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.
- package/dist/adapters/AdapterFactory.d.ts +87 -0
- package/dist/adapters/AdapterFactory.js +217 -0
- package/dist/adapters/DatabaseAdapter.d.ts +217 -0
- package/dist/adapters/DatabaseAdapter.js +50 -0
- package/dist/adapters/LegacyAdapter.d.ts +49 -0
- package/dist/adapters/LegacyAdapter.js +382 -0
- package/dist/adapters/TablesDBAdapter.d.ts +55 -0
- package/dist/adapters/TablesDBAdapter.js +302 -0
- package/dist/adapters/index.d.ts +11 -0
- package/dist/adapters/index.js +12 -0
- package/dist/collections/attributes.js +43 -24
- package/dist/collections/methods.d.ts +4 -3
- package/dist/collections/methods.js +34 -14
- package/dist/config/yamlConfig.d.ts +40 -437
- package/dist/config/yamlConfig.js +8 -2
- package/dist/databases/setup.js +2 -2
- package/dist/main.js +0 -0
- package/dist/migrations/appwriteToX.d.ts +26 -37
- package/dist/migrations/comprehensiveTransfer.js +4 -4
- package/dist/migrations/dataLoader.d.ts +124 -1484
- package/dist/migrations/dataLoader.js +2 -1
- package/dist/migrations/relationships.d.ts +2 -3
- package/dist/migrations/relationships.js +1 -1
- package/dist/migrations/services/UserMappingService.js +1 -1
- package/dist/migrations/yaml/YamlImportConfigLoader.d.ts +24 -279
- package/dist/migrations/yaml/YamlImportConfigLoader.js +7 -2
- package/dist/schemas/authUser.d.ts +7 -47
- package/dist/schemas/authUser.js +1 -1
- package/dist/shared/jsonSchemaGenerator.d.ts +0 -2
- package/dist/shared/jsonSchemaGenerator.js +4 -17
- package/dist/shared/migrationHelpers.d.ts +17 -119
- package/dist/shared/operationQueue.js +16 -7
- package/dist/shared/schemaGenerator.js +2 -17
- package/dist/storage/schemas.d.ts +149 -296
- package/dist/users/methods.d.ts +2 -2
- package/dist/utils/configMigration.js +0 -1
- package/dist/utils/getClientFromConfig.d.ts +26 -0
- package/dist/utils/getClientFromConfig.js +37 -0
- package/dist/utils/loadConfigs.js +0 -2
- package/dist/utils/schemaStrings.js +2 -17
- package/dist/utils/setupFiles.js +2 -0
- package/dist/utils/versionDetection.d.ts +56 -0
- package/dist/utils/versionDetection.js +217 -0
- package/dist/utils/yamlConverter.d.ts +0 -1
- package/dist/utils/yamlConverter.js +0 -2
- package/dist/utilsController.js +2 -0
- package/package.json +3 -2
- package/src/adapters/AdapterFactory.ts +296 -0
- package/src/adapters/DatabaseAdapter.ts +290 -0
- package/src/adapters/LegacyAdapter.ts +667 -0
- package/src/adapters/TablesDBAdapter.ts +429 -0
- package/src/adapters/index.ts +37 -0
- package/src/collections/attributes.ts +351 -157
- package/src/collections/methods.ts +43 -28
- package/src/config/yamlConfig.ts +8 -2
- package/src/databases/setup.ts +2 -2
- package/src/migrations/afterImportActions.ts +2 -2
- package/src/migrations/comprehensiveTransfer.ts +4 -0
- package/src/migrations/dataLoader.ts +2 -1
- package/src/migrations/relationships.ts +1 -1
- package/src/migrations/services/UserMappingService.ts +1 -1
- package/src/migrations/yaml/YamlImportConfigLoader.ts +7 -2
- package/src/schemas/authUser.ts +1 -1
- package/src/shared/jsonSchemaGenerator.ts +4 -19
- package/src/shared/operationQueue.ts +20 -13
- package/src/shared/schemaGenerator.ts +2 -16
- package/src/types/node-appwrite-tablesdb.d.ts +44 -0
- package/src/users/methods.ts +2 -2
- package/src/utils/configMigration.ts +0 -1
- package/src/utils/getClientFromConfig.ts +56 -0
- package/src/utils/loadConfigs.ts +0 -2
- package/src/utils/schemaStrings.ts +2 -16
- package/src/utils/setupFiles.ts +2 -0
- package/src/utils/versionDetection.ts +265 -0
- package/src/utils/yamlConverter.ts +0 -2
- package/src/utilsController.ts +2 -0
- package/dist/functions/openapi.d.ts +0 -4
- package/dist/functions/openapi.js +0 -60
- package/dist/migrations/attributes.d.ts +0 -4
- package/dist/migrations/attributes.js +0 -301
- package/dist/migrations/backup.d.ts +0 -687
- package/dist/migrations/backup.js +0 -175
- package/dist/migrations/collections.d.ts +0 -22
- package/dist/migrations/collections.js +0 -347
- package/dist/migrations/converters.d.ts +0 -46
- package/dist/migrations/converters.js +0 -139
- package/dist/migrations/databases.d.ts +0 -2
- package/dist/migrations/databases.js +0 -28
- package/dist/migrations/dbHelpers.d.ts +0 -5
- package/dist/migrations/dbHelpers.js +0 -57
- package/dist/migrations/helper.d.ts +0 -3
- package/dist/migrations/helper.js +0 -21
- package/dist/migrations/indexes.d.ts +0 -4
- package/dist/migrations/indexes.js +0 -19
- package/dist/migrations/logging.d.ts +0 -10
- package/dist/migrations/logging.js +0 -46
- package/dist/migrations/migrationHelper.d.ts +0 -173
- package/dist/migrations/migrationHelper.js +0 -130
- package/dist/migrations/openapi.d.ts +0 -4
- package/dist/migrations/openapi.js +0 -60
- package/dist/migrations/queue.d.ts +0 -13
- package/dist/migrations/queue.js +0 -79
- package/dist/migrations/schemaStrings.d.ts +0 -14
- package/dist/migrations/schemaStrings.js +0 -478
- package/dist/migrations/setupDatabase.d.ts +0 -6
- package/dist/migrations/setupDatabase.js +0 -115
- package/dist/migrations/storage.d.ts +0 -10
- package/dist/migrations/storage.js +0 -340
- package/dist/migrations/users.d.ts +0 -16
- package/dist/migrations/users.js +0 -276
- package/dist/migrations/validationRules.d.ts +0 -43
- package/dist/migrations/validationRules.js +0 -42
- package/dist/shared/attributeManager.d.ts +0 -17
- package/dist/shared/attributeManager.js +0 -272
- package/src/functions/openapi.ts +0 -83
- package/src/shared/attributeManager.ts +0 -428
|
@@ -5,80 +5,38 @@ declare const YamlConfigSchema: z.ZodObject<{
|
|
|
5
5
|
endpoint: z.ZodDefault<z.ZodString>;
|
|
6
6
|
project: z.ZodString;
|
|
7
7
|
key: z.ZodString;
|
|
8
|
-
},
|
|
9
|
-
endpoint: string;
|
|
10
|
-
project: string;
|
|
11
|
-
key: string;
|
|
12
|
-
}, {
|
|
13
|
-
project: string;
|
|
14
|
-
key: string;
|
|
15
|
-
endpoint?: string | undefined;
|
|
16
|
-
}>;
|
|
8
|
+
}, z.core.$strip>;
|
|
17
9
|
logging: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
18
10
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
-
level: z.ZodDefault<z.ZodEnum<
|
|
11
|
+
level: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
error: "error";
|
|
13
|
+
warn: "warn";
|
|
14
|
+
info: "info";
|
|
15
|
+
debug: "debug";
|
|
16
|
+
}>>;
|
|
20
17
|
directory: z.ZodOptional<z.ZodString>;
|
|
21
18
|
console: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
-
},
|
|
23
|
-
enabled: boolean;
|
|
24
|
-
level: "error" | "warn" | "info" | "debug";
|
|
25
|
-
console: boolean;
|
|
26
|
-
directory?: string | undefined;
|
|
27
|
-
}, {
|
|
28
|
-
enabled?: boolean | undefined;
|
|
29
|
-
level?: "error" | "warn" | "info" | "debug" | undefined;
|
|
30
|
-
directory?: string | undefined;
|
|
31
|
-
console?: boolean | undefined;
|
|
32
|
-
}>>>;
|
|
19
|
+
}, z.core.$strip>>>;
|
|
33
20
|
backups: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
34
21
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
35
22
|
interval: z.ZodDefault<z.ZodNumber>;
|
|
36
23
|
retention: z.ZodDefault<z.ZodNumber>;
|
|
37
24
|
cleanup: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
-
},
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
interval: number;
|
|
41
|
-
retention: number;
|
|
42
|
-
cleanup: boolean;
|
|
43
|
-
}, {
|
|
44
|
-
enabled?: boolean | undefined;
|
|
45
|
-
interval?: number | undefined;
|
|
46
|
-
retention?: number | undefined;
|
|
47
|
-
cleanup?: boolean | undefined;
|
|
48
|
-
}>>>;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
49
26
|
data: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
50
27
|
enableMockData: z.ZodDefault<z.ZodBoolean>;
|
|
51
28
|
documentBucketId: z.ZodDefault<z.ZodString>;
|
|
52
29
|
usersCollectionName: z.ZodDefault<z.ZodString>;
|
|
53
30
|
importDirectory: z.ZodDefault<z.ZodString>;
|
|
54
|
-
},
|
|
55
|
-
enableMockData: boolean;
|
|
56
|
-
documentBucketId: string;
|
|
57
|
-
usersCollectionName: string;
|
|
58
|
-
importDirectory: string;
|
|
59
|
-
}, {
|
|
60
|
-
enableMockData?: boolean | undefined;
|
|
61
|
-
documentBucketId?: string | undefined;
|
|
62
|
-
usersCollectionName?: string | undefined;
|
|
63
|
-
importDirectory?: string | undefined;
|
|
64
|
-
}>>>;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
65
32
|
schemas: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
66
33
|
outputDirectory: z.ZodDefault<z.ZodString>;
|
|
67
34
|
yamlSchemaDirectory: z.ZodDefault<z.ZodString>;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
yamlSchemaDirectory: string;
|
|
71
|
-
}, {
|
|
72
|
-
outputDirectory?: string | undefined;
|
|
73
|
-
yamlSchemaDirectory?: string | undefined;
|
|
74
|
-
}>>>;
|
|
35
|
+
collectionsDirectory: z.ZodDefault<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
75
37
|
migrations: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
76
38
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
77
|
-
},
|
|
78
|
-
enabled: boolean;
|
|
79
|
-
}, {
|
|
80
|
-
enabled?: boolean | undefined;
|
|
81
|
-
}>>>;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
82
40
|
databases: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
83
41
|
id: z.ZodString;
|
|
84
42
|
name: z.ZodString;
|
|
@@ -88,163 +46,58 @@ declare const YamlConfigSchema: z.ZodObject<{
|
|
|
88
46
|
permissions: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
89
47
|
permission: z.ZodString;
|
|
90
48
|
target: z.ZodString;
|
|
91
|
-
},
|
|
92
|
-
permission: string;
|
|
93
|
-
target: string;
|
|
94
|
-
}, {
|
|
49
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
95
50
|
permission: string;
|
|
96
51
|
target: string;
|
|
97
|
-
}
|
|
98
|
-
permission: string;
|
|
99
|
-
target: string;
|
|
100
|
-
}, string>]>, "many">>;
|
|
52
|
+
}, string>>]>>>;
|
|
101
53
|
fileSecurity: z.ZodOptional<z.ZodBoolean>;
|
|
102
54
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
103
55
|
maximumFileSize: z.ZodOptional<z.ZodNumber>;
|
|
104
|
-
allowedFileExtensions: z.ZodOptional<z.ZodArray<z.ZodString
|
|
105
|
-
compression: z.ZodOptional<z.ZodEnum<
|
|
56
|
+
allowedFileExtensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
|
+
compression: z.ZodOptional<z.ZodEnum<{
|
|
58
|
+
none: "none";
|
|
59
|
+
gzip: "gzip";
|
|
60
|
+
zstd: "zstd";
|
|
61
|
+
}>>;
|
|
106
62
|
encryption: z.ZodOptional<z.ZodBoolean>;
|
|
107
63
|
antivirus: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
id: string;
|
|
111
|
-
enabled?: boolean | undefined;
|
|
112
|
-
permissions?: ({
|
|
113
|
-
permission: string;
|
|
114
|
-
target: string;
|
|
115
|
-
} | {
|
|
116
|
-
permission: string;
|
|
117
|
-
target: string;
|
|
118
|
-
})[] | undefined;
|
|
119
|
-
fileSecurity?: boolean | undefined;
|
|
120
|
-
maximumFileSize?: number | undefined;
|
|
121
|
-
allowedFileExtensions?: string[] | undefined;
|
|
122
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
123
|
-
encryption?: boolean | undefined;
|
|
124
|
-
antivirus?: boolean | undefined;
|
|
125
|
-
}, {
|
|
126
|
-
name: string;
|
|
127
|
-
id: string;
|
|
128
|
-
enabled?: boolean | undefined;
|
|
129
|
-
permissions?: (string | {
|
|
130
|
-
permission: string;
|
|
131
|
-
target: string;
|
|
132
|
-
})[] | undefined;
|
|
133
|
-
fileSecurity?: boolean | undefined;
|
|
134
|
-
maximumFileSize?: number | undefined;
|
|
135
|
-
allowedFileExtensions?: string[] | undefined;
|
|
136
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
137
|
-
encryption?: boolean | undefined;
|
|
138
|
-
antivirus?: boolean | undefined;
|
|
139
|
-
}>>;
|
|
140
|
-
}, "strip", z.ZodTypeAny, {
|
|
141
|
-
name: string;
|
|
142
|
-
id: string;
|
|
143
|
-
bucket?: {
|
|
144
|
-
name: string;
|
|
145
|
-
id: string;
|
|
146
|
-
enabled?: boolean | undefined;
|
|
147
|
-
permissions?: ({
|
|
148
|
-
permission: string;
|
|
149
|
-
target: string;
|
|
150
|
-
} | {
|
|
151
|
-
permission: string;
|
|
152
|
-
target: string;
|
|
153
|
-
})[] | undefined;
|
|
154
|
-
fileSecurity?: boolean | undefined;
|
|
155
|
-
maximumFileSize?: number | undefined;
|
|
156
|
-
allowedFileExtensions?: string[] | undefined;
|
|
157
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
158
|
-
encryption?: boolean | undefined;
|
|
159
|
-
antivirus?: boolean | undefined;
|
|
160
|
-
} | undefined;
|
|
161
|
-
}, {
|
|
162
|
-
name: string;
|
|
163
|
-
id: string;
|
|
164
|
-
bucket?: {
|
|
165
|
-
name: string;
|
|
166
|
-
id: string;
|
|
167
|
-
enabled?: boolean | undefined;
|
|
168
|
-
permissions?: (string | {
|
|
169
|
-
permission: string;
|
|
170
|
-
target: string;
|
|
171
|
-
})[] | undefined;
|
|
172
|
-
fileSecurity?: boolean | undefined;
|
|
173
|
-
maximumFileSize?: number | undefined;
|
|
174
|
-
allowedFileExtensions?: string[] | undefined;
|
|
175
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
176
|
-
encryption?: boolean | undefined;
|
|
177
|
-
antivirus?: boolean | undefined;
|
|
178
|
-
} | undefined;
|
|
179
|
-
}>, "many">>>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$strip>>>>;
|
|
180
66
|
buckets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
181
67
|
id: z.ZodString;
|
|
182
68
|
name: z.ZodString;
|
|
183
69
|
permissions: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
184
70
|
permission: z.ZodString;
|
|
185
71
|
target: z.ZodString;
|
|
186
|
-
},
|
|
72
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
187
73
|
permission: string;
|
|
188
74
|
target: string;
|
|
189
|
-
},
|
|
190
|
-
permission: string;
|
|
191
|
-
target: string;
|
|
192
|
-
}>, z.ZodEffects<z.ZodString, {
|
|
193
|
-
permission: string;
|
|
194
|
-
target: string;
|
|
195
|
-
}, string>]>, "many">>;
|
|
75
|
+
}, string>>]>>>;
|
|
196
76
|
fileSecurity: z.ZodOptional<z.ZodBoolean>;
|
|
197
77
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
198
78
|
maximumFileSize: z.ZodOptional<z.ZodNumber>;
|
|
199
|
-
allowedFileExtensions: z.ZodOptional<z.ZodArray<z.ZodString
|
|
200
|
-
compression: z.ZodOptional<z.ZodEnum<
|
|
79
|
+
allowedFileExtensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
compression: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
none: "none";
|
|
82
|
+
gzip: "gzip";
|
|
83
|
+
zstd: "zstd";
|
|
84
|
+
}>>;
|
|
201
85
|
encryption: z.ZodOptional<z.ZodBoolean>;
|
|
202
86
|
antivirus: z.ZodOptional<z.ZodBoolean>;
|
|
203
|
-
},
|
|
204
|
-
name: string;
|
|
205
|
-
id: string;
|
|
206
|
-
enabled?: boolean | undefined;
|
|
207
|
-
permissions?: ({
|
|
208
|
-
permission: string;
|
|
209
|
-
target: string;
|
|
210
|
-
} | {
|
|
211
|
-
permission: string;
|
|
212
|
-
target: string;
|
|
213
|
-
})[] | undefined;
|
|
214
|
-
fileSecurity?: boolean | undefined;
|
|
215
|
-
maximumFileSize?: number | undefined;
|
|
216
|
-
allowedFileExtensions?: string[] | undefined;
|
|
217
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
218
|
-
encryption?: boolean | undefined;
|
|
219
|
-
antivirus?: boolean | undefined;
|
|
220
|
-
}, {
|
|
221
|
-
name: string;
|
|
222
|
-
id: string;
|
|
223
|
-
enabled?: boolean | undefined;
|
|
224
|
-
permissions?: (string | {
|
|
225
|
-
permission: string;
|
|
226
|
-
target: string;
|
|
227
|
-
})[] | undefined;
|
|
228
|
-
fileSecurity?: boolean | undefined;
|
|
229
|
-
maximumFileSize?: number | undefined;
|
|
230
|
-
allowedFileExtensions?: string[] | undefined;
|
|
231
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
232
|
-
encryption?: boolean | undefined;
|
|
233
|
-
antivirus?: boolean | undefined;
|
|
234
|
-
}>, "many">>>;
|
|
87
|
+
}, z.core.$strip>>>>;
|
|
235
88
|
functions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
236
89
|
id: z.ZodString;
|
|
237
90
|
name: z.ZodString;
|
|
238
91
|
runtime: any;
|
|
239
|
-
execute: z.ZodOptional<z.ZodArray<z.ZodString
|
|
240
|
-
events: z.ZodOptional<z.ZodArray<z.ZodString
|
|
92
|
+
execute: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
+
events: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
241
94
|
schedule: z.ZodOptional<z.ZodString>;
|
|
242
95
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
243
96
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
244
97
|
logging: z.ZodOptional<z.ZodBoolean>;
|
|
245
98
|
entrypoint: z.ZodOptional<z.ZodString>;
|
|
246
99
|
commands: z.ZodOptional<z.ZodString>;
|
|
247
|
-
scopes: z.ZodOptional<z.ZodArray<z.
|
|
100
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
248
101
|
installationId: z.ZodOptional<z.ZodString>;
|
|
249
102
|
providerRepositoryId: z.ZodOptional<z.ZodString>;
|
|
250
103
|
providerBranch: z.ZodOptional<z.ZodString>;
|
|
@@ -254,264 +107,14 @@ declare const YamlConfigSchema: z.ZodObject<{
|
|
|
254
107
|
templateOwner: z.ZodOptional<z.ZodString>;
|
|
255
108
|
templateRootDirectory: z.ZodOptional<z.ZodString>;
|
|
256
109
|
templateBranch: z.ZodOptional<z.ZodString>;
|
|
257
|
-
specification: z.ZodOptional<z.
|
|
110
|
+
specification: z.ZodOptional<z.ZodString>;
|
|
258
111
|
dirPath: z.ZodOptional<z.ZodString>;
|
|
259
|
-
predeployCommands: z.ZodOptional<z.ZodArray<z.ZodString
|
|
112
|
+
predeployCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
113
|
deployDir: z.ZodOptional<z.ZodString>;
|
|
261
|
-
ignore: z.ZodOptional<z.ZodArray<z.ZodString
|
|
114
|
+
ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
262
115
|
templateVersion: z.ZodOptional<z.ZodString>;
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
id: string;
|
|
266
|
-
enabled?: boolean | undefined;
|
|
267
|
-
logging?: boolean | undefined;
|
|
268
|
-
runtime?: any;
|
|
269
|
-
execute?: string[] | undefined;
|
|
270
|
-
events?: string[] | undefined;
|
|
271
|
-
schedule?: string | undefined;
|
|
272
|
-
timeout?: number | undefined;
|
|
273
|
-
entrypoint?: string | undefined;
|
|
274
|
-
commands?: string | undefined;
|
|
275
|
-
scopes?: ("users.read" | "users.write" | "sessions.read" | "sessions.write" | "teams.read" | "teams.write" | "databases.read" | "databases.write" | "collections.read" | "collections.write" | "attributes.read" | "attributes.write" | "indexes.read" | "indexes.write" | "documents.read" | "documents.write" | "files.read" | "files.write" | "buckets.read" | "buckets.write" | "functions.read" | "functions.write" | "execution.read" | "execution.write" | "locale.read" | "avatars.read" | "health.read" | "rules.read" | "rules.write" | "migrations.read" | "migrations.write" | "sites.read" | "sites.write" | "log.read" | "log.write" | "tokens.read" | "tokens.write" | "vcs.read" | "vcs.write" | "assistant.read" | "messages.read" | "messages.write" | "targets.read" | "targets.write" | "providers.read" | "providers.write" | "topics.read" | "topics.write" | "subscribers.read" | "subscribers.write")[] | undefined;
|
|
276
|
-
installationId?: string | undefined;
|
|
277
|
-
providerRepositoryId?: string | undefined;
|
|
278
|
-
providerBranch?: string | undefined;
|
|
279
|
-
providerSilentMode?: boolean | undefined;
|
|
280
|
-
providerRootDirectory?: string | undefined;
|
|
281
|
-
templateRepository?: string | undefined;
|
|
282
|
-
templateOwner?: string | undefined;
|
|
283
|
-
templateRootDirectory?: string | undefined;
|
|
284
|
-
templateBranch?: string | undefined;
|
|
285
|
-
specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined;
|
|
286
|
-
dirPath?: string | undefined;
|
|
287
|
-
predeployCommands?: string[] | undefined;
|
|
288
|
-
deployDir?: string | undefined;
|
|
289
|
-
ignore?: string[] | undefined;
|
|
290
|
-
templateVersion?: string | undefined;
|
|
291
|
-
}, {
|
|
292
|
-
name: string;
|
|
293
|
-
id: string;
|
|
294
|
-
enabled?: boolean | undefined;
|
|
295
|
-
logging?: boolean | undefined;
|
|
296
|
-
runtime?: any;
|
|
297
|
-
execute?: string[] | undefined;
|
|
298
|
-
events?: string[] | undefined;
|
|
299
|
-
schedule?: string | undefined;
|
|
300
|
-
timeout?: number | undefined;
|
|
301
|
-
entrypoint?: string | undefined;
|
|
302
|
-
commands?: string | undefined;
|
|
303
|
-
scopes?: string[] | undefined;
|
|
304
|
-
installationId?: string | undefined;
|
|
305
|
-
providerRepositoryId?: string | undefined;
|
|
306
|
-
providerBranch?: string | undefined;
|
|
307
|
-
providerSilentMode?: boolean | undefined;
|
|
308
|
-
providerRootDirectory?: string | undefined;
|
|
309
|
-
templateRepository?: string | undefined;
|
|
310
|
-
templateOwner?: string | undefined;
|
|
311
|
-
templateRootDirectory?: string | undefined;
|
|
312
|
-
templateBranch?: string | undefined;
|
|
313
|
-
specification?: string | undefined;
|
|
314
|
-
dirPath?: string | undefined;
|
|
315
|
-
predeployCommands?: string[] | undefined;
|
|
316
|
-
deployDir?: string | undefined;
|
|
317
|
-
ignore?: string[] | undefined;
|
|
318
|
-
templateVersion?: string | undefined;
|
|
319
|
-
}>, "many">>>;
|
|
320
|
-
}, "strip", z.ZodTypeAny, {
|
|
321
|
-
appwrite: {
|
|
322
|
-
endpoint: string;
|
|
323
|
-
project: string;
|
|
324
|
-
key: string;
|
|
325
|
-
};
|
|
326
|
-
logging: {
|
|
327
|
-
enabled: boolean;
|
|
328
|
-
level: "error" | "warn" | "info" | "debug";
|
|
329
|
-
console: boolean;
|
|
330
|
-
directory?: string | undefined;
|
|
331
|
-
};
|
|
332
|
-
backups: {
|
|
333
|
-
enabled: boolean;
|
|
334
|
-
interval: number;
|
|
335
|
-
retention: number;
|
|
336
|
-
cleanup: boolean;
|
|
337
|
-
};
|
|
338
|
-
data: {
|
|
339
|
-
enableMockData: boolean;
|
|
340
|
-
documentBucketId: string;
|
|
341
|
-
usersCollectionName: string;
|
|
342
|
-
importDirectory: string;
|
|
343
|
-
};
|
|
344
|
-
schemas: {
|
|
345
|
-
outputDirectory: string;
|
|
346
|
-
yamlSchemaDirectory: string;
|
|
347
|
-
};
|
|
348
|
-
migrations: {
|
|
349
|
-
enabled: boolean;
|
|
350
|
-
};
|
|
351
|
-
databases: {
|
|
352
|
-
name: string;
|
|
353
|
-
id: string;
|
|
354
|
-
bucket?: {
|
|
355
|
-
name: string;
|
|
356
|
-
id: string;
|
|
357
|
-
enabled?: boolean | undefined;
|
|
358
|
-
permissions?: ({
|
|
359
|
-
permission: string;
|
|
360
|
-
target: string;
|
|
361
|
-
} | {
|
|
362
|
-
permission: string;
|
|
363
|
-
target: string;
|
|
364
|
-
})[] | undefined;
|
|
365
|
-
fileSecurity?: boolean | undefined;
|
|
366
|
-
maximumFileSize?: number | undefined;
|
|
367
|
-
allowedFileExtensions?: string[] | undefined;
|
|
368
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
369
|
-
encryption?: boolean | undefined;
|
|
370
|
-
antivirus?: boolean | undefined;
|
|
371
|
-
} | undefined;
|
|
372
|
-
}[];
|
|
373
|
-
buckets: {
|
|
374
|
-
name: string;
|
|
375
|
-
id: string;
|
|
376
|
-
enabled?: boolean | undefined;
|
|
377
|
-
permissions?: ({
|
|
378
|
-
permission: string;
|
|
379
|
-
target: string;
|
|
380
|
-
} | {
|
|
381
|
-
permission: string;
|
|
382
|
-
target: string;
|
|
383
|
-
})[] | undefined;
|
|
384
|
-
fileSecurity?: boolean | undefined;
|
|
385
|
-
maximumFileSize?: number | undefined;
|
|
386
|
-
allowedFileExtensions?: string[] | undefined;
|
|
387
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
388
|
-
encryption?: boolean | undefined;
|
|
389
|
-
antivirus?: boolean | undefined;
|
|
390
|
-
}[];
|
|
391
|
-
functions: {
|
|
392
|
-
name: string;
|
|
393
|
-
id: string;
|
|
394
|
-
enabled?: boolean | undefined;
|
|
395
|
-
logging?: boolean | undefined;
|
|
396
|
-
runtime?: any;
|
|
397
|
-
execute?: string[] | undefined;
|
|
398
|
-
events?: string[] | undefined;
|
|
399
|
-
schedule?: string | undefined;
|
|
400
|
-
timeout?: number | undefined;
|
|
401
|
-
entrypoint?: string | undefined;
|
|
402
|
-
commands?: string | undefined;
|
|
403
|
-
scopes?: ("users.read" | "users.write" | "sessions.read" | "sessions.write" | "teams.read" | "teams.write" | "databases.read" | "databases.write" | "collections.read" | "collections.write" | "attributes.read" | "attributes.write" | "indexes.read" | "indexes.write" | "documents.read" | "documents.write" | "files.read" | "files.write" | "buckets.read" | "buckets.write" | "functions.read" | "functions.write" | "execution.read" | "execution.write" | "locale.read" | "avatars.read" | "health.read" | "rules.read" | "rules.write" | "migrations.read" | "migrations.write" | "sites.read" | "sites.write" | "log.read" | "log.write" | "tokens.read" | "tokens.write" | "vcs.read" | "vcs.write" | "assistant.read" | "messages.read" | "messages.write" | "targets.read" | "targets.write" | "providers.read" | "providers.write" | "topics.read" | "topics.write" | "subscribers.read" | "subscribers.write")[] | undefined;
|
|
404
|
-
installationId?: string | undefined;
|
|
405
|
-
providerRepositoryId?: string | undefined;
|
|
406
|
-
providerBranch?: string | undefined;
|
|
407
|
-
providerSilentMode?: boolean | undefined;
|
|
408
|
-
providerRootDirectory?: string | undefined;
|
|
409
|
-
templateRepository?: string | undefined;
|
|
410
|
-
templateOwner?: string | undefined;
|
|
411
|
-
templateRootDirectory?: string | undefined;
|
|
412
|
-
templateBranch?: string | undefined;
|
|
413
|
-
specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined;
|
|
414
|
-
dirPath?: string | undefined;
|
|
415
|
-
predeployCommands?: string[] | undefined;
|
|
416
|
-
deployDir?: string | undefined;
|
|
417
|
-
ignore?: string[] | undefined;
|
|
418
|
-
templateVersion?: string | undefined;
|
|
419
|
-
}[];
|
|
420
|
-
}, {
|
|
421
|
-
appwrite: {
|
|
422
|
-
project: string;
|
|
423
|
-
key: string;
|
|
424
|
-
endpoint?: string | undefined;
|
|
425
|
-
};
|
|
426
|
-
logging?: {
|
|
427
|
-
enabled?: boolean | undefined;
|
|
428
|
-
level?: "error" | "warn" | "info" | "debug" | undefined;
|
|
429
|
-
directory?: string | undefined;
|
|
430
|
-
console?: boolean | undefined;
|
|
431
|
-
} | undefined;
|
|
432
|
-
backups?: {
|
|
433
|
-
enabled?: boolean | undefined;
|
|
434
|
-
interval?: number | undefined;
|
|
435
|
-
retention?: number | undefined;
|
|
436
|
-
cleanup?: boolean | undefined;
|
|
437
|
-
} | undefined;
|
|
438
|
-
data?: {
|
|
439
|
-
enableMockData?: boolean | undefined;
|
|
440
|
-
documentBucketId?: string | undefined;
|
|
441
|
-
usersCollectionName?: string | undefined;
|
|
442
|
-
importDirectory?: string | undefined;
|
|
443
|
-
} | undefined;
|
|
444
|
-
schemas?: {
|
|
445
|
-
outputDirectory?: string | undefined;
|
|
446
|
-
yamlSchemaDirectory?: string | undefined;
|
|
447
|
-
} | undefined;
|
|
448
|
-
migrations?: {
|
|
449
|
-
enabled?: boolean | undefined;
|
|
450
|
-
} | undefined;
|
|
451
|
-
databases?: {
|
|
452
|
-
name: string;
|
|
453
|
-
id: string;
|
|
454
|
-
bucket?: {
|
|
455
|
-
name: string;
|
|
456
|
-
id: string;
|
|
457
|
-
enabled?: boolean | undefined;
|
|
458
|
-
permissions?: (string | {
|
|
459
|
-
permission: string;
|
|
460
|
-
target: string;
|
|
461
|
-
})[] | undefined;
|
|
462
|
-
fileSecurity?: boolean | undefined;
|
|
463
|
-
maximumFileSize?: number | undefined;
|
|
464
|
-
allowedFileExtensions?: string[] | undefined;
|
|
465
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
466
|
-
encryption?: boolean | undefined;
|
|
467
|
-
antivirus?: boolean | undefined;
|
|
468
|
-
} | undefined;
|
|
469
|
-
}[] | undefined;
|
|
470
|
-
buckets?: {
|
|
471
|
-
name: string;
|
|
472
|
-
id: string;
|
|
473
|
-
enabled?: boolean | undefined;
|
|
474
|
-
permissions?: (string | {
|
|
475
|
-
permission: string;
|
|
476
|
-
target: string;
|
|
477
|
-
})[] | undefined;
|
|
478
|
-
fileSecurity?: boolean | undefined;
|
|
479
|
-
maximumFileSize?: number | undefined;
|
|
480
|
-
allowedFileExtensions?: string[] | undefined;
|
|
481
|
-
compression?: "none" | "gzip" | "zstd" | undefined;
|
|
482
|
-
encryption?: boolean | undefined;
|
|
483
|
-
antivirus?: boolean | undefined;
|
|
484
|
-
}[] | undefined;
|
|
485
|
-
functions?: {
|
|
486
|
-
name: string;
|
|
487
|
-
id: string;
|
|
488
|
-
enabled?: boolean | undefined;
|
|
489
|
-
logging?: boolean | undefined;
|
|
490
|
-
runtime?: any;
|
|
491
|
-
execute?: string[] | undefined;
|
|
492
|
-
events?: string[] | undefined;
|
|
493
|
-
schedule?: string | undefined;
|
|
494
|
-
timeout?: number | undefined;
|
|
495
|
-
entrypoint?: string | undefined;
|
|
496
|
-
commands?: string | undefined;
|
|
497
|
-
scopes?: string[] | undefined;
|
|
498
|
-
installationId?: string | undefined;
|
|
499
|
-
providerRepositoryId?: string | undefined;
|
|
500
|
-
providerBranch?: string | undefined;
|
|
501
|
-
providerSilentMode?: boolean | undefined;
|
|
502
|
-
providerRootDirectory?: string | undefined;
|
|
503
|
-
templateRepository?: string | undefined;
|
|
504
|
-
templateOwner?: string | undefined;
|
|
505
|
-
templateRootDirectory?: string | undefined;
|
|
506
|
-
templateBranch?: string | undefined;
|
|
507
|
-
specification?: string | undefined;
|
|
508
|
-
dirPath?: string | undefined;
|
|
509
|
-
predeployCommands?: string[] | undefined;
|
|
510
|
-
deployDir?: string | undefined;
|
|
511
|
-
ignore?: string[] | undefined;
|
|
512
|
-
templateVersion?: string | undefined;
|
|
513
|
-
}[] | undefined;
|
|
514
|
-
}>;
|
|
116
|
+
}, z.core.$strip>>>>;
|
|
117
|
+
}, z.core.$strip>;
|
|
515
118
|
export type YamlConfig = z.infer<typeof YamlConfigSchema>;
|
|
516
119
|
export declare const convertYamlToAppwriteConfig: (yamlConfig: YamlConfig) => AppwriteConfig;
|
|
517
120
|
export declare const loadYamlConfig: (configPath: string) => Promise<AppwriteConfig | null>;
|
|
@@ -45,15 +45,17 @@ const YamlConfigSchema = z.object({
|
|
|
45
45
|
.object({
|
|
46
46
|
outputDirectory: z.string().default("schemas"),
|
|
47
47
|
yamlSchemaDirectory: z.string().default(".yaml_schemas"),
|
|
48
|
+
collectionsDirectory: z.string().default("collections"),
|
|
48
49
|
})
|
|
49
50
|
.optional()
|
|
50
51
|
.default({
|
|
51
52
|
outputDirectory: "schemas",
|
|
52
53
|
yamlSchemaDirectory: ".yaml_schemas",
|
|
54
|
+
collectionsDirectory: "collections",
|
|
53
55
|
}),
|
|
54
56
|
migrations: z
|
|
55
57
|
.object({
|
|
56
|
-
enabled: z.boolean().default(
|
|
58
|
+
enabled: z.boolean().default(false),
|
|
57
59
|
})
|
|
58
60
|
.optional()
|
|
59
61
|
.default({
|
|
@@ -138,6 +140,7 @@ export const convertYamlToAppwriteConfig = (yamlConfig) => {
|
|
|
138
140
|
appwriteEndpoint: yamlConfig.appwrite.endpoint,
|
|
139
141
|
appwriteProject: yamlConfig.appwrite.project,
|
|
140
142
|
appwriteKey: yamlConfig.appwrite.key,
|
|
143
|
+
apiMode: "auto", // Default to auto-detect for dual API support
|
|
141
144
|
appwriteClient: null,
|
|
142
145
|
logging: {
|
|
143
146
|
enabled: yamlConfig.logging.enabled,
|
|
@@ -157,6 +160,7 @@ export const convertYamlToAppwriteConfig = (yamlConfig) => {
|
|
|
157
160
|
outputDirectory: yamlConfig.schemas.outputDirectory,
|
|
158
161
|
yamlSchemaDirectory: yamlConfig.schemas.yamlSchemaDirectory,
|
|
159
162
|
importDirectory: yamlConfig.data.importDirectory,
|
|
163
|
+
collectionsDirectory: yamlConfig.schemas.collectionsDirectory || "collections",
|
|
160
164
|
},
|
|
161
165
|
databases: yamlConfig.databases.map((db) => ({
|
|
162
166
|
$id: db.id,
|
|
@@ -232,7 +236,7 @@ export const loadYamlConfig = async (configPath) => {
|
|
|
232
236
|
catch (error) {
|
|
233
237
|
if (error instanceof z.ZodError) {
|
|
234
238
|
console.error("❌ YAML config validation failed:");
|
|
235
|
-
error.
|
|
239
|
+
error.issues.forEach((err) => {
|
|
236
240
|
console.error(` ${err.path.join('.')} → ${err.message}`);
|
|
237
241
|
});
|
|
238
242
|
}
|
|
@@ -389,6 +393,7 @@ export const generateYamlConfigTemplate = (outputPath) => {
|
|
|
389
393
|
schemas: {
|
|
390
394
|
outputDirectory: "schemas",
|
|
391
395
|
yamlSchemaDirectory: ".yaml_schemas",
|
|
396
|
+
collectionsDirectory: "collections",
|
|
392
397
|
},
|
|
393
398
|
migrations: {
|
|
394
399
|
enabled: true,
|
|
@@ -446,6 +451,7 @@ export const writeYamlConfig = async (configPath, config) => {
|
|
|
446
451
|
schemas: {
|
|
447
452
|
outputDirectory: config.schemaConfig?.outputDirectory || "schemas",
|
|
448
453
|
yamlSchemaDirectory: config.schemaConfig?.yamlSchemaDirectory || ".yaml_schemas",
|
|
454
|
+
collectionsDirectory: config.schemaConfig?.collectionsDirectory || "collections",
|
|
449
455
|
},
|
|
450
456
|
migrations: {
|
|
451
457
|
enabled: config.useMigrations !== false,
|
package/dist/databases/setup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Databases, Query } from "node-appwrite";
|
|
2
|
-
import {
|
|
2
|
+
import { createOrUpdateAttributeWithStatusCheck } from "../collections/attributes.js";
|
|
3
3
|
import { getMigrationCollectionSchemas } from "../storage/schemas.js";
|
|
4
4
|
import { areCollectionNamesSame, delay, toCamelCase, tryAwaitWithRetry, } from "../utils/index.js";
|
|
5
5
|
import {} from "appwrite-utils";
|
|
@@ -54,7 +54,7 @@ export const setupMigrationDatabase = async (config) => {
|
|
|
54
54
|
}
|
|
55
55
|
for (const attribute of attributes) {
|
|
56
56
|
try {
|
|
57
|
-
await
|
|
57
|
+
await createOrUpdateAttributeWithStatusCheck(database, db.$id, collectionFound, attribute);
|
|
58
58
|
await delay(100);
|
|
59
59
|
console.log(`Attribute created/updated: ${attribute.key}`);
|
|
60
60
|
}
|
package/dist/main.js
CHANGED
|
File without changes
|