@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,9 @@
|
|
|
1
|
+
export * from './EngageActionPerformer';
|
|
2
|
+
export * from './MessageSendPerformer';
|
|
3
|
+
export * from './operationTracking';
|
|
4
|
+
export * from './EngageLogger';
|
|
5
|
+
export * from './EngageStats';
|
|
6
|
+
export * from './track';
|
|
7
|
+
export * from './isDestinationActionService';
|
|
8
|
+
export * from './ResponseError';
|
|
9
|
+
export * from './IntegrationErrorWrapper';
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./EngageActionPerformer"), exports);
|
|
14
|
+
__exportStar(require("./MessageSendPerformer"), exports);
|
|
15
|
+
__exportStar(require("./operationTracking"), exports);
|
|
16
|
+
__exportStar(require("./EngageLogger"), exports);
|
|
17
|
+
__exportStar(require("./EngageStats"), exports);
|
|
18
|
+
__exportStar(require("./track"), exports);
|
|
19
|
+
__exportStar(require("./isDestinationActionService"), exports);
|
|
20
|
+
__exportStar(require("./ResponseError"), exports);
|
|
21
|
+
__exportStar(require("./IntegrationErrorWrapper"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAuC;AACvC,yDAAsC;AACtC,sDAAmC;AACnC,iDAA8B;AAC9B,gDAA6B;AAC7B,0CAAuB;AACvB,+DAA4C;AAC5C,kDAA+B;AAC/B,4DAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isDestinationActionService(): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDestinationActionService = void 0;
|
|
4
|
+
function isDestinationActionService() {
|
|
5
|
+
return (process.env.DESTINATIONS_ACTION_SERVICE === 'true' || process.env.SERVICE_NAME === 'destination-actions-service');
|
|
6
|
+
}
|
|
7
|
+
exports.isDestinationActionService = isDestinationActionService;
|
|
8
|
+
//# sourceMappingURL=isDestinationActionService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDestinationActionService.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/isDestinationActionService.ts"],"names":[],"mappings":";;;AAAA,SAAgB,0BAA0B;IAExC,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,6BAA6B,CACjH,CAAA;AACH,CAAC;AALD,gEAKC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRetryableStatus = exports.isRetryableError = void 0;
|
|
4
|
+
const ResponseError_1 = require("./ResponseError");
|
|
5
|
+
function isRetryableError(error) {
|
|
6
|
+
return isRetryableStatus(ResponseError_1.getErrorDetails(error).status);
|
|
7
|
+
}
|
|
8
|
+
exports.isRetryableError = isRetryableError;
|
|
9
|
+
function isRetryableStatus(status) {
|
|
10
|
+
let result = true;
|
|
11
|
+
const statusGroup = status === undefined ? undefined : Math.floor(status / 100);
|
|
12
|
+
switch (statusGroup) {
|
|
13
|
+
case 2:
|
|
14
|
+
case 4:
|
|
15
|
+
result = false;
|
|
16
|
+
break;
|
|
17
|
+
default:
|
|
18
|
+
result = true;
|
|
19
|
+
}
|
|
20
|
+
switch (status) {
|
|
21
|
+
case 408:
|
|
22
|
+
case 423:
|
|
23
|
+
case 429:
|
|
24
|
+
result = true;
|
|
25
|
+
break;
|
|
26
|
+
case 501:
|
|
27
|
+
result = false;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
exports.isRetryableStatus = isRetryableStatus;
|
|
33
|
+
//# sourceMappingURL=isRetryableError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRetryableError.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/isRetryableError.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAGjD,SAAgB,gBAAgB,CAAC,KAAU;IACzC,OAAO,iBAAiB,CAAC,+BAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;AACzD,CAAC;AAFD,4CAEC;AAED,SAAgB,iBAAiB,CAAC,MAAe;IAE/C,IAAI,MAAM,GAAG,IAAI,CAAA;IACjB,MAAM,WAAW,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA;IAC/E,QAAQ,WAAW,EAAE;QACnB,KAAK,CAAC,CAAC;QACP,KAAK,CAAC;YACJ,MAAM,GAAG,KAAK,CAAA;YACd,MAAK;QACP;YAEE,MAAM,GAAG,IAAI,CAAA;KAChB;IACD,QAAQ,MAAM,EAAE;QACd,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,GAAG;YACN,MAAM,GAAG,IAAI,CAAA;YACb,MAAK;QACP,KAAK,GAAG;YACN,MAAM,GAAG,KAAK,CAAA;YACd,MAAK;KAGR;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AA1BD,8CA0BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type GenericMethodDecorator<TFunc extends (this: any, ...args: any[]) => any = (this: any, ...args: any) => any> = (target: ThisParameterType<TFunc>, propertyKey: string, descriptor: TypedPropertyDescriptor<TFunc>) => TypedPropertyDescriptor<TFunc> | void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericMethodDecorator.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/GenericMethodDecorator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { GenericMethodDecorator } from './GenericMethodDecorator';
|
|
2
|
+
import { OperationDuration } from './OperationDuration';
|
|
3
|
+
import { OperationErrorHandler } from './OperationErrorHandler';
|
|
4
|
+
import { OperationFinallyHooks } from './OperationFinallyHooks';
|
|
5
|
+
import { OperationTree } from './OperationTree';
|
|
6
|
+
import { FuncFromTryCatchFinallyContext, TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
7
|
+
export interface DecoratorArgs {
|
|
8
|
+
operation?: string;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export declare type OperationHookContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext, TDecoratorArgs extends DecoratorArgs = DecoratorArgs> = TContext & {
|
|
12
|
+
decoratorArgs?: TDecoratorArgs;
|
|
13
|
+
};
|
|
14
|
+
export interface OperationHookProvider<TContext extends OperationHookContext = OperationHookContext, TDecoratorUtils = {}> {
|
|
15
|
+
getTryCatchFinallyHook(ctx: TContext): TryCatchFinallyHook<TContext>;
|
|
16
|
+
getDecoratorUtils?(): TDecoratorUtils;
|
|
17
|
+
}
|
|
18
|
+
export declare type UnionToIntersection<TUnion> = (TUnion extends any ? (k: TUnion) => void : never) extends (k: infer I) => void ? I : never;
|
|
19
|
+
export declare type ContextFromHookProviders<TProviders extends OperationHookProvider[]> = TProviders extends OperationHookProvider<infer TContext>[] ? UnionToIntersection<TContext> : TryCatchFinallyContext;
|
|
20
|
+
export declare type DecoratorArgsFromContext<TContext extends TryCatchFinallyContext> = TContext extends {
|
|
21
|
+
decoratorArgs?: infer TDecoratorArgs;
|
|
22
|
+
} ? TDecoratorArgs : DecoratorArgs;
|
|
23
|
+
export declare type DecoratorArgsFromHookProviders<TProviders extends OperationHookProvider[]> = DecoratorArgsFromContext<ContextFromHookProviders<TProviders>>;
|
|
24
|
+
export declare type DecoratorUtilsFromHookProviders<TProviders extends OperationHookProvider[]> = TProviders extends OperationHookProvider<any, infer TDecoratorUtils>[] ? UnionToIntersection<TDecoratorUtils> : {};
|
|
25
|
+
export declare type FuncFromHookProviders<TProviders extends OperationHookProvider[]> = FuncFromTryCatchFinallyContext<ContextFromHookProviders<TProviders>>;
|
|
26
|
+
export declare class OperationDecorator {
|
|
27
|
+
static createDecoratorFactory<TOperationHookProviders extends OperationHookProvider[]>(...hookProviders: TOperationHookProviders): ((decoratorArgs?: DecoratorArgsFromHookProviders<TOperationHookProviders>) => GenericMethodDecorator<FuncFromHookProviders<TOperationHookProviders>>) & DecoratorUtilsFromHookProviders<TOperationHookProviders> & {
|
|
28
|
+
_contextType: ContextFromHookProviders<TOperationHookProviders>;
|
|
29
|
+
};
|
|
30
|
+
static createDecoratorFactoryWithDefault<TOperationHookProviders extends OperationHookProvider[]>(...customHookProviders: TOperationHookProviders): ((decoratorArgs?: DecoratorArgsFromContext<ContextFromHookProviders<[typeof OperationErrorHandler, typeof OperationTree, typeof OperationDuration, typeof OperationFinallyHooks, ...TOperationHookProviders]>> | undefined) => GenericMethodDecorator<FuncFromTryCatchFinallyContext<ContextFromHookProviders<[typeof OperationErrorHandler, typeof OperationTree, typeof OperationDuration, typeof OperationFinallyHooks, ...TOperationHookProviders]>>>) & DecoratorUtilsFromHookProviders<[typeof OperationErrorHandler, typeof OperationTree, typeof OperationDuration, typeof OperationFinallyHooks, ...TOperationHookProviders]> & {
|
|
31
|
+
_contextType: ContextFromHookProviders<[typeof OperationErrorHandler, typeof OperationTree, typeof OperationDuration, typeof OperationFinallyHooks, ...TOperationHookProviders]>;
|
|
32
|
+
};
|
|
33
|
+
static getOperationName<TContext extends TryCatchFinallyContext>(ctx: TContext): string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export declare type OperationDecoratorContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
36
|
+
decoratorOf?: {
|
|
37
|
+
classProto: any;
|
|
38
|
+
methodName: string;
|
|
39
|
+
descriptor: TypedPropertyDescriptor<any>;
|
|
40
|
+
originalMethod: FuncFromTryCatchFinallyContext<TContext>;
|
|
41
|
+
};
|
|
42
|
+
decoratorArgs?: DecoratorArgsFromContext<TContext> & DecoratorArgs;
|
|
43
|
+
};
|
|
44
|
+
export declare type ContextFromDecorator<TDecorator> = TDecorator extends {
|
|
45
|
+
_contextType: infer TContext;
|
|
46
|
+
} ? TContext : never;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationDecorator = void 0;
|
|
4
|
+
const OperationDuration_1 = require("./OperationDuration");
|
|
5
|
+
const OperationErrorHandler_1 = require("./OperationErrorHandler");
|
|
6
|
+
const OperationFinallyHooks_1 = require("./OperationFinallyHooks");
|
|
7
|
+
const OperationTree_1 = require("./OperationTree");
|
|
8
|
+
const wrapTryCatchFinallyPromisable_1 = require("./wrapTryCatchFinallyPromisable");
|
|
9
|
+
class OperationDecorator {
|
|
10
|
+
static createDecoratorFactory(...hookProviders) {
|
|
11
|
+
const decorator = (decoratorArgs) => {
|
|
12
|
+
return function (classProto, methodName, descriptor) {
|
|
13
|
+
const originalMethod = descriptor.value;
|
|
14
|
+
if (!(originalMethod instanceof Function))
|
|
15
|
+
throw new Error('Track decorator can only be applied to class methods');
|
|
16
|
+
const decoratorOf = {
|
|
17
|
+
classProto,
|
|
18
|
+
methodName,
|
|
19
|
+
descriptor,
|
|
20
|
+
originalMethod
|
|
21
|
+
};
|
|
22
|
+
descriptor.value = wrapTryCatchFinallyPromisable_1.wrapTryCatchFinallyPromisable(originalMethod, (ctx) => {
|
|
23
|
+
ctx.decoratorOf = decoratorOf;
|
|
24
|
+
ctx.decoratorArgs = decoratorArgs;
|
|
25
|
+
return hookProviders.map((h) => h.getTryCatchFinallyHook(ctx));
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const decoratorUtils = {};
|
|
30
|
+
for (const hookProvider of hookProviders) {
|
|
31
|
+
Object.assign(decoratorUtils, hookProvider.getDecoratorUtils?.() || {});
|
|
32
|
+
}
|
|
33
|
+
return Object.assign(decorator, decoratorUtils);
|
|
34
|
+
}
|
|
35
|
+
static createDecoratorFactoryWithDefault(...customHookProviders) {
|
|
36
|
+
return OperationDecorator.createDecoratorFactory(OperationErrorHandler_1.OperationErrorHandler, OperationTree_1.OperationTree, OperationDuration_1.OperationDuration, OperationFinallyHooks_1.OperationFinallyHooks, ...customHookProviders);
|
|
37
|
+
}
|
|
38
|
+
static getOperationName(ctx) {
|
|
39
|
+
const ctxDecorated = ctx;
|
|
40
|
+
return (ctxDecorated.decoratorArgs?.operation ||
|
|
41
|
+
ctxDecorated.decoratorOf?.methodName ||
|
|
42
|
+
ctxDecorated.decoratorOf?.originalMethod?.name);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.OperationDecorator = OperationDecorator;
|
|
46
|
+
//# sourceMappingURL=OperationDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationDecorator.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationDecorator.ts"],"names":[],"mappings":";;;AAEA,2DAAuD;AACvD,mEAA+D;AAC/D,mEAA+D;AAC/D,mDAA+C;AAC/C,mFAKwC;AAmFxC,MAAa,kBAAkB;IAO7B,MAAM,CAAC,sBAAsB,CAC3B,GAAG,aAAsC;QAUzC,MAAM,SAAS,GAAG,CAAC,aAA8B,EAAiC,EAAE;YAClF,OAAO,UAAU,UAAU,EAAE,UAAU,EAAE,UAAU;gBACjD,MAAM,cAAc,GAAG,UAAU,CAAC,KAAc,CAAA;gBAChD,IAAI,CAAC,CAAC,cAAc,YAAY,QAAQ,CAAC;oBACvC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;gBAEzE,MAAM,WAAW,GAA6C;oBAC5D,UAAU;oBACV,UAAU;oBACV,UAAU;oBACV,cAAc;iBACf,CAAA;gBACD,UAAU,CAAC,KAAK,GAAG,6DAA6B,CAAC,cAAc,EAAE,CAAC,GAA8B,EAAE,EAAE;oBAClG,GAAG,CAAC,WAAW,GAAG,WAAW,CAAA;oBAC7B,GAAG,CAAC,aAAa,GAAG,aAAa,CAAA;oBACjC,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAA;gBAChE,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA;QACH,CAAC,CAAA;QACD,MAAM,cAAc,GAAG,EAAE,CAAA;QACzB,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;YACxC,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;SACxE;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,CAAQ,CAAA;IACxD,CAAC;IAWD,MAAM,CAAC,iCAAiC,CACtC,GAAG,mBAA4C;QAE/C,OAAO,kBAAkB,CAAC,sBAAsB,CAC9C,6CAAqB,EACrB,6BAAa,EACb,qCAAiB,EACjB,6CAAqB,EACrB,GAAG,mBAAmB,CACvB,CAAA;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,CAA0C,GAAa;QAC5E,MAAM,YAAY,GAAG,GAAgC,CAAA;QACrD,OAAO,CACL,YAAY,CAAC,aAAa,EAAE,SAAS;YACrC,YAAY,CAAC,WAAW,EAAE,UAAU;YACpC,YAAY,CAAC,WAAW,EAAE,cAAc,EAAE,IAAI,CAC/C,CAAA;IACH,CAAC;CACF;AA1ED,gDA0EC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
2
|
+
export declare type OperationDurationContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
3
|
+
start?: number;
|
|
4
|
+
duration?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare class OperationDuration {
|
|
7
|
+
static getTryCatchFinallyHook(_ctx: OperationDurationContext): TryCatchFinallyHook<OperationDurationContext>;
|
|
8
|
+
static getPriority(): number;
|
|
9
|
+
static onTry(ctx: OperationDurationContext): void;
|
|
10
|
+
static onFinally(ctx: OperationDurationContext): void;
|
|
11
|
+
static getDuration<TContext extends OperationDurationContext>(ctx: TContext): number | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationDuration = void 0;
|
|
4
|
+
class OperationDuration {
|
|
5
|
+
static getTryCatchFinallyHook(_ctx) {
|
|
6
|
+
return this;
|
|
7
|
+
}
|
|
8
|
+
static getPriority() {
|
|
9
|
+
return -1000;
|
|
10
|
+
}
|
|
11
|
+
static onTry(ctx) {
|
|
12
|
+
ctx.start = Date.now();
|
|
13
|
+
}
|
|
14
|
+
static onFinally(ctx) {
|
|
15
|
+
if (ctx.start !== undefined)
|
|
16
|
+
ctx.duration = Date.now() - ctx.start;
|
|
17
|
+
}
|
|
18
|
+
static getDuration(ctx) {
|
|
19
|
+
return ctx.duration;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.OperationDuration = OperationDuration;
|
|
23
|
+
//# sourceMappingURL=OperationDuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationDuration.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationDuration.ts"],"names":[],"mappings":";;;AAOA,MAAa,iBAAiB;IAC5B,MAAM,CAAC,sBAAsB,CAAC,IAA8B;QAC1D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,CAAC,WAAW;QAChB,OAAO,CAAC,IAAI,CAAA;IACd,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,GAA6B;QACxC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IACxB,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,GAA6B;QAC5C,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS;YAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,KAAK,CAAA;IACpE,CAAC;IACD,MAAM,CAAC,WAAW,CAA4C,GAAa;QACzE,OAAO,GAAG,CAAC,QAAQ,CAAA;IACrB,CAAC;CACF;AAjBD,8CAiBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TrackedError } from './TrackedError';
|
|
2
|
+
import { TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
3
|
+
export declare type OperationErrorHandlerContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
4
|
+
decoratorArgs?: {
|
|
5
|
+
onError?: (ctx: OperationErrorHandlerContext<TContext>) => void;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare class OperationErrorHandler {
|
|
9
|
+
static getTryCatchFinallyHook(_ctx: OperationErrorHandlerContext): TryCatchFinallyHook<OperationErrorHandlerContext>;
|
|
10
|
+
static onCatch(ctx: OperationErrorHandlerContext): void;
|
|
11
|
+
static wrap<TContext extends OperationErrorHandlerContext = OperationErrorHandlerContext>(originalError: unknown, getWrapper: (e: unknown) => unknown | undefined, ctx?: TContext): TrackedError<TryCatchFinallyContext<(this: any, ...args: any[]) => any>> | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationErrorHandler = void 0;
|
|
4
|
+
class OperationErrorHandler {
|
|
5
|
+
static getTryCatchFinallyHook(_ctx) {
|
|
6
|
+
return this;
|
|
7
|
+
}
|
|
8
|
+
static onCatch(ctx) {
|
|
9
|
+
const dArgs = ctx.decoratorArgs;
|
|
10
|
+
ctx.error = this.wrap(ctx.error, () => {
|
|
11
|
+
dArgs?.onError?.apply(this, [ctx]);
|
|
12
|
+
return ctx.error;
|
|
13
|
+
}, ctx);
|
|
14
|
+
}
|
|
15
|
+
static wrap(originalError, getWrapper, ctx) {
|
|
16
|
+
const wrapper = getWrapper(originalError);
|
|
17
|
+
if (wrapper && originalError !== wrapper)
|
|
18
|
+
wrapper.underlyingError = originalError;
|
|
19
|
+
const trackedError = wrapper;
|
|
20
|
+
if (!trackedError)
|
|
21
|
+
return;
|
|
22
|
+
if (!ctx)
|
|
23
|
+
return;
|
|
24
|
+
if (!trackedError.trackedContext)
|
|
25
|
+
trackedError.trackedContext = ctx;
|
|
26
|
+
const trackedContextProp = Object.getOwnPropertyDescriptor(trackedError, 'trackedContext');
|
|
27
|
+
if (trackedContextProp?.enumerable) {
|
|
28
|
+
trackedContextProp.enumerable = false;
|
|
29
|
+
Object.defineProperty(trackedError, 'trackedContext', trackedContextProp);
|
|
30
|
+
}
|
|
31
|
+
return wrapper;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.OperationErrorHandler = OperationErrorHandler;
|
|
35
|
+
//# sourceMappingURL=OperationErrorHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationErrorHandler.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationErrorHandler.ts"],"names":[],"mappings":";;;AAaA,MAAa,qBAAqB;IAChC,MAAM,CAAC,sBAAsB,CAAC,IAAkC;QAC9D,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,GAAiC;QAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAA;QAG/B,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CACnB,GAAG,CAAC,KAAK,EACT,GAAG,EAAE;YAEH,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAClC,OAAO,GAAG,CAAC,KAAqB,CAAA;QAClC,CAAC,EACD,GAAG,CACJ,CAAA;IACH,CAAC;IAED,MAAM,CAAC,IAAI,CACT,aAAsB,EACtB,UAA+C,EAC/C,GAAc;QAEd,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAiB,CAAA;QAEzD,IAAI,OAAO,IAAI,aAAa,KAAK,OAAO;YAAE,OAAO,CAAC,eAAe,GAAG,aAAa,CAAA;QAEjF,MAAM,YAAY,GAAG,OAAO,CAAA;QAC5B,IAAI,CAAC,YAAY;YAAE,OAAM;QAEzB,IAAI,CAAC,GAAG;YAAE,OAAM;QAGhB,IAAI,CAAC,YAAY,CAAC,cAAc;YAAE,YAAY,CAAC,cAAc,GAAG,GAAG,CAAA;QAGnE,MAAM,kBAAkB,GAAG,MAAM,CAAC,wBAAwB,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAA;QAC1F,IAAI,kBAAkB,EAAE,UAAU,EAAE;YAElC,kBAAkB,CAAC,UAAU,GAAG,KAAK,CAAA;YACrC,MAAM,CAAC,cAAc,CAAC,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAA;SAC1E;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA/CD,sDA+CC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
2
|
+
export declare type OperationFinallyHooksContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
3
|
+
onFinally: (() => void)[];
|
|
4
|
+
decoratorArgs?: {
|
|
5
|
+
onTry?: (ctx: TContext) => void;
|
|
6
|
+
onFinally?: (ctx: TContext) => void;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare class OperationFinallyHooks {
|
|
10
|
+
static getTryCatchFinallyHook(_ctx: OperationFinallyHooksContext): TryCatchFinallyHook<OperationFinallyHooksContext>;
|
|
11
|
+
static getPriority(): number;
|
|
12
|
+
static onTry<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
13
|
+
static onFinally<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationFinallyHooks = void 0;
|
|
4
|
+
class OperationFinallyHooks {
|
|
5
|
+
static getTryCatchFinallyHook(_ctx) {
|
|
6
|
+
return this;
|
|
7
|
+
}
|
|
8
|
+
static getPriority() {
|
|
9
|
+
return 100;
|
|
10
|
+
}
|
|
11
|
+
static onTry(ctx) {
|
|
12
|
+
ctx.onFinally = [];
|
|
13
|
+
ctx.decoratorArgs?.onTry?.(ctx);
|
|
14
|
+
}
|
|
15
|
+
static onFinally(ctx) {
|
|
16
|
+
for (const hook of ctx.onFinally) {
|
|
17
|
+
try {
|
|
18
|
+
hook();
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
const error = e;
|
|
22
|
+
const loggerCtx = ctx;
|
|
23
|
+
if (loggerCtx.logs)
|
|
24
|
+
loggerCtx.logs.push(`Error in onFinally hook: ${error?.message || error.toString()}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
ctx.decoratorArgs?.onFinally?.(ctx);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.OperationFinallyHooks = OperationFinallyHooks;
|
|
31
|
+
//# sourceMappingURL=OperationFinallyHooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationFinallyHooks.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationFinallyHooks.ts"],"names":[],"mappings":";;;AAeA,MAAa,qBAAqB;IAChC,MAAM,CAAC,sBAAsB,CAAC,IAAkC;QAC9D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,CAAC,WAAW;QAChB,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,MAAM,CAAC,KAAK,CAA0C,GAA2C;QAC/F,GAAG,CAAC,SAAS,GAAG,EAAE,CAAA;QAClB,GAAG,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,SAAS,CAA0C,GAA2C;QACnG,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,SAAS,EAAE;YAChC,IAAI;gBACF,IAAI,EAAE,CAAA;aACP;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,KAAK,GAAG,CAAU,CAAA;gBAExB,MAAM,SAAS,GAAG,GAAsC,CAAA;gBACxD,IAAI,SAAS,CAAC,IAAI;oBAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;aAC1G;SACF;QACD,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC;CACF;AA1BD,sDA0BC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
2
|
+
import { TrackedError } from './TrackedError';
|
|
3
|
+
import { OperationDecoratorContext } from './OperationDecorator';
|
|
4
|
+
export declare type OperationLoggerContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
5
|
+
logs: string[];
|
|
6
|
+
logMetadata?: Record<string, unknown>;
|
|
7
|
+
decoratorArgs?: OperationLoggerDecoratorArgs;
|
|
8
|
+
sharedContext: OperationLoggerSharedContext;
|
|
9
|
+
};
|
|
10
|
+
export interface OperationLoggerSharedContext {
|
|
11
|
+
logs: string[];
|
|
12
|
+
logMetadata?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export interface OperationLoggerDecoratorArgs {
|
|
15
|
+
shouldLog?: (ctx: OperationLoggerContext) => boolean | void;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class OperationLogger implements TryCatchFinallyHook<OperationLoggerContext> {
|
|
18
|
+
static getTryCatchFinallyHook(_ctx: OperationLoggerContext): TryCatchFinallyHook<OperationLoggerContext>;
|
|
19
|
+
abstract logInfo(msg: string, metadata?: object): void;
|
|
20
|
+
abstract logError(msg: string, metadata?: object): void;
|
|
21
|
+
onTry(ctx: OperationLoggerContext): () => void;
|
|
22
|
+
onFinally(ctx: OperationLoggerContext): () => void;
|
|
23
|
+
stageLog(ctx: OperationLoggerContext): () => void;
|
|
24
|
+
shouldLogDefault(_ctx: OperationLoggerContext): boolean;
|
|
25
|
+
getOperationLogMessages(ctx: OperationLoggerContext): string[];
|
|
26
|
+
getOperationTryMessage(ctx: OperationLoggerContext): string;
|
|
27
|
+
getOperationName<TContext extends OperationDecoratorContext>(ctx: TContext, fullPath?: boolean, separator?: string): string;
|
|
28
|
+
getOperationCompletedMessage(ctx: OperationLoggerContext): string;
|
|
29
|
+
getOperationErrorDetails(error: TrackedError, ctx: OperationLoggerContext): string[];
|
|
30
|
+
getErrorMessage(error: unknown, _ctx?: OperationLoggerContext): string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationLogger = void 0;
|
|
4
|
+
const OperationTree_1 = require("./OperationTree");
|
|
5
|
+
const OperationDecorator_1 = require("./OperationDecorator");
|
|
6
|
+
class OperationLogger {
|
|
7
|
+
static getTryCatchFinallyHook(_ctx) {
|
|
8
|
+
throw new Error('OperationLogger.getTryCatchFinallyHook is abstract and must be implemented by derived class');
|
|
9
|
+
}
|
|
10
|
+
onTry(ctx) {
|
|
11
|
+
return this.stageLog(ctx);
|
|
12
|
+
}
|
|
13
|
+
onFinally(ctx) {
|
|
14
|
+
return this.stageLog(ctx);
|
|
15
|
+
}
|
|
16
|
+
stageLog(ctx) {
|
|
17
|
+
if (!ctx.sharedContext.logs)
|
|
18
|
+
ctx.sharedContext.logs = [];
|
|
19
|
+
if (!ctx.logs)
|
|
20
|
+
ctx.logs = [];
|
|
21
|
+
const stageLogMessages = this.getOperationLogMessages(ctx);
|
|
22
|
+
if (stageLogMessages)
|
|
23
|
+
ctx.logs.push(...stageLogMessages);
|
|
24
|
+
return () => {
|
|
25
|
+
let shouldLog = ctx.decoratorArgs?.shouldLog?.(ctx);
|
|
26
|
+
if (shouldLog === undefined)
|
|
27
|
+
shouldLog = this.shouldLogDefault(ctx);
|
|
28
|
+
if (shouldLog) {
|
|
29
|
+
const fullLogMessage = (ctx.logs || [])
|
|
30
|
+
.concat(...(ctx.sharedContext.logs || []))
|
|
31
|
+
.filter((t) => t)
|
|
32
|
+
.join('. ');
|
|
33
|
+
const logDetails = ctx.logMetadata || ctx.sharedContext.logMetadata
|
|
34
|
+
? { ...ctx.sharedContext.logMetadata, ...ctx.logMetadata }
|
|
35
|
+
: undefined;
|
|
36
|
+
if (ctx.error)
|
|
37
|
+
this.logError(fullLogMessage, { error: ctx.error, ...logDetails });
|
|
38
|
+
else
|
|
39
|
+
this.logInfo(fullLogMessage, logDetails);
|
|
40
|
+
}
|
|
41
|
+
ctx.logs.length = 0;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
shouldLogDefault(_ctx) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
getOperationLogMessages(ctx) {
|
|
48
|
+
const res = [];
|
|
49
|
+
switch (ctx.stage) {
|
|
50
|
+
case 'try':
|
|
51
|
+
res.push(this.getOperationTryMessage(ctx));
|
|
52
|
+
break;
|
|
53
|
+
case 'finally':
|
|
54
|
+
res.push(this.getOperationCompletedMessage(ctx));
|
|
55
|
+
if (ctx.error) {
|
|
56
|
+
const error = ctx.error;
|
|
57
|
+
res.push(...(this.getOperationErrorDetails(error, ctx) || []));
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
return res;
|
|
64
|
+
}
|
|
65
|
+
getOperationTryMessage(ctx) {
|
|
66
|
+
return `${this.getOperationName(ctx)} starting...`;
|
|
67
|
+
}
|
|
68
|
+
getOperationName(ctx, fullPath = true, separator = ' > ') {
|
|
69
|
+
if (!fullPath)
|
|
70
|
+
return OperationDecorator_1.OperationDecorator.getOperationName(ctx) || '(anonymous)';
|
|
71
|
+
const fullOperationName = OperationTree_1.OperationTree.getOperationsStack(ctx)
|
|
72
|
+
.map((op) => this.getOperationName(op, false))
|
|
73
|
+
.join(separator);
|
|
74
|
+
return fullOperationName;
|
|
75
|
+
}
|
|
76
|
+
getOperationCompletedMessage(ctx) {
|
|
77
|
+
const hasError = !!ctx.error;
|
|
78
|
+
const fullOperationName = this.getOperationName(ctx);
|
|
79
|
+
const duration = ctx.duration;
|
|
80
|
+
if (duration !== undefined)
|
|
81
|
+
return `${fullOperationName} ${hasError ? 'failed' : 'succeeded'} after ${duration} ms`;
|
|
82
|
+
else
|
|
83
|
+
return `${fullOperationName} ${hasError ? 'failed' : 'succeeded'}`;
|
|
84
|
+
}
|
|
85
|
+
getOperationErrorDetails(error, ctx) {
|
|
86
|
+
const errorContext = error.trackedContext;
|
|
87
|
+
const logMessages = [];
|
|
88
|
+
logMessages.push(this.getErrorMessage(error, ctx));
|
|
89
|
+
if (errorContext == ctx && error.underlyingError) {
|
|
90
|
+
logMessages.push(`Underlying error: ${this.getErrorMessage(error.underlyingError, ctx)}`);
|
|
91
|
+
}
|
|
92
|
+
return logMessages;
|
|
93
|
+
}
|
|
94
|
+
getErrorMessage(error, _ctx) {
|
|
95
|
+
if (error instanceof Error) {
|
|
96
|
+
const trError = error;
|
|
97
|
+
const errorClass = trError?.constructor?.name;
|
|
98
|
+
return `${errorClass || '[undefined]'}: ${trError.message}`;
|
|
99
|
+
}
|
|
100
|
+
return error?.toString?.() || 'unknown error';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.OperationLogger = OperationLogger;
|
|
104
|
+
//# sourceMappingURL=OperationLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationLogger.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationLogger.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TrackedError } from './TrackedError';
|
|
2
|
+
import { TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
3
|
+
export declare type OperationStatsContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
4
|
+
tags: string[];
|
|
5
|
+
sharedContext: {
|
|
6
|
+
tags: string[];
|
|
7
|
+
};
|
|
8
|
+
decoratorArgs?: {
|
|
9
|
+
shouldStats?: (args: OperationStatsEventArgs) => boolean | void;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare abstract class OperationStats<TContext extends OperationStatsContext = OperationStatsContext> implements TryCatchFinallyHook<TContext> {
|
|
13
|
+
static getTryCatchFinallyHook(_ctx: OperationStatsContext): TryCatchFinallyHook<OperationStatsContext>;
|
|
14
|
+
abstract stats(args: StatsArgs): void;
|
|
15
|
+
getMetricName(ctx: OperationStatsContext): string | undefined;
|
|
16
|
+
onTry(ctx: OperationStatsContext): () => void;
|
|
17
|
+
mergeTags(...tagSets: (string[] | undefined)[]): string[];
|
|
18
|
+
statsOperationEvent(args: OperationStatsEventArgs): void;
|
|
19
|
+
onCatch(ctx: OperationStatsContext): void;
|
|
20
|
+
onFinally(ctx: OperationStatsContext): () => void;
|
|
21
|
+
getHistogramMetric(ctx: OperationStatsContext): string | undefined;
|
|
22
|
+
extractTagsFromError(error: TrackedError, ctx: OperationStatsContext): string[];
|
|
23
|
+
getErrorOperationNameTag(error: TrackedError, ctx: OperationStatsContext): string | undefined;
|
|
24
|
+
getOperationNameTag(ctx: OperationStatsContext): string | undefined;
|
|
25
|
+
}
|
|
26
|
+
export declare type StatsMethod = 'incr' | 'histogram' | 'set';
|
|
27
|
+
export declare type StatsArgs = {
|
|
28
|
+
method?: StatsMethod;
|
|
29
|
+
metric: string;
|
|
30
|
+
value?: number;
|
|
31
|
+
tags?: string[];
|
|
32
|
+
};
|
|
33
|
+
export declare type OperationStatsEvent = OperationStatsContext['stage'] | 'duration';
|
|
34
|
+
export interface OperationStatsEventArgs {
|
|
35
|
+
event: OperationStatsEvent;
|
|
36
|
+
context: OperationStatsContext;
|
|
37
|
+
stats: StatsArgs;
|
|
38
|
+
shouldStats: boolean;
|
|
39
|
+
}
|