@segment/action-destinations 3.421.1-staging-3677f2ec2.0 → 3.422.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/batch/updateProfile/type.d.ts +1 -1
- package/dist/destinations/dynamic-yield-audiences/generated-types.d.ts +0 -1
- package/dist/destinations/dynamic-yield-audiences/helpers.d.ts +3 -2
- package/dist/destinations/dynamic-yield-audiences/helpers.js +27 -4
- package/dist/destinations/dynamic-yield-audiences/helpers.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/index.js +22 -11
- package/dist/destinations/dynamic-yield-audiences/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js +13 -10
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/epsilon/sendEvent/fields.d.ts +1 -0
- package/dist/destinations/epsilon/sendEvent/fields.js +8 -1
- package/dist/destinations/epsilon/sendEvent/fields.js.map +1 -1
- package/dist/destinations/epsilon/sendEvent/generated-types.d.ts +3 -0
- package/dist/destinations/epsilon/sendEvent/index.js +5 -3
- package/dist/destinations/epsilon/sendEvent/index.js.map +1 -1
- package/dist/destinations/first-party-dv360/_tests_/index.test.js +17 -17
- package/dist/destinations/first-party-dv360/_tests_/index.test.js.map +1 -1
- package/dist/destinations/first-party-dv360/addToAudContactInfo/_tests_/index.test.d.ts +1 -7
- package/dist/destinations/first-party-dv360/addToAudContactInfo/_tests_/index.test.js +2 -60
- package/dist/destinations/first-party-dv360/addToAudContactInfo/_tests_/index.test.js.map +1 -1
- package/dist/destinations/first-party-dv360/functions.d.ts +2 -2
- package/dist/destinations/first-party-dv360/functions.js +26 -64
- package/dist/destinations/first-party-dv360/functions.js.map +1 -1
- package/dist/destinations/first-party-dv360/index.js +2 -4
- package/dist/destinations/first-party-dv360/index.js.map +1 -1
- package/dist/destinations/first-party-dv360/removeFromAudContactInfo/_tests_/index.test.js +2 -2
- package/dist/destinations/first-party-dv360/removeFromAudContactInfo/_tests_/index.test.js.map +1 -1
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/kafka/index.js +1 -1
- package/dist/destinations/kafka/index.js.map +1 -1
- package/dist/destinations/kafka/send/generated-types.d.ts +0 -2
- package/dist/destinations/kafka/send/index.js +1 -17
- package/dist/destinations/kafka/send/index.js.map +1 -1
- package/dist/destinations/kafka/utils.d.ts +3 -2
- package/dist/destinations/kafka/utils.js +29 -65
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +3 -3
- package/dist/destinations/klaviyo/functions.js +21 -42
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/types.d.ts +3 -5
- package/dist/destinations/klaviyo/types.js.map +1 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js +27 -25
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateAudience/index.js +2 -1
- package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js +0 -3
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.d.ts +1 -2
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.js +0 -33
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.js.map +1 -1
- package/dist/destinations/taguchi/generated-types.d.ts +5 -0
- package/dist/destinations/taguchi/generated-types.js.map +1 -0
- package/dist/destinations/{ms-bing-capi → taguchi}/index.d.ts +1 -1
- package/dist/destinations/taguchi/index.js +61 -0
- package/dist/destinations/taguchi/index.js.map +1 -0
- package/dist/destinations/taguchi/syncEvent/fields.d.ts +5 -0
- package/dist/destinations/taguchi/syncEvent/fields.js +139 -0
- package/dist/destinations/taguchi/syncEvent/fields.js.map +1 -0
- package/dist/destinations/taguchi/syncEvent/generated-types.d.ts +20 -0
- package/dist/destinations/taguchi/syncEvent/generated-types.js.map +1 -0
- package/dist/destinations/taguchi/syncEvent/index.js +22 -0
- package/dist/destinations/taguchi/syncEvent/index.js.map +1 -0
- package/dist/destinations/taguchi/syncEvent/types.d.ts +33 -0
- package/dist/destinations/taguchi/syncEvent/types.js.map +1 -0
- package/dist/destinations/taguchi/syncEvent/utils.d.ts +6 -0
- package/dist/destinations/taguchi/syncEvent/utils.js +62 -0
- package/dist/destinations/taguchi/syncEvent/utils.js.map +1 -0
- package/dist/destinations/taguchi/syncUserProfile/fields.d.ts +6 -0
- package/dist/destinations/taguchi/syncUserProfile/fields.js +235 -0
- package/dist/destinations/taguchi/syncUserProfile/fields.js.map +1 -0
- package/dist/destinations/taguchi/syncUserProfile/generated-types.d.ts +25 -0
- package/dist/destinations/taguchi/syncUserProfile/generated-types.js.map +1 -0
- package/dist/destinations/taguchi/syncUserProfile/index.js +23 -0
- package/dist/destinations/taguchi/syncUserProfile/index.js.map +1 -0
- package/dist/destinations/taguchi/syncUserProfile/types.d.ts +32 -0
- package/dist/destinations/taguchi/syncUserProfile/types.js.map +1 -0
- package/dist/destinations/taguchi/syncUserProfile/utils.d.ts +6 -0
- package/dist/destinations/taguchi/syncUserProfile/utils.js +97 -0
- package/dist/destinations/taguchi/syncUserProfile/utils.js.map +1 -0
- package/dist/destinations/the-trade-desk-crm/index.d.ts +2 -0
- package/dist/destinations/the-trade-desk-crm/index.js +8 -5
- package/dist/destinations/the-trade-desk-crm/index.js.map +1 -1
- package/dist/destinations/twilio-messaging/sendMessage/fields.js +10 -0
- package/dist/destinations/twilio-messaging/sendMessage/fields.js.map +1 -1
- package/dist/destinations/yonoma/sendEvent/generated-types.d.ts +1 -0
- package/dist/destinations/yonoma/sendEvent/index.js +6 -0
- package/dist/destinations/yonoma/sendEvent/index.js.map +1 -1
- package/dist/destinations/yonoma/trackPageView/index.js +14 -2
- package/dist/destinations/yonoma/trackPageView/index.js.map +1 -1
- package/dist/destinations/yonoma/upsertContact/constants.d.ts +0 -2
- package/dist/destinations/yonoma/upsertContact/constants.js +1 -3
- package/dist/destinations/yonoma/upsertContact/constants.js.map +1 -1
- package/dist/destinations/yonoma/upsertContact/index.js +10 -26
- package/dist/destinations/yonoma/upsertContact/index.js.map +1 -1
- package/dist/destinations/yonoma/upsertContact/types.d.ts +2 -6
- package/package.json +4 -4
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.d.ts +0 -30
- package/dist/destinations/dynamic-yield-audiences/syncAudience/types.js.map +0 -1
- package/dist/destinations/ms-bing-capi/constants.d.ts +0 -2
- package/dist/destinations/ms-bing-capi/constants.js +0 -186
- package/dist/destinations/ms-bing-capi/constants.js.map +0 -1
- package/dist/destinations/ms-bing-capi/fields.d.ts +0 -6
- package/dist/destinations/ms-bing-capi/fields.js +0 -334
- package/dist/destinations/ms-bing-capi/fields.js.map +0 -1
- package/dist/destinations/ms-bing-capi/generated-types.d.ts +0 -4
- package/dist/destinations/ms-bing-capi/generated-types.js.map +0 -1
- package/dist/destinations/ms-bing-capi/index.js +0 -49
- package/dist/destinations/ms-bing-capi/index.js.map +0 -1
- package/dist/destinations/ms-bing-capi/pageLoad/generated-types.d.ts +0 -22
- package/dist/destinations/ms-bing-capi/pageLoad/generated-types.js.map +0 -1
- package/dist/destinations/ms-bing-capi/pageLoad/index.js +0 -36
- package/dist/destinations/ms-bing-capi/pageLoad/index.js.map +0 -1
- package/dist/destinations/ms-bing-capi/sendEvent/generated-types.d.ts +0 -22
- package/dist/destinations/ms-bing-capi/sendEvent/generated-types.js.map +0 -1
- package/dist/destinations/ms-bing-capi/sendEvent/index.js +0 -35
- package/dist/destinations/ms-bing-capi/sendEvent/index.js.map +0 -1
- package/dist/destinations/ms-bing-capi/sendEvent/types.d.ts +0 -13
- package/dist/destinations/ms-bing-capi/sendEvent/types.js.map +0 -1
- package/dist/destinations/ms-bing-capi/sendEvent/utils.d.ts +0 -4
- package/dist/destinations/ms-bing-capi/sendEvent/utils.js +0 -8
- package/dist/destinations/ms-bing-capi/sendEvent/utils.js.map +0 -1
- /package/dist/destinations/{ms-bing-capi → taguchi}/generated-types.js +0 -0
- /package/dist/destinations/{ms-bing-capi/pageLoad → taguchi/syncEvent}/generated-types.js +0 -0
- /package/dist/destinations/{ms-bing-capi/pageLoad → taguchi/syncEvent}/index.d.ts +0 -0
- /package/dist/destinations/{dynamic-yield-audiences/syncAudience → taguchi/syncEvent}/types.js +0 -0
- /package/dist/destinations/{ms-bing-capi/sendEvent → taguchi/syncUserProfile}/generated-types.js +0 -0
- /package/dist/destinations/{ms-bing-capi/sendEvent → taguchi/syncUserProfile}/index.d.ts +0 -0
- /package/dist/destinations/{ms-bing-capi/sendEvent → taguchi/syncUserProfile}/types.js +0 -0
|
@@ -5,5 +5,4 @@ declare function uploadS3(payload: Payload, filename: string, fileContent: Buffe
|
|
|
5
5
|
declare function isValidS3Path(key: string): boolean;
|
|
6
6
|
declare function normalizeS3Path(path?: string): string | undefined;
|
|
7
7
|
declare function isValidS3BucketName(bucketName: string): boolean;
|
|
8
|
-
|
|
9
|
-
export { validateS3, uploadS3, isValidS3Path, normalizeS3Path, isValidS3BucketName, validateS3Permissions };
|
|
8
|
+
export { validateS3, uploadS3, isValidS3Path, normalizeS3Path, isValidS3BucketName };
|
|
@@ -8,7 +8,6 @@ exports.uploadS3 = uploadS3;
|
|
|
8
8
|
exports.isValidS3Path = isValidS3Path;
|
|
9
9
|
exports.normalizeS3Path = normalizeS3Path;
|
|
10
10
|
exports.isValidS3BucketName = isValidS3BucketName;
|
|
11
|
-
exports.validateS3Permissions = validateS3Permissions;
|
|
12
11
|
const s3_1 = __importDefault(require("../../../lib/AWS/s3"));
|
|
13
12
|
const actions_core_1 = require("@segment/actions-core");
|
|
14
13
|
function validateS3(payload) {
|
|
@@ -91,36 +90,4 @@ function isValidS3BucketName(bucketName) {
|
|
|
91
90
|
}
|
|
92
91
|
return true;
|
|
93
92
|
}
|
|
94
|
-
async function validateS3Permissions(payload, request) {
|
|
95
|
-
if (!payload.s3_aws_access_key ||
|
|
96
|
-
!payload.s3_aws_secret_key ||
|
|
97
|
-
!payload.s3_aws_bucket_name ||
|
|
98
|
-
!payload.s3_aws_region) {
|
|
99
|
-
throw new actions_core_1.PayloadValidationError('Missing required S3 credentials.');
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const method = 'HEAD';
|
|
103
|
-
const opts = await (0, s3_1.default)(payload.s3_aws_bucket_name, payload.s3_aws_region, '', method, '', payload.s3_aws_access_key, payload.s3_aws_secret_key);
|
|
104
|
-
if (!opts.headers || !opts.method || !opts.host) {
|
|
105
|
-
throw new actions_core_1.InvalidAuthenticationError('Unable to generate signature header for AWS S3 permission check.');
|
|
106
|
-
}
|
|
107
|
-
await request(`https://${opts.host}`, {
|
|
108
|
-
headers: opts.headers,
|
|
109
|
-
method
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
const status = error?.response?.status || error?.status;
|
|
114
|
-
if (status === 403 || status === 401) {
|
|
115
|
-
throw new actions_core_1.InvalidAuthenticationError(`AWS IAM credentials are invalid or do not have permission to access S3 bucket "${payload.s3_aws_bucket_name}". Please verify your access key, secret key, and bucket permissions.`);
|
|
116
|
-
}
|
|
117
|
-
if (status === 404) {
|
|
118
|
-
throw new actions_core_1.InvalidAuthenticationError(`S3 bucket "${payload.s3_aws_bucket_name}" does not exist or is not accessible with the provided credentials.`);
|
|
119
|
-
}
|
|
120
|
-
if (status === 400) {
|
|
121
|
-
throw new actions_core_1.InvalidAuthenticationError(`Bad request when accessing S3 bucket "${payload.s3_aws_bucket_name}". Please verify your AWS region and bucket configuration.`);
|
|
122
|
-
}
|
|
123
|
-
throw error;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
93
|
//# sourceMappingURL=s3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredS3/s3.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEnteredS3/s3.ts"],"names":[],"mappings":";;;;;AAiJS,gCAAU;AAAE,4BAAQ;AAAE,sCAAa;AAAE,0CAAe;AAAE,kDAAmB;AAjJlF,6DAA0D;AAC1D,wDAAoG;AAGpG,SAAS,UAAU,CAAC,OAAgB;IAClC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC/B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;IAC7F,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC/B,MAAM,IAAI,yCAA0B,CAAC,qDAAqD,CAAC,CAAA;IAC7F,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAChC,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,CAAC,CAAA;IACjG,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,yCAA0B,CAAC,iDAAiD,CAAC,CAAA;IACzF,CAAC;AACH,CAAC;AAED,KAAK,UAAU,QAAQ,CACrB,OAAgB,EAChB,QAAgB,EAChB,WAAmB,EACnB,OAAmG;IAEnG,MAAM,MAAM,GAAG,KAAK,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,IAAA,YAAwB,EACzC,OAAO,CAAC,kBAA4B,EACpC,OAAO,CAAC,aAAuB,EAC/B,QAAQ,EACR,MAAM,EACN,WAAW,EACX,OAAO,CAAC,iBAA2B,EACnC,OAAO,CAAC,iBAA2B,CACpC,CAAA;IACD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC9D,MAAM,IAAI,yCAA0B,CAAC,yDAAyD,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AAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/taguchi/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DestinationDefinition } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from './generated-types';
|
|
3
3
|
declare const destination: DestinationDefinition<Settings>;
|
|
4
4
|
export default destination;
|
|
@@ -0,0 +1,61 @@
|
|
|
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 syncEvent_1 = __importDefault(require("./syncEvent"));
|
|
7
|
+
const syncUserProfile_1 = __importDefault(require("./syncUserProfile"));
|
|
8
|
+
const destination = {
|
|
9
|
+
name: 'Taguchi',
|
|
10
|
+
slug: 'actions-taguchi',
|
|
11
|
+
mode: 'cloud',
|
|
12
|
+
description: 'Sync analytics events, user profile details, including Audience and Computed Trait details to Taguchi.',
|
|
13
|
+
authentication: {
|
|
14
|
+
scheme: 'custom',
|
|
15
|
+
fields: {
|
|
16
|
+
apiKey: {
|
|
17
|
+
label: 'API Key',
|
|
18
|
+
description: 'Taguchi API Key used to authenticate requests to the Taguchi platform.',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
integrationURL: {
|
|
23
|
+
label: 'Integration URL',
|
|
24
|
+
description: "The Taguchi URL Segment will send data to. This should be created in the Taguchi User Interface by navigating to 'Taguchi Integrations' then 'Integrations Setup.'",
|
|
25
|
+
type: 'string',
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
organizationId: {
|
|
29
|
+
label: 'Organization ID',
|
|
30
|
+
description: 'The Taguchi ID of the organization to which this Subscriber belongs.',
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
testAuthentication: (request, { settings }) => {
|
|
36
|
+
const testUrl = settings.integrationURL.replace('/prod', '/test');
|
|
37
|
+
return request(`${testUrl}/subscriber`, {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
json: [
|
|
40
|
+
{
|
|
41
|
+
profile: {
|
|
42
|
+
organizationId: Number(settings.organizationId),
|
|
43
|
+
ref: 'test-connection',
|
|
44
|
+
firstname: 'Test'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
Authorization: `Bearer ${settings.apiKey}`
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
actions: {
|
|
56
|
+
syncEvent: syncEvent_1.default,
|
|
57
|
+
syncUserProfile: syncUserProfile_1.default,
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.default = destination;
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/taguchi/index.ts"],"names":[],"mappings":";;;;;AAEA,4DAAmC;AACnC,wEAA+C;AAE/C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,wGAAwG;IACrH,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,wEAAwE;gBACrF,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,cAAc,EAAE;gBACd,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EACT,oKAAoK;gBACtK,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,cAAc,EAAE;gBACd,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,sEAAsE;gBACnF,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YACjE,OAAO,OAAO,CAAC,GAAG,OAAO,aAAa,EAAE;gBACtC,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACJ;wBACE,OAAO,EAAE;4BACP,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;4BAC/C,GAAG,EAAE,iBAAiB;4BACtB,SAAS,EAAE,MAAM;yBAClB;qBACF;iBACF;gBACD,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,UAAU,QAAQ,CAAC,MAAM,EAAE;iBAC3C;aACF,CAAC,CAAA;QACJ,CAAC;KACF;IACD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,eAAe,EAAf,yBAAe;KAChB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.products = exports.eventData = exports.eventType = exports.target = void 0;
|
|
4
|
+
exports.target = {
|
|
5
|
+
label: 'Event Target',
|
|
6
|
+
description: 'Target identifier / user identifier for the event. At least one identifier is required.',
|
|
7
|
+
type: 'object',
|
|
8
|
+
required: true,
|
|
9
|
+
additionalProperties: false,
|
|
10
|
+
properties: {
|
|
11
|
+
ref: {
|
|
12
|
+
label: 'Reference',
|
|
13
|
+
description: 'A unique identifier for the target.',
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
email: {
|
|
17
|
+
label: 'Email',
|
|
18
|
+
description: 'Email address of the target.',
|
|
19
|
+
type: 'string',
|
|
20
|
+
format: 'email'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
default: {
|
|
24
|
+
ref: { '@path': '$.userId' },
|
|
25
|
+
email: {
|
|
26
|
+
'@if': {
|
|
27
|
+
exists: { '@path': '$.userId' },
|
|
28
|
+
then: { '@path': '$.userId' },
|
|
29
|
+
else: { '@path': '$.anonymousId' }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.eventType = {
|
|
35
|
+
label: 'Event Type',
|
|
36
|
+
description: 'Type of event being sent.',
|
|
37
|
+
type: 'string',
|
|
38
|
+
required: true,
|
|
39
|
+
choices: [
|
|
40
|
+
{ label: 'Purchase', value: 'p' },
|
|
41
|
+
{ label: 'Transaction', value: 'f' }
|
|
42
|
+
],
|
|
43
|
+
default: 'p'
|
|
44
|
+
};
|
|
45
|
+
exports.eventData = {
|
|
46
|
+
label: 'Event Data',
|
|
47
|
+
description: 'Ecommerce event data including total and products.',
|
|
48
|
+
type: 'object',
|
|
49
|
+
required: false,
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
properties: {
|
|
52
|
+
total: {
|
|
53
|
+
label: 'Total',
|
|
54
|
+
description: 'Total value of the transaction.',
|
|
55
|
+
type: 'number',
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
currency: {
|
|
59
|
+
label: 'Currency',
|
|
60
|
+
description: 'Currency code for the transaction.',
|
|
61
|
+
type: 'string',
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
order_id: {
|
|
65
|
+
label: 'Order ID',
|
|
66
|
+
description: 'Unique identifier for the order.',
|
|
67
|
+
type: 'string',
|
|
68
|
+
required: false
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
default: {
|
|
72
|
+
total: { '@path': '$.properties.total' },
|
|
73
|
+
currency: { '@path': '$.properties.currency' },
|
|
74
|
+
order_id: { '@path': '$.properties.order_id' }
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
exports.products = {
|
|
78
|
+
label: 'Products',
|
|
79
|
+
description: 'Array of products in the transaction.',
|
|
80
|
+
type: 'object',
|
|
81
|
+
multiple: true,
|
|
82
|
+
required: false,
|
|
83
|
+
additionalProperties: true,
|
|
84
|
+
properties: {
|
|
85
|
+
sku: {
|
|
86
|
+
label: 'SKU',
|
|
87
|
+
description: 'Product SKU.',
|
|
88
|
+
type: 'string',
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
price: {
|
|
92
|
+
label: 'Price',
|
|
93
|
+
description: 'Product price.',
|
|
94
|
+
type: 'number',
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
quantity: {
|
|
98
|
+
label: 'Quantity',
|
|
99
|
+
description: 'Product quantity.',
|
|
100
|
+
type: 'integer',
|
|
101
|
+
required: false
|
|
102
|
+
},
|
|
103
|
+
name: {
|
|
104
|
+
label: 'Product Name',
|
|
105
|
+
description: 'Product name.',
|
|
106
|
+
type: 'string',
|
|
107
|
+
required: false
|
|
108
|
+
},
|
|
109
|
+
category: {
|
|
110
|
+
label: 'Category',
|
|
111
|
+
description: 'Product category.',
|
|
112
|
+
type: 'string',
|
|
113
|
+
required: false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
default: {
|
|
117
|
+
'@arrayPath': [
|
|
118
|
+
'$.properties.products',
|
|
119
|
+
{
|
|
120
|
+
sku: {
|
|
121
|
+
'@path': '$.sku'
|
|
122
|
+
},
|
|
123
|
+
price: {
|
|
124
|
+
'@path': '$.price'
|
|
125
|
+
},
|
|
126
|
+
quantity: {
|
|
127
|
+
'@path': '$.quantity'
|
|
128
|
+
},
|
|
129
|
+
name: {
|
|
130
|
+
'@path': '$.name'
|
|
131
|
+
},
|
|
132
|
+
category: {
|
|
133
|
+
'@path': '$.category'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/destinations/taguchi/syncEvent/fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,MAAM,GAAe;IAC9B,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,yFAAyF;IACtG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACR,GAAG,EAAE;YACD,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,QAAQ;SACjB;QACD,KAAK,EAAE;YACH,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;SAClB;KACJ;IACD,OAAO,EAAE;QACL,GAAG,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;QAC5B,KAAK,EAAE;YACH,KAAK,EAAE;gBACP,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;gBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;gBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;aACjC;SACJ;KACJ;CACJ,CAAA;AAEY,QAAA,SAAS,GAAe;IACjC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE;QACL,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAC;QAChC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAC;KACtC;IACD,OAAO,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ACjB,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;SAClB;QACD,IAAI,EAAE;YACF,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,eAAe;YAC5B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAClB;QACD,QAAQ,EAAE;YACN,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAClB;KACJ;IACD,OAAO,EAAE;QACL,YAAY,EAAE;YACV,uBAAuB;YACvB;gBACA,GAAG,EAAE;oBACD,OAAO,EAAE,OAAO;iBACnB;gBACD,KAAK,EAAE;oBACH,OAAO,EAAE,SAAS;iBACrB;gBACD,QAAQ,EAAE;oBACN,OAAO,EAAE,YAAY;iBACxB;gBACD,IAAI,EAAE;oBACF,OAAO,EAAE,QAAQ;iBACpB;gBACD,QAAQ,EAAE;oBACN,OAAO,EAAE,YAAY;iBACxB;aACJ;SAAC;KACL;CACJ,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
target: {
|
|
3
|
+
ref?: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
};
|
|
6
|
+
eventType: string;
|
|
7
|
+
eventData?: {
|
|
8
|
+
total?: number;
|
|
9
|
+
currency?: string;
|
|
10
|
+
order_id?: string;
|
|
11
|
+
};
|
|
12
|
+
products?: {
|
|
13
|
+
sku?: string;
|
|
14
|
+
price?: number;
|
|
15
|
+
quantity?: number;
|
|
16
|
+
name?: string;
|
|
17
|
+
category?: string;
|
|
18
|
+
[k: string]: unknown;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/taguchi/syncEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("./utils");
|
|
4
|
+
const fields_1 = require("./fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Sync Event',
|
|
7
|
+
description: 'Sync ecommerce events to Taguchi.',
|
|
8
|
+
fields: {
|
|
9
|
+
target: fields_1.target,
|
|
10
|
+
eventType: fields_1.eventType,
|
|
11
|
+
eventData: fields_1.eventData,
|
|
12
|
+
products: fields_1.products
|
|
13
|
+
},
|
|
14
|
+
perform: async (request, { payload, settings }) => {
|
|
15
|
+
await (0, utils_1.send)(request, [payload], settings, false);
|
|
16
|
+
},
|
|
17
|
+
performBatch: async (request, { payload, settings }) => {
|
|
18
|
+
await (0, utils_1.send)(request, payload, settings, true);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.default = action;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/taguchi/syncEvent/index.ts"],"names":[],"mappings":";;AAGA,mCAA8B;AAC9B,qCAAiE;AAEjE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAE;QACN,MAAM,EAAN,eAAM;QACN,SAAS,EAAT,kBAAS;QACT,SAAS,EAAT,kBAAS;QACT,QAAQ,EAAR,iBAAQ;KACT;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,MAAM,IAAA,YAAI,EAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;IACjD,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QACrD,MAAM,IAAA,YAAI,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Product {
|
|
2
|
+
sku?: string;
|
|
3
|
+
price?: number;
|
|
4
|
+
quantity?: number;
|
|
5
|
+
name?: string;
|
|
6
|
+
category?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EventData {
|
|
9
|
+
total?: number;
|
|
10
|
+
products?: Product[];
|
|
11
|
+
currency?: string;
|
|
12
|
+
order_id?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface EventTarget {
|
|
16
|
+
ref?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
id?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface EventItem {
|
|
22
|
+
event: {
|
|
23
|
+
target: EventTarget;
|
|
24
|
+
data: EventData;
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type TaguchiEventJSON = EventItem[];
|
|
29
|
+
export type EventResponseJSON = {
|
|
30
|
+
code: number;
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/taguchi/syncEvent/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Payload } from './generated-types';
|
|
2
|
+
import { Settings } from '../generated-types';
|
|
3
|
+
import { RequestClient, MultiStatusResponse } from '@segment/actions-core';
|
|
4
|
+
import { EventResponseJSON } from './types';
|
|
5
|
+
export declare function validate(payloads: Payload[]): Payload[];
|
|
6
|
+
export declare function send(request: RequestClient, payloads: Payload[], settings: Settings, isBatch: boolean): Promise<MultiStatusResponse | import("@segment/actions-core").ModifiedResponse<EventResponseJSON>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validate = validate;
|
|
4
|
+
exports.send = send;
|
|
5
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
6
|
+
function validate(payloads) {
|
|
7
|
+
for (const payload of payloads) {
|
|
8
|
+
if (!payload.target || Object.keys(payload.target).length === 0) {
|
|
9
|
+
throw new actions_core_1.PayloadValidationError('At least one target identifier is required.');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return payloads;
|
|
13
|
+
}
|
|
14
|
+
async function send(request, payloads, settings, isBatch) {
|
|
15
|
+
if (!isBatch) {
|
|
16
|
+
validate(payloads);
|
|
17
|
+
}
|
|
18
|
+
const json = payloads.map((payload) => buildEventJSON(payload));
|
|
19
|
+
const response = await request(`${settings.integrationURL}/subscriber`, {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
json,
|
|
22
|
+
headers: {
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
Authorization: `Bearer ${settings.apiKey}`
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
if (isBatch) {
|
|
28
|
+
const multiStatusResponse = new actions_core_1.MultiStatusResponse();
|
|
29
|
+
response.data.forEach((res, index) => {
|
|
30
|
+
if (res.code >= 200 && res.code < 300) {
|
|
31
|
+
multiStatusResponse.setSuccessResponseAtIndex(index, {
|
|
32
|
+
status: res.code,
|
|
33
|
+
sent: json[index],
|
|
34
|
+
body: res
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
multiStatusResponse.setErrorResponseAtIndex(index, {
|
|
39
|
+
status: res.code,
|
|
40
|
+
sent: json[index],
|
|
41
|
+
body: res,
|
|
42
|
+
errormessage: res.description
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return multiStatusResponse;
|
|
47
|
+
}
|
|
48
|
+
return response;
|
|
49
|
+
}
|
|
50
|
+
function buildEventJSON(payload) {
|
|
51
|
+
const { products, eventData } = payload;
|
|
52
|
+
const data = { ...eventData, products };
|
|
53
|
+
const eventItem = {
|
|
54
|
+
event: {
|
|
55
|
+
target: payload.target,
|
|
56
|
+
data,
|
|
57
|
+
type: payload.eventType
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return eventItem;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/destinations/taguchi/syncEvent/utils.ts"],"names":[],"mappings":";;AAKA,4BAOC;AAED,oBAsCC;AAlDD,wDAAkH;AAGlH,SAAgB,QAAQ,CAAC,QAAmB;IAC1C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChE,MAAM,IAAI,qCAAsB,CAAC,6CAA6C,CAAC,CAAA;QACjF,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC;AAEM,KAAK,UAAU,IAAI,CAAC,OAAsB,EAAE,QAAmB,EAAE,QAAkB,EAAE,OAAgB;IAC1G,IAAG,CAAC,OAAO,EAAC,CAAC;QACX,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACpB,CAAC;IAED,MAAM,IAAI,GAAqB,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAEjF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAoB,GAAG,QAAQ,CAAC,cAAc,aAAa,EAAE;QACzF,MAAM,EAAE,MAAM;QACd,IAAI;QACJ,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,QAAQ,C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declare const identifiers: InputField;
|
|
3
|
+
export declare const traits: InputField;
|
|
4
|
+
export declare const timestamp: InputField;
|
|
5
|
+
export declare const subscribeLists: InputField;
|
|
6
|
+
export declare const unsubscribeLists: InputField;
|