@segment/action-destinations 3.284.0 → 3.285.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/amazon-ads/generated-types.d.ts +12 -0
- package/dist/destinations/amazon-ads/generated-types.js +3 -0
- package/dist/destinations/amazon-ads/generated-types.js.map +1 -0
- package/dist/destinations/amazon-ads/index.d.ts +4 -0
- package/dist/destinations/amazon-ads/index.js +237 -0
- package/dist/destinations/amazon-ads/index.js.map +1 -0
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +15 -0
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js +3 -0
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js.map +1 -0
- package/dist/destinations/amazon-ads/syncAudiences/index.d.ts +5 -0
- package/dist/destinations/amazon-ads/syncAudiences/index.js +182 -0
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -0
- package/dist/destinations/amazon-ads/types.d.ts +47 -0
- package/dist/destinations/amazon-ads/types.js +11 -0
- package/dist/destinations/amazon-ads/types.js.map +1 -0
- package/dist/destinations/amazon-ads/utils.d.ts +37 -0
- package/dist/destinations/amazon-ads/utils.js +25 -0
- package/dist/destinations/amazon-ads/utils.js.map +1 -0
- package/dist/destinations/amazon-amc/index.js +2 -10
- package/dist/destinations/amazon-amc/index.js.map +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/contentstack/constants.d.ts +3 -0
- package/dist/destinations/contentstack/constants.js +7 -0
- package/dist/destinations/contentstack/constants.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.d.ts +22 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.js +3 -0
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.js.map +1 -0
- package/dist/destinations/dynamic-yield-audiences/types.d.ts +8 -0
- package/dist/destinations/dynamic-yield-audiences/types.js +12 -0
- package/dist/destinations/dynamic-yield-audiences/types.js.map +1 -0
- package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
- package/dist/destinations/engage/sendgrid/Profile.js +3 -0
- package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
- 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/api-lookups.d.ts +21 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +174 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.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 +65 -0
- package/dist/destinations/engage/utils/MessageSendPerformer.js +211 -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.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.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/klaviyo/orderCompleted/formatters.d.ts +26 -0
- package/dist/destinations/klaviyo/orderCompleted/formatters.js +62 -0
- package/dist/destinations/klaviyo/orderCompleted/formatters.js.map +1 -0
- package/dist/destinations/klaviyo/orderCompleted/generated-types.d.ts +9 -0
- package/dist/destinations/klaviyo/orderCompleted/index.js +166 -64
- package/dist/destinations/klaviyo/orderCompleted/index.js.map +1 -1
- package/dist/destinations/klaviyo/orderCompleted/types.d.ts +2 -0
- package/dist/destinations/klaviyo/orderCompleted/types.js +3 -0
- package/dist/destinations/klaviyo/orderCompleted/types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +43 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/klaviyo/trackEvent/index.js +1 -1
- package/dist/destinations/klaviyo/trackEvent/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/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
- package/dist/destinations/movable-ink/categoryView/index.js +43 -0
- package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
- package/dist/destinations/movable-ink/conversion/index.js +45 -0
- package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
- package/dist/destinations/movable-ink/fields.d.ts +21 -0
- package/dist/destinations/movable-ink/fields.js +236 -0
- package/dist/destinations/movable-ink/fields.js.map +1 -0
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
- package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
- package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
- package/dist/destinations/movable-ink/identify/index.js +32 -0
- package/dist/destinations/movable-ink/identify/index.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productAdded/index.js +43 -0
- package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productViewed/index.js +43 -0
- package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
- package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
- package/dist/destinations/movable-ink/search/generated-types.js +3 -0
- package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/search/index.d.ts +5 -0
- package/dist/destinations/movable-ink/search/index.js +43 -0
- package/dist/destinations/movable-ink/search/index.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +14 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +113 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +20 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +174 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +1 -0
- package/dist/destinations/responsys/rsp-operations.d.ts +14 -0
- package/dist/destinations/responsys/rsp-operations.js +33 -0
- package/dist/destinations/responsys/rsp-operations.js.map +1 -0
- package/dist/destinations/responsys/rsp-properties.d.ts +4 -0
- package/dist/destinations/responsys/rsp-properties.js +27 -0
- package/dist/destinations/responsys/rsp-properties.js.map +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +381 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +581 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +4 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +97 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +1 -0
- package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +30 -0
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +316 -0
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +34 -0
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +43 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +1 -0
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/trackey/group.types.js +3 -0
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/trackey/identify.types.js +3 -0
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/trackey/track.types.js +3 -0
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/index.js +1 -2
- package/dist/destinations/yahoo-audiences/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -23,6 +23,15 @@ const action = {
|
|
|
23
23
|
label: 'External ID',
|
|
24
24
|
default: {
|
|
25
25
|
'@path': '$.userId'
|
|
26
|
+
},
|
|
27
|
+
depends_on: {
|
|
28
|
+
conditions: [
|
|
29
|
+
{
|
|
30
|
+
fieldKey: 'role',
|
|
31
|
+
operator: 'is',
|
|
32
|
+
value: 'user'
|
|
33
|
+
}
|
|
34
|
+
]
|
|
26
35
|
}
|
|
27
36
|
},
|
|
28
37
|
email: {
|
|
@@ -32,6 +41,15 @@ const action = {
|
|
|
32
41
|
format: 'email',
|
|
33
42
|
default: {
|
|
34
43
|
'@path': '$.traits.email'
|
|
44
|
+
},
|
|
45
|
+
depends_on: {
|
|
46
|
+
conditions: [
|
|
47
|
+
{
|
|
48
|
+
fieldKey: 'role',
|
|
49
|
+
operator: 'is',
|
|
50
|
+
value: 'user'
|
|
51
|
+
}
|
|
52
|
+
]
|
|
35
53
|
}
|
|
36
54
|
},
|
|
37
55
|
phone: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/identifyContact/index.ts"],"names":[],"mappings":";;AAAA,wDAAuF;AAEvF,kCAAyE;AAGzE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gEAAgE;YAC7E,KAAK,EAAE,MAAM;YACb,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;aACjC;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,wLAAwL;YAC1L,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gGAAgG;YAC7G,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,OAAO;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qBAAqB;YAClC,KAAK,EAAE,MAAM;YACb,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,QAAQ;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AEnC,MAAM,IAAI,6BAAc,CACtB,wHAAwH,CACzH,CAAA;aACF;YACD,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA;AAED,KAAK,UAAU,qBAAqB,CAAC,OAAsB,EAAE,OAAgB;IAC3E,OAAO,OAAO,CAAC,kCAAkC,EAAE;QACjD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,OAAsB,EAAE,SAAiB,EAAE,OAAgB;IAC9F,OAAO,OAAO,CAAC,oCAAoC,SAAS,EAAE,EAAE;QAC9D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/identifyContact/index.ts"],"names":[],"mappings":";;AAAA,wDAAuF;AAEvF,kCAAyE;AAGzE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gEAAgE;YAC7E,KAAK,EAAE,MAAM;YACb,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;aACjC;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,wLAAwL;YAC1L,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;YACD,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV;wBACE,QAAQ,EAAE,MAAM;wBAChB,QAAQ,EAAE,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}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Product } from './types';
|
|
2
|
+
export declare function convertKeysToTitleCase(obj: Record<string, unknown>, level?: number): Record<string, unknown>;
|
|
3
|
+
export declare function formatOrderedProduct(product: Product, order_id?: string, unique_event_id?: String): {
|
|
4
|
+
unique_id: string | undefined;
|
|
5
|
+
productProperties: {
|
|
6
|
+
OrderId: string | undefined;
|
|
7
|
+
ProductId: unknown;
|
|
8
|
+
SKU: string | undefined;
|
|
9
|
+
ProductName: string | undefined;
|
|
10
|
+
Quantity: number | undefined;
|
|
11
|
+
Categories: string[];
|
|
12
|
+
ProductURL: string | undefined;
|
|
13
|
+
ImageURL: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function formatProductItems(product: Product): {
|
|
17
|
+
ProductId: unknown;
|
|
18
|
+
SKU: string | undefined;
|
|
19
|
+
ProductName: string | undefined;
|
|
20
|
+
Quantity: number | undefined;
|
|
21
|
+
ItemPrice: number | undefined;
|
|
22
|
+
RowTotal: number | undefined;
|
|
23
|
+
Categories: string[];
|
|
24
|
+
ProductURL: string | undefined;
|
|
25
|
+
ImageURL: string | undefined;
|
|
26
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatProductItems = exports.formatOrderedProduct = exports.convertKeysToTitleCase = void 0;
|
|
4
|
+
function toTitleCase(str) {
|
|
5
|
+
return (str
|
|
6
|
+
.replace(/[^a-zA-Z0-9]/g, ' ')
|
|
7
|
+
.replace(/\s+/g, ' ')
|
|
8
|
+
.trim()
|
|
9
|
+
.split(' ')
|
|
10
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
11
|
+
.join(''));
|
|
12
|
+
}
|
|
13
|
+
function convertKeysToTitleCase(obj, level = 0) {
|
|
14
|
+
if (level > 1)
|
|
15
|
+
return obj;
|
|
16
|
+
return Object.fromEntries(Object.entries(obj).map(([key, value]) => {
|
|
17
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
18
|
+
return [toTitleCase(key), convertKeysToTitleCase(value, level + 1)];
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(value)) {
|
|
21
|
+
return [toTitleCase(key), value];
|
|
22
|
+
}
|
|
23
|
+
return [toTitleCase(key), value];
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
exports.convertKeysToTitleCase = convertKeysToTitleCase;
|
|
27
|
+
function formatOrderedProduct(product, order_id, unique_event_id) {
|
|
28
|
+
const event_id = unique_event_id ?? order_id;
|
|
29
|
+
const unique_product_id = product.product_id || product.sku || product?.id;
|
|
30
|
+
const unique_id = event_id && unique_product_id ? `${event_id}_${unique_product_id}` : undefined;
|
|
31
|
+
const { name, quantity, sku, price, url, image_url, category, product_id, id, ...otherProperties } = product;
|
|
32
|
+
const productProperties = {
|
|
33
|
+
OrderId: order_id,
|
|
34
|
+
ProductId: product_id ?? id,
|
|
35
|
+
SKU: sku,
|
|
36
|
+
ProductName: name,
|
|
37
|
+
Quantity: quantity,
|
|
38
|
+
Categories: category ? [category] : [],
|
|
39
|
+
ProductURL: url,
|
|
40
|
+
ImageURL: image_url,
|
|
41
|
+
...convertKeysToTitleCase(otherProperties)
|
|
42
|
+
};
|
|
43
|
+
return { unique_id, productProperties };
|
|
44
|
+
}
|
|
45
|
+
exports.formatOrderedProduct = formatOrderedProduct;
|
|
46
|
+
function formatProductItems(product) {
|
|
47
|
+
const { sku, name, quantity, price, category, url, image_url, id, product_id, ...otherProperties } = product;
|
|
48
|
+
return {
|
|
49
|
+
ProductId: product_id ?? id,
|
|
50
|
+
SKU: sku,
|
|
51
|
+
ProductName: name,
|
|
52
|
+
Quantity: quantity,
|
|
53
|
+
ItemPrice: price,
|
|
54
|
+
RowTotal: price,
|
|
55
|
+
Categories: category ? [category] : [],
|
|
56
|
+
ProductURL: url,
|
|
57
|
+
ImageURL: image_url,
|
|
58
|
+
...convertKeysToTitleCase(otherProperties)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
exports.formatProductItems = formatProductItems;
|
|
62
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/formatters.ts"],"names":[],"mappings":";;;AAEA,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,CACL,GAAG;SAEA,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;SAE7B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SAEpB,IAAI,EAAE;SACN,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,EAAE,CAAC,CACZ,CAAA;AACH,CAAC;AAMD,SAAgB,sBAAsB,CAAC,GAA4B,EAAE,KAAK,GAAG,CAAC;IAC5E,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,GAAG,CAAA;IACzB,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACtD,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,sBAAsB,CAAC,KAAgC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;SAC/F;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;SACjC;QACD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AG,OAAO,CAAA;IAC5G,OAAO;QACL,SAAS,EAAE,UAAU,IAAI,EAAE;QAC3B,GAAG,EAAE,GAAG;QACR,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;QACtC,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,SAAS;QAGnB,GAAG,sBAAsB,CAAC,eAAe,CAAC;KAC3C,CAAA;AACH,CAAC;AAhBD,gDAgBC"}
|
|
@@ -7,12 +7,21 @@ export interface Payload {
|
|
|
7
7
|
[k: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
properties: {
|
|
10
|
+
order_id?: string;
|
|
10
11
|
[k: string]: unknown;
|
|
11
12
|
};
|
|
12
13
|
time?: string | number;
|
|
13
14
|
value?: number;
|
|
14
15
|
unique_id?: string;
|
|
15
16
|
products?: {
|
|
17
|
+
product_id?: string;
|
|
18
|
+
category?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
sku?: string;
|
|
21
|
+
price?: number;
|
|
22
|
+
image_url?: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
quantity?: number;
|
|
16
25
|
[k: string]: unknown;
|
|
17
26
|
}[];
|
|
18
27
|
}
|
|
@@ -2,68 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const config_1 = require("../config");
|
|
5
|
-
const
|
|
6
|
-
const createEventData = (payload) => ({
|
|
7
|
-
data: {
|
|
8
|
-
type: 'event',
|
|
9
|
-
attributes: {
|
|
10
|
-
properties: { ...payload.properties },
|
|
11
|
-
time: payload.time,
|
|
12
|
-
value: payload.value,
|
|
13
|
-
unique_id: payload.unique_id,
|
|
14
|
-
metric: {
|
|
15
|
-
data: {
|
|
16
|
-
type: 'metric',
|
|
17
|
-
attributes: {
|
|
18
|
-
name: 'Order Completed'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
profile: {
|
|
23
|
-
data: {
|
|
24
|
-
type: 'profile',
|
|
25
|
-
attributes: payload.profile
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const sendProductRequests = async (payload, orderEventData, request) => {
|
|
32
|
-
if (!payload.products || !Array.isArray(payload.products)) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
delete orderEventData.data.attributes.properties?.products;
|
|
36
|
-
const productPromises = payload.products.map((product) => {
|
|
37
|
-
const productEventData = {
|
|
38
|
-
data: {
|
|
39
|
-
type: 'event',
|
|
40
|
-
attributes: {
|
|
41
|
-
properties: { ...product, ...orderEventData.data.attributes.properties },
|
|
42
|
-
unique_id: uuid_1.v4(),
|
|
43
|
-
metric: {
|
|
44
|
-
data: {
|
|
45
|
-
type: 'metric',
|
|
46
|
-
attributes: {
|
|
47
|
-
name: 'Ordered Product'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
time: orderEventData.data.attributes.time,
|
|
52
|
-
profile: orderEventData.data.attributes.profile
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
return request(`${config_1.API_URL}/events/`, {
|
|
57
|
-
method: 'POST',
|
|
58
|
-
json: productEventData
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
await Promise.all(productPromises);
|
|
62
|
-
};
|
|
5
|
+
const formatters_1 = require("./formatters");
|
|
63
6
|
const action = {
|
|
64
7
|
title: 'Order Completed',
|
|
65
8
|
description: 'Order Completed Event action tracks users Order Completed events and associate it with their profile.',
|
|
66
|
-
defaultSubscription: 'type = "track"',
|
|
9
|
+
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
67
10
|
fields: {
|
|
68
11
|
profile: {
|
|
69
12
|
label: 'Profile',
|
|
@@ -95,11 +38,30 @@ const action = {
|
|
|
95
38
|
required: true
|
|
96
39
|
},
|
|
97
40
|
properties: {
|
|
98
|
-
description: `Properties of this event.`,
|
|
41
|
+
description: `Properties of this event. Segment adds products array as Items, ItemNames and Categories properties in the properties object. Segment will title case the keys of this object before sending it to Klaviyo.`,
|
|
99
42
|
label: 'Properties',
|
|
100
43
|
type: 'object',
|
|
44
|
+
additionalProperties: true,
|
|
45
|
+
properties: {
|
|
46
|
+
order_id: {
|
|
47
|
+
label: 'Order ID',
|
|
48
|
+
description: 'Unique identifier for the order.',
|
|
49
|
+
type: 'string'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
101
52
|
default: {
|
|
102
|
-
'@
|
|
53
|
+
'@arrayPath': [
|
|
54
|
+
'$.properties',
|
|
55
|
+
{
|
|
56
|
+
order_id: {
|
|
57
|
+
'@if': {
|
|
58
|
+
exists: { '@path': '$.properties.order_id' },
|
|
59
|
+
then: { '@path': '$.properties.order_id' },
|
|
60
|
+
else: { '@path': '$.properties.orderId' }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
103
65
|
},
|
|
104
66
|
required: true
|
|
105
67
|
},
|
|
@@ -135,7 +97,71 @@ const action = {
|
|
|
135
97
|
label: 'Products',
|
|
136
98
|
description: 'List of products purchased in the order.',
|
|
137
99
|
multiple: true,
|
|
138
|
-
type: 'object'
|
|
100
|
+
type: 'object',
|
|
101
|
+
additionalProperties: true,
|
|
102
|
+
properties: {
|
|
103
|
+
product_id: {
|
|
104
|
+
label: 'Product ID',
|
|
105
|
+
description: 'Id of the product.',
|
|
106
|
+
type: 'string'
|
|
107
|
+
},
|
|
108
|
+
category: {
|
|
109
|
+
label: 'Category',
|
|
110
|
+
description: 'Category of the product',
|
|
111
|
+
type: 'string'
|
|
112
|
+
},
|
|
113
|
+
name: {
|
|
114
|
+
label: 'Name',
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'Name of the product'
|
|
117
|
+
},
|
|
118
|
+
sku: {
|
|
119
|
+
label: 'SKU',
|
|
120
|
+
type: 'string',
|
|
121
|
+
description: 'Stock Keeping Unit of the product'
|
|
122
|
+
},
|
|
123
|
+
price: {
|
|
124
|
+
label: 'Price',
|
|
125
|
+
type: 'number',
|
|
126
|
+
description: 'Price of the product'
|
|
127
|
+
},
|
|
128
|
+
image_url: {
|
|
129
|
+
label: 'Image URL of the product',
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: 'URL of the image of the product'
|
|
132
|
+
},
|
|
133
|
+
url: {
|
|
134
|
+
label: 'Product URL',
|
|
135
|
+
type: 'string',
|
|
136
|
+
description: 'URL of the product page'
|
|
137
|
+
},
|
|
138
|
+
quantity: {
|
|
139
|
+
label: 'Quantity',
|
|
140
|
+
type: 'number',
|
|
141
|
+
description: 'Quantity of the product'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
default: {
|
|
145
|
+
'@arrayPath': [
|
|
146
|
+
'$.properties.products',
|
|
147
|
+
{
|
|
148
|
+
product_id: {
|
|
149
|
+
'@if': {
|
|
150
|
+
exists: { '@path': '$.properties.product_id' },
|
|
151
|
+
then: { '@path': '$.properties.product_id' },
|
|
152
|
+
else: { '@path': '$.properties.productId' }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
category: { '@path': '$.properties.category' },
|
|
156
|
+
name: { '@path': '$.properties.name' },
|
|
157
|
+
sku: { '@path': '$.properties.sku' },
|
|
158
|
+
price: { '@path': '$.properties.price' },
|
|
159
|
+
image_url: { '@path': '$.properties.image_url' },
|
|
160
|
+
url: { '@path': '$.properties.url' },
|
|
161
|
+
quantity: { '@path': '$.properties.quantity' }
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
139
165
|
}
|
|
140
166
|
},
|
|
141
167
|
perform: async (request, { payload }) => {
|
|
@@ -143,16 +169,92 @@ const action = {
|
|
|
143
169
|
if (!email && !phone_number && !external_id && !anonymous_id) {
|
|
144
170
|
throw new actions_core_1.PayloadValidationError('One of External ID, Anonymous ID, Phone Number or Email is required.');
|
|
145
171
|
}
|
|
146
|
-
const eventData =
|
|
172
|
+
const eventData = createOrderCompleteEvent(payload);
|
|
147
173
|
const event = await request(`${config_1.API_URL}/events/`, {
|
|
148
174
|
method: 'POST',
|
|
149
175
|
json: eventData
|
|
150
176
|
});
|
|
151
177
|
if (event.status == 202 && Array.isArray(payload.products)) {
|
|
152
|
-
await sendProductRequests(payload,
|
|
178
|
+
await sendProductRequests(payload, request);
|
|
153
179
|
}
|
|
154
180
|
return event;
|
|
155
181
|
}
|
|
156
182
|
};
|
|
183
|
+
function createOrderCompleteEvent(payload) {
|
|
184
|
+
delete payload.properties?.products;
|
|
185
|
+
const categories = payload.products?.filter((product) => Boolean(product.category)).map((product) => product.category);
|
|
186
|
+
const itemNames = payload.products?.filter((product) => Boolean(product.name)).map((product) => product.name);
|
|
187
|
+
const items = payload.products?.map(formatters_1.formatProductItems);
|
|
188
|
+
return {
|
|
189
|
+
data: {
|
|
190
|
+
type: 'event',
|
|
191
|
+
attributes: {
|
|
192
|
+
properties: {
|
|
193
|
+
Categories: categories,
|
|
194
|
+
ItemNames: itemNames,
|
|
195
|
+
Items: items,
|
|
196
|
+
...formatters_1.convertKeysToTitleCase(payload.properties)
|
|
197
|
+
},
|
|
198
|
+
time: payload.time,
|
|
199
|
+
value: payload.value,
|
|
200
|
+
unique_id: payload.unique_id,
|
|
201
|
+
metric: {
|
|
202
|
+
data: {
|
|
203
|
+
type: 'metric',
|
|
204
|
+
attributes: {
|
|
205
|
+
name: 'Order Completed'
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
profile: {
|
|
210
|
+
data: {
|
|
211
|
+
type: 'profile',
|
|
212
|
+
attributes: payload.profile
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function sendOrderedProduct(request, payload, product) {
|
|
220
|
+
const { unique_id, productProperties } = formatters_1.formatOrderedProduct(product, payload.properties.order_id, payload.unique_id);
|
|
221
|
+
const productEventData = {
|
|
222
|
+
data: {
|
|
223
|
+
type: 'event',
|
|
224
|
+
attributes: {
|
|
225
|
+
properties: productProperties,
|
|
226
|
+
unique_id: unique_id,
|
|
227
|
+
value: product.price,
|
|
228
|
+
metric: {
|
|
229
|
+
data: {
|
|
230
|
+
type: 'metric',
|
|
231
|
+
attributes: {
|
|
232
|
+
name: 'Ordered Product'
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
time: payload.time,
|
|
237
|
+
profile: {
|
|
238
|
+
data: {
|
|
239
|
+
type: 'profile',
|
|
240
|
+
attributes: payload.profile
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
return request(`${config_1.API_URL}/events/`, {
|
|
247
|
+
method: 'POST',
|
|
248
|
+
json: productEventData
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const sendProductRequests = async (payload, request) => {
|
|
252
|
+
if (!Array.isArray(payload.products)) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
delete payload.properties?.products;
|
|
256
|
+
const productPromises = payload.products.map((product) => sendOrderedProduct(request, payload, product));
|
|
257
|
+
await Promise.all(productPromises);
|
|
258
|
+
};
|
|
157
259
|
exports.default = action;
|
|
158
260
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/index.ts"],"names":[],"mappings":";;AAGA,wDAA6E;AAC7E,sCAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/index.ts"],"names":[],"mappings":";;AAGA,wDAA6E;AAC7E,sCAAmC;AACnC,6CAA+F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O,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACpC,OAAM;KACP;IAID,OAAO,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAA;IAEnC,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IACxG,MAAM,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const functions_1 = require("../functions");
|
|
5
|
+
const properties_1 = require("../properties");
|
|
6
|
+
const action = {
|
|
7
|
+
title: 'Remove profile from list',
|
|
8
|
+
description: 'Remove profile from list',
|
|
9
|
+
fields: {
|
|
10
|
+
email: { ...properties_1.email },
|
|
11
|
+
list_id: { ...properties_1.external_id }
|
|
12
|
+
},
|
|
13
|
+
perform: async (request, { payload }) => {
|
|
14
|
+
const { email, list_id } = payload;
|
|
15
|
+
if (!email || !list_id) {
|
|
16
|
+
throw new actions_core_1.IntegrationError("Insert the ID of the default list that you'd like to subscribe users", 'Missing required fields', 400);
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const profileData = await functions_1.getProfile(request, email);
|
|
20
|
+
const v = JSON.parse(profileData.content);
|
|
21
|
+
if (Object.keys(v).length !== 0) {
|
|
22
|
+
console.log(v);
|
|
23
|
+
const listData = {
|
|
24
|
+
data: [
|
|
25
|
+
{
|
|
26
|
+
type: 'profile',
|
|
27
|
+
id: v.data[0].id
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
};
|
|
31
|
+
const list = await functions_1.executeProfileList(request, 'DELETE', listData, list_id);
|
|
32
|
+
return list;
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.log(error);
|
|
38
|
+
throw new Error('An error occurred while processing the request');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.default = action;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAK1E,4CAA6D;AAC7D,8CAAkD;AAElD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,0BAA0B;IACvC,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,GAAG,kBAAK,EAAE;QACnB,OAAO,EAAE,EAAE,GAAG,wBAAW,EAAE;KAC5B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;QAClC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE;YACtB,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;SACF;QACD,IAAI;YACF,MAAM,WAAW,GAA2B,MAAM,sBAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YAC5E,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACzC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACd,MAAM,QAAQ,GAAa;oBACzB,IAAI,EAAE;wBACJ;4BACE,IAAI,EAAE,SAAS;4BACf,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;yBACjB;qBACF;iBACF,CAAA;gBAED,MAAM,IAAI,GAAG,MAAM,8BAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;gBAC3E,OAAO,IAAI,CAAA;aACZ;YACD,OAAM;SACP;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAClB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -5,7 +5,7 @@ const config_1 = require("../config");
|
|
|
5
5
|
const action = {
|
|
6
6
|
title: 'Track Event',
|
|
7
7
|
description: 'Track user events and associate it with their profile.',
|
|
8
|
-
defaultSubscription: 'type = "track"',
|
|
8
|
+
defaultSubscription: 'type = "track" and event != "Order Completed"',
|
|
9
9
|
fields: {
|
|
10
10
|
profile: {
|
|
11
11
|
label: 'Profile',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/trackEvent/index.ts"],"names":[],"mappings":";;AAIA,wDAA8D;AAC9D,sCAAmC;AAEnC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,wDAAwD;IACrE,mBAAmB,EAAE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/trackEvent/index.ts"],"names":[],"mappings":";;AAIA,wDAA8D;A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AAM,CAAA"}
|
|
@@ -14,6 +14,7 @@ export declare class LinkedInConversions {
|
|
|
14
14
|
getConversionRulesList: (adAccountId?: string | undefined) => Promise<DynamicFieldResponse>;
|
|
15
15
|
private parseIdFromUrn;
|
|
16
16
|
getCampaignsList: (adAccountUrn?: string | undefined) => Promise<DynamicFieldResponse>;
|
|
17
|
+
private normalizeEmail;
|
|
17
18
|
private hashValue;
|
|
18
19
|
private buildUserIdsArray;
|
|
19
20
|
streamConversionEvent(payload: Payload, conversionTime: number): Promise<ModifiedResponse>;
|
|
@@ -292,6 +292,9 @@ class LinkedInConversions {
|
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
|
+
this.normalizeEmail = (email) => {
|
|
296
|
+
return email.toLowerCase();
|
|
297
|
+
};
|
|
295
298
|
this.hashValue = (val) => {
|
|
296
299
|
const hash = crypto_1.createHash('sha256');
|
|
297
300
|
hash.update(val);
|
|
@@ -300,7 +303,7 @@ class LinkedInConversions {
|
|
|
300
303
|
this.buildUserIdsArray = (payload) => {
|
|
301
304
|
const userIds = [];
|
|
302
305
|
if (payload.email) {
|
|
303
|
-
const hashedEmail = this.hashValue(payload.email);
|
|
306
|
+
const hashedEmail = this.hashValue(this.normalizeEmail(payload.email));
|
|
304
307
|
userIds.push({
|
|
305
308
|
idType: 'SHA256_EMAIL',
|
|
306
309
|
idValue: hashedEmail
|