@adtrackify/at-service-common 1.1.7 → 1.1.8

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.
@@ -1,44 +1,44 @@
1
- import { EventBridgeClient } from '../clients';
2
- import { Message, TemplatedMessage } from 'postmark';
3
-
4
- export const enum PostmarkRequestType {
5
- SINGLE_EMAIL = 'single_email',
6
- TEMPLATE_EMAIL = 'template_email'
7
- }
8
-
9
- export enum ADTRACKIFY_EVENT_BRIDGE_EVENTS {
10
- SEND_POSTMARK_EMAIL = 'integration.sendPostmarkEmail',
11
- }
12
-
13
- export class EventBridgeIntegrationService {
14
- public eventBridgeClient: EventBridgeClient;
15
- public EVENT_BUS_NAME: string;
16
-
17
- constructor (eventBusName: string) {
18
- this.eventBridgeClient = new EventBridgeClient(eventBusName);
19
- this.EVENT_BUS_NAME = eventBusName;
20
- }
21
-
22
- public sendPostmarkEmailEvent = async (eventSource: string, postmarkMessage: Message, postmarkServerToken: string) => {
23
- return await this.eventBridgeClient.buildAndSendEvent(
24
- eventSource,
25
- ADTRACKIFY_EVENT_BRIDGE_EVENTS.SEND_POSTMARK_EMAIL,
26
- {
27
- postmarkMessage,
28
- postmarkRequestType: PostmarkRequestType.SINGLE_EMAIL,
29
- postmarkServerToken
30
- });
31
- };
32
-
33
- public sendPostmarkTemplatedEmailEvent = async (eventSource: string, postmarkMessage: TemplatedMessage, postmarkServerToken: string) => {
34
- return await this.eventBridgeClient.buildAndSendEvent(
35
- eventSource,
36
- ADTRACKIFY_EVENT_BRIDGE_EVENTS.SEND_POSTMARK_EMAIL,
37
- {
38
- postmarkMessage,
39
- postmarkRequestType: PostmarkRequestType.TEMPLATE_EMAIL,
40
- postmarkServerToken
41
- });
42
- };
43
-
44
- }
1
+ import { EventBridgeClient } from '../clients';
2
+ import { Message, TemplatedMessage } from 'postmark';
3
+
4
+ export const enum PostmarkRequestType {
5
+ SINGLE_EMAIL = 'single_email',
6
+ TEMPLATE_EMAIL = 'template_email'
7
+ }
8
+
9
+ export enum ADTRACKIFY_EVENT_BRIDGE_EVENTS {
10
+ SEND_POSTMARK_EMAIL = 'integration.sendPostmarkEmail',
11
+ }
12
+
13
+ export class EventBridgeIntegrationService {
14
+ public eventBridgeClient: EventBridgeClient;
15
+ public EVENT_BUS_NAME: string;
16
+
17
+ constructor (eventBusName: string) {
18
+ this.eventBridgeClient = new EventBridgeClient(eventBusName);
19
+ this.EVENT_BUS_NAME = eventBusName;
20
+ }
21
+
22
+ public sendPostmarkEmailEvent = async (eventSource: string, postmarkMessage: Message, postmarkServerToken: string) => {
23
+ return await this.eventBridgeClient.buildAndSendEvent(
24
+ eventSource,
25
+ ADTRACKIFY_EVENT_BRIDGE_EVENTS.SEND_POSTMARK_EMAIL,
26
+ {
27
+ postmarkMessage,
28
+ postmarkRequestType: PostmarkRequestType.SINGLE_EMAIL,
29
+ postmarkServerToken
30
+ });
31
+ };
32
+
33
+ public sendPostmarkTemplatedEmailEvent = async (eventSource: string, postmarkMessage: TemplatedMessage, postmarkServerToken: string) => {
34
+ return await this.eventBridgeClient.buildAndSendEvent(
35
+ eventSource,
36
+ ADTRACKIFY_EVENT_BRIDGE_EVENTS.SEND_POSTMARK_EMAIL,
37
+ {
38
+ postmarkMessage,
39
+ postmarkRequestType: PostmarkRequestType.TEMPLATE_EMAIL,
40
+ postmarkServerToken
41
+ });
42
+ };
43
+
44
+ }
@@ -1,10 +1,10 @@
1
- export enum ADTRACKIFY_EVENT_TYPES {
2
- NOTIFY_SHOPIFY_SUBSCRIPTION_CREATED = 'shopifySubscriptionCreated',
3
- NOTIFY_SUBSCRIPTION_SIGNUP_COMPLETED = 'subscription.signupCompleted',
4
- REQUEST_SET_ACCOUNT_OWNER = 'setAccountOwner',
5
- REQUEST_SET_ACCOUNT_SUBSCRIPTION_ID = 'setAccountSubscriptionId',
6
- }
7
-
8
- export enum ADTRACKIFY_EVENT_SOURCES {
9
- SUBSCRIPTIONS = 'subscriptions',
1
+ export enum ADTRACKIFY_EVENT_TYPES {
2
+ NOTIFY_SHOPIFY_SUBSCRIPTION_CREATED = 'shopifySubscriptionCreated',
3
+ NOTIFY_SUBSCRIPTION_SIGNUP_COMPLETED = 'subscription.signupCompleted',
4
+ REQUEST_SET_ACCOUNT_OWNER = 'setAccountOwner',
5
+ REQUEST_SET_ACCOUNT_SUBSCRIPTION_ID = 'setAccountSubscriptionId',
6
+ }
7
+
8
+ export enum ADTRACKIFY_EVENT_SOURCES {
9
+ SUBSCRIPTIONS = 'subscriptions',
10
10
  }