appwrite-cli 17.1.0 → 17.2.1
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/.github/workflows/ci.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/CHANGELOG.md +14 -0
- package/README.md +2 -2
- package/bun.lock +783 -0
- package/cli.ts +14 -2
- package/dist/bundle-win-arm64.mjs +1137 -733
- package/dist/cli.cjs +1137 -733
- package/dist/index.cjs +193 -79
- package/dist/index.js +193 -79
- package/dist/lib/client.d.ts +9 -0
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/commands/init.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/emulation/docker.d.ts.map +1 -1
- package/dist/lib/parser.d.ts.map +1 -1
- package/dist/lib/questions.d.ts.map +1 -1
- package/dist/lib/types.d.ts +2 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +12 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.ts +12 -0
- package/lib/commands/init.ts +109 -2
- package/lib/commands/services/account.ts +110 -55
- package/lib/commands/services/activities.ts +4 -2
- package/lib/commands/services/backups.ts +24 -12
- package/lib/commands/services/databases.ts +150 -75
- package/lib/commands/services/functions.ts +60 -30
- package/lib/commands/services/graphql.ts +4 -2
- package/lib/commands/services/health.ts +46 -23
- package/lib/commands/services/locale.ts +16 -8
- package/lib/commands/services/messaging.ts +96 -48
- package/lib/commands/services/migrations.ts +28 -14
- package/lib/commands/services/organizations.ts +76 -38
- package/lib/commands/services/project.ts +12 -6
- package/lib/commands/services/projects.ts +103 -51
- package/lib/commands/services/proxy.ts +16 -8
- package/lib/commands/services/sites.ts +58 -29
- package/lib/commands/services/storage.ts +30 -15
- package/lib/commands/services/tables-db.ts +148 -74
- package/lib/commands/services/teams.ts +28 -14
- package/lib/commands/services/tokens.ts +10 -5
- package/lib/commands/services/users.ts +88 -44
- package/lib/commands/services/vcs.ts +20 -10
- package/lib/commands/services/webhooks.ts +12 -6
- package/lib/constants.ts +1 -1
- package/lib/emulation/docker.ts +1 -0
- package/lib/parser.ts +279 -122
- package/lib/questions.ts +8 -3
- package/lib/sdks.ts +0 -1
- package/lib/types.ts +2 -0
- package/lib/utils.ts +234 -0
- package/package.json +1 -1
- package/scoop/appwrite.config.json +3 -3
package/lib/commands/init.ts
CHANGED
|
@@ -30,7 +30,13 @@ import {
|
|
|
30
30
|
commandDescriptions,
|
|
31
31
|
} from "../parser.js";
|
|
32
32
|
import { sdkForConsole } from "../sdks.js";
|
|
33
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
isCloud,
|
|
35
|
+
hasSkillsInstalled,
|
|
36
|
+
fetchAvailableSkills,
|
|
37
|
+
detectProjectSkills,
|
|
38
|
+
placeSkills,
|
|
39
|
+
} from "../utils.js";
|
|
34
40
|
import { Account, UseCases, AppwriteException } from "@appwrite.io/console";
|
|
35
41
|
import { DEFAULT_ENDPOINT, EXECUTABLE_NAME } from "../constants.js";
|
|
36
42
|
|
|
@@ -84,6 +90,7 @@ const initResources = async (): Promise<void> => {
|
|
|
84
90
|
const actions: Record<string, InitResourceAction> = {
|
|
85
91
|
function: initFunction,
|
|
86
92
|
site: initSite,
|
|
93
|
+
skill: initSkill,
|
|
87
94
|
table: initTable,
|
|
88
95
|
bucket: initBucket,
|
|
89
96
|
team: initTeam,
|
|
@@ -132,7 +139,8 @@ const initProject = async ({
|
|
|
132
139
|
if (!organizationId && !projectId && !projectName) {
|
|
133
140
|
answers = await inquirer.prompt(questionsInitProject);
|
|
134
141
|
if (answers.override === false) {
|
|
135
|
-
|
|
142
|
+
log("No changes made. Existing project configuration was kept.");
|
|
143
|
+
return;
|
|
136
144
|
}
|
|
137
145
|
} else {
|
|
138
146
|
const selectedOrganization =
|
|
@@ -252,6 +260,30 @@ const initProject = async ({
|
|
|
252
260
|
hint(
|
|
253
261
|
`Next you can use '${EXECUTABLE_NAME} init' to create resources in your project, or use '${EXECUTABLE_NAME} pull' and '${EXECUTABLE_NAME} push' to synchronize your project.`,
|
|
254
262
|
);
|
|
263
|
+
|
|
264
|
+
if (!hasSkillsInstalled(localConfig.configDirectoryPath)) {
|
|
265
|
+
try {
|
|
266
|
+
const skillsCwd = localConfig.configDirectoryPath;
|
|
267
|
+
log("Setting up Appwrite agent skills ...");
|
|
268
|
+
const { skills, tempDir } = fetchAvailableSkills();
|
|
269
|
+
try {
|
|
270
|
+
const detected = detectProjectSkills(skillsCwd, skills);
|
|
271
|
+
if (detected.length > 0) {
|
|
272
|
+
const names = detected.map((s) => s.dirName);
|
|
273
|
+
placeSkills(skillsCwd, tempDir, names, [".agents", ".claude"], true);
|
|
274
|
+
success(
|
|
275
|
+
`Installed ${names.length} agent skill${names.length === 1 ? "" : "s"} based on your project: ${detected.map((s) => s.name).join(", ")}`,
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
} finally {
|
|
279
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
280
|
+
}
|
|
281
|
+
} catch (e) {
|
|
282
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
283
|
+
error(`Failed to install agent skills: ${msg}`);
|
|
284
|
+
hint(`You can install them later with '${EXECUTABLE_NAME} init skill'.`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
255
287
|
};
|
|
256
288
|
|
|
257
289
|
const initBucket = async (): Promise<void> => {
|
|
@@ -368,6 +400,75 @@ const initTopic = async (): Promise<void> => {
|
|
|
368
400
|
);
|
|
369
401
|
};
|
|
370
402
|
|
|
403
|
+
const initSkill = async (): Promise<void> => {
|
|
404
|
+
process.chdir(localConfig.configDirectoryPath);
|
|
405
|
+
const cwd = process.cwd();
|
|
406
|
+
|
|
407
|
+
log("Fetching available Appwrite agent skills ...");
|
|
408
|
+
const { skills, tempDir } = fetchAvailableSkills();
|
|
409
|
+
|
|
410
|
+
try {
|
|
411
|
+
const { selectedSkills } = await inquirer.prompt([
|
|
412
|
+
{
|
|
413
|
+
type: "checkbox",
|
|
414
|
+
name: "selectedSkills",
|
|
415
|
+
message: "Which skills would you like to install?",
|
|
416
|
+
choices: skills.map((skill) => ({
|
|
417
|
+
name: skill.name,
|
|
418
|
+
value: skill.dirName,
|
|
419
|
+
checked: false,
|
|
420
|
+
})),
|
|
421
|
+
validate: (value: string[]) =>
|
|
422
|
+
value.length > 0 || "Please select at least one skill.",
|
|
423
|
+
},
|
|
424
|
+
]);
|
|
425
|
+
|
|
426
|
+
const { selectedAgents } = await inquirer.prompt([
|
|
427
|
+
{
|
|
428
|
+
type: "checkbox",
|
|
429
|
+
name: "selectedAgents",
|
|
430
|
+
message: "Which agent directories would you like to install to?",
|
|
431
|
+
choices: [
|
|
432
|
+
{ name: ".agents", value: ".agents", checked: true },
|
|
433
|
+
{ name: ".claude", value: ".claude", checked: false },
|
|
434
|
+
],
|
|
435
|
+
validate: (value: string[]) =>
|
|
436
|
+
value.length > 0 || "Please select at least one agent directory.",
|
|
437
|
+
},
|
|
438
|
+
]);
|
|
439
|
+
|
|
440
|
+
const { installMethod } = await inquirer.prompt([
|
|
441
|
+
{
|
|
442
|
+
type: "list",
|
|
443
|
+
name: "installMethod",
|
|
444
|
+
message: "How would you like to install the skills?",
|
|
445
|
+
choices: [
|
|
446
|
+
{
|
|
447
|
+
name: "Symlink (recommended) — single source of truth, easy to update",
|
|
448
|
+
value: "symlink",
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: "Copy — independent copies in each agent directory",
|
|
452
|
+
value: "copy",
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
},
|
|
456
|
+
]);
|
|
457
|
+
|
|
458
|
+
const useSymlinks = installMethod === "symlink";
|
|
459
|
+
placeSkills(cwd, tempDir, selectedSkills, selectedAgents, useSymlinks);
|
|
460
|
+
|
|
461
|
+
success(
|
|
462
|
+
`${selectedSkills.length} skill${selectedSkills.length === 1 ? "" : "s"} installed successfully.`,
|
|
463
|
+
);
|
|
464
|
+
hint(
|
|
465
|
+
`Agent skills are automatically discovered by AI coding agents like Claude Code, Cursor, and GitHub Copilot.`,
|
|
466
|
+
);
|
|
467
|
+
} finally {
|
|
468
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
|
|
371
472
|
const initFunction = async (): Promise<void> => {
|
|
372
473
|
process.chdir(localConfig.configDirectoryPath);
|
|
373
474
|
|
|
@@ -770,6 +871,12 @@ init
|
|
|
770
871
|
.description("Init a new Appwrite site")
|
|
771
872
|
.action(actionRunner(initSite));
|
|
772
873
|
|
|
874
|
+
init
|
|
875
|
+
.command("skill")
|
|
876
|
+
.alias("skills")
|
|
877
|
+
.description("Install Appwrite agent skills for AI coding agents")
|
|
878
|
+
.action(actionRunner(initSkill));
|
|
879
|
+
|
|
773
880
|
init
|
|
774
881
|
.command("bucket")
|
|
775
882
|
.alias("buckets")
|
|
@@ -26,7 +26,7 @@ export const account = new Command("account")
|
|
|
26
26
|
helpWidth: process.stdout.columns || 80,
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
account
|
|
29
|
+
const accountGetCommand = account
|
|
30
30
|
.command(`get`)
|
|
31
31
|
.description(`Get the currently logged in user.`)
|
|
32
32
|
.action(
|
|
@@ -35,7 +35,8 @@ account
|
|
|
35
35
|
),
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
const accountCreateCommand = account
|
|
39
40
|
.command(`create`)
|
|
40
41
|
.description(`Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).`)
|
|
41
42
|
.requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
@@ -49,7 +50,8 @@ account
|
|
|
49
50
|
),
|
|
50
51
|
);
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
|
|
54
|
+
const accountDeleteCommand = account
|
|
53
55
|
.command(`delete`)
|
|
54
56
|
.description(`Delete the currently logged in user.`)
|
|
55
57
|
.action(
|
|
@@ -58,7 +60,8 @@ account
|
|
|
58
60
|
),
|
|
59
61
|
);
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
|
|
64
|
+
const accountUpdateEmailCommand = account
|
|
62
65
|
.command(`update-email`)
|
|
63
66
|
.description(`Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
|
|
64
67
|
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
|
@@ -72,7 +75,8 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
72
75
|
),
|
|
73
76
|
);
|
|
74
77
|
|
|
75
|
-
|
|
78
|
+
|
|
79
|
+
const accountListIdentitiesCommand = account
|
|
76
80
|
.command(`list-identities`)
|
|
77
81
|
.description(`Get the list of identities for the currently logged in user.`)
|
|
78
82
|
.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: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`)
|
|
@@ -89,7 +93,8 @@ account
|
|
|
89
93
|
),
|
|
90
94
|
);
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
|
|
97
|
+
const accountDeleteIdentityCommand = account
|
|
93
98
|
.command(`delete-identity`)
|
|
94
99
|
.description(`Delete an identity by its unique ID.`)
|
|
95
100
|
.requiredOption(`--identity-id <identity-id>`, `Identity ID.`)
|
|
@@ -100,7 +105,8 @@ account
|
|
|
100
105
|
),
|
|
101
106
|
);
|
|
102
107
|
|
|
103
|
-
|
|
108
|
+
|
|
109
|
+
const accountCreateJWTCommand = account
|
|
104
110
|
.command(`create-jwt`)
|
|
105
111
|
.description(`Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.`)
|
|
106
112
|
.option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
|
|
@@ -111,7 +117,8 @@ account
|
|
|
111
117
|
),
|
|
112
118
|
);
|
|
113
119
|
|
|
114
|
-
|
|
120
|
+
|
|
121
|
+
const accountListKeysCommand = account
|
|
115
122
|
.command(`list-keys`)
|
|
116
123
|
.description(`Get a list of all API keys from the current account.`)
|
|
117
124
|
.option(
|
|
@@ -127,7 +134,8 @@ account
|
|
|
127
134
|
),
|
|
128
135
|
);
|
|
129
136
|
|
|
130
|
-
|
|
137
|
+
|
|
138
|
+
const accountCreateKeyCommand = account
|
|
131
139
|
.command(`create-key`)
|
|
132
140
|
.description(`Create a new account API key.`)
|
|
133
141
|
.requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
|
|
@@ -140,7 +148,8 @@ account
|
|
|
140
148
|
),
|
|
141
149
|
);
|
|
142
150
|
|
|
143
|
-
|
|
151
|
+
|
|
152
|
+
const accountGetKeyCommand = account
|
|
144
153
|
.command(`get-key`)
|
|
145
154
|
.description(`Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes.`)
|
|
146
155
|
.requiredOption(`--key-id <key-id>`, `Key unique ID.`)
|
|
@@ -151,7 +160,8 @@ account
|
|
|
151
160
|
),
|
|
152
161
|
);
|
|
153
162
|
|
|
154
|
-
|
|
163
|
+
|
|
164
|
+
const accountUpdateKeyCommand = account
|
|
155
165
|
.command(`update-key`)
|
|
156
166
|
.description(`Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.`)
|
|
157
167
|
.requiredOption(`--key-id <key-id>`, `Key unique ID.`)
|
|
@@ -165,7 +175,8 @@ account
|
|
|
165
175
|
),
|
|
166
176
|
);
|
|
167
177
|
|
|
168
|
-
|
|
178
|
+
|
|
179
|
+
const accountDeleteKeyCommand = account
|
|
169
180
|
.command(`delete-key`)
|
|
170
181
|
.description(`Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.`)
|
|
171
182
|
.requiredOption(`--key-id <key-id>`, `Key unique ID.`)
|
|
@@ -176,7 +187,8 @@ account
|
|
|
176
187
|
),
|
|
177
188
|
);
|
|
178
189
|
|
|
179
|
-
|
|
190
|
+
|
|
191
|
+
const accountListLogsCommand = account
|
|
180
192
|
.command(`list-logs`)
|
|
181
193
|
.description(`Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.`)
|
|
182
194
|
.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). Only supported methods are limit and offset`)
|
|
@@ -193,7 +205,8 @@ account
|
|
|
193
205
|
),
|
|
194
206
|
);
|
|
195
207
|
|
|
196
|
-
|
|
208
|
+
|
|
209
|
+
const accountUpdateMFACommand = account
|
|
197
210
|
.command(`update-mfa`)
|
|
198
211
|
.description(`Enable or disable MFA on an account.`)
|
|
199
212
|
.requiredOption(`--mfa <mfa>`, `Enable or disable MFA.`, parseBool)
|
|
@@ -204,7 +217,8 @@ account
|
|
|
204
217
|
),
|
|
205
218
|
);
|
|
206
219
|
|
|
207
|
-
|
|
220
|
+
|
|
221
|
+
const accountCreateMfaAuthenticatorCommand = account
|
|
208
222
|
.command(`create-mfa-authenticator`)
|
|
209
223
|
.description(`Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.`)
|
|
210
224
|
.requiredOption(`--type <type>`, `Type of authenticator. Must be \`totp\``)
|
|
@@ -215,7 +229,8 @@ account
|
|
|
215
229
|
),
|
|
216
230
|
);
|
|
217
231
|
|
|
218
|
-
|
|
232
|
+
|
|
233
|
+
const accountUpdateMfaAuthenticatorCommand = account
|
|
219
234
|
.command(`update-mfa-authenticator`)
|
|
220
235
|
.description(`Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.`)
|
|
221
236
|
.requiredOption(`--type <type>`, `Type of authenticator.`)
|
|
@@ -227,7 +242,8 @@ account
|
|
|
227
242
|
),
|
|
228
243
|
);
|
|
229
244
|
|
|
230
|
-
|
|
245
|
+
|
|
246
|
+
const accountDeleteMfaAuthenticatorCommand = account
|
|
231
247
|
.command(`delete-mfa-authenticator`)
|
|
232
248
|
.description(`Delete an authenticator for a user by ID.`)
|
|
233
249
|
.requiredOption(`--type <type>`, `Type of authenticator.`)
|
|
@@ -238,7 +254,8 @@ account
|
|
|
238
254
|
),
|
|
239
255
|
);
|
|
240
256
|
|
|
241
|
-
|
|
257
|
+
|
|
258
|
+
const accountCreateMfaChallengeCommand = account
|
|
242
259
|
.command(`create-mfa-challenge`)
|
|
243
260
|
.description(`Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.`)
|
|
244
261
|
.requiredOption(`--factor <factor>`, `Factor used for verification. Must be one of following: \`email\`, \`phone\`, \`totp\`, \`recoveryCode\`.`)
|
|
@@ -249,7 +266,8 @@ account
|
|
|
249
266
|
),
|
|
250
267
|
);
|
|
251
268
|
|
|
252
|
-
|
|
269
|
+
|
|
270
|
+
const accountUpdateMfaChallengeCommand = account
|
|
253
271
|
.command(`update-mfa-challenge`)
|
|
254
272
|
.description(`Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.`)
|
|
255
273
|
.requiredOption(`--challenge-id <challenge-id>`, `ID of the challenge.`)
|
|
@@ -261,7 +279,8 @@ account
|
|
|
261
279
|
),
|
|
262
280
|
);
|
|
263
281
|
|
|
264
|
-
|
|
282
|
+
|
|
283
|
+
const accountListMfaFactorsCommand = account
|
|
265
284
|
.command(`list-mfa-factors`)
|
|
266
285
|
.description(`List the factors available on the account to be used as a MFA challange.`)
|
|
267
286
|
.action(
|
|
@@ -270,7 +289,8 @@ account
|
|
|
270
289
|
),
|
|
271
290
|
);
|
|
272
291
|
|
|
273
|
-
|
|
292
|
+
|
|
293
|
+
const accountGetMfaRecoveryCodesCommand = account
|
|
274
294
|
.command(`get-mfa-recovery-codes`)
|
|
275
295
|
.description(`Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.`)
|
|
276
296
|
.action(
|
|
@@ -279,7 +299,8 @@ account
|
|
|
279
299
|
),
|
|
280
300
|
);
|
|
281
301
|
|
|
282
|
-
|
|
302
|
+
|
|
303
|
+
const accountCreateMfaRecoveryCodesCommand = account
|
|
283
304
|
.command(`create-mfa-recovery-codes`)
|
|
284
305
|
.description(`Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.`)
|
|
285
306
|
.action(
|
|
@@ -288,7 +309,8 @@ account
|
|
|
288
309
|
),
|
|
289
310
|
);
|
|
290
311
|
|
|
291
|
-
|
|
312
|
+
|
|
313
|
+
const accountUpdateMfaRecoveryCodesCommand = account
|
|
292
314
|
.command(`update-mfa-recovery-codes`)
|
|
293
315
|
.description(`Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.`)
|
|
294
316
|
.action(
|
|
@@ -297,7 +319,8 @@ account
|
|
|
297
319
|
),
|
|
298
320
|
);
|
|
299
321
|
|
|
300
|
-
|
|
322
|
+
|
|
323
|
+
const accountUpdateNameCommand = account
|
|
301
324
|
.command(`update-name`)
|
|
302
325
|
.description(`Update currently logged in user account name.`)
|
|
303
326
|
.requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
@@ -308,7 +331,8 @@ account
|
|
|
308
331
|
),
|
|
309
332
|
);
|
|
310
333
|
|
|
311
|
-
|
|
334
|
+
|
|
335
|
+
const accountUpdatePasswordCommand = account
|
|
312
336
|
.command(`update-password`)
|
|
313
337
|
.description(`Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.`)
|
|
314
338
|
.requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
|
|
@@ -320,7 +344,8 @@ account
|
|
|
320
344
|
),
|
|
321
345
|
);
|
|
322
346
|
|
|
323
|
-
|
|
347
|
+
|
|
348
|
+
const accountUpdatePhoneCommand = account
|
|
324
349
|
.command(`update-phone`)
|
|
325
350
|
.description(`Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.`)
|
|
326
351
|
.requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
@@ -332,7 +357,8 @@ account
|
|
|
332
357
|
),
|
|
333
358
|
);
|
|
334
359
|
|
|
335
|
-
|
|
360
|
+
|
|
361
|
+
const accountGetPrefsCommand = account
|
|
336
362
|
.command(`get-prefs`)
|
|
337
363
|
.description(`Get the preferences as a key-value object for the currently logged in user.`)
|
|
338
364
|
.action(
|
|
@@ -341,7 +367,8 @@ account
|
|
|
341
367
|
),
|
|
342
368
|
);
|
|
343
369
|
|
|
344
|
-
|
|
370
|
+
|
|
371
|
+
const accountUpdatePrefsCommand = account
|
|
345
372
|
.command(`update-prefs`)
|
|
346
373
|
.description(`Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.`)
|
|
347
374
|
.requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
|
|
@@ -352,7 +379,8 @@ account
|
|
|
352
379
|
),
|
|
353
380
|
);
|
|
354
381
|
|
|
355
|
-
|
|
382
|
+
|
|
383
|
+
const accountCreateRecoveryCommand = account
|
|
356
384
|
.command(`create-recovery`)
|
|
357
385
|
.description(`Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.`)
|
|
358
386
|
.requiredOption(`--email <email>`, `User email.`)
|
|
@@ -364,7 +392,8 @@ account
|
|
|
364
392
|
),
|
|
365
393
|
);
|
|
366
394
|
|
|
367
|
-
|
|
395
|
+
|
|
396
|
+
const accountUpdateRecoveryCommand = account
|
|
368
397
|
.command(`update-recovery`)
|
|
369
398
|
.description(`Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.
|
|
370
399
|
|
|
@@ -379,7 +408,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
379
408
|
),
|
|
380
409
|
);
|
|
381
410
|
|
|
382
|
-
|
|
411
|
+
|
|
412
|
+
const accountListSessionsCommand = account
|
|
383
413
|
.command(`list-sessions`)
|
|
384
414
|
.description(`Get the list of active sessions across different devices for the currently logged in user.`)
|
|
385
415
|
.action(
|
|
@@ -388,7 +418,8 @@ account
|
|
|
388
418
|
),
|
|
389
419
|
);
|
|
390
420
|
|
|
391
|
-
|
|
421
|
+
|
|
422
|
+
const accountDeleteSessionsCommand = account
|
|
392
423
|
.command(`delete-sessions`)
|
|
393
424
|
.description(`Delete all sessions from the user account and remove any sessions cookies from the end client.`)
|
|
394
425
|
.action(
|
|
@@ -397,7 +428,8 @@ account
|
|
|
397
428
|
),
|
|
398
429
|
);
|
|
399
430
|
|
|
400
|
-
|
|
431
|
+
|
|
432
|
+
const accountCreateAnonymousSessionCommand = account
|
|
401
433
|
.command(`create-anonymous-session`)
|
|
402
434
|
.description(`Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).`)
|
|
403
435
|
.action(
|
|
@@ -406,7 +438,8 @@ account
|
|
|
406
438
|
),
|
|
407
439
|
);
|
|
408
440
|
|
|
409
|
-
|
|
441
|
+
|
|
442
|
+
const accountCreateEmailPasswordSessionCommand = account
|
|
410
443
|
.command(`create-email-password-session`)
|
|
411
444
|
.description(`Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.
|
|
412
445
|
|
|
@@ -420,7 +453,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
420
453
|
),
|
|
421
454
|
);
|
|
422
455
|
|
|
423
|
-
|
|
456
|
+
|
|
457
|
+
const accountUpdateMagicURLSessionCommand = account
|
|
424
458
|
.command(`update-magic-url-session`)
|
|
425
459
|
.description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
|
|
426
460
|
.requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
@@ -432,7 +466,8 @@ account
|
|
|
432
466
|
),
|
|
433
467
|
);
|
|
434
468
|
|
|
435
|
-
|
|
469
|
+
|
|
470
|
+
const accountCreateOAuth2SessionCommand = account
|
|
436
471
|
.command(`create-o-auth-2-session`)
|
|
437
472
|
.description(`Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
|
|
438
473
|
|
|
@@ -453,7 +488,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
453
488
|
),
|
|
454
489
|
);
|
|
455
490
|
|
|
456
|
-
|
|
491
|
+
|
|
492
|
+
const accountUpdatePhoneSessionCommand = account
|
|
457
493
|
.command(`update-phone-session`)
|
|
458
494
|
.description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
|
|
459
495
|
.requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
@@ -465,7 +501,8 @@ account
|
|
|
465
501
|
),
|
|
466
502
|
);
|
|
467
503
|
|
|
468
|
-
|
|
504
|
+
|
|
505
|
+
const accountCreateSessionCommand = account
|
|
469
506
|
.command(`create-session`)
|
|
470
507
|
.description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
|
|
471
508
|
.requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
@@ -477,7 +514,8 @@ account
|
|
|
477
514
|
),
|
|
478
515
|
);
|
|
479
516
|
|
|
480
|
-
|
|
517
|
+
|
|
518
|
+
const accountGetSessionCommand = account
|
|
481
519
|
.command(`get-session`)
|
|
482
520
|
.description(`Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.`)
|
|
483
521
|
.requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to get the current device session.`)
|
|
@@ -488,7 +526,8 @@ account
|
|
|
488
526
|
),
|
|
489
527
|
);
|
|
490
528
|
|
|
491
|
-
|
|
529
|
+
|
|
530
|
+
const accountUpdateSessionCommand = account
|
|
492
531
|
.command(`update-session`)
|
|
493
532
|
.description(`Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.`)
|
|
494
533
|
.requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to update the current device session.`)
|
|
@@ -499,7 +538,8 @@ account
|
|
|
499
538
|
),
|
|
500
539
|
);
|
|
501
540
|
|
|
502
|
-
|
|
541
|
+
|
|
542
|
+
const accountDeleteSessionCommand = account
|
|
503
543
|
.command(`delete-session`)
|
|
504
544
|
.description(`Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.`)
|
|
505
545
|
.requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to delete the current device session.`)
|
|
@@ -510,7 +550,8 @@ account
|
|
|
510
550
|
),
|
|
511
551
|
);
|
|
512
552
|
|
|
513
|
-
|
|
553
|
+
|
|
554
|
+
const accountUpdateStatusCommand = account
|
|
514
555
|
.command(`update-status`)
|
|
515
556
|
.description(`Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.`)
|
|
516
557
|
.action(
|
|
@@ -519,7 +560,8 @@ account
|
|
|
519
560
|
),
|
|
520
561
|
);
|
|
521
562
|
|
|
522
|
-
|
|
563
|
+
|
|
564
|
+
const accountCreatePushTargetCommand = account
|
|
523
565
|
.command(`create-push-target`)
|
|
524
566
|
.description(`Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.`)
|
|
525
567
|
.requiredOption(`--target-id <target-id>`, `Target ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
@@ -532,7 +574,8 @@ account
|
|
|
532
574
|
),
|
|
533
575
|
);
|
|
534
576
|
|
|
535
|
-
|
|
577
|
+
|
|
578
|
+
const accountUpdatePushTargetCommand = account
|
|
536
579
|
.command(`update-push-target`)
|
|
537
580
|
.description(`Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.`)
|
|
538
581
|
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
@@ -544,7 +587,8 @@ account
|
|
|
544
587
|
),
|
|
545
588
|
);
|
|
546
589
|
|
|
547
|
-
|
|
590
|
+
|
|
591
|
+
const accountDeletePushTargetCommand = account
|
|
548
592
|
.command(`delete-push-target`)
|
|
549
593
|
.description(`Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.`)
|
|
550
594
|
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
@@ -555,7 +599,8 @@ account
|
|
|
555
599
|
),
|
|
556
600
|
);
|
|
557
601
|
|
|
558
|
-
|
|
602
|
+
|
|
603
|
+
const accountCreateEmailTokenCommand = account
|
|
559
604
|
.command(`create-email-token`)
|
|
560
605
|
.description(`Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided \`userId\`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
|
|
561
606
|
|
|
@@ -576,7 +621,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
576
621
|
),
|
|
577
622
|
);
|
|
578
623
|
|
|
579
|
-
|
|
624
|
+
|
|
625
|
+
const accountCreateMagicURLTokenCommand = account
|
|
580
626
|
.command(`create-magic-url-token`)
|
|
581
627
|
.description(`Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
|
|
582
628
|
|
|
@@ -598,7 +644,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
598
644
|
),
|
|
599
645
|
);
|
|
600
646
|
|
|
601
|
-
|
|
647
|
+
|
|
648
|
+
const accountCreateOAuth2TokenCommand = account
|
|
602
649
|
.command(`create-o-auth-2-token`)
|
|
603
650
|
.description(`Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
|
|
604
651
|
|
|
@@ -618,7 +665,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
618
665
|
),
|
|
619
666
|
);
|
|
620
667
|
|
|
621
|
-
|
|
668
|
+
|
|
669
|
+
const accountCreatePhoneTokenCommand = account
|
|
622
670
|
.command(`create-phone-token`)
|
|
623
671
|
.description(`Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
|
|
624
672
|
|
|
@@ -632,7 +680,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
632
680
|
),
|
|
633
681
|
);
|
|
634
682
|
|
|
635
|
-
|
|
683
|
+
|
|
684
|
+
const accountCreateEmailVerificationCommand = account
|
|
636
685
|
.command(`create-email-verification`)
|
|
637
686
|
.description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
|
|
638
687
|
|
|
@@ -646,7 +695,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
646
695
|
),
|
|
647
696
|
);
|
|
648
697
|
|
|
649
|
-
|
|
698
|
+
|
|
699
|
+
const accountCreateVerificationCommand = account
|
|
650
700
|
.command(`create-verification`)
|
|
651
701
|
.description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
|
|
652
702
|
|
|
@@ -660,7 +710,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
660
710
|
),
|
|
661
711
|
);
|
|
662
712
|
|
|
663
|
-
|
|
713
|
+
|
|
714
|
+
const accountUpdateEmailVerificationCommand = account
|
|
664
715
|
.command(`update-email-verification`)
|
|
665
716
|
.description(`Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.`)
|
|
666
717
|
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
@@ -672,7 +723,8 @@ account
|
|
|
672
723
|
),
|
|
673
724
|
);
|
|
674
725
|
|
|
675
|
-
|
|
726
|
+
|
|
727
|
+
const accountUpdateVerificationCommand = account
|
|
676
728
|
.command(`update-verification`)
|
|
677
729
|
.description(`Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.`)
|
|
678
730
|
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
@@ -684,7 +736,8 @@ account
|
|
|
684
736
|
),
|
|
685
737
|
);
|
|
686
738
|
|
|
687
|
-
|
|
739
|
+
|
|
740
|
+
const accountCreatePhoneVerificationCommand = account
|
|
688
741
|
.command(`create-phone-verification`)
|
|
689
742
|
.description(`Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.`)
|
|
690
743
|
.action(
|
|
@@ -693,7 +746,8 @@ account
|
|
|
693
746
|
),
|
|
694
747
|
);
|
|
695
748
|
|
|
696
|
-
|
|
749
|
+
|
|
750
|
+
const accountUpdatePhoneVerificationCommand = account
|
|
697
751
|
.command(`update-phone-verification`)
|
|
698
752
|
.description(`Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.`)
|
|
699
753
|
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
@@ -705,3 +759,4 @@ account
|
|
|
705
759
|
),
|
|
706
760
|
);
|
|
707
761
|
|
|
762
|
+
|