@segment/action-destinations 3.259.0-staging-efc1d2e68 → 3.259.0-staging-4802f81d3
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/utils/EngageActionPerformer.js +17 -2
- package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -1
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.d.ts +3 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js +15 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -1
- package/dist/destinations/engage/utils/track.d.ts +20 -17
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.d.ts +13 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js +95 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/index.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.d.ts +6 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.js +37 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/s3.js.map +1 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.d.ts +7 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js +52 -0
- package/dist/destinations/liveramp-audiences/audienceEntered/sftp.js.map +1 -0
- package/package.json +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -43
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/categoryView/generated-types.js +0 -3
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/index.js +0 -43
- package/dist/destinations/movable-ink/categoryView/index.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +0 -20
- package/dist/destinations/movable-ink/conversion/generated-types.js +0 -3
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/index.d.ts +0 -5
- package/dist/destinations/movable-ink/conversion/index.js +0 -45
- package/dist/destinations/movable-ink/conversion/index.js.map +0 -1
- package/dist/destinations/movable-ink/fields.d.ts +0 -21
- package/dist/destinations/movable-ink/fields.js +0 -236
- package/dist/destinations/movable-ink/fields.js.map +0 -1
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +0 -7
- package/dist/destinations/movable-ink/identify/generated-types.js +0 -3
- package/dist/destinations/movable-ink/identify/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/identify/index.d.ts +0 -5
- package/dist/destinations/movable-ink/identify/index.js +0 -32
- package/dist/destinations/movable-ink/identify/index.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/productAdded/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productAdded/index.js +0 -43
- package/dist/destinations/movable-ink/productAdded/index.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +0 -21
- package/dist/destinations/movable-ink/productViewed/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productViewed/index.js +0 -43
- package/dist/destinations/movable-ink/productViewed/index.js.map +0 -1
- package/dist/destinations/movable-ink/search/generated-types.d.ts +0 -12
- package/dist/destinations/movable-ink/search/generated-types.js +0 -3
- package/dist/destinations/movable-ink/search/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/search/index.d.ts +0 -5
- package/dist/destinations/movable-ink/search/index.js +0 -43
- package/dist/destinations/movable-ink/search/index.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +0 -25
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +0 -3
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +0 -5
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +0 -48
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +0 -3
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +0 -3
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +0 -5
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
- package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
- package/dist/destinations/responsys/rsp-operations.js +0 -33
- package/dist/destinations/responsys/rsp-operations.js.map +0 -1
- package/dist/destinations/responsys/rsp-properties.d.ts +0 -4
- package/dist/destinations/responsys/rsp-properties.js +0 -27
- package/dist/destinations/responsys/rsp-properties.js.map +0 -1
- 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 +0 -3
- 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
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +0 -381
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +0 -581
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +0 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +0 -4
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +0 -97
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +0 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +0 -3
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +0 -43
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +0 -1
- package/dist/destinations/trackey/group.types.d.ts +0 -11
- package/dist/destinations/trackey/group.types.js +0 -3
- package/dist/destinations/trackey/group.types.js.map +0 -1
- package/dist/destinations/trackey/identify.types.d.ts +0 -11
- package/dist/destinations/trackey/identify.types.js +0 -3
- package/dist/destinations/trackey/identify.types.js.map +0 -1
- package/dist/destinations/trackey/track.types.d.ts +0 -12
- package/dist/destinations/trackey/track.types.js +0 -3
- package/dist/destinations/trackey/track.types.js.map +0 -1
- /package/dist/destinations/{klaviyo/removeProfileToList → liveramp-audiences/audienceEntered}/generated-types.js +0 -0
- /package/dist/destinations/{movable-ink/categoryView → liveramp-audiences/audienceEntered}/index.d.ts +0 -0
|
@@ -17,6 +17,7 @@ const isDestinationActionService_1 = require("./isDestinationActionService");
|
|
|
17
17
|
const ResponseError_1 = require("./ResponseError");
|
|
18
18
|
const IntegrationErrorWrapper_1 = require("./IntegrationErrorWrapper");
|
|
19
19
|
const truncate_1 = __importDefault(require("lodash/truncate"));
|
|
20
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
20
21
|
class EngageActionPerformer {
|
|
21
22
|
constructor(requestClient, executeInput) {
|
|
22
23
|
this.requestClient = requestClient;
|
|
@@ -49,7 +50,6 @@ class EngageActionPerformer {
|
|
|
49
50
|
const errorCode = errorDetails.code ?? respError.code ?? 'etimedout';
|
|
50
51
|
respError.code = errorCode;
|
|
51
52
|
errorDetails.code = errorCode;
|
|
52
|
-
respError.retry = true;
|
|
53
53
|
}
|
|
54
54
|
if (errorDetails.code)
|
|
55
55
|
op.tags.push(`response_code:${errorDetails.code}`);
|
|
@@ -76,6 +76,20 @@ class EngageActionPerformer {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
+
op?.onCatch.push(() => {
|
|
80
|
+
const respError = op?.error;
|
|
81
|
+
if (respError) {
|
|
82
|
+
const errorDetails = ResponseError_1.getErrorDetails(respError);
|
|
83
|
+
const msgLowercare = errorDetails?.message?.toLowerCase();
|
|
84
|
+
const isTimeoutErrorInOnCatch = msgLowercare?.includes('timeout') ||
|
|
85
|
+
msgLowercare?.includes('timedout') ||
|
|
86
|
+
msgLowercare?.includes('exceeded the deadline') ||
|
|
87
|
+
errorDetails.code?.toLowerCase().includes('etimedout');
|
|
88
|
+
if (isTimeoutErrorInOnCatch) {
|
|
89
|
+
op.error = new actions_core_1.RetryableError('Timeout error in onCatch');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
79
93
|
return await this.requestClient(url, options);
|
|
80
94
|
}
|
|
81
95
|
redactPii(pii) {
|
|
@@ -134,7 +148,8 @@ __decorate([
|
|
|
134
148
|
__decorate([
|
|
135
149
|
track_1.track({
|
|
136
150
|
onTry: addUrlToLog,
|
|
137
|
-
onFinally: addUrlToLog
|
|
151
|
+
onFinally: addUrlToLog,
|
|
152
|
+
onCatch: addUrlToLog
|
|
138
153
|
})
|
|
139
154
|
], EngageActionPerformer.prototype, "request", null);
|
|
140
155
|
exports.EngageActionPerformer = EngageActionPerformer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngageActionPerformer.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/EngageActionPerformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,iDAA6C;AAC7C,+CAA2C;AAC3C,mCAAiD;AACjD,6EAAyE;AACzE,mDAAgE;AAGhE,uEAAmE;AAEnE,+DAAsC;
|
|
1
|
+
{"version":3,"file":"EngageActionPerformer.js","sourceRoot":"","sources":["../../../../src/destinations/engage/utils/EngageActionPerformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,iDAA6C;AAC7C,+CAA2C;AAC3C,mCAAiD;AACjD,6EAAyE;AACzE,mDAAgE;AAGhE,uEAAmE;AAEnE,+DAAsC;AACtC,wDAAsD;AAKtD,MAAsB,qBAAqB;IASzC,YAAqB,aAA4B,EAAW,YAA+C;QAAtF,kBAAa,GAAb,aAAa,CAAe;QAAW,iBAAY,GAAZ,YAAY,CAAmC;QARlG,WAAM,GAAiB,IAAI,2BAAY,CAAC,IAAI,CAAC,CAAA;QAC7C,gBAAW,GAAgB,IAAI,yBAAW,CAAC,IAAI,CAAC,CAAA;QAChD,kBAAa,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAA;QAOtD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAA;QACnC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAA;IACvC,CAAC;IAKD,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,aAAa,EAAE,EAAE,CAAA;QAC5B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAA;IACzB,CAAC;IAkBD,KAAK,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2KC;AAED,SAAS,WAAW,CAAC,GAAQ;IAE3B,MAAM,OAAO,GAAG,GAAuB,CAAA;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;IAChC,IAAI,OAAO,CAAC,IAAI,IAAI,MAAM,EAAE;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAQ,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;KACpD;AACH,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TryCatchFinallyContext, TryCatchFinallyHook } from './wrapTryCatchFinallyPromisable';
|
|
2
2
|
export declare type OperationFinallyHooksContext<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TContext & {
|
|
3
3
|
onFinally: (() => void)[];
|
|
4
|
+
onCatch: (() => void)[];
|
|
4
5
|
decoratorArgs?: {
|
|
5
6
|
onTry?: (ctx: TContext) => void;
|
|
6
7
|
onFinally?: (ctx: TContext) => void;
|
|
8
|
+
onCatch?: (ctx: TContext) => void;
|
|
7
9
|
};
|
|
8
10
|
};
|
|
9
11
|
export declare class OperationFinallyHooks {
|
|
@@ -11,4 +13,5 @@ export declare class OperationFinallyHooks {
|
|
|
11
13
|
static getPriority(): number;
|
|
12
14
|
static onTry<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
13
15
|
static onFinally<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
16
|
+
static onCatch<TContext extends TryCatchFinallyContext>(ctx: OperationFinallyHooksContext<TContext>): void;
|
|
14
17
|
}
|
|
@@ -10,6 +10,7 @@ class OperationFinallyHooks {
|
|
|
10
10
|
}
|
|
11
11
|
static onTry(ctx) {
|
|
12
12
|
ctx.onFinally = [];
|
|
13
|
+
ctx.onCatch = [];
|
|
13
14
|
ctx.decoratorArgs?.onTry?.(ctx);
|
|
14
15
|
}
|
|
15
16
|
static onFinally(ctx) {
|
|
@@ -26,6 +27,20 @@ class OperationFinallyHooks {
|
|
|
26
27
|
}
|
|
27
28
|
ctx.decoratorArgs?.onFinally?.(ctx);
|
|
28
29
|
}
|
|
30
|
+
static onCatch(ctx) {
|
|
31
|
+
for (const hook of ctx.onCatch) {
|
|
32
|
+
try {
|
|
33
|
+
hook();
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
const error = e;
|
|
37
|
+
const loggerCtx = ctx;
|
|
38
|
+
if (loggerCtx.logs)
|
|
39
|
+
loggerCtx.logs.push(`Error in onCatch hook: ${error?.message || error.toString()}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
ctx.decoratorArgs?.onFinally?.(ctx);
|
|
43
|
+
}
|
|
29
44
|
}
|
|
30
45
|
exports.OperationFinallyHooks = OperationFinallyHooks;
|
|
31
46
|
//# sourceMappingURL=OperationFinallyHooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationFinallyHooks.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationFinallyHooks.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"OperationFinallyHooks.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationFinallyHooks.ts"],"names":[],"mappings":";;;AAiBA,MAAa,qBAAqB;IAChC,MAAM,CAAC,sBAAsB,CAAC,IAAkC;QAC9D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,CAAC,WAAW;QAChB,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,MAAM,CAAC,KAAK,CAA0C,GAA2C;QAC/F,GAAG,CAAC,SAAS,GAAG,EAAE,CAAA;QAClB,GAAG,CAAC,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,SAAS,CAA0C,GAA2C;QACnG,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,SAAS,EAAE;YAChC,IAAI;gBACF,IAAI,EAAE,CAAA;aACP;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,KAAK,GAAG,CAAU,CAAA;gBAExB,MAAM,SAAS,GAAG,GAAsC,CAAA;gBACxD,IAAI,SAAS,CAAC,IAAI;oBAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;aAC1G;SACF;QACD,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,CAAC,OAAO,CAA0C,GAA2C;QACjG,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE;YAC9B,IAAI;gBACF,IAAI,EAAE,CAAA;aACP;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,KAAK,GAAG,CAAU,CAAA;gBAExB,MAAM,SAAS,GAAG,GAAsC,CAAA;gBACxD,IAAI,SAAS,CAAC,IAAI;oBAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;aACxG;SACF;QACD,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC;CACF;AAxCD,sDAwCC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ContextFromDecorator } from './operationTracking';
|
|
2
2
|
export declare const track: ((decoratorArgs?: ({
|
|
3
|
-
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
4
|
-
} & {
|
|
5
|
-
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
6
|
-
} & {
|
|
7
3
|
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
8
4
|
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
5
|
+
onCatch?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
9
6
|
} & import("./operationTracking").OperationLoggerDecoratorArgs & {
|
|
7
|
+
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
10
|
+
} & {
|
|
10
11
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
11
12
|
}) | undefined) => import("./operationTracking").GenericMethodDecorator<(this: any, ...args: any[]) => any>) & {
|
|
12
13
|
getCurrentOperation(classInstance: any): (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
@@ -15,13 +16,18 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
15
16
|
}) | undefined;
|
|
16
17
|
} & {
|
|
17
18
|
_contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
tags: string[];
|
|
21
|
-
};
|
|
19
|
+
onFinally: (() => void)[];
|
|
20
|
+
onCatch: (() => void)[];
|
|
22
21
|
decoratorArgs?: {
|
|
23
|
-
|
|
22
|
+
onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
23
|
+
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
24
|
+
onCatch?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
24
25
|
} | undefined;
|
|
26
|
+
} & {
|
|
27
|
+
logs: string[];
|
|
28
|
+
logMetadata?: Record<string, unknown> | undefined;
|
|
29
|
+
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
30
|
+
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
25
31
|
} & {
|
|
26
32
|
decoratorArgs?: {
|
|
27
33
|
onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
|
|
@@ -33,16 +39,13 @@ export declare const track: ((decoratorArgs?: ({
|
|
|
33
39
|
start?: number | undefined;
|
|
34
40
|
duration?: number | undefined;
|
|
35
41
|
} & {
|
|
36
|
-
|
|
42
|
+
tags: string[];
|
|
43
|
+
sharedContext: {
|
|
44
|
+
tags: string[];
|
|
45
|
+
};
|
|
37
46
|
decoratorArgs?: {
|
|
38
|
-
|
|
39
|
-
onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
|
|
47
|
+
shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
|
|
40
48
|
} | undefined;
|
|
41
|
-
} & {
|
|
42
|
-
logs: string[];
|
|
43
|
-
logMetadata?: Record<string, unknown> | undefined;
|
|
44
|
-
decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
|
|
45
|
-
sharedContext: import("./operationTracking").OperationLoggerSharedContext;
|
|
46
49
|
} & {
|
|
47
50
|
decoratorArgs?: {
|
|
48
51
|
wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
audience_key: string;
|
|
3
|
+
identifier_data?: {
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
unhashed_identifier_data?: {
|
|
7
|
+
[k: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
delimiter: string;
|
|
10
|
+
filename: string;
|
|
11
|
+
enable_batching: boolean;
|
|
12
|
+
batch_size?: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const s3_1 = require("./s3");
|
|
5
|
+
const sftp_1 = require("./sftp");
|
|
6
|
+
const operations_1 = require("../operations");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Audience Entered',
|
|
9
|
+
description: 'Uploads audience membership data to a file for LiveRamp ingestion.',
|
|
10
|
+
defaultSubscription: 'event = "Audience Entered"',
|
|
11
|
+
fields: {
|
|
12
|
+
audience_key: {
|
|
13
|
+
label: 'Audience Key',
|
|
14
|
+
description: 'Identifies the user within the entered audience.',
|
|
15
|
+
type: 'string',
|
|
16
|
+
required: true,
|
|
17
|
+
default: { '@path': '$.userId' }
|
|
18
|
+
},
|
|
19
|
+
identifier_data: {
|
|
20
|
+
label: 'Identifier Data',
|
|
21
|
+
description: `Additional data pertaining to the user to be written to the file.`,
|
|
22
|
+
type: 'object',
|
|
23
|
+
required: false,
|
|
24
|
+
defaultObjectUI: 'keyvalue:only'
|
|
25
|
+
},
|
|
26
|
+
unhashed_identifier_data: {
|
|
27
|
+
label: 'Hashable Identifier Data',
|
|
28
|
+
description: `Additional data pertaining to the user to be hashed before written to the file`,
|
|
29
|
+
type: 'object',
|
|
30
|
+
required: false,
|
|
31
|
+
defaultObjectUI: 'keyvalue:only'
|
|
32
|
+
},
|
|
33
|
+
delimiter: {
|
|
34
|
+
label: 'Delimeter',
|
|
35
|
+
description: `Character used to separate tokens in the resulting file.`,
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: true,
|
|
38
|
+
default: ','
|
|
39
|
+
},
|
|
40
|
+
filename: {
|
|
41
|
+
label: 'Filename',
|
|
42
|
+
description: `Name of the CSV file to upload for LiveRamp ingestion.`,
|
|
43
|
+
type: 'string',
|
|
44
|
+
required: true,
|
|
45
|
+
default: { '@template': '{{properties.audience_key}}_PII_{{timestamp}}.csv' }
|
|
46
|
+
},
|
|
47
|
+
enable_batching: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
label: 'Batch data',
|
|
50
|
+
description: 'Receive events in a batch payload. This is required for LiveRamp audiences ingestion.',
|
|
51
|
+
required: true,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
batch_size: {
|
|
55
|
+
label: 'Batch Size',
|
|
56
|
+
description: 'Maximum number of events to include in each batch. Actual batch sizes may be lower.',
|
|
57
|
+
type: 'number',
|
|
58
|
+
required: false,
|
|
59
|
+
default: 1000000
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
perform: async (request, { settings, payload }) => {
|
|
63
|
+
return processData(request, settings, [payload]);
|
|
64
|
+
},
|
|
65
|
+
performBatch: (request, { settings, payload }) => {
|
|
66
|
+
return processData(request, settings, payload);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
async function processData(request, settings, payloads) {
|
|
70
|
+
const LIVERAMP_MIN_RECORD_COUNT = 25;
|
|
71
|
+
if (payloads.length < LIVERAMP_MIN_RECORD_COUNT) {
|
|
72
|
+
throw new actions_core_1.PayloadValidationError(`received payload count below LiveRamp's ingestion limits. expected: >=${LIVERAMP_MIN_RECORD_COUNT} actual: ${payloads.length}`);
|
|
73
|
+
}
|
|
74
|
+
switch (settings.upload_mode) {
|
|
75
|
+
case 'S3':
|
|
76
|
+
s3_1.validateS3(settings);
|
|
77
|
+
break;
|
|
78
|
+
case 'SFTP':
|
|
79
|
+
sftp_1.validateSFTP(settings);
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
throw new actions_core_1.InvalidAuthenticationError(`Unexpected upload mode: ${settings.upload_mode}`);
|
|
83
|
+
}
|
|
84
|
+
const { filename, fileContent } = operations_1.generateFile(payloads);
|
|
85
|
+
switch (settings.upload_mode) {
|
|
86
|
+
case 'S3':
|
|
87
|
+
return s3_1.uploadS3(settings, filename, fileContent, request);
|
|
88
|
+
case 'SFTP': {
|
|
89
|
+
const sftpClient = new sftp_1.Client();
|
|
90
|
+
return sftp_1.uploadSFTP(sftpClient, settings, filename, fileContent);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.default = action;
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/index.ts"],"names":[],"mappings":";;AAAA,wDAK8B;AAG9B,6BAA2C;AAC3C,iCAAuE;AACvE,8CAA4C;AAE5C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,oEAAoE;IACjF,mBAAmB,EAAE,4BAA4B;IACjD,MAAM,EAAE;QACN,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,mEAAmE;YAChF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,eAAe;SACjC;QACD,wBA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G,yBAAyB,EAAE;QAC/C,MAAM,IAAI,qCAAsB,CAC9B,yEAAyE,yBAAyB,YAAY,QAAQ,CAAC,MAAM,EAAE,CAChI,CAAA;KACF;IAED,QAAQ,QAAQ,CAAC,WAAW,EAAE;QAC5B,KAAK,IAAI;YACP,eAAU,CAAC,QAAQ,CAAC,CAAA;YACpB,MAAK;QACP,KAAK,MAAM;YACT,mBAAY,CAAC,QAAQ,CAAC,CAAA;YACtB,MAAK;QACP;YACE,MAAM,IAAI,yCAA0B,CAAC,2BAA2B,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;KAC1F;IAED,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,yBAAY,CAAC,QAAQ,CAAC,CAAA;IAExD,QAAQ,QAAQ,CAAC,WAAW,EAAE;QAC5B,KAAK,IAAI;YACP,OAAO,aAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;QAC3D,KAAK,MAAM,CAAC,CAAC;YACX,MAAM,UAAU,GAAG,IAAI,aAAU,EAAE,CAAA;YACnC,OAAO,iBAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;SAC/D;KACF;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ModifiedResponse, RequestOptions } from '@segment/actions-core';
|
|
3
|
+
import { Settings } from '../generated-types';
|
|
4
|
+
declare function validateS3(settings: Settings): void;
|
|
5
|
+
declare function uploadS3(settings: Settings, filename: string, fileContent: Buffer, request: <Data = unknown>(url: string, options?: RequestOptions) => Promise<ModifiedResponse<Data>>): Promise<ModifiedResponse<unknown>>;
|
|
6
|
+
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
|
|
@@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EAAE,IAAI,CAAC,OAAiC;QAC/C,MAAM;QACN,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC,CAAA;AACJ,CAAC;AAEoB,4BAAQ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Client from 'ssh2-sftp-client';
|
|
3
|
+
import { Settings } from '../generated-types';
|
|
4
|
+
declare function validateSFTP(settings: Settings): void;
|
|
5
|
+
declare function uploadSFTP(sftp: Client, settings: Settings, filename: string, fileContent: Buffer): Promise<unknown>;
|
|
6
|
+
declare function testAuthenticationSFTP(sftp: Client, settings: Settings): Promise<unknown>;
|
|
7
|
+
export { validateSFTP, uploadSFTP, testAuthenticationSFTP, Client };
|
|
@@ -0,0 +1,52 @@
|
|
|
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.Client = exports.testAuthenticationSFTP = exports.uploadSFTP = exports.validateSFTP = void 0;
|
|
7
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
8
|
+
const ssh2_sftp_client_1 = __importDefault(require("ssh2-sftp-client"));
|
|
9
|
+
exports.Client = ssh2_sftp_client_1.default;
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const LIVERAMP_SFTP_SERVER = 'files.liveramp.com';
|
|
12
|
+
const LIVERAMP_SFTP_PORT = 22;
|
|
13
|
+
function validateSFTP(settings) {
|
|
14
|
+
if (!settings.sftp_username) {
|
|
15
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected SFTP upload mode, but missing credentials (Username)');
|
|
16
|
+
}
|
|
17
|
+
if (!settings.sftp_password) {
|
|
18
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected SFTP upload mode, but missing credentials (Password)');
|
|
19
|
+
}
|
|
20
|
+
if (!settings.sftp_folder_path) {
|
|
21
|
+
throw new actions_core_1.InvalidAuthenticationError('Selected SFTP upload mode, but missing SFTP folder path.');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.validateSFTP = validateSFTP;
|
|
25
|
+
async function uploadSFTP(sftp, settings, filename, fileContent) {
|
|
26
|
+
return doSFTP(sftp, settings, async (sftp) => {
|
|
27
|
+
const targetPath = path_1.default.join(settings.sftp_folder_path, filename);
|
|
28
|
+
return sftp.put(fileContent, targetPath);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.uploadSFTP = uploadSFTP;
|
|
32
|
+
async function doSFTP(sftp, settings, action) {
|
|
33
|
+
await sftp.connect({
|
|
34
|
+
host: LIVERAMP_SFTP_SERVER,
|
|
35
|
+
port: LIVERAMP_SFTP_PORT,
|
|
36
|
+
username: settings.sftp_username,
|
|
37
|
+
password: settings.sftp_password
|
|
38
|
+
});
|
|
39
|
+
const retVal = await action(sftp);
|
|
40
|
+
await sftp.end();
|
|
41
|
+
return retVal;
|
|
42
|
+
}
|
|
43
|
+
async function testAuthenticationSFTP(sftp, settings) {
|
|
44
|
+
return doSFTP(sftp, settings, async (sftp) => {
|
|
45
|
+
return sftp.exists(settings.sftp_folder_path).then((fileType) => {
|
|
46
|
+
if (!fileType)
|
|
47
|
+
throw new Error(`Could not find path: ${settings.sftp_folder_path}`);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.testAuthenticationSFTP = testAuthenticationSFTP;
|
|
52
|
+
//# sourceMappingURL=sftp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sftp.js","sourceRoot":"","sources":["../../../../src/destinations/liveramp-audiences/audienceEntered/sftp.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAkE;AAClE,wEAAqC;AAiDsB,iBAjDpD,0BAAM,CAiDoD;AAhDjE,gDAAuB;AAGvB,MAAM,oBAAoB,GAAG,oBAAoB,CAAA;AAC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AM,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACxE,IAAI,CAAC,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAA;QACrF,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC;AAEkC,wDAAsB"}
|
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.259.0-staging-
|
|
4
|
+
"version": "3.259.0-staging-4802f81d3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,184 +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 test_data_1 = require("../../../../lib/test-data");
|
|
8
|
-
const index_1 = __importDefault(require("../../index"));
|
|
9
|
-
const nock_1 = __importDefault(require("nock"));
|
|
10
|
-
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
11
|
-
const actionSlug = 'updateUserProfile';
|
|
12
|
-
const destinationSlug = 'Braze';
|
|
13
|
-
const seedName = `${destinationSlug}#${actionSlug}`;
|
|
14
|
-
const receivedAt = '2021-08-03T17:40:04.055Z';
|
|
15
|
-
const settings = {
|
|
16
|
-
app_id: 'my-app-id',
|
|
17
|
-
api_key: 'my-api-key',
|
|
18
|
-
endpoint: 'https://rest.iad-01.braze.com'
|
|
19
|
-
};
|
|
20
|
-
describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
|
|
21
|
-
it('required fields', async () => {
|
|
22
|
-
const action = index_1.default.actions[actionSlug];
|
|
23
|
-
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
|
|
24
|
-
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
25
|
-
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
26
|
-
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
27
|
-
const event = actions_core_1.createTestEvent({
|
|
28
|
-
properties: eventData
|
|
29
|
-
});
|
|
30
|
-
const responses = await testDestination.testAction(actionSlug, {
|
|
31
|
-
event: event,
|
|
32
|
-
mapping: event.properties,
|
|
33
|
-
settings: settingsData,
|
|
34
|
-
auth: undefined
|
|
35
|
-
});
|
|
36
|
-
const request = responses[0].request;
|
|
37
|
-
const rawBody = await request.text();
|
|
38
|
-
try {
|
|
39
|
-
const json = JSON.parse(rawBody);
|
|
40
|
-
expect(json).toMatchSnapshot();
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
expect(rawBody).toMatchSnapshot();
|
|
45
|
-
}
|
|
46
|
-
expect(request.headers).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
it('all fields', async () => {
|
|
49
|
-
const action = index_1.default.actions[actionSlug];
|
|
50
|
-
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
|
|
51
|
-
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
52
|
-
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
53
|
-
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
54
|
-
const event = actions_core_1.createTestEvent({
|
|
55
|
-
properties: eventData
|
|
56
|
-
});
|
|
57
|
-
const responses = await testDestination.testAction(actionSlug, {
|
|
58
|
-
event: event,
|
|
59
|
-
mapping: event.properties,
|
|
60
|
-
settings: settingsData,
|
|
61
|
-
auth: undefined
|
|
62
|
-
});
|
|
63
|
-
const request = responses[0].request;
|
|
64
|
-
const rawBody = await request.text();
|
|
65
|
-
try {
|
|
66
|
-
const json = JSON.parse(rawBody);
|
|
67
|
-
expect(json).toMatchSnapshot();
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
expect(rawBody).toMatchSnapshot();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
it('it should work with batched events', async () => {
|
|
75
|
-
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
76
|
-
const events = [
|
|
77
|
-
actions_core_1.createTestEvent({
|
|
78
|
-
event: 'Test Event 1',
|
|
79
|
-
type: 'track',
|
|
80
|
-
receivedAt,
|
|
81
|
-
properties: {}
|
|
82
|
-
}),
|
|
83
|
-
actions_core_1.createTestEvent({
|
|
84
|
-
event: 'Test Event 2',
|
|
85
|
-
type: 'track',
|
|
86
|
-
receivedAt,
|
|
87
|
-
properties: {}
|
|
88
|
-
})
|
|
89
|
-
];
|
|
90
|
-
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
91
|
-
events,
|
|
92
|
-
useDefaultMappings: true,
|
|
93
|
-
mapping: {
|
|
94
|
-
external_id: {
|
|
95
|
-
'@path': '$.userId'
|
|
96
|
-
},
|
|
97
|
-
user_alias: {},
|
|
98
|
-
braze_id: {
|
|
99
|
-
'@path': '$.properties.braze_id'
|
|
100
|
-
},
|
|
101
|
-
name: {
|
|
102
|
-
'@path': '$.event'
|
|
103
|
-
},
|
|
104
|
-
time: {
|
|
105
|
-
'@path': '$.receivedAt'
|
|
106
|
-
},
|
|
107
|
-
properties: {
|
|
108
|
-
'@path': '$.properties'
|
|
109
|
-
},
|
|
110
|
-
products: {
|
|
111
|
-
'@path': '$.properties.products'
|
|
112
|
-
},
|
|
113
|
-
enable_batching: true,
|
|
114
|
-
_update_existing_only: true
|
|
115
|
-
},
|
|
116
|
-
settings: {
|
|
117
|
-
...settings
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
expect(responses.length).toBe(1);
|
|
121
|
-
expect(responses[0].status).toBe(200);
|
|
122
|
-
expect(responses[0].options.headers).toMatchSnapshot();
|
|
123
|
-
expect(responses[0].options.json).toMatchSnapshot();
|
|
124
|
-
});
|
|
125
|
-
it('it should work with a single batched events', async () => {
|
|
126
|
-
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
127
|
-
const events = [
|
|
128
|
-
actions_core_1.createTestEvent({
|
|
129
|
-
event: 'Test Event 1',
|
|
130
|
-
type: 'track',
|
|
131
|
-
receivedAt,
|
|
132
|
-
properties: {
|
|
133
|
-
products: [
|
|
134
|
-
{
|
|
135
|
-
quantity: 1,
|
|
136
|
-
product_id: 'Bowflex Treadmill 10',
|
|
137
|
-
price: 100
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
quantity: 2,
|
|
141
|
-
product_id: 'Bowflex Treadmill 20',
|
|
142
|
-
price: 200
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
];
|
|
148
|
-
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
149
|
-
events,
|
|
150
|
-
useDefaultMappings: true,
|
|
151
|
-
mapping: {
|
|
152
|
-
external_id: {
|
|
153
|
-
'@path': '$.userId'
|
|
154
|
-
},
|
|
155
|
-
user_alias: {},
|
|
156
|
-
braze_id: {
|
|
157
|
-
'@path': '$.properties.braze_id'
|
|
158
|
-
},
|
|
159
|
-
name: {
|
|
160
|
-
'@path': '$.event'
|
|
161
|
-
},
|
|
162
|
-
time: {
|
|
163
|
-
'@path': '$.receivedAt'
|
|
164
|
-
},
|
|
165
|
-
properties: {
|
|
166
|
-
'@path': '$.properties'
|
|
167
|
-
},
|
|
168
|
-
products: {
|
|
169
|
-
'@path': '$.properties.products'
|
|
170
|
-
},
|
|
171
|
-
enable_batching: true,
|
|
172
|
-
_update_existing_only: true
|
|
173
|
-
},
|
|
174
|
-
settings: {
|
|
175
|
-
...settings
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
expect(responses.length).toBe(1);
|
|
179
|
-
expect(responses[0].status).toBe(200);
|
|
180
|
-
expect(responses[0].options.headers).toMatchSnapshot();
|
|
181
|
-
expect(responses[0].options.json).toMatchSnapshot();
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
//# sourceMappingURL=snapshot.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4F;AAC5F,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAC1D,MAAM,UAAU,GAAG,mBAAmB,CAAA;AACtC,MAAM,eAAe,GAAG,OAAO,CAAA;AAC/B,MAAM,QAAQ,GAAG,GAAG,eAAe,IAAI,UAAU,EAAE,CAAA;AACnD,MAAM,UAAU,GAAG,0BAA0B,CAAA;AAC7C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,+BAAwC;CACnD,CAAA;AAED,QAAQ,CAAC,wBAAwB,eAAe,MAAM,UAAU,sBAAsB,EAAE,GAAG,EAAE;IAC3F,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,eAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,4BAAgB,CAAC,QAAQ,EAAE,eAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAA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