@segment/action-destinations 3.345.7-staging → 3.345.7-staging-1461904fc.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 (163) hide show
  1. package/dist/destinations/salesforce-marketing-cloud/_tests_/multistatus.test.d.ts +1 -0
  2. package/dist/destinations/salesforce-marketing-cloud/_tests_/multistatus.test.js +325 -0
  3. package/dist/destinations/salesforce-marketing-cloud/_tests_/multistatus.test.js.map +1 -0
  4. package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/index.js +1 -17
  5. package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/index.js.map +1 -1
  6. package/dist/destinations/salesforce-marketing-cloud/dataExtension/index.js +1 -17
  7. package/dist/destinations/salesforce-marketing-cloud/dataExtension/index.js.map +1 -1
  8. package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.d.ts +2 -2
  9. package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.js +45 -7
  10. package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.js.map +1 -1
  11. package/dist/destinations/salesforce-marketing-cloud/types.d.ts +19 -0
  12. package/dist/destinations/salesforce-marketing-cloud/types.js.map +1 -0
  13. package/package.json +2 -2
  14. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.d.ts +0 -5
  15. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js +0 -3
  16. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js.map +0 -1
  17. package/dist/destinations/accoil-analytics/postToAccoil/index.d.ts +0 -5
  18. package/dist/destinations/accoil-analytics/postToAccoil/index.js +0 -28
  19. package/dist/destinations/accoil-analytics/postToAccoil/index.js.map +0 -1
  20. package/dist/destinations/braze/createAliasV2.types.d.ts +0 -5
  21. package/dist/destinations/braze/createAliasV2.types.js +0 -3
  22. package/dist/destinations/braze/createAliasV2.types.js.map +0 -1
  23. package/dist/destinations/braze/identifyUserV2.types.d.ts +0 -8
  24. package/dist/destinations/braze/identifyUserV2.types.js +0 -3
  25. package/dist/destinations/braze/identifyUserV2.types.js.map +0 -1
  26. package/dist/destinations/campaign-manager-360/common-fields.d.ts +0 -3
  27. package/dist/destinations/campaign-manager-360/common-fields.js +0 -306
  28. package/dist/destinations/campaign-manager-360/common-fields.js.map +0 -1
  29. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.d.ts +0 -45
  30. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js +0 -3
  31. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js.map +0 -1
  32. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.d.ts +0 -5
  33. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js +0 -86
  34. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js.map +0 -1
  35. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.d.ts +0 -50
  36. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js +0 -3
  37. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js.map +0 -1
  38. package/dist/destinations/campaign-manager-360/conversionUpload/index.d.ts +0 -5
  39. package/dist/destinations/campaign-manager-360/conversionUpload/index.js +0 -131
  40. package/dist/destinations/campaign-manager-360/conversionUpload/index.js.map +0 -1
  41. package/dist/destinations/campaign-manager-360/generated-types.d.ts +0 -5
  42. package/dist/destinations/campaign-manager-360/generated-types.js +0 -3
  43. package/dist/destinations/campaign-manager-360/generated-types.js.map +0 -1
  44. package/dist/destinations/campaign-manager-360/index.d.ts +0 -4
  45. package/dist/destinations/campaign-manager-360/index.js +0 -63
  46. package/dist/destinations/campaign-manager-360/index.js.map +0 -1
  47. package/dist/destinations/campaign-manager-360/types.d.ts +0 -116
  48. package/dist/destinations/campaign-manager-360/types.js +0 -23
  49. package/dist/destinations/campaign-manager-360/types.js.map +0 -1
  50. package/dist/destinations/campaign-manager-360/utils.d.ts +0 -21
  51. package/dist/destinations/campaign-manager-360/utils.js +0 -175
  52. package/dist/destinations/campaign-manager-360/utils.js.map +0 -1
  53. package/dist/destinations/first-party-dv360/addToList/generated-types.d.ts +0 -2
  54. package/dist/destinations/first-party-dv360/addToList/generated-types.js +0 -3
  55. package/dist/destinations/first-party-dv360/addToList/generated-types.js.map +0 -1
  56. package/dist/destinations/first-party-dv360/addToList/index.d.ts +0 -5
  57. package/dist/destinations/first-party-dv360/addToList/index.js +0 -11
  58. package/dist/destinations/first-party-dv360/addToList/index.js.map +0 -1
  59. package/dist/destinations/first-party-dv360/addToList.types.d.ts +0 -9
  60. package/dist/destinations/first-party-dv360/addToList.types.js +0 -3
  61. package/dist/destinations/first-party-dv360/addToList.types.js.map +0 -1
  62. package/dist/destinations/hubspot/customEvent/dynamic-fields.d.ts +0 -5
  63. package/dist/destinations/hubspot/customEvent/dynamic-fields.js +0 -112
  64. package/dist/destinations/hubspot/customEvent/dynamic-fields.js.map +0 -1
  65. package/dist/destinations/hubspot/customEvent/event-completion.d.ts +0 -3
  66. package/dist/destinations/hubspot/customEvent/event-completion.js +0 -17
  67. package/dist/destinations/hubspot/customEvent/event-completion.js.map +0 -1
  68. package/dist/destinations/hubspot/customEvent/schema-functions.d.ts +0 -3
  69. package/dist/destinations/hubspot/customEvent/schema-functions.js +0 -30
  70. package/dist/destinations/hubspot/customEvent/schema-functions.js.map +0 -1
  71. package/dist/destinations/hubspot/customEvent/utils.d.ts +0 -14
  72. package/dist/destinations/hubspot/customEvent/utils.js +0 -303
  73. package/dist/destinations/hubspot/customEvent/utils.js.map +0 -1
  74. package/dist/destinations/hubspot/customEvent/validation-functions.d.ts +0 -3
  75. package/dist/destinations/hubspot/customEvent/validation-functions.js +0 -66
  76. package/dist/destinations/hubspot/customEvent/validation-functions.js.map +0 -1
  77. package/dist/destinations/hubspot/customEvent/validation.d.ts +0 -3
  78. package/dist/destinations/hubspot/customEvent/validation.js +0 -66
  79. package/dist/destinations/hubspot/customEvent/validation.js.map +0 -1
  80. package/dist/destinations/hubspot/upsertObject/association-functions.d.ts +0 -5
  81. package/dist/destinations/hubspot/upsertObject/association-functions.js +0 -136
  82. package/dist/destinations/hubspot/upsertObject/association-functions.js.map +0 -1
  83. package/dist/destinations/hubspot/upsertObject/cache-functions.d.ts +0 -3
  84. package/dist/destinations/hubspot/upsertObject/cache-functions.js +0 -20
  85. package/dist/destinations/hubspot/upsertObject/cache-functions.js.map +0 -1
  86. package/dist/destinations/hubspot/upsertObject/dynamic-fields.d.ts +0 -7
  87. package/dist/destinations/hubspot/upsertObject/dynamic-fields.js +0 -222
  88. package/dist/destinations/hubspot/upsertObject/dynamic-fields.js.map +0 -1
  89. package/dist/destinations/hubspot/upsertObject/hubspot-association-functions.d.ts +0 -5
  90. package/dist/destinations/hubspot/upsertObject/hubspot-association-functions.js +0 -136
  91. package/dist/destinations/hubspot/upsertObject/hubspot-association-functions.js.map +0 -1
  92. package/dist/destinations/hubspot/upsertObject/hubspot-properties-functions.d.ts +0 -4
  93. package/dist/destinations/hubspot/upsertObject/hubspot-properties-functions.js +0 -159
  94. package/dist/destinations/hubspot/upsertObject/hubspot-properties-functions.js.map +0 -1
  95. package/dist/destinations/hubspot/upsertObject/hubspot-record-functions.d.ts +0 -4
  96. package/dist/destinations/hubspot/upsertObject/hubspot-record-functions.js +0 -100
  97. package/dist/destinations/hubspot/upsertObject/hubspot-record-functions.js.map +0 -1
  98. package/dist/destinations/hubspot/upsertObject/schema-functions.d.ts +0 -3
  99. package/dist/destinations/hubspot/upsertObject/schema-functions.js +0 -80
  100. package/dist/destinations/hubspot/upsertObject/schema-functions.js.map +0 -1
  101. package/dist/destinations/hubspot/upsertObject/send-from-record-functions.d.ts +0 -4
  102. package/dist/destinations/hubspot/upsertObject/send-from-record-functions.js +0 -100
  103. package/dist/destinations/hubspot/upsertObject/send-from-record-functions.js.map +0 -1
  104. package/dist/destinations/hubspot/upsertObject/utils.d.ts +0 -13
  105. package/dist/destinations/hubspot/upsertObject/utils.js +0 -547
  106. package/dist/destinations/hubspot/upsertObject/utils.js.map +0 -1
  107. package/dist/destinations/hubspot/upsertObject/validation-functions.d.ts +0 -2
  108. package/dist/destinations/hubspot/upsertObject/validation-functions.js +0 -67
  109. package/dist/destinations/hubspot/upsertObject/validation-functions.js.map +0 -1
  110. package/dist/destinations/responsys/shared_properties.d.ts +0 -3
  111. package/dist/destinations/responsys/shared_properties.js +0 -19
  112. package/dist/destinations/responsys/shared_properties.js.map +0 -1
  113. package/dist/destinations/s3/syncAudienceToS3/generated-types.d.ts +0 -53
  114. package/dist/destinations/s3/syncAudienceToS3/generated-types.js +0 -3
  115. package/dist/destinations/s3/syncAudienceToS3/generated-types.js.map +0 -1
  116. package/dist/destinations/s3/syncAudienceToS3/index.d.ts +0 -5
  117. package/dist/destinations/s3/syncAudienceToS3/index.js +0 -22
  118. package/dist/destinations/s3/syncAudienceToS3/index.js.map +0 -1
  119. package/dist/destinations/s3/syncEventsToS3/generated-types.d.ts +0 -44
  120. package/dist/destinations/s3/syncEventsToS3/generated-types.js +0 -3
  121. package/dist/destinations/s3/syncEventsToS3/generated-types.js.map +0 -1
  122. package/dist/destinations/s3/syncEventsToS3/index.d.ts +0 -5
  123. package/dist/destinations/s3/syncEventsToS3/index.js +0 -19
  124. package/dist/destinations/s3/syncEventsToS3/index.js.map +0 -1
  125. package/dist/destinations/s3/syncToS3.types.d.ts +0 -44
  126. package/dist/destinations/s3/syncToS3.types.js +0 -3
  127. package/dist/destinations/s3/syncToS3.types.js.map +0 -1
  128. package/dist/destinations/singlestore/sendData/generated-types.d.ts +0 -2
  129. package/dist/destinations/singlestore/sendData/generated-types.js +0 -3
  130. package/dist/destinations/singlestore/sendData/generated-types.js.map +0 -1
  131. package/dist/destinations/singlestore/sendData/index.d.ts +0 -5
  132. package/dist/destinations/singlestore/sendData/index.js +0 -65
  133. package/dist/destinations/singlestore/sendData/index.js.map +0 -1
  134. package/dist/destinations/singlestore/utils.d.ts +0 -0
  135. package/dist/destinations/singlestore/utils.js +0 -2
  136. package/dist/destinations/singlestore/utils.js.map +0 -1
  137. package/dist/destinations/twilio-messaging/generated-types.d.ts +0 -6
  138. package/dist/destinations/twilio-messaging/generated-types.js +0 -3
  139. package/dist/destinations/twilio-messaging/generated-types.js.map +0 -1
  140. package/dist/destinations/twilio-messaging/index.d.ts +0 -4
  141. package/dist/destinations/twilio-messaging/index.js +0 -61
  142. package/dist/destinations/twilio-messaging/index.js.map +0 -1
  143. package/dist/destinations/twilio-messaging/sendMessage/constants.d.ts +0 -45
  144. package/dist/destinations/twilio-messaging/sendMessage/constants.js +0 -99
  145. package/dist/destinations/twilio-messaging/sendMessage/constants.js.map +0 -1
  146. package/dist/destinations/twilio-messaging/sendMessage/dynamic-fields.d.ts +0 -11
  147. package/dist/destinations/twilio-messaging/sendMessage/dynamic-fields.js +0 -209
  148. package/dist/destinations/twilio-messaging/sendMessage/dynamic-fields.js.map +0 -1
  149. package/dist/destinations/twilio-messaging/sendMessage/fields.d.ts +0 -2
  150. package/dist/destinations/twilio-messaging/sendMessage/fields.js +0 -261
  151. package/dist/destinations/twilio-messaging/sendMessage/fields.js.map +0 -1
  152. package/dist/destinations/twilio-messaging/sendMessage/generated-types.d.ts +0 -24
  153. package/dist/destinations/twilio-messaging/sendMessage/generated-types.js +0 -3
  154. package/dist/destinations/twilio-messaging/sendMessage/generated-types.js.map +0 -1
  155. package/dist/destinations/twilio-messaging/sendMessage/index.d.ts +0 -5
  156. package/dist/destinations/twilio-messaging/sendMessage/index.js +0 -42
  157. package/dist/destinations/twilio-messaging/sendMessage/index.js.map +0 -1
  158. package/dist/destinations/twilio-messaging/sendMessage/types.d.ts +0 -34
  159. package/dist/destinations/twilio-messaging/sendMessage/types.js.map +0 -1
  160. package/dist/destinations/twilio-messaging/sendMessage/utils.d.ts +0 -6
  161. package/dist/destinations/twilio-messaging/sendMessage/utils.js +0 -154
  162. package/dist/destinations/twilio-messaging/sendMessage/utils.js.map +0 -1
  163. /package/dist/destinations/{twilio-messaging/sendMessage → salesforce-marketing-cloud}/types.js +0 -0
@@ -1,209 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dynamicContentVariables = exports.dynamicMediaUrls = exports.dynamicContentSid = exports.dynamicContentTemplateType = exports.dynamicMessagingServiceSid = exports.dynamicFromPhoneNumber = exports.dynamicSenderType = void 0;
4
- const constants_1 = require("./constants");
5
- const utils_1 = require("./utils");
6
- function isErrorResponse(response) {
7
- return response.error !== undefined;
8
- }
9
- function createErrorResponse(message, code) {
10
- return {
11
- choices: [],
12
- error: { message: message ?? 'Unknown error', code: code ?? '404' }
13
- };
14
- }
15
- async function getData(request, url) {
16
- try {
17
- const response = await request(url, {
18
- method: 'GET',
19
- skipResponseCloning: true
20
- });
21
- return response;
22
- }
23
- catch (err) {
24
- const error = err;
25
- return createErrorResponse(error.response.data.message, String(error.response.data.status));
26
- }
27
- }
28
- async function dynamicSenderType(payload) {
29
- const { channel } = payload;
30
- if (!channel) {
31
- return createErrorResponse("Select from 'Channel' field first.");
32
- }
33
- if (channel === constants_1.CHANNELS.MESSENGER) {
34
- return {
35
- choices: [
36
- { label: constants_1.SENDER_TYPE.MESSENGER_SENDER_ID, value: constants_1.SENDER_TYPE.MESSENGER_SENDER_ID },
37
- { label: constants_1.SENDER_TYPE.MESSAGING_SERVICE, value: constants_1.SENDER_TYPE.MESSAGING_SERVICE }
38
- ]
39
- };
40
- }
41
- else {
42
- return {
43
- choices: [
44
- { label: constants_1.SENDER_TYPE.PHONE_NUMBER, value: constants_1.SENDER_TYPE.PHONE_NUMBER },
45
- { label: constants_1.SENDER_TYPE.MESSAGING_SERVICE, value: constants_1.SENDER_TYPE.MESSAGING_SERVICE }
46
- ]
47
- };
48
- }
49
- }
50
- exports.dynamicSenderType = dynamicSenderType;
51
- async function dynamicFromPhoneNumber(request, payload, settings) {
52
- const { channel } = payload;
53
- const numbers = [];
54
- const supportsShortCodes = channel === constants_1.CHANNELS.SMS || channel === constants_1.CHANNELS.MMS;
55
- if (channel === constants_1.CHANNELS.MESSENGER) {
56
- return createErrorResponse("Use 'From Messenger Sender ID' field for specifying the sender ID.");
57
- }
58
- if (supportsShortCodes) {
59
- const shortCodeResp = await getData(request, constants_1.GET_INCOMING_SHORT_CODES_URL.replace(constants_1.ACCOUNT_SID_TOKEN, settings.accountSID));
60
- if (isErrorResponse(shortCodeResp)) {
61
- return shortCodeResp;
62
- }
63
- const shortCodes = (shortCodeResp.data?.short_codes
64
- .filter((s) => (channel === constants_1.CHANNELS.MMS && s.sms_url !== null) || channel === constants_1.CHANNELS.SMS))
65
- .map((s) => s.short_code);
66
- numbers.push(...shortCodes);
67
- }
68
- const PhoneNumResp = await getData(request, constants_1.GET_INCOMING_PHONE_NUMBERS_URL.replace(constants_1.ACCOUNT_SID_TOKEN, settings.accountSID));
69
- if (isErrorResponse(PhoneNumResp)) {
70
- return PhoneNumResp;
71
- }
72
- const phoneNumbers = PhoneNumResp.data.incoming_phone_numbers
73
- .filter((n) => (channel === constants_1.CHANNELS.SMS && n.capabilities.sms) || (n.capabilities.mms && channel === constants_1.CHANNELS.MMS))
74
- .map((n) => n.phone_number);
75
- numbers.push(...phoneNumbers);
76
- numbers.sort((a, b) => a.length - b.length || a.localeCompare(b));
77
- if (numbers.length === 0) {
78
- return createErrorResponse(`No phone numbers ${supportsShortCodes ? 'or short codes' : ''} found. Please create a phone number ${supportsShortCodes ? 'or short code' : ''} in your Twilio account.`);
79
- }
80
- return {
81
- choices: numbers
82
- .map((n) => {
83
- return {
84
- label: n,
85
- value: n
86
- };
87
- })
88
- };
89
- }
90
- exports.dynamicFromPhoneNumber = dynamicFromPhoneNumber;
91
- async function dynamicMessagingServiceSid(request, settings) {
92
- const response = await getData(request, constants_1.GET_MESSAGING_SERVICE_SIDS_URL.replace(constants_1.ACCOUNT_SID_TOKEN, settings.accountSID));
93
- if (isErrorResponse(response)) {
94
- return response;
95
- }
96
- const sids = response.data.services ?? [];
97
- if (sids.length === 0) {
98
- return createErrorResponse('No Messaging Services found. Please create a Messaging Service in your Twilio account.');
99
- }
100
- return {
101
- choices: sids.map((s) => {
102
- return {
103
- label: `${s.friendly_name} [${s.sid}]`,
104
- value: `${s.friendly_name} [${s.sid}]`
105
- };
106
- })
107
- };
108
- }
109
- exports.dynamicMessagingServiceSid = dynamicMessagingServiceSid;
110
- async function dynamicContentTemplateType(payload) {
111
- const { channel } = payload;
112
- if (!channel) {
113
- return createErrorResponse("Select from 'Channel' field first.");
114
- }
115
- return await Promise.resolve({
116
- choices: Object.values({ ...constants_1.INLINE_CONTENT_TYPES, ...constants_1.PREDEFINED_CONTENT_TYPES })
117
- .filter((t) => t.supported_channels.includes(channel))
118
- .map((t) => ({
119
- label: t.friendly_name,
120
- value: t.friendly_name
121
- }))
122
- });
123
- }
124
- exports.dynamicContentTemplateType = dynamicContentTemplateType;
125
- async function dynamicContentSid(request, payload) {
126
- const { contentTemplateType } = payload;
127
- if (contentTemplateType === constants_1.INLINE_CONTENT_TYPES.INLINE.friendly_name) {
128
- return createErrorResponse("Inline messages do not use 'pre-defined' Content Templates.");
129
- }
130
- const response = await getData(request, constants_1.GET_ALL_CONTENTS_URL);
131
- if (isErrorResponse(response)) {
132
- return response;
133
- }
134
- const contents = response.data.contents ?? [];
135
- if (contents.length === 0) {
136
- return createErrorResponse('No Content Templates found. Please create a Content Template in Twilio first.');
137
- }
138
- const name = Object.values(constants_1.PREDEFINED_CONTENT_TYPES).find((type) => type.friendly_name === contentTemplateType)
139
- ?.name;
140
- return {
141
- choices: contents
142
- .filter((c) => c.types[name])
143
- .map((c) => ({
144
- label: `${c.friendly_name} [${c.sid}]`,
145
- value: `${c.friendly_name} [${c.sid}]`
146
- }))
147
- };
148
- }
149
- exports.dynamicContentSid = dynamicContentSid;
150
- async function dynamicMediaUrls(request, payload) {
151
- const { contentTemplateType, mediaUrls } = payload;
152
- const contentSid = utils_1.parseFieldValue(payload.contentSid);
153
- if (contentTemplateType === constants_1.INLINE_CONTENT_TYPES.INLINE.friendly_name) {
154
- return createErrorResponse("Use the 'Inline Media URLs' field for specifying Media URLs for an inline message.");
155
- }
156
- if ([undefined, '', null].includes(contentSid)) {
157
- return createErrorResponse("Select 'Content Template SID' first.");
158
- }
159
- if (utils_1.validateContentSid(contentSid) === false) {
160
- return createErrorResponse('Invalid Content Template SID. SID should match with the pattern HX[0-9a-fA-F]{32}');
161
- }
162
- const response = await getData(request, constants_1.GET_CONTENT_URL.replace(constants_1.CONTENT_SID_TOKEN, contentSid));
163
- if (isErrorResponse(response)) {
164
- return response;
165
- }
166
- const name = Object.values(constants_1.PREDEFINED_CONTENT_TYPES).find((type) => type.friendly_name === contentTemplateType)
167
- ?.name;
168
- const urls = response.data?.types?.[name]?.media ?? [];
169
- if (urls.length === 0) {
170
- return createErrorResponse('No Media URLs found for this Content Template. If media files are required please create them in Twilio first.');
171
- }
172
- const selectedUrls = mediaUrls?.map((m) => m.url) ?? [];
173
- const filteredUrls = urls.filter((url) => !selectedUrls.includes(url));
174
- if (filteredUrls.length === 0) {
175
- return createErrorResponse('No additional Media URLs found for this Content Template.');
176
- }
177
- return {
178
- choices: filteredUrls.map((url) => ({
179
- label: url,
180
- value: url
181
- }))
182
- };
183
- }
184
- exports.dynamicMediaUrls = dynamicMediaUrls;
185
- async function dynamicContentVariables(request, payload) {
186
- const contentSid = utils_1.parseFieldValue(payload.contentSid);
187
- if (!contentSid) {
188
- return createErrorResponse("Select from 'Content Template' field first");
189
- }
190
- const response = await getData(request, constants_1.GET_CONTENT_VARIABLES_URL.replace(constants_1.CONTENT_SID_TOKEN, contentSid));
191
- if (isErrorResponse(response)) {
192
- return response;
193
- }
194
- const types = response?.data?.types ?? {};
195
- const variables = [...JSON.stringify(types).matchAll(constants_1.TOKEN_REGEX)].map((match) => match[1]);
196
- if (variables.length === 0) {
197
- return createErrorResponse('No Variables found for the selected Content Template. If variable are required please createthem in Twilio first.');
198
- }
199
- const selectedVariables = Object.keys(payload.contentVariables ?? {}).filter((key) => key.trim() !== '');
200
- const filteredVariables = variables.filter((v) => !selectedVariables.includes(v));
201
- return {
202
- choices: filteredVariables.map((key) => ({
203
- label: key,
204
- value: key
205
- }))
206
- };
207
- }
208
- exports.dynamicContentVariables = dynamicContentVariables;
209
- //# sourceMappingURL=dynamic-fields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dynamic-fields.js","sourceRoot":"","sources":["../../../../src/destinations/twilio-messaging/sendMessage/dynamic-fields.ts"],"names":[],"mappings":";;;AAEA,2CAcoB;AAGpB,mCAA6D;AAoB7D,SAAS,eAAe,CAAC,QAAiB;IACxC,OAAQ,QAA0B,CAAC,KAAK,KAAK,SAAS,CAAA;AACxD,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAgB,EAAE,IAAa;IAC1D,OAAO;QACL,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE;KACpE,CAAA;AACH,CAAC;AAED,KAAK,UAAU,OAAO,CAAI,OAAsB,EAAE,GAAW;IAC3D,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE;YAClC,MAAM,EAAE,KAAK;YACb,mBAAmB,EAAE,IAAI;SAC1B,CAAC,CAAA;QACF,OAAO,QAAwB,CAAA;KAChC;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,KAAK,GAAG,GAAkB,CAAA;QAChC,OAAO,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;KAC5F;AACH,CAAC;AAEM,KAAK,UAAU,iBAAiB,CAAC,OAAgB;IACtD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,mBAAmB,CAAC,oCAAoC,CAAC,CAAA;KACjE;IAED,IAAG,OAAO,KAAK,oBAAQ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QAAQ,CAAC,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAE3F,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,OAAO,mBAAmB,CACxB,mHAAmH,CACpH,CAAA;KACF;IAED,MAAM,iBAAiB,GAAa,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAClH,MAAM,iBAAiB,GAAa,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAE3F,OAAO;QACL,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACvC,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,GAAG;SACX,CAAC,CAAC;KACJ,CAAA;AACH,CAAC;AAxCD,0DAwCC"}
@@ -1,2 +0,0 @@
1
- import { InputField } from '@segment/actions-core';
2
- export declare const fields: Record<string, InputField>;
@@ -1,261 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fields = void 0;
4
- const constants_1 = require("./constants");
5
- exports.fields = {
6
- channel: {
7
- label: 'Channel',
8
- description: 'The channel to send the message on.',
9
- type: 'string',
10
- required: true,
11
- choices: [
12
- { label: 'SMS', value: constants_1.CHANNELS.SMS },
13
- { label: 'MMS', value: constants_1.CHANNELS.MMS },
14
- { label: 'WhatsApp', value: constants_1.CHANNELS.WHATSAPP },
15
- { label: 'Facebook Messenger', value: constants_1.CHANNELS.MESSENGER }
16
- ],
17
- default: constants_1.CHANNELS.MMS,
18
- disabledInputMethods: ['literal', 'variable', 'function', 'freeform', 'enrichment']
19
- },
20
- senderType: {
21
- label: 'Sender Type',
22
- description: "The Sender type to use for the message. Depending on the selected 'Channel' this can be a phone number, messaging service, or Messenger sender ID.",
23
- type: 'string',
24
- required: true,
25
- dynamic: true
26
- },
27
- contentTemplateType: {
28
- label: 'Content Template Type',
29
- description: 'The Content Template type to use for the message. Selecting "Inline" will allow you to define the message body directly. For all other options a Content Template must be pre-defined in Twilio.',
30
- type: 'string',
31
- required: true,
32
- dynamic: true
33
- },
34
- toPhoneNumber: {
35
- label: 'To Phone Number',
36
- description: 'The number to send the message to (E.164 format).',
37
- type: 'string',
38
- required: false,
39
- default: undefined,
40
- depends_on: {
41
- match: 'all',
42
- conditions: [
43
- {
44
- fieldKey: 'channel',
45
- operator: 'is_not',
46
- value: constants_1.CHANNELS.MESSENGER
47
- }
48
- ]
49
- }
50
- },
51
- toMessengerPageUserId: {
52
- label: 'To Messenger Page or User ID',
53
- description: 'A valid Facebook Messenger Page Id or Messenger User Id to send the message to.',
54
- type: 'string',
55
- required: false,
56
- default: undefined,
57
- depends_on: {
58
- match: 'all',
59
- conditions: [
60
- {
61
- fieldKey: 'channel',
62
- operator: 'is',
63
- value: constants_1.CHANNELS.MESSENGER
64
- }
65
- ]
66
- }
67
- },
68
- fromPhoneNumber: {
69
- label: 'From Phone Number',
70
- description: "The Twilio phone number (E.164 format) or Short Code. If not in the dropdown, enter it directly. Please ensure the number supports the selected 'Channel' type.",
71
- type: 'string',
72
- dynamic: true,
73
- required: false,
74
- default: undefined,
75
- depends_on: {
76
- match: 'all',
77
- conditions: [
78
- {
79
- fieldKey: 'senderType',
80
- operator: 'is',
81
- value: constants_1.SENDER_TYPE.PHONE_NUMBER
82
- }
83
- ]
84
- }
85
- },
86
- fromMessengerSenderId: {
87
- label: 'From Messenger Sender ID',
88
- description: "The unique identifier for your Facebook Page, used to send messages via Messenger. You can find this in your Facebook Page settings.",
89
- type: 'string',
90
- required: false,
91
- default: undefined,
92
- depends_on: {
93
- match: 'all',
94
- conditions: [
95
- {
96
- fieldKey: 'senderType',
97
- operator: 'is',
98
- value: constants_1.SENDER_TYPE.MESSENGER_SENDER_ID
99
- }
100
- ]
101
- }
102
- },
103
- messagingServiceSid: {
104
- label: 'Messaging Service SID',
105
- description: 'The SID of the messaging service to use. If not in the dropdown, enter it directly.',
106
- type: 'string',
107
- dynamic: true,
108
- required: false,
109
- default: undefined,
110
- allowNull: false,
111
- disabledInputMethods: ['literal', 'variable', 'function', 'freeform', 'enrichment'],
112
- depends_on: {
113
- match: 'all',
114
- conditions: [
115
- {
116
- fieldKey: 'senderType',
117
- operator: 'is',
118
- value: constants_1.SENDER_TYPE.MESSAGING_SERVICE
119
- }
120
- ]
121
- }
122
- },
123
- contentSid: {
124
- label: 'Content Template SID',
125
- description: 'The SID of the Content Template to use.',
126
- type: 'string',
127
- dynamic: true,
128
- required: false,
129
- allowNull: false,
130
- disabledInputMethods: ['literal', 'variable', 'function', 'freeform', 'enrichment'],
131
- depends_on: {
132
- match: 'all',
133
- conditions: [
134
- {
135
- fieldKey: 'contentTemplateType',
136
- operator: 'is_not',
137
- value: constants_1.ALL_CONTENT_TYPES.INLINE.friendly_name
138
- }
139
- ]
140
- }
141
- },
142
- mediaUrls: {
143
- label: 'Media URLs',
144
- description: 'The URLs of the media to include with the message. The URLs should be configured in the Content Template in Twilio.',
145
- type: 'object',
146
- multiple: true,
147
- required: false,
148
- properties: {
149
- url: {
150
- label: 'URL',
151
- type: 'string',
152
- description: 'The URL of the media to include with the message.',
153
- required: true,
154
- dynamic: true,
155
- allowNull: false,
156
- disabledInputMethods: ['literal', 'variable', 'function', 'freeform', 'enrichment']
157
- }
158
- },
159
- depends_on: {
160
- match: 'all',
161
- conditions: [
162
- {
163
- fieldKey: 'contentTemplateType',
164
- operator: 'is',
165
- value: constants_1.CONTENT_TYPE_FRIENDLY_NAMES_SUPPORTING_MEDIA
166
- }
167
- ]
168
- }
169
- },
170
- contentVariables: {
171
- label: 'Content Variables',
172
- description: 'Variables to be used in the Content Template. The Variables must be defined in the Content Template in Twilio.',
173
- type: 'object',
174
- dynamic: true,
175
- required: false,
176
- defaultObjectUI: 'keyvalue',
177
- additionalProperties: true,
178
- depends_on: {
179
- match: 'all',
180
- conditions: [
181
- {
182
- fieldKey: 'contentTemplateType',
183
- operator: 'is_not',
184
- value: constants_1.ALL_CONTENT_TYPES.INLINE.friendly_name
185
- }
186
- ]
187
- }
188
- },
189
- inlineBody: {
190
- label: 'Inline Template',
191
- description: 'Define an inline message body to be sent. Variables values can be referenced using {{variable}} format. e.g. Hello {{first_name}}!.',
192
- type: 'text',
193
- format: 'text',
194
- required: false,
195
- default: undefined,
196
- depends_on: {
197
- match: 'all',
198
- conditions: [
199
- {
200
- fieldKey: 'contentTemplateType',
201
- operator: 'is',
202
- value: constants_1.ALL_CONTENT_TYPES.INLINE.friendly_name
203
- }
204
- ]
205
- }
206
- },
207
- inlineMediaUrls: {
208
- label: 'Inline Media URLs',
209
- description: 'The URLs of the media to sent with the inline message. The URLs must be publicaly accessible.',
210
- type: 'string',
211
- multiple: true,
212
- required: false,
213
- depends_on: {
214
- match: 'all',
215
- conditions: [
216
- {
217
- fieldKey: 'contentTemplateType',
218
- operator: 'is',
219
- value: constants_1.ALL_CONTENT_TYPES.INLINE.friendly_name
220
- }
221
- ]
222
- }
223
- },
224
- inlineVariables: {
225
- label: 'Inline Variables',
226
- description: "Variables to be send with the inline message. e.g. 'first_name' would match with {{first_name}} in the Inline Template message body.",
227
- type: 'object',
228
- required: false,
229
- defaultObjectUI: 'keyvalue',
230
- additionalProperties: true,
231
- default: undefined,
232
- depends_on: {
233
- match: 'all',
234
- conditions: [
235
- {
236
- fieldKey: 'contentTemplateType',
237
- operator: 'is',
238
- value: constants_1.ALL_CONTENT_TYPES.INLINE.friendly_name
239
- }
240
- ]
241
- }
242
- },
243
- validityPeriod: {
244
- label: 'Validity Period',
245
- description: 'The number of seconds between 1-14400 that the message is valid for. Default is 14400. If the message is not delivered within this time, it will not be delivered.',
246
- type: 'number',
247
- required: false,
248
- minimum: 1,
249
- maximum: 14400,
250
- default: undefined
251
- },
252
- sendAt: {
253
- label: 'Send At',
254
- description: 'The time that Twilio will send the message. Must be in ISO 8601 format.',
255
- type: 'string',
256
- format: 'date-time',
257
- required: false,
258
- default: undefined
259
- }
260
- };
261
- //# sourceMappingURL=fields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/destinations/twilio-messaging/sendMessage/fields.ts"],"names":[],"mappings":";;;AACA,2CAAoH;AAEvG,QAAA,MAAM,GAA+B;IAChD,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,qCAAqC;QAClD,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAQ,CAAC,GAAG,EAAE;YACrC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAQ,CAAC,GAAG,EAAE;YACrC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,oBAAQ,CAAC,QAAQ,EAAE;YAC/C,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAQ,CAAC,SAAS,EAAE;SAC3D;QACD,OAAO,EAAE,oBAAQ,CAAC,GAAG;QACrB,oBAAoB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC;KACpF;IACD,UAAU,EAAE;QACV,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,oJAAoJ;QACjK,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACd;IACD,mBAAmB,EAAE;QACnB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,kMAAkM;QAC/M,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KAC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AK;QACf,UAAU,EAAE;YACV,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE;gBACV;oBACE,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE,6BAAiB,CAAC,MAAM,CAAC,aAAa;iBAC9C;aACF;SACF;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,sIAAsI;QACxI,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,eAAe,EAAE,UAAU;QAC3B,oBAAoB,EAAE,IAAI;QAC1B,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE;YACV,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE;gBACV;oBACE,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE,6BAAiB,CAAC,MAAM,CAAC,aAAa;iBAC9C;aACF;SACF;KACF;IACD,cAAc,EAAE;QACd,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,oKAAoK;QACtK,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,SAAS;KACnB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,yEAAyE;QACtF,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,WAAW;QACnB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CAAA"}
@@ -1,24 +0,0 @@
1
- export interface Payload {
2
- channel: string;
3
- senderType: string;
4
- contentTemplateType: string;
5
- toPhoneNumber?: string;
6
- toMessengerPageUserId?: string;
7
- fromPhoneNumber?: string;
8
- fromMessengerSenderId?: string;
9
- messagingServiceSid?: string;
10
- contentSid?: string;
11
- mediaUrls?: {
12
- url: string;
13
- }[];
14
- contentVariables?: {
15
- [k: string]: unknown;
16
- };
17
- inlineBody?: string;
18
- inlineMediaUrls?: string[];
19
- inlineVariables?: {
20
- [k: string]: unknown;
21
- };
22
- validityPeriod?: number;
23
- sendAt?: string;
24
- }
@@ -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/twilio-messaging/sendMessage/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
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;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fields_1 = require("./fields");
4
- const dynamic_fields_1 = require("./dynamic-fields");
5
- const utils_1 = require("./utils");
6
- const action = {
7
- title: 'Send message',
8
- description: "Send messages with Twilio's REST API.",
9
- fields: fields_1.fields,
10
- dynamicFields: {
11
- senderType: async (_, { payload }) => {
12
- return await dynamic_fields_1.dynamicSenderType(payload);
13
- },
14
- fromPhoneNumber: async (request, { payload, settings }) => {
15
- return await dynamic_fields_1.dynamicFromPhoneNumber(request, payload, settings);
16
- },
17
- messagingServiceSid: async (request, { settings }) => {
18
- return await dynamic_fields_1.dynamicMessagingServiceSid(request, settings);
19
- },
20
- contentTemplateType: async (_, { payload }) => {
21
- return await dynamic_fields_1.dynamicContentTemplateType(payload);
22
- },
23
- contentSid: async (request, { payload }) => {
24
- return await dynamic_fields_1.dynamicContentSid(request, payload);
25
- },
26
- mediaUrls: {
27
- url: async (request, { payload }) => {
28
- return await dynamic_fields_1.dynamicMediaUrls(request, payload);
29
- }
30
- },
31
- contentVariables: {
32
- __keys__: async (request, { payload }) => {
33
- return await dynamic_fields_1.dynamicContentVariables(request, payload);
34
- }
35
- }
36
- },
37
- perform: async (request, { payload, settings }) => {
38
- return await utils_1.send(request, payload, settings);
39
- }
40
- };
41
- exports.default = action;
42
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/twilio-messaging/sendMessage/index.ts"],"names":[],"mappings":";;AAGA,qCAAiC;AACjC,qDAQyB;AACzB,mCAA8B;AAE9B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,uCAAuC;IACpD,MAAM,EAAN,eAAM;IACN,aAAa,EAAE;QACb,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YACnC,OAAO,MAAM,kCAAiB,CAAC,OAAO,CAAC,CAAA;QACzC,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;YACxD,OAAO,MAAM,uCAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;QACjE,CAAC;QACD,mBAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YACnD,OAAO,MAAM,2CAA0B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAC5D,CAAC;QACD,mBAAmB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YAC5C,OAAO,MAAM,2CAA0B,CAAC,OAAO,CAAC,CAAA;QAClD,CAAC;QACD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YACzC,OAAO,MAAM,kCAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAClD,CAAC;QACD,SAAS,EAAE;YACT,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;gBAClC,OAAO,MAAM,iCAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YACjD,CAAC;SACF;QACD,gBAAgB,EAAE;YAChB,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;gBACvC,OAAO,MAAM,wCAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YACxD,CAAC;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,OAAO,MAAM,YAAI,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,34 +0,0 @@
1
- import { PREDEFINED_CONTENT_TYPES, CHANNELS } from './constants';
2
- export declare type TwilioPayload = {
3
- To: string;
4
- SendAt?: string;
5
- ValidityPeriod?: number;
6
- MediaUrl?: string[];
7
- } & Sender & Content;
8
- export declare type Sender = FromPhone | FromMessagingService;
9
- declare type FromMessagingService = {
10
- MessagingServiceSid: string;
11
- };
12
- declare type FromPhone = {
13
- From: string;
14
- };
15
- export declare type Content = ContentTemplateMessage | InlineMessage;
16
- declare type ContentTemplateMessage = {
17
- ContentSid: string;
18
- ContentVariables?: string;
19
- };
20
- declare type InlineMessage = {
21
- Body: string;
22
- };
23
- export declare type PredefinedContentTypes = {
24
- [key: string]: PredefinedContentTypeItem;
25
- };
26
- export declare type Channel = typeof CHANNELS[keyof typeof CHANNELS];
27
- export declare type PredefinedContentTypeItem = {
28
- friendly_name: string;
29
- name: string;
30
- supports_media: boolean;
31
- supported_channels: Array<Channel>;
32
- };
33
- export declare type ContentTypeName = typeof PREDEFINED_CONTENT_TYPES[keyof typeof PREDEFINED_CONTENT_TYPES]['name'];
34
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/twilio-messaging/sendMessage/types.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import { RequestClient } from '@segment/actions-core';
2
- import { Payload } from './generated-types';
3
- import { Settings } from '../generated-types';
4
- export declare function send(request: RequestClient, payload: Payload, settings: Settings): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
5
- export declare function parseFieldValue(value: string | undefined | null): string | undefined;
6
- export declare function validateContentSid(contentSid: string): boolean;