appwrite-cli 15.0.0 → 16.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/CHANGELOG.md +14 -0
- package/README.md +3 -3
- package/cli.ts +2 -0
- package/dist/bundle-win-arm64.mjs +1387 -1087
- package/dist/cli.cjs +1331 -1031
- package/dist/index.cjs +987 -943
- package/dist/index.js +1043 -999
- package/dist/lib/commands/generators/typescript/databases.d.ts +5 -0
- package/dist/lib/commands/generators/typescript/databases.d.ts.map +1 -1
- package/dist/lib/commands/pull.d.ts.map +1 -1
- package/dist/lib/commands/services/functions.d.ts.map +1 -1
- package/dist/lib/commands/services/sites.d.ts.map +1 -1
- package/dist/lib/commands/services/storage.d.ts.map +1 -1
- package/dist/lib/commands/services/webhooks.d.ts +3 -0
- package/dist/lib/commands/services/webhooks.d.ts.map +1 -0
- package/dist/lib/commands/utils/deployment.d.ts +5 -0
- package/dist/lib/commands/utils/deployment.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/parser.d.ts.map +1 -1
- package/docs/examples/webhooks/create.md +7 -0
- package/docs/examples/webhooks/delete.md +4 -0
- package/docs/examples/webhooks/get.md +4 -0
- package/docs/examples/webhooks/list.md +3 -0
- package/docs/examples/webhooks/update-signature.md +4 -0
- package/docs/examples/webhooks/update.md +7 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/commands/generators/typescript/databases.ts +36 -6
- package/lib/commands/pull.ts +30 -12
- package/lib/commands/services/functions.ts +2 -1
- package/lib/commands/services/projects.ts +0 -100
- package/lib/commands/services/sites.ts +2 -1
- package/lib/commands/services/storage.ts +2 -1
- package/lib/commands/services/webhooks.ts +134 -0
- package/lib/commands/utils/deployment.ts +31 -7
- package/lib/constants.ts +1 -1
- package/lib/parser.ts +1 -0
- package/package.json +2 -2
- package/scoop/appwrite.config.json +3 -3
- package/docs/examples/projects/create-webhook.md +0 -8
- package/docs/examples/projects/delete-webhook.md +0 -5
- package/docs/examples/projects/get-webhook.md +0 -5
- package/docs/examples/projects/list-webhooks.md +0 -4
- package/docs/examples/projects/update-webhook-signature.md +0 -5
- package/docs/examples/projects/update-webhook.md +0 -9
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
|
+
import os from "os";
|
|
2
3
|
import path from "path";
|
|
3
4
|
import { create, extract } from "tar";
|
|
4
5
|
import { Client, AppwriteException } from "@appwrite.io/console";
|
|
@@ -21,10 +22,12 @@ interface DeploymentDetails {
|
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Package a directory into a tar.gz File object for deployment
|
|
24
|
-
* @private - Only used internally by pushDeployment
|
|
25
25
|
*/
|
|
26
26
|
async function packageDirectory(dirPath: string): Promise<File> {
|
|
27
|
-
const tempFile =
|
|
27
|
+
const tempFile = path.join(
|
|
28
|
+
os.tmpdir(),
|
|
29
|
+
`appwrite-deploy-${Date.now()}.tar.gz`,
|
|
30
|
+
);
|
|
28
31
|
|
|
29
32
|
await create(
|
|
30
33
|
{
|
|
@@ -35,12 +38,33 @@ async function packageDirectory(dirPath: string): Promise<File> {
|
|
|
35
38
|
["."],
|
|
36
39
|
);
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
try {
|
|
42
|
+
const buffer = fs.readFileSync(tempFile);
|
|
43
|
+
return new File([buffer], path.basename(tempFile), {
|
|
44
|
+
type: "application/gzip",
|
|
45
|
+
});
|
|
46
|
+
} finally {
|
|
47
|
+
if (fs.existsSync(tempFile)) {
|
|
48
|
+
fs.unlinkSync(tempFile);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
40
52
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Resolve a file path (file or directory) into a File object for upload.
|
|
55
|
+
* Directories are packaged into a tar.gz archive.
|
|
56
|
+
*/
|
|
57
|
+
export async function resolveFileParam(filePath: string): Promise<File> {
|
|
58
|
+
const resolved = path.resolve(filePath);
|
|
59
|
+
if (!fs.existsSync(resolved)) {
|
|
60
|
+
throw new Error(`File or directory not found: ${resolved}`);
|
|
61
|
+
}
|
|
62
|
+
const stat = fs.statSync(resolved);
|
|
63
|
+
if (stat.isDirectory()) {
|
|
64
|
+
return packageDirectory(resolved);
|
|
65
|
+
}
|
|
66
|
+
const buffer = fs.readFileSync(resolved);
|
|
67
|
+
return new File([buffer], path.basename(resolved));
|
|
44
68
|
}
|
|
45
69
|
|
|
46
70
|
/**
|
package/lib/constants.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SDK
|
|
2
2
|
export const SDK_TITLE = 'Appwrite';
|
|
3
3
|
export const SDK_TITLE_LOWER = 'appwrite';
|
|
4
|
-
export const SDK_VERSION = '
|
|
4
|
+
export const SDK_VERSION = '16.0.0';
|
|
5
5
|
export const SDK_NAME = 'Command Line';
|
|
6
6
|
export const SDK_PLATFORM = 'console';
|
|
7
7
|
export const SDK_LANGUAGE = 'cli';
|
package/lib/parser.ts
CHANGED
|
@@ -305,6 +305,7 @@ export const commandDescriptions: Record<string, string> = {
|
|
|
305
305
|
messaging: `The messaging command allows you to manage topics and targets and send messages.`,
|
|
306
306
|
migrations: `The migrations command allows you to migrate data between services.`,
|
|
307
307
|
vcs: `The vcs command allows you to interact with VCS providers and manage your code repositories.`,
|
|
308
|
+
webhooks: `The webhooks command allows you to manage your project webhooks.`,
|
|
308
309
|
main: chalk.redBright(`${logo}${description}`),
|
|
309
310
|
};
|
|
310
311
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"homepage": "https://appwrite.io/support",
|
|
5
5
|
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "16.0.0",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
8
8
|
"main": "dist/index.cjs",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@appwrite.io/console": "
|
|
50
|
+
"@appwrite.io/console": "*",
|
|
51
51
|
"chalk": "4.1.2",
|
|
52
52
|
"chokidar": "^3.6.0",
|
|
53
53
|
"cli-progress": "^3.12.0",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
|
|
5
5
|
"homepage": "https://github.com/appwrite/sdk-for-cli",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"architecture": {
|
|
8
8
|
"64bit": {
|
|
9
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/
|
|
9
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/16.0.0/appwrite-cli-win-x64.exe",
|
|
10
10
|
"bin": [
|
|
11
11
|
[
|
|
12
12
|
"appwrite-cli-win-x64.exe",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"arm64": {
|
|
18
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/
|
|
18
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/16.0.0/appwrite-cli-win-arm64.exe",
|
|
19
19
|
"bin": [
|
|
20
20
|
[
|
|
21
21
|
"appwrite-cli-win-arm64.exe",
|