appwrite-cli 6.2.0 → 6.2.3
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 +6 -5
- package/docs/examples/databases/update-float-attribute.md +2 -2
- package/docs/examples/databases/update-integer-attribute.md +2 -2
- package/docs/examples/health/get-queue-stats-resources.md +2 -0
- package/docs/examples/health/get-queue-stats-usage-dump.md +2 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +7 -4
- package/lib/commands/account.js +3 -3
- package/lib/commands/assistant.js +1 -1
- package/lib/commands/avatars.js +2 -2
- package/lib/commands/databases.js +12 -12
- package/lib/commands/functions.js +4 -4
- package/lib/commands/health.js +49 -44
- package/lib/commands/messaging.js +3 -3
- package/lib/commands/migrations.js +18 -18
- package/lib/commands/organizations.js +48 -0
- package/lib/commands/project.js +1 -1
- package/lib/commands/projects.js +46 -46
- package/lib/commands/proxy.js +1 -1
- package/lib/commands/push.js +15 -15
- package/lib/commands/storage.js +2 -2
- package/lib/commands/users.js +1 -1
- package/lib/commands/vcs.js +10 -10
- package/lib/parser.js +1 -1
- package/lib/questions.js +5 -1
- package/lib/utils.js +20 -1
- package/package.json +1 -1
- package/scoop/appwrite.json +3 -3
- package/docs/examples/health/get-queue-usage-dump.md +0 -2
- package/docs/examples/health/get-queue.md +0 -1
package/lib/commands/vcs.js
CHANGED
|
@@ -387,14 +387,14 @@ const vcsDeleteInstallation = async ({installationId,parseOutput = true, overrid
|
|
|
387
387
|
|
|
388
388
|
vcs
|
|
389
389
|
.command(`list-repositories`)
|
|
390
|
-
.description(
|
|
390
|
+
.description(`Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.`)
|
|
391
391
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
392
392
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
393
393
|
.action(actionRunner(vcsListRepositories))
|
|
394
394
|
|
|
395
395
|
vcs
|
|
396
396
|
.command(`create-repository`)
|
|
397
|
-
.description(
|
|
397
|
+
.description(`Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.`)
|
|
398
398
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
399
399
|
.requiredOption(`--name <name>`, `Repository name (slug)`)
|
|
400
400
|
.requiredOption(`--xprivate <xprivate>`, `Mark repository public or private`, parseBool)
|
|
@@ -402,21 +402,21 @@ vcs
|
|
|
402
402
|
|
|
403
403
|
vcs
|
|
404
404
|
.command(`get-repository`)
|
|
405
|
-
.description(
|
|
405
|
+
.description(`Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.`)
|
|
406
406
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
407
407
|
.requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
|
|
408
408
|
.action(actionRunner(vcsGetRepository))
|
|
409
409
|
|
|
410
410
|
vcs
|
|
411
411
|
.command(`list-repository-branches`)
|
|
412
|
-
.description(
|
|
412
|
+
.description(`Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work. `)
|
|
413
413
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
414
414
|
.requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
|
|
415
415
|
.action(actionRunner(vcsListRepositoryBranches))
|
|
416
416
|
|
|
417
417
|
vcs
|
|
418
418
|
.command(`get-repository-contents`)
|
|
419
|
-
.description(
|
|
419
|
+
.description(`Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work. `)
|
|
420
420
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
421
421
|
.requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
|
|
422
422
|
.option(`--provider-root-directory <provider-root-directory>`, `Path to get contents of nested directory`)
|
|
@@ -424,7 +424,7 @@ vcs
|
|
|
424
424
|
|
|
425
425
|
vcs
|
|
426
426
|
.command(`create-repository-detection`)
|
|
427
|
-
.description(
|
|
427
|
+
.description(`Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.`)
|
|
428
428
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
429
429
|
.requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
|
|
430
430
|
.option(`--provider-root-directory <provider-root-directory>`, `Path to Root Directory`)
|
|
@@ -432,7 +432,7 @@ vcs
|
|
|
432
432
|
|
|
433
433
|
vcs
|
|
434
434
|
.command(`update-external-deployments`)
|
|
435
|
-
.description(
|
|
435
|
+
.description(`Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.`)
|
|
436
436
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
437
437
|
.requiredOption(`--repository-id <repository-id>`, `VCS Repository Id`)
|
|
438
438
|
.requiredOption(`--provider-pull-request-id <provider-pull-request-id>`, `GitHub Pull Request Id`)
|
|
@@ -440,20 +440,20 @@ vcs
|
|
|
440
440
|
|
|
441
441
|
vcs
|
|
442
442
|
.command(`list-installations`)
|
|
443
|
-
.description(
|
|
443
|
+
.description(`List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details. `)
|
|
444
444
|
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: provider, organization`)
|
|
445
445
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
446
446
|
.action(actionRunner(vcsListInstallations))
|
|
447
447
|
|
|
448
448
|
vcs
|
|
449
449
|
.command(`get-installation`)
|
|
450
|
-
.description(
|
|
450
|
+
.description(`Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. `)
|
|
451
451
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
452
452
|
.action(actionRunner(vcsGetInstallation))
|
|
453
453
|
|
|
454
454
|
vcs
|
|
455
455
|
.command(`delete-installation`)
|
|
456
|
-
.description(
|
|
456
|
+
.description(`Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.`)
|
|
457
457
|
.requiredOption(`--installation-id <installation-id>`, `Installation Id`)
|
|
458
458
|
.action(actionRunner(vcsDeleteInstallation))
|
|
459
459
|
|
package/lib/parser.js
CHANGED
|
@@ -120,7 +120,7 @@ const parseError = (err) => {
|
|
|
120
120
|
} catch {
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const version = '6.2.
|
|
123
|
+
const version = '6.2.3';
|
|
124
124
|
const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
|
|
125
125
|
const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud}`;
|
|
126
126
|
|
package/lib/questions.js
CHANGED
|
@@ -2,6 +2,7 @@ const chalk = require("chalk");
|
|
|
2
2
|
const Client = require("./client");
|
|
3
3
|
const { localConfig, globalConfig } = require('./config');
|
|
4
4
|
const { projectsList } = require('./commands/projects');
|
|
5
|
+
const { organizationsList } = require('./commands/organizations');
|
|
5
6
|
const { teamsList } = require('./commands/teams');
|
|
6
7
|
const { functionsListRuntimes, functionsListSpecifications, functionsList } = require('./commands/functions');
|
|
7
8
|
const { accountListMfaFactors } = require("./commands/account");
|
|
@@ -152,7 +153,10 @@ const questionsInitProject = [
|
|
|
152
153
|
message: "Choose your organization",
|
|
153
154
|
choices: async () => {
|
|
154
155
|
let client = await sdkForConsole(true);
|
|
155
|
-
const
|
|
156
|
+
const hostname = new URL(client.endpoint).hostname;
|
|
157
|
+
const { teams } = hostname.endsWith('appwrite.io')
|
|
158
|
+
? await paginate(organizationsList, { parseOutput: false, sdk: client }, 100, 'teams')
|
|
159
|
+
: await paginate(teamsList, { parseOutput: false, sdk: client }, 100, 'teams');
|
|
156
160
|
|
|
157
161
|
let choices = teams.map((team, idx) => {
|
|
158
162
|
return {
|
package/lib/utils.js
CHANGED
|
@@ -9,7 +9,13 @@ function getAllFiles(folder) {
|
|
|
9
9
|
const files = [];
|
|
10
10
|
for (const pathDir of fs.readdirSync(folder)) {
|
|
11
11
|
const pathAbsolute = path.join(folder, pathDir);
|
|
12
|
-
|
|
12
|
+
let stats;
|
|
13
|
+
try {
|
|
14
|
+
stats = fs.statSync(pathAbsolute);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (stats.isDirectory()) {
|
|
13
19
|
files.push(...getAllFiles(pathAbsolute));
|
|
14
20
|
} else {
|
|
15
21
|
files.push(pathAbsolute);
|
|
@@ -89,6 +95,9 @@ function showConsoleLink(serviceName, action, ...ids) {
|
|
|
89
95
|
case "teams":
|
|
90
96
|
url.pathname += getTeamsPath(action, ids);
|
|
91
97
|
break;
|
|
98
|
+
case "organizations":
|
|
99
|
+
url.pathname += getOrganizationsPath(action, ids);
|
|
100
|
+
break;
|
|
92
101
|
case "users":
|
|
93
102
|
url.pathname += getUsersPath(action, ids);
|
|
94
103
|
break;
|
|
@@ -241,6 +250,16 @@ function getTeamsPath(action, ids) {
|
|
|
241
250
|
return path;
|
|
242
251
|
}
|
|
243
252
|
|
|
253
|
+
function getOrganizationsPath(action, ids) {
|
|
254
|
+
let path = `/organization-${ids[0]}`;
|
|
255
|
+
|
|
256
|
+
if (action === 'list') {
|
|
257
|
+
path = '/account/organizations';
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return path;
|
|
261
|
+
}
|
|
262
|
+
|
|
244
263
|
function getUsersPath(action, ids) {
|
|
245
264
|
let path = '/auth';
|
|
246
265
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "appwrite-cli",
|
|
3
3
|
"homepage": "https://appwrite.io/support",
|
|
4
4
|
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
|
|
5
|
-
"version": "6.2.
|
|
5
|
+
"version": "6.2.3",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"bin": {
|
package/scoop/appwrite.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.3",
|
|
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/6.2.
|
|
9
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.3/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/6.2.
|
|
18
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.3/appwrite-cli-win-arm64.exe",
|
|
19
19
|
"bin": [
|
|
20
20
|
[
|
|
21
21
|
"appwrite-cli-win-arm64.exe",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
appwrite health getQueue
|