Introduce @ghostfolio/common lib (#102)

pull/104/head
Thomas 4 years ago committed by GitHub
parent 561d8dbc70
commit abd0e08566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,8 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed _Ghostfolio Account_ to _My Ghostfolio_
- Hid unknown exchange in the position overview
- Refactored the portfolio unit tests to work without database
- Moved shared interfaces to `@ghostfolio/helper/interfaces`
- Moved shared types to `@ghostfolio/helper/types`
- Renamed shared helper to `@ghostfolio/common/helper`
- Moved shared interfaces to `@ghostfolio/common/interfaces`
- Moved shared types to `@ghostfolio/common/types`
## 1.3.0 - 15.05.2021

@ -208,22 +208,22 @@
}
}
},
"helper": {
"root": "libs/helper",
"sourceRoot": "libs/helper/src",
"common": {
"root": "libs/common",
"sourceRoot": "libs/common/src",
"projectType": "library",
"architect": {
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["libs/helper/**/*.ts"]
"lintFilePatterns": ["libs/common/**/*.ts"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"outputs": ["coverage/libs/helper"],
"outputs": ["coverage/libs/common"],
"options": {
"jestConfig": "libs/helper/jest.config.js",
"jestConfig": "libs/common/jest.config.js",
"passWithNoTests": true
}
}

@ -1,5 +1,5 @@
import { Access } from '@ghostfolio/helper/interfaces';
import { RequestWithUser } from '@ghostfolio/helper/types';
import { Access } from '@ghostfolio/common/interfaces';
import { RequestWithUser } from '@ghostfolio/common/types';
import { Controller, Get, Inject, UseGuards } from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
import { AuthGuard } from '@nestjs/passport';

@ -1,5 +1,5 @@
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { AccessWithGranteeUser } from '@ghostfolio/helper/types';
import { AccessWithGranteeUser } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { Prisma } from '@prisma/client';

@ -4,8 +4,8 @@ import {
getPermissions,
hasPermission,
permissions
} from '@ghostfolio/helper/permissions';
import { RequestWithUser } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/permissions';
import { RequestWithUser } from '@ghostfolio/common/types';
import {
Body,
Controller,

@ -1,11 +1,11 @@
import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service';
import { AdminData } from '@ghostfolio/helper/interfaces';
import { AdminData } from '@ghostfolio/common/interfaces';
import {
getPermissions,
hasPermission,
permissions
} from '@ghostfolio/helper/permissions';
import { RequestWithUser } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/permissions';
import { RequestWithUser } from '@ghostfolio/common/types';
import {
Controller,
Get,

@ -1,6 +1,6 @@
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { AdminData } from '@ghostfolio/helper/interfaces';
import { AdminData } from '@ghostfolio/common/interfaces';
import { Injectable } from '@nestjs/common';
import { Currency } from '@prisma/client';

@ -1,4 +1,4 @@
import { RequestWithUser } from '@ghostfolio/helper/types';
import { RequestWithUser } from '@ghostfolio/common/types';
import { Controller, Inject, Post, UseGuards } from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
import { AuthGuard } from '@nestjs/passport';

@ -1,6 +1,6 @@
import { baseCurrency, benchmarks } from '@ghostfolio/helper/config';
import { isApiTokenAuthorized } from '@ghostfolio/helper/permissions';
import { RequestWithUser } from '@ghostfolio/helper/types';
import { baseCurrency, benchmarks } from '@ghostfolio/common/config';
import { isApiTokenAuthorized } from '@ghostfolio/common/permissions';
import { RequestWithUser } from '@ghostfolio/common/types';
import {
Body,
Controller,

@ -3,7 +3,7 @@ import { DataProviderService } from '@ghostfolio/api/services/data-provider.serv
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { RulesService } from '@ghostfolio/api/services/rules.service';
import { OrderWithAccount } from '@ghostfolio/helper/types';
import { OrderWithAccount } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { Currency, Type } from '@prisma/client';
import { parseISO } from 'date-fns';

@ -1,4 +1,4 @@
import { InfoItem } from '@ghostfolio/helper/interfaces';
import { InfoItem } from '@ghostfolio/common/interfaces';
import { Controller, Get } from '@nestjs/common';
import { InfoService } from './info.service';

@ -1,7 +1,7 @@
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { InfoItem } from '@ghostfolio/helper/interfaces';
import { permissions } from '@ghostfolio/helper/permissions';
import { InfoItem } from '@ghostfolio/common/interfaces';
import { permissions } from '@ghostfolio/common/permissions';
import { Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { Currency } from '@prisma/client';

@ -4,8 +4,8 @@ import {
getPermissions,
hasPermission,
permissions
} from '@ghostfolio/helper/permissions';
import { RequestWithUser } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/permissions';
import { RequestWithUser } from '@ghostfolio/common/types';
import {
Body,
Controller,

@ -1,6 +1,6 @@
import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { OrderWithAccount } from '@ghostfolio/helper/types';
import { OrderWithAccount } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { Order, Prisma } from '@prisma/client';

@ -10,13 +10,13 @@ import {
PortfolioPerformance,
PortfolioPosition,
PortfolioReport
} from '@ghostfolio/helper/interfaces';
} from '@ghostfolio/common/interfaces';
import {
getPermissions,
hasPermission,
permissions
} from '@ghostfolio/helper/permissions';
import { RequestWithUser } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/permissions';
import { RequestWithUser } from '@ghostfolio/common/types';
import {
Controller,
Get,

@ -7,8 +7,8 @@ import { RulesService } from '@ghostfolio/api/services/rules.service';
import {
PortfolioItem,
PortfolioOverview
} from '@ghostfolio/helper/interfaces';
import { DateRange, RequestWithUser } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/interfaces';
import { DateRange, RequestWithUser } from '@ghostfolio/common/types';
import { Inject, Injectable } from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
import {

@ -1,4 +1,4 @@
import { RequestWithUser } from '@ghostfolio/helper/types';
import { RequestWithUser } from '@ghostfolio/common/types';
import {
Controller,
Get,

@ -1,10 +1,10 @@
import { User } from '@ghostfolio/helper/interfaces';
import { User } from '@ghostfolio/common/interfaces';
import {
getPermissions,
hasPermission,
permissions
} from '@ghostfolio/helper/permissions';
import { RequestWithUser } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/permissions';
import { RequestWithUser } from '@ghostfolio/common/types';
import {
Body,
Controller,

@ -1,9 +1,9 @@
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { locale } from '@ghostfolio/helper/config';
import { resetHours } from '@ghostfolio/helper/helper';
import { User as IUser, UserWithSettings } from '@ghostfolio/helper/interfaces';
import { getPermissions, permissions } from '@ghostfolio/helper/permissions';
import { locale } from '@ghostfolio/common/config';
import { resetHours } from '@ghostfolio/common/helper';
import { User as IUser, UserWithSettings } from '@ghostfolio/common/interfaces';
import { getPermissions, permissions } from '@ghostfolio/common/permissions';
import { Injectable } from '@nestjs/common';
import { Currency, Prisma, Provider, User } from '@prisma/client';
import { add } from 'date-fns';

@ -1,4 +1,4 @@
import { PortfolioItem, Position } from '@ghostfolio/helper/interfaces';
import { PortfolioItem, Position } from '@ghostfolio/common/interfaces';
import { Order } from '../order';

@ -1,4 +1,4 @@
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { EvaluationResult } from './evaluation-result.interface';

@ -1,5 +1,5 @@
import { UNKNOWN_KEY, baseCurrency } from '@ghostfolio/helper/config';
import { getUtc, getYesterday } from '@ghostfolio/helper/helper';
import { UNKNOWN_KEY, baseCurrency } from '@ghostfolio/common/config';
import { getUtc, getYesterday } from '@ghostfolio/common/helper';
import { AccountType, Currency, DataSource, Role, Type } from '@prisma/client';
import { format } from 'date-fns';

@ -1,5 +1,5 @@
import { UNKNOWN_KEY } from '@ghostfolio/helper/config';
import { getToday, getYesterday, resetHours } from '@ghostfolio/helper/helper';
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import { getToday, getYesterday, resetHours } from '@ghostfolio/common/helper';
import {
PortfolioItem,
PortfolioPerformance,
@ -7,8 +7,8 @@ import {
PortfolioReport,
Position,
UserWithSettings
} from '@ghostfolio/helper/interfaces';
import { DateRange, OrderWithAccount } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/interfaces';
import { DateRange, OrderWithAccount } from '@ghostfolio/common/types';
import {
add,
format,

@ -1,5 +1,5 @@
import { groupBy } from '@ghostfolio/helper/helper';
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { groupBy } from '@ghostfolio/common/helper';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { Currency } from '@prisma/client';
import { ExchangeRateDataService } from '../services/exchange-rate-data.service';

@ -1,5 +1,5 @@
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { Rule } from '../../rule';

@ -1,4 +1,4 @@
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule';

@ -1,4 +1,4 @@
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule';

@ -1,5 +1,5 @@
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { Rule } from '../../rule';

@ -1,4 +1,4 @@
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule';

@ -1,4 +1,4 @@
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule';

@ -1,4 +1,4 @@
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule';

@ -1,4 +1,4 @@
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule';

@ -1,9 +1,9 @@
import { benchmarks, currencyPairs } from '@ghostfolio/helper/config';
import { benchmarks, currencyPairs } from '@ghostfolio/common/config';
import {
getUtc,
isGhostfolioScraperApiSymbol,
resetHours
} from '@ghostfolio/helper/helper';
} from '@ghostfolio/common/helper';
import { Injectable } from '@nestjs/common';
import {
differenceInHours,

@ -2,8 +2,8 @@ import {
isCrypto,
isGhostfolioScraperApiSymbol,
isRakutenRapidApiSymbol
} from '@ghostfolio/helper/helper';
import { Granularity } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/helper';
import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { MarketData } from '@prisma/client';
import { format } from 'date-fns';

@ -1,4 +1,4 @@
import { Granularity } from '@ghostfolio/helper/types';
import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { isAfter, isBefore, parse } from 'date-fns';

@ -1,5 +1,5 @@
import { getYesterday } from '@ghostfolio/helper/helper';
import { Granularity } from '@ghostfolio/helper/types';
import { getYesterday } from '@ghostfolio/common/helper';
import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { DataSource } from '@prisma/client';
import * as bent from 'bent';

@ -1,5 +1,5 @@
import { getToday, getYesterday } from '@ghostfolio/helper/helper';
import { Granularity } from '@ghostfolio/helper/types';
import { getToday, getYesterday } from '@ghostfolio/common/helper';
import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { DataSource } from '@prisma/client';
import * as bent from 'bent';

@ -1,6 +1,6 @@
import { UNKNOWN_KEY } from '@ghostfolio/helper/config';
import { isCrypto, isCurrency, parseCurrency } from '@ghostfolio/helper/helper';
import { Granularity } from '@ghostfolio/helper/types';
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import { isCrypto, isCurrency, parseCurrency } from '@ghostfolio/common/helper';
import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { DataSource } from '@prisma/client';
import { format } from 'date-fns';

@ -1,4 +1,4 @@
import { getYesterday } from '@ghostfolio/helper/helper';
import { getYesterday } from '@ghostfolio/common/helper';
import { Injectable } from '@nestjs/common';
import { Currency } from '@prisma/client';
import { format } from 'date-fns';

@ -1,4 +1,4 @@
import { Granularity } from '@ghostfolio/helper/types';
import { Granularity } from '@ghostfolio/common/types';
import {
IDataProviderHistoricalResponse,

@ -1,4 +1,4 @@
import { UNKNOWN_KEY } from '@ghostfolio/helper/config';
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import { Account, Currency, DataSource } from '@prisma/client';
import { OrderType } from '../../models/order-type';

@ -1,7 +1,7 @@
import {
DEFAULT_DATE_FORMAT,
DEFAULT_DATE_FORMAT_MONTH_YEAR
} from '@ghostfolio/helper/config';
} from '@ghostfolio/common/config';
export const DateFormats = {
display: {

@ -6,9 +6,9 @@ import {
OnInit
} from '@angular/core';
import { NavigationEnd, PRIMARY_OUTLET, Router } from '@angular/router';
import { primaryColorHex, secondaryColorHex } from '@ghostfolio/helper/config';
import { InfoItem, User } from '@ghostfolio/helper/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions';
import { primaryColorHex, secondaryColorHex } from '@ghostfolio/common/config';
import { InfoItem, User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { MaterialCssVarsService } from 'angular-material-css-vars';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';

@ -6,7 +6,7 @@ import {
OnInit
} from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import { Access } from '@ghostfolio/helper/interfaces';
import { Access } from '@ghostfolio/common/interfaces';
@Component({
selector: 'gf-access-table',

@ -5,7 +5,7 @@ import {
OnChanges,
OnInit
} from '@angular/core';
import { resolveFearAndGreedIndex } from '@ghostfolio/helper/helper';
import { resolveFearAndGreedIndex } from '@ghostfolio/common/helper';
@Component({
selector: 'gf-fear-and-greed-index',

@ -10,8 +10,8 @@ import { LoginWithAccessTokenDialog } from '@ghostfolio/client/pages/login/login
import { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { InfoItem, User } from '@ghostfolio/helper/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions';
import { InfoItem, User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { EMPTY, Subject } from 'rxjs';
import { catchError, takeUntil } from 'rxjs/operators';

@ -9,8 +9,8 @@ import {
OnInit,
ViewChild
} from '@angular/core';
import { primaryColorRgb } from '@ghostfolio/helper/config';
import { PortfolioItem } from '@ghostfolio/helper/interfaces';
import { primaryColorRgb } from '@ghostfolio/common/config';
import { PortfolioItem } from '@ghostfolio/common/interfaces';
import {
LineController,
LineElement,

@ -9,8 +9,8 @@ import {
OnInit,
ViewChild
} from '@angular/core';
import { primaryColorRgb, secondaryColorRgb } from '@ghostfolio/helper/config';
import { getBackgroundColor } from '@ghostfolio/helper/helper';
import { primaryColorRgb, secondaryColorRgb } from '@ghostfolio/common/config';
import { getBackgroundColor } from '@ghostfolio/common/helper';
import {
Chart,
Filler,

@ -5,7 +5,7 @@ import {
OnChanges,
OnInit
} from '@angular/core';
import { PortfolioOverview } from '@ghostfolio/helper/interfaces';
import { PortfolioOverview } from '@ghostfolio/common/interfaces';
import { Currency } from '@prisma/client';
@Component({

@ -7,7 +7,7 @@ import {
OnInit,
ViewChild
} from '@angular/core';
import { PortfolioPerformance } from '@ghostfolio/helper/interfaces';
import { PortfolioPerformance } from '@ghostfolio/common/interfaces';
import { Currency } from '@prisma/client';
import { CountUp } from 'countup.js';
import { isNumber } from 'lodash';

@ -4,7 +4,7 @@ import {
Input,
OnInit
} from '@angular/core';
import { PortfolioPerformance } from '@ghostfolio/helper/interfaces';
import { PortfolioPerformance } from '@ghostfolio/common/interfaces';
import { Currency } from '@prisma/client';
@Component({

@ -7,7 +7,7 @@ import {
OnChanges,
OnInit
} from '@angular/core';
import { PortfolioItem } from '@ghostfolio/helper/interfaces';
import { PortfolioItem } from '@ghostfolio/common/interfaces';
import { endOfDay, parseISO, startOfDay } from 'date-fns';
@Component({

@ -7,9 +7,9 @@ import {
OnInit,
ViewChild
} from '@angular/core';
import { UNKNOWN_KEY } from '@ghostfolio/helper/config';
import { getCssVariable, getTextColor } from '@ghostfolio/helper/helper';
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import { getCssVariable, getTextColor } from '@ghostfolio/common/helper';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { Currency } from '@prisma/client';
import { Tooltip } from 'chart.js';
import { LinearScale } from 'chart.js';

@ -7,8 +7,8 @@ import {
} from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { UNKNOWN_KEY } from '@ghostfolio/helper/config';
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -13,7 +13,7 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Router } from '@angular/router';
import { PortfolioPosition } from '@ghostfolio/helper/interfaces';
import { PortfolioPosition } from '@ghostfolio/common/interfaces';
import { Order as OrderModel } from '@prisma/client';
import { Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -6,7 +6,7 @@ import {
OnInit
} from '@angular/core';
import { MarketState } from '@ghostfolio/api/services/interfaces/interfaces';
import { PortfolioPosition } from '@ghostfolio/helper/interfaces/portfolio-position.interface';
import { PortfolioPosition } from '@ghostfolio/common/interfaces/portfolio-position.interface';
@Component({
selector: 'gf-positions',

@ -4,7 +4,7 @@ import {
Input,
OnInit
} from '@angular/core';
import { PortfolioReportRule } from '@ghostfolio/helper/interfaces';
import { PortfolioReportRule } from '@ghostfolio/common/interfaces';
@Component({
selector: 'gf-rule',

@ -1,5 +1,5 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { PortfolioReportRule } from '@ghostfolio/helper/interfaces';
import { PortfolioReportRule } from '@ghostfolio/common/interfaces';
@Component({
selector: 'gf-rules',

@ -21,8 +21,8 @@ import { MatDialog } from '@angular/material/dialog';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Router } from '@angular/router';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config';
import { OrderWithAccount } from '@ghostfolio/helper/types';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { OrderWithAccount } from '@ghostfolio/common/types';
import { format } from 'date-fns';
import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -5,7 +5,7 @@ import {
OnChanges,
OnInit
} from '@angular/core';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { format, isDate } from 'date-fns';
import { isNumber } from 'lodash';

@ -1,8 +1,8 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { baseCurrency } from '@ghostfolio/helper/config';
import { User } from '@ghostfolio/helper/interfaces';
import { baseCurrency } from '@ghostfolio/common/config';
import { User } from '@ghostfolio/common/interfaces';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -1,9 +1,9 @@
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config';
import { Access, User } from '@ghostfolio/helper/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { Access, User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Currency } from '@prisma/client';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -6,8 +6,8 @@ import { UpdateAccountDto } from '@ghostfolio/api/app/account/update-account.dto
import { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { User } from '@ghostfolio/helper/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions';
import { User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Account as AccountModel, AccountType } from '@prisma/client';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, Subscription } from 'rxjs';

@ -3,8 +3,8 @@ import { AdminService } from '@ghostfolio/client/services/admin.service';
import { CacheService } from '@ghostfolio/client/services/cache.service';
import { DataService } from '@ghostfolio/client/services/data.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config';
import { AdminData, User } from '@ghostfolio/helper/interfaces';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { AdminData, User } from '@ghostfolio/common/interfaces';
import { formatDistanceToNow, isValid, parseISO, sub } from 'date-fns';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -7,7 +7,7 @@ import {
PortfolioItem,
PortfolioPosition,
User
} from '@ghostfolio/helper/interfaces';
} from '@ghostfolio/common/interfaces';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -16,9 +16,9 @@ import {
PortfolioPerformance,
PortfolioPosition,
User
} from '@ghostfolio/helper/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions';
import { DateRange } from '@ghostfolio/helper/types';
} from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { DateRange } from '@ghostfolio/common/types';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -1,8 +1,8 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { baseCurrency } from '@ghostfolio/helper/config';
import { User } from '@ghostfolio/helper/interfaces';
import { baseCurrency } from '@ghostfolio/common/config';
import { User } from '@ghostfolio/common/interfaces';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -1,6 +1,6 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service';
import { PortfolioReportRule } from '@ghostfolio/helper/interfaces';
import { PortfolioReportRule } from '@ghostfolio/common/interfaces';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

@ -6,8 +6,8 @@ import { UpdateOrderDto } from '@ghostfolio/api/app/order/update-order.dto';
import { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { User } from '@ghostfolio/helper/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions';
import { User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Order as OrderModel } from '@prisma/client';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, Subscription } from 'rxjs';

@ -1,5 +1,5 @@
import { Pipe, PipeTransform } from '@angular/core';
import { ghostfolioScraperApiSymbolPrefix } from '@ghostfolio/helper/config';
import { ghostfolioScraperApiSymbolPrefix } from '@ghostfolio/common/config';
@Pipe({ name: 'gfSymbol' })
export class SymbolPipe implements PipeTransform {

@ -1,5 +1,3 @@
import {} from '@ghostfolio/helper/interfaces';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto';
@ -24,7 +22,7 @@ import {
PortfolioPosition,
PortfolioReport,
User
} from '@ghostfolio/helper/interfaces';
} from '@ghostfolio/common/interfaces';
import { Order as OrderModel } from '@prisma/client';
import { Account as AccountModel } from '@prisma/client';
import { parseISO } from 'date-fns';

@ -2,6 +2,6 @@ module.exports = {
projects: [
'<rootDir>/apps/api',
'<rootDir>/apps/client',
'<rootDir>/libs/helper'
'<rootDir>/libs/common'
]
};

@ -5,7 +5,7 @@
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["libs/helper/tsconfig.*?.json"]
"project": ["libs/common/tsconfig.*?.json"]
},
"rules": {}
},

@ -1,7 +1,7 @@
# helper
# @ghostfolio/common
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test helper` to execute the unit tests via [Jest](https://jestjs.io).
Run `nx test common` to execute the unit tests via [Jest](https://jestjs.io).

@ -1,5 +1,5 @@
module.exports = {
displayName: 'helper',
displayName: 'common',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
@ -10,5 +10,5 @@ module.exports = {
'^.+\\.[tj]sx?$': 'ts-jest'
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/helper'
coverageDirectory: '../../coverage/libs/common'
};

@ -1,4 +1,4 @@
import { Position } from '@ghostfolio/helper/interfaces';
import { Position } from '@ghostfolio/common/interfaces';
export interface PortfolioItem {
date: string;

@ -1,3 +1,3 @@
import { UserWithSettings } from '@ghostfolio/helper/interfaces';
import { UserWithSettings } from '@ghostfolio/common/interfaces';
export type RequestWithUser = Request & { user: UserWithSettings };

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save