@segment/action-destinations 3.74.1-alpha.1 → 3.74.1-alpha.12

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 (79) hide show
  1. package/dist/destinations/gainsight-px-cloud-action/index.js +1 -1
  2. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +2 -2
  3. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
  4. package/dist/destinations/google-analytics-4/addToCart/index.js +1 -1
  5. package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
  6. package/dist/destinations/google-analytics-4/addToWishlist/index.js +2 -2
  7. package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
  8. package/dist/destinations/google-analytics-4/beginCheckout/index.js +2 -2
  9. package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
  10. package/dist/destinations/google-analytics-4/generateLead/index.js +1 -1
  11. package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
  12. package/dist/destinations/google-analytics-4/purchase/index.js +2 -2
  13. package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
  14. package/dist/destinations/google-analytics-4/refund/index.js +2 -2
  15. package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
  16. package/dist/destinations/google-analytics-4/removeFromCart/index.js +2 -2
  17. package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
  18. package/dist/destinations/google-analytics-4/selectItem/index.js +1 -1
  19. package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
  20. package/dist/destinations/google-analytics-4/selectPromotion/index.js +1 -1
  21. package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
  22. package/dist/destinations/google-analytics-4/viewCart/index.js +2 -2
  23. package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
  24. package/dist/destinations/google-analytics-4/viewItem/index.js +2 -2
  25. package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
  26. package/dist/destinations/google-analytics-4/viewItemList/index.js +1 -1
  27. package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
  28. package/dist/destinations/google-analytics-4/viewPromotion/index.js +1 -1
  29. package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
  30. package/dist/destinations/google-sheets/constants.d.ts +3 -0
  31. package/dist/destinations/google-sheets/constants.js +7 -0
  32. package/dist/destinations/google-sheets/constants.js.map +1 -0
  33. package/dist/destinations/google-sheets/generated-types.d.ts +2 -0
  34. package/dist/destinations/google-sheets/generated-types.js +3 -0
  35. package/dist/destinations/google-sheets/generated-types.js.map +1 -0
  36. package/dist/destinations/google-sheets/googleapis/index.d.ts +17 -0
  37. package/dist/destinations/google-sheets/googleapis/index.js +34 -0
  38. package/dist/destinations/google-sheets/googleapis/index.js.map +1 -0
  39. package/dist/destinations/google-sheets/index.d.ts +4 -0
  40. package/dist/destinations/google-sheets/index.js +27 -0
  41. package/dist/destinations/google-sheets/index.js.map +1 -0
  42. package/dist/destinations/google-sheets/postSheet/generated-types.d.ts +10 -0
  43. package/dist/destinations/google-sheets/postSheet/generated-types.js +3 -0
  44. package/dist/destinations/google-sheets/postSheet/generated-types.js.map +1 -0
  45. package/dist/destinations/google-sheets/postSheet/index.d.ts +5 -0
  46. package/dist/destinations/google-sheets/postSheet/index.js +71 -0
  47. package/dist/destinations/google-sheets/postSheet/index.js.map +1 -0
  48. package/dist/destinations/google-sheets/postSheet/operations.d.ts +10 -0
  49. package/dist/destinations/google-sheets/postSheet/operations.js +96 -0
  50. package/dist/destinations/google-sheets/postSheet/operations.js.map +1 -0
  51. package/dist/destinations/personas-messaging-sendgrid/generated-types.d.ts +8 -0
  52. package/dist/destinations/personas-messaging-sendgrid/generated-types.js +3 -0
  53. package/dist/destinations/personas-messaging-sendgrid/generated-types.js.map +1 -0
  54. package/dist/destinations/personas-messaging-sendgrid/index.d.ts +4 -0
  55. package/dist/destinations/personas-messaging-sendgrid/index.js +59 -0
  56. package/dist/destinations/personas-messaging-sendgrid/index.js.map +1 -0
  57. package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.d.ts +26 -0
  58. package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.js +3 -0
  59. package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.js.map +1 -0
  60. package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.d.ts +5 -0
  61. package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js +310 -0
  62. package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js.map +1 -0
  63. package/dist/destinations/personas-messaging-twilio/generated-types.d.ts +11 -0
  64. package/dist/destinations/personas-messaging-twilio/generated-types.js +3 -0
  65. package/dist/destinations/personas-messaging-twilio/generated-types.js.map +1 -0
  66. package/dist/destinations/personas-messaging-twilio/index.d.ts +4 -0
  67. package/dist/destinations/personas-messaging-twilio/index.js +150 -0
  68. package/dist/destinations/personas-messaging-twilio/index.js.map +1 -0
  69. package/dist/destinations/personas-messaging-twilio/sendSms/generated-types.d.ts +16 -0
  70. package/dist/destinations/personas-messaging-twilio/sendSms/generated-types.js +3 -0
  71. package/dist/destinations/personas-messaging-twilio/sendSms/generated-types.js.map +1 -0
  72. package/dist/destinations/personas-messaging-twilio/sendSms/index.d.ts +5 -0
  73. package/dist/destinations/personas-messaging-twilio/sendSms/index.js +166 -0
  74. package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -0
  75. package/dist/destinations/salesforce/sf-operations.d.ts +1 -0
  76. package/dist/destinations/salesforce/sf-operations.js +13 -1
  77. package/dist/destinations/salesforce/sf-operations.js.map +1 -1
  78. package/dist/destinations/snap-conversions-api/index.js +1 -1
  79. package/package.json +10 -5
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-twilio/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,150 @@
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 sendSms_1 = __importDefault(require("./sendSms"));
7
+ const getRange = (val) => {
8
+ return Array(val)
9
+ .fill(1)
10
+ .map((x, y) => ({ value: x + y, label: `${x + y}` }));
11
+ };
12
+ const ConnectionOverridesProperties = {
13
+ ct: {
14
+ label: 'Connection timeout',
15
+ description: 'The timeout in milliseconds Twilio will wait to establish its TCP connection to your webserver',
16
+ type: 'number',
17
+ default: 5000,
18
+ choices: getRange(10000)
19
+ },
20
+ rt: {
21
+ label: 'Read timeout',
22
+ description: 'The amount of time in milliseconds after sending your webhook an HTTP request that Twilio will wait for the initial HTTP response packet',
23
+ type: 'number',
24
+ default: 15000,
25
+ choices: getRange(15000)
26
+ },
27
+ tt: {
28
+ label: 'Total timeout',
29
+ description: 'The total time allowed for all timeouts including retries',
30
+ type: 'number',
31
+ default: 15000,
32
+ choices: getRange(15000)
33
+ },
34
+ rc: {
35
+ label: 'Retry count',
36
+ description: 'The number of retry attempts Twilio will make if its connection to your webhook fails',
37
+ type: 'number',
38
+ default: 1,
39
+ choices: getRange(5)
40
+ },
41
+ rp: {
42
+ label: 'Retry policy',
43
+ description: 'The type of failure to retry on',
44
+ type: 'string',
45
+ default: 'ct',
46
+ choices: ['ct', '4xx', '5xx', 'rt', 'all']
47
+ },
48
+ sni: {
49
+ label: 'SNI',
50
+ description: 'The type of failure to retry on',
51
+ type: 'string',
52
+ default: 'unset',
53
+ choices: ['y', 'n', 'unser']
54
+ },
55
+ e: {
56
+ label: 'Edge location',
57
+ description: 'The Twilio edge location where webhooks egress. This can be a list and we rotate through the list as retries happen.',
58
+ type: 'string',
59
+ default: 'ashburn',
60
+ choices: [
61
+ 'ashburn',
62
+ 'ashburn-ix',
63
+ 'dublin',
64
+ 'frankfurt',
65
+ 'frankfurt-ix',
66
+ 'sao-paulo',
67
+ 'singapore',
68
+ 'sydney',
69
+ 'tokyo',
70
+ 'umatilla',
71
+ 'london-ix',
72
+ 'san-jose-ix',
73
+ 'singapore-ix'
74
+ ]
75
+ }
76
+ };
77
+ const destination = {
78
+ name: 'Personas Messaging Twilio (Actions)',
79
+ mode: 'cloud',
80
+ authentication: {
81
+ scheme: 'custom',
82
+ fields: {
83
+ twilioAccountSID: {
84
+ label: 'Twilio Account SID',
85
+ description: 'Twilio Account SID',
86
+ type: 'string',
87
+ required: true
88
+ },
89
+ twilioApiKeySID: {
90
+ label: 'Twilio API Key SID',
91
+ description: 'Twilio API Key SID',
92
+ type: 'string',
93
+ required: true
94
+ },
95
+ twilioApiKeySecret: {
96
+ label: 'Twilio API Key Secret',
97
+ description: 'Twilio API Key Secret',
98
+ type: 'password',
99
+ required: true
100
+ },
101
+ profileApiEnvironment: {
102
+ label: 'Profile API Environment',
103
+ description: 'Profile API Environment',
104
+ type: 'string',
105
+ required: true
106
+ },
107
+ profileApiAccessToken: {
108
+ label: 'Profile API Access Token',
109
+ description: 'Profile API Access Token',
110
+ type: 'password',
111
+ required: true
112
+ },
113
+ spaceId: {
114
+ label: 'Space ID',
115
+ description: 'Space ID',
116
+ type: 'string',
117
+ required: true
118
+ },
119
+ sourceId: {
120
+ label: 'Source ID',
121
+ description: 'Source ID',
122
+ type: 'string',
123
+ required: true
124
+ },
125
+ webhookUrl: {
126
+ label: 'Webhook URL',
127
+ description: 'Webhook URL that will receive all events for the sent message',
128
+ type: 'string',
129
+ format: 'uri',
130
+ required: false
131
+ },
132
+ connectionOverrides: {
133
+ label: 'Connection Overrides',
134
+ description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
135
+ type: 'string',
136
+ required: false,
137
+ default: 'rp=all&rc=5',
138
+ properties: ConnectionOverridesProperties
139
+ }
140
+ },
141
+ testAuthentication: (request) => {
142
+ return request('https://api.twilio.com/2010-04-01');
143
+ }
144
+ },
145
+ actions: {
146
+ sendSms: sendSms_1.default
147
+ }
148
+ };
149
+ exports.default = destination;
150
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/personas-messaging-twilio/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA+B;AAE/B,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAsC,EAAE;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC;SACd,IAAI,CAAC,CAAC,CAAC;SACP,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACzD,CAAC,CAAA;AAED,MAAM,6BAA6B,GAA+B;IAChE,EAAE,EAAE;QACF,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,gGAAgG;QAC7G,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,0IAA0I;QAC5I,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,2DAA2D;QACxE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KACzB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,uFAAuF;QACpG,IAAI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E,uBAAuB;gBACpC,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,yBAAyB;gBAChC,WAAW,EAAE,yBAAyB;gBACtC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,qBAAqB,EAAE;gBACrB,KAAK,EAAE,0BAA0B;gBACjC,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,+DAA+D;gBAC5E,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,KAAK;aAChB;YACD,mBAAmB,EAAE;gBACnB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EACT,8HAA8H;gBAChI,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,aAAa;gBACtB,UAAU,EAAE,6BAA6B;aAC1C;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,mCAAmC,CAAC,CAAA;QACrD,CAAC;KACF;IASD,OAAO,EAAE;QACP,OAAO,EAAP,iBAAO;KACR;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,16 @@
1
+ export interface Payload {
2
+ userId: string;
3
+ toNumber?: string;
4
+ from: string;
5
+ body: string;
6
+ customArgs?: {
7
+ [k: string]: unknown;
8
+ };
9
+ connectionOverrides?: string;
10
+ send?: boolean;
11
+ externalIds?: {
12
+ id?: string;
13
+ type?: string;
14
+ subscriptionStatus?: string;
15
+ }[];
16
+ }
@@ -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/personas-messaging-twilio/sendSms/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,166 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const liquidjs_1 = require("liquidjs");
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ const Liquid = new liquidjs_1.Liquid();
6
+ const getProfileApiEndpoint = (environment) => {
7
+ return `https://profiles.segment.${environment === 'production' ? 'com' : 'build'}`;
8
+ };
9
+ const fetchProfileTraits = async (request, settings, profileId) => {
10
+ const endpoint = getProfileApiEndpoint(settings.profileApiEnvironment);
11
+ const response = await request(`${endpoint}/v1/spaces/${settings.spaceId}/collections/users/profiles/user_id:${profileId}/traits?limit=200`, {
12
+ headers: {
13
+ authorization: `Basic ${Buffer.from(settings.profileApiAccessToken + ':').toString('base64')}`,
14
+ 'content-type': 'application/json'
15
+ }
16
+ });
17
+ const body = await response.json();
18
+ return body.traits;
19
+ };
20
+ const EXTERNAL_ID_KEY = 'phone';
21
+ const DEFAULT_CONNECTION_OVERRIDES = 'rp=all&rc=5';
22
+ const action = {
23
+ title: 'Send SMS',
24
+ description: 'Send SMS using Twilio',
25
+ defaultSubscription: 'type = "track" and event = "Audience Entered"',
26
+ fields: {
27
+ userId: {
28
+ label: 'User ID',
29
+ description: 'User ID in Segment',
30
+ type: 'string',
31
+ required: true,
32
+ default: { '@path': '$.userId' }
33
+ },
34
+ toNumber: {
35
+ label: 'Test Number',
36
+ description: 'Number to send SMS to when testing',
37
+ type: 'string'
38
+ },
39
+ from: {
40
+ label: 'From',
41
+ description: 'The Twilio Phone Number, Short Code, or Messaging Service to send SMS from.',
42
+ type: 'string',
43
+ required: true
44
+ },
45
+ body: {
46
+ label: 'Message',
47
+ description: 'Message to send',
48
+ type: 'text',
49
+ required: true
50
+ },
51
+ customArgs: {
52
+ label: 'Custom Arguments',
53
+ description: 'Additional custom arguments that will be opaquely sent back on webhook events',
54
+ type: 'object',
55
+ required: false
56
+ },
57
+ connectionOverrides: {
58
+ label: 'Connection Overrides',
59
+ description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
60
+ type: 'string',
61
+ required: false
62
+ },
63
+ send: {
64
+ label: 'Send Message',
65
+ description: 'Whether or not the message should actually get sent.',
66
+ type: 'boolean',
67
+ required: false,
68
+ default: false
69
+ },
70
+ externalIds: {
71
+ label: 'External IDs',
72
+ description: 'An array of user profile identity information.',
73
+ type: 'object',
74
+ multiple: true,
75
+ properties: {
76
+ id: {
77
+ label: 'ID',
78
+ description: 'A unique identifier for the collection.',
79
+ type: 'string'
80
+ },
81
+ type: {
82
+ label: 'type',
83
+ description: 'The external ID contact type.',
84
+ type: 'string'
85
+ },
86
+ subscriptionStatus: {
87
+ label: 'ID',
88
+ description: 'The subscription status for the identity.',
89
+ type: 'string'
90
+ }
91
+ },
92
+ default: {
93
+ '@arrayPath': [
94
+ '$.external_ids',
95
+ {
96
+ id: {
97
+ '@path': '$.id'
98
+ },
99
+ type: {
100
+ '@path': '$.type'
101
+ },
102
+ subscriptionStatus: {
103
+ '@path': '$.isSubscribed'
104
+ }
105
+ }
106
+ ]
107
+ }
108
+ }
109
+ },
110
+ perform: async (request, { settings, payload }) => {
111
+ if (!payload.send) {
112
+ return;
113
+ }
114
+ const externalId = payload.externalIds?.find(({ type }) => type === 'phone');
115
+ if (!externalId?.subscriptionStatus ||
116
+ ['unsubscribed', 'did not subscribed', 'false'].includes(externalId.subscriptionStatus)) {
117
+ return;
118
+ }
119
+ else if (['subscribed', 'true'].includes(externalId.subscriptionStatus)) {
120
+ const traits = await fetchProfileTraits(request, settings, payload.userId);
121
+ const phone = payload.toNumber || externalId.id;
122
+ if (!phone) {
123
+ return;
124
+ }
125
+ const profile = {
126
+ user_id: payload.userId,
127
+ phone,
128
+ traits
129
+ };
130
+ const token = Buffer.from(`${settings.twilioApiKeySID}:${settings.twilioApiKeySecret}`).toString('base64');
131
+ const parsedBody = await Liquid.parseAndRender(payload.body, { profile });
132
+ const body = new URLSearchParams({
133
+ Body: parsedBody,
134
+ From: payload.from,
135
+ To: phone
136
+ });
137
+ const webhookUrl = settings.webhookUrl;
138
+ const connectionOverrides = settings.connectionOverrides;
139
+ const customArgs = {
140
+ ...payload.customArgs,
141
+ __segment_internal_external_id_key__: EXTERNAL_ID_KEY,
142
+ __segment_internal_external_id_value__: phone
143
+ };
144
+ if (webhookUrl && customArgs) {
145
+ const webhookUrlWithParams = new URL(webhookUrl);
146
+ for (const key of Object.keys(customArgs)) {
147
+ webhookUrlWithParams.searchParams.append(key, String(customArgs[key]));
148
+ }
149
+ webhookUrlWithParams.hash = connectionOverrides || DEFAULT_CONNECTION_OVERRIDES;
150
+ body.append('StatusCallback', webhookUrlWithParams.toString());
151
+ }
152
+ return request(`https://api.twilio.com/2010-04-01/Accounts/${settings.twilioAccountSID}/Messages.json`, {
153
+ method: 'POST',
154
+ headers: {
155
+ authorization: `Basic ${token}`
156
+ },
157
+ body
158
+ });
159
+ }
160
+ else {
161
+ throw new actions_core_1.IntegrationError(`Failed to recognize the subscriptionStatus in the payload: "${externalId.subscriptionStatus}".`, 'Invalid subscriptionStatus value', 400);
162
+ }
163
+ }
164
+ };
165
+ exports.default = action;
166
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations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MAAM,CAAA"}
@@ -16,6 +16,7 @@ export default class Salesforce {
16
16
  private buildJSONData;
17
17
  private escapeQuotes;
18
18
  private removeInvalidChars;
19
+ private typecast;
19
20
  private buildQuery;
20
21
  private lookupTraits;
21
22
  }
@@ -104,12 +104,24 @@ class Salesforce {
104
104
  };
105
105
  this.escapeQuotes = (value) => value.replace(/'/g, "\\'");
106
106
  this.removeInvalidChars = (value) => value.replace(/[^a-zA-Z0-9_]/g, '');
107
+ this.typecast = (value) => {
108
+ switch (typeof value) {
109
+ case 'boolean':
110
+ return value;
111
+ case 'number':
112
+ return value;
113
+ case 'string':
114
+ return `'${this.escapeQuotes(value)}'`;
115
+ default:
116
+ throw new actions_core_1.IntegrationError('Unsupported datatype for record matcher traits - ' + typeof value, 'Unsupported Type', 400);
117
+ }
118
+ };
107
119
  this.buildQuery = (traits, sobject) => {
108
120
  let soql = `SELECT Id FROM ${sobject} WHERE `;
109
121
  const entries = Object.entries(traits);
110
122
  let i = 0;
111
123
  for (const [key, value] of entries) {
112
- let token = `${this.removeInvalidChars(key)} = '${this.escapeQuotes(value)}'`;
124
+ let token = `${this.removeInvalidChars(key)} = ${this.typecast(value)}`;
113
125
  if (i < entries.length - 1) {
114
126
  token += ' OR ';
115
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sf-operations.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-operations.ts"],"names":[],"mappings":";;;AAAA,wDAAuE;AAEvE,6DAAuD;AACvD,yCAAyC;AAE5B,QAAA,WAAW,GAAG,OAAO,CAAA;AAgBlC,MAAqB,UAAU;IAI7B,YAAY,WAAmB,EAAE,OAAsB;QAOvD,iBAAY,GAAG,KAAK,EAAE,OAAuB,EAAE,OAAe,EAAE,EAAE;YAChE,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,iBAAiB,mBAAW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,EAAE,EAAE,IAAI,+BAAgB,CAAC,kCAAkC,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC,CAAA;aAC3F;YAED,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;QAC5C,CAAC,CAAA;QAzMC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAC/E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAwMF;AAjND,6BAiNC"}
@@ -138,7 +138,7 @@ const presets = [
138
138
  }
139
139
  ];
140
140
  const destination = {
141
- name: 'Snap Conversions API',
141
+ name: 'Snap Conversions Api',
142
142
  slug: 'actions-snap-conversions',
143
143
  mode: 'cloud',
144
144
  authentication: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@segment/action-destinations",
3
3
  "description": "Destination Actions engine and definitions.",
4
- "version": "3.74.1-alpha.1",
4
+ "version": "3.74.1-alpha.12",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -27,7 +27,7 @@
27
27
  "clean": "tsc -b tsconfig.build.json --clean",
28
28
  "postclean": "rm -rf dist",
29
29
  "prepublishOnly": "yarn build",
30
- "test": "jest",
30
+ "test": "jest --coverage",
31
31
  "typecheck": "tsc -p tsconfig.build.json --noEmit"
32
32
  },
33
33
  "devDependencies": {
@@ -37,8 +37,9 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@amplitude/ua-parser-js": "^0.7.25",
40
- "@segment/actions-core": "^3.24.0",
41
- "@segment/actions-shared": "^1.7.0",
40
+ "@segment/a1-notation": "^2.1.4",
41
+ "@segment/actions-core": "^3.24.1-alpha.12",
42
+ "@segment/actions-shared": "^1.7.1-alpha.12",
42
43
  "cheerio": "^1.0.0-rc.10",
43
44
  "dayjs": "^1.10.7",
44
45
  "escape-goat": "^3",
@@ -59,7 +60,11 @@
59
60
  },
60
61
  "setupFilesAfterEnv": [
61
62
  "<rootDir>/test/setup-after-env.ts"
63
+ ],
64
+ "coverageReporters": [
65
+ "html",
66
+ "lcov"
62
67
  ]
63
68
  },
64
- "gitHead": "1f2e6fc8b731590db779dacac71c7f8748a59a54"
69
+ "gitHead": "899e8ab1065b6b8689a720886d1d4210c7cc6548"
65
70
  }