@segment/action-destinations 3.38.0 → 3.40.0
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/clevertap/generated-types.d.ts +5 -0
- package/dist/destinations/clevertap/generated-types.js +3 -0
- package/dist/destinations/clevertap/generated-types.js.map +1 -0
- package/dist/destinations/clevertap/index.d.ts +4 -0
- package/dist/destinations/clevertap/index.js +51 -0
- package/dist/destinations/clevertap/index.js.map +1 -0
- package/dist/destinations/clevertap/userDelete/generated-types.d.ts +3 -0
- package/dist/destinations/clevertap/userDelete/generated-types.js +3 -0
- package/dist/destinations/clevertap/userDelete/generated-types.js.map +1 -0
- package/dist/destinations/clevertap/userDelete/index.d.ts +5 -0
- package/dist/destinations/clevertap/userDelete/index.js +30 -0
- package/dist/destinations/clevertap/userDelete/index.js.map +1 -0
- package/dist/destinations/clevertap/userDelete/types.d.ts +3 -0
- package/dist/destinations/clevertap/userDelete/types.js +3 -0
- package/dist/destinations/clevertap/userDelete/types.js.map +1 -0
- package/dist/destinations/clevertap/userUpload/generated-types.d.ts +7 -0
- package/dist/destinations/clevertap/userUpload/generated-types.js +3 -0
- package/dist/destinations/clevertap/userUpload/generated-types.js.map +1 -0
- package/dist/destinations/clevertap/userUpload/index.d.ts +5 -0
- package/dist/destinations/clevertap/userUpload/index.js +50 -0
- package/dist/destinations/clevertap/userUpload/index.js.map +1 -0
- package/dist/destinations/clevertap/userUpload/types.d.ts +7 -0
- package/dist/destinations/clevertap/userUpload/types.js +3 -0
- package/dist/destinations/clevertap/userUpload/types.js.map +1 -0
- package/dist/destinations/customerio/utils.js +10 -2
- package/dist/destinations/customerio/utils.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js +4 -4
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js.map +1 -1
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/voyage/generated-types.d.ts +3 -0
- package/dist/destinations/voyage/generated-types.js +3 -0
- package/dist/destinations/voyage/generated-types.js.map +1 -0
- package/dist/destinations/voyage/index.d.ts +4 -0
- package/dist/destinations/voyage/index.js +43 -0
- package/dist/destinations/voyage/index.js.map +1 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.d.ts +19 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.js +3 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.js.map +1 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.d.ts +5 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.js +167 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.js.map +1 -0
- package/dist/destinations/voyage/utils.d.ts +31 -0
- package/dist/destinations/voyage/utils.js +8 -0
- package/dist/destinations/voyage/utils.js.map +1 -0
- package/dist/destinations/webhook/__test__/webhook.test.js +3 -29
- package/dist/destinations/webhook/__test__/webhook.test.js.map +1 -1
- package/dist/destinations/webhook/send/index.js +0 -11
- package/dist/destinations/webhook/send/index.js.map +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/clevertap/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 userUpload_1 = __importDefault(require("./userUpload"));
|
|
7
|
+
const userDelete_1 = __importDefault(require("./userDelete"));
|
|
8
|
+
const destination = {
|
|
9
|
+
name: 'Clevertap (Actions)',
|
|
10
|
+
slug: 'actions-clevertap',
|
|
11
|
+
mode: 'cloud',
|
|
12
|
+
description: 'Send events server-side to Clevertap',
|
|
13
|
+
authentication: {
|
|
14
|
+
scheme: 'custom',
|
|
15
|
+
fields: {
|
|
16
|
+
clevertapAccountId: {
|
|
17
|
+
label: 'CleverTap Account ID',
|
|
18
|
+
description: 'Your CleverTap Account ID.',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
clevertapPasscode: {
|
|
23
|
+
label: 'CleverTap Account Passcode',
|
|
24
|
+
description: 'Your CleverTap Account Passcode.',
|
|
25
|
+
type: 'string',
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
clevertapEndpoint: {
|
|
29
|
+
label: 'REST Endpoint',
|
|
30
|
+
description: 'Your Clevertap REST endpoint. [See more details](https://docs.clevertap.com/docs)',
|
|
31
|
+
type: 'string',
|
|
32
|
+
format: 'uri',
|
|
33
|
+
choices: [
|
|
34
|
+
{ label: 'SK', value: 'https://sk1.api.clevertap.com' },
|
|
35
|
+
{ label: 'EU', value: 'https://eu1.api.clevertap.com' },
|
|
36
|
+
{ label: 'US', value: 'https://us1.api.clevertap.com' },
|
|
37
|
+
{ label: 'SG', value: 'https://sg1.api.clevertap.com' },
|
|
38
|
+
{ label: 'IN', value: 'https://in1.api.clevertap.com' }
|
|
39
|
+
],
|
|
40
|
+
default: 'https://sk1.api.clevertap.com',
|
|
41
|
+
required: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
actions: {
|
|
46
|
+
userUpload: userUpload_1.default,
|
|
47
|
+
userDelete: userDelete_1.default
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.default = destination;
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/clevertap/index.ts"],"names":[],"mappings":";;;;;AAGA,8DAAqC;AAErC,8DAAqC;AAErC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,sCAAsC;IACnD,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,kBAAkB,EAAE;gBAClB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,4BAA4B;gBACzC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,kCAAkC;gBAC/C,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,mFAAmF;gBAChG,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;iBACtD;gBACD,OAAO,EAAE,+BAA+B;gBACxC,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IAED,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userDelete/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const action = {
|
|
4
|
+
title: 'User Delete',
|
|
5
|
+
description: 'The User Delete Action enables you to remove user profiles in CleverTap.',
|
|
6
|
+
fields: {
|
|
7
|
+
identity: {
|
|
8
|
+
label: 'Identity',
|
|
9
|
+
type: 'string',
|
|
10
|
+
description: 'Identity',
|
|
11
|
+
default: { '@path': '$.userId' },
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
perform: (request, { settings, payload }) => {
|
|
16
|
+
const event = {
|
|
17
|
+
identity: payload.identity,
|
|
18
|
+
};
|
|
19
|
+
return request(`${settings.clevertapEndpoint}/1/delete/profiles.json`, {
|
|
20
|
+
method: 'post',
|
|
21
|
+
json: event,
|
|
22
|
+
headers: {
|
|
23
|
+
"X-CleverTap-Account-Id": `${settings.clevertapAccountId}`,
|
|
24
|
+
"X-CleverTap-Passcode": `${settings.clevertapPasscode}`
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.default = action;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userDelete/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE,EAAC,OAAO,EAAE,UAAU,EAAC;YAC9B,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,EAAE;QACxC,MAAM,KAAK,GAAgB;YACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAA;QACD,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,iBAAiB,yBAAyB,EAAE;YACrE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACP,wBAAwB,EAAE,GAAG,QAAQ,CAAC,kBAAkB,EAAE;gBAC1D,sBAAsB,EAAE,GAAG,QAAQ,CAAC,iBAAiB,EAAE;aACxD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userDelete/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userUpload/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const type = 'profile';
|
|
4
|
+
const source = 'Segment';
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'User Upload',
|
|
7
|
+
description: 'The User Upload Action enables you to create or update user profiles in CleverTap.',
|
|
8
|
+
fields: {
|
|
9
|
+
ts: {
|
|
10
|
+
label: 'Timestamp',
|
|
11
|
+
type: 'string',
|
|
12
|
+
description: 'The timestamp of the event. If time is not sent with the event, it will be set to the request upload time.',
|
|
13
|
+
default: { '@path': '$.timestamp' }
|
|
14
|
+
},
|
|
15
|
+
profileData: {
|
|
16
|
+
label: 'Profile Data',
|
|
17
|
+
type: 'object',
|
|
18
|
+
description: 'Profile Data',
|
|
19
|
+
default: { '@path': '$.properties' }
|
|
20
|
+
},
|
|
21
|
+
identity: {
|
|
22
|
+
label: 'Identity',
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'Identity',
|
|
25
|
+
default: { '@path': '$.userId' },
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
perform: (request, { settings, payload }) => {
|
|
30
|
+
const event = {
|
|
31
|
+
type: type,
|
|
32
|
+
source: source,
|
|
33
|
+
profileData: payload.profileData,
|
|
34
|
+
identity: payload.identity,
|
|
35
|
+
ts: payload.ts
|
|
36
|
+
};
|
|
37
|
+
return request(`${settings.clevertapEndpoint}/1/upload`, {
|
|
38
|
+
method: 'post',
|
|
39
|
+
json: {
|
|
40
|
+
"d": [event]
|
|
41
|
+
},
|
|
42
|
+
headers: {
|
|
43
|
+
"X-CleverTap-Account-Id": `${settings.clevertapAccountId}`,
|
|
44
|
+
"X-CleverTap-Passcode": `${settings.clevertapPasscode}`
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.default = action;
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userUpload/index.ts"],"names":[],"mappings":";;AAKA,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,oFAAoF;IACjG,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4GAA4G;YACzH,OAAO,EAAE,EAAC,OAAO,EAAE,aAAa,EAAC;SAClC;QACD,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,OAAO,EAAE,EAAC,OAAO,EAAE,cAAc,EAAC;SACnC;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE,EAAC,OAAO,EAAE,UAAU,EAAC;YAC9B,QAAQ,EAAE,IAAI;SACf;KACF;IAGD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,EAAE;QACxC,MAAM,KAAK,GAAmB;YAC5B,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,EAAE,EAAE,OAAO,CAAC,EAAE;SACf,CAAA;QAED,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,iBAAiB,WAAW,EAAE;YACvD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,GAAG,EAAE,CAAC,KAAK,CAAC;aACb;YACD,OAAO,EAAE;gBACP,wBAAwB,EAAE,GAAG,QAAQ,CAAC,kBAAkB,EAAE;gBAC1D,sBAAsB,EAAE,GAAG,QAAQ,CAAC,iBAAiB,EAAE;aACxD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userUpload/types.ts"],"names":[],"mappings":""}
|
|
@@ -21,14 +21,22 @@ var AccountRegion;
|
|
|
21
21
|
const isRecord = (value) => {
|
|
22
22
|
return isPlainObject_1.default(value);
|
|
23
23
|
};
|
|
24
|
+
const isIsoDate = (value) => {
|
|
25
|
+
const isoformat = '^\\d{4}-\\d{2}-\\d{2}' +
|
|
26
|
+
'((T\\d{2}:\\d{2}(:\\d{2})?)' +
|
|
27
|
+
'(\\.\\d{1,6})?' +
|
|
28
|
+
'(Z|(\\+|-)\\d{2}:\\d{2})?)?$';
|
|
29
|
+
const matcher = new RegExp(isoformat);
|
|
30
|
+
return typeof value === 'string' && matcher.test(value) && !isNaN(Date.parse(value));
|
|
31
|
+
};
|
|
24
32
|
const convertAttributeTimestamps = (payload) => {
|
|
25
33
|
const clone = {};
|
|
26
34
|
const keys = Object.keys(payload);
|
|
27
35
|
keys.forEach((key) => {
|
|
28
36
|
const value = payload[key];
|
|
29
37
|
if (typeof value === 'string') {
|
|
30
|
-
const maybeDate = dayjs_1.default
|
|
31
|
-
if (
|
|
38
|
+
const maybeDate = dayjs_1.default(value);
|
|
39
|
+
if (isIsoDate(value)) {
|
|
32
40
|
clone[key] = maybeDate.unix();
|
|
33
41
|
return;
|
|
34
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/customerio/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AACnC,yEAAgD;AAEzC,MAAM,gBAAgB,GAAG,CAAC,aAAsB,EAAE,EAAE;IACzD,IAAI,aAAa,KAAK,aAAa,CAAC,EAAE,EAAE;QACtC,OAAO,8BAA8B,CAAA;KACtC;IAED,OAAO,2BAA2B,CAAA;AACpC,CAAC,CAAA;AANY,QAAA,gBAAgB,oBAM5B;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,mDAAc,CAAA;IACd,mDAAc,CAAA;AAChB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE;IACpE,OAAO,uBAAa,CAAC,KAAK,CAAC,CAAA;AAC7B,CAAC,CAAA;AAGM,MAAM,0BAA0B,GAAG,CAAC,OAAgC,EAA2B,EAAE;IACtG,MAAM,KAAK,GAA4B,EAAE,CAAA;IACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAEjC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;QAE1B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/customerio/utils.ts"],"names":[],"mappings":";;;;;;AA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AAC,EAAE;gBACpB,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAA;gBAC7B,OAAM;aACP;SACF;QAED,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;YACnB,KAAK,CAAC,GAAG,CAAC,GAAG,kCAA0B,CAAC,KAAK,CAAC,CAAA;YAE9C,OAAM;SACP;QAED,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;IACpB,CAAC,CAAC,CAAA;IAEF,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AA3BY,QAAA,0BAA0B,8BA2BtC"}
|
|
@@ -12,7 +12,7 @@ exports.user_data_field = {
|
|
|
12
12
|
externalId: {
|
|
13
13
|
label: 'External ID',
|
|
14
14
|
description: 'Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs. You can send one or more external IDs for a given event.',
|
|
15
|
-
type: 'string'
|
|
15
|
+
type: 'string'
|
|
16
16
|
},
|
|
17
17
|
email: {
|
|
18
18
|
label: 'Email',
|
|
@@ -103,9 +103,9 @@ exports.user_data_field = {
|
|
|
103
103
|
default: {
|
|
104
104
|
externalId: {
|
|
105
105
|
'@if': {
|
|
106
|
-
exists: { '@path': '$.
|
|
107
|
-
then: { '@path': '$.
|
|
108
|
-
else: { '@path': '$.
|
|
106
|
+
exists: { '@path': '$.userId' },
|
|
107
|
+
then: { '@path': '$.userId' },
|
|
108
|
+
else: { '@path': '$.anonymousId' }
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
email: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fb-capi-user-data.js","sourceRoot":"","sources":["../../../src/destinations/facebook-conversions-api/fb-capi-user-data.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AACnC,2CAA2D;AAK9C,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,WAAW;IAClB,WAAW,
|
|
1
|
+
{"version":3,"file":"fb-capi-user-data.js","sourceRoot":"","sources":["../../../src/dest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AC,SAAS,EAAE,SAAS,CAAC;QACtC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC;QACjC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC;QAClC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;QAChC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC;QACzC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC;QAChD,iBAAiB,EAAE,OAAO,CAAC,SAAS,EAAE,iBAAiB;QACvD,iBAAiB,EAAE,OAAO,CAAC,SAAS,EAAE,iBAAiB;QACvD,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE,GAAG;QAC3B,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE,GAAG;QAC3B,eAAe,EAAE,OAAO,CAAC,SAAS,EAAE,cAAc;QAClD,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM;QAClC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS;KAC1C,CAAA;AACH,CAAC,CAAA;AAvBY,QAAA,cAAc,kBAuB1B"}
|
|
@@ -31,6 +31,7 @@ register('60f64ae3eaebd66d17d28e9f', './1plusx');
|
|
|
31
31
|
register('61806e472cd47ea1104885fc', './facebook-conversions-api');
|
|
32
32
|
register('5f7dd6d21ad74f3842b1fc47', './amplitude');
|
|
33
33
|
register('60f9d0d048950c356be2e4da', './braze');
|
|
34
|
+
register('61d7456b078e79929de4ee8c', './clevertap');
|
|
34
35
|
register('5f7dd78fe27ce7ff2b8bfa37', './customerio');
|
|
35
36
|
register('60ad61f9ff47a16b8fb7b5d9', './google-analytics-4');
|
|
36
37
|
register('60ae8b97dcb6cc52d5d0d5ab', './google-enhanced-conversions');
|
|
@@ -43,6 +44,7 @@ register('5f7dd8e302173ff732db5cc4', './slack');
|
|
|
43
44
|
register('615cae349d109d6b7496a131', './tiktok-conversions');
|
|
44
45
|
register('602efa1f249b9a5e2bf8a813', './twilio');
|
|
45
46
|
register('614a3c7d791c91c41bae7599', './webhook');
|
|
47
|
+
register('61dc4e96894a6d7954cc6e45', './voyage');
|
|
46
48
|
function register(id, destinationPath) {
|
|
47
49
|
const definition = require(destinationPath).default;
|
|
48
50
|
const resolvedPath = require.resolve(destinationPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/destinations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAAmD;AACnD,gDAAuB;AAWV,QAAA,YAAY,GAA0C,EAAE,CAAA;AACxD,QAAA,QAAQ,GAAsC,EAAE,CAAA;AAU7D,QAAQ,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAA;AAChD,QAAQ,CAAC,0BAA0B,EAAE,4BAA4B,CAAC,CAAA;AAClE,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAA;AACpD,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAA;AAC5D,QAAQ,CAAC,0BAA0B,EAAE,+BAA+B,CAAC,CAAA;AACrE,QAAQ,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAA;AAClD,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,+BAA+B,CAAC,CAAA;AACrE,QAAQ,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,CAAA;AACnE,QAAQ,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAA;AACnD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;AAC/C,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAA;AAC5D,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AAO,IAAI,CAAA;KACZ;IAED,OAAO,IAAI,0BAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;AAChD,CAAC;AARD,gDAQC;AAEM,KAAK,UAAU,uBAAuB,CAAC,WAAmB;IAC/D,OAAO,kBAAkB,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0DAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/voyage/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 trackOrderPlaced_1 = __importDefault(require("./trackOrderPlaced"));
|
|
8
|
+
const destination = {
|
|
9
|
+
name: 'Voyage',
|
|
10
|
+
slug: 'actions-voyage',
|
|
11
|
+
mode: 'cloud',
|
|
12
|
+
authentication: {
|
|
13
|
+
scheme: 'custom',
|
|
14
|
+
fields: {
|
|
15
|
+
apiKey: {
|
|
16
|
+
label: 'API Key',
|
|
17
|
+
description: 'Voyage API key. You can create a new API key or find your existing API key in the Advanced section of your [Settings page](https://app.voyagetext.com/dashboard/settings/advanced).',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
extendRequest: ({ settings }) => {
|
|
24
|
+
return {
|
|
25
|
+
headers: {
|
|
26
|
+
'x-api-key': settings.apiKey
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
presets: [
|
|
31
|
+
{
|
|
32
|
+
name: 'Track Order Placed Event',
|
|
33
|
+
subscribe: 'type = "track"',
|
|
34
|
+
partnerAction: 'trackOrderPlaced',
|
|
35
|
+
mapping: actions_core_1.defaultValues(trackOrderPlaced_1.default.fields)
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
actions: {
|
|
39
|
+
trackOrderPlaced: trackOrderPlaced_1.default
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.default = destination;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/voyage/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAqD;AACrD,0EAAiD;AAEjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EACT,qLAAqL;gBACvL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IAED,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,WAAW,EAAE,QAAQ,CAAC,MAAM;aAC7B;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP;YACE,IAAI,EAAE,0BAA0B;YAChC,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,kBAAkB;YACjC,OAAO,EAAE,4BAAa,CAAC,0BAAgB,CAAC,MAAM,CAAC;SAChD;KACF;IAED,OAAO,EAAE;QACP,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
DateCreated: string | number;
|
|
3
|
+
OrderNumber?: string;
|
|
4
|
+
SourceId?: string;
|
|
5
|
+
TokenId?: string;
|
|
6
|
+
CustomerId: string;
|
|
7
|
+
Url: string;
|
|
8
|
+
OrderTotal: number;
|
|
9
|
+
TotalSpent: number;
|
|
10
|
+
FirstName?: string;
|
|
11
|
+
lastName?: string;
|
|
12
|
+
Phone: string;
|
|
13
|
+
Email?: string;
|
|
14
|
+
Zip: string;
|
|
15
|
+
LastUpdated?: string | number;
|
|
16
|
+
ProductImageUrl?: string;
|
|
17
|
+
LinkReference?: string;
|
|
18
|
+
HomepageUrl?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/voyage/trackOrderPlaced/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Track Order Placed',
|
|
6
|
+
description: 'Track when an order is placed.',
|
|
7
|
+
defaultSubscription: 'type = "track"',
|
|
8
|
+
fields: {
|
|
9
|
+
DateCreated: {
|
|
10
|
+
label: 'Timestamp',
|
|
11
|
+
description: 'Date of cart creation. Default to current date and time.',
|
|
12
|
+
type: 'datetime',
|
|
13
|
+
required: true,
|
|
14
|
+
default: {
|
|
15
|
+
'@path': '$.timestamp'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
OrderNumber: {
|
|
19
|
+
label: 'Order Number',
|
|
20
|
+
description: 'Order number from e-commerce platform.',
|
|
21
|
+
type: 'string',
|
|
22
|
+
default: {
|
|
23
|
+
'@path': '$.properties.OrderNumber'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
SourceId: {
|
|
27
|
+
label: 'Order ID',
|
|
28
|
+
description: 'Order id from e-commerce platform (same as checkout id).',
|
|
29
|
+
type: 'string',
|
|
30
|
+
default: {
|
|
31
|
+
'@path': '$.properties.SourceId'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
TokenId: {
|
|
35
|
+
label: 'Token ID',
|
|
36
|
+
description: 'A reference to the order that is a string value.',
|
|
37
|
+
type: 'string',
|
|
38
|
+
default: {
|
|
39
|
+
'@path': '$.properties.TokenId'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
CustomerId: {
|
|
43
|
+
label: 'Customer ID',
|
|
44
|
+
description: 'Customer ID from e-commerce platform.',
|
|
45
|
+
type: 'string',
|
|
46
|
+
required: true,
|
|
47
|
+
default: {
|
|
48
|
+
'@path': '$.properties.CustomerId'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
Url: {
|
|
52
|
+
label: 'Order URL',
|
|
53
|
+
description: 'Link for user to click on to see status.',
|
|
54
|
+
type: 'string',
|
|
55
|
+
format: 'uri',
|
|
56
|
+
required: true,
|
|
57
|
+
default: {
|
|
58
|
+
'@path': '$.properties.Url'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
OrderTotal: {
|
|
62
|
+
label: 'Order Total',
|
|
63
|
+
description: 'Total Order Value.',
|
|
64
|
+
type: 'number',
|
|
65
|
+
required: true,
|
|
66
|
+
default: {
|
|
67
|
+
'@path': '$.properties.OrderTotal'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
TotalSpent: {
|
|
71
|
+
label: 'Total Spent',
|
|
72
|
+
description: 'Total customer lifetime spend.',
|
|
73
|
+
type: 'number',
|
|
74
|
+
required: true,
|
|
75
|
+
default: {
|
|
76
|
+
'@path': '$.properties.TotalSpent'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
FirstName: {
|
|
80
|
+
label: 'First name',
|
|
81
|
+
description: "Customer's first name.",
|
|
82
|
+
type: 'string',
|
|
83
|
+
default: {
|
|
84
|
+
'@path': '$.properties.FirstName'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
lastName: {
|
|
88
|
+
label: 'Last name',
|
|
89
|
+
description: "Customer's last name.",
|
|
90
|
+
type: 'string',
|
|
91
|
+
default: {
|
|
92
|
+
'@path': '$.properties.lastName'
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
Phone: {
|
|
96
|
+
label: 'Phone number',
|
|
97
|
+
description: "Customer's phone number.",
|
|
98
|
+
type: 'string',
|
|
99
|
+
required: true,
|
|
100
|
+
default: {
|
|
101
|
+
'@path': '$.properties.Phone'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
Email: {
|
|
105
|
+
label: 'Email',
|
|
106
|
+
description: "Customer's email address",
|
|
107
|
+
type: 'string',
|
|
108
|
+
format: 'email',
|
|
109
|
+
default: {
|
|
110
|
+
'@path': '$.properties.Email'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
Zip: {
|
|
114
|
+
label: 'Zip code',
|
|
115
|
+
description: "Customer's postal code",
|
|
116
|
+
type: 'string',
|
|
117
|
+
required: true,
|
|
118
|
+
default: {
|
|
119
|
+
'@path': '$.properties.Zip'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
LastUpdated: {
|
|
123
|
+
label: 'Last Updated',
|
|
124
|
+
description: 'The date and time when the updates interacted with.',
|
|
125
|
+
type: 'datetime',
|
|
126
|
+
default: {
|
|
127
|
+
'@path': '$.timestamp'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
ProductImageUrl: {
|
|
131
|
+
label: 'Product Image URL',
|
|
132
|
+
description: 'URL with product image.',
|
|
133
|
+
type: 'string',
|
|
134
|
+
format: 'uri',
|
|
135
|
+
default: {
|
|
136
|
+
'@path': '$.properties.ProductImageUrl'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
LinkReference: {
|
|
140
|
+
label: 'Link reference',
|
|
141
|
+
description: 'Used as a key to link events together.',
|
|
142
|
+
type: 'string',
|
|
143
|
+
default: {
|
|
144
|
+
'@path': '$.properties.LinkReference'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
HomepageUrl: {
|
|
148
|
+
label: 'Homepage URL',
|
|
149
|
+
description: "URL of the tenant's e-commerce homepage.",
|
|
150
|
+
type: 'string',
|
|
151
|
+
format: 'uri',
|
|
152
|
+
default: {
|
|
153
|
+
'@path': '$.properties.HomepageUrl'
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
perform: (request, { payload }) => {
|
|
158
|
+
const body = {
|
|
159
|
+
eventTypeId: utils_1.EventTypeId,
|
|
160
|
+
phone: payload.Phone,
|
|
161
|
+
eventMeta: payload
|
|
162
|
+
};
|
|
163
|
+
return request(utils_1.EventEndpoint, { method: 'POST', json: body });
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
exports.default = action;
|
|
167
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/voyage/trackOrderPlaced/index.ts"],"names":[],"mappings":";;AAIA,oCAAqD;AAGrD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,gBAAgB;IAErC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,0BAA0B;aACpC;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,OAAO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AAA;QACD,OAAO,OAAO,CAAC,qBAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/D,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const BaseApiUrl = "https://api.voyagetext.com/api/v1";
|
|
2
|
+
export declare const EventApiUri = "/customEvent";
|
|
3
|
+
export declare const EventEndpoint: string;
|
|
4
|
+
export declare const EventTypeId = 7310;
|
|
5
|
+
declare type EventBody<EventMeta> = {
|
|
6
|
+
eventTypeId: number;
|
|
7
|
+
phone: string;
|
|
8
|
+
subscriberId?: string;
|
|
9
|
+
eventMeta: EventMeta;
|
|
10
|
+
};
|
|
11
|
+
declare type OrderPlacedPayload = {
|
|
12
|
+
DateCreated: string | number;
|
|
13
|
+
OrderNumber?: string;
|
|
14
|
+
SourceId?: string;
|
|
15
|
+
TokenId?: string;
|
|
16
|
+
CustomerId: string;
|
|
17
|
+
Url: string;
|
|
18
|
+
OrderTotal: number;
|
|
19
|
+
TotalSpent: number;
|
|
20
|
+
FirstName?: string;
|
|
21
|
+
LastName?: string;
|
|
22
|
+
Phone: string;
|
|
23
|
+
Email?: string;
|
|
24
|
+
Zip: string;
|
|
25
|
+
LastUpdated?: string | number;
|
|
26
|
+
ProductImageUrl?: string;
|
|
27
|
+
LinkReference?: string;
|
|
28
|
+
HomepageUrl?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type OrderPlacedBody = EventBody<OrderPlacedPayload>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventTypeId = exports.EventEndpoint = exports.EventApiUri = exports.BaseApiUrl = void 0;
|
|
4
|
+
exports.BaseApiUrl = 'https://api.voyagetext.com/api/v1';
|
|
5
|
+
exports.EventApiUri = '/customEvent';
|
|
6
|
+
exports.EventEndpoint = exports.BaseApiUrl + exports.EventApiUri;
|
|
7
|
+
exports.EventTypeId = 7310;
|
|
8
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/voyage/utils.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,mCAAmC,CAAA;AAEhD,QAAA,WAAW,GAAG,cAAc,CAAA;AAE5B,QAAA,aAAa,GAAG,kBAAU,GAAG,mBAAW,CAAA;AAExC,QAAA,WAAW,GAAG,IAAI,CAAA"}
|
|
@@ -11,7 +11,7 @@ const timestamp = new Date().toISOString();
|
|
|
11
11
|
describe('Webhook', () => {
|
|
12
12
|
describe('send', () => {
|
|
13
13
|
it('should work with default mapping', async () => {
|
|
14
|
-
const url = 'https://
|
|
14
|
+
const url = 'https://example.com';
|
|
15
15
|
const event = actions_core_1.createTestEvent({
|
|
16
16
|
timestamp,
|
|
17
17
|
event: 'Test Event'
|
|
@@ -30,7 +30,7 @@ describe('Webhook', () => {
|
|
|
30
30
|
expect(responses[0].status).toBe(200);
|
|
31
31
|
});
|
|
32
32
|
it('supports customizations', async () => {
|
|
33
|
-
const url = 'https://
|
|
33
|
+
const url = 'https://example.build';
|
|
34
34
|
const event = actions_core_1.createTestEvent({
|
|
35
35
|
timestamp,
|
|
36
36
|
event: 'Test Event'
|
|
@@ -49,7 +49,7 @@ describe('Webhook', () => {
|
|
|
49
49
|
expect(responses[0].status).toBe(200);
|
|
50
50
|
});
|
|
51
51
|
it('supports customizations', async () => {
|
|
52
|
-
const url = 'https://
|
|
52
|
+
const url = 'https://example.build';
|
|
53
53
|
const event = actions_core_1.createTestEvent({
|
|
54
54
|
timestamp,
|
|
55
55
|
event: 'Test Event'
|
|
@@ -67,32 +67,6 @@ describe('Webhook', () => {
|
|
|
67
67
|
expect(responses.length).toBe(1);
|
|
68
68
|
expect(responses[0].status).toBe(200);
|
|
69
69
|
});
|
|
70
|
-
it('restricts usage to mme-e2e urls', async () => {
|
|
71
|
-
const url = 'https://api.acme.com/webhook';
|
|
72
|
-
const event = actions_core_1.createTestEvent({
|
|
73
|
-
timestamp,
|
|
74
|
-
event: 'Test Event'
|
|
75
|
-
});
|
|
76
|
-
const data = { cool: true };
|
|
77
|
-
nock_1.default(url).put('/', data).reply(200);
|
|
78
|
-
try {
|
|
79
|
-
await testDestination.testAction('send', {
|
|
80
|
-
event,
|
|
81
|
-
mapping: {
|
|
82
|
-
url,
|
|
83
|
-
method: 'PUT',
|
|
84
|
-
data: { cool: true }
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
fail('expected testAction to reject');
|
|
88
|
-
}
|
|
89
|
-
catch (err) {
|
|
90
|
-
const error = err;
|
|
91
|
-
expect(error.status).toBe(400);
|
|
92
|
-
expect(error.code).toBe('Bad Request');
|
|
93
|
-
expect(error.message).toBe("invalid url 'https://api.acme.com/webhook'");
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
70
|
});
|
|
97
71
|
});
|
|
98
72
|
//# sourceMappingURL=webhook.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.test.js","sourceRoot":"","sources":["../../../../src/destinations/webhook/__test__/webhook.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"webhook.test.js","sourceRoot":"","sources":["../../../../src/destinations/webhook/__test__/webhook.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,wDAA8E;AAC9E,qDAA8B;AAE9B,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAO,CAAC,CAAA;AACtD,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;AAE1C,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAA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AC,CAAC,CAAA;YAChC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;YACvC,MAAM,GAAG,GAAG,uBAAuB,CAAA;YACnC,MAAM,KAAK,GAAG,8BAAe,CAAC;gBAC5B,SAAS;gBACT,KAAK,EAAE,YAAY;aACpB,CAAC,CAAA;YACF,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;YAE3B,cAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAEnC,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE;gBACzD,KAAK;gBACL,OAAO,EAAE;oBACP,GAAG;oBACH,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;iBACrB;aACF,CAAC,CAAA;YAEF,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAChC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const MME_E2E_URLS = [
|
|
5
|
-
'https://mme-e2e.segment.com',
|
|
6
|
-
'https://mme-e2e.segment.build'
|
|
7
|
-
];
|
|
8
3
|
const action = {
|
|
9
4
|
title: 'Send',
|
|
10
5
|
description: 'Send an HTTP request.',
|
|
@@ -38,9 +33,6 @@ const action = {
|
|
|
38
33
|
}
|
|
39
34
|
},
|
|
40
35
|
perform: (request, { payload }) => {
|
|
41
|
-
if (!MME_E2E_URLS.includes(payload.url)) {
|
|
42
|
-
throw new actions_core_1.IntegrationError(`invalid url '${payload.url}'`, 'Bad Request', 400);
|
|
43
|
-
}
|
|
44
36
|
return request(payload.url, {
|
|
45
37
|
method: payload.method,
|
|
46
38
|
json: payload.data
|
|
@@ -48,9 +40,6 @@ const action = {
|
|
|
48
40
|
},
|
|
49
41
|
performBatch: (request, { payload }) => {
|
|
50
42
|
const { url, method } = payload[0];
|
|
51
|
-
if (!MME_E2E_URLS.includes(url)) {
|
|
52
|
-
throw new actions_core_1.IntegrationError(`invalid url '${url}'`, 'Bad Request', 400);
|
|
53
|
-
}
|
|
54
43
|
return request(url, {
|
|
55
44
|
method: method,
|
|
56
45
|
json: payload.map(({ data }) => data)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/webhook/send/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/webhook/send/index.ts"],"names":[],"mappings":";;AAMA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,uBAAuB;IACpC,MAAM,EAAE;QACN,GAAG,EAAE;YACH,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,KAAK;SACd;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;gBAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;gBAClC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACpC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;aAC/B;YACD,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SAC3B;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAuB;YACvC,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAA;IACJ,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAErC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;QAElC,OAAO,OAAO,CAAC,GAAG,EAAE;YAClB,MAAM,EAAE,MAAuB;YAC/B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;SACtC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,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.
|
|
4
|
+
"version": "3.40.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -59,6 +59,5 @@
|
|
|
59
59
|
"setupFilesAfterEnv": [
|
|
60
60
|
"<rootDir>/test/setup-after-env.ts"
|
|
61
61
|
]
|
|
62
|
-
}
|
|
63
|
-
"gitHead": "86682cf9abdca8c612c81d53bef137dba736b559"
|
|
62
|
+
}
|
|
64
63
|
}
|