@segment/action-destinations 3.133.0 → 3.133.1-staging.195

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 (141) hide show
  1. package/dist/destinations/actable-predictive/index.js +1 -1
  2. package/dist/destinations/actable-predictive/index.js.map +1 -1
  3. package/dist/destinations/actable-predictive/sendCustomEvent/index.js +13 -13
  4. package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -1
  5. package/dist/destinations/actable-predictive/sendEmailEvent/index.js +20 -20
  6. package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -1
  7. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +28 -28
  8. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -1
  9. package/dist/destinations/actable-predictive/sendWebEvent/index.js +25 -25
  10. package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -1
  11. package/dist/destinations/actions-bingads/functions.d.ts +0 -0
  12. package/dist/destinations/actions-bingads/functions.js +2 -0
  13. package/dist/destinations/actions-bingads/functions.js.map +1 -0
  14. package/dist/destinations/actions-bingads/generated-types.d.ts +10 -0
  15. package/dist/destinations/actions-bingads/generated-types.js +3 -0
  16. package/dist/destinations/actions-bingads/generated-types.js.map +1 -0
  17. package/dist/destinations/actions-bingads/index.d.ts +4 -0
  18. package/dist/destinations/actions-bingads/index.js +77 -0
  19. package/dist/destinations/actions-bingads/index.js.map +1 -0
  20. package/dist/destinations/actions-bingads/offlineConversions/formatter.d.ts +8 -0
  21. package/dist/destinations/actions-bingads/offlineConversions/formatter.js +33 -0
  22. package/dist/destinations/actions-bingads/offlineConversions/formatter.js.map +1 -0
  23. package/dist/destinations/actions-bingads/offlineConversions/generated-types.d.ts +7 -0
  24. package/dist/destinations/actions-bingads/offlineConversions/generated-types.js +3 -0
  25. package/dist/destinations/actions-bingads/offlineConversions/generated-types.js.map +1 -0
  26. package/dist/destinations/actions-bingads/offlineConversions/index.d.ts +5 -0
  27. package/dist/destinations/actions-bingads/offlineConversions/index.js +131 -0
  28. package/dist/destinations/actions-bingads/offlineConversions/index.js.map +1 -0
  29. package/dist/destinations/braze/trackEvent/generated-types.d.ts +0 -1
  30. package/dist/destinations/braze/trackEvent/index.js +35 -11
  31. package/dist/destinations/braze/trackEvent/index.js.map +1 -1
  32. package/dist/destinations/braze/trackPurchase/index.js +43 -2
  33. package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
  34. package/dist/destinations/braze-cohorts/cohortChanges.d.ts +10 -0
  35. package/dist/destinations/braze-cohorts/cohortChanges.js +3 -0
  36. package/dist/destinations/braze-cohorts/cohortChanges.js.map +1 -0
  37. package/dist/destinations/clevertap/userDelete/index.js +4 -4
  38. package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
  39. package/dist/destinations/cordial/addContactToList/index.js.map +1 -1
  40. package/dist/destinations/cordial/addProductToCart/index.js +1 -1
  41. package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
  42. package/dist/destinations/cordial/cordial-client.js +2 -2
  43. package/dist/destinations/cordial/createContactactivity/index.js.map +1 -1
  44. package/dist/destinations/cordial/identities-fields.d.ts +1 -1
  45. package/dist/destinations/cordial/identities-fields.js +1 -1
  46. package/dist/destinations/cordial/identities-fields.js.map +1 -1
  47. package/dist/destinations/cordial/index.js +1 -1
  48. package/dist/destinations/cordial/index.js.map +1 -1
  49. package/dist/destinations/cordial/mergeContacts/index.js.map +1 -1
  50. package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -1
  51. package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
  52. package/dist/destinations/cordial/upsertOrder/index.js +8 -8
  53. package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
  54. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +5 -0
  55. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +1 -0
  56. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +1 -1
  57. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.d.ts +1 -0
  58. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js +8 -0
  59. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +1 -1
  60. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +6 -0
  61. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +5 -1
  62. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
  63. package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +1 -0
  64. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +1 -1
  65. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +1 -1
  66. package/dist/destinations/google-sheets-dev/index.js +10 -3
  67. package/dist/destinations/google-sheets-dev/index.js.map +1 -1
  68. package/dist/destinations/google-sheets-partner/constants.d.ts +3 -0
  69. package/dist/destinations/google-sheets-partner/constants.js +7 -0
  70. package/dist/destinations/google-sheets-partner/constants.js.map +1 -0
  71. package/dist/destinations/google-sheets-partner/generated-types.d.ts +2 -0
  72. package/dist/destinations/google-sheets-partner/generated-types.js +3 -0
  73. package/dist/destinations/google-sheets-partner/generated-types.js.map +1 -0
  74. package/dist/destinations/google-sheets-partner/googleapis/index.d.ts +17 -0
  75. package/dist/destinations/google-sheets-partner/googleapis/index.js +34 -0
  76. package/dist/destinations/google-sheets-partner/googleapis/index.js.map +1 -0
  77. package/dist/destinations/google-sheets-partner/index.d.ts +4 -0
  78. package/dist/destinations/google-sheets-partner/index.js +43 -0
  79. package/dist/destinations/google-sheets-partner/index.js.map +1 -0
  80. package/dist/destinations/google-sheets-partner/postSheet/generated-types.d.ts +11 -0
  81. package/dist/destinations/google-sheets-partner/postSheet/generated-types.js +3 -0
  82. package/dist/destinations/google-sheets-partner/postSheet/generated-types.js.map +1 -0
  83. package/dist/destinations/google-sheets-partner/postSheet/index.d.ts +5 -0
  84. package/dist/destinations/google-sheets-partner/postSheet/index.js +79 -0
  85. package/dist/destinations/google-sheets-partner/postSheet/index.js.map +1 -0
  86. package/dist/destinations/google-sheets-partner/postSheet/operations.d.ts +10 -0
  87. package/dist/destinations/google-sheets-partner/postSheet/operations.js +96 -0
  88. package/dist/destinations/google-sheets-partner/postSheet/operations.js.map +1 -0
  89. package/dist/destinations/index.js +2 -0
  90. package/dist/destinations/index.js.map +1 -1
  91. package/dist/destinations/mixpanel/index.js +1 -1
  92. package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
  93. package/dist/destinations/mixpanel/trackEvent/functions.js +1 -1
  94. package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
  95. package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
  96. package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
  97. package/dist/destinations/salesforce/sf-properties.d.ts +1 -0
  98. package/dist/destinations/salesforce/sf-properties.js.map +1 -1
  99. package/dist/destinations/segment/segment-properties.js +1 -2
  100. package/dist/destinations/segment/segment-properties.js.map +1 -1
  101. package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -1
  102. package/dist/destinations/tiktok-audiences/addUser/generated-types.d.ts +12 -0
  103. package/dist/destinations/tiktok-audiences/addUser/generated-types.js +3 -0
  104. package/dist/destinations/tiktok-audiences/addUser/generated-types.js.map +1 -0
  105. package/dist/destinations/tiktok-audiences/addUser/index.d.ts +5 -0
  106. package/dist/destinations/tiktok-audiences/addUser/index.js +47 -0
  107. package/dist/destinations/tiktok-audiences/addUser/index.js.map +1 -0
  108. package/dist/destinations/tiktok-audiences/api/api.test.d.ts +1 -0
  109. package/dist/destinations/tiktok-audiences/api/api.test.js +118 -0
  110. package/dist/destinations/tiktok-audiences/api/api.test.js.map +1 -0
  111. package/dist/destinations/tiktok-audiences/api/index.d.ts +13 -0
  112. package/dist/destinations/tiktok-audiences/api/index.js +93 -0
  113. package/dist/destinations/tiktok-audiences/api/index.js.map +1 -0
  114. package/dist/destinations/tiktok-audiences/constants.d.ts +2 -0
  115. package/dist/destinations/tiktok-audiences/constants.js +6 -0
  116. package/dist/destinations/tiktok-audiences/constants.js.map +1 -0
  117. package/dist/destinations/tiktok-audiences/functions.d.ts +14 -0
  118. package/dist/destinations/tiktok-audiences/functions.js +116 -0
  119. package/dist/destinations/tiktok-audiences/functions.js.map +1 -0
  120. package/dist/destinations/tiktok-audiences/generated-types.d.ts +3 -0
  121. package/dist/destinations/tiktok-audiences/generated-types.js +3 -0
  122. package/dist/destinations/tiktok-audiences/generated-types.js.map +1 -0
  123. package/dist/destinations/tiktok-audiences/index.d.ts +4 -0
  124. package/dist/destinations/tiktok-audiences/index.js +38 -0
  125. package/dist/destinations/tiktok-audiences/index.js.map +1 -0
  126. package/dist/destinations/tiktok-audiences/properties.d.ts +11 -0
  127. package/dist/destinations/tiktok-audiences/properties.js +80 -0
  128. package/dist/destinations/tiktok-audiences/properties.js.map +1 -0
  129. package/dist/destinations/tiktok-audiences/removeUser/generated-types.d.ts +12 -0
  130. package/dist/destinations/tiktok-audiences/removeUser/generated-types.js +3 -0
  131. package/dist/destinations/tiktok-audiences/removeUser/generated-types.js.map +1 -0
  132. package/dist/destinations/tiktok-audiences/removeUser/index.d.ts +5 -0
  133. package/dist/destinations/tiktok-audiences/removeUser/index.js +47 -0
  134. package/dist/destinations/tiktok-audiences/removeUser/index.js.map +1 -0
  135. package/dist/destinations/tiktok-audiences/types.d.ts +33 -0
  136. package/dist/destinations/tiktok-audiences/types.js +3 -0
  137. package/dist/destinations/tiktok-audiences/types.js.map +1 -0
  138. package/package.json +2 -2
  139. package/dist/destinations/braze/utils.d.ts +0 -6
  140. package/dist/destinations/braze/utils.js +0 -81
  141. package/dist/destinations/braze/utils.js.map +0 -1
@@ -0,0 +1,38 @@
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 addUser_1 = __importDefault(require("./addUser"));
7
+ const removeUser_1 = __importDefault(require("./removeUser"));
8
+ const destination = {
9
+ name: 'TikTok Audiences',
10
+ slug: 'actions-tiktok-audiences',
11
+ mode: 'cloud',
12
+ authentication: {
13
+ scheme: 'oauth2',
14
+ fields: {
15
+ advertiser_ids: {
16
+ label: 'TikTok Advertiser IDs',
17
+ description: 'The Advertiser IDs where audiences should be synced.',
18
+ type: 'string',
19
+ required: true,
20
+ multiple: true
21
+ }
22
+ }
23
+ },
24
+ extendRequest({ auth }) {
25
+ return {
26
+ headers: {
27
+ 'Access-Token': `${auth?.accessToken}`,
28
+ 'Content-Type': 'application/json'
29
+ }
30
+ };
31
+ },
32
+ actions: {
33
+ addUser: addUser_1.default,
34
+ removeUser: removeUser_1.default
35
+ }
36
+ };
37
+ exports.default = destination;
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-audiences/index.ts"],"names":[],"mappings":";;;;;AAGA,wDAA+B;AAC/B,8DAAqC;AAErC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,cAAc,EAAE;gBACd,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,sDAAsD;gBACnE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KASF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,cAAc,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE;gBACtC,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,OAAO,EAAP,iBAAO;QACP,UAAU,EAAV,oBAAU;KACX;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { InputField } from '@segment/actions-core/src/destination-kit/types';
2
+ export declare const selected_advertiser_id: InputField;
3
+ export declare const custom_audience_name: InputField;
4
+ export declare const id_type: InputField;
5
+ export declare const email: InputField;
6
+ export declare const send_email: InputField;
7
+ export declare const advertising_id: InputField;
8
+ export declare const send_advertising_id: InputField;
9
+ export declare const event_name: InputField;
10
+ export declare const enable_batching: InputField;
11
+ export declare const personas_audience_key: InputField;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.personas_audience_key = exports.enable_batching = exports.event_name = exports.send_advertising_id = exports.advertising_id = exports.send_email = exports.email = exports.id_type = exports.custom_audience_name = exports.selected_advertiser_id = void 0;
4
+ exports.selected_advertiser_id = {
5
+ label: 'Advertiser ID',
6
+ description: 'The advertiser ID to use when syncing audiences.',
7
+ type: 'string',
8
+ dynamic: true,
9
+ required: true
10
+ };
11
+ exports.custom_audience_name = {
12
+ label: 'Custom Audience Name',
13
+ description: 'Custom audience name of audience to be created. Please note that names over 70 characters will be truncated to 67 characters with "..." appended. This field is set only when Segment creates a new audience. Updating this field after Segment has created an audience will not update the audience name in TikTok.',
14
+ type: 'string',
15
+ default: {
16
+ '@path': '$.properties.audience_key'
17
+ },
18
+ required: true
19
+ };
20
+ exports.id_type = {
21
+ label: 'ID Type',
22
+ description: 'Encryption type to be used for populating the audience. This field is set only when Segment creates a new audience.',
23
+ type: 'string',
24
+ choices: [
25
+ { label: 'Email', value: 'EMAIL_SHA256' },
26
+ { label: 'Phone', value: 'PHONE_SHA256' },
27
+ { label: 'Google Advertising ID', value: 'GAID_SHA256' },
28
+ { label: 'Android Advertising ID', value: 'AAID_SHA256' },
29
+ { label: 'iOS Advertising ID', value: 'IDFA_SHA256' }
30
+ ],
31
+ required: true
32
+ };
33
+ exports.email = {
34
+ label: 'User Email',
35
+ description: "The user's email address to send to TikTok.",
36
+ type: 'hidden',
37
+ default: {
38
+ '@path': '$.context.traits.email'
39
+ }
40
+ };
41
+ exports.send_email = {
42
+ label: 'Send Email',
43
+ description: 'Send email to TikTok. Segment will hash this value before sending',
44
+ type: 'boolean',
45
+ default: true
46
+ };
47
+ exports.advertising_id = {
48
+ label: 'User Advertising ID',
49
+ description: "The user's mobile dvertising ID to send to TikTok. This could be a GAID, IDFA, or AAID",
50
+ type: 'hidden',
51
+ default: {
52
+ '@path': '$.context.device.advertisingId'
53
+ }
54
+ };
55
+ exports.send_advertising_id = {
56
+ label: 'Send Mobile Advertising ID',
57
+ description: 'Send mobile advertising ID (IDFA, AAID or GAID) to TikTok. Segment will hash this value before sending.',
58
+ type: 'boolean',
59
+ default: true
60
+ };
61
+ exports.event_name = {
62
+ label: 'Event Name',
63
+ description: 'The name of the current Segment event.',
64
+ type: 'hidden',
65
+ default: {
66
+ '@path': '$.event'
67
+ }
68
+ };
69
+ exports.enable_batching = {
70
+ label: 'Enable Batching',
71
+ description: 'Enable batching of requests to the TikTok Audiences.',
72
+ type: 'boolean',
73
+ default: true
74
+ };
75
+ exports.personas_audience_key = {
76
+ label: 'Segment Engage Audience Key',
77
+ description: 'The `audience_key` of the Engage audience you want to sync to TikTok. This value must be a hard-coded string variable, e.g. `personas_test_audience`, in order for batching to work properly.',
78
+ type: 'string'
79
+ };
80
+ //# sourceMappingURL=properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-audiences/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAe;IAChD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,oBAAoB,GAAe;IAC9C,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,sTAAsT;IACxT,IAAI,EAAE,QAAQ;I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,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,SAAS;KACnB;CACF,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,sDAAsD;IACnE,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,qBAAqB,GAAe;IAC/C,KAAK,EAAE,6BAA6B;IACpC,WAAW,EACT,+LAA+L;IACjM,IAAI,EAAE,QAAQ;CACf,CAAA"}
@@ -0,0 +1,12 @@
1
+ export interface Payload {
2
+ selected_advertiser_id: string;
3
+ custom_audience_name: string;
4
+ id_type: string;
5
+ email?: string;
6
+ advertising_id?: string;
7
+ send_email?: boolean;
8
+ send_advertising_id?: boolean;
9
+ event_name?: string;
10
+ enable_batching?: boolean;
11
+ personas_audience_key?: string;
12
+ }
@@ -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/tiktok-audiences/removeUser/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,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const functions_1 = require("../functions");
4
+ const properties_1 = require("../properties");
5
+ const api_1 = require("../api");
6
+ const action = {
7
+ title: 'Remove Users',
8
+ description: 'Remove contacts from an Engage Audience to a TikTok Audience Segment.',
9
+ defaultSubscription: 'event = "Audience Exited"',
10
+ fields: {
11
+ selected_advertiser_id: { ...properties_1.selected_advertiser_id },
12
+ custom_audience_name: { ...properties_1.custom_audience_name },
13
+ id_type: { ...properties_1.id_type },
14
+ email: { ...properties_1.email },
15
+ advertising_id: { ...properties_1.advertising_id },
16
+ send_email: { ...properties_1.send_email },
17
+ send_advertising_id: { ...properties_1.send_advertising_id },
18
+ event_name: { ...properties_1.event_name },
19
+ enable_batching: { ...properties_1.enable_batching },
20
+ personas_audience_key: { ...properties_1.personas_audience_key }
21
+ },
22
+ dynamicFields: {
23
+ selected_advertiser_id: async (request, { settings }) => {
24
+ try {
25
+ const tiktok = new api_1.TikTokAudiences(request);
26
+ return tiktok.fetchAdvertisers(settings.advertiser_ids);
27
+ }
28
+ catch (err) {
29
+ return {
30
+ choices: [],
31
+ error: {
32
+ message: JSON.stringify(err),
33
+ code: '500'
34
+ }
35
+ };
36
+ }
37
+ }
38
+ },
39
+ perform: async (request, { settings, payload }) => {
40
+ return functions_1.processPayload(request, settings, [payload], 'delete');
41
+ },
42
+ performBatch: async (request, { settings, payload }) => {
43
+ return functions_1.processPayload(request, settings, payload, 'delete');
44
+ }
45
+ };
46
+ exports.default = action;
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-audiences/removeUser/index.ts"],"names":[],"mappings":";;AAGA,4CAA6C;AAC7C,8CAWsB;AACtB,gCAAwC;AAExC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,uEAAuE;IACpF,mBAAmB,EAAE,2BAA2B;IAChD,MAAM,EAAE;QACN,sBAAsB,EAAE,EAAE,GAAG,mCAAsB,EAAE;QACrD,oBAAoB,EAAE,EAAE,GAAG,iCAAoB,EAAE;QACjD,OAAO,EAAE,EAAE,GAAG,oBAAO,EAAE;QACvB,KAAK,EAAE,EAAE,GAAG,kBAAK,EAAE;QACnB,cAAc,EAAE,EAAE,GAAG,2BAAc,EAAE;QACrC,UAAU,EAAE,EAAE,GAAG,uBAAU,EAAE;QAC7B,mBAAmB,EAAE,EAAE,GAAG,gCAAmB,EAAE;QAC/C,UAAU,EAAE,EAAE,GAAG,uBAAU,EAAE;QAC7B,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;QACvC,qBAAqB,EAAE,EAAE,GAAG,kCAAqB,EAAE;KACpD;IACD,aAAa,EAAE;QACb,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YACtD,IAAI;gBACF,MAAM,MAAM,GAAG,IAAI,qBAAe,CAAC,OAAO,CAAC,CAAA;gBAE3C,OAAO,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAA;aACxD;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO;oBACL,OAAO,EAAE,EAAE;oBACX,KAAK,EAAE;wBACL,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;wBAC5B,IAAI,EAAE,KAAK;qBACZ;iBACF,CAAA;aACF;QACH,CAAC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,OAAO,0BAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC/D,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACrD,OAAO,0BAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC7D,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,33 @@
1
+ export interface APIResponse {
2
+ code: number;
3
+ message: string;
4
+ request_id: string;
5
+ }
6
+ export interface GetAudienceAPIResponse extends APIResponse {
7
+ data: {
8
+ page_info: {
9
+ page: number;
10
+ total_page: number;
11
+ total_number: number;
12
+ page_size: number;
13
+ };
14
+ list: [Audiences];
15
+ };
16
+ }
17
+ export interface CreateAudienceAPIResponse extends APIResponse {
18
+ data: {
19
+ audience_id: string;
20
+ };
21
+ }
22
+ export interface Audiences {
23
+ is_expiring: boolean;
24
+ cover_num: number;
25
+ name: string;
26
+ audience_id: string;
27
+ audience_type: string;
28
+ is_valid: boolean;
29
+ create_time: string;
30
+ shared: boolean;
31
+ expired_time: string;
32
+ calculate_type: string;
33
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-audiences/types.ts"],"names":[],"mappings":""}
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.133.0",
4
+ "version": "3.133.1-staging.195+b03941b5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -68,5 +68,5 @@
68
68
  "lcov"
69
69
  ]
70
70
  },
71
- "gitHead": "e46c080524ccf5ea07837e2d15ce3a3840df69d0"
71
+ "gitHead": "b03941b511e07e07cd6d79aa5374e193138fc247"
72
72
  }
@@ -1,6 +0,0 @@
1
- import { RequestClient } from '@segment/actions-core';
2
- import { Settings } from './generated-types';
3
- import { Payload as TrackEventPayload } from './trackEvent/generated-types';
4
- import { Payload as TrackPurchasePayload } from './trackPurchase/generated-types';
5
- export declare function sendTrackEvent(request: RequestClient, settings: Settings, payloads: TrackEventPayload[]): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
6
- export declare function sendTrackPurchase(request: RequestClient, settings: Settings, payload: TrackPurchasePayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>> | undefined;
@@ -1,81 +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
- exports.sendTrackPurchase = exports.sendTrackEvent = void 0;
7
- const actions_core_1 = require("@segment/actions-core");
8
- const actions_core_2 = require("@segment/actions-core");
9
- const dayjs_1 = __importDefault(require("dayjs"));
10
- const trackPurchase_1 = __importDefault(require("./trackPurchase"));
11
- const userAlias_1 = require("./userAlias");
12
- function toISO8601(date) {
13
- if (date === null || date === undefined) {
14
- return date;
15
- }
16
- const d = dayjs_1.default(date);
17
- return d.isValid() ? d.toISOString() : undefined;
18
- }
19
- function sendTrackEvent(request, settings, payloads) {
20
- const payload = payloads.map((payload) => {
21
- const { braze_id, external_id } = payload;
22
- const user_alias = userAlias_1.getUserAlias(payload.user_alias);
23
- if (!braze_id && !user_alias && !external_id) {
24
- throw new actions_core_2.IntegrationError('One of "external_id" or "user_alias" or "braze_id" is required.', 'Missing required fields', 400);
25
- }
26
- return {
27
- braze_id,
28
- external_id,
29
- user_alias,
30
- app_id: settings.app_id,
31
- name: payload.name,
32
- time: toISO8601(payload.time),
33
- properties: payload.properties,
34
- _update_existing_only: payload._update_existing_only
35
- };
36
- });
37
- return request(`${settings.endpoint}/users/track`, {
38
- method: 'post',
39
- ...(payload.length > 1 ? { headers: { 'X-Braze-Batch': 'true' } } : undefined),
40
- json: {
41
- events: payload
42
- }
43
- });
44
- }
45
- exports.sendTrackEvent = sendTrackEvent;
46
- function sendTrackPurchase(request, settings, payload) {
47
- const { braze_id, external_id } = payload;
48
- const user_alias = userAlias_1.getUserAlias(payload.user_alias);
49
- if (!braze_id && !user_alias && !external_id) {
50
- throw new actions_core_2.IntegrationError('One of "external_id" or "user_alias" or "braze_id" is required.', 'Missing required fields', 400);
51
- }
52
- if (payload.products.length === 0) {
53
- return;
54
- }
55
- const reservedKeys = Object.keys(trackPurchase_1.default.fields.products.properties ?? {});
56
- const properties = actions_core_1.omit(payload.properties, reservedKeys);
57
- const base = {
58
- braze_id,
59
- external_id,
60
- user_alias,
61
- app_id: settings.app_id,
62
- time: toISO8601(payload.time),
63
- properties,
64
- _update_existing_only: payload._update_existing_only
65
- };
66
- return request(`${settings.endpoint}/users/track`, {
67
- method: 'post',
68
- ...(payload.products.length > 1 ? { headers: { 'X-Braze-Batch': 'true' } } : undefined),
69
- json: {
70
- purchases: payload.products.map((product) => ({
71
- ...base,
72
- product_id: product.product_id,
73
- currency: product.currency ?? 'USD',
74
- price: product.price,
75
- quantity: product.quantity
76
- }))
77
- }
78
- });
79
- }
80
- exports.sendTrackPurchase = sendTrackPurchase;
81
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/braze/utils.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA4C;AAC5C,wDAAuE;AACvE,kDAAyB;AAEzB,oEAAoC;AAGpC,2CAA0C;AAI1C,SAAS,SAAS,CAAC,IAAe;IAChC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;QACvC,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,CAAC,GAAG,eAAK,CAAC,IAAI,CAAC,CAAA;IACrB,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AAClD,CAAC;AAED,SAAgB,cAAc,CAAC,OAAsB,EAAE,QAAkB,EAAE,QAA6B;IACtG,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACvC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QAEzC,MAAM,UAAU,GAAG,wBAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAEnD,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,IAAI,CAAC,WAAW,EAAE;YAC5C,MAAM,IAAI,+BAAgB,CACxB,iEAAiE,EACjE,yBAAyB,EACzB,GAAG,CACJ,CAAA;SACF;QAED,OAAO;YACL,QAAQ;YACR,WAAW;YAC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