appwrite-utils-cli 0.0.284 → 0.0.286
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.
@@ -60,10 +60,8 @@ export class AppwriteToX {
|
|
60
60
|
for (const collection of collections) {
|
61
61
|
console.log(`Processing collection: ${collection.name}`);
|
62
62
|
const existingCollectionIndex = updatedConfig.collections.findIndex((c) => c.name === collection.name);
|
63
|
-
console.log(`Parsing permissions...`);
|
64
63
|
// Parse the collection permissions and attributes
|
65
64
|
const collPermissions = this.parsePermissionsArray(collection.$permissions);
|
66
|
-
console.log(`Parsing attributes...`, collection.attributes);
|
67
65
|
const collAttributes = collection.attributes
|
68
66
|
.map((attr) => {
|
69
67
|
return parseAttribute(attr);
|
@@ -95,7 +93,6 @@ export class AppwriteToX {
|
|
95
93
|
}),
|
96
94
|
};
|
97
95
|
});
|
98
|
-
console.log(`Parsing indexes...`, finalIndexes);
|
99
96
|
const collIndexes = indexesSchema.parse(finalIndexes) ?? [];
|
100
97
|
// Prepare the collection object to be added or updated
|
101
98
|
const collToPush = CollectionSchema.parse({
|
@@ -17,7 +17,7 @@ export class SchemaGenerator {
|
|
17
17
|
const collections = this.config.collections;
|
18
18
|
delete this.config.collections;
|
19
19
|
const configPath = path.join(this.appwriteFolderPath, "appwriteConfig.ts");
|
20
|
-
const configContent = `import { AppwriteConfig } from "appwrite-utils";
|
20
|
+
const configContent = `import { type AppwriteConfig } from "appwrite-utils";
|
21
21
|
|
22
22
|
const appwriteConfig: AppwriteConfig = {
|
23
23
|
appwriteEndpoint: "${this.config.appwriteEndpoint}",
|
@@ -45,7 +45,7 @@ export class SchemaGenerator {
|
|
45
45
|
collections?.forEach((collection) => {
|
46
46
|
const { databaseId, ...collectionWithoutDbId } = collection; // Destructure to exclude databaseId
|
47
47
|
const collectionFilePath = path.join(collectionsFolderPath, `${collection.name}.ts`);
|
48
|
-
const collectionContent = `import { CollectionCreate } from "appwrite-utils";
|
48
|
+
const collectionContent = `import { type CollectionCreate } from "appwrite-utils";
|
49
49
|
|
50
50
|
const ${collection.name}Config: Partial<CollectionCreate> = {
|
51
51
|
name: "${collection.name}",
|
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.286",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
@@ -83,13 +83,10 @@ export class AppwriteToX {
|
|
83
83
|
const existingCollectionIndex = updatedConfig.collections.findIndex(
|
84
84
|
(c) => c.name === collection.name
|
85
85
|
);
|
86
|
-
|
87
|
-
console.log(`Parsing permissions...`);
|
88
86
|
// Parse the collection permissions and attributes
|
89
87
|
const collPermissions = this.parsePermissionsArray(
|
90
88
|
collection.$permissions
|
91
89
|
);
|
92
|
-
console.log(`Parsing attributes...`, collection.attributes);
|
93
90
|
const collAttributes = collection.attributes
|
94
91
|
.map((attr: any) => {
|
95
92
|
return parseAttribute(attr);
|
@@ -133,7 +130,6 @@ export class AppwriteToX {
|
|
133
130
|
}),
|
134
131
|
};
|
135
132
|
});
|
136
|
-
console.log(`Parsing indexes...`, finalIndexes);
|
137
133
|
const collIndexes = indexesSchema.parse(finalIndexes) ?? [];
|
138
134
|
|
139
135
|
// Prepare the collection object to be added or updated
|
@@ -35,7 +35,7 @@ export class SchemaGenerator {
|
|
35
35
|
delete this.config.collections;
|
36
36
|
|
37
37
|
const configPath = path.join(this.appwriteFolderPath, "appwriteConfig.ts");
|
38
|
-
const configContent = `import { AppwriteConfig } from "appwrite-utils";
|
38
|
+
const configContent = `import { type AppwriteConfig } from "appwrite-utils";
|
39
39
|
|
40
40
|
const appwriteConfig: AppwriteConfig = {
|
41
41
|
appwriteEndpoint: "${this.config.appwriteEndpoint}",
|
@@ -71,7 +71,7 @@ export class SchemaGenerator {
|
|
71
71
|
collectionsFolderPath,
|
72
72
|
`${collection.name}.ts`
|
73
73
|
);
|
74
|
-
const collectionContent = `import { CollectionCreate } from "appwrite-utils";
|
74
|
+
const collectionContent = `import { type CollectionCreate } from "appwrite-utils";
|
75
75
|
|
76
76
|
const ${collection.name}Config: Partial<CollectionCreate> = {
|
77
77
|
name: "${collection.name}",
|