@segment/action-destinations 3.284.0 → 3.284.1-channels-1094.49
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/README.md +1 -2
- package/dist/destinations/dynamic-yield-audiences/index.js +24 -29
- package/dist/destinations/dynamic-yield-audiences/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js +34 -33
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/destinationDefinition.d.ts +3 -0
- package/dist/destinations/engage/sendgrid/destinationDefinition.js +70 -0
- package/dist/destinations/engage/sendgrid/destinationDefinition.js.map +1 -0
- package/dist/destinations/engage/sendgrid/generated-types.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/generated-types.js +14 -0
- package/dist/destinations/engage/sendgrid/generated-types.js.map +1 -0
- package/dist/destinations/engage/sendgrid/index.d.ts +2 -0
- package/dist/destinations/engage/sendgrid/index.js +5 -0
- package/dist/destinations/engage/sendgrid/index.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.d.ts +4 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js +28 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js +14 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.js +14 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.d.ts +44 -0
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +419 -0
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.d.ts +12 -0
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js +3 -0
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.d.ts +4 -0
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js +257 -0
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js +14 -0
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/index.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/index.js +14 -0
- package/dist/destinations/engage/sendgrid/sendEmail/index.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js +23 -0
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js +14 -0
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js.map +1 -0
- package/dist/destinations/engage/twilio/destinationDefinition.d.ts +3 -0
- package/dist/destinations/engage/twilio/destinationDefinition.js +172 -0
- package/dist/destinations/engage/twilio/destinationDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/index.d.ts +2 -0
- package/dist/destinations/engage/twilio/index.js +5 -0
- package/dist/destinations/engage/twilio/index.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.d.ts +28 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +151 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.d.ts +4 -0
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js +250 -0
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/index.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/index.js +14 -0
- package/dist/destinations/engage/twilio/sendMobilePush/index.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.d.ts +9 -0
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +72 -0
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/actionDefinition.d.ts +4 -0
- package/dist/destinations/engage/twilio/sendSms/actionDefinition.js +162 -0
- package/dist/destinations/engage/twilio/sendSms/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendSms/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/sendSms/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/index.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendSms/index.js +14 -0
- package/dist/destinations/engage/twilio/sendSms/index.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.d.ts +9 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js +89 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.d.ts +4 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js +136 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/index.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/index.js +14 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/index.js.map +1 -0
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.d.ts +16 -0
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +71 -0
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.d.ts +16 -0
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +115 -0
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/utils/index.d.ts +2 -0
- package/dist/destinations/engage/twilio/utils/index.js +15 -0
- package/dist/destinations/engage/twilio/utils/index.js.map +1 -0
- package/dist/destinations/engage/twilio/utils/types.d.ts +23 -0
- package/dist/destinations/engage/twilio/utils/types.js +3 -0
- package/dist/destinations/engage/twilio/utils/types.js.map +1 -0
- package/dist/destinations/engage/utils/AggregateError.d.ts +14 -0
- package/dist/destinations/engage/utils/AggregateError.js +26 -0
- package/dist/destinations/engage/utils/AggregateError.js.map +1 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +42 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.js +148 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -0
- package/dist/destinations/engage/utils/EngageLogger.d.ts +18 -0
- package/dist/destinations/engage/utils/EngageLogger.js +52 -0
- package/dist/destinations/engage/utils/EngageLogger.js.map +1 -0
- package/dist/destinations/engage/utils/EngageStats.d.ts +18 -0
- package/dist/destinations/engage/utils/EngageStats.js +95 -0
- package/dist/destinations/engage/utils/EngageStats.js.map +1 -0
- package/dist/destinations/engage/utils/IntegrationErrorWrapper.d.ts +12 -0
- package/dist/destinations/engage/utils/IntegrationErrorWrapper.js +31 -0
- package/dist/destinations/engage/utils/IntegrationErrorWrapper.js.map +1 -0
- package/dist/destinations/engage/utils/MessageSendPerformer.d.ts +68 -0
- package/dist/destinations/engage/utils/MessageSendPerformer.js +274 -0
- package/dist/destinations/engage/utils/MessageSendPerformer.js.map +1 -0
- package/dist/destinations/engage/utils/Profile.d.ts +6 -0
- package/dist/destinations/engage/utils/Profile.js +3 -0
- package/dist/destinations/engage/utils/Profile.js.map +1 -0
- package/dist/destinations/engage/utils/ResponseError.d.ts +25 -0
- package/dist/destinations/engage/utils/ResponseError.js +22 -0
- package/dist/destinations/engage/utils/ResponseError.js.map +1 -0
- package/dist/destinations/engage/utils/apiLookups.d.ts +22 -0
- package/dist/destinations/engage/utils/apiLookups.js +189 -0
- package/dist/destinations/engage/utils/apiLookups.js.map +1 -0
- package/dist/destinations/engage/utils/getProfileApiEndpoint.d.ts +2 -0
- package/dist/destinations/engage/utils/getProfileApiEndpoint.js +10 -0
- package/dist/destinations/engage/utils/getProfileApiEndpoint.js.map +1 -0
- package/dist/destinations/engage/utils/index.d.ts +9 -0
- package/dist/destinations/engage/utils/index.js +22 -0
- package/dist/destinations/engage/utils/index.js.map +1 -0
- package/dist/destinations/engage/utils/isDestinationActionService.d.ts +1 -0
- package/dist/destinations/engage/utils/isDestinationActionService.js +8 -0
- package/dist/destinations/engage/utils/isDestinationActionService.js.map +1 -0
- package/dist/destinations/engage/utils/isRetryableError.d.ts +2 -0
- package/dist/destinations/engage/utils/isRetryableError.js +33 -0
- package/dist/destinations/engage/utils/isRetryableError.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.d.ts +1 -0
- package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js +3 -0
- package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDecorator.d.ts +46 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js +46 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDuration.d.ts +12 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDuration.js +23 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDuration.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.d.ts +12 -0
- package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js +35 -0
- package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.d.ts +14 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js +31 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationLogger.d.ts +31 -0
- package/dist/destinations/engage/utils/operationTracking/OperationLogger.js +104 -0
- package/dist/destinations/engage/utils/operationTracking/OperationLogger.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationStats.d.ts +39 -0
- package/dist/destinations/engage/utils/operationTracking/OperationStats.js +130 -0
- package/dist/destinations/engage/utils/operationTracking/OperationStats.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.d.ts +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js +377 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTree.d.ts +23 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTree.js +49 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTree.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/TrackedError.d.ts +6 -0
- package/dist/destinations/engage/utils/operationTracking/TrackedError.js +3 -0
- package/dist/destinations/engage/utils/operationTracking/TrackedError.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/index.d.ts +10 -0
- package/dist/destinations/engage/utils/operationTracking/index.js +23 -0
- package/dist/destinations/engage/utils/operationTracking/index.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.d.ts +21 -0
- package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js +99 -0
- package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js.map +1 -0
- package/dist/destinations/engage/utils/testUtils.d.ts +6 -0
- package/dist/destinations/engage/utils/testUtils.js +26 -0
- package/dist/destinations/engage/utils/testUtils.js.map +1 -0
- package/dist/destinations/engage/utils/track.d.ts +52 -0
- package/dist/destinations/engage/utils/track.js +9 -0
- package/dist/destinations/engage/utils/track.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.d.ts +3 -3
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.js +9 -9
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.d.ts +16 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.d.ts +2 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.js +1 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.d.ts +56 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.d.ts +39 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms.types.d.ts +27 -0
- package/dist/destinations/engage-messaging-twilio/sendSms.types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendSms.types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.d.ts +25 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js.map +1 -0
- package/dist/destinations/first-party-dv360/addToList/generated-types.d.ts +2 -0
- package/dist/destinations/first-party-dv360/addToList/generated-types.js +3 -0
- package/dist/destinations/first-party-dv360/addToList/generated-types.js.map +1 -0
- package/dist/destinations/first-party-dv360/addToList/index.d.ts +5 -0
- package/dist/destinations/first-party-dv360/addToList/index.js +11 -0
- package/dist/destinations/first-party-dv360/addToList/index.js.map +1 -0
- package/dist/destinations/first-party-dv360/generated-types.d.ts +2 -0
- package/dist/destinations/first-party-dv360/generated-types.js +3 -0
- package/dist/destinations/first-party-dv360/generated-types.js.map +1 -0
- package/dist/destinations/first-party-dv360/index.d.ts +4 -0
- package/dist/destinations/first-party-dv360/index.js +38 -0
- package/dist/destinations/first-party-dv360/index.js.map +1 -0
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/intercom/identifyContact/index.js +18 -0
- package/dist/destinations/intercom/identifyContact/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +1 -0
- package/dist/destinations/linkedin-conversions/api/index.js +4 -1
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/taboola-actions/syncAudience/index.js +7 -3
- package/dist/destinations/taboola-actions/syncAudience/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationTracker.test.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationTracker.test.ts"],"names":[],"mappings":";;;;;;;;AAEA,uDAA2E;AAC3E,qDAAwE;AACxE,6DAA+E;AAI/E,MAAM,UAAW,SAAQ,iCAAe;IAAxC;;QACE,YAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;QACnB,aAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAItB,CAAC;IAHC,MAAM,CAAC,sBAAsB,CAAC,GAA2B;QACvD,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAA;IAC5B,CAAC;CACF;AAED,MAAM,SAAU,SAAQ,+BAAc;IAAtC;;QACE,UAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAInB,CAAC;IAHC,MAAM,CAAC,sBAAsB,CAAC,GAA0B;QACtD,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAA;IAC3B,CAAC;CACF;AAED,MAAM,SAAS,GAAG,uCAAkB,CAAC,iCAAiC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;AAK7F,SAAS,eAAe,CACtB,aAA4C,EAC5C,cAAuC,EACvC,YAAqB;IAErB,MAAM,gBAAgB;QAAtB;YACE,WAAM,GAAG,IAAI,UAAU,EAAE,CAAA;YACzB,UAAK,GAAG,IAAI,SAAS,EAAE,CAAA;YAEvB,mBAAc,GAAG,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,CAAA;QAa1C,CAAC;QAVC,UAAU,CAAC,GAAG,IAAW;YAEvB,MAAM,QAAQ,GAAG,IAAI,CAAA;YACrB,IAAI,YAAY;gBACd,OAAO,CAAC,KAAK,IAAI,EAAE;oBACjB,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,C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,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAW,EAAE,EAAE;gBAC9D,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,IAAI,CAAA;gBAC7B,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;YAC7D,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,cAAc,EAAE;gBACnB,MAAM,IAAI,KAAK,CACb,6CAA6C,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,IAAI,CAAC,KAAK;qBACvG,GAAG,CAAC,CAAC,IAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBACrC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAA;aACF;SACF;AACL,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ContextFromHookProviders, FuncFromHookProviders, OperationHookProvider } from './OperationDecorator';
|
|
2
|
+
import { TryCatchFinallyHook, TryCatchFinallyContext } from './wrapTryCatchFinallyPromisable';
|
|
3
|
+
declare type OperationTreeContext<TParentContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TParentContext & {
|
|
4
|
+
parent?: OperationTreeContext<TParentContext>;
|
|
5
|
+
sharedContext: {};
|
|
6
|
+
};
|
|
7
|
+
export declare class OperationTree {
|
|
8
|
+
static getTryCatchFinallyHook(_ctx: OperationTreeContext): TryCatchFinallyHook<OperationTreeContext>;
|
|
9
|
+
static getPriority(): number;
|
|
10
|
+
static onTry(ctx: OperationTreeContext): void;
|
|
11
|
+
static onFinally(ctx: OperationTreeContext): () => void;
|
|
12
|
+
static getCurrentOperationFromTrackedClassInstance<TClassInstance>(classInstance: TClassInstance): OperationTreeContext<TryCatchFinallyContext<(this: any, ...args: any[]) => any>>;
|
|
13
|
+
static getCurrentOperationFromContext(ctx: OperationTreeContext): OperationTreeContext<TryCatchFinallyContext<(this: any, ...args: any[]) => any>>;
|
|
14
|
+
protected static setCurrentOperationToContext(ctx: OperationTreeContext, newCurrentOperation: OperationTreeContext | undefined): void;
|
|
15
|
+
static getOperationsStack<TContext extends OperationTreeContext>(ctx: TContext): TContext[];
|
|
16
|
+
static getDecoratorUtils(): {
|
|
17
|
+
getCurrentOperation(classInstance: any): OperationTreeContext | undefined;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare type CanGetCurrentOperation<TOperationHookProviders extends OperationHookProvider[]> = {
|
|
21
|
+
getCurrentOperation(classInstance: ThisParameterType<FuncFromHookProviders<TOperationHookProviders>>): ContextFromHookProviders<TOperationHookProviders> | undefined;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationTree = void 0;
|
|
4
|
+
class OperationTree {
|
|
5
|
+
static getTryCatchFinallyHook(_ctx) {
|
|
6
|
+
return this;
|
|
7
|
+
}
|
|
8
|
+
static getPriority() {
|
|
9
|
+
return -1;
|
|
10
|
+
}
|
|
11
|
+
static onTry(ctx) {
|
|
12
|
+
const parent = this.getCurrentOperationFromContext(ctx);
|
|
13
|
+
ctx.sharedContext = parent?.sharedContext || {};
|
|
14
|
+
ctx.parent = parent;
|
|
15
|
+
this.setCurrentOperationToContext(ctx, ctx);
|
|
16
|
+
}
|
|
17
|
+
static onFinally(ctx) {
|
|
18
|
+
return () => {
|
|
19
|
+
this.setCurrentOperationToContext(ctx, ctx.parent);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
static getCurrentOperationFromTrackedClassInstance(classInstance) {
|
|
23
|
+
return classInstance?.currentOperation;
|
|
24
|
+
}
|
|
25
|
+
static getCurrentOperationFromContext(ctx) {
|
|
26
|
+
return ctx.funcThis.currentOperation;
|
|
27
|
+
}
|
|
28
|
+
static setCurrentOperationToContext(ctx, newCurrentOperation) {
|
|
29
|
+
ctx.funcThis.currentOperation = newCurrentOperation;
|
|
30
|
+
}
|
|
31
|
+
static getOperationsStack(ctx) {
|
|
32
|
+
const stack = [];
|
|
33
|
+
let current = ctx;
|
|
34
|
+
while (current) {
|
|
35
|
+
stack.unshift(current);
|
|
36
|
+
current = current.parent;
|
|
37
|
+
}
|
|
38
|
+
return stack;
|
|
39
|
+
}
|
|
40
|
+
static getDecoratorUtils() {
|
|
41
|
+
return {
|
|
42
|
+
getCurrentOperation(classInstance) {
|
|
43
|
+
return classInstance?.currentOperation;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.OperationTree = OperationTree;
|
|
49
|
+
//# sourceMappingURL=OperationTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationTree.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationTree.ts"],"names":[],"mappings":";;;AAWA,MAAa,aAAa;IACxB,MAAM,CAAC,sBAAsB,CAAC,IAA0B;QAEtD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,CAAC,WAAW;QAChB,OAAO,CAAC,CAAC,CAAA;IACX,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,GAAyB;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,CAAA;QACvD,GAAG,CAAC,aAAa,GAAG,MAAM,EAAE,aAAa,IAAI,EAAE,CAAA;QAC/C,GAAG,CAAC,MAAM,GAAG,MAAM,CAAA;QACnB,IAAI,CAAC,4BAA4B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC7C,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,GAAyB;QACxC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,4BAA4B,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;QACpD,CAAC,CAAA;IACH,CAAC;IACD,MAAM,CAAC,2CAA2C,CAAiB,aAA6B;QAE9F,OAAQ,aAAqB,EAAE,gBAAwC,CAAA;IACzE,CAAC;IACD,MAAM,CAAC,8BAA8B,CAAC,GAAyB;QAC7D,OAAO,GAAG,CAAC,QAAQ,CAAC,gBAAwC,CAAA;IAC9D,CAAC;IACS,MAAM,CAAC,4BAA4B,CAC3C,GAAyB,EACzB,mBAAqD;QAErD,GAAG,CAAC,QAAQ,CAAC,gBAAgB,GAAG,mBAAmB,CAAA;IACrD,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAwC,GAAa;QAC5E,MAAM,KAAK,GAAe,EAAE,CAAA;QAC5B,IAAI,OAAO,GAAG,GAAG,CAAA;QACjB,OAAO,OAAO,EAAE;YACd,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;YAEtB,OAAO,GAAG,OAAO,CAAC,MAAkB,CAAA;SACrC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,CAAC,iBAAiB;QACtB,OAAO;YAEL,mBAAmB,CAAC,aAAkB;gBACpC,OAAO,aAAa,EAAE,gBAAgB,CAAA;YACxC,CAAC;SACF,CAAA;IACH,CAAC;CACF;AApDD,sCAoDC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TryCatchFinallyContext } from './wrapTryCatchFinallyPromisable';
|
|
2
|
+
export interface TrackedError<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> extends Error {
|
|
3
|
+
underlyingError?: unknown;
|
|
4
|
+
trackedContext?: TContext;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackedError.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/TrackedError.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './wrapTryCatchFinallyPromisable';
|
|
2
|
+
export * from './OperationDecorator';
|
|
3
|
+
export * from './GenericMethodDecorator';
|
|
4
|
+
export * from './OperationTree';
|
|
5
|
+
export * from './OperationFinallyHooks';
|
|
6
|
+
export * from './OperationLogger';
|
|
7
|
+
export * from './OperationDuration';
|
|
8
|
+
export * from './OperationStats';
|
|
9
|
+
export * from './OperationErrorHandler';
|
|
10
|
+
export * from './TrackedError';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./wrapTryCatchFinallyPromisable"), exports);
|
|
14
|
+
__exportStar(require("./OperationDecorator"), exports);
|
|
15
|
+
__exportStar(require("./GenericMethodDecorator"), exports);
|
|
16
|
+
__exportStar(require("./OperationTree"), exports);
|
|
17
|
+
__exportStar(require("./OperationFinallyHooks"), exports);
|
|
18
|
+
__exportStar(require("./OperationLogger"), exports);
|
|
19
|
+
__exportStar(require("./OperationDuration"), exports);
|
|
20
|
+
__exportStar(require("./OperationStats"), exports);
|
|
21
|
+
__exportStar(require("./OperationErrorHandler"), exports);
|
|
22
|
+
__exportStar(require("./TrackedError"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAA+C;AAC/C,uDAAoC;AACpC,2DAAwC;AACxC,kDAA+B;AAC/B,0DAAuC;AACvC,oDAAiC;AACjC,sDAAmC;AACnC,mDAAgC;AAChC,0DAAuC;AACvC,iDAA8B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TryCatchFinallyContext<TFunc extends (this: any, ...args: any[]) => any = (this: any, ...args: any[]) => any> {
|
|
2
|
+
func: TFunc;
|
|
3
|
+
funcArgs: Parameters<TFunc>;
|
|
4
|
+
funcThis: ThisParameterType<TFunc>;
|
|
5
|
+
result?: ReturnType<TFunc> | Awaited<ReturnType<TFunc>>;
|
|
6
|
+
error?: unknown;
|
|
7
|
+
stage: 'try' | 'success' | 'catch' | 'finally';
|
|
8
|
+
}
|
|
9
|
+
export interface TryCatchFinallyHook<TContext extends TryCatchFinallyContext<any> = TryCatchFinallyContext<(...args: any[]) => any>> {
|
|
10
|
+
onTry?(ctx: TContext): void | (() => void);
|
|
11
|
+
onSuccess?(ctx: TContext): void | (() => void);
|
|
12
|
+
onCatch?(ctx: TContext): void | (() => void);
|
|
13
|
+
onFinally?(ctx: TContext): void | (() => void);
|
|
14
|
+
getPriority?(ctx: TContext): number | void;
|
|
15
|
+
}
|
|
16
|
+
export declare type FuncFromTryCatchFinallyContext<TWrapContext extends TryCatchFinallyContext<any>> = TWrapContext extends TryCatchFinallyContext<infer TFunc> ? TFunc : never;
|
|
17
|
+
export declare const DefaultHookPriority = 0;
|
|
18
|
+
export declare function wrapTryCatchFinallyPromisable<TFunc extends (...args: any[]) => any, TContext extends TryCatchFinallyContext<TFunc> = TryCatchFinallyContext<TFunc>, THooks extends TryCatchFinallyHook<TContext>[] = TryCatchFinallyHook<TContext>[]>(func: TFunc, getHooks: (ctx: TContext) => THooks, onHookError?: (e: unknown) => unknown | undefined): TFunc;
|
|
19
|
+
export declare type Awaited<T> = T extends null | undefined ? T : T extends object & {
|
|
20
|
+
then(onfulfilled: infer F, ...args: infer _): any;
|
|
21
|
+
} ? F extends (value: infer V, ...args: infer _) => any ? Awaited<V> : never : T;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapTryCatchFinallyPromisable = exports.DefaultHookPriority = void 0;
|
|
4
|
+
exports.DefaultHookPriority = 0;
|
|
5
|
+
function wrapTryCatchFinallyPromisable(func, getHooks, onHookError) {
|
|
6
|
+
function forEachHook(hooks, inContext, doThis) {
|
|
7
|
+
const prioritizedHooks = Object.values(hooks).sort((h1, h2) => {
|
|
8
|
+
const p1 = h1.getPriority ? h1.getPriority(inContext) : exports.DefaultHookPriority;
|
|
9
|
+
const p2 = h2.getPriority ? h2.getPriority(inContext) : exports.DefaultHookPriority;
|
|
10
|
+
return (p1 === undefined ? exports.DefaultHookPriority : p1) - (p2 === undefined ? exports.DefaultHookPriority : p2);
|
|
11
|
+
});
|
|
12
|
+
const postCallbacks = [];
|
|
13
|
+
for (const hook of prioritizedHooks) {
|
|
14
|
+
try {
|
|
15
|
+
const callback = doThis(hook);
|
|
16
|
+
if (callback instanceof Function)
|
|
17
|
+
postCallbacks.push(callback);
|
|
18
|
+
}
|
|
19
|
+
catch (hookError) {
|
|
20
|
+
let errorToThrow = hookError;
|
|
21
|
+
if (onHookError)
|
|
22
|
+
errorToThrow = onHookError(errorToThrow);
|
|
23
|
+
if (errorToThrow)
|
|
24
|
+
throw errorToThrow;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
for (const callback of postCallbacks.reverse()) {
|
|
28
|
+
try {
|
|
29
|
+
callback();
|
|
30
|
+
}
|
|
31
|
+
catch (callbackError) {
|
|
32
|
+
let errorToThrow = callbackError;
|
|
33
|
+
if (onHookError)
|
|
34
|
+
errorToThrow = onHookError(errorToThrow);
|
|
35
|
+
if (errorToThrow)
|
|
36
|
+
throw errorToThrow;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return function (...funcArgs) {
|
|
41
|
+
const ctx = {
|
|
42
|
+
funcArgs: funcArgs,
|
|
43
|
+
funcThis: this,
|
|
44
|
+
func,
|
|
45
|
+
stage: 'try'
|
|
46
|
+
};
|
|
47
|
+
let isPromise = false;
|
|
48
|
+
const hooks = getHooks(ctx);
|
|
49
|
+
try {
|
|
50
|
+
forEachHook(hooks, ctx, (hook) => hook.onTry?.(ctx));
|
|
51
|
+
const funcResMayBePromise = func.apply(this, funcArgs);
|
|
52
|
+
isPromise = isValuePromise(funcResMayBePromise);
|
|
53
|
+
if (isPromise) {
|
|
54
|
+
const wrappedPromise = (async () => {
|
|
55
|
+
try {
|
|
56
|
+
ctx.result = await funcResMayBePromise;
|
|
57
|
+
ctx.stage = 'success';
|
|
58
|
+
forEachHook(hooks, ctx, (hook) => hook.onSuccess?.(ctx));
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
ctx.stage = 'catch';
|
|
62
|
+
ctx.error = error;
|
|
63
|
+
forEachHook(hooks, ctx, (hook) => hook.onCatch?.(ctx));
|
|
64
|
+
if (ctx.error)
|
|
65
|
+
throw ctx.error;
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
ctx.stage = 'finally';
|
|
69
|
+
forEachHook(hooks, ctx, (hook) => hook.onFinally?.(ctx));
|
|
70
|
+
}
|
|
71
|
+
return ctx.result;
|
|
72
|
+
})();
|
|
73
|
+
return wrappedPromise;
|
|
74
|
+
}
|
|
75
|
+
ctx.result = funcResMayBePromise;
|
|
76
|
+
ctx.stage = 'success';
|
|
77
|
+
forEachHook(hooks, ctx, (hook) => hook.onSuccess?.(ctx));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
ctx.stage = 'catch';
|
|
81
|
+
ctx.error = error;
|
|
82
|
+
forEachHook(hooks, ctx, (hook) => hook.onCatch?.(ctx));
|
|
83
|
+
if (ctx.error)
|
|
84
|
+
throw ctx.error;
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
if (!isPromise) {
|
|
88
|
+
ctx.stage = 'finally';
|
|
89
|
+
forEachHook(hooks, ctx, (hook) => hook.onFinally?.(ctx));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return ctx.result;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
exports.wrapTryCatchFinallyPromisable = wrapTryCatchFinallyPromisable;
|
|
96
|
+
function isValuePromise(obj) {
|
|
97
|
+
return obj instanceof Object && 'then' in obj && typeof obj.then === 'function';
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=wrapTryCatchFinallyPromisable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapTryCatchFinallyPromisable.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.ts"],"names":[],"mappings":";;;AA+Ba,QAAA,mBAAmB,GAAG,CAAC,CAAA;AASpC,SAAgB,6BAA6B,CAI3C,IAAW,EAAE,QAAmC,EAAE,WAAiD;IAEnG,SAAS,WAAW,CAAC,KAAa,EAAE,SAAmB,EAAE,MAA2C;QAClG,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YAC5D,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,2BAAmB,CAAA;YAC3E,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,2BAAmB,CAAA;YAC3E,OAAO,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,2BAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,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EAAE;YACd,GAAG,CAAC,KAAK,GAAG,OAAO,CAAA;YACnB,GAAG,CAAC,KAAK,GAAG,KAAK,CAAA;YACjB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YACtD,IAAI,GAAG,CAAC,KAAK;gBAAE,MAAM,GAAG,CAAC,KAAK,CAAA;SAC/B;gBAAS;YACR,IAAI,CAAC,SAAS,EAAE;gBACd,GAAG,CAAC,KAAK,GAAG,SAAS,CAAA;gBACrB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;aACzD;SACF;QACD,OAAO,GAAG,CAAC,MAA2B,CAAA;IACxC,CAAU,CAAA;AACZ,CAAC;AApFD,sEAoFC;AAYD,SAAS,cAAc,CAAc,GAAY;IAM/C,OAAO,GAAG,YAAY,MAAM,IAAI,MAAM,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAA;AACjF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Logger } from '@segment/actions-core/destination-kit';
|
|
2
|
+
export declare function createLoggerMock(): Logger;
|
|
3
|
+
export declare const loggerMock: Logger;
|
|
4
|
+
export declare function expectLogged(logMethod: Function, ...msgs: string[]): void;
|
|
5
|
+
export declare function expectErrorLogged(...msgs: string[]): void;
|
|
6
|
+
export declare function expectInfoLogged(...msgs: string[]): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expectInfoLogged = exports.expectErrorLogged = exports.expectLogged = exports.loggerMock = exports.createLoggerMock = void 0;
|
|
4
|
+
function createLoggerMock() {
|
|
5
|
+
return {
|
|
6
|
+
level: 'error',
|
|
7
|
+
name: 'test',
|
|
8
|
+
error: jest.fn(),
|
|
9
|
+
info: jest.fn()
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
exports.createLoggerMock = createLoggerMock;
|
|
13
|
+
exports.loggerMock = createLoggerMock();
|
|
14
|
+
function expectLogged(logMethod, ...msgs) {
|
|
15
|
+
expect(logMethod).toHaveBeenCalledWith(expect.stringMatching(new RegExp(`(.*)${msgs.join('(.*)')}(.*)`)), expect.anything());
|
|
16
|
+
}
|
|
17
|
+
exports.expectLogged = expectLogged;
|
|
18
|
+
function expectErrorLogged(...msgs) {
|
|
19
|
+
expectLogged(exports.loggerMock.error, ...msgs);
|
|
20
|
+
}
|
|
21
|
+
exports.expectErrorLogged = expectErrorLogged;
|
|
22
|
+
function expectInfoLogged(...msgs) {
|
|
23
|
+
expectLogged(exports.loggerMock.info, ...msgs);
|
|
24
|
+
}
|
|
25
|
+
exports.expectInfoLogged = expectInfoLogged;
|
|
26
|
+
//# sourceMappingURL=testUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testUtils.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/testUtils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gBAAgB;IAC9B,OAAO;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,IAAI,CAAC,EAAE,EAAqB;QACnC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAoB;KACxB,CAAA;AACb,CAAC;AAPD,4CAOC;AAEY,QAAA,UAAU,GAAG,gBAAgB,EAAE,CAAA;AAE5C,SAAgB,YAAY,CAAC,SAAmB,EAAE,GAAG,IAAc;IACjE,MAAM,CAAC,SAAS,CAAC,CAAC,oBAAoB,CACpC,MAAM,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EACjE,MAAM,CAAC,QAAQ,EAAE,CAClB,CAAA;AACH,CAAC;AALD,oCAKC;AAED,SAAgB,iBAAiB,CAAC,GAAG,IAAc;IACjD,YAAY,CAAC,kBAAU,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAA;AACzC,CAAC;AAFD,8CAEC;AACD,SAAgB,gBAAgB,CAAC,GAAG,IAAc;IAChD,YAAY,CAAC,kBAAU,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAA;AACxC,CAAC;AAFD,4CAEC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ContextFromDecorator } from './operationTracking';
|
|
2
|
+
export declare const track: ((decoratorArgs?: ({
|
|
3
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
4
|
+
} & {
|
|
5
|
+
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
8
|
+
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
9
|
+
} & import("./operationTracking").OperationLoggerDecoratorArgs & {
|
|
10
|
+
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
11
|
+
}) | undefined) => import("./operationTracking").GenericMethodDecorator<(this: any, ...args: any[]) => any>) & {
|
|
12
|
+
getCurrentOperation(classInstance: any): (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
13
|
+
parent?: (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
|
|
14
|
+
sharedContext: {};
|
|
15
|
+
}) | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
_contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
18
|
+
tags: string[];
|
|
19
|
+
sharedContext: {
|
|
20
|
+
tags: string[];
|
|
21
|
+
};
|
|
22
|
+
decoratorArgs?: {
|
|
23
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
decoratorArgs?: {
|
|
27
|
+
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
parent?: (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
|
|
31
|
+
sharedContext: {};
|
|
32
|
+
} & {
|
|
33
|
+
start?: number | undefined;
|
|
34
|
+
duration?: number | undefined;
|
|
35
|
+
} & {
|
|
36
|
+
onFinally: (() => void)[];
|
|
37
|
+
decoratorArgs?: {
|
|
38
|
+
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
39
|
+
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
logs: string[];
|
|
43
|
+
logMetadata?: Record<string, unknown> | undefined;
|
|
44
|
+
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
45
|
+
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
46
|
+
} & {
|
|
47
|
+
decoratorArgs?: {
|
|
48
|
+
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare type OperationContext = ContextFromDecorator<typeof track>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.track = void 0;
|
|
4
|
+
const operationTracking_1 = require("./operationTracking");
|
|
5
|
+
const EngageStats_1 = require("./EngageStats");
|
|
6
|
+
const EngageLogger_1 = require("./EngageLogger");
|
|
7
|
+
const IntegrationErrorWrapper_1 = require("./IntegrationErrorWrapper");
|
|
8
|
+
exports.track = operationTracking_1.OperationDecorator.createDecoratorFactoryWithDefault(EngageLogger_1.EngageLogger, EngageStats_1.EngageStats, IntegrationErrorWrapper_1.IntegrationErrorWrapper);
|
|
9
|
+
//# sourceMappingURL=track.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/track.ts"],"names":[],"mappings":";;;AAEA,2DAA8E;AAC9E,+CAA2C;AAC3C,iDAA6C;AAC7C,uEAAmE;AAEtD,QAAA,KAAK,GAAG,sCAAkB,CAAC,iCAAiC,CACvE,2BAAY,EACZ,yBAAW,EACX,iDAAuB,CACxB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputField } from '@segment/actions-core';
|
|
2
2
|
import { RequestClient } from '@segment/actions-core';
|
|
3
|
-
import { Logger, StatsClient,
|
|
3
|
+
import type { Logger, StatsClient, EngageDestinationCache } from '@segment/actions-core/destination-kit';
|
|
4
4
|
import type { Settings } from '../generated-types';
|
|
5
5
|
import { Profile } from '@segment/actions-shared';
|
|
6
6
|
export declare type ApiLookupConfig = {
|
|
@@ -15,8 +15,8 @@ export declare type ApiLookupConfig = {
|
|
|
15
15
|
shouldRetryOnRetryableError?: boolean;
|
|
16
16
|
};
|
|
17
17
|
export declare const getRequestId: ({ method, url, body, headers }: ApiLookupConfig) => string;
|
|
18
|
-
export declare const getCachedResponse: ({ responseType }: ApiLookupConfig, requestId: string,
|
|
19
|
-
export declare const performApiLookup: (request: RequestClient, apiLookupConfig: ApiLookupConfig, profile: Profile, statsClient: StatsClient | undefined, tags: string[], settings: Settings, logger?: Logger | undefined,
|
|
18
|
+
export declare const getCachedResponse: ({ responseType }: ApiLookupConfig, requestId: string, engageDestinationCache: EngageDestinationCache, datafeedTags: string[]) => Promise<any>;
|
|
19
|
+
export declare const performApiLookup: (request: RequestClient, apiLookupConfig: ApiLookupConfig, profile: Profile, statsClient: StatsClient | undefined, tags: string[], settings: Settings, logger?: Logger | undefined, engageDestinationCache?: EngageDestinationCache | undefined) => Promise<any>;
|
|
20
20
|
export declare const apiLookupActionFields: Record<string, InputField>;
|
|
21
21
|
export declare const apiLookupLiquidKey = "datafeeds";
|
|
22
22
|
export declare const FLAGON_NAME_DATA_FEEDS = "is-datafeeds-enabled";
|
|
@@ -36,8 +36,8 @@ const getRequestId = ({ method, url, body, headers }) => {
|
|
|
36
36
|
return requestId;
|
|
37
37
|
};
|
|
38
38
|
exports.getRequestId = getRequestId;
|
|
39
|
-
const getCachedResponse = async ({ responseType }, requestId,
|
|
40
|
-
const cachedResponse = await
|
|
39
|
+
const getCachedResponse = async ({ responseType }, requestId, engageDestinationCache, datafeedTags) => {
|
|
40
|
+
const cachedResponse = await engageDestinationCache.getByKey(requestId);
|
|
41
41
|
if (!cachedResponse) {
|
|
42
42
|
datafeedTags.push('cache_hit:false');
|
|
43
43
|
return;
|
|
@@ -49,7 +49,7 @@ const getCachedResponse = async ({ responseType }, requestId, dataFeedCache, dat
|
|
|
49
49
|
return cachedResponse;
|
|
50
50
|
};
|
|
51
51
|
exports.getCachedResponse = getCachedResponse;
|
|
52
|
-
const performApiLookup = async (request, apiLookupConfig, profile, statsClient, tags, settings, logger,
|
|
52
|
+
const performApiLookup = async (request, apiLookupConfig, profile, statsClient, tags, settings, logger, engageDestinationCache) => {
|
|
53
53
|
const { id, method, headers, cacheTtl, name, shouldRetryOnRetryableError = true } = apiLookupConfig;
|
|
54
54
|
const datafeedTags = [
|
|
55
55
|
...tags,
|
|
@@ -65,13 +65,13 @@ const performApiLookup = async (request, apiLookupConfig, profile, statsClient,
|
|
|
65
65
|
try {
|
|
66
66
|
const { renderedUrl, renderedBody } = await renderLiquidFields(apiLookupConfig, profile, datafeedTags, logDataFeedError);
|
|
67
67
|
const requestId = exports.getRequestId({ ...apiLookupConfig, url: renderedUrl, body: renderedBody });
|
|
68
|
-
if (cacheTtl > 0 && !
|
|
68
|
+
if (cacheTtl > 0 && !engageDestinationCache) {
|
|
69
69
|
logDataFeedError('Data feed cache not available and cache needed');
|
|
70
70
|
datafeedTags.push('cache_set:false');
|
|
71
71
|
throw new actions_core_1.IntegrationError('Data feed cache not available and cache needed', 'DATA_FEED_CACHE_NOT_AVAILABLE', 400);
|
|
72
72
|
}
|
|
73
|
-
if (cacheTtl > 0 &&
|
|
74
|
-
const cachedResponse = await exports.getCachedResponse(apiLookupConfig, requestId,
|
|
73
|
+
if (cacheTtl > 0 && engageDestinationCache) {
|
|
74
|
+
const cachedResponse = await exports.getCachedResponse(apiLookupConfig, requestId, engageDestinationCache, datafeedTags);
|
|
75
75
|
if (cachedResponse) {
|
|
76
76
|
datafeedTags.push('error:false');
|
|
77
77
|
return cachedResponse;
|
|
@@ -97,16 +97,16 @@ const performApiLookup = async (request, apiLookupConfig, profile, statsClient,
|
|
|
97
97
|
}
|
|
98
98
|
return {};
|
|
99
99
|
}
|
|
100
|
-
if (cacheTtl > 0 &&
|
|
100
|
+
if (cacheTtl > 0 && engageDestinationCache) {
|
|
101
101
|
const dataString = JSON.stringify(data);
|
|
102
102
|
const size = Buffer.byteLength(dataString, 'utf-8');
|
|
103
|
-
if (size >
|
|
103
|
+
if (size > engageDestinationCache.maxValueSizeBytes) {
|
|
104
104
|
datafeedTags.push('error:true', 'reason:response_size_too_big');
|
|
105
105
|
logDataFeedError('Data feed response size too big too cache and caching needed, failing send');
|
|
106
106
|
throw new actions_core_1.IntegrationError('Data feed response size too big too cache and caching needed, failing send', 'DATA_FEED_RESPONSE_TOO_BIG', 400);
|
|
107
107
|
}
|
|
108
108
|
try {
|
|
109
|
-
await
|
|
109
|
+
await engageDestinationCache.setByKey(requestId, dataString, cacheTtl / 1000);
|
|
110
110
|
datafeedTags.push('cache_set:true');
|
|
111
111
|
}
|
|
112
112
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiLookups.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,wDAAwD;AAKxD,uCAA6C;AAG7C,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"apiLookups.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,wDAAwD;AAKxD,uCAA6C;AAG7C,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAmB7B,MAAM,kBAAkB,GAAG,KAAK,EAC9B,EAAE,GAAG,EAAE,IAAI,EAAyC,EACpD,OAAgB,EAChB,YAAsB,EACtB,gBAAkC,EAClC,EAAE;IACF,IAAI,WAAmB,CAAA;IACvB,IAAI,YAAgC,CAAA;IACpC,IAAI;QACF,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;KAC5D;IAAC,OAAO,KAAK,EAAE;QACd,gBAAgB,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAA;QACrD,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,0BAA0B,EAAE,eAAe,CAAC,CAAA;QAC5E,MAAM,IAAI,+BAAgB,CAAC,+BAA+B,EAAE,2BAA2B,EAAE,GAAG,CAAC,CAAA;KAC9F;IACD,IAAI;QACF,YAAY,GAAG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AI,EAAE,QAAQ;KACf;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,wDAAwD;QACrE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,GAAG,EAAE;QACH,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,MAAM,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,wCAAwC;QACrD,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,uDAAuD;QACpE,IAAI,EAAE,QAAQ;KACf;IACD,OAAO,EAAE;QACP,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,QAAQ;KACf;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,mEAAmE;QAChF,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,2BAA2B,EAAE;QAC3B,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,iJAAiJ;QACnJ,IAAI,EAAE,SAAS;KAChB;CACF,CAAA;AAEY,QAAA,kBAAkB,GAAG,WAAW,CAAA;AAEhC,QAAA,sBAAsB,GAAG,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
url: string;
|
|
5
|
+
method: string;
|
|
6
|
+
cacheTtl: number;
|
|
7
|
+
body?: string;
|
|
8
|
+
headers?: {
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
responseType: string;
|
|
12
|
+
shouldRetryOnRetryableError?: boolean;
|
|
13
|
+
traits?: {
|
|
14
|
+
[k: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewApiLookup.types.js","sourceRoot":"","sources":["../../../src/destinations/engage-messaging-sendgrid/previewApiLookup.types.ts"],"names":[],"mappings":""}
|
|
@@ -2,6 +2,7 @@ import { ExtId, MessageSendPerformer, OperationContext, ResponseError, Profile }
|
|
|
2
2
|
import type { Settings } from '../generated-types';
|
|
3
3
|
import type { Payload } from './generated-types';
|
|
4
4
|
import { Liquid as LiquidJs } from 'liquidjs';
|
|
5
|
+
import { ModifiedResponse } from '@segment/actions-core';
|
|
5
6
|
import { ApiLookupConfig, apiLookupLiquidKey } from '../previewApiLookup/apiLookups';
|
|
6
7
|
export declare const EXTERNAL_ID_KEY = "email";
|
|
7
8
|
export declare const Liquid: LiquidJs;
|
|
@@ -16,7 +17,7 @@ export declare class SendEmailPerformer extends MessageSendPerformer<Settings, P
|
|
|
16
17
|
profile: Profile;
|
|
17
18
|
[apiLookupLiquidKey]?: Record<string, unknown>;
|
|
18
19
|
}, contentType: string): Promise<any>;
|
|
19
|
-
sendToRecepient(emailProfile: ExtId<Payload>): Promise<
|
|
20
|
+
sendToRecepient(emailProfile: ExtId<Payload>): Promise<ModifiedResponse<unknown> | undefined>;
|
|
20
21
|
getBodyTemplateFromS3(bodyUrl: string): Promise<string>;
|
|
21
22
|
getBodyHtml(profile: Profile, apiLookupData: Record<string, unknown>, emailProfile: {
|
|
22
23
|
id?: string | undefined;
|
|
@@ -276,7 +276,7 @@ class SendEmailPerformer extends actions_shared_1.MessageSendPerformer {
|
|
|
276
276
|
}
|
|
277
277
|
const request = this.request.bind(this);
|
|
278
278
|
const data = await Promise.all(apiLookups.map(async (apiLookup) => {
|
|
279
|
-
const data = await apiLookups_1.performApiLookup(request, apiLookup, profile, this.statsClient.statsClient, this.tags, this.settings, this.logger.loggerClient, this.
|
|
279
|
+
const data = await apiLookups_1.performApiLookup(request, apiLookup, profile, this.statsClient.statsClient, this.tags, this.settings, this.logger.loggerClient, this.engageDestinationCache);
|
|
280
280
|
return { name: apiLookup.name, data };
|
|
281
281
|
}));
|
|
282
282
|
return data.reduce((acc, { name, data }) => {
|