@segment/action-destinations 3.118.0-alpha.1 → 3.118.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 (134) hide show
  1. package/dist/destinations/actable-predictive/generated-types.d.ts +4 -0
  2. package/dist/destinations/actable-predictive/generated-types.js +3 -0
  3. package/dist/destinations/actable-predictive/generated-types.js.map +1 -0
  4. package/dist/destinations/actable-predictive/index.d.ts +6 -0
  5. package/dist/destinations/actable-predictive/index.js +57 -0
  6. package/dist/destinations/actable-predictive/index.js.map +1 -0
  7. package/dist/destinations/actable-predictive/sendCustomEvent/generated-types.d.ts +8 -0
  8. package/dist/destinations/actable-predictive/sendCustomEvent/generated-types.js +3 -0
  9. package/dist/destinations/actable-predictive/sendCustomEvent/generated-types.js.map +1 -0
  10. package/dist/destinations/actable-predictive/sendCustomEvent/index.d.ts +5 -0
  11. package/dist/destinations/actable-predictive/sendCustomEvent/index.js +62 -0
  12. package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -0
  13. package/dist/destinations/actable-predictive/sendEmailEvent/generated-types.d.ts +9 -0
  14. package/dist/destinations/actable-predictive/sendEmailEvent/generated-types.js +3 -0
  15. package/dist/destinations/actable-predictive/sendEmailEvent/generated-types.js.map +1 -0
  16. package/dist/destinations/actable-predictive/sendEmailEvent/index.d.ts +5 -0
  17. package/dist/destinations/actable-predictive/sendEmailEvent/index.js +85 -0
  18. package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -0
  19. package/dist/destinations/actable-predictive/sendTransactionEvent/generated-types.d.ts +11 -0
  20. package/dist/destinations/actable-predictive/sendTransactionEvent/generated-types.js +3 -0
  21. package/dist/destinations/actable-predictive/sendTransactionEvent/generated-types.js.map +1 -0
  22. package/dist/destinations/actable-predictive/sendTransactionEvent/index.d.ts +5 -0
  23. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +113 -0
  24. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -0
  25. package/dist/destinations/actable-predictive/sendWebEvent/generated-types.d.ts +9 -0
  26. package/dist/destinations/actable-predictive/sendWebEvent/generated-types.js +3 -0
  27. package/dist/destinations/actable-predictive/sendWebEvent/generated-types.js.map +1 -0
  28. package/dist/destinations/actable-predictive/sendWebEvent/index.d.ts +5 -0
  29. package/dist/destinations/actable-predictive/sendWebEvent/index.js +84 -0
  30. package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -0
  31. package/dist/destinations/actions-pardot/generated-types.d.ts +1 -1
  32. package/dist/destinations/actions-pardot/index.js +1 -2
  33. package/dist/destinations/actions-pardot/index.js.map +1 -1
  34. package/dist/destinations/adobe-target/adobeTarget_operations.js +1 -1
  35. package/dist/destinations/adobe-target/adobeTarget_operations.js.map +1 -1
  36. package/dist/destinations/adobe-target/updateProfile/index.js +10 -2
  37. package/dist/destinations/adobe-target/updateProfile/index.js.map +1 -1
  38. package/dist/destinations/amplitude/user-agent.js +2 -2
  39. package/dist/destinations/amplitude/user-agent.js.map +1 -1
  40. package/dist/destinations/clevertap/userDelete/index.js +1 -1
  41. package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
  42. package/dist/destinations/fullstory/vars.js +22 -13
  43. package/dist/destinations/fullstory/vars.js.map +1 -1
  44. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +3 -3
  45. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
  46. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +1 -1
  47. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
  48. package/dist/destinations/hubspot/upsertContact/index.js +1 -1
  49. package/dist/destinations/hubspot/upsertContact/index.js.map +1 -1
  50. package/dist/destinations/index.js +2 -0
  51. package/dist/destinations/index.js.map +1 -1
  52. package/dist/destinations/mixpanel/generated-types.d.ts +1 -0
  53. package/dist/destinations/mixpanel/index.js +7 -0
  54. package/dist/destinations/mixpanel/index.js.map +1 -1
  55. package/dist/destinations/mixpanel/mixpanel-properties.js +24 -0
  56. package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
  57. package/dist/destinations/mixpanel/mixpanel-types.d.ts +1 -1
  58. package/dist/destinations/mixpanel/trackEvent/functions.js +9 -3
  59. package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
  60. package/dist/destinations/mixpanel/trackEvent/generated-types.d.ts +4 -1
  61. package/dist/destinations/mixpanel/trackEvent/index.js +3 -76
  62. package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
  63. package/dist/destinations/mixpanel/trackPurchase/generated-types.d.ts +5 -0
  64. package/dist/destinations/mixpanel/trackPurchase/index.js +2 -2
  65. package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
  66. package/dist/destinations/mixpanel/utils.d.ts +4 -0
  67. package/dist/destinations/mixpanel/utils.js +6 -1
  68. package/dist/destinations/mixpanel/utils.js.map +1 -1
  69. package/dist/destinations/moengage/index.js +4 -0
  70. package/dist/destinations/moengage/index.js.map +1 -1
  71. package/dist/destinations/moengage/regional-endpoints.d.ts +1 -0
  72. package/dist/destinations/moengage/regional-endpoints.js +2 -1
  73. package/dist/destinations/moengage/regional-endpoints.js.map +1 -1
  74. package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/index.js +1 -1
  75. package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/index.js.map +1 -1
  76. package/dist/destinations/salesforce-marketing-cloud/sfmc-properties.js +3 -3
  77. package/dist/destinations/salesforce-marketing-cloud/sfmc-properties.js.map +1 -1
  78. package/dist/destinations/segment/errors.d.ts +3 -0
  79. package/dist/destinations/segment/errors.js +7 -0
  80. package/dist/destinations/segment/errors.js.map +1 -0
  81. package/dist/destinations/segment/generated-types.d.ts +4 -0
  82. package/dist/destinations/segment/generated-types.js +3 -0
  83. package/dist/destinations/segment/generated-types.js.map +1 -0
  84. package/dist/destinations/segment/index.d.ts +4 -0
  85. package/dist/destinations/segment/index.js +58 -0
  86. package/dist/destinations/segment/index.js.map +1 -0
  87. package/dist/destinations/segment/properties.d.ts +10 -0
  88. package/dist/destinations/segment/properties.js +17 -0
  89. package/dist/destinations/segment/properties.js.map +1 -0
  90. package/dist/destinations/segment/segment-properties.d.ts +23 -0
  91. package/dist/destinations/segment/segment-properties.js +322 -0
  92. package/dist/destinations/segment/segment-properties.js.map +1 -0
  93. package/dist/destinations/segment/sendGroup/generated-types.d.ts +65 -0
  94. package/dist/destinations/segment/sendGroup/generated-types.js +3 -0
  95. package/dist/destinations/segment/sendGroup/generated-types.js.map +1 -0
  96. package/dist/destinations/segment/sendGroup/index.d.ts +5 -0
  97. package/dist/destinations/segment/sendGroup/index.js +67 -0
  98. package/dist/destinations/segment/sendGroup/index.js.map +1 -0
  99. package/dist/destinations/segment/sendIdentify/generated-types.d.ts +65 -0
  100. package/dist/destinations/segment/sendIdentify/generated-types.js +3 -0
  101. package/dist/destinations/segment/sendIdentify/generated-types.js.map +1 -0
  102. package/dist/destinations/segment/sendIdentify/index.d.ts +5 -0
  103. package/dist/destinations/segment/sendIdentify/index.js +67 -0
  104. package/dist/destinations/segment/sendIdentify/index.js.map +1 -0
  105. package/dist/destinations/segment/sendPage/generated-types.d.ts +67 -0
  106. package/dist/destinations/segment/sendPage/generated-types.js +3 -0
  107. package/dist/destinations/segment/sendPage/generated-types.js.map +1 -0
  108. package/dist/destinations/segment/sendPage/index.d.ts +5 -0
  109. package/dist/destinations/segment/sendPage/index.js +77 -0
  110. package/dist/destinations/segment/sendPage/index.js.map +1 -0
  111. package/dist/destinations/segment/sendScreen/generated-types.d.ts +66 -0
  112. package/dist/destinations/segment/sendScreen/generated-types.js +3 -0
  113. package/dist/destinations/segment/sendScreen/generated-types.js.map +1 -0
  114. package/dist/destinations/segment/sendScreen/index.d.ts +5 -0
  115. package/dist/destinations/segment/sendScreen/index.js +69 -0
  116. package/dist/destinations/segment/sendScreen/index.js.map +1 -0
  117. package/dist/destinations/segment/sendTrack/generated-types.d.ts +66 -0
  118. package/dist/destinations/segment/sendTrack/generated-types.js +3 -0
  119. package/dist/destinations/segment/sendTrack/generated-types.js.map +1 -0
  120. package/dist/destinations/segment/sendTrack/index.d.ts +5 -0
  121. package/dist/destinations/segment/sendTrack/index.js +69 -0
  122. package/dist/destinations/segment/sendTrack/index.js.map +1 -0
  123. package/dist/destinations/sendgrid/sendgrid-properties.d.ts +1 -0
  124. package/dist/destinations/sendgrid/sendgrid-properties.js +23 -2
  125. package/dist/destinations/sendgrid/sendgrid-properties.js.map +1 -1
  126. package/dist/destinations/snap-conversions-api/_tests_/index.test.js +123 -0
  127. package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
  128. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +8 -2
  129. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
  130. package/dist/destinations/snap-conversions-api/snap-capi-properties.js +5 -5
  131. package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
  132. package/dist/destinations/webhook/send/index.js +1 -3
  133. package/dist/destinations/webhook/send/index.js.map +1 -1
  134. package/package.json +4 -4
@@ -0,0 +1,4 @@
1
+ export interface Settings {
2
+ client_id: string;
3
+ client_secret: string;
4
+ }
@@ -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/actable-predictive/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ export declare const API_URL = "https://api.converscience.com/events";
4
+ export declare function formatTimestampAsUnixSeconds(ISOTimestamp: string | number): number;
5
+ declare const destination: DestinationDefinition<Settings>;
6
+ export default destination;
@@ -0,0 +1,57 @@
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.formatTimestampAsUnixSeconds = exports.API_URL = void 0;
7
+ const sendEmailEvent_1 = __importDefault(require("./sendEmailEvent"));
8
+ const sendWebEvent_1 = __importDefault(require("./sendWebEvent"));
9
+ const sendTransactionEvent_1 = __importDefault(require("./sendTransactionEvent"));
10
+ const sendCustomEvent_1 = __importDefault(require("./sendCustomEvent"));
11
+ const dayjs_1 = __importDefault(require("../../lib/dayjs"));
12
+ exports.API_URL = "https://api.converscience.com/events";
13
+ function formatTimestampAsUnixSeconds(ISOTimestamp) {
14
+ return dayjs_1.default.utc(ISOTimestamp).unix();
15
+ }
16
+ exports.formatTimestampAsUnixSeconds = formatTimestampAsUnixSeconds;
17
+ const destination = {
18
+ name: 'Actable Predictive',
19
+ slug: 'actions-actable-predictive',
20
+ mode: 'cloud',
21
+ authentication: {
22
+ scheme: 'custom',
23
+ fields: {
24
+ client_id: {
25
+ label: 'Client ID',
26
+ description: 'Your Actable-supplied Client ID.',
27
+ type: 'string',
28
+ required: true
29
+ },
30
+ client_secret: {
31
+ label: 'Client Secret',
32
+ description: 'Your Actable-supplied Client Secret.',
33
+ type: 'string',
34
+ required: true
35
+ }
36
+ },
37
+ testAuthentication: (request) => {
38
+ return request(exports.API_URL, {
39
+ method: 'post',
40
+ json: { data: [{ stream_key: 'auth' }] }
41
+ });
42
+ }
43
+ },
44
+ extendRequest({ settings }) {
45
+ return {
46
+ headers: { Authorization: Buffer.from(settings.client_id + ':' + settings.client_secret).toString('base64') }
47
+ };
48
+ },
49
+ actions: {
50
+ sendEmailEvent: sendEmailEvent_1.default,
51
+ sendWebEvent: sendWebEvent_1.default,
52
+ sendTransactionEvent: sendTransactionEvent_1.default,
53
+ sendCustomEvent: sendCustomEvent_1.default
54
+ }
55
+ };
56
+ exports.default = destination;
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":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AAY;QACZ,oBAAoB,EAApB,8BAAoB;QACpB,eAAe,EAAf,yBAAe;KAChB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,8 @@
1
+ export interface Payload {
2
+ customer_id: string;
3
+ timestamp: string | number;
4
+ properties: {
5
+ [k: string]: unknown;
6
+ };
7
+ stream_key: string;
8
+ }
@@ -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/actable-predictive/sendCustomEvent/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,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../index");
4
+ const action = {
5
+ title: 'Send Custom Event',
6
+ description: 'Send a custom event to Actable for prediction.',
7
+ fields: {
8
+ customer_id: {
9
+ label: 'Customer ID',
10
+ description: 'The unique user identifier.',
11
+ type: 'string',
12
+ required: true,
13
+ default: {
14
+ '@path': '$.userId'
15
+ }
16
+ },
17
+ timestamp: {
18
+ type: "datetime",
19
+ label: "Timestamp of Event",
20
+ description: "Timestamp of when the custom event occured.",
21
+ format: 'date-time',
22
+ required: true,
23
+ default: {
24
+ '@path': '$.timestamp'
25
+ }
26
+ },
27
+ properties: {
28
+ type: "object",
29
+ label: "Custom Properties",
30
+ description: "Send an object of custom properties to Actable Predictive for custom data modeling.",
31
+ format: "text",
32
+ required: true,
33
+ default: { '@path': '$.properties' }
34
+ },
35
+ stream_key: {
36
+ type: "string",
37
+ format: "text",
38
+ label: "Stream Key",
39
+ description: "Dataset label, should be left as default unless specified otherwise.",
40
+ required: true,
41
+ default: "custom"
42
+ }
43
+ },
44
+ perform: (request, data) => {
45
+ data.payload.timestamp = index_1.formatTimestampAsUnixSeconds(data.payload.timestamp);
46
+ return request(index_1.API_URL, {
47
+ method: 'post',
48
+ json: { data: [data.payload] }
49
+ });
50
+ },
51
+ performBatch: (request, data) => {
52
+ for (const ev of data.payload) {
53
+ ev.timestamp = index_1.formatTimestampAsUnixSeconds(ev.timestamp);
54
+ }
55
+ return request(index_1.API_URL, {
56
+ method: 'post',
57
+ json: { data: data.payload }
58
+ });
59
+ }
60
+ };
61
+ exports.default = action;
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/actable-predictive/sendCustomEvent/index.ts"],"names":[],"mappings":";;AAGA,oCAAgE;AAEhE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,6CAA6C;YAC1D,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,qFAAqF;YAClG,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SAErC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,sEAAsE;YACnF,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,QAAQ;SAClB;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,oCAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAE7E,OAAO,OAAO,CAAC,eAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;SAC/B,CAAC,CAAA;IACJ,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE;YAC7B,EAAE,CAAC,SAAS,GAAG,oCAA4B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAA;SAC1D;QACD,OAAO,OAAO,CAAC,eAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;SAC7B,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ customer_id: string;
3
+ date_email_sent: string | number;
4
+ campaign_name?: string;
5
+ clicked_flag?: number;
6
+ opened_flag?: number;
7
+ unsub_flag?: number;
8
+ stream_key: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/actable-predictive/sendEmailEvent/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,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../index");
4
+ const action = {
5
+ title: 'Send Email Event',
6
+ description: '',
7
+ fields: {
8
+ customer_id: {
9
+ label: 'Customer ID',
10
+ description: 'The unique user identifier.',
11
+ type: 'string',
12
+ required: true,
13
+ default: {
14
+ '@path': '$.userId'
15
+ }
16
+ },
17
+ date_email_sent: {
18
+ type: "datetime",
19
+ label: "timestamp of event",
20
+ description: "Timestamp of event",
21
+ format: 'date-time',
22
+ required: true,
23
+ default: {
24
+ '@path': '$.timestamp'
25
+ }
26
+ },
27
+ campaign_name: {
28
+ type: "string",
29
+ label: "Campaign Name of Email",
30
+ description: "name of the campaign associated with the email",
31
+ format: 'text',
32
+ required: false,
33
+ default: {
34
+ '@path': '$.context.campaign.name'
35
+ }
36
+ },
37
+ clicked_flag: {
38
+ type: "integer",
39
+ label: "Click Event Indicator",
40
+ description: "1=email was clicked, 0 email was not clicked",
41
+ format: 'text',
42
+ required: false
43
+ },
44
+ opened_flag: {
45
+ type: "integer",
46
+ label: "Open Event Indicator",
47
+ description: "1=email was opened, 0 email was not opened",
48
+ format: 'text',
49
+ required: false
50
+ },
51
+ unsub_flag: {
52
+ type: "integer",
53
+ label: "Unsubscribe Event Indicator",
54
+ description: "1=customer unsubscribed from the email list, 0 user remained subscribed",
55
+ format: 'text',
56
+ required: false
57
+ },
58
+ stream_key: {
59
+ type: "string",
60
+ format: "text",
61
+ label: "Stream Key",
62
+ description: "Dataset label, should be left as default unless directed otherwise",
63
+ required: true,
64
+ default: "email"
65
+ }
66
+ },
67
+ perform: (request, data) => {
68
+ data.payload.date_email_sent = index_1.formatTimestampAsUnixSeconds(data.payload.date_email_sent);
69
+ return request(index_1.API_URL, {
70
+ method: 'post',
71
+ json: { data: [data.payload] }
72
+ });
73
+ },
74
+ performBatch: (request, data) => {
75
+ for (const ev of data.payload) {
76
+ ev.date_email_sent = index_1.formatTimestampAsUnixSeconds(ev.date_email_sent);
77
+ }
78
+ return request(index_1.API_URL, {
79
+ method: 'post',
80
+ json: { data: data.payload }
81
+ });
82
+ }
83
+ };
84
+ exports.default = action;
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/actable-predictive/sendEmailEvent/index.ts"],"names":[],"mappings":";;AAGA,oCAAgE;AAEhE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,EAAE;IACf,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,oBAAoB;YACjC,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,gDAAgD;YAC7D,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;SAEF;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,uBAAuB;YAC9B,WAAW,EAAE,8CAA8C;YAC3D,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,4CAA4C;YACzD,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,6BAA6B;YACpC,WAAW,EAAE,yEAAyE;YACtF,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,oEAAoE;YACjF,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,OAAO;SACjB;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,oCAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QAEzF,OAAO,OAAO,CAAC,eAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;SAC/B,CAAC,CAAA;IACJ,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE;YAC7B,EAAE,CAAC,eAAe,GAAG,oCAA4B,CAAC,EAAE,CAAC,eAAe,CAAC,CAAA;SACtE;QACD,OAAO,OAAO,CAAC,eAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;SAC7B,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,11 @@
1
+ export interface Payload {
2
+ customer_id: string;
3
+ discount_code?: string;
4
+ transaction_id?: string;
5
+ spend?: number;
6
+ products: {
7
+ [k: string]: unknown;
8
+ }[];
9
+ purchase_datetime: string | number;
10
+ stream_key: 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/actable-predictive/sendTransactionEvent/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const actions_core_1 = require("@segment/actions-core");
4
+ const index_1 = require("../index");
5
+ function formatPurchasePayload(purchaseEvent) {
6
+ purchaseEvent.purchase_datetime = index_1.formatTimestampAsUnixSeconds(purchaseEvent.purchase_datetime);
7
+ const codeList = [];
8
+ if (purchaseEvent.discount_code) {
9
+ codeList.push(purchaseEvent.discount_code);
10
+ }
11
+ if (purchaseEvent.products) {
12
+ for (const product of purchaseEvent.products) {
13
+ if (product.coupon) {
14
+ codeList.push(product.coupon);
15
+ }
16
+ }
17
+ }
18
+ const productList = [];
19
+ if (purchaseEvent.products) {
20
+ for (const product of purchaseEvent.products) {
21
+ const productIdentifier = product.product_id || product.sku;
22
+ if (productIdentifier) {
23
+ productList.push(productIdentifier);
24
+ }
25
+ }
26
+ }
27
+ return {
28
+ ...actions_core_1.omit(purchaseEvent, ["products", "discount_code"]),
29
+ "product_column": productList.join("|"),
30
+ "discount_code": codeList.join("|")
31
+ };
32
+ }
33
+ const action = {
34
+ title: 'Send Transaction Event',
35
+ description: '',
36
+ fields: {
37
+ customer_id: {
38
+ label: 'Customer ID',
39
+ description: 'The unique user identifier.',
40
+ type: 'string',
41
+ required: true,
42
+ default: {
43
+ '@path': '$.userId'
44
+ }
45
+ },
46
+ discount_code: {
47
+ type: "string",
48
+ label: "Discount Code",
49
+ description: "Discount code, if any, used on purchase. Will be used in addition to per-product coupons in Segment v2commerce events spec.",
50
+ format: "text",
51
+ required: false
52
+ },
53
+ transaction_id: {
54
+ type: "string",
55
+ label: "Transaction ID",
56
+ description: "Optional Identifier for transaction.",
57
+ format: "text",
58
+ required: false,
59
+ default: { '@path': '$.properties.order_id' }
60
+ },
61
+ spend: {
62
+ type: "number",
63
+ label: "Amount",
64
+ description: "Total order amount.",
65
+ format: "text",
66
+ required: false,
67
+ default: { '@path': '$.properties.total' }
68
+ },
69
+ products: {
70
+ type: "object",
71
+ multiple: true,
72
+ label: "Products Purchased",
73
+ description: "product(s) purchased in transaction. This value should be an array of objects which at the minimum contains a Product ID or SKU per-product.",
74
+ format: "text",
75
+ required: true,
76
+ default: { '@path': '$.properties.products' }
77
+ },
78
+ purchase_datetime: {
79
+ type: "datetime",
80
+ label: "Timestamp",
81
+ description: "timestamp of when transaction event occurred.",
82
+ format: "date-time",
83
+ required: true,
84
+ default: { '@path': '$.timestamp' }
85
+ },
86
+ stream_key: {
87
+ type: "string",
88
+ format: "text",
89
+ label: "Stream Key",
90
+ description: "Dataset label, should be left as default unless directed otherwise.",
91
+ required: true,
92
+ default: "transaction"
93
+ }
94
+ },
95
+ perform: (request, data) => {
96
+ return request(index_1.API_URL, {
97
+ method: 'post',
98
+ json: { data: [formatPurchasePayload(data.payload)] }
99
+ });
100
+ },
101
+ performBatch: (request, data) => {
102
+ const formattedPayload = [];
103
+ for (const ev of data.payload) {
104
+ formattedPayload.push(formatPurchasePayload(ev));
105
+ }
106
+ return request(index_1.API_URL, {
107
+ method: 'post',
108
+ json: { data: formattedPayload }
109
+ });
110
+ }
111
+ };
112
+ exports.default = action;
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/actable-predictive/sendTransactionEvent/index.ts"],"names":[],"mappings":";;AAAA,wDAA8D;AAG9D,oCAAgE;AAEhE,SAAS,qBAAqB,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AE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE;SACtD,CAAC,CAAA;IACJ,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,MAAM,gBAAgB,GAAa,EAAE,CAAA;QAErC,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE;YAC7B,gBAAgB,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAA;SACjD;QACD,OAAO,OAAO,CAAC,eAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;SACjC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AACD,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ customer_id: string;
3
+ datetime: string | number;
4
+ interaction_type: string;
5
+ utm_campaign?: string;
6
+ utm_medium?: string;
7
+ utm_source?: string;
8
+ stream_key: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/actable-predictive/sendWebEvent/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,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../index");
4
+ const action = {
5
+ title: 'Send Web Activity Event',
6
+ description: '',
7
+ fields: {
8
+ customer_id: {
9
+ label: 'Customer ID',
10
+ description: 'The unique user identifier.',
11
+ type: 'string',
12
+ required: true,
13
+ default: {
14
+ '@path': '$.userId'
15
+ }
16
+ },
17
+ datetime: {
18
+ type: "datetime",
19
+ format: "date-time",
20
+ label: "Event Timestamp",
21
+ description: "Timestamp of event",
22
+ required: true,
23
+ default: { '@path': '$.timestamp' }
24
+ },
25
+ interaction_type: {
26
+ type: "string",
27
+ format: "text",
28
+ label: "Event Type",
29
+ description: "type of interaction (page view, add to cart, etc).",
30
+ required: true,
31
+ default: { '@path': '$.event' }
32
+ },
33
+ utm_campaign: {
34
+ type: "string",
35
+ format: "text",
36
+ label: "UTM Campaign",
37
+ description: "UTM campaign parameter associated with event.",
38
+ required: false,
39
+ default: { '@path': '$.context.campaign.name' }
40
+ },
41
+ utm_medium: {
42
+ type: "string",
43
+ format: "text",
44
+ label: "UTM Medium",
45
+ description: "UTM medium parameter associated with event.",
46
+ required: false,
47
+ default: { '@path': '$.context.campaign.medium' }
48
+ },
49
+ utm_source: {
50
+ type: "string",
51
+ format: "text",
52
+ label: "UTM Source",
53
+ description: "UTM source parameter associated with event.",
54
+ required: false,
55
+ default: { '@path': '$.context.campaign.source' }
56
+ },
57
+ stream_key: {
58
+ type: "string",
59
+ format: "text",
60
+ label: "Stream Key",
61
+ description: "Dataset label, should be left as default unless directed otherwise",
62
+ required: true,
63
+ default: "web"
64
+ }
65
+ },
66
+ perform: (request, data) => {
67
+ data.payload.datetime = index_1.formatTimestampAsUnixSeconds(data.payload.datetime);
68
+ return request(index_1.API_URL, {
69
+ method: 'post',
70
+ json: { data: [data.payload] }
71
+ });
72
+ },
73
+ performBatch: (request, data) => {
74
+ for (const ev of data.payload) {
75
+ ev.datetime = index_1.formatTimestampAsUnixSeconds(ev.datetime);
76
+ }
77
+ return request(index_1.API_URL, {
78
+ method: 'post',
79
+ json: { data: data.payload }
80
+ });
81
+ }
82
+ };
83
+ exports.default = action;
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../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,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE;SAClD;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,oEAAoE;YACjF,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,oCAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QAE3E,OAAO,OAAO,CAAC,eAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;SAC/B,CAAC,CAAA;IACJ,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE;YAC7B,EAAE,CAAC,QAAQ,GAAG,oCAA4B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;SACxD;QACD,OAAO,OAAO,CAAC,eAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;SAC7B,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,5 +1,5 @@
1
1
  export interface Settings {
2
2
  businessUnitID: string;
3
3
  accountID: string;
4
- isSandbox: boolean;
4
+ isSandbox?: boolean;
5
5
  }
@@ -28,8 +28,7 @@ const destination = {
28
28
  label: 'Sandbox Instance',
29
29
  description: 'Enable to authenticate into a sandbox instance. You can log in to a sandbox by appending the sandbox name to your Salesforce username. For example, if a username for a production org is user@acme.com and the sandbox is named `test`, the username to log in to the sandbox is user@acme.com.test. If you are already authenticated, please disconnect and reconnect with your sandbox username.',
30
30
  type: 'boolean',
31
- default: false,
32
- required: true
31
+ default: false
33
32
  }
34
33
  },
35
34
  refreshAccessToken: async (request, { auth, settings }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/actions-pardot/index.ts"],"names":[],"mappings":";;;;;AAEA,4DAAmC;AAMnC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,cAAc,EAAE;gBACd,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EACT,mEAAmE;oBACnE,iTAAiT;gBACnT,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EACT,gNAAgN;gBAClN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,qYAAqY;gBACvY,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;YAExD,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,8BAA8B,CAAA;YACnG,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,GAAG,OAAO,wBAAwB,EAAE;gBAClF,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YACF,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAA;QAC/C,CAAC;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;gBAC5C,yBAAyB,EAAE,QAAQ,CAAC,cAAc;aACnD;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/actions-pardot/index.ts"],"names":[],"mappings":";;;;;AAEA,4DAAmC;AAMnC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,cAAc,EAAE;gBACd,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EACT,mEAAmE;oBACnE,iTAAiT;gBACnT,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EACT,gNAAgN;gBAClN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,qYAAqY;gBACvY,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;YAExD,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,8BAA8B,CAAA;YACnG,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,GAAG,OAAO,wBAAwB,EAAE;gBAClF,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YACF,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAA;QAC/C,CAAC;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;gBAC5C,yBAAyB,EAAE,QAAQ,CAAC,cAAc;aACnD;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -41,7 +41,7 @@ class AdobeTarget {
41
41
  }
42
42
  catch (error) {
43
43
  if (error instanceof Error) {
44
- return new actions_core_1.IntegrationError(error.message, error.stack, error.message == 'Forbidden' ? 403 : 400);
44
+ return new actions_core_1.IntegrationError(error.message, error.message == 'Forbidden' ? '403' : '400');
45
45
  }
46
46
  }
47
47
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"adobeTarget_operations.js","sourceRoot":"","sources":["../../../src/destinations/adobe-target/adobeTarget_operations.ts"],"names":[],"mappings":";;AAAA,wDAAuE;AAEvE,SAAS,gBAAgB,CAAC,GAAyB,EAAE,UAAU,GAAG,EAAE,EAAE,aAAsC,EAAE;IAE5G,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,IAAI,SAAS,EAAE;QACnC,MAAM,CAAC,IAAI,CA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M,CAAC,EAAE,CAAA;oBAE9E,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;wBAC9B,MAAM,EAAE,MAAM;qBACf,CAAC,CAAA;iBACH;aACF;QACH,CAAC,CAAA;QAEO,kBAAa,GAAG,KAAK,EAAE,MAAc,EAAE,UAAkB,EAAyC,EAAE;YAC1G,IAAI;gBACF,MAAM,IAAI,CAAC,OAAO,CAChB,WAAW,UAAU,gDAAgD,MAAM,WAAW,UAAU,EAAE,EAClG,EAAE,MAAM,EAAE,KAAK,EAAE,CAClB,CAAA;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,IAAI,KAAK,YAAY,KAAK,EAAE;oBAC1B,OAAO,IAAI,+BAAgB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;iBAClG;aACF;YAED,OAAO,SAAS,CAAA;QAClB,CAAC,CAAA;QArCC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAkCF;AA7CD,8BA6CC"}
1
+ {"version":3,"file":"adobeTarget_operations.js","sourceRoot":"","sources":["../../../src/destinations/adobe-target/adobeTarget_operations.ts"],"names":[],"mappings":";;AAAA,wDAAuE;AAEvE,SAAS,gBAAgB,CAAC,GAAyB,EAAE,UAAU,GAAG,EAAE,EAAE,aAAsC,EAAE;IAE5G,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,IAAI,SAAS,EAAE;QACnC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,G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,CAAA;iBACH;aACF;QACH,CAAC,CAAA;QAEO,kBAAa,GAAG,KAAK,EAAE,MAAc,EAAE,UAAkB,EAAyC,EAAE;YAC1G,IAAI;gBACF,MAAM,IAAI,CAAC,OAAO,CAChB,WAAW,UAAU,gDAAgD,MAAM,WAAW,UAAU,EAAE,EAClG,EAAE,MAAM,EAAE,KAAK,EAAE,CAClB,CAAA;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,IAAI,KAAK,YAAY,KAAK,EAAE;oBAC1B,OAAO,IAAI,+BAAgB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;iBACzF;aACF;YAED,OAAO,SAAS,CAAA;QAClB,CAAC,CAAA;QArCC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAkCF;AA7CD,8BA6CC"}
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const actions_core_1 = require("@segment/actions-core");
6
7
  const adobeTarget_operations_1 = __importDefault(require("../adobeTarget_operations"));
7
8
  const action = {
8
9
  title: 'Update Profile',
@@ -31,8 +32,15 @@ const action = {
31
32
  }
32
33
  },
33
34
  perform: async (request, { settings, payload }) => {
34
- const at = new adobeTarget_operations_1.default(payload.user_id, settings.client_code, payload.traits, request);
35
- return await at.updateProfile();
35
+ try {
36
+ const at = new adobeTarget_operations_1.default(payload.user_id, settings.client_code, payload.traits, request);
37
+ return await at.updateProfile();
38
+ }
39
+ catch (error) {
40
+ if (error instanceof Error) {
41
+ throw new actions_core_1.IntegrationError(error.message, error.message == 'Forbidden' ? '403' : '400');
42
+ }
43
+ }
36
44
  }
37
45
  };
38
46
  exports.default = action;