Skip to content

Commit

Permalink
Merge pull request #120 from appwrite/fix-msg91-params
Browse files Browse the repository at this point in the history
Fix msg91 params
  • Loading branch information
christyjacob4 authored Apr 2, 2024
2 parents c42164d + 16c5f07 commit 0152cab
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
}
Expand Down
38 changes: 19 additions & 19 deletions lib/commands/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {};
Expand All @@ -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;
Expand Down Expand Up @@ -1085,17 +1085,17 @@ 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
*/

/**
* @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 = {};
Expand All @@ -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;

Expand Down Expand Up @@ -2497,9 +2497,9 @@ messaging
.description(`Create a new MSG91 provider.`)
.requiredOption(`--providerId <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 <name>`, `Provider name.`)
.option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
.option(`--senderId <senderId>`, `Msg91 Sender ID.`)
.option(`--authKey <authKey>`, `Msg91 Auth Key.`)
.option(`--templateId <templateId>`, `Msg91 template ID`)
.option(`--senderId <senderId>`, `Msg91 sender ID.`)
.option(`--authKey <authKey>`, `Msg91 auth key.`)
.option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
.action(actionRunner(messagingCreateMsg91Provider))

Expand All @@ -2509,9 +2509,9 @@ messaging
.requiredOption(`--providerId <providerId>`, `Provider ID.`)
.option(`--name <name>`, `Provider name.`)
.option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
.option(`--senderId <senderId>`, `Msg91 Sender ID.`)
.option(`--authKey <authKey>`, `Msg91 Auth Key.`)
.option(`--from <from>`, `Sender number.`)
.option(`--templateId <templateId>`, `Msg91 template ID.`)
.option(`--senderId <senderId>`, `Msg91 sender ID.`)
.option(`--authKey <authKey>`, `Msg91 auth key.`)
.action(actionRunner(messagingUpdateMsg91Provider))

messaging
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions scoop/appwrite.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 0152cab

Please sign in to comment.