appwrite-utils-cli 0.0.39 → 0.0.41
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.
|
@@ -3,7 +3,7 @@ import { BatchSchema, OperationSchema } from "./backup.js";
|
|
|
3
3
|
import { AttributeMappingsSchema } from "appwrite-utils";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { logger } from "./logging.js";
|
|
6
|
-
import { tryAwaitWithRetry } from "
|
|
6
|
+
import { tryAwaitWithRetry } from "../utils/helperFunctions.js";
|
|
7
7
|
/**
|
|
8
8
|
* Object that contains the context for an action that needs to be executed after import
|
|
9
9
|
* Used in the afterImportActionsDefinitions
|
|
@@ -79,7 +79,7 @@ export const wipeDocumentStorage = async (storage, config, dbName) => {
|
|
|
79
79
|
}
|
|
80
80
|
for (const fileId of allFiles) {
|
|
81
81
|
console.log(`Deleting file: ${fileId}`);
|
|
82
|
-
await storage.deleteFile(bucketId, fileId);
|
|
82
|
+
await tryAwaitWithRetry(async () => await storage.deleteFile(bucketId, fileId));
|
|
83
83
|
}
|
|
84
84
|
console.log(`All files in bucket ${bucketId} have been deleted.`);
|
|
85
85
|
};
|
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.0.
|
|
4
|
+
"version": "0.0.41",
|
|
5
5
|
"main": "src/main.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -3,7 +3,7 @@ import { BatchSchema, OperationSchema, type Operation } from "./backup.js";
|
|
|
3
3
|
import { AttributeMappingsSchema } from "appwrite-utils";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { logger } from "./logging.js";
|
|
6
|
-
import { tryAwaitWithRetry } from "
|
|
6
|
+
import { tryAwaitWithRetry } from "../utils/helperFunctions.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Object that contains the context for an action that needs to be executed after import
|
|
@@ -132,7 +132,9 @@ export const wipeDocumentStorage = async (
|
|
|
132
132
|
|
|
133
133
|
for (const fileId of allFiles) {
|
|
134
134
|
console.log(`Deleting file: ${fileId}`);
|
|
135
|
-
await
|
|
135
|
+
await tryAwaitWithRetry(
|
|
136
|
+
async () => await storage.deleteFile(bucketId, fileId)
|
|
137
|
+
);
|
|
136
138
|
}
|
|
137
139
|
console.log(`All files in bucket ${bucketId} have been deleted.`);
|
|
138
140
|
};
|