appwrite-utils-cli 1.3.4 → 1.4.0

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 (116) hide show
  1. package/dist/adapters/AdapterFactory.d.ts +87 -0
  2. package/dist/adapters/AdapterFactory.js +217 -0
  3. package/dist/adapters/DatabaseAdapter.d.ts +217 -0
  4. package/dist/adapters/DatabaseAdapter.js +50 -0
  5. package/dist/adapters/LegacyAdapter.d.ts +49 -0
  6. package/dist/adapters/LegacyAdapter.js +382 -0
  7. package/dist/adapters/TablesDBAdapter.d.ts +55 -0
  8. package/dist/adapters/TablesDBAdapter.js +302 -0
  9. package/dist/adapters/index.d.ts +11 -0
  10. package/dist/adapters/index.js +12 -0
  11. package/dist/collections/attributes.js +43 -24
  12. package/dist/collections/methods.d.ts +4 -3
  13. package/dist/collections/methods.js +34 -14
  14. package/dist/config/yamlConfig.d.ts +40 -437
  15. package/dist/config/yamlConfig.js +8 -2
  16. package/dist/databases/setup.js +2 -2
  17. package/dist/main.js +0 -0
  18. package/dist/migrations/appwriteToX.d.ts +26 -37
  19. package/dist/migrations/comprehensiveTransfer.js +4 -4
  20. package/dist/migrations/dataLoader.d.ts +124 -1484
  21. package/dist/migrations/dataLoader.js +2 -1
  22. package/dist/migrations/relationships.d.ts +2 -3
  23. package/dist/migrations/relationships.js +1 -1
  24. package/dist/migrations/services/UserMappingService.js +1 -1
  25. package/dist/migrations/yaml/YamlImportConfigLoader.d.ts +24 -279
  26. package/dist/migrations/yaml/YamlImportConfigLoader.js +7 -2
  27. package/dist/schemas/authUser.d.ts +7 -47
  28. package/dist/schemas/authUser.js +1 -1
  29. package/dist/shared/jsonSchemaGenerator.d.ts +0 -2
  30. package/dist/shared/jsonSchemaGenerator.js +4 -17
  31. package/dist/shared/migrationHelpers.d.ts +17 -119
  32. package/dist/shared/operationQueue.js +16 -7
  33. package/dist/shared/schemaGenerator.js +2 -17
  34. package/dist/storage/schemas.d.ts +149 -296
  35. package/dist/users/methods.d.ts +2 -2
  36. package/dist/utils/configMigration.js +0 -1
  37. package/dist/utils/getClientFromConfig.d.ts +26 -0
  38. package/dist/utils/getClientFromConfig.js +37 -0
  39. package/dist/utils/loadConfigs.js +0 -2
  40. package/dist/utils/schemaStrings.js +2 -17
  41. package/dist/utils/setupFiles.js +2 -0
  42. package/dist/utils/versionDetection.d.ts +56 -0
  43. package/dist/utils/versionDetection.js +217 -0
  44. package/dist/utils/yamlConverter.d.ts +0 -1
  45. package/dist/utils/yamlConverter.js +0 -2
  46. package/dist/utilsController.js +2 -0
  47. package/package.json +3 -2
  48. package/src/adapters/AdapterFactory.ts +296 -0
  49. package/src/adapters/DatabaseAdapter.ts +290 -0
  50. package/src/adapters/LegacyAdapter.ts +667 -0
  51. package/src/adapters/TablesDBAdapter.ts +429 -0
  52. package/src/adapters/index.ts +37 -0
  53. package/src/collections/attributes.ts +351 -157
  54. package/src/collections/methods.ts +43 -28
  55. package/src/config/yamlConfig.ts +8 -2
  56. package/src/databases/setup.ts +2 -2
  57. package/src/migrations/afterImportActions.ts +2 -2
  58. package/src/migrations/comprehensiveTransfer.ts +4 -0
  59. package/src/migrations/dataLoader.ts +2 -1
  60. package/src/migrations/relationships.ts +1 -1
  61. package/src/migrations/services/UserMappingService.ts +1 -1
  62. package/src/migrations/yaml/YamlImportConfigLoader.ts +7 -2
  63. package/src/schemas/authUser.ts +1 -1
  64. package/src/shared/jsonSchemaGenerator.ts +4 -19
  65. package/src/shared/operationQueue.ts +20 -13
  66. package/src/shared/schemaGenerator.ts +2 -16
  67. package/src/types/node-appwrite-tablesdb.d.ts +44 -0
  68. package/src/users/methods.ts +2 -2
  69. package/src/utils/configMigration.ts +0 -1
  70. package/src/utils/getClientFromConfig.ts +56 -0
  71. package/src/utils/loadConfigs.ts +0 -2
  72. package/src/utils/schemaStrings.ts +2 -16
  73. package/src/utils/setupFiles.ts +2 -0
  74. package/src/utils/versionDetection.ts +265 -0
  75. package/src/utils/yamlConverter.ts +0 -2
  76. package/src/utilsController.ts +2 -0
  77. package/dist/functions/openapi.d.ts +0 -4
  78. package/dist/functions/openapi.js +0 -60
  79. package/dist/migrations/attributes.d.ts +0 -4
  80. package/dist/migrations/attributes.js +0 -301
  81. package/dist/migrations/backup.d.ts +0 -687
  82. package/dist/migrations/backup.js +0 -175
  83. package/dist/migrations/collections.d.ts +0 -22
  84. package/dist/migrations/collections.js +0 -347
  85. package/dist/migrations/converters.d.ts +0 -46
  86. package/dist/migrations/converters.js +0 -139
  87. package/dist/migrations/databases.d.ts +0 -2
  88. package/dist/migrations/databases.js +0 -28
  89. package/dist/migrations/dbHelpers.d.ts +0 -5
  90. package/dist/migrations/dbHelpers.js +0 -57
  91. package/dist/migrations/helper.d.ts +0 -3
  92. package/dist/migrations/helper.js +0 -21
  93. package/dist/migrations/indexes.d.ts +0 -4
  94. package/dist/migrations/indexes.js +0 -19
  95. package/dist/migrations/logging.d.ts +0 -10
  96. package/dist/migrations/logging.js +0 -46
  97. package/dist/migrations/migrationHelper.d.ts +0 -173
  98. package/dist/migrations/migrationHelper.js +0 -130
  99. package/dist/migrations/openapi.d.ts +0 -4
  100. package/dist/migrations/openapi.js +0 -60
  101. package/dist/migrations/queue.d.ts +0 -13
  102. package/dist/migrations/queue.js +0 -79
  103. package/dist/migrations/schemaStrings.d.ts +0 -14
  104. package/dist/migrations/schemaStrings.js +0 -478
  105. package/dist/migrations/setupDatabase.d.ts +0 -6
  106. package/dist/migrations/setupDatabase.js +0 -115
  107. package/dist/migrations/storage.d.ts +0 -10
  108. package/dist/migrations/storage.js +0 -340
  109. package/dist/migrations/users.d.ts +0 -16
  110. package/dist/migrations/users.js +0 -276
  111. package/dist/migrations/validationRules.d.ts +0 -43
  112. package/dist/migrations/validationRules.js +0 -42
  113. package/dist/shared/attributeManager.d.ts +0 -17
  114. package/dist/shared/attributeManager.js +0 -272
  115. package/src/functions/openapi.ts +0 -83
  116. package/src/shared/attributeManager.ts +0 -428
@@ -1,687 +0,0 @@
1
- import { z } from "zod";
2
- export declare const BackupSchema: z.ZodObject<{
3
- $id: z.ZodString;
4
- $createdAt: z.ZodString;
5
- $updatedAt: z.ZodString;
6
- database: z.ZodString;
7
- collections: z.ZodArray<z.ZodString, "many">;
8
- documents: z.ZodDefault<z.ZodArray<z.ZodObject<{
9
- collectionId: z.ZodString;
10
- data: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- data: string;
13
- collectionId: string;
14
- }, {
15
- data: string;
16
- collectionId: string;
17
- }>, "many">>;
18
- }, "strip", z.ZodTypeAny, {
19
- documents: {
20
- data: string;
21
- collectionId: string;
22
- }[];
23
- $id: string;
24
- collections: string[];
25
- $createdAt: string;
26
- $updatedAt: string;
27
- database: string;
28
- }, {
29
- $id: string;
30
- collections: string[];
31
- $createdAt: string;
32
- $updatedAt: string;
33
- database: string;
34
- documents?: {
35
- data: string;
36
- collectionId: string;
37
- }[] | undefined;
38
- }>;
39
- export type Backup = z.infer<typeof BackupSchema>;
40
- export declare const BackupCreateSchema: z.ZodObject<Omit<{
41
- $id: z.ZodString;
42
- $createdAt: z.ZodString;
43
- $updatedAt: z.ZodString;
44
- database: z.ZodString;
45
- collections: z.ZodArray<z.ZodString, "many">;
46
- documents: z.ZodDefault<z.ZodArray<z.ZodObject<{
47
- collectionId: z.ZodString;
48
- data: z.ZodString;
49
- }, "strip", z.ZodTypeAny, {
50
- data: string;
51
- collectionId: string;
52
- }, {
53
- data: string;
54
- collectionId: string;
55
- }>, "many">>;
56
- }, "$id" | "$createdAt" | "$updatedAt">, "strip", z.ZodTypeAny, {
57
- documents: {
58
- data: string;
59
- collectionId: string;
60
- }[];
61
- collections: string[];
62
- database: string;
63
- }, {
64
- collections: string[];
65
- database: string;
66
- documents?: {
67
- data: string;
68
- collectionId: string;
69
- }[] | undefined;
70
- }>;
71
- export type BackupCreate = z.infer<typeof BackupCreateSchema>;
72
- export declare const BatchSchema: z.ZodObject<{
73
- $id: z.ZodString;
74
- $createdAt: z.ZodString;
75
- $updatedAt: z.ZodString;
76
- data: z.ZodString;
77
- processed: z.ZodDefault<z.ZodBoolean>;
78
- }, "strip", z.ZodTypeAny, {
79
- data: string;
80
- $id: string;
81
- $createdAt: string;
82
- $updatedAt: string;
83
- processed: boolean;
84
- }, {
85
- data: string;
86
- $id: string;
87
- $createdAt: string;
88
- $updatedAt: string;
89
- processed?: boolean | undefined;
90
- }>;
91
- export type Batch = z.infer<typeof BatchSchema>;
92
- export declare const BatchCreateSchema: z.ZodObject<Omit<{
93
- $id: z.ZodString;
94
- $createdAt: z.ZodString;
95
- $updatedAt: z.ZodString;
96
- data: z.ZodString;
97
- processed: z.ZodDefault<z.ZodBoolean>;
98
- }, "$id" | "$createdAt" | "$updatedAt">, "strip", z.ZodTypeAny, {
99
- data: string;
100
- processed: boolean;
101
- }, {
102
- data: string;
103
- processed?: boolean | undefined;
104
- }>;
105
- export type BatchCreate = z.infer<typeof BatchCreateSchema>;
106
- export declare const OperationSchema: z.ZodObject<{
107
- $id: z.ZodString;
108
- $createdAt: z.ZodString;
109
- $updatedAt: z.ZodString;
110
- operationType: z.ZodString;
111
- collectionId: z.ZodString;
112
- data: z.ZodAny;
113
- batches: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
114
- progress: z.ZodNumber;
115
- total: z.ZodNumber;
116
- error: z.ZodString;
117
- status: z.ZodDefault<z.ZodEnum<["pending", "ready", "in_progress", "completed", "error", "cancelled"]>>;
118
- }, "strip", z.ZodTypeAny, {
119
- status: "error" | "pending" | "ready" | "in_progress" | "completed" | "cancelled";
120
- error: string;
121
- $id: string;
122
- $createdAt: string;
123
- $updatedAt: string;
124
- collectionId: string;
125
- operationType: string;
126
- progress: number;
127
- total: number;
128
- data?: any;
129
- batches?: string[] | undefined;
130
- }, {
131
- error: string;
132
- $id: string;
133
- $createdAt: string;
134
- $updatedAt: string;
135
- collectionId: string;
136
- operationType: string;
137
- progress: number;
138
- total: number;
139
- status?: "error" | "pending" | "ready" | "in_progress" | "completed" | "cancelled" | undefined;
140
- data?: any;
141
- batches?: string[] | undefined;
142
- }>;
143
- export type Operation = z.infer<typeof OperationSchema>;
144
- export declare const OperationCreateSchema: z.ZodObject<Omit<{
145
- $id: z.ZodString;
146
- $createdAt: z.ZodString;
147
- $updatedAt: z.ZodString;
148
- operationType: z.ZodString;
149
- collectionId: z.ZodString;
150
- data: z.ZodAny;
151
- batches: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
152
- progress: z.ZodNumber;
153
- total: z.ZodNumber;
154
- error: z.ZodString;
155
- status: z.ZodDefault<z.ZodEnum<["pending", "ready", "in_progress", "completed", "error", "cancelled"]>>;
156
- }, "$id" | "$createdAt" | "$updatedAt">, "strip", z.ZodTypeAny, {
157
- status: "error" | "pending" | "ready" | "in_progress" | "completed" | "cancelled";
158
- error: string;
159
- collectionId: string;
160
- operationType: string;
161
- progress: number;
162
- total: number;
163
- data?: any;
164
- batches?: string[] | undefined;
165
- }, {
166
- error: string;
167
- collectionId: string;
168
- operationType: string;
169
- progress: number;
170
- total: number;
171
- status?: "error" | "pending" | "ready" | "in_progress" | "completed" | "cancelled" | undefined;
172
- data?: any;
173
- batches?: string[] | undefined;
174
- }>;
175
- export type OperationCreate = z.infer<typeof OperationCreateSchema>;
176
- export declare const getMigrationCollectionSchemas: () => {
177
- CurrentOperations: {
178
- collection: {
179
- name: string;
180
- attributes: ({
181
- type: "string";
182
- key: string;
183
- size: number;
184
- format?: string | null | undefined;
185
- description?: string | Record<string, string> | undefined;
186
- required?: boolean | undefined;
187
- array?: boolean | undefined;
188
- error?: string | undefined;
189
- xdefault?: string | null | undefined;
190
- encrypted?: boolean | undefined;
191
- } | {
192
- type: "integer";
193
- key: string;
194
- description?: string | Record<string, string> | null | undefined;
195
- required?: boolean | undefined;
196
- array?: boolean | undefined;
197
- error?: string | undefined;
198
- xdefault?: number | null | undefined;
199
- min?: number | undefined;
200
- max?: number | undefined;
201
- } | {
202
- type: "float";
203
- key: string;
204
- description?: string | Record<string, string> | null | undefined;
205
- required?: boolean | undefined;
206
- array?: boolean | undefined;
207
- error?: string | undefined;
208
- xdefault?: number | null | undefined;
209
- min?: number | undefined;
210
- max?: number | undefined;
211
- } | {
212
- type: "boolean";
213
- key: string;
214
- description?: string | Record<string, string> | null | undefined;
215
- required?: boolean | undefined;
216
- array?: boolean | undefined;
217
- error?: string | undefined;
218
- xdefault?: boolean | null | undefined;
219
- } | {
220
- type: "datetime";
221
- key: string;
222
- description?: string | Record<string, string> | null | undefined;
223
- required?: boolean | undefined;
224
- array?: boolean | undefined;
225
- error?: string | undefined;
226
- xdefault?: string | null | undefined;
227
- } | {
228
- type: "email";
229
- key: string;
230
- description?: string | Record<string, string> | null | undefined;
231
- required?: boolean | undefined;
232
- array?: boolean | undefined;
233
- error?: string | undefined;
234
- xdefault?: string | null | undefined;
235
- } | {
236
- type: "ip";
237
- key: string;
238
- description?: string | Record<string, string> | null | undefined;
239
- required?: boolean | undefined;
240
- array?: boolean | undefined;
241
- error?: string | undefined;
242
- xdefault?: string | null | undefined;
243
- } | {
244
- type: "url";
245
- key: string;
246
- description?: string | Record<string, string> | null | undefined;
247
- required?: boolean | undefined;
248
- array?: boolean | undefined;
249
- error?: string | undefined;
250
- xdefault?: string | null | undefined;
251
- } | {
252
- type: "enum";
253
- key: string;
254
- elements: string[];
255
- description?: string | Record<string, string> | null | undefined;
256
- required?: boolean | undefined;
257
- array?: boolean | undefined;
258
- error?: string | undefined;
259
- xdefault?: string | null | undefined;
260
- } | {
261
- type: "relationship";
262
- key: string;
263
- relatedCollection: string;
264
- relationType: "oneToMany" | "manyToOne" | "oneToOne" | "manyToMany";
265
- twoWay: boolean;
266
- twoWayKey: string;
267
- onDelete: "setNull" | "cascade" | "restrict";
268
- side: "parent" | "child";
269
- description?: string | Record<string, string> | null | undefined;
270
- required?: boolean | undefined;
271
- array?: boolean | undefined;
272
- error?: string | undefined;
273
- importMapping?: {
274
- originalIdField: string;
275
- targetField?: string | undefined;
276
- } | undefined;
277
- })[];
278
- $permissions: {
279
- permission: string;
280
- target: string;
281
- }[];
282
- indexes: {
283
- type: "key" | "unique" | "fulltext";
284
- key: string;
285
- attributes: string[];
286
- status?: string | undefined;
287
- error?: string | undefined;
288
- orders?: string[] | undefined;
289
- }[];
290
- importDefs: {
291
- filePath: string;
292
- primaryKeyField: string;
293
- attributeMappings: {
294
- targetKey: string;
295
- oldKey?: string | undefined;
296
- oldKeys?: string[] | undefined;
297
- valueToSet?: any;
298
- fileData?: {
299
- path: string;
300
- name: string;
301
- } | undefined;
302
- converters?: string[] | undefined;
303
- validationActions?: {
304
- params: string[];
305
- action: string;
306
- }[] | undefined;
307
- postImportActions?: {
308
- params: (string | Record<string, any>)[];
309
- action: string;
310
- }[] | undefined;
311
- }[];
312
- type?: "create" | "update" | undefined;
313
- basePath?: string | undefined;
314
- idMappings?: {
315
- sourceField: string;
316
- targetField: string;
317
- targetCollection: string;
318
- fieldToSet?: string | undefined;
319
- targetFieldToMatch?: string | undefined;
320
- }[] | undefined;
321
- createUsers?: boolean | null | undefined;
322
- updateMapping?: {
323
- targetField: string;
324
- originalIdField: string;
325
- } | undefined;
326
- }[];
327
- description?: string | undefined;
328
- $id?: string | undefined;
329
- enabled?: boolean | undefined;
330
- documentSecurity?: boolean | undefined;
331
- databaseId?: string | undefined;
332
- };
333
- attributes: ({
334
- type: "string";
335
- key: string;
336
- size: number;
337
- format?: string | null | undefined;
338
- description?: string | Record<string, string> | undefined;
339
- required?: boolean | undefined;
340
- array?: boolean | undefined;
341
- error?: string | undefined;
342
- xdefault?: string | null | undefined;
343
- encrypted?: boolean | undefined;
344
- } | {
345
- type: "integer";
346
- key: string;
347
- description?: string | Record<string, string> | null | undefined;
348
- required?: boolean | undefined;
349
- array?: boolean | undefined;
350
- error?: string | undefined;
351
- xdefault?: number | null | undefined;
352
- min?: number | undefined;
353
- max?: number | undefined;
354
- } | {
355
- type: "float";
356
- key: string;
357
- description?: string | Record<string, string> | null | undefined;
358
- required?: boolean | undefined;
359
- array?: boolean | undefined;
360
- error?: string | undefined;
361
- xdefault?: number | null | undefined;
362
- min?: number | undefined;
363
- max?: number | undefined;
364
- } | {
365
- type: "boolean";
366
- key: string;
367
- description?: string | Record<string, string> | null | undefined;
368
- required?: boolean | undefined;
369
- array?: boolean | undefined;
370
- error?: string | undefined;
371
- xdefault?: boolean | null | undefined;
372
- } | {
373
- type: "datetime";
374
- key: string;
375
- description?: string | Record<string, string> | null | undefined;
376
- required?: boolean | undefined;
377
- array?: boolean | undefined;
378
- error?: string | undefined;
379
- xdefault?: string | null | undefined;
380
- } | {
381
- type: "email";
382
- key: string;
383
- description?: string | Record<string, string> | null | undefined;
384
- required?: boolean | undefined;
385
- array?: boolean | undefined;
386
- error?: string | undefined;
387
- xdefault?: string | null | undefined;
388
- } | {
389
- type: "ip";
390
- key: string;
391
- description?: string | Record<string, string> | null | undefined;
392
- required?: boolean | undefined;
393
- array?: boolean | undefined;
394
- error?: string | undefined;
395
- xdefault?: string | null | undefined;
396
- } | {
397
- type: "url";
398
- key: string;
399
- description?: string | Record<string, string> | null | undefined;
400
- required?: boolean | undefined;
401
- array?: boolean | undefined;
402
- error?: string | undefined;
403
- xdefault?: string | null | undefined;
404
- } | {
405
- type: "enum";
406
- key: string;
407
- elements: string[];
408
- description?: string | Record<string, string> | null | undefined;
409
- required?: boolean | undefined;
410
- array?: boolean | undefined;
411
- error?: string | undefined;
412
- xdefault?: string | null | undefined;
413
- } | {
414
- type: "relationship";
415
- key: string;
416
- relatedCollection: string;
417
- relationType: "oneToMany" | "manyToOne" | "oneToOne" | "manyToMany";
418
- twoWay: boolean;
419
- twoWayKey: string;
420
- onDelete: "setNull" | "cascade" | "restrict";
421
- side: "parent" | "child";
422
- description?: string | Record<string, string> | null | undefined;
423
- required?: boolean | undefined;
424
- array?: boolean | undefined;
425
- error?: string | undefined;
426
- importMapping?: {
427
- originalIdField: string;
428
- targetField?: string | undefined;
429
- } | undefined;
430
- })[];
431
- };
432
- Batches: {
433
- collection: {
434
- name: string;
435
- attributes: ({
436
- type: "string";
437
- key: string;
438
- size: number;
439
- format?: string | null | undefined;
440
- description?: string | Record<string, string> | undefined;
441
- required?: boolean | undefined;
442
- array?: boolean | undefined;
443
- error?: string | undefined;
444
- xdefault?: string | null | undefined;
445
- encrypted?: boolean | undefined;
446
- } | {
447
- type: "integer";
448
- key: string;
449
- description?: string | Record<string, string> | null | undefined;
450
- required?: boolean | undefined;
451
- array?: boolean | undefined;
452
- error?: string | undefined;
453
- xdefault?: number | null | undefined;
454
- min?: number | undefined;
455
- max?: number | undefined;
456
- } | {
457
- type: "float";
458
- key: string;
459
- description?: string | Record<string, string> | null | undefined;
460
- required?: boolean | undefined;
461
- array?: boolean | undefined;
462
- error?: string | undefined;
463
- xdefault?: number | null | undefined;
464
- min?: number | undefined;
465
- max?: number | undefined;
466
- } | {
467
- type: "boolean";
468
- key: string;
469
- description?: string | Record<string, string> | null | undefined;
470
- required?: boolean | undefined;
471
- array?: boolean | undefined;
472
- error?: string | undefined;
473
- xdefault?: boolean | null | undefined;
474
- } | {
475
- type: "datetime";
476
- key: string;
477
- description?: string | Record<string, string> | null | undefined;
478
- required?: boolean | undefined;
479
- array?: boolean | undefined;
480
- error?: string | undefined;
481
- xdefault?: string | null | undefined;
482
- } | {
483
- type: "email";
484
- key: string;
485
- description?: string | Record<string, string> | null | undefined;
486
- required?: boolean | undefined;
487
- array?: boolean | undefined;
488
- error?: string | undefined;
489
- xdefault?: string | null | undefined;
490
- } | {
491
- type: "ip";
492
- key: string;
493
- description?: string | Record<string, string> | null | undefined;
494
- required?: boolean | undefined;
495
- array?: boolean | undefined;
496
- error?: string | undefined;
497
- xdefault?: string | null | undefined;
498
- } | {
499
- type: "url";
500
- key: string;
501
- description?: string | Record<string, string> | null | undefined;
502
- required?: boolean | undefined;
503
- array?: boolean | undefined;
504
- error?: string | undefined;
505
- xdefault?: string | null | undefined;
506
- } | {
507
- type: "enum";
508
- key: string;
509
- elements: string[];
510
- description?: string | Record<string, string> | null | undefined;
511
- required?: boolean | undefined;
512
- array?: boolean | undefined;
513
- error?: string | undefined;
514
- xdefault?: string | null | undefined;
515
- } | {
516
- type: "relationship";
517
- key: string;
518
- relatedCollection: string;
519
- relationType: "oneToMany" | "manyToOne" | "oneToOne" | "manyToMany";
520
- twoWay: boolean;
521
- twoWayKey: string;
522
- onDelete: "setNull" | "cascade" | "restrict";
523
- side: "parent" | "child";
524
- description?: string | Record<string, string> | null | undefined;
525
- required?: boolean | undefined;
526
- array?: boolean | undefined;
527
- error?: string | undefined;
528
- importMapping?: {
529
- originalIdField: string;
530
- targetField?: string | undefined;
531
- } | undefined;
532
- })[];
533
- $permissions: {
534
- permission: string;
535
- target: string;
536
- }[];
537
- indexes: {
538
- type: "key" | "unique" | "fulltext";
539
- key: string;
540
- attributes: string[];
541
- status?: string | undefined;
542
- error?: string | undefined;
543
- orders?: string[] | undefined;
544
- }[];
545
- importDefs: {
546
- filePath: string;
547
- primaryKeyField: string;
548
- attributeMappings: {
549
- targetKey: string;
550
- oldKey?: string | undefined;
551
- oldKeys?: string[] | undefined;
552
- valueToSet?: any;
553
- fileData?: {
554
- path: string;
555
- name: string;
556
- } | undefined;
557
- converters?: string[] | undefined;
558
- validationActions?: {
559
- params: string[];
560
- action: string;
561
- }[] | undefined;
562
- postImportActions?: {
563
- params: (string | Record<string, any>)[];
564
- action: string;
565
- }[] | undefined;
566
- }[];
567
- type?: "create" | "update" | undefined;
568
- basePath?: string | undefined;
569
- idMappings?: {
570
- sourceField: string;
571
- targetField: string;
572
- targetCollection: string;
573
- fieldToSet?: string | undefined;
574
- targetFieldToMatch?: string | undefined;
575
- }[] | undefined;
576
- createUsers?: boolean | null | undefined;
577
- updateMapping?: {
578
- targetField: string;
579
- originalIdField: string;
580
- } | undefined;
581
- }[];
582
- description?: string | undefined;
583
- $id?: string | undefined;
584
- enabled?: boolean | undefined;
585
- documentSecurity?: boolean | undefined;
586
- databaseId?: string | undefined;
587
- };
588
- attributes: ({
589
- type: "string";
590
- key: string;
591
- size: number;
592
- format?: string | null | undefined;
593
- description?: string | Record<string, string> | undefined;
594
- required?: boolean | undefined;
595
- array?: boolean | undefined;
596
- error?: string | undefined;
597
- xdefault?: string | null | undefined;
598
- encrypted?: boolean | undefined;
599
- } | {
600
- type: "integer";
601
- key: string;
602
- description?: string | Record<string, string> | null | undefined;
603
- required?: boolean | undefined;
604
- array?: boolean | undefined;
605
- error?: string | undefined;
606
- xdefault?: number | null | undefined;
607
- min?: number | undefined;
608
- max?: number | undefined;
609
- } | {
610
- type: "float";
611
- key: string;
612
- description?: string | Record<string, string> | null | undefined;
613
- required?: boolean | undefined;
614
- array?: boolean | undefined;
615
- error?: string | undefined;
616
- xdefault?: number | null | undefined;
617
- min?: number | undefined;
618
- max?: number | undefined;
619
- } | {
620
- type: "boolean";
621
- key: string;
622
- description?: string | Record<string, string> | null | undefined;
623
- required?: boolean | undefined;
624
- array?: boolean | undefined;
625
- error?: string | undefined;
626
- xdefault?: boolean | null | undefined;
627
- } | {
628
- type: "datetime";
629
- key: string;
630
- description?: string | Record<string, string> | null | undefined;
631
- required?: boolean | undefined;
632
- array?: boolean | undefined;
633
- error?: string | undefined;
634
- xdefault?: string | null | undefined;
635
- } | {
636
- type: "email";
637
- key: string;
638
- description?: string | Record<string, string> | null | undefined;
639
- required?: boolean | undefined;
640
- array?: boolean | undefined;
641
- error?: string | undefined;
642
- xdefault?: string | null | undefined;
643
- } | {
644
- type: "ip";
645
- key: string;
646
- description?: string | Record<string, string> | null | undefined;
647
- required?: boolean | undefined;
648
- array?: boolean | undefined;
649
- error?: string | undefined;
650
- xdefault?: string | null | undefined;
651
- } | {
652
- type: "url";
653
- key: string;
654
- description?: string | Record<string, string> | null | undefined;
655
- required?: boolean | undefined;
656
- array?: boolean | undefined;
657
- error?: string | undefined;
658
- xdefault?: string | null | undefined;
659
- } | {
660
- type: "enum";
661
- key: string;
662
- elements: string[];
663
- description?: string | Record<string, string> | null | undefined;
664
- required?: boolean | undefined;
665
- array?: boolean | undefined;
666
- error?: string | undefined;
667
- xdefault?: string | null | undefined;
668
- } | {
669
- type: "relationship";
670
- key: string;
671
- relatedCollection: string;
672
- relationType: "oneToMany" | "manyToOne" | "oneToOne" | "manyToMany";
673
- twoWay: boolean;
674
- twoWayKey: string;
675
- onDelete: "setNull" | "cascade" | "restrict";
676
- side: "parent" | "child";
677
- description?: string | Record<string, string> | null | undefined;
678
- required?: boolean | undefined;
679
- array?: boolean | undefined;
680
- error?: string | undefined;
681
- importMapping?: {
682
- originalIdField: string;
683
- targetField?: string | undefined;
684
- } | undefined;
685
- })[];
686
- };
687
- };