From 16c5f07c775621bb2f17429cbf7aca41e1ce6027 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 21 Mar 2024 13:57:58 -0700 Subject: [PATCH] fix(messaging): fix msg91 params --- README.md | 6 +++--- install.ps1 | 4 ++-- install.sh | 2 +- lib/client.js | 4 ++-- lib/commands/messaging.js | 38 +++++++++++++++++++------------------- package.json | 2 +- scoop/appwrite.json | 6 +++--- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index dfa032f..f92b683 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Command Line SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.5.4-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![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 ```sh $ appwrite -v -5.0.1 +5.0.2 ``` ### Install using prebuilt binaries @@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -5.0.1 +5.0.2 ``` ## Getting Started diff --git a/install.ps1 b/install.ps1 index ee00f1e..e0872a2 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.1/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.1/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.2/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.2/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 43c7132..7d708de 100644 --- a/install.sh +++ b/install.sh @@ -97,7 +97,7 @@ printSuccess() { downloadBinary() { echo "[2/4] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="5.0.1" + GITHUB_LATEST_VERSION="5.0.2" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/client.js b/lib/client.js index 141f6d1..9446bbf 100644 --- a/lib/client.js +++ b/lib/client.js @@ -15,8 +15,8 @@ class Client { 'x-sdk-name': 'Command Line', 'x-sdk-platform': 'console', 'x-sdk-language': 'cli', - 'x-sdk-version': '5.0.1', - 'user-agent' : `AppwriteCLI/5.0.1 (${os.type()} ${os.version()}; ${os.arch()})`, + 'x-sdk-version': '5.0.2', + 'user-agent' : `AppwriteCLI/5.0.2 (${os.type()} ${os.version()}; ${os.arch()})`, 'X-Appwrite-Response-Format' : '1.5.0', }; } diff --git a/lib/commands/messaging.js b/lib/commands/messaging.js index 612f9d4..db65ec2 100644 --- a/lib/commands/messaging.js +++ b/lib/commands/messaging.js @@ -1032,9 +1032,9 @@ const messagingUpdateMailgunProvider = async ({ providerId, name, apiKey, domain * @typedef {Object} MessagingCreateMsg91ProviderRequestParams * @property {string} providerId Provider 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. * @property {string} name Provider name. - * @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - * @property {string} senderId Msg91 Sender ID. - * @property {string} authKey Msg91 Auth Key. + * @property {string} templateId Msg91 template ID + * @property {string} senderId Msg91 sender ID. + * @property {string} authKey Msg91 auth key. * @property {boolean} enabled Set as enabled. * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1043,7 +1043,7 @@ const messagingUpdateMailgunProvider = async ({ providerId, name, apiKey, domain /** * @param {MessagingCreateMsg91ProviderRequestParams} params */ -const messagingCreateMsg91Provider = async ({ providerId, name, from, senderId, authKey, enabled, parseOutput = true, sdk = undefined}) => { +const messagingCreateMsg91Provider = async ({ providerId, name, templateId, senderId, authKey, enabled, parseOutput = true, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/msg91'; let payload = {}; @@ -1053,8 +1053,8 @@ const messagingCreateMsg91Provider = async ({ providerId, name, from, senderId, if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof from !== 'undefined') { - payload['from'] = from; + if (typeof templateId !== 'undefined') { + payload['templateId'] = templateId; } if (typeof senderId !== 'undefined') { payload['senderId'] = senderId; @@ -1085,9 +1085,9 @@ const messagingCreateMsg91Provider = async ({ providerId, name, from, senderId, * @property {string} providerId Provider ID. * @property {string} name Provider name. * @property {boolean} enabled Set as enabled. - * @property {string} senderId Msg91 Sender ID. - * @property {string} authKey Msg91 Auth Key. - * @property {string} from Sender number. + * @property {string} templateId Msg91 template ID. + * @property {string} senderId Msg91 sender ID. + * @property {string} authKey Msg91 auth key. * @property {boolean} parseOutput * @property {libClient | undefined} sdk */ @@ -1095,7 +1095,7 @@ const messagingCreateMsg91Provider = async ({ providerId, name, from, senderId, /** * @param {MessagingUpdateMsg91ProviderRequestParams} params */ -const messagingUpdateMsg91Provider = async ({ providerId, name, enabled, senderId, authKey, from, parseOutput = true, sdk = undefined}) => { +const messagingUpdateMsg91Provider = async ({ providerId, name, enabled, templateId, senderId, authKey, parseOutput = true, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId); let payload = {}; @@ -1105,15 +1105,15 @@ const messagingUpdateMsg91Provider = async ({ providerId, name, enabled, senderI if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof templateId !== 'undefined') { + payload['templateId'] = templateId; + } if (typeof senderId !== 'undefined') { payload['senderId'] = senderId; } if (typeof authKey !== 'undefined') { payload['authKey'] = authKey; } - if (typeof from !== 'undefined') { - payload['from'] = from; - } let response = undefined; @@ -2497,9 +2497,9 @@ messaging .description(`Create a new MSG91 provider.`) .requiredOption(`--providerId `, `Provider 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.`) .requiredOption(`--name `, `Provider name.`) - .option(`--from `, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`) - .option(`--senderId `, `Msg91 Sender ID.`) - .option(`--authKey `, `Msg91 Auth Key.`) + .option(`--templateId `, `Msg91 template ID`) + .option(`--senderId `, `Msg91 sender ID.`) + .option(`--authKey `, `Msg91 auth key.`) .option(`--enabled `, `Set as enabled.`, parseBool) .action(actionRunner(messagingCreateMsg91Provider)) @@ -2509,9 +2509,9 @@ messaging .requiredOption(`--providerId `, `Provider ID.`) .option(`--name `, `Provider name.`) .option(`--enabled `, `Set as enabled.`, parseBool) - .option(`--senderId `, `Msg91 Sender ID.`) - .option(`--authKey `, `Msg91 Auth Key.`) - .option(`--from `, `Sender number.`) + .option(`--templateId `, `Msg91 template ID.`) + .option(`--senderId `, `Msg91 sender ID.`) + .option(`--authKey `, `Msg91 auth key.`) .action(actionRunner(messagingUpdateMsg91Provider)) messaging diff --git a/package.json b/package.json index c028469..9813a15 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "appwrite-cli", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "5.0.1", + "version": "5.0.2", "license": "BSD-3-Clause", "main": "index.js", "bin": { diff --git a/scoop/appwrite.json b/scoop/appwrite.json index 0f955da..5cc3535 100644 --- a/scoop/appwrite.json +++ b/scoop/appwrite.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "5.0.1", + "version": "5.0.2", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.1/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.2/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.1/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/5.0.2/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe",