@segment/action-destinations 3.291.0-staging-4513e30cb → 3.291.0-staging.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-amc/index.js +22 -16
- package/dist/destinations/amazon-amc/index.js.map +1 -1
- package/dist/destinations/angler-ai/saveCheckoutEvent/index.js +2 -1
- package/dist/destinations/angler-ai/saveCheckoutEvent/index.js.map +1 -1
- package/dist/destinations/angler-ai/saveUser/index.js +2 -1
- package/dist/destinations/angler-ai/saveUser/index.js.map +1 -1
- package/dist/destinations/app-fit/track/index.js +1 -1
- package/dist/destinations/app-fit/track/index.js.map +1 -1
- package/dist/destinations/aws-s3/generated-types.d.ts +11 -0
- package/dist/destinations/aws-s3/generated-types.js.map +1 -0
- package/dist/destinations/aws-s3/index.d.ts +4 -0
- package/dist/destinations/aws-s3/index.js +96 -0
- package/dist/destinations/aws-s3/index.js.map +1 -0
- package/dist/destinations/aws-s3/operations.d.ts +18 -0
- package/dist/destinations/aws-s3/operations.js +85 -0
- package/dist/destinations/aws-s3/operations.js.map +1 -0
- package/dist/destinations/aws-s3/properties.d.ts +1 -0
- package/dist/destinations/aws-s3/properties.js +5 -0
- package/dist/destinations/aws-s3/properties.js.map +1 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/generated-types.d.ts +36 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/generated-types.js.map +1 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/index.d.ts +5 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/index.js +241 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/index.js.map +1 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/s3.d.ts +20 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/s3.js +99 -0
- package/dist/destinations/aws-s3/syncAudienceToCSV/s3.js.map +1 -0
- package/dist/destinations/contentstack/customAttributesSync/generated-types.d.ts +1 -0
- package/dist/destinations/contentstack/customAttributesSync/index.js +25 -15
- package/dist/destinations/contentstack/customAttributesSync/index.js.map +1 -1
- package/dist/destinations/contentstack/index.js +9 -0
- package/dist/destinations/contentstack/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/index.js +1 -1
- package/dist/destinations/dynamic-yield-audiences/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js +12 -7
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.d.ts +3 -3
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.js +9 -9
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/apiLookups.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.d.ts +2 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.js +9 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/constants.d.ts +1 -1
- package/dist/destinations/facebook-conversions-api/constants.js +1 -1
- package/dist/destinations/facebook-custom-audiences/fbca-operations.d.ts +32 -0
- package/dist/destinations/facebook-custom-audiences/fbca-operations.js +50 -0
- package/dist/destinations/facebook-custom-audiences/fbca-operations.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/fbca-properties.d.ts +2 -0
- package/dist/destinations/facebook-custom-audiences/fbca-properties.js +10 -0
- package/dist/destinations/facebook-custom-audiences/fbca-properties.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/generated-types.d.ts +2 -2
- package/dist/destinations/facebook-custom-audiences/index.js +6 -16
- package/dist/destinations/facebook-custom-audiences/index.js.map +1 -1
- package/dist/destinations/facebook-custom-audiences/sync/generated-types.d.ts +14 -0
- package/dist/destinations/{engage/sendgrid/sendEmail/UnlayerResponse.js → facebook-custom-audiences/sync/generated-types.js} +1 -1
- package/dist/destinations/facebook-custom-audiences/sync/generated-types.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/sync/index.js +87 -0
- package/dist/destinations/facebook-custom-audiences/sync/index.js.map +1 -0
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +23 -3
- package/dist/destinations/google-enhanced-conversions/functions.js +305 -3
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/generated-types.d.ts +4 -0
- package/dist/destinations/google-enhanced-conversions/index.d.ts +8 -2
- package/dist/destinations/google-enhanced-conversions/index.js +51 -1
- package/dist/destinations/google-enhanced-conversions/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/types.d.ts +51 -0
- package/dist/destinations/google-enhanced-conversions/userList/generated-types.d.ts +31 -0
- package/dist/destinations/{engage-messaging-twilio/sendSms.types.js → google-enhanced-conversions/userList/generated-types.js} +1 -1
- package/dist/destinations/google-enhanced-conversions/userList/generated-types.js.map +1 -0
- package/dist/destinations/google-enhanced-conversions/userList/index.js +280 -0
- package/dist/destinations/google-enhanced-conversions/userList/index.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/insider/insider-helpers.js +57 -76
- package/dist/destinations/insider/insider-helpers.js.map +1 -1
- package/dist/destinations/klaviyo/addProfileToList/generated-types.d.ts +1 -0
- package/dist/destinations/klaviyo/addProfileToList/index.js +6 -5
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +2 -2
- package/dist/destinations/klaviyo/functions.js +11 -2
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/orderCompleted/generated-types.d.ts +0 -9
- package/dist/destinations/klaviyo/orderCompleted/index.js +64 -166
- package/dist/destinations/klaviyo/orderCompleted/index.js.map +1 -1
- package/dist/destinations/klaviyo/properties.d.ts +1 -0
- package/dist/destinations/klaviyo/properties.js +7 -1
- package/dist/destinations/klaviyo/properties.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfile/generated-types.d.ts +1 -0
- package/dist/destinations/klaviyo/removeProfile/index.js +16 -7
- package/dist/destinations/klaviyo/removeProfile/index.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfileFromList/generated-types.d.ts +1 -0
- package/dist/destinations/klaviyo/removeProfileFromList/index.js +10 -6
- package/dist/destinations/klaviyo/removeProfileFromList/index.js.map +1 -1
- package/dist/destinations/klaviyo/trackEvent/index.js +1 -1
- package/dist/destinations/klaviyo/trackEvent/index.js.map +1 -1
- package/dist/destinations/mappings-two-test/generated-types.d.ts +3 -0
- package/dist/destinations/mappings-two-test/generated-types.js +3 -0
- package/dist/destinations/mappings-two-test/generated-types.js.map +1 -0
- package/dist/destinations/{engage/sendgrid/destinationDefinition.d.ts → mappings-two-test/index.d.ts} +2 -1
- package/dist/destinations/mappings-two-test/index.js +32 -0
- package/dist/destinations/mappings-two-test/index.js.map +1 -0
- package/dist/destinations/mappings-two-test/kitchenSink/generated-types.d.ts +53 -0
- package/dist/destinations/mappings-two-test/kitchenSink/generated-types.js +3 -0
- package/dist/destinations/mappings-two-test/kitchenSink/generated-types.js.map +1 -0
- package/dist/destinations/{engage/twilio/sendWhatsApp/actionDefinition.d.ts → mappings-two-test/kitchenSink/index.d.ts} +2 -1
- package/dist/destinations/mappings-two-test/kitchenSink/index.js +289 -0
- package/dist/destinations/mappings-two-test/kitchenSink/index.js.map +1 -0
- package/dist/destinations/mappings-two-test/sendEvent/generated-types.d.ts +17 -0
- package/dist/destinations/mappings-two-test/sendEvent/generated-types.js +3 -0
- package/dist/destinations/mappings-two-test/sendEvent/generated-types.js.map +1 -0
- package/dist/destinations/{engage/twilio/sendSms/actionDefinition.d.ts → mappings-two-test/sendEvent/index.d.ts} +2 -1
- package/dist/destinations/mappings-two-test/sendEvent/index.js +343 -0
- package/dist/destinations/mappings-two-test/sendEvent/index.js.map +1 -0
- package/dist/destinations/segment/segment-properties.d.ts +0 -1
- package/dist/destinations/segment/segment-properties.js +1 -34
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/generated-types.d.ts +0 -7
- package/dist/destinations/segment/sendIdentify/index.js +2 -4
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/sendgrid/sendgrid-properties.d.ts +0 -1
- package/dist/destinations/sendgrid/updateUserProfile/generated-types.d.ts +0 -1
- package/dist/destinations/sendgrid/updateUserProfile/index.js +6 -19
- package/dist/destinations/sendgrid/updateUserProfile/index.js.map +1 -1
- package/dist/destinations/taboola-actions/index.js +1 -1
- package/dist/destinations/taboola-actions/index.js.map +1 -1
- package/dist/destinations/taboola-actions/syncAudience/index.js +4 -4
- package/dist/destinations/taboola-actions/syncAudience/index.js.map +1 -1
- package/dist/destinations/webhook-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/index.js +2 -1
- package/dist/destinations/yahoo-audiences/index.js.map +1 -1
- package/package.json +5 -4
- 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 +0 -28
- 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.d.ts +0 -44
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +0 -419
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.d.ts +0 -12
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.d.ts +0 -4
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js +0 -257
- 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.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js +0 -23
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js.map +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.d.ts +0 -1
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js +0 -14
- 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.d.ts +0 -28
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +0 -151
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +0 -1
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.d.ts +0 -4
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js +0 -250
- 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.d.ts +0 -9
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +0 -72
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/sendSms/actionDefinition.js +0 -162
- 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.d.ts +0 -9
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js +0 -89
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js +0 -136
- 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.d.ts +0 -16
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +0 -71
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.d.ts +0 -16
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +0 -115
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +0 -1
- package/dist/destinations/engage/twilio/utils/index.d.ts +0 -2
- package/dist/destinations/engage/twilio/utils/index.js +0 -15
- package/dist/destinations/engage/twilio/utils/index.js.map +0 -1
- package/dist/destinations/engage/twilio/utils/types.d.ts +0 -23
- package/dist/destinations/engage/twilio/utils/types.js +0 -3
- 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.d.ts +0 -22
- package/dist/destinations/engage/utils/apiLookups.js +0 -189
- 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.d.ts +0 -16
- 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.d.ts +0 -56
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js +0 -3
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.d.ts +0 -39
- 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.d.ts +0 -27
- package/dist/destinations/engage-messaging-twilio/sendSms.types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.d.ts +0 -25
- 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/facebook-custom-audiences/add/generated-types.d.ts +0 -2
- package/dist/destinations/facebook-custom-audiences/add/generated-types.js.map +0 -1
- package/dist/destinations/facebook-custom-audiences/add/index.js +0 -11
- package/dist/destinations/facebook-custom-audiences/add/index.js.map +0 -1
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.d.ts +0 -2
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.js.map +0 -1
- package/dist/destinations/facebook-custom-audiences/remove/index.js +0 -11
- package/dist/destinations/facebook-custom-audiences/remove/index.js.map +0 -1
- package/dist/destinations/klaviyo/orderCompleted/formatters.d.ts +0 -26
- package/dist/destinations/klaviyo/orderCompleted/formatters.js +0 -62
- package/dist/destinations/klaviyo/orderCompleted/formatters.js.map +0 -1
- package/dist/destinations/klaviyo/orderCompleted/types.d.ts +0 -2
- package/dist/destinations/klaviyo/orderCompleted/types.js +0 -3
- package/dist/destinations/klaviyo/orderCompleted/types.js.map +0 -1
- /package/dist/destinations/{facebook-custom-audiences/add → aws-s3}/generated-types.js +0 -0
- /package/dist/destinations/{facebook-custom-audiences/remove → aws-s3/syncAudienceToCSV}/generated-types.js +0 -0
- /package/dist/destinations/facebook-custom-audiences/{add → sync}/index.d.ts +0 -0
- /package/dist/destinations/{facebook-custom-audiences/remove → google-enhanced-conversions/userList}/index.d.ts +0 -0
|
@@ -54,7 +54,7 @@ async function removeProfileFromList(request, ids, list_id) {
|
|
|
54
54
|
return response;
|
|
55
55
|
}
|
|
56
56
|
exports.removeProfileFromList = removeProfileFromList;
|
|
57
|
-
async function createProfile(request, email, external_id, additionalAttributes) {
|
|
57
|
+
async function createProfile(request, email, external_id, phone_number, additionalAttributes) {
|
|
58
58
|
try {
|
|
59
59
|
const profileData = {
|
|
60
60
|
data: {
|
|
@@ -62,6 +62,7 @@ async function createProfile(request, email, external_id, additionalAttributes)
|
|
|
62
62
|
attributes: {
|
|
63
63
|
email,
|
|
64
64
|
external_id,
|
|
65
|
+
phone_number,
|
|
65
66
|
...additionalAttributes
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -124,7 +125,7 @@ const sendImportJobRequest = async (request, importJobPayload) => {
|
|
|
124
125
|
});
|
|
125
126
|
};
|
|
126
127
|
exports.sendImportJobRequest = sendImportJobRequest;
|
|
127
|
-
async function getProfiles(request, emails, external_ids) {
|
|
128
|
+
async function getProfiles(request, emails, external_ids, phoneNumbers) {
|
|
128
129
|
const profileIds = [];
|
|
129
130
|
if (external_ids?.length) {
|
|
130
131
|
const filterId = `external_id,["${external_ids.join('","')}"]`;
|
|
@@ -142,6 +143,14 @@ async function getProfiles(request, emails, external_ids) {
|
|
|
142
143
|
const data = await response.json();
|
|
143
144
|
profileIds.push(...data.data.map((profile) => profile.id));
|
|
144
145
|
}
|
|
146
|
+
if (phoneNumbers?.length) {
|
|
147
|
+
const filterPhone = `phone_number,["${phoneNumbers.join('","')}"]`;
|
|
148
|
+
const response = await request(`${config_1.API_URL}/profiles/?filter=any(${filterPhone})`, {
|
|
149
|
+
method: 'GET'
|
|
150
|
+
});
|
|
151
|
+
const data = await response.json();
|
|
152
|
+
profileIds.push(...data.data.map((profile) => profile.id));
|
|
153
|
+
}
|
|
145
154
|
return Array.from(new Set(profileIds));
|
|
146
155
|
}
|
|
147
156
|
exports.getProfiles = getProfiles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/functions.ts"],"names":[],"mappings":";;;AAAA,wDAM8B;AAC9B,qCAAiD;AAmB1C,KAAK,UAAU,oBAAoB,CAAC,OAAsB;IAC/D,IAAI;QACF,MAAM,MAAM,GAAmB,MAAM,OAAO,CAAC,GA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e,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;QACxC,MAAM,gBAAgB,GAAG,8BAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QACjE,OAAO,MAAM,4BAAoB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;IAC9D,CAAC,CAAC,CACH,CAAA;IACD,OAAO,eAAe,CAAA;AACxB,CAAC;AATD,wDASC"}
|
|
@@ -7,21 +7,12 @@ export interface Payload {
|
|
|
7
7
|
[k: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
properties: {
|
|
10
|
-
order_id?: string;
|
|
11
10
|
[k: string]: unknown;
|
|
12
11
|
};
|
|
13
12
|
time?: string | number;
|
|
14
13
|
value?: number;
|
|
15
14
|
unique_id?: string;
|
|
16
15
|
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;
|
|
25
16
|
[k: string]: unknown;
|
|
26
17
|
}[];
|
|
27
18
|
}
|
|
@@ -2,11 +2,68 @@
|
|
|
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
|
|
5
|
+
const uuid_1 = require("@lukeed/uuid");
|
|
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
|
+
};
|
|
6
63
|
const action = {
|
|
7
64
|
title: 'Order Completed',
|
|
8
65
|
description: 'Order Completed Event action tracks users Order Completed events and associate it with their profile.',
|
|
9
|
-
defaultSubscription: 'type = "track"
|
|
66
|
+
defaultSubscription: 'type = "track"',
|
|
10
67
|
fields: {
|
|
11
68
|
profile: {
|
|
12
69
|
label: 'Profile',
|
|
@@ -38,30 +95,11 @@ const action = {
|
|
|
38
95
|
required: true
|
|
39
96
|
},
|
|
40
97
|
properties: {
|
|
41
|
-
description: `Properties of this event
|
|
98
|
+
description: `Properties of this event.`,
|
|
42
99
|
label: 'Properties',
|
|
43
100
|
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
|
-
},
|
|
52
101
|
default: {
|
|
53
|
-
'@
|
|
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
|
-
]
|
|
102
|
+
'@path': '$.properties'
|
|
65
103
|
},
|
|
66
104
|
required: true
|
|
67
105
|
},
|
|
@@ -97,71 +135,7 @@ const action = {
|
|
|
97
135
|
label: 'Products',
|
|
98
136
|
description: 'List of products purchased in the order.',
|
|
99
137
|
multiple: true,
|
|
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
|
-
}
|
|
138
|
+
type: 'object'
|
|
165
139
|
}
|
|
166
140
|
},
|
|
167
141
|
perform: async (request, { payload }) => {
|
|
@@ -169,92 +143,16 @@ const action = {
|
|
|
169
143
|
if (!email && !phone_number && !external_id && !anonymous_id) {
|
|
170
144
|
throw new actions_core_1.PayloadValidationError('One of External ID, Anonymous ID, Phone Number or Email is required.');
|
|
171
145
|
}
|
|
172
|
-
const eventData =
|
|
146
|
+
const eventData = createEventData(payload);
|
|
173
147
|
const event = await request(`${config_1.API_URL}/events/`, {
|
|
174
148
|
method: 'POST',
|
|
175
149
|
json: eventData
|
|
176
150
|
});
|
|
177
151
|
if (event.status == 202 && Array.isArray(payload.products)) {
|
|
178
|
-
await sendProductRequests(payload, request);
|
|
152
|
+
await sendProductRequests(payload, eventData, request);
|
|
179
153
|
}
|
|
180
154
|
return event;
|
|
181
155
|
}
|
|
182
156
|
};
|
|
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
|
-
};
|
|
259
157
|
exports.default = action;
|
|
260
158
|
//# 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;AAEnC,uCAA2C;AAE3C,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,UAAU,EAAE;YACV,UAAU,EAAE,EAAE,G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object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.properties = exports.location = exports.image = exports.title = exports.organization = exports.last_name = exports.first_name = exports.batch_size = exports.enable_batching = exports.external_id = exports.email = exports.list_id = void 0;
|
|
3
|
+
exports.phone_number = exports.properties = exports.location = exports.image = exports.title = exports.organization = exports.last_name = exports.first_name = exports.batch_size = exports.enable_batching = exports.external_id = exports.email = exports.list_id = void 0;
|
|
4
4
|
exports.list_id = {
|
|
5
5
|
label: 'List Id',
|
|
6
6
|
description: `'Insert the ID of the default list that you'd like to subscribe users to when you call .identify().'`,
|
|
@@ -128,4 +128,10 @@ exports.properties = {
|
|
|
128
128
|
type: 'object',
|
|
129
129
|
default: { '@path': '$.properties.properties' }
|
|
130
130
|
};
|
|
131
|
+
exports.phone_number = {
|
|
132
|
+
label: 'Phone Number',
|
|
133
|
+
description: `Individual's phone number in E.164 format. If SMS is not enabled and if you use Phone Number as identifier, then you have to provide one of Email or External ID.`,
|
|
134
|
+
type: 'string',
|
|
135
|
+
default: { '@path': '$.context.traits.phone' }
|
|
136
|
+
};
|
|
131
137
|
//# sourceMappingURL=properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,sGAAsG;IACnH,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,yCAAyC;KACnD;IACD,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,KAAK,GAAe;IAC/B,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,qCAAqC;IAClD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,wBAAwB;KAClC;CACF,CAAA;AAEY,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,W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AAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;CAChD,CAAA"}
|
|
1
|
+
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,sGAAsG;IACnH,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,yCAAyC;KACnD;IACD,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,KAAK,GAAe;IAC/B,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,qCAAqC;IAClD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,wBAAwB;KAClC;CACF,CAAA;AAEY,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,iJAAiJ;IAC9J,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,0DAA0D;IACvE,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,qFAAqF;IAClG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE,KAAK;CACf,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,0BAA0B;IACvC,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;CAC/C,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,yBAAyB;IACtC,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE,OAAO,EAAE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E,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;SAChB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;SAChB;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE;QAC9C,MAAM,EAAE,EAAE,OAAO,EAAE,4BAA4B,EAAE;QACjD,GAAG,EAAE,EAAE,OAAO,EAAE,kCAAkC,EAAE;QACpD,QAAQ,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;QACpD,OAAO,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE;KACrD;CACF,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,WAAW,EAAE,0FAA0F;IACvG,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;CAChD,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,mKAAmK;IAChL,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;CAC/C,CAAA"}
|
|
@@ -27,7 +27,13 @@ const action = {
|
|
|
27
27
|
dynamic: true,
|
|
28
28
|
required: true
|
|
29
29
|
},
|
|
30
|
-
enable_batching: { ...properties_1.enable_batching }
|
|
30
|
+
enable_batching: { ...properties_1.enable_batching },
|
|
31
|
+
phone_number: {
|
|
32
|
+
label: 'Phone Number',
|
|
33
|
+
description: `Individual's phone number in E.164 format. If SMS is not enabled and if you use Phone Number as identifier, then you have to provide one of Email or External ID.`,
|
|
34
|
+
type: 'string',
|
|
35
|
+
default: { '@path': '$.traits.phone' }
|
|
36
|
+
}
|
|
31
37
|
},
|
|
32
38
|
dynamicFields: {
|
|
33
39
|
list_id: async (request) => {
|
|
@@ -35,21 +41,24 @@ const action = {
|
|
|
35
41
|
}
|
|
36
42
|
},
|
|
37
43
|
perform: async (request, { payload }) => {
|
|
38
|
-
const { email, list_id, external_id } = payload;
|
|
39
|
-
if (!email && !external_id) {
|
|
40
|
-
throw new actions_core_1.PayloadValidationError('
|
|
44
|
+
const { email, list_id, external_id, phone_number } = payload;
|
|
45
|
+
if (!email && !external_id && !phone_number) {
|
|
46
|
+
throw new actions_core_1.PayloadValidationError('One of External ID, Phone Number and Email is required.');
|
|
41
47
|
}
|
|
42
|
-
const profileIds = await functions_1.getProfiles(request, email ? [email] : undefined, external_id ? [external_id] : undefined);
|
|
48
|
+
const profileIds = await functions_1.getProfiles(request, email ? [email] : undefined, external_id ? [external_id] : undefined, phone_number ? [phone_number] : undefined);
|
|
43
49
|
return await functions_1.removeProfileFromList(request, profileIds, list_id);
|
|
44
50
|
},
|
|
45
51
|
performBatch: async (request, { payload }) => {
|
|
46
|
-
const filteredPayload = payload.filter((profile) => profile.email || profile.external_id);
|
|
52
|
+
const filteredPayload = payload.filter((profile) => profile.email || profile.external_id || profile.phone_number);
|
|
47
53
|
const listId = filteredPayload[0]?.list_id;
|
|
48
54
|
const emails = filteredPayload.map((profile) => profile.email).filter((email) => email);
|
|
49
55
|
const externalIds = filteredPayload
|
|
50
56
|
.map((profile) => profile.external_id)
|
|
51
57
|
.filter((external_id) => external_id);
|
|
52
|
-
const
|
|
58
|
+
const phoneNumbers = filteredPayload
|
|
59
|
+
.map((profile) => profile.phone_number)
|
|
60
|
+
.filter((phone_number) => phone_number);
|
|
61
|
+
const profileIds = await functions_1.getProfiles(request, emails, externalIds, phoneNumbers);
|
|
53
62
|
return await functions_1.removeProfileFromList(request, profileIds, listId);
|
|
54
63
|
}
|
|
55
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfile/index.ts"],"names":[],"mappings":";;AAAA,wDAAsG;AAItG,4CAAuF;AACvF,8CAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,0BAA0B;IACvC,mBAAmB,EAAE,oBAAoB;IACzC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,oEAAoE;YACjF,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;SACvC;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,+JAA+J;YAC5K,IAAI,EAAE,QAAQ;SACf;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfile/index.ts"],"names":[],"mappings":";;AAAA,wDAAsG;AAItG,4CAAuF;AACvF,8CAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,0BAA0B;IACvC,mBAAmB,EAAE,oBAAoB;IACzC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,oEAAoE;YACjF,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;SACvC;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,+JAA+J;YAC5K,IAAI,EAAE,QAAQ;SACf;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SAC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AAC,CAAC,CAAC,EAAE,OAAO,CAAA;QAC1C,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAa,CAAA;QACnG,MAAM,WAAW,GAAG,eAAe;aAChC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;aACrC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAa,CAAA;QACnD,MAAM,YAAY,GAAG,eAAe;aACjC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;aACtC,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAa,CAAA;QAErD,MAAM,UAAU,GAAG,MAAM,uBAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;QAChF,OAAO,MAAM,iCAAqB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAA;IACjE,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -11,24 +11,28 @@ const action = {
|
|
|
11
11
|
email: { ...properties_1.email },
|
|
12
12
|
external_id: { ...properties_1.external_id },
|
|
13
13
|
list_id: { ...properties_1.list_id },
|
|
14
|
+
phone_number: { ...properties_1.phone_number },
|
|
14
15
|
enable_batching: { ...properties_1.enable_batching }
|
|
15
16
|
},
|
|
16
17
|
perform: async (request, { payload }) => {
|
|
17
|
-
const { email, list_id, external_id } = payload;
|
|
18
|
-
if (!email && !external_id) {
|
|
19
|
-
throw new actions_core_1.PayloadValidationError('
|
|
18
|
+
const { email, list_id, external_id, phone_number } = payload;
|
|
19
|
+
if (!email && !external_id && !phone_number) {
|
|
20
|
+
throw new actions_core_1.PayloadValidationError('One of External ID, Phone Number and Email is required.');
|
|
20
21
|
}
|
|
21
|
-
const profileIds = await functions_1.getProfiles(request, email ? [email] : undefined, external_id ? [external_id] : undefined);
|
|
22
|
+
const profileIds = await functions_1.getProfiles(request, email ? [email] : undefined, external_id ? [external_id] : undefined, phone_number ? [phone_number] : undefined);
|
|
22
23
|
return await functions_1.removeProfileFromList(request, profileIds, list_id);
|
|
23
24
|
},
|
|
24
25
|
performBatch: async (request, { payload }) => {
|
|
25
|
-
const filteredPayload = payload.filter((profile) => profile.email || profile.external_id);
|
|
26
|
+
const filteredPayload = payload.filter((profile) => profile.email || profile.external_id || profile.phone_number);
|
|
26
27
|
const listId = filteredPayload[0]?.list_id;
|
|
27
28
|
const emails = filteredPayload.map((profile) => profile.email).filter((email) => email);
|
|
28
29
|
const externalIds = filteredPayload
|
|
29
30
|
.map((profile) => profile.external_id)
|
|
30
31
|
.filter((external_id) => external_id);
|
|
31
|
-
const
|
|
32
|
+
const phoneNumbers = filteredPayload
|
|
33
|
+
.map((profile) => profile.phone_number)
|
|
34
|
+
.filter((phone_number) => phone_number);
|
|
35
|
+
const profileIds = await functions_1.getProfiles(request, emails, externalIds, phoneNumbers);
|
|
32
36
|
return await functions_1.removeProfileFromList(request, profileIds, listId);
|
|
33
37
|
}
|
|
34
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileFromList/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAIhF,4CAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileFromList/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAIhF,4CAAiE;AACjE,8CAA0F;AAE1F,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EAAE,0BAA0B;IACvC,mBAAmB,EAAE,2BAA2B;IAChD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,GAAG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K,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAa,CAAA;QACnG,MAAM,WAAW,GAAG,eAAe;aAChC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;aACrC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAa,CAAA;QACnD,MAAM,YAAY,GAAG,eAAe;aACjC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;aACtC,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAa,CAAA;QAErD,MAAM,UAAU,GAAG,MAAM,uBAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;QAChF,OAAO,MAAM,iCAAqB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAA;IACjE,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"',
|
|
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;AAC9D,sC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A"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/mappings-two-test/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
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 default destination;
|