@segment/action-destinations 3.281.0 → 3.282.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/amplitude/logPurchase/index.js +16 -1
- package/dist/destinations/amplitude/logPurchase/index.js.map +1 -1
- package/dist/destinations/courier/audienceToList/generated-types.d.ts +11 -0
- package/dist/destinations/{engage-messaging-sendgrid/sendEmail.types.js → courier/audienceToList/generated-types.js} +1 -1
- package/dist/destinations/courier/audienceToList/generated-types.js.map +1 -0
- package/dist/destinations/courier/audienceToList/index.d.ts +9 -0
- package/dist/destinations/courier/audienceToList/index.js +107 -0
- package/dist/destinations/courier/audienceToList/index.js.map +1 -0
- package/dist/destinations/courier/index.d.ts +1 -0
- package/dist/destinations/courier/index.js +19 -1
- package/dist/destinations/courier/index.js.map +1 -1
- package/dist/destinations/courier/postToCourier/generated-types.d.ts +1 -0
- package/dist/destinations/courier/postToCourier/index.js +14 -6
- package/dist/destinations/courier/postToCourier/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/generated-types.d.ts +1 -1
- package/dist/destinations/dynamic-yield-audiences/index.js +19 -20
- package/dist/destinations/dynamic-yield-audiences/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/syncAudience/generated-types.d.ts +1 -1
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js +26 -16
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/index.d.ts +4 -3
- package/dist/destinations/engage-messaging-sendgrid/index.js +68 -16
- package/dist/destinations/engage-messaging-sendgrid/index.js.map +1 -1
- package/dist/destinations/{engage/utils → engage-messaging-sendgrid/previewApiLookup}/apiLookups.d.ts +2 -2
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio/sendSms.types.js → engage-messaging-sendgrid/previewApiLookup/generated-types.js} +1 -1
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/generated-types.js.map +1 -0
- package/dist/destinations/{engage/twilio/sendMobilePush/actionDefinition.d.ts → engage-messaging-sendgrid/previewApiLookup/index.d.ts} +1 -0
- package/dist/destinations/{engage/sendgrid/previewApiLookup/actionDefinition.js → engage-messaging-sendgrid/previewApiLookup/index.js} +3 -2
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/index.js.map +1 -0
- package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/SendEmailPerformer.d.ts +2 -3
- package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/SendEmailPerformer.js +10 -10
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/UnlayerResponse.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js.map +1 -0
- package/dist/destinations/{engage/sendgrid/sendEmail/actionDefinition.d.ts → engage-messaging-sendgrid/sendEmail/index.d.ts} +1 -0
- package/dist/destinations/{engage/sendgrid/sendEmail/actionDefinition.js → engage-messaging-sendgrid/sendEmail/index.js} +3 -2
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/insertEmailPreviewText.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/isRestrictedDomain.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/index.d.ts +4 -3
- package/dist/destinations/engage-messaging-twilio/index.js +169 -15
- package/dist/destinations/engage-messaging-twilio/index.js.map +1 -1
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/sendMobilePush/PushSender.d.ts +1 -1
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/sendMobilePush/PushSender.js +2 -2
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/PushSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.js.map +1 -0
- package/dist/destinations/{engage/twilio/sendWhatsApp/actionDefinition.d.ts → engage-messaging-twilio/sendMobilePush/index.d.ts} +1 -0
- package/dist/destinations/{engage/twilio/sendMobilePush/actionDefinition.js → engage-messaging-twilio/sendMobilePush/index.js} +2 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/index.js.map +1 -0
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/sendSms/SmsMessageSender.d.ts +1 -1
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/sendSms/SmsMessageSender.js +2 -2
- package/dist/destinations/engage-messaging-twilio/sendSms/SmsMessageSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js.map +1 -0
- package/dist/destinations/{engage/twilio/sendSms/actionDefinition.d.ts → engage-messaging-twilio/sendSms/index.d.ts} +1 -0
- package/dist/destinations/{engage/twilio/sendSms/actionDefinition.js → engage-messaging-twilio/sendSms/index.js} +2 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -0
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/sendWhatsApp/WhatsAppMessageSender.js +4 -4
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.d.ts +5 -0
- package/dist/destinations/{engage/twilio/sendWhatsApp/actionDefinition.js → engage-messaging-twilio/sendWhatsApp/index.js} +2 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +1 -0
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/PhoneMessageSender.d.ts +1 -1
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/PhoneMessageSender.js +2 -2
- package/dist/destinations/engage-messaging-twilio/utils/PhoneMessageSender.js.map +1 -0
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/TwilioMessageSender.d.ts +1 -1
- package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/TwilioMessageSender.js +6 -6
- package/dist/destinations/engage-messaging-twilio/utils/TwilioMessageSender.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/index.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/types.js.map +1 -0
- package/dist/destinations/google-sheets/postSheet/generated-types.d.ts +0 -1
- package/dist/destinations/google-sheets/postSheet/index.js +5 -13
- package/dist/destinations/google-sheets/postSheet/index.js.map +1 -1
- package/dist/destinations/google-sheets-dev/postSheet.types.d.ts +0 -1
- package/dist/destinations/klaviyo/functions.d.ts +1 -1
- package/dist/destinations/klaviyo/properties.js +1 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js +4 -5
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/loops/sendEvent/generated-types.d.ts +3 -0
- package/dist/destinations/loops/sendEvent/index.js +9 -1
- package/dist/destinations/loops/sendEvent/index.js.map +1 -1
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.js +15 -1
- package/dist/destinations/pinterest-conversions/pinterset-capi-user-data.js.map +1 -1
- package/dist/destinations/pinterest-conversions/reportConversionEvent/generated-types.d.ts +2 -0
- package/dist/destinations/segment/index.js +1 -5
- package/dist/destinations/segment/index.js.map +1 -1
- package/dist/destinations/segment/properties.d.ts +0 -4
- package/dist/destinations/segment/properties.js +1 -14
- package/dist/destinations/segment/properties.js.map +1 -1
- package/dist/destinations/taboola-actions/index.js +10 -11
- package/dist/destinations/taboola-actions/index.js.map +1 -1
- package/dist/destinations/taboola-actions/syncAudience/client.d.ts +8 -3
- package/dist/destinations/taboola-actions/syncAudience/client.js +22 -2
- package/dist/destinations/taboola-actions/syncAudience/client.js.map +1 -1
- package/dist/destinations/taboola-actions/syncAudience/index.js +1 -13
- package/dist/destinations/taboola-actions/syncAudience/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/common_fields.js +86 -1
- package/dist/destinations/tiktok-conversions/common_fields.js.map +1 -1
- package/dist/destinations/tiktok-conversions/formatter.d.ts +2 -0
- package/dist/destinations/tiktok-conversions/formatter.js +16 -1
- package/dist/destinations/tiktok-conversions/formatter.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +8 -0
- package/dist/destinations/tiktok-conversions/utils.js +7 -1
- package/dist/destinations/tiktok-conversions/utils.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/engage/sendgrid/destinationDefinition.d.ts +0 -3
- package/dist/destinations/engage/sendgrid/destinationDefinition.js +0 -70
- package/dist/destinations/engage/sendgrid/destinationDefinition.js.map +0 -1
- package/dist/destinations/engage/sendgrid/generated-types.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/generated-types.js +0 -14
- package/dist/destinations/engage/sendgrid/generated-types.js.map +0 -1
- package/dist/destinations/engage/sendgrid/index.d.ts +0 -2
- package/dist/destinations/engage/sendgrid/index.js +0 -5
- package/dist/destinations/engage/sendgrid/index.js.map +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.d.ts +0 -4
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js.map +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js +0 -14
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js.map +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.js +0 -14
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js +0 -14
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/index.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/index.js +0 -14
- package/dist/destinations/engage/sendgrid/sendEmail/index.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js.map +0 -1
- package/dist/destinations/engage/twilio/destinationDefinition.d.ts +0 -3
- package/dist/destinations/engage/twilio/destinationDefinition.js +0 -172
- package/dist/destinations/engage/twilio/destinationDefinition.js.map +0 -1
- package/dist/destinations/engage/twilio/generated-types.d.ts +0 -1
- package/dist/destinations/engage/twilio/generated-types.js +0 -14
- package/dist/destinations/engage/twilio/generated-types.js.map +0 -1
- package/dist/destinations/engage/twilio/index.d.ts +0 -2
- package/dist/destinations/engage/twilio/index.js +0 -5
- package/dist/destinations/engage/twilio/index.js.map +0 -1
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +0 -1
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +0 -1
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.d.ts +0 -1
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js +0 -14
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js.map +0 -1
- package/dist/destinations/engage/twilio/sendMobilePush/index.d.ts +0 -1
- package/dist/destinations/engage/twilio/sendMobilePush/index.js +0 -14
- package/dist/destinations/engage/twilio/sendMobilePush/index.js.map +0 -1
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/sendSms/actionDefinition.js.map +0 -1
- package/dist/destinations/engage/twilio/sendSms/generated-types.d.ts +0 -1
- package/dist/destinations/engage/twilio/sendSms/generated-types.js +0 -14
- package/dist/destinations/engage/twilio/sendSms/generated-types.js.map +0 -1
- package/dist/destinations/engage/twilio/sendSms/index.d.ts +0 -1
- package/dist/destinations/engage/twilio/sendSms/index.js +0 -14
- package/dist/destinations/engage/twilio/sendSms/index.js.map +0 -1
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js.map +0 -1
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.d.ts +0 -1
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js +0 -14
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js.map +0 -1
- package/dist/destinations/engage/twilio/sendWhatsApp/index.d.ts +0 -1
- package/dist/destinations/engage/twilio/sendWhatsApp/index.js +0 -14
- package/dist/destinations/engage/twilio/sendWhatsApp/index.js.map +0 -1
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/utils/index.js.map +0 -1
- package/dist/destinations/engage/twilio/utils/types.js.map +0 -1
- package/dist/destinations/engage/utils/AggregateError.d.ts +0 -14
- package/dist/destinations/engage/utils/AggregateError.js +0 -26
- package/dist/destinations/engage/utils/AggregateError.js.map +0 -1
- package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +0 -42
- package/dist/destinations/engage/utils/EngageActionPerformer.js +0 -148
- package/dist/destinations/engage/utils/EngageActionPerformer.js.map +0 -1
- package/dist/destinations/engage/utils/EngageLogger.d.ts +0 -18
- package/dist/destinations/engage/utils/EngageLogger.js +0 -52
- package/dist/destinations/engage/utils/EngageLogger.js.map +0 -1
- package/dist/destinations/engage/utils/EngageStats.d.ts +0 -18
- package/dist/destinations/engage/utils/EngageStats.js +0 -95
- package/dist/destinations/engage/utils/EngageStats.js.map +0 -1
- package/dist/destinations/engage/utils/IntegrationErrorWrapper.d.ts +0 -12
- package/dist/destinations/engage/utils/IntegrationErrorWrapper.js +0 -31
- package/dist/destinations/engage/utils/IntegrationErrorWrapper.js.map +0 -1
- package/dist/destinations/engage/utils/MessageSendPerformer.d.ts +0 -65
- package/dist/destinations/engage/utils/MessageSendPerformer.js +0 -211
- package/dist/destinations/engage/utils/MessageSendPerformer.js.map +0 -1
- package/dist/destinations/engage/utils/Profile.d.ts +0 -6
- package/dist/destinations/engage/utils/Profile.js +0 -3
- package/dist/destinations/engage/utils/Profile.js.map +0 -1
- package/dist/destinations/engage/utils/ResponseError.d.ts +0 -25
- package/dist/destinations/engage/utils/ResponseError.js +0 -22
- package/dist/destinations/engage/utils/ResponseError.js.map +0 -1
- package/dist/destinations/engage/utils/apiLookups.js.map +0 -1
- package/dist/destinations/engage/utils/getProfileApiEndpoint.d.ts +0 -2
- package/dist/destinations/engage/utils/getProfileApiEndpoint.js +0 -10
- package/dist/destinations/engage/utils/getProfileApiEndpoint.js.map +0 -1
- package/dist/destinations/engage/utils/index.d.ts +0 -9
- package/dist/destinations/engage/utils/index.js +0 -22
- package/dist/destinations/engage/utils/index.js.map +0 -1
- package/dist/destinations/engage/utils/isDestinationActionService.d.ts +0 -1
- package/dist/destinations/engage/utils/isDestinationActionService.js +0 -8
- package/dist/destinations/engage/utils/isDestinationActionService.js.map +0 -1
- package/dist/destinations/engage/utils/isRetryableError.d.ts +0 -2
- package/dist/destinations/engage/utils/isRetryableError.js +0 -33
- package/dist/destinations/engage/utils/isRetryableError.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.d.ts +0 -1
- package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js +0 -3
- package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationDecorator.d.ts +0 -46
- package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js +0 -46
- package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationDuration.d.ts +0 -12
- package/dist/destinations/engage/utils/operationTracking/OperationDuration.js +0 -23
- package/dist/destinations/engage/utils/operationTracking/OperationDuration.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.d.ts +0 -12
- package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js +0 -35
- package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.d.ts +0 -14
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js +0 -31
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationLogger.d.ts +0 -31
- package/dist/destinations/engage/utils/operationTracking/OperationLogger.js +0 -104
- package/dist/destinations/engage/utils/operationTracking/OperationLogger.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationStats.d.ts +0 -39
- package/dist/destinations/engage/utils/operationTracking/OperationStats.js +0 -130
- package/dist/destinations/engage/utils/operationTracking/OperationStats.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.d.ts +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js +0 -377
- package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/OperationTree.d.ts +0 -23
- package/dist/destinations/engage/utils/operationTracking/OperationTree.js +0 -49
- package/dist/destinations/engage/utils/operationTracking/OperationTree.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/TrackedError.d.ts +0 -6
- package/dist/destinations/engage/utils/operationTracking/TrackedError.js +0 -3
- package/dist/destinations/engage/utils/operationTracking/TrackedError.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/index.d.ts +0 -10
- package/dist/destinations/engage/utils/operationTracking/index.js +0 -23
- package/dist/destinations/engage/utils/operationTracking/index.js.map +0 -1
- package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.d.ts +0 -21
- package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js +0 -99
- package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js.map +0 -1
- package/dist/destinations/engage/utils/testUtils.d.ts +0 -6
- package/dist/destinations/engage/utils/testUtils.js +0 -26
- package/dist/destinations/engage/utils/testUtils.js.map +0 -1
- package/dist/destinations/engage/utils/track.d.ts +0 -52
- package/dist/destinations/engage/utils/track.js +0 -9
- package/dist/destinations/engage/utils/track.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js +0 -3
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js +0 -3
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms.types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js +0 -3
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js.map +0 -1
- /package/dist/destinations/{engage/utils → engage-messaging-sendgrid/previewApiLookup}/apiLookups.js +0 -0
- /package/dist/destinations/engage-messaging-sendgrid/{previewApiLookup.types.d.ts → previewApiLookup/generated-types.d.ts} +0 -0
- /package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/UnlayerResponse.d.ts +0 -0
- /package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/UnlayerResponse.js +0 -0
- /package/dist/destinations/engage-messaging-sendgrid/{sendEmail.types.d.ts → sendEmail/generated-types.d.ts} +0 -0
- /package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/insertEmailPreviewText.d.ts +0 -0
- /package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/insertEmailPreviewText.js +0 -0
- /package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/isRestrictedDomain.d.ts +0 -0
- /package/dist/destinations/{engage/sendgrid → engage-messaging-sendgrid}/sendEmail/isRestrictedDomain.js +0 -0
- /package/dist/destinations/engage-messaging-twilio/{sendMobilePush.types.d.ts → sendMobilePush/generated-types.d.ts} +0 -0
- /package/dist/destinations/engage-messaging-twilio/{sendSms.types.d.ts → sendSms/generated-types.d.ts} +0 -0
- /package/dist/destinations/{engage/twilio → engage-messaging-twilio}/sendWhatsApp/WhatsAppMessageSender.d.ts +0 -0
- /package/dist/destinations/engage-messaging-twilio/{sendWhatsApp.types.d.ts → sendWhatsApp/generated-types.d.ts} +0 -0
- /package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/index.d.ts +0 -0
- /package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/index.js +0 -0
- /package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/types.d.ts +0 -0
- /package/dist/destinations/{engage/twilio → engage-messaging-twilio}/utils/types.js +0 -0
|
@@ -62,7 +62,22 @@ const action = {
|
|
|
62
62
|
revenue: {
|
|
63
63
|
label: 'Revenue',
|
|
64
64
|
type: 'number',
|
|
65
|
-
description: 'Revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then (price * quantity) will be used as the revenue value. You can use negative values to indicate refunds.'
|
|
65
|
+
description: 'Revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then (price * quantity) will be used as the revenue value. You can use negative values to indicate refunds.',
|
|
66
|
+
depends_on: {
|
|
67
|
+
match: 'any',
|
|
68
|
+
conditions: [
|
|
69
|
+
{
|
|
70
|
+
fieldKey: 'price',
|
|
71
|
+
operator: 'is',
|
|
72
|
+
value: ''
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
fieldKey: 'quantity',
|
|
76
|
+
operator: 'is',
|
|
77
|
+
value: ''
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
66
81
|
},
|
|
67
82
|
productId: {
|
|
68
83
|
label: 'Product ID',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amplitude/logPurchase/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA6D;AAC7D,+DAAsC;AACtC,kDAA6C;AAI7C,gCAA6C;AAC7C,0CAAqD;AACrD,oEAA8D;AAC9D,8CAAwD;AACxD,8DAA2D;AAC3D,4DAAsD;AACtD,8CAA6C;AAW7C,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAA;AAUhF,SAAS,oBAAoB,CAAC,OAAqB;IACjD,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAC7B,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC7E,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAA;KAC3C;IAED,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,EAAE,CAAA;KACV;IAED,OAAO;QACL,OAAO;QACP,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,UAAU;QAC9C,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QACzF,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,6BAA6B;IAC1C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,sBAAsB,EAAE;YACtB,KAAK,EAAE,2BAA2B;YAClC,WAAW,EACT,wHAAwH;YAC1H,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACf;QACD,GAAG,0BAAW;QACd,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,IAAI;YAC1B,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,+IAA+I;iBAClJ;gBACD,QAAQ,EAAE;oBACR,KAAK,EAAE,UAAU;oBACjB,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,qEAAqE;iBACnF;gBACD,OAAO,EAAE;oBACP,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,mMAAmM;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amplitude/logPurchase/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA6D;AAC7D,+DAAsC;AACtC,kDAA6C;AAI7C,gCAA6C;AAC7C,0CAAqD;AACrD,oEAA8D;AAC9D,8CAAwD;AACxD,8DAA2D;AAC3D,4DAAsD;AACtD,8CAA6C;AAW7C,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAA;AAUhF,SAAS,oBAAoB,CAAC,OAAqB;IACjD,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAC7B,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC7E,OAAO,GAAG,OAAO,CA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AS,EAAE,aAAa,CAAC,CAAC;gBAE3E,GAAG,8BAAe,CAAC,UAAU,CAAC;gBAE9B,GAAG,CAAC,QAAQ,CAAC,MAAM,IAAI,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;gBACnF,OAAO,EAAE,SAAS;aACnB;SACF,CAAA;QAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG,UAAU;gBAEb,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChF,gBAAgB,EAAE,OAAO;gBACzB,UAAU,EAAE,mBAAmB;gBAC/B,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;gBAC5F,OAAO,EAAE,SAAS;aACnB,CAAC,CAAA;SACH;QAED,MAAM,QAAQ,GAAG,wCAAmB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAEzG,OAAO,OAAO,CAAC,QAAQ,EAAE;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,OAAO,EAAE,QAAQ,CAAC,MAAM;gBACxB,MAAM;gBACN,OAAO;aACR;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
segment_audience_id: string;
|
|
3
|
+
segment_audience_key: string;
|
|
4
|
+
segment_computation_action: string;
|
|
5
|
+
segment_user_id?: string;
|
|
6
|
+
segment_anonymous_id?: string;
|
|
7
|
+
traits_or_props: {
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
audience_action?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/courier/audienceToList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionDefinition } from '@segment/actions-core';
|
|
2
|
+
import type { Settings } from '../generated-types';
|
|
3
|
+
import type { Payload } from './generated-types';
|
|
4
|
+
export declare const CONSTANTS: {
|
|
5
|
+
ADD: string;
|
|
6
|
+
REMOVE: string;
|
|
7
|
+
};
|
|
8
|
+
declare const action: ActionDefinition<Settings, Payload>;
|
|
9
|
+
export default action;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONSTANTS = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
exports.CONSTANTS = {
|
|
6
|
+
ADD: 'ADD',
|
|
7
|
+
REMOVE: 'REMOVE'
|
|
8
|
+
};
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Sync Audience',
|
|
11
|
+
description: 'Sync Engage Audiences to Courier lists',
|
|
12
|
+
defaultSubscription: 'type = "identify" or type = "track"',
|
|
13
|
+
fields: {
|
|
14
|
+
segment_audience_id: {
|
|
15
|
+
label: 'Audience ID',
|
|
16
|
+
description: 'Segment Audience ID to which user identifier should be added or removed',
|
|
17
|
+
type: 'string',
|
|
18
|
+
unsafe_hidden: true,
|
|
19
|
+
required: true,
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.context.personas.computation_id'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
segment_audience_key: {
|
|
25
|
+
label: 'Audience Key',
|
|
26
|
+
description: 'Segment Audience key to which user identifier should be added or removed',
|
|
27
|
+
type: 'string',
|
|
28
|
+
unsafe_hidden: true,
|
|
29
|
+
required: true,
|
|
30
|
+
default: {
|
|
31
|
+
'@path': '$.context.personas.computation_key'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
segment_computation_action: {
|
|
35
|
+
label: 'Segment Computation Action',
|
|
36
|
+
description: "Segment computation class used to determine if input event is from an Engage Audience'. Value must be = 'audience'.",
|
|
37
|
+
type: 'string',
|
|
38
|
+
unsafe_hidden: true,
|
|
39
|
+
required: true,
|
|
40
|
+
default: {
|
|
41
|
+
'@path': '$.context.personas.computation_class'
|
|
42
|
+
},
|
|
43
|
+
choices: [{ label: 'audience', value: 'audience' }]
|
|
44
|
+
},
|
|
45
|
+
segment_user_id: {
|
|
46
|
+
label: 'Segment User ID',
|
|
47
|
+
description: 'The Segment userId value.',
|
|
48
|
+
type: 'string',
|
|
49
|
+
unsafe_hidden: true,
|
|
50
|
+
required: false,
|
|
51
|
+
default: { '@path': '$.userId' }
|
|
52
|
+
},
|
|
53
|
+
segment_anonymous_id: {
|
|
54
|
+
label: 'Segment Anonymous ID',
|
|
55
|
+
description: 'The Segment anonymousId value.',
|
|
56
|
+
type: 'string',
|
|
57
|
+
unsafe_hidden: true,
|
|
58
|
+
required: false,
|
|
59
|
+
default: { '@path': '$.anonymousId' }
|
|
60
|
+
},
|
|
61
|
+
traits_or_props: {
|
|
62
|
+
label: 'Traits or properties object',
|
|
63
|
+
description: 'A computed object for track and identify events. This field should not need to be edited.',
|
|
64
|
+
type: 'object',
|
|
65
|
+
required: true,
|
|
66
|
+
unsafe_hidden: true,
|
|
67
|
+
default: {
|
|
68
|
+
'@if': {
|
|
69
|
+
exists: { '@path': '$.properties' },
|
|
70
|
+
then: { '@path': '$.properties' },
|
|
71
|
+
else: { '@path': '$.traits' }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
audience_action: {
|
|
76
|
+
label: 'Audience Action',
|
|
77
|
+
description: 'Indicates if the user will be added or removed from the Audience',
|
|
78
|
+
type: 'string',
|
|
79
|
+
unsafe_hidden: true,
|
|
80
|
+
choices: [
|
|
81
|
+
{ label: exports.CONSTANTS.ADD, value: exports.CONSTANTS.ADD },
|
|
82
|
+
{ label: exports.CONSTANTS.REMOVE, value: exports.CONSTANTS.REMOVE }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
perform: (request, { payload, settings }) => {
|
|
87
|
+
return processPayload(request, payload, settings);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const processPayload = (request, payload, settings) => {
|
|
91
|
+
payload.audience_action = payload.traits_or_props[payload.segment_audience_key] ? exports.CONSTANTS.ADD : exports.CONSTANTS.REMOVE;
|
|
92
|
+
const domain = __1.getDomain(settings.region);
|
|
93
|
+
const list_id = `${payload.segment_audience_key}-${payload.segment_audience_id}`;
|
|
94
|
+
const user_id = payload.segment_user_id ?? payload.segment_anonymous_id;
|
|
95
|
+
if (payload.audience_action === exports.CONSTANTS.ADD) {
|
|
96
|
+
return request(`${domain}/lists/${list_id}/subscriptions/${user_id}`, {
|
|
97
|
+
method: 'PUT'
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return request(`${domain}/lists/${list_id}/subscriptions/${user_id}`, {
|
|
102
|
+
method: 'DELETE'
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.default = action;
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/courier/audienceToList/index.ts"],"names":[],"mappings":";;;AAGA,0BAA8B;AAEjB,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;CACjB,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,qCAAqC;IAC1D,MAAM,EAAE;QACN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AC,GAAG,MAAM,UAAU,OAAO,kBAAkB,OAAO,EAAE,EAAE;YACpE,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;KACH;SAAM;QACL,OAAO,OAAO,CAAC,GAAG,MAAM,UAAU,OAAO,kBAAkB,OAAO,EAAE,EAAE;YACpE,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAA;KACH;AACH,CAAC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DestinationDefinition } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from './generated-types';
|
|
3
3
|
declare const destination: DestinationDefinition<Settings>;
|
|
4
|
+
export declare const getDomain: (region: string) => string;
|
|
4
5
|
export default destination;
|
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDomain = void 0;
|
|
6
7
|
const postToCourier_1 = __importDefault(require("./postToCourier"));
|
|
8
|
+
const audienceToList_1 = __importDefault(require("./audienceToList"));
|
|
7
9
|
const destination = {
|
|
8
10
|
name: 'Courier (Actions)',
|
|
9
11
|
slug: 'actions-courier',
|
|
@@ -34,11 +36,27 @@ const destination = {
|
|
|
34
36
|
],
|
|
35
37
|
required: true
|
|
36
38
|
}
|
|
39
|
+
},
|
|
40
|
+
testAuthentication: (request, { settings }) => {
|
|
41
|
+
const domain = exports.getDomain(settings.region);
|
|
42
|
+
return request(`${domain}/debug`, { method: 'POST', headers: { Authorization: `Bearer ${settings.apiKey}` } });
|
|
37
43
|
}
|
|
38
44
|
},
|
|
39
45
|
actions: {
|
|
40
|
-
postToCourier: postToCourier_1.default
|
|
46
|
+
postToCourier: postToCourier_1.default,
|
|
47
|
+
audienceToList: audienceToList_1.default
|
|
48
|
+
},
|
|
49
|
+
extendRequest({ settings }) {
|
|
50
|
+
return {
|
|
51
|
+
headers: {
|
|
52
|
+
Authorization: `Bearer ${settings.apiKey}`,
|
|
53
|
+
'Content-Type': 'application/json',
|
|
54
|
+
'User-Agent': 'SegmentCourier'
|
|
55
|
+
}
|
|
56
|
+
};
|
|
41
57
|
}
|
|
42
58
|
};
|
|
59
|
+
const getDomain = (region) => `https://api.${region === 'EU' ? 'eu.' : ''}courier.com`;
|
|
60
|
+
exports.getDomain = getDomain;
|
|
43
61
|
exports.default = destination;
|
|
44
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/courier/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/courier/index.ts"],"names":[],"mappings":";;;;;;AAGA,oEAA2C;AAC3C,sEAA6C;AAE7C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,wEAAwE;gBACrF,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,IAAI;wBACX,KAAK,EAAE,IAAI;qBACZ;oBACD;wBACE,KAAK,EAAE,IAAI;wBACX,KAAK,EAAE,IAAI;qBACZ;iBACF;gBACD,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,MAAM,MAAM,GAAG,iBAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YACzC,OAAO,OAAO,CAAC,GAAG,MAAM,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAA;QAChH,CAAC;KACF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,cAAc,EAAd,wBAAc;KACf;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,QAAQ,CAAC,MAAM,EAAE;gBAC1C,cAAc,EAAE,kBAAkB;gBAClC,YAAY,EAAE,gBAAgB;aAC/B;SACF,CAAA;IACH,CAAC;CACF,CAAA;AAEM,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,eAAe,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,CAAA;AAAxF,QAAA,SAAS,aAA+E;AAErG,kBAAe,WAAW,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const __1 = require("..");
|
|
4
5
|
const action = {
|
|
5
6
|
title: 'Forward to Courier',
|
|
6
7
|
description: 'Forward track, group and identify events to Courier',
|
|
@@ -13,20 +14,27 @@ const action = {
|
|
|
13
14
|
required: true,
|
|
14
15
|
default: { '@path': '$.' },
|
|
15
16
|
unsafe_hidden: true
|
|
17
|
+
},
|
|
18
|
+
segment_computation_action: {
|
|
19
|
+
label: 'Segment Computation Action',
|
|
20
|
+
description: "Segment computation class used to determine if input event is from an Engage Audience'",
|
|
21
|
+
type: 'string',
|
|
22
|
+
unsafe_hidden: true,
|
|
23
|
+
default: {
|
|
24
|
+
'@path': '$.context.personas.computation_class'
|
|
25
|
+
}
|
|
16
26
|
}
|
|
17
27
|
},
|
|
18
28
|
perform: (request, { settings, payload }) => {
|
|
29
|
+
if (payload?.segment_computation_action === 'audience') {
|
|
30
|
+
throw new actions_core_1.PayloadValidationError('This Action does not support sending Engage Audiences. Please use the Sync Audience Action.');
|
|
31
|
+
}
|
|
19
32
|
if (!['track', 'group', 'identify'].includes(payload.data.type)) {
|
|
20
33
|
throw new actions_core_1.PayloadValidationError('Event type must be either track, group or identify');
|
|
21
34
|
}
|
|
22
|
-
const domain =
|
|
23
|
-
const headers = {
|
|
24
|
-
Authorization: `Bearer ${settings.apiKey}`,
|
|
25
|
-
'Content-Type': 'application/json'
|
|
26
|
-
};
|
|
35
|
+
const domain = __1.getDomain(settings.region);
|
|
27
36
|
return request(`${domain}/inbound/segment`, {
|
|
28
37
|
method: 'POST',
|
|
29
|
-
headers,
|
|
30
38
|
json: payload.data
|
|
31
39
|
});
|
|
32
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/courier/postToCourier/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/courier/postToCourier/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAGhF,0BAA8B;AAE9B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,qDAAqD;IAClE,mBAAmB,EAAE,uDAAuD;IAC5E,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YAC1B,aAAa,EAAE,IAAI;SACpB;QACD,0BAA0B,EAAE;YAC1B,KAAK,EAAE,4BAA4B;YACnC,WAAW,EAAE,wFAAwF;YACrG,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,IAAI;YACnB,OAAO,EAAE;gBACP,OAAO,EAAE,sCAAsC;aAChD;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,IAAI,OAAO,EAAE,0BAA0B,KAAK,UAAU,EAAE;YACtD,MAAM,IAAI,qCAAsB,CAC9B,6FAA6F,CAC9F,CAAA;SACF;QAED,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAc,CAAC,EAAE;YACzE,MAAM,IAAI,qCAAsB,CAAC,oDAAoD,CAAC,CAAA;SACvF;QAED,MAAM,MAAM,GAAG,aAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAEzC,OAAO,OAAO,CAAC,GAAG,MAAM,kBAAkB,EAAE;YAC1C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -7,7 +7,6 @@ const actions_core_1 = require("@segment/actions-core");
|
|
|
7
7
|
const syncAudience_1 = __importDefault(require("./syncAudience"));
|
|
8
8
|
const helpers_1 = require("./helpers");
|
|
9
9
|
const uuid_1 = require("@lukeed/uuid");
|
|
10
|
-
const constants_1 = require("./constants");
|
|
11
10
|
const destination = {
|
|
12
11
|
name: 'Dynamic Yield Audiences',
|
|
13
12
|
slug: 'actions-dynamic-yield-audiences',
|
|
@@ -18,7 +17,13 @@ const destination = {
|
|
|
18
17
|
type: 'string',
|
|
19
18
|
label: 'Audience Name',
|
|
20
19
|
required: true,
|
|
21
|
-
description: '
|
|
20
|
+
description: 'Provide a name for your Audience to be displayed in Dynamic Yield.'
|
|
21
|
+
},
|
|
22
|
+
identifier_type: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
label: 'Identifier Type',
|
|
25
|
+
required: true,
|
|
26
|
+
description: 'The type of Identifier to send to Dynamic Yield. E.g. `email`, `anonymous_id`, `user_id`, or any other custom identifier. Make sure you configure the `Customized Setup` below so that your chosen include identifier is sent to Dynamic Yield.'
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
authentication: {
|
|
@@ -47,18 +52,6 @@ const destination = {
|
|
|
47
52
|
description: 'Description to be added',
|
|
48
53
|
type: 'password',
|
|
49
54
|
required: true
|
|
50
|
-
},
|
|
51
|
-
identifier_type: {
|
|
52
|
-
label: 'Identifier Type',
|
|
53
|
-
description: 'The type of identifier being used to identify the user in Dynamic Yield. Segment hashes the identifier before sending to Dynamic Yield.',
|
|
54
|
-
type: 'string',
|
|
55
|
-
required: true,
|
|
56
|
-
choices: [
|
|
57
|
-
{ label: constants_1.IDENTIFIER_TYPES.EMAIL, value: constants_1.IDENTIFIER_TYPES.EMAIL },
|
|
58
|
-
{ label: constants_1.IDENTIFIER_TYPES.SEGMENT_USER_ID, value: constants_1.IDENTIFIER_TYPES.SEGMENT_USER_ID },
|
|
59
|
-
{ label: constants_1.IDENTIFIER_TYPES.SEGMENT_ANONYMOUS_ID, value: constants_1.IDENTIFIER_TYPES.SEGMENT_ANONYMOUS_ID }
|
|
60
|
-
],
|
|
61
|
-
default: 'Email'
|
|
62
55
|
}
|
|
63
56
|
}
|
|
64
57
|
},
|
|
@@ -91,9 +84,14 @@ const destination = {
|
|
|
91
84
|
full_audience_sync: false
|
|
92
85
|
},
|
|
93
86
|
async createAudience(request, createAudienceInput) {
|
|
94
|
-
const { settings,
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
const { settings, audienceSettings: { audience_name, personas } = {} } = createAudienceInput;
|
|
88
|
+
if (!audience_name) {
|
|
89
|
+
throw new actions_core_1.IntegrationError('Missing Audience Name', 'MISSING_REQUIRED_FIELD', 400);
|
|
90
|
+
}
|
|
91
|
+
if (!personas) {
|
|
92
|
+
throw new actions_core_1.IntegrationError('Missing computation parameters: Id and Key', 'MISSING_REQUIRED_FIELD', 400);
|
|
93
|
+
}
|
|
94
|
+
const audience_id = personas.computation_id;
|
|
97
95
|
try {
|
|
98
96
|
const response = await request(helpers_1.getCreateAudienceURL(settings.dataCenter), {
|
|
99
97
|
method: 'POST',
|
|
@@ -107,8 +105,8 @@ const destination = {
|
|
|
107
105
|
api_key: settings.accessKey
|
|
108
106
|
}
|
|
109
107
|
},
|
|
110
|
-
audience_id: helpers_1.hashAndEncode(
|
|
111
|
-
audience_name: audience_name
|
|
108
|
+
audience_id: helpers_1.hashAndEncode(audience_id),
|
|
109
|
+
audience_name: audience_name,
|
|
112
110
|
action: 'add'
|
|
113
111
|
}
|
|
114
112
|
});
|
|
@@ -118,7 +116,8 @@ const destination = {
|
|
|
118
116
|
};
|
|
119
117
|
}
|
|
120
118
|
catch (e) {
|
|
121
|
-
|
|
119
|
+
const errorMessage = e instanceof Error ? e.message : 'Unknown error';
|
|
120
|
+
throw new actions_core_1.IntegrationError(`Failed to create Audience in Dynamic Yield - ${errorMessage}`, 'DYNAMIC_YIELD_AUDIENCE_CREATION_FAILED', 400);
|
|
122
121
|
}
|
|
123
122
|
},
|
|
124
123
|
async getAudience(_, getAudienceInput) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/dynamic-yield-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAEvF,kEAAyC;AACzC,uCAA+D;AAC/D,uCAA2C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/dynamic-yield-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAEvF,kEAAyC;AACzC,uCAA+D;AAC/D,uCAA2C;AAO3C,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,OAAO;IACb,WA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E,QAAQ,CAAC,SAAS;6BAC5B;yBACF;wBACD,WAAW,EAAE,uBAAa,CAAC,WAAW,CAAC;wBACvC,aAAa,EAAE,aAAa;wBAC5B,MAAM,EAAE,KAAK;qBACd;iBACF,CAAC,CAAA;gBACF,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;gBAC1C,OAAO;oBACL,UAAU,EAAE,YAAY,CAAC,EAAE;iBAC5B,CAAA;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,YAAY,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAA;gBACrE,MAAM,IAAI,+BAAgB,CACxB,gDAAgD,YAAY,EAAE,EAC9D,wCAAwC,EACxC,GAAG,CACJ,CAAA;aACF;QACH,CAAC;QACD,KAAK,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"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const helpers_1 = require("../helpers");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Sync Audience',
|
|
8
7
|
description: 'Sync Segment Engage Audiences to Dynamic Yield',
|
|
@@ -28,14 +27,14 @@ const action = {
|
|
|
28
27
|
'@path': '$.timestamp'
|
|
29
28
|
}
|
|
30
29
|
},
|
|
31
|
-
|
|
30
|
+
external_audience_id: {
|
|
32
31
|
type: 'string',
|
|
33
|
-
label: 'Audience ID',
|
|
32
|
+
label: 'External Audience ID',
|
|
34
33
|
description: 'Unique Audience Identifier returned by the createAudience() function call.',
|
|
35
34
|
required: true,
|
|
36
35
|
unsafe_hidden: true,
|
|
37
36
|
default: {
|
|
38
|
-
'@path': '$.context.personas.
|
|
37
|
+
'@path': '$.context.personas.external_audience_id'
|
|
39
38
|
}
|
|
40
39
|
},
|
|
41
40
|
segment_audience_key: {
|
|
@@ -105,22 +104,33 @@ const action = {
|
|
|
105
104
|
default: { '@path': '$.userId' }
|
|
106
105
|
}
|
|
107
106
|
},
|
|
108
|
-
perform: async (request,
|
|
109
|
-
const {
|
|
107
|
+
perform: async (request, { audienceSettings, payload, settings }) => {
|
|
108
|
+
const { external_audience_id } = payload;
|
|
109
|
+
if (!audienceSettings?.audience_name) {
|
|
110
|
+
throw new actions_core_1.IntegrationError('Audience Name is required', 'MISSING_REQUIRED_FIELD', 400);
|
|
111
|
+
}
|
|
112
|
+
if (!audienceSettings?.identifier_type) {
|
|
113
|
+
throw new actions_core_1.IntegrationError('Identifier Type is required', 'MISSING_REQUIRED_FIELD', 400);
|
|
114
|
+
}
|
|
115
|
+
if (!external_audience_id) {
|
|
116
|
+
throw new actions_core_1.IntegrationError('External Audience ID is required', 'MISSING_REQUIRED_FIELD', 400);
|
|
117
|
+
}
|
|
110
118
|
const audienceName = audienceSettings?.audience_name;
|
|
119
|
+
const identifierType = (audienceSettings?.identifier_type).toLowerCase().replace(/_/g, '');
|
|
111
120
|
const audienceValue = payload.traits_or_props[payload.segment_audience_key];
|
|
112
|
-
const { audience_id } = payload;
|
|
113
121
|
let primaryIdentifier;
|
|
114
|
-
switch (
|
|
115
|
-
case
|
|
122
|
+
switch (identifierType) {
|
|
123
|
+
case 'email':
|
|
116
124
|
primaryIdentifier = payload.email ?? undefined;
|
|
117
125
|
break;
|
|
118
|
-
case
|
|
126
|
+
case 'userid':
|
|
119
127
|
primaryIdentifier = payload.userId ?? undefined;
|
|
120
128
|
break;
|
|
121
|
-
case
|
|
129
|
+
case 'anonymousid':
|
|
122
130
|
primaryIdentifier = payload.anonymousId ?? undefined;
|
|
123
131
|
break;
|
|
132
|
+
default:
|
|
133
|
+
primaryIdentifier = payload.traits_or_props[identifierType] ?? undefined;
|
|
124
134
|
}
|
|
125
135
|
if (!primaryIdentifier) {
|
|
126
136
|
throw new actions_core_1.IntegrationError('Primary Identifier not found', 'MISSING_REQUIRED_FIELD', 400);
|
|
@@ -135,7 +145,7 @@ const action = {
|
|
|
135
145
|
account: {
|
|
136
146
|
account_settings: {
|
|
137
147
|
section_id: settings.sectionId,
|
|
138
|
-
identifier_type:
|
|
148
|
+
identifier_type: identifierType,
|
|
139
149
|
accessKey: settings.accessKey
|
|
140
150
|
}
|
|
141
151
|
},
|
|
@@ -143,14 +153,14 @@ const action = {
|
|
|
143
153
|
{
|
|
144
154
|
user_identities: [
|
|
145
155
|
{
|
|
146
|
-
type:
|
|
147
|
-
encoding:
|
|
148
|
-
value:
|
|
156
|
+
type: identifierType,
|
|
157
|
+
encoding: identifierType === 'email' ? '"sha-256"' : 'raw',
|
|
158
|
+
value: identifierType === 'email' ? helpers_1.hashAndEncode(primaryIdentifier) : primaryIdentifier
|
|
149
159
|
}
|
|
150
160
|
],
|
|
151
161
|
audiences: [
|
|
152
162
|
{
|
|
153
|
-
audience_id:
|
|
163
|
+
audience_id: external_audience_id,
|
|
154
164
|
audience_name: audienceName,
|
|
155
165
|
action: audienceValue ? 'add' : 'delete'
|
|
156
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/dynamic-yield-audiences/syncAudience/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,wCAAwD;
|
|
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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AO,CAAC,UAAU;gBACtB,YAAY,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;gBACnD,OAAO,EAAE;oBACP,gBAAgB,EAAE;wBAChB,UAAU,EAAE,QAAQ,CAAC,SAAS;wBAC9B,eAAe,EAAE,cAAc;wBAC/B,SAAS,EAAE,QAAQ,CAAC,SAAS;qBAC9B;iBACF;gBACD,aAAa,EAAE;oBACb;wBACE,eAAe,EAAE;4BACf;gCACE,IAAI,EAAE,cAAc;gCACpB,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK;gCAC1D,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,uBAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB;6BACzF;yBACF;wBACD,SAAS,EAAE;4BACT;gCACE,WAAW,EAAE,oBAAoB;gCACjC,aAAa,EAAE,YAAY;gCAC3B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;6BACzC;yBACF;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import type { DestinationDefinition } from '@segment/actions-core';
|
|
2
|
+
import type { Settings } from './generated-types';
|
|
3
|
+
export declare const destinationDefinition: DestinationDefinition<Settings>;
|
|
4
|
+
export default destinationDefinition;
|