@punks/backend-entity-manager 0.0.34 → 0.0.35
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/dist/cjs/index.js +5247 -42
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/email.d.ts +4 -4
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/__test__/server/messaging/email/index.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/__test__/server/messaging/email/registration.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/__test__/server/messaging/module.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/__test__/server/services/email-provider/index.d.ts +9 -5
- package/dist/cjs/types/platforms/nest/extensions/authentication/settings/index.d.ts +2 -2
- package/dist/cjs/types/platforms/nest/extensions/authentication/types/index.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/abstractions/index.d.ts +9 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/base/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/base/template.d.ts +6 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/decorators/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/decorators/template.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/index.d.ts +5 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/module.d.ts +5 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/provider/email/index.d.ts +8 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/settings/index.d.ts +10 -0
- package/dist/cjs/types/platforms/nest/plugins/email/aws-ses/symbols/index.d.ts +3 -0
- package/dist/cjs/types/platforms/nest/plugins/email/index.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/abstractions/index.d.ts +16 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/base/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/base/template.d.ts +6 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/decorators/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/decorators/template.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/index.d.ts +4 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/module.d.ts +5 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/provider/email/index.d.ts +7 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/settings/index.d.ts +8 -0
- package/dist/cjs/types/platforms/nest/plugins/email/sendgrid/symbols/index.d.ts +3 -0
- package/dist/cjs/types/platforms/nest/services/email/index.d.ts +2 -0
- package/dist/cjs/types/providers/services.d.ts +2 -2
- package/dist/cjs/types/reflection/decorators/decorator.test.d.ts +1 -0
- package/dist/cjs/types/reflection/decorators/index.d.ts +1 -0
- package/dist/cjs/types/reflection/index.d.ts +1 -1
- package/dist/cjs/types/reflection/types/index.d.ts +1 -0
- package/dist/cjs/types/settings/index.d.ts +6 -0
- package/dist/cjs/types/utils/index.d.ts +1 -0
- package/dist/cjs/types/utils/rendering.d.ts +4 -0
- package/dist/esm/index.js +5219 -43
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/email.d.ts +4 -4
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/__test__/server/messaging/email/index.d.ts +2 -0
- package/dist/esm/types/platforms/nest/__test__/server/messaging/email/registration.d.ts +2 -0
- package/dist/esm/types/platforms/nest/__test__/server/messaging/module.d.ts +2 -0
- package/dist/esm/types/platforms/nest/__test__/server/services/email-provider/index.d.ts +9 -5
- package/dist/esm/types/platforms/nest/extensions/authentication/settings/index.d.ts +2 -2
- package/dist/esm/types/platforms/nest/extensions/authentication/types/index.d.ts +1 -1
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/abstractions/index.d.ts +9 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/base/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/base/template.d.ts +6 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/decorators/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/decorators/template.d.ts +2 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/index.d.ts +5 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/module.d.ts +5 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/provider/email/index.d.ts +8 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/settings/index.d.ts +10 -0
- package/dist/esm/types/platforms/nest/plugins/email/aws-ses/symbols/index.d.ts +3 -0
- package/dist/esm/types/platforms/nest/plugins/email/index.d.ts +2 -1
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/abstractions/index.d.ts +16 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/base/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/base/template.d.ts +6 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/decorators/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/decorators/template.d.ts +2 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/index.d.ts +4 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/module.d.ts +5 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/provider/email/index.d.ts +7 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/settings/index.d.ts +8 -0
- package/dist/esm/types/platforms/nest/plugins/email/sendgrid/symbols/index.d.ts +3 -0
- package/dist/esm/types/platforms/nest/services/email/index.d.ts +2 -0
- package/dist/esm/types/providers/services.d.ts +2 -2
- package/dist/esm/types/reflection/decorators/decorator.test.d.ts +1 -0
- package/dist/esm/types/reflection/decorators/index.d.ts +1 -0
- package/dist/esm/types/reflection/index.d.ts +1 -1
- package/dist/esm/types/reflection/types/index.d.ts +1 -0
- package/dist/esm/types/settings/index.d.ts +6 -0
- package/dist/esm/types/utils/index.d.ts +1 -0
- package/dist/esm/types/utils/rendering.d.ts +4 -0
- package/dist/index.d.ts +87 -8
- package/package.json +6 -1
- package/readme.md +15 -1
|
@@ -11,7 +11,7 @@ export type TemplatedEmailInput<TPayload> = {
|
|
|
11
11
|
to?: string[];
|
|
12
12
|
cc?: string[];
|
|
13
13
|
bcc?: string[];
|
|
14
|
-
|
|
14
|
+
subjectTemplate?: string;
|
|
15
15
|
templateId: string;
|
|
16
16
|
payload: TPayload;
|
|
17
17
|
};
|
|
@@ -20,11 +20,11 @@ export interface HtmlEmailInput<TPayload> {
|
|
|
20
20
|
to?: string[];
|
|
21
21
|
cc?: string[];
|
|
22
22
|
bcc?: string[];
|
|
23
|
-
|
|
23
|
+
subjectTemplate: string;
|
|
24
24
|
htmlTemplate: string;
|
|
25
25
|
payload: TPayload;
|
|
26
26
|
}
|
|
27
|
-
export interface IEmailProvider {
|
|
28
|
-
sendTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
27
|
+
export interface IEmailProvider<TTemplateData> {
|
|
28
|
+
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<TTemplateData, TPayload, TAugmentedPayload>): Promise<void>;
|
|
29
29
|
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
30
30
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { HtmlEmailInput, IEmailProvider, TemplatedEmailInput } from "../../../../../../abstractions";
|
|
1
|
+
import { HtmlEmailInput, IEmailProvider, IEmailTemplate, TemplatedEmailInput } from "../../../../../../abstractions";
|
|
2
2
|
type SentEmail = {
|
|
3
|
-
input: TemplatedEmailInput<unknown
|
|
4
|
-
|
|
3
|
+
input: TemplatedEmailInput<unknown>;
|
|
4
|
+
template: IEmailTemplate<void, unknown, unknown>;
|
|
5
|
+
type: "templated";
|
|
6
|
+
} | {
|
|
7
|
+
input: HtmlEmailInput<unknown>;
|
|
8
|
+
type: "html";
|
|
5
9
|
};
|
|
6
|
-
export declare class InMemoryEmailProvider implements IEmailProvider {
|
|
10
|
+
export declare class InMemoryEmailProvider implements IEmailProvider<void> {
|
|
7
11
|
private readonly sentEmails;
|
|
8
|
-
sendTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
12
|
+
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<void, TPayload, TAugmentedPayload>): Promise<void>;
|
|
9
13
|
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
10
14
|
getSentEmails(): SentEmail[];
|
|
11
15
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import { AppInMemorySettings } from "../../../../../settings";
|
|
1
2
|
import { AuthenticationModuleSettings } from "../types";
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const getAuthSettings: () => AuthenticationModuleSettings;
|
|
3
|
+
export declare const authSettings: AppInMemorySettings<AuthenticationModuleSettings>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AwsSesEmailTemplate } from "./template";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IEmailTemplate } from "../../../../../../abstractions";
|
|
2
|
+
import { AwsSesEmailTemplateData } from "../abstractions";
|
|
3
|
+
export declare abstract class AwsSesEmailTemplate<TPayload, TAugmentedPayload = TPayload> implements IEmailTemplate<AwsSesEmailTemplateData, TPayload, TAugmentedPayload> {
|
|
4
|
+
processPayload(payload: TPayload): Promise<TAugmentedPayload>;
|
|
5
|
+
getTemplateData(payload: TAugmentedPayload): Promise<AwsSesEmailTemplateData>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./template";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AwsSesEmailTemplateData } from "../abstractions";
|
|
2
|
+
export declare const WpAwsSesEmailTemplate: (templateId: string, sendgridTemplateData: AwsSesEmailTemplateData) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HtmlEmailInput, IEmailProvider, IEmailTemplate, TemplatedEmailInput } from "../../../../../../../abstractions";
|
|
2
|
+
import { AwsSesEmailTemplateData } from "../../abstractions";
|
|
3
|
+
export declare class AwsSesEmailProvider implements IEmailProvider<AwsSesEmailTemplateData> {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor();
|
|
6
|
+
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<AwsSesEmailTemplateData, TPayload, TAugmentedPayload>): Promise<void>;
|
|
7
|
+
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppInMemorySettings } from "../../../../../../settings";
|
|
2
|
+
export type AwsSesSettings = {
|
|
3
|
+
awsAccessKeyId?: string;
|
|
4
|
+
awsSecretAccessKey?: string;
|
|
5
|
+
region?: string;
|
|
6
|
+
defaultSender: string;
|
|
7
|
+
defaultCc?: string[];
|
|
8
|
+
defaultBcc?: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const awsSesSettings: AppInMemorySettings<AwsSesSettings>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./aws-ses";
|
|
2
|
+
export * from "./sendgrid";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type SendgridTemplateType = "template" | "html";
|
|
2
|
+
export type SendgridTemplateBaseData = {
|
|
3
|
+
from?: string;
|
|
4
|
+
to?: string[];
|
|
5
|
+
cc?: string[];
|
|
6
|
+
bcc?: string[];
|
|
7
|
+
replyTo?: string;
|
|
8
|
+
};
|
|
9
|
+
export type SendgridEmailTemplateData = SendgridTemplateBaseData & ({
|
|
10
|
+
type: "template";
|
|
11
|
+
sendgridTemplateId: string;
|
|
12
|
+
} | {
|
|
13
|
+
type: "html";
|
|
14
|
+
subjectTemplate: string;
|
|
15
|
+
bodyTemplate: string;
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SendgridEmailTemplate } from "./template";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IEmailTemplate } from "../../../../../../abstractions";
|
|
2
|
+
import { SendgridEmailTemplateData } from "../abstractions";
|
|
3
|
+
export declare abstract class SendgridEmailTemplate<TPayload, TAugmentedPayload = TPayload> implements IEmailTemplate<SendgridEmailTemplateData, TPayload, TAugmentedPayload> {
|
|
4
|
+
processPayload(payload: TPayload): Promise<TAugmentedPayload>;
|
|
5
|
+
getTemplateData(payload: TAugmentedPayload): Promise<SendgridEmailTemplateData>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./template";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SendgridEmailTemplateData } from "../abstractions";
|
|
2
|
+
export declare const WpSendgridEmailTemplate: (templateId: string, sendgridTemplateData: SendgridEmailTemplateData) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HtmlEmailInput, IEmailProvider, IEmailTemplate, TemplatedEmailInput } from "../../../../../../../abstractions";
|
|
2
|
+
import { SendgridEmailTemplateData } from "../../abstractions";
|
|
3
|
+
export declare class SendgridEmailProvider implements IEmailProvider<SendgridEmailTemplateData> {
|
|
4
|
+
constructor();
|
|
5
|
+
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<SendgridEmailTemplateData, TPayload, TAugmentedPayload>): Promise<void>;
|
|
6
|
+
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppInMemorySettings } from "../../../../../../settings";
|
|
2
|
+
export type SendgridSettings = {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
defaultSender: string;
|
|
5
|
+
defaultCc?: string[];
|
|
6
|
+
defaultBcc?: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare const sendgridSettings: AppInMemorySettings<SendgridSettings>;
|
|
@@ -5,5 +5,7 @@ export declare class EmailService {
|
|
|
5
5
|
constructor(registry: EntityManagerRegistry);
|
|
6
6
|
sendTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
7
7
|
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
8
|
+
private getTemplate;
|
|
9
|
+
private get templates();
|
|
8
10
|
private get provider();
|
|
9
11
|
}
|
|
@@ -53,8 +53,8 @@ export declare class EntitiesServiceLocator {
|
|
|
53
53
|
getProvider(): ServiceLocator;
|
|
54
54
|
resolveEventEmitter<TEventEmitter extends IEventEmitter>(): TEventEmitter;
|
|
55
55
|
registerEventEmitter<TEventEmitter extends IEventEmitter>(instance: TEventEmitter): void;
|
|
56
|
-
resolveEmailProvider<TEmailProvider extends IEmailProvider
|
|
57
|
-
registerEmailProvider<TEmailProvider extends IEmailProvider
|
|
56
|
+
resolveEmailProvider<TEmailProvider extends IEmailProvider<unknown>>(): TEmailProvider;
|
|
57
|
+
registerEmailProvider<TEmailProvider extends IEmailProvider<unknown>>(instance: TEmailProvider): void;
|
|
58
58
|
resolveEmailTemplatesCollection(): IEmailTemplatesCollection;
|
|
59
59
|
registerEmailTemplatesCollection(instance: IEmailTemplatesCollection): void;
|
|
60
60
|
resolveAuthenticationContextProvider<TAuthenticationContextProvider extends IAuthenticationContextProvider<TUserContext>, TUserContext>(): TAuthenticationContextProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getInstanceDecoratorData: <T>(metadataKey: any, instance: Object) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTypeName: (type: any) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -327,8 +327,8 @@ declare class EntitiesServiceLocator {
|
|
|
327
327
|
getProvider(): ServiceLocator;
|
|
328
328
|
resolveEventEmitter<TEventEmitter extends IEventEmitter>(): TEventEmitter;
|
|
329
329
|
registerEventEmitter<TEventEmitter extends IEventEmitter>(instance: TEventEmitter): void;
|
|
330
|
-
resolveEmailProvider<TEmailProvider extends IEmailProvider
|
|
331
|
-
registerEmailProvider<TEmailProvider extends IEmailProvider
|
|
330
|
+
resolveEmailProvider<TEmailProvider extends IEmailProvider<unknown>>(): TEmailProvider;
|
|
331
|
+
registerEmailProvider<TEmailProvider extends IEmailProvider<unknown>>(instance: TEmailProvider): void;
|
|
332
332
|
resolveEmailTemplatesCollection(): IEmailTemplatesCollection;
|
|
333
333
|
registerEmailTemplatesCollection(instance: IEmailTemplatesCollection): void;
|
|
334
334
|
resolveAuthenticationContextProvider<TAuthenticationContextProvider extends IAuthenticationContextProvider<TUserContext>, TUserContext>(): TAuthenticationContextProvider;
|
|
@@ -432,7 +432,7 @@ type TemplatedEmailInput<TPayload> = {
|
|
|
432
432
|
to?: string[];
|
|
433
433
|
cc?: string[];
|
|
434
434
|
bcc?: string[];
|
|
435
|
-
|
|
435
|
+
subjectTemplate?: string;
|
|
436
436
|
templateId: string;
|
|
437
437
|
payload: TPayload;
|
|
438
438
|
};
|
|
@@ -441,12 +441,12 @@ interface HtmlEmailInput<TPayload> {
|
|
|
441
441
|
to?: string[];
|
|
442
442
|
cc?: string[];
|
|
443
443
|
bcc?: string[];
|
|
444
|
-
|
|
444
|
+
subjectTemplate: string;
|
|
445
445
|
htmlTemplate: string;
|
|
446
446
|
payload: TPayload;
|
|
447
447
|
}
|
|
448
|
-
interface IEmailProvider {
|
|
449
|
-
sendTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
448
|
+
interface IEmailProvider<TTemplateData> {
|
|
449
|
+
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<TTemplateData, TPayload, TAugmentedPayload>): Promise<void>;
|
|
450
450
|
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
451
451
|
}
|
|
452
452
|
|
|
@@ -818,7 +818,7 @@ type EmailVerifyTokenPayload = {
|
|
|
818
818
|
timestamp: number;
|
|
819
819
|
};
|
|
820
820
|
declare enum UserRegistrationError {
|
|
821
|
-
UserAlreadyExists =
|
|
821
|
+
UserAlreadyExists = "userAlreadyExists"
|
|
822
822
|
}
|
|
823
823
|
|
|
824
824
|
type UserRegisterCallbackTemplate = {
|
|
@@ -898,6 +898,8 @@ declare class EmailService {
|
|
|
898
898
|
constructor(registry: EntityManagerRegistry);
|
|
899
899
|
sendTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
900
900
|
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
901
|
+
private getTemplate;
|
|
902
|
+
private get templates();
|
|
901
903
|
private get provider();
|
|
902
904
|
}
|
|
903
905
|
|
|
@@ -1124,6 +1126,78 @@ declare abstract class AppExceptionsFilterBase implements ExceptionFilter {
|
|
|
1124
1126
|
protected abstract getCustomErrorStatusCode(exception: any): number | undefined;
|
|
1125
1127
|
}
|
|
1126
1128
|
|
|
1129
|
+
type AwsSesEmailTemplateData = {
|
|
1130
|
+
subjectTemplate: string;
|
|
1131
|
+
htmlTemplate: string;
|
|
1132
|
+
from?: string;
|
|
1133
|
+
to?: string[];
|
|
1134
|
+
cc?: string[];
|
|
1135
|
+
bcc?: string[];
|
|
1136
|
+
replyTo?: string;
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
declare abstract class AwsSesEmailTemplate<TPayload, TAugmentedPayload = TPayload> implements IEmailTemplate<AwsSesEmailTemplateData, TPayload, TAugmentedPayload> {
|
|
1140
|
+
processPayload(payload: TPayload): Promise<TAugmentedPayload>;
|
|
1141
|
+
getTemplateData(payload: TAugmentedPayload): Promise<AwsSesEmailTemplateData>;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
declare const WpAwsSesEmailTemplate: (templateId: string, sendgridTemplateData: AwsSesEmailTemplateData) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1145
|
+
|
|
1146
|
+
declare class AppInMemorySettings<T> {
|
|
1147
|
+
private _instance;
|
|
1148
|
+
constructor();
|
|
1149
|
+
initialize(value: T): void;
|
|
1150
|
+
get value(): T;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
type AwsSesSettings = {
|
|
1154
|
+
awsAccessKeyId?: string;
|
|
1155
|
+
awsSecretAccessKey?: string;
|
|
1156
|
+
region?: string;
|
|
1157
|
+
defaultSender: string;
|
|
1158
|
+
defaultCc?: string[];
|
|
1159
|
+
defaultBcc?: string[];
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
declare class AwsEmailModule {
|
|
1163
|
+
static forRoot(input: AwsSesSettings): DynamicModule;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
type SendgridTemplateType = "template" | "html";
|
|
1167
|
+
type SendgridTemplateBaseData = {
|
|
1168
|
+
from?: string;
|
|
1169
|
+
to?: string[];
|
|
1170
|
+
cc?: string[];
|
|
1171
|
+
bcc?: string[];
|
|
1172
|
+
replyTo?: string;
|
|
1173
|
+
};
|
|
1174
|
+
type SendgridEmailTemplateData = SendgridTemplateBaseData & ({
|
|
1175
|
+
type: "template";
|
|
1176
|
+
sendgridTemplateId: string;
|
|
1177
|
+
} | {
|
|
1178
|
+
type: "html";
|
|
1179
|
+
subjectTemplate: string;
|
|
1180
|
+
bodyTemplate: string;
|
|
1181
|
+
});
|
|
1182
|
+
|
|
1183
|
+
declare abstract class SendgridEmailTemplate<TPayload, TAugmentedPayload = TPayload> implements IEmailTemplate<SendgridEmailTemplateData, TPayload, TAugmentedPayload> {
|
|
1184
|
+
processPayload(payload: TPayload): Promise<TAugmentedPayload>;
|
|
1185
|
+
getTemplateData(payload: TAugmentedPayload): Promise<SendgridEmailTemplateData>;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
declare const WpSendgridEmailTemplate: (templateId: string, sendgridTemplateData: SendgridEmailTemplateData) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1189
|
+
|
|
1190
|
+
type SendgridSettings = {
|
|
1191
|
+
apiKey: string;
|
|
1192
|
+
defaultSender: string;
|
|
1193
|
+
defaultCc?: string[];
|
|
1194
|
+
defaultBcc?: string[];
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1197
|
+
declare class SendgridEmailModule {
|
|
1198
|
+
static forRoot(input: SendgridSettings): DynamicModule;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1127
1201
|
declare class NestEventEmitter implements IEventEmitter {
|
|
1128
1202
|
private eventEmitter;
|
|
1129
1203
|
constructor();
|
|
@@ -1168,4 +1242,9 @@ declare class EntityManagerModule {
|
|
|
1168
1242
|
|
|
1169
1243
|
declare const newUuid: () => string;
|
|
1170
1244
|
|
|
1171
|
-
|
|
1245
|
+
declare const renderHandlebarsTemplate: <TContext extends object>(input: {
|
|
1246
|
+
template: string;
|
|
1247
|
+
context: TContext;
|
|
1248
|
+
}) => string;
|
|
1249
|
+
|
|
1250
|
+
export { AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSessionMiddleware, AppSessionService, AuthenticationEmailTemplates, AuthenticationError, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationModuleSettings, AuthenticationService, AwsEmailModule, AwsSesEmailTemplate, AwsSesEmailTemplateData, AwsSesSettings, EmailService, EmailTemplateProps, EmailVerifyEmailPayload, EmailVerifyTokenPayload, EntityActionsProps, EntityAdapterProps, EntityAuthMiddlewareProps, EntityConnectorProps, EntityConverterProps, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerProps, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntityProps, EntityQueryBuilderProps, EntityRepositoryProps, FilterExpression, HtmlEmailInput, IAuthenticationContext, IAuthenticationContextProvider, IAuthenticationService, IAuthorizationResult, IEmailProvider, IEmailTemplate, IEmailTemplatesCollection, IEntitiesQueryBuilder, IEntitiesSearchAction, IEntitiesSearchQuery, IEntitiesSearchResults, IEntitiesSearchResultsPaging, IEntityActions, IEntityAdapter, IEntityAuthorizationMiddleware, IEntityConverter, IEntityCreateAction, IEntityCreateCommand, IEntityDeleteAction, IEntityDeleteCommand, IEntityEventsManager, IEntityGetAction, IEntityGetQuery, IEntityManager, IEntityManagerServiceCollection, IEntityManagerServiceRoot, IEntityMapper, IEntityReplicaDeleteManager, IEntityReplicaSyncManager, IEntityRepository, IEntitySearchParameters, IEntitySearchResults, IEntityUpdateAction, IEntityUpdateCommand, IEntityUpsertAction, IEntityUpsertCommand, IReplicasConfiguration, ISearchFilters, ISearchOptions, ISearchRequestPaging, ISearchResultsPaging, ISearchSorting, ISearchSortingField, IUser, IUserContext, IUserOrganization, IUserProfile, IUserService, IUserTokenData, InvalidCredentialsError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestTypeOrmQueryBuilder, NestTypeOrmRepository, OperationTokenMismatchError, PasswordResetEmailPayload, QueryBuilderBase, RegistrationEmailPayload, ReplicaConfiguration, ReplicaOptions, ReplicationMode, RuntimeErrorInformation, SendgridEmailModule, SendgridEmailTemplate, SendgridEmailTemplateData, SendgridTemplateBaseData, SendgridTemplateType, SortDirection, SortingType, TemplatedEmailInput, UserDisableInput, UserEnableInput, UserLoginInput, UserLoginResult, UserPasswordChangeInput, UserPasswordResetCompleteInput, UserPasswordResetRequestCallbackTemplate, UserPasswordResetRequestInput, UserPasswordResetRequestResult, UserPasswordResetTokenPayload, UserRegisterCallbackTemplate, UserRegistrationError, UserRegistrationInput, UserRegistrationResult, UserTokenVerifyInput, UserTokenVerifyResult, UserVerifyCompleteInput, UserVerifyRequestCallbackTemplate, UserVerifyRequestInput, UserVerifyRequestResult as UserVerifyResetRequestResult, WpAppInitializer, WpAwsSesEmailTemplate, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpSendgridEmailTemplate, WpUserService, newUuid, renderHandlebarsTemplate };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@punks/backend-entity-manager",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"author": "WebPunks",
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@aws-sdk/client-ses": "^3.370.0",
|
|
28
29
|
"@babel/core": "^7.21.0",
|
|
29
30
|
"@nestjs/common": "^10.1.0",
|
|
30
31
|
"@nestjs/core": "^10.1.0",
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
"@rollup/plugin-json": "^6.0.0",
|
|
40
41
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
41
42
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
43
|
+
"@sendgrid/mail": "^7.7.0",
|
|
42
44
|
"@types/bcrypt": "^5.0.0",
|
|
43
45
|
"@types/express": "^4.17.17",
|
|
44
46
|
"@types/jest": "^29.5.2",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"class-transformer": "^0.5.1",
|
|
50
52
|
"class-validator": "^0.14.0",
|
|
51
53
|
"express": "^4.18.2",
|
|
54
|
+
"handlebars": "^4.7.7",
|
|
52
55
|
"jest": "^29.6.1",
|
|
53
56
|
"lodash": "^4.17.21",
|
|
54
57
|
"pg": "^8.11.1",
|
|
@@ -66,6 +69,7 @@
|
|
|
66
69
|
"typescript": "^5.1.6"
|
|
67
70
|
},
|
|
68
71
|
"peerDependencies": {
|
|
72
|
+
"@aws-sdk/client-ses": "^3.370.0",
|
|
69
73
|
"@nestjs/common": "^10.1.0",
|
|
70
74
|
"@nestjs/core": "^10.1.0",
|
|
71
75
|
"@nestjs/event-emitter": "^2.0.0",
|
|
@@ -75,6 +79,7 @@
|
|
|
75
79
|
"@nestjs/testing": "^10.1.0",
|
|
76
80
|
"@nestjs/typeorm": "^10.0.0",
|
|
77
81
|
"@punks/backend-core": "0.0.12",
|
|
82
|
+
"@sendgrid/mail": "^7.7.0",
|
|
78
83
|
"bcrypt": "^5.1.0",
|
|
79
84
|
"typeorm": "^0.3.17"
|
|
80
85
|
},
|
package/readme.md
CHANGED
|
@@ -11,7 +11,7 @@ npm install @punks/backend-entity-manager @punks/backend-core class-transformer
|
|
|
11
11
|
## Add authentication
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install express async_hooks @nestjs/platform-express @nestjs/jwt
|
|
14
|
+
npm install express async_hooks bcrypt @nestjs/platform-express @nestjs/jwt
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Supported ORMs:
|
|
@@ -22,6 +22,20 @@ npm install express async_hooks @nestjs/platform-express @nestjs/jwt
|
|
|
22
22
|
npm install typeorm
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Supported email providers:
|
|
26
|
+
|
|
27
|
+
- [SendGrid](https://sendgrid.com/)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
mpm install @sendgrid/mail
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- [AWS SES](https://aws.amazon.com/ses/)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @aws-sdk/client-ses
|
|
37
|
+
```
|
|
38
|
+
|
|
25
39
|
## Supported platforms:
|
|
26
40
|
|
|
27
41
|
- [NestJS](https://nestjs.com/)
|