appwrite-utils-cli 0.0.6 → 0.0.7

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.
@@ -1,4 +1,4 @@
1
- import { Storage, Databases, Query, InputFile, ID, } from "node-appwrite";
1
+ import { Storage, Databases, Query, InputFile, ID, Permission, } from "node-appwrite";
2
2
  import {} from "./backup.js";
3
3
  import { splitIntoBatches } from "./migrationHelper.js";
4
4
  export const logOperation = async (db, dbId, operationDetails, operationId) => {
@@ -39,7 +39,12 @@ export const initOrGetDocumentStorage = async (storage, config, dbName) => {
39
39
  catch (e) {
40
40
  // ID documentStorage
41
41
  // Name Document Storage
42
- const documentStorage = await storage.createBucket(`${config.documentBucketId}_${dbName.toLowerCase().replace(" ", "")}`, "Document Storage");
42
+ const documentStorage = await storage.createBucket(`${config.documentBucketId}_${dbName.toLowerCase().replace(" ", "")}`, `Document Storage ${dbName}`, [
43
+ Permission.read("any"),
44
+ Permission.create("any"),
45
+ Permission.update("any"),
46
+ Permission.delete("any"),
47
+ ]);
43
48
  return documentStorage;
44
49
  }
45
50
  };
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.6",
4
+ "version": "0.0.7",
5
5
  "main": "src/main.ts",
6
6
  "type": "module",
7
7
  "repository": {
@@ -5,6 +5,7 @@ import {
5
5
  InputFile,
6
6
  type Models,
7
7
  ID,
8
+ Permission,
8
9
  } from "node-appwrite";
9
10
  import { type OperationCreate, type BackupCreate } from "./backup.js";
10
11
  import { splitIntoBatches } from "./migrationHelper.js";
@@ -72,7 +73,13 @@ export const initOrGetDocumentStorage = async (
72
73
  // Name Document Storage
73
74
  const documentStorage = await storage.createBucket(
74
75
  `${config.documentBucketId}_${dbName.toLowerCase().replace(" ", "")}`,
75
- "Document Storage"
76
+ `Document Storage ${dbName}`,
77
+ [
78
+ Permission.read("any"),
79
+ Permission.create("any"),
80
+ Permission.update("any"),
81
+ Permission.delete("any"),
82
+ ]
76
83
  );
77
84
  return documentStorage;
78
85
  }