Skip to content

Commit 91bea6e

Browse files
Merge pull request #157 from appwrite/feat-specifications
Fix: Missed specifications param when updating a function
2 parents 1bcf806 + a7be174 commit 91bea6e

21 files changed

+139
-216
lines changed

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite Command Line SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
2929

3030
```sh
3131
$ appwrite -v
32-
6.1.0
32+
6.2.0
3333
```
3434

3535
### Install using prebuilt binaries
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
6060
Once the installation completes, you can verify your install using
6161
```
6262
$ appwrite -v
63-
6.1.0
63+
6.2.0
6464
```
6565

6666
## Getting Started

docs/examples/messaging/create-push.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
appwrite messaging createPush \
22
--messageId <MESSAGE_ID> \
3-
--title <TITLE> \
4-
--body <BODY> \
3+
4+
5+
6+
7+
58

69

710

docs/examples/messaging/update-push.md

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ appwrite messaging updatePush \
1515

1616

1717

18+
19+
20+

docs/examples/migrations/create-firebase-o-auth-migration.md

-3
This file was deleted.

docs/examples/migrations/delete-firebase-auth.md

-1
This file was deleted.

docs/examples/migrations/get-firebase-report-o-auth.md

-3
This file was deleted.

docs/examples/migrations/list-firebase-projects.md

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
appwrite projects updateMembershipsPrivacy \
2+
--projectId <PROJECT_ID> \
3+
--userName false \
4+
--userEmail false \
5+
--mfa false

install.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# You can use "View source" of this page to see the full script.
1414

1515
# REPO
16-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.1.0/appwrite-cli-win-x64.exe"
17-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.1.0/appwrite-cli-win-arm64.exe"
16+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.0/appwrite-cli-win-x64.exe"
17+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.0/appwrite-cli-win-arm64.exe"
1818

1919
$APPWRITE_BINARY_NAME = "appwrite.exe"
2020

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ printSuccess() {
9797
downloadBinary() {
9898
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
9999

100-
GITHUB_LATEST_VERSION="6.1.0"
100+
GITHUB_LATEST_VERSION="6.2.0"
101101
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
102102
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
103103

lib/client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Client {
1616
'x-sdk-name': 'Command Line',
1717
'x-sdk-platform': 'console',
1818
'x-sdk-language': 'cli',
19-
'x-sdk-version': '6.1.0',
20-
'user-agent' : `AppwriteCLI/6.1.0 (${os.type()} ${os.version()}; ${os.arch()})`,
19+
'x-sdk-version': '6.2.0',
20+
'user-agent' : `AppwriteCLI/6.2.0 (${os.type()} ${os.version()}; ${os.arch()})`,
2121
'X-Appwrite-Response-Format' : '1.6.0',
2222
};
2323
}

lib/commands/account.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ account
19831983

19841984
account
19851985
.command(`create-magic-url-token`)
1986-
.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. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). `)
1986+
.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. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). `)
19871987
.requiredOption(`--user-id <user-id>`, `Unique 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.`)
19881988
.requiredOption(`--email <email>`, `User email.`)
19891989
.option(`--url <url>`, `URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)

lib/commands/messaging.js

+40-10
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,19 @@ const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,cont
254254
* @property {string[]} topics List of Topic IDs.
255255
* @property {string[]} users List of User IDs.
256256
* @property {string[]} targets List of Targets IDs.
257-
* @property {object} data Additional Data for push notification.
257+
* @property {object} data Additional key-value pair data for push notification.
258258
* @property {string} action Action for push notification.
259259
* @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 &lt;BUCKET_ID&gt;:&lt;FILE_ID&gt;.
260260
* @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 IOS Platform.
261+
* @property {string} sound Sound for push notification. Available only for Android and iOS Platform.
262262
* @property {string} color Color for push notification. Available only for Android Platform.
263263
* @property {string} tag Tag for push notification. Available only for Android Platform.
264-
* @property {string} badge Badge for push notification. Available only for IOS Platform.
264+
* @property {number} badge Badge for push notification. Available only for iOS Platform.
265265
* @property {boolean} draft Is message a draft
266266
* @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. &quot;normal&quot; will consider device state and may not deliver notifications immediately. &quot;high&quot; will always attempt to immediately deliver the notification.
267270
* @property {boolean} overrideForCli
268271
* @property {boolean} parseOutput
269272
* @property {libClient | undefined} sdk
@@ -272,7 +275,7 @@ const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,cont
272275
/**
273276
* @param {MessagingCreatePushRequestParams} params
274277
*/
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}) => {
276279
let client = !sdk ? await sdkForProject() :
277280
sdk;
278281
let apiPath = '/messaging/messages/push';
@@ -328,6 +331,15 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
328331
if (typeof scheduledAt !== 'undefined') {
329332
payload['scheduledAt'] = scheduledAt;
330333
}
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+
}
331343

332344
let response = undefined;
333345

@@ -361,6 +373,9 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
361373
* @property {number} badge Badge for push notification. Available only for iOS platforms.
362374
* @property {boolean} draft Is message a draft
363375
* @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. &quot;normal&quot; will consider device battery state and may send notifications later. &quot;high&quot; will always attempt to immediately deliver the notification.
364379
* @property {boolean} overrideForCli
365380
* @property {boolean} parseOutput
366381
* @property {libClient | undefined} sdk
@@ -369,7 +384,7 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
369384
/**
370385
* @param {MessagingUpdatePushRequestParams} params
371386
*/
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}) => {
373388
let client = !sdk ? await sdkForProject() :
374389
sdk;
375390
let apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
@@ -422,6 +437,15 @@ const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,da
422437
if (typeof scheduledAt !== 'undefined') {
423438
payload['scheduledAt'] = scheduledAt;
424439
}
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+
}
425449

426450
let response = undefined;
427451

@@ -2454,21 +2478,24 @@ messaging
24542478
.command(`create-push`)
24552479
.description(`Create a new push notification.`)
24562480
.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-
.requiredOption(`--title <title>`, `Title for push notification.`)
2458-
.requiredOption(`--body <body>`, `Body for push notification.`)
2481+
.option(`--title <title>`, `Title for push notification.`)
2482+
.option(`--body <body>`, `Body for push notification.`)
24592483
.option(`--topics [topics...]`, `List of Topic IDs.`)
24602484
.option(`--users [users...]`, `List of User IDs.`)
24612485
.option(`--targets [targets...]`, `List of Targets IDs.`)
2462-
.option(`--data <data>`, `Additional Data for push notification.`)
2486+
.option(`--data <data>`, `Additional key-value pair data for push notification.`)
24632487
.option(`--action <action>`, `Action for push notification.`)
24642488
.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>.`)
24652489
.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 IOS Platform.`)
2490+
.option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS Platform.`)
24672491
.option(`--color <color>`, `Color for push notification. Available only for Android Platform.`)
24682492
.option(`--tag <tag>`, `Tag for push notification. Available only for Android Platform.`)
2469-
.option(`--badge <badge>`, `Badge for push notification. Available only for IOS Platform.`)
2493+
.option(`--badge <badge>`, `Badge for push notification. Available only for iOS Platform.`, parseInteger)
24702494
.option(`--draft <draft>`, `Is message a draft`, parseBool)
24712495
.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.`)
24722499
.action(actionRunner(messagingCreatePush))
24732500

24742501
messaging
@@ -2490,6 +2517,9 @@ messaging
24902517
.option(`--badge <badge>`, `Badge for push notification. Available only for iOS platforms.`, parseInteger)
24912518
.option(`--draft <draft>`, `Is message a draft`, parseBool)
24922519
.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.`)
24932523
.action(actionRunner(messagingUpdatePush))
24942524

24952525
messaging

0 commit comments

Comments
 (0)