appwrite-utils-cli 0.10.85 → 0.10.86
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/README.md +1 -0
- package/dist/interactiveCLI.js +2 -3
- package/package.json +1 -1
- package/src/interactiveCLI.ts +4 -2
package/README.md
CHANGED
@@ -150,6 +150,7 @@ This updated CLI ensures that developers have robust tools at their fingertips t
|
|
150
150
|
|
151
151
|
## Changelog
|
152
152
|
|
153
|
+
- 0.10.86: Fixed `selectCollections` not always filtering by `databaseId`
|
153
154
|
- 0.10.85: Added logging to `wipeCollection`
|
154
155
|
- 0.10.83: Actually fixed the import oops
|
155
156
|
- 0.10.82: Fixed the `lodash` import, replaced with `es-toolkit`
|
package/dist/interactiveCLI.js
CHANGED
@@ -172,11 +172,10 @@ export class InteractiveCLI {
|
|
172
172
|
]);
|
173
173
|
return selectedDatabases;
|
174
174
|
}
|
175
|
-
async selectCollections(database, databasesClient, message, multiSelect = true, preferLocal = false) {
|
175
|
+
async selectCollections(database, databasesClient, message, multiSelect = true, preferLocal = false, shouldFilterByDatabase = false) {
|
176
176
|
await this.initControllerIfNeeded();
|
177
177
|
const configCollections = this.getLocalCollections();
|
178
178
|
let remoteCollections = [];
|
179
|
-
let shouldFilterByDatabase = true;
|
180
179
|
const dbExists = await databasesClient.list([
|
181
180
|
Query.equal("name", database.name),
|
182
181
|
]);
|
@@ -1053,7 +1052,7 @@ export class InteractiveCLI {
|
|
1053
1052
|
const databases = await fetchAllDatabases(this.controller.database);
|
1054
1053
|
const selectedDatabases = await this.selectDatabases(databases, "Select the database(s) containing the collections to wipe:", true);
|
1055
1054
|
for (const database of selectedDatabases) {
|
1056
|
-
const collections = await this.selectCollections(database, this.controller.database, `Select collections to wipe from ${database.name}:`, true);
|
1055
|
+
const collections = await this.selectCollections(database, this.controller.database, `Select collections to wipe from ${database.name}:`, true, undefined, true);
|
1057
1056
|
const { confirm } = await inquirer.prompt([
|
1058
1057
|
{
|
1059
1058
|
type: "confirm",
|
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.10.
|
4
|
+
"version": "0.10.86",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
package/src/interactiveCLI.ts
CHANGED
@@ -233,13 +233,13 @@ export class InteractiveCLI {
|
|
233
233
|
databasesClient: Databases,
|
234
234
|
message: string,
|
235
235
|
multiSelect = true,
|
236
|
-
preferLocal = false
|
236
|
+
preferLocal = false,
|
237
|
+
shouldFilterByDatabase = false
|
237
238
|
): Promise<Models.Collection[]> {
|
238
239
|
await this.initControllerIfNeeded();
|
239
240
|
|
240
241
|
const configCollections = this.getLocalCollections();
|
241
242
|
let remoteCollections: Models.Collection[] = [];
|
242
|
-
let shouldFilterByDatabase = true;
|
243
243
|
|
244
244
|
const dbExists = await databasesClient.list([
|
245
245
|
Query.equal("name", database.name),
|
@@ -1454,6 +1454,8 @@ export class InteractiveCLI {
|
|
1454
1454
|
database,
|
1455
1455
|
this.controller!.database,
|
1456
1456
|
`Select collections to wipe from ${database.name}:`,
|
1457
|
+
true,
|
1458
|
+
undefined,
|
1457
1459
|
true
|
1458
1460
|
);
|
1459
1461
|
|