appwrite-utils-cli 1.2.8 → 1.2.9
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/interactiveCLI.js
CHANGED
@@ -1067,7 +1067,7 @@ export class InteractiveCLI {
|
|
1067
1067
|
}
|
1068
1068
|
// Update schemas after all changes
|
1069
1069
|
const schemaGenerator = new SchemaGenerator(this.controller.config, this.controller.getAppwriteFolderPath());
|
1070
|
-
schemaGenerator.updateConfig(this.controller.config);
|
1070
|
+
await schemaGenerator.updateConfig(this.controller.config);
|
1071
1071
|
}
|
1072
1072
|
console.log(chalk.green("✨ Configurations synchronized successfully!"));
|
1073
1073
|
}
|
@@ -6,7 +6,7 @@ export declare class SchemaGenerator {
|
|
6
6
|
constructor(config: AppwriteConfig, appwriteFolderPath: string);
|
7
7
|
updateYamlCollections(): void;
|
8
8
|
updateTsSchemas(): void;
|
9
|
-
updateConfig(config: AppwriteConfig): void
|
9
|
+
updateConfig(config: AppwriteConfig): Promise<void>;
|
10
10
|
private updateYamlConfig;
|
11
11
|
private updateTypeScriptConfig;
|
12
12
|
private extractRelationships;
|
@@ -154,13 +154,13 @@ export class SchemaGenerator {
|
|
154
154
|
console.log(`Collection schema written to ${collectionFilePath}`);
|
155
155
|
});
|
156
156
|
}
|
157
|
-
updateConfig(config) {
|
157
|
+
async updateConfig(config) {
|
158
158
|
// Check if user is using YAML config
|
159
|
-
const { findYamlConfig
|
159
|
+
const { findYamlConfig } = await import("../config/yamlConfig.js");
|
160
160
|
const yamlConfigPath = findYamlConfig(this.appwriteFolderPath);
|
161
161
|
if (yamlConfigPath) {
|
162
162
|
// User has YAML config - update it and generate individual collection files
|
163
|
-
this.updateYamlConfig(config, yamlConfigPath);
|
163
|
+
await this.updateYamlConfig(config, yamlConfigPath);
|
164
164
|
}
|
165
165
|
else {
|
166
166
|
// User has TypeScript config - update the TS file
|
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.
|
4
|
+
"version": "1.2.9",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
package/src/interactiveCLI.ts
CHANGED
@@ -1442,7 +1442,7 @@ export class InteractiveCLI {
|
|
1442
1442
|
this.controller!.config!,
|
1443
1443
|
this.controller!.getAppwriteFolderPath()!
|
1444
1444
|
);
|
1445
|
-
schemaGenerator.updateConfig(this.controller!.config!);
|
1445
|
+
await schemaGenerator.updateConfig(this.controller!.config!);
|
1446
1446
|
}
|
1447
1447
|
|
1448
1448
|
console.log(chalk.green("✨ Configurations synchronized successfully!"));
|
@@ -197,14 +197,14 @@ export class SchemaGenerator {
|
|
197
197
|
});
|
198
198
|
}
|
199
199
|
|
200
|
-
public updateConfig(config: AppwriteConfig): void {
|
200
|
+
public async updateConfig(config: AppwriteConfig): Promise<void> {
|
201
201
|
// Check if user is using YAML config
|
202
|
-
const { findYamlConfig
|
202
|
+
const { findYamlConfig } = await import("../config/yamlConfig.js");
|
203
203
|
const yamlConfigPath = findYamlConfig(this.appwriteFolderPath);
|
204
204
|
|
205
205
|
if (yamlConfigPath) {
|
206
206
|
// User has YAML config - update it and generate individual collection files
|
207
|
-
this.updateYamlConfig(config, yamlConfigPath);
|
207
|
+
await this.updateYamlConfig(config, yamlConfigPath);
|
208
208
|
} else {
|
209
209
|
// User has TypeScript config - update the TS file
|
210
210
|
this.updateTypeScriptConfig(config);
|