@segment/action-destinations 3.45.0 → 3.46.1-alpha.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/friendbuy/cloudUtil.d.ts +4 -4
- package/dist/destinations/friendbuy/cloudUtil.js +31 -15
- package/dist/destinations/friendbuy/cloudUtil.js.map +1 -1
- package/dist/destinations/friendbuy/index.js +2 -2
- package/dist/destinations/friendbuy/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.d.ts +1 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.js +8 -5
- package/dist/destinations/friendbuy/trackCustomEvent/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackCustomer/index.js +4 -3
- package/dist/destinations/friendbuy/trackCustomer/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackPurchase/generated-types.d.ts +2 -0
- package/dist/destinations/friendbuy/trackPurchase/index.js +29 -29
- package/dist/destinations/friendbuy/trackPurchase/index.js.map +1 -1
- package/dist/destinations/friendbuy/trackSignUp/generated-types.d.ts +3 -0
- package/dist/destinations/friendbuy/trackSignUp/index.js +7 -3
- package/dist/destinations/friendbuy/trackSignUp/index.js.map +1 -1
- package/dist/destinations/gainsight-px-cloud-action/common-fields.d.ts +2 -0
- package/dist/destinations/gainsight-px-cloud-action/common-fields.js +277 -0
- package/dist/destinations/gainsight-px-cloud-action/common-fields.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/generated-types.d.ts +4 -0
- package/dist/destinations/gainsight-px-cloud-action/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.d.ts +60 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.js +38 -0
- package/dist/destinations/gainsight-px-cloud-action/groupIdentify/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/generated-types.d.ts +59 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.js +29 -0
- package/dist/destinations/gainsight-px-cloud-action/identifyUser/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/index.d.ts +4 -0
- package/dist/destinations/gainsight-px-cloud-action/index.js +100 -0
- package/dist/destinations/gainsight-px-cloud-action/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.d.ts +12 -0
- package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.js +19 -0
- package/dist/destinations/gainsight-px-cloud-action/regional-endpoints.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/generated-types.d.ts +60 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.js +37 -0
- package/dist/destinations/gainsight-px-cloud-action/trackEvent/index.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/generated-types.d.ts +63 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/generated-types.js +3 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/generated-types.js.map +1 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.d.ts +5 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.js +60 -0
- package/dist/destinations/gainsight-px-cloud-action/trackPageView/index.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js +6 -3
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js +7 -2
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/salesforce/lead/index.js +81 -18
- package/dist/destinations/salesforce/lead/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-properties.js +7 -3
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/package.json +4 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSONObject, RequestClient, RequestOptions } from '@segment/actions-core';
|
|
2
2
|
import { Settings } from './generated-types';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function getAuthToken(request: RequestClient,
|
|
3
|
+
export declare const defaultMapiBaseUrl = "https://mapi.fbot.me";
|
|
4
|
+
export declare function getMapiBaseUrl(authSecret: string): string[];
|
|
5
|
+
export declare function createMapiRequest(path: string, request: RequestClient, settings: Settings, friendbuyPayload: JSONObject): Promise<[string, RequestOptions]>;
|
|
6
|
+
export declare function getAuthToken(request: RequestClient, mapiBaseUrl: string, authKey: string, authSecret: string): Promise<string>;
|
|
@@ -1,29 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAuthToken = exports.
|
|
4
|
-
exports.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
exports.getAuthToken = exports.createMapiRequest = exports.getMapiBaseUrl = exports.defaultMapiBaseUrl = void 0;
|
|
4
|
+
exports.defaultMapiBaseUrl = `https://mapi.fbot.me`;
|
|
5
|
+
function getMapiBaseUrl(authSecret) {
|
|
6
|
+
const colonPos = authSecret.indexOf(':');
|
|
7
|
+
if (colonPos <= 0) {
|
|
8
|
+
return [authSecret, exports.defaultMapiBaseUrl];
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
const realAuthSecret = authSecret.substring(colonPos + 1);
|
|
12
|
+
const environment = authSecret.substring(0, colonPos);
|
|
13
|
+
const mapiBaseUrl = `https://mapi.fbot-${environment}.me`;
|
|
14
|
+
return [realAuthSecret, mapiBaseUrl];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.getMapiBaseUrl = getMapiBaseUrl;
|
|
18
|
+
async function createMapiRequest(path, request, settings, friendbuyPayload) {
|
|
19
|
+
const [authSecret, mapiBaseUrl] = getMapiBaseUrl(settings.authSecret);
|
|
20
|
+
const authToken = await getAuthToken(request, mapiBaseUrl, settings.authKey, authSecret);
|
|
21
|
+
return [
|
|
22
|
+
`${mapiBaseUrl}/${path}`,
|
|
23
|
+
{
|
|
24
|
+
method: 'POST',
|
|
25
|
+
json: friendbuyPayload,
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: authToken
|
|
28
|
+
}
|
|
13
29
|
}
|
|
14
|
-
|
|
30
|
+
];
|
|
15
31
|
}
|
|
16
|
-
exports.
|
|
32
|
+
exports.createMapiRequest = createMapiRequest;
|
|
17
33
|
const AUTH_PADDING_MS = 10000;
|
|
18
34
|
let friendbuyAuth;
|
|
19
|
-
async function getAuthToken(request,
|
|
35
|
+
async function getAuthToken(request, mapiBaseUrl, authKey, authSecret) {
|
|
20
36
|
if (!friendbuyAuth || Date.now() >= friendbuyAuth.expiresEpoch) {
|
|
21
|
-
const r = await request(`${
|
|
37
|
+
const r = await request(`${mapiBaseUrl}/v1/authorization`, {
|
|
22
38
|
method: 'POST',
|
|
23
39
|
headers: {
|
|
24
40
|
'Content-Type': 'application/json'
|
|
25
41
|
},
|
|
26
|
-
json: { key:
|
|
42
|
+
json: { key: authKey, secret: authSecret }
|
|
27
43
|
});
|
|
28
44
|
if (r.data) {
|
|
29
45
|
const data = r.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudUtil.js","sourceRoot":"","sources":["../../../src/destinations/friendbuy/cloudUtil.ts"],"names":[],"mappings":";;;AAIa,QAAA,
|
|
1
|
+
{"version":3,"file":"cloudUtil.js","sourceRoot":"","sources":["../../../src/destinations/friendbuy/cloudUtil.ts"],"names":[],"mappings":";;;AAIa,QAAA,kBAAkB,GAAG,sBAAsB,CAAA;AAExD,SAAgB,cAAc,CAAC,UAAkB;IAC/C,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACxC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACjB,OAAO,CAAC,UAAU,EAAE,0BAAkB,CAAC,CAAA;KACxC;SAAM;QACL,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAA;QACzD,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,WAAW,GAAG,qBAAqB,WAAW,KAAK,CAAA;QACzD,OAAO,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;KACrC;AACH,CAAC;AAVD,wCAUC;AAEM,KAAK,UAAU,iBAAiB,CACrC,IAAY,EACZ,OAAsB,EACtB,QAAkB,EAClB,gBAA4B;IAE5B,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IACrE,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAExF,OAAO;QACL,GAAG,WAAW,IAAI,IAAI,EAAE;QACxB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS;aACzB;SACF;KACF,CAAA;AACH,CAAC;AAnBD,8CAmBC;AAED,MAAM,eAAe,GAAG,KAAK,CAAA;AAO7B,IAAI,aAA4B,CAAA;AAEzB,KAAK,UAAU,YAAY,CAAC,OAAsB,EAAE,WAAmB,EAAE,OAAe,EAAE,UAAkB;IAEjH,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;QAC9D,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,WAAW,mBAAmB,EAAE;YACzD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE;SAC3C,CAAC,CAAA;QAEF,IAAI,CAAC,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,GAAG,CAAC,CAAC,IAA0C,CAAA;YACzD,aAAa,GAAG;gBACd,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,eAAe;aACzD,CAAA;SACF;KACF;IAED,OAAO,aAAa,CAAC,KAAK,CAAA;AAC5B,CAAC;AArBD,oCAqBC"}
|
|
@@ -30,7 +30,7 @@ const destination = {
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
testAuthentication: (request, { settings }) => {
|
|
33
|
-
return request(`${cloudUtil_1.
|
|
33
|
+
return request(`${cloudUtil_1.defaultMapiBaseUrl}/v1/authorization`, {
|
|
34
34
|
method: 'POST',
|
|
35
35
|
json: { key: settings.authKey, secret: settings.authSecret }
|
|
36
36
|
});
|
|
@@ -39,7 +39,7 @@ const destination = {
|
|
|
39
39
|
onDelete: async (request, { payload }) => {
|
|
40
40
|
return !payload.userId
|
|
41
41
|
? true
|
|
42
|
-
: request(`${cloudUtil_1.
|
|
42
|
+
: request(`${cloudUtil_1.defaultMapiBaseUrl}/v1/user-data`, {
|
|
43
43
|
method: 'DELETE',
|
|
44
44
|
searchParams: {
|
|
45
45
|
customerId: payload.userId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/friendbuy/index.ts"],"names":[],"mappings":";;;;;AAGA,oEAA2C;AAC3C,oEAA2C;AAC3C,gEAAuC;AACvC,0EAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/friendbuy/index.ts"],"names":[],"mappings":";;;;;AAGA,oEAA2C;AAC3C,oEAA2C;AAC3C,gEAAuC;AACvC,0EAAiD;AACjD,2CAAgD;AAEhD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,wFAAwF;gBACrG,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,IAAI;aACf;YAGD,UAAU,EAAE;gBACV,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,yBAAyB;gBACtC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAE5C,OAAO,OAAO,CAAC,GAAG,8BAAkB,mBAAmB,EAAE;gBACvD,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE;aAC7D,CAAC,CAAA;QACJ,CAAC;KACF;IAED,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAIvC,OAAO,CAAC,OAAO,CAAC,MAAM;YACpB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,OAAO,CAAC,GAAG,8BAAkB,eAAe,EAAE;gBAC5C,MAAM,EAAE,QAAQ;gBAChB,YAAY,EAAE;oBACZ,UAAU,EAAE,OAAO,CAAC,MAAM;iBAC3B;aACF,CAAC,CAAA;IACR,CAAC;IAED,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,aAAa,EAAb,uBAAa;QACb,WAAW,EAAX,qBAAW;QACX,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -5,6 +5,7 @@ const actions_shared_1 = require("@segment/actions-shared");
|
|
|
5
5
|
const actions_shared_2 = require("@segment/actions-shared");
|
|
6
6
|
const actions_shared_3 = require("@segment/actions-shared");
|
|
7
7
|
const actions_shared_4 = require("@segment/actions-shared");
|
|
8
|
+
const cloudTrackCustomEventFields = { ...actions_shared_3.trackCustomEventFields({ requireEmail: true }), ...actions_shared_1.contextFields };
|
|
8
9
|
const trackCustomEventMapi = {
|
|
9
10
|
fields: {
|
|
10
11
|
eventType: actions_shared_2.COPY,
|
|
@@ -17,19 +18,21 @@ const trackCustomEventMapi = {
|
|
|
17
18
|
lastName: actions_shared_2.COPY,
|
|
18
19
|
isNewCustomer: actions_shared_2.COPY,
|
|
19
20
|
ipAddress: actions_shared_2.COPY,
|
|
20
|
-
userAgent: actions_shared_2.COPY
|
|
21
|
+
userAgent: actions_shared_2.COPY,
|
|
22
|
+
pageUrl: actions_shared_2.DROP,
|
|
23
|
+
pageTitle: actions_shared_2.DROP
|
|
21
24
|
},
|
|
22
25
|
unmappedFieldObject: 'additionalProperties'
|
|
23
26
|
};
|
|
24
27
|
const action = {
|
|
25
28
|
title: 'Track Custom Event',
|
|
26
|
-
description: 'Record when a customer completes any custom event.',
|
|
27
|
-
fields:
|
|
29
|
+
description: 'Record when a customer completes any custom event that you define.',
|
|
30
|
+
fields: cloudTrackCustomEventFields,
|
|
28
31
|
perform: async (request, { settings, payload }) => {
|
|
29
32
|
const payload1 = actions_shared_4.moveEventPropertiesToRoot(payload);
|
|
30
33
|
const friendbuyPayload = actions_shared_2.mapEvent(trackCustomEventMapi, payload1);
|
|
31
|
-
const requestParams = await cloudUtil_1.
|
|
32
|
-
return request(
|
|
34
|
+
const [requestUrl, requestParams] = await cloudUtil_1.createMapiRequest('v1/event/custom', request, settings, friendbuyPayload);
|
|
35
|
+
return request(requestUrl, requestParams);
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
38
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackCustomEvent/index.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackCustomEvent/index.ts"],"names":[],"mappings":";;AAKA,4CAAgD;AAChD,4DAAuD;AACvD,4DAAgF;AAChF,4DAAgE;AAChE,4DAAmE;AAEnE,MAAM,2BAA2B,GAAG,EAAE,GAAG,uCAAsB,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,8BAAa,EAAE,CAAA;AAE3G,MAAM,oBAAoB,GAAa;IACrC,MAAM,EAAE;QACN,SAAS,EAAE,qBAAI;QACf,eAAe,EAAE,qBAAI;QACrB,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;QAC9B,aAAa,EAAE,qBAAI;QACnB,YAAY,EAAE,qBAAI;QAIlB,KAAK,EAAE,qBAAI;QACX,SAAS,EAAE,qBAAI;QACf,QAAQ,EAAE,qBAAI;QACd,aAAa,EAAE,qBAAI;QAGnB,SAAS,EAAE,qBAAI;QACf,SAAS,EAAE,qBAAI;QACf,OAAO,EAAE,qBAAI;QACb,SAAS,EAAE,qBAAI;KAChB;IACD,mBAAmB,EAAE,sBAAsB;CAC5C,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,oEAAoE;IACjF,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG,0CAAyB,CAAC,OAAsC,CAAC,CAAA;QAClF,MAAM,gBAAgB,GAAG,yBAAQ,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAA;QACjE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,6BAAiB,CAAC,iBAAiB,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAA;QACnH,OAAO,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -5,6 +5,7 @@ const actions_shared_1 = require("@segment/actions-shared");
|
|
|
5
5
|
const actions_shared_2 = require("@segment/actions-shared");
|
|
6
6
|
const actions_shared_3 = require("@segment/actions-shared");
|
|
7
7
|
const actions_shared_4 = require("@segment/actions-shared");
|
|
8
|
+
const cloudTrackCustomerFields = { ...actions_shared_3.trackCustomerFields, ...actions_shared_1.contextFields };
|
|
8
9
|
const trackCustomerMapi = {
|
|
9
10
|
fields: {
|
|
10
11
|
customerId: actions_shared_2.COPY,
|
|
@@ -33,11 +34,11 @@ const trackCustomerMapi = {
|
|
|
33
34
|
const action = {
|
|
34
35
|
title: 'Track Customer',
|
|
35
36
|
description: 'Create a new customer profile or update an existing customer profile.',
|
|
36
|
-
fields:
|
|
37
|
+
fields: cloudTrackCustomerFields,
|
|
37
38
|
perform: async (request, { settings, payload }) => {
|
|
38
39
|
const friendbuyPayload = actions_shared_2.mapEvent(trackCustomerMapi, payload);
|
|
39
|
-
const requestParams = await cloudUtil_1.
|
|
40
|
-
return request(
|
|
40
|
+
const [requestUrl, requestParams] = await cloudUtil_1.createMapiRequest('v1/customer', request, settings, friendbuyPayload);
|
|
41
|
+
return request(requestUrl, requestParams);
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackCustomer/index.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackCustomer/index.ts"],"names":[],"mappings":";;AAKA,4CAAgD;AAChD,4DAAuD;AACvD,4DAA8D;AAC9D,4DAA6D;AAC7D,4DAAmD;AAEnD,MAAM,wBAAwB,GAAG,EAAE,GAAG,oCAAmB,EAAE,GAAG,8BAAa,EAAE,CAAA;AAE7E,MAAM,iBAAiB,GAAa;IAClC,MAAM,EAAE;QACN,UAAU,EAAE,qBAAI;QAEhB,KAAK,EAAE,qBAAI;QACX,aAAa,EAAE,qBAAI;QACnB,aAAa,EAAE,qBAAI;QACnB,QAAQ,EAAE,qBAAI;QACd,SAAS,EAAE,qBAAI;QACf,QAAQ,EAAE,qBAAI;QAEd,MAAM,EAAE,qBAAI;QACZ,GAAG,EAAE,qBAAI;QACT,QAAQ,EAAE,EAAE,OAAO,EAAE,0BAAuB,EAAE;QAC9C,QAAQ,EAAE,qBAAI;QACd,QAAQ,EAAE,qBAAI;QACd,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACnC,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QAC/B,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QAC7B,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAGtC,SAAS,EAAE,qBAAI;QACf,SAAS,EAAE,qBAAI;QACf,OAAO,EAAE,qBAAI;QACb,SAAS,EAAE,qBAAI;KAChB;IACD,mBAAmB,EAAE,sBAAsB;CAC5C,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,uEAAuE;IACpF,MAAM,EAAE,wBAAwB;IAEhC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,gBAAgB,GAAG,yBAAQ,CAAC,iBAAiB,EAAE,OAAsC,CAAC,CAAA;QAC5F,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,6BAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAA;QAC/G,OAAO,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,52 +4,52 @@ const cloudUtil_1 = require("../cloudUtil");
|
|
|
4
4
|
const actions_shared_1 = require("@segment/actions-shared");
|
|
5
5
|
const actions_shared_2 = require("@segment/actions-shared");
|
|
6
6
|
const actions_shared_3 = require("@segment/actions-shared");
|
|
7
|
-
const
|
|
7
|
+
const cloudTrackPurchaseFields = { ...actions_shared_3.trackPurchaseFields({}), ...actions_shared_1.contextFields };
|
|
8
8
|
const trackPurchaseMapi = {
|
|
9
9
|
fields: {
|
|
10
|
-
orderId:
|
|
11
|
-
amount:
|
|
12
|
-
currency:
|
|
10
|
+
orderId: actions_shared_2.COPY,
|
|
11
|
+
amount: actions_shared_2.COPY,
|
|
12
|
+
currency: actions_shared_2.COPY,
|
|
13
13
|
coupon: { name: 'couponCode' },
|
|
14
|
-
attributionId:
|
|
15
|
-
referralCode:
|
|
16
|
-
giftCardCodes:
|
|
14
|
+
attributionId: actions_shared_2.COPY,
|
|
15
|
+
referralCode: actions_shared_2.COPY,
|
|
16
|
+
giftCardCodes: actions_shared_2.COPY,
|
|
17
17
|
products: {
|
|
18
18
|
type: 'array',
|
|
19
19
|
defaultObject: { sku: 'unknown', name: 'unknown', quantity: 1 },
|
|
20
20
|
fields: {
|
|
21
|
-
sku:
|
|
22
|
-
name:
|
|
23
|
-
quantity:
|
|
24
|
-
price:
|
|
25
|
-
description:
|
|
26
|
-
category:
|
|
27
|
-
url:
|
|
21
|
+
sku: actions_shared_2.COPY,
|
|
22
|
+
name: actions_shared_2.COPY,
|
|
23
|
+
quantity: actions_shared_2.COPY,
|
|
24
|
+
price: actions_shared_2.COPY,
|
|
25
|
+
description: actions_shared_2.COPY,
|
|
26
|
+
category: actions_shared_2.COPY,
|
|
27
|
+
url: actions_shared_2.COPY,
|
|
28
28
|
image_url: { name: 'imageUrl' }
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
customerId:
|
|
32
|
-
email:
|
|
33
|
-
firstName:
|
|
34
|
-
lastName:
|
|
35
|
-
isNewCustomer:
|
|
36
|
-
age:
|
|
37
|
-
birthday:
|
|
38
|
-
ipAddress:
|
|
39
|
-
userAgent:
|
|
40
|
-
pageUrl:
|
|
41
|
-
pageTitle:
|
|
31
|
+
customerId: actions_shared_2.COPY,
|
|
32
|
+
email: actions_shared_2.COPY,
|
|
33
|
+
firstName: actions_shared_2.COPY,
|
|
34
|
+
lastName: actions_shared_2.COPY,
|
|
35
|
+
isNewCustomer: actions_shared_2.COPY,
|
|
36
|
+
age: actions_shared_2.DROP,
|
|
37
|
+
birthday: actions_shared_2.DROP,
|
|
38
|
+
ipAddress: actions_shared_2.COPY,
|
|
39
|
+
userAgent: actions_shared_2.COPY,
|
|
40
|
+
pageUrl: actions_shared_2.DROP,
|
|
41
|
+
pageTitle: actions_shared_2.DROP
|
|
42
42
|
},
|
|
43
43
|
unmappedFieldObject: 'additionalProperties'
|
|
44
44
|
};
|
|
45
45
|
const action = {
|
|
46
46
|
title: 'Track Purchase',
|
|
47
47
|
description: 'Record when a customer makes a purchase.',
|
|
48
|
-
fields:
|
|
48
|
+
fields: cloudTrackPurchaseFields,
|
|
49
49
|
perform: async (request, { settings, payload }) => {
|
|
50
|
-
const friendbuyPayload =
|
|
51
|
-
const requestParams = await cloudUtil_1.
|
|
52
|
-
return request(
|
|
50
|
+
const friendbuyPayload = actions_shared_2.mapEvent(trackPurchaseMapi, payload);
|
|
51
|
+
const [requestUrl, requestParams] = await cloudUtil_1.createMapiRequest('v1/event/purchase', request, settings, friendbuyPayload);
|
|
52
|
+
return request(requestUrl, requestParams);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackPurchase/index.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackPurchase/index.ts"],"names":[],"mappings":";;AAKA,4CAAgD;AAChD,4DAAuD;AACvD,4DAA8D;AAC9D,4DAA6D;AAE7D,MAAM,wBAAwB,GAAG,EAAE,GAAG,oCAAmB,CAAC,EAAE,CAAC,EAAE,GAAG,8BAAa,EAAE,CAAA;AAEjF,MAAM,iBAAiB,GAAa;IAClC,MAAM,EAAE;QACN,OAAO,EAAE,qBAAI;QACb,MAAM,EAAE,qBAAI;QACZ,QAAQ,EAAE,qBAAI;QACd,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;QAC9B,aAAa,EAAE,qBAAI;QACnB,YAAY,EAAE,qBAAI;QAClB,aAAa,EAAE,qBAAI;QAEnB,QAAQ,EAAE;YACR,IAAI,EAAE,OAAO;YACb,aAAa,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE;YAC/D,MAAM,EAAE;gBACN,GAAG,EAAE,qBAAI;gBACT,IAAI,EAAE,qBAAI;gBACV,QAAQ,EAAE,qBAAI;gBACd,KAAK,EAAE,qBAAI;gBACX,WAAW,EAAE,qBAAI;gBACjB,QAAQ,EAAE,qBAAI;gBACd,GAAG,EAAE,qBAAI;gBACT,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;aAChC;SACF;QAGD,UAAU,EAAE,qBAAI;QAEhB,KAAK,EAAE,qBAAI;QACX,SAAS,EAAE,qBAAI;QACf,QAAQ,EAAE,qBAAI;QAEd,aAAa,EAAE,qBAAI;QAEnB,GAAG,EAAE,qBAAI;QACT,QAAQ,EAAE,qBAAI;QAGd,SAAS,EAAE,qBAAI;QACf,SAAS,EAAE,qBAAI;QACf,OAAO,EAAE,qBAAI;QACb,SAAS,EAAE,qBAAI;KAChB;IACD,mBAAmB,EAAE,sBAAsB;CAC5C,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,0CAA0C;IACvD,MAAM,EAAE,wBAAwB;IAEhC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,gBAAgB,GAAG,yBAAQ,CAAC,iBAAiB,EAAE,OAAsC,CAAC,CAAA;QAC5F,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,6BAAiB,CACzD,mBAAmB,EACnB,OAAO,EACP,QAAQ,EACR,gBAAgB,CACjB,CAAA;QACD,OAAO,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -5,6 +5,10 @@ const actions_shared_1 = require("@segment/actions-shared");
|
|
|
5
5
|
const actions_shared_2 = require("@segment/actions-shared");
|
|
6
6
|
const actions_shared_3 = require("@segment/actions-shared");
|
|
7
7
|
const actions_shared_4 = require("@segment/actions-shared");
|
|
8
|
+
const cloudTrackSignUpFields = {
|
|
9
|
+
...actions_shared_3.trackSignUpFields({ requireCustomerId: true, requireEmail: true }),
|
|
10
|
+
...actions_shared_1.contextFields
|
|
11
|
+
};
|
|
8
12
|
const trackSignUpMapi = {
|
|
9
13
|
fields: {
|
|
10
14
|
coupon: { name: 'couponCode' },
|
|
@@ -28,11 +32,11 @@ const trackSignUpMapi = {
|
|
|
28
32
|
const action = {
|
|
29
33
|
title: 'Track Sign Up',
|
|
30
34
|
description: 'Record when a customer signs up for a service.',
|
|
31
|
-
fields:
|
|
35
|
+
fields: cloudTrackSignUpFields,
|
|
32
36
|
perform: async (request, { settings, payload }) => {
|
|
33
37
|
const friendbuyPayload = actions_shared_2.mapEvent(trackSignUpMapi, payload);
|
|
34
|
-
const requestParams = await cloudUtil_1.
|
|
35
|
-
return request(
|
|
38
|
+
const [requestUrl, requestParams] = await cloudUtil_1.createMapiRequest('v1/event/account-sign-up', request, settings, friendbuyPayload);
|
|
39
|
+
return request(requestUrl, requestParams);
|
|
36
40
|
}
|
|
37
41
|
};
|
|
38
42
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackSignUp/index.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/friendbuy/trackSignUp/index.ts"],"names":[],"mappings":";;AAKA,4CAAgD;AAChD,4DAAuD;AACvD,4DAA8D;AAC9D,4DAA2D;AAC3D,4DAAmD;AAEnD,MAAM,sBAAsB,GAAG;IAC7B,GAAG,kCAAiB,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IACrE,GAAG,8BAAa;CACjB,CAAA;AAED,MAAM,eAAe,GAAa;IAChC,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;QAC9B,aAAa,EAAE,qBAAI;QACnB,YAAY,EAAE,qBAAI;QAGlB,UAAU,EAAE,qBAAI;QAEhB,KAAK,EAAE,qBAAI;QACX,aAAa,EAAE,qBAAI;QACnB,aAAa,EAAE,qBAAI;QACnB,SAAS,EAAE,qBAAI;QACf,QAAQ,EAAE,qBAAI;QAEd,GAAG,EAAE,qBAAI;QACT,QAAQ,EAAE,EAAE,OAAO,EAAE,0BAAuB,EAAE;QAG9C,SAAS,EAAE,qBAAI;QACf,SAAS,EAAE,qBAAI;QACf,OAAO,EAAE,qBAAI;QACb,SAAS,EAAE,qBAAI;KAChB;IACD,mBAAmB,EAAE,sBAAsB;CAC5C,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,sBAAsB;IAE9B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,gBAAgB,GAAG,yBAAQ,CAAC,eAAe,EAAE,OAAsC,CAAC,CAAA;QAC1F,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,6BAAiB,CACzD,0BAA0B,EAC1B,OAAO,EACP,QAAQ,EACR,gBAAgB,CACjB,CAAA;QACD,OAAO,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commonFields = void 0;
|
|
4
|
+
exports.commonFields = {
|
|
5
|
+
anonymousId: {
|
|
6
|
+
label: 'Anonymous ID',
|
|
7
|
+
type: 'string',
|
|
8
|
+
allowNull: true,
|
|
9
|
+
description: 'The generated anonymous ID for the user',
|
|
10
|
+
default: {
|
|
11
|
+
'@path': '$.anonymousId'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
context: {
|
|
15
|
+
label: 'Event Context',
|
|
16
|
+
type: 'object',
|
|
17
|
+
description: 'Segment context with ip and userAgent',
|
|
18
|
+
required: true,
|
|
19
|
+
default: { '@path': '$.context' },
|
|
20
|
+
properties: {
|
|
21
|
+
campaign: {
|
|
22
|
+
label: 'UTM Properties',
|
|
23
|
+
type: 'object',
|
|
24
|
+
description: 'UTM Tracking Properties',
|
|
25
|
+
properties: {
|
|
26
|
+
source: {
|
|
27
|
+
label: 'UTM Source',
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: { '@path': '$.context.campaign.source' }
|
|
30
|
+
},
|
|
31
|
+
medium: {
|
|
32
|
+
label: 'UTM Medium',
|
|
33
|
+
type: 'string',
|
|
34
|
+
default: { '@path': '$.context.campaign.medium' }
|
|
35
|
+
},
|
|
36
|
+
name: {
|
|
37
|
+
label: 'UTM Campaign',
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: { '@path': '$.context.campaign.name' }
|
|
40
|
+
},
|
|
41
|
+
term: {
|
|
42
|
+
label: 'UTM Term',
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: { '@path': '$.context.campaign.term' }
|
|
45
|
+
},
|
|
46
|
+
content: {
|
|
47
|
+
label: 'UTM Content',
|
|
48
|
+
type: 'string',
|
|
49
|
+
default: { '@path': '$.context.campaign.content' }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
location: {
|
|
54
|
+
label: 'Location',
|
|
55
|
+
type: 'object',
|
|
56
|
+
description: 'information about the user’s current location',
|
|
57
|
+
properties: {
|
|
58
|
+
city: {
|
|
59
|
+
label: 'City',
|
|
60
|
+
type: 'string',
|
|
61
|
+
default: { '@path': '$.context.location.city' }
|
|
62
|
+
},
|
|
63
|
+
country: {
|
|
64
|
+
label: 'Country',
|
|
65
|
+
type: 'string',
|
|
66
|
+
default: { '@path': '$.context.location.country' }
|
|
67
|
+
},
|
|
68
|
+
latitude: {
|
|
69
|
+
label: 'Latitude',
|
|
70
|
+
type: 'number',
|
|
71
|
+
default: { '@path': '$.context.location.latitude' }
|
|
72
|
+
},
|
|
73
|
+
longitude: {
|
|
74
|
+
label: 'Longitude',
|
|
75
|
+
type: 'number',
|
|
76
|
+
default: { '@path': '$.context.location.longitude' }
|
|
77
|
+
},
|
|
78
|
+
region: {
|
|
79
|
+
label: 'Region',
|
|
80
|
+
type: 'string',
|
|
81
|
+
default: { '@path': '$.context.location.region' }
|
|
82
|
+
},
|
|
83
|
+
speed: {
|
|
84
|
+
label: 'Speed',
|
|
85
|
+
type: 'number',
|
|
86
|
+
default: { '@path': '$.context.location.speed' }
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
page: {
|
|
91
|
+
label: 'Page Properties',
|
|
92
|
+
type: 'object',
|
|
93
|
+
description: 'Current page properties',
|
|
94
|
+
properties: {
|
|
95
|
+
path: {
|
|
96
|
+
label: 'Page path',
|
|
97
|
+
type: 'string',
|
|
98
|
+
default: { '@path': '$.context.page.path' }
|
|
99
|
+
},
|
|
100
|
+
referrer: {
|
|
101
|
+
label: 'Referrer',
|
|
102
|
+
type: 'string',
|
|
103
|
+
default: { '@path': '$.context.page.referrer' }
|
|
104
|
+
},
|
|
105
|
+
search: {
|
|
106
|
+
label: 'Search',
|
|
107
|
+
type: 'string',
|
|
108
|
+
default: { '@path': '$.context.page.search' }
|
|
109
|
+
},
|
|
110
|
+
title: {
|
|
111
|
+
label: 'Title',
|
|
112
|
+
type: 'string',
|
|
113
|
+
default: { '@path': '$.context.page.title' }
|
|
114
|
+
},
|
|
115
|
+
url: {
|
|
116
|
+
label: 'Url',
|
|
117
|
+
type: 'string',
|
|
118
|
+
default: { '@path': '$.context.page.url' }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
screen: {
|
|
123
|
+
label: 'Screen Properties',
|
|
124
|
+
type: 'object',
|
|
125
|
+
description: 'Screen Properties',
|
|
126
|
+
properties: {
|
|
127
|
+
width: {
|
|
128
|
+
label: 'Screen Width',
|
|
129
|
+
type: 'number',
|
|
130
|
+
default: { '@path': '$.context.screen.width' }
|
|
131
|
+
},
|
|
132
|
+
height: {
|
|
133
|
+
label: 'Screen Height',
|
|
134
|
+
type: 'number',
|
|
135
|
+
default: { '@path': '$.context.screen.height' }
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
app: {
|
|
140
|
+
label: 'Application Properties',
|
|
141
|
+
type: 'object',
|
|
142
|
+
description: 'Application Properties',
|
|
143
|
+
properties: {
|
|
144
|
+
name: {
|
|
145
|
+
label: 'Name',
|
|
146
|
+
type: 'string',
|
|
147
|
+
default: { '@path': '$.context.app.name' },
|
|
148
|
+
},
|
|
149
|
+
version: {
|
|
150
|
+
label: 'Version',
|
|
151
|
+
type: 'string',
|
|
152
|
+
default: { '@path': '$.context.app.version' }
|
|
153
|
+
},
|
|
154
|
+
build: {
|
|
155
|
+
label: 'Build',
|
|
156
|
+
type: 'string',
|
|
157
|
+
default: { '@path': '$.context.app.build' }
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
device: {
|
|
162
|
+
label: 'Device Properties',
|
|
163
|
+
type: 'object',
|
|
164
|
+
description: 'Device Properties',
|
|
165
|
+
default: { '@path': '$.context.device' }
|
|
166
|
+
},
|
|
167
|
+
network: {
|
|
168
|
+
label: 'Network Properties',
|
|
169
|
+
type: 'object',
|
|
170
|
+
description: 'Network Properties',
|
|
171
|
+
default: { '@path': '$.context.network' }
|
|
172
|
+
},
|
|
173
|
+
library: {
|
|
174
|
+
label: 'Library Properties',
|
|
175
|
+
type: 'object',
|
|
176
|
+
description: 'Device Properties',
|
|
177
|
+
properties: {
|
|
178
|
+
name: {
|
|
179
|
+
label: 'Name',
|
|
180
|
+
type: 'string',
|
|
181
|
+
default: { '@path': '$.context.library.name' },
|
|
182
|
+
},
|
|
183
|
+
version: {
|
|
184
|
+
label: 'Version',
|
|
185
|
+
type: 'string',
|
|
186
|
+
default: { '@path': '$.context.library.version' }
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
ip: {
|
|
191
|
+
label: 'Users IP address',
|
|
192
|
+
type: 'string',
|
|
193
|
+
description: 'Users IP address',
|
|
194
|
+
default: { '@path': '$.context.ip' }
|
|
195
|
+
},
|
|
196
|
+
locale: {
|
|
197
|
+
label: 'Users Locale string',
|
|
198
|
+
type: 'string',
|
|
199
|
+
description: 'Users Locale string',
|
|
200
|
+
default: { '@path': '$.context.locale' }
|
|
201
|
+
},
|
|
202
|
+
userAgent: {
|
|
203
|
+
label: 'User Agent string',
|
|
204
|
+
type: 'string',
|
|
205
|
+
description: 'User Agent string',
|
|
206
|
+
default: { '@path': '$.context.userAgent' }
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
messageId: {
|
|
211
|
+
type: 'string',
|
|
212
|
+
label: 'Message ID',
|
|
213
|
+
description: 'The message ID uniquely identifies an event to ensure each event is only processed once.',
|
|
214
|
+
required: true,
|
|
215
|
+
default: {
|
|
216
|
+
'@path': '$.messageId'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
receivedAt: {
|
|
220
|
+
type: 'datetime',
|
|
221
|
+
label: 'receivedAt',
|
|
222
|
+
description: 'The timestamp at which this event was received.',
|
|
223
|
+
required: true,
|
|
224
|
+
default: {
|
|
225
|
+
'@path': '$.receivedAt'
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
sentAt: {
|
|
229
|
+
type: 'datetime',
|
|
230
|
+
label: 'sentAt',
|
|
231
|
+
description: 'The timestamp at which this was sent.',
|
|
232
|
+
required: true,
|
|
233
|
+
default: {
|
|
234
|
+
'@path': '$.sentAt'
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
timestamp: {
|
|
238
|
+
type: 'datetime',
|
|
239
|
+
label: 'timestamp',
|
|
240
|
+
description: 'The timestamp at which this event occurred.',
|
|
241
|
+
required: true,
|
|
242
|
+
default: {
|
|
243
|
+
'@path': '$.timestamp'
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
userId: {
|
|
247
|
+
label: 'User ID',
|
|
248
|
+
type: 'string',
|
|
249
|
+
allowNull: true,
|
|
250
|
+
required: true,
|
|
251
|
+
description: 'The unique user identifier',
|
|
252
|
+
default: {
|
|
253
|
+
'@path': '$.userId'
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
type: {
|
|
257
|
+
label: 'Type',
|
|
258
|
+
type: 'string',
|
|
259
|
+
allowNull: false,
|
|
260
|
+
required: true,
|
|
261
|
+
description: 'Segment event type',
|
|
262
|
+
default: {
|
|
263
|
+
'@path': '$.type'
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
version: {
|
|
267
|
+
label: 'Version',
|
|
268
|
+
type: 'number',
|
|
269
|
+
allowNull: true,
|
|
270
|
+
required: false,
|
|
271
|
+
description: 'Version of the Segment Tracking API that received the message',
|
|
272
|
+
default: {
|
|
273
|
+
'@path': '$.version'
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
//# sourceMappingURL=common-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-fields.js","sourceRoot":"","sources":["../../../src/destinations/gainsight-px-cloud-action/common-fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAA+B;IACtD,WAAW,EAAE;QACX,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE;YACP,OAAO,EAAE,eAAe;SACzB;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,uCAAuC;QACpD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;QACjC,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yBAAyB;gBACtC,UAAU,EAAE;oBACV,MAAM,EAAE;wBACN,KAAK,EAAE,YAAY;wBACnB,IAAI,EAAE,QAAQ;w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