@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,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BUILT_IN_FUNCTIONS = exports.PIPE_OPERATIONS = exports.isoDate = exports.now = exports.random = exports.uuid = void 0;
4
- function uuid() {
5
- if (typeof crypto !== 'undefined' && crypto.randomUUID) {
6
- return crypto.randomUUID();
7
- }
8
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
9
- const r = (Math.random() * 16) | 0;
10
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
11
- return v.toString(16);
12
- });
13
- }
14
- exports.uuid = uuid;
15
- function random(min, max) {
16
- return Math.floor(Math.random() * (max - min + 1)) + min;
17
- }
18
- exports.random = random;
19
- function now() {
20
- return Date.now();
21
- }
22
- exports.now = now;
23
- function isoDate() {
24
- return new Date().toISOString();
25
- }
26
- exports.isoDate = isoDate;
27
- exports.PIPE_OPERATIONS = {
28
- lower: (value) => String(value).toLowerCase(),
29
- upper: (value) => String(value).toUpperCase(),
30
- trim: (value) => String(value).trim(),
31
- length: (value) => (Array.isArray(value) ? value.length : String(value).length),
32
- abs: (value) => Math.abs(Number(value)),
33
- round: (value) => Math.round(Number(value)),
34
- floor: (value) => Math.floor(Number(value)),
35
- ceil: (value) => Math.ceil(Number(value)),
36
- json: (value) => JSON.stringify(value),
37
- parse: (value) => {
38
- try {
39
- return JSON.parse(String(value));
40
- }
41
- catch {
42
- return value;
43
- }
44
- },
45
- isNumber: (value) => typeof value === 'number' && !isNaN(value),
46
- isString: (value) => typeof value === 'string',
47
- isArray: (value) => Array.isArray(value),
48
- isObject: (value) => typeof value === 'object' && value !== null,
49
- };
50
- exports.BUILT_IN_FUNCTIONS = {
51
- uuid,
52
- random: (...args) => random(Number(args[0]), Number(args[1])),
53
- now,
54
- isoDate,
55
- min: (...args) => Math.min(...args.map(Number)),
56
- max: (...args) => Math.max(...args.map(Number)),
57
- abs: (...args) => Math.abs(Number(args[0])),
58
- round: (...args) => Math.round(Number(args[0])),
59
- floor: (...args) => Math.floor(Number(args[0])),
60
- ceil: (...args) => Math.ceil(Number(args[0])),
61
- };
@@ -1,11 +0,0 @@
1
- import { type ExpressionMappingOptions } from '../../expressions';
2
- import type { WorkflowResourceMapping, DataSourceType } from './expression.types';
3
- export declare function convertToDisplayFormat(expression: string, mappings: WorkflowResourceMapping[], options?: ExpressionMappingOptions): string;
4
- export declare function convertToSaveFormat(expression: string, mappings: WorkflowResourceMapping[], options?: ExpressionMappingOptions): string;
5
- export declare function extractMappings(expression: string, mappings: WorkflowResourceMapping[]): WorkflowResourceMapping[];
6
- export declare function validateExpression(expression: string, mappings: WorkflowResourceMapping[]): {
7
- valid: boolean;
8
- missingReferences: string[];
9
- };
10
- export declare function createWorkflowResourceMapping(source: DataSourceType, resourceId: string, resourceName: string): WorkflowResourceMapping;
11
- export declare function buildPathSegment(source: DataSourceType, identifier: string): string;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildPathSegment = exports.createWorkflowResourceMapping = exports.validateExpression = exports.extractMappings = exports.convertToSaveFormat = exports.convertToDisplayFormat = void 0;
4
- const expressions_1 = require("../../expressions");
5
- function convertToDisplayFormat(expression, mappings, options) {
6
- return (0, expressions_1.convertToDisplayFormat)(expression, mappings, options);
7
- }
8
- exports.convertToDisplayFormat = convertToDisplayFormat;
9
- function convertToSaveFormat(expression, mappings, options) {
10
- return (0, expressions_1.convertToSaveFormat)(expression, mappings, options);
11
- }
12
- exports.convertToSaveFormat = convertToSaveFormat;
13
- function extractMappings(expression, mappings) {
14
- return (0, expressions_1.extractMappings)(expression, mappings);
15
- }
16
- exports.extractMappings = extractMappings;
17
- function validateExpression(expression, mappings) {
18
- return (0, expressions_1.validateExpression)(expression, mappings);
19
- }
20
- exports.validateExpression = validateExpression;
21
- function createWorkflowResourceMapping(source, resourceId, resourceName) {
22
- return (0, expressions_1.createResourceMapping)(source, resourceId, resourceName, buildPathSegment);
23
- }
24
- exports.createWorkflowResourceMapping = createWorkflowResourceMapping;
25
- function buildPathSegment(source, identifier) {
26
- const escapedId = identifier.replace(/[.\[\]]/g, '\\$&');
27
- if (/[\s."']/.test(identifier)) {
28
- return `${source}["${identifier}"]`;
29
- }
30
- return `${source}.${escapedId}`;
31
- }
32
- exports.buildPathSegment = buildPathSegment;
@@ -1,4 +0,0 @@
1
- import { ResourceMapping } from './expression.types';
2
- export declare function convertExpressionToSaveFormat(expression: string, mappings: ResourceMapping[]): string;
3
- export declare function convertExpressionToDisplayFormat(expression: string, mappings: ResourceMapping[]): string;
4
- export declare function extractExpressionTokens(text: string): string[];
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractExpressionTokens = exports.convertExpressionToDisplayFormat = exports.convertExpressionToSaveFormat = void 0;
4
- const expression_tokenizer_utils_1 = require("./expression-tokenizer.utils");
5
- function convertExpressionToSaveFormat(expression, mappings) {
6
- if (!expression || mappings.length === 0) {
7
- return expression;
8
- }
9
- let result = expression;
10
- const sortedMappings = [...mappings].sort((a, b) => b.displayPath.length - a.displayPath.length);
11
- for (const mapping of sortedMappings) {
12
- const displayPattern = escapeRegExp(mapping.displayPath);
13
- const regex = new RegExp(displayPattern, 'g');
14
- result = result.replace(regex, mapping.savePath);
15
- }
16
- return result;
17
- }
18
- exports.convertExpressionToSaveFormat = convertExpressionToSaveFormat;
19
- function convertExpressionToDisplayFormat(expression, mappings) {
20
- if (!expression || mappings.length === 0) {
21
- return expression;
22
- }
23
- let result = expression;
24
- const sortedMappings = [...mappings].sort((a, b) => b.savePath.length - a.savePath.length);
25
- for (const mapping of sortedMappings) {
26
- const savePattern = escapeRegExp(mapping.savePath);
27
- const regex = new RegExp(savePattern, 'g');
28
- result = result.replace(regex, mapping.displayPath);
29
- }
30
- return result;
31
- }
32
- exports.convertExpressionToDisplayFormat = convertExpressionToDisplayFormat;
33
- function escapeRegExp(str) {
34
- return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
35
- }
36
- function extractExpressionTokens(text) {
37
- const tokens = (0, expression_tokenizer_utils_1.tokenize)(text);
38
- const expressions = tokens
39
- .filter((token) => token.type === 'expression')
40
- .map((token) => token.value);
41
- return Array.from(new Set(expressions));
42
- }
43
- exports.extractExpressionTokens = extractExpressionTokens;
@@ -1,3 +0,0 @@
1
- export declare function resolvePathValue(path: string, context: Record<string, unknown>): unknown;
2
- export declare function resolveExpressions(text: string, context: Record<string, unknown>): string;
3
- export declare function isTruthy(value: unknown): boolean;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTruthy = exports.resolveExpressions = exports.resolvePathValue = void 0;
4
- const expression_tokenizer_utils_1 = require("./expression-tokenizer.utils");
5
- function resolvePathValue(path, context) {
6
- const segments = (0, expression_tokenizer_utils_1.parsePathSegments)(path);
7
- let current = context;
8
- for (const segment of segments) {
9
- if (current === null || current === undefined) {
10
- return undefined;
11
- }
12
- if (/^\d+$/.test(segment) && Array.isArray(current)) {
13
- current = current[Number(segment)];
14
- }
15
- else {
16
- current = current[segment];
17
- }
18
- }
19
- return current;
20
- }
21
- exports.resolvePathValue = resolvePathValue;
22
- function resolveExpressions(text, context) {
23
- return text.replace(/\{\{(.+?)\}\}/g, (match, path) => {
24
- const trimmedPath = path.trim();
25
- const value = resolvePathValue(trimmedPath, context);
26
- if (value === undefined || value === null) {
27
- return match;
28
- }
29
- if (typeof value === 'object') {
30
- return JSON.stringify(value);
31
- }
32
- return String(value);
33
- });
34
- }
35
- exports.resolveExpressions = resolveExpressions;
36
- function isTruthy(value) {
37
- if (value === null || value === undefined) {
38
- return false;
39
- }
40
- if (typeof value === 'boolean') {
41
- return value;
42
- }
43
- if (typeof value === 'number') {
44
- return value !== 0;
45
- }
46
- if (typeof value === 'string') {
47
- return value.length > 0;
48
- }
49
- if (Array.isArray(value)) {
50
- return value.length > 0;
51
- }
52
- return true;
53
- }
54
- exports.isTruthy = isTruthy;
@@ -1,4 +0,0 @@
1
- import { ExpressionToken, DataSourceType } from './expression.types';
2
- export declare function detectDataSource(path: string): DataSourceType | null;
3
- export declare function tokenize(text: string): ExpressionToken[];
4
- export declare function parsePathSegments(path: string): string[];
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parsePathSegments = exports.tokenize = exports.detectDataSource = void 0;
4
- const expression_types_1 = require("./expression.types");
5
- const EXPRESSION_PATTERN = /\{\{(.+?)\}\}/g;
6
- const REFERENCE_PATTERN = /@(\w+):([a-zA-Z0-9-_]+)/g;
7
- const DATA_SOURCE_PREFIXES = {
8
- trigger: expression_types_1.DataSourceType.WORKFLOW_TRIGGER,
9
- triggerData: expression_types_1.DataSourceType.WORKFLOW_TRIGGER,
10
- steps: expression_types_1.DataSourceType.WORKFLOW_STEPS,
11
- variables: expression_types_1.DataSourceType.WORKFLOW_VARIABLES,
12
- secret: expression_types_1.DataSourceType.SECRETS,
13
- ipAddress: expression_types_1.DataSourceType.IP_ADDRESSES,
14
- domain: expression_types_1.DataSourceType.DOMAINS,
15
- abyss: expression_types_1.DataSourceType.ABYSS_CONFIG,
16
- app: expression_types_1.DataSourceType.APPLICATIONS,
17
- project: expression_types_1.DataSourceType.PROJECT,
18
- env: expression_types_1.DataSourceType.ENV,
19
- fn: expression_types_1.DataSourceType.FUNCTIONS,
20
- };
21
- function detectDataSource(path) {
22
- const firstDot = path.indexOf('.');
23
- const firstBracket = path.indexOf('[');
24
- let prefix;
25
- if (firstDot === -1 && firstBracket === -1) {
26
- prefix = path;
27
- }
28
- else if (firstDot === -1) {
29
- prefix = path.substring(0, firstBracket);
30
- }
31
- else if (firstBracket === -1) {
32
- prefix = path.substring(0, firstDot);
33
- }
34
- else {
35
- prefix = path.substring(0, Math.min(firstDot, firstBracket));
36
- }
37
- return DATA_SOURCE_PREFIXES[prefix] || null;
38
- }
39
- exports.detectDataSource = detectDataSource;
40
- function tokenize(text) {
41
- const tokens = [];
42
- let lastIndex = 0;
43
- const expressionMatches = Array.from(text.matchAll(EXPRESSION_PATTERN));
44
- for (const match of expressionMatches) {
45
- const matchIndex = match.index;
46
- if (matchIndex > lastIndex) {
47
- tokens.push({
48
- type: 'text',
49
- value: text.substring(lastIndex, matchIndex),
50
- });
51
- }
52
- tokens.push({
53
- type: 'expression',
54
- value: match[1].trim(),
55
- raw: match[0],
56
- });
57
- lastIndex = matchIndex + match[0].length;
58
- }
59
- if (lastIndex < text.length) {
60
- tokens.push({
61
- type: 'text',
62
- value: text.substring(lastIndex),
63
- });
64
- }
65
- const referenceMatches = Array.from(text.matchAll(REFERENCE_PATTERN));
66
- for (const match of referenceMatches) {
67
- tokens.push({
68
- type: 'reference',
69
- entityType: match[1],
70
- entityId: match[2],
71
- });
72
- }
73
- return tokens;
74
- }
75
- exports.tokenize = tokenize;
76
- function parsePathSegments(path) {
77
- const segments = [];
78
- let current = '';
79
- let inBrackets = false;
80
- let quoteChar = null;
81
- for (let i = 0; i < path.length; i++) {
82
- const char = path[i];
83
- if (quoteChar) {
84
- if (char === quoteChar && path[i - 1] !== '\\') {
85
- quoteChar = null;
86
- }
87
- else if (char !== quoteChar) {
88
- current += char;
89
- }
90
- }
91
- else if (char === '"' || char === "'") {
92
- quoteChar = char;
93
- }
94
- else if (char === '[') {
95
- if (current) {
96
- segments.push(current);
97
- current = '';
98
- }
99
- inBrackets = true;
100
- }
101
- else if (char === ']') {
102
- if (current) {
103
- segments.push(current);
104
- current = '';
105
- }
106
- inBrackets = false;
107
- }
108
- else if (char === '.' && !inBrackets) {
109
- if (current) {
110
- segments.push(current);
111
- current = '';
112
- }
113
- }
114
- else {
115
- current += char;
116
- }
117
- }
118
- if (current) {
119
- segments.push(current);
120
- }
121
- return segments;
122
- }
123
- exports.parsePathSegments = parsePathSegments;
@@ -1,33 +0,0 @@
1
- import type { ResourceMapping as GenericResourceMapping } from '../../expressions';
2
- export declare enum DataSourceType {
3
- WORKFLOW_TRIGGER = "trigger",
4
- WORKFLOW_STEPS = "steps",
5
- WORKFLOW_VARIABLES = "variables",
6
- SECRETS = "secret",
7
- IP_ADDRESSES = "ipAddress",
8
- DOMAINS = "domain",
9
- APPLICATIONS = "app",
10
- ABYSS_CONFIG = "abyss",
11
- PROJECT = "project",
12
- ENV = "env",
13
- FUNCTIONS = "fn"
14
- }
15
- export type WorkflowResourceMapping = GenericResourceMapping<DataSourceType>;
16
- export interface WorkflowExpressionContext {
17
- trigger?: Record<string, unknown>;
18
- steps?: Record<string, unknown>;
19
- variables?: Record<string, unknown>;
20
- secret?: Record<string, unknown>;
21
- ipAddress?: Record<string, unknown>;
22
- domain?: Record<string, unknown>;
23
- app?: Record<string, unknown>;
24
- abyss?: Record<string, unknown>;
25
- project?: Record<string, unknown>;
26
- env?: Record<string, unknown>;
27
- }
28
- export interface WorkflowExpressionResult {
29
- value: unknown;
30
- success: boolean;
31
- error?: string;
32
- accessedSources: DataSourceType[];
33
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- 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["SECRETS"] = "secret";
10
- DataSourceType["IP_ADDRESSES"] = "ipAddress";
11
- DataSourceType["DOMAINS"] = "domain";
12
- DataSourceType["APPLICATIONS"] = "app";
13
- DataSourceType["ABYSS_CONFIG"] = "abyss";
14
- DataSourceType["PROJECT"] = "project";
15
- DataSourceType["ENV"] = "env";
16
- DataSourceType["FUNCTIONS"] = "fn";
17
- })(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
@@ -1,10 +0,0 @@
1
- export type { WorkflowResourceMapping, WorkflowExpressionContext, WorkflowExpressionResult, } from './expression.types';
2
- export { DataSourceType } from './expression.types';
3
- export { convertToDisplayFormat, convertToSaveFormat, extractMappings, validateExpression, createWorkflowResourceMapping, buildPathSegment, } from './expression-mapper';
4
- export { resolveWorkflowExpression, isWorkflowExpressionDynamic, extractDataSources, validateWorkflowExpression, } from './workflow-resolver';
5
- export type { ExpressionMappingOptions, ExpressionParserConfig, ResolverOptions, } from '../../expressions';
6
- export { parseExpression, stringifyExpression, isDynamicExpression, extractPaths, } from '../../expressions';
7
- export * from './expression-resolver.utils';
8
- export * from './expression-tokenizer.utils';
9
- export * from './expression-functions.utils';
10
- export * from './expression-mapping.utils';
@@ -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>;