appwrite-utils-cli 1.2.22 → 1.2.24

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.
@@ -540,7 +540,7 @@ export class InteractiveCLI {
540
540
  await deployLocalFunction(this.controller.appwriteServer, functionConfig.name, {
541
541
  ...functionConfig,
542
542
  dirPath: functionPath,
543
- });
543
+ }, functionPath);
544
544
  MessageFormatter.success("Function deployed successfully!", { prefix: "Functions" });
545
545
  }
546
546
  catch (error) {
@@ -20,6 +20,8 @@ import { deployLocalFunction } from "./functions/deployments.js";
20
20
  import fs from "node:fs";
21
21
  import { configureLogging, updateLogger } from "./shared/logging.js";
22
22
  import { MessageFormatter, Messages } from "./shared/messageFormatter.js";
23
+ import { SchemaGenerator } from "./shared/schemaGenerator.js";
24
+ import { findYamlConfig } from "./config/yamlConfig.js";
23
25
  export class UtilsController {
24
26
  appwriteFolderPath;
25
27
  appwriteConfigPath;
@@ -398,6 +400,11 @@ export class UtilsController {
398
400
  await appwriteToX.toSchemas(databases);
399
401
  // Update the controller's config with the synchronized collections
400
402
  this.config = appwriteToX.updatedConfig;
403
+ // Write the updated config back to disk
404
+ const generator = new SchemaGenerator(this.config, this.appwriteFolderPath);
405
+ const yamlConfigPath = findYamlConfig(this.appwriteFolderPath);
406
+ const isYamlProject = !!yamlConfigPath;
407
+ await generator.updateConfig(this.config, isYamlProject);
401
408
  }
402
409
  async syncDb(databases = [], collections = []) {
403
410
  await this.init();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "appwrite-utils-cli",
3
3
  "description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
4
- "version": "1.2.22",
4
+ "version": "1.2.24",
5
5
  "main": "src/main.ts",
6
6
  "type": "module",
7
7
  "repository": {
@@ -728,7 +728,8 @@ export class InteractiveCLI {
728
728
  {
729
729
  ...functionConfig,
730
730
  dirPath: functionPath,
731
- }
731
+ },
732
+ functionPath
732
733
  );
733
734
  MessageFormatter.success("Function deployed successfully!", { prefix: "Functions" });
734
735
  } catch (error) {
@@ -68,6 +68,8 @@ import { deployLocalFunction } from "./functions/deployments.js";
68
68
  import fs from "node:fs";
69
69
  import { configureLogging, updateLogger } from "./shared/logging.js";
70
70
  import { MessageFormatter, Messages } from "./shared/messageFormatter.js";
71
+ import { SchemaGenerator } from "./shared/schemaGenerator.js";
72
+ import { findYamlConfig } from "./config/yamlConfig.js";
71
73
 
72
74
  export interface SetupOptions {
73
75
  databases?: Models.Database[];
@@ -569,6 +571,12 @@ export class UtilsController {
569
571
 
570
572
  // Update the controller's config with the synchronized collections
571
573
  this.config = appwriteToX.updatedConfig;
574
+
575
+ // Write the updated config back to disk
576
+ const generator = new SchemaGenerator(this.config, this.appwriteFolderPath);
577
+ const yamlConfigPath = findYamlConfig(this.appwriteFolderPath);
578
+ const isYamlProject = !!yamlConfigPath;
579
+ await generator.updateConfig(this.config, isYamlProject);
572
580
  }
573
581
 
574
582
  async syncDb(