appwrite-cli 6.0.0 → 6.2.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/.github/workflows/npm-publish.yml +2 -1
- package/LICENSE.md +1 -1
- package/README.md +3 -3
- package/docs/examples/databases/update-boolean-attribute.md +2 -1
- package/docs/examples/databases/update-datetime-attribute.md +2 -1
- package/docs/examples/databases/update-email-attribute.md +2 -1
- package/docs/examples/databases/update-enum-attribute.md +2 -1
- package/docs/examples/databases/update-float-attribute.md +2 -1
- package/docs/examples/databases/update-integer-attribute.md +2 -1
- package/docs/examples/databases/update-ip-attribute.md +2 -1
- package/docs/examples/databases/update-relationship-attribute.md +1 -0
- package/docs/examples/databases/update-string-attribute.md +3 -1
- package/docs/examples/databases/update-url-attribute.md +2 -1
- package/docs/examples/messaging/create-push.md +5 -2
- package/docs/examples/messaging/update-push.md +3 -0
- package/docs/examples/projects/update-memberships-privacy.md +5 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +2 -2
- package/lib/commands/account.js +1 -1
- package/lib/commands/databases.js +65 -10
- package/lib/commands/generic.js +1 -1
- package/lib/commands/init.js +1 -0
- package/lib/commands/messaging.js +40 -10
- package/lib/commands/migrations.js +2 -167
- package/lib/commands/projects.js +53 -0
- package/lib/commands/push.js +3 -0
- package/lib/commands/run.js +4 -4
- package/lib/commands/teams.js +2 -2
- package/lib/config.js +5 -1
- package/lib/emulation/docker.js +6 -6
- package/lib/emulation/utils.js +13 -13
- package/lib/parser.js +1 -1
- package/lib/questions.js +21 -2
- package/package.json +1 -1
- package/scoop/appwrite.json +3 -3
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +0 -3
- package/docs/examples/migrations/delete-firebase-auth.md +0 -1
- package/docs/examples/migrations/get-firebase-report-o-auth.md +0 -3
- package/docs/examples/migrations/list-firebase-projects.md +0 -1
|
@@ -254,16 +254,19 @@ const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,cont
|
|
|
254
254
|
* @property {string[]} topics List of Topic IDs.
|
|
255
255
|
* @property {string[]} users List of User IDs.
|
|
256
256
|
* @property {string[]} targets List of Targets IDs.
|
|
257
|
-
* @property {object} data Additional
|
|
257
|
+
* @property {object} data Additional key-value pair data for push notification.
|
|
258
258
|
* @property {string} action Action for push notification.
|
|
259
259
|
* @property {string} image Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
260
260
|
* @property {string} icon Icon for push notification. Available only for Android and Web Platform.
|
|
261
|
-
* @property {string} sound Sound for push notification. Available only for Android and
|
|
261
|
+
* @property {string} sound Sound for push notification. Available only for Android and iOS Platform.
|
|
262
262
|
* @property {string} color Color for push notification. Available only for Android Platform.
|
|
263
263
|
* @property {string} tag Tag for push notification. Available only for Android Platform.
|
|
264
|
-
* @property {
|
|
264
|
+
* @property {number} badge Badge for push notification. Available only for iOS Platform.
|
|
265
265
|
* @property {boolean} draft Is message a draft
|
|
266
266
|
* @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
267
|
+
* @property {boolean} contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
268
|
+
* @property {boolean} critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
|
|
269
|
+
* @property {MessagePriority} priority Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
|
|
267
270
|
* @property {boolean} overrideForCli
|
|
268
271
|
* @property {boolean} parseOutput
|
|
269
272
|
* @property {libClient | undefined} sdk
|
|
@@ -272,7 +275,7 @@ const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,cont
|
|
|
272
275
|
/**
|
|
273
276
|
* @param {MessagingCreatePushRequestParams} params
|
|
274
277
|
*/
|
|
275
|
-
const messagingCreatePush = async ({messageId,title,body,topics,users,targets,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
278
|
+
const messagingCreatePush = async ({messageId,title,body,topics,users,targets,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,contentAvailable,critical,priority,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
276
279
|
let client = !sdk ? await sdkForProject() :
|
|
277
280
|
sdk;
|
|
278
281
|
let apiPath = '/messaging/messages/push';
|
|
@@ -328,6 +331,15 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
|
|
|
328
331
|
if (typeof scheduledAt !== 'undefined') {
|
|
329
332
|
payload['scheduledAt'] = scheduledAt;
|
|
330
333
|
}
|
|
334
|
+
if (typeof contentAvailable !== 'undefined') {
|
|
335
|
+
payload['contentAvailable'] = contentAvailable;
|
|
336
|
+
}
|
|
337
|
+
if (typeof critical !== 'undefined') {
|
|
338
|
+
payload['critical'] = critical;
|
|
339
|
+
}
|
|
340
|
+
if (typeof priority !== 'undefined') {
|
|
341
|
+
payload['priority'] = priority;
|
|
342
|
+
}
|
|
331
343
|
|
|
332
344
|
let response = undefined;
|
|
333
345
|
|
|
@@ -361,6 +373,9 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
|
|
|
361
373
|
* @property {number} badge Badge for push notification. Available only for iOS platforms.
|
|
362
374
|
* @property {boolean} draft Is message a draft
|
|
363
375
|
* @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
376
|
+
* @property {boolean} contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
377
|
+
* @property {boolean} critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
|
|
378
|
+
* @property {MessagePriority} priority Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
|
|
364
379
|
* @property {boolean} overrideForCli
|
|
365
380
|
* @property {boolean} parseOutput
|
|
366
381
|
* @property {libClient | undefined} sdk
|
|
@@ -369,7 +384,7 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
|
|
|
369
384
|
/**
|
|
370
385
|
* @param {MessagingUpdatePushRequestParams} params
|
|
371
386
|
*/
|
|
372
|
-
const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
387
|
+
const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,contentAvailable,critical,priority,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
373
388
|
let client = !sdk ? await sdkForProject() :
|
|
374
389
|
sdk;
|
|
375
390
|
let apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
|
|
@@ -422,6 +437,15 @@ const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,da
|
|
|
422
437
|
if (typeof scheduledAt !== 'undefined') {
|
|
423
438
|
payload['scheduledAt'] = scheduledAt;
|
|
424
439
|
}
|
|
440
|
+
if (typeof contentAvailable !== 'undefined') {
|
|
441
|
+
payload['contentAvailable'] = contentAvailable;
|
|
442
|
+
}
|
|
443
|
+
if (typeof critical !== 'undefined') {
|
|
444
|
+
payload['critical'] = critical;
|
|
445
|
+
}
|
|
446
|
+
if (typeof priority !== 'undefined') {
|
|
447
|
+
payload['priority'] = priority;
|
|
448
|
+
}
|
|
425
449
|
|
|
426
450
|
let response = undefined;
|
|
427
451
|
|
|
@@ -2454,21 +2478,24 @@ messaging
|
|
|
2454
2478
|
.command(`create-push`)
|
|
2455
2479
|
.description(`Create a new push notification.`)
|
|
2456
2480
|
.requiredOption(`--message-id <message-id>`, `Message 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.`)
|
|
2457
|
-
.
|
|
2458
|
-
.
|
|
2481
|
+
.option(`--title <title>`, `Title for push notification.`)
|
|
2482
|
+
.option(`--body <body>`, `Body for push notification.`)
|
|
2459
2483
|
.option(`--topics [topics...]`, `List of Topic IDs.`)
|
|
2460
2484
|
.option(`--users [users...]`, `List of User IDs.`)
|
|
2461
2485
|
.option(`--targets [targets...]`, `List of Targets IDs.`)
|
|
2462
|
-
.option(`--data <data>`, `Additional
|
|
2486
|
+
.option(`--data <data>`, `Additional key-value pair data for push notification.`)
|
|
2463
2487
|
.option(`--action <action>`, `Action for push notification.`)
|
|
2464
2488
|
.option(`--image <image>`, `Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.`)
|
|
2465
2489
|
.option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web Platform.`)
|
|
2466
|
-
.option(`--sound <sound>`, `Sound for push notification. Available only for Android and
|
|
2490
|
+
.option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS Platform.`)
|
|
2467
2491
|
.option(`--color <color>`, `Color for push notification. Available only for Android Platform.`)
|
|
2468
2492
|
.option(`--tag <tag>`, `Tag for push notification. Available only for Android Platform.`)
|
|
2469
|
-
.option(`--badge <badge>`, `Badge for push notification. Available only for
|
|
2493
|
+
.option(`--badge <badge>`, `Badge for push notification. Available only for iOS Platform.`, parseInteger)
|
|
2470
2494
|
.option(`--draft <draft>`, `Is message a draft`, parseBool)
|
|
2471
2495
|
.option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
|
|
2496
|
+
.option(`--content-available <content-available>`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, parseBool)
|
|
2497
|
+
.option(`--critical <critical>`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, parseBool)
|
|
2498
|
+
.option(`--priority <priority>`, `Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.`)
|
|
2472
2499
|
.action(actionRunner(messagingCreatePush))
|
|
2473
2500
|
|
|
2474
2501
|
messaging
|
|
@@ -2490,6 +2517,9 @@ messaging
|
|
|
2490
2517
|
.option(`--badge <badge>`, `Badge for push notification. Available only for iOS platforms.`, parseInteger)
|
|
2491
2518
|
.option(`--draft <draft>`, `Is message a draft`, parseBool)
|
|
2492
2519
|
.option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
|
|
2520
|
+
.option(`--content-available <content-available>`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, parseBool)
|
|
2521
|
+
.option(`--critical <critical>`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, parseBool)
|
|
2522
|
+
.option(`--priority <priority>`, `Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.`)
|
|
2493
2523
|
.action(actionRunner(messagingUpdatePush))
|
|
2494
2524
|
|
|
2495
2525
|
messaging
|
|
@@ -41,7 +41,7 @@ const migrations = new Command("migrations").description(commandDescriptions['mi
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {Object} MigrationsListRequestParams
|
|
44
|
-
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors
|
|
44
|
+
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors
|
|
45
45
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
46
46
|
* @property {boolean} overrideForCli
|
|
47
47
|
* @property {boolean} parseOutput
|
|
@@ -209,105 +209,6 @@ const migrationsCreateFirebaseMigration = async ({resources,serviceAccount,parse
|
|
|
209
209
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
/**
|
|
213
|
-
* @typedef {Object} MigrationsDeleteFirebaseAuthRequestParams
|
|
214
|
-
* @property {boolean} overrideForCli
|
|
215
|
-
* @property {boolean} parseOutput
|
|
216
|
-
* @property {libClient | undefined} sdk
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* @param {MigrationsDeleteFirebaseAuthRequestParams} params
|
|
221
|
-
*/
|
|
222
|
-
const migrationsDeleteFirebaseAuth = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
223
|
-
let client = !sdk ? await sdkForProject() :
|
|
224
|
-
sdk;
|
|
225
|
-
let apiPath = '/migrations/firebase/deauthorize';
|
|
226
|
-
let payload = {};
|
|
227
|
-
|
|
228
|
-
let response = undefined;
|
|
229
|
-
|
|
230
|
-
response = await client.call('get', apiPath, {
|
|
231
|
-
'content-type': 'application/json',
|
|
232
|
-
}, payload);
|
|
233
|
-
|
|
234
|
-
if (parseOutput) {
|
|
235
|
-
parse(response)
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
return response;
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* @typedef {Object} MigrationsCreateFirebaseOAuthMigrationRequestParams
|
|
244
|
-
* @property {string[]} resources List of resources to migrate
|
|
245
|
-
* @property {string} projectId Project ID of the Firebase Project
|
|
246
|
-
* @property {boolean} overrideForCli
|
|
247
|
-
* @property {boolean} parseOutput
|
|
248
|
-
* @property {libClient | undefined} sdk
|
|
249
|
-
*/
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* @param {MigrationsCreateFirebaseOAuthMigrationRequestParams} params
|
|
253
|
-
*/
|
|
254
|
-
const migrationsCreateFirebaseOAuthMigration = async ({resources,projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
255
|
-
let client = !sdk ? await sdkForProject() :
|
|
256
|
-
sdk;
|
|
257
|
-
let apiPath = '/migrations/firebase/oauth';
|
|
258
|
-
let payload = {};
|
|
259
|
-
resources = resources === true ? [] : resources;
|
|
260
|
-
if (typeof resources !== 'undefined') {
|
|
261
|
-
payload['resources'] = resources;
|
|
262
|
-
}
|
|
263
|
-
if (typeof projectId !== 'undefined') {
|
|
264
|
-
payload['projectId'] = projectId;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
let response = undefined;
|
|
268
|
-
|
|
269
|
-
response = await client.call('post', apiPath, {
|
|
270
|
-
'content-type': 'application/json',
|
|
271
|
-
}, payload);
|
|
272
|
-
|
|
273
|
-
if (parseOutput) {
|
|
274
|
-
parse(response)
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return response;
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* @typedef {Object} MigrationsListFirebaseProjectsRequestParams
|
|
283
|
-
* @property {boolean} overrideForCli
|
|
284
|
-
* @property {boolean} parseOutput
|
|
285
|
-
* @property {libClient | undefined} sdk
|
|
286
|
-
*/
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* @param {MigrationsListFirebaseProjectsRequestParams} params
|
|
290
|
-
*/
|
|
291
|
-
const migrationsListFirebaseProjects = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
292
|
-
let client = !sdk ? await sdkForProject() :
|
|
293
|
-
sdk;
|
|
294
|
-
let apiPath = '/migrations/firebase/projects';
|
|
295
|
-
let payload = {};
|
|
296
|
-
|
|
297
|
-
let response = undefined;
|
|
298
|
-
|
|
299
|
-
response = await client.call('get', apiPath, {
|
|
300
|
-
'content-type': 'application/json',
|
|
301
|
-
}, payload);
|
|
302
|
-
|
|
303
|
-
if (parseOutput) {
|
|
304
|
-
parse(response)
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return response;
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
212
|
/**
|
|
312
213
|
* @typedef {Object} MigrationsGetFirebaseReportRequestParams
|
|
313
214
|
* @property {string[]} resources List of resources to migrate
|
|
@@ -346,44 +247,6 @@ const migrationsGetFirebaseReport = async ({resources,serviceAccount,parseOutput
|
|
|
346
247
|
|
|
347
248
|
}
|
|
348
249
|
|
|
349
|
-
/**
|
|
350
|
-
* @typedef {Object} MigrationsGetFirebaseReportOAuthRequestParams
|
|
351
|
-
* @property {string[]} resources List of resources to migrate
|
|
352
|
-
* @property {string} projectId Project ID
|
|
353
|
-
* @property {boolean} overrideForCli
|
|
354
|
-
* @property {boolean} parseOutput
|
|
355
|
-
* @property {libClient | undefined} sdk
|
|
356
|
-
*/
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* @param {MigrationsGetFirebaseReportOAuthRequestParams} params
|
|
360
|
-
*/
|
|
361
|
-
const migrationsGetFirebaseReportOAuth = async ({resources,projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
362
|
-
let client = !sdk ? await sdkForProject() :
|
|
363
|
-
sdk;
|
|
364
|
-
let apiPath = '/migrations/firebase/report/oauth';
|
|
365
|
-
let payload = {};
|
|
366
|
-
if (typeof resources !== 'undefined') {
|
|
367
|
-
payload['resources'] = resources;
|
|
368
|
-
}
|
|
369
|
-
if (typeof projectId !== 'undefined') {
|
|
370
|
-
payload['projectId'] = projectId;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
let response = undefined;
|
|
374
|
-
|
|
375
|
-
response = await client.call('get', apiPath, {
|
|
376
|
-
'content-type': 'application/json',
|
|
377
|
-
}, payload);
|
|
378
|
-
|
|
379
|
-
if (parseOutput) {
|
|
380
|
-
parse(response)
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
return response;
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
|
|
387
250
|
/**
|
|
388
251
|
* @typedef {Object} MigrationsCreateNHostMigrationRequestParams
|
|
389
252
|
* @property {string[]} resources List of resources to migrate
|
|
@@ -722,7 +585,7 @@ const migrationsDelete = async ({migrationId,parseOutput = true, overrideForCli
|
|
|
722
585
|
migrations
|
|
723
586
|
.command(`list`)
|
|
724
587
|
.description(``)
|
|
725
|
-
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors`)
|
|
588
|
+
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors`)
|
|
726
589
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
727
590
|
.action(actionRunner(migrationsList))
|
|
728
591
|
|
|
@@ -751,23 +614,6 @@ migrations
|
|
|
751
614
|
.requiredOption(`--service-account <service-account>`, `JSON of the Firebase service account credentials`)
|
|
752
615
|
.action(actionRunner(migrationsCreateFirebaseMigration))
|
|
753
616
|
|
|
754
|
-
migrations
|
|
755
|
-
.command(`delete-firebase-auth`)
|
|
756
|
-
.description(``)
|
|
757
|
-
.action(actionRunner(migrationsDeleteFirebaseAuth))
|
|
758
|
-
|
|
759
|
-
migrations
|
|
760
|
-
.command(`create-firebase-o-auth-migration`)
|
|
761
|
-
.description(``)
|
|
762
|
-
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
|
|
763
|
-
.requiredOption(`--project-id <project-id>`, `Project ID of the Firebase Project`)
|
|
764
|
-
.action(actionRunner(migrationsCreateFirebaseOAuthMigration))
|
|
765
|
-
|
|
766
|
-
migrations
|
|
767
|
-
.command(`list-firebase-projects`)
|
|
768
|
-
.description(``)
|
|
769
|
-
.action(actionRunner(migrationsListFirebaseProjects))
|
|
770
|
-
|
|
771
617
|
migrations
|
|
772
618
|
.command(`get-firebase-report`)
|
|
773
619
|
.description(``)
|
|
@@ -775,13 +621,6 @@ migrations
|
|
|
775
621
|
.requiredOption(`--service-account <service-account>`, `JSON of the Firebase service account credentials`)
|
|
776
622
|
.action(actionRunner(migrationsGetFirebaseReport))
|
|
777
623
|
|
|
778
|
-
migrations
|
|
779
|
-
.command(`get-firebase-report-o-auth`)
|
|
780
|
-
.description(``)
|
|
781
|
-
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
|
|
782
|
-
.requiredOption(`--project-id <project-id>`, `Project ID`)
|
|
783
|
-
.action(actionRunner(migrationsGetFirebaseReportOAuth))
|
|
784
|
-
|
|
785
624
|
migrations
|
|
786
625
|
.command(`create-n-host-migration`)
|
|
787
626
|
.description(``)
|
|
@@ -856,11 +695,7 @@ module.exports = {
|
|
|
856
695
|
migrationsCreateAppwriteMigration,
|
|
857
696
|
migrationsGetAppwriteReport,
|
|
858
697
|
migrationsCreateFirebaseMigration,
|
|
859
|
-
migrationsDeleteFirebaseAuth,
|
|
860
|
-
migrationsCreateFirebaseOAuthMigration,
|
|
861
|
-
migrationsListFirebaseProjects,
|
|
862
698
|
migrationsGetFirebaseReport,
|
|
863
|
-
migrationsGetFirebaseReportOAuth,
|
|
864
699
|
migrationsCreateNHostMigration,
|
|
865
700
|
migrationsGetNHostReport,
|
|
866
701
|
migrationsCreateSupabaseMigration,
|
package/lib/commands/projects.js
CHANGED
|
@@ -479,6 +479,49 @@ const projectsUpdateAuthSessionsLimit = async ({projectId,limit,parseOutput = tr
|
|
|
479
479
|
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
+
/**
|
|
483
|
+
* @typedef {Object} ProjectsUpdateMembershipsPrivacyRequestParams
|
|
484
|
+
* @property {string} projectId Project unique ID.
|
|
485
|
+
* @property {boolean} userName Set to true to show userName to members of a team.
|
|
486
|
+
* @property {boolean} userEmail Set to true to show email to members of a team.
|
|
487
|
+
* @property {boolean} mfa Set to true to show mfa to members of a team.
|
|
488
|
+
* @property {boolean} overrideForCli
|
|
489
|
+
* @property {boolean} parseOutput
|
|
490
|
+
* @property {libClient | undefined} sdk
|
|
491
|
+
*/
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* @param {ProjectsUpdateMembershipsPrivacyRequestParams} params
|
|
495
|
+
*/
|
|
496
|
+
const projectsUpdateMembershipsPrivacy = async ({projectId,userName,userEmail,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
497
|
+
let client = !sdk ? await sdkForConsole() :
|
|
498
|
+
sdk;
|
|
499
|
+
let apiPath = '/projects/{projectId}/auth/memberships-privacy'.replace('{projectId}', projectId);
|
|
500
|
+
let payload = {};
|
|
501
|
+
if (typeof userName !== 'undefined') {
|
|
502
|
+
payload['userName'] = userName;
|
|
503
|
+
}
|
|
504
|
+
if (typeof userEmail !== 'undefined') {
|
|
505
|
+
payload['userEmail'] = userEmail;
|
|
506
|
+
}
|
|
507
|
+
if (typeof mfa !== 'undefined') {
|
|
508
|
+
payload['mfa'] = mfa;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
let response = undefined;
|
|
512
|
+
|
|
513
|
+
response = await client.call('patch', apiPath, {
|
|
514
|
+
'content-type': 'application/json',
|
|
515
|
+
}, payload);
|
|
516
|
+
|
|
517
|
+
if (parseOutput) {
|
|
518
|
+
parse(response)
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
return response;
|
|
522
|
+
|
|
523
|
+
}
|
|
524
|
+
|
|
482
525
|
/**
|
|
483
526
|
* @typedef {Object} ProjectsUpdateMockNumbersRequestParams
|
|
484
527
|
* @property {string} projectId Project unique ID.
|
|
@@ -1985,6 +2028,15 @@ projects
|
|
|
1985
2028
|
.requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10`, parseInteger)
|
|
1986
2029
|
.action(actionRunner(projectsUpdateAuthSessionsLimit))
|
|
1987
2030
|
|
|
2031
|
+
projects
|
|
2032
|
+
.command(`update-memberships-privacy`)
|
|
2033
|
+
.description(``)
|
|
2034
|
+
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
|
|
2035
|
+
.requiredOption(`--user-name <user-name>`, `Set to true to show userName to members of a team.`, parseBool)
|
|
2036
|
+
.requiredOption(`--user-email <user-email>`, `Set to true to show email to members of a team.`, parseBool)
|
|
2037
|
+
.requiredOption(`--mfa <mfa>`, `Set to true to show mfa to members of a team.`, parseBool)
|
|
2038
|
+
.action(actionRunner(projectsUpdateMembershipsPrivacy))
|
|
2039
|
+
|
|
1988
2040
|
projects
|
|
1989
2041
|
.command(`update-mock-numbers`)
|
|
1990
2042
|
.description(``)
|
|
@@ -2305,6 +2357,7 @@ module.exports = {
|
|
|
2305
2357
|
projectsUpdateAuthDuration,
|
|
2306
2358
|
projectsUpdateAuthLimit,
|
|
2307
2359
|
projectsUpdateAuthSessionsLimit,
|
|
2360
|
+
projectsUpdateMembershipsPrivacy,
|
|
2308
2361
|
projectsUpdateMockNumbers,
|
|
2309
2362
|
projectsUpdateAuthPasswordDictionary,
|
|
2310
2363
|
projectsUpdateAuthPasswordHistory,
|
package/lib/commands/push.js
CHANGED
|
@@ -1095,6 +1095,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
|
|
|
1095
1095
|
response = await functionsUpdate({
|
|
1096
1096
|
functionId: func['$id'],
|
|
1097
1097
|
name: func.name,
|
|
1098
|
+
specification: func.specification,
|
|
1098
1099
|
execute: func.execute,
|
|
1099
1100
|
events: func.events,
|
|
1100
1101
|
schedule: func.schedule,
|
|
@@ -1126,6 +1127,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
|
|
|
1126
1127
|
functionId: func.$id,
|
|
1127
1128
|
name: func.name,
|
|
1128
1129
|
runtime: func.runtime,
|
|
1130
|
+
specification: func.specification,
|
|
1129
1131
|
execute: func.execute,
|
|
1130
1132
|
events: func.events,
|
|
1131
1133
|
schedule: func.schedule,
|
|
@@ -1134,6 +1136,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
|
|
|
1134
1136
|
logging: func.logging,
|
|
1135
1137
|
entrypoint: func.entrypoint,
|
|
1136
1138
|
commands: func.commands,
|
|
1139
|
+
scopes: func.scopes,
|
|
1137
1140
|
vars: JSON.stringify(func.vars),
|
|
1138
1141
|
parseOutput: false
|
|
1139
1142
|
});
|
package/lib/commands/run.js
CHANGED
|
@@ -97,8 +97,8 @@ const runFunction = async ({ port, functionId, withVariables, reload, userId } =
|
|
|
97
97
|
process.exit();
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
const logsPath = path.join(
|
|
101
|
-
const errorsPath = path.join(
|
|
100
|
+
const logsPath = path.join(localConfig.getDirname(), func.path, '.appwrite/logs.txt');
|
|
101
|
+
const errorsPath = path.join(localConfig.getDirname(), func.path, '.appwrite/errors.txt');
|
|
102
102
|
|
|
103
103
|
if(!fs.existsSync(path.dirname(logsPath))) {
|
|
104
104
|
fs.mkdirSync(path.dirname(logsPath), { recursive: true });
|
|
@@ -131,7 +131,7 @@ const runFunction = async ({ port, functionId, withVariables, reload, userId } =
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
const functionPath = path.join(
|
|
134
|
+
const functionPath = path.join(localConfig.getDirname(), func.path);
|
|
135
135
|
const envPath = path.join(functionPath, '.env');
|
|
136
136
|
if(fs.existsSync(envPath)) {
|
|
137
137
|
const env = parseDotenv(fs.readFileSync(envPath).toString() ?? '');
|
|
@@ -192,7 +192,7 @@ const runFunction = async ({ port, functionId, withVariables, reload, userId } =
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
chokidar.watch('.', {
|
|
195
|
-
cwd: path.join(
|
|
195
|
+
cwd: path.join(localConfig.getDirname(), func.path),
|
|
196
196
|
ignoreInitial: true,
|
|
197
197
|
ignored: (xpath) => {
|
|
198
198
|
const relativePath = path.relative(functionPath, xpath);
|
package/lib/commands/teams.js
CHANGED
|
@@ -607,7 +607,7 @@ teams
|
|
|
607
607
|
|
|
608
608
|
teams
|
|
609
609
|
.command(`list-memberships`)
|
|
610
|
-
.description(`Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.`)
|
|
610
|
+
.description(`Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.`)
|
|
611
611
|
.requiredOption(`--team-id <team-id>`, `Team ID.`)
|
|
612
612
|
.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, teamId, invited, joined, confirm`)
|
|
613
613
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
@@ -627,7 +627,7 @@ teams
|
|
|
627
627
|
|
|
628
628
|
teams
|
|
629
629
|
.command(`get-membership`)
|
|
630
|
-
.description(`Get a team member by the membership unique id. All team members have read access for this resource.`)
|
|
630
|
+
.description(`Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.`)
|
|
631
631
|
.requiredOption(`--team-id <team-id>`, `Team ID.`)
|
|
632
632
|
.requiredOption(`--membership-id <membership-id>`, `Membership ID.`)
|
|
633
633
|
.action(actionRunner(teamsGetMembership))
|
package/lib/config.js
CHANGED
|
@@ -5,7 +5,7 @@ const process = require("process");
|
|
|
5
5
|
const JSONbig = require("json-bigint")({ storeAsString: false });
|
|
6
6
|
|
|
7
7
|
const KeysVars = new Set(["key", "value"]);
|
|
8
|
-
const KeysFunction = new Set(["path", "$id", "execute", "name", "enabled", "logging", "runtime", "scopes", "events", "schedule", "timeout", "entrypoint", "commands", "vars"]);
|
|
8
|
+
const KeysFunction = new Set(["path", "$id", "execute", "name", "enabled", "logging", "runtime", "specification", "scopes", "events", "schedule", "timeout", "entrypoint", "commands", "vars"]);
|
|
9
9
|
const KeysDatabase = new Set(["$id", "name", "enabled"]);
|
|
10
10
|
const KeysCollection = new Set(["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "attributes", "indexes"]);
|
|
11
11
|
const KeysStorage = new Set(["$id", "$permissions", "fileSecurity", "name", "enabled", "maximumFileSize", "allowedFileExtensions", "compression", "encryption", "antivirus"]);
|
|
@@ -145,6 +145,10 @@ class Local extends Config {
|
|
|
145
145
|
this.configDirectoryPath =_path.dirname(absolutePath);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
getDirname() {
|
|
149
|
+
return _path.dirname(this.path)
|
|
150
|
+
}
|
|
151
|
+
|
|
148
152
|
getFunctions() {
|
|
149
153
|
if (!this.has("functions")) {
|
|
150
154
|
return [];
|
package/lib/emulation/docker.js
CHANGED
|
@@ -47,7 +47,7 @@ async function dockerBuild(func, variables) {
|
|
|
47
47
|
const runtimeName = runtimeChunks.join("-");
|
|
48
48
|
const imageName = `openruntimes/${runtimeName}:${openRuntimesVersion}-${runtimeVersion}`;
|
|
49
49
|
|
|
50
|
-
const functionDir = path.join(
|
|
50
|
+
const functionDir = path.join(localConfig.getDirname(), func.path);
|
|
51
51
|
|
|
52
52
|
const id = func.$id;
|
|
53
53
|
|
|
@@ -124,7 +124,7 @@ async function dockerBuild(func, variables) {
|
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
const copyPath = path.join(
|
|
127
|
+
const copyPath = path.join(localConfig.getDirname(), func.path, '.appwrite', 'build.tar.gz');
|
|
128
128
|
const copyDir = path.dirname(copyPath);
|
|
129
129
|
if (!fs.existsSync(copyDir)) {
|
|
130
130
|
fs.mkdirSync(copyDir, { recursive: true });
|
|
@@ -143,7 +143,7 @@ async function dockerBuild(func, variables) {
|
|
|
143
143
|
|
|
144
144
|
await dockerStop(id);
|
|
145
145
|
|
|
146
|
-
const tempPath = path.join(
|
|
146
|
+
const tempPath = path.join(localConfig.getDirname(), func.path, 'code.tar.gz');
|
|
147
147
|
if (fs.existsSync(tempPath)) {
|
|
148
148
|
fs.rmSync(tempPath, { force: true });
|
|
149
149
|
}
|
|
@@ -153,7 +153,7 @@ async function dockerBuild(func, variables) {
|
|
|
153
153
|
|
|
154
154
|
async function dockerStart(func, variables, port) {
|
|
155
155
|
// Pack function files
|
|
156
|
-
const functionDir = path.join(
|
|
156
|
+
const functionDir = path.join(localConfig.getDirname(), func.path);
|
|
157
157
|
|
|
158
158
|
const runtimeChunks = func.runtime.split("-");
|
|
159
159
|
const runtimeVersion = runtimeChunks.pop();
|
|
@@ -211,12 +211,12 @@ async function dockerCleanup(functionId) {
|
|
|
211
211
|
await dockerStop(functionId);
|
|
212
212
|
|
|
213
213
|
const func = localConfig.getFunction(functionId);
|
|
214
|
-
const appwritePath = path.join(
|
|
214
|
+
const appwritePath = path.join(localConfig.getDirname(), func.path, '.appwrite');
|
|
215
215
|
if (fs.existsSync(appwritePath)) {
|
|
216
216
|
fs.rmSync(appwritePath, { recursive: true, force: true });
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
const tempPath = path.join(
|
|
219
|
+
const tempPath = path.join(localConfig.getDirname(), func.path, 'code.tar.gz');
|
|
220
220
|
if (fs.existsSync(tempPath)) {
|
|
221
221
|
fs.rmSync(tempPath, { force: true });
|
|
222
222
|
}
|
package/lib/emulation/utils.js
CHANGED
|
@@ -25,67 +25,67 @@ const runtimeNames = {
|
|
|
25
25
|
const systemTools = {
|
|
26
26
|
'node': {
|
|
27
27
|
isCompiled: false,
|
|
28
|
-
startCommand: "
|
|
28
|
+
startCommand: "sh helpers/server.sh",
|
|
29
29
|
dependencyFiles: [ "package.json", "package-lock.json" ]
|
|
30
30
|
},
|
|
31
31
|
'php': {
|
|
32
32
|
isCompiled: false,
|
|
33
|
-
startCommand: "
|
|
33
|
+
startCommand: "sh helpers/server.sh",
|
|
34
34
|
dependencyFiles: [ "composer.json", "composer.lock" ]
|
|
35
35
|
},
|
|
36
36
|
'ruby': {
|
|
37
37
|
isCompiled: false,
|
|
38
|
-
startCommand: "
|
|
38
|
+
startCommand: "sh helpers/server.sh",
|
|
39
39
|
dependencyFiles: [ "Gemfile", "Gemfile.lock" ]
|
|
40
40
|
},
|
|
41
41
|
'python': {
|
|
42
42
|
isCompiled: false,
|
|
43
|
-
startCommand: "
|
|
43
|
+
startCommand: "sh helpers/server.sh",
|
|
44
44
|
dependencyFiles: [ "requirements.txt", "requirements.lock" ]
|
|
45
45
|
},
|
|
46
46
|
'python-ml': {
|
|
47
47
|
isCompiled: false,
|
|
48
|
-
startCommand: "
|
|
48
|
+
startCommand: "sh helpers/server.sh",
|
|
49
49
|
dependencyFiles: [ "requirements.txt", "requirements.lock" ]
|
|
50
50
|
},
|
|
51
51
|
'deno': {
|
|
52
52
|
isCompiled: false,
|
|
53
|
-
startCommand: "
|
|
53
|
+
startCommand: "sh helpers/server.sh",
|
|
54
54
|
dependencyFiles: [ ]
|
|
55
55
|
},
|
|
56
56
|
'dart': {
|
|
57
57
|
isCompiled: true,
|
|
58
|
-
startCommand: "
|
|
58
|
+
startCommand: "sh helpers/server.sh",
|
|
59
59
|
dependencyFiles: [ ]
|
|
60
60
|
},
|
|
61
61
|
'dotnet': {
|
|
62
62
|
isCompiled: true,
|
|
63
|
-
startCommand: "
|
|
63
|
+
startCommand: "sh helpers/server.sh",
|
|
64
64
|
dependencyFiles: [ ]
|
|
65
65
|
},
|
|
66
66
|
'java': {
|
|
67
67
|
isCompiled: true,
|
|
68
|
-
startCommand: "
|
|
68
|
+
startCommand: "sh helpers/server.sh",
|
|
69
69
|
dependencyFiles: [ ]
|
|
70
70
|
},
|
|
71
71
|
'swift': {
|
|
72
72
|
isCompiled: true,
|
|
73
|
-
startCommand: "
|
|
73
|
+
startCommand: "sh helpers/server.sh",
|
|
74
74
|
dependencyFiles: [ ]
|
|
75
75
|
},
|
|
76
76
|
'kotlin': {
|
|
77
77
|
isCompiled: true,
|
|
78
|
-
startCommand: "
|
|
78
|
+
startCommand: "sh helpers/server.sh",
|
|
79
79
|
dependencyFiles: [ ]
|
|
80
80
|
},
|
|
81
81
|
'bun': {
|
|
82
82
|
isCompiled: false,
|
|
83
|
-
startCommand: "
|
|
83
|
+
startCommand: "sh helpers/server.sh",
|
|
84
84
|
dependencyFiles: [ "package.json", "package-lock.json", "bun.lockb" ]
|
|
85
85
|
},
|
|
86
86
|
'go': {
|
|
87
87
|
isCompiled: true,
|
|
88
|
-
startCommand: "
|
|
88
|
+
startCommand: "sh helpers/server.sh",
|
|
89
89
|
dependencyFiles: [ ]
|
|
90
90
|
},
|
|
91
91
|
};
|
package/lib/parser.js
CHANGED
|
@@ -120,7 +120,7 @@ const parseError = (err) => {
|
|
|
120
120
|
} catch {
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const version = '6.
|
|
123
|
+
const version = '6.2.0';
|
|
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
|
|