@activepieces/shared 0.80.0 → 0.80.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/package.json +2 -1
  2. package/src/index.d.ts +4 -0
  3. package/src/index.d.ts.map +1 -1
  4. package/src/index.js +5 -0
  5. package/src/index.js.map +1 -1
  6. package/src/lib/automation/engine/execution-errors.d.ts +7 -0
  7. package/src/lib/automation/engine/execution-errors.d.ts.map +1 -1
  8. package/src/lib/automation/engine/execution-errors.js +7 -1
  9. package/src/lib/automation/engine/execution-errors.js.map +1 -1
  10. package/src/lib/core/license-keys/index.d.ts +2 -0
  11. package/src/lib/core/license-keys/index.d.ts.map +1 -1
  12. package/src/lib/core/license-keys/index.js +1 -0
  13. package/src/lib/core/license-keys/index.js.map +1 -1
  14. package/src/lib/ee/billing/index.d.ts.map +1 -1
  15. package/src/lib/ee/billing/index.js +2 -0
  16. package/src/lib/ee/billing/index.js.map +1 -1
  17. package/src/lib/ee/chat/index.d.ts +27 -2
  18. package/src/lib/ee/chat/index.d.ts.map +1 -1
  19. package/src/lib/ee/chat/index.js +6 -0
  20. package/src/lib/ee/chat/index.js.map +1 -1
  21. package/src/lib/formula/formula-evaluator.d.ts +22 -0
  22. package/src/lib/formula/formula-evaluator.d.ts.map +1 -0
  23. package/src/lib/formula/formula-evaluator.js +438 -0
  24. package/src/lib/formula/formula-evaluator.js.map +1 -0
  25. package/src/lib/formula/function-implementations.d.ts +9 -0
  26. package/src/lib/formula/function-implementations.d.ts.map +1 -0
  27. package/src/lib/formula/function-implementations.js +333 -0
  28. package/src/lib/formula/function-implementations.js.map +1 -0
  29. package/src/lib/formula/function-registry.d.ts +25 -0
  30. package/src/lib/formula/function-registry.d.ts.map +1 -0
  31. package/src/lib/formula/function-registry.js +978 -0
  32. package/src/lib/formula/function-registry.js.map +1 -0
  33. package/src/lib/formula/function-type-checker.d.ts +9 -0
  34. package/src/lib/formula/function-type-checker.d.ts.map +1 -0
  35. package/src/lib/formula/function-type-checker.js +206 -0
  36. package/src/lib/formula/function-type-checker.js.map +1 -0
  37. package/src/lib/management/platform/platform.model.d.ts +4 -0
  38. package/src/lib/management/platform/platform.model.d.ts.map +1 -1
  39. package/src/lib/management/platform/platform.model.js +1 -1
  40. package/src/lib/management/platform/platform.model.js.map +1 -1
@@ -0,0 +1,978 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AP_FUNCTIONS = void 0;
4
+ exports.AP_FUNCTIONS = [
5
+ {
6
+ name: 'combine',
7
+ category: 'text',
8
+ description: 'Joins two or more values into one piece of text.',
9
+ syntax: 'combine(text1; text2; separator)',
10
+ example: 'combine( John ; Smith ; " " )',
11
+ exampleResult: 'John Smith',
12
+ minArgs: 2,
13
+ maxArgs: 3,
14
+ argTypes: ['string', 'string', 'string'],
15
+ returnType: 'string',
16
+ },
17
+ {
18
+ name: 'uppercase',
19
+ category: 'text',
20
+ description: 'Changes all characters to uppercase.',
21
+ syntax: 'uppercase(text)',
22
+ example: 'uppercase( acme inc )',
23
+ exampleResult: 'ACME INC',
24
+ minArgs: 1,
25
+ maxArgs: 1,
26
+ argTypes: ['string'],
27
+ returnType: 'string',
28
+ },
29
+ {
30
+ name: 'lowercase',
31
+ category: 'text',
32
+ description: 'Changes all characters to lowercase.',
33
+ syntax: 'lowercase(text)',
34
+ example: 'lowercase( John@ACME.com )',
35
+ exampleResult: 'john@acme.com',
36
+ minArgs: 1,
37
+ maxArgs: 1,
38
+ argTypes: ['string'],
39
+ returnType: 'string',
40
+ },
41
+ {
42
+ name: 'titlecase',
43
+ category: 'text',
44
+ description: 'Capitalizes the first letter of every word.',
45
+ syntax: 'titlecase(text)',
46
+ example: 'titlecase( john smith )',
47
+ exampleResult: 'John Smith',
48
+ minArgs: 1,
49
+ maxArgs: 1,
50
+ argTypes: ['string'],
51
+ returnType: 'string',
52
+ },
53
+ {
54
+ name: 'trim',
55
+ category: 'text',
56
+ description: 'Removes space characters at the start and end.',
57
+ syntax: 'trim(text)',
58
+ example: 'trim( Hello World )',
59
+ exampleResult: 'Hello World',
60
+ minArgs: 1,
61
+ maxArgs: 1,
62
+ argTypes: ['string'],
63
+ returnType: 'string',
64
+ },
65
+ {
66
+ name: 'prefix',
67
+ category: 'text',
68
+ description: 'Adds text before a value.',
69
+ syntax: 'prefix(text; value)',
70
+ example: 'prefix( 10042 ; ORD- )',
71
+ exampleResult: 'ORD-10042',
72
+ minArgs: 2,
73
+ maxArgs: 2,
74
+ argTypes: ['string', 'string'],
75
+ returnType: 'string',
76
+ },
77
+ {
78
+ name: 'suffix',
79
+ category: 'text',
80
+ description: 'Adds text after a value.',
81
+ syntax: 'suffix(text; value)',
82
+ example: 'suffix( Acme ; Ltd. )',
83
+ exampleResult: 'Acme Ltd.',
84
+ minArgs: 2,
85
+ maxArgs: 2,
86
+ argTypes: ['string', 'string'],
87
+ returnType: 'string',
88
+ },
89
+ {
90
+ name: 'replace',
91
+ category: 'text',
92
+ description: 'Finds a word or character and swaps it for another.',
93
+ syntax: 'replace(text; find; with)',
94
+ example: 'replace( first_name ; "_"; " " )',
95
+ exampleResult: 'first name',
96
+ minArgs: 3,
97
+ maxArgs: 3,
98
+ argTypes: ['string', 'string', 'string'],
99
+ returnType: 'string',
100
+ },
101
+ {
102
+ name: 'remove',
103
+ category: 'text',
104
+ description: 'Deletes every occurrence of a character or word.',
105
+ syntax: 'remove(text; value)',
106
+ example: 'remove( 004-420-712 ; "-" )',
107
+ exampleResult: '004420712',
108
+ minArgs: 2,
109
+ maxArgs: 2,
110
+ argTypes: ['string', 'string'],
111
+ returnType: 'string',
112
+ },
113
+ {
114
+ name: 'first_n',
115
+ category: 'text',
116
+ description: 'Returns only the first N characters.',
117
+ syntax: 'first_n(text; n)',
118
+ example: 'first_n( Jonathan ; 3 )',
119
+ exampleResult: 'Jon',
120
+ minArgs: 2,
121
+ maxArgs: 2,
122
+ argTypes: ['string', 'number'],
123
+ returnType: 'string',
124
+ },
125
+ {
126
+ name: 'last_n',
127
+ category: 'text',
128
+ description: 'Returns only the last N characters.',
129
+ syntax: 'last_n(text; n)',
130
+ example: 'last_n( ACC-7890 ; 4 )',
131
+ exampleResult: '7890',
132
+ minArgs: 2,
133
+ maxArgs: 2,
134
+ argTypes: ['string', 'number'],
135
+ returnType: 'string',
136
+ },
137
+ {
138
+ name: 'truncate',
139
+ category: 'text',
140
+ description: 'Cuts text to N characters and adds \'...\' at the end.',
141
+ syntax: 'truncate(text; n)',
142
+ example: 'truncate( Annual Revenue Report ; 14 )',
143
+ exampleResult: 'Annual Revenue...',
144
+ minArgs: 2,
145
+ maxArgs: 2,
146
+ argTypes: ['string', 'number'],
147
+ returnType: 'string',
148
+ },
149
+ {
150
+ name: 'split',
151
+ category: 'text',
152
+ description: 'Breaks text into parts and returns one of them.',
153
+ syntax: 'split(text; separator; index)',
154
+ example: 'split( John Smith ; " "; 0 )',
155
+ exampleResult: 'John',
156
+ minArgs: 3,
157
+ maxArgs: 3,
158
+ argTypes: ['string', 'string', 'number'],
159
+ returnType: 'string',
160
+ },
161
+ {
162
+ name: 'extract_between',
163
+ category: 'text',
164
+ description: 'Returns the text sitting between two markers.',
165
+ syntax: 'extract_between(text; start; end)',
166
+ example: 'extract_between( Status [urgent] ; "["; "]" )',
167
+ exampleResult: 'urgent',
168
+ minArgs: 3,
169
+ maxArgs: 3,
170
+ argTypes: ['string', 'string', 'string'],
171
+ returnType: 'string',
172
+ },
173
+ {
174
+ name: 'extract_email',
175
+ category: 'text',
176
+ description: 'Finds and returns the first email address in a text.',
177
+ syntax: 'extract_email(text)',
178
+ example: 'extract_email( Contact john@acme.com for help )',
179
+ exampleResult: 'john@acme.com',
180
+ minArgs: 1,
181
+ maxArgs: 1,
182
+ argTypes: ['string'],
183
+ returnType: 'string',
184
+ },
185
+ {
186
+ name: 'extract_url',
187
+ category: 'text',
188
+ description: 'Finds and returns the first URL in a text.',
189
+ syntax: 'extract_url(text)',
190
+ example: 'extract_url( Visit https://acme.com today )',
191
+ exampleResult: 'https://acme.com',
192
+ minArgs: 1,
193
+ maxArgs: 1,
194
+ argTypes: ['string'],
195
+ returnType: 'string',
196
+ },
197
+ {
198
+ name: 'length',
199
+ category: 'text',
200
+ description: 'Counts how many characters are in the text.',
201
+ syntax: 'length(text)',
202
+ example: 'length( Hello World )',
203
+ exampleResult: '11',
204
+ minArgs: 1,
205
+ maxArgs: 1,
206
+ argTypes: ['string'],
207
+ returnType: 'number',
208
+ },
209
+ {
210
+ name: 'contains',
211
+ category: 'text',
212
+ description: 'Checks if the text has a specific word or character in it.',
213
+ syntax: 'contains(text; value)',
214
+ example: 'contains( bug, urgent, backend ; urgent )',
215
+ exampleResult: 'TRUE',
216
+ minArgs: 2,
217
+ maxArgs: 2,
218
+ argTypes: ['string', 'string'],
219
+ returnType: 'boolean',
220
+ },
221
+ {
222
+ name: 'starts_with',
223
+ category: 'text',
224
+ description: 'Checks if the text begins with a specific value.',
225
+ syntax: 'starts_with(text; value)',
226
+ example: 'starts_with( support@acme.com ; info@ )',
227
+ exampleResult: 'FALSE',
228
+ minArgs: 2,
229
+ maxArgs: 2,
230
+ argTypes: ['string', 'string'],
231
+ returnType: 'boolean',
232
+ },
233
+ {
234
+ name: 'ends_with',
235
+ category: 'text',
236
+ description: 'Checks if the text ends with a specific value.',
237
+ syntax: 'ends_with(text; value)',
238
+ example: 'ends_with( report.pdf ; .pdf )',
239
+ exampleResult: 'TRUE',
240
+ minArgs: 2,
241
+ maxArgs: 2,
242
+ argTypes: ['string', 'string'],
243
+ returnType: 'boolean',
244
+ },
245
+ {
246
+ name: 'remove_spaces',
247
+ category: 'text',
248
+ description: 'Removes all extra spaces and line breaks inside the text.',
249
+ syntax: 'remove_spaces(text)',
250
+ example: 'remove_spaces( hello world )',
251
+ exampleResult: 'hello world',
252
+ minArgs: 1,
253
+ maxArgs: 1,
254
+ argTypes: ['string'],
255
+ returnType: 'string',
256
+ },
257
+ {
258
+ name: 'word_count',
259
+ category: 'text',
260
+ description: 'Counts how many words are in the text.',
261
+ syntax: 'word_count(text)',
262
+ example: 'word_count( The quick brown fox )',
263
+ exampleResult: '4',
264
+ minArgs: 1,
265
+ maxArgs: 1,
266
+ argTypes: ['string'],
267
+ returnType: 'number',
268
+ },
269
+ {
270
+ name: 'add',
271
+ category: 'number',
272
+ description: 'Adds two numbers together.',
273
+ syntax: 'add(num1; num2)',
274
+ example: 'add( 49.99 ; 5.00 )',
275
+ exampleResult: '54.99',
276
+ minArgs: 2,
277
+ maxArgs: 2,
278
+ argTypes: ['number', 'number'],
279
+ returnType: 'number',
280
+ },
281
+ {
282
+ name: 'subtract',
283
+ category: 'number',
284
+ description: 'Takes the second number away from the first.',
285
+ syntax: 'subtract(num1; num2)',
286
+ example: 'subtract( 100.00 ; 10.50 )',
287
+ exampleResult: '89.5',
288
+ minArgs: 2,
289
+ maxArgs: 2,
290
+ argTypes: ['number', 'number'],
291
+ returnType: 'number',
292
+ },
293
+ {
294
+ name: 'multiply',
295
+ category: 'number',
296
+ description: 'Multiplies two numbers together.',
297
+ syntax: 'multiply(num1; num2)',
298
+ example: 'multiply( 3 ; 49.99 )',
299
+ exampleResult: '149.97',
300
+ minArgs: 2,
301
+ maxArgs: 2,
302
+ argTypes: ['number', 'number'],
303
+ returnType: 'number',
304
+ },
305
+ {
306
+ name: 'divide',
307
+ category: 'number',
308
+ description: 'Divides the first number by the second.',
309
+ syntax: 'divide(num1; num2)',
310
+ example: 'divide( 4999 ; 100 )',
311
+ exampleResult: '49.99',
312
+ minArgs: 2,
313
+ maxArgs: 2,
314
+ argTypes: ['number', 'number'],
315
+ returnType: 'number',
316
+ },
317
+ {
318
+ name: 'round',
319
+ category: 'number',
320
+ description: 'Rounds a number to a set number of decimal places.',
321
+ syntax: 'round(number; decimals)',
322
+ example: 'round( 49.9871 ; 2 )',
323
+ exampleResult: '49.99',
324
+ minArgs: 2,
325
+ maxArgs: 2,
326
+ argTypes: ['number', 'number'],
327
+ returnType: 'number',
328
+ },
329
+ {
330
+ name: 'round_up',
331
+ category: 'number',
332
+ description: 'Always rounds up to the next whole number.',
333
+ syntax: 'round_up(number)',
334
+ example: 'round_up( 7.1 )',
335
+ exampleResult: '8',
336
+ minArgs: 1,
337
+ maxArgs: 1,
338
+ argTypes: ['number'],
339
+ returnType: 'number',
340
+ },
341
+ {
342
+ name: 'round_down',
343
+ category: 'number',
344
+ description: 'Always rounds down to the previous whole number.',
345
+ syntax: 'round_down(number)',
346
+ example: 'round_down( 7.9 )',
347
+ exampleResult: '7',
348
+ minArgs: 1,
349
+ maxArgs: 1,
350
+ argTypes: ['number'],
351
+ returnType: 'number',
352
+ },
353
+ {
354
+ name: 'absolute',
355
+ category: 'number',
356
+ description: 'Returns the positive version of a number, removing any minus sign.',
357
+ syntax: 'absolute(number)',
358
+ example: 'absolute( -42.00 )',
359
+ exampleResult: '42',
360
+ minArgs: 1,
361
+ maxArgs: 1,
362
+ argTypes: ['number'],
363
+ returnType: 'number',
364
+ },
365
+ {
366
+ name: 'percentage',
367
+ category: 'number',
368
+ description: 'Calculates what percentage the value is of the total.',
369
+ syntax: 'percentage(value; total)',
370
+ example: 'percentage( 75 ; 100 )',
371
+ exampleResult: '75%',
372
+ minArgs: 2,
373
+ maxArgs: 2,
374
+ argTypes: ['number', 'number'],
375
+ returnType: 'number',
376
+ },
377
+ {
378
+ name: 'format_number',
379
+ category: 'number',
380
+ description: 'Adds thousand separators so large numbers are easier to read.',
381
+ syntax: 'format_number(number; decimals)',
382
+ example: 'format_number( 1250000 ; 2 )',
383
+ exampleResult: '1,250,000.00',
384
+ minArgs: 2,
385
+ maxArgs: 2,
386
+ argTypes: ['number', 'number'],
387
+ returnType: 'string',
388
+ },
389
+ {
390
+ name: 'format_currency',
391
+ category: 'number',
392
+ description: 'Adds a currency symbol and formats the number.',
393
+ syntax: 'format_currency(number; symbol)',
394
+ example: 'format_currency( 49.99 ; "$" )',
395
+ exampleResult: '$49.99',
396
+ minArgs: 2,
397
+ maxArgs: 2,
398
+ argTypes: ['number', 'string'],
399
+ returnType: 'string',
400
+ },
401
+ {
402
+ name: 'cents_to_dollars',
403
+ category: 'number',
404
+ description: 'Converts a value stored in cents into dollars.',
405
+ syntax: 'cents_to_dollars(number)',
406
+ example: 'cents_to_dollars( 4999 )',
407
+ exampleResult: '$49.99',
408
+ minArgs: 1,
409
+ maxArgs: 1,
410
+ argTypes: ['number'],
411
+ returnType: 'string',
412
+ },
413
+ {
414
+ name: 'min',
415
+ category: 'number',
416
+ description: 'Returns the smaller of two numbers.',
417
+ syntax: 'min(num1; num2)',
418
+ example: 'min( 87 ; 100 )',
419
+ exampleResult: '87',
420
+ minArgs: 2,
421
+ maxArgs: 2,
422
+ argTypes: ['number', 'number'],
423
+ returnType: 'number',
424
+ },
425
+ {
426
+ name: 'max',
427
+ category: 'number',
428
+ description: 'Returns the larger of two numbers.',
429
+ syntax: 'max(num1; num2)',
430
+ example: 'max( -5 ; 0 )',
431
+ exampleResult: '0',
432
+ minArgs: 2,
433
+ maxArgs: 2,
434
+ argTypes: ['number', 'number'],
435
+ returnType: 'number',
436
+ },
437
+ {
438
+ name: 'to_number',
439
+ category: 'number',
440
+ description: 'Converts a text value into a number you can calculate with.',
441
+ syntax: 'to_number(text)',
442
+ example: 'to_number( 1990 )',
443
+ exampleResult: '1990',
444
+ minArgs: 1,
445
+ maxArgs: 1,
446
+ argTypes: [['string', 'number', 'boolean']],
447
+ returnType: 'number',
448
+ },
449
+ {
450
+ name: 'format_date',
451
+ category: 'date',
452
+ description: 'Changes how a date looks using a format you pick.',
453
+ syntax: 'format_date(date; format)',
454
+ example: 'format_date( 2025-01-15 ; MMM DD, YYYY )',
455
+ exampleResult: 'Jan 15, 2025',
456
+ minArgs: 2,
457
+ maxArgs: 2,
458
+ argTypes: ['date', 'string'],
459
+ returnType: 'string',
460
+ },
461
+ {
462
+ name: 'format_date_long',
463
+ category: 'date',
464
+ description: 'Shows the full date written out in plain language.',
465
+ syntax: 'format_date_long(date)',
466
+ example: 'format_date_long( 2025-01-15 )',
467
+ exampleResult: 'Friday, January 15, 2025',
468
+ minArgs: 1,
469
+ maxArgs: 1,
470
+ argTypes: ['date'],
471
+ returnType: 'string',
472
+ },
473
+ {
474
+ name: 'format_time',
475
+ category: 'date',
476
+ description: 'Pulls the time out of a date and formats it.',
477
+ syntax: 'format_time(date; format)',
478
+ example: 'format_time( 2025-01-15T14:30:00Z ; h:mm A )',
479
+ exampleResult: '2:30 PM',
480
+ minArgs: 2,
481
+ maxArgs: 2,
482
+ argTypes: ['date', 'string'],
483
+ returnType: 'string',
484
+ },
485
+ {
486
+ name: 'relative_time',
487
+ category: 'date',
488
+ description: 'Shows how long ago or how far away a date is.',
489
+ syntax: 'relative_time(date)',
490
+ example: 'relative_time( 2025-01-12 )',
491
+ exampleResult: '3 days ago',
492
+ minArgs: 1,
493
+ maxArgs: 1,
494
+ argTypes: ['date'],
495
+ returnType: 'string',
496
+ },
497
+ {
498
+ name: 'add_days',
499
+ category: 'date',
500
+ description: 'Adds a number of days to a date.',
501
+ syntax: 'add_days(date; n)',
502
+ example: 'add_days( 2025-01-15 ; 30 )',
503
+ exampleResult: 'Feb 14, 2025',
504
+ minArgs: 2,
505
+ maxArgs: 2,
506
+ argTypes: ['date', 'number'],
507
+ returnType: 'date',
508
+ },
509
+ {
510
+ name: 'subtract_days',
511
+ category: 'date',
512
+ description: 'Goes back a number of days from a date.',
513
+ syntax: 'subtract_days(date; n)',
514
+ example: 'subtract_days( 2025-01-15 ; 7 )',
515
+ exampleResult: 'Jan 08, 2025',
516
+ minArgs: 2,
517
+ maxArgs: 2,
518
+ argTypes: ['date', 'number'],
519
+ returnType: 'date',
520
+ },
521
+ {
522
+ name: 'add_hours',
523
+ category: 'date',
524
+ description: 'Adds a number of hours to a date and time.',
525
+ syntax: 'add_hours(date; n)',
526
+ example: 'add_hours( 2025-01-15T14:30:00Z ; 2 )',
527
+ exampleResult: '2025-01-15T16:30:00Z',
528
+ minArgs: 2,
529
+ maxArgs: 2,
530
+ argTypes: ['date', 'number'],
531
+ returnType: 'date',
532
+ },
533
+ {
534
+ name: 'days_between',
535
+ category: 'date',
536
+ description: 'Counts how many days are between two dates.',
537
+ syntax: 'days_between(date1; date2)',
538
+ example: 'days_between( 2025-01-01 ; 2025-01-15 )',
539
+ exampleResult: '14',
540
+ minArgs: 2,
541
+ maxArgs: 2,
542
+ argTypes: ['date', 'date'],
543
+ returnType: 'number',
544
+ },
545
+ {
546
+ name: 'get_day',
547
+ category: 'date',
548
+ description: 'Returns the day number from a date (1–31).',
549
+ syntax: 'get_day(date)',
550
+ example: 'get_day( 2025-01-15 )',
551
+ exampleResult: '15',
552
+ minArgs: 1,
553
+ maxArgs: 1,
554
+ argTypes: ['date'],
555
+ returnType: 'number',
556
+ },
557
+ {
558
+ name: 'get_month',
559
+ category: 'date',
560
+ description: 'Returns the month from a date.',
561
+ syntax: 'get_month(date)',
562
+ example: 'get_month( 2025-01-15 )',
563
+ exampleResult: 'January',
564
+ minArgs: 1,
565
+ maxArgs: 1,
566
+ argTypes: ['date'],
567
+ returnType: 'string',
568
+ },
569
+ {
570
+ name: 'get_year',
571
+ category: 'date',
572
+ description: 'Returns the year from a date.',
573
+ syntax: 'get_year(date)',
574
+ example: 'get_year( 2025-01-15 )',
575
+ exampleResult: '2025',
576
+ minArgs: 1,
577
+ maxArgs: 1,
578
+ argTypes: ['date'],
579
+ returnType: 'number',
580
+ },
581
+ {
582
+ name: 'get_day_of_week',
583
+ category: 'date',
584
+ description: 'Returns the name of the day of the week.',
585
+ syntax: 'get_day_of_week(date)',
586
+ example: 'get_day_of_week( 2025-01-15 )',
587
+ exampleResult: 'Wednesday',
588
+ minArgs: 1,
589
+ maxArgs: 1,
590
+ argTypes: ['date'],
591
+ returnType: 'string',
592
+ },
593
+ {
594
+ name: 'start_of_month',
595
+ category: 'date',
596
+ description: 'Returns the first day of the same month.',
597
+ syntax: 'start_of_month(date)',
598
+ example: 'start_of_month( 2025-01-15 )',
599
+ exampleResult: 'Jan 01, 2025',
600
+ minArgs: 1,
601
+ maxArgs: 1,
602
+ argTypes: ['date'],
603
+ returnType: 'date',
604
+ },
605
+ {
606
+ name: 'end_of_month',
607
+ category: 'date',
608
+ description: 'Returns the last day of the same month.',
609
+ syntax: 'end_of_month(date)',
610
+ example: 'end_of_month( 2025-01-15 )',
611
+ exampleResult: 'Jan 31, 2025',
612
+ minArgs: 1,
613
+ maxArgs: 1,
614
+ argTypes: ['date'],
615
+ returnType: 'date',
616
+ },
617
+ {
618
+ name: 'convert_timezone',
619
+ category: 'date',
620
+ description: 'Converts a date and time from one timezone to another.',
621
+ syntax: 'convert_timezone(date; timezone)',
622
+ example: 'convert_timezone( 2025-01-15T14:30:00Z ; America/New_York )',
623
+ exampleResult: 'Jan 15, 9:30 AM EST',
624
+ minArgs: 2,
625
+ maxArgs: 2,
626
+ argTypes: ['date', 'string'],
627
+ returnType: 'string',
628
+ },
629
+ {
630
+ name: 'now',
631
+ category: 'date',
632
+ description: 'Returns the current date and time at the moment the flow runs.',
633
+ syntax: 'now()',
634
+ example: 'now()',
635
+ exampleResult: '2025-01-15T14:30:00Z',
636
+ minArgs: 0,
637
+ maxArgs: 0,
638
+ argTypes: [],
639
+ returnType: 'date',
640
+ },
641
+ {
642
+ name: 'today',
643
+ category: 'date',
644
+ description: 'Returns today\'s date with no time attached.',
645
+ syntax: 'today()',
646
+ example: 'today()',
647
+ exampleResult: '2025-01-15',
648
+ minArgs: 0,
649
+ maxArgs: 0,
650
+ argTypes: [],
651
+ returnType: 'date',
652
+ },
653
+ {
654
+ name: 'to_date',
655
+ category: 'date',
656
+ description: 'Turns a text value into a proper date the flow can work with.',
657
+ syntax: 'to_date(text)',
658
+ example: 'to_date( January 15, 2025 )',
659
+ exampleResult: '2025-01-15T00:00:00Z',
660
+ minArgs: 1,
661
+ maxArgs: 1,
662
+ argTypes: [['string', 'date']],
663
+ returnType: 'date',
664
+ },
665
+ {
666
+ name: 'filter_list',
667
+ category: 'list',
668
+ description: 'Keeps only the items where a field matches a value.',
669
+ syntax: 'filter_list(list; field; value)',
670
+ example: 'filter_list( tickets ; status; open )',
671
+ exampleResult: '[3 of 10 items]',
672
+ minArgs: 3,
673
+ maxArgs: 3,
674
+ argTypes: ['list', 'string', ['string', 'number', 'boolean']],
675
+ returnType: 'list',
676
+ },
677
+ {
678
+ name: 'sort_list',
679
+ category: 'list',
680
+ description: 'Sorts a list from highest to lowest, or A to Z, by a field.',
681
+ syntax: 'sort_list(list; field; order)',
682
+ example: 'sort_list( orders ; amount; desc )',
683
+ exampleResult: '[sorted: 500, 200, 50]',
684
+ minArgs: 3,
685
+ maxArgs: 3,
686
+ argTypes: ['list', 'string', 'string'],
687
+ returnType: 'list',
688
+ },
689
+ {
690
+ name: 'pluck',
691
+ category: 'list',
692
+ description: 'Picks one field out of every item in a list.',
693
+ syntax: 'pluck(list; field)',
694
+ example: 'pluck( users ; email )',
695
+ exampleResult: '[ana@x.com, bob@x.com]',
696
+ minArgs: 2,
697
+ maxArgs: 2,
698
+ argTypes: ['list', 'string'],
699
+ returnType: 'list',
700
+ },
701
+ {
702
+ name: 'join_list',
703
+ category: 'list',
704
+ description: 'Turns a list into a single piece of text with a separator.',
705
+ syntax: 'join_list(list; separator)',
706
+ example: 'join_list( [bug;urgent;backend] ; ", " )',
707
+ exampleResult: 'bug, urgent, backend',
708
+ minArgs: 2,
709
+ maxArgs: 2,
710
+ argTypes: ['list', 'string'],
711
+ returnType: 'string',
712
+ },
713
+ {
714
+ name: 'first_item',
715
+ category: 'list',
716
+ description: 'Returns the first item in a list.',
717
+ syntax: 'first_item(list)',
718
+ example: 'first_item( [apple;banana;cherry] )',
719
+ exampleResult: 'apple',
720
+ minArgs: 1,
721
+ maxArgs: 1,
722
+ argTypes: ['list'],
723
+ returnType: ['string', 'number', 'boolean', 'list'],
724
+ },
725
+ {
726
+ name: 'last_item',
727
+ category: 'list',
728
+ description: 'Returns the last item in a list.',
729
+ syntax: 'last_item(list)',
730
+ example: 'last_item( [apple;banana;cherry] )',
731
+ exampleResult: 'cherry',
732
+ minArgs: 1,
733
+ maxArgs: 1,
734
+ argTypes: ['list'],
735
+ returnType: ['string', 'number', 'boolean'],
736
+ },
737
+ {
738
+ name: 'item_at',
739
+ category: 'list',
740
+ description: 'Returns the item at a specific position in a list.',
741
+ syntax: 'item_at(list; index)',
742
+ example: 'item_at( [apple;banana;cherry] ; 1 )',
743
+ exampleResult: 'banana',
744
+ minArgs: 2,
745
+ maxArgs: 2,
746
+ argTypes: ['list', 'number'],
747
+ returnType: ['string', 'number', 'boolean', 'list'],
748
+ },
749
+ {
750
+ name: 'count',
751
+ category: 'list',
752
+ description: 'Counts how many items are in a list.',
753
+ syntax: 'count(list)',
754
+ example: 'count( [bug;urgent;backend] )',
755
+ exampleResult: '3',
756
+ minArgs: 1,
757
+ maxArgs: 1,
758
+ argTypes: ['list'],
759
+ returnType: 'number',
760
+ },
761
+ {
762
+ name: 'sum',
763
+ category: 'list',
764
+ description: 'Adds up a number field across all items in a list.',
765
+ syntax: 'sum(list; field)',
766
+ example: 'sum( orders ; amount )',
767
+ exampleResult: '4820.5',
768
+ minArgs: 2,
769
+ maxArgs: 2,
770
+ argTypes: ['list', 'string'],
771
+ returnType: 'number',
772
+ },
773
+ {
774
+ name: 'average',
775
+ category: 'list',
776
+ description: 'Calculates the average of a number field across all items.',
777
+ syntax: 'average(list; field)',
778
+ example: 'average( scores ; value )',
779
+ exampleResult: '82.4',
780
+ minArgs: 2,
781
+ maxArgs: 2,
782
+ argTypes: ['list', 'string'],
783
+ returnType: 'number',
784
+ },
785
+ {
786
+ name: 'max_in_list',
787
+ category: 'list',
788
+ description: 'Finds the highest value of a field across all items.',
789
+ syntax: 'max_in_list(list; field)',
790
+ example: 'max_in_list( orders ; amount )',
791
+ exampleResult: '1200',
792
+ minArgs: 2,
793
+ maxArgs: 2,
794
+ argTypes: ['list', 'string'],
795
+ returnType: 'number',
796
+ },
797
+ {
798
+ name: 'min_in_list',
799
+ category: 'list',
800
+ description: 'Finds the lowest value of a field across all items.',
801
+ syntax: 'min_in_list(list; field)',
802
+ example: 'min_in_list( orders ; amount )',
803
+ exampleResult: '9.99',
804
+ minArgs: 2,
805
+ maxArgs: 2,
806
+ argTypes: ['list', 'string'],
807
+ returnType: 'number',
808
+ },
809
+ {
810
+ name: 'deduplicate',
811
+ category: 'list',
812
+ description: 'Removes items that have the same value in a field.',
813
+ syntax: 'deduplicate(list; field)',
814
+ example: 'deduplicate( leads ; email )',
815
+ exampleResult: '[7 of 10 items]',
816
+ minArgs: 2,
817
+ maxArgs: 2,
818
+ argTypes: ['list', 'string'],
819
+ returnType: 'list',
820
+ },
821
+ {
822
+ name: 'flatten',
823
+ category: 'list',
824
+ description: 'Turns a list of lists into one flat list.',
825
+ syntax: 'flatten(list)',
826
+ example: 'flatten( [[a;b];[c;d]] )',
827
+ exampleResult: '[a,b,c,d]',
828
+ minArgs: 1,
829
+ maxArgs: 1,
830
+ argTypes: ['list'],
831
+ returnType: 'list',
832
+ },
833
+ {
834
+ name: 'split_text_to_list',
835
+ category: 'list',
836
+ description: 'Turns a comma-separated text into a list of items.',
837
+ syntax: 'split_text_to_list(text; separator)',
838
+ example: 'split_text_to_list( bug,urgent,backend ; "," )',
839
+ exampleResult: '[bug,urgent,backend]',
840
+ minArgs: 2,
841
+ maxArgs: 2,
842
+ argTypes: ['string', 'string'],
843
+ returnType: 'list',
844
+ },
845
+ {
846
+ name: 'if',
847
+ category: 'logic',
848
+ description: 'Returns one value if something is true, and another if it\'s not.',
849
+ syntax: 'if(condition; true_value; false_value)',
850
+ example: 'if( 1500 > 1000; High value; Standard )',
851
+ exampleResult: 'High value',
852
+ minArgs: 3,
853
+ maxArgs: 3,
854
+ argTypes: ['boolean', ['string', 'number', 'boolean', 'date', 'list'], ['string', 'number', 'boolean', 'date', 'list']],
855
+ returnType: ['string', 'number', 'boolean', 'date', 'list'],
856
+ },
857
+ {
858
+ name: 'if_empty',
859
+ category: 'logic',
860
+ description: 'Uses a fallback value if the field is empty.',
861
+ syntax: 'if_empty(value; fallback)',
862
+ example: 'if_empty( "" ; No name )',
863
+ exampleResult: 'No name',
864
+ minArgs: 2,
865
+ maxArgs: 2,
866
+ argTypes: [['string', 'number', 'boolean', 'date', 'list'], 'string'],
867
+ returnType: ['string', 'number', 'boolean'],
868
+ },
869
+ {
870
+ name: 'if_null',
871
+ category: 'logic',
872
+ description: 'Uses a fallback value if the field has no value at all.',
873
+ syntax: 'if_null(value; fallback)',
874
+ example: 'if_null( null ; N/A )',
875
+ exampleResult: 'N/A',
876
+ minArgs: 2,
877
+ maxArgs: 2,
878
+ argTypes: [['string', 'number', 'boolean', 'date', 'list'], 'string'],
879
+ returnType: ['string', 'number', 'boolean'],
880
+ },
881
+ {
882
+ name: 'switch',
883
+ category: 'logic',
884
+ description: 'Maps a value to another — like a lookup table written inline.',
885
+ syntax: 'switch(value; key1; result1; key2; result2; ...)',
886
+ example: 'switch( US ; US;North America; DE;Europe )',
887
+ exampleResult: 'North America',
888
+ minArgs: 3,
889
+ maxArgs: -1,
890
+ argTypes: [['string', 'number', 'boolean'], ['string', 'number', 'boolean'], ['string', 'number', 'boolean']],
891
+ returnType: ['string', 'number', 'boolean'],
892
+ },
893
+ {
894
+ name: 'is_empty',
895
+ category: 'logic',
896
+ description: 'Checks if a field has no value.',
897
+ syntax: 'is_empty(value)',
898
+ example: 'is_empty( "" )',
899
+ exampleResult: 'TRUE',
900
+ minArgs: 1,
901
+ maxArgs: 1,
902
+ argTypes: [['string', 'number', 'boolean', 'date', 'list']],
903
+ returnType: 'boolean',
904
+ },
905
+ {
906
+ name: 'is_not_empty',
907
+ category: 'logic',
908
+ description: 'Checks if a field has any value in it.',
909
+ syntax: 'is_not_empty(value)',
910
+ example: 'is_not_empty( john@acme.com )',
911
+ exampleResult: 'TRUE',
912
+ minArgs: 1,
913
+ maxArgs: 1,
914
+ argTypes: [['string', 'number', 'boolean', 'date', 'list']],
915
+ returnType: 'boolean',
916
+ },
917
+ {
918
+ name: 'is_equal',
919
+ category: 'logic',
920
+ description: 'Checks if two values are exactly the same.',
921
+ syntax: 'is_equal(value1; value2)',
922
+ example: 'is_equal( active ; active )',
923
+ exampleResult: 'TRUE',
924
+ minArgs: 2,
925
+ maxArgs: 2,
926
+ argTypes: [['string', 'number', 'boolean'], ['string', 'number', 'boolean']],
927
+ returnType: 'boolean',
928
+ },
929
+ {
930
+ name: 'and',
931
+ category: 'logic',
932
+ description: 'Returns true only if both conditions are true at the same time.',
933
+ syntax: 'and(condition1; condition2)',
934
+ example: 'and( 25 >= 18; US = US )',
935
+ exampleResult: 'TRUE',
936
+ minArgs: 2,
937
+ maxArgs: 2,
938
+ argTypes: ['boolean', 'boolean'],
939
+ returnType: 'boolean',
940
+ },
941
+ {
942
+ name: 'or',
943
+ category: 'logic',
944
+ description: 'Returns true if at least one of the conditions is true.',
945
+ syntax: 'or(condition1; condition2)',
946
+ example: 'or( standard = vip; 600 > 500 )',
947
+ exampleResult: 'TRUE',
948
+ minArgs: 2,
949
+ maxArgs: 2,
950
+ argTypes: ['boolean', 'boolean'],
951
+ returnType: 'boolean',
952
+ },
953
+ {
954
+ name: 'not',
955
+ category: 'logic',
956
+ description: 'Flips a true to false, or a false to true.',
957
+ syntax: 'not(condition)',
958
+ example: 'not( is_empty( john@acme.com ) )',
959
+ exampleResult: 'TRUE',
960
+ minArgs: 1,
961
+ maxArgs: 1,
962
+ argTypes: ['boolean'],
963
+ returnType: 'boolean',
964
+ },
965
+ {
966
+ name: 'coalesce',
967
+ category: 'logic',
968
+ description: 'Returns the first field that has a value, skipping any empty ones.',
969
+ syntax: 'coalesce(value1; value2; value3; ...)',
970
+ example: 'coalesce( "" ; John ; User )',
971
+ exampleResult: 'John',
972
+ minArgs: 2,
973
+ maxArgs: -1,
974
+ argTypes: [['string', 'number', 'boolean']],
975
+ returnType: ['string', 'number', 'boolean'],
976
+ },
977
+ ];
978
+ //# sourceMappingURL=function-registry.js.map