@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
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# action-destinations
|
|
2
2
|
|
|
3
|
-
Destination definitions and their actions
|
|
3
|
+
Destination definitions and their actions.
|
|
4
4
|
|
|
5
5
|
## License
|
|
6
6
|
|
|
@@ -8,7 +8,6 @@ MIT License
|
|
|
8
8
|
|
|
9
9
|
Copyright (c) 2024 Segment
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
12
|
of this software and associated documentation files (the "Software"), to deal
|
|
14
13
|
in the Software without restriction, including without limitation the rights
|
|
@@ -91,37 +91,32 @@ const destination = {
|
|
|
91
91
|
if (!personas) {
|
|
92
92
|
throw new actions_core_1.IntegrationError('Missing computation parameters: Id and Key', 'MISSING_REQUIRED_FIELD', 400);
|
|
93
93
|
}
|
|
94
|
-
const audience_id = personas.computation_id;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
account_settings: {
|
|
104
|
-
section_id: settings.sectionId,
|
|
105
|
-
api_key: settings.accessKey
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
audience_id: helpers_1.hashAndEncodeToInt(audience_id),
|
|
109
|
-
audience_name: audience_name,
|
|
110
|
-
action: 'add'
|
|
94
|
+
const audience_id = helpers_1.hashAndEncodeToInt(personas.computation_id);
|
|
95
|
+
const json = {
|
|
96
|
+
type: 'audience_subscription_request',
|
|
97
|
+
id: uuid_1.v4(),
|
|
98
|
+
timestamp_ms: new Date().getTime(),
|
|
99
|
+
account: {
|
|
100
|
+
account_settings: {
|
|
101
|
+
section_id: settings.sectionId,
|
|
102
|
+
api_key: settings.accessKey
|
|
111
103
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
throw new actions_core_1.IntegrationError(`Failed to create Audience in Dynamic Yield -
|
|
104
|
+
},
|
|
105
|
+
audience_id: audience_id,
|
|
106
|
+
audience_name: audience_name,
|
|
107
|
+
action: 'add'
|
|
108
|
+
};
|
|
109
|
+
const response = await request(helpers_1.getCreateAudienceURL(settings.dataCenter), {
|
|
110
|
+
method: 'POST',
|
|
111
|
+
json
|
|
112
|
+
});
|
|
113
|
+
const responseData = await response.json();
|
|
114
|
+
if (!responseData.id) {
|
|
115
|
+
throw new actions_core_1.IntegrationError(`Failed to create Audience in Dynamic Yield - responseData.id null or undefined`, 'DYNAMIC_YIELD_AUDIENCE_CREATION_FAILED', 400);
|
|
124
116
|
}
|
|
117
|
+
return {
|
|
118
|
+
externalId: String(audience_id)
|
|
119
|
+
};
|
|
125
120
|
},
|
|
126
121
|
async getAudience(_, getAudienceInput) {
|
|
127
122
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/dynamic-yield-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAEvF,kEAAyC;AACzC,uCAAoE;AACpE,uCAA2C;AAO3C,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,wFAAwF;IACrG,cAAc,EAAE;QACd,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,oEAAoE;SAClF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,iPAAiP;SACpP;KACF;IACD,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QA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;IACH,CAAC;IACD,cAAc,EAAE;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,kBAAkB,EAAE,KAAK;SAC1B;QAED,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB;YAC/C,MAAM,EACJ,QAAQ,EACR,gBAAgB,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,EACnD,GAMG,mBAAmB,CAAA;YAEvB,IAAI,CAAC,aAAa,EAAE;gBAClB,MAAM,IAAI,+BAAgB,CAAC,uBAAuB,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;aACnF;YAED,IAAI,CAAC,QAAQ,EAAE;gBACb,MAAM,IAAI,+BAAgB,CAAC,4CAA4C,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;aACxG;YAED,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/dynamic-yield-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAEvF,kEAAyC;AACzC,uCAAoE;AACpE,uCAA2C;AAO3C,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,wFAAwF;IACrG,cAAc,EAAE;QACd,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,oEAAoE;SAClF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,iPAAiP;SACpP;KACF;IACD,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,QAAQ;gB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CAAC,WAAW,CAAC,CAAC,EAAE,gBAAgB;YACnC,OAAO;gBAEL,UAAU,EAAE,gBAAgB,CAAC,UAAU;aACxC,CAAA;QACH,CAAC;KACF;IACD,OAAO,EAAE;QACP,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -32,7 +32,7 @@ const action = {
|
|
|
32
32
|
label: 'External Audience ID',
|
|
33
33
|
description: 'Unique Audience Identifier returned by the createAudience() function call.',
|
|
34
34
|
required: true,
|
|
35
|
-
unsafe_hidden:
|
|
35
|
+
unsafe_hidden: false,
|
|
36
36
|
default: {
|
|
37
37
|
'@path': '$.context.personas.external_audience_id'
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ const action = {
|
|
|
41
41
|
label: 'Audience Key',
|
|
42
42
|
description: 'Segment Audience key / name',
|
|
43
43
|
type: 'string',
|
|
44
|
-
unsafe_hidden:
|
|
44
|
+
unsafe_hidden: false,
|
|
45
45
|
required: true,
|
|
46
46
|
default: {
|
|
47
47
|
'@path': '$.context.personas.computation_key'
|
|
@@ -51,7 +51,7 @@ const action = {
|
|
|
51
51
|
label: 'Traits or Properties',
|
|
52
52
|
description: 'Traits or Properties object',
|
|
53
53
|
type: 'object',
|
|
54
|
-
unsafe_hidden:
|
|
54
|
+
unsafe_hidden: false,
|
|
55
55
|
required: true,
|
|
56
56
|
default: {
|
|
57
57
|
'@if': {
|
|
@@ -136,38 +136,39 @@ const action = {
|
|
|
136
136
|
throw new actions_core_1.IntegrationError('Primary Identifier not found', 'MISSING_REQUIRED_FIELD', 400);
|
|
137
137
|
}
|
|
138
138
|
const URL = helpers_1.getUpsertURL(settings.dataCenter);
|
|
139
|
+
const json = {
|
|
140
|
+
type: 'audience_membership_change_request',
|
|
141
|
+
id: payload.message_id,
|
|
142
|
+
timestamp_ms: new Date(payload.timestamp).getTime(),
|
|
143
|
+
account: {
|
|
144
|
+
account_settings: {
|
|
145
|
+
section_id: settings.sectionId,
|
|
146
|
+
identifier_type: identifierType,
|
|
147
|
+
accessKey: settings.accessKey
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
user_profiles: [
|
|
151
|
+
{
|
|
152
|
+
user_identities: [
|
|
153
|
+
{
|
|
154
|
+
type: identifierType,
|
|
155
|
+
encoding: identifierType === 'email' ? '"sha-256"' : 'raw',
|
|
156
|
+
value: identifierType === 'email' ? helpers_1.hashAndEncode(primaryIdentifier) : primaryIdentifier
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
audiences: [
|
|
160
|
+
{
|
|
161
|
+
audience_id: Number(external_audience_id),
|
|
162
|
+
audience_name: audienceName,
|
|
163
|
+
action: audienceValue ? 'add' : 'delete'
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
};
|
|
139
169
|
return request(URL, {
|
|
140
170
|
method: 'post',
|
|
141
|
-
json
|
|
142
|
-
type: 'audience_membership_change_request',
|
|
143
|
-
id: payload.message_id,
|
|
144
|
-
timestamp_ms: new Date(payload.timestamp).getTime(),
|
|
145
|
-
account: {
|
|
146
|
-
account_settings: {
|
|
147
|
-
section_id: settings.sectionId,
|
|
148
|
-
identifier_type: identifierType,
|
|
149
|
-
accessKey: settings.accessKey
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
user_profiles: [
|
|
153
|
-
{
|
|
154
|
-
user_identities: [
|
|
155
|
-
{
|
|
156
|
-
type: identifierType,
|
|
157
|
-
encoding: identifierType === 'email' ? '"sha-256"' : 'raw',
|
|
158
|
-
value: identifierType === 'email' ? helpers_1.hashAndEncode(primaryIdentifier) : primaryIdentifier
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
audiences: [
|
|
162
|
-
{
|
|
163
|
-
audience_id: external_audience_id,
|
|
164
|
-
audience_name: audienceName,
|
|
165
|
-
action: audienceValue ? 'add' : 'delete'
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
+
json
|
|
171
172
|
});
|
|
172
173
|
}
|
|
173
174
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/dynamic-yield-audiences/syncAudience/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,wCAAwD;AAExD,MAAM,MAAM,GAA0D;IACpE,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,qCAAqC;IAC1D,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,UAAU;YAChB,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,4EAA4E;YACzF,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/dynamic-yield-audiences/syncAudience/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,wCAAwD;AAExD,MAAM,MAAM,GAA0D;IACpE,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,qCAAqC;IAC1D,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;YACd,aAAa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,eAAe,EAAE,cAAc;oBAC/B,SAAS,EAAE,QAAQ,CAAC,SAAS;iBAC9B;aACF;YACD,aAAa,EAAE;gBACb;oBACE,eAAe,EAAE;wBACf;4BACE,IAAI,EAAE,cAAc;4BACpB,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK;4BAC1D,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,uBAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB;yBACzF;qBACF;oBACD,SAAS,EAAE;wBACT;4BACE,WAAW,EAAE,MAAM,CAAC,oBAAoB,CAAC;4BACzC,aAAa,EAAE,YAAY;4BAC3B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;yBACzC;qBACF;iBACF;aACF;SACF,CAAA;QAED,OAAO,OAAO,CAAC,GAAG,EAAE;YAClB,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.destinationDefinition = void 0;
|
|
4
|
+
const sendEmail_1 = require("./sendEmail");
|
|
5
|
+
const previewApiLookup_1 = require("./previewApiLookup");
|
|
6
|
+
exports.destinationDefinition = {
|
|
7
|
+
name: 'Engage Messaging SendGrid',
|
|
8
|
+
slug: 'actions-personas-messaging-sendgrid',
|
|
9
|
+
mode: 'cloud',
|
|
10
|
+
description: 'This is an Engage specific action to send an email',
|
|
11
|
+
authentication: {
|
|
12
|
+
scheme: 'custom',
|
|
13
|
+
fields: {
|
|
14
|
+
unlayerApiKey: {
|
|
15
|
+
label: 'Unlayer API Key',
|
|
16
|
+
type: 'password',
|
|
17
|
+
description: 'The API key for your Unlayer account'
|
|
18
|
+
},
|
|
19
|
+
sendGridApiKey: {
|
|
20
|
+
label: 'API Key',
|
|
21
|
+
type: 'password',
|
|
22
|
+
description: 'The Api Key for your SendGrid account',
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
profileApiEnvironment: {
|
|
26
|
+
label: 'Profile API Environment',
|
|
27
|
+
description: 'Profile API Environment',
|
|
28
|
+
type: 'string',
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
profileApiAccessToken: {
|
|
32
|
+
label: 'Profile API Access Token',
|
|
33
|
+
description: 'Profile API Access Token',
|
|
34
|
+
type: 'password',
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
spaceId: {
|
|
38
|
+
label: 'Space ID',
|
|
39
|
+
description: 'Space ID',
|
|
40
|
+
type: 'string',
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
sourceId: {
|
|
44
|
+
label: 'Source ID',
|
|
45
|
+
description: 'Source ID',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
region: {
|
|
50
|
+
label: 'Region',
|
|
51
|
+
description: 'The region where the email is originating from',
|
|
52
|
+
type: 'string',
|
|
53
|
+
choices: [
|
|
54
|
+
{ value: 'us-west-2', label: 'US West 2' },
|
|
55
|
+
{ value: 'eu-west-1', label: 'EU West 1' }
|
|
56
|
+
],
|
|
57
|
+
default: 'us-west-2',
|
|
58
|
+
required: false
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
testAuthentication: (request) => {
|
|
62
|
+
return request('https://api.sendgrid.com/v3/mail_settings');
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
actions: {
|
|
66
|
+
sendEmail: sendEmail_1.actionDefinition,
|
|
67
|
+
previewApiLookup: previewApiLookup_1.actionDefinition
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=destinationDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destinationDefinition.js","sourceRoot":"","sources":["../../../../src/destinations/engage/sendgrid/destinationDefinition.ts"],"names":[],"mappings":";;;AAEA,2CAA2D;AAC3D,yDAAyE;AAE5D,QAAA,qBAAqB,GAAoC;IACpE,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,qCAAqC;IAC3C,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,oDAAoD;IACjE,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,aAAa,EAAE;gBACb,KAAK,EAAE,iBAAiB;gBACxB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,sCAAsC;aACpD;YACD,cAAc,EAAE;gBACd,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,uCAAuC;gBACpD,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EAAE,yBAAyB;gBACtC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,0BAA0B;gBACjC,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,gDAAgD;gBAC7D,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC1C,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC3C;gBACD,OAAO,EAAE,WAAW;gBACpB,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,2CAA2C,CAAC,CAAA;QAC7D,CAAC;KACF;IACD,OAAO,EAAE;QACP,SAAS,EAAT,4BAAS;QACT,gBAAgB,EAAhB,mCAAgB;KACjB;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../engage-messaging-sendgrid/generated-types';
|
|
@@ -0,0 +1,14 @@
|
|
|
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("../../engage-messaging-sendgrid/generated-types"), exports);
|
|
14
|
+
//# sourceMappingURL=generated-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/engage/sendgrid/generated-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kFAA+D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/engage/sendgrid/index.ts"],"names":[],"mappings":";;AAAA,mEAA+D;AAC/D,kBAAe,6CAAqB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.actionDefinition = void 0;
|
|
4
|
+
const apiLookups_1 = require("../../utils/apiLookups");
|
|
5
|
+
exports.actionDefinition = {
|
|
6
|
+
title: 'Perform a single API lookup',
|
|
7
|
+
description: 'Perform a single API lookup and return the response',
|
|
8
|
+
fields: {
|
|
9
|
+
...apiLookups_1.apiLookupActionFields,
|
|
10
|
+
traits: {
|
|
11
|
+
label: 'Traits',
|
|
12
|
+
description: "A user profile's traits",
|
|
13
|
+
type: 'object',
|
|
14
|
+
required: false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
perform: async (request, { settings, payload, statsContext, logger }) => {
|
|
18
|
+
const statsClient = statsContext?.statsClient;
|
|
19
|
+
const tags = statsContext?.tags ?? [];
|
|
20
|
+
const { traits = {}, ...apiLookupConfig } = payload;
|
|
21
|
+
const profile = { traits: traits };
|
|
22
|
+
const data = await apiLookups_1.performApiLookup(request, apiLookupConfig, profile, statsClient, tags, settings, logger);
|
|
23
|
+
return {
|
|
24
|
+
data
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=actionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionDefinition.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/actionDefinition.ts"],"names":[],"mappings":";;;AAGA,uDAAgF;AAGnE,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,6BAA6B;IACpC,WAAW,EAAE,qDAAqD;IAClE,MAAM,EAAE;QACN,GAAG,kCAAqB;QACxB,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE;QACtE,MAAM,WAAW,GAAG,YAAY,EAAE,WAAW,CAAA;QAC7C,MAAM,IAAI,GAAG,YAAY,EAAE,IAAI,IAAI,EAAE,CAAA;QACrC,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAA;QACnD,MAAM,OAAO,GAAY,EAAE,MAAM,EAAE,MAAgC,EAAE,CAAA;QACrE,MAAM,IAAI,GAAG,MAAM,6BAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC3G,OAAO;YACL,IAAI;SACL,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../engage-messaging-sendgrid/previewApiLookup.types';
|
|
@@ -0,0 +1,14 @@
|
|
|
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("../../../engage-messaging-sendgrid/previewApiLookup.types"), exports);
|
|
14
|
+
//# sourceMappingURL=generated-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/generated-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4FAAyE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './actionDefinition';
|
|
@@ -0,0 +1,14 @@
|
|
|
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("./actionDefinition"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ExtId, MessageSendPerformer, OperationContext, ResponseError } from '../../utils';
|
|
2
|
+
import type { Settings } from '../generated-types';
|
|
3
|
+
import type { Payload } from './generated-types';
|
|
4
|
+
import { Profile } from '../../utils/Profile';
|
|
5
|
+
import { Liquid as LiquidJs } from 'liquidjs';
|
|
6
|
+
import { ApiLookupConfig, apiLookupLiquidKey } from '../../utils/apiLookups';
|
|
7
|
+
export declare const EXTERNAL_ID_KEY = "email";
|
|
8
|
+
export declare const Liquid: LiquidJs;
|
|
9
|
+
export declare class SendEmailPerformer extends MessageSendPerformer<Settings, Payload> {
|
|
10
|
+
getIntegrationStatsName(): string;
|
|
11
|
+
getChannelType(): string;
|
|
12
|
+
getDefaultSettingsRegion(): string;
|
|
13
|
+
isSupportedExternalId(externalId: ExtId<Payload>): boolean;
|
|
14
|
+
isExternalIdSubscribed(extId: ExtId<Payload>): boolean | undefined;
|
|
15
|
+
getRecepients(): ExtId<Payload>[];
|
|
16
|
+
parseTemplating(content: string, liquidData: {
|
|
17
|
+
profile: Profile;
|
|
18
|
+
[apiLookupLiquidKey]?: Record<string, unknown>;
|
|
19
|
+
}, contentType: string): Promise<any>;
|
|
20
|
+
sendToRecepient(emailProfile: ExtId<Payload>): Promise<import("@segment/actions-core").ModifiedResponse<unknown> | undefined>;
|
|
21
|
+
getBodyTemplateFromS3(bodyUrl: string): Promise<string>;
|
|
22
|
+
getBodyHtml(profile: Profile, apiLookupData: Record<string, unknown>, emailProfile: {
|
|
23
|
+
id?: string | undefined;
|
|
24
|
+
type?: string | undefined;
|
|
25
|
+
subscriptionStatus?: string | undefined;
|
|
26
|
+
unsubscribeLink?: string | undefined;
|
|
27
|
+
preferencesLink?: string | undefined;
|
|
28
|
+
groups?: {
|
|
29
|
+
id?: string | undefined;
|
|
30
|
+
isSubscribed?: boolean | undefined;
|
|
31
|
+
groupUnsubscribeLink?: string | undefined;
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
}): Promise<string>;
|
|
34
|
+
generateEmailHtml(design: string): Promise<string>;
|
|
35
|
+
performApiLookups(this: SendEmailPerformer, apiLookups: ApiLookupConfig[] | undefined, profile: Profile): Promise<Record<string, unknown>>;
|
|
36
|
+
validateLinkAndLog(link: string): void;
|
|
37
|
+
insertUnsubscribeLinks(html: string, emailProfile: EmailProfile): string;
|
|
38
|
+
onResponse(args: {
|
|
39
|
+
response?: Response;
|
|
40
|
+
error?: ResponseError;
|
|
41
|
+
operation: OperationContext;
|
|
42
|
+
}): void;
|
|
43
|
+
}
|
|
44
|
+
export declare type EmailProfile = ExtId<Payload>;
|