@segment/action-destinations 3.260.1-staging.1 → 3.261.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 (203) hide show
  1. package/dist/destinations/amazon-ads/generated-types.d.ts +0 -9
  2. package/dist/destinations/amazon-ads/index.d.ts +2 -2
  3. package/dist/destinations/amazon-ads/index.js +3 -174
  4. package/dist/destinations/amazon-ads/index.js.map +1 -1
  5. package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +0 -19
  6. package/dist/destinations/amazon-ads/syncAudiences/index.js +7 -158
  7. package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -1
  8. package/dist/destinations/chartmogul/index.js +1 -1
  9. package/dist/destinations/chartmogul/index.js.map +1 -1
  10. package/dist/destinations/display-video-360/addToAudience/index.js +1 -2
  11. package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -1
  12. package/dist/destinations/engage/utils/EngageActionPerformer.js +2 -17
  13. package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -1
  14. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.d.ts +0 -3
  15. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js +0 -15
  16. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -1
  17. package/dist/destinations/engage/utils/track.d.ts +0 -3
  18. package/dist/destinations/gameball/index.js +1 -1
  19. package/dist/destinations/gameball/index.js.map +1 -1
  20. package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
  21. package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js +4 -4
  22. package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js.map +1 -1
  23. package/dist/destinations/index.js +3 -0
  24. package/dist/destinations/index.js.map +1 -1
  25. package/dist/destinations/inleads-ai/common-fields.d.ts +3 -0
  26. package/dist/destinations/inleads-ai/common-fields.js +238 -0
  27. package/dist/destinations/inleads-ai/common-fields.js.map +1 -0
  28. package/dist/destinations/inleads-ai/contants.d.ts +4 -0
  29. package/dist/destinations/inleads-ai/contants.js +8 -0
  30. package/dist/destinations/inleads-ai/contants.js.map +1 -0
  31. package/dist/destinations/inleads-ai/generated-types.d.ts +3 -0
  32. package/dist/destinations/inleads-ai/generated-types.js.map +1 -0
  33. package/dist/destinations/inleads-ai/group/generated-types.d.ts +44 -0
  34. package/dist/destinations/inleads-ai/group/generated-types.js.map +1 -0
  35. package/dist/destinations/{responsys/asyncMergePetRecords → inleads-ai/group}/index.d.ts +1 -1
  36. package/dist/destinations/inleads-ai/group/index.js +76 -0
  37. package/dist/destinations/inleads-ai/group/index.js.map +1 -0
  38. package/dist/destinations/inleads-ai/identify/generated-types.d.ts +46 -0
  39. package/dist/destinations/{engage/sendgrid/Profile.js → inleads-ai/identify/generated-types.js} +1 -1
  40. package/dist/destinations/inleads-ai/identify/generated-types.js.map +1 -0
  41. package/dist/destinations/{responsys/asyncMergeProfileListMembers → inleads-ai/identify}/index.d.ts +1 -1
  42. package/dist/destinations/inleads-ai/identify/index.js +120 -0
  43. package/dist/destinations/inleads-ai/identify/index.js.map +1 -0
  44. package/dist/destinations/inleads-ai/index.d.ts +4 -0
  45. package/dist/destinations/inleads-ai/index.js +66 -0
  46. package/dist/destinations/inleads-ai/index.js.map +1 -0
  47. package/dist/destinations/inleads-ai/track/generated-types.d.ts +45 -0
  48. package/dist/destinations/inleads-ai/track/generated-types.js +3 -0
  49. package/dist/destinations/inleads-ai/track/generated-types.js.map +1 -0
  50. package/dist/destinations/inleads-ai/track/index.d.ts +5 -0
  51. package/dist/destinations/inleads-ai/track/index.js +64 -0
  52. package/dist/destinations/inleads-ai/track/index.js.map +1 -0
  53. package/dist/destinations/kameleoon/group/generated-types.d.ts +12 -0
  54. package/dist/destinations/kameleoon/group/generated-types.js +3 -0
  55. package/dist/destinations/kameleoon/group/generated-types.js.map +1 -0
  56. package/dist/destinations/kameleoon/group/index.d.ts +5 -0
  57. package/dist/destinations/kameleoon/group/index.js +94 -0
  58. package/dist/destinations/kameleoon/group/index.js.map +1 -0
  59. package/dist/destinations/kameleoon/identify/generated-types.d.ts +11 -0
  60. package/dist/destinations/kameleoon/identify/generated-types.js +3 -0
  61. package/dist/destinations/kameleoon/identify/generated-types.js.map +1 -0
  62. package/dist/destinations/kameleoon/identify/index.d.ts +5 -0
  63. package/dist/destinations/kameleoon/identify/index.js +87 -0
  64. package/dist/destinations/kameleoon/identify/index.js.map +1 -0
  65. package/dist/destinations/kameleoon/index.js +15 -9
  66. package/dist/destinations/kameleoon/index.js.map +1 -1
  67. package/dist/destinations/kameleoon/logEvent/generated-types.d.ts +2 -0
  68. package/dist/destinations/kameleoon/logEvent/index.js +13 -1
  69. package/dist/destinations/kameleoon/logEvent/index.js.map +1 -1
  70. package/dist/destinations/kameleoon/page/generated-types.d.ts +15 -0
  71. package/dist/destinations/kameleoon/page/generated-types.js +3 -0
  72. package/dist/destinations/kameleoon/page/generated-types.js.map +1 -0
  73. package/dist/destinations/kameleoon/page/index.d.ts +5 -0
  74. package/dist/destinations/kameleoon/page/index.js +99 -0
  75. package/dist/destinations/kameleoon/page/index.js.map +1 -0
  76. package/dist/destinations/klaviyo/functions.d.ts +4 -7
  77. package/dist/destinations/klaviyo/functions.js +1 -80
  78. package/dist/destinations/klaviyo/functions.js.map +1 -1
  79. package/dist/destinations/klaviyo/removeProfile/index.js +0 -2
  80. package/dist/destinations/klaviyo/removeProfile/index.js.map +1 -1
  81. package/dist/destinations/klaviyo/types.d.ts +0 -97
  82. package/dist/destinations/klaviyo/upsertProfile/index.js +19 -29
  83. package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
  84. package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js +2 -2
  85. package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js.map +1 -1
  86. package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js +2 -2
  87. package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js.map +1 -1
  88. package/dist/destinations/marketo-static-lists/addToList/index.js +2 -4
  89. package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -1
  90. package/dist/destinations/moloco-rmp/index.js +2 -2
  91. package/dist/destinations/segment/segment-properties.js +2 -2
  92. package/dist/destinations/segment/segment-properties.js.map +1 -1
  93. package/dist/destinations/snap-conversions-api/_tests_/index.test.js +420 -488
  94. package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
  95. package/dist/destinations/snap-conversions-api/index.js +42 -42
  96. package/dist/destinations/snap-conversions-api/index.js.map +1 -1
  97. package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.d.ts +97 -18
  98. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +7 -29
  99. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
  100. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-deprecated.d.ts +31 -0
  101. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-deprecated.js +174 -0
  102. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-deprecated.js.map +1 -0
  103. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-v3.d.ts +16 -0
  104. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-v3.js +640 -0
  105. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-v3.js.map +1 -0
  106. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.d.ts +0 -4
  107. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +593 -119
  108. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -1
  109. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.d.ts +3 -4
  110. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js +6 -1
  111. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js.map +1 -1
  112. package/dist/destinations/spiffy/generated-types.d.ts +5 -0
  113. package/dist/destinations/spiffy/generated-types.js +3 -0
  114. package/dist/destinations/spiffy/generated-types.js.map +1 -0
  115. package/dist/destinations/spiffy/index.d.ts +4 -0
  116. package/dist/destinations/spiffy/index.js +62 -0
  117. package/dist/destinations/spiffy/index.js.map +1 -0
  118. package/dist/destinations/spiffy/send/generated-types.d.ts +8 -0
  119. package/dist/destinations/spiffy/send/generated-types.js +3 -0
  120. package/dist/destinations/spiffy/send/generated-types.js.map +1 -0
  121. package/dist/destinations/spiffy/send/index.d.ts +5 -0
  122. package/dist/destinations/spiffy/send/index.js +42 -0
  123. package/dist/destinations/spiffy/send/index.js.map +1 -0
  124. package/dist/destinations/stackadapt/forwardEvent/generated-types.d.ts +4 -4
  125. package/dist/destinations/stackadapt/forwardEvent/index.js +11 -7
  126. package/dist/destinations/stackadapt/forwardEvent/index.js.map +1 -1
  127. package/dist/destinations/tiktok-conversions/common_fields.d.ts +2 -0
  128. package/dist/destinations/tiktok-conversions/common_fields.js +244 -0
  129. package/dist/destinations/tiktok-conversions/common_fields.js.map +1 -0
  130. package/dist/destinations/{tiktok-offline-conversions/reportOfflineEvent → tiktok-conversions}/formatter.js +11 -11
  131. package/dist/destinations/tiktok-conversions/formatter.js.map +1 -0
  132. package/dist/destinations/tiktok-conversions/index.js +163 -75
  133. package/dist/destinations/tiktok-conversions/index.js.map +1 -1
  134. package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +12 -4
  135. package/dist/destinations/tiktok-conversions/reportWebEvent/index.d.ts +1 -1
  136. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +5 -233
  137. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
  138. package/dist/destinations/tiktok-conversions/utils.d.ts +4 -0
  139. package/dist/destinations/tiktok-conversions/utils.js +65 -0
  140. package/dist/destinations/tiktok-conversions/utils.js.map +1 -0
  141. package/dist/destinations/xtremepush/generated-types.d.ts +4 -0
  142. package/dist/destinations/xtremepush/generated-types.js +3 -0
  143. package/dist/destinations/xtremepush/generated-types.js.map +1 -0
  144. package/dist/destinations/xtremepush/identify/generated-types.d.ts +14 -0
  145. package/dist/destinations/xtremepush/identify/generated-types.js +3 -0
  146. package/dist/destinations/xtremepush/identify/generated-types.js.map +1 -0
  147. package/dist/destinations/xtremepush/identify/index.d.ts +5 -0
  148. package/dist/destinations/xtremepush/identify/index.js +87 -0
  149. package/dist/destinations/xtremepush/identify/index.js.map +1 -0
  150. package/dist/destinations/xtremepush/index.d.ts +4 -0
  151. package/dist/destinations/xtremepush/index.js +66 -0
  152. package/dist/destinations/xtremepush/index.js.map +1 -0
  153. package/dist/destinations/xtremepush/track/generated-types.d.ts +15 -0
  154. package/dist/destinations/xtremepush/track/generated-types.js +3 -0
  155. package/dist/destinations/xtremepush/track/generated-types.js.map +1 -0
  156. package/dist/destinations/xtremepush/track/index.d.ts +5 -0
  157. package/dist/destinations/xtremepush/track/index.js +95 -0
  158. package/dist/destinations/xtremepush/track/index.js.map +1 -0
  159. package/package.json +4 -4
  160. package/dist/destinations/amazon-ads/utils.d.ts +0 -25
  161. package/dist/destinations/amazon-ads/utils.js +0 -8
  162. package/dist/destinations/amazon-ads/utils.js.map +0 -1
  163. package/dist/destinations/engage/sendgrid/Profile.d.ts +0 -6
  164. package/dist/destinations/engage/sendgrid/Profile.js.map +0 -1
  165. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +0 -21
  166. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +0 -174
  167. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +0 -1
  168. package/dist/destinations/mixpanel/utils.d.ts +0 -13
  169. package/dist/destinations/mixpanel/utils.js +0 -117
  170. package/dist/destinations/mixpanel/utils.js.map +0 -1
  171. package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
  172. package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
  173. package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
  174. package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
  175. package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
  176. package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
  177. package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
  178. package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
  179. package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
  180. package/dist/destinations/responsys/rsp-operations.js +0 -33
  181. package/dist/destinations/responsys/rsp-operations.js.map +0 -1
  182. package/dist/destinations/responsys/rsp-properties.d.ts +0 -4
  183. package/dist/destinations/responsys/rsp-properties.js +0 -27
  184. package/dist/destinations/responsys/rsp-properties.js.map +0 -1
  185. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +0 -1
  186. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +0 -381
  187. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +0 -1
  188. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +0 -1
  189. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +0 -581
  190. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +0 -1
  191. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +0 -4
  192. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +0 -97
  193. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +0 -1
  194. package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +0 -30
  195. package/dist/destinations/snap-conversions-api/snap-capi-properties.js +0 -316
  196. package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +0 -1
  197. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +0 -3
  198. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +0 -34
  199. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +0 -1
  200. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +0 -1
  201. package/dist/destinations/{responsys/asyncMergePetRecords → inleads-ai}/generated-types.js +0 -0
  202. package/dist/destinations/{responsys/asyncMergeProfileListMembers → inleads-ai/group}/generated-types.js +0 -0
  203. package/dist/destinations/{tiktok-offline-conversions/reportOfflineEvent → tiktok-conversions}/formatter.d.ts +1 -1
@@ -0,0 +1,46 @@
1
+ export interface Payload {
2
+ user_id: string;
3
+ name?: string | null;
4
+ first_name?: string | null;
5
+ last_name?: string | null;
6
+ email?: string;
7
+ account_id?: string;
8
+ created_at?: string;
9
+ traits?: {
10
+ [k: string]: unknown;
11
+ };
12
+ userMeta?: {
13
+ ip?: string;
14
+ latitude?: number;
15
+ longitude?: number;
16
+ country?: string;
17
+ city?: string;
18
+ browser?: string;
19
+ os?: string;
20
+ osVersion?: string;
21
+ deviceType?: string;
22
+ deviceVendor?: string;
23
+ deviceModel?: string;
24
+ timeZone?: string;
25
+ };
26
+ anonymous_id?: string | null;
27
+ event_id?: string;
28
+ url?: string;
29
+ referer?: string;
30
+ user_language?: string;
31
+ utc_time: string;
32
+ utm?: {
33
+ source?: string;
34
+ medium?: string;
35
+ name?: string;
36
+ term?: string;
37
+ content?: string;
38
+ };
39
+ screen?: {
40
+ height?: number;
41
+ width?: number;
42
+ density?: number;
43
+ };
44
+ timezone?: string;
45
+ source_ip?: string;
46
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Profile.js.map
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/inleads-ai/identify/generated-types.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { ActionDefinition } from '@segment/actions-core';
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
2
  import type { Settings } from '../generated-types';
3
3
  import type { Payload } from './generated-types';
4
4
  declare const action: ActionDefinition<Settings, Payload>;
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_fields_1 = require("../common-fields");
4
+ const contants_1 = require("../contants");
5
+ const action = {
6
+ title: 'Identify',
7
+ description: `Send identify calls to ${contants_1.IntegrationName}.`,
8
+ defaultSubscription: 'type = "identify"',
9
+ platform: 'cloud',
10
+ fields: {
11
+ user_id: {
12
+ type: 'string',
13
+ required: true,
14
+ description: 'The External ID of the user',
15
+ label: 'User ID',
16
+ default: { '@path': '$.userId' }
17
+ },
18
+ name: {
19
+ type: 'string',
20
+ required: false,
21
+ description: "The user's name",
22
+ allowNull: true,
23
+ label: 'Name',
24
+ default: {
25
+ '@if': {
26
+ exists: { '@path': '$.traits.name' },
27
+ then: { '@path': '$.traits.name' },
28
+ else: { '@path': '$.properties.name' }
29
+ }
30
+ }
31
+ },
32
+ first_name: {
33
+ type: 'string',
34
+ required: false,
35
+ allowNull: true,
36
+ description: "The user's first name. This field is mandatory if you're not providing a name field",
37
+ label: 'First name',
38
+ default: {
39
+ '@if': {
40
+ exists: { '@path': '$.traits.first_name' },
41
+ then: { '@path': '$.traits.first_name' },
42
+ else: { '@path': '$.properties.first_name' }
43
+ }
44
+ }
45
+ },
46
+ last_name: {
47
+ type: 'string',
48
+ required: false,
49
+ allowNull: true,
50
+ description: "The user's last name. This field is mandatory if you're not providing a name field",
51
+ label: 'Last name',
52
+ default: {
53
+ '@if': {
54
+ exists: { '@path': '$.traits.last_name' },
55
+ then: { '@path': '$.traits.last_name' },
56
+ else: { '@path': '$.properties.last_name' }
57
+ }
58
+ }
59
+ },
60
+ email: {
61
+ type: 'string',
62
+ required: false,
63
+ description: "The user's email address",
64
+ label: 'Email address',
65
+ default: {
66
+ '@if': {
67
+ exists: { '@path': '$.traits.email' },
68
+ then: { '@path': '$.traits.email' },
69
+ else: { '@path': '$.properties.email' }
70
+ }
71
+ }
72
+ },
73
+ account_id: {
74
+ type: 'string',
75
+ required: false,
76
+ description: 'The account id, to uniquely identify the account associated with the user',
77
+ label: 'Account id',
78
+ default: {
79
+ '@if': {
80
+ exists: { '@path': '$.context.group_id' },
81
+ then: { '@path': '$.context.group_id' },
82
+ else: { '@path': '$.groupId' }
83
+ }
84
+ }
85
+ },
86
+ created_at: {
87
+ type: 'string',
88
+ required: false,
89
+ description: 'The timestamp when the user was created, represented in the ISO-8601 date format. For instance, "2023-09-26T15:30:00Z".',
90
+ label: 'Created at',
91
+ format: 'date-time',
92
+ default: {
93
+ '@if': {
94
+ exists: { '@path': '$.traits.created_at' },
95
+ then: { '@path': '$.traits.created_at' },
96
+ else: { '@path': '$.traits.createdAt' }
97
+ }
98
+ }
99
+ },
100
+ traits: {
101
+ type: 'object',
102
+ label: 'Traits',
103
+ description: 'Properties to associate with the user',
104
+ required: false,
105
+ default: { '@path': '$.traits' }
106
+ },
107
+ ...common_fields_1.commonFields
108
+ },
109
+ perform: (request, data) => {
110
+ return request(`${contants_1.IntegrationBaseUrl}/events/track`, {
111
+ method: 'post',
112
+ headers: {
113
+ Authorization: `Basic ${data.settings.apiKey}`
114
+ },
115
+ json: { ...data.payload, apiKey: data.settings.apiKey }
116
+ });
117
+ }
118
+ };
119
+ exports.default = action;
120
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/inleads-ai/identify/index.ts"],"names":[],"mappings":";;AAGA,oDAA+C;AAC/C,0CAAiE;AAEjE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,0BAA0B,0BAAe,GAAG;IACzD,mBAAmB,EAAE,mBAAmB;IACxC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,6BAA6B;YAC1C,KAAK,EAAE,SAAS;YAChB,OAAO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C/C;YACD,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;SACxD,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -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,66 @@
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 track_1 = __importDefault(require("./track"));
8
+ const group_1 = __importDefault(require("./group"));
9
+ const identify_1 = __importDefault(require("./identify"));
10
+ const contants_1 = require("./contants");
11
+ const destination = {
12
+ name: contants_1.IntegrationName,
13
+ slug: 'inleads-ai',
14
+ mode: 'cloud',
15
+ authentication: {
16
+ scheme: 'custom',
17
+ fields: {
18
+ apiKey: {
19
+ label: 'API Key',
20
+ description: `Your ${contants_1.IntegrationName} API Key. You can find your API Key in your ${contants_1.IntegrationWebsite} settings.`,
21
+ type: 'password',
22
+ required: true
23
+ }
24
+ },
25
+ testAuthentication: async (request, { settings }) => {
26
+ const AUTH_KEY = settings.apiKey;
27
+ return await request(`${contants_1.IntegrationBaseUrl}/events/validate/key`, {
28
+ method: 'post',
29
+ headers: {
30
+ Authorization: `Basic ${AUTH_KEY}`
31
+ },
32
+ json: { apiKey: AUTH_KEY }
33
+ });
34
+ }
35
+ },
36
+ presets: [
37
+ {
38
+ name: 'Track Event',
39
+ subscribe: 'type = "track"',
40
+ partnerAction: contants_1.PartnerActionName,
41
+ mapping: actions_core_1.defaultValues(track_1.default.fields),
42
+ type: 'automatic'
43
+ },
44
+ {
45
+ name: 'Group',
46
+ subscribe: 'type = "group"',
47
+ partnerAction: contants_1.PartnerActionName,
48
+ mapping: actions_core_1.defaultValues(group_1.default.fields),
49
+ type: 'automatic'
50
+ },
51
+ {
52
+ name: 'Identify User',
53
+ subscribe: 'type = "identify"',
54
+ partnerAction: contants_1.PartnerActionName,
55
+ mapping: actions_core_1.defaultValues(identify_1.default.fields),
56
+ type: 'automatic'
57
+ }
58
+ ],
59
+ actions: {
60
+ identify: identify_1.default,
61
+ group: group_1.default,
62
+ track: track_1.default
63
+ }
64
+ };
65
+ exports.default = destination;
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/inleads-ai/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAErD,oDAA2B;AAC3B,oDAA2B;AAC3B,0DAAiC;AACjC,yCAKmB;AAEnB,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,0BAAe;IACrB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,QAAQ,0BAAe,+CAA+C,6BAAkB,YAAY;gBACjH,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjC,OAAO,MAAM,OAAO,CAAC,GAAG,6BAAkB,sBAAsB,EAAE;gBAChE,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,QAAQ,EAAE;iBACnC;gBACD,IAAI,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC;aACzB,CAAC,CAAA;QACJ,CAAC;KACF;IAED,OAAO,EAAE;QACP;YACE,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,4BAAiB;YAChC,OAAO,EAAE,4BAAa,CAAC,eAAK,CAAC,MAAM,CAAC;YACpC,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,4BAAiB;YAChC,OAAO,EAAE,4BAAa,CAAC,eAAK,CAAC,MAAM,CAAC;YACpC,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,mBAAmB;YAC9B,aAAa,EAAE,4BAAiB;YAChC,OAAO,EAAE,4BAAa,CAAC,kBAAQ,CAAC,MAAM,CAAC;YACvC,IAAI,EAAE,WAAW;SAClB;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAR,kBAAQ;QACR,KAAK,EAAL,eAAK;QACL,KAAK,EAAL,eAAK;KACN;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,45 @@
1
+ export interface Payload {
2
+ eventName: string;
3
+ user_id: string;
4
+ account_id?: string;
5
+ properties?: {
6
+ [k: string]: unknown;
7
+ };
8
+ traits?: {
9
+ [k: string]: unknown;
10
+ };
11
+ userMeta?: {
12
+ ip?: string;
13
+ latitude?: number;
14
+ longitude?: number;
15
+ country?: string;
16
+ city?: string;
17
+ browser?: string;
18
+ os?: string;
19
+ osVersion?: string;
20
+ deviceType?: string;
21
+ deviceVendor?: string;
22
+ deviceModel?: string;
23
+ timeZone?: string;
24
+ };
25
+ anonymous_id?: string | null;
26
+ event_id?: string;
27
+ url?: string;
28
+ referer?: string;
29
+ user_language?: string;
30
+ utc_time: string;
31
+ utm?: {
32
+ source?: string;
33
+ medium?: string;
34
+ name?: string;
35
+ term?: string;
36
+ content?: string;
37
+ };
38
+ screen?: {
39
+ height?: number;
40
+ width?: number;
41
+ density?: number;
42
+ };
43
+ timezone?: string;
44
+ source_ip?: string;
45
+ }
@@ -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/inleads-ai/track/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,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_fields_1 = require("../common-fields");
4
+ const contants_1 = require("../contants");
5
+ const action = {
6
+ title: 'Track',
7
+ description: `Send track calls to ${contants_1.IntegrationName}.`,
8
+ defaultSubscription: 'type = "track"',
9
+ fields: {
10
+ eventName: {
11
+ type: 'string',
12
+ required: true,
13
+ description: 'The name of the event',
14
+ label: 'Event name',
15
+ default: { '@path': '$.event' }
16
+ },
17
+ user_id: {
18
+ type: 'string',
19
+ required: true,
20
+ description: 'The user id, to uniquely identify the user associated with the event',
21
+ label: 'User id',
22
+ default: { '@path': '$.userId' }
23
+ },
24
+ account_id: {
25
+ type: 'string',
26
+ required: false,
27
+ description: 'The account id, to uniquely identify the account associated with the user',
28
+ label: 'Account id',
29
+ default: {
30
+ '@if': {
31
+ exists: { '@path': '$.context.groupId' },
32
+ then: { '@path': '$.context.groupId' },
33
+ else: { '@path': '$.groupId' }
34
+ }
35
+ }
36
+ },
37
+ properties: {
38
+ type: 'object',
39
+ required: false,
40
+ description: 'The properties of the track call',
41
+ label: 'Event properties',
42
+ default: { '@path': '$.properties' }
43
+ },
44
+ traits: {
45
+ type: 'object',
46
+ required: false,
47
+ description: 'The Traits of the track call',
48
+ label: 'Event Traits',
49
+ default: { '@path': '$.context.traits' }
50
+ },
51
+ ...common_fields_1.commonFields
52
+ },
53
+ perform: (request, data) => {
54
+ return request(`${contants_1.IntegrationBaseUrl}/events/track`, {
55
+ method: 'post',
56
+ headers: {
57
+ Authorization: `Basic ${data.settings.apiKey}`
58
+ },
59
+ json: { ...data.payload, apiKey: data.settings.apiKey }
60
+ });
61
+ }
62
+ };
63
+ exports.default = action;
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/inleads-ai/track/index.ts"],"names":[],"mappings":";;AAGA,oDAA+C;AAC/C,0CAAiE;AAEjE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,uBAAuB,0BAAe,GAAG;IACtD,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SAChC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,sEAAsE;YACnF,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,2EAA2E;YACxF,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;oBACxC,IAAI,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;oBACtC,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;iBAC/B;aACF;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,kCAAkC;YAC/C,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,8BAA8B;YAC3C,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE;SACzC;QACD,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,OAAO,OAAO,CAAC,GAAG,6BAAkB,eAAe,EAAE;YACnD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;aAC/C;YACD,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;SACxD,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,12 @@
1
+ export interface Payload {
2
+ anonymousId?: string;
3
+ userId?: string;
4
+ type: string;
5
+ groupId: string;
6
+ properties?: {
7
+ [k: string]: unknown;
8
+ };
9
+ kameleoonVisitorCode?: string;
10
+ timestamp: string;
11
+ messageId: 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/kameleoon/group/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,94 @@
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 omit_1 = __importDefault(require("lodash/omit"));
7
+ const properties_1 = require("../properties");
8
+ const action = {
9
+ title: 'Group Event',
10
+ description: 'Send group traits to Kameleoon',
11
+ defaultSubscription: 'type = "group"',
12
+ fields: {
13
+ anonymousId: {
14
+ type: 'string',
15
+ description: 'Anonymous id',
16
+ label: 'Anonymous ID',
17
+ default: { '@path': '$.anonymousId' }
18
+ },
19
+ userId: {
20
+ type: 'string',
21
+ description: 'The ID associated with the user',
22
+ label: 'User ID',
23
+ default: { '@path': '$.userId' }
24
+ },
25
+ type: {
26
+ label: 'Type',
27
+ type: 'string',
28
+ required: true,
29
+ description: 'The type of the event',
30
+ default: {
31
+ '@path': '$.type'
32
+ }
33
+ },
34
+ groupId: {
35
+ type: 'string',
36
+ description: 'The group id',
37
+ label: 'Group ID',
38
+ required: true,
39
+ default: { '@path': '$.groupId' }
40
+ },
41
+ properties: {
42
+ type: 'object',
43
+ required: false,
44
+ description: 'Traits to send with the event',
45
+ label: 'User Traits',
46
+ default: {
47
+ '@path': '$.traits'
48
+ }
49
+ },
50
+ kameleoonVisitorCode: {
51
+ type: 'string',
52
+ required: false,
53
+ description: 'Kameleoon Visitor Code - a unique identifier for the user',
54
+ label: 'Kameleoon Visitor Code',
55
+ default: {
56
+ '@path': '$.traits.kameleoonVisitorCode'
57
+ }
58
+ },
59
+ timestamp: {
60
+ type: 'string',
61
+ format: 'date-time',
62
+ required: true,
63
+ description: 'The timestamp of the event',
64
+ label: 'Timestamp',
65
+ default: { '@path': '$.timestamp' }
66
+ },
67
+ messageId: {
68
+ type: 'string',
69
+ required: true,
70
+ description: 'The Segment messageId',
71
+ label: 'MessageId',
72
+ default: { '@path': '$.messageId' }
73
+ }
74
+ },
75
+ perform: (request, data) => {
76
+ const payload = {
77
+ ...omit_1.default(data.payload, ['kameleoonVisitorCode']),
78
+ properties: {
79
+ ...(data.payload.properties || {}),
80
+ kameleoonVisitorCode: data.payload.kameleoonVisitorCode
81
+ }
82
+ };
83
+ return request(properties_1.BASE_URL, {
84
+ headers: {
85
+ authorization: `Basic ${data.settings.apiKey}`,
86
+ 'x-segment-settings': data.settings.sitecode
87
+ },
88
+ method: 'post',
89
+ json: payload
90
+ });
91
+ }
92
+ };
93
+ exports.default = action;
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/group/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAA8B;AAE9B,8CAAwC;AAExC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,uBAAuB;YACpC,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ;aAClB;SACF;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;SAClC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+BAA+B;YAC5C,KAAK,EA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payload {
2
+ anonymousId?: string;
3
+ userId?: string;
4
+ type: string;
5
+ properties?: {
6
+ [k: string]: unknown;
7
+ };
8
+ kameleoonVisitorCode?: string;
9
+ timestamp: string;
10
+ messageId: string;
11
+ }
@@ -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/kameleoon/identify/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,87 @@
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 omit_1 = __importDefault(require("lodash/omit"));
7
+ const properties_1 = require("../properties");
8
+ const action = {
9
+ title: 'Identify Event',
10
+ description: 'Send user traits to Kameleoon',
11
+ defaultSubscription: 'type = "identify"',
12
+ fields: {
13
+ anonymousId: {
14
+ type: 'string',
15
+ description: 'Anonymous id',
16
+ label: 'Anonymous ID',
17
+ default: { '@path': '$.anonymousId' }
18
+ },
19
+ userId: {
20
+ type: 'string',
21
+ description: 'The ID associated with the user',
22
+ label: 'User ID',
23
+ default: { '@path': '$.userId' }
24
+ },
25
+ type: {
26
+ label: 'Type',
27
+ type: 'string',
28
+ required: true,
29
+ description: 'The type of the event',
30
+ default: {
31
+ '@path': '$.type'
32
+ }
33
+ },
34
+ properties: {
35
+ type: 'object',
36
+ required: false,
37
+ description: 'Traits to send with the event',
38
+ label: 'User Traits',
39
+ default: {
40
+ '@path': '$.traits'
41
+ }
42
+ },
43
+ kameleoonVisitorCode: {
44
+ type: 'string',
45
+ required: false,
46
+ description: 'Kameleoon Visitor Code - a unique identifier for the user',
47
+ label: 'Kameleoon Visitor Code',
48
+ default: {
49
+ '@path': '$.traits.kameleoonVisitorCode'
50
+ }
51
+ },
52
+ timestamp: {
53
+ type: 'string',
54
+ format: 'date-time',
55
+ required: true,
56
+ description: 'The timestamp of the event',
57
+ label: 'Timestamp',
58
+ default: { '@path': '$.timestamp' }
59
+ },
60
+ messageId: {
61
+ type: 'string',
62
+ required: true,
63
+ description: 'The Segment messageId',
64
+ label: 'MessageId',
65
+ default: { '@path': '$.messageId' }
66
+ }
67
+ },
68
+ perform: (request, data) => {
69
+ const payload = {
70
+ ...omit_1.default(data.payload, ['kameleoonVisitorCode']),
71
+ properties: {
72
+ ...(data.payload.properties || {}),
73
+ kameleoonVisitorCode: data.payload.kameleoonVisitorCode
74
+ }
75
+ };
76
+ return request(properties_1.BASE_URL, {
77
+ headers: {
78
+ authorization: `Basic ${data.settings.apiKey}`,
79
+ 'x-segment-settings': data.settings.sitecode
80
+ },
81
+ method: 'post',
82
+ json: payload
83
+ });
84
+ }
85
+ };
86
+ exports.default = action;
87
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/identify/index.ts"],"names":[],"mappings":";;;;;AAIA,uDAA8B;AAE9B,8CAAwC;AAExC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,+BAA+B;IAC5C,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,O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