@segment/action-destinations 3.363.0 → 3.363.1-node-engine-upgrade.1
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/display-video-360/shared.js +1 -1
- package/dist/destinations/display-video-360/shared.js.map +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/intercom/identifyContact/index.js.map +1 -1
- 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/optimizely-feature-experimentation-actions/trackEvent/functions.d.ts +2 -14
- package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/functions.js +1 -1
- package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/functions.js.map +1 -1
- 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 +5 -5
|
@@ -0,0 +1,115 @@
|
|
|
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.TwilioMessageSender = void 0;
|
|
10
|
+
const liquidjs_1 = require("liquidjs");
|
|
11
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const Liquid = new liquidjs_1.Liquid();
|
|
14
|
+
class TwilioMessageSender extends utils_1.MessageSendPerformer {
|
|
15
|
+
getIntegrationStatsName() {
|
|
16
|
+
return 'actions_personas_messaging_twilio';
|
|
17
|
+
}
|
|
18
|
+
getDefaultSettingsRegion() {
|
|
19
|
+
return 'us-west-1';
|
|
20
|
+
}
|
|
21
|
+
async parseContent(content, profile) {
|
|
22
|
+
const traits = profile.traits ? { ...profile.traits } : profile.traits;
|
|
23
|
+
if (traits) {
|
|
24
|
+
for (const trait of Object.keys(traits)) {
|
|
25
|
+
if (traits && traits[trait] === '<nil>') {
|
|
26
|
+
traits[trait] = '';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const parsedEntries = await Promise.all(Object.entries(content).map(async ([key, val]) => {
|
|
31
|
+
if (val == null) {
|
|
32
|
+
return [key, val];
|
|
33
|
+
}
|
|
34
|
+
if (Array.isArray(val)) {
|
|
35
|
+
val = await Promise.all(val.map((item) => Liquid.parseAndRender(item, { profile: { ...profile, traits } })));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
val = await Liquid.parseAndRender(val, { profile: { ...profile, traits } });
|
|
39
|
+
}
|
|
40
|
+
return [key, val];
|
|
41
|
+
}));
|
|
42
|
+
return Object.fromEntries(parsedEntries);
|
|
43
|
+
}
|
|
44
|
+
async getContentTemplateTypes() {
|
|
45
|
+
if (!this.payload.contentSid) {
|
|
46
|
+
throw new actions_core_1.PayloadValidationError('Content SID not in payload');
|
|
47
|
+
}
|
|
48
|
+
const twilioToken = Buffer.from(`${this.settings.twilioApiKeySID}:${this.settings.twilioApiKeySecret}`).toString('base64');
|
|
49
|
+
const response = await this.request(`https://content.twilio.com/v1/Content/${this.payload.contentSid}`, {
|
|
50
|
+
method: 'GET',
|
|
51
|
+
headers: {
|
|
52
|
+
authorization: `Basic ${twilioToken}`
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const template = (await response.json());
|
|
56
|
+
return this.extractTemplateTypes(template);
|
|
57
|
+
}
|
|
58
|
+
extractTemplateTypes(template) {
|
|
59
|
+
if (!template.types) {
|
|
60
|
+
throw new actions_core_1.IntegrationError('Template from Twilio Content API does not contain any template types', `NO_CONTENT_TYPES`, 400);
|
|
61
|
+
}
|
|
62
|
+
const type = Object.keys(template.types)[0];
|
|
63
|
+
if (this.supportedTemplateTypes.includes(type)) {
|
|
64
|
+
return { body: template.types[type].body, media: template.types[type].media };
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
throw new actions_core_1.IntegrationError(`Sending templates with '${type}' content type is not supported by ${this.getChannelType()}`, 'UNSUPPORTED_CONTENT_TYPE', 400);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
getWebhookUrlWithParams(externalIdType, externalIdValue, defaultConnectionOverrides = 'rp=all&rc=5') {
|
|
71
|
+
const webhookUrl = this.settings.webhookUrl;
|
|
72
|
+
const connectionOverrides = this.settings.connectionOverrides;
|
|
73
|
+
const customArgs = {
|
|
74
|
+
...this.payload.customArgs,
|
|
75
|
+
space_id: this.settings.spaceId,
|
|
76
|
+
__segment_internal_external_id_key__: externalIdType,
|
|
77
|
+
__segment_internal_external_id_value__: externalIdValue
|
|
78
|
+
};
|
|
79
|
+
if (webhookUrl && customArgs) {
|
|
80
|
+
this.logOnError(() => JSON.stringify(customArgs));
|
|
81
|
+
const webhookUrlWithParams = new URL(webhookUrl);
|
|
82
|
+
for (const key of Object.keys(customArgs)) {
|
|
83
|
+
webhookUrlWithParams.searchParams.append(key, String(customArgs[key]));
|
|
84
|
+
}
|
|
85
|
+
webhookUrlWithParams.hash = connectionOverrides || defaultConnectionOverrides;
|
|
86
|
+
return webhookUrlWithParams.toString();
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
beforePerform() {
|
|
91
|
+
super.beforePerform();
|
|
92
|
+
Object.assign(this.logDetails, {
|
|
93
|
+
contentSid: this.payload.contentSid,
|
|
94
|
+
twilioApiKeySID: this.settings.twilioApiKeySID
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
__decorate([
|
|
99
|
+
utils_1.track({
|
|
100
|
+
wrapIntegrationError: () => new actions_core_1.PayloadValidationError('Unable to parse templating, invalid liquid')
|
|
101
|
+
})
|
|
102
|
+
], TwilioMessageSender.prototype, "parseContent", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
utils_1.track()
|
|
105
|
+
], TwilioMessageSender.prototype, "getContentTemplateTypes", null);
|
|
106
|
+
__decorate([
|
|
107
|
+
utils_1.track()
|
|
108
|
+
], TwilioMessageSender.prototype, "extractTemplateTypes", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
utils_1.track({
|
|
111
|
+
wrapIntegrationError: () => new actions_core_1.PayloadValidationError('Invalid webhook url arguments')
|
|
112
|
+
})
|
|
113
|
+
], TwilioMessageSender.prototype, "getWebhookUrlWithParams", null);
|
|
114
|
+
exports.TwilioMessageSender = TwilioMessageSender;
|
|
115
|
+
//# sourceMappingURL=TwilioMessageSender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwilioMessageSender.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/utils/TwilioMessageSender.ts"],"names":[],"mappings":";;;;;;;;;AAEA,uCAA6C;AAI7C,wDAAgF;AAEhF,uCAA6E;AAE7E,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAM7B,MAAsB,mBAAwD,SAAQ,4BAGrF;IACC,uBAAuB;QACrB,OAAO,mCAAmC,CAAA;IAC5C,CAAC;IAED,wBAAwB;QACtB,OAAO,WAAW,CAAA;IACpB,CAAC;IAUD,KAAK,CAAC,YAAY,CAChB,OAAU,EACV,OAAgB;QAEhB,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAA;QACtE,IAAI,MAAM,EAAE;YACV,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBACvC,IAAI,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,OAAO,EAAE;oBACvC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAA;iBACnB;aACF;SACF;QAED,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,GAAG,CACrC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE;YAC/C,IAAI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CAAC,CAAA;YACjD,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;YAEhD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBACzC,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACvE;YAED,oBAAoB,CAAC,IAAI,GAAG,mBAAmB,IAAI,0BAA0B,CAAA;YAC7E,OAAO,oBAAoB,CAAC,QAAQ,EAAE,CAAA;SACvC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,aAAa;QACX,KAAK,CAAC,aAAa,EAAE,CAAA;QACrB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE;YAC7B,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;YACnC,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe;SAC/C,CAAC,CAAA;IACJ,CAAC;CACF;AAtHC;IAHC,aAAK,CAAC;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,IAAI,qCAAsB,CAAC,4CAA4C,CAAC;KACrG,CAAC;uDA8BD;AAGD;IADC,aAAK,EAAE;kEAmBP;AAGD;IADC,aAAK,EAAE;+DAoBP;AAKD;IAHC,aAAK,CAAC;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,IAAI,qCAAsB,CAAC,+BAA+B,CAAC;KACxF,CAAC;kEAiCD;AAjIH,kDA0IC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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("./TwilioMessageSender"), exports);
|
|
14
|
+
__exportStar(require("./PhoneMessageSender"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAqC;AACrC,uDAAoC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Payload } from '../sendSms/generated-types';
|
|
2
|
+
export interface ContentTemplateResponse {
|
|
3
|
+
types: {
|
|
4
|
+
[type: string]: {
|
|
5
|
+
body: string;
|
|
6
|
+
media?: string[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface ContentTemplateResponse {
|
|
11
|
+
types: {
|
|
12
|
+
[type: string]: {
|
|
13
|
+
body: string;
|
|
14
|
+
media?: string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare type ContentTemplateTypes = ContentTemplateResponse['types'][string];
|
|
19
|
+
export declare type Profile = {
|
|
20
|
+
user_id?: string | undefined;
|
|
21
|
+
phone?: string;
|
|
22
|
+
traits: Payload['traits'];
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/twilio/utils/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IntegrationError } from '@segment/actions-core';
|
|
2
|
+
export declare class AggregateError extends IntegrationError {
|
|
3
|
+
errors: any[];
|
|
4
|
+
data?: any;
|
|
5
|
+
static create(args: {
|
|
6
|
+
errors: any[];
|
|
7
|
+
code?: string;
|
|
8
|
+
status?: number;
|
|
9
|
+
takeCodeAndStatusFromError?: any;
|
|
10
|
+
message?: (msg: string) => string;
|
|
11
|
+
}): AggregateError;
|
|
12
|
+
constructor(errors: any[], code?: string, status?: number, data?: any, message?: string);
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregateError = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const ResponseError_1 = require("./ResponseError");
|
|
6
|
+
class AggregateError extends actions_core_1.IntegrationError {
|
|
7
|
+
constructor(errors, code, status, data, message) {
|
|
8
|
+
super(message || 'Multiple errors', code, status);
|
|
9
|
+
this.errors = errors;
|
|
10
|
+
this.data = data;
|
|
11
|
+
}
|
|
12
|
+
static create(args) {
|
|
13
|
+
const firstErrorInfo = ResponseError_1.getErrorDetails(args.takeCodeAndStatusFromError ? args.takeCodeAndStatusFromError : args.errors[0]);
|
|
14
|
+
if (!args.code)
|
|
15
|
+
args.code = firstErrorInfo.code;
|
|
16
|
+
if (!args.status)
|
|
17
|
+
args.status = firstErrorInfo.status;
|
|
18
|
+
let message = `Multiple errors (${args.errors.length}): ${args.errors
|
|
19
|
+
.map((e) => ResponseError_1.getErrorDetails(e).message)
|
|
20
|
+
.join(', ')}`;
|
|
21
|
+
message = args.message?.(message) || message;
|
|
22
|
+
return new AggregateError(args.errors, args.code, args.status, undefined, message);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.AggregateError = AggregateError;
|
|
26
|
+
//# sourceMappingURL=AggregateError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AggregateError.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/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
2
|
+
import { ExecuteInput } from '@segment/actions-core/destination-kit';
|
|
3
|
+
import { MaybePromise } from '@segment/actions-core/destination-kit/types';
|
|
4
|
+
import { EngageLogger } from './EngageLogger';
|
|
5
|
+
import { EngageStats } from './EngageStats';
|
|
6
|
+
import { OperationContext } from './track';
|
|
7
|
+
import { RequestOptions } from '@segment/actions-core/request-client';
|
|
8
|
+
import { IntegrationError } from '@segment/actions-core';
|
|
9
|
+
import { Awaited } from './operationTracking';
|
|
10
|
+
export declare abstract class EngageActionPerformer<TSettings = any, TPayload = any, TReturn = any> {
|
|
11
|
+
readonly requestClient: RequestClient;
|
|
12
|
+
readonly executeInput: ExecuteInput<TSettings, TPayload>;
|
|
13
|
+
readonly logger: EngageLogger;
|
|
14
|
+
readonly statsClient: EngageStats;
|
|
15
|
+
readonly dataFeedCache: import("@segment/actions-core/src/destination-kit").DataFeedCache | undefined;
|
|
16
|
+
readonly currentOperation: OperationContext | undefined;
|
|
17
|
+
readonly payload: TPayload;
|
|
18
|
+
readonly settings: TSettings;
|
|
19
|
+
constructor(requestClient: RequestClient, executeInput: ExecuteInput<TSettings, TPayload>);
|
|
20
|
+
beforePerform?(): void | Promise<void>;
|
|
21
|
+
perform(): Promise<TReturn>;
|
|
22
|
+
abstract doPerform(): MaybePromise<TReturn>;
|
|
23
|
+
abstract getIntegrationStatsName(): string;
|
|
24
|
+
abstract getChannelType(): string;
|
|
25
|
+
request<Data = unknown>(url: string, options?: RequestOptions): Promise<import("@segment/actions-core/create-request-client").ModifiedResponse<Data>>;
|
|
26
|
+
onResponse?(args: {
|
|
27
|
+
response?: Awaited<ReturnType<RequestClient>>;
|
|
28
|
+
error?: any;
|
|
29
|
+
operation: OperationContext;
|
|
30
|
+
}): void;
|
|
31
|
+
redactPii(pii: string | undefined): string | undefined;
|
|
32
|
+
isFeatureActive(featureName: string, getDefault?: () => boolean): boolean | undefined;
|
|
33
|
+
logInfo(msg: string, metadata?: object): void;
|
|
34
|
+
logError(msg: string, metadata?: object): void;
|
|
35
|
+
logOnError(logMessage: string | ((ctx: OperationContext) => string)): void;
|
|
36
|
+
statsIncr(metric: string, value?: number, tags?: string[]): void;
|
|
37
|
+
statsHistogram(metric: string, value: number, tags?: string[]): void;
|
|
38
|
+
statsSet(metric: string, value: number, tags?: string[]): void;
|
|
39
|
+
get logDetails(): Record<string, unknown>;
|
|
40
|
+
get tags(): string[];
|
|
41
|
+
rethrowIntegrationError(error: unknown, getWrapper: () => IntegrationError | ConstructorParameters<typeof IntegrationError>): never;
|
|
42
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EngageActionPerformer = void 0;
|
|
13
|
+
const EngageLogger_1 = require("./EngageLogger");
|
|
14
|
+
const EngageStats_1 = require("./EngageStats");
|
|
15
|
+
const track_1 = require("./track");
|
|
16
|
+
const isDestinationActionService_1 = require("./isDestinationActionService");
|
|
17
|
+
const ResponseError_1 = require("./ResponseError");
|
|
18
|
+
const IntegrationErrorWrapper_1 = require("./IntegrationErrorWrapper");
|
|
19
|
+
const truncate_1 = __importDefault(require("lodash/truncate"));
|
|
20
|
+
class EngageActionPerformer {
|
|
21
|
+
constructor(requestClient, executeInput) {
|
|
22
|
+
this.requestClient = requestClient;
|
|
23
|
+
this.executeInput = executeInput;
|
|
24
|
+
this.logger = new EngageLogger_1.EngageLogger(this);
|
|
25
|
+
this.statsClient = new EngageStats_1.EngageStats(this);
|
|
26
|
+
this.dataFeedCache = this.executeInput.dataFeedCache;
|
|
27
|
+
this.payload = executeInput.payload;
|
|
28
|
+
this.settings = executeInput.settings;
|
|
29
|
+
}
|
|
30
|
+
async perform() {
|
|
31
|
+
await this.beforePerform?.();
|
|
32
|
+
return this.doPerform();
|
|
33
|
+
}
|
|
34
|
+
async request(url, options) {
|
|
35
|
+
const op = this.currentOperation;
|
|
36
|
+
op?.onFinally.push(() => {
|
|
37
|
+
const respError = op?.error;
|
|
38
|
+
if (respError) {
|
|
39
|
+
const errorDetails = ResponseError_1.getErrorDetails(respError);
|
|
40
|
+
const msgLowercare = errorDetails?.message?.toLowerCase();
|
|
41
|
+
const isTimeoutError = msgLowercare?.includes('timeout') ||
|
|
42
|
+
msgLowercare?.includes('timedout') ||
|
|
43
|
+
msgLowercare?.includes('exceeded the deadline') ||
|
|
44
|
+
errorDetails.code?.toLowerCase().includes('etimedout');
|
|
45
|
+
if (isTimeoutError) {
|
|
46
|
+
const status = errorDetails.status ?? respError.status ?? 408;
|
|
47
|
+
respError.status = status;
|
|
48
|
+
errorDetails.status = status;
|
|
49
|
+
const errorCode = errorDetails.code ?? respError.code ?? 'etimedout';
|
|
50
|
+
respError.code = errorCode;
|
|
51
|
+
errorDetails.code = errorCode;
|
|
52
|
+
respError.retry = true;
|
|
53
|
+
}
|
|
54
|
+
if (errorDetails.code)
|
|
55
|
+
op.tags.push(`response_code:${errorDetails.code}`);
|
|
56
|
+
if (errorDetails.status)
|
|
57
|
+
op.tags.push(`response_status:${errorDetails.status}`);
|
|
58
|
+
if (this.onResponse)
|
|
59
|
+
try {
|
|
60
|
+
this.onResponse({ error: respError, operation: op });
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
op.logs.push(`Error in onResponse: ${e}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const resp = op?.result;
|
|
68
|
+
if (resp && resp.status)
|
|
69
|
+
op.tags.push(`response_status:${resp.status}`);
|
|
70
|
+
if (this.onResponse)
|
|
71
|
+
try {
|
|
72
|
+
this.onResponse({ response: resp, operation: op });
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
op.logs.push(`Error in onResponse: ${e}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return await this.requestClient(url, options);
|
|
80
|
+
}
|
|
81
|
+
redactPii(pii) {
|
|
82
|
+
if (!pii) {
|
|
83
|
+
return pii;
|
|
84
|
+
}
|
|
85
|
+
if (pii.length <= 8) {
|
|
86
|
+
return '***';
|
|
87
|
+
}
|
|
88
|
+
return pii.substring(0, 3) + '***' + pii.substring(pii.length - 3);
|
|
89
|
+
}
|
|
90
|
+
isFeatureActive(featureName, getDefault) {
|
|
91
|
+
if (isDestinationActionService_1.isDestinationActionService())
|
|
92
|
+
return true;
|
|
93
|
+
if (!this.executeInput.features || !(featureName in this.executeInput.features))
|
|
94
|
+
return getDefault?.();
|
|
95
|
+
return this.executeInput.features[featureName];
|
|
96
|
+
}
|
|
97
|
+
logInfo(msg, metadata) {
|
|
98
|
+
this.logger.logInfo(msg, metadata);
|
|
99
|
+
}
|
|
100
|
+
logError(msg, metadata) {
|
|
101
|
+
this.logger.logError(msg, metadata);
|
|
102
|
+
}
|
|
103
|
+
logOnError(logMessage) {
|
|
104
|
+
const op = this.currentOperation;
|
|
105
|
+
op?.onFinally.push(() => {
|
|
106
|
+
if (op.error) {
|
|
107
|
+
const msg = typeof logMessage === 'function' ? logMessage(op) : logMessage;
|
|
108
|
+
op.logs.push(msg);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
statsIncr(metric, value, tags) {
|
|
113
|
+
this.statsClient.stats({ method: 'incr', metric, value, tags });
|
|
114
|
+
}
|
|
115
|
+
statsHistogram(metric, value, tags) {
|
|
116
|
+
this.statsClient.stats({ method: 'histogram', metric, value, tags });
|
|
117
|
+
}
|
|
118
|
+
statsSet(metric, value, tags) {
|
|
119
|
+
this.statsClient.stats({ method: 'set', metric, value, tags });
|
|
120
|
+
}
|
|
121
|
+
get logDetails() {
|
|
122
|
+
return this.logger.logDetails;
|
|
123
|
+
}
|
|
124
|
+
get tags() {
|
|
125
|
+
return this.statsClient.tags;
|
|
126
|
+
}
|
|
127
|
+
rethrowIntegrationError(error, getWrapper) {
|
|
128
|
+
throw IntegrationErrorWrapper_1.IntegrationErrorWrapper.wrap(error, getWrapper, this.currentOperation);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
__decorate([
|
|
132
|
+
track_1.track()
|
|
133
|
+
], EngageActionPerformer.prototype, "perform", null);
|
|
134
|
+
__decorate([
|
|
135
|
+
track_1.track({
|
|
136
|
+
onTry: addUrlToLog,
|
|
137
|
+
onFinally: addUrlToLog
|
|
138
|
+
})
|
|
139
|
+
], EngageActionPerformer.prototype, "request", null);
|
|
140
|
+
exports.EngageActionPerformer = EngageActionPerformer;
|
|
141
|
+
function addUrlToLog(ctx) {
|
|
142
|
+
const ctxFull = ctx;
|
|
143
|
+
const argUrl = ctx.funcArgs?.[0];
|
|
144
|
+
if (ctxFull.logs && argUrl) {
|
|
145
|
+
ctxFull.logs.push(truncate_1.default(argUrl, { length: 70 }));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=EngageActionPerformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EngageActionPerformer.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/EngageActionPerformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,iDAA6C;AAC7C,+CAA2C;AAC3C,mCAAiD;AACjD,6EAAyE;AACzE,mDAAgE;AAGhE,uEA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;IAE3B,MAAM,OAAO,GAAG,GAAuB,CAAA;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;IAChC,IAAI,OAAO,CAAC,IAAI,IAAI,MAAM,EAAE;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAQ,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;KACpD;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Logger } from '@segment/actions-core/destination-kit';
|
|
2
|
+
import { OperationLogger, OperationLoggerContext, TryCatchFinallyHook } from './operationTracking';
|
|
3
|
+
import { EngageActionPerformer } from './EngageActionPerformer';
|
|
4
|
+
export declare const FLAGON_NAME_LOG_INFO = "engage-messaging-log-info";
|
|
5
|
+
export declare const FLAGON_NAME_LOG_ERROR = "engage-messaging-log-error";
|
|
6
|
+
export declare class EngageLogger extends OperationLogger {
|
|
7
|
+
actionPerformer: EngageActionPerformer;
|
|
8
|
+
static getTryCatchFinallyHook(_ctx: OperationLoggerContext): TryCatchFinallyHook<OperationLoggerContext>;
|
|
9
|
+
constructor(actionPerformer: EngageActionPerformer);
|
|
10
|
+
readonly channelType: string;
|
|
11
|
+
get loggerClient(): Logger | undefined;
|
|
12
|
+
readonly logDetails: Record<string, unknown>;
|
|
13
|
+
logInfo(msg: string, metadata?: object): void;
|
|
14
|
+
logError(msg: string, metadata?: object): void;
|
|
15
|
+
error(msg: string, metadata?: object): void;
|
|
16
|
+
info(msg: string, metadata?: object): void;
|
|
17
|
+
getErrorMessage(error: unknown): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EngageLogger = exports.FLAGON_NAME_LOG_ERROR = exports.FLAGON_NAME_LOG_INFO = void 0;
|
|
4
|
+
const operationTracking_1 = require("./operationTracking");
|
|
5
|
+
const ResponseError_1 = require("./ResponseError");
|
|
6
|
+
exports.FLAGON_NAME_LOG_INFO = 'engage-messaging-log-info';
|
|
7
|
+
exports.FLAGON_NAME_LOG_ERROR = 'engage-messaging-log-error';
|
|
8
|
+
class EngageLogger extends operationTracking_1.OperationLogger {
|
|
9
|
+
constructor(actionPerformer) {
|
|
10
|
+
super();
|
|
11
|
+
this.actionPerformer = actionPerformer;
|
|
12
|
+
this.logDetails = {};
|
|
13
|
+
this.channelType = this.actionPerformer.getChannelType().toUpperCase();
|
|
14
|
+
}
|
|
15
|
+
static getTryCatchFinallyHook(_ctx) {
|
|
16
|
+
const msgSender = _ctx.funcThis;
|
|
17
|
+
return msgSender?.logger;
|
|
18
|
+
}
|
|
19
|
+
get loggerClient() {
|
|
20
|
+
return this.actionPerformer.executeInput.logger;
|
|
21
|
+
}
|
|
22
|
+
logInfo(msg, metadata) {
|
|
23
|
+
const msgs = [msg, ...(metadata ? [JSON.stringify(metadata)] : [])];
|
|
24
|
+
if (!this.actionPerformer.isFeatureActive(exports.FLAGON_NAME_LOG_INFO, () => false))
|
|
25
|
+
return;
|
|
26
|
+
const [firstMsg, ...rest] = msgs;
|
|
27
|
+
this.loggerClient?.info(`TE Messaging: ${this.channelType} ${firstMsg}`, ...rest, JSON.stringify({ ...this.logDetails, ...metadata }));
|
|
28
|
+
}
|
|
29
|
+
logError(msg, metadata) {
|
|
30
|
+
if (!this.actionPerformer.isFeatureActive(exports.FLAGON_NAME_LOG_ERROR, () => false))
|
|
31
|
+
return;
|
|
32
|
+
const msgPrefix = `⛔ TE Messaging: ${this.channelType}`;
|
|
33
|
+
this.loggerClient?.error(`${msgPrefix} ${msg}`, JSON.stringify({ ...this.logDetails, ...metadata }));
|
|
34
|
+
}
|
|
35
|
+
error(msg, metadata) {
|
|
36
|
+
return this.logError(msg, metadata);
|
|
37
|
+
}
|
|
38
|
+
info(msg, metadata) {
|
|
39
|
+
return this.logInfo(msg, metadata);
|
|
40
|
+
}
|
|
41
|
+
getErrorMessage(error) {
|
|
42
|
+
const errorDetails = ResponseError_1.getErrorDetails(error);
|
|
43
|
+
let res = `${errorDetails.message}`;
|
|
44
|
+
if (errorDetails.code)
|
|
45
|
+
res += `. Code: ${errorDetails.code}`;
|
|
46
|
+
if (errorDetails.status)
|
|
47
|
+
res += `. Status: ${errorDetails.status}`;
|
|
48
|
+
return res;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.EngageLogger = EngageLogger;
|
|
52
|
+
//# sourceMappingURL=EngageLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EngageLogger.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/EngageLogger.ts"],"names":[],"mappings":";;;AAGA,2DAAkG;AAElG,mDAAiD;AAEpC,QAAA,oBAAoB,GAAG,2BAA2B,CAAA;AAClD,QAAA,qBAAqB,GAAG,4BAA4B,CAAA;AAEjE,MAAa,YAAa,SAAQ,mCAAe;IAM/C,YAAmB,eAAsC;QACvD,KAAK,EAAE,CAAA;QADU,oBAAe,GAAf,eAAe,CAAuB;QAQhD,eAAU,GAA4B,EAAE,CAAA;QAN/C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,CAAC,WAAW,EAAE,CAAA;IACxE,CAAC;IARD,MAAM,CAAC,sBAAsB,CAAC,IAA4B;QACxD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAiC,CAAA;QACxD,OAAO,SAAS,EAAE,MAAM,CAAA;IAC1B,CAAC;IAOD,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAA;IACjD,CAAC;IAGD,OAAO,CAAC,GAAW,EAAE,QAAiB;QACpC,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAA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YAAE,GAAG,IAAI,WAAW,YAAY,CAAC,IAAI,EAAE,CAAA;QAC5D,IAAI,YAAY,CAAC,MAAM;YAAE,GAAG,IAAI,aAAa,YAAY,CAAC,MAAM,EAAE,CAAA;QAClE,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AA9CD,oCA8CC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StatsClient } from '@segment/actions-core/destination-kit';
|
|
2
|
+
import { StatsArgs, OperationStats, OperationStatsContext, TryCatchFinallyHook, TrackedError } from './operationTracking';
|
|
3
|
+
import { EngageActionPerformer } from './EngageActionPerformer';
|
|
4
|
+
export declare class EngageStats extends OperationStats {
|
|
5
|
+
actionPerformer: EngageActionPerformer;
|
|
6
|
+
static getTryCatchFinallyHook(_ctx: OperationStatsContext): TryCatchFinallyHook<OperationStatsContext>;
|
|
7
|
+
constructor(actionPerformer: EngageActionPerformer);
|
|
8
|
+
onTry(ctx: OperationStatsContext): () => void;
|
|
9
|
+
get statsClient(): StatsClient | undefined;
|
|
10
|
+
get tags(): string[];
|
|
11
|
+
_tags: string[];
|
|
12
|
+
stats(statsArgs: StatsArgs): void;
|
|
13
|
+
incr(metric: string, value?: number, tags?: string[]): void;
|
|
14
|
+
histogram(metric: string, value?: number, tags?: string[]): void;
|
|
15
|
+
set(metric: string, value?: number, tags?: string[]): void;
|
|
16
|
+
extractTagsFromError(error: TrackedError, ctx: OperationStatsContext): string[];
|
|
17
|
+
getOperationNameTag(ctx: OperationStatsContext): string | undefined;
|
|
18
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EngageStats = void 0;
|
|
4
|
+
const operationTracking_1 = require("./operationTracking");
|
|
5
|
+
const ResponseError_1 = require("./ResponseError");
|
|
6
|
+
class EngageStats extends operationTracking_1.OperationStats {
|
|
7
|
+
constructor(actionPerformer) {
|
|
8
|
+
super();
|
|
9
|
+
this.actionPerformer = actionPerformer;
|
|
10
|
+
this._tags = [];
|
|
11
|
+
}
|
|
12
|
+
static getTryCatchFinallyHook(_ctx) {
|
|
13
|
+
const msgSender = _ctx.funcThis;
|
|
14
|
+
return msgSender?.statsClient;
|
|
15
|
+
}
|
|
16
|
+
onTry(ctx) {
|
|
17
|
+
const res = super.onTry(ctx);
|
|
18
|
+
ctx.sharedContext.tags.push(`space_id:${this.actionPerformer.settings.spaceId}`, `projectid:${this.actionPerformer.settings.sourceId}`, `computation_id:${this.actionPerformer.payload.segmentComputationId}`, `settings_region:${this.actionPerformer.settings.region}`, `channel:${this.actionPerformer.getChannelType()}`);
|
|
19
|
+
const correlation_id = this.actionPerformer.payload.customArgs?.correlation_id ||
|
|
20
|
+
this.actionPerformer.payload.customArgs?.__segment_internal_correlation_id__;
|
|
21
|
+
if (correlation_id)
|
|
22
|
+
ctx.sharedContext.tags.push(`correlation_id:${correlation_id}`);
|
|
23
|
+
const parentOperation = ctx.parent;
|
|
24
|
+
if (parentOperation) {
|
|
25
|
+
const operation_path = this.getOperationNameTag(parentOperation);
|
|
26
|
+
if (operation_path)
|
|
27
|
+
ctx.tags.push('operation_path:' + operation_path);
|
|
28
|
+
}
|
|
29
|
+
return res;
|
|
30
|
+
}
|
|
31
|
+
get statsClient() {
|
|
32
|
+
return this.actionPerformer.executeInput.statsContext?.statsClient;
|
|
33
|
+
}
|
|
34
|
+
get tags() {
|
|
35
|
+
if (this.actionPerformer.currentOperation?.tags)
|
|
36
|
+
return this.actionPerformer.currentOperation.tags;
|
|
37
|
+
if (this.actionPerformer.executeInput.statsContext?.tags)
|
|
38
|
+
return this.actionPerformer.executeInput.statsContext?.tags;
|
|
39
|
+
return this._tags;
|
|
40
|
+
}
|
|
41
|
+
stats(statsArgs) {
|
|
42
|
+
if (!this.statsClient)
|
|
43
|
+
return;
|
|
44
|
+
const { method: statsMethod, metric, value, tags } = statsArgs;
|
|
45
|
+
let statsFunc = this.statsClient?.[statsMethod || 'incr'].bind(this.statsClient);
|
|
46
|
+
if (!statsFunc)
|
|
47
|
+
switch (statsMethod ||
|
|
48
|
+
'incr') {
|
|
49
|
+
case 'incr':
|
|
50
|
+
statsFunc = this.statsClient?.incr.bind(this.statsClient);
|
|
51
|
+
break;
|
|
52
|
+
break;
|
|
53
|
+
case 'histogram':
|
|
54
|
+
statsFunc = this.statsClient?.histogram.bind(this.statsClient);
|
|
55
|
+
break;
|
|
56
|
+
break;
|
|
57
|
+
case 'set':
|
|
58
|
+
statsFunc = this.statsClient?.set.bind(this.statsClient);
|
|
59
|
+
break;
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
statsFunc?.(`${this.actionPerformer.getIntegrationStatsName()}.${metric}`, typeof value === 'undefined' ? 1 : value, [...(this.actionPerformer.executeInput.statsContext?.tags || []), ...(tags ?? [])]);
|
|
65
|
+
}
|
|
66
|
+
incr(metric, value, tags) {
|
|
67
|
+
this.stats({ metric, value, tags, method: 'incr' });
|
|
68
|
+
}
|
|
69
|
+
histogram(metric, value, tags) {
|
|
70
|
+
this.stats({ metric, value, tags, method: 'histogram' });
|
|
71
|
+
}
|
|
72
|
+
set(metric, value, tags) {
|
|
73
|
+
this.stats({ metric, value, tags, method: 'set' });
|
|
74
|
+
}
|
|
75
|
+
extractTagsFromError(error, ctx) {
|
|
76
|
+
const res = super.extractTagsFromError(error, ctx);
|
|
77
|
+
const errDetails = ResponseError_1.getErrorDetails(error);
|
|
78
|
+
if (errDetails?.code)
|
|
79
|
+
res.push(`error_code:${errDetails.code}`);
|
|
80
|
+
if (errDetails?.status)
|
|
81
|
+
res.push(`error_status:${errDetails.status}`);
|
|
82
|
+
if (error.underlyingError) {
|
|
83
|
+
const underlyingErrorTags = this.extractTagsFromError(error.underlyingError, ctx);
|
|
84
|
+
res.push(...underlyingErrorTags.map((t) => `underlying_${t}`));
|
|
85
|
+
}
|
|
86
|
+
return res;
|
|
87
|
+
}
|
|
88
|
+
getOperationNameTag(ctx) {
|
|
89
|
+
if (!ctx)
|
|
90
|
+
return undefined;
|
|
91
|
+
return this.actionPerformer.logger.getOperationName(ctx, true, '::');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.EngageStats = EngageStats;
|
|
95
|
+
//# sourceMappingURL=EngageStats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EngageStats.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/EngageStats.ts"],"names":[],"mappings":";;;AAEA,2DAM4B;AAG5B,mDAAiD;AAEjD,MAAa,WAAY,SAAQ,kCAAc;IAM7C,YAAmB,eAAsC;QACvD,KAAK,EAAE,CAAA;QADU,oBAAe,GAAf,eAAe,CAAuB;QAoCzD,UAAK,GAAa,EAAE,CAAA;IAlCpB,CAAC;IAPD,MAAM,CAAC,sBAAsB,CAAC,IAA2B;QACvD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAiC,CAAA;QACxD,OAAO,SAAS,EAAE,WAAW,CAAA;IAC/B,CAAC;IAMD,KAAK,CAAC,GAA0B;QAC9B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC5B,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CACzB,YAAY,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,EAAE,EACnD,aAAa,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,EACrD,kBAAkB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,oBAAoB,EAAE,EACrE,mBAAmB,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,EAAE,EACzD,WAAW,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,EAAE,CACnD,CAAA;QACD,MAAM,cAAc,GAClB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc;YACvD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,U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C;IAED,oBAAoB,CAAC,KAAmB,EAAE,GAA0B;QAClE,MAAM,GAAG,GAAG,KAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAElD,MAAM,UAAU,GAAG,+BAAe,CAAC,KAAK,CAAC,CAAA;QACzC,IAAI,UAAU,EAAE,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,cAAc,UAAU,CAAC,IAAI,EAAE,CAAC,CAAA;QAC/D,IAAI,UAAU,EAAE,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,gBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAA;QAErE,IAAI,KAAK,CAAC,eAAe,EAAE;YACzB,MAAM,mBAAmB,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,eAAsB,EAAE,GAAG,CAAC,CAAA;YACxF,GAAG,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;SAC/D;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAOD,mBAAmB,CAAC,GAA0B;QAC5C,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAA;QAE1B,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACtE,CAAC;CACF;AA/GD,kCA+GC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IntegrationError } from '@segment/actions-core';
|
|
2
|
+
import { TryCatchFinallyContext, TryCatchFinallyHook } from './operationTracking';
|
|
3
|
+
export declare type IntegrationErrorWrapperContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
4
|
+
decoratorArgs?: {
|
|
5
|
+
wrapIntegrationError?: (ctx: TContext) => IntegrationError | ConstructorParameters<typeof IntegrationError>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare class IntegrationErrorWrapper {
|
|
9
|
+
static getTryCatchFinallyHook(_ctx: IntegrationErrorWrapperContext): TryCatchFinallyHook<IntegrationErrorWrapperContext>;
|
|
10
|
+
static onCatch(ctx: IntegrationErrorWrapperContext): void;
|
|
11
|
+
static wrap<TContext extends TryCatchFinallyContext>(error: unknown, getWrapper: () => IntegrationError | ConstructorParameters<typeof IntegrationError>, ctx?: TContext): import("./operationTracking").TrackedError<TryCatchFinallyContext<(this: any, ...args: any[]) => any>> | undefined;
|
|
12
|
+
}
|