@segment/action-destinations 3.253.0-staging-ee3deb0fd → 3.253.0-staging-950b4d9df
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/utils/index.d.ts +1 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +5 -2
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +98 -18
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -1
- package/dist/destinations/marketo-static-lists/addToList/index.js +2 -2
- package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.d.ts +4 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.d.ts +5 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js +33 -0
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.d.ts +6 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.d.ts +5 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.js +45 -0
- package/dist/destinations/yahoo-audiences/createSegment/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/utils.d.ts +4 -0
- package/dist/destinations/yahoo-audiences/utils.js +30 -0
- package/dist/destinations/yahoo-audiences/utils.js.map +1 -0
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ export declare const dateStringToFuzzyDate: (dateString: string | number) => fal
|
|
|
9
9
|
y: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const augmentFieldsWithConstituentFields: (fields: Record<string, InputField>) => Record<string, InputField>;
|
|
12
|
-
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<
|
|
12
|
+
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Phone> | Partial<Constituent> | Partial<Address> | Partial<OnlinePresence>)[];
|
|
13
13
|
export declare const buildConstituentPayloadFromPayload: (payload: StringIndexedObject) => Partial<CreateOrUpdateIndividualConstituentPayload>;
|
|
14
14
|
export declare const buildGiftDataFromPayload: (constituentId: string, payload: CreateGiftPayload) => Partial<Gift>;
|
|
15
15
|
export declare const buildConstituentActionDataFromPayload: (constituentId: string, payload: CreateConstituentAction) => Partial<ConstituentAction>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputField } from '@segment/actions-core';
|
|
2
2
|
import { RequestClient } from '@segment/actions-core';
|
|
3
|
-
import { Logger, StatsClient } from '@segment/actions-core/destination-kit';
|
|
3
|
+
import { Logger, StatsClient, DataFeedCache } from '@segment/actions-core/destination-kit';
|
|
4
4
|
import type { Settings } from '../generated-types';
|
|
5
5
|
import { Profile } from '../Profile';
|
|
6
6
|
export declare type ApiLookupConfig = {
|
|
@@ -13,6 +13,9 @@ export declare type ApiLookupConfig = {
|
|
|
13
13
|
headers?: object | undefined;
|
|
14
14
|
responseType: string;
|
|
15
15
|
};
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const getRequestId: ({ method, url, body, headers }: ApiLookupConfig) => string;
|
|
17
|
+
export declare const getCachedResponse: ({ responseType }: ApiLookupConfig, requestId: string, dataFeedCache: DataFeedCache, datafeedTags: string[]) => Promise<any>;
|
|
18
|
+
export declare const performApiLookup: (request: RequestClient, apiLookupConfig: ApiLookupConfig, profile: Profile, statsClient: StatsClient | undefined, tags: string[], settings: Settings, logger?: Logger | undefined, dataFeedCache?: DataFeedCache | undefined) => Promise<any>;
|
|
17
19
|
export declare const apiLookupActionFields: Record<string, InputField>;
|
|
18
20
|
export declare const apiLookupLiquidKey = "lookups";
|
|
21
|
+
export declare const FLAGON_NAME_DATA_FEEDS = "is-datafeeds-enabled";
|
|
@@ -1,46 +1,125 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiLookupLiquidKey = exports.apiLookupActionFields = exports.performApiLookup = void 0;
|
|
3
|
+
exports.FLAGON_NAME_DATA_FEEDS = exports.apiLookupLiquidKey = exports.apiLookupActionFields = exports.performApiLookup = exports.getCachedResponse = exports.getRequestId = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
4
5
|
const actions_core_1 = require("@segment/actions-core");
|
|
5
6
|
const liquidjs_1 = require("liquidjs");
|
|
6
7
|
const Liquid = new liquidjs_1.Liquid();
|
|
7
|
-
const
|
|
8
|
+
const maxResponseSizeBytes = 1000000;
|
|
9
|
+
const renderLiquidFields = async ({ id, url, body }, profile, datafeedTags, settings, logger) => {
|
|
8
10
|
let renderedUrl;
|
|
9
11
|
let renderedBody;
|
|
10
12
|
try {
|
|
11
13
|
renderedUrl = await Liquid.parseAndRender(url, { profile });
|
|
12
14
|
}
|
|
13
15
|
catch (error) {
|
|
14
|
-
logger?.error(`TE Messaging: Email
|
|
15
|
-
|
|
16
|
-
statsClient?.incr('actions-personas-messaging-sendgrid-error', 1, tags);
|
|
16
|
+
logger?.error(`TE Messaging: Email datafeed url parse failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
17
|
+
datafeedTags.push('error:true', `error_message:${error?.message}`, 'reason:rendering_failure', 'rendering:url');
|
|
17
18
|
throw new actions_core_1.IntegrationError('Unable to parse email api lookup url', 'api lookup url parse failure', 400);
|
|
18
19
|
}
|
|
19
20
|
try {
|
|
20
21
|
renderedBody = body ? await Liquid.parseAndRender(body, { profile }) : undefined;
|
|
21
22
|
}
|
|
22
23
|
catch (error) {
|
|
23
|
-
logger?.error(`TE Messaging: Email
|
|
24
|
-
|
|
25
|
-
statsClient?.incr('actions-personas-messaging-sendgrid-error', 1, tags);
|
|
24
|
+
logger?.error(`TE Messaging: Email datafeed body parse failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
25
|
+
datafeedTags.push('error:true', `error_message:${error?.message}`, 'reason:rendering_failure', 'rendering:body');
|
|
26
26
|
throw new actions_core_1.IntegrationError('Unable to parse email api lookup body', 'api lookup body parse failure', 400);
|
|
27
27
|
}
|
|
28
|
+
return {
|
|
29
|
+
renderedUrl,
|
|
30
|
+
renderedBody
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const getRequestId = ({ method, url, body, headers }) => {
|
|
34
|
+
const requestHash = crypto_1.createHash('sha256');
|
|
35
|
+
requestHash.update(`${method}${url}${body}${JSON.stringify(headers)}`);
|
|
36
|
+
const requestId = requestHash.digest('hex');
|
|
37
|
+
return requestId;
|
|
38
|
+
};
|
|
39
|
+
exports.getRequestId = getRequestId;
|
|
40
|
+
const getCachedResponse = async ({ responseType }, requestId, dataFeedCache, datafeedTags) => {
|
|
41
|
+
const cachedResponse = await dataFeedCache?.getRequestResponse(requestId);
|
|
42
|
+
if (!cachedResponse) {
|
|
43
|
+
datafeedTags.push('cache_hit:false');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
datafeedTags.push('cache_hit:true');
|
|
47
|
+
if (responseType === 'json') {
|
|
48
|
+
return JSON.parse(cachedResponse);
|
|
49
|
+
}
|
|
50
|
+
return cachedResponse;
|
|
51
|
+
};
|
|
52
|
+
exports.getCachedResponse = getCachedResponse;
|
|
53
|
+
const performApiLookup = async (request, apiLookupConfig, profile, statsClient, tags, settings, logger, dataFeedCache) => {
|
|
54
|
+
const { id, method, headers, cacheTtl, name } = apiLookupConfig;
|
|
55
|
+
const datafeedTags = [
|
|
56
|
+
...tags,
|
|
57
|
+
`datafeed_id:${id}`,
|
|
58
|
+
`datafeed_name:${name}`,
|
|
59
|
+
`space_id:${settings.spaceId}`,
|
|
60
|
+
`cache_ttl_greater_than_0:${cacheTtl > 0}`
|
|
61
|
+
];
|
|
28
62
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
const { renderedUrl, renderedBody } = await renderLiquidFields(apiLookupConfig, profile, datafeedTags, settings, logger);
|
|
64
|
+
const requestId = exports.getRequestId({ ...apiLookupConfig, url: renderedUrl, body: renderedBody });
|
|
65
|
+
if (cacheTtl > 0 && dataFeedCache) {
|
|
66
|
+
const cachedResponse = await exports.getCachedResponse(apiLookupConfig, requestId, dataFeedCache, datafeedTags);
|
|
67
|
+
if (cachedResponse) {
|
|
68
|
+
datafeedTags.push('error:false');
|
|
69
|
+
return cachedResponse;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
let data;
|
|
73
|
+
try {
|
|
74
|
+
const res = await request(renderedUrl, {
|
|
75
|
+
headers: headers ?? undefined,
|
|
76
|
+
timeout: 3000,
|
|
77
|
+
method: method,
|
|
78
|
+
body: renderedBody,
|
|
79
|
+
skipResponseCloning: true
|
|
80
|
+
});
|
|
81
|
+
data = await res.data;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
const respError = error.response;
|
|
85
|
+
logger?.error(`TE Messaging: Email api lookup failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
86
|
+
datafeedTags.push(`error:true`, `error_message:${error.message}`, `error_status:${respError?.status}`, 'reason:api_call_failure');
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
const dataString = JSON.stringify(data);
|
|
90
|
+
const size = Buffer.byteLength(dataString, 'utf-8');
|
|
91
|
+
datafeedTags.push(`response_size_greater_than_mb:${size > maxResponseSizeBytes}`);
|
|
92
|
+
if (cacheTtl > 0) {
|
|
93
|
+
if (size <= maxResponseSizeBytes) {
|
|
94
|
+
try {
|
|
95
|
+
await dataFeedCache?.setRequestResponse(requestId, dataString, cacheTtl / 1000);
|
|
96
|
+
datafeedTags.push('cache_set:true');
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
logger?.error(`TE Messaging: Email api lookup cache set failure - api lookup id: ${id} - ${settings.spaceId} - [${err}]`);
|
|
100
|
+
datafeedTags.push('cache_set:false');
|
|
101
|
+
datafeedTags.push('error:true', 'reason:cache_set_failure', `error_message:${err?.message}`);
|
|
102
|
+
throw err;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
datafeedTags.push('cache_set:false');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return data;
|
|
37
110
|
}
|
|
38
111
|
catch (error) {
|
|
112
|
+
const isErrorCapturedInTags = datafeedTags.find((str) => str.includes('error:true'));
|
|
113
|
+
if (!isErrorCapturedInTags) {
|
|
114
|
+
datafeedTags.push('error:true', `error_message:${error?.message}`, 'reason:unknown');
|
|
115
|
+
}
|
|
116
|
+
tags.push('reason:datafeed_failure');
|
|
39
117
|
logger?.error(`TE Messaging: Email api lookup failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
40
|
-
tags.push('reason:apilookup_failure');
|
|
41
|
-
statsClient?.incr('actions-personas-messaging-sendgrid-error', 1, tags);
|
|
42
118
|
throw error;
|
|
43
119
|
}
|
|
120
|
+
finally {
|
|
121
|
+
statsClient?.incr('datafeed-execution', 1, datafeedTags);
|
|
122
|
+
}
|
|
44
123
|
};
|
|
45
124
|
exports.performApiLookup = performApiLookup;
|
|
46
125
|
exports.apiLookupActionFields = {
|
|
@@ -91,4 +170,5 @@ exports.apiLookupActionFields = {
|
|
|
91
170
|
}
|
|
92
171
|
};
|
|
93
172
|
exports.apiLookupLiquidKey = 'lookups';
|
|
173
|
+
exports.FLAGON_NAME_DATA_FEEDS = 'is-datafeeds-enabled';
|
|
94
174
|
//# sourceMappingURL=api-lookups.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-lookups.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/api-lookups.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AAKxD,uCAA6C;
|
|
1
|
+
{"version":3,"file":"api-lookups.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/api-lookups.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,wDAAwD;AAKxD,uCAA6C;AAI7C,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAE7B,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAcpC,MAAM,kBAAkB,GAAG,KAAK,EAC9B,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAgD,EAC/D,OAAgB,EAChB,YAAsB,EACtB,QAAkB,EAClB,MAA2B,EAC3B,EAAE;IACF,IAAI,WAAmB,CAAA;IACvB,IAAI,YAAgC,CAAA;IACpC,IAAI;QACF,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;KAC5D;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,EAAE,KAAK,CACX,mEAAmE,EAAE,MAAM,QAAQ,CAAC,OAAO,OAAO,KAAK,GAAG,CAC3G,CAAA;QACD,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,iBAAiB,KAAK,EAAE,OAAO,EAAE,EAAE,0BAA0B,EAAE,eAAe,CAAC,CAAA;QAC/G,MAAM,IAAI,+BAAgB,CAAC,sCAAsC,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;KACxG;IACD,IAAI;QACF,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;KACjF;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,EAAE,KAAK,CACX,oEAAoE,EAAE,MAAM,QAAQ,CAAC,OAAO,OAAO,KAAK,GAAG,CAC5G,CAAA;QACD,Y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;QACpE,IAAI,EAAE,QAAQ;KACf;IACD,OAAO,EAAE;QACP,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,QAAQ;KACf;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,mEAAmE;QAChF,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;CACF,CAAA;AAEY,QAAA,kBAAkB,GAAG,SAAS,CAAA;AAE9B,QAAA,sBAAsB,GAAG,sBAAsB,CAAA"}
|
|
@@ -84,8 +84,8 @@ const action = {
|
|
|
84
84
|
},
|
|
85
85
|
performBatch: async (request, { settings, payload, statsContext, hookOutputs }) => {
|
|
86
86
|
statsContext?.statsClient?.incr('addToAudience.batch', 1, statsContext?.tags);
|
|
87
|
-
if (hookOutputs?.retlOnMappingSave?.outputs.
|
|
88
|
-
payload[0].external_id = hookOutputs?.retlOnMappingSave?.outputs.
|
|
87
|
+
if (hookOutputs?.retlOnMappingSave?.outputs.id) {
|
|
88
|
+
payload[0].external_id = hookOutputs?.retlOnMappingSave?.outputs.id;
|
|
89
89
|
}
|
|
90
90
|
return functions_1.addToList(request, settings, payload, statsContext);
|
|
91
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/marketo-static-lists/addToList/index.ts"],"names":[],"mappings":";;AAGA,8CAAwG;AACxG,4CAA6D;AAE7D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,yDAAyD;IACtE,mBAAmB,EAAE,4BAA4B;IACjD,MAAM,EAAE;QACN,WAAW,EAAE,EAAE,GAAG,wBAAW,EAAE;QAC/B,YAAY,EAAE,EAAE,GAAG,yBAAY,EAAE;QACjC,IAAI,EAAE,EAAE,GAAG,iBAAI,EAAE;QACjB,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;QACvC,UAAU,EAAE,EAAE,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AE,MAAM;4BACV,IAAI,EAAE,UAAU,CAAC,SAAS;yBAC3B;qBACF,CAAA;iBACF;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO;wBACL,KAAK,EAAE;4BACL,OAAO,EAAE,uBAAuB;4BAChC,IAAI,EAAE,qBAAqB;yBAC5B;qBACF,CAAA;iBACF;YACH,CAAC;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,EAAE;QAC3E,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAEvE,IAAI,WAAW,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,EAAE;YAC9C,OAAO,CAAC,WAAW,GAAG,WAAW,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,CAAA;SACjE;QACD,OAAO,qBAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,CAAA;IAC9D,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,EAAE;QAChF,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAE7E,IAAI,WAAW,EAAE,iBAAiB,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/marketo-static-lists/addToList/index.ts"],"names":[],"mappings":";;AAGA,8CAAwG;AACxG,4CAA6D;AAE7D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,yDAAyD;IACtE,mBAAmB,EAAE,4BAA4B;IACjD,MAAM,EAAE;QACN,WAAW,EAAE,EAAE,GAAG,wBAAW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D,OAAO,qBAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IAC5D,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createCustomerNode/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_tax_1 = require("../utils-tax");
|
|
4
|
+
const utils_tax_2 = require("../utils-tax");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Create top-level CUSTOMER node in Yahoo taxonomy',
|
|
7
|
+
defaultSubscription: 'event = "Audience Entered" and event = "Audience Exited"',
|
|
8
|
+
description: '',
|
|
9
|
+
fields: {
|
|
10
|
+
engage_space_id: {
|
|
11
|
+
label: 'Engage Space Id',
|
|
12
|
+
description: 'Provide Engage Space Id found in Unify > Settings > API Access. This maps to the "Id" and "Name" of the top-level Customer node in Yahoo taxonomy',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
customer_desc: {
|
|
17
|
+
label: 'Customer Description',
|
|
18
|
+
description: 'Provide a description for the Customer node in Yahoo taxonomy. This must be less then 1000 characters',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
perform: async (request, { settings, payload }) => {
|
|
24
|
+
const tx_creds = {
|
|
25
|
+
tx_client_key: settings.taxonomy_client_key,
|
|
26
|
+
tx_client_secret: settings.taxonomy_client_secret
|
|
27
|
+
};
|
|
28
|
+
const taxonomy_payload = utils_tax_1.gen_customer_taxonomy_payload(settings, payload);
|
|
29
|
+
return await utils_tax_2.update_taxonomy('', tx_creds, request, taxonomy_payload);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.default = action;
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createCustomerNode/index.ts"],"names":[],"mappings":";;AAGA,4CAA4D;AAC5D,4CAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kDAAkD;IACzD,mBAAmB,EAAE,0DAA0D;IAC/E,WAAW,EAAE,EAAE;IACf,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,mJAAmJ;YACrJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,uGAAuG;YACzG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG;YACf,aAAa,EAAE,QAAQ,CAAC,mBAAmB;YAC3C,gBAAgB,EAAE,QAAQ,CAAC,sBAAsB;SAClD,CAAA;QACD,MAAM,gBAAgB,GAAG,yCAA6B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACzE,OAAO,MAAM,2BAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAA;IACvE,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createSegment/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_tax_1 = require("../utils-tax");
|
|
4
|
+
const utils_tax_2 = require("../utils-tax");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Create SEGMENT sub-node in Yahoo taxonomy',
|
|
7
|
+
description: 'Use this action to generate SEGMENT sub-node within CUSTOMER node in Yahoo taxonomy',
|
|
8
|
+
defaultSubscription: 'event = "Audience Entered" and event = "Audience Exited"',
|
|
9
|
+
fields: {
|
|
10
|
+
segment_audience_key: {
|
|
11
|
+
label: 'Audience Key',
|
|
12
|
+
description: 'Provide audience key. This maps to the "Name" of the Segment node in Yahoo taxonomy',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
segment_audience_id: {
|
|
17
|
+
label: 'Audience Id',
|
|
18
|
+
description: 'Provide audience Id (aud_...) from audience URL in Segment Engage. This maps to the "Id" of the Segment node in Yahoo taxonomy',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
engage_space_id: {
|
|
23
|
+
label: 'Engage Space Id',
|
|
24
|
+
description: 'Provide Engage Space Id found in Unify > Settings > API Access. This maps to the "Id" and "Name" of the top-level Customer node in Yahoo taxonomy and specifies the parent node for your Segment node in Yahoo taxonomy',
|
|
25
|
+
type: 'string',
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
customer_desc: {
|
|
29
|
+
label: 'Space Description',
|
|
30
|
+
description: 'Provide the description for Segment node in Yahoo taxonomy. This must be less then 1000 characters',
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
perform: async (request, { payload, settings }) => {
|
|
36
|
+
const tx_creds = {
|
|
37
|
+
tx_client_key: settings.taxonomy_client_key,
|
|
38
|
+
tx_client_secret: settings.taxonomy_client_secret
|
|
39
|
+
};
|
|
40
|
+
const body_form_data = utils_tax_1.gen_segment_subtaxonomy_payload(payload);
|
|
41
|
+
return await utils_tax_2.update_taxonomy(String(payload.engage_space_id), tx_creds, request, body_form_data);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.default = action;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createSegment/index.ts"],"names":[],"mappings":";;AAIA,4CAA8D;AAC9D,4CAA8C;AAG9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,2CAA2C;IAClD,WAAW,EAAE,qFAAqF;IAClG,mBAAmB,EAAE,0DAA0D;IAE/E,MAAM,EAAE;QACN,oBAAoB,EAAE;YACpB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,qFAAqF;YAClG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,aAAa;YACpB,WAAW,EACT,gIAAgI;YAClI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,yNAAyN;YAC3N,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,aAAa,EAAE;YACb,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,oGAAoG;YACjH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG;YACf,aAAa,EAAE,QAAQ,CAAC,mBAAmB;YAC3C,gBAAgB,EAAE,QAAQ,CAAC,sBAAsB;SAClD,CAAA;QAED,MAAM,cAAc,GAAG,2CAA+B,CAAC,OAAO,CAAC,CAAA;QAC/D,OAAO,MAAM,2BAAe,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IAClG,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RequestClient } from '@segment/actions-core';
|
|
2
|
+
import { CredsObj } from './types';
|
|
3
|
+
export declare function gen_random_id(length: number): string;
|
|
4
|
+
export declare function update_taxonomy(engage_space_id: string, tx_creds: CredsObj, request: RequestClient, body_form_data: string): Promise<any>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update_taxonomy = exports.gen_random_id = void 0;
|
|
4
|
+
const utils_tax_1 = require("./utils-tax");
|
|
5
|
+
function gen_random_id(length) {
|
|
6
|
+
const pattern = 'abcdefghijklmnopqrstuvwxyz123456789';
|
|
7
|
+
const result = [];
|
|
8
|
+
for (let i = 0; i < length; i++) {
|
|
9
|
+
result.push(pattern[Math.floor(Math.random() * pattern.length)]);
|
|
10
|
+
}
|
|
11
|
+
return result.join('');
|
|
12
|
+
}
|
|
13
|
+
exports.gen_random_id = gen_random_id;
|
|
14
|
+
async function update_taxonomy(engage_space_id, tx_creds, request, body_form_data) {
|
|
15
|
+
const tx_client_secret = tx_creds.tx_client_key;
|
|
16
|
+
const tx_client_key = tx_creds.tx_client_secret;
|
|
17
|
+
const url = `https://datax.yahooapis.com/v1/taxonomy/append${engage_space_id.length > 0 ? '/' + engage_space_id : ''}`;
|
|
18
|
+
const oauth1_auth_string = utils_tax_1.gen_oauth1_signature(tx_client_key, tx_client_secret, 'PUT', url);
|
|
19
|
+
const add_segment_node = await request(url, {
|
|
20
|
+
method: 'PUT',
|
|
21
|
+
body: body_form_data,
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: oauth1_auth_string,
|
|
24
|
+
'Content-Type': 'multipart/form-data; boundary=SEGMENT-DATA'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return await add_segment_node.json();
|
|
28
|
+
}
|
|
29
|
+
exports.update_taxonomy = update_taxonomy;
|
|
30
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/yahoo-audiences/utils.ts"],"names":[],"mappings":";;;AAEA,2CAAkD;AAQlD,SAAgB,aAAa,CAAC,MAAc;IAC1C,MAAM,OAAO,GAAG,qCAAqC,CAAA;IACrD,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;KACjE;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxB,CAAC;AAPD,sCAOC;AAEM,KAAK,UAAU,eAAe,CACnC,eAAuB,EACvB,QAAkB,EAClB,OAAsB,EACtB,cAAsB;IAEtB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAA;IAC/C,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAA;IAC/C,MAAM,GAAG,GAAG,iDAAiD,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;IACtH,MAAM,kBAAkB,GAAG,gCAAoB,CAAC,aAAa,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IAE5F,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE;YACP,aAAa,EAAE,kBAAkB;YACjC,cAAc,EAAE,4CAA4C;SAC7D;KACF,CAAC,CAAA;IAEF,OAAO,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAA;AACtC,CAAC;AArBD,0CAqBC"}
|
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.253.0-staging-
|
|
4
|
+
"version": "3.253.0-staging-950b4d9df",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@bufbuild/protobuf": "^1.4.2",
|
|
44
44
|
"@bufbuild/protoc-gen-es": "^1.4.2",
|
|
45
45
|
"@segment/a1-notation": "^2.1.4",
|
|
46
|
-
"@segment/actions-core": "3.102.0-staging-
|
|
46
|
+
"@segment/actions-core": "3.102.0-staging-950b4d9df",
|
|
47
47
|
"@segment/actions-shared": "^1.83.0",
|
|
48
48
|
"@types/node": "^18.11.15",
|
|
49
49
|
"ajv-formats": "^2.1.1",
|