@tstdl/base 0.92.51 → 0.92.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { ForbiddenError } from '../../errors/forbidden.error.js';
8
8
  import { InvalidTokenError } from '../../errors/invalid-token.error.js';
9
9
  import { NotImplementedError } from '../../errors/not-implemented.error.js';
10
- import { Singleton, afterResolve, inject } from '../../injector/index.js';
11
- import { injectRepository } from '../../orm/server/repository.js';
10
+ import { Singleton, afterResolve, inject, provide } from '../../injector/index.js';
11
+ import { DatabaseConfig } from '../../orm/server/index.js';
12
+ import { EntityRepositoryConfig, injectRepository } from '../../orm/server/repository.js';
12
13
  import { Alphabet } from '../../utils/alphabet.js';
13
14
  import { deriveBytesMultiple, importPbkdf2Key } from '../../utils/cryptography.js';
14
15
  import { currentTimestamp, timestampToTimestampSeconds } from '../../utils/date-time.js';
@@ -21,6 +22,7 @@ import { AuthenticationCredentials, AuthenticationSession } from '../models/inde
21
22
  import { AuthenticationAncillaryService, GetTokenPayloadContextAction } from './authentication-ancillary.service.js';
22
23
  import { AuthenticationSecretRequirementsValidator } from './authentication-secret-requirements.validator.js';
23
24
  import { getRefreshTokenFromString, getSecretResetTokenFromString, getTokenFromString } from './helper.js';
25
+ import { AuthenticationModuleConfig } from './module.js';
24
26
  export class AuthenticationServiceOptions {
25
27
  /**
26
28
  * Secrets used for signing tokens and refreshTokens
@@ -271,6 +273,11 @@ let AuthenticationService = class AuthenticationService {
271
273
  }
272
274
  };
273
275
  AuthenticationService = __decorate([
274
- Singleton()
276
+ Singleton({
277
+ providers: [
278
+ provide(EntityRepositoryConfig, { useValue: { schema: 'authentication' } }),
279
+ { provide: DatabaseConfig, useFactory: (_, context) => context.resolve(AuthenticationModuleConfig).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }) }
280
+ ]
281
+ })
275
282
  ], AuthenticationService);
276
283
  export { AuthenticationService };
@@ -354,7 +354,7 @@ DocumentManagementService = __decorate([
354
354
  Singleton({
355
355
  providers: [
356
356
  provide(EntityRepositoryConfig, { useValue: { schema: 'document_management' } }),
357
- { provide: DatabaseConfig, useFactory: (_, context) => context.resolve(DocumentManagementConfig).database }
357
+ { provide: DatabaseConfig, useFactory: (_, context) => context.resolve(DocumentManagementConfig).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }) }
358
358
  ]
359
359
  })
360
360
  ], DocumentManagementService);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.51",
3
+ "version": "0.92.52",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"