@abyss-project/main 1.0.110 → 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 (245) 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 +7 -4
  10. package/dist/api/index.js +7 -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 +9 -6
  14. package/dist/api/organization-member.api.js +19 -7
  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/user-billing.api.d.ts +11 -0
  26. package/dist/api/user-billing.api.js +40 -0
  27. package/dist/api/user.api.d.ts +1 -4
  28. package/dist/api/user.api.js +1 -16
  29. package/dist/index.d.ts +1 -37
  30. package/dist/index.js +1 -37
  31. package/dist/permissions/ability.d.ts +12 -0
  32. package/dist/permissions/ability.js +134 -0
  33. package/dist/permissions/index.d.ts +1 -0
  34. package/dist/{workflow → permissions}/index.js +1 -1
  35. package/dist/types/enum/abyss-application-event.enum.d.ts +17 -1
  36. package/dist/types/enum/abyss-application-event.enum.js +16 -0
  37. package/dist/types/enum/index.d.ts +1 -4
  38. package/dist/types/enum/index.js +1 -4
  39. package/dist/types/enum/onboarding-steps.enum.d.ts +5 -3
  40. package/dist/types/enum/onboarding-steps.enum.js +5 -3
  41. package/dist/types/enum/organization-billing.enum.d.ts +70 -0
  42. package/dist/types/enum/organization-billing.enum.js +82 -0
  43. package/dist/types/enum/user-type.enum.d.ts +1 -0
  44. package/dist/types/enum/user-type.enum.js +1 -0
  45. package/dist/types/interface/api/index.d.ts +13 -8
  46. package/dist/types/interface/api/index.js +13 -8
  47. package/dist/types/interface/api/requests/billing-account.admin.request.d.ts +53 -0
  48. package/dist/types/interface/api/requests/billing-addon-template.request.d.ts +32 -0
  49. package/dist/types/interface/api/requests/billing-plan.request.d.ts +37 -0
  50. package/dist/types/interface/api/requests/organization-billing.request.d.ts +95 -0
  51. package/dist/types/interface/api/requests/organization-member.request.d.ts +13 -3
  52. package/dist/types/interface/api/requests/organization.request.d.ts +10 -0
  53. package/dist/types/interface/api/requests/project-access.admin.request.d.ts +1 -20
  54. package/dist/types/interface/api/requests/project-access.request.d.ts +16 -20
  55. package/dist/types/interface/api/requests/project-api-key.request.d.ts +39 -0
  56. package/dist/types/interface/api/requests/project.request.d.ts +2 -23
  57. package/dist/types/interface/api/requests/user-billing.request.d.ts +23 -0
  58. package/dist/types/interface/api/requests/user.request.d.ts +2 -8
  59. package/dist/types/interface/api/responses/billing-account.admin.response.d.ts +38 -0
  60. package/dist/types/interface/api/responses/billing-addon-template.response.d.ts +22 -0
  61. package/dist/types/interface/api/responses/billing-plan.response.d.ts +26 -0
  62. package/dist/types/interface/api/responses/gift-code.admin.response.d.ts +0 -1
  63. package/dist/types/interface/api/responses/gift-code.response.d.ts +0 -1
  64. package/dist/types/interface/api/responses/organization-billing.response.d.ts +82 -0
  65. package/dist/types/interface/api/responses/organization-member.response.d.ts +20 -8
  66. package/dist/types/interface/api/responses/project-access.admin.response.d.ts +0 -8
  67. package/dist/types/interface/api/responses/project-access.response.d.ts +16 -8
  68. package/dist/types/interface/api/responses/project-api-key.response.d.ts +26 -0
  69. package/dist/types/interface/api/responses/project.response.d.ts +0 -14
  70. package/dist/types/interface/api/responses/report.public.response.d.ts +0 -1
  71. package/dist/types/interface/api/responses/user-billing.response.d.ts +45 -0
  72. package/dist/types/interface/index.d.ts +13 -3
  73. package/dist/types/interface/index.js +13 -3
  74. package/dist/types/interface/models/application.model.d.ts +1 -1
  75. package/dist/types/interface/models/atlas-group.model.d.ts +2 -2
  76. package/dist/types/interface/models/atlas-page.model.d.ts +2 -2
  77. package/dist/types/interface/models/atlas.model.d.ts +8 -5
  78. package/dist/types/interface/models/billing-account.model.d.ts +40 -0
  79. package/dist/types/interface/models/billing-account.model.js +2 -0
  80. package/dist/types/interface/models/billing-addon-template.model.d.ts +15 -0
  81. package/dist/types/interface/models/billing-addon-template.model.js +2 -0
  82. package/dist/types/interface/models/board-card-checklist.model.d.ts +1 -1
  83. package/dist/types/interface/models/board-card.model.d.ts +6 -6
  84. package/dist/types/interface/models/board-column.model.d.ts +1 -1
  85. package/dist/types/interface/models/board.model.d.ts +7 -4
  86. package/dist/types/interface/models/credit-transaction.model.d.ts +22 -0
  87. package/dist/types/interface/models/credit-transaction.model.js +2 -0
  88. package/dist/types/interface/models/draw.model.d.ts +3 -0
  89. package/dist/types/interface/models/gift-code-activation.model.d.ts +4 -3
  90. package/dist/types/interface/models/gift-code.model.d.ts +1 -1
  91. package/dist/types/interface/models/invoice.model.d.ts +26 -0
  92. package/dist/types/interface/models/invoice.model.js +2 -0
  93. package/dist/types/interface/models/memo.model.d.ts +3 -0
  94. package/dist/types/interface/models/organization-billing.model.d.ts +37 -0
  95. package/dist/types/interface/models/organization-billing.model.js +2 -0
  96. package/dist/types/interface/models/organization-member.model.d.ts +0 -1
  97. package/dist/types/interface/models/organization-project-quota.model.d.ts +15 -0
  98. package/dist/types/interface/models/organization-project-quota.model.js +2 -0
  99. package/dist/types/interface/models/organization-quota-alert.model.d.ts +11 -0
  100. package/dist/types/interface/models/organization-quota-alert.model.js +2 -0
  101. package/dist/types/interface/models/organization-service-quota.model.d.ts +13 -0
  102. package/dist/types/interface/models/organization-service-quota.model.js +2 -0
  103. package/dist/types/interface/models/organization.model.d.ts +7 -0
  104. package/dist/types/interface/models/plan-template.model.d.ts +29 -0
  105. package/dist/types/interface/models/plan-template.model.js +2 -0
  106. package/dist/types/interface/models/project-access.model.d.ts +5 -6
  107. package/dist/types/interface/models/project-api-key-application-access.model.d.ts +13 -0
  108. package/dist/types/interface/models/project-api-key-application-access.model.js +2 -0
  109. package/dist/types/interface/models/project-api-key.model.d.ts +15 -0
  110. package/dist/types/interface/models/project-api-key.model.js +2 -0
  111. package/dist/types/interface/models/project.model.d.ts +8 -12
  112. package/dist/types/interface/models/quota-grant.model.d.ts +20 -0
  113. package/dist/types/interface/models/quota-grant.model.js +2 -0
  114. package/dist/types/interface/models/retrospective.model.d.ts +6 -3
  115. package/dist/types/interface/models/short-link.model.d.ts +4 -1
  116. package/dist/types/interface/models/team-project-access.model.d.ts +2 -0
  117. package/dist/types/interface/models/team-project-application-access.model.d.ts +13 -0
  118. package/dist/types/interface/models/team-project-application-access.model.js +2 -0
  119. package/dist/types/interface/models/team.model.d.ts +1 -1
  120. package/dist/types/interface/models/token-history.model.d.ts +2 -0
  121. package/dist/types/interface/models/usage-record.model.d.ts +24 -0
  122. package/dist/types/interface/models/usage-record.model.js +2 -0
  123. package/dist/types/interface/models/user-ticket-message.model.d.ts +1 -1
  124. package/dist/types/interface/models/user-ticket.model.d.ts +1 -1
  125. package/dist/types/interface/models/user.model.d.ts +16 -18
  126. package/dist/types/utils/onboarding.utils.d.ts +1 -6
  127. package/dist/types/utils/onboarding.utils.js +9 -5
  128. package/dist/utils/index.d.ts +0 -1
  129. package/dist/utils/index.js +0 -1
  130. package/package.json +2 -1
  131. package/dist/api/user-credit-purchase.admin.api.d.ts +0 -7
  132. package/dist/api/user-credit-purchase.admin.api.js +0 -28
  133. package/dist/api/user-credit-purchase.api.d.ts +0 -3
  134. package/dist/api/user-credit-purchase.api.js +0 -14
  135. package/dist/api/user-transaction.admin.api.d.ts +0 -5
  136. package/dist/api/user-transaction.admin.api.js +0 -20
  137. package/dist/api/user-transaction.api.d.ts +0 -3
  138. package/dist/api/user-transaction.api.js +0 -14
  139. package/dist/expressions/index.d.ts +0 -5
  140. package/dist/expressions/index.js +0 -16
  141. package/dist/expressions/mapper.d.ts +0 -9
  142. package/dist/expressions/mapper.js +0 -90
  143. package/dist/expressions/parser.d.ts +0 -3
  144. package/dist/expressions/parser.js +0 -97
  145. package/dist/expressions/resolver.d.ts +0 -12
  146. package/dist/expressions/resolver.js +0 -88
  147. package/dist/expressions/types.d.ts +0 -36
  148. package/dist/types/enum/integration-type.enum.d.ts +0 -4
  149. package/dist/types/enum/integration-type.enum.js +0 -8
  150. package/dist/types/enum/invoice-status.enum.d.ts +0 -7
  151. package/dist/types/enum/invoice-status.enum.js +0 -11
  152. package/dist/types/enum/organization-role.enum.d.ts +0 -6
  153. package/dist/types/enum/organization-role.enum.js +0 -10
  154. package/dist/types/enum/organization-subscription-status.enum.d.ts +0 -7
  155. package/dist/types/enum/organization-subscription-status.enum.js +0 -11
  156. package/dist/types/enum/plan-billing-period.enum.d.ts +0 -4
  157. package/dist/types/enum/plan-billing-period.enum.js +0 -8
  158. package/dist/types/enum/plan-status.enum.d.ts +0 -4
  159. package/dist/types/enum/plan-status.enum.js +0 -8
  160. package/dist/types/enum/subscription-level.enum.d.ts +0 -72
  161. package/dist/types/enum/subscription-level.enum.js +0 -179
  162. package/dist/types/enum/usage-record-type.enum.d.ts +0 -8
  163. package/dist/types/enum/usage-record-type.enum.js +0 -12
  164. package/dist/types/enum/user-credit-purchase-payment-method.enum.d.ts +0 -3
  165. package/dist/types/enum/user-credit-purchase-payment-method.enum.js +0 -7
  166. package/dist/types/enum/user-credit-purchase-platform.enum.d.ts +0 -8
  167. package/dist/types/enum/user-credit-purchase-platform.enum.js +0 -12
  168. package/dist/types/enum/user-transaction-type.enum.d.ts +0 -14
  169. package/dist/types/enum/user-transaction-type.enum.js +0 -18
  170. package/dist/types/interface/api/requests/user-credit-purchase.admin.request.d.ts +0 -42
  171. package/dist/types/interface/api/requests/user-credit-purchase.request.d.ts +0 -9
  172. package/dist/types/interface/api/requests/user-transaction.admin.request.d.ts +0 -30
  173. package/dist/types/interface/api/requests/user-transaction.request.d.ts +0 -8
  174. package/dist/types/interface/api/responses/user-credit-purchase.admin.response.d.ts +0 -22
  175. package/dist/types/interface/api/responses/user-credit-purchase.response.d.ts +0 -8
  176. package/dist/types/interface/api/responses/user-transaction.admin.response.d.ts +0 -13
  177. package/dist/types/interface/api/responses/user-transaction.response.d.ts +0 -11
  178. package/dist/types/interface/models/subscription.model.d.ts +0 -16
  179. package/dist/types/interface/models/user-credit-purchase.model.d.ts +0 -22
  180. package/dist/types/interface/models/user-transaction.model.d.ts +0 -19
  181. package/dist/utils/organization-permission.utils.d.ts +0 -3
  182. package/dist/utils/organization-permission.utils.js +0 -36
  183. package/dist/utils/subscription.utils.d.ts +0 -6
  184. package/dist/utils/subscription.utils.js +0 -41
  185. package/dist/workflow/expression/expression-functions.utils.d.ts +0 -6
  186. package/dist/workflow/expression/expression-functions.utils.js +0 -61
  187. package/dist/workflow/expression/expression-mapper.d.ts +0 -11
  188. package/dist/workflow/expression/expression-mapper.js +0 -32
  189. package/dist/workflow/expression/expression-mapping.utils.d.ts +0 -4
  190. package/dist/workflow/expression/expression-mapping.utils.js +0 -43
  191. package/dist/workflow/expression/expression-resolver.utils.d.ts +0 -3
  192. package/dist/workflow/expression/expression-resolver.utils.js +0 -54
  193. package/dist/workflow/expression/expression-tokenizer.utils.d.ts +0 -4
  194. package/dist/workflow/expression/expression-tokenizer.utils.js +0 -123
  195. package/dist/workflow/expression/expression.types.d.ts +0 -33
  196. package/dist/workflow/expression/expression.types.js +0 -17
  197. package/dist/workflow/expression/index.d.ts +0 -10
  198. package/dist/workflow/expression/index.js +0 -40
  199. package/dist/workflow/expression/workflow-resolver.d.ts +0 -9
  200. package/dist/workflow/expression/workflow-resolver.js +0 -102
  201. package/dist/workflow/expressions/functions/array.d.ts +0 -2
  202. package/dist/workflow/expressions/functions/array.js +0 -252
  203. package/dist/workflow/expressions/functions/crypto.d.ts +0 -2
  204. package/dist/workflow/expressions/functions/crypto.js +0 -101
  205. package/dist/workflow/expressions/functions/datetime.d.ts +0 -2
  206. package/dist/workflow/expressions/functions/datetime.js +0 -256
  207. package/dist/workflow/expressions/functions/index.d.ts +0 -7
  208. package/dist/workflow/expressions/functions/index.js +0 -46
  209. package/dist/workflow/expressions/functions/math.d.ts +0 -2
  210. package/dist/workflow/expressions/functions/math.js +0 -174
  211. package/dist/workflow/expressions/functions/string.d.ts +0 -2
  212. package/dist/workflow/expressions/functions/string.js +0 -301
  213. package/dist/workflow/expressions/functions/utility.d.ts +0 -2
  214. package/dist/workflow/expressions/functions/utility.js +0 -230
  215. package/dist/workflow/expressions/helpers.d.ts +0 -26
  216. package/dist/workflow/expressions/helpers.js +0 -132
  217. package/dist/workflow/expressions/index.d.ts +0 -15
  218. package/dist/workflow/expressions/index.js +0 -61
  219. package/dist/workflow/expressions/parser.d.ts +0 -8
  220. package/dist/workflow/expressions/parser.js +0 -436
  221. package/dist/workflow/expressions/pipes/array-pipes.d.ts +0 -2
  222. package/dist/workflow/expressions/pipes/array-pipes.js +0 -248
  223. package/dist/workflow/expressions/pipes/index.d.ts +0 -8
  224. package/dist/workflow/expressions/pipes/index.js +0 -40
  225. package/dist/workflow/expressions/pipes/object-pipes.d.ts +0 -2
  226. package/dist/workflow/expressions/pipes/object-pipes.js +0 -243
  227. package/dist/workflow/expressions/pipes/string-pipes.d.ts +0 -9
  228. package/dist/workflow/expressions/pipes/string-pipes.js +0 -178
  229. package/dist/workflow/expressions/resolver.d.ts +0 -8
  230. package/dist/workflow/expressions/resolver.js +0 -263
  231. package/dist/workflow/expressions/types.d.ts +0 -144
  232. package/dist/workflow/expressions/types.js +0 -33
  233. package/dist/workflow/index.d.ts +0 -1
  234. /package/dist/{expressions/types.js → types/interface/api/requests/billing-account.admin.request.js} +0 -0
  235. /package/dist/types/interface/api/requests/{user-credit-purchase.admin.request.js → billing-addon-template.request.js} +0 -0
  236. /package/dist/types/interface/api/requests/{user-credit-purchase.request.js → billing-plan.request.js} +0 -0
  237. /package/dist/types/interface/api/requests/{user-transaction.admin.request.js → organization-billing.request.js} +0 -0
  238. /package/dist/types/interface/api/requests/{user-transaction.request.js → project-api-key.request.js} +0 -0
  239. /package/dist/types/interface/api/{responses/user-credit-purchase.admin.response.js → requests/user-billing.request.js} +0 -0
  240. /package/dist/types/interface/api/responses/{user-credit-purchase.response.js → billing-account.admin.response.js} +0 -0
  241. /package/dist/types/interface/api/responses/{user-transaction.admin.response.js → billing-addon-template.response.js} +0 -0
  242. /package/dist/types/interface/api/responses/{user-transaction.response.js → billing-plan.response.js} +0 -0
  243. /package/dist/types/interface/{models/subscription.model.js → api/responses/organization-billing.response.js} +0 -0
  244. /package/dist/types/interface/{models/user-credit-purchase.model.js → api/responses/project-api-key.response.js} +0 -0
  245. /package/dist/types/interface/{models/user-transaction.model.js → api/responses/user-billing.response.js} +0 -0
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.extractPaths = exports.isDynamicExpression = exports.stringifyExpression = exports.parseExpression = exports.validateWorkflowExpression = exports.extractDataSources = exports.isWorkflowExpressionDynamic = exports.resolveWorkflowExpression = exports.buildPathSegment = exports.createWorkflowResourceMapping = exports.validateExpression = exports.extractMappings = exports.convertToSaveFormat = exports.convertToDisplayFormat = exports.DataSourceType = void 0;
18
- var expression_types_1 = require("./expression.types");
19
- Object.defineProperty(exports, "DataSourceType", { enumerable: true, get: function () { return expression_types_1.DataSourceType; } });
20
- var expression_mapper_1 = require("./expression-mapper");
21
- Object.defineProperty(exports, "convertToDisplayFormat", { enumerable: true, get: function () { return expression_mapper_1.convertToDisplayFormat; } });
22
- Object.defineProperty(exports, "convertToSaveFormat", { enumerable: true, get: function () { return expression_mapper_1.convertToSaveFormat; } });
23
- Object.defineProperty(exports, "extractMappings", { enumerable: true, get: function () { return expression_mapper_1.extractMappings; } });
24
- Object.defineProperty(exports, "validateExpression", { enumerable: true, get: function () { return expression_mapper_1.validateExpression; } });
25
- Object.defineProperty(exports, "createWorkflowResourceMapping", { enumerable: true, get: function () { return expression_mapper_1.createWorkflowResourceMapping; } });
26
- Object.defineProperty(exports, "buildPathSegment", { enumerable: true, get: function () { return expression_mapper_1.buildPathSegment; } });
27
- var workflow_resolver_1 = require("./workflow-resolver");
28
- Object.defineProperty(exports, "resolveWorkflowExpression", { enumerable: true, get: function () { return workflow_resolver_1.resolveWorkflowExpression; } });
29
- Object.defineProperty(exports, "isWorkflowExpressionDynamic", { enumerable: true, get: function () { return workflow_resolver_1.isWorkflowExpressionDynamic; } });
30
- Object.defineProperty(exports, "extractDataSources", { enumerable: true, get: function () { return workflow_resolver_1.extractDataSources; } });
31
- Object.defineProperty(exports, "validateWorkflowExpression", { enumerable: true, get: function () { return workflow_resolver_1.validateWorkflowExpression; } });
32
- var expressions_1 = require("../../expressions");
33
- Object.defineProperty(exports, "parseExpression", { enumerable: true, get: function () { return expressions_1.parseExpression; } });
34
- Object.defineProperty(exports, "stringifyExpression", { enumerable: true, get: function () { return expressions_1.stringifyExpression; } });
35
- Object.defineProperty(exports, "isDynamicExpression", { enumerable: true, get: function () { return expressions_1.isDynamicExpression; } });
36
- Object.defineProperty(exports, "extractPaths", { enumerable: true, get: function () { return expressions_1.extractPaths; } });
37
- __exportStar(require("./expression-resolver.utils"), exports);
38
- __exportStar(require("./expression-tokenizer.utils"), exports);
39
- __exportStar(require("./expression-functions.utils"), exports);
40
- __exportStar(require("./expression-mapping.utils"), exports);
@@ -1,9 +0,0 @@
1
- import { type ResolverOptions } from '../../expressions';
2
- import type { WorkflowExpressionContext, WorkflowExpressionResult, DataSourceType } from './expression.types';
3
- export declare function resolveWorkflowExpression(expression: string, context: WorkflowExpressionContext, options?: ResolverOptions): WorkflowExpressionResult;
4
- export declare function isWorkflowExpressionDynamic(expression: string): boolean;
5
- export declare function extractDataSources(expression: string): DataSourceType[];
6
- export declare function validateWorkflowExpression(expression: string): {
7
- valid: boolean;
8
- error?: string;
9
- };
@@ -1,102 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateWorkflowExpression = exports.extractDataSources = exports.isWorkflowExpressionDynamic = exports.resolveWorkflowExpression = void 0;
4
- const expressions_1 = require("../../expressions");
5
- function resolveWorkflowExpression(expression, context, options) {
6
- try {
7
- const paths = (0, expressions_1.extractPaths)(expression);
8
- const accessedSources = new Set();
9
- for (const path of paths) {
10
- const source = path.split('.')[0];
11
- accessedSources.add(source);
12
- }
13
- const value = (0, expressions_1.resolveExpression)(expression, context, {
14
- ...options,
15
- functions: {
16
- ...workflowFunctions,
17
- ...((options === null || options === void 0 ? void 0 : options.functions) || {}),
18
- },
19
- });
20
- return {
21
- value,
22
- success: true,
23
- accessedSources: Array.from(accessedSources),
24
- };
25
- }
26
- catch (error) {
27
- return {
28
- value: undefined,
29
- success: false,
30
- error: error instanceof Error ? error.message : String(error),
31
- accessedSources: [],
32
- };
33
- }
34
- }
35
- exports.resolveWorkflowExpression = resolveWorkflowExpression;
36
- const workflowFunctions = {
37
- upper: (str) => String(str).toUpperCase(),
38
- lower: (str) => String(str).toLowerCase(),
39
- trim: (str) => String(str).trim(),
40
- length: (str) => String(str).length,
41
- join: (arr, separator = ',') => {
42
- if (!Array.isArray(arr))
43
- return String(arr);
44
- return arr.join(String(separator));
45
- },
46
- first: (arr) => {
47
- if (!Array.isArray(arr))
48
- return arr;
49
- return arr[0];
50
- },
51
- last: (arr) => {
52
- if (!Array.isArray(arr))
53
- return arr;
54
- return arr[arr.length - 1];
55
- },
56
- now: () => new Date().toISOString(),
57
- timestamp: () => Date.now(),
58
- json: (obj) => JSON.stringify(obj),
59
- default: (value, defaultValue) => {
60
- return value === undefined || value === null ? defaultValue : value;
61
- },
62
- };
63
- function isWorkflowExpressionDynamic(expression) {
64
- return (0, expressions_1.isDynamicExpression)(expression);
65
- }
66
- exports.isWorkflowExpressionDynamic = isWorkflowExpressionDynamic;
67
- function extractDataSources(expression) {
68
- const paths = (0, expressions_1.extractPaths)(expression);
69
- const sources = new Set();
70
- for (const path of paths) {
71
- const source = path.split('.')[0];
72
- sources.add(source);
73
- }
74
- return Array.from(sources);
75
- }
76
- exports.extractDataSources = extractDataSources;
77
- function validateWorkflowExpression(expression) {
78
- try {
79
- const openCount = (expression.match(/\{\{/g) || []).length;
80
- const closeCount = (expression.match(/\}\}/g) || []).length;
81
- if (openCount !== closeCount) {
82
- return {
83
- valid: false,
84
- error: 'Mismatched expression delimiters',
85
- };
86
- }
87
- if (/\{\{\s*\}\}/.test(expression)) {
88
- return {
89
- valid: false,
90
- error: 'Empty expression found',
91
- };
92
- }
93
- return { valid: true };
94
- }
95
- catch (error) {
96
- return {
97
- valid: false,
98
- error: error instanceof Error ? error.message : String(error),
99
- };
100
- }
101
- }
102
- exports.validateWorkflowExpression = validateWorkflowExpression;
@@ -1,2 +0,0 @@
1
- import type { BuiltInFunction } from '../types';
2
- export declare const arrayFunctions: Record<string, BuiltInFunction>;
@@ -1,252 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.arrayFunctions = void 0;
4
- exports.arrayFunctions = {
5
- length: {
6
- name: 'length',
7
- description: 'Returns the length of a string or array',
8
- category: 'array',
9
- signature: 'length(value)',
10
- args: [
11
- {
12
- name: 'value',
13
- type: 'string|array',
14
- required: true,
15
- description: 'String or array',
16
- },
17
- ],
18
- returnType: 'number',
19
- examples: ['{{fn.length(trigger.items)}}'],
20
- execute: (value) => {
21
- if (typeof value === 'string') {
22
- return value.length;
23
- }
24
- if (Array.isArray(value)) {
25
- return value.length;
26
- }
27
- return 0;
28
- },
29
- },
30
- first: {
31
- name: 'first',
32
- description: 'Returns the first element of an array',
33
- category: 'array',
34
- signature: 'first(arr)',
35
- args: [
36
- {
37
- name: 'arr',
38
- type: 'array',
39
- required: true,
40
- description: 'Input array',
41
- },
42
- ],
43
- returnType: 'any',
44
- examples: ['{{fn.first(trigger.items)}}'],
45
- execute: (arr) => {
46
- if (Array.isArray(arr) && arr.length > 0) {
47
- return arr[0];
48
- }
49
- return undefined;
50
- },
51
- },
52
- last: {
53
- name: 'last',
54
- description: 'Returns the last element of an array',
55
- category: 'array',
56
- signature: 'last(arr)',
57
- args: [
58
- {
59
- name: 'arr',
60
- type: 'array',
61
- required: true,
62
- description: 'Input array',
63
- },
64
- ],
65
- returnType: 'any',
66
- examples: ['{{fn.last(trigger.items)}}'],
67
- execute: (arr) => {
68
- if (Array.isArray(arr) && arr.length > 0) {
69
- return arr[arr.length - 1];
70
- }
71
- return undefined;
72
- },
73
- },
74
- join: {
75
- name: 'join',
76
- description: 'Joins array elements into a string',
77
- category: 'array',
78
- signature: 'join(arr, separator)',
79
- args: [
80
- {
81
- name: 'arr',
82
- type: 'array',
83
- required: true,
84
- description: 'Input array',
85
- },
86
- {
87
- name: 'separator',
88
- type: 'string',
89
- required: false,
90
- description: 'Separator (default: ",")',
91
- },
92
- ],
93
- returnType: 'string',
94
- examples: ['{{fn.join(trigger.tags, ", ")}}'],
95
- execute: (arr, separator) => {
96
- if (!Array.isArray(arr)) {
97
- return '';
98
- }
99
- return arr.join(separator !== undefined ? String(separator) : ',');
100
- },
101
- },
102
- slice: {
103
- name: 'slice',
104
- description: 'Extracts a section of an array',
105
- category: 'array',
106
- signature: 'slice(arr, start, end?)',
107
- args: [
108
- {
109
- name: 'arr',
110
- type: 'array',
111
- required: true,
112
- description: 'Input array',
113
- },
114
- {
115
- name: 'start',
116
- type: 'number',
117
- required: true,
118
- description: 'Start index',
119
- },
120
- {
121
- name: 'end',
122
- type: 'number',
123
- required: false,
124
- description: 'End index',
125
- },
126
- ],
127
- returnType: 'array',
128
- examples: ['{{fn.slice(trigger.items, 0, 3)}}'],
129
- execute: (arr, start, end) => {
130
- if (!Array.isArray(arr)) {
131
- return [];
132
- }
133
- return arr.slice(Number(start), end !== undefined ? Number(end) : undefined);
134
- },
135
- },
136
- includes: {
137
- name: 'includes',
138
- description: 'Checks if an array includes a value',
139
- category: 'array',
140
- signature: 'includes(arr, value)',
141
- args: [
142
- {
143
- name: 'arr',
144
- type: 'array',
145
- required: true,
146
- description: 'Input array',
147
- },
148
- {
149
- name: 'value',
150
- type: 'any',
151
- required: true,
152
- description: 'Value to search for',
153
- },
154
- ],
155
- returnType: 'boolean',
156
- examples: ['{{fn.includes(trigger.roles, "admin")}}'],
157
- execute: (arr, value) => {
158
- if (!Array.isArray(arr)) {
159
- return false;
160
- }
161
- return arr.includes(value);
162
- },
163
- },
164
- reverse: {
165
- name: 'reverse',
166
- description: 'Reverses the order of array elements',
167
- category: 'array',
168
- signature: 'reverse(arr)',
169
- args: [
170
- {
171
- name: 'arr',
172
- type: 'array',
173
- required: true,
174
- description: 'Input array',
175
- },
176
- ],
177
- returnType: 'array',
178
- examples: ['{{fn.reverse(trigger.items)}}'],
179
- execute: (arr) => {
180
- if (!Array.isArray(arr)) {
181
- return [];
182
- }
183
- return [...arr].reverse();
184
- },
185
- },
186
- unique: {
187
- name: 'unique',
188
- description: 'Returns unique elements from an array',
189
- category: 'array',
190
- signature: 'unique(arr)',
191
- args: [
192
- {
193
- name: 'arr',
194
- type: 'array',
195
- required: true,
196
- description: 'Input array',
197
- },
198
- ],
199
- returnType: 'array',
200
- examples: ['{{fn.unique(trigger.tags)}}'],
201
- execute: (arr) => {
202
- if (!Array.isArray(arr)) {
203
- return [];
204
- }
205
- return Array.from(new Set(arr));
206
- },
207
- },
208
- flatten: {
209
- name: 'flatten',
210
- description: 'Flattens a nested array by one level',
211
- category: 'array',
212
- signature: 'flatten(arr)',
213
- args: [
214
- {
215
- name: 'arr',
216
- type: 'array',
217
- required: true,
218
- description: 'Input array',
219
- },
220
- ],
221
- returnType: 'array',
222
- examples: ['{{fn.flatten([[1, 2], [3, 4]])}}'],
223
- execute: (arr) => {
224
- if (!Array.isArray(arr)) {
225
- return [];
226
- }
227
- return arr.flat();
228
- },
229
- },
230
- compact: {
231
- name: 'compact',
232
- description: 'Removes falsy values from an array',
233
- category: 'array',
234
- signature: 'compact(arr)',
235
- args: [
236
- {
237
- name: 'arr',
238
- type: 'array',
239
- required: true,
240
- description: 'Input array',
241
- },
242
- ],
243
- returnType: 'array',
244
- examples: ['{{fn.compact([0, 1, false, 2, "", 3])}}'],
245
- execute: (arr) => {
246
- if (!Array.isArray(arr)) {
247
- return [];
248
- }
249
- return arr.filter(Boolean);
250
- },
251
- },
252
- };
@@ -1,2 +0,0 @@
1
- import type { BuiltInFunction } from '../types';
2
- export declare const cryptoFunctions: Record<string, BuiltInFunction>;
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cryptoFunctions = void 0;
4
- const crypto_1 = require("crypto");
5
- exports.cryptoFunctions = {
6
- md5: {
7
- name: 'md5',
8
- description: 'Generates an MD5 hash of the input string',
9
- category: 'crypto',
10
- signature: 'md5(str)',
11
- args: [
12
- {
13
- name: 'str',
14
- type: 'string',
15
- required: true,
16
- description: 'Input string',
17
- },
18
- ],
19
- returnType: 'string',
20
- examples: ['{{fn.md5(trigger.password)}}'],
21
- execute: (str) => {
22
- return (0, crypto_1.createHash)('md5').update(String(str)).digest('hex');
23
- },
24
- },
25
- sha1: {
26
- name: 'sha1',
27
- description: 'Generates a SHA-1 hash of the input string',
28
- category: 'crypto',
29
- signature: 'sha1(str)',
30
- args: [
31
- {
32
- name: 'str',
33
- type: 'string',
34
- required: true,
35
- description: 'Input string',
36
- },
37
- ],
38
- returnType: 'string',
39
- examples: ['{{fn.sha1(trigger.data)}}'],
40
- execute: (str) => {
41
- return (0, crypto_1.createHash)('sha1').update(String(str)).digest('hex');
42
- },
43
- },
44
- sha256: {
45
- name: 'sha256',
46
- description: 'Generates a SHA-256 hash of the input string',
47
- category: 'crypto',
48
- signature: 'sha256(str)',
49
- args: [
50
- {
51
- name: 'str',
52
- type: 'string',
53
- required: true,
54
- description: 'Input string',
55
- },
56
- ],
57
- returnType: 'string',
58
- examples: ['{{fn.sha256(trigger.data)}}'],
59
- execute: (str) => {
60
- return (0, crypto_1.createHash)('sha256').update(String(str)).digest('hex');
61
- },
62
- },
63
- sha512: {
64
- name: 'sha512',
65
- description: 'Generates a SHA-512 hash of the input string',
66
- category: 'crypto',
67
- signature: 'sha512(str)',
68
- args: [
69
- {
70
- name: 'str',
71
- type: 'string',
72
- required: true,
73
- description: 'Input string',
74
- },
75
- ],
76
- returnType: 'string',
77
- examples: ['{{fn.sha512(trigger.data)}}'],
78
- execute: (str) => {
79
- return (0, crypto_1.createHash)('sha512').update(String(str)).digest('hex');
80
- },
81
- },
82
- randomBytes: {
83
- name: 'randomBytes',
84
- description: 'Generates random bytes as a hex string',
85
- category: 'crypto',
86
- signature: 'randomBytes(size)',
87
- args: [
88
- {
89
- name: 'size',
90
- type: 'number',
91
- required: true,
92
- description: 'Number of bytes',
93
- },
94
- ],
95
- returnType: 'string',
96
- examples: ['{{fn.randomBytes(16)}}'],
97
- execute: (size) => {
98
- return (0, crypto_1.randomBytes)(Number(size)).toString('hex');
99
- },
100
- },
101
- };
@@ -1,2 +0,0 @@
1
- import type { BuiltInFunction } from '../types';
2
- export declare const datetimeFunctions: Record<string, BuiltInFunction>;