Browse Source

Introduce @ghostfolio/common lib (#102)

pull/104/head
Thomas 4 years ago
committed by GitHub
parent
commit
abd0e08566
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CHANGELOG.md
  2. 12
      angular.json
  3. 4
      apps/api/src/app/access/access.controller.ts
  4. 2
      apps/api/src/app/access/access.service.ts
  5. 4
      apps/api/src/app/account/account.controller.ts
  6. 6
      apps/api/src/app/admin/admin.controller.ts
  7. 2
      apps/api/src/app/admin/admin.service.ts
  8. 2
      apps/api/src/app/cache/cache.controller.ts
  9. 6
      apps/api/src/app/experimental/experimental.controller.ts
  10. 2
      apps/api/src/app/experimental/experimental.service.ts
  11. 2
      apps/api/src/app/info/info.controller.ts
  12. 4
      apps/api/src/app/info/info.service.ts
  13. 4
      apps/api/src/app/order/order.controller.ts
  14. 2
      apps/api/src/app/order/order.service.ts
  15. 6
      apps/api/src/app/portfolio/portfolio.controller.ts
  16. 4
      apps/api/src/app/portfolio/portfolio.service.ts
  17. 2
      apps/api/src/app/symbol/symbol.controller.ts
  18. 6
      apps/api/src/app/user/user.controller.ts
  19. 8
      apps/api/src/app/user/user.service.ts
  20. 2
      apps/api/src/models/interfaces/portfolio.interface.ts
  21. 2
      apps/api/src/models/interfaces/rule.interface.ts
  22. 4
      apps/api/src/models/portfolio.spec.ts
  23. 8
      apps/api/src/models/portfolio.ts
  24. 4
      apps/api/src/models/rule.ts
  25. 2
      apps/api/src/models/rules/account-cluster-risk/current-investment.ts
  26. 2
      apps/api/src/models/rules/account-cluster-risk/initial-investment.ts
  27. 2
      apps/api/src/models/rules/account-cluster-risk/single-account.ts
  28. 2
      apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts
  29. 2
      apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts
  30. 2
      apps/api/src/models/rules/currency-cluster-risk/current-investment.ts
  31. 2
      apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts
  32. 2
      apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts
  33. 4
      apps/api/src/services/data-gathering.service.ts
  34. 4
      apps/api/src/services/data-provider.service.ts
  35. 2
      apps/api/src/services/data-provider/alpha-vantage/alpha-vantage.service.ts
  36. 4
      apps/api/src/services/data-provider/ghostfolio-scraper-api/ghostfolio-scraper-api.service.ts
  37. 4
      apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts
  38. 6
      apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
  39. 2
      apps/api/src/services/exchange-rate-data.service.ts
  40. 2
      apps/api/src/services/interfaces/data-provider.interface.ts
  41. 2
      apps/api/src/services/interfaces/interfaces.ts
  42. 2
      apps/client/src/app/adapter/date-formats.ts
  43. 6
      apps/client/src/app/app.component.ts
  44. 2
      apps/client/src/app/components/access-table/access-table.component.ts
  45. 2
      apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts
  46. 4
      apps/client/src/app/components/header/header.component.ts
  47. 4
      apps/client/src/app/components/investment-chart/investment-chart.component.ts
  48. 4
      apps/client/src/app/components/line-chart/line-chart.component.ts
  49. 2
      apps/client/src/app/components/portfolio-overview/portfolio-overview.component.ts
  50. 2
      apps/client/src/app/components/portfolio-performance-summary/portfolio-performance-summary.component.ts
  51. 2
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts
  52. 2
      apps/client/src/app/components/portfolio-positions-chart/portfolio-positions-chart.component.ts
  53. 6
      apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts
  54. 4
      apps/client/src/app/components/position/position.component.ts
  55. 2
      apps/client/src/app/components/positions-table/positions-table.component.ts
  56. 2
      apps/client/src/app/components/positions/positions.component.ts
  57. 2
      apps/client/src/app/components/rule/rule.component.ts
  58. 2
      apps/client/src/app/components/rules/rules.component.ts
  59. 4
      apps/client/src/app/components/transactions-table/transactions-table.component.ts
  60. 2
      apps/client/src/app/components/value/value.component.ts
  61. 4
      apps/client/src/app/pages/about/about-page.component.ts
  62. 6
      apps/client/src/app/pages/account/account-page.component.ts
  63. 4
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  64. 4
      apps/client/src/app/pages/admin/admin-page.component.ts
  65. 2
      apps/client/src/app/pages/analysis/analysis-page.component.ts
  66. 6
      apps/client/src/app/pages/home/home-page.component.ts
  67. 4
      apps/client/src/app/pages/pricing/pricing-page.component.ts
  68. 2
      apps/client/src/app/pages/report/report-page.component.ts
  69. 4
      apps/client/src/app/pages/transactions/transactions-page.component.ts
  70. 2
      apps/client/src/app/pipes/symbol/symbol.pipe.ts
  71. 4
      apps/client/src/app/services/data.service.ts
  72. 2
      jest.config.js
  73. 0
      libs/common/.babelrc
  74. 2
      libs/common/.eslintrc.json
  75. 4
      libs/common/README.md
  76. 4
      libs/common/jest.config.js
  77. 0
      libs/common/src/lib/config.ts
  78. 0
      libs/common/src/lib/helper.ts
  79. 0
      libs/common/src/lib/interfaces/access.interface.ts
  80. 0
      libs/common/src/lib/interfaces/admin-data.interface.ts
  81. 0
      libs/common/src/lib/interfaces/index.ts
  82. 0
      libs/common/src/lib/interfaces/info-item.interface.ts
  83. 2
      libs/common/src/lib/interfaces/portfolio-item.interface.ts
  84. 0
      libs/common/src/lib/interfaces/portfolio-overview.interface.ts
  85. 0
      libs/common/src/lib/interfaces/portfolio-performance.interface.ts
  86. 0
      libs/common/src/lib/interfaces/portfolio-position.interface.ts
  87. 0
      libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts
  88. 0
      libs/common/src/lib/interfaces/portfolio-report.interface.ts
  89. 0
      libs/common/src/lib/interfaces/position.interface.ts
  90. 0
      libs/common/src/lib/interfaces/user-settings.interface.ts
  91. 0
      libs/common/src/lib/interfaces/user-with-settings.ts
  92. 0
      libs/common/src/lib/interfaces/user.interface.ts
  93. 0
      libs/common/src/lib/permissions.ts
  94. 0
      libs/common/src/lib/types/access-with-grantee-user.type.ts
  95. 0
      libs/common/src/lib/types/date-range.type.ts
  96. 0
      libs/common/src/lib/types/granularity.type.ts
  97. 0
      libs/common/src/lib/types/index.ts
  98. 0
      libs/common/src/lib/types/order-with-account.type.ts
  99. 2
      libs/common/src/lib/types/request-with-user.type.ts
  100. 0
      libs/common/tsconfig.json

5
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_ - Renamed _Ghostfolio Account_ to _My Ghostfolio_
- Hid unknown exchange in the position overview - Hid unknown exchange in the position overview
- Refactored the portfolio unit tests to work without database - Refactored the portfolio unit tests to work without database
- Moved shared interfaces to `@ghostfolio/helper/interfaces` - Renamed shared helper to `@ghostfolio/common/helper`
- Moved shared types to `@ghostfolio/helper/types` - Moved shared interfaces to `@ghostfolio/common/interfaces`
- Moved shared types to `@ghostfolio/common/types`
## 1.3.0 - 15.05.2021 ## 1.3.0 - 15.05.2021

12
angular.json

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

4
apps/api/src/app/access/access.controller.ts

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

2
apps/api/src/app/access/access.service.ts

@ -1,5 +1,5 @@
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; 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 { Injectable } from '@nestjs/common';
import { Prisma } from '@prisma/client'; import { Prisma } from '@prisma/client';

4
apps/api/src/app/account/account.controller.ts

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

6
apps/api/src/app/admin/admin.controller.ts

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

2
apps/api/src/app/admin/admin.service.ts

@ -1,6 +1,6 @@
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.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 { Injectable } from '@nestjs/common';
import { Currency } from '@prisma/client'; import { Currency } from '@prisma/client';

2
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 { Controller, Inject, Post, UseGuards } from '@nestjs/common';
import { REQUEST } from '@nestjs/core'; import { REQUEST } from '@nestjs/core';
import { AuthGuard } from '@nestjs/passport'; import { AuthGuard } from '@nestjs/passport';

6
apps/api/src/app/experimental/experimental.controller.ts

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

2
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 { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { RulesService } from '@ghostfolio/api/services/rules.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 { Injectable } from '@nestjs/common';
import { Currency, Type } from '@prisma/client'; import { Currency, Type } from '@prisma/client';
import { parseISO } from 'date-fns'; import { parseISO } from 'date-fns';

2
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 { Controller, Get } from '@nestjs/common';
import { InfoService } from './info.service'; import { InfoService } from './info.service';

4
apps/api/src/app/info/info.service.ts

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

4
apps/api/src/app/order/order.controller.ts

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

2
apps/api/src/app/order/order.service.ts

@ -1,6 +1,6 @@
import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service'; import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.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 { Injectable } from '@nestjs/common';
import { Order, Prisma } from '@prisma/client'; import { Order, Prisma } from '@prisma/client';

6
apps/api/src/app/portfolio/portfolio.controller.ts

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

4
apps/api/src/app/portfolio/portfolio.service.ts

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

2
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 { import {
Controller, Controller,
Get, Get,

6
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 { import {
getPermissions, getPermissions,
hasPermission, hasPermission,
permissions permissions
} from '@ghostfolio/helper/permissions'; } from '@ghostfolio/common/permissions';
import { RequestWithUser } from '@ghostfolio/helper/types'; import { RequestWithUser } from '@ghostfolio/common/types';
import { import {
Body, Body,
Controller, Controller,

8
apps/api/src/app/user/user.service.ts

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

2
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'; import { Order } from '../order';

2
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'; import { EvaluationResult } from './evaluation-result.interface';

4
apps/api/src/models/portfolio.spec.ts

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

8
apps/api/src/models/portfolio.ts

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

4
apps/api/src/models/rule.ts

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

2
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 { 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'; import { Rule } from '../../rule';

2
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 { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule'; import { Rule } from '../../rule';

2
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 { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule'; import { Rule } from '../../rule';

2
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 { 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'; import { Rule } from '../../rule';

2
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 { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule'; import { Rule } from '../../rule';

2
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 { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule'; import { Rule } from '../../rule';

2
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 { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule'; import { Rule } from '../../rule';

2
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 { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service';
import { Rule } from '../../rule'; import { Rule } from '../../rule';

4
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 { import {
getUtc, getUtc,
isGhostfolioScraperApiSymbol, isGhostfolioScraperApiSymbol,
resetHours resetHours
} from '@ghostfolio/helper/helper'; } from '@ghostfolio/common/helper';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { import {
differenceInHours, differenceInHours,

4
apps/api/src/services/data-provider.service.ts

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

2
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 { Injectable } from '@nestjs/common';
import { isAfter, isBefore, parse } from 'date-fns'; import { isAfter, isBefore, parse } from 'date-fns';

4
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 { getYesterday } from '@ghostfolio/common/helper';
import { Granularity } from '@ghostfolio/helper/types'; import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { DataSource } from '@prisma/client'; import { DataSource } from '@prisma/client';
import * as bent from 'bent'; import * as bent from 'bent';

4
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 { getToday, getYesterday } from '@ghostfolio/common/helper';
import { Granularity } from '@ghostfolio/helper/types'; import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { DataSource } from '@prisma/client'; import { DataSource } from '@prisma/client';
import * as bent from 'bent'; import * as bent from 'bent';

6
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts

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

2
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 { Injectable } from '@nestjs/common';
import { Currency } from '@prisma/client'; import { Currency } from '@prisma/client';
import { format } from 'date-fns'; import { format } from 'date-fns';

2
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 { import {
IDataProviderHistoricalResponse, IDataProviderHistoricalResponse,

2
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 { Account, Currency, DataSource } from '@prisma/client';
import { OrderType } from '../../models/order-type'; import { OrderType } from '../../models/order-type';

2
apps/client/src/app/adapter/date-formats.ts

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

6
apps/client/src/app/app.component.ts

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

2
apps/client/src/app/components/access-table/access-table.component.ts

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

2
apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts

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

4
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 { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { InfoItem, User } from '@ghostfolio/helper/interfaces'; import { InfoItem, User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { EMPTY, Subject } from 'rxjs'; import { EMPTY, Subject } from 'rxjs';
import { catchError, takeUntil } from 'rxjs/operators'; import { catchError, takeUntil } from 'rxjs/operators';

4
apps/client/src/app/components/investment-chart/investment-chart.component.ts

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

4
apps/client/src/app/components/line-chart/line-chart.component.ts

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

2
apps/client/src/app/components/portfolio-overview/portfolio-overview.component.ts

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

2
apps/client/src/app/components/portfolio-performance-summary/portfolio-performance-summary.component.ts

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

2
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts

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

2
apps/client/src/app/components/portfolio-positions-chart/portfolio-positions-chart.component.ts

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

6
apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

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

4
apps/client/src/app/components/position/position.component.ts

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

2
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 { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table'; import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Router } from '@angular/router'; 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 { Order as OrderModel } from '@prisma/client';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';

2
apps/client/src/app/components/positions/positions.component.ts

@ -6,7 +6,7 @@ import {
OnInit OnInit
} from '@angular/core'; } from '@angular/core';
import { MarketState } from '@ghostfolio/api/services/interfaces/interfaces'; 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({ @Component({
selector: 'gf-positions', selector: 'gf-positions',

2
apps/client/src/app/components/rule/rule.component.ts

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

2
apps/client/src/app/components/rules/rules.component.ts

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

4
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 { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table'; import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config'; import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { OrderWithAccount } from '@ghostfolio/helper/types'; import { OrderWithAccount } from '@ghostfolio/common/types';
import { format } from 'date-fns'; import { format } from 'date-fns';
import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs'; import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';

2
apps/client/src/app/components/value/value.component.ts

@ -5,7 +5,7 @@ import {
OnChanges, OnChanges,
OnInit OnInit
} from '@angular/core'; } 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 { format, isDate } from 'date-fns';
import { isNumber } from 'lodash'; import { isNumber } from 'lodash';

4
apps/client/src/app/pages/about/about-page.component.ts

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

6
apps/client/src/app/pages/account/account-page.component.ts

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

4
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 { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { User } from '@ghostfolio/helper/interfaces'; import { User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Account as AccountModel, AccountType } from '@prisma/client'; import { Account as AccountModel, AccountType } from '@prisma/client';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';

4
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 { CacheService } from '@ghostfolio/client/services/cache.service';
import { DataService } from '@ghostfolio/client/services/data.service'; import { DataService } from '@ghostfolio/client/services/data.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config'; import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { AdminData, User } from '@ghostfolio/helper/interfaces'; import { AdminData, User } from '@ghostfolio/common/interfaces';
import { formatDistanceToNow, isValid, parseISO, sub } from 'date-fns'; import { formatDistanceToNow, isValid, parseISO, sub } from 'date-fns';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';

2
apps/client/src/app/pages/analysis/analysis-page.component.ts

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

6
apps/client/src/app/pages/home/home-page.component.ts

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

4
apps/client/src/app/pages/pricing/pricing-page.component.ts

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

2
apps/client/src/app/pages/report/report-page.component.ts

@ -1,6 +1,6 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service'; 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 { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';

4
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 { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
import { User } from '@ghostfolio/helper/interfaces'; import { User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Order as OrderModel } from '@prisma/client'; import { Order as OrderModel } from '@prisma/client';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';

2
apps/client/src/app/pipes/symbol/symbol.pipe.ts

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

4
apps/client/src/app/services/data.service.ts

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

2
jest.config.js

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

0
libs/helper/.babelrc → libs/common/.babelrc

2
libs/helper/.eslintrc.json → libs/common/.eslintrc.json

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

4
libs/helper/README.md → libs/common/README.md

@ -1,7 +1,7 @@
# helper # @ghostfolio/common
This library was generated with [Nx](https://nx.dev). This library was generated with [Nx](https://nx.dev).
## Running unit tests ## 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).

4
libs/helper/jest.config.js → libs/common/jest.config.js

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

0
libs/helper/src/lib/config.ts → libs/common/src/lib/config.ts

0
libs/helper/src/lib/helper.ts → libs/common/src/lib/helper.ts

0
libs/helper/src/lib/interfaces/access.interface.ts → libs/common/src/lib/interfaces/access.interface.ts

0
libs/helper/src/lib/interfaces/admin-data.interface.ts → libs/common/src/lib/interfaces/admin-data.interface.ts

0
libs/helper/src/lib/interfaces/index.ts → libs/common/src/lib/interfaces/index.ts

0
libs/helper/src/lib/interfaces/info-item.interface.ts → libs/common/src/lib/interfaces/info-item.interface.ts

2
libs/helper/src/lib/interfaces/portfolio-item.interface.ts → 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 { export interface PortfolioItem {
date: string; date: string;

0
libs/helper/src/lib/interfaces/portfolio-overview.interface.ts → libs/common/src/lib/interfaces/portfolio-overview.interface.ts

0
libs/helper/src/lib/interfaces/portfolio-performance.interface.ts → libs/common/src/lib/interfaces/portfolio-performance.interface.ts

0
libs/helper/src/lib/interfaces/portfolio-position.interface.ts → libs/common/src/lib/interfaces/portfolio-position.interface.ts

0
libs/helper/src/lib/interfaces/portfolio-report-rule.interface.ts → libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts

0
libs/helper/src/lib/interfaces/portfolio-report.interface.ts → libs/common/src/lib/interfaces/portfolio-report.interface.ts

0
libs/helper/src/lib/interfaces/position.interface.ts → libs/common/src/lib/interfaces/position.interface.ts

0
libs/helper/src/lib/interfaces/user-settings.interface.ts → libs/common/src/lib/interfaces/user-settings.interface.ts

0
libs/helper/src/lib/interfaces/user-with-settings.ts → libs/common/src/lib/interfaces/user-with-settings.ts

0
libs/helper/src/lib/interfaces/user.interface.ts → libs/common/src/lib/interfaces/user.interface.ts

0
libs/helper/src/lib/permissions.ts → libs/common/src/lib/permissions.ts

0
libs/helper/src/lib/types/access-with-grantee-user.type.ts → libs/common/src/lib/types/access-with-grantee-user.type.ts

0
libs/helper/src/lib/types/date-range.type.ts → libs/common/src/lib/types/date-range.type.ts

0
libs/helper/src/lib/types/granularity.type.ts → libs/common/src/lib/types/granularity.type.ts

0
libs/helper/src/lib/types/index.ts → libs/common/src/lib/types/index.ts

0
libs/helper/src/lib/types/order-with-account.type.ts → libs/common/src/lib/types/order-with-account.type.ts

2
libs/helper/src/lib/types/request-with-user.type.ts → 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 }; export type RequestWithUser = Request & { user: UserWithSettings };

0
libs/helper/tsconfig.json → libs/common/tsconfig.json

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

Loading…
Cancel
Save