diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ccd7ca90..6bbb662a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/angular.json b/angular.json index ee8651c24..d6c8c04fb 100644 --- a/angular.json +++ b/angular.json @@ -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 } } diff --git a/apps/api/src/app/access/access.controller.ts b/apps/api/src/app/access/access.controller.ts index 2bbc32f38..7dded5328 100644 --- a/apps/api/src/app/access/access.controller.ts +++ b/apps/api/src/app/access/access.controller.ts @@ -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'; diff --git a/apps/api/src/app/access/access.service.ts b/apps/api/src/app/access/access.service.ts index 93448d15c..74a81de0d 100644 --- a/apps/api/src/app/access/access.service.ts +++ b/apps/api/src/app/access/access.service.ts @@ -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'; diff --git a/apps/api/src/app/account/account.controller.ts b/apps/api/src/app/account/account.controller.ts index 8595daaa1..3757d216d 100644 --- a/apps/api/src/app/account/account.controller.ts +++ b/apps/api/src/app/account/account.controller.ts @@ -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, diff --git a/apps/api/src/app/admin/admin.controller.ts b/apps/api/src/app/admin/admin.controller.ts index 93dc8f647..6593bf68d 100644 --- a/apps/api/src/app/admin/admin.controller.ts +++ b/apps/api/src/app/admin/admin.controller.ts @@ -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, diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 718ab8e34..1437a0244 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -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'; diff --git a/apps/api/src/app/cache/cache.controller.ts b/apps/api/src/app/cache/cache.controller.ts index 8c208a063..3e7fdbc76 100644 --- a/apps/api/src/app/cache/cache.controller.ts +++ b/apps/api/src/app/cache/cache.controller.ts @@ -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'; diff --git a/apps/api/src/app/experimental/experimental.controller.ts b/apps/api/src/app/experimental/experimental.controller.ts index 0e82fa9b4..cdddcee4e 100644 --- a/apps/api/src/app/experimental/experimental.controller.ts +++ b/apps/api/src/app/experimental/experimental.controller.ts @@ -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, diff --git a/apps/api/src/app/experimental/experimental.service.ts b/apps/api/src/app/experimental/experimental.service.ts index 7f4e815f8..acc3e8d54 100644 --- a/apps/api/src/app/experimental/experimental.service.ts +++ b/apps/api/src/app/experimental/experimental.service.ts @@ -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'; diff --git a/apps/api/src/app/info/info.controller.ts b/apps/api/src/app/info/info.controller.ts index 984136bdd..82520f2e7 100644 --- a/apps/api/src/app/info/info.controller.ts +++ b/apps/api/src/app/info/info.controller.ts @@ -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'; diff --git a/apps/api/src/app/info/info.service.ts b/apps/api/src/app/info/info.service.ts index e4a204d41..13fad7c27 100644 --- a/apps/api/src/app/info/info.service.ts +++ b/apps/api/src/app/info/info.service.ts @@ -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'; diff --git a/apps/api/src/app/order/order.controller.ts b/apps/api/src/app/order/order.controller.ts index 5c6f5fcf3..379eb4c11 100644 --- a/apps/api/src/app/order/order.controller.ts +++ b/apps/api/src/app/order/order.controller.ts @@ -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, diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index 73be22f3c..5f772375b 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -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'; diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 0ee656d8a..8c957fe70 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -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, diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 949446751..6ce441907 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -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 { diff --git a/apps/api/src/app/symbol/symbol.controller.ts b/apps/api/src/app/symbol/symbol.controller.ts index b9b6e74c6..33a22286e 100644 --- a/apps/api/src/app/symbol/symbol.controller.ts +++ b/apps/api/src/app/symbol/symbol.controller.ts @@ -1,4 +1,4 @@ -import { RequestWithUser } from '@ghostfolio/helper/types'; +import { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Get, diff --git a/apps/api/src/app/user/user.controller.ts b/apps/api/src/app/user/user.controller.ts index c794c2d44..6b11c064e 100644 --- a/apps/api/src/app/user/user.controller.ts +++ b/apps/api/src/app/user/user.controller.ts @@ -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, diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index 23880bdb9..f1994fffe 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -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'; diff --git a/apps/api/src/models/interfaces/portfolio.interface.ts b/apps/api/src/models/interfaces/portfolio.interface.ts index 269300bd9..9e958272c 100644 --- a/apps/api/src/models/interfaces/portfolio.interface.ts +++ b/apps/api/src/models/interfaces/portfolio.interface.ts @@ -1,4 +1,4 @@ -import { PortfolioItem, Position } from '@ghostfolio/helper/interfaces'; +import { PortfolioItem, Position } from '@ghostfolio/common/interfaces'; import { Order } from '../order'; diff --git a/apps/api/src/models/interfaces/rule.interface.ts b/apps/api/src/models/interfaces/rule.interface.ts index 6c448a263..515730694 100644 --- a/apps/api/src/models/interfaces/rule.interface.ts +++ b/apps/api/src/models/interfaces/rule.interface.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; +import { PortfolioPosition } from '@ghostfolio/common/interfaces'; import { EvaluationResult } from './evaluation-result.interface'; diff --git a/apps/api/src/models/portfolio.spec.ts b/apps/api/src/models/portfolio.spec.ts index 97b182c9a..e4e4ecf9b 100644 --- a/apps/api/src/models/portfolio.spec.ts +++ b/apps/api/src/models/portfolio.spec.ts @@ -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'; diff --git a/apps/api/src/models/portfolio.ts b/apps/api/src/models/portfolio.ts index f2e00e846..4bea0ac2a 100644 --- a/apps/api/src/models/portfolio.ts +++ b/apps/api/src/models/portfolio.ts @@ -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, diff --git a/apps/api/src/models/rule.ts b/apps/api/src/models/rule.ts index 2b0a30702..5e9194a1a 100644 --- a/apps/api/src/models/rule.ts +++ b/apps/api/src/models/rule.ts @@ -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'; diff --git a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts index f495630ed..d30957315 100644 --- a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts @@ -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'; diff --git a/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts b/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts index 668d27aa8..50ab10bec 100644 --- a/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts +++ b/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts @@ -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'; diff --git a/apps/api/src/models/rules/account-cluster-risk/single-account.ts b/apps/api/src/models/rules/account-cluster-risk/single-account.ts index 835385f78..011906270 100644 --- a/apps/api/src/models/rules/account-cluster-risk/single-account.ts +++ b/apps/api/src/models/rules/account-cluster-risk/single-account.ts @@ -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'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts index 5936828ac..a09e57c95 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts @@ -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'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts index e4aaaf60b..dfc8fd5d0 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts @@ -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'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts index 4a7935596..305b5e59e 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts @@ -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'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts index bdb0e7e71..70778cfea 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts @@ -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'; diff --git a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts index cc63a0fb9..9d8bd1be2 100644 --- a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts +++ b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts @@ -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'; diff --git a/apps/api/src/services/data-gathering.service.ts b/apps/api/src/services/data-gathering.service.ts index 8b4fa1312..df84076ab 100644 --- a/apps/api/src/services/data-gathering.service.ts +++ b/apps/api/src/services/data-gathering.service.ts @@ -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, diff --git a/apps/api/src/services/data-provider.service.ts b/apps/api/src/services/data-provider.service.ts index 8490eb624..e5d82a7a1 100644 --- a/apps/api/src/services/data-provider.service.ts +++ b/apps/api/src/services/data-provider.service.ts @@ -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'; diff --git a/apps/api/src/services/data-provider/alpha-vantage/alpha-vantage.service.ts b/apps/api/src/services/data-provider/alpha-vantage/alpha-vantage.service.ts index ad7e05f99..696aee3c4 100644 --- a/apps/api/src/services/data-provider/alpha-vantage/alpha-vantage.service.ts +++ b/apps/api/src/services/data-provider/alpha-vantage/alpha-vantage.service.ts @@ -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'; diff --git a/apps/api/src/services/data-provider/ghostfolio-scraper-api/ghostfolio-scraper-api.service.ts b/apps/api/src/services/data-provider/ghostfolio-scraper-api/ghostfolio-scraper-api.service.ts index d92898d8e..4568bf9a2 100644 --- a/apps/api/src/services/data-provider/ghostfolio-scraper-api/ghostfolio-scraper-api.service.ts +++ b/apps/api/src/services/data-provider/ghostfolio-scraper-api/ghostfolio-scraper-api.service.ts @@ -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'; diff --git a/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts b/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts index 2a3d67465..1d31c0298 100644 --- a/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts +++ b/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts @@ -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'; diff --git a/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts b/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts index 1b91d903c..d20446f29 100644 --- a/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts +++ b/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts @@ -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'; diff --git a/apps/api/src/services/exchange-rate-data.service.ts b/apps/api/src/services/exchange-rate-data.service.ts index 96970128c..29ea37862 100644 --- a/apps/api/src/services/exchange-rate-data.service.ts +++ b/apps/api/src/services/exchange-rate-data.service.ts @@ -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'; diff --git a/apps/api/src/services/interfaces/data-provider.interface.ts b/apps/api/src/services/interfaces/data-provider.interface.ts index d1e1b2931..c3a431dce 100644 --- a/apps/api/src/services/interfaces/data-provider.interface.ts +++ b/apps/api/src/services/interfaces/data-provider.interface.ts @@ -1,4 +1,4 @@ -import { Granularity } from '@ghostfolio/helper/types'; +import { Granularity } from '@ghostfolio/common/types'; import { IDataProviderHistoricalResponse, diff --git a/apps/api/src/services/interfaces/interfaces.ts b/apps/api/src/services/interfaces/interfaces.ts index 97678f4cc..82f1381c3 100644 --- a/apps/api/src/services/interfaces/interfaces.ts +++ b/apps/api/src/services/interfaces/interfaces.ts @@ -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'; diff --git a/apps/client/src/app/adapter/date-formats.ts b/apps/client/src/app/adapter/date-formats.ts index 62373944f..554f7c76e 100644 --- a/apps/client/src/app/adapter/date-formats.ts +++ b/apps/client/src/app/adapter/date-formats.ts @@ -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: { diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts index c2b6e74f1..6e27af9be 100644 --- a/apps/client/src/app/app.component.ts +++ b/apps/client/src/app/app.component.ts @@ -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'; diff --git a/apps/client/src/app/components/access-table/access-table.component.ts b/apps/client/src/app/components/access-table/access-table.component.ts index ab7475070..f1a844a01 100644 --- a/apps/client/src/app/components/access-table/access-table.component.ts +++ b/apps/client/src/app/components/access-table/access-table.component.ts @@ -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', diff --git a/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts b/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts index 12f5f7b3e..a024b0f51 100644 --- a/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts +++ b/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts @@ -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', diff --git a/apps/client/src/app/components/header/header.component.ts b/apps/client/src/app/components/header/header.component.ts index 7a848945f..e6113789e 100644 --- a/apps/client/src/app/components/header/header.component.ts +++ b/apps/client/src/app/components/header/header.component.ts @@ -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'; diff --git a/apps/client/src/app/components/investment-chart/investment-chart.component.ts b/apps/client/src/app/components/investment-chart/investment-chart.component.ts index 350660f9a..0ecd3a7ff 100644 --- a/apps/client/src/app/components/investment-chart/investment-chart.component.ts +++ b/apps/client/src/app/components/investment-chart/investment-chart.component.ts @@ -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, diff --git a/apps/client/src/app/components/line-chart/line-chart.component.ts b/apps/client/src/app/components/line-chart/line-chart.component.ts index c5e8ea0a0..e5f5fbe45 100644 --- a/apps/client/src/app/components/line-chart/line-chart.component.ts +++ b/apps/client/src/app/components/line-chart/line-chart.component.ts @@ -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, diff --git a/apps/client/src/app/components/portfolio-overview/portfolio-overview.component.ts b/apps/client/src/app/components/portfolio-overview/portfolio-overview.component.ts index d8f34c84e..d8f2c86d5 100644 --- a/apps/client/src/app/components/portfolio-overview/portfolio-overview.component.ts +++ b/apps/client/src/app/components/portfolio-overview/portfolio-overview.component.ts @@ -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({ diff --git a/apps/client/src/app/components/portfolio-performance-summary/portfolio-performance-summary.component.ts b/apps/client/src/app/components/portfolio-performance-summary/portfolio-performance-summary.component.ts index f26525f56..580f48147 100644 --- a/apps/client/src/app/components/portfolio-performance-summary/portfolio-performance-summary.component.ts +++ b/apps/client/src/app/components/portfolio-performance-summary/portfolio-performance-summary.component.ts @@ -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'; diff --git a/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts b/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts index 609245e4d..735bfbd19 100644 --- a/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts +++ b/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts @@ -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({ diff --git a/apps/client/src/app/components/portfolio-positions-chart/portfolio-positions-chart.component.ts b/apps/client/src/app/components/portfolio-positions-chart/portfolio-positions-chart.component.ts index 8777f9410..42e36e228 100644 --- a/apps/client/src/app/components/portfolio-positions-chart/portfolio-positions-chart.component.ts +++ b/apps/client/src/app/components/portfolio-positions-chart/portfolio-positions-chart.component.ts @@ -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({ diff --git a/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts index f46ca0ed0..152a83ca3 100644 --- a/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts +++ b/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts @@ -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'; diff --git a/apps/client/src/app/components/position/position.component.ts b/apps/client/src/app/components/position/position.component.ts index 7c14a73af..974101cef 100644 --- a/apps/client/src/app/components/position/position.component.ts +++ b/apps/client/src/app/components/position/position.component.ts @@ -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'; diff --git a/apps/client/src/app/components/positions-table/positions-table.component.ts b/apps/client/src/app/components/positions-table/positions-table.component.ts index 12655b396..e990366a7 100644 --- a/apps/client/src/app/components/positions-table/positions-table.component.ts +++ b/apps/client/src/app/components/positions-table/positions-table.component.ts @@ -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'; diff --git a/apps/client/src/app/components/positions/positions.component.ts b/apps/client/src/app/components/positions/positions.component.ts index 8bcc8addd..da31ba614 100644 --- a/apps/client/src/app/components/positions/positions.component.ts +++ b/apps/client/src/app/components/positions/positions.component.ts @@ -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', diff --git a/apps/client/src/app/components/rule/rule.component.ts b/apps/client/src/app/components/rule/rule.component.ts index 941bf2070..0e61caef2 100644 --- a/apps/client/src/app/components/rule/rule.component.ts +++ b/apps/client/src/app/components/rule/rule.component.ts @@ -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', diff --git a/apps/client/src/app/components/rules/rules.component.ts b/apps/client/src/app/components/rules/rules.component.ts index c77642484..0043be1ab 100644 --- a/apps/client/src/app/components/rules/rules.component.ts +++ b/apps/client/src/app/components/rules/rules.component.ts @@ -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', diff --git a/apps/client/src/app/components/transactions-table/transactions-table.component.ts b/apps/client/src/app/components/transactions-table/transactions-table.component.ts index d7008d6a8..072b844e9 100644 --- a/apps/client/src/app/components/transactions-table/transactions-table.component.ts +++ b/apps/client/src/app/components/transactions-table/transactions-table.component.ts @@ -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'; diff --git a/apps/client/src/app/components/value/value.component.ts b/apps/client/src/app/components/value/value.component.ts index 0ff93735d..863ec9806 100644 --- a/apps/client/src/app/components/value/value.component.ts +++ b/apps/client/src/app/components/value/value.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/about/about-page.component.ts b/apps/client/src/app/pages/about/about-page.component.ts index eddb2f620..78cb264ae 100644 --- a/apps/client/src/app/pages/about/about-page.component.ts +++ b/apps/client/src/app/pages/about/about-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/account/account-page.component.ts b/apps/client/src/app/pages/account/account-page.component.ts index 9b6c908a8..d933691b1 100644 --- a/apps/client/src/app/pages/account/account-page.component.ts +++ b/apps/client/src/app/pages/account/account-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/accounts/accounts-page.component.ts b/apps/client/src/app/pages/accounts/accounts-page.component.ts index fe4d2f11a..ad4604e24 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.component.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/admin/admin-page.component.ts b/apps/client/src/app/pages/admin/admin-page.component.ts index 7dcad34c6..ade728f03 100644 --- a/apps/client/src/app/pages/admin/admin-page.component.ts +++ b/apps/client/src/app/pages/admin/admin-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/analysis/analysis-page.component.ts b/apps/client/src/app/pages/analysis/analysis-page.component.ts index 8b1cf2ae5..bd704ecd9 100644 --- a/apps/client/src/app/pages/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/analysis/analysis-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/home/home-page.component.ts b/apps/client/src/app/pages/home/home-page.component.ts index afe0500ee..d67481c9d 100644 --- a/apps/client/src/app/pages/home/home-page.component.ts +++ b/apps/client/src/app/pages/home/home-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/pricing/pricing-page.component.ts b/apps/client/src/app/pages/pricing/pricing-page.component.ts index 525682b4a..18915d265 100644 --- a/apps/client/src/app/pages/pricing/pricing-page.component.ts +++ b/apps/client/src/app/pages/pricing/pricing-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/report/report-page.component.ts b/apps/client/src/app/pages/report/report-page.component.ts index aa71391f2..4f6e3d0e4 100644 --- a/apps/client/src/app/pages/report/report-page.component.ts +++ b/apps/client/src/app/pages/report/report-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pages/transactions/transactions-page.component.ts b/apps/client/src/app/pages/transactions/transactions-page.component.ts index 593e9ecc7..369629ac7 100644 --- a/apps/client/src/app/pages/transactions/transactions-page.component.ts +++ b/apps/client/src/app/pages/transactions/transactions-page.component.ts @@ -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'; diff --git a/apps/client/src/app/pipes/symbol/symbol.pipe.ts b/apps/client/src/app/pipes/symbol/symbol.pipe.ts index 71af05ed3..940ec18e5 100644 --- a/apps/client/src/app/pipes/symbol/symbol.pipe.ts +++ b/apps/client/src/app/pipes/symbol/symbol.pipe.ts @@ -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 { diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index 68feb3841..78c0f6cb0 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -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'; diff --git a/jest.config.js b/jest.config.js index 24b94bfa0..bd2d6db5c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,6 +2,6 @@ module.exports = { projects: [ '/apps/api', '/apps/client', - '/libs/helper' + '/libs/common' ] }; diff --git a/libs/helper/.babelrc b/libs/common/.babelrc similarity index 100% rename from libs/helper/.babelrc rename to libs/common/.babelrc diff --git a/libs/helper/.eslintrc.json b/libs/common/.eslintrc.json similarity index 86% rename from libs/helper/.eslintrc.json rename to libs/common/.eslintrc.json index 54fc45563..69cfc2050 100644 --- a/libs/helper/.eslintrc.json +++ b/libs/common/.eslintrc.json @@ -5,7 +5,7 @@ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "parserOptions": { - "project": ["libs/helper/tsconfig.*?.json"] + "project": ["libs/common/tsconfig.*?.json"] }, "rules": {} }, diff --git a/libs/helper/README.md b/libs/common/README.md similarity index 52% rename from libs/helper/README.md rename to libs/common/README.md index 35029d1a8..722fbd648 100644 --- a/libs/helper/README.md +++ b/libs/common/README.md @@ -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). diff --git a/libs/helper/jest.config.js b/libs/common/jest.config.js similarity index 76% rename from libs/helper/jest.config.js rename to libs/common/jest.config.js index 1bcce708e..e969f9e29 100644 --- a/libs/helper/jest.config.js +++ b/libs/common/jest.config.js @@ -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' }; diff --git a/libs/helper/src/lib/config.ts b/libs/common/src/lib/config.ts similarity index 100% rename from libs/helper/src/lib/config.ts rename to libs/common/src/lib/config.ts diff --git a/libs/helper/src/lib/helper.ts b/libs/common/src/lib/helper.ts similarity index 100% rename from libs/helper/src/lib/helper.ts rename to libs/common/src/lib/helper.ts diff --git a/libs/helper/src/lib/interfaces/access.interface.ts b/libs/common/src/lib/interfaces/access.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/access.interface.ts rename to libs/common/src/lib/interfaces/access.interface.ts diff --git a/libs/helper/src/lib/interfaces/admin-data.interface.ts b/libs/common/src/lib/interfaces/admin-data.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/admin-data.interface.ts rename to libs/common/src/lib/interfaces/admin-data.interface.ts diff --git a/libs/helper/src/lib/interfaces/index.ts b/libs/common/src/lib/interfaces/index.ts similarity index 100% rename from libs/helper/src/lib/interfaces/index.ts rename to libs/common/src/lib/interfaces/index.ts diff --git a/libs/helper/src/lib/interfaces/info-item.interface.ts b/libs/common/src/lib/interfaces/info-item.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/info-item.interface.ts rename to libs/common/src/lib/interfaces/info-item.interface.ts diff --git a/libs/helper/src/lib/interfaces/portfolio-item.interface.ts b/libs/common/src/lib/interfaces/portfolio-item.interface.ts similarity index 74% rename from libs/helper/src/lib/interfaces/portfolio-item.interface.ts rename to libs/common/src/lib/interfaces/portfolio-item.interface.ts index 0891ad3a0..a3e42a05f 100644 --- a/libs/helper/src/lib/interfaces/portfolio-item.interface.ts +++ b/libs/common/src/lib/interfaces/portfolio-item.interface.ts @@ -1,4 +1,4 @@ -import { Position } from '@ghostfolio/helper/interfaces'; +import { Position } from '@ghostfolio/common/interfaces'; export interface PortfolioItem { date: string; diff --git a/libs/helper/src/lib/interfaces/portfolio-overview.interface.ts b/libs/common/src/lib/interfaces/portfolio-overview.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/portfolio-overview.interface.ts rename to libs/common/src/lib/interfaces/portfolio-overview.interface.ts diff --git a/libs/helper/src/lib/interfaces/portfolio-performance.interface.ts b/libs/common/src/lib/interfaces/portfolio-performance.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/portfolio-performance.interface.ts rename to libs/common/src/lib/interfaces/portfolio-performance.interface.ts diff --git a/libs/helper/src/lib/interfaces/portfolio-position.interface.ts b/libs/common/src/lib/interfaces/portfolio-position.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/portfolio-position.interface.ts rename to libs/common/src/lib/interfaces/portfolio-position.interface.ts diff --git a/libs/helper/src/lib/interfaces/portfolio-report-rule.interface.ts b/libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/portfolio-report-rule.interface.ts rename to libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts diff --git a/libs/helper/src/lib/interfaces/portfolio-report.interface.ts b/libs/common/src/lib/interfaces/portfolio-report.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/portfolio-report.interface.ts rename to libs/common/src/lib/interfaces/portfolio-report.interface.ts diff --git a/libs/helper/src/lib/interfaces/position.interface.ts b/libs/common/src/lib/interfaces/position.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/position.interface.ts rename to libs/common/src/lib/interfaces/position.interface.ts diff --git a/libs/helper/src/lib/interfaces/user-settings.interface.ts b/libs/common/src/lib/interfaces/user-settings.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/user-settings.interface.ts rename to libs/common/src/lib/interfaces/user-settings.interface.ts diff --git a/libs/helper/src/lib/interfaces/user-with-settings.ts b/libs/common/src/lib/interfaces/user-with-settings.ts similarity index 100% rename from libs/helper/src/lib/interfaces/user-with-settings.ts rename to libs/common/src/lib/interfaces/user-with-settings.ts diff --git a/libs/helper/src/lib/interfaces/user.interface.ts b/libs/common/src/lib/interfaces/user.interface.ts similarity index 100% rename from libs/helper/src/lib/interfaces/user.interface.ts rename to libs/common/src/lib/interfaces/user.interface.ts diff --git a/libs/helper/src/lib/permissions.ts b/libs/common/src/lib/permissions.ts similarity index 100% rename from libs/helper/src/lib/permissions.ts rename to libs/common/src/lib/permissions.ts diff --git a/libs/helper/src/lib/types/access-with-grantee-user.type.ts b/libs/common/src/lib/types/access-with-grantee-user.type.ts similarity index 100% rename from libs/helper/src/lib/types/access-with-grantee-user.type.ts rename to libs/common/src/lib/types/access-with-grantee-user.type.ts diff --git a/libs/helper/src/lib/types/date-range.type.ts b/libs/common/src/lib/types/date-range.type.ts similarity index 100% rename from libs/helper/src/lib/types/date-range.type.ts rename to libs/common/src/lib/types/date-range.type.ts diff --git a/libs/helper/src/lib/types/granularity.type.ts b/libs/common/src/lib/types/granularity.type.ts similarity index 100% rename from libs/helper/src/lib/types/granularity.type.ts rename to libs/common/src/lib/types/granularity.type.ts diff --git a/libs/helper/src/lib/types/index.ts b/libs/common/src/lib/types/index.ts similarity index 100% rename from libs/helper/src/lib/types/index.ts rename to libs/common/src/lib/types/index.ts diff --git a/libs/helper/src/lib/types/order-with-account.type.ts b/libs/common/src/lib/types/order-with-account.type.ts similarity index 100% rename from libs/helper/src/lib/types/order-with-account.type.ts rename to libs/common/src/lib/types/order-with-account.type.ts diff --git a/libs/helper/src/lib/types/request-with-user.type.ts b/libs/common/src/lib/types/request-with-user.type.ts similarity index 52% rename from libs/helper/src/lib/types/request-with-user.type.ts rename to libs/common/src/lib/types/request-with-user.type.ts index a58760891..a31f17f92 100644 --- a/libs/helper/src/lib/types/request-with-user.type.ts +++ b/libs/common/src/lib/types/request-with-user.type.ts @@ -1,3 +1,3 @@ -import { UserWithSettings } from '@ghostfolio/helper/interfaces'; +import { UserWithSettings } from '@ghostfolio/common/interfaces'; export type RequestWithUser = Request & { user: UserWithSettings }; diff --git a/libs/helper/tsconfig.json b/libs/common/tsconfig.json similarity index 100% rename from libs/helper/tsconfig.json rename to libs/common/tsconfig.json diff --git a/libs/helper/tsconfig.lib.json b/libs/common/tsconfig.lib.json similarity index 100% rename from libs/helper/tsconfig.lib.json rename to libs/common/tsconfig.lib.json diff --git a/libs/helper/tsconfig.spec.json b/libs/common/tsconfig.spec.json similarity index 100% rename from libs/helper/tsconfig.spec.json rename to libs/common/tsconfig.spec.json diff --git a/nx.json b/nx.json index 84f94e8e3..c48d21bb0 100644 --- a/nx.json +++ b/nx.json @@ -21,6 +21,6 @@ "tags": [], "implicitDependencies": ["client"] }, - "helper": { "tags": [] } + "common": { "tags": [] } } } diff --git a/tsconfig.base.json b/tsconfig.base.json index fac4a76af..c32fbaa1d 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,7 +18,7 @@ "paths": { "@ghostfolio/api/*": ["apps/api/src/*"], "@ghostfolio/client/*": ["apps/client/src/app/*"], - "@ghostfolio/helper/*": ["libs/helper/src/lib/*"] + "@ghostfolio/common/*": ["libs/common/src/lib/*"] } }, "exclude": ["node_modules", "tmp"]