@segment/action-destinations 3.362.0 → 3.362.1-remove-abort-controller.2
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/accoil-analytics/postToAccoil/generated-types.d.ts +5 -0
- package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js +3 -0
- package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js.map +1 -0
- package/dist/destinations/accoil-analytics/postToAccoil/index.d.ts +5 -0
- package/dist/destinations/accoil-analytics/postToAccoil/index.js +28 -0
- package/dist/destinations/accoil-analytics/postToAccoil/index.js.map +1 -0
- package/dist/destinations/braze/createAliasV2.types.d.ts +5 -0
- package/dist/destinations/braze/createAliasV2.types.js +3 -0
- package/dist/destinations/braze/createAliasV2.types.js.map +1 -0
- package/dist/destinations/braze/identifyUserV2.types.d.ts +8 -0
- package/dist/destinations/braze/identifyUserV2.types.js +3 -0
- package/dist/destinations/braze/identifyUserV2.types.js.map +1 -0
- package/dist/destinations/campaign-manager-360/common-fields.d.ts +3 -0
- package/dist/destinations/campaign-manager-360/common-fields.js +306 -0
- package/dist/destinations/campaign-manager-360/common-fields.js.map +1 -0
- package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.d.ts +45 -0
- package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js +3 -0
- package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js.map +1 -0
- package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.d.ts +5 -0
- package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js +86 -0
- package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js.map +1 -0
- package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.d.ts +50 -0
- package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js +3 -0
- package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js.map +1 -0
- package/dist/destinations/campaign-manager-360/conversionUpload/index.d.ts +5 -0
- package/dist/destinations/campaign-manager-360/conversionUpload/index.js +131 -0
- package/dist/destinations/campaign-manager-360/conversionUpload/index.js.map +1 -0
- package/dist/destinations/campaign-manager-360/generated-types.d.ts +5 -0
- package/dist/destinations/campaign-manager-360/generated-types.js +3 -0
- package/dist/destinations/campaign-manager-360/generated-types.js.map +1 -0
- package/dist/destinations/campaign-manager-360/index.d.ts +4 -0
- package/dist/destinations/campaign-manager-360/index.js +63 -0
- package/dist/destinations/campaign-manager-360/index.js.map +1 -0
- package/dist/destinations/campaign-manager-360/types.d.ts +116 -0
- package/dist/destinations/campaign-manager-360/types.js +23 -0
- package/dist/destinations/campaign-manager-360/types.js.map +1 -0
- package/dist/destinations/campaign-manager-360/utils.d.ts +21 -0
- package/dist/destinations/campaign-manager-360/utils.js +175 -0
- package/dist/destinations/campaign-manager-360/utils.js.map +1 -0
- package/dist/destinations/contentstack/customAttributesSync/generated-types.d.ts +7 -0
- package/dist/destinations/contentstack/customAttributesSync/generated-types.js +3 -0
- package/dist/destinations/contentstack/customAttributesSync/generated-types.js.map +1 -0
- package/dist/destinations/contentstack/customAttributesSync/index.d.ts +5 -0
- package/dist/destinations/contentstack/customAttributesSync/index.js +54 -0
- package/dist/destinations/contentstack/customAttributesSync/index.js.map +1 -0
- package/dist/destinations/contentstack/customAttributesSync/types.d.ts +14 -0
- package/dist/destinations/contentstack/customAttributesSync/types.js +3 -0
- package/dist/destinations/contentstack/customAttributesSync/types.js.map +1 -0
- package/dist/destinations/contentstack/customAttributesSync/utils.d.ts +4 -0
- package/dist/destinations/contentstack/customAttributesSync/utils.js +20 -0
- package/dist/destinations/contentstack/customAttributesSync/utils.js.map +1 -0
- package/dist/destinations/contentstack/types.d.ts +12 -0
- package/dist/destinations/contentstack/types.js +3 -0
- package/dist/destinations/contentstack/types.js.map +1 -0
- package/dist/destinations/customerio/utils.d.ts +1 -1
- 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/facebook-custom-audiences/add/generated-types.d.ts +2 -0
- package/dist/destinations/facebook-custom-audiences/add/generated-types.js +3 -0
- package/dist/destinations/facebook-custom-audiences/add/generated-types.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/add/index.d.ts +5 -0
- package/dist/destinations/facebook-custom-audiences/add/index.js +11 -0
- package/dist/destinations/facebook-custom-audiences/add/index.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.d.ts +2 -0
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.js +3 -0
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/remove/index.d.ts +5 -0
- package/dist/destinations/facebook-custom-audiences/remove/index.js +11 -0
- package/dist/destinations/facebook-custom-audiences/remove/index.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/hubspot/customEvent/dynamic-fields.d.ts +5 -0
- package/dist/destinations/hubspot/customEvent/dynamic-fields.js +112 -0
- package/dist/destinations/hubspot/customEvent/dynamic-fields.js.map +1 -0
- package/dist/destinations/hubspot/customEvent/event-completion.d.ts +3 -0
- package/dist/destinations/hubspot/customEvent/event-completion.js +17 -0
- package/dist/destinations/hubspot/customEvent/event-completion.js.map +1 -0
- package/dist/destinations/hubspot/customEvent/hubspot-api.d.ts +62 -0
- package/dist/destinations/hubspot/customEvent/hubspot-api.js +305 -0
- package/dist/destinations/hubspot/customEvent/hubspot-api.js.map +1 -0
- package/dist/destinations/hubspot/customEvent/utils.d.ts +14 -0
- package/dist/destinations/hubspot/customEvent/utils.js +303 -0
- package/dist/destinations/hubspot/customEvent/utils.js.map +1 -0
- package/dist/destinations/hubspot/customEvent/validation.d.ts +3 -0
- package/dist/destinations/hubspot/customEvent/validation.js +66 -0
- package/dist/destinations/hubspot/customEvent/validation.js.map +1 -0
- package/dist/destinations/hubspot/upsertObject/dynamic-fields.d.ts +7 -0
- package/dist/destinations/hubspot/upsertObject/dynamic-fields.js +222 -0
- package/dist/destinations/hubspot/upsertObject/dynamic-fields.js.map +1 -0
- package/dist/destinations/hubspot/upsertObject/hubspot-api.d.ts +219 -0
- package/dist/destinations/hubspot/upsertObject/hubspot-api.js +609 -0
- package/dist/destinations/hubspot/upsertObject/hubspot-api.js.map +1 -0
- package/dist/destinations/hubspot/upsertObject/utils.d.ts +13 -0
- package/dist/destinations/hubspot/upsertObject/utils.js +547 -0
- package/dist/destinations/hubspot/upsertObject/utils.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +5 -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 +62 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/mixpanel/incrementProperties/__test__/__snapshots__/snapshot.test.js.snap +18 -0
- 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/shared_properties.d.ts +3 -0
- package/dist/destinations/responsys/shared_properties.js +19 -0
- package/dist/destinations/responsys/shared_properties.js.map +1 -0
- package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +35 -0
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +401 -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/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/package.json +4 -4
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.actionDefinition = void 0;
|
|
4
|
+
const SmsMessageSender_1 = require("./SmsMessageSender");
|
|
5
|
+
exports.actionDefinition = {
|
|
6
|
+
title: 'Send SMS',
|
|
7
|
+
description: 'Send SMS using Twilio',
|
|
8
|
+
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
9
|
+
fields: {
|
|
10
|
+
userId: {
|
|
11
|
+
label: 'User ID',
|
|
12
|
+
description: 'User ID in Segment',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: { '@path': '$.userId' }
|
|
15
|
+
},
|
|
16
|
+
toNumber: {
|
|
17
|
+
label: 'Test Number',
|
|
18
|
+
description: 'Number to send SMS to when testing',
|
|
19
|
+
type: 'string'
|
|
20
|
+
},
|
|
21
|
+
from: {
|
|
22
|
+
label: 'From',
|
|
23
|
+
description: 'The Twilio Phone Number, Short Code, or Messaging Service to send SMS from.',
|
|
24
|
+
type: 'string',
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
body: {
|
|
28
|
+
label: 'Message',
|
|
29
|
+
description: 'Message to send',
|
|
30
|
+
type: 'text',
|
|
31
|
+
required: false
|
|
32
|
+
},
|
|
33
|
+
media: {
|
|
34
|
+
label: 'Media Urls',
|
|
35
|
+
description: 'Media to attach to message',
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: false,
|
|
38
|
+
multiple: true
|
|
39
|
+
},
|
|
40
|
+
contentSid: {
|
|
41
|
+
label: 'SMS content template SID',
|
|
42
|
+
description: 'Content template SID for Twilio Content API',
|
|
43
|
+
type: 'string',
|
|
44
|
+
required: false
|
|
45
|
+
},
|
|
46
|
+
customArgs: {
|
|
47
|
+
label: 'Custom Arguments',
|
|
48
|
+
description: 'Additional custom arguments that will be opaquely sent back on webhook events',
|
|
49
|
+
type: 'object',
|
|
50
|
+
required: false
|
|
51
|
+
},
|
|
52
|
+
connectionOverrides: {
|
|
53
|
+
label: 'Connection Overrides',
|
|
54
|
+
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
55
|
+
type: 'string',
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
send: {
|
|
59
|
+
label: 'Send Message',
|
|
60
|
+
description: 'Whether or not the message should actually get sent.',
|
|
61
|
+
type: 'boolean',
|
|
62
|
+
required: false,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
traitEnrichment: {
|
|
66
|
+
label: 'Trait Enrich',
|
|
67
|
+
description: 'Whether or not trait enrich from event (i.e without profile api call)',
|
|
68
|
+
type: 'boolean',
|
|
69
|
+
required: false,
|
|
70
|
+
default: true
|
|
71
|
+
},
|
|
72
|
+
sendBasedOnOptOut: {
|
|
73
|
+
label: 'Send OptOut',
|
|
74
|
+
description: 'Send to any subscription status other than unsubscribed',
|
|
75
|
+
type: 'boolean',
|
|
76
|
+
default: false
|
|
77
|
+
},
|
|
78
|
+
segmentComputationId: {
|
|
79
|
+
label: 'Segment Computation ID',
|
|
80
|
+
description: 'Segment computation ID',
|
|
81
|
+
type: 'string',
|
|
82
|
+
required: false,
|
|
83
|
+
default: {
|
|
84
|
+
'@path': '$.context.personas.computation_id'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
externalIds: {
|
|
88
|
+
label: 'External IDs',
|
|
89
|
+
description: 'An array of user profile identity information.',
|
|
90
|
+
type: 'object',
|
|
91
|
+
multiple: true,
|
|
92
|
+
properties: {
|
|
93
|
+
id: {
|
|
94
|
+
label: 'ID',
|
|
95
|
+
description: 'A unique identifier for the collection.',
|
|
96
|
+
type: 'string'
|
|
97
|
+
},
|
|
98
|
+
type: {
|
|
99
|
+
label: 'type',
|
|
100
|
+
description: 'The external ID contact type.',
|
|
101
|
+
type: 'string'
|
|
102
|
+
},
|
|
103
|
+
channelType: {
|
|
104
|
+
label: 'type',
|
|
105
|
+
description: 'The external ID contact channel type (SMS, WHATSAPP, etc).',
|
|
106
|
+
type: 'string'
|
|
107
|
+
},
|
|
108
|
+
subscriptionStatus: {
|
|
109
|
+
label: 'ID',
|
|
110
|
+
description: 'The subscription status for the identity.',
|
|
111
|
+
type: 'string'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
default: {
|
|
115
|
+
'@arrayPath': [
|
|
116
|
+
'$.external_ids',
|
|
117
|
+
{
|
|
118
|
+
id: {
|
|
119
|
+
'@path': '$.id'
|
|
120
|
+
},
|
|
121
|
+
type: {
|
|
122
|
+
'@path': '$.type'
|
|
123
|
+
},
|
|
124
|
+
channelType: {
|
|
125
|
+
'@path': '$.channelType'
|
|
126
|
+
},
|
|
127
|
+
subscriptionStatus: {
|
|
128
|
+
'@path': '$.isSubscribed'
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
traits: {
|
|
135
|
+
label: 'Traits',
|
|
136
|
+
description: "A user profile's traits",
|
|
137
|
+
type: 'object',
|
|
138
|
+
required: false,
|
|
139
|
+
default: { '@path': '$.properties' }
|
|
140
|
+
},
|
|
141
|
+
eventOccurredTS: {
|
|
142
|
+
label: 'Event Timestamp',
|
|
143
|
+
description: 'Time of when the actual event happened.',
|
|
144
|
+
type: 'string',
|
|
145
|
+
required: false,
|
|
146
|
+
default: {
|
|
147
|
+
'@path': '$.timestamp'
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
messageId: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
required: false,
|
|
153
|
+
description: 'The Segment messageId',
|
|
154
|
+
label: 'MessageId',
|
|
155
|
+
default: { '@path': '$.messageId' }
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
perform: async (request, data) => {
|
|
159
|
+
return new SmsMessageSender_1.SmsMessageSender(request, data).perform();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=actionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionDefinition.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/sendSms/actionDefinition.ts"],"names":[],"mappings":";;;AAIA,yDAAqD;AAExC,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,uBAAuB;IACpC,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,oCAAoC;YACjD,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,6EAA6E;YAC1F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,KAAK;SAChB;QACD,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,6CAA6C;YAC1D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,+EAA+E;YAC5F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,8HAA8H;YAChI,IAAI,EAA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BACE,EAAE,EAAE;4BACF,OAAO,EAAE,MAAM;yBAChB;wBACD,IAAI,EAAE;4BACJ,OAAO,EAAE,QAAQ;yBAClB;wBACD,WAAW,EAAE;4BACX,OAAO,EAAE,eAAe;yBACzB;wBACD,kBAAkB,EAAE;4BAClB,OAAO,EAAE,gBAAgB;yBAC1B;qBACF;iBACF;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,OAAO,IAAI,mCAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;IACtD,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../engage-messaging-twilio/sendSms.types';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("../../../engage-messaging-twilio/sendSms.types"), exports);
|
|
14
|
+
//# sourceMappingURL=generated-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/sendSms/generated-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iFAA8D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './actionDefinition';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./actionDefinition"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/sendSms/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Payload } from './generated-types';
|
|
2
|
+
import { PhoneMessageSender } from '../utils';
|
|
3
|
+
export declare class WhatsAppMessageSender extends PhoneMessageSender<Payload> {
|
|
4
|
+
get supportedTemplateTypes(): string[];
|
|
5
|
+
getChannelType(): string;
|
|
6
|
+
getBody(phone: string): Promise<URLSearchParams>;
|
|
7
|
+
private parsePhoneNumber;
|
|
8
|
+
private getVariables;
|
|
9
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.WhatsAppMessageSender = void 0;
|
|
10
|
+
const liquidjs_1 = require("liquidjs");
|
|
11
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
12
|
+
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
13
|
+
const utils_1 = require("../utils");
|
|
14
|
+
const utils_2 = require("../../utils");
|
|
15
|
+
const phoneUtil = google_libphonenumber_1.PhoneNumberUtil.getInstance();
|
|
16
|
+
const Liquid = new liquidjs_1.Liquid();
|
|
17
|
+
class WhatsAppMessageSender extends utils_1.PhoneMessageSender {
|
|
18
|
+
get supportedTemplateTypes() {
|
|
19
|
+
throw new Error('Method not supported.');
|
|
20
|
+
}
|
|
21
|
+
getChannelType() {
|
|
22
|
+
return 'whatsapp';
|
|
23
|
+
}
|
|
24
|
+
async getBody(phone) {
|
|
25
|
+
if (!this.payload.contentSid) {
|
|
26
|
+
throw new actions_core_1.IntegrationError('A valid whatsApp Content SID was not provided.', `INVALID_CONTENT_SID`, 400);
|
|
27
|
+
}
|
|
28
|
+
const params = {
|
|
29
|
+
ContentSid: this.payload.contentSid,
|
|
30
|
+
From: this.payload.from,
|
|
31
|
+
To: this.parsePhoneNumber(phone)
|
|
32
|
+
};
|
|
33
|
+
const contentVariables = await this.getVariables();
|
|
34
|
+
if (contentVariables)
|
|
35
|
+
params['ContentVariables'] = contentVariables;
|
|
36
|
+
return new URLSearchParams(params);
|
|
37
|
+
}
|
|
38
|
+
parsePhoneNumber(phone) {
|
|
39
|
+
let parsedPhone;
|
|
40
|
+
try {
|
|
41
|
+
parsedPhone = phoneUtil.parse(phone, 'US');
|
|
42
|
+
if (!phoneUtil.isPossibleNumber(parsedPhone) || !phoneUtil.isValidNumber(parsedPhone)) {
|
|
43
|
+
parsedPhone = phoneUtil.parse('+' + phone, 'US');
|
|
44
|
+
}
|
|
45
|
+
parsedPhone = phoneUtil.format(parsedPhone, google_libphonenumber_1.PhoneNumberFormat.E164);
|
|
46
|
+
return `whatsapp:${parsedPhone}`;
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
const underlyingError = e;
|
|
50
|
+
throw new actions_core_1.IntegrationError('Phone number must be able to be formatted to e164 for whatsapp. ' + underlyingError.message, `INVALID_PHONE`, 400);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async getVariables() {
|
|
54
|
+
if (!this.payload.traitEnrichment && this.payload.contentVariables)
|
|
55
|
+
return JSON.stringify(this.payload.contentVariables) ?? null;
|
|
56
|
+
if (!this.payload.contentVariables || !this.payload.traits)
|
|
57
|
+
return null;
|
|
58
|
+
const profile = {
|
|
59
|
+
profile: {
|
|
60
|
+
traits: this.payload.traits
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const mapping = {};
|
|
64
|
+
for (const [key, val] of Object.entries(this.payload.contentVariables)) {
|
|
65
|
+
const parsed = await Liquid.parseAndRender(val, profile);
|
|
66
|
+
if (parsed?.length) {
|
|
67
|
+
mapping[key] = parsed;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return JSON.stringify(mapping);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
__decorate([
|
|
74
|
+
utils_2.track()
|
|
75
|
+
], WhatsAppMessageSender.prototype, "getBody", null);
|
|
76
|
+
__decorate([
|
|
77
|
+
utils_2.track()
|
|
78
|
+
], WhatsAppMessageSender.prototype, "parsePhoneNumber", null);
|
|
79
|
+
__decorate([
|
|
80
|
+
utils_2.track({
|
|
81
|
+
wrapIntegrationError: () => [
|
|
82
|
+
`Unable to parse templating in content variables`,
|
|
83
|
+
`Content variables templating parse failure`,
|
|
84
|
+
400
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
], WhatsAppMessageSender.prototype, "getVariables", null);
|
|
88
|
+
exports.WhatsAppMessageSender = WhatsAppMessageSender;
|
|
89
|
+
//# sourceMappingURL=WhatsAppMessageSender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhatsAppMessageSender.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.ts"],"names":[],"mappings":";;;;;;;;;AACA,uCAA6C;AAE7C,wDAAwD;AACxD,iEAA0E;AAC1E,oCAA6C;AAC7C,uCAAmC;AAEnC,MAAM,SAAS,GAAG,uCAAe,CAAC,WAAW,EAAE,CAAA;AAC/C,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAE7B,MAAa,qBAAsB,SAAQ,0BAA2B;IACpE,IAAI,sBAAsB;QACxB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;IAC1C,CAAC;IACD,cAAc;QACZ,OAAO,UAAU,CAAA;IACnB,CAAC;IAGD,KAAK,CAAC,OAAO,CAAC,KAAa;QACzB,IAAI,CAAC,I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,CAAC,OAAO,CAAC,gBAAgB;YAChE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,IAAI,CAAA;QAC9D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,OAAO,IAAI,CAAA;QAEvE,MAAM,OAAO,GAAG;YACd,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;aAC5B;SACF,CAAA;QAED,MAAM,OAAO,GAA2B,EAAE,CAAA;QAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;YACtE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,GAAa,EAAE,OAAO,CAAC,CAAA;YAClE,IAAI,MAAM,EAAE,MAAM,EAAE;gBAClB,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAA;aACtB;SACF;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;CACF;AA3EC;IADC,aAAK,EAAE;oDAgBP;AAGD;IADC,aAAK,EAAE;6DAyBP;AASD;IAPC,aAAK,CAAC;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC;YAC1B,iDAAiD;YACjD,4CAA4C;YAC5C,GAAG;SACJ;KACF,CAAC;yDAwBD;AAnFH,sDAoFC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.actionDefinition = void 0;
|
|
4
|
+
const WhatsAppMessageSender_1 = require("./WhatsAppMessageSender");
|
|
5
|
+
exports.actionDefinition = {
|
|
6
|
+
title: 'Send WhatsApp',
|
|
7
|
+
description: 'Send WhatsApp using Twilio',
|
|
8
|
+
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
9
|
+
fields: {
|
|
10
|
+
contentSid: {
|
|
11
|
+
label: 'WhatsApp template Content Sid',
|
|
12
|
+
description: 'The template you sending through WhatsApp',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
contentVariables: {
|
|
17
|
+
label: 'WhatsApp template variables',
|
|
18
|
+
description: 'Content personalization variables/merge tags for your WhatsApp message',
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: false
|
|
21
|
+
},
|
|
22
|
+
toNumber: {
|
|
23
|
+
label: 'Test Number',
|
|
24
|
+
description: 'Number to send WhatsApp to when testing',
|
|
25
|
+
type: 'string'
|
|
26
|
+
},
|
|
27
|
+
from: {
|
|
28
|
+
label: 'From',
|
|
29
|
+
description: 'The Twilio Phone Number, Short Code, or Messaging Service to send WhatsApp from.',
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
customArgs: {
|
|
34
|
+
label: 'Custom Arguments',
|
|
35
|
+
description: 'Additional custom arguments that will be opaquely sent back on webhook events',
|
|
36
|
+
type: 'object',
|
|
37
|
+
required: false
|
|
38
|
+
},
|
|
39
|
+
connectionOverrides: {
|
|
40
|
+
label: 'Connection Overrides',
|
|
41
|
+
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
42
|
+
type: 'string',
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
send: {
|
|
46
|
+
label: 'Send Message',
|
|
47
|
+
description: 'Whether or not the message should actually get sent.',
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
required: false,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
traitEnrichment: {
|
|
53
|
+
label: 'Trait Enrich',
|
|
54
|
+
description: 'Whether or not trait enrich from event (i.e without profile api call)',
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
required: false,
|
|
57
|
+
default: true
|
|
58
|
+
},
|
|
59
|
+
segmentComputationId: {
|
|
60
|
+
label: 'Segment Computation ID',
|
|
61
|
+
description: 'Segment computation ID',
|
|
62
|
+
type: 'string',
|
|
63
|
+
required: false,
|
|
64
|
+
default: {
|
|
65
|
+
'@path': '$.context.personas.computation_id'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
externalIds: {
|
|
69
|
+
label: 'External IDs',
|
|
70
|
+
description: 'An array of user profile identity information.',
|
|
71
|
+
type: 'object',
|
|
72
|
+
multiple: true,
|
|
73
|
+
properties: {
|
|
74
|
+
id: {
|
|
75
|
+
label: 'ID',
|
|
76
|
+
description: 'A unique identifier for the collection.',
|
|
77
|
+
type: 'string'
|
|
78
|
+
},
|
|
79
|
+
type: {
|
|
80
|
+
label: 'type',
|
|
81
|
+
description: 'The external ID contact type.',
|
|
82
|
+
type: 'string'
|
|
83
|
+
},
|
|
84
|
+
channelType: {
|
|
85
|
+
label: 'type',
|
|
86
|
+
description: 'The external ID contact channel type (SMS, WHATSAPP, etc).',
|
|
87
|
+
type: 'string'
|
|
88
|
+
},
|
|
89
|
+
subscriptionStatus: {
|
|
90
|
+
label: 'ID',
|
|
91
|
+
description: 'The subscription status for the identity.',
|
|
92
|
+
type: 'string'
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
default: {
|
|
96
|
+
'@arrayPath': [
|
|
97
|
+
'$.external_ids',
|
|
98
|
+
{
|
|
99
|
+
id: {
|
|
100
|
+
'@path': '$.id'
|
|
101
|
+
},
|
|
102
|
+
type: {
|
|
103
|
+
'@path': '$.type'
|
|
104
|
+
},
|
|
105
|
+
channelType: {
|
|
106
|
+
'@path': '$.channelType'
|
|
107
|
+
},
|
|
108
|
+
subscriptionStatus: {
|
|
109
|
+
'@path': '$.isSubscribed'
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
traits: {
|
|
116
|
+
label: 'Traits',
|
|
117
|
+
description: "A user profile's traits",
|
|
118
|
+
type: 'object',
|
|
119
|
+
required: false,
|
|
120
|
+
default: { '@path': '$.properties' }
|
|
121
|
+
},
|
|
122
|
+
eventOccurredTS: {
|
|
123
|
+
label: 'Event Timestamp',
|
|
124
|
+
description: 'Time of when the actual event happened.',
|
|
125
|
+
type: 'string',
|
|
126
|
+
required: false,
|
|
127
|
+
default: {
|
|
128
|
+
'@path': '$.timestamp'
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
perform: async (request, data) => {
|
|
133
|
+
return new WhatsAppMessageSender_1.WhatsAppMessageSender(request, data).perform();
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=actionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionDefinition.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/sendWhatsApp/actionDefinition.ts"],"names":[],"mappings":";;;AAIA,mEAA+D;AAElD,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,4BAA4B;IACzC,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,+BAA+B;YACtC,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,6BAA6B;YACpC,WAAW,EAAE,wEAAwE;YACrF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,kFAAkF;YAC/F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,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ACD,OAAO,EAAE;gBACP,YAAY,EAAE;oBACZ,gBAAgB;oBAChB;wBACE,EAAE,EAAE;4BACF,OAAO,EAAE,MAAM;yBAChB;wBACD,IAAI,EAAE;4BACJ,OAAO,EAAE,QAAQ;yBAClB;wBACD,WAAW,EAAE;4BACX,OAAO,EAAE,eAAe;yBACzB;wBACD,kBAAkB,EAAE;4BAClB,OAAO,EAAE,gBAAgB;yBAC1B;qBACF;iBACF;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,OAAO,IAAI,6CAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;IAC3D,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../engage-messaging-twilio/sendWhatsApp.types';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("../../../engage-messaging-twilio/sendWhatsApp.types"), exports);
|
|
14
|
+
//# sourceMappingURL=generated-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/sendWhatsApp/generated-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sFAAmE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './actionDefinition';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./actionDefinition"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/sendWhatsApp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TwilioMessageSender, TwilioPayloadBase } from './TwilioMessageSender';
|
|
2
|
+
import { ExtId } from '../../utils';
|
|
3
|
+
export declare abstract class PhoneMessageSender<Payload extends PhoneMessagePayload> extends TwilioMessageSender<Payload> {
|
|
4
|
+
private readonly EXTERNAL_ID_KEY;
|
|
5
|
+
private readonly DEFAULT_HOSTNAME;
|
|
6
|
+
private readonly DEFAULT_CONNECTION_OVERRIDES;
|
|
7
|
+
abstract getBody(phone: string): Promise<URLSearchParams>;
|
|
8
|
+
get twilioHostname(): string;
|
|
9
|
+
get twilioToken(): string;
|
|
10
|
+
sendToRecepient(recepient: ExtId<Payload>): Promise<import("@segment/actions-core/*").ModifiedResponse<unknown>>;
|
|
11
|
+
isSupportedExternalId(externalId: NonNullable<Payload['externalIds']>[number]): boolean;
|
|
12
|
+
getRecepients(): ExtId<Payload>[];
|
|
13
|
+
}
|
|
14
|
+
export interface PhoneMessagePayload extends TwilioPayloadBase {
|
|
15
|
+
toNumber?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhoneMessageSender = void 0;
|
|
4
|
+
const TwilioMessageSender_1 = require("./TwilioMessageSender");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
class PhoneMessageSender extends TwilioMessageSender_1.TwilioMessageSender {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.EXTERNAL_ID_KEY = 'phone';
|
|
10
|
+
this.DEFAULT_HOSTNAME = 'api.twilio.com';
|
|
11
|
+
this.DEFAULT_CONNECTION_OVERRIDES = 'rp=all&rc=5';
|
|
12
|
+
}
|
|
13
|
+
get twilioHostname() {
|
|
14
|
+
return this.settings.twilioHostname ?? this.DEFAULT_HOSTNAME;
|
|
15
|
+
}
|
|
16
|
+
get twilioToken() {
|
|
17
|
+
return Buffer.from(`${this.settings.twilioApiKeySID}:${this.settings.twilioApiKeySecret}`).toString('base64');
|
|
18
|
+
}
|
|
19
|
+
async sendToRecepient(recepient) {
|
|
20
|
+
const phone = recepient.id;
|
|
21
|
+
const op = this.currentOperation;
|
|
22
|
+
this.currentOperation?.onFinally.push(() => {
|
|
23
|
+
const error = op.error;
|
|
24
|
+
if (error)
|
|
25
|
+
op.tags.push('not_sent_reason:error_operation_' + utils_1.OperationDecorator.getOperationName(error.trackedContext || op));
|
|
26
|
+
});
|
|
27
|
+
const body = await this.getBody(phone);
|
|
28
|
+
const webhookUrlWithParams = this.getWebhookUrlWithParams(this.EXTERNAL_ID_KEY, phone, this.DEFAULT_CONNECTION_OVERRIDES);
|
|
29
|
+
const tags = {
|
|
30
|
+
audience_id: this.payload.customArgs && this.payload.customArgs['audience_id'],
|
|
31
|
+
correlation_id: this.payload.customArgs && this.payload.customArgs['correlation_id'],
|
|
32
|
+
journey_name: this.payload.customArgs && this.payload.customArgs['journey_name'],
|
|
33
|
+
step_name: this.payload.customArgs && this.payload.customArgs['step_name'],
|
|
34
|
+
campaign_name: this.payload.customArgs && this.payload.customArgs['campaign_name'],
|
|
35
|
+
campaign_key: this.payload.customArgs && this.payload.customArgs['campaign_key'],
|
|
36
|
+
user_id: this.payload.customArgs && this.payload.customArgs['user_id'],
|
|
37
|
+
message_id: this.payload.customArgs && this.payload.customArgs['message_id'],
|
|
38
|
+
external_id_type: recepient.type,
|
|
39
|
+
external_id_value: phone
|
|
40
|
+
};
|
|
41
|
+
body.append('Tags', JSON.stringify(tags));
|
|
42
|
+
if (webhookUrlWithParams) {
|
|
43
|
+
body.append('StatusCallback', webhookUrlWithParams);
|
|
44
|
+
}
|
|
45
|
+
this.statsSet('message_body_size', body?.toString().length);
|
|
46
|
+
const response = await this.request(`https://${this.twilioHostname}/2010-04-01/Accounts/${this.settings.twilioAccountSID}/Messages.json`, {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
headers: {
|
|
49
|
+
authorization: `Basic ${this.twilioToken}`
|
|
50
|
+
},
|
|
51
|
+
body
|
|
52
|
+
});
|
|
53
|
+
this.logDetails['twilio-request-id'] = response.headers?.get('twilio-request-id');
|
|
54
|
+
return response;
|
|
55
|
+
}
|
|
56
|
+
isSupportedExternalId(externalId) {
|
|
57
|
+
return externalId.type === 'phone' && externalId.channelType?.toLowerCase() === this.getChannelType();
|
|
58
|
+
}
|
|
59
|
+
getRecepients() {
|
|
60
|
+
if (this.payload.toNumber)
|
|
61
|
+
return [
|
|
62
|
+
{
|
|
63
|
+
id: this.payload.toNumber
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
const res = super.getRecepients();
|
|
67
|
+
return res.length > 0 ? [res[0]] : res;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.PhoneMessageSender = PhoneMessageSender;
|
|
71
|
+
//# sourceMappingURL=PhoneMessageSender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneMessageSender.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/utils/PhoneMessageSender.ts"],"names":[],"mappings":";;;AAEA,+DAA8E;AAC9E,uCAAuF;AAKvF,MAAsB,kBAAwD,SAAQ,yCAA4B;IAAlH;;QACmB,oBAAe,GAAG,OAAO,CAAA;QACzB,qBAAgB,GAAG,gBAAgB,CAAA;QACnC,iCAA4B,GAAG,aAAa,CAAA;IAmF/D,CAAC;IA/EC,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,IAAI,IAAI,CAAC,gBAAgB,CAAA;IAC9D,CAAC;IACD,IAAI,WAAW;QACb,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC/G,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAyB;QAC7C,MAAM,KAAK,GAAG,SAAS,CAAC,EAAG,CAAA;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAoC,CAAA;QACpD,IAA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AM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IACxC,CAAC;CACF;AAtFD,gDAsFC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Settings } from '../generated-types';
|
|
2
|
+
import { ContentTemplateTypes, Profile } from './types';
|
|
3
|
+
import { MessageSendPerformer, MessagePayloadBase } from '../../utils';
|
|
4
|
+
export interface TwilioPayloadBase extends MessagePayloadBase {
|
|
5
|
+
contentSid?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class TwilioMessageSender<TPayload extends TwilioPayloadBase> extends MessageSendPerformer<Settings, TPayload> {
|
|
8
|
+
getIntegrationStatsName(): string;
|
|
9
|
+
getDefaultSettingsRegion(): string;
|
|
10
|
+
abstract readonly supportedTemplateTypes: string[];
|
|
11
|
+
parseContent<R extends Record<string, string | string[] | undefined>>(content: R, profile: Profile): Promise<R>;
|
|
12
|
+
getContentTemplateTypes(): Promise<ContentTemplateTypes>;
|
|
13
|
+
private extractTemplateTypes;
|
|
14
|
+
getWebhookUrlWithParams(externalIdType?: string, externalIdValue?: string, defaultConnectionOverrides?: string): string | null;
|
|
15
|
+
beforePerform(): void;
|
|
16
|
+
}
|