-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathww-config.js
More file actions
958 lines (957 loc) · 34.7 KB
/
ww-config.js
File metadata and controls
958 lines (957 loc) · 34.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
export default {
features: {
datasource: true,
},
editor: {
settings: [
{
label: 'Configuration',
icon: 'advanced',
edit: () => import('./src/components/Configuration/SettingsEditMultiEnv.vue'),
summary: () => import('./src/components/Configuration/SettingsSummary.vue'),
getIsValid(settings) {
// Prevent saving while branch change is in progress
if (settings.privateData?._isBranchChanging) {
return false;
}
// Check if using new multi-environment format
if (settings.publicData?.environments) {
// Production environment is required
return !!(settings.publicData.environments.production?.projectUrl &&
settings.publicData.environments.production?.apiKey);
}
// Legacy format validation
return !!settings.publicData.projectUrl && !!settings.publicData.apiKey;
},
onSave: 'onSave',
},
{
label: 'Realtime collections',
icon: 'data',
edit: () => import('./src/components/Realtime/SettingsEdit.vue'),
summary: () => import('./src/components/Realtime/SettingsSummary.vue'),
getIsValid(settings) {
return !!settings.publicData.realtimeTables;
},
},
],
collection: {
edit: () => import('./src/components/Collection/CollectionEdit.vue'),
summary: () => import('./src/components/Collection/CollectionSummary.vue'),
getIsValid({ table }) {
return !!table;
},
modes: ['dynamic'],
queryConfig: {
hasNativePagination: true,
hasNativeSort: true,
hasNativeFilter: true,
filterOperators: [
{ label: 'Is', value: '$eq', acceptedTypes: ['string', 'boolean'] },
{ label: 'Is not', value: '$ne', acceptedTypes: ['string', 'boolean'] },
{ label: '=', value: '$eq', acceptedTypes: ['number'] },
{ label: '≠', value: '$ne', acceptedTypes: ['number'] },
{ label: '<', value: '$lt', acceptedTypes: ['number', 'string'] },
{ label: '>', value: '$gt', acceptedTypes: ['number', 'string'] },
{ label: '≤', value: '$lte', acceptedTypes: ['number', 'string'] },
{ label: '≥', value: '$gte', acceptedTypes: ['number', 'string'] },
{
label: 'Contains',
value: '$iLike:contains',
acceptedTypes: ['string'],
defaultValue: '',
},
{
label: 'Does not contains',
value: '$notILike:contains',
acceptedTypes: ['string'],
defaultValue: '',
},
{
label: 'Starts with',
value: '$iLike:startsWith',
acceptedTypes: ['string'],
defaultValue: 'start',
},
{ label: 'Ends with', value: '$iLike:endsWith', acceptedTypes: ['string'], defaultValue: 'end' },
{ label: 'Is exactly', value: '$eq', acceptedTypes: ['array', 'object'] },
{ label: 'Is empty', value: '$eq:null', acceptedTypes: ['string', 'number', 'array', 'object'] },
{
label: 'Is not empty',
value: '$ne:null',
acceptedTypes: ['string', 'number', 'array', 'object'],
},
{ label: 'Is in', value: '$in', acceptedTypes: ['string', 'number'], defaultValue: [] },
{ label: 'Is not in', value: '$notIn', acceptedTypes: ['string', 'number'], defaultValue: [] },
{ label: 'Has any of', value: '$overlap', acceptedTypes: ['array'], defaultValue: [] },
{ label: 'Has none of', value: '$notOverlap', acceptedTypes: ['array'], defaultValue: [] },
{ label: 'Has all of', value: '$contains', acceptedTypes: ['array'], defaultValue: [] },
],
typeDefaultOperator: {
string: '$iLike:contains',
number: '$eq',
object: '$has',
array: '$contains',
boolean: '$eq',
},
},
},
},
triggers: [
{
label: 'On realtime database changes',
value: 'realtime:postgres_changes',
event: {
channel: '',
data: {
schema: 'public',
table: 'My Table',
commit_timestamp: '2024-08-01T20:17:03.216Z',
eventType: 'INSERT | UPDATE | DELETE',
errors: null,
new: {},
old: {},
},
},
conditions: [
{
name: 'Channel name',
key: 'channel',
placeholder: 'Default: All channels',
type: 'Text',
},
{
name: 'Event type',
key: 'event',
placeholder: 'Default: All events',
type: 'TextSelect',
options: [
{ label: 'All events', value: null },
{ label: 'INSERT', value: 'INSERT' },
{ label: 'UPDATE', value: 'UPDATE' },
{ label: 'DELETE', value: 'DELETE' },
],
},
],
},
{
label: 'On realtime presence',
value: 'realtime:presence',
event: {
channel: '',
data: {
event: 'join',
key: '9fe543c6-4530-11ef-a6c3-0a58a9feac02',
currentPresences: [],
leftPresences: [],
newPresences: [],
},
},
conditions: [
{
name: 'Channel name',
key: 'channel',
placeholder: 'Default: All channels',
type: 'Text',
},
{
name: 'Event type',
key: 'event',
placeholder: 'Default: All events',
type: 'TextSelect',
options: [
{ label: 'All events', value: null },
{ label: 'Sync', value: 'sync' },
{ label: 'Join', value: 'join' },
{ label: 'Leave', value: 'leave' },
],
},
],
},
{
label: 'On realtime broadcast',
value: 'realtime:broadcast',
event: { channel: '', data: { event: '', payload: '' } },
conditions: [
{
name: 'Channel name',
key: 'channel',
placeholder: 'Default: All channels',
type: 'Text',
},
{
name: 'Event name',
placeholder: 'Default: All events',
key: 'event',
type: 'Text',
},
],
},
],
actions: [
{
name: 'Database | Select',
code: 'select',
parameters: [],
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Database/Select.vue'),
copilot: {
description: 'Select data from a Supabase table',
returns: 'array | object',
schema: {
table: {
type: 'string',
description: 'The table name to select from',
bindable: true,
},
fieldsMode: {
type: 'string',
description: 'Mode for selecting fields (guided or advanced)',
bindable: false,
},
dataFields: {
type: 'array',
description: 'Array of column names to select in guided mode, default to all',
bindable: true,
},
dataFieldsAdvanced: {
type: 'string',
description:
'Custom field selection query in advanced mode using the supabase sdk syntax, example: "name, orchestral_sections(*)"',
bindable: true,
},
filters: {
type: 'array',
description: `Array of filter conditions. eg: [
{
"fn": "eq", // Supabase filter method
"column": "status",
"value": "active",
"isEnabled": true
},
{
"fn": "textSearch",
"column": "description",
"value": {
"__wwtype": "f",
"code": "context.item.data?.['description']"
},
"options": { config: "english" }, // Optional search config
"isEnabled": false // This filter will be ignored
},
{
"fn": "or",
"value": "type.eq.car,type.eq.truck", // Postgrest syntax for OR
"isEnabled": true
},
{
"fn": "filter",
"column": "price",
"operator": "gte",
"value": 1000,
"isEnabled": true
}
]`,
bindable: true,
},
modifiers: {
type: 'object',
description: `Query modifiers like ordering and pagination, eg: {
select: {
mode: "guided", // Options: 'minimal', 'guided', 'advanced'
fields: ["id", "name", "price"] // Only used if mode is 'guided'
},
order: {
column: "price",
ascending: false, // Sort by price in descending order
nullsFirst: true // Place NULL values first
},
limit: {
count: 10 // Limit results to 10
},
range: {
from: 0,
to: 9 // Equivalent to limit(10), but using range
},
single: false, // Don't force single result
maybeSingle: true, // Allow maybeSingle (returns single row or null)
csv: false, // Don't return results in CSV format
}`,
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Database | Insert',
code: 'insert',
parameters: [{ name: 'data', type: 'object' }],
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Database/Insert.vue'),
copilot: {
description: 'Insert new records into a Supabase table',
returns: 'object',
schema: {
table: {
type: 'string',
description: 'The table name to insert into',
bindable: true,
},
data: {
type: 'object',
description: 'The data to insert',
bindable: true,
},
mode: {
type: 'string',
description: 'Insert mode (single or multiple)',
bindable: false,
},
autoSync: {
type: 'boolean',
description: 'Whether to automatically sync collections',
bindable: true,
},
defaultToNull: {
type: 'boolean',
description: 'Whether to default missing fields to null',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Database | Update',
code: 'update',
parameters: [
{ name: 'primaryData', type: 'object' },
{ name: 'data', type: 'object' },
],
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Database/Update.vue'),
copilot: {
description: 'Update existing records in a Supabase table',
returns: 'object',
schema: {
table: {
type: 'string',
description: 'The table name to update',
bindable: true,
},
primaryData: {
type: 'object',
description: 'Primary key values to identify records',
bindable: true,
},
data: {
type: 'object',
description: 'The new data to update with',
bindable: true,
},
mode: {
type: 'string',
description: 'Update mode (single or multiple)',
bindable: false,
},
filters: {
type: 'array',
description: `Array of filter conditions for multiple update mode. eg: [
{
"fn": "eq", // Supabase filter method
"column": "status",
"value": "active",
"isEnabled": true
},
{
"fn": "textSearch",
"column": "description",
"value": {
"__wwtype": "f",
"code": "context.item.data?.['description']"
},
"options": { config: "english" }, // Optional search config
"isEnabled": false // This filter will be ignored
},
{
"fn": "or",
"value": "type.eq.car,type.eq.truck", // Postgrest syntax for OR
"isEnabled": true
},
{
"fn": "filter",
"column": "price",
"operator": "gte",
"value": 1000,
"isEnabled": true
}
]`,
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Database | Upsert',
code: 'upsert',
parameters: [{ name: 'data', type: 'object' }],
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Database/Upsert.vue'),
copilot: {
description: 'Insert or update records in a Supabase table',
returns: 'object',
schema: {
table: {
type: 'string',
description: 'The table name to upsert into',
bindable: true,
},
data: {
type: 'object',
description: 'The data to upsert',
bindable: true,
},
onConflict: {
type: 'array',
description: 'Fields to check for conflicts',
bindable: true,
},
ignoreDuplicates: {
type: 'boolean',
description: 'Whether to ignore duplicate records',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Database | Delete',
code: 'delete',
parameters: [{ name: 'primaryData', type: 'object' }],
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Database/Delete.vue'),
copilot: {
description: 'Delete records from a Supabase table',
returns: 'object',
schema: {
table: {
type: 'string',
description: 'The table name to delete from',
bindable: true,
},
primaryData: {
type: 'object',
description: 'Primary key values to identify records to delete',
bindable: true,
},
mode: {
type: 'string',
description: 'Delete mode (single or multiple)',
bindable: false,
},
filters: {
type: 'array',
description: `Array of filter conditions for multiple delete mode. eg: [
{
"fn": "eq", // Supabase filter method
"column": "status",
"value": "active",
"isEnabled": true
},
{
"fn": "textSearch",
"column": "description",
"value": {
"__wwtype": "f",
"code": "context.item.data?.['description']"
},
"options": { config: "english" }, // Optional search config
"isEnabled": false // This filter will be ignored
},
{
"fn": "or",
"value": "type.eq.car,type.eq.truck", // Postgrest syntax for OR
"isEnabled": true
},
{
"fn": "filter",
"column": "price",
"operator": "gte",
"value": 1000,
"isEnabled": true
}
]`,
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | List all files',
code: 'listFiles',
getIsValid({ bucket }) {
return !!bucket;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/ListFiles.vue'),
copilot: {
description: 'List files in a Supabase storage bucket',
returns: 'array',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
path: {
type: 'string',
description: 'Path prefix to filter files',
bindable: true,
},
options: {
type: 'object',
description: 'Listing options like limit and search',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | Upload a file',
code: 'uploadFile',
getIsValid({ bucket, path, file }) {
return !!bucket && !!path && !!file;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/UploadFile.vue'),
copilot: {
description: 'Upload a file to Supabase storage',
returns: 'object',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
path: {
type: 'string',
description: 'Destination path for the file',
bindable: true,
},
file: {
type: 'file',
description: 'The file to upload',
bindable: true,
},
options: {
type: 'object',
description: 'Upload options like cacheControl and contentType',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | Replace a file',
code: 'updateFile',
getIsValid({ bucket, path, file }) {
return !!bucket && !!path && !!file;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/UpdateFile.vue'),
copilot: {
description: 'Replace an existing file in Supabase storage',
returns: 'object',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
path: {
type: 'string',
description: 'Path of the file to replace',
bindable: true,
},
file: {
type: 'file',
description: 'The new file',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | Move a file',
code: 'moveFile',
getIsValid({ bucket, path, newPath }) {
return !!bucket && !!path && !!newPath;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/MoveFile.vue'),
copilot: {
description: 'Move a file to a new location in Supabase storage',
returns: 'object',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
path: {
type: 'string',
description: 'Current path of the file',
bindable: true,
},
newPath: {
type: 'string',
description: 'New path for the file',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | Copy a file',
code: 'copyFile',
getIsValid({ bucket, path, newPath }) {
return !!bucket && !!path && !!newPath;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/CopyFile.vue'),
copilot: {
description: 'Copy a file to a new location in Supabase storage',
returns: 'object',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
path: {
type: 'string',
description: 'Path of the file to copy',
bindable: true,
},
newPath: {
type: 'string',
description: 'Destination path for the copy',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | Delete files',
code: 'deleteFiles',
getIsValid({ paths }) {
return !!paths;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/DeleteFiles.vue'),
copilot: {
description: 'Delete one or more files from Supabase storage',
returns: 'object',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
paths: {
type: 'array',
description: 'Array of file paths to delete',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | Create signed URL',
code: 'createSignedUrl',
getIsValid({ bucket, path, expiresIn }) {
return !!bucket && !!path && !!expiresIn;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/CreateSignedUrl.vue'),
copilot: {
description: 'Create a temporary signed URL for file access',
returns: 'string',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
path: {
type: 'string',
description: 'Path to the file',
bindable: true,
},
expiresIn: {
type: 'number',
description: 'Expiration time in seconds',
bindable: true,
},
options: {
type: 'object',
description: 'Options for download and transformation',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Storage | Retrieve public URL',
code: 'getPublicUrl',
getIsValid({ bucket, path }) {
return !!bucket && !!path;
},
isAsync: false,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Storage/GetPublicUrl.vue'),
copilot: {
description: 'Get the public URL for a file',
returns: 'string',
schema: {
bucket: {
type: 'string',
description: 'The storage bucket name',
bindable: true,
},
path: {
type: 'string',
description: 'Path to the file',
bindable: true,
},
options: {
type: 'object',
description: 'Options for download and transformation',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Realtime | Subscribe to channel',
code: 'subscribeToChannel',
getIsValid({ channel, type }) {
return !!channel && !!type;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Realtime/SubscribeChannel.vue'),
copilot: {
description: 'Subscribe to a realtime channel',
returns: 'void',
schema: {
channel: {
type: 'string',
description: 'Channel name to subscribe to',
bindable: true,
},
type: {
type: 'string',
description: 'Subscription type (postgres_changes or broadcast)',
bindable: false,
},
event: {
type: 'string',
description: 'Event type to listen for',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Realtime | Unsubscribe from channel',
code: 'unsubscribeFromChannel',
getIsValid({ channel }) {
return !!channel;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Realtime/UnsubscribeChannel.vue'),
copilot: {
description: 'Unsubscribe from a realtime channel',
returns: 'void',
schema: {
channel: {
type: 'string',
description: 'Channel name to unsubscribe from',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Realtime | Broadcast a message',
code: 'sendMessageToChannel',
getIsValid({ channel, event }) {
return !!channel && !!event;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Realtime/BroadcastMessage.vue'),
copilot: {
description: 'Broadcast a message to a channel',
returns: 'void',
schema: {
channel: {
type: 'string',
description: 'Channel to broadcast to',
bindable: true,
},
event: {
type: 'string',
description: 'Event name',
bindable: true,
},
payload: {
type: 'any',
description: 'Message payload',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Realtime | Update presence state',
code: 'updateChannelState',
getIsValid({ channel, state }) {
return !!channel && !!state;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Realtime/UpdateState.vue'),
copilot: {
description: 'Update presence state in a channel',
returns: 'void',
schema: {
channel: {
type: 'string',
description: 'Channel to update state in',
bindable: true,
},
state: {
type: 'any',
description: 'New presence state',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Call a Postgres function',
code: 'callPostgresFunction',
getIsValid({ functionName }) {
return !!functionName;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/CallPostgres.vue'),
copilot: {
description: 'Call a Postgres database function',
returns: 'any',
schema: {
functionName: {
type: 'string',
description: 'Name of the function to call',
bindable: true,
},
params: {
type: 'array',
description: 'Function parameters',
bindable: true,
},
modifiers: {
type: 'object',
description: 'Query modifiers',
bindable: true,
},
},
},
/* wwEditor:end */
},
{
name: 'Invoke an Edge function',
code: 'invokeEdgeFunction',
getIsValid({ functionName }) {
return !!functionName;
},
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/InvokeEdge.vue'),
copilot: {
description: 'Invoke a Supabase Edge Function',
returns: 'any',
schema: {
functionName: {
type: 'string',
description: 'It must be the **slug** of the Edge Function',
bindable: true,
},
method: {
type: 'string',
description: 'HTTP method to use',
bindable: true,
},
headers: {
type: 'array',
description: 'Request headers',
bindable: true,
},
queries: {
type: 'array',
description: 'Query parameters',
bindable: true,
},
body: {
type: 'any',
description: 'Request body',
bindable: true,
},
useStreaming: {
type: 'boolean',
description: 'Whether to use streaming',
bindable: true,
},
streamVariableId: {
type: 'string',
description: 'The variable ID of the array variable that will receive the stream data',
bindable: true,
},
},
},
/* wwEditor:end */
},
],
};