@abyss-project/main 1.0.109 → 1.0.111

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 (259) hide show
  1. package/dist/api/billing-account.admin.api.d.ts +10 -0
  2. package/dist/api/billing-account.admin.api.js +38 -0
  3. package/dist/api/billing-addon-template.admin.api.d.ts +7 -0
  4. package/dist/api/billing-addon-template.admin.api.js +26 -0
  5. package/dist/api/billing-plan.admin.api.d.ts +6 -0
  6. package/dist/api/billing-plan.admin.api.js +20 -0
  7. package/dist/api/billing-plan.api.d.ts +4 -0
  8. package/dist/api/billing-plan.api.js +12 -0
  9. package/dist/api/index.d.ts +10 -4
  10. package/dist/api/index.js +10 -4
  11. package/dist/api/organization-billing.api.d.ts +17 -0
  12. package/dist/api/organization-billing.api.js +64 -0
  13. package/dist/api/organization-member.api.d.ts +12 -0
  14. package/dist/api/organization-member.api.js +44 -0
  15. package/dist/api/organization.api.d.ts +3 -2
  16. package/dist/api/organization.api.js +5 -1
  17. package/dist/api/project-access.admin.api.d.ts +1 -3
  18. package/dist/api/project-access.admin.api.js +1 -9
  19. package/dist/api/project-access.api.d.ts +5 -3
  20. package/dist/api/project-access.api.js +17 -9
  21. package/dist/api/project-api-key.api.d.ts +8 -0
  22. package/dist/api/project-api-key.api.js +29 -0
  23. package/dist/api/project.api.d.ts +1 -5
  24. package/dist/api/project.api.js +1 -17
  25. package/dist/api/team.api.d.ts +14 -0
  26. package/dist/api/team.api.js +52 -0
  27. package/dist/api/user-billing.api.d.ts +11 -0
  28. package/dist/api/user-billing.api.js +40 -0
  29. package/dist/api/user.api.d.ts +1 -4
  30. package/dist/api/user.api.js +1 -16
  31. package/dist/index.d.ts +1 -37
  32. package/dist/index.js +1 -37
  33. package/dist/permissions/ability.d.ts +12 -0
  34. package/dist/permissions/ability.js +134 -0
  35. package/dist/permissions/index.d.ts +1 -0
  36. package/dist/{workflow → permissions}/index.js +1 -1
  37. package/dist/types/enum/abyss-application-event.enum.d.ts +18 -1
  38. package/dist/types/enum/abyss-application-event.enum.js +17 -0
  39. package/dist/types/enum/index.d.ts +2 -4
  40. package/dist/types/enum/index.js +2 -4
  41. package/dist/types/enum/onboarding-steps.enum.d.ts +5 -3
  42. package/dist/types/enum/onboarding-steps.enum.js +5 -3
  43. package/dist/types/enum/organization-billing.enum.d.ts +70 -0
  44. package/dist/types/enum/organization-billing.enum.js +82 -0
  45. package/dist/types/enum/organization-permission.enum.d.ts +13 -1
  46. package/dist/types/enum/organization-permission.enum.js +40 -2
  47. package/dist/types/enum/user-type.enum.d.ts +1 -0
  48. package/dist/types/enum/user-type.enum.js +1 -0
  49. package/dist/types/interface/api/index.d.ts +17 -8
  50. package/dist/types/interface/api/index.js +17 -8
  51. package/dist/types/interface/api/requests/billing-account.admin.request.d.ts +53 -0
  52. package/dist/types/interface/api/requests/billing-addon-template.request.d.ts +32 -0
  53. package/dist/types/interface/api/requests/billing-plan.request.d.ts +37 -0
  54. package/dist/types/interface/api/requests/organization-billing.request.d.ts +95 -0
  55. package/dist/types/interface/api/requests/organization-member.request.d.ts +38 -0
  56. package/dist/types/interface/api/requests/organization.request.d.ts +10 -0
  57. package/dist/types/interface/api/requests/project-access.admin.request.d.ts +1 -20
  58. package/dist/types/interface/api/requests/project-access.request.d.ts +16 -20
  59. package/dist/types/interface/api/requests/project-api-key.request.d.ts +39 -0
  60. package/dist/types/interface/api/requests/project.request.d.ts +2 -23
  61. package/dist/types/interface/api/requests/team.request.d.ts +72 -0
  62. package/dist/types/interface/api/requests/user-billing.request.d.ts +23 -0
  63. package/dist/types/interface/api/requests/user.request.d.ts +2 -8
  64. package/dist/types/interface/api/responses/billing-account.admin.response.d.ts +38 -0
  65. package/dist/types/interface/api/responses/billing-addon-template.response.d.ts +22 -0
  66. package/dist/types/interface/api/responses/billing-plan.response.d.ts +26 -0
  67. package/dist/types/interface/api/responses/gift-code.admin.response.d.ts +0 -1
  68. package/dist/types/interface/api/responses/gift-code.response.d.ts +0 -1
  69. package/dist/types/interface/api/responses/organization-billing.response.d.ts +82 -0
  70. package/dist/types/interface/api/responses/organization-member.response.d.ts +42 -0
  71. package/dist/types/interface/api/responses/organization-member.response.js +2 -0
  72. package/dist/types/interface/api/responses/project-access.admin.response.d.ts +0 -8
  73. package/dist/types/interface/api/responses/project-access.response.d.ts +16 -8
  74. package/dist/types/interface/api/responses/project-api-key.response.d.ts +26 -0
  75. package/dist/types/interface/api/responses/project-api-key.response.js +2 -0
  76. package/dist/types/interface/api/responses/project.response.d.ts +0 -14
  77. package/dist/types/interface/api/responses/report.public.response.d.ts +0 -1
  78. package/dist/types/interface/api/responses/team.response.d.ts +52 -0
  79. package/dist/types/interface/api/responses/team.response.js +2 -0
  80. package/dist/types/interface/api/responses/user-billing.response.d.ts +45 -0
  81. package/dist/types/interface/api/responses/user-billing.response.js +2 -0
  82. package/dist/types/interface/index.d.ts +17 -3
  83. package/dist/types/interface/index.js +17 -3
  84. package/dist/types/interface/models/application.model.d.ts +1 -1
  85. package/dist/types/interface/models/atlas-group.model.d.ts +2 -2
  86. package/dist/types/interface/models/atlas-page.model.d.ts +2 -2
  87. package/dist/types/interface/models/atlas.model.d.ts +8 -5
  88. package/dist/types/interface/models/billing-account.model.d.ts +40 -0
  89. package/dist/types/interface/models/billing-account.model.js +2 -0
  90. package/dist/types/interface/models/billing-addon-template.model.d.ts +15 -0
  91. package/dist/types/interface/models/billing-addon-template.model.js +2 -0
  92. package/dist/types/interface/models/board-card-checklist.model.d.ts +1 -1
  93. package/dist/types/interface/models/board-card.model.d.ts +6 -6
  94. package/dist/types/interface/models/board-column.model.d.ts +1 -1
  95. package/dist/types/interface/models/board.model.d.ts +7 -4
  96. package/dist/types/interface/models/credit-transaction.model.d.ts +22 -0
  97. package/dist/types/interface/models/credit-transaction.model.js +2 -0
  98. package/dist/types/interface/models/draw.model.d.ts +3 -0
  99. package/dist/types/interface/models/gift-code-activation.model.d.ts +4 -3
  100. package/dist/types/interface/models/gift-code.model.d.ts +1 -1
  101. package/dist/types/interface/models/invoice.model.d.ts +26 -0
  102. package/dist/types/interface/models/invoice.model.js +2 -0
  103. package/dist/types/interface/models/memo.model.d.ts +3 -0
  104. package/dist/types/interface/models/organization-billing.model.d.ts +37 -0
  105. package/dist/types/interface/models/organization-billing.model.js +2 -0
  106. package/dist/types/interface/models/organization-member.model.d.ts +5 -4
  107. package/dist/types/interface/models/organization-project-quota.model.d.ts +15 -0
  108. package/dist/types/interface/models/organization-project-quota.model.js +2 -0
  109. package/dist/types/interface/models/organization-quota-alert.model.d.ts +11 -0
  110. package/dist/types/interface/models/organization-quota-alert.model.js +2 -0
  111. package/dist/types/interface/models/organization-service-quota.model.d.ts +13 -0
  112. package/dist/types/interface/models/organization-service-quota.model.js +2 -0
  113. package/dist/types/interface/models/organization.model.d.ts +13 -0
  114. package/dist/types/interface/models/plan-template.model.d.ts +29 -0
  115. package/dist/types/interface/models/plan-template.model.js +2 -0
  116. package/dist/types/interface/models/project-access.model.d.ts +5 -6
  117. package/dist/types/interface/models/project-api-key-application-access.model.d.ts +13 -0
  118. package/dist/types/interface/models/project-api-key-application-access.model.js +2 -0
  119. package/dist/types/interface/models/project-api-key.model.d.ts +15 -0
  120. package/dist/types/interface/models/project-api-key.model.js +2 -0
  121. package/dist/types/interface/models/project.model.d.ts +8 -12
  122. package/dist/types/interface/models/quota-grant.model.d.ts +20 -0
  123. package/dist/types/interface/models/quota-grant.model.js +2 -0
  124. package/dist/types/interface/models/retrospective.model.d.ts +6 -3
  125. package/dist/types/interface/models/short-link.model.d.ts +4 -1
  126. package/dist/types/interface/models/team-member.model.d.ts +11 -0
  127. package/dist/types/interface/models/team-member.model.js +2 -0
  128. package/dist/types/interface/models/team-project-access.model.d.ts +15 -0
  129. package/dist/types/interface/models/team-project-access.model.js +2 -0
  130. package/dist/types/interface/models/team-project-application-access.model.d.ts +13 -0
  131. package/dist/types/interface/models/team-project-application-access.model.js +2 -0
  132. package/dist/types/interface/models/team.model.d.ts +19 -0
  133. package/dist/types/interface/models/team.model.js +2 -0
  134. package/dist/types/interface/models/token-history.model.d.ts +9 -1
  135. package/dist/types/interface/models/usage-record.model.d.ts +24 -0
  136. package/dist/types/interface/models/usage-record.model.js +2 -0
  137. package/dist/types/interface/models/user-ticket-message.model.d.ts +1 -1
  138. package/dist/types/interface/models/user-ticket.model.d.ts +1 -1
  139. package/dist/types/interface/models/user.model.d.ts +16 -18
  140. package/dist/types/utils/onboarding.utils.d.ts +1 -6
  141. package/dist/types/utils/onboarding.utils.js +9 -5
  142. package/dist/utils/index.d.ts +0 -1
  143. package/dist/utils/index.js +0 -1
  144. package/package.json +2 -1
  145. package/dist/api/user-credit-purchase.admin.api.d.ts +0 -7
  146. package/dist/api/user-credit-purchase.admin.api.js +0 -28
  147. package/dist/api/user-credit-purchase.api.d.ts +0 -3
  148. package/dist/api/user-credit-purchase.api.js +0 -14
  149. package/dist/api/user-transaction.admin.api.d.ts +0 -5
  150. package/dist/api/user-transaction.admin.api.js +0 -20
  151. package/dist/api/user-transaction.api.d.ts +0 -3
  152. package/dist/api/user-transaction.api.js +0 -14
  153. package/dist/expressions/index.d.ts +0 -5
  154. package/dist/expressions/index.js +0 -16
  155. package/dist/expressions/mapper.d.ts +0 -9
  156. package/dist/expressions/mapper.js +0 -90
  157. package/dist/expressions/parser.d.ts +0 -3
  158. package/dist/expressions/parser.js +0 -97
  159. package/dist/expressions/resolver.d.ts +0 -12
  160. package/dist/expressions/resolver.js +0 -88
  161. package/dist/expressions/types.d.ts +0 -36
  162. package/dist/types/enum/integration-type.enum.d.ts +0 -4
  163. package/dist/types/enum/integration-type.enum.js +0 -8
  164. package/dist/types/enum/invoice-status.enum.d.ts +0 -7
  165. package/dist/types/enum/invoice-status.enum.js +0 -11
  166. package/dist/types/enum/organization-role.enum.d.ts +0 -6
  167. package/dist/types/enum/organization-role.enum.js +0 -10
  168. package/dist/types/enum/organization-subscription-status.enum.d.ts +0 -7
  169. package/dist/types/enum/organization-subscription-status.enum.js +0 -11
  170. package/dist/types/enum/plan-billing-period.enum.d.ts +0 -4
  171. package/dist/types/enum/plan-billing-period.enum.js +0 -8
  172. package/dist/types/enum/plan-status.enum.d.ts +0 -4
  173. package/dist/types/enum/plan-status.enum.js +0 -8
  174. package/dist/types/enum/subscription-level.enum.d.ts +0 -72
  175. package/dist/types/enum/subscription-level.enum.js +0 -179
  176. package/dist/types/enum/usage-record-type.enum.d.ts +0 -8
  177. package/dist/types/enum/usage-record-type.enum.js +0 -12
  178. package/dist/types/enum/user-credit-purchase-payment-method.enum.d.ts +0 -3
  179. package/dist/types/enum/user-credit-purchase-payment-method.enum.js +0 -7
  180. package/dist/types/enum/user-credit-purchase-platform.enum.d.ts +0 -8
  181. package/dist/types/enum/user-credit-purchase-platform.enum.js +0 -12
  182. package/dist/types/enum/user-transaction-type.enum.d.ts +0 -14
  183. package/dist/types/enum/user-transaction-type.enum.js +0 -18
  184. package/dist/types/interface/api/requests/user-credit-purchase.admin.request.d.ts +0 -42
  185. package/dist/types/interface/api/requests/user-credit-purchase.request.d.ts +0 -9
  186. package/dist/types/interface/api/requests/user-transaction.admin.request.d.ts +0 -30
  187. package/dist/types/interface/api/requests/user-transaction.request.d.ts +0 -8
  188. package/dist/types/interface/api/responses/user-credit-purchase.admin.response.d.ts +0 -22
  189. package/dist/types/interface/api/responses/user-credit-purchase.response.d.ts +0 -8
  190. package/dist/types/interface/api/responses/user-transaction.admin.response.d.ts +0 -13
  191. package/dist/types/interface/api/responses/user-transaction.response.d.ts +0 -11
  192. package/dist/types/interface/models/subscription.model.d.ts +0 -16
  193. package/dist/types/interface/models/user-credit-purchase.model.d.ts +0 -22
  194. package/dist/types/interface/models/user-transaction.model.d.ts +0 -19
  195. package/dist/utils/organization-permission.utils.d.ts +0 -3
  196. package/dist/utils/organization-permission.utils.js +0 -36
  197. package/dist/utils/subscription.utils.d.ts +0 -6
  198. package/dist/utils/subscription.utils.js +0 -41
  199. package/dist/workflow/expression/expression-functions.utils.d.ts +0 -6
  200. package/dist/workflow/expression/expression-functions.utils.js +0 -61
  201. package/dist/workflow/expression/expression-mapper.d.ts +0 -11
  202. package/dist/workflow/expression/expression-mapper.js +0 -32
  203. package/dist/workflow/expression/expression-mapping.utils.d.ts +0 -4
  204. package/dist/workflow/expression/expression-mapping.utils.js +0 -43
  205. package/dist/workflow/expression/expression-resolver.utils.d.ts +0 -3
  206. package/dist/workflow/expression/expression-resolver.utils.js +0 -54
  207. package/dist/workflow/expression/expression-tokenizer.utils.d.ts +0 -4
  208. package/dist/workflow/expression/expression-tokenizer.utils.js +0 -123
  209. package/dist/workflow/expression/expression.types.d.ts +0 -33
  210. package/dist/workflow/expression/expression.types.js +0 -17
  211. package/dist/workflow/expression/index.d.ts +0 -10
  212. package/dist/workflow/expression/index.js +0 -40
  213. package/dist/workflow/expression/workflow-resolver.d.ts +0 -9
  214. package/dist/workflow/expression/workflow-resolver.js +0 -102
  215. package/dist/workflow/expressions/functions/array.d.ts +0 -2
  216. package/dist/workflow/expressions/functions/array.js +0 -252
  217. package/dist/workflow/expressions/functions/crypto.d.ts +0 -2
  218. package/dist/workflow/expressions/functions/crypto.js +0 -101
  219. package/dist/workflow/expressions/functions/datetime.d.ts +0 -2
  220. package/dist/workflow/expressions/functions/datetime.js +0 -256
  221. package/dist/workflow/expressions/functions/index.d.ts +0 -7
  222. package/dist/workflow/expressions/functions/index.js +0 -46
  223. package/dist/workflow/expressions/functions/math.d.ts +0 -2
  224. package/dist/workflow/expressions/functions/math.js +0 -174
  225. package/dist/workflow/expressions/functions/string.d.ts +0 -2
  226. package/dist/workflow/expressions/functions/string.js +0 -301
  227. package/dist/workflow/expressions/functions/utility.d.ts +0 -2
  228. package/dist/workflow/expressions/functions/utility.js +0 -230
  229. package/dist/workflow/expressions/helpers.d.ts +0 -26
  230. package/dist/workflow/expressions/helpers.js +0 -132
  231. package/dist/workflow/expressions/index.d.ts +0 -15
  232. package/dist/workflow/expressions/index.js +0 -61
  233. package/dist/workflow/expressions/parser.d.ts +0 -8
  234. package/dist/workflow/expressions/parser.js +0 -436
  235. package/dist/workflow/expressions/pipes/array-pipes.d.ts +0 -2
  236. package/dist/workflow/expressions/pipes/array-pipes.js +0 -248
  237. package/dist/workflow/expressions/pipes/index.d.ts +0 -8
  238. package/dist/workflow/expressions/pipes/index.js +0 -40
  239. package/dist/workflow/expressions/pipes/object-pipes.d.ts +0 -2
  240. package/dist/workflow/expressions/pipes/object-pipes.js +0 -243
  241. package/dist/workflow/expressions/pipes/string-pipes.d.ts +0 -9
  242. package/dist/workflow/expressions/pipes/string-pipes.js +0 -178
  243. package/dist/workflow/expressions/resolver.d.ts +0 -8
  244. package/dist/workflow/expressions/resolver.js +0 -263
  245. package/dist/workflow/expressions/types.d.ts +0 -144
  246. package/dist/workflow/expressions/types.js +0 -33
  247. package/dist/workflow/index.d.ts +0 -1
  248. /package/dist/{expressions/types.js → types/interface/api/requests/billing-account.admin.request.js} +0 -0
  249. /package/dist/types/interface/api/requests/{user-credit-purchase.admin.request.js → billing-addon-template.request.js} +0 -0
  250. /package/dist/types/interface/api/requests/{user-credit-purchase.request.js → billing-plan.request.js} +0 -0
  251. /package/dist/types/interface/api/requests/{user-transaction.admin.request.js → organization-billing.request.js} +0 -0
  252. /package/dist/types/interface/api/requests/{user-transaction.request.js → organization-member.request.js} +0 -0
  253. /package/dist/types/interface/api/{responses/user-credit-purchase.admin.response.js → requests/project-api-key.request.js} +0 -0
  254. /package/dist/types/interface/api/{responses/user-credit-purchase.response.js → requests/team.request.js} +0 -0
  255. /package/dist/types/interface/api/{responses/user-transaction.admin.response.js → requests/user-billing.request.js} +0 -0
  256. /package/dist/types/interface/api/responses/{user-transaction.response.js → billing-account.admin.response.js} +0 -0
  257. /package/dist/types/interface/{models/subscription.model.js → api/responses/billing-addon-template.response.js} +0 -0
  258. /package/dist/types/interface/{models/user-credit-purchase.model.js → api/responses/billing-plan.response.js} +0 -0
  259. /package/dist/types/interface/{models/user-transaction.model.js → api/responses/organization-billing.response.js} +0 -0
@@ -1,263 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveExpression = exports.interpolateString = exports.evaluateExpression = exports.resolvePathValue = exports.buildResolverContext = void 0;
4
- const parser_1 = require("./parser");
5
- const functions_1 = require("./functions");
6
- const pipes_1 = require("./pipes");
7
- function buildResolverContext(workflowContext) {
8
- var _a;
9
- if (!workflowContext) {
10
- return {};
11
- }
12
- const context = {};
13
- if (workflowContext.triggerData) {
14
- context.trigger = workflowContext.triggerData;
15
- context.triggerData = workflowContext.triggerData;
16
- }
17
- if (workflowContext.stepExecutions) {
18
- const steps = {};
19
- for (const [stepId, execution] of Object.entries(workflowContext.stepExecutions)) {
20
- const step = (_a = workflowContext.steps) === null || _a === void 0 ? void 0 : _a.find((s) => s.id === stepId);
21
- const stepKey = (step === null || step === void 0 ? void 0 : step.name) || stepId;
22
- steps[stepKey] = execution.outputData;
23
- }
24
- context.steps = steps;
25
- }
26
- if (workflowContext.variables) {
27
- context.variables = workflowContext.variables;
28
- }
29
- context.project = {
30
- id: workflowContext.projectId,
31
- ...(workflowContext.projectName
32
- ? { name: workflowContext.projectName }
33
- : {}),
34
- };
35
- if (workflowContext.workflowId) {
36
- context.workflow = {
37
- id: workflowContext.workflowId,
38
- };
39
- }
40
- return context;
41
- }
42
- exports.buildResolverContext = buildResolverContext;
43
- function resolvePathValue(path, context) {
44
- const segments = (0, parser_1.parsePathSegments)(path);
45
- let current = context;
46
- for (const segment of segments) {
47
- if (current === null || current === undefined) {
48
- return undefined;
49
- }
50
- if (/^\d+$/.test(segment) && Array.isArray(current)) {
51
- current = current[Number(segment)];
52
- }
53
- else if (typeof current === 'object') {
54
- current = current[segment];
55
- }
56
- else {
57
- return undefined;
58
- }
59
- }
60
- return current;
61
- }
62
- exports.resolvePathValue = resolvePathValue;
63
- function evaluateExpression(parsed, context, secretsMap) {
64
- switch (parsed.type) {
65
- case 'literal':
66
- return parsed.literalValue;
67
- case 'path':
68
- return evaluatePathExpression(parsed, context, secretsMap);
69
- case 'function':
70
- return evaluateFunctionExpression(parsed, context, secretsMap);
71
- case 'binary':
72
- return evaluateBinaryExpression(parsed, context, secretsMap);
73
- case 'unary':
74
- return evaluateUnaryExpression(parsed, context, secretsMap);
75
- case 'ternary':
76
- return evaluateTernaryExpression(parsed, context, secretsMap);
77
- case 'group':
78
- return evaluateExpression(parsed.expression, context, secretsMap);
79
- default:
80
- return undefined;
81
- }
82
- }
83
- exports.evaluateExpression = evaluateExpression;
84
- function evaluatePathExpression(parsed, context, secretsMap) {
85
- var _a;
86
- if (parsed.source === 'secret' && secretsMap && parsed.path) {
87
- const secretKey = parsed.path.replace('secret.', '');
88
- let value = (_a = secretsMap.get(secretKey)) !== null && _a !== void 0 ? _a : `[Secret: ${secretKey}]`;
89
- if (parsed.operations && parsed.operations.length > 0) {
90
- for (const op of parsed.operations) {
91
- try {
92
- const resolvedArgs = op.args.map((arg) => {
93
- if (typeof arg === 'string' && arg.includes('.')) {
94
- const resolved = resolvePathValue(arg, context);
95
- return resolved !== undefined ? resolved : arg;
96
- }
97
- return arg;
98
- });
99
- value = (0, pipes_1.executePipeOperation)(op.name, value, resolvedArgs);
100
- }
101
- catch (error) {
102
- return `[Error: ${error.message}]`;
103
- }
104
- }
105
- }
106
- return value;
107
- }
108
- let value = parsed.path ? resolvePathValue(parsed.path, context) : undefined;
109
- if (parsed.operations && parsed.operations.length > 0) {
110
- for (const op of parsed.operations) {
111
- try {
112
- const resolvedArgs = op.args.map((arg) => {
113
- if (typeof arg === 'string' && arg.includes('.')) {
114
- const resolved = resolvePathValue(arg, context);
115
- return resolved !== undefined ? resolved : arg;
116
- }
117
- return arg;
118
- });
119
- value = (0, pipes_1.executePipeOperation)(op.name, value, resolvedArgs);
120
- }
121
- catch (error) {
122
- return `[Error: ${error.message}]`;
123
- }
124
- }
125
- }
126
- return value;
127
- }
128
- function evaluateFunctionExpression(parsed, context, secretsMap) {
129
- if (!parsed.functionName) {
130
- return undefined;
131
- }
132
- const resolvedArgs = (parsed.functionArgs || []).map((arg) => {
133
- if (typeof arg === 'string' && arg.includes('.')) {
134
- const resolved = resolvePathValue(arg, context);
135
- return resolved !== undefined ? resolved : arg;
136
- }
137
- return arg;
138
- });
139
- try {
140
- let value = (0, functions_1.executeFunction)(parsed.functionName, resolvedArgs);
141
- if (parsed.operations && parsed.operations.length > 0) {
142
- for (const op of parsed.operations) {
143
- try {
144
- const resolvedPipeArgs = op.args.map((arg) => {
145
- if (typeof arg === 'string' && arg.includes('.')) {
146
- const resolved = resolvePathValue(arg, context);
147
- return resolved !== undefined ? resolved : arg;
148
- }
149
- return arg;
150
- });
151
- value = (0, pipes_1.executePipeOperation)(op.name, value, resolvedPipeArgs);
152
- }
153
- catch (error) {
154
- return `[Error: ${error.message}]`;
155
- }
156
- }
157
- }
158
- return value;
159
- }
160
- catch (error) {
161
- return `[Error: ${error.message}]`;
162
- }
163
- }
164
- function evaluateBinaryExpression(parsed, context, secretsMap) {
165
- const left = evaluateExpression(parsed.left, context, secretsMap);
166
- const right = evaluateExpression(parsed.right, context, secretsMap);
167
- switch (parsed.operator) {
168
- case '+':
169
- return left + right;
170
- case '-':
171
- return left - right;
172
- case '*':
173
- return left * right;
174
- case '/':
175
- return left / right;
176
- case '%':
177
- return left % right;
178
- case '**':
179
- return Math.pow(left, right);
180
- case '==':
181
- case '===':
182
- return left === right;
183
- case '!=':
184
- case '!==':
185
- return left !== right;
186
- case '<':
187
- return left < right;
188
- case '>':
189
- return left > right;
190
- case '<=':
191
- return left <= right;
192
- case '>=':
193
- return left >= right;
194
- case '&&':
195
- return left && right;
196
- case '||':
197
- return left || right;
198
- default:
199
- return undefined;
200
- }
201
- }
202
- function evaluateUnaryExpression(parsed, context, secretsMap) {
203
- const operand = evaluateExpression(parsed.operand, context, secretsMap);
204
- switch (parsed.operator) {
205
- case '!':
206
- return !operand;
207
- case '-':
208
- return -operand;
209
- default:
210
- return undefined;
211
- }
212
- }
213
- function evaluateTernaryExpression(parsed, context, secretsMap) {
214
- const condition = evaluateExpression(parsed.condition, context, secretsMap);
215
- return condition
216
- ? evaluateExpression(parsed.consequent, context, secretsMap)
217
- : evaluateExpression(parsed.alternate, context, secretsMap);
218
- }
219
- function interpolateString(template, context, secretsMap, options = {}) {
220
- const tokens = (0, parser_1.tokenizeTemplate)(template);
221
- let result = '';
222
- for (const token of tokens) {
223
- if (token.type === 'text') {
224
- result += token.value;
225
- }
226
- else if (token.type === 'expression') {
227
- try {
228
- const parsed = (0, parser_1.parseExpression)(token.value);
229
- let value = evaluateExpression(parsed, context, secretsMap);
230
- if (parsed.type === 'path' &&
231
- parsed.source === 'secret' &&
232
- options.maskSecrets) {
233
- result += '••••••••';
234
- }
235
- else if (value !== undefined && value !== null) {
236
- result +=
237
- typeof value === 'object' ? JSON.stringify(value) : String(value);
238
- }
239
- else {
240
- result += `{{${token.value}}}`;
241
- }
242
- }
243
- catch (error) {
244
- result += `[Error: ${error.message}]`;
245
- }
246
- }
247
- }
248
- return result;
249
- }
250
- exports.interpolateString = interpolateString;
251
- function resolveExpression(expression, context, secretsMap) {
252
- if (expression.includes('{{') && expression.includes('}}')) {
253
- const tokens = (0, parser_1.tokenizeTemplate)(expression);
254
- if (tokens.length === 1 && tokens[0].type === 'expression') {
255
- const parsed = (0, parser_1.parseExpression)(tokens[0].value);
256
- return evaluateExpression(parsed, context, secretsMap);
257
- }
258
- return interpolateString(expression, context, secretsMap);
259
- }
260
- const parsed = (0, parser_1.parseExpression)(expression);
261
- return evaluateExpression(parsed, context, secretsMap);
262
- }
263
- exports.resolveExpression = resolveExpression;
@@ -1,144 +0,0 @@
1
- export declare enum DataSourceType {
2
- WORKFLOW_TRIGGER = "trigger",
3
- WORKFLOW_STEPS = "steps",
4
- WORKFLOW_VARIABLES = "variables",
5
- IP_ADDRESSES = "ipAddress",
6
- DOMAINS = "domain",
7
- APPLICATIONS = "app",
8
- SECRETS = "secret",
9
- PROJECT = "project",
10
- ENV = "env",
11
- ABYSS_CONFIG = "abyss",
12
- FUNCTIONS = "fn"
13
- }
14
- export declare const OPERATOR_PRECEDENCE: Record<string, number>;
15
- export type ParsedExpression = PathExpression | FunctionExpression | BinaryExpression | UnaryExpression | TernaryExpression | LiteralExpression | GroupExpression;
16
- export interface BaseExpression {
17
- type: string;
18
- isValid: boolean;
19
- error?: string;
20
- }
21
- export interface PathExpression extends BaseExpression {
22
- type: 'path';
23
- path: string;
24
- source: DataSourceType | null;
25
- operations?: PipeOperation[];
26
- resolvedValue?: unknown;
27
- }
28
- export interface FunctionExpression extends BaseExpression {
29
- type: 'function';
30
- isFunction: true;
31
- functionName: string;
32
- functionArgs: unknown[];
33
- operations?: PipeOperation[];
34
- resolvedValue?: unknown;
35
- }
36
- export interface BinaryExpression extends BaseExpression {
37
- type: 'binary';
38
- operator: string;
39
- left: ParsedExpression;
40
- right: ParsedExpression;
41
- }
42
- export interface UnaryExpression extends BaseExpression {
43
- type: 'unary';
44
- operator: string;
45
- operand: ParsedExpression;
46
- }
47
- export interface TernaryExpression extends BaseExpression {
48
- type: 'ternary';
49
- condition: ParsedExpression;
50
- consequent: ParsedExpression;
51
- alternate: ParsedExpression;
52
- }
53
- export interface LiteralExpression extends BaseExpression {
54
- type: 'literal';
55
- literalType: 'string' | 'number' | 'boolean' | 'null';
56
- literalValue: unknown;
57
- }
58
- export interface GroupExpression extends BaseExpression {
59
- type: 'group';
60
- expression: ParsedExpression;
61
- }
62
- export interface PipeOperation {
63
- name: string;
64
- args: unknown[];
65
- description?: string;
66
- category?: OperationCategory;
67
- }
68
- export type OperationCategory = 'string' | 'array' | 'object' | 'number' | 'date' | 'encoding' | 'formatting';
69
- export interface BuiltInFunction {
70
- name: string;
71
- description: string;
72
- category: FunctionCategory;
73
- signature: string;
74
- args: FunctionArg[];
75
- returnType: string;
76
- examples: string[];
77
- execute: (...args: unknown[]) => unknown;
78
- }
79
- export type FunctionCategory = 'datetime' | 'string' | 'math' | 'crypto' | 'array' | 'utility' | 'encoding';
80
- export interface FunctionArg {
81
- name: string;
82
- type: string;
83
- required: boolean;
84
- description: string;
85
- }
86
- export interface WorkflowContext {
87
- projectId: string;
88
- projectName?: string;
89
- workflowId?: string;
90
- triggerData?: Record<string, unknown>;
91
- stepExecutions?: Record<string, StepExecution>;
92
- variables?: Record<string, unknown>;
93
- steps?: WorkflowStep[];
94
- }
95
- export interface StepExecution {
96
- stepId: string;
97
- outputData: unknown;
98
- status: 'success' | 'failed' | 'running' | 'pending';
99
- startedAt?: Date;
100
- completedAt?: Date;
101
- error?: string;
102
- }
103
- export interface WorkflowStep {
104
- id: string;
105
- name: string;
106
- type: string;
107
- config?: Record<string, unknown>;
108
- }
109
- export interface ExpressionToken {
110
- type: 'text' | 'expression' | 'reference' | 'function' | 'error';
111
- value: string;
112
- rawValue: string;
113
- start: number;
114
- end: number;
115
- parsed?: ParsedExpression;
116
- isSecret?: boolean;
117
- }
118
- export interface ValidationResult {
119
- isValid: boolean;
120
- errors: ValidationError[];
121
- warnings: ValidationWarning[];
122
- }
123
- export interface ValidationError {
124
- type: 'error';
125
- message: string;
126
- start: number;
127
- end: number;
128
- path?: string;
129
- }
130
- export interface ValidationWarning {
131
- type: 'warning';
132
- message: string;
133
- start: number;
134
- end: number;
135
- path?: string;
136
- suggestion?: string;
137
- }
138
- export interface WorkflowResourceMapping {
139
- source: DataSourceType;
140
- resourceId: string;
141
- resourceName: string;
142
- displayPath: string;
143
- savePath: string;
144
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPERATOR_PRECEDENCE = exports.DataSourceType = void 0;
4
- var DataSourceType;
5
- (function (DataSourceType) {
6
- DataSourceType["WORKFLOW_TRIGGER"] = "trigger";
7
- DataSourceType["WORKFLOW_STEPS"] = "steps";
8
- DataSourceType["WORKFLOW_VARIABLES"] = "variables";
9
- DataSourceType["IP_ADDRESSES"] = "ipAddress";
10
- DataSourceType["DOMAINS"] = "domain";
11
- DataSourceType["APPLICATIONS"] = "app";
12
- DataSourceType["SECRETS"] = "secret";
13
- DataSourceType["PROJECT"] = "project";
14
- DataSourceType["ENV"] = "env";
15
- DataSourceType["ABYSS_CONFIG"] = "abyss";
16
- DataSourceType["FUNCTIONS"] = "fn";
17
- })(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
18
- exports.OPERATOR_PRECEDENCE = {
19
- '||': 1,
20
- '&&': 2,
21
- '==': 3,
22
- '!=': 3,
23
- '<': 4,
24
- '>': 4,
25
- '<=': 4,
26
- '>=': 4,
27
- '+': 5,
28
- '-': 5,
29
- '*': 6,
30
- '/': 6,
31
- '%': 6,
32
- '**': 7,
33
- };
@@ -1 +0,0 @@
1
- export * from './expressions';