@segment/action-destinations 3.234.0-staging.1 → 3.234.0-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/linkedin-conversions/index.js +4 -1
- package/dist/destinations/linkedin-conversions/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/destinations/amazon-ads/generated-types.d.ts +0 -3
- package/dist/destinations/amazon-ads/generated-types.js +0 -3
- package/dist/destinations/amazon-ads/generated-types.js.map +0 -1
- package/dist/destinations/amazon-ads/index.d.ts +0 -4
- package/dist/destinations/amazon-ads/index.js +0 -87
- package/dist/destinations/amazon-ads/index.js.map +0 -1
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +0 -2
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js +0 -3
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js.map +0 -1
- package/dist/destinations/amazon-ads/syncAudiences/index.d.ts +0 -5
- package/dist/destinations/amazon-ads/syncAudiences/index.js +0 -15
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +0 -1
- package/dist/destinations/amazon-ads/types.d.ts +0 -22
- package/dist/destinations/amazon-ads/types.js +0 -11
- package/dist/destinations/amazon-ads/types.js.map +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +0 -3
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -43
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
- package/dist/destinations/mixpanel/utils.d.ts +0 -13
- package/dist/destinations/mixpanel/utils.js +0 -117
- package/dist/destinations/mixpanel/utils.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/categoryView/generated-types.js +0 -3
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/index.d.ts +0 -5
- package/dist/destinations/movable-ink/categoryView/index.js +0 -43
- package/dist/destinations/movable-ink/categoryView/index.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +0 -20
- package/dist/destinations/movable-ink/conversion/generated-types.js +0 -3
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/index.d.ts +0 -5
- package/dist/destinations/movable-ink/conversion/index.js +0 -45
- package/dist/destinations/movable-ink/conversion/index.js.map +0 -1
- package/dist/destinations/movable-ink/fields.d.ts +0 -21
- package/dist/destinations/movable-ink/fields.js +0 -236
- package/dist/destinations/movable-ink/fields.js.map +0 -1
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +0 -7
- package/dist/destinations/movable-ink/identify/generated-types.js +0 -3
- package/dist/destinations/movable-ink/identify/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/identify/index.d.ts +0 -5
- package/dist/destinations/movable-ink/identify/index.js +0 -32
- package/dist/destinations/movable-ink/identify/index.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/productAdded/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productAdded/index.js +0 -43
- package/dist/destinations/movable-ink/productAdded/index.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +0 -21
- package/dist/destinations/movable-ink/productViewed/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productViewed/index.js +0 -43
- package/dist/destinations/movable-ink/productViewed/index.js.map +0 -1
- package/dist/destinations/movable-ink/search/generated-types.d.ts +0 -12
- package/dist/destinations/movable-ink/search/generated-types.js +0 -3
- package/dist/destinations/movable-ink/search/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/search/index.d.ts +0 -5
- package/dist/destinations/movable-ink/search/index.js +0 -43
- package/dist/destinations/movable-ink/search/index.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +0 -25
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +0 -3
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +0 -5
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +0 -48
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +0 -3
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +0 -3
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
- package/dist/destinations/responsys/generated-types.d.ts +0 -5
- package/dist/destinations/responsys/generated-types.js +0 -3
- package/dist/destinations/responsys/generated-types.js.map +0 -1
- package/dist/destinations/responsys/index.d.ts +0 -4
- package/dist/destinations/responsys/index.js +0 -62
- package/dist/destinations/responsys/index.js.map +0 -1
- package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
- package/dist/destinations/responsys/rsp-operations.js +0 -33
- package/dist/destinations/responsys/rsp-operations.js.map +0 -1
- package/dist/destinations/responsys/rsp-properties.d.ts +0 -4
- package/dist/destinations/responsys/rsp-properties.js +0 -27
- package/dist/destinations/responsys/rsp-properties.js.map +0 -1
- package/dist/destinations/responsys/types.d.ts +0 -37
- package/dist/destinations/responsys/types.js +0 -3
- package/dist/destinations/responsys/types.js.map +0 -1
- package/dist/destinations/trackey/group.types.d.ts +0 -11
- package/dist/destinations/trackey/group.types.js +0 -3
- package/dist/destinations/trackey/group.types.js.map +0 -1
- package/dist/destinations/trackey/identify.types.d.ts +0 -11
- package/dist/destinations/trackey/identify.types.js +0 -3
- package/dist/destinations/trackey/identify.types.js.map +0 -1
- package/dist/destinations/trackey/track.types.d.ts +0 -12
- package/dist/destinations/trackey/track.types.js +0 -3
- package/dist/destinations/trackey/track.types.js.map +0 -1
|
@@ -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<Address> | Partial<OnlinePresence> | Partial<Phone> | Partial<Constituent>)[];
|
|
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>;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
7
|
const api_1 = require("./api");
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
|
+
const https_1 = __importDefault(require("https"));
|
|
9
10
|
const streamConversion_1 = __importDefault(require("./streamConversion"));
|
|
10
11
|
const destination = {
|
|
11
12
|
name: 'LinkedIn Conversions API',
|
|
@@ -54,12 +55,14 @@ const destination = {
|
|
|
54
55
|
}
|
|
55
56
|
},
|
|
56
57
|
extendRequest({ auth }) {
|
|
58
|
+
const agent = new https_1.default.Agent({ keepAlive: true });
|
|
57
59
|
return {
|
|
58
60
|
headers: {
|
|
59
61
|
authorization: `Bearer ${auth?.accessToken}`,
|
|
60
62
|
'LinkedIn-Version': constants_1.LINKEDIN_API_VERSION,
|
|
61
63
|
'X-Restli-Protocol-Version': `2.0.0`
|
|
62
|
-
}
|
|
64
|
+
},
|
|
65
|
+
agent
|
|
63
66
|
};
|
|
64
67
|
},
|
|
65
68
|
actions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-conversions/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAgG;AAEhG,+BAA2C;AAE3C,2CAAkD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-conversions/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAgG;AAEhG,+BAA2C;AAE3C,2CAAkD;AAClD,kDAAyB;AACzB,0EAAiD;AAEjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAA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,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,EAC5E,yBAAU,CAAC,oBAAoB,EAC/B,GAAG,CACJ,CAAA;aACF;YAED,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA;QACjD,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QAIpB,MAAM,KAAK,GAAG,IAAI,eAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAElD,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;gBAC5C,kBAAkB,EAAE,gCAAoB;gBACxC,2BAA2B,EAAE,OAAO;aACrC;YACD,KAAK;SACN,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.234.0-staging.
|
|
4
|
+
"version": "3.234.0-staging.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,87 +0,0 @@
|
|
|
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 syncAudiences_1 = __importDefault(require("./syncAudiences"));
|
|
8
|
-
const destination = {
|
|
9
|
-
name: 'Amazon Ads',
|
|
10
|
-
slug: 'actions-amazon-ads',
|
|
11
|
-
mode: 'cloud',
|
|
12
|
-
authentication: {
|
|
13
|
-
scheme: 'oauth2',
|
|
14
|
-
fields: {
|
|
15
|
-
region: {
|
|
16
|
-
label: 'Region',
|
|
17
|
-
description: 'Region for API Endpoint, either NA, EU, FE.',
|
|
18
|
-
choices: [
|
|
19
|
-
{ label: 'North America (NA)', value: 'https://advertising-api.amazon.com' },
|
|
20
|
-
{ label: 'Europe (EU)', value: 'https://advertising-api-eu.amazon.com' },
|
|
21
|
-
{ label: 'Far East (FE)', value: 'https://advertising-api-fe.amazon.com' }
|
|
22
|
-
],
|
|
23
|
-
default: 'North America (NA)',
|
|
24
|
-
type: 'string',
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
testAuthentication: async (request, { auth }) => {
|
|
29
|
-
if (!auth?.accessToken) {
|
|
30
|
-
throw new actions_core_1.InvalidAuthenticationError('Please authenticate via Oauth before enabling the destination.');
|
|
31
|
-
}
|
|
32
|
-
try {
|
|
33
|
-
await request('https://advertising-api.amazon.com/v2/profiles', {
|
|
34
|
-
method: 'GET'
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
catch (e) {
|
|
38
|
-
const error = e;
|
|
39
|
-
if (error.message === 'Unauthorized') {
|
|
40
|
-
throw new Error('Invalid LinkedIn Oauth access token. Please reauthenticate to retrieve a valid access token before enabling the destination.');
|
|
41
|
-
}
|
|
42
|
-
throw e;
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
refreshAccessToken: async (request, { auth }) => {
|
|
46
|
-
let res;
|
|
47
|
-
try {
|
|
48
|
-
res = await request('https://api.amazon.com/auth/o2/token', {
|
|
49
|
-
method: 'POST',
|
|
50
|
-
body: new URLSearchParams({
|
|
51
|
-
refresh_token: auth.refreshToken,
|
|
52
|
-
client_id: auth.clientId,
|
|
53
|
-
client_secret: auth.clientSecret,
|
|
54
|
-
grant_type: 'refresh_token'
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
const error = e;
|
|
60
|
-
if (error.response?.data?.error === 'invalid_grant') {
|
|
61
|
-
throw new actions_core_1.IntegrationError(`Invalid Authentication: Your refresh token is invalid or expired. Please re-authenticate to fetch a new refresh token.`, actions_core_1.ErrorCodes.REFRESH_TOKEN_EXPIRED, 401);
|
|
62
|
-
}
|
|
63
|
-
throw new actions_core_1.IntegrationError(`Failed to fetch a new access token. Reason: ${error.response?.data?.error}`, actions_core_1.ErrorCodes.OAUTH_REFRESH_FAILED, 401);
|
|
64
|
-
}
|
|
65
|
-
return { accessToken: res?.data?.access_token };
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
extendRequest({ auth }) {
|
|
69
|
-
return {
|
|
70
|
-
headers: {
|
|
71
|
-
authorization: `Bearer ${auth?.accessToken}`
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
audienceFields: {},
|
|
76
|
-
audienceConfig: {
|
|
77
|
-
mode: {
|
|
78
|
-
type: 'synced',
|
|
79
|
-
full_audience_sync: false
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
actions: {
|
|
83
|
-
syncAudiences: syncAudiences_1.default
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
exports.default = destination;
|
|
87
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAgG;AAIhG,oEAA2C;AAG3C,MAAM,WAAW,GAA4C;IAC3D,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,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AC;iBACH,CAAC,CAAA;aACH;YAAC,OAAO,CAAM,EAAE;gBACf,MAAM,KAAK,GAAG,CAA4B,CAAA;gBAC1C,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,KAAK,eAAe,EAAE;oBACnD,MAAM,IAAI,+BAAgB,CACxB,wHAAwH,EACxH,yBAAU,CAAC,qBAAqB,EAChC,GAAG,CACJ,CAAA;iBACF;gBAED,MAAM,IAAI,+BAAgB,CACxB,+CAA+C,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,EAC5E,yBAAU,CAAC,oBAAoB,EAC/B,GAAG,CACJ,CAAA;aACF;YAED,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA;QACjD,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;aAC7C;SACF,CAAA;IACH,CAAC;IAED,cAAc,EAAE,EAAE;IAElB,cAAc,EAAE;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,kBAAkB,EAAE,KAAK;SAC1B;KAWF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/amazon-ads/syncAudiences/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const action = {
|
|
4
|
-
title: 'Sync Audiences',
|
|
5
|
-
description: 'Sync audiences from Segment to Amazon Ads Audience.',
|
|
6
|
-
fields: {},
|
|
7
|
-
perform: (request, data) => {
|
|
8
|
-
return request('https://example.com', {
|
|
9
|
-
method: 'post',
|
|
10
|
-
json: data.payload
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
exports.default = action;
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amazon-ads/syncAudiences/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,qDAAqD;IAClE,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,OAAO,OAAO,CAAC,qBAAqB,EAAE;YACpC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,OAAO;SACnB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HTTPError } from '@segment/actions-core';
|
|
2
|
-
export interface RefreshTokenResponse {
|
|
3
|
-
access_token: string;
|
|
4
|
-
scope: string;
|
|
5
|
-
expires_in: number;
|
|
6
|
-
token_type: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class AmazonTestAuthenticationError extends HTTPError {
|
|
9
|
-
response: Response & {
|
|
10
|
-
data: {
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare class AmazonRefreshTokenError extends HTTPError {
|
|
16
|
-
response: Response & {
|
|
17
|
-
data: {
|
|
18
|
-
error: string;
|
|
19
|
-
error_description: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AmazonRefreshTokenError = exports.AmazonTestAuthenticationError = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
-
class AmazonTestAuthenticationError extends actions_core_1.HTTPError {
|
|
6
|
-
}
|
|
7
|
-
exports.AmazonTestAuthenticationError = AmazonTestAuthenticationError;
|
|
8
|
-
class AmazonRefreshTokenError extends actions_core_1.HTTPError {
|
|
9
|
-
}
|
|
10
|
-
exports.AmazonRefreshTokenError = AmazonRefreshTokenError;
|
|
11
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;AAajD,MAAa,6BAA8B,SAAQ,wBAAS;CAM3D;AAND,sEAMC;AAED,MAAa,uBAAwB,SAAQ,wBAAS;CAOrD;AAPD,0DAOC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,184 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;QACz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e,EAAE,CAAA;QACtD,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const functions_1 = require("../functions");
|
|
5
|
-
const properties_1 = require("../properties");
|
|
6
|
-
const action = {
|
|
7
|
-
title: 'Remove profile from list',
|
|
8
|
-
description: 'Remove profile from list',
|
|
9
|
-
fields: {
|
|
10
|
-
email: { ...properties_1.email },
|
|
11
|
-
list_id: { ...properties_1.external_id }
|
|
12
|
-
},
|
|
13
|
-
perform: async (request, { payload }) => {
|
|
14
|
-
const { email, list_id } = payload;
|
|
15
|
-
if (!email || !list_id) {
|
|
16
|
-
throw new actions_core_1.IntegrationError("Insert the ID of the default list that you'd like to subscribe users", 'Missing required fields', 400);
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const profileData = await functions_1.getProfile(request, email);
|
|
20
|
-
const v = JSON.parse(profileData.content);
|
|
21
|
-
if (Object.keys(v).length !== 0) {
|
|
22
|
-
console.log(v);
|
|
23
|
-
const listData = {
|
|
24
|
-
data: [
|
|
25
|
-
{
|
|
26
|
-
type: 'profile',
|
|
27
|
-
id: v.data[0].id
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
};
|
|
31
|
-
const list = await functions_1.executeProfileList(request, 'DELETE', listData, list_id);
|
|
32
|
-
return list;
|
|
33
|
-
}
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
console.log(error);
|
|
38
|
-
throw new Error('An error occurred while processing the request');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.default = action;
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAK1E,4CAA6D;AAC7D,8CAAkD;AAElD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,0BAA0B;IACvC,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,GAAG,kBAAK,EAAE;QACnB,OAAO,EAAE,EAAE,GAAG,wBAAW,EAAE;KAC5B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;QAClC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE;YACtB,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;SACF;QACD,IAAI;YACF,MAAM,WAAW,GAA2B,MAAM,sBAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YAC5E,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACzC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACd,MAAM,QAAQ,GAAa;oBACzB,IAAI,EAAE;wBACJ;4BACE,IAAI,EAAE,SAAS;4BACf,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;yBACjB;qBACF;iBACF,CAAA;gBAED,MAAM,IAAI,GAAG,MAAM,8BAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;gBAC3E,OAAO,IAAI,CAAA;aACZ;YACD,OAAM;SACP;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAClB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare enum ApiRegions {
|
|
2
|
-
US = "US \uD83C\uDDFA\uD83C\uDDF8",
|
|
3
|
-
EU = "EU \uD83C\uDDEA\uD83C\uDDFA"
|
|
4
|
-
}
|
|
5
|
-
export declare enum StrictMode {
|
|
6
|
-
ON = "1",
|
|
7
|
-
OFF = "0"
|
|
8
|
-
}
|
|
9
|
-
export declare function getConcatenatedName(firstName: unknown, lastName: unknown, name: unknown): unknown;
|
|
10
|
-
export declare function getApiServerUrl(apiRegion: string | undefined): "https://api-eu.mixpanel.com" | "https://api.mixpanel.com";
|
|
11
|
-
export declare function getBrowser(userAgent: string): string;
|
|
12
|
-
export declare function getBrowserVersion(userAgent: string): string | undefined;
|
|
13
|
-
export declare function cheapGuid(maxlen?: number): string;
|