@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,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>;
@@ -1,256 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.datetimeFunctions = void 0;
4
- const date_fns_1 = require("date-fns");
5
- exports.datetimeFunctions = {
6
- now: {
7
- name: 'now',
8
- description: 'Returns the current date and time in ISO format',
9
- category: 'datetime',
10
- signature: 'now()',
11
- args: [],
12
- returnType: 'string',
13
- examples: ['{{fn.now()}}', '{{now()}}'],
14
- execute: () => new Date().toISOString(),
15
- },
16
- timestamp: {
17
- name: 'timestamp',
18
- description: 'Returns the current Unix timestamp in milliseconds',
19
- category: 'datetime',
20
- signature: 'timestamp()',
21
- args: [],
22
- returnType: 'number',
23
- examples: ['{{fn.timestamp()}}', '{{timestamp()}}'],
24
- execute: () => Date.now(),
25
- },
26
- formatDate: {
27
- name: 'formatDate',
28
- description: 'Formats a date string with the specified format',
29
- category: 'datetime',
30
- signature: 'formatDate(date, format)',
31
- args: [
32
- {
33
- name: 'date',
34
- type: 'string',
35
- required: true,
36
- description: 'ISO date string',
37
- },
38
- {
39
- name: 'format',
40
- type: 'string',
41
- required: true,
42
- description: 'Format pattern (e.g., yyyy-MM-dd)',
43
- },
44
- ],
45
- returnType: 'string',
46
- examples: ['{{fn.formatDate(trigger.createdAt, "yyyy-MM-dd")}}'],
47
- execute: (date, formatStr) => {
48
- const d = new Date(date);
49
- return (0, date_fns_1.format)(d, formatStr);
50
- },
51
- },
52
- addDays: {
53
- name: 'addDays',
54
- description: 'Adds days to a date',
55
- category: 'datetime',
56
- signature: 'addDays(date, days)',
57
- args: [
58
- {
59
- name: 'date',
60
- type: 'string',
61
- required: true,
62
- description: 'ISO date string',
63
- },
64
- {
65
- name: 'days',
66
- type: 'number',
67
- required: true,
68
- description: 'Number of days to add',
69
- },
70
- ],
71
- returnType: 'string',
72
- examples: ['{{fn.addDays(fn.now(), 7)}}'],
73
- execute: (date, days) => {
74
- const d = new Date(date);
75
- return (0, date_fns_1.addDays)(d, days).toISOString();
76
- },
77
- },
78
- addHours: {
79
- name: 'addHours',
80
- description: 'Adds hours to a date',
81
- category: 'datetime',
82
- signature: 'addHours(date, hours)',
83
- args: [
84
- {
85
- name: 'date',
86
- type: 'string',
87
- required: true,
88
- description: 'ISO date string',
89
- },
90
- {
91
- name: 'hours',
92
- type: 'number',
93
- required: true,
94
- description: 'Number of hours to add',
95
- },
96
- ],
97
- returnType: 'string',
98
- examples: ['{{fn.addHours(fn.now(), 24)}}'],
99
- execute: (date, hours) => {
100
- const d = new Date(date);
101
- return (0, date_fns_1.addHours)(d, hours).toISOString();
102
- },
103
- },
104
- addMinutes: {
105
- name: 'addMinutes',
106
- description: 'Adds minutes to a date',
107
- category: 'datetime',
108
- signature: 'addMinutes(date, minutes)',
109
- args: [
110
- {
111
- name: 'date',
112
- type: 'string',
113
- required: true,
114
- description: 'ISO date string',
115
- },
116
- {
117
- name: 'minutes',
118
- type: 'number',
119
- required: true,
120
- description: 'Number of minutes to add',
121
- },
122
- ],
123
- returnType: 'string',
124
- examples: ['{{fn.addMinutes(fn.now(), 30)}}'],
125
- execute: (date, minutes) => {
126
- const d = new Date(date);
127
- return (0, date_fns_1.addMinutes)(d, minutes).toISOString();
128
- },
129
- },
130
- addSeconds: {
131
- name: 'addSeconds',
132
- description: 'Adds seconds to a date',
133
- category: 'datetime',
134
- signature: 'addSeconds(date, seconds)',
135
- args: [
136
- {
137
- name: 'date',
138
- type: 'string',
139
- required: true,
140
- description: 'ISO date string',
141
- },
142
- {
143
- name: 'seconds',
144
- type: 'number',
145
- required: true,
146
- description: 'Number of seconds to add',
147
- },
148
- ],
149
- returnType: 'string',
150
- examples: ['{{fn.addSeconds(fn.now(), 60)}}'],
151
- execute: (date, seconds) => {
152
- const d = new Date(date);
153
- return (0, date_fns_1.addSeconds)(d, seconds).toISOString();
154
- },
155
- },
156
- diffDays: {
157
- name: 'diffDays',
158
- description: 'Returns the difference in days between two dates',
159
- category: 'datetime',
160
- signature: 'diffDays(date1, date2)',
161
- args: [
162
- {
163
- name: 'date1',
164
- type: 'string',
165
- required: true,
166
- description: 'First ISO date string',
167
- },
168
- {
169
- name: 'date2',
170
- type: 'string',
171
- required: true,
172
- description: 'Second ISO date string',
173
- },
174
- ],
175
- returnType: 'number',
176
- examples: ['{{fn.diffDays(trigger.startDate, fn.now())}}'],
177
- execute: (date1, date2) => {
178
- return (0, date_fns_1.differenceInDays)(new Date(date1), new Date(date2));
179
- },
180
- },
181
- diffHours: {
182
- name: 'diffHours',
183
- description: 'Returns the difference in hours between two dates',
184
- category: 'datetime',
185
- signature: 'diffHours(date1, date2)',
186
- args: [
187
- {
188
- name: 'date1',
189
- type: 'string',
190
- required: true,
191
- description: 'First ISO date string',
192
- },
193
- {
194
- name: 'date2',
195
- type: 'string',
196
- required: true,
197
- description: 'Second ISO date string',
198
- },
199
- ],
200
- returnType: 'number',
201
- examples: ['{{fn.diffHours(trigger.startDate, fn.now())}}'],
202
- execute: (date1, date2) => {
203
- return (0, date_fns_1.differenceInHours)(new Date(date1), new Date(date2));
204
- },
205
- },
206
- diffMinutes: {
207
- name: 'diffMinutes',
208
- description: 'Returns the difference in minutes between two dates',
209
- category: 'datetime',
210
- signature: 'diffMinutes(date1, date2)',
211
- args: [
212
- {
213
- name: 'date1',
214
- type: 'string',
215
- required: true,
216
- description: 'First ISO date string',
217
- },
218
- {
219
- name: 'date2',
220
- type: 'string',
221
- required: true,
222
- description: 'Second ISO date string',
223
- },
224
- ],
225
- returnType: 'number',
226
- examples: ['{{fn.diffMinutes(trigger.startDate, fn.now())}}'],
227
- execute: (date1, date2) => {
228
- return (0, date_fns_1.differenceInMinutes)(new Date(date1), new Date(date2));
229
- },
230
- },
231
- diffSeconds: {
232
- name: 'diffSeconds',
233
- description: 'Returns the difference in seconds between two dates',
234
- category: 'datetime',
235
- signature: 'diffSeconds(date1, date2)',
236
- args: [
237
- {
238
- name: 'date1',
239
- type: 'string',
240
- required: true,
241
- description: 'First ISO date string',
242
- },
243
- {
244
- name: 'date2',
245
- type: 'string',
246
- required: true,
247
- description: 'Second ISO date string',
248
- },
249
- ],
250
- returnType: 'number',
251
- examples: ['{{fn.diffSeconds(trigger.startDate, fn.now())}}'],
252
- execute: (date1, date2) => {
253
- return (0, date_fns_1.differenceInSeconds)(new Date(date1), new Date(date2));
254
- },
255
- },
256
- };
@@ -1,7 +0,0 @@
1
- import type { BuiltInFunction, FunctionCategory } from '../types';
2
- export declare const BUILT_IN_FUNCTIONS: Record<string, BuiltInFunction>;
3
- export declare function executeFunction(name: string, args: unknown[]): unknown;
4
- export declare function getFunctionsByCategory(category: FunctionCategory): Record<string, BuiltInFunction>;
5
- export declare function getFunctionNames(): string[];
6
- export declare function hasFunction(name: string): boolean;
7
- export declare function getFunction(name: string): BuiltInFunction | undefined;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFunction = exports.hasFunction = exports.getFunctionNames = exports.getFunctionsByCategory = exports.executeFunction = exports.BUILT_IN_FUNCTIONS = void 0;
4
- const datetime_1 = require("./datetime");
5
- const string_1 = require("./string");
6
- const math_1 = require("./math");
7
- const crypto_1 = require("./crypto");
8
- const array_1 = require("./array");
9
- const utility_1 = require("./utility");
10
- exports.BUILT_IN_FUNCTIONS = {
11
- ...datetime_1.datetimeFunctions,
12
- ...string_1.stringFunctions,
13
- ...math_1.mathFunctions,
14
- ...crypto_1.cryptoFunctions,
15
- ...array_1.arrayFunctions,
16
- ...utility_1.utilityFunctions,
17
- };
18
- function executeFunction(name, args) {
19
- const func = exports.BUILT_IN_FUNCTIONS[name];
20
- if (!func) {
21
- throw new Error(`Unknown function: ${name}`);
22
- }
23
- return func.execute(...args);
24
- }
25
- exports.executeFunction = executeFunction;
26
- function getFunctionsByCategory(category) {
27
- return Object.entries(exports.BUILT_IN_FUNCTIONS)
28
- .filter(([, func]) => func.category === category)
29
- .reduce((acc, [name, func]) => {
30
- acc[name] = func;
31
- return acc;
32
- }, {});
33
- }
34
- exports.getFunctionsByCategory = getFunctionsByCategory;
35
- function getFunctionNames() {
36
- return Object.keys(exports.BUILT_IN_FUNCTIONS);
37
- }
38
- exports.getFunctionNames = getFunctionNames;
39
- function hasFunction(name) {
40
- return name in exports.BUILT_IN_FUNCTIONS;
41
- }
42
- exports.hasFunction = hasFunction;
43
- function getFunction(name) {
44
- return exports.BUILT_IN_FUNCTIONS[name];
45
- }
46
- exports.getFunction = getFunction;
@@ -1,2 +0,0 @@
1
- import type { BuiltInFunction } from '../types';
2
- export declare const mathFunctions: Record<string, BuiltInFunction>;