appwrite-utils-cli 0.0.278 → 0.0.280

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.
@@ -1,771 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "appwriteEndpoint": {
6
- "type": "string",
7
- "default": "https://cloud.appwrite.io/v1",
8
- "description": "The endpoint URL for the Appwrite server"
9
- },
10
- "appwriteProject": {
11
- "type": "string",
12
- "description": "The project ID for the Appwrite project"
13
- },
14
- "appwriteKey": {
15
- "type": "string",
16
- "description": "The API key for accessing Appwrite services"
17
- },
18
- "appwriteClient": {
19
- "type": ["object", "null"],
20
- "default": null,
21
- "description": "The client configuration for Appwrite, should be null, used in the package"
22
- },
23
- "enableDevDatabase": {
24
- "type": "boolean",
25
- "default": true,
26
- "description": "Enable development database alongside production database"
27
- },
28
- "enableBackups": {
29
- "type": "boolean",
30
- "default": true,
31
- "description": "Enable backups"
32
- },
33
- "backupInterval": {
34
- "type": "number",
35
- "default": 3600,
36
- "description": "Backup interval in seconds"
37
- },
38
- "backupRetention": {
39
- "type": "number",
40
- "default": 30,
41
- "description": "Backup retention in days"
42
- },
43
- "enableBackupCleanup": {
44
- "type": "boolean",
45
- "default": true,
46
- "description": "Enable backup cleanup"
47
- },
48
- "enableMockData": {
49
- "type": "boolean",
50
- "default": false,
51
- "description": "Enable mock data"
52
- },
53
- "enableWipeOtherDatabases": {
54
- "type": "boolean",
55
- "default": true,
56
- "description": "Enable wiping other databases"
57
- },
58
- "documentBucketId": {
59
- "type": "string",
60
- "default": "documents",
61
- "description": "Documents bucket id for imported documents"
62
- },
63
- "usersCollectionName": {
64
- "type": "string",
65
- "default": "Members",
66
- "description": "Users collection name for any overflowing data associated with users, will try to match one of the collections by name"
67
- },
68
- "databases": {
69
- "type": "array",
70
- "items": {
71
- "type": "object",
72
- "properties": {
73
- "$id": {
74
- "type": "string",
75
- "description": "The unique identifier for a database"
76
- },
77
- "name": {
78
- "type": "string",
79
- "description": "The name of the database"
80
- }
81
- },
82
- "required": ["$id", "name"],
83
- "description": "The schema for database objects. Each database must have a unique identifier and a name."
84
- },
85
- "default": [
86
- { "$id": "dev", "name": "Development" },
87
- { "$id": "main", "name": "Main" },
88
- { "$id": "migrations", "name": "Migrations" }
89
- ],
90
- "description": "List of databases to create, with each database identified by its $id."
91
- },
92
- "collections": {
93
- "type": "array",
94
- "items": {
95
- "type": "object",
96
- "properties": {
97
- "$id": {
98
- "type": "string",
99
- "description": "The id of the collection, if not provided it will be generated"
100
- },
101
- "name": {
102
- "type": "string",
103
- "description": "The name of the collection"
104
- },
105
- "$permissions": {
106
- "type": "array",
107
- "items": {
108
- "type": "object",
109
- "properties": {
110
- "permission": {
111
- "type": "string",
112
- "enum": ["read", "write", "update", "delete", "create"],
113
- "description": "The type of permission (read, write, update, delete, create)"
114
- },
115
- "target": {
116
- "type": "string",
117
- "description": "The target of the permission"
118
- }
119
- },
120
- "description": "Permissions associated with the collection"
121
- }
122
- },
123
- "enabled": {
124
- "type": "boolean",
125
- "default": true,
126
- "description": "Whether the collection is enabled or not"
127
- },
128
- "documentSecurity": {
129
- "type": "boolean",
130
- "default": false,
131
- "description": "Whether document security is enabled for the collection"
132
- },
133
- "databaseId": {
134
- "type": "string",
135
- "description": "The ID of the database the collection belongs to"
136
- },
137
- "attributes": {
138
- "type": "array",
139
- "items": {
140
- "oneOf": [
141
- {
142
- "type": "object",
143
- "properties": {
144
- "key": {
145
- "type": "string",
146
- "description": "The key of the attribute"
147
- },
148
- "type": {
149
- "type": "string",
150
- "enum": ["string"],
151
- "description": "The type of the attribute"
152
- },
153
- "required": {
154
- "type": "boolean",
155
- "default": false,
156
- "description": "Whether the attribute is required"
157
- },
158
- "array": {
159
- "type": "boolean",
160
- "default": false,
161
- "description": "Whether the attribute is an array"
162
- },
163
- "size": {
164
- "type": "number",
165
- "default": 50,
166
- "description": "The size of the attribute"
167
- },
168
- "xdefault": {
169
- "type": ["string", "null"],
170
- "description": "The default value of the attribute"
171
- },
172
- "encrypted": {
173
- "type": "boolean",
174
- "default": false,
175
- "description": "Whether the attribute is encrypted"
176
- }
177
- },
178
- "required": ["key", "type"],
179
- "description": "Schema for a string attribute"
180
- },
181
- {
182
- "type": "object",
183
- "properties": {
184
- "key": {
185
- "type": "string",
186
- "description": "The unique identifier for the attribute"
187
- },
188
- "type": {
189
- "type": "string",
190
- "enum": ["integer"],
191
- "description": "Specifies the attribute type as an integer"
192
- },
193
- "required": {
194
- "type": "boolean",
195
- "default": false,
196
- "description": "Indicates whether the attribute is required"
197
- },
198
- "array": {
199
- "type": "boolean",
200
- "default": false,
201
- "description": "Indicates whether the attribute should be treated as an array"
202
- },
203
- "min": {
204
- "type": "number",
205
- "description": "The minimum value for the attribute, applicable for numeric types"
206
- },
207
- "max": {
208
- "type": "number",
209
- "description": "The maximum value for the attribute, applicable for numeric types"
210
- },
211
- "xdefault": {
212
- "type": ["number", "null"],
213
- "description": "The default value for the attribute, if not provided by the user"
214
- }
215
- },
216
- "required": ["key", "type"],
217
- "description": "Schema for an integer attribute, including range constraints"
218
- },
219
- {
220
- "type": "object",
221
- "properties": {
222
- "key": {
223
- "type": "string",
224
- "description": "The unique identifier for the attribute"
225
- },
226
- "type": {
227
- "type": "string",
228
- "enum": ["float"],
229
- "description": "Specifies the attribute type as a float"
230
- },
231
- "required": {
232
- "type": "boolean",
233
- "default": false,
234
- "description": "Indicates whether the attribute is required"
235
- },
236
- "array": {
237
- "type": "boolean",
238
- "default": false,
239
- "description": "Indicates whether the attribute should be treated as an array"
240
- },
241
- "min": {
242
- "type": "number",
243
- "description": "The minimum value for the attribute, applicable for numeric types"
244
- },
245
- "max": {
246
- "type": "number",
247
- "description": "The maximum value for the attribute, applicable for numeric types"
248
- },
249
- "xdefault": {
250
- "type": ["number", "null"],
251
- "description": "The default value for the attribute, if not provided by the user"
252
- }
253
- },
254
- "required": ["key", "type"],
255
- "description": "Schema for a float attribute, including range constraints"
256
- },
257
- {
258
- "type": "object",
259
- "properties": {
260
- "key": {
261
- "type": "string",
262
- "description": "The unique identifier for the attribute"
263
- },
264
- "type": {
265
- "type": "string",
266
- "enum": ["boolean"],
267
- "description": "Specifies the attribute type as a boolean"
268
- },
269
- "required": {
270
- "type": "boolean",
271
- "default": false,
272
- "description": "Indicates whether the attribute is required"
273
- },
274
- "array": {
275
- "type": "boolean",
276
- "default": false,
277
- "description": "Indicates whether the attribute should be treated as an array"
278
- },
279
- "xdefault": {
280
- "type": ["boolean", "null"],
281
- "description": "The default value for the attribute, if not provided by the user"
282
- }
283
- },
284
- "required": ["key", "type"],
285
- "description": "Schema for a boolean attribute"
286
- },
287
- {
288
- "type": "object",
289
- "properties": {
290
- "key": {
291
- "type": "string",
292
- "description": "The unique identifier for the attribute"
293
- },
294
- "type": {
295
- "type": "string",
296
- "enum": ["datetime"],
297
- "description": "Specifies the attribute type as a datetime"
298
- },
299
- "required": {
300
- "type": "boolean",
301
- "default": false,
302
- "description": "Indicates whether the attribute is required"
303
- },
304
- "array": {
305
- "type": "boolean",
306
- "default": false,
307
- "description": "Indicates whether the attribute should be treated as an array"
308
- },
309
- "xdefault": {
310
- "type": ["string", "null"],
311
- "description": "The default value for the attribute, if not provided by the user, in ISO 8601 format"
312
- }
313
- },
314
- "required": ["key", "type"],
315
- "description": "Schema for a datetime attribute"
316
- },
317
- {
318
- "type": "object",
319
- "properties": {
320
- "key": {
321
- "type": "string",
322
- "description": "The unique identifier for the attribute"
323
- },
324
- "type": {
325
- "type": "string",
326
- "enum": ["email"],
327
- "description": "Specifies the attribute type as an email"
328
- },
329
- "required": {
330
- "type": "boolean",
331
- "default": false,
332
- "description": "Indicates whether the attribute is required"
333
- },
334
- "array": {
335
- "type": "boolean",
336
- "default": false,
337
- "description": "Indicates whether the attribute should be treated as an array"
338
- },
339
- "xdefault": {
340
- "type": ["string", "null"],
341
- "description": "The default value for the attribute, if not provided by the user"
342
- }
343
- },
344
- "required": ["key", "type"],
345
- "description": "Schema for an email attribute"
346
- },
347
- {
348
- "type": "object",
349
- "properties": {
350
- "key": {
351
- "type": "string",
352
- "description": "The unique identifier for the attribute"
353
- },
354
- "type": {
355
- "type": "string",
356
- "enum": ["ip"],
357
- "description": "Specifies the attribute type as an IP address"
358
- },
359
- "required": {
360
- "type": "boolean",
361
- "default": false,
362
- "description": "Indicates whether the attribute is required"
363
- },
364
- "array": {
365
- "type": "boolean",
366
- "default": false,
367
- "description": "Indicates whether the attribute should be treated as an array"
368
- },
369
- "xdefault": {
370
- "type": ["string", "null"],
371
- "description": "The default value for the attribute, if not provided by the user"
372
- }
373
- },
374
- "required": ["key", "type"],
375
- "description": "Schema for an IP address attribute"
376
- },
377
- {
378
- "type": "object",
379
- "properties": {
380
- "key": {
381
- "type": "string",
382
- "description": "The unique identifier for the URL attribute"
383
- },
384
- "type": {
385
- "type": "string",
386
- "enum": ["url"],
387
- "description": "Specifies the attribute type as a URL"
388
- },
389
- "required": {
390
- "type": "boolean",
391
- "default": false,
392
- "description": "Indicates whether the URL attribute is required"
393
- },
394
- "array": {
395
- "type": "boolean",
396
- "default": false,
397
- "description": "Indicates whether the URL attribute should be treated as an array"
398
- },
399
- "xdefault": {
400
- "type": ["string", "null"],
401
- "description": "The default value for the URL attribute, if not provided by the user"
402
- }
403
- },
404
- "required": ["key", "type"],
405
- "description": "Schema for a URL attribute"
406
- },
407
- {
408
- "type": "object",
409
- "properties": {
410
- "key": {
411
- "type": "string",
412
- "description": "The unique identifier for the enum attribute"
413
- },
414
- "type": {
415
- "type": "string",
416
- "enum": ["enum"],
417
- "description": "Specifies the attribute type as an enumeration"
418
- },
419
- "required": {
420
- "type": "boolean",
421
- "default": false,
422
- "description": "Indicates whether the enum attribute is required"
423
- },
424
- "array": {
425
- "type": "boolean",
426
- "default": false,
427
- "description": "Indicates whether the enum attribute should be treated as an array"
428
- },
429
- "elements": {
430
- "type": "array",
431
- "items": { "type": "string" },
432
- "description": "Defines the allowed values for the enumeration"
433
- },
434
- "xdefault": {
435
- "type": ["string", "null"],
436
- "description": "The default value for the enum attribute, if not provided by the user"
437
- }
438
- },
439
- "required": ["key", "type", "elements"],
440
- "description": "Schema for an enumeration attribute"
441
- },
442
- {
443
- "type": "object",
444
- "properties": {
445
- "key": {
446
- "type": "string",
447
- "description": "The unique identifier for the relationship attribute"
448
- },
449
- "type": {
450
- "type": "string",
451
- "enum": ["relationship"],
452
- "description": "Specifies the attribute type as a relationship"
453
- },
454
- "required": {
455
- "type": "boolean",
456
- "default": false,
457
- "description": "Indicates whether the relationship attribute is required"
458
- },
459
- "array": {
460
- "type": "boolean",
461
- "default": false,
462
- "description": "Indicates whether the relationship attribute should be treated as an array"
463
- },
464
- "relatedCollection": {
465
- "type": "string",
466
- "description": "Specifies the collection that this relationship is linked to"
467
- },
468
- "relationType": {
469
- "type": "string",
470
- "enum": [
471
- "oneToOne",
472
- "oneToMany",
473
- "manyToOne",
474
- "manyToMany"
475
- ],
476
- "description": "Defines the type of relationship"
477
- },
478
- "twoWay": {
479
- "type": "boolean",
480
- "default": false,
481
- "description": "Indicates whether the relationship is two-way"
482
- },
483
- "twoWayKey": {
484
- "type": "string",
485
- "nullable": true,
486
- "description": "Specifies the key for the two-way relationship, if applicable"
487
- },
488
- "onDelete": {
489
- "type": "string",
490
- "enum": ["cascade", "setNull", "restrict"],
491
- "default": "restrict",
492
- "description": "Defines the action to take when the related entity is deleted"
493
- },
494
- "side": {
495
- "type": "string",
496
- "enum": ["parent", "child"],
497
- "nullable": true,
498
- "description": "Specifies which side of the relationship this entity is on"
499
- },
500
- "importMapping": {
501
- "type": "object",
502
- "nullable": true,
503
- "properties": {
504
- "originalIdField": {
505
- "type": "string",
506
- "description": "The field in the import data representing the original ID to match"
507
- },
508
- "targetField": {
509
- "type": "string",
510
- "description": "The field in the target collection that matches the original ID. Optional, defaults to the same as originalIdField if not provided",
511
- "default": ""
512
- }
513
- },
514
- "required": ["originalIdField"],
515
- "description": "Configuration for mapping and resolving relationships during data import"
516
- }
517
- },
518
- "required": [
519
- "key",
520
- "type",
521
- "relatedCollection",
522
- "relationType"
523
- ],
524
- "description": "Schema for a relationship attribute"
525
- }
526
- ]
527
- },
528
- "default": []
529
- },
530
- "indexes": {
531
- "type": "array",
532
- "items": {
533
- "type": "object",
534
- "properties": {
535
- "key": {
536
- "type": "string"
537
- },
538
- "type": {
539
- "type": "string",
540
- "enum": ["key", "unique", "fulltext"],
541
- "default": "key"
542
- },
543
- "status": {
544
- "type": "string"
545
- },
546
- "error": {
547
- "type": "string",
548
- "nullable": true
549
- },
550
- "attributes": {
551
- "type": "array",
552
- "items": {
553
- "type": "string"
554
- }
555
- },
556
- "orders": {
557
- "type": "array",
558
- "items": {
559
- "type": "string"
560
- },
561
- "nullable": true
562
- }
563
- },
564
- "required": ["key", "type", "attributes"]
565
- }
566
- }
567
- },
568
- "required": ["name", "attributes"]
569
- },
570
- "default": [],
571
- "description": "Collections to create, $id is the id of the collection, it'll always check by collection name and $id for existing before creating another"
572
- },
573
- "importDefs": {
574
- "type": "array",
575
- "description": "Defines the parameters and rules for importing data into collections, including document creation and updates.",
576
- "items": {
577
- "type": "object",
578
- "properties": {
579
- "type": {
580
- "type": "string",
581
- "enum": ["create", "update"],
582
- "default": "create",
583
- "description": "The type of import action, if update you should set an object for the originalIdField and targetField"
584
- },
585
- "filePath": {
586
- "type": "string",
587
- "description": "The file path of the data to import"
588
- },
589
- "basePath": {
590
- "type": "string",
591
- "description": "The base path of the import e.g. if you have JSON, and the array is in the RECORDS object, then this would be RECORDS, if nothing then leave it gone"
592
- },
593
- "primaryKeyField": {
594
- "type": "string",
595
- "default": "id",
596
- "description": "The field in the import data representing the primary key for this import data (if any)"
597
- },
598
- "idMappings": {
599
- "type": "array",
600
- "description": "The id mappings for the attribute to map ID's to",
601
- "items": {
602
- "type": "object",
603
- "properties": {
604
- "sourceField": {
605
- "type": "string",
606
- "description": "The key of the data in the import data to match in the current data (this collection import data)"
607
- },
608
- "fieldToSet": {
609
- "type": "string",
610
- "description": "The field to set in the target collection, if different from sourceField"
611
- },
612
- "targetField": {
613
- "type": "string",
614
- "description": "The field in the target collection to match with sourceField that will then be updated"
615
- },
616
- "targetCollection": {
617
- "type": "string",
618
- "description": "The collection to search"
619
- }
620
- },
621
- "required": ["sourceField", "targetField", "targetCollection"]
622
- }
623
- },
624
- "updateMapping": {
625
- "type": "object",
626
- "description": "Configuration for mapping and resolving the update during data import",
627
- "properties": {
628
- "originalIdField": {
629
- "type": "string",
630
- "description": "The field in the import data representing the original ID to match"
631
- },
632
- "targetField": {
633
- "type": "string",
634
- "description": "The field in the target collection that matches the original ID. Optional, defaults to the same as originalIdField if not provided"
635
- }
636
- }
637
- },
638
- "attributeMappings": {
639
- "type": "array",
640
- "description": "Defines how attributes from the source data should be mapped to attributes in the destination collection. This includes specifying the source attribute ('oldKey' or 'oldKeys' for multiple source attributes), the destination attribute ('targetKey'), and any necessary conversions or validations. For example, mapping 'id' from the source to 'idOrig' in the destination, or combining 'firstName' and 'lastName' into a single 'name' attribute.",
641
- "items": {
642
- "type": "object",
643
- "properties": {
644
- "oldKey": {
645
- "type": "string",
646
- "description": "The key of the attribute in the source data. Used when mapping a single source attribute to a destination attribute. For instance, 'id' from the source could be mapped to 'idOrig' in the destination."
647
- },
648
- "oldKeys": {
649
- "type": "array",
650
- "items": {
651
- "type": "string"
652
- },
653
- "description": "An array of keys from the source data. Used when multiple source attributes need to be combined or transformed before mapping to a destination attribute. For example, combining 'firstName' and 'lastName' into a single 'fullName' attribute in the destination."
654
- },
655
- "targetKey": {
656
- "type": "string",
657
- "description": "The key of the attribute in the destination collection that the source data should be mapped to. For example, 'idOrig' as the destination key for the source 'id'."
658
- },
659
- "fileData": {
660
- "type": "object",
661
- "properties": {
662
- "name": {
663
- "type": "string",
664
- "description": "The name of the file related to the attribute. Supports template strings for dynamic file names based on source data attributes, such as using '{id}' to include the source 'id' in the file name."
665
- },
666
- "path": {
667
- "type": "string",
668
- "description": "The path where the file related to the attribute is located. Supports template strings for dynamic paths based on source data attributes, such as using '{id}' to construct a file path that includes the source 'id'."
669
- }
670
- },
671
- "required": ["name", "path"]
672
- },
673
- "converters": {
674
- "type": "array",
675
- "items": {
676
- "type": "string"
677
- },
678
- "description": "A list of converters to apply to the source data before mapping it to the destination attribute. Converters transform the data format or value. For example, a 'stringifyObject' converter might convert an object to a JSON string.",
679
- "default": []
680
- },
681
- "validationActions": {
682
- "type": "array",
683
- "items": {
684
- "type": "object",
685
- "properties": {
686
- "action": {
687
- "type": "string"
688
- },
689
- "params": {
690
- "type": "array",
691
- "description": "Template parameters to use for the action. Use {key} for the actual key in the data, or {dbId}, {collectionId}, {currentDoc}, {currentDocId}. For non-templates, just use the value. These actions and parameters allow for dynamic processing of data post-import, such as validation or transformation based on specific rules.",
692
- "items": {
693
- "oneOf": [
694
- {
695
- "type": "string",
696
- "pattern": "^\\{.*\\}$"
697
- },
698
- {
699
- "type": "string"
700
- }
701
- ]
702
- }
703
- }
704
- },
705
- "required": ["action", "params"]
706
- },
707
- "description": "The after import actions and parameter placeholders (they'll be replaced with the actual data) to use for the import. This allows for dynamic post-processing of imported data, such as applying specific validations or transformations.",
708
- "default": []
709
- },
710
- "postImportActions": {
711
- "type": "array",
712
- "items": {
713
- "type": "object",
714
- "properties": {
715
- "action": {
716
- "type": "string",
717
- "description": "Specifies the type of action to be performed after the import process. Actions can include data transformation, validation, or any custom logic defined."
718
- },
719
- "params": {
720
- "oneOf": [
721
- {
722
- "type": "array",
723
- "items": {
724
- "type": "string",
725
- "pattern": "^\\{.*\\}$",
726
- "description": "Defines the parameters for the action, using placeholders that will be replaced with actual data during the import process. This allows for dynamic parameterization based on the imported data."
727
- },
728
- "description": "An array of parameters for the action, supporting dynamic placeholders for flexibility in post-import processing."
729
- },
730
- {
731
- "type": "string",
732
- "description": "Defines the parameters for the action, using placeholders that will be replaced with actual data during the import process. This allows for dynamic parameterization based on the imported data."
733
- },
734
- {
735
- "type": "object",
736
- "additionalProperties": {
737
- "type": ["string", "number", "boolean", "null"]
738
- },
739
- "description": "Defines the parameters for the action, using placeholders that will be replaced with actual data during the import process. This allows for dynamic parameterization based on the imported data."
740
- }
741
- ]
742
- }
743
- },
744
- "required": ["action", "params"],
745
- "description": "An object representing a single post-import action, including the action type and its parameters."
746
- },
747
- "description": "Defines a list of actions to be executed after the import process, allowing for additional data processing or validation.",
748
- "default": []
749
- }
750
- },
751
- "oneOf": [
752
- {
753
- "required": ["oldKey", "targetKey"],
754
- "description": "Specifies that the mapping must include a direct mapping from an old key to a target key."
755
- },
756
- {
757
- "required": ["oldKeys", "targetKey"],
758
- "description": "Specifies that the mapping can include a mapping from multiple old keys to a single target key, allowing for data consolidation."
759
- }
760
- ]
761
- }
762
- }
763
- },
764
- "required": ["filePath", "basePath", "attributeMappings"],
765
- "description": "Defines the required fields for the import configuration, including the file path, base path, and attribute mappings to guide the import process."
766
- }
767
- }
768
- },
769
- "required": ["appwriteEndpoint", "appwriteProject", "appwriteKey"],
770
- "description": "The root level of the schema, requiring the basic configuration for connecting to an Appwrite project, including endpoint, project ID, and API key."
771
- }