@segment/action-destinations 3.251.2-staging → 3.251.2-staging.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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/braze/index.js.map +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/chartmogul/common_fields.d.ts +7 -0
- package/dist/destinations/chartmogul/common_fields.js +49 -0
- package/dist/destinations/chartmogul/common_fields.js.map +1 -0
- package/dist/destinations/chartmogul/generated-types.d.ts +3 -0
- package/dist/destinations/chartmogul/generated-types.js +3 -0
- package/dist/destinations/chartmogul/generated-types.js.map +1 -0
- package/dist/destinations/chartmogul/index.d.ts +4 -0
- package/dist/destinations/chartmogul/index.js +42 -0
- package/dist/destinations/chartmogul/index.js.map +1 -0
- package/dist/destinations/chartmogul/sendContact/generated-types.d.ts +20 -0
- package/dist/destinations/chartmogul/sendContact/generated-types.js +3 -0
- package/dist/destinations/chartmogul/sendContact/generated-types.js.map +1 -0
- package/dist/destinations/chartmogul/sendContact/index.d.ts +5 -0
- package/dist/destinations/chartmogul/sendContact/index.js +106 -0
- package/dist/destinations/chartmogul/sendContact/index.js.map +1 -0
- package/dist/destinations/chartmogul/sendCustomer/generated-types.d.ts +20 -0
- package/dist/destinations/chartmogul/sendCustomer/generated-types.js +3 -0
- package/dist/destinations/chartmogul/sendCustomer/generated-types.js.map +1 -0
- package/dist/destinations/chartmogul/sendCustomer/index.d.ts +5 -0
- package/dist/destinations/chartmogul/sendCustomer/index.js +102 -0
- package/dist/destinations/chartmogul/sendCustomer/index.js.map +1 -0
- package/dist/destinations/customerio/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +2 -5
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +18 -98
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -1
- package/dist/destinations/index.js +1 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/iterable/index.js.map +1 -1
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/klaviyo/properties.js +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +43 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/linkedin-conversions/api/api.test.js +5 -4
- package/dist/destinations/linkedin-conversions/api/api.test.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +8 -6
- package/dist/destinations/linkedin-conversions/api/index.js +41 -10
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/generated-types.d.ts +2 -2
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +48 -34
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/mantle/config.d.ts +1 -0
- package/dist/destinations/mantle/config.js +5 -0
- package/dist/destinations/mantle/config.js.map +1 -0
- package/dist/destinations/mantle/generated-types.d.ts +4 -0
- package/dist/destinations/mantle/generated-types.js +3 -0
- package/dist/destinations/mantle/generated-types.js.map +1 -0
- package/dist/destinations/mantle/identify/generated-types.d.ts +9 -0
- package/dist/destinations/mantle/identify/generated-types.js +3 -0
- package/dist/destinations/mantle/identify/generated-types.js.map +1 -0
- package/dist/destinations/mantle/identify/index.d.ts +5 -0
- package/dist/destinations/mantle/identify/index.js +61 -0
- package/dist/destinations/mantle/identify/index.js.map +1 -0
- package/dist/destinations/mantle/index.d.ts +4 -0
- package/dist/destinations/mantle/index.js +50 -0
- package/dist/destinations/mantle/index.js.map +1 -0
- package/dist/destinations/mantle/pushEvent/generated-types.d.ts +9 -0
- package/dist/destinations/mantle/pushEvent/generated-types.js +3 -0
- package/dist/destinations/mantle/pushEvent/generated-types.js.map +1 -0
- package/dist/destinations/mantle/pushEvent/index.d.ts +5 -0
- package/dist/destinations/mantle/pushEvent/index.js +74 -0
- package/dist/destinations/mantle/pushEvent/index.js.map +1 -0
- package/dist/destinations/marketo-static-lists/addToList/generated-types.d.ts +1 -4
- package/dist/destinations/marketo-static-lists/addToList/index.js +1 -1
- package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/functions.js +2 -1
- package/dist/destinations/marketo-static-lists/functions.js.map +1 -1
- package/dist/destinations/marketo-static-lists/properties.js +1 -37
- package/dist/destinations/marketo-static-lists/properties.js.map +1 -1
- package/dist/destinations/moloco-rmp/addToCart/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/addToWishlist/index.js +1 -1
- package/dist/destinations/moloco-rmp/addToWishlist/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/common/convert.js +17 -29
- package/dist/destinations/moloco-rmp/common/convert.js.map +1 -1
- package/dist/destinations/moloco-rmp/common/event.js.map +1 -1
- package/dist/destinations/moloco-rmp/common/fields.js +10 -10
- package/dist/destinations/moloco-rmp/common/fields.js.map +1 -1
- package/dist/destinations/moloco-rmp/common/request-client.js.map +1 -1
- package/dist/destinations/moloco-rmp/home/index.js +1 -1
- package/dist/destinations/moloco-rmp/home/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/itemPageView/index.js +1 -1
- package/dist/destinations/moloco-rmp/itemPageView/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/land/index.js +1 -1
- package/dist/destinations/moloco-rmp/land/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/pageView/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/purchase/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/search/index.js.map +1 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
- package/dist/destinations/movable-ink/categoryView/index.js +43 -0
- package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
- package/dist/destinations/movable-ink/conversion/index.js +45 -0
- package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
- package/dist/destinations/movable-ink/fields.d.ts +21 -0
- package/dist/destinations/movable-ink/fields.js +236 -0
- package/dist/destinations/movable-ink/fields.js.map +1 -0
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
- package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
- package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
- package/dist/destinations/movable-ink/identify/index.js +32 -0
- package/dist/destinations/movable-ink/identify/index.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productAdded/index.js +43 -0
- package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productViewed/index.js +43 -0
- package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
- package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
- package/dist/destinations/movable-ink/search/generated-types.js +3 -0
- package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/search/index.d.ts +5 -0
- package/dist/destinations/movable-ink/search/index.js +43 -0
- package/dist/destinations/movable-ink/search/index.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
- package/dist/destinations/responsys/index.js +0 -12
- package/dist/destinations/responsys/index.js.map +1 -1
- package/dist/destinations/responsys/sendAudience/index.js +4 -4
- package/dist/destinations/responsys/sendAudience/index.js.map +1 -1
- package/dist/destinations/responsys/sendCustomTraits/index.js +4 -4
- package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -1
- package/dist/destinations/responsys/utils.d.ts +3 -2
- package/dist/destinations/responsys/utils.js +11 -2
- package/dist/destinations/responsys/utils.js.map +1 -1
- package/dist/destinations/responsys-cloud/generated-types.d.ts +20 -0
- package/dist/destinations/responsys-cloud/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/index.d.ts +4 -0
- package/dist/destinations/responsys-cloud/index.js +207 -0
- package/dist/destinations/responsys-cloud/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.d.ts +16 -0
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendAudience/index.d.ts +5 -0
- package/dist/destinations/responsys-cloud/sendAudience/index.js +109 -0
- package/dist/destinations/responsys-cloud/sendAudience/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.d.ts +11 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.d.ts +5 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js +72 -0
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/shared_properties.d.ts +3 -0
- package/dist/destinations/responsys-cloud/shared_properties.js +19 -0
- package/dist/destinations/responsys-cloud/shared_properties.js.map +1 -0
- package/dist/destinations/responsys-cloud/types.d.ts +38 -0
- package/dist/destinations/responsys-cloud/types.js +3 -0
- package/dist/destinations/responsys-cloud/types.js.map +1 -0
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.d.ts +14 -0
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js +3 -0
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js.map +1 -0
- package/dist/destinations/responsys-cloud/upsertListMember/index.d.ts +5 -0
- package/dist/destinations/responsys-cloud/upsertListMember/index.js +85 -0
- package/dist/destinations/responsys-cloud/upsertListMember/index.js.map +1 -0
- package/dist/destinations/responsys-cloud/utils.d.ts +20 -0
- package/dist/destinations/responsys-cloud/utils.js +179 -0
- package/dist/destinations/responsys-cloud/utils.js.map +1 -0
- package/dist/destinations/schematic/identifyUser/generated-types.d.ts +2 -1
- package/dist/destinations/schematic/trackEvent/generated-types.d.ts +1 -0
- package/dist/destinations/segment/segment-properties.d.ts +1 -0
- package/dist/destinations/segment/segment-properties.js +6 -1
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendGroup/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendGroup/index.js +2 -0
- package/dist/destinations/segment/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendIdentify/index.js +2 -0
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment/sendPage/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendPage/index.js +2 -0
- package/dist/destinations/segment/sendPage/index.js.map +1 -1
- package/dist/destinations/segment/sendScreen/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendScreen/index.js +2 -0
- package/dist/destinations/segment/sendScreen/index.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendTrack/index.js +2 -0
- package/dist/destinations/segment/sendTrack/index.js.map +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +1 -0
- package/dist/destinations/segment-profiles/segment-properties.js +6 -1
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/segment-profiles/sendGroup/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendGroup/index.js +3 -1
- package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendIdentify/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendIdentify/index.js +3 -1
- package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendSubscription/index.js +3 -1
- package/dist/destinations/segment-profiles/sendSubscription/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/subscription-properties.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendSubscription/subscription-properties.js +6 -1
- package/dist/destinations/segment-profiles/sendSubscription/subscription-properties.js.map +1 -1
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/trackey/group.types.js +3 -0
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/trackey/identify.types.js +3 -0
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/trackey/track.types.js +3 -0
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/dist/destinations/yotpo/generated-types.d.ts +3 -0
- package/dist/destinations/yotpo/generated-types.js +3 -0
- package/dist/destinations/yotpo/generated-types.js.map +1 -0
- package/dist/destinations/yotpo/index.d.ts +4 -0
- package/dist/destinations/yotpo/index.js +53 -0
- package/dist/destinations/yotpo/index.js.map +1 -0
- package/dist/destinations/yotpo/sendData/generated-types.d.ts +5 -0
- package/dist/destinations/yotpo/sendData/generated-types.js +3 -0
- package/dist/destinations/yotpo/sendData/generated-types.js.map +1 -0
- package/dist/destinations/yotpo/sendData/index.d.ts +5 -0
- package/dist/destinations/yotpo/sendData/index.js +22 -0
- package/dist/destinations/yotpo/sendData/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ export declare const dateStringToFuzzyDate: (dateString: string | number) => fal
|
|
|
9
9
|
y: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const augmentFieldsWithConstituentFields: (fields: Record<string, InputField>) => Record<string, InputField>;
|
|
12
|
-
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<
|
|
12
|
+
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Constituent> | Partial<Address> | Partial<OnlinePresence> | Partial<Phone>)[];
|
|
13
13
|
export declare const buildConstituentPayloadFromPayload: (payload: StringIndexedObject) => Partial<CreateOrUpdateIndividualConstituentPayload>;
|
|
14
14
|
export declare const buildGiftDataFromPayload: (constituentId: string, payload: CreateGiftPayload) => Partial<Gift>;
|
|
15
15
|
export declare const buildConstituentActionDataFromPayload: (constituentId: string, payload: CreateConstituentAction) => Partial<ConstituentAction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/braze/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/braze/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAqD;AACrD,gEAAuC;AACvC,kEAAyC;AACzC,8DAAqC;AACrC,oEAA2C;AAC3C,4EAAmD;AAEnD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,gDAAgD;IAC7D,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,yDAAyD;gBACtE,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EACT,+IAA+I;gBACjJ,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,gGAAgG;gBAC7G,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAAE,+BAA+B,EAAE;oBAC3F,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAAE,+BAA+B,EAAE;oBAC3F,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAAE,+BAA+B,EAAE;oBAC3F,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAAE,+BAA+B,EAAE;oBAC3F,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAAE,+BAA+B,EAAE;oBAC3F,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAAE,+BAA+B,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gBACP,GAAG,4BAAa,CAAC,2BAAiB,CAAC,MAAM,CAAC;gBAC1C,iBAAiB,EAAE;oBACjB,OAAO,EAAE,UAAU;iBACpB;aACF;YACD,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,gDAAgD;SAC5D;QACD;YACE,IAAI,EAAE,gCAAgC;YACtC,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE;gBACP,GAAG,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;gBACnC,UAAU,EAAE;oBACV,OAAO,EAAE,cAAc;iBACxB;aACF;YACD,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,6BAA6B;SACzC;KACF;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const test_data_1 = require("../../../../lib/test-data");
|
|
8
|
+
const index_1 = __importDefault(require("../../index"));
|
|
9
|
+
const nock_1 = __importDefault(require("nock"));
|
|
10
|
+
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
11
|
+
const actionSlug = 'updateUserProfile';
|
|
12
|
+
const destinationSlug = 'Braze';
|
|
13
|
+
const seedName = `${destinationSlug}#${actionSlug}`;
|
|
14
|
+
const receivedAt = '2021-08-03T17:40:04.055Z';
|
|
15
|
+
const settings = {
|
|
16
|
+
app_id: 'my-app-id',
|
|
17
|
+
api_key: 'my-api-key',
|
|
18
|
+
endpoint: 'https://rest.iad-01.braze.com'
|
|
19
|
+
};
|
|
20
|
+
describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
|
|
21
|
+
it('required fields', async () => {
|
|
22
|
+
const action = index_1.default.actions[actionSlug];
|
|
23
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
|
|
24
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
25
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
26
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
27
|
+
const event = actions_core_1.createTestEvent({
|
|
28
|
+
properties: eventData
|
|
29
|
+
});
|
|
30
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
31
|
+
event: event,
|
|
32
|
+
mapping: event.properties,
|
|
33
|
+
settings: settingsData,
|
|
34
|
+
auth: undefined
|
|
35
|
+
});
|
|
36
|
+
const request = responses[0].request;
|
|
37
|
+
const rawBody = await request.text();
|
|
38
|
+
try {
|
|
39
|
+
const json = JSON.parse(rawBody);
|
|
40
|
+
expect(json).toMatchSnapshot();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
expect(rawBody).toMatchSnapshot();
|
|
45
|
+
}
|
|
46
|
+
expect(request.headers).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
it('all fields', async () => {
|
|
49
|
+
const action = index_1.default.actions[actionSlug];
|
|
50
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
|
|
51
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
52
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
53
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
54
|
+
const event = actions_core_1.createTestEvent({
|
|
55
|
+
properties: eventData
|
|
56
|
+
});
|
|
57
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
58
|
+
event: event,
|
|
59
|
+
mapping: event.properties,
|
|
60
|
+
settings: settingsData,
|
|
61
|
+
auth: undefined
|
|
62
|
+
});
|
|
63
|
+
const request = responses[0].request;
|
|
64
|
+
const rawBody = await request.text();
|
|
65
|
+
try {
|
|
66
|
+
const json = JSON.parse(rawBody);
|
|
67
|
+
expect(json).toMatchSnapshot();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
expect(rawBody).toMatchSnapshot();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
it('it should work with batched events', async () => {
|
|
75
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
76
|
+
const events = [
|
|
77
|
+
actions_core_1.createTestEvent({
|
|
78
|
+
event: 'Test Event 1',
|
|
79
|
+
type: 'track',
|
|
80
|
+
receivedAt,
|
|
81
|
+
properties: {}
|
|
82
|
+
}),
|
|
83
|
+
actions_core_1.createTestEvent({
|
|
84
|
+
event: 'Test Event 2',
|
|
85
|
+
type: 'track',
|
|
86
|
+
receivedAt,
|
|
87
|
+
properties: {}
|
|
88
|
+
})
|
|
89
|
+
];
|
|
90
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
91
|
+
events,
|
|
92
|
+
useDefaultMappings: true,
|
|
93
|
+
mapping: {
|
|
94
|
+
external_id: {
|
|
95
|
+
'@path': '$.userId'
|
|
96
|
+
},
|
|
97
|
+
user_alias: {},
|
|
98
|
+
braze_id: {
|
|
99
|
+
'@path': '$.properties.braze_id'
|
|
100
|
+
},
|
|
101
|
+
name: {
|
|
102
|
+
'@path': '$.event'
|
|
103
|
+
},
|
|
104
|
+
time: {
|
|
105
|
+
'@path': '$.receivedAt'
|
|
106
|
+
},
|
|
107
|
+
properties: {
|
|
108
|
+
'@path': '$.properties'
|
|
109
|
+
},
|
|
110
|
+
products: {
|
|
111
|
+
'@path': '$.properties.products'
|
|
112
|
+
},
|
|
113
|
+
enable_batching: true,
|
|
114
|
+
_update_existing_only: true
|
|
115
|
+
},
|
|
116
|
+
settings: {
|
|
117
|
+
...settings
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
expect(responses.length).toBe(1);
|
|
121
|
+
expect(responses[0].status).toBe(200);
|
|
122
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
123
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
124
|
+
});
|
|
125
|
+
it('it should work with a single batched events', async () => {
|
|
126
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
127
|
+
const events = [
|
|
128
|
+
actions_core_1.createTestEvent({
|
|
129
|
+
event: 'Test Event 1',
|
|
130
|
+
type: 'track',
|
|
131
|
+
receivedAt,
|
|
132
|
+
properties: {
|
|
133
|
+
products: [
|
|
134
|
+
{
|
|
135
|
+
quantity: 1,
|
|
136
|
+
product_id: 'Bowflex Treadmill 10',
|
|
137
|
+
price: 100
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
quantity: 2,
|
|
141
|
+
product_id: 'Bowflex Treadmill 20',
|
|
142
|
+
price: 200
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
];
|
|
148
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
149
|
+
events,
|
|
150
|
+
useDefaultMappings: true,
|
|
151
|
+
mapping: {
|
|
152
|
+
external_id: {
|
|
153
|
+
'@path': '$.userId'
|
|
154
|
+
},
|
|
155
|
+
user_alias: {},
|
|
156
|
+
braze_id: {
|
|
157
|
+
'@path': '$.properties.braze_id'
|
|
158
|
+
},
|
|
159
|
+
name: {
|
|
160
|
+
'@path': '$.event'
|
|
161
|
+
},
|
|
162
|
+
time: {
|
|
163
|
+
'@path': '$.receivedAt'
|
|
164
|
+
},
|
|
165
|
+
properties: {
|
|
166
|
+
'@path': '$.properties'
|
|
167
|
+
},
|
|
168
|
+
products: {
|
|
169
|
+
'@path': '$.properties.products'
|
|
170
|
+
},
|
|
171
|
+
enable_batching: true,
|
|
172
|
+
_update_existing_only: true
|
|
173
|
+
},
|
|
174
|
+
settings: {
|
|
175
|
+
...settings
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
expect(responses.length).toBe(1);
|
|
179
|
+
expect(responses[0].status).toBe(200);
|
|
180
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
181
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=snapshot.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4F;AAC5F,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAC1D,MAAM,UAAU,GAAG,mBAAmB,CAAA;AACtC,MAAM,eAAe,GAAG,OAAO,CAAA;AAC/B,MAAM,QAAQ,GAAG,GAAG,eAAe,IAAI,UAAU,EAAE,CAAA;AACnD,MAAM,UAAU,GAAG,0BAA0B,CAAA;AAC7C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,+BAAwC;CACnD,CAAA;AAED,QAAQ,CAAC,wBAAwB,eAAe,MAAM,UAAU,sBAAsB,EAAE,GAAG,EAAE;IAC3F,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,eAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,4BAAgB,CAAC,QAAQ,EAAE,eAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAEvF,cAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACzC,cAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,IAA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C,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputField } from '@segment/actions-core/destination-kit/types';
|
|
2
|
+
export declare const message_id: InputField;
|
|
3
|
+
export declare const timestamp: InputField;
|
|
4
|
+
export declare const sent_at: InputField;
|
|
5
|
+
export declare const event_type: InputField;
|
|
6
|
+
export declare const user_id: InputField;
|
|
7
|
+
export declare const anonymous_id: InputField;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.anonymous_id = exports.user_id = exports.event_type = exports.sent_at = exports.timestamp = exports.message_id = void 0;
|
|
4
|
+
exports.message_id = {
|
|
5
|
+
label: 'MessageId',
|
|
6
|
+
description: 'The Segment message id',
|
|
7
|
+
type: 'string',
|
|
8
|
+
required: true,
|
|
9
|
+
default: { '@path': '$.messageId' }
|
|
10
|
+
};
|
|
11
|
+
exports.timestamp = {
|
|
12
|
+
label: 'Event Timestamp',
|
|
13
|
+
description: 'The timestamp at which the event was created',
|
|
14
|
+
type: 'datetime',
|
|
15
|
+
required: true,
|
|
16
|
+
default: { '@path': '$.timestamp' }
|
|
17
|
+
};
|
|
18
|
+
exports.sent_at = {
|
|
19
|
+
label: 'Sent At',
|
|
20
|
+
description: 'When the event was sent',
|
|
21
|
+
type: 'datetime',
|
|
22
|
+
required: true,
|
|
23
|
+
default: { '@path': '$.sentAt' }
|
|
24
|
+
};
|
|
25
|
+
exports.event_type = {
|
|
26
|
+
label: 'Event Type',
|
|
27
|
+
description: 'The type of event',
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: 'Send ...',
|
|
30
|
+
required: true,
|
|
31
|
+
unsafe_hidden: true
|
|
32
|
+
};
|
|
33
|
+
exports.user_id = {
|
|
34
|
+
label: 'User Id',
|
|
35
|
+
description: 'Segment User Id',
|
|
36
|
+
type: 'string',
|
|
37
|
+
readOnly: true,
|
|
38
|
+
required: false,
|
|
39
|
+
default: { '@path': '$.userId' }
|
|
40
|
+
};
|
|
41
|
+
exports.anonymous_id = {
|
|
42
|
+
label: 'Anonymous Id',
|
|
43
|
+
description: 'Segment Anonymous Id',
|
|
44
|
+
type: 'string',
|
|
45
|
+
readOnly: true,
|
|
46
|
+
required: false,
|
|
47
|
+
default: { '@path': '$.anonymousId' }
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=common_fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common_fields.js","sourceRoot":"","sources":["../../../src/destinations/chartmogul/common_fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;CACpC,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,8CAA8C;IAC3D,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;CACpC,CAAA;AAEY,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,yBAAyB;IACtC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;CACjC,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,mBAAmB;IAChC,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,iBAAiB;IAC9B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;CACjC,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;CACtC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/chartmogul/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const sendContact_1 = __importDefault(require("./sendContact"));
|
|
8
|
+
const sendCustomer_1 = __importDefault(require("./sendCustomer"));
|
|
9
|
+
const destination = {
|
|
10
|
+
name: 'Chart Mogul',
|
|
11
|
+
slug: 'actions-chartmogul',
|
|
12
|
+
mode: 'cloud',
|
|
13
|
+
description: 'Send Contacts and Customers to ChartMogul.',
|
|
14
|
+
authentication: {
|
|
15
|
+
scheme: 'custom',
|
|
16
|
+
fields: {
|
|
17
|
+
chartmogul_webhook_url: {
|
|
18
|
+
label: 'ChartMogul webhook URL',
|
|
19
|
+
description: 'Copy the webhook URL from ChartMogul and paste it here',
|
|
20
|
+
type: 'string',
|
|
21
|
+
format: 'uri',
|
|
22
|
+
required: true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
testAuthentication: (request, auth) => {
|
|
26
|
+
const targetUrl = auth?.settings?.chartmogul_webhook_url;
|
|
27
|
+
if (!targetUrl || !targetUrl.startsWith('https://')) {
|
|
28
|
+
throw new actions_core_1.InvalidAuthenticationError('Please configure the ChartMogul webhook URL.');
|
|
29
|
+
}
|
|
30
|
+
return request(targetUrl, {
|
|
31
|
+
method: 'post',
|
|
32
|
+
json: {}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
actions: {
|
|
37
|
+
sendContact: sendContact_1.default,
|
|
38
|
+
sendCustomer: sendCustomer_1.default
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.default = destination;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/chartmogul/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAkE;AAElE,gEAAuC;AAEvC,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,4CAA4C;IACzD,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,sBAAsB,EAAE;gBACtB,KAAK,EAAE,wBAAwB;gBAC/B,WAAW,EAAE,wDAAwD;gBACrE,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;YACpC,MAAM,SAAS,GAAG,IAAI,EAAE,QAAQ,EAAE,sBAAsB,CAAA;YACxD,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;gBACnD,MAAM,IAAI,yCAA0B,CAAC,8CAA8C,CAAC,CAAA;aACrF;YAED,OAAO,OAAO,CAAC,SAAS,EAAE;gBACxB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE;aACT,CAAC,CAAA;QACJ,CAAC;KACF;IAED,OAAO,EAAE;QACP,WAAW,EAAX,qBAAW;QACX,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
type: string;
|
|
3
|
+
message_id: string;
|
|
4
|
+
timestamp: string | number;
|
|
5
|
+
sent_at: string | number;
|
|
6
|
+
user_id?: string;
|
|
7
|
+
anonymous_id?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
first_name?: string;
|
|
10
|
+
last_name?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
phone?: string;
|
|
14
|
+
linked_in?: string;
|
|
15
|
+
twitter?: string;
|
|
16
|
+
company?: {
|
|
17
|
+
id: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/chartmogul/sendContact/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const common_fields_1 = require("../common_fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Send Contact',
|
|
7
|
+
description: 'Send a Contact to ChartMogul CRM',
|
|
8
|
+
defaultSubscription: 'type = "identify"',
|
|
9
|
+
fields: {
|
|
10
|
+
type: { ...common_fields_1.event_type, default: 'Send Contact' },
|
|
11
|
+
message_id: common_fields_1.message_id,
|
|
12
|
+
timestamp: common_fields_1.timestamp,
|
|
13
|
+
sent_at: common_fields_1.sent_at,
|
|
14
|
+
user_id: common_fields_1.user_id,
|
|
15
|
+
anonymous_id: common_fields_1.anonymous_id,
|
|
16
|
+
email: {
|
|
17
|
+
label: 'Email',
|
|
18
|
+
description: "The user's email",
|
|
19
|
+
type: 'string',
|
|
20
|
+
format: 'email',
|
|
21
|
+
default: { '@path': '$.traits.email' }
|
|
22
|
+
},
|
|
23
|
+
first_name: {
|
|
24
|
+
label: 'First Name',
|
|
25
|
+
description: `The contact's first name`,
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: { '@path': '$.traits.first_name' }
|
|
28
|
+
},
|
|
29
|
+
last_name: {
|
|
30
|
+
label: 'Last Name',
|
|
31
|
+
description: "The contact's last name",
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: { '@path': '$.traits.last_name' }
|
|
34
|
+
},
|
|
35
|
+
name: {
|
|
36
|
+
label: 'Full Name',
|
|
37
|
+
description: "The contact's full name. It is used if first_name and last_name are not provided.",
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: { '@path': '$.traits.name' }
|
|
40
|
+
},
|
|
41
|
+
title: {
|
|
42
|
+
label: 'Title',
|
|
43
|
+
description: `The contact's job or personal title`,
|
|
44
|
+
type: 'string',
|
|
45
|
+
default: { '@path': '$.traits.title' }
|
|
46
|
+
},
|
|
47
|
+
phone: {
|
|
48
|
+
label: 'Phone Number',
|
|
49
|
+
description: "The contact's phone number",
|
|
50
|
+
type: 'string',
|
|
51
|
+
default: { '@path': '$.traits.phone' }
|
|
52
|
+
},
|
|
53
|
+
linked_in: {
|
|
54
|
+
label: 'LinkedIn',
|
|
55
|
+
description: "The contact's LinkedIn URL",
|
|
56
|
+
type: 'string',
|
|
57
|
+
format: 'uri',
|
|
58
|
+
default: { '@path': '$.traits.linkedIn' }
|
|
59
|
+
},
|
|
60
|
+
twitter: {
|
|
61
|
+
label: 'Twitter (X)',
|
|
62
|
+
description: "The contact's Twitter (X) URL or handle",
|
|
63
|
+
type: 'string',
|
|
64
|
+
default: { '@path': '$.traits.twitter' }
|
|
65
|
+
},
|
|
66
|
+
company: {
|
|
67
|
+
label: 'Company',
|
|
68
|
+
description: "The contact's Company. It creates a Customer in ChartMogul if the company id is present.",
|
|
69
|
+
type: 'object',
|
|
70
|
+
additionalProperties: false,
|
|
71
|
+
defaultObjectUI: 'keyvalue',
|
|
72
|
+
properties: {
|
|
73
|
+
id: {
|
|
74
|
+
label: 'Company Id',
|
|
75
|
+
type: 'string',
|
|
76
|
+
required: true
|
|
77
|
+
},
|
|
78
|
+
name: {
|
|
79
|
+
label: 'Company Name',
|
|
80
|
+
type: 'string'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
default: {
|
|
84
|
+
id: { '@path': '$.traits.company.id' },
|
|
85
|
+
name: { '@path': '$.traits.company.name' }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
perform: (request, data) => {
|
|
90
|
+
if (!data.payload.user_id && !data.payload.anonymous_id) {
|
|
91
|
+
throw new actions_core_1.PayloadValidationError(`The user_id and/or anonymous_id must be present.`);
|
|
92
|
+
}
|
|
93
|
+
if (data.payload.company && !data.payload.company.id) {
|
|
94
|
+
delete data.payload.company;
|
|
95
|
+
}
|
|
96
|
+
if (Object.keys(data.payload).length <= 5) {
|
|
97
|
+
throw new actions_core_1.PayloadValidationError('The event contains no information of interest to Chartmogul.');
|
|
98
|
+
}
|
|
99
|
+
return request(data.settings.chartmogul_webhook_url, {
|
|
100
|
+
method: 'post',
|
|
101
|
+
json: data.payload
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
exports.default = action;
|
|
106
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/chartmogul/sendContact/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAGhF,oDAAoG;AAEpG,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,kCAAkC;IAC/C,mBAAmB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CAAC,QAAQ,CAAC,sBAAsB,EAAE;YACnD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,OAAO;SACnB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
type: string;
|
|
3
|
+
message_id: string;
|
|
4
|
+
timestamp: string | number;
|
|
5
|
+
sent_at: string | number;
|
|
6
|
+
user_id: string;
|
|
7
|
+
group_id: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
website?: string;
|
|
12
|
+
created_at?: string | number;
|
|
13
|
+
address?: {
|
|
14
|
+
street?: string;
|
|
15
|
+
city?: string;
|
|
16
|
+
state?: string;
|
|
17
|
+
postal_code?: string;
|
|
18
|
+
country?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/chartmogul/sendCustomer/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_fields_1 = require("../common_fields");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Send Customer',
|
|
6
|
+
description: 'Send a Customer (company) to ChartMogul CRM',
|
|
7
|
+
defaultSubscription: 'type = "group"',
|
|
8
|
+
fields: {
|
|
9
|
+
type: { ...common_fields_1.event_type, default: 'Send Customer' },
|
|
10
|
+
message_id: common_fields_1.message_id,
|
|
11
|
+
timestamp: common_fields_1.timestamp,
|
|
12
|
+
sent_at: common_fields_1.sent_at,
|
|
13
|
+
user_id: { ...common_fields_1.user_id, required: true },
|
|
14
|
+
group_id: {
|
|
15
|
+
label: 'Group Id',
|
|
16
|
+
description: 'Segment Group Id',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: true,
|
|
19
|
+
default: { '@path': '$.groupId' }
|
|
20
|
+
},
|
|
21
|
+
name: {
|
|
22
|
+
label: 'Name',
|
|
23
|
+
description: "The company's name",
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: { '@path': '$.traits.name' }
|
|
26
|
+
},
|
|
27
|
+
description: {
|
|
28
|
+
label: 'Description',
|
|
29
|
+
description: "The company's name",
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: { '@path': '$.traits.description' }
|
|
32
|
+
},
|
|
33
|
+
email: {
|
|
34
|
+
label: 'Email',
|
|
35
|
+
description: "The company's email",
|
|
36
|
+
type: 'string',
|
|
37
|
+
format: 'email',
|
|
38
|
+
default: { '@path': '$.traits.email' }
|
|
39
|
+
},
|
|
40
|
+
website: {
|
|
41
|
+
label: 'Website',
|
|
42
|
+
description: "The company's website URL",
|
|
43
|
+
type: 'string',
|
|
44
|
+
format: 'uri-reference',
|
|
45
|
+
default: { '@path': '$.traits.website' }
|
|
46
|
+
},
|
|
47
|
+
created_at: {
|
|
48
|
+
label: 'Created at',
|
|
49
|
+
description: 'Date the group’s account was first created',
|
|
50
|
+
type: 'datetime',
|
|
51
|
+
default: { '@path': '$.traits.createdAt' }
|
|
52
|
+
},
|
|
53
|
+
address: {
|
|
54
|
+
label: 'Address',
|
|
55
|
+
type: 'object',
|
|
56
|
+
description: 'The company’s address details',
|
|
57
|
+
defaultObjectUI: 'keyvalue',
|
|
58
|
+
properties: {
|
|
59
|
+
street: {
|
|
60
|
+
label: 'Street',
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'The company’s street address'
|
|
63
|
+
},
|
|
64
|
+
city: {
|
|
65
|
+
label: 'City',
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'The company’s city'
|
|
68
|
+
},
|
|
69
|
+
state: {
|
|
70
|
+
label: 'State',
|
|
71
|
+
type: 'string',
|
|
72
|
+
description: 'The company’s state or region'
|
|
73
|
+
},
|
|
74
|
+
postal_code: {
|
|
75
|
+
label: 'Postal code',
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'The company’s zip or postal code'
|
|
78
|
+
},
|
|
79
|
+
country: {
|
|
80
|
+
label: 'Country',
|
|
81
|
+
type: 'string',
|
|
82
|
+
description: 'The company’s country'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
default: {
|
|
86
|
+
street: { '@path': '$.traits.address.street' },
|
|
87
|
+
city: { '@path': '$.traits.address.city' },
|
|
88
|
+
state: { '@path': '$.traits.address.state' },
|
|
89
|
+
postal_code: { '@path': '$.traits.address.postalCode' },
|
|
90
|
+
country: { '@path': '$.traits.address.country' }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
perform: (request, data) => {
|
|
95
|
+
return request(data.settings.chartmogul_webhook_url, {
|
|
96
|
+
method: 'post',
|
|
97
|
+
json: data.payload
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
exports.default = action;
|
|
102
|
+
//# sourceMappingURL=index.js.map
|