@njdamstra/appwrite-utils-cli 1.10.0 → 1.11.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.
- package/dist/cli/commands/migrateCommands.d.ts +6 -0
- package/dist/cli/commands/migrateCommands.js +118 -0
- package/dist/collections/attributes.js +83 -0
- package/dist/collections/indexes.js +1 -1
- package/dist/collections/tableOperations.js +35 -0
- package/dist/interactiveCLI.js +7 -1
- package/dist/main.js +56 -0
- package/dist/migrations/appwriteToX.d.ts +96 -0
- package/dist/migrations/dataLoader.d.ts +194 -2
- package/dist/migrations/migrateStrings.d.ts +9 -0
- package/dist/migrations/migrateStrings.js +724 -0
- package/dist/migrations/migrateStringsTypes.d.ts +195 -0
- package/dist/migrations/migrateStringsTypes.js +117 -0
- package/dist/storage/schemas.d.ts +384 -0
- package/package.json +4 -4
- package/src/cli/commands/migrateCommands.ts +157 -0
- package/src/collections/attributes.ts +152 -0
- package/src/collections/indexes.ts +3 -3
- package/src/collections/tableOperations.ts +35 -0
- package/src/functions/methods.ts +2 -2
- package/src/interactiveCLI.ts +9 -3
- package/src/main.ts +69 -0
- package/src/migrations/migrateStrings.ts +1064 -0
- package/src/migrations/migrateStringsTypes.ts +158 -0
|
@@ -14,8 +14,8 @@ export declare const CollectionImportDataSchema: z.ZodObject<{
|
|
|
14
14
|
error: z.ZodOptional<z.ZodString>;
|
|
15
15
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
16
16
|
array: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
18
|
-
xdefault: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
17
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodAny>]>>;
|
|
18
|
+
xdefault: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodAny>]>>;
|
|
19
19
|
format: z.ZodOptional<z.ZodString>;
|
|
20
20
|
size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
21
21
|
min: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
@@ -47,6 +47,63 @@ export declare const CollectionImportDataSchema: z.ZodObject<{
|
|
|
47
47
|
size: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
48
48
|
xdefault: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
49
|
encrypt: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
format: z.ZodOptional<z.ZodString>;
|
|
53
|
+
key: z.ZodString;
|
|
54
|
+
status: z.ZodOptional<z.ZodString>;
|
|
55
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
58
|
+
$createdAt: z.ZodOptional<z.ZodString>;
|
|
59
|
+
$updatedAt: z.ZodOptional<z.ZodString>;
|
|
60
|
+
error: z.ZodOptional<z.ZodString>;
|
|
61
|
+
type: z.ZodLiteral<"varchar">;
|
|
62
|
+
size: z.ZodNumber;
|
|
63
|
+
xdefault: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
encrypt: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
66
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
format: z.ZodOptional<z.ZodString>;
|
|
68
|
+
key: z.ZodString;
|
|
69
|
+
status: z.ZodOptional<z.ZodString>;
|
|
70
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
73
|
+
$createdAt: z.ZodOptional<z.ZodString>;
|
|
74
|
+
$updatedAt: z.ZodOptional<z.ZodString>;
|
|
75
|
+
error: z.ZodOptional<z.ZodString>;
|
|
76
|
+
type: z.ZodLiteral<"text">;
|
|
77
|
+
xdefault: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
encrypt: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
format: z.ZodOptional<z.ZodString>;
|
|
82
|
+
key: z.ZodString;
|
|
83
|
+
status: z.ZodOptional<z.ZodString>;
|
|
84
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
87
|
+
$createdAt: z.ZodOptional<z.ZodString>;
|
|
88
|
+
$updatedAt: z.ZodOptional<z.ZodString>;
|
|
89
|
+
error: z.ZodOptional<z.ZodString>;
|
|
90
|
+
type: z.ZodLiteral<"mediumtext">;
|
|
91
|
+
xdefault: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
encrypt: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
94
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
format: z.ZodOptional<z.ZodString>;
|
|
96
|
+
key: z.ZodString;
|
|
97
|
+
status: z.ZodOptional<z.ZodString>;
|
|
98
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
101
|
+
$createdAt: z.ZodOptional<z.ZodString>;
|
|
102
|
+
$updatedAt: z.ZodOptional<z.ZodString>;
|
|
103
|
+
error: z.ZodOptional<z.ZodString>;
|
|
104
|
+
type: z.ZodLiteral<"longtext">;
|
|
105
|
+
xdefault: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
encrypt: z.ZodOptional<z.ZodBoolean>;
|
|
50
107
|
}, z.core.$strip>, z.ZodObject<{
|
|
51
108
|
array: z.ZodOptional<z.ZodBoolean>;
|
|
52
109
|
format: z.ZodOptional<z.ZodString>;
|
|
@@ -171,6 +228,45 @@ export declare const CollectionImportDataSchema: z.ZodObject<{
|
|
|
171
228
|
type: z.ZodLiteral<"enum">;
|
|
172
229
|
elements: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
173
230
|
xdefault: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
232
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
format: z.ZodOptional<z.ZodString>;
|
|
234
|
+
key: z.ZodString;
|
|
235
|
+
status: z.ZodOptional<z.ZodString>;
|
|
236
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
237
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
238
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
239
|
+
$createdAt: z.ZodOptional<z.ZodString>;
|
|
240
|
+
$updatedAt: z.ZodOptional<z.ZodString>;
|
|
241
|
+
error: z.ZodOptional<z.ZodString>;
|
|
242
|
+
type: z.ZodLiteral<"point">;
|
|
243
|
+
xdefault: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
244
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
245
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
246
|
+
format: z.ZodOptional<z.ZodString>;
|
|
247
|
+
key: z.ZodString;
|
|
248
|
+
status: z.ZodOptional<z.ZodString>;
|
|
249
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
250
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
251
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
252
|
+
$createdAt: z.ZodOptional<z.ZodString>;
|
|
253
|
+
$updatedAt: z.ZodOptional<z.ZodString>;
|
|
254
|
+
error: z.ZodOptional<z.ZodString>;
|
|
255
|
+
type: z.ZodLiteral<"line">;
|
|
256
|
+
xdefault: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodArray<z.ZodNumber>>>>;
|
|
257
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
258
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
259
|
+
format: z.ZodOptional<z.ZodString>;
|
|
260
|
+
key: z.ZodString;
|
|
261
|
+
status: z.ZodOptional<z.ZodString>;
|
|
262
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
263
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
264
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
265
|
+
$createdAt: z.ZodOptional<z.ZodString>;
|
|
266
|
+
$updatedAt: z.ZodOptional<z.ZodString>;
|
|
267
|
+
error: z.ZodOptional<z.ZodString>;
|
|
268
|
+
type: z.ZodLiteral<"polygon">;
|
|
269
|
+
xdefault: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber>>>>>;
|
|
174
270
|
}, z.core.$strip>, z.ZodObject<{
|
|
175
271
|
array: z.ZodOptional<z.ZodBoolean>;
|
|
176
272
|
format: z.ZodOptional<z.ZodString>;
|
|
@@ -395,6 +491,63 @@ export declare class DataLoader {
|
|
|
395
491
|
error?: string | undefined;
|
|
396
492
|
xdefault?: string | null | undefined;
|
|
397
493
|
encrypt?: boolean | undefined;
|
|
494
|
+
} | {
|
|
495
|
+
key: string;
|
|
496
|
+
required: boolean;
|
|
497
|
+
type: "varchar";
|
|
498
|
+
size: number;
|
|
499
|
+
array?: boolean | undefined;
|
|
500
|
+
format?: string | undefined;
|
|
501
|
+
status?: string | undefined;
|
|
502
|
+
attributes?: string[] | undefined;
|
|
503
|
+
orders?: string[] | undefined;
|
|
504
|
+
$createdAt?: string | undefined;
|
|
505
|
+
$updatedAt?: string | undefined;
|
|
506
|
+
error?: string | undefined;
|
|
507
|
+
xdefault?: string | null | undefined;
|
|
508
|
+
encrypt?: boolean | undefined;
|
|
509
|
+
} | {
|
|
510
|
+
key: string;
|
|
511
|
+
required: boolean;
|
|
512
|
+
type: "text";
|
|
513
|
+
array?: boolean | undefined;
|
|
514
|
+
format?: string | undefined;
|
|
515
|
+
status?: string | undefined;
|
|
516
|
+
attributes?: string[] | undefined;
|
|
517
|
+
orders?: string[] | undefined;
|
|
518
|
+
$createdAt?: string | undefined;
|
|
519
|
+
$updatedAt?: string | undefined;
|
|
520
|
+
error?: string | undefined;
|
|
521
|
+
xdefault?: string | null | undefined;
|
|
522
|
+
encrypt?: boolean | undefined;
|
|
523
|
+
} | {
|
|
524
|
+
key: string;
|
|
525
|
+
required: boolean;
|
|
526
|
+
type: "mediumtext";
|
|
527
|
+
array?: boolean | undefined;
|
|
528
|
+
format?: string | undefined;
|
|
529
|
+
status?: string | undefined;
|
|
530
|
+
attributes?: string[] | undefined;
|
|
531
|
+
orders?: string[] | undefined;
|
|
532
|
+
$createdAt?: string | undefined;
|
|
533
|
+
$updatedAt?: string | undefined;
|
|
534
|
+
error?: string | undefined;
|
|
535
|
+
xdefault?: string | null | undefined;
|
|
536
|
+
encrypt?: boolean | undefined;
|
|
537
|
+
} | {
|
|
538
|
+
key: string;
|
|
539
|
+
required: boolean;
|
|
540
|
+
type: "longtext";
|
|
541
|
+
array?: boolean | undefined;
|
|
542
|
+
format?: string | undefined;
|
|
543
|
+
status?: string | undefined;
|
|
544
|
+
attributes?: string[] | undefined;
|
|
545
|
+
orders?: string[] | undefined;
|
|
546
|
+
$createdAt?: string | undefined;
|
|
547
|
+
$updatedAt?: string | undefined;
|
|
548
|
+
error?: string | undefined;
|
|
549
|
+
xdefault?: string | null | undefined;
|
|
550
|
+
encrypt?: boolean | undefined;
|
|
398
551
|
} | {
|
|
399
552
|
key: string;
|
|
400
553
|
required: boolean;
|
|
@@ -519,6 +672,45 @@ export declare class DataLoader {
|
|
|
519
672
|
$updatedAt?: string | undefined;
|
|
520
673
|
error?: string | undefined;
|
|
521
674
|
xdefault?: string | null | undefined;
|
|
675
|
+
} | {
|
|
676
|
+
key: string;
|
|
677
|
+
required: boolean;
|
|
678
|
+
type: "point";
|
|
679
|
+
array?: boolean | undefined;
|
|
680
|
+
format?: string | undefined;
|
|
681
|
+
status?: string | undefined;
|
|
682
|
+
attributes?: string[] | undefined;
|
|
683
|
+
orders?: string[] | undefined;
|
|
684
|
+
$createdAt?: string | undefined;
|
|
685
|
+
$updatedAt?: string | undefined;
|
|
686
|
+
error?: string | undefined;
|
|
687
|
+
xdefault?: number[] | null | undefined;
|
|
688
|
+
} | {
|
|
689
|
+
key: string;
|
|
690
|
+
required: boolean;
|
|
691
|
+
type: "line";
|
|
692
|
+
array?: boolean | undefined;
|
|
693
|
+
format?: string | undefined;
|
|
694
|
+
status?: string | undefined;
|
|
695
|
+
attributes?: string[] | undefined;
|
|
696
|
+
orders?: string[] | undefined;
|
|
697
|
+
$createdAt?: string | undefined;
|
|
698
|
+
$updatedAt?: string | undefined;
|
|
699
|
+
error?: string | undefined;
|
|
700
|
+
xdefault?: number[][] | null | undefined;
|
|
701
|
+
} | {
|
|
702
|
+
key: string;
|
|
703
|
+
required: boolean;
|
|
704
|
+
type: "polygon";
|
|
705
|
+
array?: boolean | undefined;
|
|
706
|
+
format?: string | undefined;
|
|
707
|
+
status?: string | undefined;
|
|
708
|
+
attributes?: string[] | undefined;
|
|
709
|
+
orders?: string[] | undefined;
|
|
710
|
+
$createdAt?: string | undefined;
|
|
711
|
+
$updatedAt?: string | undefined;
|
|
712
|
+
error?: string | undefined;
|
|
713
|
+
xdefault?: number[][][] | null | undefined;
|
|
522
714
|
} | {
|
|
523
715
|
key: string;
|
|
524
716
|
required: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DatabaseAdapter } from "@njdamstra/appwrite-utils-helpers";
|
|
2
|
+
import type { AppwriteConfig } from "@njdamstra/appwrite-utils";
|
|
3
|
+
import { type MigrationPlan, type AnalyzeOptions, type ExecuteOptions } from "./migrateStringsTypes.js";
|
|
4
|
+
export declare function analyzeStringAttributes(config: AppwriteConfig, options?: AnalyzeOptions): MigrationPlan;
|
|
5
|
+
export declare function executeMigrationPlan(adapter: DatabaseAdapter, options: ExecuteOptions): Promise<{
|
|
6
|
+
succeeded: number;
|
|
7
|
+
failed: number;
|
|
8
|
+
skipped: number;
|
|
9
|
+
}>;
|