appwrite-ctl 1.0.0
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 +288 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +236 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/lib/appwrite.d.ts +21 -0
- package/dist/lib/appwrite.js +72 -0
- package/dist/lib/cli.d.ts +28 -0
- package/dist/lib/cli.js +136 -0
- package/dist/lib/config.d.ts +12 -0
- package/dist/lib/config.js +48 -0
- package/dist/lib/diagram.d.ts +4 -0
- package/dist/lib/diagram.js +222 -0
- package/dist/lib/runner.d.ts +4 -0
- package/dist/lib/runner.js +183 -0
- package/dist/lib/schema.d.ts +6 -0
- package/dist/lib/schema.js +57 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.js +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Client, Databases } from 'node-appwrite';
|
|
2
|
+
export type { Client, Databases } from 'node-appwrite';
|
|
3
|
+
export type Logger = (msg: string) => void;
|
|
4
|
+
export interface MigrationContext {
|
|
5
|
+
client: Client;
|
|
6
|
+
databases: Databases;
|
|
7
|
+
log: Logger;
|
|
8
|
+
error: Logger;
|
|
9
|
+
}
|
|
10
|
+
export type MigrationFunction = (context: MigrationContext) => Promise<void>;
|
|
11
|
+
export interface Migration {
|
|
12
|
+
id: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
requiresBackup?: boolean;
|
|
15
|
+
up: MigrationFunction;
|
|
16
|
+
down?: MigrationFunction;
|
|
17
|
+
}
|
|
18
|
+
export interface Config {
|
|
19
|
+
collection: string;
|
|
20
|
+
database: string;
|
|
21
|
+
}
|
|
22
|
+
export interface MigrationFile {
|
|
23
|
+
version: string;
|
|
24
|
+
path: string;
|
|
25
|
+
content: Migration;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "appwrite-ctl",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Appwrite infrastructure as code and migration CLI tool.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/bfbechlin/appwrite-ctl.git"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"bin": {
|
|
12
|
+
"appwrite-ctl": "dist/cli/index.js"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"start": "node dist/cli/index.js",
|
|
17
|
+
"dev": "tsx src/cli/index.ts",
|
|
18
|
+
"lint": "eslint . --fix",
|
|
19
|
+
"format": "prettier . --write",
|
|
20
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
21
|
+
"prepare": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"appwrite",
|
|
28
|
+
"migration",
|
|
29
|
+
"cli",
|
|
30
|
+
"schema",
|
|
31
|
+
"iac"
|
|
32
|
+
],
|
|
33
|
+
"author": "Béuren Bechlin <beuren.bechlin@gmail.com>",
|
|
34
|
+
"license": "ISC",
|
|
35
|
+
"type": "module",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"chalk": "^5.6.2",
|
|
38
|
+
"commander": "^14.0.3",
|
|
39
|
+
"dotenv": "^17.3.1",
|
|
40
|
+
"inquirer": "^13.2.2",
|
|
41
|
+
"jiti": "^2.6.1",
|
|
42
|
+
"node-appwrite": "^22.0.0",
|
|
43
|
+
"tsx": "^4.21.0",
|
|
44
|
+
"uuid": "^13.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@eslint/js": "^10.0.1",
|
|
48
|
+
"@types/inquirer": "^9.0.9",
|
|
49
|
+
"@types/node": "^25.2.3",
|
|
50
|
+
"@types/uuid": "^10.0.0",
|
|
51
|
+
"eslint": "^9.14.0",
|
|
52
|
+
"eslint-config-prettier": "^10.1.8",
|
|
53
|
+
"globals": "^17.3.0",
|
|
54
|
+
"prettier": "^3.8.1",
|
|
55
|
+
"typescript": "^5.9.3",
|
|
56
|
+
"typescript-eslint": "^8.55.0"
|
|
57
|
+
}
|
|
58
|
+
}
|