@segment/action-destinations 3.336.25-staging.0 → 3.337.2-staging.1
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/Profile.d.ts +6 -0
- package/dist/destinations/engage/sendgrid/Profile.js +3 -0
- 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/hubspot/sendCustomBehavioralEvent/index.js +27 -0
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
- package/dist/destinations/hubspot/utils.d.ts +10 -0
- package/dist/destinations/index.js +0 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/klaviyo/index.js +1 -1
- package/dist/destinations/klaviyo/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/index.js +4 -1
- package/dist/destinations/linkedin-conversions/index.js.map +1 -1
- package/dist/destinations/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/dist/destinations/segment-profiles/generated-types.d.ts +0 -1
- package/dist/destinations/segment-profiles/index.js +0 -18
- package/dist/destinations/segment-profiles/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendGroup/index.js +5 -20
- package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendIdentify/index.js +5 -20
- package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/index.js +5 -21
- package/dist/destinations/segment-profiles/sendSubscription/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/common_fields.d.ts +2 -0
- package/dist/destinations/tiktok-offline-conversions/common_fields.js +85 -0
- package/dist/destinations/tiktok-offline-conversions/common_fields.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.d.ts +2 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.js +33 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.d.ts +10 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.js.map +1 -0
- package/dist/destinations/{amazon-ads/syncAudiences → tiktok-offline-conversions/trackNonPaymentOfflineConversion}/index.d.ts +1 -1
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js +41 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.d.ts +20 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.d.ts +5 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js +137 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/destinations/amazon-ads/generated-types.d.ts +0 -3
- package/dist/destinations/amazon-ads/generated-types.js.map +0 -1
- package/dist/destinations/amazon-ads/index.d.ts +0 -4
- package/dist/destinations/amazon-ads/index.js +0 -87
- package/dist/destinations/amazon-ads/index.js.map +0 -1
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +0 -2
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js.map +0 -1
- package/dist/destinations/amazon-ads/syncAudiences/index.js +0 -15
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +0 -1
- package/dist/destinations/amazon-ads/types.d.ts +0 -22
- package/dist/destinations/amazon-ads/types.js +0 -11
- package/dist/destinations/amazon-ads/types.js.map +0 -1
- /package/dist/destinations/{amazon-ads → tiktok-offline-conversions/trackNonPaymentOfflineConversion}/generated-types.js +0 -0
- /package/dist/destinations/{amazon-ads/syncAudiences → tiktok-offline-conversions/trackPaymentOfflineConversion}/generated-types.js +0 -0
|
@@ -1,87 +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 syncAudiences_1 = __importDefault(require("./syncAudiences"));
|
|
8
|
-
const destination = {
|
|
9
|
-
name: 'Amazon Ads',
|
|
10
|
-
slug: 'actions-amazon-ads',
|
|
11
|
-
mode: 'cloud',
|
|
12
|
-
authentication: {
|
|
13
|
-
scheme: 'oauth2',
|
|
14
|
-
fields: {
|
|
15
|
-
region: {
|
|
16
|
-
label: 'Region',
|
|
17
|
-
description: 'Region for API Endpoint, either NA, EU, FE.',
|
|
18
|
-
choices: [
|
|
19
|
-
{ label: 'North America (NA)', value: 'https://advertising-api.amazon.com' },
|
|
20
|
-
{ label: 'Europe (EU)', value: 'https://advertising-api-eu.amazon.com' },
|
|
21
|
-
{ label: 'Far East (FE)', value: 'https://advertising-api-fe.amazon.com' }
|
|
22
|
-
],
|
|
23
|
-
default: 'North America (NA)',
|
|
24
|
-
type: 'string',
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
testAuthentication: async (request, { auth }) => {
|
|
29
|
-
if (!auth?.accessToken) {
|
|
30
|
-
throw new actions_core_1.InvalidAuthenticationError('Please authenticate via Oauth before enabling the destination.');
|
|
31
|
-
}
|
|
32
|
-
try {
|
|
33
|
-
await request('https://advertising-api.amazon.com/v2/profiles', {
|
|
34
|
-
method: 'GET'
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
catch (e) {
|
|
38
|
-
const error = e;
|
|
39
|
-
if (error.message === 'Unauthorized') {
|
|
40
|
-
throw new Error('Invalid LinkedIn Oauth access token. Please reauthenticate to retrieve a valid access token before enabling the destination.');
|
|
41
|
-
}
|
|
42
|
-
throw e;
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
refreshAccessToken: async (request, { auth }) => {
|
|
46
|
-
let res;
|
|
47
|
-
try {
|
|
48
|
-
res = await request('https://api.amazon.com/auth/o2/token', {
|
|
49
|
-
method: 'POST',
|
|
50
|
-
body: new URLSearchParams({
|
|
51
|
-
refresh_token: auth.refreshToken,
|
|
52
|
-
client_id: auth.clientId,
|
|
53
|
-
client_secret: auth.clientSecret,
|
|
54
|
-
grant_type: 'refresh_token'
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
const error = e;
|
|
60
|
-
if (error.response?.data?.error === 'invalid_grant') {
|
|
61
|
-
throw new actions_core_1.IntegrationError(`Invalid Authentication: Your refresh token is invalid or expired. Please re-authenticate to fetch a new refresh token.`, actions_core_1.ErrorCodes.REFRESH_TOKEN_EXPIRED, 401);
|
|
62
|
-
}
|
|
63
|
-
throw new actions_core_1.IntegrationError(`Failed to fetch a new access token. Reason: ${error.response?.data?.error}`, actions_core_1.ErrorCodes.OAUTH_REFRESH_FAILED, 401);
|
|
64
|
-
}
|
|
65
|
-
return { accessToken: res?.data?.access_token };
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
extendRequest({ auth }) {
|
|
69
|
-
return {
|
|
70
|
-
headers: {
|
|
71
|
-
authorization: `Bearer ${auth?.accessToken}`
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
audienceFields: {},
|
|
76
|
-
audienceConfig: {
|
|
77
|
-
mode: {
|
|
78
|
-
type: 'synced',
|
|
79
|
-
full_audience_sync: false
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
actions: {
|
|
83
|
-
syncAudiences: syncAudiences_1.default
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
exports.default = destination;
|
|
87
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAgG;AAIhG,oEAA2C;AAG3C,MAAM,WAAW,GAA4C;IAC3D,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,6CAA6C;gBAC1D,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,oCAAoC,EAAE;oBAC5E,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,uCAAuC,EAAE;oBACxE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,uCAAuC,EAAE;iBAC3E;gBACD,OAAO,EAAE,oBAAoB;gBAC7B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE;gBACtB,MAAM,IAAI,yCAA0B,CAAC,gEAAgE,CAAC,CAAA;aACvG;YAED,IAAI;gBACF,MAAM,OAAO,CAAuB,gDAAgD,EAAE;oBACpF,MAAM,EAAE,KAAK;iBACd,CAAC,CAAA;aACH;YAAC,OAAO,CAAM,EAAE;gBACf,MAAM,KAAK,GAAG,CAAkC,CAAA;gBAChD,IAAI,KAAK,CAAC,OAAO,KAAK,cAAc,E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KAWF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/amazon-ads/syncAudiences/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const action = {
|
|
4
|
-
title: 'Sync Audiences',
|
|
5
|
-
description: '',
|
|
6
|
-
fields: {},
|
|
7
|
-
perform: (request, data) => {
|
|
8
|
-
return request('https://example.com', {
|
|
9
|
-
method: 'post',
|
|
10
|
-
json: data.payload
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
exports.default = action;
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/amazon-ads/syncAudiences/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,OAAO,OAAO,CAAC,qBAAqB,EAAE;YACpC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,OAAO;SACnB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HTTPError } from '@segment/actions-core';
|
|
2
|
-
export interface RefreshTokenResponse {
|
|
3
|
-
access_token: string;
|
|
4
|
-
scope: string;
|
|
5
|
-
expires_in: number;
|
|
6
|
-
token_type: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class AmazonTestAuthenticationError extends HTTPError {
|
|
9
|
-
response: Response & {
|
|
10
|
-
data: {
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare class AmazonRefreshTokenError extends HTTPError {
|
|
16
|
-
response: Response & {
|
|
17
|
-
data: {
|
|
18
|
-
error: string;
|
|
19
|
-
error_description: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AmazonRefreshTokenError = exports.AmazonTestAuthenticationError = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
-
class AmazonTestAuthenticationError extends actions_core_1.HTTPError {
|
|
6
|
-
}
|
|
7
|
-
exports.AmazonTestAuthenticationError = AmazonTestAuthenticationError;
|
|
8
|
-
class AmazonRefreshTokenError extends actions_core_1.HTTPError {
|
|
9
|
-
}
|
|
10
|
-
exports.AmazonRefreshTokenError = AmazonRefreshTokenError;
|
|
11
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/amazon-ads/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;AAajD,MAAa,6BAA8B,SAAQ,wBAAS;CAM3D;AAND,sEAMC;AAED,MAAa,uBAAwB,SAAQ,wBAAS;CAOrD;AAPD,0DAOC"}
|
|
File without changes
|