@segment/action-destinations 3.56.1-alpha.2 → 3.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/destinations/adobe-target/adobeTarget_operations.js +1 -1
  2. package/dist/destinations/adobe-target/adobeTarget_operations.js.map +1 -1
  3. package/dist/destinations/adobe-target/updateProfile/index.js +2 -4
  4. package/dist/destinations/adobe-target/updateProfile/index.js.map +1 -1
  5. package/dist/destinations/criteo-audiences/addUserToAudience/generated-types.d.ts +5 -0
  6. package/dist/destinations/criteo-audiences/addUserToAudience/generated-types.js +3 -0
  7. package/dist/destinations/criteo-audiences/addUserToAudience/generated-types.js.map +1 -0
  8. package/dist/destinations/criteo-audiences/addUserToAudience/index.d.ts +5 -0
  9. package/dist/destinations/criteo-audiences/addUserToAudience/index.js +68 -0
  10. package/dist/destinations/criteo-audiences/addUserToAudience/index.js.map +1 -0
  11. package/dist/destinations/criteo-audiences/criteo-audiences.d.ts +17 -0
  12. package/dist/destinations/criteo-audiences/criteo-audiences.js +123 -0
  13. package/dist/destinations/criteo-audiences/criteo-audiences.js.map +1 -0
  14. package/dist/destinations/criteo-audiences/generated-types.d.ts +5 -0
  15. package/dist/destinations/criteo-audiences/generated-types.js +3 -0
  16. package/dist/destinations/criteo-audiences/generated-types.js.map +1 -0
  17. package/dist/destinations/criteo-audiences/index.d.ts +4 -0
  18. package/dist/destinations/criteo-audiences/index.js +50 -0
  19. package/dist/destinations/criteo-audiences/index.js.map +1 -0
  20. package/dist/destinations/criteo-audiences/removeUserFromAudience/generated-types.d.ts +5 -0
  21. package/dist/destinations/criteo-audiences/removeUserFromAudience/generated-types.js +3 -0
  22. package/dist/destinations/criteo-audiences/removeUserFromAudience/generated-types.js.map +1 -0
  23. package/dist/destinations/criteo-audiences/removeUserFromAudience/index.d.ts +5 -0
  24. package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js +68 -0
  25. package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js.map +1 -0
  26. package/dist/destinations/index.js +2 -0
  27. package/dist/destinations/index.js.map +1 -1
  28. package/dist/destinations/talon-one/createAudience/generated-types.d.ts +2 -2
  29. package/dist/destinations/talon-one/createAudience/index.js +6 -6
  30. package/dist/destinations/talon-one/createAudience/index.js.map +1 -1
  31. package/dist/destinations/talon-one/deleteAudience/generated-types.d.ts +1 -1
  32. package/dist/destinations/talon-one/deleteAudience/index.js +3 -3
  33. package/dist/destinations/talon-one/deleteAudience/index.js.map +1 -1
  34. package/dist/destinations/talon-one/generated-types.d.ts +1 -1
  35. package/dist/destinations/talon-one/index.js +10 -4
  36. package/dist/destinations/talon-one/index.js.map +1 -1
  37. package/dist/destinations/talon-one/t1-properties.d.ts +4 -0
  38. package/dist/destinations/talon-one/t1-properties.js +23 -0
  39. package/dist/destinations/talon-one/t1-properties.js.map +1 -0
  40. package/dist/destinations/talon-one/trackEvent/generated-types.d.ts +3 -3
  41. package/dist/destinations/talon-one/trackEvent/index.js +12 -12
  42. package/dist/destinations/talon-one/trackEvent/index.js.map +1 -1
  43. package/dist/destinations/talon-one/updateAudience/generated-types.d.ts +2 -2
  44. package/dist/destinations/talon-one/updateAudience/index.js +6 -6
  45. package/dist/destinations/talon-one/updateAudience/index.js.map +1 -1
  46. package/dist/destinations/talon-one/updateCustomerProfile/generated-types.d.ts +9 -0
  47. package/dist/destinations/talon-one/updateCustomerProfile/generated-types.js +3 -0
  48. package/dist/destinations/talon-one/updateCustomerProfile/generated-types.js.map +1 -0
  49. package/dist/destinations/talon-one/updateCustomerProfile/index.d.ts +5 -0
  50. package/dist/destinations/talon-one/updateCustomerProfile/index.js +34 -0
  51. package/dist/destinations/talon-one/updateCustomerProfile/index.js.map +1 -0
  52. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.d.ts +9 -0
  53. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.js +3 -0
  54. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.js.map +1 -0
  55. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.d.ts +5 -0
  56. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js +28 -0
  57. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js.map +1 -0
  58. package/dist/destinations/talon-one/updateCustomerProfilesAudiences/generated-types.d.ts +5 -0
  59. package/dist/destinations/talon-one/updateCustomerProfilesAudiences/generated-types.js +3 -0
  60. package/dist/destinations/talon-one/updateCustomerProfilesAudiences/generated-types.js.map +1 -0
  61. package/dist/destinations/talon-one/updateCustomerProfilesAudiences/index.d.ts +5 -0
  62. package/dist/destinations/talon-one/updateCustomerProfilesAudiences/index.js +28 -0
  63. package/dist/destinations/talon-one/updateCustomerProfilesAudiences/index.js.map +1 -0
  64. package/package.json +4 -4
@@ -4,7 +4,7 @@ const actions_core_1 = require("@segment/actions-core");
4
4
  function getNestedObjects(obj, objectPath = '', attributes = {}) {
5
5
  Object.keys(obj).forEach((key) => {
6
6
  const currObjectPath = objectPath ? `${objectPath}.${key}` : key;
7
- if (typeof obj[key] !== 'object' && obj[key]) {
7
+ if (typeof obj[key] !== 'object') {
8
8
  attributes[currObjectPath] = obj[key].toString();
9
9
  }
10
10
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"adobeTarget_operations.js","sourceRoot":"","sources":["../../../src/destinations/adobe-target/adobeTarget_operations.ts"],"names":[],"mappings":";;AAAA,wDAAuE;AAEvE,SAAS,gBAAgB,CAAC,GAAyB,EAAE,UAAU,GAAG,EAAE,EAAE,aAAsC,EAAE;IAC5G,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/B,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAChE,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,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,OAAO,CAChB,WAAW,UAAU,gDAAgD,MAAM,WAAW,UAAU,EAAE,EAClG,EAAE,MAAM,EAAE,KAAK,EAAE,CAClB,CAAA;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,IAAI,+BAAgB,CAAC,2DAA2D,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;aACnH;YAED,OAAO,SAAS,CAAA;QAClB,CAAC,CAAA;QAjCC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CA8BF;AAzCD,8BAyCC"}
1
+ {"version":3,"file":"adobeTarget_operations.js","sourceRoot":"","sources":["../../../src/destinations/adobe-target/adobeTarget_operations.ts"],"names":[],"mappings":";;AAAA,wDAAuE;AAEvE,SAAS,gBAAgB,CAAC,GAAyB,EAAE,UAAU,GAAG,EAAE,EAAE,aAAsC,EAAE;IAC5G,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/B,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAChE,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;YAChC,UAAU,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAA;SACjD;aAAM;YACL,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,cAAc,EAAE,UAAU,CAAC,CAAA;SACvD;IACH,CAAC,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC;AACD,MAAM,mBAAmB,GAAG,CAAC,MAAmD,EAAE,EAAE,CAClF,MAAM,CAAC,IAAI,CA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AA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CA8BF;AAzCD,8BAyCC"}
@@ -24,12 +24,10 @@ const action = {
24
24
  },
25
25
  traits: {
26
26
  label: 'Profile Attributes',
27
- description: 'Profile parameters specific to a user.',
27
+ description: 'Profile parameters specific to a user. Please note, Adobe recommends that PII is hashed prior to sending to Adobe.',
28
28
  type: 'object',
29
29
  required: true,
30
- default: {
31
- '@path': '$.traits'
32
- }
30
+ defaultObjectUI: 'keyvalue'
33
31
  }
34
32
  },
35
33
  perform: async (request, { settings, payload }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/adobe-target/updateProfile/index.ts"],"names":[],"mappings":";;;;;AAEA,uFAAmD;AAGnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,kDAAkD;IAC/D,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,+LAA+L;YACjM,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;KACF;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,EAAE,GAAgB,IAAI,gCAAW,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACvG,OAAO,MAAM,EAAE,CAAC,aAAa,EAAE,CAAA;IACjC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/adobe-target/updateProfile/index.ts"],"names":[],"mappings":";;;;;AAEA,uFAAmD;AAGnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,kDAAkD;IAC/D,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,+LAA+L;YACjM,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EACT,oHAAoH;YACtH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,UAAU;SAC5B;KACF;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,EAAE,GAAgB,IAAI,gCAAW,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACvG,OAAO,MAAM,EAAE,CAAC,aAAa,EAAE,CAAA;IACjC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface Payload {
2
+ audience_key?: string;
3
+ event?: string;
4
+ email?: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/criteo-audiences/addUserToAudience/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const criteo_audiences_1 = require("../criteo-audiences");
4
+ const getOperationFromPayload = async (request, advertiser_id, payload, credentials) => {
5
+ const add_user_list = [];
6
+ let audience_key = '';
7
+ for (const event of payload) {
8
+ if (!audience_key && event.audience_key)
9
+ audience_key = event.audience_key;
10
+ if (event.email)
11
+ add_user_list.push(event.email);
12
+ }
13
+ const audience_id = await criteo_audiences_1.getAudienceId(request, advertiser_id, audience_key, credentials);
14
+ const operation = {
15
+ operation_type: "add",
16
+ audience_id: audience_id,
17
+ user_list: add_user_list,
18
+ };
19
+ return operation;
20
+ };
21
+ const processPayload = async (request, settings, payload) => {
22
+ const credentials = {
23
+ client_id: settings.client_id,
24
+ client_secret: settings.client_secret
25
+ };
26
+ const operation = await getOperationFromPayload(request, settings.advertiser_id, payload, credentials);
27
+ return await criteo_audiences_1.patchAudience(request, operation, credentials);
28
+ };
29
+ const action = {
30
+ title: 'Add users to Audience',
31
+ description: 'Add users from Criteo audience by connecting to Criteo API',
32
+ defaultSubscription: 'type = "track" and event = "Audience Entered"',
33
+ fields: {
34
+ audience_key: {
35
+ label: 'Audience key',
36
+ description: "Unique name for personas audience",
37
+ type: 'string',
38
+ default: {
39
+ '@path': '$.properties.audience_key'
40
+ }
41
+ },
42
+ event: {
43
+ label: 'Event name',
44
+ description: "Event for audience entering or exiting",
45
+ type: 'string',
46
+ default: {
47
+ '@path': '$.event'
48
+ }
49
+ },
50
+ email: {
51
+ label: 'Email',
52
+ description: "The user's email",
53
+ type: 'string',
54
+ format: 'email',
55
+ default: {
56
+ '@path': '$.context.traits.email'
57
+ }
58
+ },
59
+ },
60
+ perform: async (request, { settings, payload }) => {
61
+ return await processPayload(request, settings, [payload]);
62
+ },
63
+ performBatch: async (request, { settings, payload }) => {
64
+ return await processPayload(request, settings, payload);
65
+ }
66
+ };
67
+ exports.default = action;
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/criteo-audiences/addUserToAudience/index.ts"],"names":[],"mappings":";;AACA,0DAAkE;AAMlE,MAAM,uBAAuB,GAAG,KAAK,EACnC,OAAsB,EACtB,aAAqB,EACrB,OAAkB,EAClB,WAA8B,EACV,EAAE;IACtB,MAAM,aAAa,GAAa,EAAE,CAAA;IAClC,IAAI,YAAY,GAAG,EAAE,CAAA;IAOrB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;QAC3B,IAAI,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY;YACrC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;QACnC,IAAI,KAAK,CAAC,KAAK;YACb,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;KAClC;IAED,MAAM,WAAW,GAAG,MAAM,gCAAa,CAAC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;IAC1F,MAAM,SAAS,GAAc;QAC3B,cAAc,EAAE,KAAK;QACrB,WAAW,EAAE,WAAW;QACxB,SAAS,EAAE,aAAa;KACzB,CAAA;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAA;AAED,MAAM,cAAc,GAA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QACrD,OAAO,MAAM,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAEzD,CAAC;CACF,CAAA;AACD,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { RequestClient } from '@segment/actions-core';
2
+ export declare type Operation = {
3
+ operation_type: string;
4
+ audience_id: string;
5
+ user_list: string[];
6
+ };
7
+ export declare type ClientCredentials = {
8
+ client_id: string;
9
+ client_secret: string;
10
+ access_token?: string;
11
+ };
12
+ export declare const getAccessToken: (request: RequestClient, credentials: ClientCredentials) => Promise<string>;
13
+ export declare const criteoAuthenticate: (request: RequestClient, credentials: ClientCredentials) => Promise<ClientCredentials>;
14
+ export declare const patchAudience: (request: RequestClient, operation: Operation, credentials: ClientCredentials) => Promise<Response>;
15
+ export declare const getAdvertiserAudiences: (request: RequestClient, advertiser_id: string, credentials: ClientCredentials) => Promise<Array<Record<string, any>>>;
16
+ export declare const getAudienceId: (request: RequestClient, advertiser_id: string, audience_name: string, credentials: ClientCredentials) => Promise<string>;
17
+ export declare const createAudience: (request: RequestClient, advertiser_id: string, audience_name: string, credentials: ClientCredentials) => Promise<string>;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAudience = exports.getAudienceId = exports.getAdvertiserAudiences = exports.patchAudience = exports.criteoAuthenticate = exports.getAccessToken = void 0;
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ const BASE_API_URL = 'https://api.criteo.com/2022-01';
6
+ const getRequestHeaders = async (request, credentials) => {
7
+ credentials = await exports.criteoAuthenticate(request, credentials);
8
+ return {
9
+ 'Accept': 'application/json',
10
+ 'Content-Type': 'application/json',
11
+ 'Authorization': `Bearer ` + credentials.access_token
12
+ };
13
+ };
14
+ const getAccessToken = async (request, credentials) => {
15
+ const res = await request(`https://api.criteo.com/oauth2/token`, {
16
+ method: 'POST',
17
+ body: new URLSearchParams({
18
+ client_id: credentials.client_id,
19
+ client_secret: credentials.client_secret,
20
+ grant_type: 'client_credentials'
21
+ }),
22
+ headers: {
23
+ 'Accept': 'text/plain',
24
+ 'Content-Type': 'application/x-www-form-urlencoded'
25
+ },
26
+ });
27
+ const body = await res.json();
28
+ if (res.status !== 200)
29
+ throw new Error(`Error while getting an access token: ${JSON.stringify(body)}`);
30
+ return body.access_token;
31
+ };
32
+ exports.getAccessToken = getAccessToken;
33
+ const criteoAuthenticate = async (request, credentials) => {
34
+ if (!credentials.access_token)
35
+ credentials.access_token = await exports.getAccessToken(request, credentials);
36
+ return credentials;
37
+ };
38
+ exports.criteoAuthenticate = criteoAuthenticate;
39
+ const patchAudience = async (request, operation, credentials) => {
40
+ if (operation.operation_type !== "add" && operation.operation_type !== "remove")
41
+ throw new Error(`Incorrect operation type: ${operation.operation_type}`);
42
+ if (isNaN(+operation.audience_id))
43
+ throw new Error(`The Audience ID should be a number (${operation.audience_id})`);
44
+ const endpoint = `${BASE_API_URL}/audiences/${operation.audience_id}/contactlist`;
45
+ const headers = await getRequestHeaders(request, credentials);
46
+ const payload = {
47
+ "data": {
48
+ "type": "ContactlistAmendment",
49
+ "attributes": {
50
+ "operation": operation.operation_type,
51
+ "identifierType": "email",
52
+ "identifiers": operation.user_list
53
+ }
54
+ }
55
+ };
56
+ return fetchRetry(request, endpoint, {
57
+ method: 'PATCH',
58
+ json: payload,
59
+ headers: headers
60
+ });
61
+ };
62
+ exports.patchAudience = patchAudience;
63
+ const getAdvertiserAudiences = async (request, advertiser_id, credentials) => {
64
+ if (isNaN(+advertiser_id))
65
+ throw new actions_core_1.IntegrationError('The Advertiser ID should be a number', 'Invalid input', 400);
66
+ const endpoint = `${BASE_API_URL}/audiences?advertiser-id=${advertiser_id}`;
67
+ const headers = await getRequestHeaders(request, credentials);
68
+ const response = await request(endpoint, { method: 'GET', headers: headers });
69
+ const body = await response.json();
70
+ if (response.status !== 200)
71
+ throw new actions_core_1.IntegrationError(`Error while fetching the Advertiser's audiences: ${JSON.stringify(body.errors)}`);
72
+ return body.data;
73
+ };
74
+ exports.getAdvertiserAudiences = getAdvertiserAudiences;
75
+ const getAudienceId = async (request, advertiser_id, audience_name, credentials) => {
76
+ if (!audience_name)
77
+ throw new Error(`Invalid Audience Name: ${audience_name}`);
78
+ const advertiser_audiences = await exports.getAdvertiserAudiences(request, advertiser_id, credentials);
79
+ for (const audience of advertiser_audiences) {
80
+ if (audience.attributes.name === audience_name)
81
+ return audience.id;
82
+ }
83
+ return await exports.createAudience(request, advertiser_id, audience_name, credentials);
84
+ };
85
+ exports.getAudienceId = getAudienceId;
86
+ const delay = (ms) => new Promise((res) => setTimeout(res, ms));
87
+ const fetchRetry = async (request, endpoint, options, retries = 3, backoff = 300) => {
88
+ try {
89
+ return await request(endpoint, options);
90
+ }
91
+ catch (err) {
92
+ if (retries === 1) {
93
+ throw new Error('All retries failed!');
94
+ }
95
+ await delay(backoff);
96
+ return await fetchRetry(request, endpoint, options, retries - 1, backoff * 2);
97
+ }
98
+ };
99
+ const createAudience = async (request, advertiser_id, audience_name, credentials) => {
100
+ if (!audience_name)
101
+ throw new Error(`Invalid Audience Name: ${audience_name}`);
102
+ if (isNaN(+advertiser_id))
103
+ throw new actions_core_1.IntegrationError('The Advertiser ID should be a number', 'Invalid input', 400);
104
+ const endpoint = `${BASE_API_URL}/audiences`;
105
+ const headers = await getRequestHeaders(request, credentials);
106
+ const payload = {
107
+ "data": {
108
+ "attributes": {
109
+ "advertiserId": advertiser_id,
110
+ "name": audience_name,
111
+ "description": audience_name
112
+ },
113
+ "type": "Audience"
114
+ }
115
+ };
116
+ const response = await request(endpoint, { method: 'POST', headers: headers, json: payload });
117
+ const body = await response.json();
118
+ if (response.status !== 200)
119
+ throw new Error(`Error while fetching the Advertiser's audiences: ${JSON.stringify(body.errors)}`);
120
+ return body.data.id;
121
+ };
122
+ exports.createAudience = createAudience;
123
+ //# sourceMappingURL=criteo-audiences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteo-audiences.js","sourceRo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IAAI,EAAE,OAAO,EAAE,CAChE,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAElC,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG;QACvB,MAAM,IAAI,KAAK,CAAC,oDAAoD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAEtG,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AACvB,CAAC,CAAA;AAjCY,QAAA,cAAc,kBAiC1B"}
@@ -0,0 +1,5 @@
1
+ export interface Settings {
2
+ client_id: string;
3
+ client_secret: string;
4
+ advertiser_id: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/criteo-audiences/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,50 @@
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 addUserToAudience_1 = __importDefault(require("./addUserToAudience"));
7
+ const removeUserFromAudience_1 = __importDefault(require("./removeUserFromAudience"));
8
+ const criteo_audiences_1 = require("./criteo-audiences");
9
+ const destination = {
10
+ name: 'Criteo Audiences',
11
+ slug: 'actions-criteo-audiences',
12
+ description: 'Add/remove users to/from Criteo Audiences using Criteo API',
13
+ mode: 'cloud',
14
+ authentication: {
15
+ scheme: 'custom',
16
+ fields: {
17
+ client_id: {
18
+ label: 'API Client ID',
19
+ description: 'Your Criteo API client ID',
20
+ type: 'string',
21
+ required: true
22
+ },
23
+ client_secret: {
24
+ label: 'API Client Secret',
25
+ description: 'Your Criteo API client secret',
26
+ type: 'string',
27
+ required: true
28
+ },
29
+ advertiser_id: {
30
+ label: 'Advertiser ID',
31
+ description: 'Your Criteo Advertiser ID',
32
+ type: 'string',
33
+ required: true
34
+ }
35
+ },
36
+ testAuthentication: async (request, { settings }) => {
37
+ const credentials = await criteo_audiences_1.criteoAuthenticate(request, {
38
+ client_id: settings.client_id,
39
+ client_secret: settings.client_secret
40
+ });
41
+ return credentials.access_token;
42
+ }
43
+ },
44
+ actions: {
45
+ addUserToAudience: addUserToAudience_1.default,
46
+ removeUserFromAudience: removeUserFromAudience_1.default
47
+ }
48
+ };
49
+ exports.default = destination;
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/criteo-audiences/index.ts"],"names":[],"mappings":";;;;;AAEA,4EAAmD;AACnD,sFAA6D;AAC7D,yDAAuD;AAGvD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,WAAW,GAAsB,MAAM,qCAAkB,CAAC,OAAO,EAAE;gBACvE,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,aAAa,EAAE,QAAQ,CAAC,aAAa;aACtC,CAAC,CAAA;YACF,OAAO,WAAW,CAAC,YAAY,CAAA;QACjC,CAAC;KACF;IACD,OAAO,EAAE;QACP,iBAAiB,EAAjB,2BAAiB;QACjB,sBAAsB,EAAtB,gCAAsB;KACvB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface Payload {
2
+ audience_key?: string;
3
+ event?: string;
4
+ email?: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/criteo-audiences/removeUserFromAudience/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const criteo_audiences_1 = require("../criteo-audiences");
4
+ const getOperationFromPayload = async (request, advertiser_id, payload, credentials) => {
5
+ const remove_user_list = [];
6
+ let audience_key = '';
7
+ for (const event of payload) {
8
+ if (!audience_key && event.audience_key)
9
+ audience_key = event.audience_key;
10
+ if (event.email)
11
+ remove_user_list.push(event.email);
12
+ }
13
+ const audience_id = await criteo_audiences_1.getAudienceId(request, advertiser_id, audience_key, credentials);
14
+ const operation = {
15
+ operation_type: "remove",
16
+ audience_id: audience_id,
17
+ user_list: remove_user_list,
18
+ };
19
+ return operation;
20
+ };
21
+ const processPayload = async (request, settings, payload) => {
22
+ const credentials = {
23
+ client_id: settings.client_id,
24
+ client_secret: settings.client_secret
25
+ };
26
+ const operation = await getOperationFromPayload(request, settings.advertiser_id, payload, credentials);
27
+ return await criteo_audiences_1.patchAudience(request, operation, credentials);
28
+ };
29
+ const action = {
30
+ title: 'Remove users from Audience',
31
+ description: 'Remove users from Criteo audience by connecting to Criteo API',
32
+ defaultSubscription: 'type = "track" and event = "Audience Exited"',
33
+ fields: {
34
+ audience_key: {
35
+ label: 'Audience key',
36
+ description: "Unique name for personas audience",
37
+ type: 'string',
38
+ default: {
39
+ '@path': '$.properties.audience_key'
40
+ }
41
+ },
42
+ event: {
43
+ label: 'Event name',
44
+ description: "Event for audience entering or exiting",
45
+ type: 'string',
46
+ default: {
47
+ '@path': '$.event'
48
+ }
49
+ },
50
+ email: {
51
+ label: 'Email',
52
+ description: "The user's email",
53
+ type: 'string',
54
+ format: 'email',
55
+ default: {
56
+ '@path': '$.context.traits.email'
57
+ }
58
+ },
59
+ },
60
+ perform: async (request, { settings, payload }) => {
61
+ return await processPayload(request, settings, [payload]);
62
+ },
63
+ performBatch: async (request, { settings, payload }) => {
64
+ return await processPayload(request, settings, payload);
65
+ }
66
+ };
67
+ exports.default = action;
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/criteo-audiences/removeUserFromAudience/index.ts"],"names":[],"mappings":";;AACA,0DAAkE;AAOlE,MAAM,uBAAuB,GAAG,KAAK,EACnC,OAAsB,EACtB,aAAqB,EACrB,OAAkB,EAClB,WAA8B,EACV,EAAE;IACtB,MAAM,gBAAgB,GAAa,EAAE,CAAA;IACrC,IAAI,YAAY,GAAG,EAAE,CAAA;IAErB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;QAC3B,IAAI,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY;YACrC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;Q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,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,wBAAwB;aAClC;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,OAAO,MAAM,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3D,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACrD,OAAO,MAAM,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzD,CAAC;CACF,CAAA;AAGD,kBAAe,MAAM,CAAA"}
@@ -34,6 +34,7 @@ register('60f9d0d048950c356be2e4da', './braze');
34
34
  register('61d7456b078e79929de4ee8c', './clevertap');
35
35
  register('61f8296b7d15c30a3bbe2b76', './close');
36
36
  register('61eed75ba749df7601b12186', './cordial');
37
+ register('6238cec53a46dd187d094eb7', './criteo-audiences');
37
38
  register('5f7dd78fe27ce7ff2b8bfa37', './customerio');
38
39
  register('61806e472cd47ea1104885fc', './facebook-conversions-api');
39
40
  register('61dde0dc77eb0db0392649d3', './friendbuy');
@@ -48,6 +49,7 @@ register('6116a41e2e8fc680d8daf821', './personas-messaging-twilio');
48
49
  register('5f7dd8191ad74f868ab1fc48', './pipedrive');
49
50
  register('61957755c4d820be968457de', './salesforce');
50
51
  register('5f7dd8e302173ff732db5cc4', './slack');
52
+ register('6234b137d3b6404a64f2a0f0', './talon-one');
51
53
  register('615cae349d109d6b7496a131', './tiktok-conversions');
52
54
  register('602efa1f249b9a5e2bf8a813', './twilio');
53
55
  register('614a3c7d791c91c41bae7599', './webhook');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/destinations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA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Y,CAAC,SAAS,CAAC,GAAG,UAAwC,CAAA;AACpE,CAAC;AAGD,KAAK,UAAU,kBAAkB,CAAC,IAAY;IAC5C,MAAM,WAAW,GAAG,MAAM,kDAAO,KAAK,IAAI,EAAE,IAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAGxE,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,OAAO,WAAW,EAAE,OAAO,KAAK,QAAQ,EAAE;QAClE,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,GAAW;IAChD,MAAM,WAAW,GAAG,oBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAA;IAExE,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAA;KACZ;IAGD,OAAO,IAAI,0BAAW,CAAC,WAAyC,CAAC,CAAA;AACnE,CAAC;AAED,SAAgB,kBAAkB,CAAC,EAAU;IAC3C,MAAM,WAAW,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAA;IAEhC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE;QAC5B,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,IAAI,0BAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;AAChD,CAAC;AARD,gDAQC;AAEM,KAAK,UAAU,uBAAuB,CAAC,WAAmB;IAC/D,OAAO,kBAAkB,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0DAEC"}
@@ -1,4 +1,4 @@
1
1
  export interface Payload {
2
- audience_id: string;
3
- audience_name: string;
2
+ audienceId: string;
3
+ audienceName: string;
4
4
  }
@@ -4,14 +4,14 @@ const action = {
4
4
  title: 'Create Audience',
5
5
  description: 'This creates a new audience entity in Talon.One.',
6
6
  fields: {
7
- audience_id: {
8
- label: 'audience_id',
7
+ audienceId: {
8
+ label: 'Segment Audience ID',
9
9
  description: 'You should get this audience ID from Segment.',
10
10
  type: 'string',
11
11
  required: true
12
12
  },
13
- audience_name: {
14
- label: 'audience_name',
13
+ audienceName: {
14
+ label: 'Audience Name',
15
15
  description: 'You should get this audience name from Segment.',
16
16
  type: 'string',
17
17
  required: true
@@ -21,8 +21,8 @@ const action = {
21
21
  return request(`https://integration.talon.one/segment/audiences`, {
22
22
  method: 'post',
23
23
  json: {
24
- audience_id: payload.audience_id,
25
- audience_name: payload.audience_name
24
+ audienceId: payload.audienceId,
25
+ audienceName: payload.audienceName
26
26
  }
27
27
  });
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/createAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,+CAA+C;YAC5D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,iDAAiD,EAAE;YAChE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,aAAa,EAAE,OAAO,CAAC,aAAa;aACrC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/createAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,+CAA+C;YAC5D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,iDAAiD,EAAE;YAChE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,YAAY,EAAE,OAAO,CAAC,YAAY;aACnC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,3 +1,3 @@
1
1
  export interface Payload {
2
- audience_id: string;
2
+ audienceId: string;
3
3
  }
@@ -4,15 +4,15 @@ const action = {
4
4
  title: 'Delete Audience',
5
5
  description: 'This deletes the audience entity in Talon.One.',
6
6
  fields: {
7
- audience_id: {
8
- label: 'audience_id',
7
+ audienceId: {
8
+ label: 'Segment Audience ID',
9
9
  description: 'You should get this audience ID from Segment.',
10
10
  type: 'string',
11
11
  required: true
12
12
  }
13
13
  },
14
14
  perform: (request, { payload }) => {
15
- return request(`https://integration.talon.one/segment/audiences/${payload.audience_id}`, { method: 'delete' });
15
+ return request(`https://integration.talon.one/segment/audiences/${payload.audienceId}`, { method: 'delete' });
16
16
  }
17
17
  };
18
18
  exports.default = action;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/deleteAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,+CAA+C;YAC5D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,mDAAmD,OAAO,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;IAChH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/deleteAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,+CAA+C;YAC5D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,mDAAmD,OAAO,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC/G,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,4 +1,4 @@
1
1
  export interface Settings {
2
- api_key: string;
2
+ apiKey: string;
3
3
  deployment: string;
4
4
  }
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const createAudience_1 = __importDefault(require("./createAudience"));
7
7
  const updateAudience_1 = __importDefault(require("./updateAudience"));
8
8
  const deleteAudience_1 = __importDefault(require("./deleteAudience"));
9
+ const updateCustomerProfile_1 = __importDefault(require("./updateCustomerProfile"));
10
+ const updateCustomerProfilesAttributes_1 = __importDefault(require("./updateCustomerProfilesAttributes"));
11
+ const updateCustomerProfilesAudiences_1 = __importDefault(require("./updateCustomerProfilesAudiences"));
9
12
  const trackEvent_1 = __importDefault(require("./trackEvent"));
10
13
  const destination = {
11
- name: 'Talon.One',
12
- slug: 'talon-one',
14
+ name: 'Talon.One (Actions)',
15
+ slug: 'actions-talon-one',
13
16
  mode: 'cloud',
14
17
  authentication: {
15
18
  scheme: 'custom',
16
19
  fields: {
17
- api_key: {
20
+ apiKey: {
18
21
  label: 'API Key',
19
22
  description: 'Created under Developer Settings in the Talon.One Campaign Manager.',
20
23
  type: 'string',
@@ -34,7 +37,7 @@ const destination = {
34
37
  extendRequest({ settings }) {
35
38
  return {
36
39
  headers: {
37
- Authorization: `ApiKey-v1 ${settings.api_key}`,
40
+ Authorization: `ApiKey-v1 ${settings.apiKey}`,
38
41
  'destination-hostname': `${settings.deployment}`
39
42
  }
40
43
  };
@@ -43,6 +46,9 @@ const destination = {
43
46
  createAudience: createAudience_1.default,
44
47
  updateAudience: updateAudience_1.default,
45
48
  deleteAudience: deleteAudience_1.default,
49
+ updateCustomerProfile: updateCustomerProfile_1.default,
50
+ updateCustomerProfilesAttributes: updateCustomerProfilesAttributes_1.default,
51
+ updateCustomerProfilesAudiences: updateCustomerProfilesAudiences_1.default,
46
52
  trackEvent: trackEvent_1.default
47
53
  }
48
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/talon-one/index.ts"],"names":[],"mappings":";;;;;AAGA,sEAA6C;AAC7C,sEAA6C;AAC7C,sEAA6C;AAC7C,8DAAqC;AAErC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KA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AE,IAAI;aACf;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAI5C,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,UAAU,cAAc,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;QACzE,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,aAAa,QAAQ,CAAC,MAAM,EAAE;gBAC7C,sBAAsB,EAAE,GAAG,QAAQ,CAAC,UAAU,EAAE;aACjD;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,cAAc,EAAd,wBAAc;QACd,cAAc,EAAd,wBAAc;QACd,cAAc,EAAd,wBAAc;QACd,qBAAqB,EAArB,+BAAqB;QACrB,gCAAgC,EAAhC,0CAAgC;QAChC,+BAA+B,EAA/B,yCAA+B;QAC/B,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { InputField } from '@segment/actions-core/src/destination-kit/types';
2
+ export declare const customerProfileId: InputField;
3
+ export declare const attribute: InputField;
4
+ export declare const audienceId: InputField;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.audienceId = exports.attribute = exports.customerProfileId = void 0;
4
+ exports.customerProfileId = {
5
+ label: 'Customer Profile ID',
6
+ description: 'Unique identifier of the customer profile.',
7
+ type: 'string',
8
+ required: true
9
+ };
10
+ exports.attribute = {
11
+ label: 'Attribute-Value pairs',
12
+ description: 'Arbitrary additional JSON data associated with the customer profile.',
13
+ type: 'object',
14
+ required: false
15
+ };
16
+ exports.audienceId = {
17
+ label: 'Talon.One audience ID',
18
+ description: 'You should get this audience ID from Talon.One.',
19
+ type: 'integer',
20
+ multiple: true,
21
+ required: false
22
+ };
23
+ //# sourceMappingURL=t1-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"t1-properties.js","sourceRoot":"","sources":["../../../src/destinations/talon-one/t1-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAe;IAC3C,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,4CAA4C;IACzD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,sEAAsE;IACnF,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;CAChB,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,iDAAiD;IAC9D,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAK;CAChB,CAAA"}
@@ -1,8 +1,8 @@
1
1
  export interface Payload {
2
- customer_profile_id: string;
3
- event_type: string;
2
+ customerProfileId: string;
3
+ eventType: string;
4
4
  type: string;
5
- event_attributes?: {
5
+ attributes?: {
6
6
  [k: string]: unknown;
7
7
  };
8
8
  }
@@ -4,27 +4,27 @@ const action = {
4
4
  title: 'Track Event',
5
5
  description: 'This records a custom event in Talon.One.',
6
6
  fields: {
7
- customer_profile_id: {
8
- label: 'customer_profile_id',
7
+ customerProfileId: {
8
+ label: 'Customer Profile ID',
9
9
  description: 'Unique identifier of the customer profile associated to the event.',
10
10
  type: 'string',
11
11
  required: true
12
12
  },
13
- event_type: {
14
- label: 'event_type',
15
- description: "It's just the name of your event.",
13
+ eventType: {
14
+ label: 'Event Type',
15
+ description: 'It is just the name of your event.',
16
16
  type: 'string',
17
17
  required: true
18
18
  },
19
19
  type: {
20
- label: 'type',
20
+ label: 'Type',
21
21
  description: 'Type of event. Can be only `string`, `time`, `number`, `boolean`, `location`',
22
22
  type: 'string',
23
23
  required: true
24
24
  },
25
- event_attributes: {
26
- label: 'type',
27
- description: 'Arbitrary additional JSON data associated with the event',
25
+ attributes: {
26
+ label: 'Attribute-Value pairs',
27
+ description: 'Arbitrary additional JSON data associated with the event.',
28
28
  type: 'object',
29
29
  required: false
30
30
  }
@@ -33,10 +33,10 @@ const action = {
33
33
  return request(`https://integration.talon.one/segment/event`, {
34
34
  method: 'put',
35
35
  json: {
36
- customer_profile_id: payload.customer_profile_id,
37
- event_type: payload.event_type,
36
+ customerProfileId: payload.customerProfileId,
37
+ eventType: payload.eventType,
38
38
  type: payload.type,
39
- event_attributes: payload.event_attributes
39
+ eventAttributes: payload.attributes
40
40
  }
41
41
  });
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/trackEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,2CAA2C;IACxD,MAAM,EAAE;QACN,mBAAmB,EAAE;YACnB,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,oEAAoE;YACjF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,8EAA8E;YAC3F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;gBAChD,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;aAC3C;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/trackEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,2CAA2C;IACxD,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,oEAAoE;YACjF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,oCAAoC;YACjD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,8EAA8E;YAC3F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,uBAAuB;YAC9B,WAAW,EAAE,2DAA2D;YACxE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;gBAC5C,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,eAAe,EAAE,OAAO,CAAC,UAAU;aACpC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,4 +1,4 @@
1
1
  export interface Payload {
2
- audience_id: string;
3
- audience_name: string;
2
+ audienceId: string;
3
+ audienceName: string;
4
4
  }
@@ -4,24 +4,24 @@ const action = {
4
4
  title: 'Update Audience',
5
5
  description: 'This synchronizes audience data if there is an existing audience entity.',
6
6
  fields: {
7
- audience_id: {
8
- label: 'audience_id',
7
+ audienceId: {
8
+ label: 'Segment Audience ID',
9
9
  description: 'You should get this audience ID from Segment.',
10
10
  type: 'string',
11
11
  required: true
12
12
  },
13
- audience_name: {
14
- label: 'audience_name',
13
+ audienceName: {
14
+ label: 'Audience Name',
15
15
  description: 'You should get this audience name from Segment.',
16
16
  type: 'string',
17
17
  required: true
18
18
  }
19
19
  },
20
20
  perform: (request, { payload }) => {
21
- return request(`https://integration.talon.one/segment/audiences/${payload.audience_id}`, {
21
+ return request(`https://integration.talon.one/segment/audiences/${payload.audienceId}`, {
22
22
  method: 'put',
23
23
  json: {
24
- audience_name: payload.audience_name
24
+ audienceName: payload.audienceName
25
25
  }
26
26
  });
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,+CAA+C;YAC5D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,mDAAmD,OAAO,CAAC,WAAW,EAAE,EAAE;YACvF,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,aAAa,EAAE,OAAO,CAAC,aAAa;aACrC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateAudience/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,+CAA+C;YAC5D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,mDAAmD,OAAO,CAAC,UAAU,EAAE,EAAE;YACtF,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,YAAY,EAAE,OAAO,CAAC,YAAY;aACnC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ attributes?: {
3
+ [k: string]: unknown;
4
+ };
5
+ customerProfileId: string;
6
+ deleteAudienceIDs?: number[];
7
+ addAudienceIDs?: number[];
8
+ runRuleEngine?: boolean;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfile/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const t1_properties_1 = require("../t1-properties");
4
+ const action = {
5
+ title: 'Update Customer Profile',
6
+ description: 'This synchronizes customer profile data concerning audiences and attributes.',
7
+ fields: {
8
+ attributes: { ...t1_properties_1.attribute },
9
+ customerProfileId: { ...t1_properties_1.customerProfileId },
10
+ deleteAudienceIDs: { ...t1_properties_1.audienceId },
11
+ addAudienceIDs: { ...t1_properties_1.audienceId },
12
+ runRuleEngine: {
13
+ label: 'Run rule engine',
14
+ description: 'This runs rule engine in Talon.One upon updating customer profile. Set to true to trigger rules.',
15
+ type: 'boolean',
16
+ default: false
17
+ }
18
+ },
19
+ perform: (request, { payload }) => {
20
+ return request(`https://integration.talon.one/segment/customer_profile/${payload.customerProfileId}`, {
21
+ method: 'put',
22
+ json: {
23
+ attributes: payload.attributes,
24
+ audiencesChanges: {
25
+ adds: payload.addAudienceIDs,
26
+ deletes: payload.deleteAudienceIDs
27
+ },
28
+ runRuleEngine: payload.runRuleEngine
29
+ }
30
+ });
31
+ }
32
+ };
33
+ exports.default = action;
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfile/index.ts"],"names":[],"mappings":";;AAGA,oDAA2E;AAE3E,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,8EAA8E;IAC3F,MAAM,EAAE;QACN,UAAU,EAAE,EAAE,GAAG,yBAAS,EAAE;QAC5B,iBAAiB,EAAE,EAAE,GAAG,iCAAiB,EAAE;QAC3C,iBAAiB,EAAE,EAAE,GAAG,0BAAU,EAAE;QACpC,cAAc,EAAE,EAAE,GAAG,0BAAU,EAAE;QACjC,aAAa,EAAE;YACb,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,kGAAkG;YAC/G,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,0DAA0D,OAAO,CAAC,iBAAiB,EAAE,EAAE;YACpG,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,gBAAgB,EAAE;oBAChB,IAAI,EAAE,OAAO,CAAC,cAAc;oBAC5B,OAAO,EAAE,OAAO,CAAC,iBAAiB;iBACnC;gBACD,aAAa,EAAE,OAAO,CAAC,aAAa;aACrC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ customerProfileId: string;
3
+ attributes?: {
4
+ [k: string]: unknown;
5
+ };
6
+ mutualAttributes?: {
7
+ [k: string]: unknown;
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const t1_properties_1 = require("../t1-properties");
4
+ const action = {
5
+ title: 'Update Customer Profile Attribute-Value pairs.',
6
+ description: 'This synchronizes attributes data for multiple customer profiles.',
7
+ fields: {
8
+ customerProfileId: { ...t1_properties_1.customerProfileId },
9
+ attributes: { ...t1_properties_1.attribute },
10
+ mutualAttributes: { ...t1_properties_1.attribute }
11
+ },
12
+ perform: (request, { payload }) => {
13
+ return request(`https://integration.talon.one/segment/customer_profiles/attributes`, {
14
+ method: 'put',
15
+ json: {
16
+ data: [
17
+ {
18
+ customerProfileId: payload.customerProfileId,
19
+ attributes: payload.attributes
20
+ }
21
+ ],
22
+ mutualAttributes: payload.mutualAttributes
23
+ }
24
+ });
25
+ }
26
+ };
27
+ exports.default = action;
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfilesAttributes/index.ts"],"names":[],"mappings":";;AAGA,oDAA+D;AAE/D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,mEAAmE;IAChF,MAAM,EAAE;QACN,iBAAiB,EAAE,EAAE,GAAG,iCAAiB,EAAE;QAC3C,UAAU,EAAE,EAAE,GAAG,yBAAS,EAAE;QAC5B,gBAAgB,EAAE,EAAE,GAAG,yBAAS,EAAE;KACnC;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,oEAAoE,EAAE;YACnF,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ;wBACE,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;wBAC5C,UAAU,EAAE,OAAO,CAAC,UAAU;qBAC/B;iBACF;gBACD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;aAC3C;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface Payload {
2
+ deleteAudienceIDs?: number[];
3
+ addAudienceIDs?: number[];
4
+ customerProfileId: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfilesAudiences/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const t1_properties_1 = require("../t1-properties");
4
+ const action = {
5
+ title: 'Update Customer Profiles Audiences',
6
+ description: 'This synchronizes audience data for multiple customer profiles.',
7
+ fields: {
8
+ deleteAudienceIDs: { ...t1_properties_1.audienceId },
9
+ addAudienceIDs: { ...t1_properties_1.audienceId },
10
+ customerProfileId: { ...t1_properties_1.customerProfileId }
11
+ },
12
+ perform: (request, { payload }) => {
13
+ return request(`https://integration.talon.one/segment/customer_profiles/audiences`, {
14
+ method: 'put',
15
+ json: {
16
+ data: [
17
+ {
18
+ customerProfileId: payload.customerProfileId,
19
+ adds: payload.addAudienceIDs,
20
+ deletes: payload.deleteAudienceIDs
21
+ }
22
+ ]
23
+ }
24
+ });
25
+ }
26
+ };
27
+ exports.default = action;
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfilesAudiences/index.ts"],"names":[],"mappings":";;AAGA,oDAAgE;AAEhE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,oCAAoC;IAC3C,WAAW,EAAE,iEAAiE;IAC9E,MAAM,EAAE;QACN,iBAAiB,EAAE,EAAE,GAAG,0BAAU,EAAE;QACpC,cAAc,EAAE,EAAE,GAAG,0BAAU,EAAE;QACjC,iBAAiB,EAAE,EAAE,GAAG,iCAAiB,EAAE;KAC5C;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEhC,OAAO,OAAO,CAAC,mEAAmE,EAAE;YAClF,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ;wBACE,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;wBAC5C,IAAI,EAAE,OAAO,CAAC,cAAc;wBAC5B,OAAO,EAAE,OAAO,CAAC,iBAAiB;qBACnC;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
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.56.1-alpha.2",
4
+ "version": "3.58.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@amplitude/ua-parser-js": "^0.7.25",
41
- "@segment/actions-core": "^3.22.2-alpha.2",
42
- "@segment/actions-shared": "^1.4.1-alpha.2",
41
+ "@segment/actions-core": "^3.22.1",
42
+ "@segment/actions-shared": "^1.4.0",
43
43
  "cheerio": "^1.0.0-rc.10",
44
44
  "dayjs": "^1.10.7",
45
45
  "escape-goat": "^3",
@@ -62,5 +62,5 @@
62
62
  "<rootDir>/test/setup-after-env.ts"
63
63
  ]
64
64
  },
65
- "gitHead": "0ee5dbc84cf3d872539c71e73186e39fd0aaa519"
65
+ "gitHead": "b0d3b1307158bff8dc04ff9abdc473481de2684f"
66
66
  }