diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c2e7ef7..9f1f02bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 12.0.1 + +Fix type generation for `point`, `lineString` and `polygon` columns + ## 12.0.0 * Change `create-deployment-template`'s `version` parameter to `type` and `reference`. eg. usage - `create-deployment-template --type tag --reference 1.0.0` diff --git a/README.md b/README.md index 4ef5ae48..93b631ad 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -12.0.0 +12.0.1 ``` ### 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 -12.0.0 +12.0.1 ``` ## Getting Started diff --git a/install.ps1 b/install.ps1 index aad94fdf..347b4f30 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/12.0.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.1/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.1/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 3f1fe8c4..8620db85 100644 --- a/install.sh +++ b/install.sh @@ -97,7 +97,7 @@ printSuccess() { downloadBinary() { echo "[2/4] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="12.0.0" + GITHUB_LATEST_VERSION="12.0.1" 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 9f7de380..02937a6f 100644 --- a/lib/client.js +++ b/lib/client.js @@ -16,8 +16,8 @@ class Client { 'x-sdk-name': 'Command Line', 'x-sdk-platform': 'console', 'x-sdk-language': 'cli', - 'x-sdk-version': '12.0.0', - 'user-agent' : `AppwriteCLI/12.0.0 (${os.type()} ${os.version()}; ${os.arch()})`, + 'x-sdk-version': '12.0.1', + 'user-agent' : `AppwriteCLI/12.0.1 (${os.type()} ${os.version()}; ${os.arch()})`, 'X-Appwrite-Response-Format' : '1.8.0', }; } diff --git a/lib/commands/account.js b/lib/commands/account.js index 315cf0a8..edc7b7a7 100644 --- a/lib/commands/account.js +++ b/lib/commands/account.js @@ -454,7 +454,7 @@ const accountDeleteMFAAuthenticator = async ({type,parseOutput = true, overrideF const accountCreateMFAChallenge = async ({factor,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; - let apiPath = '/account/mfa/challenge'; + let apiPath = '/account/mfa/challenges'; let payload = {}; if (typeof factor !== 'undefined') { payload['factor'] = factor; @@ -488,7 +488,7 @@ const accountCreateMFAChallenge = async ({factor,parseOutput = true, overrideFor const accountUpdateMFAChallenge = async ({challengeId,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; - let apiPath = '/account/mfa/challenge'; + let apiPath = '/account/mfa/challenges'; let payload = {}; if (typeof challengeId !== 'undefined') { payload['challengeId'] = challengeId; diff --git a/lib/commands/vcs.js b/lib/commands/vcs.js index a29cb403..475646d0 100644 --- a/lib/commands/vcs.js +++ b/lib/commands/vcs.js @@ -86,6 +86,7 @@ const vcsCreateRepositoryDetection = async ({installationId,providerRepositoryId * @property {string} installationId Installation Id * @property {VCSDetectionType} type Detector type. Must be one of the following: runtime, framework * @property {string} search Search term to filter your list results. Max length: 256 chars. + * @property {string[]} 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 * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -94,7 +95,7 @@ const vcsCreateRepositoryDetection = async ({installationId,providerRepositoryId /** * @param {VcsListRepositoriesRequestParams} params */ -const vcsListRepositories = async ({installationId,type,search,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const vcsListRepositories = async ({installationId,type,search,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/vcs/github/installations/{installationId}/providerRepositories'.replace('{installationId}', installationId); @@ -105,6 +106,9 @@ const vcsListRepositories = async ({installationId,type,search,parseOutput = tru if (typeof search !== 'undefined') { payload['search'] = search; } + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } let response = undefined; @@ -403,6 +407,7 @@ vcs .requiredOption(`--installation-id `, `Installation Id`) .requiredOption(`--type `, `Detector type. Must be one of the following: runtime, framework`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) + .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`) .action(actionRunner(vcsListRepositories)) vcs diff --git a/lib/parser.js b/lib/parser.js index ce888870..8de61e4a 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -122,7 +122,7 @@ const parseError = (err) => { } catch { } - const version = '12.0.0'; + const version = '12.0.1'; const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``; const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud()}`; diff --git a/lib/type-generation/attribute.js b/lib/type-generation/attribute.js index 70bfc386..e36d0558 100644 --- a/lib/type-generation/attribute.js +++ b/lib/type-generation/attribute.js @@ -9,6 +9,9 @@ const AttributeType = { URL: "url", ENUM: "enum", RELATIONSHIP: "relationship", + POINT: "point", + LINESTRING: "linestring", + POLYGON: "polygon", }; module.exports = { diff --git a/lib/type-generation/languages/csharp.js b/lib/type-generation/languages/csharp.js index 3914d159..ff85bf67 100644 --- a/lib/type-generation/languages/csharp.js +++ b/lib/type-generation/languages/csharp.js @@ -33,6 +33,15 @@ class CSharp extends LanguageMeta { type = `List<${type}>`; } break; + case AttributeType.POINT: + type = "List"; + break; + case AttributeType.LINESTRING: + type = "List>"; + break; + case AttributeType.POLYGON: + type = "List>>"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/lib/type-generation/languages/dart.js b/lib/type-generation/languages/dart.js index d44efb93..d48ca486 100644 --- a/lib/type-generation/languages/dart.js +++ b/lib/type-generation/languages/dart.js @@ -70,6 +70,15 @@ class Dart extends LanguageMeta { type = `List<${type}>`; } break; + case AttributeType.POINT: + type = "List"; + break; + case AttributeType.LINESTRING: + type = "List>"; + break; + case AttributeType.POLYGON: + type = "List>>"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/lib/type-generation/languages/java.js b/lib/type-generation/languages/java.js index dfcf5e20..e45f22e5 100644 --- a/lib/type-generation/languages/java.js +++ b/lib/type-generation/languages/java.js @@ -33,6 +33,15 @@ class Java extends LanguageMeta { type = "List<" + type + ">"; } break; + case AttributeType.POINT: + type = "List"; + break; + case AttributeType.LINESTRING: + type = "List>"; + break; + case AttributeType.POLYGON: + type = "List>>"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/lib/type-generation/languages/javascript.js b/lib/type-generation/languages/javascript.js index 5c40f292..1d19cfb4 100644 --- a/lib/type-generation/languages/javascript.js +++ b/lib/type-generation/languages/javascript.js @@ -38,6 +38,15 @@ class JavaScript extends LanguageMeta { type = `${type}[]`; } break; + case AttributeType.POINT: + type = "number[]"; + break; + case AttributeType.LINESTRING: + type = "number[][]"; + break; + case AttributeType.POLYGON: + type = "number[][][]"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/lib/type-generation/languages/kotlin.js b/lib/type-generation/languages/kotlin.js index 09df341a..8cecd74b 100644 --- a/lib/type-generation/languages/kotlin.js +++ b/lib/type-generation/languages/kotlin.js @@ -33,6 +33,15 @@ class Kotlin extends LanguageMeta { type = `List<${type}>`; } break; + case AttributeType.POINT: + type = "List"; + break; + case AttributeType.LINESTRING: + type = "List>"; + break; + case AttributeType.POLYGON: + type = "List>>"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/lib/type-generation/languages/php.js b/lib/type-generation/languages/php.js index 713ed200..d316796f 100644 --- a/lib/type-generation/languages/php.js +++ b/lib/type-generation/languages/php.js @@ -36,6 +36,11 @@ class PHP extends LanguageMeta { type = "array"; } break; + case AttributeType.POINT: + case AttributeType.LINESTRING: + case AttributeType.POLYGON: + type = "array"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/lib/type-generation/languages/swift.js b/lib/type-generation/languages/swift.js index 87557bb3..8cb25748 100644 --- a/lib/type-generation/languages/swift.js +++ b/lib/type-generation/languages/swift.js @@ -33,6 +33,15 @@ class Swift extends LanguageMeta { type = `[${type}]`; } break; + case AttributeType.POINT: + type = "[Double]"; + break; + case AttributeType.LINESTRING: + type = "[[Double]]"; + break; + case AttributeType.POLYGON: + type = "[[[Double]]]"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/lib/type-generation/languages/typescript.js b/lib/type-generation/languages/typescript.js index 61a6fcb0..d3fdd67b 100644 --- a/lib/type-generation/languages/typescript.js +++ b/lib/type-generation/languages/typescript.js @@ -38,6 +38,15 @@ class TypeScript extends LanguageMeta { type = `${type}[]`; } break; + case AttributeType.POINT: + type = "Array"; + break; + case AttributeType.LINESTRING: + type = "Array>"; + break; + case AttributeType.POLYGON: + type = "Array>>"; + break; default: throw new Error(`Unknown attribute type: ${attribute.type}`); } diff --git a/package.json b/package.json index 33209c57..f2878153 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": "12.0.0", + "version": "12.0.1", "license": "BSD-3-Clause", "main": "index.js", "bin": { diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index 59e2d4f2..298461ab 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "12.0.0", + "version": "12.0.1", "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/12.0.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.1/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/12.0.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.1/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe",