@venturialstd/workflow 0.1.0 → 0.1.3

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 (266) hide show
  1. package/dist/constants/workflow.constant.d.ts +2 -1
  2. package/dist/constants/workflow.constant.d.ts.map +1 -1
  3. package/dist/constants/workflow.constant.js +1 -0
  4. package/dist/constants/workflow.constant.js.map +1 -1
  5. package/dist/dtos/create-workflow-webhook.dto.d.ts +9 -0
  6. package/dist/dtos/create-workflow-webhook.dto.d.ts.map +1 -0
  7. package/dist/dtos/create-workflow-webhook.dto.js +48 -0
  8. package/dist/dtos/create-workflow-webhook.dto.js.map +1 -0
  9. package/dist/dtos/index.d.ts +1 -0
  10. package/dist/dtos/index.d.ts.map +1 -1
  11. package/dist/dtos/index.js +1 -0
  12. package/dist/dtos/index.js.map +1 -1
  13. package/dist/entities/workflow-webhook.entity.d.ts +22 -0
  14. package/dist/entities/workflow-webhook.entity.d.ts.map +1 -0
  15. package/dist/entities/workflow-webhook.entity.js +103 -0
  16. package/dist/entities/workflow-webhook.entity.js.map +1 -0
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/modules/conditional/services/evaluate-condition.service.d.ts.map +1 -1
  22. package/dist/modules/conditional/services/evaluate-condition.service.js +39 -23
  23. package/dist/modules/conditional/services/evaluate-condition.service.js.map +1 -1
  24. package/dist/modules/index.d.ts +1 -0
  25. package/dist/modules/index.d.ts.map +1 -1
  26. package/dist/modules/index.js +5 -1
  27. package/dist/modules/index.js.map +1 -1
  28. package/dist/modules/twilio/actions/cancel-verification.action.d.ts +3 -0
  29. package/dist/modules/twilio/actions/cancel-verification.action.d.ts.map +1 -0
  30. package/dist/modules/twilio/actions/cancel-verification.action.js +56 -0
  31. package/dist/modules/twilio/actions/cancel-verification.action.js.map +1 -0
  32. package/dist/modules/twilio/actions/create-conversation.action.d.ts +3 -0
  33. package/dist/modules/twilio/actions/create-conversation.action.d.ts.map +1 -0
  34. package/dist/modules/twilio/actions/create-conversation.action.js +79 -0
  35. package/dist/modules/twilio/actions/create-conversation.action.js.map +1 -0
  36. package/dist/modules/twilio/actions/create-video-room.action.d.ts +3 -0
  37. package/dist/modules/twilio/actions/create-video-room.action.d.ts.map +1 -0
  38. package/dist/modules/twilio/actions/create-video-room.action.js +89 -0
  39. package/dist/modules/twilio/actions/create-video-room.action.js.map +1 -0
  40. package/dist/modules/twilio/actions/delete-call.action.d.ts +3 -0
  41. package/dist/modules/twilio/actions/delete-call.action.d.ts.map +1 -0
  42. package/dist/modules/twilio/actions/delete-call.action.js +40 -0
  43. package/dist/modules/twilio/actions/delete-call.action.js.map +1 -0
  44. package/dist/modules/twilio/actions/delete-message.action.d.ts +3 -0
  45. package/dist/modules/twilio/actions/delete-message.action.d.ts.map +1 -0
  46. package/dist/modules/twilio/actions/delete-message.action.js +40 -0
  47. package/dist/modules/twilio/actions/delete-message.action.js.map +1 -0
  48. package/dist/modules/twilio/actions/fetch-call-recordings.action.d.ts +3 -0
  49. package/dist/modules/twilio/actions/fetch-call-recordings.action.d.ts.map +1 -0
  50. package/dist/modules/twilio/actions/fetch-call-recordings.action.js +46 -0
  51. package/dist/modules/twilio/actions/fetch-call-recordings.action.js.map +1 -0
  52. package/dist/modules/twilio/actions/fetch-call.action.d.ts +3 -0
  53. package/dist/modules/twilio/actions/fetch-call.action.d.ts.map +1 -0
  54. package/dist/modules/twilio/actions/fetch-call.action.js +52 -0
  55. package/dist/modules/twilio/actions/fetch-call.action.js.map +1 -0
  56. package/dist/modules/twilio/actions/fetch-message.action.d.ts +3 -0
  57. package/dist/modules/twilio/actions/fetch-message.action.d.ts.map +1 -0
  58. package/dist/modules/twilio/actions/fetch-message.action.js +58 -0
  59. package/dist/modules/twilio/actions/fetch-message.action.js.map +1 -0
  60. package/dist/modules/twilio/actions/fetch-verification.action.d.ts +3 -0
  61. package/dist/modules/twilio/actions/fetch-verification.action.d.ts.map +1 -0
  62. package/dist/modules/twilio/actions/fetch-verification.action.js +62 -0
  63. package/dist/modules/twilio/actions/fetch-verification.action.js.map +1 -0
  64. package/dist/modules/twilio/actions/generate-twiml-dial.action.d.ts +3 -0
  65. package/dist/modules/twilio/actions/generate-twiml-dial.action.d.ts.map +1 -0
  66. package/dist/modules/twilio/actions/generate-twiml-dial.action.js +72 -0
  67. package/dist/modules/twilio/actions/generate-twiml-dial.action.js.map +1 -0
  68. package/dist/modules/twilio/actions/generate-twiml-say.action.d.ts +3 -0
  69. package/dist/modules/twilio/actions/generate-twiml-say.action.d.ts.map +1 -0
  70. package/dist/modules/twilio/actions/generate-twiml-say.action.js +68 -0
  71. package/dist/modules/twilio/actions/generate-twiml-say.action.js.map +1 -0
  72. package/dist/modules/twilio/actions/index.d.ts +20 -0
  73. package/dist/modules/twilio/actions/index.d.ts.map +1 -1
  74. package/dist/modules/twilio/actions/index.js +20 -0
  75. package/dist/modules/twilio/actions/index.js.map +1 -1
  76. package/dist/modules/twilio/actions/list-calls.action.d.ts +3 -0
  77. package/dist/modules/twilio/actions/list-calls.action.d.ts.map +1 -0
  78. package/dist/modules/twilio/actions/list-calls.action.js +80 -0
  79. package/dist/modules/twilio/actions/list-calls.action.js.map +1 -0
  80. package/dist/modules/twilio/actions/list-messages.action.d.ts +3 -0
  81. package/dist/modules/twilio/actions/list-messages.action.d.ts.map +1 -0
  82. package/dist/modules/twilio/actions/list-messages.action.js +89 -0
  83. package/dist/modules/twilio/actions/list-messages.action.js.map +1 -0
  84. package/dist/modules/twilio/actions/lookup-phone-number.action.d.ts +3 -0
  85. package/dist/modules/twilio/actions/lookup-phone-number.action.d.ts.map +1 -0
  86. package/dist/modules/twilio/actions/lookup-phone-number.action.js +79 -0
  87. package/dist/modules/twilio/actions/lookup-phone-number.action.js.map +1 -0
  88. package/dist/modules/twilio/actions/make-call.action.d.ts +3 -0
  89. package/dist/modules/twilio/actions/make-call.action.d.ts.map +1 -0
  90. package/dist/modules/twilio/actions/make-call.action.js +109 -0
  91. package/dist/modules/twilio/actions/make-call.action.js.map +1 -0
  92. package/dist/modules/twilio/actions/send-conversation-message.action.d.ts +3 -0
  93. package/dist/modules/twilio/actions/send-conversation-message.action.d.ts.map +1 -0
  94. package/dist/modules/twilio/actions/send-conversation-message.action.js +72 -0
  95. package/dist/modules/twilio/actions/send-conversation-message.action.js.map +1 -0
  96. package/dist/modules/twilio/actions/send-sms.action.d.ts.map +1 -1
  97. package/dist/modules/twilio/actions/send-sms.action.js +15 -0
  98. package/dist/modules/twilio/actions/send-sms.action.js.map +1 -1
  99. package/dist/modules/twilio/actions/send-verification.action.d.ts +3 -0
  100. package/dist/modules/twilio/actions/send-verification.action.d.ts.map +1 -0
  101. package/dist/modules/twilio/actions/send-verification.action.js +99 -0
  102. package/dist/modules/twilio/actions/send-verification.action.js.map +1 -0
  103. package/dist/modules/twilio/actions/update-call.action.d.ts +3 -0
  104. package/dist/modules/twilio/actions/update-call.action.d.ts.map +1 -0
  105. package/dist/modules/twilio/actions/update-call.action.js +72 -0
  106. package/dist/modules/twilio/actions/update-call.action.js.map +1 -0
  107. package/dist/modules/twilio/actions/update-message.action.d.ts +3 -0
  108. package/dist/modules/twilio/actions/update-message.action.d.ts.map +1 -0
  109. package/dist/modules/twilio/actions/update-message.action.js +57 -0
  110. package/dist/modules/twilio/actions/update-message.action.js.map +1 -0
  111. package/dist/modules/twilio/actions/verify-code.action.d.ts +3 -0
  112. package/dist/modules/twilio/actions/verify-code.action.d.ts.map +1 -0
  113. package/dist/modules/twilio/actions/verify-code.action.js +72 -0
  114. package/dist/modules/twilio/actions/verify-code.action.js.map +1 -0
  115. package/dist/modules/twilio/services/cancel-verification.service.d.ts +8 -0
  116. package/dist/modules/twilio/services/cancel-verification.service.d.ts.map +1 -0
  117. package/dist/modules/twilio/services/cancel-verification.service.js +53 -0
  118. package/dist/modules/twilio/services/cancel-verification.service.js.map +1 -0
  119. package/dist/modules/twilio/services/create-conversation.service.d.ts +8 -0
  120. package/dist/modules/twilio/services/create-conversation.service.d.ts.map +1 -0
  121. package/dist/modules/twilio/services/create-conversation.service.js +56 -0
  122. package/dist/modules/twilio/services/create-conversation.service.js.map +1 -0
  123. package/dist/modules/twilio/services/create-video-room.service.d.ts +8 -0
  124. package/dist/modules/twilio/services/create-video-room.service.d.ts.map +1 -0
  125. package/dist/modules/twilio/services/create-video-room.service.js +57 -0
  126. package/dist/modules/twilio/services/create-video-room.service.js.map +1 -0
  127. package/dist/modules/twilio/services/delete-call.service.d.ts +8 -0
  128. package/dist/modules/twilio/services/delete-call.service.d.ts.map +1 -0
  129. package/dist/modules/twilio/services/delete-call.service.js +48 -0
  130. package/dist/modules/twilio/services/delete-call.service.js.map +1 -0
  131. package/dist/modules/twilio/services/delete-message.service.d.ts +8 -0
  132. package/dist/modules/twilio/services/delete-message.service.d.ts.map +1 -0
  133. package/dist/modules/twilio/services/delete-message.service.js +43 -0
  134. package/dist/modules/twilio/services/delete-message.service.js.map +1 -0
  135. package/dist/modules/twilio/services/fetch-call-recordings.service.d.ts +8 -0
  136. package/dist/modules/twilio/services/fetch-call-recordings.service.d.ts.map +1 -0
  137. package/dist/modules/twilio/services/fetch-call-recordings.service.js +56 -0
  138. package/dist/modules/twilio/services/fetch-call-recordings.service.js.map +1 -0
  139. package/dist/modules/twilio/services/fetch-call.service.d.ts +8 -0
  140. package/dist/modules/twilio/services/fetch-call.service.d.ts.map +1 -0
  141. package/dist/modules/twilio/services/fetch-call.service.js +52 -0
  142. package/dist/modules/twilio/services/fetch-call.service.js.map +1 -0
  143. package/dist/modules/twilio/services/fetch-message.service.d.ts +8 -0
  144. package/dist/modules/twilio/services/fetch-message.service.d.ts.map +1 -0
  145. package/dist/modules/twilio/services/fetch-message.service.js +60 -0
  146. package/dist/modules/twilio/services/fetch-message.service.js.map +1 -0
  147. package/dist/modules/twilio/services/fetch-verification.service.d.ts +8 -0
  148. package/dist/modules/twilio/services/fetch-verification.service.d.ts.map +1 -0
  149. package/dist/modules/twilio/services/fetch-verification.service.js +58 -0
  150. package/dist/modules/twilio/services/fetch-verification.service.js.map +1 -0
  151. package/dist/modules/twilio/services/generate-twiml-dial.service.d.ts +8 -0
  152. package/dist/modules/twilio/services/generate-twiml-dial.service.d.ts.map +1 -0
  153. package/dist/modules/twilio/services/generate-twiml-dial.service.js +43 -0
  154. package/dist/modules/twilio/services/generate-twiml-dial.service.js.map +1 -0
  155. package/dist/modules/twilio/services/generate-twiml-say.service.d.ts +8 -0
  156. package/dist/modules/twilio/services/generate-twiml-say.service.d.ts.map +1 -0
  157. package/dist/modules/twilio/services/generate-twiml-say.service.js +41 -0
  158. package/dist/modules/twilio/services/generate-twiml-say.service.js.map +1 -0
  159. package/dist/modules/twilio/services/index.d.ts +20 -0
  160. package/dist/modules/twilio/services/index.d.ts.map +1 -1
  161. package/dist/modules/twilio/services/index.js +20 -0
  162. package/dist/modules/twilio/services/index.js.map +1 -1
  163. package/dist/modules/twilio/services/list-calls.service.d.ts +8 -0
  164. package/dist/modules/twilio/services/list-calls.service.d.ts.map +1 -0
  165. package/dist/modules/twilio/services/list-calls.service.js +62 -0
  166. package/dist/modules/twilio/services/list-calls.service.js.map +1 -0
  167. package/dist/modules/twilio/services/list-messages.service.d.ts +8 -0
  168. package/dist/modules/twilio/services/list-messages.service.d.ts.map +1 -0
  169. package/dist/modules/twilio/services/list-messages.service.js +65 -0
  170. package/dist/modules/twilio/services/list-messages.service.js.map +1 -0
  171. package/dist/modules/twilio/services/lookup-phone-number.service.d.ts +8 -0
  172. package/dist/modules/twilio/services/lookup-phone-number.service.d.ts.map +1 -0
  173. package/dist/modules/twilio/services/lookup-phone-number.service.js +61 -0
  174. package/dist/modules/twilio/services/lookup-phone-number.service.js.map +1 -0
  175. package/dist/modules/twilio/services/make-call.service.d.ts +8 -0
  176. package/dist/modules/twilio/services/make-call.service.d.ts.map +1 -0
  177. package/dist/modules/twilio/services/make-call.service.js +80 -0
  178. package/dist/modules/twilio/services/make-call.service.js.map +1 -0
  179. package/dist/modules/twilio/services/send-conversation-message.service.d.ts +8 -0
  180. package/dist/modules/twilio/services/send-conversation-message.service.d.ts.map +1 -0
  181. package/dist/modules/twilio/services/send-conversation-message.service.js +61 -0
  182. package/dist/modules/twilio/services/send-conversation-message.service.js.map +1 -0
  183. package/dist/modules/twilio/services/send-sms.service.d.ts +3 -0
  184. package/dist/modules/twilio/services/send-sms.service.d.ts.map +1 -1
  185. package/dist/modules/twilio/services/send-sms.service.js +44 -9
  186. package/dist/modules/twilio/services/send-sms.service.js.map +1 -1
  187. package/dist/modules/twilio/services/send-verification.service.d.ts +8 -0
  188. package/dist/modules/twilio/services/send-verification.service.d.ts.map +1 -0
  189. package/dist/modules/twilio/services/send-verification.service.js +64 -0
  190. package/dist/modules/twilio/services/send-verification.service.js.map +1 -0
  191. package/dist/modules/twilio/services/update-call.service.d.ts +8 -0
  192. package/dist/modules/twilio/services/update-call.service.d.ts.map +1 -0
  193. package/dist/modules/twilio/services/update-call.service.js +62 -0
  194. package/dist/modules/twilio/services/update-call.service.js.map +1 -0
  195. package/dist/modules/twilio/services/update-message.service.d.ts +8 -0
  196. package/dist/modules/twilio/services/update-message.service.d.ts.map +1 -0
  197. package/dist/modules/twilio/services/update-message.service.js +54 -0
  198. package/dist/modules/twilio/services/update-message.service.js.map +1 -0
  199. package/dist/modules/twilio/services/verify-code.service.d.ts +8 -0
  200. package/dist/modules/twilio/services/verify-code.service.d.ts.map +1 -0
  201. package/dist/modules/twilio/services/verify-code.service.js +62 -0
  202. package/dist/modules/twilio/services/verify-code.service.js.map +1 -0
  203. package/dist/modules/twilio/twilio-nest.module.d.ts.map +1 -1
  204. package/dist/modules/twilio/twilio-nest.module.js +51 -3
  205. package/dist/modules/twilio/twilio-nest.module.js.map +1 -1
  206. package/dist/modules/twilio/twilio.module.d.ts.map +1 -1
  207. package/dist/modules/twilio/twilio.module.js +24 -2
  208. package/dist/modules/twilio/twilio.module.js.map +1 -1
  209. package/dist/modules/types.d.ts +2 -0
  210. package/dist/modules/types.d.ts.map +1 -1
  211. package/dist/modules/types.js.map +1 -1
  212. package/dist/modules/webhook/controllers/index.d.ts +2 -0
  213. package/dist/modules/webhook/controllers/index.d.ts.map +1 -0
  214. package/dist/modules/webhook/controllers/index.js +18 -0
  215. package/dist/modules/webhook/controllers/index.js.map +1 -0
  216. package/dist/modules/webhook/controllers/webhook-receiver.controller.d.ts +12 -0
  217. package/dist/modules/webhook/controllers/webhook-receiver.controller.d.ts.map +1 -0
  218. package/dist/modules/webhook/controllers/webhook-receiver.controller.js +122 -0
  219. package/dist/modules/webhook/controllers/webhook-receiver.controller.js.map +1 -0
  220. package/dist/modules/webhook/credentials.d.ts +3 -0
  221. package/dist/modules/webhook/credentials.d.ts.map +1 -0
  222. package/dist/modules/webhook/credentials.js +5 -0
  223. package/dist/modules/webhook/credentials.js.map +1 -0
  224. package/dist/modules/webhook/services/index.d.ts +2 -0
  225. package/dist/modules/webhook/services/index.d.ts.map +1 -0
  226. package/dist/modules/webhook/services/index.js +18 -0
  227. package/dist/modules/webhook/services/index.js.map +1 -0
  228. package/dist/modules/webhook/services/webhook-received.service.d.ts +10 -0
  229. package/dist/modules/webhook/services/webhook-received.service.d.ts.map +1 -0
  230. package/dist/modules/webhook/services/webhook-received.service.js +94 -0
  231. package/dist/modules/webhook/services/webhook-received.service.js.map +1 -0
  232. package/dist/modules/webhook/triggers/index.d.ts +2 -0
  233. package/dist/modules/webhook/triggers/index.d.ts.map +1 -0
  234. package/dist/modules/webhook/triggers/index.js +18 -0
  235. package/dist/modules/webhook/triggers/index.js.map +1 -0
  236. package/dist/modules/webhook/triggers/webhook-received.trigger.d.ts +3 -0
  237. package/dist/modules/webhook/triggers/webhook-received.trigger.d.ts.map +1 -0
  238. package/dist/modules/webhook/triggers/webhook-received.trigger.js +78 -0
  239. package/dist/modules/webhook/triggers/webhook-received.trigger.js.map +1 -0
  240. package/dist/modules/webhook/webhook-nest.module.d.ts +3 -0
  241. package/dist/modules/webhook/webhook-nest.module.d.ts.map +1 -0
  242. package/dist/modules/webhook/webhook-nest.module.js +32 -0
  243. package/dist/modules/webhook/webhook-nest.module.js.map +1 -0
  244. package/dist/modules/webhook/webhook.module.d.ts +3 -0
  245. package/dist/modules/webhook/webhook.module.d.ts.map +1 -0
  246. package/dist/modules/webhook/webhook.module.js +16 -0
  247. package/dist/modules/webhook/webhook.module.js.map +1 -0
  248. package/dist/services/workflow-execution.service.d.ts +14 -1
  249. package/dist/services/workflow-execution.service.d.ts.map +1 -1
  250. package/dist/services/workflow-execution.service.js +319 -2
  251. package/dist/services/workflow-execution.service.js.map +1 -1
  252. package/dist/services/workflow-module.service.d.ts +6 -1
  253. package/dist/services/workflow-module.service.d.ts.map +1 -1
  254. package/dist/services/workflow-module.service.js +56 -2
  255. package/dist/services/workflow-module.service.js.map +1 -1
  256. package/dist/services/workflow-webhook.service.d.ts +13 -0
  257. package/dist/services/workflow-webhook.service.d.ts.map +1 -0
  258. package/dist/services/workflow-webhook.service.js +72 -0
  259. package/dist/services/workflow-webhook.service.js.map +1 -0
  260. package/dist/workflow-core.module.d.ts.map +1 -1
  261. package/dist/workflow-core.module.js +5 -0
  262. package/dist/workflow-core.module.js.map +1 -1
  263. package/dist/workflow.module.d.ts.map +1 -1
  264. package/dist/workflow.module.js +3 -0
  265. package/dist/workflow.module.js.map +1 -1
  266. package/package.json +2 -2
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ListCallsService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const twilio_1 = require("@venturialstd/twilio");
15
+ let ListCallsService = class ListCallsService {
16
+ twilioVoiceService;
17
+ constructor(twilioVoiceService) {
18
+ this.twilioVoiceService = twilioVoiceService;
19
+ }
20
+ async perform(inputs, context) {
21
+ const accountSid = context.credentials?.accountSid;
22
+ const authToken = context.credentials?.authToken;
23
+ if (!accountSid || !authToken) {
24
+ throw new Error('Twilio credentials (accountSid and authToken) are required');
25
+ }
26
+ const config = {
27
+ auth: {
28
+ accountSid,
29
+ authToken,
30
+ },
31
+ };
32
+ const options = {};
33
+ if (inputs.to)
34
+ options.to = inputs.to;
35
+ if (inputs.from)
36
+ options.from = inputs.from;
37
+ if (inputs.status) {
38
+ options.status = inputs.status;
39
+ }
40
+ if (inputs.limit)
41
+ options.limit = Number(inputs.limit);
42
+ const calls = await this.twilioVoiceService.listCalls(config, options);
43
+ return {
44
+ calls: calls.map((call) => ({
45
+ callSid: call.sid,
46
+ status: call.status,
47
+ to: call.to,
48
+ from: call.from,
49
+ direction: call.direction,
50
+ duration: call.duration,
51
+ dateCreated: call.dateCreated?.toISOString(),
52
+ })),
53
+ count: calls.length,
54
+ };
55
+ }
56
+ };
57
+ exports.ListCallsService = ListCallsService;
58
+ exports.ListCallsService = ListCallsService = __decorate([
59
+ (0, common_1.Injectable)(),
60
+ __metadata("design:paramtypes", [twilio_1.TwilioVoiceService])
61
+ ], ListCallsService);
62
+ //# sourceMappingURL=list-calls.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-calls.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/list-calls.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAAwE;AAKjE,IAAM,gBAAg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AI;gBACf,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE;aAC7C,CAAC,CAAC;YACH,KAAK,EAAE,KAAK,CAAC,MAAM;SACpB,CAAC;IACJ,CAAC;CACF,CAAA;AAnDY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAEsC,2BAAkB;GADxD,gBAAgB,CAmD5B"}
@@ -0,0 +1,8 @@
1
+ import { TwilioMessageService } from '@venturialstd/twilio';
2
+ import { IWorkflowActionService, WorkflowActionContext } from '../../types';
3
+ export declare class ListMessagesService implements IWorkflowActionService {
4
+ private readonly twilioMessageService;
5
+ constructor(twilioMessageService: TwilioMessageService);
6
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
7
+ }
8
+ //# sourceMappingURL=list-messages.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-messages.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/list-messages.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,mBAAoB,YAAW,sBAAsB;IACpD,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB;IAEjE,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CA+CpC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ListMessagesService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const twilio_1 = require("@venturialstd/twilio");
15
+ let ListMessagesService = class ListMessagesService {
16
+ twilioMessageService;
17
+ constructor(twilioMessageService) {
18
+ this.twilioMessageService = twilioMessageService;
19
+ }
20
+ async perform(inputs, context) {
21
+ const accountSid = context.credentials?.accountSid;
22
+ const authToken = context.credentials?.authToken;
23
+ if (!accountSid || !authToken) {
24
+ throw new Error('Twilio credentials (accountSid and authToken) are required');
25
+ }
26
+ const config = {
27
+ auth: {
28
+ accountSid,
29
+ authToken,
30
+ },
31
+ };
32
+ const options = {};
33
+ if (inputs.to)
34
+ options.to = inputs.to;
35
+ if (inputs.from)
36
+ options.from = inputs.from;
37
+ if (inputs.dateSent)
38
+ options.dateSent = new Date(inputs.dateSent);
39
+ if (inputs.dateSentBefore)
40
+ options.dateSentBefore = new Date(inputs.dateSentBefore);
41
+ if (inputs.dateSentAfter)
42
+ options.dateSentAfter = new Date(inputs.dateSentAfter);
43
+ if (inputs.limit)
44
+ options.limit = Number(inputs.limit);
45
+ const messages = await this.twilioMessageService.listMessages(config, options);
46
+ return {
47
+ messages: messages.map((msg) => ({
48
+ messageSid: msg.sid,
49
+ status: msg.status,
50
+ to: msg.to,
51
+ from: msg.from,
52
+ body: msg.body,
53
+ dateCreated: msg.dateCreated?.toISOString(),
54
+ dateSent: msg.dateSent?.toISOString(),
55
+ })),
56
+ count: messages.length,
57
+ };
58
+ }
59
+ };
60
+ exports.ListMessagesService = ListMessagesService;
61
+ exports.ListMessagesService = ListMessagesService = __decorate([
62
+ (0, common_1.Injectable)(),
63
+ __metadata("design:paramtypes", [twilio_1.TwilioMessageService])
64
+ ], ListMessagesService);
65
+ //# sourceMappingURL=list-messages.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-messages.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/list-messages.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAA0E;AAKnE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACD;IAA7B,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAE3E,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAG9B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,UAAoB,CAAC;QAC7D,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,SAAmB,CAAC;QAE3D,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;QAED,MAAM,MAAM,GAAwB;YAClC,IAAI,EAAE;gBACJ,UAAU;gBACV,SAAS;aACV;SACF,CAAC;QAEF,MAAM,OAAO,GAOT,EAAE,CAAC;QAEP,IAAI,MAAM,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,EAAY,CAAC;QAChD,IAAI,MAAM,CAAC,IAAI;YAAE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,IAAc,CAAC;QACtD,IAAI,MAAM,CAAC,QAAQ;YAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,QAAkB,CAAC,CAAC;QAC5E,IAAI,MAAM,CAAC,cAAc;YAAE,OAAO,CAAC,cAAc,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,cAAwB,CAAC,CAAC;QAC9F,IAAI,MAAM,CAAC,aAAa;YAAE,OAAO,CAAC,aAAa,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,aAAuB,CAAC,CAAC;QAC3F,IAAI,MAAM,CAAC,KAAK;YAAE,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE/E,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBAC/B,UAAU,EAAE,GAAG,CAAC,GAAG;gBACnB,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE;gBAC3C,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE;aACtC,CAAC,CAAC;YACH,KAAK,EAAE,QAAQ,CAAC,MAAM;SACvB,CAAC;IACJ,CAAC;CACF,CAAA;AArDY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAEwC,6BAAoB;GAD5D,mBAAmB,CAqD/B"}
@@ -0,0 +1,8 @@
1
+ import { TwilioLookupService } from '@venturialstd/twilio';
2
+ import { IWorkflowActionService, WorkflowActionContext } from '../../types';
3
+ export declare class LookupPhoneNumberService implements IWorkflowActionService {
4
+ private readonly twilioLookupService;
5
+ constructor(twilioLookupService: TwilioLookupService);
6
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
7
+ }
8
+ //# sourceMappingURL=lookup-phone-number.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookup-phone-number.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/lookup-phone-number.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,wBAAyB,YAAW,sBAAsB;IACzD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,mBAAmB;IAE/D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CA+CpC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LookupPhoneNumberService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const twilio_1 = require("@venturialstd/twilio");
15
+ let LookupPhoneNumberService = class LookupPhoneNumberService {
16
+ twilioLookupService;
17
+ constructor(twilioLookupService) {
18
+ this.twilioLookupService = twilioLookupService;
19
+ }
20
+ async perform(inputs, context) {
21
+ const phoneNumber = inputs.phoneNumber;
22
+ if (!phoneNumber) {
23
+ throw new Error('Phone number is required');
24
+ }
25
+ const accountSid = context.credentials?.accountSid;
26
+ const authToken = context.credentials?.authToken;
27
+ if (!accountSid || !authToken) {
28
+ throw new Error('Twilio credentials (accountSid and authToken) are required');
29
+ }
30
+ const config = {
31
+ auth: {
32
+ accountSid,
33
+ authToken,
34
+ },
35
+ };
36
+ const options = {
37
+ phoneNumber,
38
+ };
39
+ if (inputs.countryCode)
40
+ options.countryCode = inputs.countryCode;
41
+ if (inputs.type) {
42
+ const typeArray = Array.isArray(inputs.type) ? inputs.type : [inputs.type];
43
+ options.type = typeArray.map((t) => t);
44
+ }
45
+ const lookup = await this.twilioLookupService.lookupPhoneNumber(config, options);
46
+ return {
47
+ phoneNumber: lookup.phoneNumber,
48
+ countryCode: lookup.countryCode,
49
+ nationalFormat: lookup.nationalFormat,
50
+ carrier: lookup.carrier,
51
+ callerName: lookup.callerName,
52
+ addOns: lookup.addOns,
53
+ };
54
+ }
55
+ };
56
+ exports.LookupPhoneNumberService = LookupPhoneNumberService;
57
+ exports.LookupPhoneNumberService = LookupPhoneNumberService = __decorate([
58
+ (0, common_1.Injectable)(),
59
+ __metadata("design:paramtypes", [twilio_1.TwilioLookupService])
60
+ ], LookupPhoneNumberService);
61
+ //# sourceMappingURL=lookup-phone-number.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookup-phone-number.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/lookup-phone-number.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAAyE;AAKlE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACN;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAEzE,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAE9B,MAAM,WAAW,GAAG,MAAM,CAAC,WAAqB,C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ACJ,CAAC;CACF,CAAA;AArDY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAEuC,4BAAmB;GAD1D,wBAAwB,CAqDpC"}
@@ -0,0 +1,8 @@
1
+ import { TwilioVoiceService } from '@venturialstd/twilio';
2
+ import { IWorkflowActionService, WorkflowActionContext } from '../../types';
3
+ export declare class MakeCallService implements IWorkflowActionService {
4
+ private readonly twilioVoiceService;
5
+ constructor(twilioVoiceService: TwilioVoiceService);
6
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
7
+ }
8
+ //# sourceMappingURL=make-call.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-call.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/make-call.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,eAAgB,YAAW,sBAAsB;IAChD,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,kBAAkB;IAE7D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAmEpC"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MakeCallService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const twilio_1 = require("@venturialstd/twilio");
15
+ let MakeCallService = class MakeCallService {
16
+ twilioVoiceService;
17
+ constructor(twilioVoiceService) {
18
+ this.twilioVoiceService = twilioVoiceService;
19
+ }
20
+ async perform(inputs, context) {
21
+ const to = inputs.to;
22
+ const url = inputs.url;
23
+ const twiml = inputs.twiml;
24
+ if (!to) {
25
+ throw new Error('Phone number (to) is required');
26
+ }
27
+ if (!url && !twiml) {
28
+ throw new Error('Either URL or TwiML is required');
29
+ }
30
+ const accountSid = context.credentials?.accountSid;
31
+ const authToken = context.credentials?.authToken;
32
+ const phoneNumberFrom = context.credentials?.fromNumber || undefined;
33
+ if (!accountSid || !authToken) {
34
+ throw new Error('Twilio credentials (accountSid and authToken) are required');
35
+ }
36
+ const config = phoneNumberFrom
37
+ ? {
38
+ auth: {
39
+ accountSid,
40
+ authToken,
41
+ },
42
+ phoneNumber: phoneNumberFrom,
43
+ }
44
+ : {
45
+ auth: {
46
+ accountSid,
47
+ authToken,
48
+ },
49
+ };
50
+ const callOptions = {
51
+ to,
52
+ };
53
+ if (url)
54
+ callOptions.url = url;
55
+ if (twiml)
56
+ callOptions.twiml = twiml;
57
+ if (inputs.method)
58
+ callOptions.method = inputs.method;
59
+ if (inputs.record !== undefined)
60
+ callOptions.record = inputs.record;
61
+ if (inputs.timeout)
62
+ callOptions.timeout = Number(inputs.timeout);
63
+ const call = await this.twilioVoiceService.makeCall(config, callOptions);
64
+ return {
65
+ callSid: call.sid,
66
+ status: call.status,
67
+ to: call.to,
68
+ from: call.from,
69
+ direction: call.direction,
70
+ dateCreated: call.dateCreated?.toISOString(),
71
+ startTime: call.startTime?.toISOString(),
72
+ };
73
+ }
74
+ };
75
+ exports.MakeCallService = MakeCallService;
76
+ exports.MakeCallService = MakeCallService = __decorate([
77
+ (0, common_1.Injectable)(),
78
+ __metadata("design:paramtypes", [twilio_1.TwilioVoiceService])
79
+ ], MakeCallService);
80
+ //# sourceMappingURL=make-call.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-call.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/make-call.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAAwE;AAKjE,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAEvE,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAE9B,MAAM,EAAE,GAAG,MAAM,CAAC,EAAY,CAAC;QAC/B,MAAM,GAAG,GAAG,MAAM,CAAC,GAAyB,CAAC;QAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,KAA2B,CAAC;QAEjD,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAGD,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,UAAoB,CAAC;QAC7D,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,SAAmB,CAAC;QAC3D,MAAM,eAAe,GAAI,OAAO,CAAC,WAAW,EAAE,UAAqB,IAAI,SAAS,CAAC;QAEjF,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;QAED,MAAM,MAAM,GAAwB,eAAe;YACjD,CAAC,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from '../../types';
3
+ export declare class SendConversationMessageService implements IWorkflowActionService {
4
+ private readonly twilioConversationService;
5
+ constructor(twilioConversationService: TwilioConversationService);
6
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
7
+ }
8
+ //# sourceMappingURL=send-conversation-message.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-conversation-message.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-conversation-message.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,8BAA+B,YAAW,sBAAsB;IAC/D,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBAAzB,yBAAyB,EAAE,yBAAyB;IAE3E,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CA2CpC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SendConversationMessageService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const twilio_1 = require("@venturialstd/twilio");
15
+ let SendConversationMessageService = class SendConversationMessageService {
16
+ twilioConversationService;
17
+ constructor(twilioConversationService) {
18
+ this.twilioConversationService = twilioConversationService;
19
+ }
20
+ async perform(inputs, context) {
21
+ const conversationSid = inputs.conversationSid;
22
+ const body = inputs.body;
23
+ const author = inputs.author;
24
+ if (!conversationSid) {
25
+ throw new Error('Conversation SID is required');
26
+ }
27
+ if (!body) {
28
+ throw new Error('Message body is required');
29
+ }
30
+ const accountSid = context.credentials?.accountSid;
31
+ const authToken = context.credentials?.authToken;
32
+ if (!accountSid || !authToken) {
33
+ throw new Error('Twilio credentials (accountSid and authToken) are required');
34
+ }
35
+ const config = {
36
+ auth: {
37
+ accountSid,
38
+ authToken,
39
+ },
40
+ };
41
+ const message = await this.twilioConversationService.createMessage(config, {
42
+ conversationSid,
43
+ body,
44
+ author,
45
+ });
46
+ return {
47
+ messageSid: message.sid,
48
+ conversationSid: message.conversationSid,
49
+ author: message.author,
50
+ body: message.body,
51
+ dateCreated: message.dateCreated?.toISOString(),
52
+ index: message.index,
53
+ };
54
+ }
55
+ };
56
+ exports.SendConversationMessageService = SendConversationMessageService;
57
+ exports.SendConversationMessageService = SendConversationMessageService = __decorate([
58
+ (0, common_1.Injectable)(),
59
+ __metadata("design:paramtypes", [twilio_1.TwilioConversationService])
60
+ ], SendConversationMessageService);
61
+ //# sourceMappingURL=send-conversation-message.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-conversation-message.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-conversation-message.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAA+E;AAKxE,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACZ;IAA7B,YAA6B,yBAAoD;QAApD,8BAAyB,GAAzB,yBAAyB,CAA2B;IAAG,CAAC;IAErF,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA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turialstd/twilio';
1
2
  import { IWorkflowActionService, WorkflowActionContext } from '../../types';
2
3
  export declare class SendSmsService implements IWorkflowActionService {
4
+ private readonly twilioMessageService;
5
+ constructor(twilioMessageService: TwilioMessageService);
3
6
  perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
4
7
  }
5
8
  //# sourceMappingURL=send-sms.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-sms.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-sms.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,cAAe,YAAW,sBAAsB;IACrD,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAwBpC"}
1
+ {"version":3,"file":"send-sms.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-sms.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,cAAe,YAAW,sBAAsB;IAC/C,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB;IAEjE,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAgDpC"}
@@ -5,25 +5,60 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.SendSmsService = void 0;
10
13
  const common_1 = require("@nestjs/common");
14
+ const twilio_1 = require("@venturialstd/twilio");
11
15
  let SendSmsService = class SendSmsService {
16
+ twilioMessageService;
17
+ constructor(twilioMessageService) {
18
+ this.twilioMessageService = twilioMessageService;
19
+ }
12
20
  async perform(inputs, context) {
13
- const _phoneNumber = inputs.phoneNumber;
14
- const _messageBody = inputs.messageBody;
15
- const _accountSid = context.credentials?.accountSid;
16
- const _authToken = context.credentials?.authToken;
17
- const _fromNumber = context.credentials?.fromNumber || _phoneNumber;
21
+ const phoneNumber = inputs.phoneNumber;
22
+ const messageBody = inputs.messageBody;
23
+ const channel = inputs.channel;
24
+ if (!phoneNumber) {
25
+ throw new Error('Phone number is required');
26
+ }
27
+ if (!messageBody) {
28
+ throw new Error('Message body is required');
29
+ }
30
+ const accountSid = context.credentials?.accountSid;
31
+ const authToken = context.credentials?.authToken;
32
+ const phoneNumberFrom = context.credentials?.fromNumber || undefined;
33
+ if (!accountSid || !authToken) {
34
+ throw new Error('Twilio credentials (accountSid and authToken) are required');
35
+ }
36
+ const config = phoneNumberFrom
37
+ ? {
38
+ auth: {
39
+ accountSid,
40
+ authToken,
41
+ },
42
+ phoneNumber: phoneNumberFrom,
43
+ }
44
+ : null;
45
+ const to = channel === 'whatsapp' ? 'whatsapp:' + phoneNumber : phoneNumber;
46
+ const message = await this.twilioMessageService.sendMessage(config, {
47
+ to,
48
+ body: messageBody,
49
+ });
18
50
  return {
19
- messageSid: `SM${Date.now()}`,
20
- status: 'queued',
21
- sentAt: new Date().toISOString(),
51
+ messageSid: message.sid,
52
+ status: message.status,
53
+ sentAt: message.dateCreated?.toISOString() || new Date().toISOString(),
54
+ to: message.to,
55
+ from: message.from,
22
56
  };
23
57
  }
24
58
  };
25
59
  exports.SendSmsService = SendSmsService;
26
60
  exports.SendSmsService = SendSmsService = __decorate([
27
- (0, common_1.Injectable)()
61
+ (0, common_1.Injectable)(),
62
+ __metadata("design:paramtypes", [twilio_1.TwilioMessageService])
28
63
  ], SendSmsService);
29
64
  //# sourceMappingURL=send-sms.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-sms.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-sms.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAKrC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAI9B,MAAM,YAAY,GAAG,MAAM,CAAC,WAAqB,CAAC;QAClD,MAAM,YAAY,GAAG,MAAM,CAAC,WAAqB,CAAC;QAClD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,UAAoB,CAAC;QAC9D,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,SAAmB,CAAC;QAC5D,MAAM,WAAW,GAAI,OAAO,CAAC,WAAW,EAAE,UAAqB,IAAI,YAAY,CAAC;QAWhF,OAAO;YACL,UAAU,EAAE,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE;YAC7B,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACjC,CAAC;IACJ,CAAC;CACF,CAAA;AA5BY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CA4B1B"}
1
+ {"version":3,"file":"send-sms.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-sms.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAA0E;AAKnE,IAAM,cAAc,GAApB,MAAM,cAAc;IACI;IAA7B,YAA6B,oBAA0C;QAA1C,yB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AAC,MAAM;YACtB,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACtE,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC;IACJ,CAAC;CACF,CAAA;AAtDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEwC,6BAAoB;GAD5D,cAAc,CAsD1B"}
@@ -0,0 +1,8 @@
1
+ import { TwilioVerifyService } from '@venturialstd/twilio';
2
+ import { IWorkflowActionService, WorkflowActionContext } from '../../types';
3
+ export declare class SendVerificationService implements IWorkflowActionService {
4
+ private readonly twilioVerifyService;
5
+ constructor(twilioVerifyService: TwilioVerifyService);
6
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
7
+ }
8
+ //# sourceMappingURL=send-verification.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-verification.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-verification.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,uBAAwB,YAAW,sBAAsB;IACxD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,mBAAmB;IAE/D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAuDpC"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SendVerificationService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const twilio_1 = require("@venturialstd/twilio");
15
+ let SendVerificationService = class SendVerificationService {
16
+ twilioVerifyService;
17
+ constructor(twilioVerifyService) {
18
+ this.twilioVerifyService = twilioVerifyService;
19
+ }
20
+ async perform(inputs, context) {
21
+ const to = inputs.to;
22
+ const serviceSid = inputs.serviceSid;
23
+ const channel = inputs.channel || 'sms';
24
+ if (!to) {
25
+ throw new Error('Phone number (to) is required');
26
+ }
27
+ if (!serviceSid) {
28
+ throw new Error('Verify Service SID is required');
29
+ }
30
+ const accountSid = context.credentials?.accountSid;
31
+ const authToken = context.credentials?.authToken;
32
+ if (!accountSid || !authToken) {
33
+ throw new Error('Twilio credentials (accountSid and authToken) are required');
34
+ }
35
+ const config = {
36
+ auth: {
37
+ accountSid,
38
+ authToken,
39
+ },
40
+ };
41
+ const verificationOptions = {
42
+ to,
43
+ channel: channel,
44
+ };
45
+ if (inputs.customMessage)
46
+ verificationOptions.customMessage = inputs.customMessage;
47
+ if (inputs.customCode)
48
+ verificationOptions.customCode = inputs.customCode;
49
+ const verification = await this.twilioVerifyService.sendVerification(config, serviceSid, verificationOptions);
50
+ return {
51
+ verificationSid: verification.sid,
52
+ status: verification.status,
53
+ to: verification.to,
54
+ channel: verification.channel,
55
+ dateCreated: verification.dateCreated?.toISOString(),
56
+ };
57
+ }
58
+ };
59
+ exports.SendVerificationService = SendVerificationService;
60
+ exports.SendVerificationService = SendVerificationService = __decorate([
61
+ (0, common_1.Injectable)(),
62
+ __metadata("design:paramtypes", [twilio_1.TwilioVerifyService])
63
+ ], SendVerificationService);
64
+ //# sourceMappingURL=send-verification.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-verification.service.js","sourceRoot":"","sources":["../../../../src/modules/twilio/services/send-verification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAAyE;AAKlE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACL;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAEzE,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAE9B,MAAM,EAAE,GAAG,MAAM,CAAC,EAAY,CAAC;QAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAoB,CAAC;QAC/C,MAAM,OAAO,GAAI,MAAM,CAAC,OAAkB,IAAI,KAAK,CAAC;QAEpD,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QAGD,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,UAAoB,CAAC;QAC7D,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,SAAmB,CAAC;QAE3D,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;QAED,MAAM,MAAM,GAAwB;YAClC,IAAI,EAAE;gBACJ,UAAU;gBACV,SAAS;aACV;SACF,CAAC;QAEF,MAAM,mBAAmB,GAKrB;YACF,EAAE;YACF,OAAO,EAAE,OAAiE;SAC3E,CAAC;QAEF,IAAI,MAAM,CAAC,aAAa;YAAE,mBAAmB,CAAC,aAAa,GAAG,MAAM,CAAC,aAAuB,CAAC;QAC7F,IAAI,MAAM,CAAC,UAAU;YAAE,mBAAmB,CAAC,UAAU,GAAG,MAAM,CAAC,UAAoB,CAAC;QAEpF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAClE,MAAM,EACN,UAAU,EACV,mBAAmB,CACpB,CAAC;QAEF,OAAO;YACL,eAAe,EAAE,YAAY,CAAC,GAAG;YACjC,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,EAAE,EAAE,YAAY,CAAC,EAAE;YACnB,OAAO,EAAE,YAAY,CAAC,OAAO;YAC7B,WAAW,EAAE,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE;SACrD,CAAC;IACJ,CAAC;CACF,CAAA;AA7DY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;qCAEuC,4BAAmB;GAD1D,uBAAuB,CA6DnC"}
@@ -0,0 +1,8 @@
1
+ import { TwilioVoiceService } from '@venturialstd/twilio';
2
+ import { IWorkflowActionService, WorkflowActionContext } from '../../types';
3
+ export declare class UpdateCallService implements IWorkflowActionService {
4
+ private readonly twilioVoiceService;
5
+ constructor(twilioVoiceService: TwilioVoiceService);
6
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
7
+ }
8
+ //# sourceMappingURL=update-call.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-call.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/twilio/services/update-call.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,iBAAkB,YAAW,sBAAsB;IAClD,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,kBAAkB;IAE7D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAgDpC"}