@segment/action-destinations 3.323.1-hadron.0 → 3.324.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 (100) hide show
  1. package/dist/destinations/hubspot/customEvent/client.d.ts +2 -2
  2. package/dist/destinations/hubspot/customEvent/client.js.map +1 -1
  3. package/dist/destinations/hubspot/customEvent/dynamic-fields.js +2 -2
  4. package/dist/destinations/hubspot/customEvent/dynamic-fields.js.map +1 -1
  5. package/dist/destinations/hubspot/customEvent/index.js +42 -36
  6. package/dist/destinations/hubspot/customEvent/index.js.map +1 -1
  7. package/dist/destinations/hubspot/customEvent/types.d.ts +4 -11
  8. package/dist/destinations/hubspot/customEvent/types.js +2 -1
  9. package/dist/destinations/hubspot/customEvent/types.js.map +1 -1
  10. package/dist/destinations/hubspot/customEvent/utils.d.ts +8 -10
  11. package/dist/destinations/hubspot/customEvent/utils.js +189 -155
  12. package/dist/destinations/hubspot/customEvent/utils.js.map +1 -1
  13. package/package.json +4 -5
  14. package/dist/destinations/braze/createAliasV2.types.d.ts +0 -5
  15. package/dist/destinations/braze/createAliasV2.types.js +0 -3
  16. package/dist/destinations/braze/createAliasV2.types.js.map +0 -1
  17. package/dist/destinations/braze/identifyUserV2.types.d.ts +0 -8
  18. package/dist/destinations/braze/identifyUserV2.types.js +0 -3
  19. package/dist/destinations/braze/identifyUserV2.types.js.map +0 -1
  20. package/dist/destinations/braze/trackEvent2/generated-types.d.ts +0 -16
  21. package/dist/destinations/braze/trackEvent2/generated-types.js +0 -3
  22. package/dist/destinations/braze/trackEvent2/generated-types.js.map +0 -1
  23. package/dist/destinations/braze/trackEvent2/index.d.ts +0 -5
  24. package/dist/destinations/braze/trackEvent2/index.js +0 -117
  25. package/dist/destinations/braze/trackEvent2/index.js.map +0 -1
  26. package/dist/destinations/braze/trackPurchase2/generated-types.d.ts +0 -22
  27. package/dist/destinations/braze/trackPurchase2/generated-types.js +0 -3
  28. package/dist/destinations/braze/trackPurchase2/generated-types.js.map +0 -1
  29. package/dist/destinations/braze/trackPurchase2/index.d.ts +0 -5
  30. package/dist/destinations/braze/trackPurchase2/index.js +0 -135
  31. package/dist/destinations/braze/trackPurchase2/index.js.map +0 -1
  32. package/dist/destinations/campaign-manager-360/common-fields.d.ts +0 -3
  33. package/dist/destinations/campaign-manager-360/common-fields.js +0 -306
  34. package/dist/destinations/campaign-manager-360/common-fields.js.map +0 -1
  35. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.d.ts +0 -45
  36. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js +0 -3
  37. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js.map +0 -1
  38. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.d.ts +0 -5
  39. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js +0 -86
  40. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js.map +0 -1
  41. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.d.ts +0 -50
  42. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js +0 -3
  43. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js.map +0 -1
  44. package/dist/destinations/campaign-manager-360/conversionUpload/index.d.ts +0 -5
  45. package/dist/destinations/campaign-manager-360/conversionUpload/index.js +0 -131
  46. package/dist/destinations/campaign-manager-360/conversionUpload/index.js.map +0 -1
  47. package/dist/destinations/campaign-manager-360/generated-types.d.ts +0 -5
  48. package/dist/destinations/campaign-manager-360/generated-types.js +0 -3
  49. package/dist/destinations/campaign-manager-360/generated-types.js.map +0 -1
  50. package/dist/destinations/campaign-manager-360/index.d.ts +0 -4
  51. package/dist/destinations/campaign-manager-360/index.js +0 -63
  52. package/dist/destinations/campaign-manager-360/index.js.map +0 -1
  53. package/dist/destinations/campaign-manager-360/types.d.ts +0 -116
  54. package/dist/destinations/campaign-manager-360/types.js +0 -23
  55. package/dist/destinations/campaign-manager-360/types.js.map +0 -1
  56. package/dist/destinations/campaign-manager-360/utils.d.ts +0 -21
  57. package/dist/destinations/campaign-manager-360/utils.js +0 -175
  58. package/dist/destinations/campaign-manager-360/utils.js.map +0 -1
  59. package/dist/destinations/first-party-dv360/addToAudContactInfo/generated-types.d.ts +0 -9
  60. package/dist/destinations/first-party-dv360/addToAudContactInfo/generated-types.js +0 -3
  61. package/dist/destinations/first-party-dv360/addToAudContactInfo/generated-types.js.map +0 -1
  62. package/dist/destinations/first-party-dv360/addToAudContactInfo/index.d.ts +0 -5
  63. package/dist/destinations/first-party-dv360/addToAudContactInfo/index.js +0 -32
  64. package/dist/destinations/first-party-dv360/addToAudContactInfo/index.js.map +0 -1
  65. package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/generated-types.d.ts +0 -4
  66. package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/generated-types.js +0 -3
  67. package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/generated-types.js.map +0 -1
  68. package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/index.d.ts +0 -5
  69. package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/index.js +0 -27
  70. package/dist/destinations/first-party-dv360/addToAudMobileDeviceId/index.js.map +0 -1
  71. package/dist/destinations/first-party-dv360/addToList.types.d.ts +0 -9
  72. package/dist/destinations/first-party-dv360/addToList.types.js +0 -3
  73. package/dist/destinations/first-party-dv360/addToList.types.js.map +0 -1
  74. package/dist/destinations/first-party-dv360/properties.d.ts +0 -9
  75. package/dist/destinations/first-party-dv360/properties.js +0 -69
  76. package/dist/destinations/first-party-dv360/properties.js.map +0 -1
  77. package/dist/destinations/hubspot/customEvent/event-completion.d.ts +0 -3
  78. package/dist/destinations/hubspot/customEvent/event-completion.js +0 -17
  79. package/dist/destinations/hubspot/customEvent/event-completion.js.map +0 -1
  80. package/dist/destinations/hubspot/customEvent/validation.d.ts +0 -3
  81. package/dist/destinations/hubspot/customEvent/validation.js +0 -66
  82. package/dist/destinations/hubspot/customEvent/validation.js.map +0 -1
  83. package/dist/destinations/s3/syncAudienceToS3/generated-types.d.ts +0 -53
  84. package/dist/destinations/s3/syncAudienceToS3/generated-types.js +0 -3
  85. package/dist/destinations/s3/syncAudienceToS3/generated-types.js.map +0 -1
  86. package/dist/destinations/s3/syncAudienceToS3/index.d.ts +0 -5
  87. package/dist/destinations/s3/syncAudienceToS3/index.js +0 -22
  88. package/dist/destinations/s3/syncAudienceToS3/index.js.map +0 -1
  89. package/dist/destinations/s3/syncEventsToS3/generated-types.d.ts +0 -44
  90. package/dist/destinations/s3/syncEventsToS3/generated-types.js +0 -3
  91. package/dist/destinations/s3/syncEventsToS3/generated-types.js.map +0 -1
  92. package/dist/destinations/s3/syncEventsToS3/index.d.ts +0 -5
  93. package/dist/destinations/s3/syncEventsToS3/index.js +0 -19
  94. package/dist/destinations/s3/syncEventsToS3/index.js.map +0 -1
  95. package/dist/destinations/s3/syncToS3.types.d.ts +0 -44
  96. package/dist/destinations/s3/syncToS3.types.js +0 -3
  97. package/dist/destinations/s3/syncToS3.types.js.map +0 -1
  98. package/dist/destinations/webhook-extensible/types.d.ts +0 -6
  99. package/dist/destinations/webhook-extensible/types.js +0 -3
  100. package/dist/destinations/webhook-extensible/types.js.map +0 -1
@@ -1,175 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSources = exports.getEntityTypeChoices = exports.getCustomVarTypeChoices = exports.maybeHash = exports.getJSON = exports.send = void 0;
4
- const crypto_1 = require("crypto");
5
- const actions_core_1 = require("@segment/actions-core");
6
- const types_1 = require("./types");
7
- async function send(request, settings, payloads, isAdjustment, auth) {
8
- const json = getJSON(payloads, settings);
9
- if (json.conversions.length === 0) {
10
- maybeThrow(`No valid payloads found in batch of size ${payloads.length}`, true);
11
- }
12
- const response = await request(`https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/${settings.profileId}/conversions/batch` +
13
- (isAdjustment ? 'update' : 'insert'), {
14
- method: 'POST',
15
- headers: {
16
- Authorization: `Bearer ${auth?.accessToken}`,
17
- 'Content-Type': 'application/json',
18
- Host: 'dfareporting.googleapis.com'
19
- },
20
- json
21
- });
22
- return response;
23
- }
24
- exports.send = send;
25
- function getJSON(payloads, settings) {
26
- const json = {
27
- conversions: [],
28
- kind: 'dfareporting#conversionsBatchInsertRequest'
29
- };
30
- const shouldThrow = payloads.length === 1;
31
- for (const payload of payloads) {
32
- const { customVariables, requiredId: { encryptedUserIdCandidates } } = payload;
33
- const { requiredId: { gclid, dclid, encryptedUserId, mobileDeviceId, matchId, impressionId }, encryptionInfo, adUserDataConsent, cartDataItems, merchantId, merchantFeedLabel, merchantFeedLanguage, userDetails, floodlightActivityId, floodlightConfigurationId, timestamp, value, ordinal, quantity, limitAdTracking, childDirectedTreatment, nonPersonalizedAd, treatmentForUnderage } = payload;
34
- if ([gclid, dclid, encryptedUserId, mobileDeviceId, matchId, impressionId, encryptedUserIdCandidates].filter(Boolean)
35
- .length !== 1) {
36
- maybeThrow('Exactly one of Google Click ID, Display Click ID, Encrypted User ID, Mobile Device ID, Match ID, Impression ID or Encrypted User ID Candidates is required', shouldThrow);
37
- continue;
38
- }
39
- if (!floodlightActivityId && !settings.defaultFloodlightActivityId) {
40
- maybeThrow('Floodlight Activity ID is required', shouldThrow);
41
- continue;
42
- }
43
- if (!floodlightConfigurationId && !settings.defaultFloodlightConfigurationId) {
44
- maybeThrow('Floodlight Configuration ID is required', shouldThrow);
45
- continue;
46
- }
47
- if ((encryptedUserId || encryptedUserIdCandidates) && !encryptionInfo) {
48
- maybeThrow('Encrypted Info field should be populated if either Encrypted User ID or Encrypted User ID Candidates fields are populated', shouldThrow);
49
- continue;
50
- }
51
- const conversion = {
52
- adUserDataConsent: adUserDataConsent,
53
- cartData: (() => {
54
- if (!Array.isArray(cartDataItems) ||
55
- cartDataItems.length === 0 ||
56
- merchantId ||
57
- !merchantFeedLabel ||
58
- !merchantFeedLanguage) {
59
- return undefined;
60
- }
61
- return {
62
- merchantId,
63
- merchantFeedLabel,
64
- merchantFeedLanguage,
65
- items: cartDataItems
66
- };
67
- })(),
68
- childDirectedTreatment: childDirectedTreatment ?? undefined,
69
- dclid: dclid ?? undefined,
70
- encryptedUserId: encryptedUserId ?? undefined,
71
- floodlightActivityId: (floodlightActivityId ?? settings.defaultFloodlightActivityId),
72
- floodlightConfigurationId: (floodlightConfigurationId ?? settings.defaultFloodlightConfigurationId),
73
- gclid: gclid ?? undefined,
74
- impressionId: impressionId ?? undefined,
75
- kind: 'dfareporting#conversion',
76
- limitAdTracking: limitAdTracking ?? undefined,
77
- matchId: matchId ?? undefined,
78
- mobileDeviceId: mobileDeviceId ?? undefined,
79
- nonPersonalizedAd: nonPersonalizedAd ?? undefined,
80
- ordinal,
81
- quantity,
82
- timestampMicros: (() => {
83
- return String(BigInt(new Date(timestamp).getTime()));
84
- })(),
85
- treatmentForUnderage: treatmentForUnderage ?? undefined,
86
- userIdentifiers: (() => {
87
- const { email, phone, firstName, lastName, streetAddress, city, state, postalCode, countryCode } = userDetails ?? {};
88
- const identifiers = [];
89
- if (email) {
90
- identifiers.push({ hashedEmail: maybeHash(email) });
91
- }
92
- if (phone) {
93
- identifiers.push({ hashedPhoneNumber: maybeHash(phone) });
94
- }
95
- if (firstName || lastName || streetAddress || city || state || postalCode || countryCode) {
96
- const addressInfo = {
97
- hashedFirstName: maybeHash(firstName),
98
- hashedLastName: maybeHash(lastName),
99
- hashedStreetAddress: maybeHash(streetAddress),
100
- city: city ?? undefined,
101
- state: state ?? undefined,
102
- postalCode: postalCode ?? undefined,
103
- countryCode: countryCode ?? undefined
104
- };
105
- identifiers.push({ addressInfo });
106
- }
107
- return identifiers;
108
- })(),
109
- value,
110
- customVariables: Array.isArray(customVariables)
111
- ? customVariables
112
- .filter((c) => c.type.length > 0 && c.value.length > 0)
113
- .map((c) => ({
114
- type: c.type,
115
- value: c.value,
116
- kind: 'dfareporting#customFloodlightVariable'
117
- }))
118
- : [],
119
- encryptedUserIdCandidates: encryptedUserIdCandidates
120
- ?.split(',')
121
- .map(maybeHash)
122
- .filter((str) => str !== undefined) ?? []
123
- };
124
- json.conversions.push(conversion);
125
- json.encryptionInfo =
126
- encryptedUserId || encryptedUserIdCandidates
127
- ? {
128
- ...encryptionInfo,
129
- kind: 'dfareporting#encryptionInfo'
130
- }
131
- : undefined;
132
- }
133
- return json;
134
- }
135
- exports.getJSON = getJSON;
136
- function maybeThrow(message, shouldThrow) {
137
- if (shouldThrow) {
138
- throw new actions_core_1.PayloadValidationError(message);
139
- }
140
- }
141
- function maybeHash(value) {
142
- if (value === undefined) {
143
- return undefined;
144
- }
145
- const isHashed = new RegExp(/[0-9abcdef]{64}/gi).test(value);
146
- if (isHashed) {
147
- return value;
148
- }
149
- const hash = crypto_1.createHash('sha256');
150
- hash.update(value);
151
- return hash.digest('hex');
152
- }
153
- exports.maybeHash = maybeHash;
154
- function getCustomVarTypeChoices() {
155
- return types_1.CustomVarTypeChoices.map((item) => ({
156
- label: item,
157
- value: item
158
- }));
159
- }
160
- exports.getCustomVarTypeChoices = getCustomVarTypeChoices;
161
- function getEntityTypeChoices() {
162
- return Object.values(types_1.EntityType).map((item) => ({
163
- label: item,
164
- value: item
165
- }));
166
- }
167
- exports.getEntityTypeChoices = getEntityTypeChoices;
168
- function getSources() {
169
- return Object.values(types_1.Source).map((item) => ({
170
- label: item,
171
- value: item
172
- }));
173
- }
174
- exports.getSources = getSources;
175
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/campaign-manager-360/utils.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,wDAA6E;AAM7E,mCAWgB;AAET,KAAK,UAAU,IAAI,CACxB,OAAsB,EACtB,QAAkB,EAClB,QAA0C,EAC1C,YAAqB,EACrB,IAAiB;IAEjB,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAExC,IAAI,IAAI,CAAC,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QACf,MAAM,IAAI,qCAAsB,CAAC,OAAO,CAAC,CAAA;KAC1C;AACH,CAAC;AAED,SAAgB,SAAS,CAAC,KAAyB;IACjD,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAE5D,IAAI,QAAQ,EAAE;QACZ,OAAO,KAAK,CAAA;KACb;IAED,MAAM,IAAI,GAAG,mBAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC;AAdD,8BAcC;AAED,SAAgB,uBAAuB;IACrC,OAAO,4BAAoB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACzC,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC,CAAA;AACL,CAAC;AALD,0DAKC;AAED,SAAgB,oBAAoB;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9C,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC,CAAA;AACL,CAAC;AALD,oDAKC;AAED,SAAgB,UAAU;IACxB,OAAO,MAAM,CAAC,MAAM,CAAC,cAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1C,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC,CAAA;AACL,CAAC;AALD,gCAKC"}
@@ -1,9 +0,0 @@
1
- export interface Payload {
2
- emails?: string;
3
- phoneNumbers?: string;
4
- zipCodes?: string;
5
- firstName?: string;
6
- lastName?: string;
7
- countryCode?: string;
8
- external_id?: string;
9
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/first-party-dv360/addToAudContactInfo/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import type { ActionDefinition } from '@segment/actions-core';
2
- import type { AudienceSettings, Settings } from '../generated-types';
3
- import type { Payload } from './generated-types';
4
- declare const action: ActionDefinition<Settings, Payload, AudienceSettings>;
5
- export default action;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const properties_1 = require("../properties");
4
- const functions_1 = require("../functions");
5
- const action = {
6
- title: 'Edit Customer Match Members - Contact Info List',
7
- description: 'Add or update customer match members in Google Display & Video 360 Contact Info List Audience.',
8
- defaultSubscription: 'event = "Audeince Entered - ContactInfoList"',
9
- fields: {
10
- emails: { ...properties_1.emails },
11
- phoneNumbers: { ...properties_1.phoneNumbers },
12
- zipCodes: { ...properties_1.zipCodes },
13
- firstName: { ...properties_1.firstName },
14
- lastName: { ...properties_1.lastName },
15
- countryCode: { ...properties_1.countryCode },
16
- external_id: { ...properties_1.external_id }
17
- },
18
- perform: async (request, { payload, statsContext, audienceSettings }) => {
19
- statsContext?.statsClient?.incr('editCustomerMatchMembers', 1, statsContext?.tags);
20
- console.log('Pre-Payload', payload);
21
- console.log('Pre-audienceSettings', audienceSettings);
22
- return functions_1.addContactInfo(request, audienceSettings, [payload], statsContext);
23
- },
24
- performBatch: async (request, { payload, statsContext, audienceSettings }) => {
25
- statsContext?.statsClient?.incr('editCustomerMatchMembers.batch', 1, statsContext?.tags);
26
- console.log('Pre-Payload', payload);
27
- console.log('Pre-audienceSettings', audienceSettings);
28
- return functions_1.addContactInfo(request, audienceSettings, payload, statsContext);
29
- }
30
- };
31
- exports.default = action;
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/first-party-dv360/addToAudContactInfo/index.ts"],"names":[],"mappings":";;AAGA,8CAA6G;AAC7G,4CAA6C;AAE7C,MAAM,MAAM,GAA0D;IACpE,KAAK,EAAE,iDAAiD;IACxD,WAAW,EAAE,gGAAgG;IAC7G,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,GAAG,mBAAM,EAAE;QACrB,YAAY,EAAE,EAAE,GAAG,yBAAY,EAAE;QACjC,QAAQ,EAAE,EAAE,GAAG,qBAAQ,EAAE;QACzB,SAAS,EAAE,EAAE,GAAG,sBAAS,EAAE;QAC3B,QAAQ,EAAE,EAAE,GAAG,qBAAQ,EAAE;QACzB,WAAW,EAAE,EAAE,GAAG,wBAAW,EAAE;QAC/B,WAAW,EAAE,EAAE,GAAG,wBAAW,EAAE;KAChC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,EAAE;QACtE,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,0BAA0B,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAClF,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;QACnC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAA;QACrD,OAAO,0BAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,CAAA;IAC3E,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,EAAE;QAC3E,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,gCAAgC,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QACxF,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;QACnC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAA;QACrD,OAAO,0BAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,4 +0,0 @@
1
- export interface Payload {
2
- mobileDeviceIds?: string;
3
- external_id?: string;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/first-party-dv360/addToAudMobileDeviceId/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import type { ActionDefinition } from '@segment/actions-core';
2
- import type { AudienceSettings, Settings } from '../generated-types';
3
- import type { Payload } from './generated-types';
4
- declare const action: ActionDefinition<Settings, Payload, AudienceSettings>;
5
- export default action;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const properties_1 = require("../properties");
4
- const functions_1 = require("../functions");
5
- const action = {
6
- title: 'Edit Customer Match Members - Mobile Device Id List',
7
- description: 'Add or update customer match members in Google Display & Video 360 Mobile Device Id List Audience.',
8
- defaultSubscription: 'event = "Audeince Entered - MobileDeviceIdList"',
9
- fields: {
10
- mobileDeviceIds: { ...properties_1.mobileDeviceIds },
11
- external_id: { ...properties_1.external_id }
12
- },
13
- perform: async (request, { payload, statsContext, audienceSettings }) => {
14
- statsContext?.statsClient?.incr('editCustomerMatchMembers', 1, statsContext?.tags);
15
- console.log('Pre-Payload', payload);
16
- console.log('Pre-audienceSettings', audienceSettings);
17
- return functions_1.addDeviceMobileIds(request, audienceSettings, [payload], statsContext);
18
- },
19
- performBatch: async (request, { payload, statsContext, audienceSettings }) => {
20
- statsContext?.statsClient?.incr('editCustomerMatchMembers.batch', 1, statsContext?.tags);
21
- console.log('Pre-Payload', payload);
22
- console.log('Pre-audienceSettings', audienceSettings);
23
- return functions_1.addDeviceMobileIds(request, audienceSettings, payload, statsContext);
24
- }
25
- };
26
- exports.default = action;
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/first-party-dv360/addToAudMobileDeviceId/index.ts"],"names":[],"mappings":";;AAGA,8CAA4D;AAC5D,4CAAiD;AAEjD,MAAM,MAAM,GAA0D;IACpE,KAAK,EAAE,qDAAqD;IAC5D,WAAW,EAAE,oGAAoG;IACjH,mBAAmB,EAAE,iDAAiD;IACtE,MAAM,EAAE;QACN,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;QACvC,WAAW,EAAE,EAAE,GAAG,wBAAW,EAAE;KAChC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,EAAE;QACtE,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,0BAA0B,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QAClF,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;QACnC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAA;QACrD,OAAO,8BAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,CAAA;IAC/E,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,EAAE;QAC3E,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,gCAAgC,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QACxF,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;QACnC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAA;QACrD,OAAO,8BAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IAC7E,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,9 +0,0 @@
1
- export interface Payload {
2
- emails?: string;
3
- phoneNumbers?: string;
4
- zipCodes?: string;
5
- firstName?: string;
6
- lastName?: string;
7
- countryCode?: string;
8
- external_id?: string;
9
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=addToList.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addToList.types.js","sourceRoot":"","sources":["../../../src/destinations/first-party-dv360/addToList.types.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import { InputField } from '@segment/actions-core/index';
2
- export declare const external_id: InputField;
3
- export declare const emails: InputField;
4
- export declare const phoneNumbers: InputField;
5
- export declare const zipCodes: InputField;
6
- export declare const firstName: InputField;
7
- export declare const lastName: InputField;
8
- export declare const countryCode: InputField;
9
- export declare const mobileDeviceIds: InputField;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mobileDeviceIds = exports.countryCode = exports.lastName = exports.firstName = exports.zipCodes = exports.phoneNumbers = exports.emails = exports.external_id = void 0;
4
- exports.external_id = {
5
- label: 'External ID',
6
- description: 'The ID of the DV360 Audience.',
7
- type: 'string',
8
- default: {
9
- '@path': '$.context.personas.external_audience_id'
10
- },
11
- unsafe_hidden: true
12
- };
13
- exports.emails = {
14
- label: 'Emails',
15
- description: `A list of the user's emails. If not already hashed, the system will hash them before use.`,
16
- type: 'string',
17
- default: {
18
- '@path': '$.properties.emails'
19
- }
20
- };
21
- exports.phoneNumbers = {
22
- label: 'Phone Numbers',
23
- description: `A list of the user's phone numbers. If not already hashed, the system will hash them before use.`,
24
- type: 'string',
25
- default: {
26
- '@path': '$.properties.phoneNumbers'
27
- }
28
- };
29
- exports.zipCodes = {
30
- label: 'ZIP Codes',
31
- description: `A list of the user's zip codes.`,
32
- type: 'string',
33
- default: {
34
- '@path': '$.properties.zipCodes'
35
- }
36
- };
37
- exports.firstName = {
38
- label: 'First Name',
39
- description: `The user's first name. If not already hashed, the system will hash it before use.`,
40
- type: 'string',
41
- default: {
42
- '@path': '$.properties.firstName'
43
- }
44
- };
45
- exports.lastName = {
46
- label: 'Last Name',
47
- description: `The user's last name. If not already hashed, the system will hash it before use.`,
48
- type: 'string',
49
- default: {
50
- '@path': '$.properties.lastName'
51
- }
52
- };
53
- exports.countryCode = {
54
- label: 'Country Code',
55
- description: `The country code of the user.`,
56
- type: 'string',
57
- default: {
58
- '@path': '$.properties.countryCode'
59
- }
60
- };
61
- exports.mobileDeviceIds = {
62
- label: 'Mobile Device IDs',
63
- description: `A list of mobile device IDs defining Customer Match audience members. The size of mobileDeviceIds mustn't be greater than 500,000.`,
64
- type: 'string',
65
- default: {
66
- '@path': '$.properties.mobileDeviceIds'
67
- }
68
- };
69
- //# sourceMappingURL=properties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/first-party-dv360/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+BAA+B;IAC5C,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,yCAAyC;KACnD;IACD,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,2FAA2F;IACxG,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,qBAAqB;KAC/B;CACF,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kGAAkG;IAC/G,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,2BAA2B;KACrC;CACF,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,iCAAiC;IAC9C,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,mFAAmF;IAChG,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,wBAAwB;KAClC;CACF,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,kFAAkF;IAC/F,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAA;AAEY,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,+BAA+B;IAC5C,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,0BAA0B;KACpC;CACF,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,oIAAoI;IACjJ,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,8BAA8B;KACxC;CACF,CAAA"}
@@ -1,3 +0,0 @@
1
- import { Client } from './client';
2
- import { Payload } from './generated-types';
3
- export declare function sendEvent(client: Client, fullyQualifiedName: string, payload: Payload): Promise<import("@segment/actions-core/src").ModifiedResponse<unknown>>;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendEvent = void 0;
4
- async function sendEvent(client, fullyQualifiedName, payload) {
5
- const { record_details, properties, occurred_at: occurredAt } = payload;
6
- const json = {
7
- eventName: fullyQualifiedName,
8
- objectId: record_details.object_id ?? undefined,
9
- email: record_details.email ?? undefined,
10
- utk: record_details.utk ?? undefined,
11
- occurredAt,
12
- properties: properties
13
- };
14
- return await client.send(json);
15
- }
16
- exports.sendEvent = sendEvent;
17
- //# sourceMappingURL=event-completion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-completion.js","sourceRoot":"","sources":["../../../../src/destinations/hubspot/customEvent/event-completion.ts"],"names":[],"mappings":";;;AAIO,KAAK,UAAU,SAAS,CAAC,MAAc,EAAE,kBAA0B,EAAE,OAAgB;IAC1F,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;IAEvE,MAAM,IAAI,GAAuB;QAC/B,SAAS,EAAE,kBAAkB;QAC7B,QAAQ,EAAE,cAAc,CAAC,SAAS,IAAI,SAAS;QAC/C,KAAK,EAAE,cAAc,CAAC,KAAK,IAAI,SAAS;QACxC,GAAG,EAAE,cAAc,CAAC,GAAG,IAAI,SAAS;QACpC,UAAU;QACV,UAAU,EAAE,UAAU;KACvB,CAAA;IACD,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAChC,CAAC;AAZD,8BAYC"}
@@ -1,3 +0,0 @@
1
- import { Payload } from './generated-types';
2
- export declare function validate(payload: Payload): Payload;
3
- export declare function cleanEventName(str: string): string;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanEventName = exports.validate = void 0;
4
- const actions_core_1 = require("@segment/actions-core");
5
- function validate(payload) {
6
- if (payload.record_details.object_type !== 'contact' && typeof payload.record_details.object_id !== 'number') {
7
- throw new actions_core_1.PayloadValidationError('object_id is required and must be numeric');
8
- }
9
- if (payload.record_details.object_type === 'contact' &&
10
- typeof payload.record_details.object_id !== 'number' &&
11
- !payload.record_details.email &&
12
- !payload.record_details.utk) {
13
- throw new actions_core_1.PayloadValidationError('Contact requires at least one of object_id (as number), email or utk to be provided');
14
- }
15
- cleanIdentifiers(payload);
16
- payload.event_name = cleanEventName(payload.event_name);
17
- payload.properties = cleanPropObj(payload.properties ?? {});
18
- return payload;
19
- }
20
- exports.validate = validate;
21
- function cleanIdentifiers(payload) {
22
- if (payload.record_details.email && payload.record_details.object_type !== 'contact') {
23
- delete payload.record_details.email;
24
- }
25
- if (payload.record_details.utk && payload.record_details.object_type !== 'contact') {
26
- delete payload.record_details.utk;
27
- }
28
- }
29
- function cleanEventName(str) {
30
- return str.toLowerCase().replace(/[^a-z0-9_-]/g, '_');
31
- }
32
- exports.cleanEventName = cleanEventName;
33
- function cleanPropObj(obj) {
34
- const cleanObj = {};
35
- if (obj === undefined) {
36
- return undefined;
37
- }
38
- Object.keys(obj).forEach((key) => {
39
- const value = obj[key];
40
- const cleanKey = cleanProp(key);
41
- if (typeof value === 'boolean' || typeof value === 'number') {
42
- cleanObj[cleanKey] = value;
43
- }
44
- else if (typeof value === 'string' && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
45
- cleanObj[cleanKey] = value.toLowerCase() === 'true';
46
- }
47
- else if (!isNaN(Number(value))) {
48
- cleanObj[cleanKey] = Number(value);
49
- }
50
- else if (typeof value === 'object' && value !== null) {
51
- cleanObj[cleanKey] = JSON.stringify(value);
52
- }
53
- else {
54
- cleanObj[cleanKey] = String(value);
55
- }
56
- });
57
- return cleanObj;
58
- }
59
- function cleanProp(str) {
60
- str = str.toLowerCase().replace(/[^a-z0-9_]/g, '_');
61
- if (!/^[a-z]/.test(str)) {
62
- throw new actions_core_1.PayloadValidationError(`Property ${str} in event has an invalid name. Property names must start with a letter.`);
63
- }
64
- return str;
65
- }
66
- //# sourceMappingURL=validation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/destinations/hubspot/customEvent/validation.ts"],"names":[],"mappings":";;;AACA,wDAA8D;AAE9D,SAAgB,QAAQ,CAAC,OAA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G,CAAC,EAAE;QACvB,MAAM,IAAI,qCAAsB,CAC9B,YAAY,GAAG,yEAAyE,CACzF,CAAA;KACF;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -1,53 +0,0 @@
1
- export interface Payload {
2
- columns: {
3
- user_id_header?: string;
4
- anonymous_id_header?: string;
5
- timestamp_header?: string;
6
- message_id_header?: string;
7
- integrations_object_header?: string;
8
- all_event_properties_header?: string;
9
- all_user_traits_header?: string;
10
- event_name_header?: string;
11
- event_type_header?: string;
12
- context_header?: string;
13
- };
14
- userId?: string;
15
- anonymousId?: string;
16
- timestamp: string | number;
17
- messageId: string;
18
- integrationsObject?: {
19
- [k: string]: unknown;
20
- };
21
- all_event_properties?: {
22
- [k: string]: unknown;
23
- };
24
- all_user_traits?: {
25
- [k: string]: unknown;
26
- };
27
- context?: {
28
- [k: string]: unknown;
29
- };
30
- eventProperties?: {
31
- [k: string]: unknown;
32
- };
33
- userTraits?: {
34
- [k: string]: unknown;
35
- };
36
- eventName?: string;
37
- eventType: string;
38
- enable_batching: boolean;
39
- batch_size?: number;
40
- s3_aws_folder_name?: string;
41
- filename_prefix?: string;
42
- delimiter: string;
43
- file_extension: string;
44
- audienceColumns: {
45
- audience_name_header?: string;
46
- audience_id_header?: string;
47
- space_id_header?: string;
48
- audience_action_header?: string;
49
- };
50
- spaceId?: string;
51
- audienceName?: string;
52
- audienceId?: string;
53
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/s3/syncAudienceToS3/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
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;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fields_1 = require("../fields");
4
- const action = {
5
- title: 'Sync to S3',
6
- description: 'Syncs Segment event data to S3.',
7
- defaultSubscription: 'type = "identify" or type = "track"',
8
- fields: {
9
- ...fields_1.commonFields,
10
- ...fields_1.audienceOnlyFields
11
- },
12
- perform: async (_, { payload, settings }) => {
13
- console.log(payload);
14
- console.log(settings);
15
- },
16
- performBatch: (_, { payload, settings }) => {
17
- console.log(payload);
18
- console.log(settings);
19
- }
20
- };
21
- exports.default = action;
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/s3/syncAudienceToS3/index.ts"],"names":[],"mappings":";;AAIA,sCAA4D;AAE5D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,iCAAiC;IAC9C,mBAAmB,EAAE,qCAAqC;IAC1D,MAAM,EAAE;QACN,GAAG,qBAAY;QACf,GAAG,2BAAkB;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAEvB,CAAC;IACD,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAEvB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}