appwrite-utils-cli 1.9.7 → 1.12.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 (376) hide show
  1. package/README.md +1004 -1004
  2. package/dist/adapters/index.d.ts +7 -8
  3. package/dist/adapters/index.js +7 -9
  4. package/dist/backups/operations/bucketBackup.js +2 -2
  5. package/dist/backups/operations/collectionBackup.d.ts +1 -1
  6. package/dist/backups/operations/collectionBackup.js +3 -3
  7. package/dist/backups/operations/comprehensiveBackup.d.ts +1 -1
  8. package/dist/backups/operations/comprehensiveBackup.js +2 -2
  9. package/dist/backups/tracking/centralizedTracking.d.ts +1 -1
  10. package/dist/backups/tracking/centralizedTracking.js +2 -2
  11. package/dist/cli/commands/configCommands.js +51 -7
  12. package/dist/cli/commands/databaseCommands.js +156 -104
  13. package/dist/cli/commands/functionCommands.js +3 -3
  14. package/dist/cli/commands/importFileCommands.d.ts +7 -0
  15. package/dist/cli/commands/importFileCommands.js +674 -0
  16. package/dist/cli/commands/schemaCommands.js +3 -3
  17. package/dist/cli/commands/storageCommands.js +2 -3
  18. package/dist/cli/commands/transferCommands.js +3 -5
  19. package/dist/collections/{attributes.d.ts → columns.d.ts} +1 -1
  20. package/dist/collections/{attributes.js → columns.js} +15 -9
  21. package/dist/collections/indexes.js +1 -3
  22. package/dist/collections/methods.d.ts +1 -1
  23. package/dist/collections/methods.js +38 -20
  24. package/dist/collections/tableOperations.d.ts +1 -0
  25. package/dist/collections/tableOperations.js +30 -11
  26. package/dist/collections/transferOperations.d.ts +1 -1
  27. package/dist/collections/transferOperations.js +3 -4
  28. package/dist/collections/wipeOperations.d.ts +4 -3
  29. package/dist/collections/wipeOperations.js +112 -39
  30. package/dist/databases/methods.js +2 -2
  31. package/dist/databases/setup.js +2 -2
  32. package/dist/examples/yamlTerminologyExample.js +2 -2
  33. package/dist/functions/deployments.d.ts +1 -1
  34. package/dist/functions/deployments.js +6 -6
  35. package/dist/functions/fnConfigDiscovery.js +2 -2
  36. package/dist/functions/methods.js +2 -2
  37. package/dist/functions/templates/count-docs-in-collection/README.md +53 -53
  38. package/dist/functions/templates/count-docs-in-collection/src/main.ts +159 -159
  39. package/dist/functions/templates/count-docs-in-collection/src/request.ts +8 -8
  40. package/dist/functions/templates/hono-typescript/README.md +285 -285
  41. package/dist/functions/templates/hono-typescript/src/adapters/request.ts +73 -73
  42. package/dist/functions/templates/hono-typescript/src/adapters/response.ts +105 -105
  43. package/dist/functions/templates/hono-typescript/src/app.ts +179 -179
  44. package/dist/functions/templates/hono-typescript/src/context.ts +102 -102
  45. package/{src/functions/templates/hono-typescript/src/index.ts → dist/functions/templates/hono-typescript/src/main.ts} +53 -53
  46. package/dist/functions/templates/hono-typescript/src/middleware/appwrite.ts +118 -118
  47. package/dist/functions/templates/typescript-node/README.md +31 -31
  48. package/dist/functions/templates/typescript-node/src/context.ts +102 -102
  49. package/dist/functions/templates/typescript-node/src/{index.ts → main.ts} +29 -29
  50. package/dist/functions/templates/uv/README.md +30 -30
  51. package/dist/functions/templates/uv/pyproject.toml +29 -29
  52. package/dist/functions/templates/uv/src/context.py +124 -124
  53. package/dist/functions/templates/uv/src/{index.py → main.py} +45 -45
  54. package/dist/init.js +1 -1
  55. package/dist/interactiveCLI.d.ts +6 -1
  56. package/dist/interactiveCLI.js +79 -25
  57. package/dist/main.js +125 -180
  58. package/dist/migrations/afterImportActions.js +2 -3
  59. package/dist/migrations/appwriteToX.d.ts +1 -1
  60. package/dist/migrations/appwriteToX.js +10 -8
  61. package/dist/migrations/comprehensiveTransfer.js +3 -5
  62. package/dist/migrations/dataLoader.d.ts +4 -2
  63. package/dist/migrations/dataLoader.js +42 -20
  64. package/dist/migrations/importController.d.ts +2 -0
  65. package/dist/migrations/importController.js +39 -24
  66. package/dist/migrations/importDataActions.js +3 -3
  67. package/dist/migrations/relationships.js +1 -2
  68. package/dist/migrations/services/DataTransformationService.js +2 -2
  69. package/dist/migrations/services/FileHandlerService.js +1 -1
  70. package/dist/migrations/services/ImportOrchestrator.d.ts +2 -0
  71. package/dist/migrations/services/ImportOrchestrator.js +15 -7
  72. package/dist/migrations/services/RateLimitManager.js +1 -1
  73. package/dist/migrations/services/RelationshipResolver.js +1 -1
  74. package/dist/migrations/services/UserMappingService.js +1 -1
  75. package/dist/migrations/services/ValidationService.js +1 -1
  76. package/dist/migrations/transfer.d.ts +8 -4
  77. package/dist/migrations/transfer.js +108 -55
  78. package/dist/migrations/yaml/YamlImportConfigLoader.js +52 -52
  79. package/dist/migrations/yaml/YamlImportIntegration.js +2 -2
  80. package/dist/migrations/yaml/generateImportSchemas.js +174 -174
  81. package/dist/setupCommands.d.ts +1 -1
  82. package/dist/setupCommands.js +5 -6
  83. package/dist/setupController.js +1 -1
  84. package/dist/shared/backupTracking.d.ts +1 -1
  85. package/dist/shared/backupTracking.js +2 -2
  86. package/dist/shared/confirmationDialogs.js +1 -1
  87. package/dist/shared/migrationHelpers.d.ts +1 -1
  88. package/dist/shared/migrationHelpers.js +4 -4
  89. package/dist/shared/operationQueue.d.ts +1 -1
  90. package/dist/shared/operationQueue.js +3 -4
  91. package/dist/shared/operationsTable.d.ts +1 -1
  92. package/dist/shared/operationsTable.js +35 -34
  93. package/dist/shared/operationsTableSchema.d.ts +3 -3
  94. package/dist/shared/operationsTableSchema.js +2 -2
  95. package/dist/shared/progressManager.js +1 -1
  96. package/dist/shared/selectionDialogs.d.ts +6 -0
  97. package/dist/shared/selectionDialogs.js +56 -12
  98. package/dist/storage/methods.d.ts +12 -0
  99. package/dist/storage/methods.js +92 -89
  100. package/dist/storage/schemas.d.ts +2 -2
  101. package/dist/tables/indexManager.d.ts +1 -1
  102. package/dist/tables/indexManager.js +2 -2
  103. package/dist/types.d.ts +2 -2
  104. package/dist/types.js +1 -1
  105. package/dist/users/methods.js +2 -3
  106. package/dist/utils/configMigration.js +1 -1
  107. package/dist/utils/index.d.ts +1 -1
  108. package/dist/utils/index.js +1 -1
  109. package/dist/utils/loadConfigs.d.ts +2 -2
  110. package/dist/utils/loadConfigs.js +6 -7
  111. package/dist/utils/setupFiles.js +139 -141
  112. package/dist/utilsController.d.ts +16 -9
  113. package/dist/utilsController.js +93 -68
  114. package/package.json +9 -3
  115. package/.appwrite/.yaml_schemas/appwrite-config.schema.json +0 -380
  116. package/.appwrite/.yaml_schemas/collection.schema.json +0 -255
  117. package/.appwrite/collections/Categories.yaml +0 -182
  118. package/.appwrite/collections/ExampleCollection.yaml +0 -36
  119. package/.appwrite/collections/Posts.yaml +0 -227
  120. package/.appwrite/collections/Users.yaml +0 -149
  121. package/.appwrite/config.yaml +0 -109
  122. package/.appwrite/import/README.md +0 -148
  123. package/.appwrite/import/categories-import.yaml +0 -129
  124. package/.appwrite/import/posts-import.yaml +0 -208
  125. package/.appwrite/import/users-import.yaml +0 -130
  126. package/.appwrite/importData/categories.json +0 -194
  127. package/.appwrite/importData/posts.json +0 -270
  128. package/.appwrite/importData/users.json +0 -220
  129. package/.appwrite/schemas/categories.json +0 -128
  130. package/.appwrite/schemas/exampleCollection.json +0 -52
  131. package/.appwrite/schemas/posts.json +0 -173
  132. package/.appwrite/schemas/users.json +0 -125
  133. package/CHANGELOG.md +0 -35
  134. package/CONFIG_TODO.md +0 -1189
  135. package/SELECTION_DIALOGS.md +0 -146
  136. package/SERVICE_IMPLEMENTATION_REPORT.md +0 -462
  137. package/dist/adapters/AdapterFactory.d.ts +0 -94
  138. package/dist/adapters/AdapterFactory.js +0 -420
  139. package/dist/adapters/DatabaseAdapter.d.ts +0 -243
  140. package/dist/adapters/DatabaseAdapter.js +0 -50
  141. package/dist/adapters/LegacyAdapter.d.ts +0 -50
  142. package/dist/adapters/LegacyAdapter.js +0 -615
  143. package/dist/adapters/TablesDBAdapter.d.ts +0 -45
  144. package/dist/adapters/TablesDBAdapter.js +0 -611
  145. package/dist/config/ConfigManager.d.ts +0 -450
  146. package/dist/config/ConfigManager.js +0 -650
  147. package/dist/config/configMigration.d.ts +0 -87
  148. package/dist/config/configMigration.js +0 -390
  149. package/dist/config/configValidation.d.ts +0 -66
  150. package/dist/config/configValidation.js +0 -358
  151. package/dist/config/index.d.ts +0 -8
  152. package/dist/config/index.js +0 -7
  153. package/dist/config/services/ConfigDiscoveryService.d.ts +0 -122
  154. package/dist/config/services/ConfigDiscoveryService.js +0 -322
  155. package/dist/config/services/ConfigLoaderService.d.ts +0 -129
  156. package/dist/config/services/ConfigLoaderService.js +0 -535
  157. package/dist/config/services/ConfigMergeService.d.ts +0 -208
  158. package/dist/config/services/ConfigMergeService.js +0 -308
  159. package/dist/config/services/ConfigValidationService.d.ts +0 -214
  160. package/dist/config/services/ConfigValidationService.js +0 -310
  161. package/dist/config/services/SessionAuthService.d.ts +0 -225
  162. package/dist/config/services/SessionAuthService.js +0 -456
  163. package/dist/config/services/__tests__/ConfigMergeService.test.d.ts +0 -1
  164. package/dist/config/services/__tests__/ConfigMergeService.test.js +0 -271
  165. package/dist/config/services/index.d.ts +0 -13
  166. package/dist/config/services/index.js +0 -10
  167. package/dist/config/yamlConfig.d.ts +0 -722
  168. package/dist/config/yamlConfig.js +0 -702
  169. package/dist/functions/pathResolution.d.ts +0 -37
  170. package/dist/functions/pathResolution.js +0 -185
  171. package/dist/functions/templates/count-docs-in-collection/package.json +0 -25
  172. package/dist/functions/templates/count-docs-in-collection/tsconfig.json +0 -28
  173. package/dist/functions/templates/hono-typescript/package.json +0 -26
  174. package/dist/functions/templates/hono-typescript/src/index.ts +0 -54
  175. package/dist/functions/templates/hono-typescript/tsconfig.json +0 -20
  176. package/dist/functions/templates/typescript-node/package.json +0 -25
  177. package/dist/functions/templates/typescript-node/tsconfig.json +0 -28
  178. package/dist/shared/attributeMapper.d.ts +0 -20
  179. package/dist/shared/attributeMapper.js +0 -203
  180. package/dist/shared/errorUtils.d.ts +0 -54
  181. package/dist/shared/errorUtils.js +0 -95
  182. package/dist/shared/functionManager.d.ts +0 -48
  183. package/dist/shared/functionManager.js +0 -348
  184. package/dist/shared/jsonSchemaGenerator.d.ts +0 -50
  185. package/dist/shared/jsonSchemaGenerator.js +0 -290
  186. package/dist/shared/logging.d.ts +0 -61
  187. package/dist/shared/logging.js +0 -116
  188. package/dist/shared/messageFormatter.d.ts +0 -39
  189. package/dist/shared/messageFormatter.js +0 -162
  190. package/dist/shared/pydanticModelGenerator.d.ts +0 -17
  191. package/dist/shared/pydanticModelGenerator.js +0 -615
  192. package/dist/shared/schemaGenerator.d.ts +0 -40
  193. package/dist/shared/schemaGenerator.js +0 -556
  194. package/dist/utils/ClientFactory.d.ts +0 -87
  195. package/dist/utils/ClientFactory.js +0 -212
  196. package/dist/utils/configDiscovery.d.ts +0 -78
  197. package/dist/utils/configDiscovery.js +0 -472
  198. package/dist/utils/constantsGenerator.d.ts +0 -31
  199. package/dist/utils/constantsGenerator.js +0 -321
  200. package/dist/utils/dataConverters.d.ts +0 -46
  201. package/dist/utils/dataConverters.js +0 -139
  202. package/dist/utils/directoryUtils.d.ts +0 -22
  203. package/dist/utils/directoryUtils.js +0 -59
  204. package/dist/utils/getClientFromConfig.d.ts +0 -39
  205. package/dist/utils/getClientFromConfig.js +0 -199
  206. package/dist/utils/helperFunctions.d.ts +0 -63
  207. package/dist/utils/helperFunctions.js +0 -156
  208. package/dist/utils/pathResolvers.d.ts +0 -53
  209. package/dist/utils/pathResolvers.js +0 -72
  210. package/dist/utils/projectConfig.d.ts +0 -122
  211. package/dist/utils/projectConfig.js +0 -206
  212. package/dist/utils/retryFailedPromises.d.ts +0 -2
  213. package/dist/utils/retryFailedPromises.js +0 -23
  214. package/dist/utils/sessionAuth.d.ts +0 -48
  215. package/dist/utils/sessionAuth.js +0 -164
  216. package/dist/utils/typeGuards.d.ts +0 -35
  217. package/dist/utils/typeGuards.js +0 -57
  218. package/dist/utils/validationRules.d.ts +0 -43
  219. package/dist/utils/validationRules.js +0 -42
  220. package/dist/utils/versionDetection.d.ts +0 -58
  221. package/dist/utils/versionDetection.js +0 -251
  222. package/dist/utils/yamlConverter.d.ts +0 -100
  223. package/dist/utils/yamlConverter.js +0 -428
  224. package/dist/utils/yamlLoader.d.ts +0 -70
  225. package/dist/utils/yamlLoader.js +0 -267
  226. package/scripts/copy-templates.ts +0 -23
  227. package/src/adapters/AdapterFactory.ts +0 -529
  228. package/src/adapters/DatabaseAdapter.ts +0 -319
  229. package/src/adapters/LegacyAdapter.ts +0 -844
  230. package/src/adapters/TablesDBAdapter.ts +0 -823
  231. package/src/adapters/index.ts +0 -37
  232. package/src/backups/operations/bucketBackup.ts +0 -277
  233. package/src/backups/operations/collectionBackup.ts +0 -310
  234. package/src/backups/operations/comprehensiveBackup.ts +0 -342
  235. package/src/backups/schemas/bucketManifest.ts +0 -78
  236. package/src/backups/schemas/comprehensiveManifest.ts +0 -76
  237. package/src/backups/tracking/centralizedTracking.ts +0 -352
  238. package/src/cli/commands/configCommands.ts +0 -201
  239. package/src/cli/commands/databaseCommands.ts +0 -879
  240. package/src/cli/commands/functionCommands.ts +0 -418
  241. package/src/cli/commands/schemaCommands.ts +0 -200
  242. package/src/cli/commands/storageCommands.ts +0 -152
  243. package/src/cli/commands/transferCommands.ts +0 -457
  244. package/src/collections/attributes.ts +0 -2020
  245. package/src/collections/attributes.ts.backup +0 -1555
  246. package/src/collections/indexes.ts +0 -352
  247. package/src/collections/methods.ts +0 -700
  248. package/src/collections/tableOperations.ts +0 -521
  249. package/src/collections/transferOperations.ts +0 -590
  250. package/src/collections/wipeOperations.ts +0 -346
  251. package/src/config/ConfigManager.ts +0 -849
  252. package/src/config/README.md +0 -274
  253. package/src/config/configMigration.ts +0 -575
  254. package/src/config/configValidation.ts +0 -445
  255. package/src/config/index.ts +0 -10
  256. package/src/config/services/ConfigDiscoveryService.ts +0 -410
  257. package/src/config/services/ConfigLoaderService.ts +0 -732
  258. package/src/config/services/ConfigMergeService.ts +0 -388
  259. package/src/config/services/ConfigValidationService.ts +0 -394
  260. package/src/config/services/SessionAuthService.ts +0 -565
  261. package/src/config/services/__tests__/ConfigMergeService.test.ts +0 -351
  262. package/src/config/services/index.ts +0 -29
  263. package/src/config/yamlConfig.ts +0 -761
  264. package/src/databases/methods.ts +0 -49
  265. package/src/databases/setup.ts +0 -77
  266. package/src/examples/yamlTerminologyExample.ts +0 -346
  267. package/src/functions/deployments.ts +0 -220
  268. package/src/functions/fnConfigDiscovery.ts +0 -103
  269. package/src/functions/methods.ts +0 -284
  270. package/src/functions/pathResolution.ts +0 -227
  271. package/src/functions/templates/count-docs-in-collection/README.md +0 -54
  272. package/src/functions/templates/count-docs-in-collection/package.json +0 -25
  273. package/src/functions/templates/count-docs-in-collection/src/main.ts +0 -159
  274. package/src/functions/templates/count-docs-in-collection/src/request.ts +0 -9
  275. package/src/functions/templates/count-docs-in-collection/tsconfig.json +0 -28
  276. package/src/functions/templates/hono-typescript/README.md +0 -286
  277. package/src/functions/templates/hono-typescript/package.json +0 -26
  278. package/src/functions/templates/hono-typescript/src/adapters/request.ts +0 -74
  279. package/src/functions/templates/hono-typescript/src/adapters/response.ts +0 -106
  280. package/src/functions/templates/hono-typescript/src/app.ts +0 -180
  281. package/src/functions/templates/hono-typescript/src/context.ts +0 -103
  282. package/src/functions/templates/hono-typescript/src/middleware/appwrite.ts +0 -119
  283. package/src/functions/templates/hono-typescript/tsconfig.json +0 -20
  284. package/src/functions/templates/typescript-node/README.md +0 -32
  285. package/src/functions/templates/typescript-node/package.json +0 -25
  286. package/src/functions/templates/typescript-node/src/context.ts +0 -103
  287. package/src/functions/templates/typescript-node/src/index.ts +0 -29
  288. package/src/functions/templates/typescript-node/tsconfig.json +0 -28
  289. package/src/functions/templates/uv/README.md +0 -31
  290. package/src/functions/templates/uv/pyproject.toml +0 -30
  291. package/src/functions/templates/uv/src/__init__.py +0 -0
  292. package/src/functions/templates/uv/src/context.py +0 -125
  293. package/src/functions/templates/uv/src/index.py +0 -46
  294. package/src/init.ts +0 -62
  295. package/src/interactiveCLI.ts +0 -1136
  296. package/src/main.ts +0 -1670
  297. package/src/migrations/afterImportActions.ts +0 -580
  298. package/src/migrations/appwriteToX.ts +0 -664
  299. package/src/migrations/comprehensiveTransfer.ts +0 -2285
  300. package/src/migrations/dataLoader.ts +0 -1702
  301. package/src/migrations/importController.ts +0 -428
  302. package/src/migrations/importDataActions.ts +0 -315
  303. package/src/migrations/relationships.ts +0 -334
  304. package/src/migrations/services/DataTransformationService.ts +0 -196
  305. package/src/migrations/services/FileHandlerService.ts +0 -311
  306. package/src/migrations/services/ImportOrchestrator.ts +0 -666
  307. package/src/migrations/services/RateLimitManager.ts +0 -363
  308. package/src/migrations/services/RelationshipResolver.ts +0 -461
  309. package/src/migrations/services/UserMappingService.ts +0 -345
  310. package/src/migrations/services/ValidationService.ts +0 -349
  311. package/src/migrations/transfer.ts +0 -1068
  312. package/src/migrations/yaml/YamlImportConfigLoader.ts +0 -439
  313. package/src/migrations/yaml/YamlImportIntegration.ts +0 -446
  314. package/src/migrations/yaml/generateImportSchemas.ts +0 -1354
  315. package/src/schemas/authUser.ts +0 -23
  316. package/src/setup.ts +0 -8
  317. package/src/setupCommands.ts +0 -603
  318. package/src/setupController.ts +0 -43
  319. package/src/shared/attributeMapper.ts +0 -229
  320. package/src/shared/backupMetadataSchema.ts +0 -93
  321. package/src/shared/backupTracking.ts +0 -211
  322. package/src/shared/confirmationDialogs.ts +0 -327
  323. package/src/shared/errorUtils.ts +0 -110
  324. package/src/shared/functionManager.ts +0 -537
  325. package/src/shared/jsonSchemaGenerator.ts +0 -383
  326. package/src/shared/logging.ts +0 -149
  327. package/src/shared/messageFormatter.ts +0 -208
  328. package/src/shared/migrationHelpers.ts +0 -232
  329. package/src/shared/operationLogger.ts +0 -20
  330. package/src/shared/operationQueue.ts +0 -377
  331. package/src/shared/operationsTable.ts +0 -338
  332. package/src/shared/operationsTableSchema.ts +0 -60
  333. package/src/shared/progressManager.ts +0 -278
  334. package/src/shared/pydanticModelGenerator.ts +0 -618
  335. package/src/shared/relationshipExtractor.ts +0 -214
  336. package/src/shared/schemaGenerator.ts +0 -644
  337. package/src/shared/selectionDialogs.ts +0 -749
  338. package/src/storage/backupCompression.ts +0 -88
  339. package/src/storage/methods.ts +0 -698
  340. package/src/storage/schemas.ts +0 -205
  341. package/src/tables/indexManager.ts +0 -409
  342. package/src/types/node-appwrite-tablesdb.d.ts +0 -44
  343. package/src/types.ts +0 -9
  344. package/src/users/methods.ts +0 -359
  345. package/src/utils/ClientFactory.ts +0 -240
  346. package/src/utils/configDiscovery.ts +0 -557
  347. package/src/utils/configMigration.ts +0 -348
  348. package/src/utils/constantsGenerator.ts +0 -369
  349. package/src/utils/dataConverters.ts +0 -159
  350. package/src/utils/directoryUtils.ts +0 -61
  351. package/src/utils/getClientFromConfig.ts +0 -257
  352. package/src/utils/helperFunctions.ts +0 -228
  353. package/src/utils/index.ts +0 -2
  354. package/src/utils/loadConfigs.ts +0 -449
  355. package/src/utils/pathResolvers.ts +0 -81
  356. package/src/utils/projectConfig.ts +0 -340
  357. package/src/utils/retryFailedPromises.ts +0 -29
  358. package/src/utils/sessionAuth.ts +0 -230
  359. package/src/utils/setupFiles.ts +0 -1238
  360. package/src/utils/typeGuards.ts +0 -65
  361. package/src/utils/validationRules.ts +0 -88
  362. package/src/utils/versionDetection.ts +0 -292
  363. package/src/utils/yamlConverter.ts +0 -542
  364. package/src/utils/yamlLoader.ts +0 -371
  365. package/src/utilsController.ts +0 -1213
  366. package/tests/README.md +0 -497
  367. package/tests/adapters/AdapterFactory.test.ts +0 -277
  368. package/tests/integration/syncOperations.test.ts +0 -463
  369. package/tests/jest.config.js +0 -25
  370. package/tests/migration/configMigration.test.ts +0 -546
  371. package/tests/setup.ts +0 -62
  372. package/tests/testUtils.ts +0 -340
  373. package/tests/utils/loadConfigs.test.ts +0 -350
  374. package/tests/validation/configValidation.test.ts +0 -412
  375. package/tmp-sync-test/.appwrite/collections/TestCollection.yaml +0 -7
  376. package/tsconfig.json +0 -44
@@ -24,12 +24,12 @@ export const OperationRecordSchema = z.object({
24
24
  $createdAt: z.string(),
25
25
  $updatedAt: z.string(),
26
26
  operationType: z.string(),
27
- targetCollection: z.string().optional(),
27
+ targetTable: z.string().optional(),
28
28
  status: OperationStatusSchema,
29
29
  progress: z.number(),
30
30
  total: z.number(),
31
31
  data: z.any().optional(),
32
32
  error: z.string().optional()
33
33
  });
34
- export const OPERATIONS_TABLE_ID = "_appwrite_operations";
34
+ export const OPERATIONS_TABLE_ID = "appwrite_operations";
35
35
  export const OPERATIONS_TABLE_NAME = "Operations Tracking";
@@ -1,6 +1,6 @@
1
1
  import cliProgress from "cli-progress";
2
2
  import chalk from "chalk";
3
- import { MessageFormatter } from "./messageFormatter.js";
3
+ import { MessageFormatter } from 'appwrite-utils-helpers';
4
4
  export class ProgressManager {
5
5
  static instances = new Map();
6
6
  bar;
@@ -179,6 +179,12 @@ export declare class SelectionDialogs {
179
179
  * Shows bucket selection dialog for selected databases
180
180
  */
181
181
  static selectBucketsForDatabases(selectedDatabaseIds: string[], availableBuckets: any[], configuredBuckets: any[], options?: BucketSelectionOptions): Promise<string[]>;
182
+ /**
183
+ * Shows bucket selection for push operations with merged local+remote buckets.
184
+ * Unlike selectBucketsForDatabases, this shows all buckets as a flat list
185
+ * with source indicators (Local only, Remote only, Configured).
186
+ */
187
+ static selectBucketsForPush(mergedBuckets: any[], configuredBuckets: any[], options?: BucketSelectionOptions): Promise<string[]>;
182
188
  /**
183
189
  * Shows final confirmation dialog with sync selection summary
184
190
  */
@@ -1,7 +1,7 @@
1
1
  import inquirer from "inquirer";
2
2
  import chalk from "chalk";
3
- import { MessageFormatter } from "./messageFormatter.js";
4
- import { logger } from "./logging.js";
3
+ import { MessageFormatter } from 'appwrite-utils-helpers';
4
+ import { logger } from 'appwrite-utils-helpers';
5
5
  /**
6
6
  * Comprehensive selection dialog system for enhanced sync flow
7
7
  *
@@ -186,7 +186,7 @@ export class SelectionDialogs {
186
186
  if (showDatabaseContext) {
187
187
  MessageFormatter.section(`Table Selection for ${databaseName}`);
188
188
  }
189
- const configuredIds = new Set(configuredTables.map(table => table.$id || table.id));
189
+ const configuredIds = new Set(configuredTables.map(table => table.$id || table.id || table.tableId || table.name));
190
190
  let choices = [];
191
191
  if (showSelectAll && availableTables.length > 1) {
192
192
  choices.push({
@@ -196,18 +196,19 @@ export class SelectionDialogs {
196
196
  });
197
197
  }
198
198
  availableTables.forEach(table => {
199
- const isConfigured = configuredIds.has(table.$id);
199
+ const tableId = table.$id || table.id || table.tableId || table.name;
200
+ const isConfigured = configuredIds.has(tableId);
200
201
  const status = isConfigured ? chalk.green('✅') : chalk.blue('○');
201
- const name = `${status} ${table.name} (${table.$id})`;
202
+ const name = `${status} ${table.name} (${tableId})`;
202
203
  if (allowNewOnly && isConfigured) {
203
204
  return; // Skip configured tables if only allowing new ones
204
205
  }
205
206
  choices.push({
206
207
  name,
207
- value: table.$id,
208
+ value: tableId,
208
209
  short: table.name,
209
210
  // Do not preselect anything unless explicitly provided
210
- checked: defaultSelected.includes(table.$id)
211
+ checked: defaultSelected.includes(tableId)
211
212
  });
212
213
  });
213
214
  if (choices.length === 0) {
@@ -231,7 +232,7 @@ export class SelectionDialogs {
231
232
  }]);
232
233
  // Handle select all
233
234
  if (selectedTableIds.includes('__SELECT_ALL__')) {
234
- const allIds = availableTables.map(table => table.$id);
235
+ const allIds = availableTables.map(table => table.$id || table.id || table.tableId || table.name);
235
236
  if (allowNewOnly) {
236
237
  return allIds.filter(id => !configuredIds.has(id));
237
238
  }
@@ -360,6 +361,46 @@ export class SelectionDialogs {
360
361
  }
361
362
  return selectedBucketIds || [];
362
363
  }
364
+ /**
365
+ * Shows bucket selection for push operations with merged local+remote buckets.
366
+ * Unlike selectBucketsForDatabases, this shows all buckets as a flat list
367
+ * with source indicators (Local only, Remote only, Configured).
368
+ */
369
+ static async selectBucketsForPush(mergedBuckets, configuredBuckets, options = {}) {
370
+ MessageFormatter.section("Storage Bucket Selection");
371
+ if (mergedBuckets.length === 0) {
372
+ MessageFormatter.warning("No storage buckets found (local or remote).", { skipLogging: true });
373
+ return [];
374
+ }
375
+ const choices = mergedBuckets.map(bucket => {
376
+ let status;
377
+ let suffix = '';
378
+ if (bucket._isLocalOnly) {
379
+ status = chalk.yellow('*');
380
+ suffix = chalk.yellow(' (Local only - will be created)');
381
+ }
382
+ else if (bucket._isRemoteOnly) {
383
+ status = chalk.blue('○');
384
+ suffix = chalk.blue(' (Remote only)');
385
+ }
386
+ else {
387
+ status = chalk.green('✅');
388
+ suffix = chalk.green(' (Configured)');
389
+ }
390
+ return {
391
+ name: `${status} ${bucket.name} (${bucket.$id})${suffix}`,
392
+ value: bucket.$id,
393
+ short: bucket.name,
394
+ };
395
+ });
396
+ const { selectedBucketIds } = await inquirer.prompt([{
397
+ type: 'checkbox',
398
+ name: 'selectedBucketIds',
399
+ message: 'Select storage buckets to push:',
400
+ choices,
401
+ }]);
402
+ return selectedBucketIds || [];
403
+ }
363
404
  /**
364
405
  * Shows final confirmation dialog with sync selection summary
365
406
  */
@@ -402,7 +443,7 @@ export class SelectionDialogs {
402
443
  });
403
444
  }
404
445
  // Table summary
405
- console.log(chalk.bold.cyan("\n📋 Tables/Collections:"));
446
+ console.log(chalk.bold.cyan("\n📋 Tables:"));
406
447
  console.log(` Total: ${selectionSummary.totalTables}`);
407
448
  console.log(` ${chalk.green('✅ Configured')}: ${selectionSummary.existingItems.tables}`);
408
449
  console.log(` ${chalk.blue('○ New')}: ${selectionSummary.newItems.tables}`);
@@ -499,9 +540,12 @@ export class SelectionDialogs {
499
540
  static createBucketSelection(selectedBucketIds, availableBuckets, configuredBuckets, availableDatabases) {
500
541
  const configuredIds = new Set(configuredBuckets.map(bucket => bucket.$id || bucket.id));
501
542
  return selectedBucketIds.map(bucketId => {
502
- const bucket = availableBuckets.find(b => b.$id === bucketId);
543
+ // Look up in availableBuckets first, then fall back to configuredBuckets
544
+ // (handles merged lists where local-only buckets may only be in configuredBuckets)
545
+ const bucket = availableBuckets.find(b => b.$id === bucketId)
546
+ || configuredBuckets.find(b => (b.$id || b.id) === bucketId);
503
547
  if (!bucket) {
504
- throw new Error(`Bucket with ID ${bucketId} not found in available buckets`);
548
+ throw new Error(`Bucket with ID ${bucketId} not found in available or configured buckets`);
505
549
  }
506
550
  const database = bucket.databaseId ?
507
551
  availableDatabases.find(db => db.$id === bucket.databaseId) : undefined;
@@ -510,7 +554,7 @@ export class SelectionDialogs {
510
554
  bucketName: bucket.name,
511
555
  databaseId: bucket.databaseId,
512
556
  databaseName: database?.name,
513
- isNew: !configuredIds.has(bucketId)
557
+ isNew: bucket._isLocalOnly || !configuredIds.has(bucketId)
514
558
  };
515
559
  });
516
560
  }
@@ -9,7 +9,19 @@ export declare const deleteBucket: (storage: Storage, bucketId: string) => Promi
9
9
  export declare const getFile: (storage: Storage, bucketId: string, fileId: string) => Promise<Models.File>;
10
10
  export declare const listFiles: (storage: Storage, bucketId: string, queries?: string[], search?: string) => Promise<Models.FileList>;
11
11
  export declare const deleteFile: (storage: Storage, bucketId: string, fileId: string) => Promise<{}>;
12
+ /**
13
+ * Convert permission objects ({permission, target}) to Appwrite Permission strings.
14
+ */
15
+ export declare const buildPermissionStrings: (permissions: Array<{
16
+ permission: string;
17
+ target: string;
18
+ }> | undefined) => string[];
12
19
  export declare const ensureDatabaseConfigBucketsExist: (storage: Storage, config: AppwriteConfig, databases?: Models.Database[]) => Promise<void>;
20
+ /**
21
+ * Ensure global/root-level buckets from config.buckets[] exist on remote.
22
+ * Optionally filter to only push selected bucket IDs.
23
+ */
24
+ export declare const ensureGlobalBucketsExist: (storage: Storage, config: AppwriteConfig, selectedBucketIds?: string[]) => Promise<void>;
13
25
  export declare const wipeDocumentStorage: (storage: Storage, bucketId: string, options?: {
14
26
  skipConfirmation?: boolean;
15
27
  }) => Promise<void>;
@@ -1,15 +1,15 @@
1
1
  import { Compression, Databases, Permission, Query, Role, Storage, } from "node-appwrite";
2
2
  import { tryAwaitWithRetry } from "appwrite-utils";
3
- import { getClientFromConfig } from "../utils/getClientFromConfig.js";
3
+ import { getClientFromConfig } from "appwrite-utils-helpers";
4
4
  import { ulid } from "ulidx";
5
5
  import { logOperation } from "../shared/operationLogger.js";
6
6
  import { splitIntoBatches } from "../shared/migrationHelpers.js";
7
- import { retryFailedPromises } from "../utils/retryFailedPromises.js";
7
+ import { retryFailedPromises } from "appwrite-utils-helpers";
8
8
  import { InputFile } from "node-appwrite/file";
9
- import { MessageFormatter, Messages } from "../shared/messageFormatter.js";
9
+ import { MessageFormatter, Messages } from "appwrite-utils-helpers";
10
10
  import { ProgressManager } from "../shared/progressManager.js";
11
11
  import { recordBackup } from "../shared/backupTracking.js";
12
- import { AdapterFactory } from "../adapters/AdapterFactory.js";
12
+ import { AdapterFactory } from "appwrite-utils-helpers";
13
13
  import { createBackupZip } from "./backupCompression.js";
14
14
  export const getStorage = (config) => {
15
15
  const client = getClientFromConfig(config);
@@ -39,96 +39,99 @@ export const listFiles = async (storage, bucketId, queries, search) => {
39
39
  export const deleteFile = async (storage, bucketId, fileId) => {
40
40
  return await storage.deleteFile(bucketId, fileId);
41
41
  };
42
+ /**
43
+ * Convert permission objects ({permission, target}) to Appwrite Permission strings.
44
+ */
45
+ export const buildPermissionStrings = (permissions) => {
46
+ const result = [];
47
+ if (!permissions || permissions.length === 0)
48
+ return result;
49
+ for (const p of permissions) {
50
+ switch (p.permission) {
51
+ case 'read':
52
+ result.push(Permission.read(p.target));
53
+ break;
54
+ case 'create':
55
+ result.push(Permission.create(p.target));
56
+ break;
57
+ case 'update':
58
+ result.push(Permission.update(p.target));
59
+ break;
60
+ case 'delete':
61
+ result.push(Permission.delete(p.target));
62
+ break;
63
+ case 'write':
64
+ result.push(Permission.write(p.target));
65
+ break;
66
+ default: break;
67
+ }
68
+ }
69
+ return result;
70
+ };
71
+ /**
72
+ * Check if a bucket's current state differs from desired config.
73
+ */
74
+ const bucketDiffers = (existing, desired, permissions) => {
75
+ return (existing.name !== desired.name ||
76
+ JSON.stringify(existing.$permissions || []) !== JSON.stringify(permissions) ||
77
+ !!existing.fileSecurity !== !!desired.fileSecurity ||
78
+ !!existing.enabled !== !!desired.enabled ||
79
+ (existing.maximumFileSize ?? undefined) !== (desired.maximumFileSize ?? undefined) ||
80
+ JSON.stringify(existing.allowedFileExtensions || []) !== JSON.stringify(desired.allowedFileExtensions || []) ||
81
+ String(existing.compression || 'none') !== String(desired.compression || 'none') ||
82
+ !!existing.encryption !== !!desired.encryption ||
83
+ !!existing.antivirus !== !!desired.antivirus);
84
+ };
85
+ /**
86
+ * Create or update a single bucket to match desired config.
87
+ */
88
+ const ensureSingleBucketExists = async (storage, desired) => {
89
+ const permissions = buildPermissionStrings(desired.permissions);
90
+ try {
91
+ const existing = await storage.getBucket(desired.$id);
92
+ if (bucketDiffers(existing, desired, permissions)) {
93
+ try {
94
+ await storage.updateBucket(desired.$id, desired.name, permissions, desired.fileSecurity, desired.enabled, desired.maximumFileSize, desired.allowedFileExtensions, desired.compression, desired.encryption, desired.antivirus);
95
+ MessageFormatter.info(`Updated bucket ${desired.$id} to match config`, { prefix: 'Buckets' });
96
+ }
97
+ catch (updateErr) {
98
+ MessageFormatter.warning(`Failed to update bucket ${desired.$id}: ${updateErr instanceof Error ? updateErr.message : String(updateErr)}`, { prefix: 'Buckets' });
99
+ }
100
+ }
101
+ else {
102
+ MessageFormatter.debug(`Bucket ${desired.$id} up-to-date`, undefined, { prefix: 'Buckets' });
103
+ }
104
+ }
105
+ catch (_e) {
106
+ // Bucket doesn't exist, create it
107
+ try {
108
+ await storage.createBucket(desired.$id, desired.name, permissions, desired.fileSecurity, desired.enabled, desired.maximumFileSize, desired.allowedFileExtensions, desired.compression, desired.encryption, desired.antivirus);
109
+ MessageFormatter.success(`Bucket ${desired.$id} created`, { prefix: 'Buckets' });
110
+ }
111
+ catch (createError) {
112
+ MessageFormatter.error(`Failed to create bucket ${desired.$id}`, createError instanceof Error ? createError : new Error(String(createError)), { prefix: 'Buckets' });
113
+ }
114
+ }
115
+ };
42
116
  export const ensureDatabaseConfigBucketsExist = async (storage, config, databases = []) => {
43
117
  for (const db of databases) {
44
118
  const database = config.databases?.find((d) => d.$id === db.$id);
45
119
  if (database?.bucket) {
46
- try {
47
- const existing = await storage.getBucket(database.bucket.$id);
48
- // Compare and update if needed
49
- const desired = database.bucket;
50
- // Build desired permissions via Permission helper
51
- const permissions = [];
52
- if (desired.permissions && desired.permissions.length > 0) {
53
- for (const p of desired.permissions) {
54
- switch (p.permission) {
55
- case 'read':
56
- permissions.push(Permission.read(p.target));
57
- break;
58
- case 'create':
59
- permissions.push(Permission.create(p.target));
60
- break;
61
- case 'update':
62
- permissions.push(Permission.update(p.target));
63
- break;
64
- case 'delete':
65
- permissions.push(Permission.delete(p.target));
66
- break;
67
- case 'write':
68
- permissions.push(Permission.write(p.target));
69
- break;
70
- default: break;
71
- }
72
- }
73
- }
74
- const diff = (existing.name !== desired.name ||
75
- JSON.stringify(existing.$permissions || []) !== JSON.stringify(permissions) ||
76
- !!existing.fileSecurity !== !!desired.fileSecurity ||
77
- !!existing.enabled !== !!desired.enabled ||
78
- (existing.maximumFileSize ?? undefined) !== (desired.maximumFileSize ?? undefined) ||
79
- JSON.stringify(existing.allowedFileExtensions || []) !== JSON.stringify(desired.allowedFileExtensions || []) ||
80
- String(existing.compression || 'none') !== String(desired.compression || 'none') ||
81
- !!existing.encryption !== !!desired.encryption ||
82
- !!existing.antivirus !== !!desired.antivirus);
83
- if (diff) {
84
- try {
85
- await storage.updateBucket(desired.$id, desired.name, permissions, desired.fileSecurity, desired.enabled, desired.maximumFileSize, desired.allowedFileExtensions, desired.compression, desired.encryption, desired.antivirus);
86
- MessageFormatter.info(`Updated bucket ${desired.$id} to match config`, { prefix: 'Buckets' });
87
- }
88
- catch (updateErr) {
89
- MessageFormatter.warning(`Failed to update bucket ${desired.$id}: ${updateErr instanceof Error ? updateErr.message : String(updateErr)}`, { prefix: 'Buckets' });
90
- }
91
- }
92
- else {
93
- MessageFormatter.debug(`Bucket ${desired.$id} up-to-date`, undefined, { prefix: 'Buckets' });
94
- }
95
- }
96
- catch (e) {
97
- const permissions = [];
98
- if (database.bucket.permissions &&
99
- database.bucket.permissions.length > 0) {
100
- for (const permission of database.bucket.permissions) {
101
- switch (permission.permission) {
102
- case "read":
103
- permissions.push(Permission.read(permission.target));
104
- break;
105
- case "create":
106
- permissions.push(Permission.create(permission.target));
107
- break;
108
- case "update":
109
- permissions.push(Permission.update(permission.target));
110
- break;
111
- case "delete":
112
- permissions.push(Permission.delete(permission.target));
113
- break;
114
- case "write":
115
- permissions.push(Permission.write(permission.target));
116
- break;
117
- default:
118
- console.warn(`Unknown permission: ${permission.permission}`);
119
- break;
120
- }
121
- }
122
- }
123
- try {
124
- await storage.createBucket(database.bucket.$id, database.bucket.name, permissions, database.bucket.fileSecurity, database.bucket.enabled, database.bucket.maximumFileSize, database.bucket.allowedFileExtensions, database.bucket.compression, database.bucket.encryption, database.bucket.antivirus);
125
- MessageFormatter.success(`Bucket ${database.bucket.$id} created`, { prefix: 'Buckets' });
126
- }
127
- catch (createError) {
128
- MessageFormatter.error(`Failed to create bucket ${database.bucket.$id}`, createError instanceof Error ? createError : new Error(String(createError)), { prefix: 'Buckets' });
129
- }
130
- }
120
+ await ensureSingleBucketExists(storage, database.bucket);
121
+ }
122
+ }
123
+ };
124
+ /**
125
+ * Ensure global/root-level buckets from config.buckets[] exist on remote.
126
+ * Optionally filter to only push selected bucket IDs.
127
+ */
128
+ export const ensureGlobalBucketsExist = async (storage, config, selectedBucketIds) => {
129
+ const globalBuckets = config.buckets || [];
130
+ for (const bucket of globalBuckets) {
131
+ if (selectedBucketIds && !selectedBucketIds.includes(bucket.$id)) {
132
+ continue;
131
133
  }
134
+ await ensureSingleBucketExists(storage, bucket);
132
135
  }
133
136
  };
134
137
  export const wipeDocumentStorage = async (storage, bucketId, options = {}) => {
@@ -12,11 +12,11 @@ export declare const BackupSchema: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  export type Backup = z.infer<typeof BackupSchema>;
14
14
  export declare const BackupCreateSchema: z.ZodObject<{
15
+ collections: z.ZodArray<z.ZodString>;
15
16
  documents: z.ZodDefault<z.ZodArray<z.ZodObject<{
16
17
  collectionId: z.ZodString;
17
18
  data: z.ZodString;
18
19
  }, z.core.$strip>>>;
19
- collections: z.ZodArray<z.ZodString>;
20
20
  database: z.ZodString;
21
21
  }, z.core.$strip>;
22
22
  export type BackupCreate = z.infer<typeof BackupCreateSchema>;
@@ -56,7 +56,6 @@ export declare const OperationSchema: z.ZodObject<{
56
56
  export type Operation = z.infer<typeof OperationSchema>;
57
57
  export declare const OperationCreateSchema: z.ZodObject<{
58
58
  error: z.ZodString;
59
- data: z.ZodAny;
60
59
  status: z.ZodDefault<z.ZodEnum<{
61
60
  error: "error";
62
61
  pending: "pending";
@@ -66,6 +65,7 @@ export declare const OperationCreateSchema: z.ZodObject<{
66
65
  cancelled: "cancelled";
67
66
  }>>;
68
67
  collectionId: z.ZodString;
68
+ data: z.ZodAny;
69
69
  operationType: z.ZodString;
70
70
  batches: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
71
71
  progress: z.ZodNumber;
@@ -1,5 +1,5 @@
1
1
  import type { Index } from "appwrite-utils";
2
- import type { DatabaseAdapter } from "../adapters/DatabaseAdapter.js";
2
+ import type { DatabaseAdapter } from "appwrite-utils-helpers";
3
3
  import type { Models } from "node-appwrite";
4
4
  export interface IndexOperation {
5
5
  type: 'create' | 'update' | 'skip' | 'delete';
@@ -1,6 +1,6 @@
1
1
  import { isIndexEqualToIndex } from "../collections/tableOperations.js";
2
- import { MessageFormatter } from "../shared/messageFormatter.js";
3
- import { delay, tryAwaitWithRetry } from "../utils/helperFunctions.js";
2
+ import { MessageFormatter } from "appwrite-utils-helpers";
3
+ import { delay, tryAwaitWithRetry } from "appwrite-utils-helpers";
4
4
  /**
5
5
  * Plan index operations by comparing desired indexes with existing ones
6
6
  * Uses the existing isIndexEqualToIndex function for consistent comparison
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { ValidationRules } from "./utils/validationRules.js";
1
+ export type { ValidationRules } from "appwrite-utils-helpers";
2
2
  export { type AuthUserCreate, AuthUserCreateSchema, type AuthUser, AuthUserSchema, } from "./schemas/authUser.js";
3
- export { validationRules } from "./utils/validationRules.js";
3
+ export { validationRules } from "appwrite-utils-helpers";
4
4
  export { afterImportActions } from "./migrations/afterImportActions.js";
package/dist/types.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { AuthUserCreateSchema, AuthUserSchema, } from "./schemas/authUser.js";
2
- export { validationRules } from "./utils/validationRules.js";
2
+ export { validationRules } from "appwrite-utils-helpers";
3
3
  export { afterImportActions } from "./migrations/afterImportActions.js";
@@ -1,11 +1,10 @@
1
1
  import { AppwriteException, Databases, ID, Query, Users, } from "node-appwrite";
2
2
  import { AuthUserSchema, } from "../schemas/authUser.js";
3
- import { logger } from "../shared/logging.js";
3
+ import { logger, MessageFormatter } from "appwrite-utils-helpers";
4
4
  import { splitIntoBatches } from "../shared/migrationHelpers.js";
5
- import { getAppwriteClient, tryAwaitWithRetry, } from "../utils/helperFunctions.js";
5
+ import { getAppwriteClient, tryAwaitWithRetry, } from "appwrite-utils-helpers";
6
6
  import { isUndefined } from "es-toolkit/compat";
7
7
  import { isEmpty } from "es-toolkit/compat";
8
- import { MessageFormatter } from "../shared/messageFormatter.js";
9
8
  export class UsersController {
10
9
  config;
11
10
  users;
@@ -1,7 +1,7 @@
1
1
  import { promises as fs } from "fs";
2
2
  import path from "path";
3
3
  import { existsSync } from "fs";
4
- import { MessageFormatter } from "../shared/messageFormatter.js";
4
+ import { MessageFormatter } from "appwrite-utils-helpers";
5
5
  import { ConfirmationDialogs } from "../shared/confirmationDialogs.js";
6
6
  import yaml from "js-yaml";
7
7
  export async function migrateConfig(workingDir) {
@@ -1,2 +1,2 @@
1
- export * from "./helperFunctions.js";
1
+ export * from 'appwrite-utils-helpers';
2
2
  export * from "./setupFiles.js";
@@ -1,2 +1,2 @@
1
- export * from "./helperFunctions.js";
1
+ export * from 'appwrite-utils-helpers';
2
2
  export * from "./setupFiles.js";
@@ -1,5 +1,5 @@
1
1
  import { type AppwriteConfig } from "appwrite-utils";
2
- import { type ValidationResult } from "../config/configValidation.js";
2
+ import { type ValidationResult } from "appwrite-utils-helpers";
3
3
  /**
4
4
  * Session authentication preservation options for config loading
5
5
  */
@@ -28,7 +28,7 @@ export interface ConfigLoadingOptions {
28
28
  * @returns SessionPreservationOptions object
29
29
  */
30
30
  export declare function createSessionPreservation(sessionCookie: string, email?: string, expiresAt?: string): SessionPreservationOptions;
31
- export { findAppwriteConfig, findFunctionsDir } from "./configDiscovery.js";
31
+ export { findAppwriteConfig, findFunctionsDir } from 'appwrite-utils-helpers';
32
32
  /**
33
33
  * Loads the Appwrite configuration and returns both config and the path where it was found.
34
34
  * @param configDir The directory to search for config files.
@@ -4,12 +4,11 @@ import {} from "appwrite-utils";
4
4
  import { register } from "tsx/esm/api"; // Import the register function
5
5
  import { pathToFileURL } from "node:url";
6
6
  import chalk from "chalk";
7
- import { findYamlConfig, loadYamlConfig, loadYamlConfigWithSession, extractSessionOptionsFromConfig } from "../config/yamlConfig.js";
8
- import { detectAppwriteVersionCached, fetchServerVersion, isVersionAtLeast } from "./versionDetection.js";
9
- import { MessageFormatter } from "../shared/messageFormatter.js";
10
- import { validateCollectionsTablesConfig, reportValidationResults } from "../config/configValidation.js";
11
- import { resolveCollectionsDir, resolveTablesDir } from "./pathResolvers.js";
12
- import { findAppwriteConfig, findAppwriteConfigTS, findFunctionsDir, discoverCollections, discoverTables, discoverLegacyDirectory } from "./configDiscovery.js";
7
+ import { findYamlConfig, loadYamlConfig, loadYamlConfigWithSession, extractSessionOptionsFromConfig, validateCollectionsTablesConfig, reportValidationResults } from "appwrite-utils-helpers";
8
+ import { detectAppwriteVersionCached, fetchServerVersion, isVersionAtLeast } from 'appwrite-utils-helpers';
9
+ import { MessageFormatter } from "appwrite-utils-helpers";
10
+ import { resolveCollectionsDir, resolveTablesDir } from 'appwrite-utils-helpers';
11
+ import { findAppwriteConfig, findAppwriteConfigTS, findFunctionsDir, discoverCollections, discoverTables, discoverLegacyDirectory } from 'appwrite-utils-helpers';
13
12
  /**
14
13
  * Helper function to create session preservation options from session data
15
14
  * @param sessionCookie The session cookie string
@@ -28,7 +27,7 @@ export function createSessionPreservation(sessionCookie, email, expiresAt) {
28
27
  };
29
28
  }
30
29
  // Re-export config discovery functions for backward compatibility
31
- export { findAppwriteConfig, findFunctionsDir } from "./configDiscovery.js";
30
+ export { findAppwriteConfig, findFunctionsDir } from 'appwrite-utils-helpers';
32
31
  /**
33
32
  * Loads the Appwrite configuration and returns both config and the path where it was found.
34
33
  * @param configDir The directory to search for config files.