appwrite-utils-cli 1.5.2 → 1.6.1

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 (233) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/README.md +251 -29
  3. package/dist/adapters/AdapterFactory.d.ts +10 -3
  4. package/dist/adapters/AdapterFactory.js +213 -17
  5. package/dist/adapters/TablesDBAdapter.js +60 -17
  6. package/dist/backups/operations/bucketBackup.d.ts +19 -0
  7. package/dist/backups/operations/bucketBackup.js +197 -0
  8. package/dist/backups/operations/collectionBackup.d.ts +30 -0
  9. package/dist/backups/operations/collectionBackup.js +201 -0
  10. package/dist/backups/operations/comprehensiveBackup.d.ts +25 -0
  11. package/dist/backups/operations/comprehensiveBackup.js +238 -0
  12. package/dist/backups/schemas/bucketManifest.d.ts +93 -0
  13. package/dist/backups/schemas/bucketManifest.js +33 -0
  14. package/dist/backups/schemas/comprehensiveManifest.d.ts +108 -0
  15. package/dist/backups/schemas/comprehensiveManifest.js +32 -0
  16. package/dist/backups/tracking/centralizedTracking.d.ts +34 -0
  17. package/dist/backups/tracking/centralizedTracking.js +274 -0
  18. package/dist/cli/commands/configCommands.d.ts +8 -0
  19. package/dist/cli/commands/configCommands.js +160 -0
  20. package/dist/cli/commands/databaseCommands.d.ts +13 -0
  21. package/dist/cli/commands/databaseCommands.js +479 -0
  22. package/dist/cli/commands/functionCommands.d.ts +7 -0
  23. package/dist/cli/commands/functionCommands.js +289 -0
  24. package/dist/cli/commands/schemaCommands.d.ts +7 -0
  25. package/dist/cli/commands/schemaCommands.js +134 -0
  26. package/dist/cli/commands/transferCommands.d.ts +5 -0
  27. package/dist/cli/commands/transferCommands.js +384 -0
  28. package/dist/collections/attributes.d.ts +5 -4
  29. package/dist/collections/attributes.js +539 -246
  30. package/dist/collections/indexes.js +39 -37
  31. package/dist/collections/methods.d.ts +2 -16
  32. package/dist/collections/methods.js +90 -538
  33. package/dist/collections/transferOperations.d.ts +7 -0
  34. package/dist/collections/transferOperations.js +331 -0
  35. package/dist/collections/wipeOperations.d.ts +16 -0
  36. package/dist/collections/wipeOperations.js +328 -0
  37. package/dist/config/configMigration.d.ts +87 -0
  38. package/dist/config/configMigration.js +390 -0
  39. package/dist/config/configValidation.d.ts +66 -0
  40. package/dist/config/configValidation.js +358 -0
  41. package/dist/config/yamlConfig.d.ts +455 -1
  42. package/dist/config/yamlConfig.js +145 -52
  43. package/dist/databases/methods.js +3 -2
  44. package/dist/databases/setup.d.ts +1 -2
  45. package/dist/databases/setup.js +9 -87
  46. package/dist/examples/yamlTerminologyExample.d.ts +42 -0
  47. package/dist/examples/yamlTerminologyExample.js +269 -0
  48. package/dist/functions/deployments.js +11 -10
  49. package/dist/functions/methods.d.ts +1 -1
  50. package/dist/functions/methods.js +5 -4
  51. package/dist/init.js +9 -9
  52. package/dist/interactiveCLI.d.ts +8 -17
  53. package/dist/interactiveCLI.js +209 -1172
  54. package/dist/main.js +364 -21
  55. package/dist/migrations/afterImportActions.js +22 -30
  56. package/dist/migrations/appwriteToX.js +71 -25
  57. package/dist/migrations/dataLoader.js +35 -26
  58. package/dist/migrations/importController.js +29 -30
  59. package/dist/migrations/relationships.js +13 -12
  60. package/dist/migrations/services/ImportOrchestrator.js +16 -19
  61. package/dist/migrations/transfer.js +46 -46
  62. package/dist/migrations/yaml/YamlImportConfigLoader.d.ts +3 -1
  63. package/dist/migrations/yaml/YamlImportConfigLoader.js +6 -3
  64. package/dist/migrations/yaml/YamlImportIntegration.d.ts +9 -3
  65. package/dist/migrations/yaml/YamlImportIntegration.js +22 -11
  66. package/dist/migrations/yaml/generateImportSchemas.d.ts +14 -1
  67. package/dist/migrations/yaml/generateImportSchemas.js +736 -7
  68. package/dist/schemas/authUser.d.ts +1 -1
  69. package/dist/setupController.js +3 -2
  70. package/dist/shared/backupMetadataSchema.d.ts +94 -0
  71. package/dist/shared/backupMetadataSchema.js +38 -0
  72. package/dist/shared/backupTracking.d.ts +18 -0
  73. package/dist/shared/backupTracking.js +176 -0
  74. package/dist/shared/confirmationDialogs.js +15 -15
  75. package/dist/shared/errorUtils.d.ts +54 -0
  76. package/dist/shared/errorUtils.js +95 -0
  77. package/dist/shared/functionManager.js +20 -19
  78. package/dist/shared/indexManager.js +12 -11
  79. package/dist/shared/jsonSchemaGenerator.js +10 -26
  80. package/dist/shared/logging.d.ts +51 -0
  81. package/dist/shared/logging.js +70 -0
  82. package/dist/shared/messageFormatter.d.ts +2 -0
  83. package/dist/shared/messageFormatter.js +10 -0
  84. package/dist/shared/migrationHelpers.d.ts +6 -16
  85. package/dist/shared/migrationHelpers.js +24 -21
  86. package/dist/shared/operationLogger.d.ts +8 -1
  87. package/dist/shared/operationLogger.js +11 -24
  88. package/dist/shared/operationQueue.d.ts +28 -1
  89. package/dist/shared/operationQueue.js +268 -66
  90. package/dist/shared/operationsTable.d.ts +26 -0
  91. package/dist/shared/operationsTable.js +286 -0
  92. package/dist/shared/operationsTableSchema.d.ts +48 -0
  93. package/dist/shared/operationsTableSchema.js +35 -0
  94. package/dist/shared/relationshipExtractor.d.ts +56 -0
  95. package/dist/shared/relationshipExtractor.js +138 -0
  96. package/dist/shared/schemaGenerator.d.ts +19 -1
  97. package/dist/shared/schemaGenerator.js +56 -75
  98. package/dist/storage/backupCompression.d.ts +20 -0
  99. package/dist/storage/backupCompression.js +67 -0
  100. package/dist/storage/methods.d.ts +16 -2
  101. package/dist/storage/methods.js +98 -14
  102. package/dist/users/methods.js +9 -8
  103. package/dist/utils/configDiscovery.d.ts +78 -0
  104. package/dist/utils/configDiscovery.js +430 -0
  105. package/dist/utils/directoryUtils.d.ts +22 -0
  106. package/dist/utils/directoryUtils.js +59 -0
  107. package/dist/utils/getClientFromConfig.d.ts +17 -8
  108. package/dist/utils/getClientFromConfig.js +162 -17
  109. package/dist/utils/helperFunctions.d.ts +16 -2
  110. package/dist/utils/helperFunctions.js +19 -5
  111. package/dist/utils/loadConfigs.d.ts +34 -9
  112. package/dist/utils/loadConfigs.js +236 -316
  113. package/dist/utils/pathResolvers.d.ts +53 -0
  114. package/dist/utils/pathResolvers.js +72 -0
  115. package/dist/utils/projectConfig.d.ts +119 -0
  116. package/dist/utils/projectConfig.js +171 -0
  117. package/dist/utils/retryFailedPromises.js +4 -2
  118. package/dist/utils/sessionAuth.d.ts +48 -0
  119. package/dist/utils/sessionAuth.js +164 -0
  120. package/dist/utils/sessionPreservationExample.d.ts +1666 -0
  121. package/dist/utils/sessionPreservationExample.js +101 -0
  122. package/dist/utils/setupFiles.js +301 -41
  123. package/dist/utils/typeGuards.d.ts +35 -0
  124. package/dist/utils/typeGuards.js +57 -0
  125. package/dist/utils/versionDetection.js +145 -9
  126. package/dist/utils/yamlConverter.d.ts +53 -3
  127. package/dist/utils/yamlConverter.js +232 -13
  128. package/dist/utils/yamlLoader.d.ts +70 -0
  129. package/dist/utils/yamlLoader.js +263 -0
  130. package/dist/utilsController.d.ts +36 -3
  131. package/dist/utilsController.js +186 -56
  132. package/package.json +12 -2
  133. package/src/adapters/AdapterFactory.ts +263 -35
  134. package/src/adapters/TablesDBAdapter.ts +225 -36
  135. package/src/backups/operations/bucketBackup.ts +277 -0
  136. package/src/backups/operations/collectionBackup.ts +310 -0
  137. package/src/backups/operations/comprehensiveBackup.ts +342 -0
  138. package/src/backups/schemas/bucketManifest.ts +78 -0
  139. package/src/backups/schemas/comprehensiveManifest.ts +76 -0
  140. package/src/backups/tracking/centralizedTracking.ts +352 -0
  141. package/src/cli/commands/configCommands.ts +194 -0
  142. package/src/cli/commands/databaseCommands.ts +635 -0
  143. package/src/cli/commands/functionCommands.ts +379 -0
  144. package/src/cli/commands/schemaCommands.ts +163 -0
  145. package/src/cli/commands/transferCommands.ts +457 -0
  146. package/src/collections/attributes.ts +900 -621
  147. package/src/collections/attributes.ts.backup +1555 -0
  148. package/src/collections/indexes.ts +116 -114
  149. package/src/collections/methods.ts +295 -968
  150. package/src/collections/transferOperations.ts +516 -0
  151. package/src/collections/wipeOperations.ts +501 -0
  152. package/src/config/README.md +274 -0
  153. package/src/config/configMigration.ts +575 -0
  154. package/src/config/configValidation.ts +445 -0
  155. package/src/config/yamlConfig.ts +168 -55
  156. package/src/databases/methods.ts +3 -2
  157. package/src/databases/setup.ts +11 -138
  158. package/src/examples/yamlTerminologyExample.ts +341 -0
  159. package/src/functions/deployments.ts +14 -12
  160. package/src/functions/methods.ts +11 -11
  161. package/src/functions/templates/hono-typescript/README.md +286 -0
  162. package/src/functions/templates/hono-typescript/package.json +26 -0
  163. package/src/functions/templates/hono-typescript/src/adapters/request.ts +74 -0
  164. package/src/functions/templates/hono-typescript/src/adapters/response.ts +106 -0
  165. package/src/functions/templates/hono-typescript/src/app.ts +180 -0
  166. package/src/functions/templates/hono-typescript/src/context.ts +103 -0
  167. package/src/functions/templates/hono-typescript/src/index.ts +54 -0
  168. package/src/functions/templates/hono-typescript/src/middleware/appwrite.ts +119 -0
  169. package/src/functions/templates/hono-typescript/tsconfig.json +20 -0
  170. package/src/functions/templates/typescript-node/package.json +2 -1
  171. package/src/functions/templates/typescript-node/src/context.ts +103 -0
  172. package/src/functions/templates/typescript-node/src/index.ts +18 -12
  173. package/src/functions/templates/uv/pyproject.toml +1 -0
  174. package/src/functions/templates/uv/src/context.py +125 -0
  175. package/src/functions/templates/uv/src/index.py +35 -5
  176. package/src/init.ts +9 -11
  177. package/src/interactiveCLI.ts +274 -1563
  178. package/src/main.ts +418 -24
  179. package/src/migrations/afterImportActions.ts +71 -44
  180. package/src/migrations/appwriteToX.ts +100 -34
  181. package/src/migrations/dataLoader.ts +48 -34
  182. package/src/migrations/importController.ts +44 -39
  183. package/src/migrations/relationships.ts +28 -18
  184. package/src/migrations/services/ImportOrchestrator.ts +24 -27
  185. package/src/migrations/transfer.ts +159 -121
  186. package/src/migrations/yaml/YamlImportConfigLoader.ts +11 -4
  187. package/src/migrations/yaml/YamlImportIntegration.ts +47 -20
  188. package/src/migrations/yaml/generateImportSchemas.ts +751 -12
  189. package/src/setupController.ts +3 -2
  190. package/src/shared/backupMetadataSchema.ts +93 -0
  191. package/src/shared/backupTracking.ts +211 -0
  192. package/src/shared/confirmationDialogs.ts +19 -19
  193. package/src/shared/errorUtils.ts +110 -0
  194. package/src/shared/functionManager.ts +21 -20
  195. package/src/shared/indexManager.ts +12 -11
  196. package/src/shared/jsonSchemaGenerator.ts +38 -52
  197. package/src/shared/logging.ts +75 -0
  198. package/src/shared/messageFormatter.ts +14 -1
  199. package/src/shared/migrationHelpers.ts +45 -38
  200. package/src/shared/operationLogger.ts +11 -36
  201. package/src/shared/operationQueue.ts +322 -93
  202. package/src/shared/operationsTable.ts +338 -0
  203. package/src/shared/operationsTableSchema.ts +60 -0
  204. package/src/shared/relationshipExtractor.ts +214 -0
  205. package/src/shared/schemaGenerator.ts +179 -219
  206. package/src/storage/backupCompression.ts +88 -0
  207. package/src/storage/methods.ts +131 -34
  208. package/src/users/methods.ts +11 -9
  209. package/src/utils/configDiscovery.ts +502 -0
  210. package/src/utils/directoryUtils.ts +61 -0
  211. package/src/utils/getClientFromConfig.ts +205 -22
  212. package/src/utils/helperFunctions.ts +23 -5
  213. package/src/utils/loadConfigs.ts +313 -345
  214. package/src/utils/pathResolvers.ts +81 -0
  215. package/src/utils/projectConfig.ts +299 -0
  216. package/src/utils/retryFailedPromises.ts +4 -2
  217. package/src/utils/sessionAuth.ts +230 -0
  218. package/src/utils/setupFiles.ts +322 -54
  219. package/src/utils/typeGuards.ts +65 -0
  220. package/src/utils/versionDetection.ts +218 -64
  221. package/src/utils/yamlConverter.ts +296 -13
  222. package/src/utils/yamlLoader.ts +364 -0
  223. package/src/utilsController.ts +314 -110
  224. package/tests/README.md +497 -0
  225. package/tests/adapters/AdapterFactory.test.ts +277 -0
  226. package/tests/integration/syncOperations.test.ts +463 -0
  227. package/tests/jest.config.js +25 -0
  228. package/tests/migration/configMigration.test.ts +546 -0
  229. package/tests/setup.ts +62 -0
  230. package/tests/testUtils.ts +340 -0
  231. package/tests/utils/loadConfigs.test.ts +350 -0
  232. package/tests/validation/configValidation.test.ts +412 -0
  233. package/src/utils/schemaStrings.ts +0 -517
@@ -5,14 +5,24 @@ declare const YamlConfigSchema: z.ZodObject<{
5
5
  endpoint: z.ZodDefault<z.ZodString>;
6
6
  project: z.ZodString;
7
7
  key: z.ZodString;
8
+ sessionCookie: z.ZodOptional<z.ZodString>;
9
+ authMethod: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
10
+ session: "session";
11
+ apikey: "apikey";
12
+ auto: "auto";
13
+ }>>>;
14
+ sessionMetadata: z.ZodOptional<z.ZodObject<{
15
+ email: z.ZodOptional<z.ZodString>;
16
+ expiresAt: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
8
18
  }, z.core.$strip>;
9
19
  logging: z.ZodDefault<z.ZodOptional<z.ZodObject<{
10
20
  enabled: z.ZodDefault<z.ZodBoolean>;
11
21
  level: z.ZodDefault<z.ZodEnum<{
12
22
  error: "error";
13
- warn: "warn";
14
23
  info: "info";
15
24
  debug: "debug";
25
+ warn: "warn";
16
26
  }>>;
17
27
  directory: z.ZodOptional<z.ZodString>;
18
28
  console: z.ZodDefault<z.ZodBoolean>;
@@ -33,6 +43,7 @@ declare const YamlConfigSchema: z.ZodObject<{
33
43
  outputDirectory: z.ZodDefault<z.ZodString>;
34
44
  yamlSchemaDirectory: z.ZodDefault<z.ZodString>;
35
45
  collectionsDirectory: z.ZodDefault<z.ZodString>;
46
+ tablesDirectory: z.ZodDefault<z.ZodString>;
36
47
  }, z.core.$strip>>>;
37
48
  migrations: z.ZodDefault<z.ZodOptional<z.ZodObject<{
38
49
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -117,6 +128,23 @@ declare const YamlConfigSchema: z.ZodObject<{
117
128
  }, z.core.$strip>;
118
129
  export type YamlConfig = z.infer<typeof YamlConfigSchema>;
119
130
  export declare const convertYamlToAppwriteConfig: (yamlConfig: YamlConfig) => AppwriteConfig;
131
+ /**
132
+ * Enhanced config loading with session authentication support
133
+ * Supports session override options for preserving session state
134
+ */
135
+ export interface YamlSessionOptions {
136
+ sessionCookie?: string;
137
+ authMethod?: "session" | "apikey" | "auto";
138
+ sessionMetadata?: {
139
+ email?: string;
140
+ expiresAt?: string;
141
+ };
142
+ }
143
+ /**
144
+ * Load YAML config with optional session preservation
145
+ * Maintains authentication priority: explicit session > YAML file > system prefs
146
+ */
147
+ export declare const loadYamlConfigWithSession: (configPath: string, sessionOptions?: YamlSessionOptions) => Promise<AppwriteConfig | null>;
120
148
  export declare const loadYamlConfig: (configPath: string) => Promise<AppwriteConfig | null>;
121
149
  export declare const findYamlConfig: (startDir: string) => string | null;
122
150
  export declare const generateYamlConfigTemplate: (outputPath: string) => void;
@@ -132,4 +160,430 @@ export declare const writeYamlConfig: (configPath: string, config: AppwriteConfi
132
160
  * @param newFunction The function configuration to add
133
161
  */
134
162
  export declare const addFunctionToYamlConfig: (configPath: string, newFunction: AppwriteFunction) => Promise<void>;
163
+ /**
164
+ * Extract session options from AppwriteConfig for YAML operations
165
+ * Useful for preserving session state during config reloads
166
+ */
167
+ export declare const extractSessionOptionsFromConfig: (config: AppwriteConfig) => YamlSessionOptions;
168
+ /**
169
+ * Create session-preserved YAML config operations
170
+ * Maintains authentication state during config file updates
171
+ */
172
+ export declare const createSessionPreservingYamlConfig: (configPath: string, sessionOptions: YamlSessionOptions) => {
173
+ load: () => Promise<{
174
+ appwriteEndpoint: string;
175
+ appwriteProject: string;
176
+ appwriteKey: string;
177
+ appwriteClient: any;
178
+ authMethod: "session" | "apikey" | "auto";
179
+ logging: {
180
+ enabled: boolean;
181
+ level: "error" | "warn" | "info" | "debug";
182
+ console: boolean;
183
+ logDirectory?: string | undefined;
184
+ };
185
+ enableBackups: boolean;
186
+ backupInterval: number;
187
+ backupRetention: number;
188
+ enableBackupCleanup: boolean;
189
+ enableMockData: boolean;
190
+ documentBucketId: string;
191
+ usersCollectionName: string;
192
+ databases: {
193
+ $id: string;
194
+ name: string;
195
+ bucket?: {
196
+ $id: string;
197
+ name: string;
198
+ permissions?: ({
199
+ permission: string;
200
+ target: string;
201
+ } | {
202
+ permission: string;
203
+ target: string;
204
+ })[] | undefined;
205
+ fileSecurity?: boolean | undefined;
206
+ enabled?: boolean | undefined;
207
+ maximumFileSize?: number | undefined;
208
+ allowedFileExtensions?: string[] | undefined;
209
+ compression?: "none" | "gzip" | "zstd" | undefined;
210
+ encryption?: boolean | undefined;
211
+ antivirus?: boolean | undefined;
212
+ } | undefined;
213
+ }[];
214
+ buckets: {
215
+ $id: string;
216
+ name: string;
217
+ permissions?: ({
218
+ permission: string;
219
+ target: string;
220
+ } | {
221
+ permission: string;
222
+ target: string;
223
+ })[] | undefined;
224
+ fileSecurity?: boolean | undefined;
225
+ enabled?: boolean | undefined;
226
+ maximumFileSize?: number | undefined;
227
+ allowedFileExtensions?: string[] | undefined;
228
+ compression?: "none" | "gzip" | "zstd" | undefined;
229
+ encryption?: boolean | undefined;
230
+ antivirus?: boolean | undefined;
231
+ }[];
232
+ apiMode: "auto" | "legacy" | "tablesdb";
233
+ sessionCookie?: string | undefined;
234
+ sessionMetadata?: {
235
+ email?: string | undefined;
236
+ expiresAt?: string | undefined;
237
+ } | undefined;
238
+ collections?: {
239
+ name: string;
240
+ attributes: ({
241
+ key: string;
242
+ type: "string";
243
+ size: number;
244
+ error?: string | undefined;
245
+ required?: boolean | undefined;
246
+ array?: boolean | undefined;
247
+ xdefault?: string | null | undefined;
248
+ encrypted?: boolean | undefined;
249
+ format?: string | null | undefined;
250
+ } | {
251
+ key: string;
252
+ type: "integer";
253
+ error?: string | undefined;
254
+ required?: boolean | undefined;
255
+ array?: boolean | undefined;
256
+ min?: number | undefined;
257
+ max?: number | undefined;
258
+ xdefault?: number | null | undefined;
259
+ } | {
260
+ key: string;
261
+ type: "double";
262
+ error?: string | undefined;
263
+ required?: boolean | undefined;
264
+ array?: boolean | undefined;
265
+ min?: number | undefined;
266
+ max?: number | undefined;
267
+ xdefault?: number | null | undefined;
268
+ } | {
269
+ key: string;
270
+ type: "float";
271
+ error?: string | undefined;
272
+ required?: boolean | undefined;
273
+ array?: boolean | undefined;
274
+ min?: number | undefined;
275
+ max?: number | undefined;
276
+ xdefault?: number | null | undefined;
277
+ } | {
278
+ key: string;
279
+ type: "boolean";
280
+ error?: string | undefined;
281
+ required?: boolean | undefined;
282
+ array?: boolean | undefined;
283
+ xdefault?: boolean | null | undefined;
284
+ } | {
285
+ key: string;
286
+ type: "datetime";
287
+ error?: string | undefined;
288
+ required?: boolean | undefined;
289
+ array?: boolean | undefined;
290
+ xdefault?: string | null | undefined;
291
+ } | {
292
+ key: string;
293
+ type: "email";
294
+ error?: string | undefined;
295
+ required?: boolean | undefined;
296
+ array?: boolean | undefined;
297
+ xdefault?: string | null | undefined;
298
+ } | {
299
+ key: string;
300
+ type: "ip";
301
+ error?: string | undefined;
302
+ required?: boolean | undefined;
303
+ array?: boolean | undefined;
304
+ xdefault?: string | null | undefined;
305
+ } | {
306
+ key: string;
307
+ type: "url";
308
+ error?: string | undefined;
309
+ required?: boolean | undefined;
310
+ array?: boolean | undefined;
311
+ xdefault?: string | null | undefined;
312
+ } | {
313
+ key: string;
314
+ type: "enum";
315
+ elements: string[];
316
+ error?: string | undefined;
317
+ required?: boolean | undefined;
318
+ array?: boolean | undefined;
319
+ xdefault?: string | null | undefined;
320
+ } | {
321
+ key: string;
322
+ type: "relationship";
323
+ relatedCollection: string;
324
+ relationType: "oneToMany" | "manyToOne" | "oneToOne" | "manyToMany";
325
+ twoWay: boolean;
326
+ onDelete: "setNull" | "cascade" | "restrict";
327
+ error?: string | undefined;
328
+ required?: boolean | undefined;
329
+ array?: boolean | undefined;
330
+ twoWayKey?: string | undefined;
331
+ side?: "parent" | "child" | undefined;
332
+ importMapping?: {
333
+ originalIdField: string;
334
+ targetField?: string | undefined;
335
+ } | undefined;
336
+ })[];
337
+ $permissions: {
338
+ permission: string;
339
+ target: string;
340
+ }[];
341
+ indexes: {
342
+ key: string;
343
+ type: "key" | "unique" | "fulltext";
344
+ attributes: string[];
345
+ status?: string | undefined;
346
+ error?: string | undefined;
347
+ orders?: string[] | undefined;
348
+ }[];
349
+ importDefs: {
350
+ filePath: string;
351
+ primaryKeyField: string;
352
+ attributeMappings: {
353
+ targetKey: string;
354
+ oldKey?: string | undefined;
355
+ oldKeys?: string[] | undefined;
356
+ valueToSet?: any;
357
+ fileData?: {
358
+ name: string;
359
+ path: string;
360
+ } | undefined;
361
+ converters?: string[] | undefined;
362
+ validationActions?: {
363
+ action: string;
364
+ params: string[];
365
+ }[] | undefined;
366
+ postImportActions?: {
367
+ action: string;
368
+ params: (string | Record<string, any>)[];
369
+ }[] | undefined;
370
+ }[];
371
+ type?: "create" | "update" | undefined;
372
+ basePath?: string | undefined;
373
+ idMappings?: {
374
+ sourceField: string;
375
+ targetField: string;
376
+ targetCollection: string;
377
+ fieldToSet?: string | undefined;
378
+ targetFieldToMatch?: string | undefined;
379
+ }[] | undefined;
380
+ createUsers?: boolean | null | undefined;
381
+ updateMapping?: {
382
+ originalIdField: string;
383
+ targetField: string;
384
+ } | undefined;
385
+ }[];
386
+ $id?: string | undefined;
387
+ enabled?: boolean | undefined;
388
+ documentSecurity?: boolean | undefined;
389
+ databaseId?: string | undefined;
390
+ }[] | undefined;
391
+ tables?: {
392
+ attributes: ({
393
+ key: string;
394
+ type: "string";
395
+ size: number;
396
+ error?: string | undefined;
397
+ required?: boolean | undefined;
398
+ array?: boolean | undefined;
399
+ xdefault?: string | null | undefined;
400
+ encrypted?: boolean | undefined;
401
+ format?: string | null | undefined;
402
+ } | {
403
+ key: string;
404
+ type: "integer";
405
+ error?: string | undefined;
406
+ required?: boolean | undefined;
407
+ array?: boolean | undefined;
408
+ min?: number | undefined;
409
+ max?: number | undefined;
410
+ xdefault?: number | null | undefined;
411
+ } | {
412
+ key: string;
413
+ type: "double";
414
+ error?: string | undefined;
415
+ required?: boolean | undefined;
416
+ array?: boolean | undefined;
417
+ min?: number | undefined;
418
+ max?: number | undefined;
419
+ xdefault?: number | null | undefined;
420
+ } | {
421
+ key: string;
422
+ type: "float";
423
+ error?: string | undefined;
424
+ required?: boolean | undefined;
425
+ array?: boolean | undefined;
426
+ min?: number | undefined;
427
+ max?: number | undefined;
428
+ xdefault?: number | null | undefined;
429
+ } | {
430
+ key: string;
431
+ type: "boolean";
432
+ error?: string | undefined;
433
+ required?: boolean | undefined;
434
+ array?: boolean | undefined;
435
+ xdefault?: boolean | null | undefined;
436
+ } | {
437
+ key: string;
438
+ type: "datetime";
439
+ error?: string | undefined;
440
+ required?: boolean | undefined;
441
+ array?: boolean | undefined;
442
+ xdefault?: string | null | undefined;
443
+ } | {
444
+ key: string;
445
+ type: "email";
446
+ error?: string | undefined;
447
+ required?: boolean | undefined;
448
+ array?: boolean | undefined;
449
+ xdefault?: string | null | undefined;
450
+ } | {
451
+ key: string;
452
+ type: "ip";
453
+ error?: string | undefined;
454
+ required?: boolean | undefined;
455
+ array?: boolean | undefined;
456
+ xdefault?: string | null | undefined;
457
+ } | {
458
+ key: string;
459
+ type: "url";
460
+ error?: string | undefined;
461
+ required?: boolean | undefined;
462
+ array?: boolean | undefined;
463
+ xdefault?: string | null | undefined;
464
+ } | {
465
+ key: string;
466
+ type: "enum";
467
+ elements: string[];
468
+ error?: string | undefined;
469
+ required?: boolean | undefined;
470
+ array?: boolean | undefined;
471
+ xdefault?: string | null | undefined;
472
+ } | {
473
+ key: string;
474
+ type: "relationship";
475
+ relatedCollection: string;
476
+ relationType: "oneToMany" | "manyToOne" | "oneToOne" | "manyToMany";
477
+ twoWay: boolean;
478
+ onDelete: "setNull" | "cascade" | "restrict";
479
+ error?: string | undefined;
480
+ required?: boolean | undefined;
481
+ array?: boolean | undefined;
482
+ twoWayKey?: string | undefined;
483
+ side?: "parent" | "child" | undefined;
484
+ importMapping?: {
485
+ originalIdField: string;
486
+ targetField?: string | undefined;
487
+ } | undefined;
488
+ })[];
489
+ columns: undefined;
490
+ indexes: {
491
+ key: string;
492
+ type: "key" | "unique" | "fulltext";
493
+ attributes: string[];
494
+ status?: string | undefined;
495
+ error?: string | undefined;
496
+ orders?: string[] | undefined;
497
+ }[];
498
+ name: string;
499
+ $permissions: {
500
+ permission: string;
501
+ target: string;
502
+ }[];
503
+ importDefs: {
504
+ filePath: string;
505
+ primaryKeyField: string;
506
+ attributeMappings: {
507
+ targetKey: string;
508
+ oldKey?: string | undefined;
509
+ oldKeys?: string[] | undefined;
510
+ valueToSet?: any;
511
+ fileData?: {
512
+ name: string;
513
+ path: string;
514
+ } | undefined;
515
+ converters?: string[] | undefined;
516
+ validationActions?: {
517
+ action: string;
518
+ params: string[];
519
+ }[] | undefined;
520
+ postImportActions?: {
521
+ action: string;
522
+ params: (string | Record<string, any>)[];
523
+ }[] | undefined;
524
+ }[];
525
+ type?: "create" | "update" | undefined;
526
+ basePath?: string | undefined;
527
+ idMappings?: {
528
+ sourceField: string;
529
+ targetField: string;
530
+ targetCollection: string;
531
+ fieldToSet?: string | undefined;
532
+ targetFieldToMatch?: string | undefined;
533
+ }[] | undefined;
534
+ createUsers?: boolean | null | undefined;
535
+ updateMapping?: {
536
+ originalIdField: string;
537
+ targetField: string;
538
+ } | undefined;
539
+ }[];
540
+ $id?: string | undefined;
541
+ enabled?: boolean | undefined;
542
+ documentSecurity?: boolean | undefined;
543
+ databaseId?: string | undefined;
544
+ tableId?: string | undefined;
545
+ }[] | undefined;
546
+ functions?: {
547
+ $id: string;
548
+ name: string;
549
+ runtime: any;
550
+ execute: string[];
551
+ events: string[];
552
+ dirPath?: string | undefined;
553
+ schedule?: string | undefined;
554
+ timeout?: number | undefined;
555
+ enabled?: boolean | undefined;
556
+ logging?: boolean | undefined;
557
+ ignore?: string[] | undefined;
558
+ entrypoint?: string | undefined;
559
+ predeployCommands?: string[] | undefined;
560
+ deployDir?: string | undefined;
561
+ commands?: string | undefined;
562
+ scopes?: string[] | undefined;
563
+ installationId?: string | undefined;
564
+ providerRepositoryId?: string | undefined;
565
+ providerBranch?: string | undefined;
566
+ providerSilentMode?: boolean | undefined;
567
+ providerRootDirectory?: string | undefined;
568
+ templateRepository?: string | undefined;
569
+ templateOwner?: string | undefined;
570
+ templateRootDirectory?: string | undefined;
571
+ templateVersion?: string | undefined;
572
+ specification?: string | undefined;
573
+ }[] | undefined;
574
+ schemaConfig?: {
575
+ outputDirectory: string;
576
+ yamlSchemaDirectory: string;
577
+ importDirectory: string;
578
+ collectionsDirectory: string;
579
+ tablesDirectory: string;
580
+ } | undefined;
581
+ } | null>;
582
+ write: (config: AppwriteConfig) => Promise<void>;
583
+ addFunction: (func: AppwriteFunction) => Promise<void>;
584
+ };
585
+ /**
586
+ * Determine if YAML config has session authentication configured
587
+ */
588
+ export declare const hasYamlSessionAuth: (configPath: string) => boolean;
135
589
  export {};