@digitaldefiance/express-suite-starter 2.3.24 → 2.3.26
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.
- package/package.json +2 -2
- package/scaffolding/api-lib/src/lib/documents/user.ts +6 -5
- package/scaffolding/api-lib/src/lib/environment.ts +2 -1
- package/scaffolding/api-lib/src/lib/interfaces/environment.ts +2 -1
- package/scaffolding/api-lib/src/lib/routers/api.ts +11 -10
- package/scaffolding/api-lib/src/lib/services/email.ts +5 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/express-suite-starter",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-express-suite": "./dist/src/cli.js"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"publish:public": "npm publish --access public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@digitaldefiance/express-suite-react-components": "^2.9.
|
|
34
|
+
"@digitaldefiance/express-suite-react-components": "^2.9.39",
|
|
35
35
|
"@digitaldefiance/i18n-lib": "^3.8.16",
|
|
36
36
|
"@inquirer/prompts": "^7.5.0",
|
|
37
37
|
"chalk": "^4.1.2",
|
|
@@ -2,16 +2,17 @@ import { Types } from '@digitaldefiance/mongoose-types';
|
|
|
2
2
|
import { AccountStatus, IUserBase } from '@digitaldefiance/suite-core-lib';
|
|
3
3
|
import { IBaseDocument } from '@digitaldefiance/node-express-suite';
|
|
4
4
|
import { CoreLanguageCode } from '@digitaldefiance/i18n-lib';
|
|
5
|
+
import { PlatformID } from '@digitaldefiance/node-ecies-lib';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Composite interface for user collection documents
|
|
8
9
|
*/
|
|
9
|
-
export interface IUserDocument<
|
|
10
|
+
export interface IUserDocument<TID extends PlatformID = PlatformID, TDate extends Date = Date, TLanguage extends string = CoreLanguageCode, TAccountStatus extends AccountStatus = AccountStatus> extends IBaseDocument<
|
|
10
11
|
IUserBase<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
TID,
|
|
13
|
+
TDate,
|
|
14
|
+
TLanguage,
|
|
15
|
+
TAccountStatus
|
|
15
16
|
>
|
|
16
17
|
> {
|
|
17
18
|
}
|
|
@@ -5,8 +5,9 @@ import { IEnvironmentAws } from './interfaces/environment-aws';
|
|
|
5
5
|
import { Constants } from './constants';
|
|
6
6
|
import { getSuiteCoreTranslation, SuiteCoreStringKey } from '@digitaldefiance/suite-core-lib';
|
|
7
7
|
import { EmailService } from './services/email';
|
|
8
|
+
import { PlatformID } from '@digitaldefiance/node-ecies-lib';
|
|
8
9
|
|
|
9
|
-
export class Environment extends BaseEnvironment implements IEnvironment {
|
|
10
|
+
export class Environment<TID extends PlatformID> extends BaseEnvironment<TID> implements IEnvironment<TID> {
|
|
10
11
|
private _aws: IEnvironmentAws;
|
|
11
12
|
|
|
12
13
|
constructor(path?: string, initialization = false, override = true) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IEnvironment as IBaseEnvironment } from '@digitaldefiance/node-express-suite';
|
|
2
2
|
import { IEnvironmentAws } from './environment-aws';
|
|
3
|
+
import { PlatformID } from '@digitaldefiance/node-ecies-lib';
|
|
3
4
|
|
|
4
|
-
export interface IEnvironment extends IBaseEnvironment {
|
|
5
|
+
export interface IEnvironment<TID extends PlatformID> extends IBaseEnvironment<TID> {
|
|
5
6
|
/**
|
|
6
7
|
* AWS configuration
|
|
7
8
|
*/
|
|
@@ -3,20 +3,21 @@ import { ITokenRole, ITokenUser, IUserBase } from '@digitaldefiance/suite-core-l
|
|
|
3
3
|
import { Types } from '@digitaldefiance/mongoose-types';
|
|
4
4
|
import { Environment } from '../environment';
|
|
5
5
|
import { IConstants } from '../interfaces/constants';
|
|
6
|
+
import { CoreLanguageCode } from '@digitaldefiance/i18n-lib';
|
|
6
7
|
|
|
7
8
|
export class ApiRouter<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
TUser extends IUserBase<
|
|
13
|
-
TTokenRole extends ITokenRole<
|
|
9
|
+
TID extends Types.ObjectId | string = Types.ObjectId,
|
|
10
|
+
TDate extends Date = Date,
|
|
11
|
+
TLanguage extends CoreLanguageCode = CoreLanguageCode,
|
|
12
|
+
TAccountStatus extends string = string,
|
|
13
|
+
TUser extends IUserBase<TID, TDate, TLanguage, TAccountStatus> = IUserBase<TID, TDate, TLanguage, TAccountStatus>,
|
|
14
|
+
TTokenRole extends ITokenRole<TID, TDate> = ITokenRole<TID, TDate>,
|
|
14
15
|
TTokenUser extends ITokenUser = ITokenUser,
|
|
15
|
-
TEnvironment extends Environment = Environment
|
|
16
|
+
TEnvironment extends Environment<TID> = Environment<TID>,
|
|
16
17
|
TConstants extends IConstants = IConstants,
|
|
17
|
-
TBaseDocument extends IBaseDocument<any,
|
|
18
|
-
TApplication extends IApplication = IApplication
|
|
19
|
-
> extends BaseApiRouter<
|
|
18
|
+
TBaseDocument extends IBaseDocument<any, TID> = IBaseDocument<any, TID>,
|
|
19
|
+
TApplication extends IApplication<TID> = IApplication<TID>,
|
|
20
|
+
> extends BaseApiRouter<TID,TDate,TLanguage,TAccountStatus, TUser,TTokenRole,TBaseDocument, TTokenUser,TConstants, TEnvironment, TApplication> {
|
|
20
21
|
constructor(app: TApplication) {
|
|
21
22
|
super(app);
|
|
22
23
|
}
|
|
@@ -7,27 +7,26 @@ function debugLog(debug: boolean, type: 'log' | 'warn' | 'error', ...args: any[]
|
|
|
7
7
|
console[type](...args);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
import { Types } from '@digitaldefiance/mongoose-types';
|
|
11
10
|
import { Environment } from '../environment';
|
|
12
|
-
import {
|
|
11
|
+
import { PlatformID } from '@digitaldefiance/node-ecies-lib';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* A generic service for sending emails using Amazon SES.
|
|
16
15
|
*/
|
|
17
|
-
export class EmailService {
|
|
16
|
+
export class EmailService<TID extends PlatformID> {
|
|
18
17
|
private readonly sesClient: SESClient;
|
|
19
18
|
private readonly emailSender: string;
|
|
20
19
|
private readonly disableEmailSend: boolean;
|
|
21
20
|
private readonly debug: boolean;
|
|
22
|
-
private readonly application: IApplication
|
|
21
|
+
private readonly application: IApplication<TID>;
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Constructs an instance of EmailService.
|
|
26
25
|
* @param config Configuration object containing AWS credentials, region, sender email, and debug/disable flags.
|
|
27
26
|
*/
|
|
28
|
-
constructor(application: IApplication) {
|
|
27
|
+
constructor(application: IApplication<TID>) {
|
|
29
28
|
this.application = application;
|
|
30
|
-
const environment = application.environment as Environment
|
|
29
|
+
const environment = application.environment as Environment<TID>;
|
|
31
30
|
this.emailSender = environment.emailSender;
|
|
32
31
|
this.disableEmailSend = environment.disableEmailSend;
|
|
33
32
|
this.debug = environment.debug;
|