appwrite-utils-cli 0.0.36 → 0.0.37
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/utils/setupFiles.js +4 -0
- package/package.json +1 -1
- package/src/utils/setupFiles.ts +4 -0
package/README.md
CHANGED
|
@@ -86,6 +86,7 @@ This setup ensures that developers have robust tools at their fingertips to mana
|
|
|
86
86
|
|
|
87
87
|
### Changelog
|
|
88
88
|
|
|
89
|
+
- 0.0.37: Added `documentSecurity`, `enabled`, and `$id` to the `init` collection
|
|
89
90
|
- 0.0.36: Made it update collections by default, sometimes you gotta do what you gotta do
|
|
90
91
|
- 0.0.35: Added update collection if it exists and permissions or such are different (`documentSecurity` and `enabled`), also added a check for `fetch failed` errors to retry them with recursion, not sure how well that will work out, but we're gonna try it! It will still fail after 5 tries, but hopefully that gives Appwrite some time to figure it's stuff out
|
|
91
92
|
- 0.0.34: Fixed the `bin` section of the package.json, apparently you can't use `node` to run it
|
package/dist/utils/setupFiles.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync, existsSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { findAppwriteConfig } from "./loadConfigs.js";
|
|
4
|
+
import { ID } from "node-appwrite";
|
|
4
5
|
// Example base configuration using types from appwrite-utils
|
|
5
6
|
const baseConfig = {
|
|
6
7
|
appwriteEndpoint: "https://cloud.appwrite.io/v1",
|
|
@@ -68,6 +69,9 @@ export const createEmptyCollection = (collectionName) => {
|
|
|
68
69
|
const emptyCollection = `import type { CollectionCreate } from "appwrite-utils";
|
|
69
70
|
|
|
70
71
|
const ${collectionName}: Partial<CollectionCreate> = {
|
|
72
|
+
$id: '${ID.unique()}',
|
|
73
|
+
documentSecurity: false,
|
|
74
|
+
enabled: true,
|
|
71
75
|
name: '${collectionName}',
|
|
72
76
|
$permissions: [
|
|
73
77
|
{ permission: 'read', target: 'any' },
|
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.37",
|
|
5
5
|
"main": "src/main.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
package/src/utils/setupFiles.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { mkdirSync, writeFileSync, existsSync } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import type { AppwriteConfig } from "appwrite-utils";
|
|
4
4
|
import { findAppwriteConfig } from "./loadConfigs.js";
|
|
5
|
+
import { ID } from "node-appwrite";
|
|
5
6
|
|
|
6
7
|
// Example base configuration using types from appwrite-utils
|
|
7
8
|
const baseConfig: AppwriteConfig = {
|
|
@@ -74,6 +75,9 @@ export const createEmptyCollection = (collectionName: string) => {
|
|
|
74
75
|
const emptyCollection = `import type { CollectionCreate } from "appwrite-utils";
|
|
75
76
|
|
|
76
77
|
const ${collectionName}: Partial<CollectionCreate> = {
|
|
78
|
+
$id: '${ID.unique()}',
|
|
79
|
+
documentSecurity: false,
|
|
80
|
+
enabled: true,
|
|
77
81
|
name: '${collectionName}',
|
|
78
82
|
$permissions: [
|
|
79
83
|
{ permission: 'read', target: 'any' },
|