@segment/action-destinations 3.258.0-staging-3d1490e68 → 3.258.0-staging-52cd499a1
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/customerio/test-helper.d.ts +1 -1
- package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
- package/dist/destinations/{responsys-cloud/types.js → engage/sendgrid/Profile.js} +1 -1
- package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +21 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +174 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +1 -1
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +7 -0
- package/dist/destinations/google-enhanced-conversions/functions.js +7 -3
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/responsys-cloud/generated-types.d.ts +0 -20
- package/dist/destinations/responsys-cloud/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/index.d.ts +0 -4
- package/dist/destinations/responsys-cloud/index.js +0 -207
- package/dist/destinations/responsys-cloud/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.d.ts +0 -16
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/sendAudience/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendAudience/index.d.ts +0 -5
- package/dist/destinations/responsys-cloud/sendAudience/index.js +0 -109
- package/dist/destinations/responsys-cloud/sendAudience/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.d.ts +0 -11
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/sendCustomTraits/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.d.ts +0 -5
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js +0 -72
- package/dist/destinations/responsys-cloud/sendCustomTraits/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/shared_properties.d.ts +0 -3
- package/dist/destinations/responsys-cloud/shared_properties.js +0 -19
- package/dist/destinations/responsys-cloud/shared_properties.js.map +0 -1
- package/dist/destinations/responsys-cloud/types.d.ts +0 -38
- package/dist/destinations/responsys-cloud/types.js.map +0 -1
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.d.ts +0 -14
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js +0 -3
- package/dist/destinations/responsys-cloud/upsertListMember/generated-types.js.map +0 -1
- package/dist/destinations/responsys-cloud/upsertListMember/index.d.ts +0 -5
- package/dist/destinations/responsys-cloud/upsertListMember/index.js +0 -85
- package/dist/destinations/responsys-cloud/upsertListMember/index.js.map +0 -1
- package/dist/destinations/responsys-cloud/utils.d.ts +0 -20
- package/dist/destinations/responsys-cloud/utils.js +0 -179
- package/dist/destinations/responsys-cloud/utils.js.map +0 -1
|
@@ -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<Address> | Partial<OnlinePresence> | Partial<Phone> | Partial<Constituent>)[];
|
|
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>;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import nock from 'nock';
|
|
3
3
|
import { AccountRegion } from './utils';
|
|
4
4
|
export declare const nockTrackInternalEndpoint: (region: AccountRegion) => nock.Scope;
|
|
5
|
-
export declare function getDefaultMappings(action: string): import("lodash").Dictionary<import("@segment/actions-core/
|
|
5
|
+
export declare function getDefaultMappings(action: string): import("lodash").Dictionary<import("@segment/actions-core/destination-kittypes").FieldValue | undefined>;
|
|
6
6
|
export declare function testRunner(fn: Function): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../../../../src/destinations/engage/sendgrid/Profile.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InputField } from '@segment/actions-core';
|
|
2
|
+
import { RequestClient } from '@segment/actions-core';
|
|
3
|
+
import { Logger, StatsClient, DataFeedCache } from '@segment/actions-core/destination-kit';
|
|
4
|
+
import type { Settings } from '../generated-types';
|
|
5
|
+
import { Profile } from '../Profile';
|
|
6
|
+
export declare type ApiLookupConfig = {
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
name: string;
|
|
9
|
+
url: string;
|
|
10
|
+
method: string;
|
|
11
|
+
cacheTtl: number;
|
|
12
|
+
body?: string | undefined;
|
|
13
|
+
headers?: object | undefined;
|
|
14
|
+
responseType: string;
|
|
15
|
+
};
|
|
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>;
|
|
19
|
+
export declare const apiLookupActionFields: Record<string, InputField>;
|
|
20
|
+
export declare const apiLookupLiquidKey = "lookups";
|
|
21
|
+
export declare const FLAGON_NAME_DATA_FEEDS = "is-datafeeds-enabled";
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FLAGON_NAME_DATA_FEEDS = exports.apiLookupLiquidKey = exports.apiLookupActionFields = exports.performApiLookup = exports.getCachedResponse = exports.getRequestId = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
6
|
+
const liquidjs_1 = require("liquidjs");
|
|
7
|
+
const Liquid = new liquidjs_1.Liquid();
|
|
8
|
+
const maxResponseSizeBytes = 1000000;
|
|
9
|
+
const renderLiquidFields = async ({ id, url, body }, profile, datafeedTags, settings, logger) => {
|
|
10
|
+
let renderedUrl;
|
|
11
|
+
let renderedBody;
|
|
12
|
+
try {
|
|
13
|
+
renderedUrl = await Liquid.parseAndRender(url, { profile });
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
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');
|
|
18
|
+
throw new actions_core_1.IntegrationError('Unable to parse email api lookup url', 'api lookup url parse failure', 400);
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
renderedBody = body ? await Liquid.parseAndRender(body, { profile }) : undefined;
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
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
|
+
throw new actions_core_1.IntegrationError('Unable to parse email api lookup body', 'api lookup body parse failure', 400);
|
|
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
|
+
];
|
|
62
|
+
try {
|
|
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;
|
|
110
|
+
}
|
|
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');
|
|
117
|
+
logger?.error(`TE Messaging: Email api lookup failure - api lookup id: ${id} - ${settings.spaceId} - [${error}]`);
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
statsClient?.incr('datafeed-execution', 1, datafeedTags);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
exports.performApiLookup = performApiLookup;
|
|
125
|
+
exports.apiLookupActionFields = {
|
|
126
|
+
id: {
|
|
127
|
+
label: 'ID',
|
|
128
|
+
description: 'The id of the API lookup for use in logging & observability',
|
|
129
|
+
type: 'string'
|
|
130
|
+
},
|
|
131
|
+
name: {
|
|
132
|
+
label: 'Name',
|
|
133
|
+
description: 'The name of the API lookup referenced in liquid syntax',
|
|
134
|
+
type: 'string',
|
|
135
|
+
required: true
|
|
136
|
+
},
|
|
137
|
+
url: {
|
|
138
|
+
label: 'URL',
|
|
139
|
+
description: 'The URL endpoint to call',
|
|
140
|
+
type: 'string',
|
|
141
|
+
required: true
|
|
142
|
+
},
|
|
143
|
+
method: {
|
|
144
|
+
label: 'Request Method',
|
|
145
|
+
description: 'The request method, e.g. GET/POST/etc.',
|
|
146
|
+
type: 'string',
|
|
147
|
+
required: true
|
|
148
|
+
},
|
|
149
|
+
cacheTtl: {
|
|
150
|
+
label: 'Cache TTL',
|
|
151
|
+
description: 'The cache TTL in ms',
|
|
152
|
+
type: 'integer',
|
|
153
|
+
required: true
|
|
154
|
+
},
|
|
155
|
+
body: {
|
|
156
|
+
label: 'Request Body',
|
|
157
|
+
description: 'The request body for use with POST/PUT/PATCH requests',
|
|
158
|
+
type: 'string'
|
|
159
|
+
},
|
|
160
|
+
headers: {
|
|
161
|
+
label: 'Request Headers',
|
|
162
|
+
description: 'Headers in JSON to be sent with the request',
|
|
163
|
+
type: 'object'
|
|
164
|
+
},
|
|
165
|
+
responseType: {
|
|
166
|
+
label: 'Response Type',
|
|
167
|
+
description: 'The response type of the request. Currently only supporting JSON.',
|
|
168
|
+
type: 'string',
|
|
169
|
+
required: true
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
exports.apiLookupLiquidKey = 'lookups';
|
|
173
|
+
exports.FLAGON_NAME_DATA_FEEDS = 'is-datafeeds-enabled';
|
|
174
|
+
//# sourceMappingURL=api-lookups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,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AAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,GAAG,EAAE;QACH,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,MAAM,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,wCAAwC;QACrD,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,uDAAuD;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"}
|
|
@@ -12,7 +12,7 @@ export declare abstract class EngageActionPerformer<TSettings = any, TPayload =
|
|
|
12
12
|
readonly executeInput: ExecuteInput<TSettings, TPayload>;
|
|
13
13
|
readonly logger: EngageLogger;
|
|
14
14
|
readonly statsClient: EngageStats;
|
|
15
|
-
readonly dataFeedCache: import("@segment/actions-core/
|
|
15
|
+
readonly dataFeedCache: import("@segment/actions-core/destination-kit").DataFeedCache | undefined;
|
|
16
16
|
readonly currentOperation: OperationContext | undefined;
|
|
17
17
|
readonly payload: TPayload;
|
|
18
18
|
readonly settings: TSettings;
|
|
@@ -2,9 +2,16 @@ import { ConversionCustomVariable, PartialErrorResponse, QueryResponse } from '.
|
|
|
2
2
|
import { ModifiedResponse, RequestClient, DynamicFieldResponse } from '@segment/actions-core';
|
|
3
3
|
import { StatsContext } from '@segment/actions-core/destination-kit';
|
|
4
4
|
import { Features } from '@segment/actions-core/mapping-kit';
|
|
5
|
+
import { HTTPError } from '@segment/actions-core';
|
|
5
6
|
export declare const API_VERSION = "v15";
|
|
6
7
|
export declare const CANARY_API_VERSION = "v15";
|
|
7
8
|
export declare const FLAGON_NAME = "google-enhanced-canary-version";
|
|
9
|
+
export declare class GoogleAdsError extends HTTPError {
|
|
10
|
+
response: Response & {
|
|
11
|
+
status: string;
|
|
12
|
+
statusText: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
8
15
|
export declare function formatCustomVariables(customVariables: object, customVariableIdsResults: Array<ConversionCustomVariable>): object;
|
|
9
16
|
export declare const hash: (value: string | undefined) => string | undefined;
|
|
10
17
|
export declare function getCustomVariables(customerId: string, auth: any, request: RequestClient, features: Features | undefined, statsContext: StatsContext | undefined): Promise<ModifiedResponse<QueryResponse[]>>;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.commonHashedEmailValidation = exports.isHashedEmail = exports.getApiVersion = exports.convertTimestamp = exports.handleGoogleErrors = exports.getConversionActionDynamicData = exports.getConversionActionId = exports.getCustomVariables = exports.hash = exports.formatCustomVariables = exports.FLAGON_NAME = exports.CANARY_API_VERSION = exports.API_VERSION = void 0;
|
|
3
|
+
exports.commonHashedEmailValidation = exports.isHashedEmail = exports.getApiVersion = exports.convertTimestamp = exports.handleGoogleErrors = exports.getConversionActionDynamicData = exports.getConversionActionId = exports.getCustomVariables = exports.hash = exports.formatCustomVariables = exports.GoogleAdsError = exports.FLAGON_NAME = exports.CANARY_API_VERSION = exports.API_VERSION = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
5
|
const actions_core_1 = require("@segment/actions-core");
|
|
6
6
|
const formats_1 = require("ajv-formats/dist/formats");
|
|
7
|
+
const actions_core_2 = require("@segment/actions-core");
|
|
7
8
|
exports.API_VERSION = 'v15';
|
|
8
9
|
exports.CANARY_API_VERSION = 'v15';
|
|
9
10
|
exports.FLAGON_NAME = 'google-enhanced-canary-version';
|
|
11
|
+
class GoogleAdsError extends actions_core_2.HTTPError {
|
|
12
|
+
}
|
|
13
|
+
exports.GoogleAdsError = GoogleAdsError;
|
|
10
14
|
function formatCustomVariables(customVariables, customVariableIdsResults) {
|
|
11
15
|
const resourceNames = {};
|
|
12
16
|
Object.entries(customVariableIdsResults).forEach(([_, customVariablesIds]) => {
|
|
@@ -78,8 +82,8 @@ async function getConversionActionDynamicData(request, settings, auth, features,
|
|
|
78
82
|
choices: [],
|
|
79
83
|
nextPage: '',
|
|
80
84
|
error: {
|
|
81
|
-
message: err.
|
|
82
|
-
code: err.status + '' ?? '
|
|
85
|
+
message: err.response?.statusText ?? 'Unknown error',
|
|
86
|
+
code: err.response?.status + '' ?? '500'
|
|
83
87
|
}
|
|
84
88
|
};
|
|
85
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/functions.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAQnC,
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/functions.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAQnC,wDAM8B;AAG9B,sDAAsD;AACtD,wDAAiD;AAEpC,QAAA,WAAW,GAAG,KAAK,CAAA;AACnB,QAAA,kBAAkB,GAAG,KAAK,CAAA;AAC1B,QAAA,WAAW,GAAG,gCAAgC,CAAA;AAE3D,MAAa,cAAe,SAAQ,wBAAS;CAK5C;AALD,wCAKC;AAED,SAAgB,qBAAqB,CACnC,eAAuB,EACvB,wBAAyD;IAGzD,MAAM,aAAa,GAA2B,EAAE,CAAA;IAChD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EAAE,IAAI,CAAC,CAAA;IAChD,OAAO,OAAO,CAAA;AAChB,CAAC;AARD,sCAQC;AAEM,MAAM,aAAa,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAAvF,QAAA,aAAa,iBAA0E;AAC7F,MAAM,2BAA2B,GAAG,CAAC,KAAa,EAAU,EAAE;IACnE,IAAI,qBAAa,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IAGD,IAAI,CAAE,qBAAW,CAAC,KAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAC9C,MAAM,IAAI,qCAAsB,CAAC,sDAAsD,CAAC,CAAA;KACzF;IAED,OAAO,MAAM,CAAC,YAAI,CAAC,KAAK,CAAC,CAAC,CAAA;AAC5B,CAAC,CAAA;AAXY,QAAA,2BAA2B,+BAWvC"}
|
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.258.0-staging-
|
|
4
|
+
"version": "3.258.0-staging-52cd499a1",
|
|
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.105.0-staging-
|
|
46
|
+
"@segment/actions-core": "3.105.0-staging-52cd499a1",
|
|
47
47
|
"@segment/actions-shared": "^1.86.0",
|
|
48
48
|
"@types/node": "^18.11.15",
|
|
49
49
|
"ajv-formats": "^2.1.1",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface Settings {
|
|
2
|
-
segmentWriteKey?: string;
|
|
3
|
-
segmentWriteKeyRegion?: string;
|
|
4
|
-
username: string;
|
|
5
|
-
userPassword: string;
|
|
6
|
-
baseUrl: string;
|
|
7
|
-
profileListName: string;
|
|
8
|
-
profileExtensionTable?: string;
|
|
9
|
-
insertOnNoMatch: boolean;
|
|
10
|
-
matchColumnName1: string;
|
|
11
|
-
matchColumnName2?: string;
|
|
12
|
-
updateOnMatch: string;
|
|
13
|
-
textValue?: string;
|
|
14
|
-
matchOperator?: string;
|
|
15
|
-
optoutValue?: string;
|
|
16
|
-
rejectRecordIfChannelEmpty?: string;
|
|
17
|
-
defaultPermissionStatus: string;
|
|
18
|
-
htmlValue?: string;
|
|
19
|
-
optinValue?: string;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/responsys-cloud/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,207 +0,0 @@
|
|
|
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 sendCustomTraits_1 = __importDefault(require("./sendCustomTraits"));
|
|
8
|
-
const sendAudience_1 = __importDefault(require("./sendAudience"));
|
|
9
|
-
const upsertListMember_1 = __importDefault(require("./upsertListMember"));
|
|
10
|
-
const destination = {
|
|
11
|
-
name: 'Responsys Cloud (Actions)',
|
|
12
|
-
slug: 'actions-responsys-cloud',
|
|
13
|
-
mode: 'cloud',
|
|
14
|
-
description: 'Send Profile List Member and Profile Extension Table data to Responsys.',
|
|
15
|
-
authentication: {
|
|
16
|
-
scheme: 'oauth2',
|
|
17
|
-
fields: {
|
|
18
|
-
segmentWriteKey: {
|
|
19
|
-
label: 'Segment Source WriteKey',
|
|
20
|
-
description: "Optionally forward Responses from Segment's requests to Responsys to a Segment Source.",
|
|
21
|
-
type: 'string',
|
|
22
|
-
required: false
|
|
23
|
-
},
|
|
24
|
-
segmentWriteKeyRegion: {
|
|
25
|
-
label: 'Segment WriteKey Region',
|
|
26
|
-
description: 'Segment Region to forward responses from Responsys to. Segment Source WriteKey must also be populated',
|
|
27
|
-
type: 'string',
|
|
28
|
-
choices: [
|
|
29
|
-
{ label: 'US', value: 'US' },
|
|
30
|
-
{ label: 'EU', value: 'EU' }
|
|
31
|
-
],
|
|
32
|
-
required: false,
|
|
33
|
-
default: 'US'
|
|
34
|
-
},
|
|
35
|
-
username: {
|
|
36
|
-
label: 'Username',
|
|
37
|
-
description: 'Responsys username',
|
|
38
|
-
type: 'string',
|
|
39
|
-
required: true
|
|
40
|
-
},
|
|
41
|
-
userPassword: {
|
|
42
|
-
label: 'Password',
|
|
43
|
-
description: 'Responsys password',
|
|
44
|
-
type: 'string',
|
|
45
|
-
required: true
|
|
46
|
-
},
|
|
47
|
-
baseUrl: {
|
|
48
|
-
label: 'Responsys endpoint URL',
|
|
49
|
-
description: "Responsys endpoint URL. Refer to Responsys documentation for more details. Must start with 'HTTPS://'. See [Responsys docs](https://docs.oracle.com/en/cloud/saas/marketing/responsys-develop/API/GetStarted/Authentication/auth-endpoints-rest.htm).",
|
|
50
|
-
type: 'string',
|
|
51
|
-
format: 'uri',
|
|
52
|
-
required: true
|
|
53
|
-
},
|
|
54
|
-
profileListName: {
|
|
55
|
-
label: 'List Name',
|
|
56
|
-
description: "Name of the Profile Extension Table's Contact List.",
|
|
57
|
-
type: 'string',
|
|
58
|
-
required: true
|
|
59
|
-
},
|
|
60
|
-
profileExtensionTable: {
|
|
61
|
-
label: 'PET Name',
|
|
62
|
-
description: 'Profile Extension Table (PET) Name. Required if using the "Send Custom Traits" Action.',
|
|
63
|
-
type: 'string',
|
|
64
|
-
required: false
|
|
65
|
-
},
|
|
66
|
-
insertOnNoMatch: {
|
|
67
|
-
label: 'Insert On No Match',
|
|
68
|
-
description: 'Indicates what should be done for records where a match is not found.',
|
|
69
|
-
type: 'boolean',
|
|
70
|
-
default: true,
|
|
71
|
-
required: true
|
|
72
|
-
},
|
|
73
|
-
matchColumnName1: {
|
|
74
|
-
label: 'First Column Match',
|
|
75
|
-
description: 'First match column for determining whether an insert or update should occur.',
|
|
76
|
-
type: 'string',
|
|
77
|
-
choices: [
|
|
78
|
-
{ label: 'RIID', value: 'RIID' },
|
|
79
|
-
{ label: 'CUSTOMER_ID', value: 'CUSTOMER_ID' },
|
|
80
|
-
{ label: 'EMAIL_ADDRESS', value: 'EMAIL_ADDRESS' },
|
|
81
|
-
{ label: 'MOBILE_NUMBER', value: 'MOBILE_NUMBER' },
|
|
82
|
-
{ label: 'EMAIL_MD5_HASH', value: 'EMAIL_MD5_HASH' },
|
|
83
|
-
{ label: 'EMAIL_SHA256_HASH', value: 'EMAIL_SHA256_HASH' }
|
|
84
|
-
],
|
|
85
|
-
default: 'EMAIL_ADDRESS',
|
|
86
|
-
required: true
|
|
87
|
-
},
|
|
88
|
-
matchColumnName2: {
|
|
89
|
-
label: 'Second Column Match',
|
|
90
|
-
description: 'Second match column for determining whether an insert or update should occur.',
|
|
91
|
-
type: 'string',
|
|
92
|
-
choices: [
|
|
93
|
-
{ label: 'RIID', value: 'RIID' },
|
|
94
|
-
{ label: 'CUSTOMER_ID', value: 'CUSTOMER_ID' },
|
|
95
|
-
{ label: 'EMAIL_ADDRESS', value: 'EMAIL_ADDRESS' },
|
|
96
|
-
{ label: 'MOBILE_NUMBER', value: 'MOBILE_NUMBER' },
|
|
97
|
-
{ label: 'EMAIL_MD5_HASH', value: 'EMAIL_MD5_HASH' },
|
|
98
|
-
{ label: 'EMAIL_SHA256_HASH', value: 'EMAIL_SHA256_HASH' }
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
updateOnMatch: {
|
|
102
|
-
label: 'Update On Match',
|
|
103
|
-
description: 'Controls how the existing record should be updated. Defaults to Replace All.',
|
|
104
|
-
type: 'string',
|
|
105
|
-
required: true,
|
|
106
|
-
choices: [
|
|
107
|
-
{ label: 'Replace All', value: 'REPLACE_ALL' },
|
|
108
|
-
{ label: 'No Update', value: 'NO_UPDATE' }
|
|
109
|
-
],
|
|
110
|
-
default: 'REPLACE_ALL'
|
|
111
|
-
},
|
|
112
|
-
textValue: {
|
|
113
|
-
label: 'Text Value',
|
|
114
|
-
description: "Value of incoming preferred email format data. For example, 'T' may represent a preference for Text formatted email.",
|
|
115
|
-
type: 'string'
|
|
116
|
-
},
|
|
117
|
-
matchOperator: {
|
|
118
|
-
label: 'Match Operator',
|
|
119
|
-
description: 'Operator to join match column names.',
|
|
120
|
-
type: 'string',
|
|
121
|
-
choices: [
|
|
122
|
-
{ label: 'None', value: 'NONE' },
|
|
123
|
-
{ label: 'And', value: 'AND' }
|
|
124
|
-
],
|
|
125
|
-
default: 'AND'
|
|
126
|
-
},
|
|
127
|
-
optoutValue: {
|
|
128
|
-
label: 'Optout Value',
|
|
129
|
-
description: "Value of incoming opt-out status data that represents an optout status. For example, 'O' may represent an opt-out status.",
|
|
130
|
-
type: 'string'
|
|
131
|
-
},
|
|
132
|
-
rejectRecordIfChannelEmpty: {
|
|
133
|
-
label: 'Reject Record If Channel Empty',
|
|
134
|
-
description: 'String containing comma-separated channel codes that if specified will result in record rejection when the channel address field is null. See [Responsys API docs](https://docs.oracle.com/en/cloud/saas/marketing/responsys-rest-api/op-rest-api-v1.3-lists-listname-members-post.html)',
|
|
135
|
-
type: 'string'
|
|
136
|
-
},
|
|
137
|
-
defaultPermissionStatus: {
|
|
138
|
-
label: 'Default Permission Status',
|
|
139
|
-
description: 'This value must be specified as either OPTIN or OPTOUT. defaults to OPTOUT.',
|
|
140
|
-
type: 'string',
|
|
141
|
-
required: true,
|
|
142
|
-
choices: [
|
|
143
|
-
{ label: 'Opt In', value: 'OPTIN' },
|
|
144
|
-
{ label: 'Opt Out', value: 'OPTOUT' }
|
|
145
|
-
],
|
|
146
|
-
default: 'OPTOUT'
|
|
147
|
-
},
|
|
148
|
-
htmlValue: {
|
|
149
|
-
label: 'Preferred Email Format',
|
|
150
|
-
description: "Value of incoming preferred email format data. For example, 'H' may represent a preference for HTML formatted email.",
|
|
151
|
-
type: 'string'
|
|
152
|
-
},
|
|
153
|
-
optinValue: {
|
|
154
|
-
label: 'Optin Value',
|
|
155
|
-
description: "Value of incoming opt-in status data that represents an opt-in status. For example, 'I' may represent an opt-in status.",
|
|
156
|
-
type: 'string'
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
testAuthentication: (_, { settings }) => {
|
|
160
|
-
if (settings.profileListName.toUpperCase() !== settings.profileListName) {
|
|
161
|
-
throw new actions_core_1.IntegrationError('List Name field must be in Uppercase', 'INVALID_PROFILE_LIST_NAME', 400);
|
|
162
|
-
}
|
|
163
|
-
if (settings.profileExtensionTable) {
|
|
164
|
-
if (settings.profileExtensionTable.toUpperCase() !== settings.profileExtensionTable) {
|
|
165
|
-
throw new actions_core_1.IntegrationError('PET Name field must be in Uppercase', 'INVALID_PET_NAME', 400);
|
|
166
|
-
}
|
|
167
|
-
const regex = /^[A-Z0-9_]+$/;
|
|
168
|
-
if (!regex.test(settings.profileExtensionTable)) {
|
|
169
|
-
throw new actions_core_1.IntegrationError('The PET Name field must be capitalized and may only contain letters from A to Z, numbers from 0 to 9, and underscore characters.', 'INVALID_PET_NAME', 400);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (settings.baseUrl.startsWith('https://'.toLowerCase())) {
|
|
173
|
-
return Promise.resolve('Success');
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
throw new actions_core_1.IntegrationError('Responsys endpoint URL must start with https://', 'INVALID_URL', 400);
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
refreshAccessToken: async (request, { settings }) => {
|
|
180
|
-
const baseUrl = settings.baseUrl?.replace(/\/$/, '');
|
|
181
|
-
const endpoint = `${baseUrl}/rest/api/v1.3/auth/token`;
|
|
182
|
-
const res = await request(endpoint, {
|
|
183
|
-
method: 'POST',
|
|
184
|
-
headers: {
|
|
185
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
186
|
-
},
|
|
187
|
-
body: `user_name=${encodeURIComponent(settings.username)}&password=${encodeURIComponent(settings.userPassword)}&auth_type=password`
|
|
188
|
-
});
|
|
189
|
-
return { accessToken: res.data.authToken };
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
extendRequest({ auth }) {
|
|
193
|
-
return {
|
|
194
|
-
headers: {
|
|
195
|
-
'Content-Type': 'application/json',
|
|
196
|
-
authorization: `${auth?.accessToken}`
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
},
|
|
200
|
-
actions: {
|
|
201
|
-
sendAudience: sendAudience_1.default,
|
|
202
|
-
sendCustomTraits: sendCustomTraits_1.default,
|
|
203
|
-
upsertListMember: upsertListMember_1.default
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
exports.default = destination;
|
|
207
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/responsys-cloud/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+E;AAE/E,0EAAiD;AACjD,kEAAyC;AACzC,0EAAiD;AAMjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,yEAAyE;IACtF,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,eAAe,EAAE;gBACf,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EAAE,wFAAwF;gBACrG,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;aAChB;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EACT,uGAAu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AAW,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;QAC5C,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE;aACtC;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,YAAY,EAAZ,sBAAY;QACZ,gBAAgB,EAAhB,0BAAgB;QAChB,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
userData: {
|
|
3
|
-
EMAIL_ADDRESS_?: string;
|
|
4
|
-
CUSTOMER_ID_?: string;
|
|
5
|
-
[k: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
computation_key: string;
|
|
8
|
-
traits_or_props: {
|
|
9
|
-
[k: string]: unknown;
|
|
10
|
-
};
|
|
11
|
-
computation_class: string;
|
|
12
|
-
enable_batching?: boolean;
|
|
13
|
-
batch_size?: number;
|
|
14
|
-
stringify: boolean;
|
|
15
|
-
timestamp: string | number;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/responsys-cloud/sendAudience/generated-types.ts"],"names":[],"mappings":""}
|