@segment/action-destinations 3.162.0 → 3.163.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/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +159 -122
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.d.ts +9 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.js +3 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/index.d.ts +5 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js +54 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/operations.d.ts +6 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/operations.js +42 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/operations.js.map +1 -0
- package/dist/destinations/liveramp-audiences/generated-types.d.ts +10 -0
- package/dist/destinations/liveramp-audiences/generated-types.js +3 -0
- package/dist/destinations/liveramp-audiences/generated-types.js.map +1 -0
- package/dist/destinations/liveramp-audiences/index.d.ts +4 -0
- package/dist/destinations/liveramp-audiences/index.js +69 -0
- package/dist/destinations/liveramp-audiences/index.js.map +1 -0
- package/dist/destinations/liveramp-audiences/s3.d.ts +5 -0
- package/dist/destinations/liveramp-audiences/s3.js +37 -0
- package/dist/destinations/liveramp-audiences/s3.js.map +1 -0
- package/dist/destinations/revx/generated-types.d.ts +3 -0
- package/dist/destinations/revx/generated-types.js +3 -0
- package/dist/destinations/revx/generated-types.js.map +1 -0
- package/dist/destinations/revx/index.d.ts +4 -0
- package/dist/destinations/revx/index.js +36 -0
- package/dist/destinations/revx/index.js.map +1 -0
- package/dist/destinations/revx/sendRevxPing/generated-types.d.ts +41 -0
- package/dist/destinations/revx/sendRevxPing/generated-types.js +3 -0
- package/dist/destinations/revx/sendRevxPing/generated-types.js.map +1 -0
- package/dist/destinations/revx/sendRevxPing/index.d.ts +5 -0
- package/dist/destinations/revx/sendRevxPing/index.js +268 -0
- package/dist/destinations/revx/sendRevxPing/index.js.map +1 -0
- package/dist/destinations/segment-profiles/generated-types.d.ts +0 -1
- package/dist/destinations/segment-profiles/helperFunctions.d.ts +0 -7
- package/dist/destinations/segment-profiles/helperFunctions.js +1 -45
- package/dist/destinations/segment-profiles/helperFunctions.js.map +1 -1
- package/dist/destinations/segment-profiles/index.js +0 -14
- package/dist/destinations/segment-profiles/index.js.map +1 -1
- package/dist/destinations/segment-profiles/properties.js +10 -1
- package/dist/destinations/segment-profiles/properties.js.map +1 -1
- package/dist/destinations/segment-profiles/sendGroup/index.js +0 -8
- package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendIdentify/index.js +0 -8
- package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -1
- package/dist/destinations/usermaven/common-definitions.js +1 -1
- package/dist/destinations/usermaven/group/generated-types.d.ts +1 -1
- package/dist/destinations/usermaven/identify/generated-types.d.ts +1 -1
- package/dist/destinations/usermaven/index.js +9 -1
- package/dist/destinations/usermaven/index.js.map +1 -1
- package/dist/destinations/usermaven/page/generated-types.d.ts +31 -0
- package/dist/destinations/usermaven/page/generated-types.js +3 -0
- package/dist/destinations/usermaven/page/generated-types.js.map +1 -0
- package/dist/destinations/usermaven/page/index.d.ts +5 -0
- package/dist/destinations/usermaven/page/index.js +58 -0
- package/dist/destinations/usermaven/page/index.js.map +1 -0
- package/dist/destinations/usermaven/request-params.js +12 -8
- package/dist/destinations/usermaven/request-params.js.map +1 -1
- package/dist/destinations/usermaven/track/generated-types.d.ts +1 -1
- package/dist/lib/AWS/s3.d.ts +4 -0
- package/dist/lib/AWS/s3.js +21 -0
- package/dist/lib/AWS/s3.js.map +1 -0
- package/package.json +2 -2
|
@@ -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 audienceEntered_1 = __importDefault(require("./audienceEntered"));
|
|
7
|
+
const destination = {
|
|
8
|
+
name: 'Liveramp Audiences',
|
|
9
|
+
slug: 'actions-liveramp-audiences',
|
|
10
|
+
mode: 'cloud',
|
|
11
|
+
authentication: {
|
|
12
|
+
scheme: 'custom',
|
|
13
|
+
fields: {
|
|
14
|
+
upload_mode: {
|
|
15
|
+
label: 'Upload Mode',
|
|
16
|
+
description: 'Choose delivery route for the files',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: true,
|
|
19
|
+
default: 'S3',
|
|
20
|
+
choices: [
|
|
21
|
+
{ value: 'S3', label: 'S3' },
|
|
22
|
+
{ value: 'SFTP', label: 'SFTP' }
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
s3_aws_access_key: {
|
|
26
|
+
label: 'AWS Access Key ID (S3 only)',
|
|
27
|
+
description: 'IAM user credentials with write permissions to the S3 bucket.',
|
|
28
|
+
type: 'string'
|
|
29
|
+
},
|
|
30
|
+
s3_aws_secret_key: {
|
|
31
|
+
label: 'AWS Secret Access Key (S3 only)',
|
|
32
|
+
description: 'IAM user credentials with write permissions to the S3 bucket.',
|
|
33
|
+
type: 'password'
|
|
34
|
+
},
|
|
35
|
+
s3_aws_bucket_name: {
|
|
36
|
+
label: 'AWS Bucket Name (S3 only)',
|
|
37
|
+
description: 'Name of the S3 bucket where the files will be uploaded to.',
|
|
38
|
+
type: 'string'
|
|
39
|
+
},
|
|
40
|
+
s3_aws_region: {
|
|
41
|
+
label: 'AWS Region (S3 only)',
|
|
42
|
+
description: 'Region where the S3 bucket is hosted.',
|
|
43
|
+
type: 'string'
|
|
44
|
+
},
|
|
45
|
+
sftp_username: {
|
|
46
|
+
label: 'Username (SFTP only)',
|
|
47
|
+
description: 'User credentials for establishing an SFTP connection with LiveRamp.',
|
|
48
|
+
type: 'string'
|
|
49
|
+
},
|
|
50
|
+
sftp_password: {
|
|
51
|
+
label: 'Password (SFTP only)',
|
|
52
|
+
description: 'User credentials for establishing an SFTP connection with LiveRamp.',
|
|
53
|
+
type: 'password'
|
|
54
|
+
},
|
|
55
|
+
sftp_folder_path: {
|
|
56
|
+
label: 'Folder Path (SFTP only)',
|
|
57
|
+
description: 'Path within the SFTP server to upload the files to.',
|
|
58
|
+
type: 'string'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
testAuthentication: (_) => {
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
actions: {
|
|
65
|
+
audienceEntered: audienceEntered_1.default
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.default = destination;
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/liveramp-audiences/index.ts"],"names":[],"mappings":";;;;;AAGA,wEAA+C;AAE/C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,qCAAqC;gBAClD,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;oBAC5B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;iBACjC;aACF;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,6BAA6B;gBACpC,WAAW,EAAE,+DAA+D;gBAC5E,IAAI,EAAE,QAAQ;aACf;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,iCAAiC;gBACxC,WAAW,EAAE,+DAA+D;gBAC5E,IAAI,EAAE,UAAU;aACjB;YACD,kBAAkB,EAAE;gBAClB,KAAK,EAAE,2BAA2B;gBAClC,WAAW,EAAE,4DAA4D;gBACzE,IAAI,EAAE,QAAQ;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,uCAAuC;gBACpD,IAAI,EAAE,QAAQ;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,qEAAqE;gBAClF,IAAI,EAAE,QAAQ;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,qEAAqE;gBAClF,IAAI,EAAE,UAAU;aACjB;YACD,gBAAgB,EAAE;gBAChB,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EAAE,qDAAqD;gBAClE,IAAI,EAAE,QAAQ;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE;QAK1B,CAAC;KACF;IACD,OAAO,EAAE;QACP,eAAe,EAAf,yBAAe;KAChB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ModifiedResponse, RequestOptions } from '@segment/actions-core';
|
|
2
|
+
import type { Settings } from './generated-types';
|
|
3
|
+
declare function validateS3(settings: Settings): void;
|
|
4
|
+
declare function uploadS3(settings: Settings, filename: string, fileContent: string, request: <Data = unknown>(url: string, options?: RequestOptions) => Promise<ModifiedResponse<Data>>): Promise<ModifiedResponse<unknown>>;
|
|
5
|
+
export { validateS3, uploadS3 };
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
exports.uploadS3 = exports.validateS3 = void 0;
|
|
7
|
+
const s3_1 = __importDefault(require("../../lib/AWS/s3"));
|
|
8
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
9
|
+
function validateS3(settings) {
|
|
10
|
+
if (!settings.s3_aws_access_key) {
|
|
11
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS Access Key');
|
|
12
|
+
}
|
|
13
|
+
if (!settings.s3_aws_secret_key) {
|
|
14
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS Secret Key');
|
|
15
|
+
}
|
|
16
|
+
if (!settings.s3_aws_bucket_name) {
|
|
17
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS S3 bucket name');
|
|
18
|
+
}
|
|
19
|
+
if (!settings.s3_aws_region) {
|
|
20
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected S3 upload mode, but missing AWS Region');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.validateS3 = validateS3;
|
|
24
|
+
async function uploadS3(settings, filename, fileContent, request) {
|
|
25
|
+
const method = 'PUT';
|
|
26
|
+
const opts = await s3_1.default(settings.s3_aws_bucket_name, settings.s3_aws_region, filename, method, fileContent, settings.s3_aws_access_key, settings.s3_aws_secret_key);
|
|
27
|
+
if (!opts.headers || !opts.method || !opts.host || !opts.path) {
|
|
28
|
+
throw new actions_core_1.InvalidAuthenticationError('Unable to generate signature header for AWS S3 request.');
|
|
29
|
+
}
|
|
30
|
+
return await request(`https://${opts.host}/${opts.path}`, {
|
|
31
|
+
headers: opts.headers,
|
|
32
|
+
method,
|
|
33
|
+
body: opts.body
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.uploadS3 = uploadS3;
|
|
37
|
+
//# sourceMappingURL=s3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../src/destinations/liveramp-audiences/s3.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAuD;AACvD,wDAAoG;AAGpG,SAAS,UAAU,CAAC,QAAkB;IACpC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;QAC/B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;KAC5F;IAED,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;QAC/B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;KAC5F;IAED,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;QAChC,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,CAAC,CAAA;KAChG;IAED,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QAC3B,MAAM,IAAI,yCAA0B,CAAC,iDAAiD,CAAC,CAAA;KACxF;AACH,CAAC;AA6BQ,gCAAU;AA3BnB,KAAK,UAAU,QAAQ,CACrB,QAAkB,EAClB,QAAgB,EAChB,WAAmB,EACnB,OAAmG;IAEnG,MAAM,MAAM,GAAG,KAAK,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,YAAwB,CACzC,QAAQ,CAAC,kBAA4B,EACrC,QAAQ,CAAC,aAAuB,EAChC,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,CAAC,iBAA2B,EACpC,QAAQ,CAAC,iBAA2B,CACrC,CAAA;IACD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QAC7D,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,CAAC,CAAA;KAChG;IAED,OAAO,MAAM,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE;QACxD,OAAO,EAAE,IAAI,CAAC,OAAiC;QAC/C,MAAM;QACN,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC,CAAA;AACJ,CAAC;AAEoB,4BAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/revx/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 sendRevxPing_1 = __importDefault(require("./sendRevxPing"));
|
|
8
|
+
const destination = {
|
|
9
|
+
name: 'RevX Cloud (Actions)',
|
|
10
|
+
slug: 'actions-revx',
|
|
11
|
+
mode: 'cloud',
|
|
12
|
+
authentication: {
|
|
13
|
+
scheme: 'custom',
|
|
14
|
+
fields: {
|
|
15
|
+
client_id: {
|
|
16
|
+
label: 'Revx Client ID',
|
|
17
|
+
description: 'Revx specific client id. This can be found by contacting the RevX support team',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
presets: [
|
|
24
|
+
{
|
|
25
|
+
name: 'Send Revx Ping',
|
|
26
|
+
subscribe: 'type = "track" or type ="screen"',
|
|
27
|
+
partnerAction: 'sendRevxPing',
|
|
28
|
+
mapping: actions_core_1.defaultValues(sendRevxPing_1.default.fields)
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
actions: {
|
|
32
|
+
sendRevxPing: sendRevxPing_1.default
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = destination;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/revx/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAG5E,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,gFAAgF;gBAC7F,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,gBAAgB;YACtB,SAAS,EAAE,kCAAkC;YAC7C,aAAa,EAAE,cAAc;YAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;SAC5C;KACF;IACD,OAAO,EAAE;QACP,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
os: string;
|
|
3
|
+
advertising_id?: string;
|
|
4
|
+
event_name?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
idfv?: string;
|
|
7
|
+
time?: string | number;
|
|
8
|
+
event_properties?: {
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
user_properties?: {
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
app_version?: string;
|
|
15
|
+
os_name?: string;
|
|
16
|
+
os_version?: string;
|
|
17
|
+
device_brand?: string;
|
|
18
|
+
device_manufacturer?: string;
|
|
19
|
+
device_model?: string;
|
|
20
|
+
carrier?: string;
|
|
21
|
+
country?: string;
|
|
22
|
+
region?: string;
|
|
23
|
+
city?: string;
|
|
24
|
+
dma?: string;
|
|
25
|
+
language?: string;
|
|
26
|
+
product?: {
|
|
27
|
+
price?: number;
|
|
28
|
+
quantity?: number;
|
|
29
|
+
productId?: string;
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
products?: {
|
|
33
|
+
price?: number;
|
|
34
|
+
quantity?: number;
|
|
35
|
+
productId?: string;
|
|
36
|
+
[k: string]: unknown;
|
|
37
|
+
}[];
|
|
38
|
+
location_lat?: number;
|
|
39
|
+
location_lng?: number;
|
|
40
|
+
ip?: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/revx/sendRevxPing/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const action = {
|
|
4
|
+
title: 'Send Revx Ping',
|
|
5
|
+
description: 'Send event to revx',
|
|
6
|
+
defaultSubscription: 'type = "track" or type ="screen"',
|
|
7
|
+
fields: {
|
|
8
|
+
os: {
|
|
9
|
+
label: 'Platform',
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: 'Platform of the device.',
|
|
12
|
+
required: true,
|
|
13
|
+
default: {
|
|
14
|
+
'@path': '$.context.device.type'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
advertising_id: {
|
|
18
|
+
label: 'Identifier For Advertiser (IDFA/GAID)',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Identifier For Advertiser (IDFA/GAID)',
|
|
21
|
+
default: { '@path': '$.context.device.advertisingId' }
|
|
22
|
+
},
|
|
23
|
+
event_name: {
|
|
24
|
+
label: 'Event name',
|
|
25
|
+
description: 'A unique identifier for your event.',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: {
|
|
28
|
+
'@if': {
|
|
29
|
+
exists: { '@path': '$.name' },
|
|
30
|
+
then: { '@path': '$.name' },
|
|
31
|
+
else: { '@path': '$.event' }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
label: 'Request type',
|
|
37
|
+
description: 'A unique identifier for your request type.',
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: { '@path': '$.type' }
|
|
40
|
+
},
|
|
41
|
+
idfv: {
|
|
42
|
+
label: 'Identifier For Vendor (IDFV)',
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Identifier for Device Id for IOS and Android',
|
|
45
|
+
default: {
|
|
46
|
+
'@path': '$.context.device.id'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
time: {
|
|
50
|
+
label: 'Timestamp',
|
|
51
|
+
type: 'datetime',
|
|
52
|
+
description: 'The timestamp of the event. If time is not sent with the event, it will be set to the request upload time.',
|
|
53
|
+
default: {
|
|
54
|
+
'@path': '$.timestamp'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
event_properties: {
|
|
58
|
+
label: 'Event Properties',
|
|
59
|
+
type: 'object',
|
|
60
|
+
description: 'An object of key-value pairs that represent additional data to be sent along with the event.',
|
|
61
|
+
default: {
|
|
62
|
+
'@path': '$.properties'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
user_properties: {
|
|
66
|
+
label: 'User Properties',
|
|
67
|
+
type: 'object',
|
|
68
|
+
description: 'An object of key-value pairs that represent additional data tied to the user',
|
|
69
|
+
default: {
|
|
70
|
+
'@path': '$.context.traits'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
app_version: {
|
|
74
|
+
label: 'App Version',
|
|
75
|
+
type: 'string',
|
|
76
|
+
description: 'The current version of your application.',
|
|
77
|
+
default: {
|
|
78
|
+
'@path': '$.context.app.version'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
os_name: {
|
|
82
|
+
label: 'OS Name',
|
|
83
|
+
type: 'string',
|
|
84
|
+
description: 'The name of the mobile operating system or browser that the user is using.',
|
|
85
|
+
default: {
|
|
86
|
+
'@path': '$.context.os.name'
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
os_version: {
|
|
90
|
+
label: 'OS Version',
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: 'The version of the mobile operating system or browser the user is using.',
|
|
93
|
+
default: {
|
|
94
|
+
'@path': '$.context.os.version'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
device_brand: {
|
|
98
|
+
label: 'Device Brand',
|
|
99
|
+
type: 'string',
|
|
100
|
+
description: 'The device brand that the user is using.',
|
|
101
|
+
default: {
|
|
102
|
+
'@path': '$.context.device.brand'
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
device_manufacturer: {
|
|
106
|
+
label: 'Device Manufacturer',
|
|
107
|
+
type: 'string',
|
|
108
|
+
description: 'The device manufacturer that the user is using.',
|
|
109
|
+
default: {
|
|
110
|
+
'@path': '$.context.device.manufacturer'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
device_model: {
|
|
114
|
+
label: 'Device Model',
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'The device model that the user is using.',
|
|
117
|
+
default: {
|
|
118
|
+
'@path': '$.context.device.model'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
carrier: {
|
|
122
|
+
label: 'Carrier',
|
|
123
|
+
type: 'string',
|
|
124
|
+
description: 'The carrier that the user is using.',
|
|
125
|
+
default: {
|
|
126
|
+
'@path': '$.context.network.carrier'
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
country: {
|
|
130
|
+
label: 'Country',
|
|
131
|
+
type: 'string',
|
|
132
|
+
description: 'The current country of the user.',
|
|
133
|
+
default: {
|
|
134
|
+
'@path': '$.context.location.country'
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
region: {
|
|
138
|
+
label: 'Region',
|
|
139
|
+
type: 'string',
|
|
140
|
+
description: 'The current region of the user.',
|
|
141
|
+
default: {
|
|
142
|
+
'@path': '$.context.location.region'
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
city: {
|
|
146
|
+
label: 'City',
|
|
147
|
+
type: 'string',
|
|
148
|
+
description: 'The current city of the user.',
|
|
149
|
+
default: {
|
|
150
|
+
'@path': '$.context.location.city'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
dma: {
|
|
154
|
+
label: 'Designated Market Area',
|
|
155
|
+
type: 'string',
|
|
156
|
+
description: 'The current Designated Market Area of the user.'
|
|
157
|
+
},
|
|
158
|
+
language: {
|
|
159
|
+
label: 'Language',
|
|
160
|
+
type: 'string',
|
|
161
|
+
description: 'The language set by the user.',
|
|
162
|
+
default: {
|
|
163
|
+
'@path': '$.context.locale'
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
product: {
|
|
167
|
+
label: 'Product',
|
|
168
|
+
description: 'The single product viewed or Added to cart.',
|
|
169
|
+
type: 'object',
|
|
170
|
+
additionalProperties: true,
|
|
171
|
+
properties: {
|
|
172
|
+
price: {
|
|
173
|
+
label: 'Price',
|
|
174
|
+
type: 'number',
|
|
175
|
+
description: 'The price of the item purchased. Required for revenue data if the revenue field is not sent. You can use negative values to indicate refunds.'
|
|
176
|
+
},
|
|
177
|
+
quantity: {
|
|
178
|
+
label: 'Quantity',
|
|
179
|
+
type: 'integer',
|
|
180
|
+
description: 'The quantity of the item purchased. Defaults to 1 if not specified.'
|
|
181
|
+
},
|
|
182
|
+
productId: {
|
|
183
|
+
label: 'Product ID',
|
|
184
|
+
type: 'string',
|
|
185
|
+
description: 'An identifier for the item purchased. You must send a price and quantity or revenue with this field.'
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
default: {
|
|
189
|
+
price: { '@path': '$.properties.price' },
|
|
190
|
+
quantity: { '@path': '$.properties.quantity' },
|
|
191
|
+
productId: { '@path': '$.properties.product_id' }
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
products: {
|
|
195
|
+
label: 'Products',
|
|
196
|
+
description: 'The list of products purchased.',
|
|
197
|
+
type: 'object',
|
|
198
|
+
multiple: true,
|
|
199
|
+
additionalProperties: true,
|
|
200
|
+
properties: {
|
|
201
|
+
price: {
|
|
202
|
+
label: 'Price',
|
|
203
|
+
type: 'number',
|
|
204
|
+
description: 'The price of the item purchased. Required for revenue data if the revenue field is not sent. You can use negative values to indicate refunds.'
|
|
205
|
+
},
|
|
206
|
+
quantity: {
|
|
207
|
+
label: 'Quantity',
|
|
208
|
+
type: 'integer',
|
|
209
|
+
description: 'The quantity of the item purchased. Defaults to 1 if not specified.'
|
|
210
|
+
},
|
|
211
|
+
productId: {
|
|
212
|
+
label: 'Product ID',
|
|
213
|
+
type: 'string',
|
|
214
|
+
description: 'An identifier for the item purchased. You must send a price and quantity or revenue with this field.'
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
default: {
|
|
218
|
+
'@arrayPath': [
|
|
219
|
+
'$.properties.products',
|
|
220
|
+
{
|
|
221
|
+
price: {
|
|
222
|
+
'@path': 'price'
|
|
223
|
+
},
|
|
224
|
+
quantity: {
|
|
225
|
+
'@path': 'quantity'
|
|
226
|
+
},
|
|
227
|
+
productId: {
|
|
228
|
+
'@path': 'product_id'
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
location_lat: {
|
|
235
|
+
label: 'Latitude',
|
|
236
|
+
type: 'number',
|
|
237
|
+
description: 'The current Latitude of the user.',
|
|
238
|
+
default: {
|
|
239
|
+
'@path': '$.context.location.latitude'
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
location_lng: {
|
|
243
|
+
label: 'Longtitude',
|
|
244
|
+
type: 'number',
|
|
245
|
+
description: 'The current Longitude of the user.',
|
|
246
|
+
default: {
|
|
247
|
+
'@path': '$.context.location.longitude'
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
ip: {
|
|
251
|
+
label: 'IP Address',
|
|
252
|
+
type: 'string',
|
|
253
|
+
description: 'The IP address of the user. Use "$remote" to use the IP address on the upload request. ',
|
|
254
|
+
default: {
|
|
255
|
+
'@path': '$.context.ip'
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
perform: (request, { settings, payload }) => {
|
|
260
|
+
const body = { ...settings, ...payload };
|
|
261
|
+
return request('https://segmentdata.atomex.net/data/1x1.gif', {
|
|
262
|
+
method: 'post',
|
|
263
|
+
json: body
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
exports.default = action;
|
|
268
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/revx/sendRevxPing/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,oBAAoB;IACjC,mBAAmB,EAAE,kCAAkC;IACvD,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,cAAc,EAAE;YACd,KAAK,EAAE,uCAAuC;YAC9C,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,OAAO,EAAE,EAAE,OAAO,EAAE,gCAAgC,EAAE;SACvD;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;oBAC3B,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;iBAC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AAQ,EAAE;4BACR,OAAO,EAAE,UAAU;yBACpB;wBACD,SAAS,EAAE;4BACT,OAAO,EAAE,YAAY;yBACtB;qBACF;iBACF;aACF;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mCAAmC;YAChD,OAAO,EAAE;gBACP,OAAO,EAAE,6BAA6B;aACvC;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oCAAoC;YACjD,OAAO,EAAE;gBACP,OAAO,EAAE,8BAA8B;aACxC;SACF;QACD,EAAE,EAAE;YACF,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yFAAyF;YACtG,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAA;QACxC,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import { RequestClient, DynamicFieldResponse } from '@segment/actions-core';
|
|
2
|
-
interface GetEngageSpaceParams {
|
|
3
|
-
endpoint: string;
|
|
4
|
-
bearerToken: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function getEngageSpaces(request: RequestClient, data: GetEngageSpaceParams): Promise<DynamicFieldResponse>;
|
|
7
1
|
export declare function generateSegmentAPIAuthHeaders(writeKey: string): string;
|
|
8
|
-
export {};
|
|
@@ -1,50 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateSegmentAPIAuthHeaders =
|
|
4
|
-
const properties_1 = require("./properties");
|
|
5
|
-
async function getEngageSpaces(request, data) {
|
|
6
|
-
let cursor = 'MA==';
|
|
7
|
-
const choices = [];
|
|
8
|
-
let response;
|
|
9
|
-
const segmentPAPIEndpoint = properties_1.SEGMENT_ENDPOINTS[data.endpoint || properties_1.DEFAULT_SEGMENT_ENDPOINT].papi;
|
|
10
|
-
do {
|
|
11
|
-
const publicApiUrl = `${segmentPAPIEndpoint}/sources?pagination%5Bcount%5D=${properties_1.PAGINATION_COUNT}&pagination%5Bcursor%5D=${cursor}`;
|
|
12
|
-
try {
|
|
13
|
-
response = await request(publicApiUrl, {
|
|
14
|
-
headers: {
|
|
15
|
-
authorization: `Bearer ${data.bearerToken}`
|
|
16
|
-
},
|
|
17
|
-
method: 'GET',
|
|
18
|
-
skipResponseCloning: true
|
|
19
|
-
});
|
|
20
|
-
for (const source of response.data.data.sources) {
|
|
21
|
-
if (source.metadata.slug !== 'personas-compute') {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
choices.push({
|
|
25
|
-
label: source.name,
|
|
26
|
-
value: source.writeKeys[0]
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
return {
|
|
32
|
-
choices: [],
|
|
33
|
-
error: {
|
|
34
|
-
message: err?.response?.errors?.message ?? 'Unknown Error',
|
|
35
|
-
code: err?.response?.statusText ?? 'Unknown Error'
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (response.data.data.pagination.next) {
|
|
40
|
-
cursor = response.data.data.pagination.next;
|
|
41
|
-
}
|
|
42
|
-
} while (response.data.data.pagination.next);
|
|
43
|
-
return {
|
|
44
|
-
choices
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
exports.getEngageSpaces = getEngageSpaces;
|
|
3
|
+
exports.generateSegmentAPIAuthHeaders = void 0;
|
|
48
4
|
function generateSegmentAPIAuthHeaders(writeKey) {
|
|
49
5
|
return `Basic ${Buffer.from(writeKey + ':').toString('base64')}`;
|
|
50
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helperFunctions.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/helperFunctions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helperFunctions.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/helperFunctions.ts"],"names":[],"mappings":";;;AAAA,SAAgB,6BAA6B,CAAC,QAAgB;IAI5D,OAAO,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;AAClE,CAAC;AALD,sEAKC"}
|
|
@@ -13,12 +13,6 @@ const destination = {
|
|
|
13
13
|
authentication: {
|
|
14
14
|
scheme: 'custom',
|
|
15
15
|
fields: {
|
|
16
|
-
segment_papi_token: {
|
|
17
|
-
label: 'Segment Public API Token',
|
|
18
|
-
description: 'The Segment Public API requires that you have an authentication token before you send requests. [This document](https://docs.segmentapis.com/tag/Getting-Started#section/Get-an-API-token) explains how to setup a token.',
|
|
19
|
-
type: 'password',
|
|
20
|
-
required: true
|
|
21
|
-
},
|
|
22
16
|
endpoint: {
|
|
23
17
|
label: 'Endpoint Region',
|
|
24
18
|
description: 'The region to send your data.',
|
|
@@ -31,14 +25,6 @@ const destination = {
|
|
|
31
25
|
default: properties_1.DEFAULT_SEGMENT_ENDPOINT,
|
|
32
26
|
required: true
|
|
33
27
|
}
|
|
34
|
-
},
|
|
35
|
-
testAuthentication: async (request, { settings }) => {
|
|
36
|
-
const { endpoint } = settings;
|
|
37
|
-
return request(properties_1.SEGMENT_ENDPOINTS[endpoint || properties_1.DEFAULT_SEGMENT_ENDPOINT].papi, {
|
|
38
|
-
headers: {
|
|
39
|
-
authorization: `Bearer ${settings.segment_papi_token}`
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
28
|
}
|
|
43
29
|
},
|
|
44
30
|
actions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAEA,6CAA0E;AAE1E,4DAAmC;AAEnC,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAEA,6CAA0E;AAE1E,4DAAmC;AAEnC,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,8BAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;oBACpD,KAAK,EAAE,8BAAiB,CAAC,GAAG,CAAC,CAAC,KAAK;oBACnC,KAAK,EAAE,GAAG;iBACX,CAAC,CAAC;gBACH,OAAO,EAAE,qCAAwB;gBACjC,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PAGINATION_COUNT = exports.DEFAULT_SEGMENT_ENDPOINT = exports.SEGMENT_ENDPOINTS = void 0;
|
|
4
|
-
|
|
4
|
+
const SEG_ENDPOINT = {
|
|
5
5
|
north_america: {
|
|
6
6
|
label: 'North America',
|
|
7
7
|
url: 'https://api.segment.io/v1',
|
|
@@ -15,6 +15,15 @@ exports.SEGMENT_ENDPOINTS = {
|
|
|
15
15
|
papi: 'https://eu1.api.segmentapis.com'
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
+
if (process.env.NODE_ENV != 'production') {
|
|
19
|
+
SEG_ENDPOINT.stage = {
|
|
20
|
+
label: 'Staging',
|
|
21
|
+
url: 'https://api.segment.build/v1',
|
|
22
|
+
cdn: 'https://cdn.segment.build/v1',
|
|
23
|
+
papi: 'https://api.segmentapis.build'
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.SEGMENT_ENDPOINTS = SEG_ENDPOINT;
|
|
18
27
|
exports.DEFAULT_SEGMENT_ENDPOINT = 'north_america';
|
|
19
28
|
exports.PAGINATION_COUNT = 10;
|
|
20
29
|
//# sourceMappingURL=properties.js.map
|