appwrite-utils-cli 0.9.88 → 0.9.89
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
@@ -104,6 +104,7 @@ export class InteractiveCLI {
|
|
104
104
|
}
|
105
105
|
}
|
106
106
|
async selectDatabases(databases, message, multiSelect = true) {
|
107
|
+
await this.initControllerIfNeeded();
|
107
108
|
const configDatabases = this.getLocalDatabases();
|
108
109
|
const allDatabases = [...databases, ...configDatabases].reduce((acc, db) => {
|
109
110
|
if (!acc.find(d => d.name === db.name)) {
|
@@ -128,6 +129,7 @@ export class InteractiveCLI {
|
|
128
129
|
return selectedDatabases;
|
129
130
|
}
|
130
131
|
async selectCollections(database, databasesClient, message, multiSelect = true) {
|
132
|
+
await this.initControllerIfNeeded();
|
131
133
|
const collections = await fetchAllCollections(database.$id, databasesClient);
|
132
134
|
const configCollections = this.getLocalCollections();
|
133
135
|
const collectionNames = collections.map((c) => c.name).concat(configCollections.map((c) => c.name));
|
@@ -172,6 +172,7 @@ export class SchemaGenerator {
|
|
172
172
|
return;
|
173
173
|
}
|
174
174
|
this.config.collections.forEach((collection) => {
|
175
|
+
console.log(`Generating schema for ${JSON.stringify(collection, null, 4)}`);
|
175
176
|
const schemaString = this.createSchemaString(collection.name, collection.attributes);
|
176
177
|
const camelCaseName = toCamelCase(collection.name);
|
177
178
|
const schemaPath = path.join(this.appwriteFolderPath, "schemas", `${camelCaseName}.ts`);
|
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": "0.9.
|
4
|
+
"version": "0.9.89",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
package/src/interactiveCLI.ts
CHANGED
@@ -121,6 +121,7 @@ export class InteractiveCLI {
|
|
121
121
|
message: string,
|
122
122
|
multiSelect = true
|
123
123
|
): Promise<Models.Database[]> {
|
124
|
+
await this.initControllerIfNeeded();
|
124
125
|
const configDatabases = this.getLocalDatabases();
|
125
126
|
const allDatabases = [...databases, ...configDatabases].reduce((acc, db) => {
|
126
127
|
if (!acc.find(d => d.name === db.name)) {
|
@@ -152,8 +153,9 @@ export class InteractiveCLI {
|
|
152
153
|
database: Models.Database,
|
153
154
|
databasesClient: Databases,
|
154
155
|
message: string,
|
155
|
-
multiSelect = true
|
156
|
+
multiSelect = true
|
156
157
|
): Promise<Models.Collection[]> {
|
158
|
+
await this.initControllerIfNeeded();
|
157
159
|
const collections = await fetchAllCollections(
|
158
160
|
database.$id,
|
159
161
|
databasesClient
|
@@ -226,6 +226,7 @@ export class SchemaGenerator {
|
|
226
226
|
return;
|
227
227
|
}
|
228
228
|
this.config.collections.forEach((collection) => {
|
229
|
+
console.log(`Generating schema for ${JSON.stringify(collection, null, 4)}`);
|
229
230
|
const schemaString = this.createSchemaString(
|
230
231
|
collection.name,
|
231
232
|
collection.attributes
|