@venturialstd/workflow 0.0.1

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 (302) hide show
  1. package/README.md +238 -0
  2. package/dist/constants/workflow.constant.d.ts +23 -0
  3. package/dist/constants/workflow.constant.d.ts.map +1 -0
  4. package/dist/constants/workflow.constant.js +30 -0
  5. package/dist/constants/workflow.constant.js.map +1 -0
  6. package/dist/dtos/create-workflow-edge.dto.d.ts +10 -0
  7. package/dist/dtos/create-workflow-edge.dto.d.ts.map +1 -0
  8. package/dist/dtos/create-workflow-edge.dto.js +58 -0
  9. package/dist/dtos/create-workflow-edge.dto.js.map +1 -0
  10. package/dist/dtos/create-workflow-execution.dto.d.ts +11 -0
  11. package/dist/dtos/create-workflow-execution.dto.d.ts.map +1 -0
  12. package/dist/dtos/create-workflow-execution.dto.js +58 -0
  13. package/dist/dtos/create-workflow-execution.dto.js.map +1 -0
  14. package/dist/dtos/create-workflow-module-credential.dto.d.ts +15 -0
  15. package/dist/dtos/create-workflow-module-credential.dto.d.ts.map +1 -0
  16. package/dist/dtos/create-workflow-module-credential.dto.js +75 -0
  17. package/dist/dtos/create-workflow-module-credential.dto.js.map +1 -0
  18. package/dist/dtos/create-workflow-module.dto.d.ts +10 -0
  19. package/dist/dtos/create-workflow-module.dto.d.ts.map +1 -0
  20. package/dist/dtos/create-workflow-module.dto.js +55 -0
  21. package/dist/dtos/create-workflow-module.dto.js.map +1 -0
  22. package/dist/dtos/create-workflow-node.dto.d.ts +15 -0
  23. package/dist/dtos/create-workflow-node.dto.d.ts.map +1 -0
  24. package/dist/dtos/create-workflow-node.dto.js +62 -0
  25. package/dist/dtos/create-workflow-node.dto.js.map +1 -0
  26. package/dist/dtos/create-workflow-session.dto.d.ts +13 -0
  27. package/dist/dtos/create-workflow-session.dto.d.ts.map +1 -0
  28. package/dist/dtos/create-workflow-session.dto.js +51 -0
  29. package/dist/dtos/create-workflow-session.dto.js.map +1 -0
  30. package/dist/dtos/create-workflow.dto.d.ts +12 -0
  31. package/dist/dtos/create-workflow.dto.d.ts.map +1 -0
  32. package/dist/dtos/create-workflow.dto.js +65 -0
  33. package/dist/dtos/create-workflow.dto.js.map +1 -0
  34. package/dist/dtos/index.d.ts +8 -0
  35. package/dist/dtos/index.d.ts.map +1 -0
  36. package/dist/dtos/index.js +24 -0
  37. package/dist/dtos/index.js.map +1 -0
  38. package/dist/entities/workflow-edge.entity.d.ts +15 -0
  39. package/dist/entities/workflow-edge.entity.d.ts.map +1 -0
  40. package/dist/entities/workflow-edge.entity.js +99 -0
  41. package/dist/entities/workflow-edge.entity.js.map +1 -0
  42. package/dist/entities/workflow-execution.entity.d.ts +20 -0
  43. package/dist/entities/workflow-execution.entity.d.ts.map +1 -0
  44. package/dist/entities/workflow-execution.entity.js +123 -0
  45. package/dist/entities/workflow-execution.entity.js.map +1 -0
  46. package/dist/entities/workflow-module-credential.entity.d.ts +13 -0
  47. package/dist/entities/workflow-module-credential.entity.d.ts.map +1 -0
  48. package/dist/entities/workflow-module-credential.entity.js +89 -0
  49. package/dist/entities/workflow-module-credential.entity.js.map +1 -0
  50. package/dist/entities/workflow-module.entity.d.ts +17 -0
  51. package/dist/entities/workflow-module.entity.d.ts.map +1 -0
  52. package/dist/entities/workflow-module.entity.js +113 -0
  53. package/dist/entities/workflow-module.entity.js.map +1 -0
  54. package/dist/entities/workflow-node.entity.d.ts +20 -0
  55. package/dist/entities/workflow-node.entity.d.ts.map +1 -0
  56. package/dist/entities/workflow-node.entity.js +105 -0
  57. package/dist/entities/workflow-node.entity.js.map +1 -0
  58. package/dist/entities/workflow-session.entity.d.ts +20 -0
  59. package/dist/entities/workflow-session.entity.d.ts.map +1 -0
  60. package/dist/entities/workflow-session.entity.js +100 -0
  61. package/dist/entities/workflow-session.entity.js.map +1 -0
  62. package/dist/entities/workflow.entity.d.ts +23 -0
  63. package/dist/entities/workflow.entity.d.ts.map +1 -0
  64. package/dist/entities/workflow.entity.js +130 -0
  65. package/dist/entities/workflow.entity.js.map +1 -0
  66. package/dist/index.d.ts +19 -0
  67. package/dist/index.d.ts.map +1 -0
  68. package/dist/index.js +37 -0
  69. package/dist/index.js.map +1 -0
  70. package/dist/modules/ai/actions/analyze-sentiment.action.d.ts +3 -0
  71. package/dist/modules/ai/actions/analyze-sentiment.action.d.ts.map +1 -0
  72. package/dist/modules/ai/actions/analyze-sentiment.action.js +59 -0
  73. package/dist/modules/ai/actions/analyze-sentiment.action.js.map +1 -0
  74. package/dist/modules/ai/actions/generate-text.action.d.ts +3 -0
  75. package/dist/modules/ai/actions/generate-text.action.d.ts.map +1 -0
  76. package/dist/modules/ai/actions/generate-text.action.js +89 -0
  77. package/dist/modules/ai/actions/generate-text.action.js.map +1 -0
  78. package/dist/modules/ai/actions/index.d.ts +4 -0
  79. package/dist/modules/ai/actions/index.d.ts.map +1 -0
  80. package/dist/modules/ai/actions/index.js +20 -0
  81. package/dist/modules/ai/actions/index.js.map +1 -0
  82. package/dist/modules/ai/actions/summarize.action.d.ts +3 -0
  83. package/dist/modules/ai/actions/summarize.action.d.ts.map +1 -0
  84. package/dist/modules/ai/actions/summarize.action.js +60 -0
  85. package/dist/modules/ai/actions/summarize.action.js.map +1 -0
  86. package/dist/modules/ai/ai.module.d.ts +3 -0
  87. package/dist/modules/ai/ai.module.d.ts.map +1 -0
  88. package/dist/modules/ai/ai.module.js +19 -0
  89. package/dist/modules/ai/ai.module.js.map +1 -0
  90. package/dist/modules/ai/auth/ai-auth.service.d.ts +5 -0
  91. package/dist/modules/ai/auth/ai-auth.service.d.ts.map +1 -0
  92. package/dist/modules/ai/auth/ai-auth.service.js +41 -0
  93. package/dist/modules/ai/auth/ai-auth.service.js.map +1 -0
  94. package/dist/modules/ai/auth/index.d.ts +2 -0
  95. package/dist/modules/ai/auth/index.d.ts.map +1 -0
  96. package/dist/modules/ai/auth/index.js +18 -0
  97. package/dist/modules/ai/auth/index.js.map +1 -0
  98. package/dist/modules/ai/credentials.d.ts +3 -0
  99. package/dist/modules/ai/credentials.d.ts.map +1 -0
  100. package/dist/modules/ai/credentials.js +32 -0
  101. package/dist/modules/ai/credentials.js.map +1 -0
  102. package/dist/modules/ai/services/analyze-sentiment.service.d.ts +5 -0
  103. package/dist/modules/ai/services/analyze-sentiment.service.d.ts.map +1 -0
  104. package/dist/modules/ai/services/analyze-sentiment.service.js +27 -0
  105. package/dist/modules/ai/services/analyze-sentiment.service.js.map +1 -0
  106. package/dist/modules/ai/services/generate-text.service.d.ts +5 -0
  107. package/dist/modules/ai/services/generate-text.service.d.ts.map +1 -0
  108. package/dist/modules/ai/services/generate-text.service.js +29 -0
  109. package/dist/modules/ai/services/generate-text.service.js.map +1 -0
  110. package/dist/modules/ai/services/index.d.ts +4 -0
  111. package/dist/modules/ai/services/index.d.ts.map +1 -0
  112. package/dist/modules/ai/services/index.js +20 -0
  113. package/dist/modules/ai/services/index.js.map +1 -0
  114. package/dist/modules/ai/services/summarize.service.d.ts +5 -0
  115. package/dist/modules/ai/services/summarize.service.d.ts.map +1 -0
  116. package/dist/modules/ai/services/summarize.service.js +28 -0
  117. package/dist/modules/ai/services/summarize.service.js.map +1 -0
  118. package/dist/modules/ai/triggers/index.d.ts +3 -0
  119. package/dist/modules/ai/triggers/index.d.ts.map +1 -0
  120. package/dist/modules/ai/triggers/index.js +5 -0
  121. package/dist/modules/ai/triggers/index.js.map +1 -0
  122. package/dist/modules/chatbot/actions/ask-question.action.d.ts +3 -0
  123. package/dist/modules/chatbot/actions/ask-question.action.d.ts.map +1 -0
  124. package/dist/modules/chatbot/actions/ask-question.action.js +42 -0
  125. package/dist/modules/chatbot/actions/ask-question.action.js.map +1 -0
  126. package/dist/modules/chatbot/actions/index.d.ts +4 -0
  127. package/dist/modules/chatbot/actions/index.d.ts.map +1 -0
  128. package/dist/modules/chatbot/actions/index.js +20 -0
  129. package/dist/modules/chatbot/actions/index.js.map +1 -0
  130. package/dist/modules/chatbot/actions/send-buttons.action.d.ts +3 -0
  131. package/dist/modules/chatbot/actions/send-buttons.action.d.ts.map +1 -0
  132. package/dist/modules/chatbot/actions/send-buttons.action.js +67 -0
  133. package/dist/modules/chatbot/actions/send-buttons.action.js.map +1 -0
  134. package/dist/modules/chatbot/actions/send-message.action.d.ts +3 -0
  135. package/dist/modules/chatbot/actions/send-message.action.d.ts.map +1 -0
  136. package/dist/modules/chatbot/actions/send-message.action.js +52 -0
  137. package/dist/modules/chatbot/actions/send-message.action.js.map +1 -0
  138. package/dist/modules/chatbot/chatbot.module.d.ts +3 -0
  139. package/dist/modules/chatbot/chatbot.module.d.ts.map +1 -0
  140. package/dist/modules/chatbot/chatbot.module.js +17 -0
  141. package/dist/modules/chatbot/chatbot.module.js.map +1 -0
  142. package/dist/modules/chatbot/credentials.d.ts +3 -0
  143. package/dist/modules/chatbot/credentials.d.ts.map +1 -0
  144. package/dist/modules/chatbot/credentials.js +5 -0
  145. package/dist/modules/chatbot/credentials.js.map +1 -0
  146. package/dist/modules/chatbot/services/ask-question.service.d.ts +5 -0
  147. package/dist/modules/chatbot/services/ask-question.service.d.ts.map +1 -0
  148. package/dist/modules/chatbot/services/ask-question.service.js +25 -0
  149. package/dist/modules/chatbot/services/ask-question.service.js.map +1 -0
  150. package/dist/modules/chatbot/services/index.d.ts +5 -0
  151. package/dist/modules/chatbot/services/index.d.ts.map +1 -0
  152. package/dist/modules/chatbot/services/index.js +21 -0
  153. package/dist/modules/chatbot/services/index.js.map +1 -0
  154. package/dist/modules/chatbot/services/send-buttons.service.d.ts +5 -0
  155. package/dist/modules/chatbot/services/send-buttons.service.d.ts.map +1 -0
  156. package/dist/modules/chatbot/services/send-buttons.service.js +25 -0
  157. package/dist/modules/chatbot/services/send-buttons.service.js.map +1 -0
  158. package/dist/modules/chatbot/services/send-message.service.d.ts +5 -0
  159. package/dist/modules/chatbot/services/send-message.service.d.ts.map +1 -0
  160. package/dist/modules/chatbot/services/send-message.service.js +27 -0
  161. package/dist/modules/chatbot/services/send-message.service.js.map +1 -0
  162. package/dist/modules/chatbot/services/user-responded.service.d.ts +5 -0
  163. package/dist/modules/chatbot/services/user-responded.service.d.ts.map +1 -0
  164. package/dist/modules/chatbot/services/user-responded.service.js +25 -0
  165. package/dist/modules/chatbot/services/user-responded.service.js.map +1 -0
  166. package/dist/modules/chatbot/triggers/index.d.ts +2 -0
  167. package/dist/modules/chatbot/triggers/index.d.ts.map +1 -0
  168. package/dist/modules/chatbot/triggers/index.js +18 -0
  169. package/dist/modules/chatbot/triggers/index.js.map +1 -0
  170. package/dist/modules/chatbot/triggers/user-responded.trigger.d.ts +3 -0
  171. package/dist/modules/chatbot/triggers/user-responded.trigger.d.ts.map +1 -0
  172. package/dist/modules/chatbot/triggers/user-responded.trigger.js +45 -0
  173. package/dist/modules/chatbot/triggers/user-responded.trigger.js.map +1 -0
  174. package/dist/modules/conditional/actions/evaluate-condition.action.d.ts +3 -0
  175. package/dist/modules/conditional/actions/evaluate-condition.action.d.ts.map +1 -0
  176. package/dist/modules/conditional/actions/evaluate-condition.action.js +75 -0
  177. package/dist/modules/conditional/actions/evaluate-condition.action.js.map +1 -0
  178. package/dist/modules/conditional/actions/index.d.ts +2 -0
  179. package/dist/modules/conditional/actions/index.d.ts.map +1 -0
  180. package/dist/modules/conditional/actions/index.js +18 -0
  181. package/dist/modules/conditional/actions/index.js.map +1 -0
  182. package/dist/modules/conditional/conditional.module.d.ts +3 -0
  183. package/dist/modules/conditional/conditional.module.d.ts.map +1 -0
  184. package/dist/modules/conditional/conditional.module.js +17 -0
  185. package/dist/modules/conditional/conditional.module.js.map +1 -0
  186. package/dist/modules/conditional/credentials.d.ts +3 -0
  187. package/dist/modules/conditional/credentials.d.ts.map +1 -0
  188. package/dist/modules/conditional/credentials.js +5 -0
  189. package/dist/modules/conditional/credentials.js.map +1 -0
  190. package/dist/modules/conditional/services/condition-met.service.d.ts +5 -0
  191. package/dist/modules/conditional/services/condition-met.service.d.ts.map +1 -0
  192. package/dist/modules/conditional/services/condition-met.service.js +24 -0
  193. package/dist/modules/conditional/services/condition-met.service.js.map +1 -0
  194. package/dist/modules/conditional/services/condition-not-met.service.d.ts +5 -0
  195. package/dist/modules/conditional/services/condition-not-met.service.d.ts.map +1 -0
  196. package/dist/modules/conditional/services/condition-not-met.service.js +24 -0
  197. package/dist/modules/conditional/services/condition-not-met.service.js.map +1 -0
  198. package/dist/modules/conditional/services/evaluate-condition.service.d.ts +5 -0
  199. package/dist/modules/conditional/services/evaluate-condition.service.d.ts.map +1 -0
  200. package/dist/modules/conditional/services/evaluate-condition.service.js +56 -0
  201. package/dist/modules/conditional/services/evaluate-condition.service.js.map +1 -0
  202. package/dist/modules/conditional/services/index.d.ts +4 -0
  203. package/dist/modules/conditional/services/index.d.ts.map +1 -0
  204. package/dist/modules/conditional/services/index.js +20 -0
  205. package/dist/modules/conditional/services/index.js.map +1 -0
  206. package/dist/modules/conditional/triggers/condition-met.trigger.d.ts +3 -0
  207. package/dist/modules/conditional/triggers/condition-met.trigger.d.ts.map +1 -0
  208. package/dist/modules/conditional/triggers/condition-met.trigger.js +39 -0
  209. package/dist/modules/conditional/triggers/condition-met.trigger.js.map +1 -0
  210. package/dist/modules/conditional/triggers/condition-not-met.trigger.d.ts +3 -0
  211. package/dist/modules/conditional/triggers/condition-not-met.trigger.d.ts.map +1 -0
  212. package/dist/modules/conditional/triggers/condition-not-met.trigger.js +39 -0
  213. package/dist/modules/conditional/triggers/condition-not-met.trigger.js.map +1 -0
  214. package/dist/modules/conditional/triggers/index.d.ts +3 -0
  215. package/dist/modules/conditional/triggers/index.d.ts.map +1 -0
  216. package/dist/modules/conditional/triggers/index.js +19 -0
  217. package/dist/modules/conditional/triggers/index.js.map +1 -0
  218. package/dist/modules/index.d.ts +6 -0
  219. package/dist/modules/index.d.ts.map +1 -0
  220. package/dist/modules/index.js +110 -0
  221. package/dist/modules/index.js.map +1 -0
  222. package/dist/modules/twilio/actions/index.d.ts +2 -0
  223. package/dist/modules/twilio/actions/index.d.ts.map +1 -0
  224. package/dist/modules/twilio/actions/index.js +18 -0
  225. package/dist/modules/twilio/actions/index.js.map +1 -0
  226. package/dist/modules/twilio/actions/send-sms.action.d.ts +3 -0
  227. package/dist/modules/twilio/actions/send-sms.action.d.ts.map +1 -0
  228. package/dist/modules/twilio/actions/send-sms.action.js +59 -0
  229. package/dist/modules/twilio/actions/send-sms.action.js.map +1 -0
  230. package/dist/modules/twilio/auth/index.d.ts +2 -0
  231. package/dist/modules/twilio/auth/index.d.ts.map +1 -0
  232. package/dist/modules/twilio/auth/index.js +18 -0
  233. package/dist/modules/twilio/auth/index.js.map +1 -0
  234. package/dist/modules/twilio/auth/twilio-auth.service.d.ts +5 -0
  235. package/dist/modules/twilio/auth/twilio-auth.service.d.ts.map +1 -0
  236. package/dist/modules/twilio/auth/twilio-auth.service.js +62 -0
  237. package/dist/modules/twilio/auth/twilio-auth.service.js.map +1 -0
  238. package/dist/modules/twilio/credentials.d.ts +3 -0
  239. package/dist/modules/twilio/credentials.d.ts.map +1 -0
  240. package/dist/modules/twilio/credentials.js +48 -0
  241. package/dist/modules/twilio/credentials.js.map +1 -0
  242. package/dist/modules/twilio/services/index.d.ts +3 -0
  243. package/dist/modules/twilio/services/index.d.ts.map +1 -0
  244. package/dist/modules/twilio/services/index.js +19 -0
  245. package/dist/modules/twilio/services/index.js.map +1 -0
  246. package/dist/modules/twilio/services/message-received.service.d.ts +5 -0
  247. package/dist/modules/twilio/services/message-received.service.d.ts.map +1 -0
  248. package/dist/modules/twilio/services/message-received.service.js +28 -0
  249. package/dist/modules/twilio/services/message-received.service.js.map +1 -0
  250. package/dist/modules/twilio/services/send-sms.service.d.ts +5 -0
  251. package/dist/modules/twilio/services/send-sms.service.d.ts.map +1 -0
  252. package/dist/modules/twilio/services/send-sms.service.js +29 -0
  253. package/dist/modules/twilio/services/send-sms.service.js.map +1 -0
  254. package/dist/modules/twilio/triggers/index.d.ts +2 -0
  255. package/dist/modules/twilio/triggers/index.d.ts.map +1 -0
  256. package/dist/modules/twilio/triggers/index.js +18 -0
  257. package/dist/modules/twilio/triggers/index.js.map +1 -0
  258. package/dist/modules/twilio/triggers/message-received.trigger.d.ts +3 -0
  259. package/dist/modules/twilio/triggers/message-received.trigger.d.ts.map +1 -0
  260. package/dist/modules/twilio/triggers/message-received.trigger.js +69 -0
  261. package/dist/modules/twilio/triggers/message-received.trigger.js.map +1 -0
  262. package/dist/modules/twilio/twilio.module.d.ts +3 -0
  263. package/dist/modules/twilio/twilio.module.d.ts.map +1 -0
  264. package/dist/modules/twilio/twilio.module.js +19 -0
  265. package/dist/modules/twilio/twilio.module.js.map +1 -0
  266. package/dist/modules/types.d.ts +103 -0
  267. package/dist/modules/types.d.ts.map +1 -0
  268. package/dist/modules/types.js +50 -0
  269. package/dist/modules/types.js.map +1 -0
  270. package/dist/services/workflow-edge.service.d.ts +12 -0
  271. package/dist/services/workflow-edge.service.d.ts.map +1 -0
  272. package/dist/services/workflow-edge.service.js +52 -0
  273. package/dist/services/workflow-edge.service.js.map +1 -0
  274. package/dist/services/workflow-execution.service.d.ts +15 -0
  275. package/dist/services/workflow-execution.service.d.ts.map +1 -0
  276. package/dist/services/workflow-execution.service.js +96 -0
  277. package/dist/services/workflow-execution.service.js.map +1 -0
  278. package/dist/services/workflow-module-credential.service.d.ts +14 -0
  279. package/dist/services/workflow-module-credential.service.d.ts.map +1 -0
  280. package/dist/services/workflow-module-credential.service.js +85 -0
  281. package/dist/services/workflow-module-credential.service.js.map +1 -0
  282. package/dist/services/workflow-module.service.d.ts +15 -0
  283. package/dist/services/workflow-module.service.d.ts.map +1 -0
  284. package/dist/services/workflow-module.service.js +96 -0
  285. package/dist/services/workflow-module.service.js.map +1 -0
  286. package/dist/services/workflow-node.service.d.ts +15 -0
  287. package/dist/services/workflow-node.service.d.ts.map +1 -0
  288. package/dist/services/workflow-node.service.js +62 -0
  289. package/dist/services/workflow-node.service.js.map +1 -0
  290. package/dist/services/workflow-session.service.d.ts +15 -0
  291. package/dist/services/workflow-session.service.d.ts.map +1 -0
  292. package/dist/services/workflow-session.service.js +91 -0
  293. package/dist/services/workflow-session.service.js.map +1 -0
  294. package/dist/services/workflow.service.d.ts +13 -0
  295. package/dist/services/workflow.service.d.ts.map +1 -0
  296. package/dist/services/workflow.service.js +73 -0
  297. package/dist/services/workflow.service.js.map +1 -0
  298. package/dist/workflow.module.d.ts +3 -0
  299. package/dist/workflow.module.d.ts.map +1 -0
  300. package/dist/workflow.module.js +98 -0
  301. package/dist/workflow.module.js.map +1 -0
  302. package/package.json +93 -0
@@ -0,0 +1,3 @@
1
+ import { WorkflowModuleDefinition } from '../types';
2
+ export declare const twilioModule: WorkflowModuleDefinition;
3
+ //# sourceMappingURL=twilio.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"twilio.module.d.ts","sourceRoot":"","sources":["../../../src/modules/twilio/twilio.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAMpD,eAAO,MAAM,YAAY,EAAE,wBAU1B,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.twilioModule = void 0;
4
+ const actions_1 = require("./actions");
5
+ const twilio_auth_service_1 = require("./auth/twilio-auth.service");
6
+ const credentials_1 = require("./credentials");
7
+ const triggers_1 = require("./triggers");
8
+ exports.twilioModule = {
9
+ id: 'twilio',
10
+ name: 'Twilio',
11
+ description: 'Send and receive SMS messages via Twilio',
12
+ icon: '📱',
13
+ version: '1.0.0',
14
+ credentialFields: credentials_1.twilioCredentials,
15
+ authServiceClass: twilio_auth_service_1.TwilioAuthService,
16
+ actions: [actions_1.sendSmsAction],
17
+ triggers: [triggers_1.messageReceivedTrigger],
18
+ };
19
+ //# sourceMappingURL=twilio.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"twilio.module.js","sourceRoot":"","sources":["../../../src/modules/twilio/twilio.module.ts"],"names":[],"mappings":";;;AACA,uCAA0C;AAC1C,oEAA+D;AAC/D,+CAAkD;AAClD,yCAAoD;AAEvC,QAAA,YAAY,GAA6B;IACpD,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,0CAA0C;IACvD,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,gBAAgB,EAAE,+BAAiB;IACnC,gBAAgB,EAAE,uCAAiB;IACnC,OAAO,EAAE,CAAC,uBAAa,CAAC;IACxB,QAAQ,EAAE,CAAC,iCAAsB,CAAC;CACnC,CAAC"}
@@ -0,0 +1,103 @@
1
+ export declare enum NODE_CATEGORY {
2
+ TRIGGER = "trigger",
3
+ ACTION = "action"
4
+ }
5
+ export declare enum FIELD_TYPE {
6
+ STRING = "string",
7
+ NUMBER = "number",
8
+ BOOLEAN = "boolean",
9
+ ARRAY = "array",
10
+ OBJECT = "object",
11
+ DATE = "date",
12
+ EMAIL = "email",
13
+ PHONE = "phone",
14
+ URL = "url",
15
+ JSON = "json"
16
+ }
17
+ export interface FieldValidation {
18
+ required?: boolean;
19
+ min?: number;
20
+ max?: number;
21
+ minLength?: number;
22
+ maxLength?: number;
23
+ pattern?: string;
24
+ enum?: string[];
25
+ custom?: string;
26
+ }
27
+ export interface FieldDefinition {
28
+ id: string;
29
+ name: string;
30
+ description?: string;
31
+ type: FIELD_TYPE;
32
+ validation?: FieldValidation;
33
+ defaultValue?: unknown;
34
+ placeholder?: string;
35
+ options?: Array<{
36
+ label: string;
37
+ value: string;
38
+ }>;
39
+ dependsOn?: string[];
40
+ }
41
+ export interface WorkflowActionContext {
42
+ workflowId?: string;
43
+ executionId?: string;
44
+ sessionId?: string;
45
+ credentials?: Record<string, unknown>;
46
+ context?: Record<string, unknown>;
47
+ previousOutputs?: Record<string, unknown>;
48
+ }
49
+ export interface IWorkflowActionService {
50
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>> | Record<string, unknown>;
51
+ }
52
+ export interface CredentialAuthResult {
53
+ success: boolean;
54
+ message?: string;
55
+ error?: string;
56
+ }
57
+ export interface IWorkflowCredentialAuthService {
58
+ authenticate(credentials: Record<string, unknown>): Promise<CredentialAuthResult>;
59
+ }
60
+ export interface WorkflowActionTrigger {
61
+ id: string;
62
+ name: string;
63
+ description: string;
64
+ category: NODE_CATEGORY;
65
+ icon?: string;
66
+ inputs: FieldDefinition[];
67
+ outputs: FieldDefinition[];
68
+ serviceClass?: new (...args: unknown[]) => IWorkflowActionService;
69
+ metadata?: Record<string, unknown>;
70
+ }
71
+ export interface CredentialFieldDefinition {
72
+ id: string;
73
+ name: string;
74
+ description?: string;
75
+ type: FIELD_TYPE;
76
+ validation?: FieldValidation;
77
+ placeholder?: string;
78
+ sensitive?: boolean;
79
+ required?: boolean;
80
+ }
81
+ export interface WorkflowModuleDefinition {
82
+ id: string;
83
+ name: string;
84
+ description: string;
85
+ icon: string;
86
+ version: string;
87
+ actions: WorkflowActionTrigger[];
88
+ triggers: WorkflowActionTrigger[];
89
+ credentialFields?: CredentialFieldDefinition[];
90
+ authServiceClass?: new (...args: unknown[]) => IWorkflowCredentialAuthService;
91
+ metadata?: Record<string, unknown>;
92
+ }
93
+ export declare class WorkflowModuleRegistry {
94
+ private modules;
95
+ register(module: WorkflowModuleDefinition): void;
96
+ get(moduleId: string): WorkflowModuleDefinition | undefined;
97
+ getAll(): WorkflowModuleDefinition[];
98
+ getActions(moduleId: string): WorkflowActionTrigger[];
99
+ getTriggers(moduleId: string): WorkflowActionTrigger[];
100
+ getActionOrTrigger(moduleId: string, actionTriggerId: string): WorkflowActionTrigger | undefined;
101
+ }
102
+ export declare const workflowModuleRegistry: WorkflowModuleRegistry;
103
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/modules/types.ts"],"names":[],"mappings":"AAGA,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAKD,oBAAY,UAAU;IACpB,MAAM,WAAW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C;CACpB;AAKD,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAC/C,gBAAgB,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,8BAA8B,CAAC;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAKD,qBAAa,sBAAsB;IACjC,OAAO,CAAC,OAAO,CAAoD;IAKnE,QAAQ,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI;IAOhD,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAO3D,MAAM,IAAI,wBAAwB,EAAE;IAOpC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,EAAE;IAQrD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,EAAE;IAQtD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS;CAMjG;AAGD,eAAO,MAAM,sBAAsB,wBAA+B,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workflowModuleRegistry = exports.WorkflowModuleRegistry = exports.FIELD_TYPE = exports.NODE_CATEGORY = void 0;
4
+ var NODE_CATEGORY;
5
+ (function (NODE_CATEGORY) {
6
+ NODE_CATEGORY["TRIGGER"] = "trigger";
7
+ NODE_CATEGORY["ACTION"] = "action";
8
+ })(NODE_CATEGORY || (exports.NODE_CATEGORY = NODE_CATEGORY = {}));
9
+ var FIELD_TYPE;
10
+ (function (FIELD_TYPE) {
11
+ FIELD_TYPE["STRING"] = "string";
12
+ FIELD_TYPE["NUMBER"] = "number";
13
+ FIELD_TYPE["BOOLEAN"] = "boolean";
14
+ FIELD_TYPE["ARRAY"] = "array";
15
+ FIELD_TYPE["OBJECT"] = "object";
16
+ FIELD_TYPE["DATE"] = "date";
17
+ FIELD_TYPE["EMAIL"] = "email";
18
+ FIELD_TYPE["PHONE"] = "phone";
19
+ FIELD_TYPE["URL"] = "url";
20
+ FIELD_TYPE["JSON"] = "json";
21
+ })(FIELD_TYPE || (exports.FIELD_TYPE = FIELD_TYPE = {}));
22
+ class WorkflowModuleRegistry {
23
+ modules = new Map();
24
+ register(module) {
25
+ this.modules.set(module.id, module);
26
+ }
27
+ get(moduleId) {
28
+ return this.modules.get(moduleId);
29
+ }
30
+ getAll() {
31
+ return Array.from(this.modules.values());
32
+ }
33
+ getActions(moduleId) {
34
+ const module = this.get(moduleId);
35
+ return module?.actions || [];
36
+ }
37
+ getTriggers(moduleId) {
38
+ const module = this.get(moduleId);
39
+ return module?.triggers || [];
40
+ }
41
+ getActionOrTrigger(moduleId, actionTriggerId) {
42
+ const module = this.get(moduleId);
43
+ if (!module)
44
+ return undefined;
45
+ return [...module.actions, ...module.triggers].find((item) => item.id === actionTriggerId);
46
+ }
47
+ }
48
+ exports.WorkflowModuleRegistry = WorkflowModuleRegistry;
49
+ exports.workflowModuleRegistry = new WorkflowModuleRegistry();
50
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/modules/types.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAKD,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAA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AC;IAC7F,CAAC;CACF;AAjDD,wDAiDC;AAGY,QAAA,sBAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { TypeOrmCrudService } from '@dataui/crud-typeorm';
2
+ import { Repository } from 'typeorm';
3
+ import { WorkflowEdge } from '../entities/workflow-edge.entity';
4
+ export declare class WorkflowEdgeService extends TypeOrmCrudService<WorkflowEdge> {
5
+ readonly repo: Repository<WorkflowEdge>;
6
+ constructor(repo: Repository<WorkflowEdge>);
7
+ getEdgesByWorkflowId(workflowId: string): Promise<WorkflowEdge[]>;
8
+ getEdgeByEdgeId(workflowId: string, edgeId: string): Promise<WorkflowEdge>;
9
+ getEdgesBySourceNode(workflowId: string, sourceNodeId: string): Promise<WorkflowEdge[]>;
10
+ getEdgesByTargetNode(workflowId: string, targetNodeId: string): Promise<WorkflowEdge[]>;
11
+ }
12
+ //# sourceMappingURL=workflow-edge.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-edge.service.d.ts","sourceRoot":"","sources":["../../src/services/workflow-edge.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,qBACa,mBAAoB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;aAGrD,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC;gBAA9B,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC;IAK1C,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIjE,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAU1E,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIvF,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAG9F"}
@@ -0,0 +1,52 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.WorkflowEdgeService = void 0;
16
+ const crud_typeorm_1 = require("@dataui/crud-typeorm");
17
+ const common_1 = require("@nestjs/common");
18
+ const typeorm_1 = require("@nestjs/typeorm");
19
+ const typeorm_2 = require("typeorm");
20
+ const workflow_edge_entity_1 = require("../entities/workflow-edge.entity");
21
+ let WorkflowEdgeService = class WorkflowEdgeService extends crud_typeorm_1.TypeOrmCrudService {
22
+ repo;
23
+ constructor(repo) {
24
+ super(repo);
25
+ this.repo = repo;
26
+ }
27
+ async getEdgesByWorkflowId(workflowId) {
28
+ return this.repo.find({ where: { workflowId } });
29
+ }
30
+ async getEdgeByEdgeId(workflowId, edgeId) {
31
+ const edge = await this.repo.findOne({
32
+ where: { workflowId, edgeId },
33
+ });
34
+ if (!edge) {
35
+ throw new common_1.NotFoundException(`Edge with id "${edgeId}" not found in workflow "${workflowId}"`);
36
+ }
37
+ return edge;
38
+ }
39
+ async getEdgesBySourceNode(workflowId, sourceNodeId) {
40
+ return this.repo.find({ where: { workflowId, source: sourceNodeId } });
41
+ }
42
+ async getEdgesByTargetNode(workflowId, targetNodeId) {
43
+ return this.repo.find({ where: { workflowId, target: targetNodeId } });
44
+ }
45
+ };
46
+ exports.WorkflowEdgeService = WorkflowEdgeService;
47
+ exports.WorkflowEdgeService = WorkflowEdgeService = __decorate([
48
+ (0, common_1.Injectable)(),
49
+ __param(0, (0, typeorm_1.InjectRepository)(workflow_edge_entity_1.WorkflowEdge)),
50
+ __metadata("design:paramtypes", [typeorm_2.Repository])
51
+ ], WorkflowEdgeService);
52
+ //# sourceMappingURL=workflow-edge.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-edge.service.js","sourceRoot":"","sources":["../../src/services/workflow-edge.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA+D;AAC/D,6CAAmD;AACnD,qCAAqC;AAErC,2EAAgE;AAGzD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,iCAAgC;IAGrD;IAFlB,YAEkB,IAA8B;QAE9C,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,GAAJ,IAAI,CAA0B;IAGhD,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,UAAkB;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,UAAkB,EAAE,MAAc;QACtD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;SAC9B,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,0BAAiB,CAAC,iBAAiB,MAAM,4BAA4B,UAAU,GAAG,CAAC,CAAC;QAChG,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,UAAkB,EAAE,YAAoB;QACjE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,UAAkB,EAAE,YAAoB;QACjE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;CACF,CAAA;AA7BY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,mCAAY,CAAC,CAAA;qCACT,oBAAU;GAHvB,mBAAmB,CA6B/B"}
@@ -0,0 +1,15 @@
1
+ import { TypeOrmCrudService } from '@dataui/crud-typeorm';
2
+ import { Repository } from 'typeorm';
3
+ import { WorkflowExecution } from '../entities/workflow-execution.entity';
4
+ export declare class WorkflowExecutionService extends TypeOrmCrudService<WorkflowExecution> {
5
+ readonly repo: Repository<WorkflowExecution>;
6
+ constructor(repo: Repository<WorkflowExecution>);
7
+ getExecutionsByWorkflowId(workflowId: string): Promise<WorkflowExecution[]>;
8
+ getExecutionsBySessionId(sessionId: string): Promise<WorkflowExecution[]>;
9
+ getActiveExecutions(workflowId?: string): Promise<WorkflowExecution[]>;
10
+ startExecution(executionId: string): Promise<WorkflowExecution>;
11
+ completeExecution(executionId: string, outputData?: Record<string, unknown>): Promise<WorkflowExecution>;
12
+ failExecution(executionId: string, errorMessage: string, errorData?: Record<string, unknown>): Promise<WorkflowExecution>;
13
+ updateCurrentNode(executionId: string, currentNodeId: string): Promise<WorkflowExecution>;
14
+ }
15
+ //# sourceMappingURL=workflow-execution.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-execution.service.d.ts","sourceRoot":"","sources":["../../src/services/workflow-execution.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,qBACa,wBAAyB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;aAG/D,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC;gBAAnC,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC;IAK/C,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO3E,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAOzE,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAQtE,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAW/D,iBAAiB,CACrB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,OAAO,CAAC,iBAAiB,CAAC;IAcvB,aAAa,CACjB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,iBAAiB,CAAC;IAevB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAShG"}
@@ -0,0 +1,96 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.WorkflowExecutionService = void 0;
16
+ const crud_typeorm_1 = require("@dataui/crud-typeorm");
17
+ const common_1 = require("@nestjs/common");
18
+ const typeorm_1 = require("@nestjs/typeorm");
19
+ const typeorm_2 = require("typeorm");
20
+ const workflow_constant_1 = require("../constants/workflow.constant");
21
+ const workflow_execution_entity_1 = require("../entities/workflow-execution.entity");
22
+ let WorkflowExecutionService = class WorkflowExecutionService extends crud_typeorm_1.TypeOrmCrudService {
23
+ repo;
24
+ constructor(repo) {
25
+ super(repo);
26
+ this.repo = repo;
27
+ }
28
+ async getExecutionsByWorkflowId(workflowId) {
29
+ return this.repo.find({
30
+ where: { workflowId },
31
+ order: { createdAt: 'DESC' },
32
+ });
33
+ }
34
+ async getExecutionsBySessionId(sessionId) {
35
+ return this.repo.find({
36
+ where: { sessionId },
37
+ order: { createdAt: 'DESC' },
38
+ });
39
+ }
40
+ async getActiveExecutions(workflowId) {
41
+ const where = { status: workflow_constant_1.EXECUTION_STATUS.RUNNING };
42
+ if (workflowId) {
43
+ where.workflowId = workflowId;
44
+ }
45
+ return this.repo.find({ where });
46
+ }
47
+ async startExecution(executionId) {
48
+ const execution = await this.repo.findOne({ where: { id: executionId } });
49
+ if (!execution) {
50
+ throw new common_1.NotFoundException(`Execution with id "${executionId}" not found`);
51
+ }
52
+ execution.status = workflow_constant_1.EXECUTION_STATUS.RUNNING;
53
+ execution.startedAt = new Date();
54
+ return this.repo.save(execution);
55
+ }
56
+ async completeExecution(executionId, outputData) {
57
+ const execution = await this.repo.findOne({ where: { id: executionId } });
58
+ if (!execution) {
59
+ throw new common_1.NotFoundException(`Execution with id "${executionId}" not found`);
60
+ }
61
+ execution.status = workflow_constant_1.EXECUTION_STATUS.COMPLETED;
62
+ execution.completedAt = new Date();
63
+ if (outputData) {
64
+ execution.outputData = outputData;
65
+ }
66
+ return this.repo.save(execution);
67
+ }
68
+ async failExecution(executionId, errorMessage, errorData) {
69
+ const execution = await this.repo.findOne({ where: { id: executionId } });
70
+ if (!execution) {
71
+ throw new common_1.NotFoundException(`Execution with id "${executionId}" not found`);
72
+ }
73
+ execution.status = workflow_constant_1.EXECUTION_STATUS.FAILED;
74
+ execution.completedAt = new Date();
75
+ execution.errorMessage = errorMessage;
76
+ if (errorData) {
77
+ execution.errorData = errorData;
78
+ }
79
+ return this.repo.save(execution);
80
+ }
81
+ async updateCurrentNode(executionId, currentNodeId) {
82
+ const execution = await this.repo.findOne({ where: { id: executionId } });
83
+ if (!execution) {
84
+ throw new common_1.NotFoundException(`Execution with id "${executionId}" not found`);
85
+ }
86
+ execution.currentNodeId = currentNodeId;
87
+ return this.repo.save(execution);
88
+ }
89
+ };
90
+ exports.WorkflowExecutionService = WorkflowExecutionService;
91
+ exports.WorkflowExecutionService = WorkflowExecutionService = __decorate([
92
+ (0, common_1.Injectable)(),
93
+ __param(0, (0, typeorm_1.InjectRepository)(workflow_execution_entity_1.WorkflowExecution)),
94
+ __metadata("design:paramtypes", [typeorm_2.Repository])
95
+ ], WorkflowExecutionService);
96
+ //# sourceMappingURL=workflow-execution.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-execution.service.js","sourceRoot":"","sources":["../../src/services/workflow-execution.service.ts"],"names":[],"mappings":";;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Y,CAAC;QACtC,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,WAAmB,EAAE,aAAqB;QAChE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,0BAAiB,CAAC,sBAAsB,WAAW,aAAa,CAAC,CAAC;QAC9E,CAAC;QAED,SAAS,CAAC,aAAa,GAAG,aAAa,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AAtFY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,6CAAiB,CAAC,CAAA;qCACd,oBAAU;GAHvB,wBAAwB,CAsFpC"}
@@ -0,0 +1,14 @@
1
+ import { TypeOrmCrudService } from '@dataui/crud-typeorm';
2
+ import { Repository } from 'typeorm';
3
+ import { WorkflowModuleCredential } from '../entities/workflow-module-credential.entity';
4
+ export declare class WorkflowModuleCredentialService extends TypeOrmCrudService<WorkflowModuleCredential> {
5
+ readonly repo: Repository<WorkflowModuleCredential>;
6
+ constructor(repo: Repository<WorkflowModuleCredential>);
7
+ getCredentialsByModule(moduleId: string, organizationId?: string, userId?: string): Promise<WorkflowModuleCredential[]>;
8
+ getCredentialByName(moduleId: string, name: string, organizationId?: string, userId?: string): Promise<WorkflowModuleCredential | null>;
9
+ getActiveCredentials(moduleId: string, organizationId?: string): Promise<WorkflowModuleCredential[]>;
10
+ updateCredential(id: string, credentials: Record<string, unknown>): Promise<WorkflowModuleCredential>;
11
+ deactivateCredential(id: string): Promise<WorkflowModuleCredential>;
12
+ activateCredential(id: string): Promise<WorkflowModuleCredential>;
13
+ }
14
+ //# sourceMappingURL=workflow-module-credential.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-module-credential.service.d.ts","sourceRoot":"","sources":["../../src/services/workflow-module-credential.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAEzF,qBACa,+BAAgC,SAAQ,kBAAkB,CAAC,wBAAwB,CAAC;aAG7E,IAAI,EAAE,UAAU,CAAC,wBAAwB,CAAC;gBAA1C,IAAI,EAAE,UAAU,CAAC,wBAAwB,CAAC;IAKtD,sBAAsB,CAC1B,QAAQ,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAWhC,mBAAmB,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAWrC,oBAAoB,CACxB,QAAQ,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAQhC,gBAAgB,CACpB,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,OAAO,CAAC,wBAAwB,CAAC;IAU9B,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAUnE,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;CASxE"}
@@ -0,0 +1,85 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.WorkflowModuleCredentialService = void 0;
16
+ const crud_typeorm_1 = require("@dataui/crud-typeorm");
17
+ const common_1 = require("@nestjs/common");
18
+ const typeorm_1 = require("@nestjs/typeorm");
19
+ const typeorm_2 = require("typeorm");
20
+ const workflow_module_credential_entity_1 = require("../entities/workflow-module-credential.entity");
21
+ let WorkflowModuleCredentialService = class WorkflowModuleCredentialService extends crud_typeorm_1.TypeOrmCrudService {
22
+ repo;
23
+ constructor(repo) {
24
+ super(repo);
25
+ this.repo = repo;
26
+ }
27
+ async getCredentialsByModule(moduleId, organizationId, userId) {
28
+ const where = { moduleId, isActive: true };
29
+ if (organizationId) {
30
+ where.organizationId = organizationId;
31
+ }
32
+ if (userId) {
33
+ where.userId = userId;
34
+ }
35
+ return this.repo.find({ where });
36
+ }
37
+ async getCredentialByName(moduleId, name, organizationId, userId) {
38
+ const where = { moduleId, name };
39
+ if (organizationId) {
40
+ where.organizationId = organizationId;
41
+ }
42
+ if (userId) {
43
+ where.userId = userId;
44
+ }
45
+ return this.repo.findOne({ where });
46
+ }
47
+ async getActiveCredentials(moduleId, organizationId) {
48
+ const where = { moduleId, isActive: true };
49
+ if (organizationId) {
50
+ where.organizationId = organizationId;
51
+ }
52
+ return this.repo.find({ where });
53
+ }
54
+ async updateCredential(id, credentials) {
55
+ const credential = await this.repo.findOne({ where: { id } });
56
+ if (!credential) {
57
+ throw new common_1.NotFoundException(`Credential with id "${id}" not found`);
58
+ }
59
+ credential.credentials = credentials;
60
+ return this.repo.save(credential);
61
+ }
62
+ async deactivateCredential(id) {
63
+ const credential = await this.repo.findOne({ where: { id } });
64
+ if (!credential) {
65
+ throw new common_1.NotFoundException(`Credential with id "${id}" not found`);
66
+ }
67
+ credential.isActive = false;
68
+ return this.repo.save(credential);
69
+ }
70
+ async activateCredential(id) {
71
+ const credential = await this.repo.findOne({ where: { id } });
72
+ if (!credential) {
73
+ throw new common_1.NotFoundException(`Credential with id "${id}" not found`);
74
+ }
75
+ credential.isActive = true;
76
+ return this.repo.save(credential);
77
+ }
78
+ };
79
+ exports.WorkflowModuleCredentialService = WorkflowModuleCredentialService;
80
+ exports.WorkflowModuleCredentialService = WorkflowModuleCredentialService = __decorate([
81
+ (0, common_1.Injectable)(),
82
+ __param(0, (0, typeorm_1.InjectRepository)(workflow_module_credential_entity_1.WorkflowModuleCredential)),
83
+ __metadata("design:paramtypes", [typeorm_2.Repository])
84
+ ], WorkflowModuleCredentialService);
85
+ //# sourceMappingURL=workflow-module-credential.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-module-credential.service.js","sourceRoot":"","sources":["../../src/services/workflow-module-credential.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA+D;AAC/D,6CAAmD;AACnD,qCAAqC;AAErC,qGAAyF;AAGlF,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,iCAA4C;IAG7E;IAFlB,YAEkB,IAA0C;QAE1D,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,G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AA+B,CAkF3C"}
@@ -0,0 +1,15 @@
1
+ import { TypeOrmCrudService } from '@dataui/crud-typeorm';
2
+ import { Repository } from 'typeorm';
3
+ import { CreateWorkflowModuleDto } from '../dtos/create-workflow-module.dto';
4
+ import { WorkflowModule } from '../entities/workflow-module.entity';
5
+ export declare class WorkflowModuleService extends TypeOrmCrudService<WorkflowModule> {
6
+ readonly repo: Repository<WorkflowModule>;
7
+ constructor(repo: Repository<WorkflowModule>);
8
+ getActiveModules(): Promise<WorkflowModule[]>;
9
+ getModuleById(moduleId: string): Promise<WorkflowModule | null>;
10
+ activateModule(moduleId: string, activatedBy?: string): Promise<WorkflowModule>;
11
+ deactivateModule(moduleId: string, deactivatedBy?: string): Promise<WorkflowModule>;
12
+ isModuleActive(moduleId: string): Promise<boolean>;
13
+ createOrUpdateModule(dto: CreateWorkflowModuleDto): Promise<WorkflowModule>;
14
+ }
15
+ //# sourceMappingURL=workflow-module.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-module.service.d.ts","sourceRoot":"","sources":["../../src/services/workflow-module.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,qBACa,qBAAsB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;aAGzD,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC;gBAAhC,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC;IAQ5C,gBAAgB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAO7C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAO/D,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAoB/E,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAkBnF,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQlD,oBAAoB,CAAC,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC;CAgClF"}
@@ -0,0 +1,96 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.WorkflowModuleService = void 0;
16
+ const crud_typeorm_1 = require("@dataui/crud-typeorm");
17
+ const common_1 = require("@nestjs/common");
18
+ const typeorm_1 = require("@nestjs/typeorm");
19
+ const typeorm_2 = require("typeorm");
20
+ const workflow_module_entity_1 = require("../entities/workflow-module.entity");
21
+ let WorkflowModuleService = class WorkflowModuleService extends crud_typeorm_1.TypeOrmCrudService {
22
+ repo;
23
+ constructor(repo) {
24
+ super(repo);
25
+ this.repo = repo;
26
+ }
27
+ async getActiveModules() {
28
+ return this.repo.find({ where: { isActive: true } });
29
+ }
30
+ async getModuleById(moduleId) {
31
+ return this.repo.findOne({ where: { moduleId } });
32
+ }
33
+ async activateModule(moduleId, activatedBy) {
34
+ const module = await this.getModuleById(moduleId);
35
+ if (!module) {
36
+ throw new Error(`Module ${moduleId} not found`);
37
+ }
38
+ module.isActive = true;
39
+ module.activatedAt = new Date();
40
+ if (activatedBy) {
41
+ module.activatedBy = activatedBy;
42
+ }
43
+ module.deactivatedAt = undefined;
44
+ module.deactivatedBy = undefined;
45
+ return this.repo.save(module);
46
+ }
47
+ async deactivateModule(moduleId, deactivatedBy) {
48
+ const module = await this.getModuleById(moduleId);
49
+ if (!module) {
50
+ throw new Error(`Module ${moduleId} not found`);
51
+ }
52
+ module.isActive = false;
53
+ module.deactivatedAt = new Date();
54
+ if (deactivatedBy) {
55
+ module.deactivatedBy = deactivatedBy;
56
+ }
57
+ return this.repo.save(module);
58
+ }
59
+ async isModuleActive(moduleId) {
60
+ const module = await this.getModuleById(moduleId);
61
+ return module?.isActive ?? false;
62
+ }
63
+ async createOrUpdateModule(dto) {
64
+ const existing = await this.getModuleById(dto.moduleId);
65
+ if (existing) {
66
+ Object.assign(existing, {
67
+ isActive: dto.isActive ?? existing.isActive,
68
+ name: dto.name ?? existing.name,
69
+ description: dto.description ?? existing.description,
70
+ configuration: dto.configuration ?? existing.configuration,
71
+ settings: dto.settings ?? existing.settings,
72
+ metadata: dto.metadata ?? existing.metadata,
73
+ });
74
+ if (dto.isActive && !existing.isActive) {
75
+ existing.activatedAt = new Date();
76
+ }
77
+ else if (!dto.isActive && existing.isActive) {
78
+ existing.deactivatedAt = new Date();
79
+ }
80
+ return this.repo.save(existing);
81
+ }
82
+ const module = this.repo.create({
83
+ ...dto,
84
+ isActive: dto.isActive ?? true,
85
+ activatedAt: dto.isActive !== false ? new Date() : undefined,
86
+ });
87
+ return this.repo.save(module);
88
+ }
89
+ };
90
+ exports.WorkflowModuleService = WorkflowModuleService;
91
+ exports.WorkflowModuleService = WorkflowModuleService = __decorate([
92
+ (0, common_1.Injectable)(),
93
+ __param(0, (0, typeorm_1.InjectRepository)(workflow_module_entity_1.WorkflowModule)),
94
+ __metadata("design:paramtypes", [typeorm_2.Repository])
95
+ ], WorkflowModuleService);
96
+ //# sourceMappingURL=workflow-module.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-module.service.js","sourceRoot":"","sources":["../../src/services/workflow-module.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AAGrC,+EAAoE;AAG7D,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,iCAAkC;IAGzD;IAFlB,YAEkB,IAAgC;QAEhD,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,GAAJ,IAAI,CAA4B;IAGlD,CAAC;IAKD,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC;IAKD,KAAK,CAAC,aAAa,CAAC,QAAgB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAKD,KAAK,CAAC,cAAc,CAAC,QAAgB,EAAE,WAAoB;QACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,UAAU,QAAQ,YAAY,CAAC,CAAC;QAClD,CAAC;QAED,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAChC,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;QACnC,C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