@segment/action-destinations 3.136.0 → 3.137.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/blackbaud-raisers-edge-nxt/index.js +1 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/index.js.map +1 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.d.ts +1 -0
- package/dist/destinations/gwen/generated-types.d.ts +3 -0
- package/dist/destinations/gwen/generated-types.js +3 -0
- package/dist/destinations/gwen/generated-types.js.map +1 -0
- package/dist/destinations/gwen/identifyUser/generated-types.d.ts +5 -0
- package/dist/destinations/gwen/identifyUser/generated-types.js +3 -0
- package/dist/destinations/gwen/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/gwen/identifyUser/index.d.ts +5 -0
- package/dist/destinations/gwen/identifyUser/index.js +61 -0
- package/dist/destinations/gwen/identifyUser/index.js.map +1 -0
- package/dist/destinations/gwen/index.d.ts +4 -0
- package/dist/destinations/gwen/index.js +69 -0
- package/dist/destinations/gwen/index.js.map +1 -0
- package/dist/destinations/gwen/request-params.d.ts +3 -0
- package/dist/destinations/gwen/request-params.js +8 -0
- package/dist/destinations/gwen/request-params.js.map +1 -0
- package/dist/destinations/gwen/sendEvent/generated-types.d.ts +7 -0
- package/dist/destinations/gwen/sendEvent/generated-types.js +3 -0
- package/dist/destinations/gwen/sendEvent/generated-types.js.map +1 -0
- package/dist/destinations/gwen/sendEvent/index.d.ts +5 -0
- package/dist/destinations/gwen/sendEvent/index.js +55 -0
- package/dist/destinations/gwen/sendEvent/index.js.map +1 -0
- package/dist/destinations/heap/heapUtils.d.ts +1 -0
- package/dist/destinations/heap/heapUtils.js +12 -5
- package/dist/destinations/heap/heapUtils.js.map +1 -1
- package/dist/destinations/heap/identifyUser/index.js +19 -25
- package/dist/destinations/heap/identifyUser/index.js.map +1 -1
- package/dist/destinations/heap/index.js.map +1 -1
- package/dist/destinations/heap/trackEvent/generated-types.d.ts +3 -0
- package/dist/destinations/heap/trackEvent/index.js +35 -8
- package/dist/destinations/heap/trackEvent/index.js.map +1 -1
- package/dist/destinations/ripe/index.js +1 -1
- package/dist/destinations/ripe/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/heap/userIdHash.d.ts +0 -1
- package/dist/destinations/heap/userIdHash.js +0 -38
- package/dist/destinations/heap/userIdHash.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/blackbaud-raisers-edge-nxt/index.ts"],"names":[],"mappings":";;;;;AAEA,2CAAoE;AAEpE,wFAA+D;AAC/D,8DAAqC;AACrC,gHAAuF;AAEvF,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,oBAAoB,EAAE;gBACpB,KAAK,EAAE,gCAAgC;gBACvC,WAAW,EAAE,iEAAiE;gBAC9E,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,GAAG,4BAAgB,oBAAoB,CAAC,CAAA;QACzD,CAAC;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAE9C,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,gCAAoB,EAAE;gBACpE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,UAAU,EAAE,eAAe;oBAC3B,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;iBACjC,CAAC;aACH,CAAC,CAAA;YAEF,OAAO,EAAE,WAAW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AAI,EAAE,WAAW,EAAE;gBAC5C,yBAAyB,EAAE,GAAG,QAAQ,CAAC,oBAAoB,EAAE;aAC9D;SACF,CAAA;IACH,CAAC;IAGD,QAAQ,EAAE,KAAK,IAAI,EAAE;IAIrB,CAAC;IAED,OAAO,EAAE;QACP,uBAAuB,EAAvB,iCAAuB;QACvB,UAAU,EAAV,oBAAU;QACV,mCAAmC,EAAnC,6CAAmC;KACpC;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/gwen/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gwen/identifyUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_params_1 = require("../request-params");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Identify User',
|
|
6
|
+
description: 'Starts a new GWEN user session. Provide the users IP and userAgent to improve the GWEN experience',
|
|
7
|
+
defaultSubscription: 'type = "identify"',
|
|
8
|
+
fields: {
|
|
9
|
+
userId: {
|
|
10
|
+
label: 'User ID',
|
|
11
|
+
description: "The user's id. (Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)",
|
|
12
|
+
type: 'string',
|
|
13
|
+
format: 'uuid',
|
|
14
|
+
required: true,
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.userId'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
ip: {
|
|
20
|
+
label: 'User IP Address',
|
|
21
|
+
description: 'The IP address of the user',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: false,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.context.ip'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
userAgent: {
|
|
29
|
+
label: 'User Agent',
|
|
30
|
+
description: 'The userAgent string of the user',
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: false,
|
|
33
|
+
default: {
|
|
34
|
+
'@path': '$.context.userAgent'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
perform: async (request, { payload }) => {
|
|
39
|
+
const { userId, ip, userAgent } = payload;
|
|
40
|
+
await request(request_params_1.baseURL, {
|
|
41
|
+
...request_params_1.defaultRequestParams,
|
|
42
|
+
body: JSON.stringify({
|
|
43
|
+
operationName: 'UserSession',
|
|
44
|
+
query: `mutation UserSession($userId: UUID!, $session: UserSessionInput) {
|
|
45
|
+
userSession(userId: $userId, data: $session) {
|
|
46
|
+
timestamp
|
|
47
|
+
}
|
|
48
|
+
}`,
|
|
49
|
+
variables: {
|
|
50
|
+
userId,
|
|
51
|
+
session: {
|
|
52
|
+
ip,
|
|
53
|
+
userAgent
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.default = action;
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/gwen/identifyUser/index.ts"],"names":[],"mappings":";;AAEA,sDAAiE;AAGjE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,mGAAmG;IAChH,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,+DAA+D;YAC5E,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,EAAE,EAAE;YACF,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,qBAAqB;aAC/B;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;QAEzC,MAAM,OAAO,CAAC,wBAAO,EAAE;YACrB,GAAG,qCAAoB;YACvB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,aAAa,EAAE,aAAa;gBAC5B,KAAK,EAAE;;;;UAIL;gBACF,SAAS,EAAE;oBACT,MAAM;oBACN,OAAO,EAAE;wBACP,EAAE;wBACF,SAAS;qBACV;iBACF;aACF,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 sendEvent_1 = __importDefault(require("./sendEvent"));
|
|
8
|
+
const request_params_1 = require("./request-params");
|
|
9
|
+
const identifyUser_1 = __importDefault(require("./identifyUser"));
|
|
10
|
+
const destination = {
|
|
11
|
+
name: 'GWEN (Actions)',
|
|
12
|
+
slug: 'actions-cloud-gwen',
|
|
13
|
+
mode: 'cloud',
|
|
14
|
+
authentication: {
|
|
15
|
+
scheme: 'custom',
|
|
16
|
+
fields: {
|
|
17
|
+
apiKey: {
|
|
18
|
+
label: 'API Key',
|
|
19
|
+
description: 'GWEN API key. Can be found [here](http://gwen.insertcoin.se/iam/api-token)',
|
|
20
|
+
type: 'password',
|
|
21
|
+
required: true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
testAuthentication: (request) => {
|
|
25
|
+
return request(request_params_1.baseURL, {
|
|
26
|
+
...request_params_1.defaultRequestParams,
|
|
27
|
+
json: {
|
|
28
|
+
operationName: 'ValidateAPIKey',
|
|
29
|
+
query: `query ValidateAPIKey {
|
|
30
|
+
validateApiKey
|
|
31
|
+
}`
|
|
32
|
+
}
|
|
33
|
+
}).then(async (response) => {
|
|
34
|
+
const { errors } = (await response.json()).data;
|
|
35
|
+
if (errors && errors.length > 0) {
|
|
36
|
+
throw new Error('Invalid API key');
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
extendRequest: ({ settings }) => {
|
|
42
|
+
return {
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
Authorization: settings.apiKey
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
actions: {
|
|
50
|
+
sendEvent: sendEvent_1.default,
|
|
51
|
+
identifyUser: identifyUser_1.default
|
|
52
|
+
},
|
|
53
|
+
presets: [
|
|
54
|
+
{
|
|
55
|
+
name: 'Send an event to GWEN',
|
|
56
|
+
subscribe: 'type = "track"',
|
|
57
|
+
partnerAction: 'sendEvent',
|
|
58
|
+
mapping: actions_core_1.defaultValues(sendEvent_1.default.fields)
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Identify a user',
|
|
62
|
+
subscribe: 'type = "identify"',
|
|
63
|
+
partnerAction: 'identifyUser',
|
|
64
|
+
mapping: actions_core_1.defaultValues(identifyUser_1.default.fields)
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
exports.default = destination;
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/gwen/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,4DAAmC;AAEnC,qDAAgE;AAEhE,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,4EAA4E;gBACzF,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,wBAAO,EAAE;gBACtB,GAAG,qCAAoB;gBACvB,IAAI,EAAE;oBACJ,aAAa,EAAE,gBAAgB;oBAC/B,KAAK,EAAE;;gBAED;iBACP;aACF,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;gBACzB,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAA;gBAC/C,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;iBACnC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KACF;IACD,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,QAAQ,CAAC,MAAM;aAC/B;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,YAAY,EAAZ,sBAAY;KACb;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,uBAAuB;YAC7B,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,WAAW;YAC1B,OAAO,EAAE,4BAAa,CAAC,mBAAS,CAAC,MAAM,CAAC;SACzC;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,SAAS,EAAE,mBAAmB;YAC9B,aAAa,EAAE,cAAc;YAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;SAC5C;KACF;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultRequestParams = exports.baseURL = void 0;
|
|
4
|
+
exports.baseURL = 'https://gwen.insertcoin.se/graphql';
|
|
5
|
+
exports.defaultRequestParams = {
|
|
6
|
+
method: 'POST'
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=request-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-params.js","sourceRoot":"","sources":["../../../src/destinations/gwen/request-params.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAG,oCAAoC,CAAA;AAE9C,QAAA,oBAAoB,GAAmB;IAClD,MAAM,EAAE,MAAM;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/gwen/sendEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_params_1 = require("../request-params");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Send Event',
|
|
6
|
+
description: 'Send a user event to GWEN',
|
|
7
|
+
defaultSubscription: 'type = "track"',
|
|
8
|
+
fields: {
|
|
9
|
+
userId: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
format: 'uuid',
|
|
12
|
+
required: true,
|
|
13
|
+
description: "The user's id. (Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)",
|
|
14
|
+
label: 'User ID',
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.userId'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
label: 'Event Type',
|
|
21
|
+
description: 'The type of the event',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: true,
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.type'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
data: {
|
|
29
|
+
label: 'Data',
|
|
30
|
+
type: 'object',
|
|
31
|
+
required: false,
|
|
32
|
+
description: 'The data to be sent to GWEN',
|
|
33
|
+
default: {
|
|
34
|
+
'@path': '$.properties'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
perform: async (request, { payload }) => {
|
|
39
|
+
const { userId, type, data } = payload;
|
|
40
|
+
await request(request_params_1.baseURL, {
|
|
41
|
+
...request_params_1.defaultRequestParams,
|
|
42
|
+
body: JSON.stringify({
|
|
43
|
+
operationName: 'SendEvent',
|
|
44
|
+
query: `mutation SendEvent($userId: UUID!, $type: String!, $data: JSONObject) {\n event(userId: $userId, type: $type, data: $data)\n}`,
|
|
45
|
+
variables: {
|
|
46
|
+
userId,
|
|
47
|
+
type,
|
|
48
|
+
data: data || {}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.default = action;
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/gwen/sendEvent/index.ts"],"names":[],"mappings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k: string]: string;
|
|
7
7
|
};
|
|
8
|
+
export declare const isDefined: (value: string | undefined | null | number | object) => boolean;
|
|
8
9
|
export declare const getEventName: (payload: Payload) => string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEventName = exports.getUserIdentifier = void 0;
|
|
3
|
+
exports.getEventName = exports.isDefined = exports.getUserIdentifier = void 0;
|
|
4
4
|
const actions_core_1 = require("@segment/actions-core");
|
|
5
5
|
const getUserIdentifier = ({ identity, anonymous_id }) => {
|
|
6
|
-
if (identity) {
|
|
6
|
+
if (identity && exports.isDefined(identity)) {
|
|
7
7
|
return {
|
|
8
8
|
identity
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
if (anonymous_id) {
|
|
11
|
+
if (anonymous_id && exports.isDefined(anonymous_id)) {
|
|
12
12
|
return {
|
|
13
13
|
anonymous_id
|
|
14
14
|
};
|
|
@@ -16,6 +16,13 @@ const getUserIdentifier = ({ identity, anonymous_id }) => {
|
|
|
16
16
|
throw new actions_core_1.IntegrationError('Either identity or anonymous id are required.');
|
|
17
17
|
};
|
|
18
18
|
exports.getUserIdentifier = getUserIdentifier;
|
|
19
|
+
const isDefined = (value) => {
|
|
20
|
+
if (typeof value === 'object') {
|
|
21
|
+
return !!value && Object.keys(value).length !== 0;
|
|
22
|
+
}
|
|
23
|
+
return !(value === undefined || value === null || value === '' || value === 0 || value === '0');
|
|
24
|
+
};
|
|
25
|
+
exports.isDefined = isDefined;
|
|
19
26
|
const getEventName = (payload) => {
|
|
20
27
|
let eventName;
|
|
21
28
|
switch (payload.type) {
|
|
@@ -23,10 +30,10 @@ const getEventName = (payload) => {
|
|
|
23
30
|
eventName = payload.event;
|
|
24
31
|
break;
|
|
25
32
|
case 'page':
|
|
26
|
-
eventName =
|
|
33
|
+
eventName = 'Page viewed';
|
|
27
34
|
break;
|
|
28
35
|
case 'screen':
|
|
29
|
-
eventName =
|
|
36
|
+
eventName = 'Screen viewed';
|
|
30
37
|
break;
|
|
31
38
|
default:
|
|
32
39
|
eventName = 'track';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heapUtils.js","sourceRoot":"","sources":["../../../src/destinations/heap/heapUtils.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AAGjD,MAAM,iBAAiB,GAAG,CAAC,EAChC,QAAQ,EACR,YAAY,EAIb,EAA2B,EAAE;IAC5B,IAAI,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"heapUtils.js","sourceRoot":"","sources":["../../../src/destinations/heap/heapUtils.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AAGjD,MAAM,iBAAiB,GAAG,CAAC,EAChC,QAAQ,EACR,YAAY,EAIb,EAA2B,EAAE;IAC5B,IAAI,QAAQ,IAAI,iBAAS,CAAC,QAAQ,CAAC,EAAE;QACnC,OAAO;YACL,QAAQ;SACT,CAAA;KACF;IAED,IAAI,YAAY,IAAI,iBAAS,CAAC,YAAY,CAAC,EAAE;QAC3C,OAAO;YACL,YAAY;SACb,CAAA;KACF;IACD,MAAM,IAAI,+BAAgB,CAAC,+CAA+C,CAAC,CAAA;AAC7E,CAAC,CAAA;AAnBY,QAAA,iBAAiB,qBAmB7B;AAEM,MAAM,SAAS,GAAG,CAAC,KAAkD,EAAW,EAAE;IACvF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAA;KAClD;IACD,OAAO,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,CAAC,CAAA;AACjG,CAAC,CAAA;AALY,QAAA,SAAS,aAKrB;AAEM,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC/C,IAAI,SAA6B,CAAA;IACjC,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,OAAO;YACV,SAAS,GAAG,OAAO,CAAC,KAAK,CAAA;YACzB,MAAK;QACP,KAAK,MAAM;YACT,SAAS,GAAG,aAAa,CAAA;YACzB,MAAK;QACP,KAAK,QAAQ;YACX,SAAS,GAAG,eAAe,CAAA;YAC3B,MAAK;QACP;YACE,SAAS,GAAG,OAAO,CAAA;YACnB,MAAK;KACR;IAED,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,OAAO,CAAA;KACf;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AArBY,QAAA,YAAY,gBAqBxB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const userIdHash_1 = require("../userIdHash");
|
|
5
4
|
const flat_1 = require("../flat");
|
|
5
|
+
const heapUtils_1 = require("../heapUtils");
|
|
6
6
|
const action = {
|
|
7
7
|
title: 'Identify User',
|
|
8
8
|
description: 'Set the user ID for a particular device ID or update user properties.',
|
|
9
9
|
defaultSubscription: 'type = "identify"',
|
|
10
10
|
fields: {
|
|
11
11
|
user_id: {
|
|
12
|
-
label: '
|
|
12
|
+
label: 'Identity',
|
|
13
13
|
type: 'string',
|
|
14
14
|
allowNull: true,
|
|
15
|
-
description: '
|
|
15
|
+
description: 'REQUIRED: A string that uniquely identifies a user, such as an email, handle, or username. This means no two users in one environment may share the same identity. More on identify: https://developers.heap.io/docs/using-identify',
|
|
16
16
|
default: {
|
|
17
17
|
'@path': '$.userId'
|
|
18
18
|
}
|
|
@@ -39,33 +39,27 @@ const action = {
|
|
|
39
39
|
if (!settings.appId) {
|
|
40
40
|
throw new actions_core_1.IntegrationError('Missing Heap app ID.', 'Missing required field', 400);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const data = {
|
|
45
|
-
app_id: settings.appId,
|
|
46
|
-
identity: payload.user_id,
|
|
47
|
-
user_id: userIdHash_1.getHeapUserId(payload.anonymous_id)
|
|
48
|
-
};
|
|
49
|
-
const identifyResponse = await request('https://heapanalytics.com/api/v1/identify', {
|
|
50
|
-
method: 'post',
|
|
51
|
-
json: data
|
|
52
|
-
});
|
|
53
|
-
responses.push(identifyResponse);
|
|
42
|
+
if (!payload.user_id || !heapUtils_1.isDefined(payload.user_id)) {
|
|
43
|
+
throw new actions_core_1.IntegrationError('Missing identity, cannot add user properties without identity', 'Missing required field', 400);
|
|
54
44
|
}
|
|
45
|
+
const addUserPropertiesPayload = {
|
|
46
|
+
identity: payload.user_id,
|
|
47
|
+
app_id: settings.appId,
|
|
48
|
+
properties: {
|
|
49
|
+
...(payload.anonymous_id && { anonymous_id: payload.anonymous_id })
|
|
50
|
+
}
|
|
51
|
+
};
|
|
55
52
|
if (payload.traits && Object.keys(payload.traits).length > 0) {
|
|
56
53
|
const flatten = flat_1.flat(payload.traits);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
properties: flatten
|
|
54
|
+
addUserPropertiesPayload.properties = {
|
|
55
|
+
...addUserPropertiesPayload.properties,
|
|
56
|
+
...flatten
|
|
61
57
|
};
|
|
62
|
-
const addUserPropertiesEndpoint = request('https://heapanalytics.com/api/add_user_properties', {
|
|
63
|
-
method: 'post',
|
|
64
|
-
json: data
|
|
65
|
-
});
|
|
66
|
-
responses.push(addUserPropertiesEndpoint);
|
|
67
58
|
}
|
|
68
|
-
return
|
|
59
|
+
return request('https://heapanalytics.com/api/add_user_properties', {
|
|
60
|
+
method: 'post',
|
|
61
|
+
json: addUserPropertiesPayload
|
|
62
|
+
});
|
|
69
63
|
}
|
|
70
64
|
};
|
|
71
65
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/identifyUser/index.ts"],"names":[],"mappings":";;AAGA,wDAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/identifyUser/index.ts"],"names":[],"mappings":";;AAGA,wDAAwD;AACxD,kCAA8B;AAC9B,4CAAwC;AAUxC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,uEAAuE;IACpF,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EACT,qOAAqO;YACvO,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,0CAA0C;YACvD,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,iKAAiK;YACnK,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;YACnB,MAAM,IAAI,+BAAgB,CAAC,sBAAsB,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;SAClF;QAED,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,qBAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACnD,MAAM,IAAI,+BAAgB,CACxB,+DAA+D,EAC/D,wBAAwB,EACxB,GAAG,CACJ,CAAA;SACF;QAED,MAAM,wBAAwB,GAA6B;YACzD,QAAQ,EAAE,OAAO,CAAC,OAA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AAM,EAAE;YACN,KAAK,EAAE;gBACL,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mDAAmD;gBAChE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/heap/index.ts"],"names":[],"mappings":";;;;;AAEA,8DAAqC;AACrC,wDAAqD;AACrD,kEAAyC;AAGzC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,oDAAoD;QAC/D,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,mBAAmB;QAC9B,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;KAC5C;CACF,CAAA;AAED,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mDAAmD;gBAChE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,OAAO;IACP,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -26,7 +26,7 @@ const action = {
|
|
|
26
26
|
label: 'Identity',
|
|
27
27
|
type: 'string',
|
|
28
28
|
allowNull: true,
|
|
29
|
-
description: '
|
|
29
|
+
description: 'a string that uniquely identifies a user, such as an email, handle, or username. This means no two users in one environment may share the same identity. More on identify: https://developers.heap.io/docs/using-identify'
|
|
30
30
|
},
|
|
31
31
|
anonymous_id: {
|
|
32
32
|
label: 'Anonymous ID',
|
|
@@ -76,36 +76,63 @@ const action = {
|
|
|
76
76
|
default: {
|
|
77
77
|
'@path': '$.name'
|
|
78
78
|
}
|
|
79
|
+
},
|
|
80
|
+
traits: {
|
|
81
|
+
label: 'User Properties',
|
|
82
|
+
type: 'object',
|
|
83
|
+
description: 'An object with key-value properties you want associated with the user. Each property must either be a number or string with fewer than 1024 characters.',
|
|
84
|
+
default: {
|
|
85
|
+
'@path': '$.context.traits'
|
|
86
|
+
}
|
|
79
87
|
}
|
|
80
88
|
},
|
|
81
89
|
perform: (request, { payload, settings }) => {
|
|
90
|
+
const requests = [];
|
|
82
91
|
if (!settings.appId) {
|
|
83
92
|
throw new actions_core_1.IntegrationError('Missing app ID');
|
|
84
93
|
}
|
|
85
94
|
if (!payload.anonymous_id && !payload.identity) {
|
|
86
95
|
throw new actions_core_1.IntegrationError('Either Anonymous id or Identity should be specified.');
|
|
87
96
|
}
|
|
88
|
-
const standardProperties = { segment_library: constants_1.HEAP_SEGMENT_CLOUD_LIBRARY_NAME };
|
|
89
97
|
const flattenedProperties = flat_1.flat(payload.properties || {});
|
|
90
98
|
const event = {
|
|
91
99
|
event: heapUtils_1.getEventName(payload),
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
properties: {
|
|
101
|
+
segment_library: constants_1.HEAP_SEGMENT_CLOUD_LIBRARY_NAME,
|
|
102
|
+
...flattenedProperties,
|
|
103
|
+
...(heapUtils_1.isDefined(payload.name) && { name: payload.name })
|
|
104
|
+
},
|
|
94
105
|
idempotency_key: payload.message_id
|
|
95
106
|
};
|
|
96
107
|
event.user_identifier = heapUtils_1.getUserIdentifier({ identity: payload.identity, anonymous_id: payload.anonymous_id });
|
|
97
108
|
if (payload.timestamp && dayjs_1.default.utc(payload.timestamp).isValid()) {
|
|
98
109
|
event.timestamp = dayjs_1.default.utc(payload.timestamp).toISOString();
|
|
99
110
|
}
|
|
100
|
-
const
|
|
111
|
+
const trackPayload = {
|
|
101
112
|
app_id: settings.appId,
|
|
102
113
|
events: [event],
|
|
103
114
|
library: 'Segment'
|
|
104
115
|
};
|
|
105
|
-
|
|
116
|
+
if (heapUtils_1.isDefined(payload.identity) && (heapUtils_1.isDefined(payload.anonymous_id) || heapUtils_1.isDefined(payload.traits))) {
|
|
117
|
+
const userPropertiesPayload = {
|
|
118
|
+
app_id: settings.appId,
|
|
119
|
+
identity: payload.identity,
|
|
120
|
+
properties: {
|
|
121
|
+
...(heapUtils_1.isDefined(payload.anonymous_id) && { anonymous_id: payload.anonymous_id }),
|
|
122
|
+
...(payload.traits && Object.keys(payload.traits).length !== 0 && flat_1.flat(payload.traits))
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const addUserPropertiesRequest = request('https://heapanalytics.com/api/add_user_properties', {
|
|
126
|
+
method: 'post',
|
|
127
|
+
json: userPropertiesPayload
|
|
128
|
+
});
|
|
129
|
+
requests.push(addUserPropertiesRequest);
|
|
130
|
+
}
|
|
131
|
+
requests.push(request('https://heapanalytics.com/api/integrations/track', {
|
|
106
132
|
method: 'post',
|
|
107
|
-
json:
|
|
108
|
-
});
|
|
133
|
+
json: trackPayload
|
|
134
|
+
}));
|
|
135
|
+
return Promise.all(requests);
|
|
109
136
|
}
|
|
110
137
|
};
|
|
111
138
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,+DAAsC;AACtC,4CAA8D;AAC9D,kCAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,+DAAsC;AACtC,4CAA8D;AAC9D,kCAA8B;AAC9B,4CAAyE;AACzE,wDAAwD;AAuBxD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACp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group"',
|
|
59
59
|
partnerAction: 'group',
|
|
60
|
-
mapping: actions_core_1.defaultValues(
|
|
60
|
+
mapping: actions_core_1.defaultValues(group_1.default.fields)
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
name: 'Identify user',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/ripe/index.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAK5B,oDAA2B;AAC3B,0DAAiC;AACjC,kDAAyB;AACzB,oDAA2B;AAC3B,wDAAqD;AAErD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,+CAA+C;IAE5D,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,wCAAwC;gBACrD,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,cAAc;gBACrB,WAAW,EAAE,8EAA8E;gBAC3F,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,sCAAsC;aAChD;SACF;QAED,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,WAAW,EAAE;gBACzD,MAAM,EAAE,KAAK;aACd,CAAC,CAAA;YACF,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAA;QAC1B,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,mBAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBA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AE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,mBAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC/C,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,KAAK,EAAL,eAAK;QACL,QAAQ,EAAR,kBAAQ;QACR,IAAI,EAAJ,cAAI;QACJ,KAAK,EAAL,eAAK;KACN;IAED,OAAO,EAAE;QACP;YACE,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,OAAO;YACtB,OAAO,EAAE,4BAAa,CAAC,eAAK,CAAC,MAAM,CAAC;SACrC;QACD;YACE,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,mBAAmB;YAC9B,aAAa,EAAE,UAAU;YACzB,OAAO,EAAE,4BAAa,CAAC,kBAAQ,CAAC,MAAM,CAAC;SACxC;QACD;YACE,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,eAAe;YAC1B,aAAa,EAAE,MAAM;YACrB,OAAO,EAAE,4BAAa,CAAC,cAAI,CAAC,MAAM,CAAC;SACpC;QACD;YACE,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,OAAO;YACtB,OAAO,EAAE,4BAAa,CAAC,eAAK,CAAC,MAAM,CAAC;SACrC;KACF;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.
|
|
4
|
+
"version": "3.137.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"lcov"
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "4d7346923e17a8074d991c4593b2b13edd480758"
|
|
72
72
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getHeapUserId: (segmentAnonymousUserId: string) => number;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.getHeapUserId = void 0;
|
|
23
|
-
const crypto = __importStar(require("crypto"));
|
|
24
|
-
const md5hasher = (anonymousUserId) => {
|
|
25
|
-
const hash = crypto.createHash('md5').update(anonymousUserId, 'binary').digest();
|
|
26
|
-
return [hash.readUInt32LE(0), hash.readUInt32LE(8)];
|
|
27
|
-
};
|
|
28
|
-
const pack53Bits = (low32Bits, high32Bits) => {
|
|
29
|
-
const mask = Math.pow(2, 53 - 32) - 1;
|
|
30
|
-
const twoToThe32 = 4294967296;
|
|
31
|
-
return low32Bits + (mask & high32Bits) * twoToThe32;
|
|
32
|
-
};
|
|
33
|
-
const getHeapUserId = (segmentAnonymousUserId) => {
|
|
34
|
-
const hash = md5hasher(segmentAnonymousUserId);
|
|
35
|
-
return pack53Bits(hash[0], hash[1]);
|
|
36
|
-
};
|
|
37
|
-
exports.getHeapUserId = getHeapUserId;
|
|
38
|
-
//# sourceMappingURL=userIdHash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"userIdHash.js","sourceRoot":"","sources":["../../../src/destinations/heap/userIdHash.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGA,+CAAgC;AAEhC,MAAM,SAAS,GAAG,CAAC,eAAuB,EAAE,EAAE;IAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAA;IAChF,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC,CAAA;AAID,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAE,UAAkB,EAAE,EAAE;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;IACrC,MAAM,UAAU,GAAG,UAAU,CAAA;IAC7B,OAAO,SAAS,GAAG,CAAC,IAAI,GAAG,UAAU,CAAC,GAAG,UAAU,CAAA;AACrD,CAAC,CAAA;AAEM,MAAM,aAAa,GAAG,CAAC,sBAA8B,EAAE,EAAE;IAC9D,MAAM,IAAI,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;IAC9C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AACrC,CAAC,CAAA;AAHY,QAAA,aAAa,iBAGzB"}
|