diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8f94cb..942cfd9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,19 @@ # Change Log -## 20.2.0-rc.1 - -* Added: Code-signed Windows release binaries (`appwrite-cli-win-x64.exe` and `appwrite-cli-win-arm64.exe`) via SignPath +## 21.0.0 + +* Breaking: Renamed `project update-canonical-emails` to `update-deny-canonical-email-policy` +* Breaking: Renamed `project update-disposable-emails` to `update-deny-disposable-email-policy` +* Breaking: Renamed `project update-free-emails` to `update-deny-free-email-policy` +* Breaking: Renamed `proxy update-rule-verification` to `update-rule-status` +* Breaking: Removed `--search` option from `proxy list-rules` +* Breaking: `functions create-variable` and `sites create-variable` now require `--variable-id` +* Added: `databases create-big-int-attribute` and `update-big-int-attribute` commands +* Added: `tablesdb create-big-int-column` and `update-big-int-column` commands +* Added: `--prompt` option on `project update-o-auth-2-google` +* Added: Pagination and filter flags on `vcs list-repository-branches` and `sites list-variables` +* Added: `--on-duplicate` option on `migrations create-appwrite-migration`, `create-csv-import`, and `create-json-import` +* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` ## 20.1.0 diff --git a/README.md b/README.md index 86a3595b..f7ba8c51 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.9.3-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.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 -20.2.0-rc.1 +21.0.0 ``` ### Install using prebuilt binaries @@ -83,7 +83,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 -20.2.0-rc.1 +21.0.0 ``` ## Getting Started diff --git a/bun.lock b/bun.lock index de17313b..d4ec1760 100644 --- a/bun.lock +++ b/bun.lock @@ -5,7 +5,7 @@ "": { "name": "appwrite-cli", "dependencies": { - "@appwrite.io/console": "12.1.0", + "@appwrite.io/console": "13.0.0", "chalk": "4.1.2", "chokidar": "^3.6.0", "cli-progress": "^3.12.0", @@ -51,7 +51,7 @@ "tmp": "0.2.5", }, "packages": { - "@appwrite.io/console": ["@appwrite.io/console@12.1.0", "", { "dependencies": { "json-bigint": "1.0.0" } }, "sha512-pfI4UYCxEo8sGfub6UDDsQZxBu3b38x4d+SIQsZifRvKqCW+F7WRStxSQie6phw5dQaw/5SyEMEGhzURtj2MfQ=="], + "@appwrite.io/console": ["@appwrite.io/console@13.0.0", "", { "dependencies": { "json-bigint": "1.0.0" } }, "sha512-zbOSHBI/OjLrwxPpSVwj50Jb1EZMca1hEhGZLle/YOGRX//JGmzMNjhWFqaNVeglNqnx+V15p88VamQ4Kvv57A=="], "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], @@ -259,7 +259,7 @@ "@types/cli-progress": ["@types/cli-progress@3.11.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-cE3+jb9WRlu+uOSAugewNpITJDt1VF8dHOopPO4IABFc3SXYL5WE/+PTz/FCdZRRfIujiWW3n3aMbv1eIGVRWA=="], - "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + "@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="], "@types/inquirer": ["@types/inquirer@8.2.12", "", { "dependencies": { "@types/through": "*", "rxjs": "^7.2.0" } }, "sha512-YxURZF2ZsSjU5TAe06tW0M3sL4UI9AMPA6dd8I72uOtppzNafcY38xkYgCZ/vsVOAyNdzHmvtTpLWilOrbP0dQ=="], @@ -273,25 +273,25 @@ "@types/through": ["@types/through@0.0.33", "", { "dependencies": { "@types/node": "*" } }, "sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ=="], - "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.59.2", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.59.2", "@typescript-eslint/type-utils": "8.59.2", "@typescript-eslint/utils": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.59.2", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-j/bwmkBvHUtPNxzuWe5z6BEk3q54YRyGlBXkSsmfoih7zNrBvl5A9A98anlp/7JbyZcWIJ8KXo/3Tq/DjFLtuQ=="], + "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.59.3", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.59.3", "@typescript-eslint/type-utils": "8.59.3", "@typescript-eslint/utils": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.59.3", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw=="], - "@typescript-eslint/parser": ["@typescript-eslint/parser@8.59.2", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.59.2", "@typescript-eslint/types": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-plR3pp6D+SSUn1HM7xvSkx12/DhoHInI2YF35KAcVFNZvlC0gtrWqx7Qq1oH2Ssgi0vlFRCTbP+DZc7B9+TtsQ=="], + "@typescript-eslint/parser": ["@typescript-eslint/parser@8.59.3", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.59.3", "@typescript-eslint/types": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg=="], - "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.59.2", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.59.2", "@typescript-eslint/types": "^8.59.2", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-+2hqvEkeyf/0FBor67duF0Ll7Ot8jyKzDQOSrxazF/danillRq2DwR9dLptsXpoZQqxE1UisSmoZewrlPas9Vw=="], + "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.59.3", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.59.3", "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng=="], - "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.59.2", "", { "dependencies": { "@typescript-eslint/types": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2" } }, "sha512-JzfyEpEtOU89CcFSwyNS3mu4MLvLSXqnmX05+aKBDM+TdR5jzcGOEBwxwGNxrEQ7p/z6kK2WyioCGBf2zZBnvg=="], + "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.59.3", "", { "dependencies": { "@typescript-eslint/types": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3" } }, "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA=="], - "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.59.2", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-BKK4alN7oi4C/zv4VqHQ+uRU+lTa6JGIZ7s1juw7b3RHo9OfKB+bKX3u0iVZetdsUCBBkSbdWbarJbmN0fTeSw=="], + "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.59.3", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw=="], - "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.59.2", "", { "dependencies": { "@typescript-eslint/types": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2", "@typescript-eslint/utils": "8.59.2", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-nhqaj1nmTdVVl/BP5omXNRGO38jn5iosis2vbdmupF2txCf8ylWT8lx+JlvMYYVqzGVKtjojUFoQ3JRWK+mfzQ=="], + "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.59.3", "", { "dependencies": { "@typescript-eslint/types": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3", "@typescript-eslint/utils": "8.59.3", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ=="], - "@typescript-eslint/types": ["@typescript-eslint/types@8.59.2", "", {}, "sha512-e82GVOE8Ps3E++Egvb6Y3Dw0S10u8NkQ9KXmtRhCWJJ8kDhOJTvtMAWnFL16kB1583goCWXsr0NieKCZMs2/0Q=="], + "@typescript-eslint/types": ["@typescript-eslint/types@8.59.3", "", {}, "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg=="], - "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.59.2", "", { "dependencies": { "@typescript-eslint/project-service": "8.59.2", "@typescript-eslint/tsconfig-utils": "8.59.2", "@typescript-eslint/types": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-o0XPGNwcWw+FIwStOWn+BwBuEmL6QXP0rsvAFg7ET1dey1Nr6Wb1ac8p5HEsK0ygO/6mUxlk+YWQD9xcb/nnXg=="], + "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.59.3", "", { "dependencies": { "@typescript-eslint/project-service": "8.59.3", "@typescript-eslint/tsconfig-utils": "8.59.3", "@typescript-eslint/types": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg=="], - "@typescript-eslint/utils": ["@typescript-eslint/utils@8.59.2", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.59.2", "@typescript-eslint/types": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-Juw3EinkXqjaffxz6roowvV7GZT/kET5vSKKZT6upl5TXdWkLkYmNPXwDDL2Vkt2DPn0nODIS4egC/0AGxKo/Q=="], + "@typescript-eslint/utils": ["@typescript-eslint/utils@8.59.3", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.59.3", "@typescript-eslint/types": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg=="], - "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.59.2", "", { "dependencies": { "@typescript-eslint/types": "8.59.2", "eslint-visitor-keys": "^5.0.0" } }, "sha512-NwjLUnGy8/Zfx23fl50tRC8rYaYnM52xNRYFAXvmiil9yh1+K6aRVQMnzW6gQB/1DLgWt977lYQn7C+wtgXZiA=="], + "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.59.3", "", { "dependencies": { "@typescript-eslint/types": "8.59.3", "eslint-visitor-keys": "^5.0.0" } }, "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg=="], "@xmldom/xmldom": ["@xmldom/xmldom@0.9.10", "", {}, "sha512-A9gOqLdi6cV4ibazAjcQufGj0B1y/vDqYrcuP6d/6x8P27gRS8643Dj9o1dEKtB6O7fwxb2FgBmJS2mX7gpvdw=="], @@ -503,7 +503,7 @@ "fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="], - "fs-extra": ["fs-extra@11.3.4", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA=="], + "fs-extra": ["fs-extra@11.3.5", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg=="], "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], @@ -513,7 +513,7 @@ "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], - "get-east-asian-width": ["get-east-asian-width@1.5.0", "", {}, "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA=="], + "get-east-asian-width": ["get-east-asian-width@1.6.0", "", {}, "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA=="], "get-stream": ["get-stream@6.0.1", "", {}, "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="], @@ -665,7 +665,7 @@ "neo-async": ["neo-async@2.6.2", "", {}, "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="], - "node-abi": ["node-abi@3.91.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-B+S7X/GS3Un6wMICtnsNjQD7oSpVBQrZftHE6GZ1Fe9/k3XOOoqbM5DZZ0GO4x3YiSCQfrM28yj1ppplwgIsfg=="], + "node-abi": ["node-abi@3.92.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ=="], "node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], @@ -773,7 +773,7 @@ "sax": ["sax@1.6.0", "", {}, "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA=="], - "semver": ["semver@7.7.4", "", { "bin": "bin/semver.js" }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], + "semver": ["semver@7.8.0", "", { "bin": "bin/semver.js" }, "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA=="], "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], @@ -813,7 +813,7 @@ "tail": ["tail@2.2.6", "", {}, "sha512-IQ6G4wK/t8VBauYiGPLx+d3fA5XjSVagjWV5SIYzvEvglbQjwEcukeYI68JOPpdydjxhZ9sIgzRlSmwSpphHyw=="], - "tar": ["tar@7.5.14", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-/7sHKgQO3JLP9ESlwTYUUftHUadOURUqq23xs1vjcnp8Vss6k0wCfzulyEtk5g91pjvnuriimGlyG7k6msrzRw=="], + "tar": ["tar@7.5.15", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ=="], "tar-fs": ["tar-fs@3.1.2", "", { "dependencies": { "pump": "^3.0.0", "tar-stream": "^3.1.5" }, "optionalDependencies": { "bare-fs": "^4.0.1", "bare-path": "^3.0.0" } }, "sha512-QGxxTxxyleAdyM3kpFs14ymbYmNFrfY+pHj7Z8FgtbZ7w2//VAgLMac7sT6nRpIHjppXO2AwwEOg0bPFVRcmXw=="], @@ -857,7 +857,7 @@ "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], - "typescript-eslint": ["typescript-eslint@8.59.2", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.59.2", "@typescript-eslint/parser": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2", "@typescript-eslint/utils": "8.59.2" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-pJw051uomb3ZeCzGTpRb8RbEqB5Y4WWet8gl/GcTlU35BSx0PVdZ86/bqkQCyKKuraVQEK7r6kBHQXF+fBhkoQ=="], + "typescript-eslint": ["typescript-eslint@8.59.3", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.59.3", "@typescript-eslint/parser": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3", "@typescript-eslint/utils": "8.59.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg=="], "uglify-js": ["uglify-js@3.19.3", "", { "bin": { "uglifyjs": "bin/uglifyjs" } }, "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ=="], @@ -1139,7 +1139,7 @@ "@jimp/plugins/@jimp/plugin-threshold/@jimp/utils": ["@jimp/utils@0.14.0", "", { "dependencies": { "@babel/runtime": "^7.7.2", "regenerator-runtime": "^0.13.3" } }, "sha512-MY5KFYUru0y74IsgM/9asDwb3ERxWxXEu3CRCZEvE7DtT86y1bR1XgtlSliMrptjz4qbivNGMQSvUBpEFJDp1A=="], - "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@5.0.5", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ=="], + "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@5.0.6", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g=="], "cli-progress/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md new file mode 100644 index 00000000..4ac556d6 --- /dev/null +++ b/docs/examples/databases/create-big-int-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-big-int-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false +``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md new file mode 100644 index 00000000..fdb8fe60 --- /dev/null +++ b/docs/examples/databases/update-big-int-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-big-int-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default null +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 1b6fe426..57d8344f 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,6 +1,7 @@ ```bash appwrite functions create-variable \ --function-id \ + --variable-id \ --key \ --value ``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 5639a066..2f9db0e4 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,4 +1,5 @@ ```bash appwrite functions list-variables \ - --function-id + --function-id \ + --limit 25 ``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 7c7e7583..b8bd3dbf 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,6 +1,5 @@ ```bash appwrite functions update-variable \ --function-id \ - --variable-id \ - --key + --variable-id ``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index d80508a3..d4ab3852 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -1,5 +1,5 @@ ```bash appwrite project create-ephemeral-key \ --scopes one two three \ - --duration 1 + --duration 600 ``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index ba47af11..1c54d95c 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -1,4 +1,4 @@ ```bash appwrite project get-o-auth-2-provider \ - --provider + --provider-id amazon ``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md index df16be41..fe4d21d1 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -1,3 +1,4 @@ ```bash -appwrite project list-o-auth-2-providers +appwrite project list-o-auth-2-providers \ + --limit 25 ``` diff --git a/docs/examples/project/update-canonical-emails.md b/docs/examples/project/update-canonical-emails.md deleted file mode 100644 index 4839b77e..00000000 --- a/docs/examples/project/update-canonical-emails.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite project update-canonical-emails \ - --enabled false -``` diff --git a/docs/examples/project/update-deny-canonical-email-policy.md b/docs/examples/project/update-deny-canonical-email-policy.md new file mode 100644 index 00000000..a70582e4 --- /dev/null +++ b/docs/examples/project/update-deny-canonical-email-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-deny-canonical-email-policy \ + --enabled false +``` diff --git a/docs/examples/project/update-deny-disposable-email-policy.md b/docs/examples/project/update-deny-disposable-email-policy.md new file mode 100644 index 00000000..1764d04d --- /dev/null +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-deny-disposable-email-policy \ + --enabled false +``` diff --git a/docs/examples/project/update-deny-free-email-policy.md b/docs/examples/project/update-deny-free-email-policy.md new file mode 100644 index 00000000..c12ac126 --- /dev/null +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-deny-free-email-policy \ + --enabled false +``` diff --git a/docs/examples/project/update-disposable-emails.md b/docs/examples/project/update-disposable-emails.md deleted file mode 100644 index b6b3cae4..00000000 --- a/docs/examples/project/update-disposable-emails.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite project update-disposable-emails \ - --enabled false -``` diff --git a/docs/examples/project/update-free-emails.md b/docs/examples/project/update-free-emails.md deleted file mode 100644 index 0c386adf..00000000 --- a/docs/examples/project/update-free-emails.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite project update-free-emails \ - --enabled false -``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md new file mode 100644 index 00000000..4c9b24e3 --- /dev/null +++ b/docs/examples/proxy/update-rule-status.md @@ -0,0 +1,4 @@ +```bash +appwrite proxy update-rule-status \ + --rule-id +``` diff --git a/docs/examples/proxy/update-rule-verification.md b/docs/examples/proxy/update-rule-verification.md deleted file mode 100644 index 3e5734d2..00000000 --- a/docs/examples/proxy/update-rule-verification.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite proxy update-rule-verification \ - --rule-id -``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 100ac21e..21d7c65c 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -1,6 +1,7 @@ ```bash appwrite sites create-variable \ --site-id \ + --variable-id \ --key \ --value ``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 67861820..49f6b833 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -1,4 +1,5 @@ ```bash appwrite sites list-variables \ - --site-id + --site-id \ + --limit 25 ``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 06fe2cd7..e8a2d4b7 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -1,6 +1,5 @@ ```bash appwrite sites update-variable \ --site-id \ - --variable-id \ - --key + --variable-id ``` diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md new file mode 100644 index 00000000..49167996 --- /dev/null +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tables-db create-big-int-column \ + --database-id \ + --table-id \ + --key '' \ + --required false +``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md new file mode 100644 index 00000000..267ec29d --- /dev/null +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tables-db update-big-int-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default null +``` diff --git a/docs/examples/vcs/list-repository-branches.md b/docs/examples/vcs/list-repository-branches.md index cfa8d0fa..cb495368 100644 --- a/docs/examples/vcs/list-repository-branches.md +++ b/docs/examples/vcs/list-repository-branches.md @@ -1,5 +1,6 @@ ```bash appwrite vcs list-repository-branches \ --installation-id \ - --provider-repository-id + --provider-repository-id \ + --limit 25 ``` diff --git a/install.ps1 b/install.ps1 index be9cef55..748f0c1e 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/20.2.0-rc.1/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0-rc.1/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 3205ff00..ce2b248c 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="20.2.0-rc.1" + GITHUB_LATEST_VERSION="21.0.0" 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/commands/config.ts b/lib/commands/config.ts index b40bee64..662f3115 100644 --- a/lib/commands/config.ts +++ b/lib/commands/config.ts @@ -211,6 +211,7 @@ const AttributeSchema = z "mediumtext", "longtext", "integer", + "bigint", "double", "boolean", "datetime", @@ -291,6 +292,7 @@ const ColumnSchema = z "mediumtext", "longtext", "integer", + "bigint", "double", "boolean", "datetime", diff --git a/lib/commands/init.ts b/lib/commands/init.ts index 0d7c1989..a77b345f 100644 --- a/lib/commands/init.ts +++ b/lib/commands/init.ts @@ -276,6 +276,13 @@ const initProject = async ({ projectId, projectName, }: InitProjectOptions = {}): Promise => { + try { + localConfig.useCwdConfig(); + } catch (e) { + error(e instanceof Error ? e.message : String(e)); + process.exit(1); + } + try { if (globalConfig.getEndpoint() === "" || globalConfig.getCookie() === "") { throw new Error( diff --git a/lib/commands/push.ts b/lib/commands/push.ts index c1415f92..5cde7466 100644 --- a/lib/commands/push.ts +++ b/lib/commands/push.ts @@ -89,7 +89,7 @@ import { sdkForProject, sdkForConsole } from "../sdks.js"; import { ServiceId, ProtocolId, - MethodId, + AuthMethod, AppwriteException, Client, ImageFormat, @@ -1108,7 +1108,7 @@ export class Push { this.log("Applying auth methods statuses ..."); for (const [method, status] of Object.entries(settings.auth.methods)) { await projectService.updateAuthMethod({ - methodId: method as MethodId, + methodId: method as AuthMethod, enabled: status, }); } @@ -1552,6 +1552,7 @@ export class Push { ); await functionsServiceCreate.createVariable({ functionId: func["$id"], + variableId: ID.unique(), key: variable.key, value: variable.value, secret: false, @@ -2060,6 +2061,7 @@ export class Push { ); await sitesServiceCreate.createVariable({ siteId: site["$id"], + variableId: ID.unique(), key: variable.key, value: variable.value, secret: false, diff --git a/lib/commands/services/account.ts b/lib/commands/services/account.ts index da7e5f33..8f181998 100644 --- a/lib/commands/services/account.ts +++ b/lib/commands/services/account.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForConsole } from "../../sdks.js"; import { @@ -85,14 +86,15 @@ This endpoint can also be used to convert an anonymous account to a normal one, const accountListIdentitiesCommand = account .command(`list-identities`) .description(`Get the list of identities for the currently logged in user.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, provider, providerUid, providerEmail, providerAccessTokenExpiry`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, provider, providerUid, providerEmail, providerAccessTokenExpiry`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -101,8 +103,8 @@ const accountListIdentitiesCommand = account .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getAccountClient()).listIdentities(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getAccountClient()).listIdentities(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); diff --git a/lib/commands/services/backups.ts b/lib/commands/services/backups.ts index e2f01bb5..10f148f0 100644 --- a/lib/commands/services/backups.ts +++ b/lib/commands/services/backups.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -34,8 +35,9 @@ export const backups = new Command("backups") const backupsListArchivesCommand = backups .command(`list-archives`) .description(`List all archives for a project.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -44,8 +46,8 @@ const backupsListArchivesCommand = backups .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getBackupsClient()).listArchives(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getBackupsClient()).listArchives(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); @@ -90,8 +92,9 @@ const backupsDeleteArchiveCommand = backups const backupsListPoliciesCommand = backups .command(`list-policies`) .description(`List all policies for a project.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -100,8 +103,8 @@ const backupsListPoliciesCommand = backups .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getBackupsClient()).listPolicies(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getBackupsClient()).listPolicies(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); @@ -192,8 +195,9 @@ const backupsCreateRestorationCommand = backups const backupsListRestorationsCommand = backups .command(`list-restorations`) .description(`List all backup restorations for a project.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -202,8 +206,8 @@ const backupsListRestorationsCommand = backups .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getBackupsClient()).listRestorations(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getBackupsClient()).listRestorations(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); diff --git a/lib/commands/services/databases.ts b/lib/commands/services/databases.ts index a62f7afb..171a2ce9 100644 --- a/lib/commands/services/databases.ts +++ b/lib/commands/services/databases.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -35,7 +36,7 @@ export const databases = new Command("databases") const databasesListCommand = databases .command(`list`) .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -43,7 +44,8 @@ const databasesListCommand = databases (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -52,8 +54,8 @@ const databasesListCommand = databases .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getDatabasesClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getDatabasesClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -81,8 +83,9 @@ const databasesCreateCommand = databases const databasesListTransactionsCommand = databases .command(`list-transactions`) .description(`List transactions across all databases.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries).`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries).`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -91,8 +94,8 @@ const databasesListTransactionsCommand = databases .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getDatabasesClient()).listTransactions(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getDatabasesClient()).listTransactions(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); @@ -229,7 +232,7 @@ const databasesListCollectionsCommand = databases .command(`list-collections`) .description(`Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`) .requiredOption(`--database-id `, `Database ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, enabled, documentSecurity`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, enabled, documentSecurity`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -237,7 +240,8 @@ const databasesListCollectionsCommand = databases (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -246,8 +250,8 @@ const databasesListCollectionsCommand = databases .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getDatabasesClient()).listCollections(databaseId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ databaseId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getDatabasesClient()).listCollections(databaseId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -345,14 +349,15 @@ const databasesListAttributesCommand = databases .description(`List attributes in the collection.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, type, size, required, array, status, error`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, type, size, required, array, status, error`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -361,8 +366,53 @@ const databasesListAttributesCommand = databases .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, collectionId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getDatabasesClient()).listAttributes(databaseId, collectionId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ databaseId, collectionId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getDatabasesClient()).listAttributes(databaseId, collectionId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + ), + ); + + +const databasesCreateBigIntAttributeCommand = databases + .command(`create-big-int-attribute`) + .description(`Create a bigint attribute. Optionally, minimum and maximum values can be provided. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--collection-id `, `Collection ID.`) + .requiredOption(`--key `, `Attribute Key.`) + .requiredOption(`--required `, `Is attribute required?`, parseBool) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when attribute is required.`, parseInteger) + .option( + `--array [value]`, + `Is attribute an array?`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .action( + actionRunner( + async ({ databaseId, collectionId, key, required, min, max, xdefault, array }) => + parse(await (await getDatabasesClient()).createBigIntAttribute(databaseId, collectionId, key, required, min, max, xdefault, array)), + ), + ); + + +const databasesUpdateBigIntAttributeCommand = databases + .command(`update-big-int-attribute`) + .description(`Update a bigint attribute. Changing the \`default\` value will not update already existing documents. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--collection-id `, `Collection ID.`) + .requiredOption(`--key `, `Attribute Key.`) + .requiredOption(`--required `, `Is attribute required?`, parseBool) + .requiredOption(`--xdefault `, `Default value. Cannot be set when attribute is required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--new-key `, `New Attribute Key.`) + .action( + actionRunner( + async ({ databaseId, collectionId, key, required, xdefault, min, max, newKey }) => + parse(await (await getDatabasesClient()).updateBigIntAttribute(databaseId, collectionId, key, required, xdefault, min, max, newKey)), ), ); @@ -1120,7 +1170,7 @@ const databasesListDocumentsCommand = databases .description(`Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service server integration (https://appwrite.io/docs/server/databases#databasesCreateCollection).`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, pagination, and selection prefer --where, --sort-asc, --sort-desc, --limit, --offset, and --select. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, pagination, and selection prefer --filter, --sort-asc, --sort-desc, --limit, --offset, and --select. When mixed, raw --queries are sent before generated flag 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.`) .option(`--transaction-id `, `Transaction ID to read uncommitted changes within the transaction.`) .option( `--total [value]`, @@ -1129,7 +1179,8 @@ const databasesListDocumentsCommand = databases value === undefined ? true : parseBool(value), ) .option(`--ttl `, `TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).`, parseInteger) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1139,8 +1190,8 @@ const databasesListDocumentsCommand = databases .option(`--select `, `Attribute to include in the response. Repeat for multiple attributes.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .action( actionRunner( - async ({ databaseId, collectionId, queries, transactionId, total, ttl, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }) => - parse(await (await getDatabasesClient()).listDocuments(databaseId, collectionId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }), transactionId, total, ttl)), + async ({ databaseId, collectionId, queries, transactionId, total, ttl, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }) => + parse(await (await getDatabasesClient()).listDocuments(databaseId, collectionId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }), transactionId, total, ttl)), ), ); @@ -1199,9 +1250,10 @@ const databasesUpdateDocumentsCommand = databases .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .option(`--data `, `Document data as JSON object. Include only attribute and value pairs to be updated.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) .option(`--transaction-id `, `Transaction ID for staging the operation.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1210,8 +1262,8 @@ const databasesUpdateDocumentsCommand = databases .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, collectionId, data, queries, transactionId, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getDatabasesClient()).updateDocuments(databaseId, collectionId, parseJsonObject(data, "--data"), buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), + async ({ databaseId, collectionId, data, queries, transactionId, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getDatabasesClient()).updateDocuments(databaseId, collectionId, parseJsonObject(data, "--data"), buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), ), ); @@ -1221,9 +1273,10 @@ const databasesDeleteDocumentsCommand = databases .description(`Bulk delete documents using queries, if no queries are passed then all documents are deleted.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service server integration (https://appwrite.io/docs/server/databases#databasesCreateCollection).`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) .option(`--transaction-id `, `Transaction ID for staging the operation.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1232,8 +1285,8 @@ const databasesDeleteDocumentsCommand = databases .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, collectionId, queries, transactionId, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getDatabasesClient()).deleteDocuments(databaseId, collectionId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), + async ({ databaseId, collectionId, queries, transactionId, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getDatabasesClient()).deleteDocuments(databaseId, collectionId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), ), ); @@ -1362,14 +1415,15 @@ const databasesListIndexesCommand = databases .description(`List indexes in the collection.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service server integration (https://appwrite.io/docs/server/databases#databasesCreateCollection).`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, type, status, attributes, error`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, type, status, attributes, error`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1378,8 +1432,8 @@ const databasesListIndexesCommand = databases .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, collectionId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getDatabasesClient()).listIndexes(databaseId, collectionId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ databaseId, collectionId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getDatabasesClient()).listIndexes(databaseId, collectionId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); diff --git a/lib/commands/services/functions.ts b/lib/commands/services/functions.ts index db803b47..d289401e 100644 --- a/lib/commands/services/functions.ts +++ b/lib/commands/services/functions.ts @@ -4,7 +4,8 @@ import { resolveFileParam } from "../utils/deployment.js"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -37,7 +38,7 @@ export const functions = new Command("functions") const functionsListCommand = functions .command(`list`) .description(`Get a list of all the project's functions. You can use the query params to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -45,7 +46,8 @@ const functionsListCommand = functions (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -54,8 +56,8 @@ const functionsListCommand = functions .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getFunctionsClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getFunctionsClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -258,7 +260,7 @@ const functionsListDeploymentsCommand = functions .command(`list-deployments`) .description(`Get a list of all the function's code deployments. You can use the query params to filter your results.`) .requiredOption(`--function-id `, `Function ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -266,7 +268,8 @@ const functionsListDeploymentsCommand = functions (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -275,8 +278,8 @@ const functionsListDeploymentsCommand = functions .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ functionId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getFunctionsClient()).listDeployments(functionId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ functionId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getFunctionsClient()).listDeployments(functionId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -425,14 +428,15 @@ const functionsListExecutionsCommand = functions .command(`list-executions`) .description(`Get a list of all the current user function execution logs. You can use the query params to filter your results.`) .requiredOption(`--function-id `, `Function ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -441,8 +445,8 @@ const functionsListExecutionsCommand = functions .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ functionId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getFunctionsClient()).listExecutions(functionId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ functionId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getFunctionsClient()).listExecutions(functionId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -513,10 +517,25 @@ const functionsListVariablesCommand = functions .command(`list-variables`) .description(`Get a list of all variables of a specific function.`) .requiredOption(`--function-id `, `Function unique ID.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, resourceType, resourceId, secret`) + .option( + `--total [value]`, + `When set to false, the total count returned will be 0 and will not be calculated.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) + .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .option(`--cursor-after `, `Return results after this cursor ID.`) + .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ functionId }) => - parse(await (await getFunctionsClient()).listVariables(functionId)), + async ({ functionId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getFunctionsClient()).listVariables(functionId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -525,6 +544,7 @@ const functionsCreateVariableCommand = functions .command(`create-variable`) .description(`Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.`) .requiredOption(`--function-id `, `Function unique ID.`) + .requiredOption(`--variable-id `, `Variable 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(`--key `, `Variable key. Max length: 255 chars.`) .requiredOption(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -535,8 +555,8 @@ const functionsCreateVariableCommand = functions ) .action( actionRunner( - async ({ functionId, key, value, secret }) => - parse(await (await getFunctionsClient()).createVariable(functionId, key, value, secret)), + async ({ functionId, variableId, key, value, secret }) => + parse(await (await getFunctionsClient()).createVariable(functionId, variableId, key, value, secret)), ), ); @@ -559,7 +579,7 @@ const functionsUpdateVariableCommand = functions .description(`Update variable by its unique ID.`) .requiredOption(`--function-id `, `Function unique ID.`) .requiredOption(`--variable-id `, `Variable unique ID.`) - .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) + .option(`--key `, `Variable key. Max length: 255 chars.`) .option(`--value `, `Variable value. Max length: 8192 chars.`) .option( `--secret [value]`, diff --git a/lib/commands/services/messaging.ts b/lib/commands/services/messaging.ts index e3c22457..652bfca9 100644 --- a/lib/commands/services/messaging.ts +++ b/lib/commands/services/messaging.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -35,7 +36,7 @@ export const messaging = new Command("messaging") const messagingListMessagesCommand = messaging .command(`list-messages`) .description(`Get a list of all messages from the current Appwrite project.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -43,7 +44,8 @@ const messagingListMessagesCommand = messaging (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -52,8 +54,8 @@ const messagingListMessagesCommand = messaging .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMessagingClient()).listMessages(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMessagingClient()).listMessages(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -313,14 +315,15 @@ const messagingListTargetsCommand = messaging .command(`list-targets`) .description(`Get a list of the targets associated with a message.`) .requiredOption(`--message-id `, `Message ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, providerId, identifier, providerType`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, providerId, identifier, providerType`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -329,8 +332,8 @@ const messagingListTargetsCommand = messaging .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ messageId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMessagingClient()).listTargets(messageId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ messageId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMessagingClient()).listTargets(messageId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -338,7 +341,7 @@ const messagingListTargetsCommand = messaging const messagingListProvidersCommand = messaging .command(`list-providers`) .description(`Get a list of all providers from the current Appwrite project.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, provider, type, enabled`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, provider, type, enabled`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -346,7 +349,8 @@ const messagingListProvidersCommand = messaging (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -355,8 +359,8 @@ const messagingListProvidersCommand = messaging .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMessagingClient()).listProviders(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMessagingClient()).listProviders(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -977,7 +981,7 @@ const messagingListSubscriberLogsCommand = messaging const messagingListTopicsCommand = messaging .command(`list-topics`) .description(`Get a list of all topics from the current Appwrite project.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, description, emailTotal, smsTotal, pushTotal`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, description, emailTotal, smsTotal, pushTotal`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -985,7 +989,8 @@ const messagingListTopicsCommand = messaging (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -994,8 +999,8 @@ const messagingListTopicsCommand = messaging .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMessagingClient()).listTopics(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMessagingClient()).listTopics(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -1079,7 +1084,7 @@ const messagingListSubscribersCommand = messaging .command(`list-subscribers`) .description(`Get a list of all subscribers from the current Appwrite project.`) .requiredOption(`--topic-id `, `Topic ID. The topic ID subscribed to.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: targetId, topicId, userId, providerType`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: targetId, topicId, userId, providerType`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -1087,7 +1092,8 @@ const messagingListSubscribersCommand = messaging (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1096,8 +1102,8 @@ const messagingListSubscribersCommand = messaging .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ topicId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMessagingClient()).listSubscribers(topicId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ topicId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMessagingClient()).listSubscribers(topicId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); diff --git a/lib/commands/services/migrations.ts b/lib/commands/services/migrations.ts index 9b7c2bd7..ae8fce38 100644 --- a/lib/commands/services/migrations.ts +++ b/lib/commands/services/migrations.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -34,7 +35,7 @@ export const migrations = new Command("migrations") const migrationsListCommand = migrations .command(`list`) .description(`List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, resourceId, resourceType, statusCounters, resourceData, errors`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, resourceId, resourceType, statusCounters, resourceData, errors`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -42,7 +43,8 @@ const migrationsListCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -51,8 +53,8 @@ const migrationsListCommand = migrations .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMigrationsClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMigrationsClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -64,10 +66,11 @@ const migrationsCreateAppwriteMigrationCommand = migrations .requiredOption(`--endpoint `, `Source Appwrite endpoint`) .requiredOption(`--project-id `, `Source Project ID`) .requiredOption(`--api-key `, `Source API Key`) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ resources, endpoint, projectId, apiKey }) => - parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey)), + async ({ resources, endpoint, projectId, apiKey, onDuplicate }) => + parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey, onDuplicate)), ), ); @@ -93,7 +96,7 @@ const migrationsCreateCSVExportCommand = migrations .requiredOption(`--resource-id `, `Composite ID in the format {databaseId:collectionId}, identifying a collection within a database to export.`) .requiredOption(`--filename `, `The name of the file to be created for the export, excluding the .csv extension.`) .option(`--columns [columns...]`, `List of attributes to export. If empty, all attributes will be exported. You can use the \`*\` wildcard to export all attributes from the collection.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK to filter documents to export. Learn more about queries (https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK to filter documents to export. Learn more about queries (https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.`) .option(`--delimiter `, `The character that separates each column value. Default is comma.`) .option(`--enclosure `, `The character that encloses each column value. Default is double quotes.`) .option(`--escape `, `The escape character for the enclosure character. Default is double quotes.`) @@ -109,7 +112,8 @@ const migrationsCreateCSVExportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -118,8 +122,8 @@ const migrationsCreateCSVExportCommand = migrations .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ resourceId, filename, columns, queries, delimiter, enclosure, escape, header, notify, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMigrationsClient()).createCSVExport(resourceId, filename, columns, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), delimiter, enclosure, escape, header, notify)), + async ({ resourceId, filename, columns, queries, delimiter, enclosure, escape, header, notify, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMigrationsClient()).createCSVExport(resourceId, filename, columns, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), delimiter, enclosure, escape, header, notify)), ), ); @@ -136,10 +140,11 @@ const migrationsCreateCSVImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile }) => - parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile)), + async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => + parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), ), ); @@ -177,14 +182,15 @@ const migrationsCreateJSONExportCommand = migrations .requiredOption(`--resource-id `, `Composite ID in the format {databaseId:collectionId}, identifying a collection within a database to export.`) .requiredOption(`--filename `, `The name of the file to be created for the export, excluding the .json extension.`) .option(`--columns [columns...]`, `List of attributes to export. If empty, all attributes will be exported. You can use the \`*\` wildcard to export all attributes from the collection.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK to filter documents to export. Learn more about queries (https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK to filter documents to export. Learn more about queries (https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.`) .option( `--notify [value]`, `Set to true to receive an email when the export is complete. Default is true.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -193,8 +199,8 @@ const migrationsCreateJSONExportCommand = migrations .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ resourceId, filename, columns, queries, notify, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getMigrationsClient()).createJSONExport(resourceId, filename, columns, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), notify)), + async ({ resourceId, filename, columns, queries, notify, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getMigrationsClient()).createJSONExport(resourceId, filename, columns, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), notify)), ), ); @@ -212,10 +218,11 @@ const migrationsCreateJSONImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile }) => - parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile)), + async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => + parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), ), ); diff --git a/lib/commands/services/organizations.ts b/lib/commands/services/organizations.ts index 94c47600..75554213 100644 --- a/lib/commands/services/organizations.ts +++ b/lib/commands/services/organizations.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForConsole } from "../../sdks.js"; import { @@ -34,9 +35,10 @@ export const organizations = new Command("organizations") const organizationsListCommand = organizations .command(`list`) .description(`Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, total, billingPlan, paymentMethodId, backupPaymentMethodId, platform`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, total, billingPlan, paymentMethodId, backupPaymentMethodId, platform`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -45,8 +47,8 @@ const organizationsListCommand = organizations .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getOrganizationsClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search)), + async ({ queries, search, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getOrganizationsClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search)), ), ); @@ -187,8 +189,9 @@ const organizationsListAggregationsCommand = organizations .command(`list-aggregations`) .description(`Get a list of all aggregations for an organization.`) .requiredOption(`--organization-id `, `Organization ID`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: teamId, aggregationId, from, to`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: teamId, aggregationId, from, to`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -197,8 +200,8 @@ const organizationsListAggregationsCommand = organizations .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ organizationId, queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getOrganizationsClient()).listAggregations(organizationId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ organizationId, queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getOrganizationsClient()).listAggregations(organizationId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); @@ -263,8 +266,9 @@ const organizationsListCreditsCommand = organizations .description(`List all credits for an organization. `) .requiredOption(`--organization-id `, `Organization ID`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: teamId, couponId, credits, expiration, status`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: teamId, couponId, credits, expiration, status`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -273,8 +277,8 @@ const organizationsListCreditsCommand = organizations .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ organizationId, queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getOrganizationsClient()).listCredits(organizationId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ organizationId, queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getOrganizationsClient()).listCredits(organizationId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index b30e5580..e400d9bc 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -54,53 +55,18 @@ const projectUpdateAuthMethodCommand = project ); -const projectUpdateCanonicalEmailsCommand = project - .command(`update-canonical-emails`) - .description(`Configure if canonical emails (alias subaddresses and emails with suffixes) are allowed during new users sign-ups in this project.`) - .requiredOption(`--enabled `, `Set whether or not to require canonical email addresses during signup and email updates.`, parseBool) - .action( - actionRunner( - async ({ enabled }) => - parse(await (await getProjectClient()).updateCanonicalEmails(enabled)), - ), - ); - - -const projectUpdateDisposableEmailsCommand = project - .command(`update-disposable-emails`) - .description(`Configure if disposable emails (emails of known temporary domains) are allowed during new users sign-ups in this project.`) - .requiredOption(`--enabled `, `Set whether or not to block disposable email addresses during signup and email updates.`, parseBool) - .action( - actionRunner( - async ({ enabled }) => - parse(await (await getProjectClient()).updateDisposableEmails(enabled)), - ), - ); - - -const projectUpdateFreeEmailsCommand = project - .command(`update-free-emails`) - .description(`Configure if free emails (non-commercial and not a custom domain) are allowed during new users sign-ups in this project.`) - .requiredOption(`--enabled `, `Set whether or not to block free email addresses during signup and email updates.`, parseBool) - .action( - actionRunner( - async ({ enabled }) => - parse(await (await getProjectClient()).updateFreeEmails(enabled)), - ), - ); - - const projectListKeysCommand = project .command(`list-keys`) .description(`Get a list of all API keys from the current project.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: expire, accessedAt, name, scopes`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: expire, accessedAt, name, scopes`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -109,8 +75,8 @@ const projectListKeysCommand = project .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProjectClient()).listKeys(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProjectClient()).listKeys(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -271,9 +237,19 @@ const projectDeleteMockPhoneCommand = project const projectListOAuth2ProvidersCommand = project .command(`list-o-auth-2-providers`) .description(`Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common pagination prefer --limit and --offset. When mixed, raw --queries are sent before generated flag 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`) + .option( + `--total [value]`, + `When set to false, the total count returned will be 0 and will not be calculated.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) .action( actionRunner( - async () => parse(await (await getProjectClient()).listOAuth2Providers()), + async ({ queries, total, limit, offset }) => + parse(await (await getProjectClient()).listOAuth2Providers(buildQueries({ queries, limit, offset }), total)), ), ); @@ -631,6 +607,7 @@ const projectUpdateOAuth2GoogleCommand = project .description(`Update the project OAuth2 Google configuration.`) .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com`) .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj`) + .option(`--prompt [prompt...]`, `Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account.`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -639,8 +616,8 @@ const projectUpdateOAuth2GoogleCommand = project ) .action( actionRunner( - async ({ clientId, clientSecret, enabled }) => - parse(await (await getProjectClient()).updateOAuth2Google(clientId, clientSecret, enabled)), + async ({ clientId, clientSecret, prompt, enabled }) => + parse(await (await getProjectClient()).updateOAuth2Google(clientId, clientSecret, prompt, enabled)), ), ); @@ -1094,11 +1071,11 @@ const projectUpdateOAuth2ZoomCommand = project const projectGetOAuth2ProviderCommand = project .command(`get-o-auth-2-provider`) .description(`Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty.`) - .requiredOption(`--provider `, `OAuth2 provider key. For example: github, google, apple.`) + .requiredOption(`--provider-id `, `OAuth2 provider key. For example: github, google, apple.`) .action( actionRunner( - async ({ provider }) => - parse(await (await getProjectClient()).getOAuth2Provider(provider)), + async ({ providerId }) => + parse(await (await getProjectClient()).getOAuth2Provider(providerId)), ), ); @@ -1106,14 +1083,15 @@ const projectGetOAuth2ProviderCommand = project const projectListPlatformsCommand = project .command(`list-platforms`) .description(`Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1122,8 +1100,8 @@ const projectListPlatformsCommand = project .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProjectClient()).listPlatforms(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProjectClient()).listPlatforms(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -1312,6 +1290,42 @@ const projectListPoliciesCommand = project ); +const projectUpdateDenyCanonicalEmailPolicyCommand = project + .command(`update-deny-canonical-email-policy`) + .description(`Configures if email aliases such as subaddresses and emails with suffixes are denied during new users sign-ups and email updates.`) + .requiredOption(`--enabled `, `Set whether or not to block email aliases during signup and email updates.`, parseBool) + .action( + actionRunner( + async ({ enabled }) => + parse(await (await getProjectClient()).updateDenyCanonicalEmailPolicy(enabled)), + ), + ); + + +const projectUpdateDenyDisposableEmailPolicyCommand = project + .command(`update-deny-disposable-email-policy`) + .description(`Configures if disposable emails from known temporary domains are denied during new users sign-ups and email updates.`) + .requiredOption(`--enabled `, `Set whether or not to block disposable email addresses during signup and email updates.`, parseBool) + .action( + actionRunner( + async ({ enabled }) => + parse(await (await getProjectClient()).updateDenyDisposableEmailPolicy(enabled)), + ), + ); + + +const projectUpdateDenyFreeEmailPolicyCommand = project + .command(`update-deny-free-email-policy`) + .description(`Configures if emails from free providers such as Gmail or Yahoo are denied during new users sign-ups and email updates.`) + .requiredOption(`--enabled `, `Set whether or not to block free email addresses during signup and email updates.`, parseBool) + .action( + actionRunner( + async ({ enabled }) => + parse(await (await getProjectClient()).updateDenyFreeEmailPolicy(enabled)), + ), + ); + + const projectUpdateMembershipPrivacyPolicyCommand = project .command(`update-membership-privacy-policy`) .description(`Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members..`) @@ -1596,14 +1610,15 @@ const projectGetUsageCommand = project const projectListVariablesCommand = project .command(`list-variables`) .description(`Get a list of all project environment variables.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, resourceType, resourceId, secret`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, resourceType, resourceId, secret`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1612,8 +1627,8 @@ const projectListVariablesCommand = project .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProjectClient()).listVariables(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProjectClient()).listVariables(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -1621,7 +1636,7 @@ const projectListVariablesCommand = project const projectCreateVariableCommand = project .command(`create-variable`) .description(`Create a new project environment variable. These variables can be accessed by all functions and sites in the project.`) - .requiredOption(`--variable-id `, `Variable 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(`--variable-id `, `Variable 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.`) .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) .requiredOption(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -1641,7 +1656,7 @@ const projectCreateVariableCommand = project const projectGetVariableCommand = project .command(`get-variable`) .description(`Get a variable by its unique ID. `) - .requiredOption(`--variable-id `, `Variable ID.`) + .requiredOption(`--variable-id `, `Variable unique ID.`) .action( actionRunner( async ({ variableId }) => @@ -1653,7 +1668,7 @@ const projectGetVariableCommand = project const projectUpdateVariableCommand = project .command(`update-variable`) .description(`Update variable by its unique ID.`) - .requiredOption(`--variable-id `, `Variable ID.`) + .requiredOption(`--variable-id `, `Variable unique ID.`) .option(`--key `, `Variable key. Max length: 255 chars.`) .option(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -1673,7 +1688,7 @@ const projectUpdateVariableCommand = project const projectDeleteVariableCommand = project .command(`delete-variable`) .description(`Delete a variable by its unique ID. `) - .requiredOption(`--variable-id `, `Variable ID.`) + .requiredOption(`--variable-id `, `Variable unique ID.`) .action( actionRunner( async ({ variableId }) => diff --git a/lib/commands/services/projects.ts b/lib/commands/services/projects.ts index cde6ce97..13921687 100644 --- a/lib/commands/services/projects.ts +++ b/lib/commands/services/projects.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForConsole } from "../../sdks.js"; import { @@ -35,7 +36,7 @@ export const projects = new Command("projects") const projectsListCommand = projects .command(`list`) .description(`Get a list of all projects. You can use the query params to filter your results. `) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, teamId, labels, search`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, teamId, labels, search`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -43,7 +44,8 @@ const projectsListCommand = projects (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -52,8 +54,8 @@ const projectsListCommand = projects .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProjectsClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProjectsClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -121,8 +123,9 @@ const projectsListDevKeysCommand = projects .command(`list-dev-keys`) .description(`List all the project\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'`) .requiredOption(`--project-id `, `Project unique ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: accessedAt, expire`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: accessedAt, expire`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -131,8 +134,8 @@ const projectsListDevKeysCommand = projects .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ projectId, queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProjectsClient()).listDevKeys(projectId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ projectId, queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProjectsClient()).listDevKeys(projectId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); @@ -196,14 +199,15 @@ const projectsListSchedulesCommand = projects .command(`list-schedules`) .description(`Get a list of all the project's schedules. You can use the query params to filter your results.`) .requiredOption(`--project-id `, `Project unique ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: resourceType, resourceId, projectId, schedule, active, region`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: resourceType, resourceId, projectId, schedule, active, region`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -212,8 +216,8 @@ const projectsListSchedulesCommand = projects .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ projectId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProjectsClient()).listSchedules(projectId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ projectId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProjectsClient()).listSchedules(projectId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); diff --git a/lib/commands/services/proxy.ts b/lib/commands/services/proxy.ts index dc9542bb..a5e77629 100644 --- a/lib/commands/services/proxy.ts +++ b/lib/commands/services/proxy.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -34,15 +35,15 @@ export const proxy = new Command("proxy") const proxyListRulesCommand = proxy .command(`list-rules`) .description(`Get a list of all the proxy rules. You can use the query params to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch`) - .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -51,15 +52,17 @@ const proxyListRulesCommand = proxy .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProxyClient()).listRules(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProxyClient()).listRules(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); const proxyCreateAPIRuleCommand = proxy .command(`create-api-rule`) - .description(`Create a new proxy rule for serving Appwrite's API on custom domain.`) + .description(`Create a new proxy rule for serving Appwrite's API on custom domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .action( actionRunner( @@ -71,7 +74,9 @@ const proxyCreateAPIRuleCommand = proxy const proxyCreateFunctionRuleCommand = proxy .command(`create-function-rule`) - .description(`Create a new proxy rule for executing Appwrite Function on custom domain.`) + .description(`Create a new proxy rule for executing Appwrite Function on custom domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .requiredOption(`--function-id `, `ID of function to be executed.`) .option(`--branch `, `Name of VCS branch to deploy changes automatically`) @@ -85,7 +90,9 @@ const proxyCreateFunctionRuleCommand = proxy const proxyCreateRedirectRuleCommand = proxy .command(`create-redirect-rule`) - .description(`Create a new proxy rule for to redirect from custom domain to another domain.`) + .description(`Create a new proxy rule for to redirect from custom domain to another domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .requiredOption(`--url `, `Target URL of redirection`) .requiredOption(`--status-code `, `Status code of redirection`) @@ -101,7 +108,9 @@ const proxyCreateRedirectRuleCommand = proxy const proxyCreateSiteRuleCommand = proxy .command(`create-site-rule`) - .description(`Create a new proxy rule for serving Appwrite Site on custom domain.`) + .description(`Create a new proxy rule for serving Appwrite Site on custom domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .requiredOption(`--site-id `, `ID of site to be executed.`) .option(`--branch `, `Name of VCS branch to deploy changes automatically`) @@ -137,14 +146,14 @@ const proxyDeleteRuleCommand = proxy ); -const proxyUpdateRuleVerificationCommand = proxy - .command(`update-rule-verification`) - .description(`Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.`) +const proxyUpdateRuleStatusCommand = proxy + .command(`update-rule-status`) + .description(`If not succeeded yet, retry verification process of a proxy rule domain. This endpoint triggers domain verification by checking DNS records. If verification is successful, a TLS certificate will be automatically provisioned for the domain asynchronously in the background.`) .requiredOption(`--rule-id `, `Rule ID.`) .action( actionRunner( async ({ ruleId }) => - parse(await (await getProxyClient()).updateRuleVerification(ruleId)), + parse(await (await getProxyClient()).updateRuleStatus(ruleId)), ), ); diff --git a/lib/commands/services/sites.ts b/lib/commands/services/sites.ts index 68bb68b8..59507326 100644 --- a/lib/commands/services/sites.ts +++ b/lib/commands/services/sites.ts @@ -4,7 +4,8 @@ import { resolveFileParam } from "../utils/deployment.js"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -36,7 +37,7 @@ export const sites = new Command("sites") const sitesListCommand = sites .command(`list`) .description(`Get a list of all the project's sites. You can use the query params to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -44,7 +45,8 @@ const sitesListCommand = sites (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -53,8 +55,8 @@ const sitesListCommand = sites .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getSitesClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getSitesClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -253,7 +255,7 @@ const sitesListDeploymentsCommand = sites .command(`list-deployments`) .description(`Get a list of all the site's code deployments. You can use the query params to filter your results.`) .requiredOption(`--site-id `, `Site ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -261,7 +263,8 @@ const sitesListDeploymentsCommand = sites (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -270,8 +273,8 @@ const sitesListDeploymentsCommand = sites .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ siteId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getSitesClient()).listDeployments(siteId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ siteId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getSitesClient()).listDeployments(siteId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -421,14 +424,15 @@ const sitesListLogsCommand = sites .command(`list-logs`) .description(`Get a list of all site logs. You can use the query params to filter your results.`) .requiredOption(`--site-id `, `Site ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -437,8 +441,8 @@ const sitesListLogsCommand = sites .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ siteId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getSitesClient()).listLogs(siteId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ siteId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getSitesClient()).listLogs(siteId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -486,10 +490,25 @@ const sitesListVariablesCommand = sites .command(`list-variables`) .description(`Get a list of all variables of a specific site.`) .requiredOption(`--site-id `, `Site unique ID.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: key, resourceType, resourceId, secret`) + .option( + `--total [value]`, + `When set to false, the total count returned will be 0 and will not be calculated.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) + .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .option(`--cursor-after `, `Return results after this cursor ID.`) + .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ siteId }) => - parse(await (await getSitesClient()).listVariables(siteId)), + async ({ siteId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getSitesClient()).listVariables(siteId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -498,6 +517,7 @@ const sitesCreateVariableCommand = sites .command(`create-variable`) .description(`Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.`) .requiredOption(`--site-id `, `Site unique ID.`) + .requiredOption(`--variable-id `, `Variable 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(`--key `, `Variable key. Max length: 255 chars.`) .requiredOption(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -508,8 +528,8 @@ const sitesCreateVariableCommand = sites ) .action( actionRunner( - async ({ siteId, key, value, secret }) => - parse(await (await getSitesClient()).createVariable(siteId, key, value, secret)), + async ({ siteId, variableId, key, value, secret }) => + parse(await (await getSitesClient()).createVariable(siteId, variableId, key, value, secret)), ), ); @@ -532,7 +552,7 @@ const sitesUpdateVariableCommand = sites .description(`Update variable by its unique ID.`) .requiredOption(`--site-id `, `Site unique ID.`) .requiredOption(`--variable-id `, `Variable unique ID.`) - .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) + .option(`--key `, `Variable key. Max length: 255 chars.`) .option(`--value `, `Variable value. Max length: 8192 chars.`) .option( `--secret [value]`, diff --git a/lib/commands/services/storage.ts b/lib/commands/services/storage.ts index 73c9fc6f..05bafc49 100644 --- a/lib/commands/services/storage.ts +++ b/lib/commands/services/storage.ts @@ -4,7 +4,8 @@ import { resolveFileParam } from "../utils/deployment.js"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -36,7 +37,7 @@ export const storage = new Command("storage") const storageListBucketsCommand = storage .command(`list-buckets`) .description(`Get a list of all the storage buckets. You can use the query params to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -44,7 +45,8 @@ const storageListBucketsCommand = storage (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -53,8 +55,8 @@ const storageListBucketsCommand = storage .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getStorageClient()).listBuckets(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getStorageClient()).listBuckets(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -181,7 +183,7 @@ const storageListFilesCommand = storage .command(`list-files`) .description(`Get a list of all the user files. You can use the query params to filter your results.`) .requiredOption(`--bucket-id `, `Storage bucket unique ID. You can create a new storage bucket using the Storage service server integration (https://appwrite.io/docs/server/storage#createBucket).`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -189,7 +191,8 @@ const storageListFilesCommand = storage (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -198,8 +201,8 @@ const storageListFilesCommand = storage .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ bucketId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getStorageClient()).listFiles(bucketId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ bucketId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getStorageClient()).listFiles(bucketId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); diff --git a/lib/commands/services/tables-db.ts b/lib/commands/services/tables-db.ts index eae8e72a..632d3de9 100644 --- a/lib/commands/services/tables-db.ts +++ b/lib/commands/services/tables-db.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -35,7 +36,7 @@ export const tablesDB = new Command("tables-db") const tablesDBListCommand = tablesDB .command(`list`) .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: name`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: name`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -43,7 +44,8 @@ const tablesDBListCommand = tablesDB (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -52,8 +54,8 @@ const tablesDBListCommand = tablesDB .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTablesDBClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTablesDBClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -81,8 +83,9 @@ const tablesDBCreateCommand = tablesDB const tablesDBListTransactionsCommand = tablesDB .command(`list-transactions`) .description(`List transactions across all databases.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries).`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries).`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -91,8 +94,8 @@ const tablesDBListTransactionsCommand = tablesDB .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTablesDBClient()).listTransactions(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), + async ({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTablesDBClient()).listTransactions(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); @@ -229,7 +232,7 @@ const tablesDBListTablesCommand = tablesDB .command(`list-tables`) .description(`Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.`) .requiredOption(`--database-id `, `Database ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: name, enabled, rowSecurity`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: name, enabled, rowSecurity`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -237,7 +240,8 @@ const tablesDBListTablesCommand = tablesDB (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -246,8 +250,8 @@ const tablesDBListTablesCommand = tablesDB .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTablesDBClient()).listTables(databaseId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ databaseId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTablesDBClient()).listTables(databaseId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -345,14 +349,15 @@ const tablesDBListColumnsCommand = tablesDB .description(`List columns in the table.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: key, type, size, required, array, status, error`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: key, type, size, required, array, status, error`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -361,8 +366,53 @@ const tablesDBListColumnsCommand = tablesDB .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, tableId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTablesDBClient()).listColumns(databaseId, tableId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ databaseId, tableId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTablesDBClient()).listColumns(databaseId, tableId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + ), + ); + + +const tablesDBCreateBigIntColumnCommand = tablesDB + .command(`create-big-int-column`) + .description(`Create a bigint column. Optionally, minimum and maximum values can be provided. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required `, `Is column required?`, parseBool) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when column is required.`, parseInteger) + .option( + `--array [value]`, + `Is column an array?`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .action( + actionRunner( + async ({ databaseId, tableId, key, required, min, max, xdefault, array }) => + parse(await (await getTablesDBClient()).createBigIntColumn(databaseId, tableId, key, required, min, max, xdefault, array)), + ), + ); + + +const tablesDBUpdateBigIntColumnCommand = tablesDB + .command(`update-big-int-column`) + .description(`Update a bigint column. Changing the \`default\` value will not update already existing rows. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required `, `Is column required?`, parseBool) + .requiredOption(`--xdefault `, `Default value. Cannot be set when column is required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--new-key `, `New Column Key.`) + .action( + actionRunner( + async ({ databaseId, tableId, key, required, xdefault, min, max, newKey }) => + parse(await (await getTablesDBClient()).updateBigIntColumn(databaseId, tableId, key, required, xdefault, min, max, newKey)), ), ); @@ -1119,14 +1169,15 @@ const tablesDBListIndexesCommand = tablesDB .description(`List indexes on the table.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service server integration (https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: key, type, status, attributes, error`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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 columns: key, type, status, attributes, error`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1135,8 +1186,8 @@ const tablesDBListIndexesCommand = tablesDB .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, tableId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTablesDBClient()).listIndexes(databaseId, tableId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ databaseId, tableId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTablesDBClient()).listIndexes(databaseId, tableId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -1209,7 +1260,7 @@ const tablesDBListRowsCommand = tablesDB .description(`Get a list of all the user's rows in a given table. You can use the query params to filter your results.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the TablesDB service server integration (https://appwrite.io/docs/products/databases/tables#create-table).`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, pagination, and selection prefer --where, --sort-asc, --sort-desc, --limit, --offset, and --select. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, pagination, and selection prefer --filter, --sort-asc, --sort-desc, --limit, --offset, and --select. When mixed, raw --queries are sent before generated flag 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.`) .option(`--transaction-id `, `Transaction ID to read uncommitted changes within the transaction.`) .option( `--total [value]`, @@ -1218,7 +1269,8 @@ const tablesDBListRowsCommand = tablesDB value === undefined ? true : parseBool(value), ) .option(`--ttl `, `TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).`, parseInteger) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1228,8 +1280,8 @@ const tablesDBListRowsCommand = tablesDB .option(`--select `, `Attribute to include in the response. Repeat for multiple attributes.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .action( actionRunner( - async ({ databaseId, tableId, queries, transactionId, total, ttl, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }) => - parse(await (await getTablesDBClient()).listRows(databaseId, tableId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }), transactionId, total, ttl)), + async ({ databaseId, tableId, queries, transactionId, total, ttl, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }) => + parse(await (await getTablesDBClient()).listRows(databaseId, tableId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset, select }), transactionId, total, ttl)), ), ); @@ -1288,9 +1340,10 @@ const tablesDBUpdateRowsCommand = tablesDB .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID.`) .option(`--data `, `Row data as JSON object. Include only column and value pairs to be updated.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) .option(`--transaction-id `, `Transaction ID for staging the operation.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1299,8 +1352,8 @@ const tablesDBUpdateRowsCommand = tablesDB .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, tableId, data, queries, transactionId, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTablesDBClient()).updateRows(databaseId, tableId, parseJsonObject(data, "--data"), buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), + async ({ databaseId, tableId, data, queries, transactionId, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTablesDBClient()).updateRows(databaseId, tableId, parseJsonObject(data, "--data"), buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), ), ); @@ -1310,9 +1363,10 @@ const tablesDBDeleteRowsCommand = tablesDB .description(`Bulk delete rows using queries, if no queries are passed then all rows are deleted.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service server integration (https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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.`) .option(`--transaction-id `, `Transaction ID for staging the operation.`) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -1321,8 +1375,8 @@ const tablesDBDeleteRowsCommand = tablesDB .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ databaseId, tableId, queries, transactionId, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTablesDBClient()).deleteRows(databaseId, tableId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), + async ({ databaseId, tableId, queries, transactionId, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTablesDBClient()).deleteRows(databaseId, tableId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), transactionId)), ), ); diff --git a/lib/commands/services/teams.ts b/lib/commands/services/teams.ts index c502740e..489602b5 100644 --- a/lib/commands/services/teams.ts +++ b/lib/commands/services/teams.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -44,7 +45,7 @@ export const teams = new Command("teams") const teamsListCommand = teams .command(`list`) .description(`Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, total, billingPlan`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, total, billingPlan`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -52,7 +53,8 @@ const teamsListCommand = teams (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -61,8 +63,8 @@ const teamsListCommand = teams .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTeamsClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTeamsClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -143,7 +145,7 @@ const teamsListMembershipsCommand = teams .command(`list-memberships`) .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.`) .requiredOption(`--team-id `, `Team ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, roles`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, roles`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -151,7 +153,8 @@ const teamsListMembershipsCommand = teams (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -160,8 +163,8 @@ const teamsListMembershipsCommand = teams .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ teamId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTeamsClient()).listMemberships(teamId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ teamId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTeamsClient()).listMemberships(teamId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); diff --git a/lib/commands/services/tokens.ts b/lib/commands/services/tokens.ts index af1d99c7..0f9cc089 100644 --- a/lib/commands/services/tokens.ts +++ b/lib/commands/services/tokens.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -36,14 +37,15 @@ const tokensListCommand = tokens .description(`List all the tokens created for a specific file or bucket. You can use the query params to filter your results.`) .requiredOption(`--bucket-id `, `Storage bucket unique ID. You can create a new storage bucket using the Storage service server integration (https://appwrite.io/docs/server/storage#createBucket).`) .requiredOption(`--file-id `, `File unique ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: expire`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: expire`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -52,8 +54,8 @@ const tokensListCommand = tokens .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ bucketId, fileId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getTokensClient()).list(bucketId, fileId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ bucketId, fileId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getTokensClient()).list(bucketId, fileId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); diff --git a/lib/commands/services/users.ts b/lib/commands/services/users.ts index 5dad94c4..ccc93c76 100644 --- a/lib/commands/services/users.ts +++ b/lib/commands/services/users.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -35,7 +36,7 @@ export const users = new Command("users") const usersListCommand = users .command(`list`) .description(`Get a list of all the project's users. You can use the query params to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -43,7 +44,8 @@ const usersListCommand = users (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -52,8 +54,8 @@ const usersListCommand = users .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getUsersClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getUsersClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -107,7 +109,7 @@ const usersCreateBcryptUserCommand = users const usersListIdentitiesCommand = users .command(`list-identities`) .description(`Get identities for all users.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, provider, providerUid, providerEmail, providerAccessTokenExpiry`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, provider, providerUid, providerEmail, providerAccessTokenExpiry`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -115,7 +117,8 @@ const usersListIdentitiesCommand = users (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -124,8 +127,8 @@ const usersListIdentitiesCommand = users .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getUsersClient()).listIdentities(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getUsersClient()).listIdentities(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -344,7 +347,7 @@ const usersListMembershipsCommand = users .command(`list-memberships`) .description(`Get the user membership list by its unique ID.`) .requiredOption(`--user-id `, `User ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, roles`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, roles`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -352,7 +355,8 @@ const usersListMembershipsCommand = users (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -361,8 +365,8 @@ const usersListMembershipsCommand = users .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ userId, queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getUsersClient()).listMemberships(userId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ userId, queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getUsersClient()).listMemberships(userId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); @@ -579,14 +583,15 @@ const usersListTargetsCommand = users .command(`list-targets`) .description(`List the messaging targets that are associated with a user.`) .requiredOption(`--user-id `, `User ID.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, providerId, identifier, providerType`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, providerId, identifier, providerType`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -595,8 +600,8 @@ const usersListTargetsCommand = users .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ userId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getUsersClient()).listTargets(userId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ userId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getUsersClient()).listTargets(userId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); diff --git a/lib/commands/services/vcs.ts b/lib/commands/services/vcs.ts index 96ac14c1..392c8c6c 100644 --- a/lib/commands/services/vcs.ts +++ b/lib/commands/services/vcs.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -92,14 +93,24 @@ const vcsGetRepositoryCommand = vcs const vcsListRepositoryBranchesCommand = vcs .command(`list-repository-branches`) - .description(`Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work. + .description(`Get a list of branches from a GitHub repository in your installation. This endpoint supports filtering by a search term and pagination using query strings such as \`Query.limit()\`, \`Query.offset()\`, \`Query.cursorAfter()\`, and \`Query.cursorBefore()\`. It returns branch names along with the total number of matches. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work. `) .requiredOption(`--installation-id `, `Installation Id`) .requiredOption(`--provider-repository-id `, `Repository Id`) + .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, offset, cursorAfter, and cursorBefore`) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) + .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .option(`--cursor-after `, `Return results after this cursor ID.`) + .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ installationId, providerRepositoryId }) => - parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId)), + async ({ installationId, providerRepositoryId, search, queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId, search, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); @@ -137,7 +148,7 @@ const vcsListInstallationsCommand = vcs .command(`list-installations`) .description(`List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details. `) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: provider, organization`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: provider, organization`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -145,7 +156,8 @@ const vcsListInstallationsCommand = vcs (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -154,8 +166,8 @@ const vcsListInstallationsCommand = vcs .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getVcsClient()).listInstallations(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, search, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getVcsClient()).listInstallations(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), ), ); diff --git a/lib/commands/services/webhooks.ts b/lib/commands/services/webhooks.ts index b9fe9bb0..1cf19702 100644 --- a/lib/commands/services/webhooks.ts +++ b/lib/commands/services/webhooks.ts @@ -2,7 +2,8 @@ import { Command } from "commander"; import { buildQueries, collectQueryValue, - parseWhereQuery, + parseDeprecatedWhereQuery, + parseFilterQuery, } from "../utils/query.js"; import { sdkForProject } from "../../sdks.js"; import { @@ -34,14 +35,15 @@ export const webhooks = new Command("webhooks") const webhooksListCommand = webhooks .command(`list`) .description(`Get a list of all webhooks belonging to the project. You can use the query params to filter your results.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, url, authUsername, tls, events, enabled, logs, attempts`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: name, url, authUsername, tls, events, enabled, logs, attempts`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--filter `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseFilterQuery(value), previous)) + .option(`--where `, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) .option(`--limit `, `Maximum number of results to return.`, parseInteger) @@ -50,8 +52,8 @@ const webhooksListCommand = webhooks .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getWebhooksClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), + async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getWebhooksClient()).list(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); diff --git a/lib/commands/utils/attributes.ts b/lib/commands/utils/attributes.ts index 279c28f8..3cda601f 100644 --- a/lib/commands/utils/attributes.ts +++ b/lib/commands/utils/attributes.ts @@ -305,6 +305,17 @@ export class Attributes { xdefault: attribute.default, array: attribute.array, }); + case "bigint": + return databasesService.createBigIntAttribute({ + databaseId, + collectionId, + key: attribute.key, + required: attribute.required, + min: attribute.min, + max: attribute.max, + xdefault: attribute.default, + array: attribute.array, + }); case "double": return databasesService.createFloatAttribute({ databaseId, @@ -469,6 +480,16 @@ export class Attributes { max: attribute.max, xdefault: attribute.default, }); + case "bigint": + return databasesService.updateBigIntAttribute({ + databaseId, + collectionId, + key: attribute.key, + required: attribute.required, + min: attribute.min, + max: attribute.max, + xdefault: attribute.default, + }); case "double": return databasesService.updateFloatAttribute({ databaseId, diff --git a/lib/commands/utils/query.ts b/lib/commands/utils/query.ts index be7dbf84..f1a68121 100644 --- a/lib/commands/utils/query.ts +++ b/lib/commands/utils/query.ts @@ -12,6 +12,7 @@ export type CliQueryOptions = { sortAsc?: string[]; sortDesc?: string[]; select?: string[]; + filter?: string[]; where?: string[]; }; @@ -106,7 +107,7 @@ const parseQueryValue = (value: string): QueryValues => { return normalized; }; -const whereOperators: Array<[RegExp, string]> = [ +const filterOperators: Array<[RegExp, string]> = [ [/^(.+?)\s*!=\s*(.*)$/, "notEqual"], [/^(.+?)\s*>=\s*(.*)$/, "greaterThanEqual"], [/^(.+?)\s*<=\s*(.*)$/, "lessThanEqual"], @@ -120,8 +121,10 @@ export const collectQueryValue = (value: T, previous: T[] = []): T[] => [ value, ]; -export const parseWhereQuery = (expression: string): string => { - for (const [pattern, method] of whereOperators) { +let hasWarnedDeprecatedWhere = false; + +export const parseFilterQuery = (expression: string): string => { + for (const [pattern, method] of filterOperators) { const match = expression.match(pattern); if (!match) { @@ -131,7 +134,7 @@ export const parseWhereQuery = (expression: string): string => { const attribute = match[1].trim(); if (attribute === "") { throw new InvalidArgumentError( - "Where filters must include an attribute before the operator.", + "Filters must include an attribute before the operator.", ); } @@ -139,10 +142,21 @@ export const parseWhereQuery = (expression: string): string => { } throw new InvalidArgumentError( - "Where filters must use one of: field=value, field!=value, field>value, field>=value, fieldvalue, field>=value, field { + if (!hasWarnedDeprecatedWhere) { + console.warn("Warning: --where is deprecated. Use --filter instead."); + hasWarnedDeprecatedWhere = true; + } + + return parseFilterQuery(expression); +}; + export const buildQueries = ({ queries, limit, @@ -152,12 +166,19 @@ export const buildQueries = ({ sortAsc, sortDesc, select, + filter, where, }: CliQueryOptions): string[] | undefined => { const builtQueries = [...(queries ?? [])]; + if (filter) { + // parseFilterQuery returns fully serialized Appwrite query JSON strings. + builtQueries.push(...filter); + } + if (where) { - // parseWhereQuery returns fully serialized Appwrite query JSON strings. + // Deprecated --where values are appended after --filter values so the + // preferred flag takes precedence when both aliases are mixed. builtQueries.push(...where); } diff --git a/lib/config.ts b/lib/config.ts index fb337bda..5e076f4f 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -509,6 +509,10 @@ class Config { } } + protected usePath(path: string): void { + (this as { path: string }).path = path; + } + read(): void { try { const file = fs.readFileSync(this.path).toString(); @@ -642,6 +646,23 @@ class Local extends Config { this.read(); } + useCwdConfig( + path: string = Local.CONFIG_FILE_PATH, + legacyPath: string = Local.CONFIG_FILE_PATH_LEGACY, + ): void { + const absolutePath = + Local.findConfigFileInCwd(path) || + Local.findConfigFileInCwd(legacyPath) || + _path.join(process.cwd(), path); + + this.usePath(absolutePath); + this.configDirectoryPath = _path.dirname(absolutePath); + this.rootData = {}; + this.includePaths = {}; + this.includePathHints = {}; + this.read(); + } + read(): void { if (!fs.existsSync(this.path)) { this.rootData = {}; @@ -700,9 +721,14 @@ class Local extends Config { static findConfigFile(filename: string): string | null { let currentPath = process.cwd(); + const homeDir = os.homedir(); while (true) { - const filePath = `${currentPath}/${filename}`; + if (currentPath === homeDir && process.cwd() !== homeDir) { + break; + } + + const filePath = _path.join(currentPath, filename); if (fs.existsSync(filePath)) { return filePath; @@ -718,6 +744,12 @@ class Local extends Config { return null; } + static findConfigFileInCwd(filename: string): string | null { + const filePath = _path.join(process.cwd(), filename); + + return fs.existsSync(filePath) ? filePath : null; + } + getDirname(): string { return _path.dirname(this.path); } diff --git a/lib/constants.ts b/lib/constants.ts index 9d8ad190..6fa5730d 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '20.2.0-rc.1'; +export const SDK_VERSION = '21.0.0'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/lib/parser.ts b/lib/parser.ts index 18a417f7..063a0634 100644 --- a/lib/parser.ts +++ b/lib/parser.ts @@ -659,7 +659,7 @@ const printQueryErrorHint = (err: Error): void => { } hint( - `For common list filters, use flags like --limit 25, --sort-desc '$createdAt', or --where 'status=active'. Raw --queries values must be Appwrite JSON query strings, for example: ${EXECUTABLE_NAME} tables-db list-rows --queries '{"method":"limit","values":[25]}'`, + `For common list filters, use flags like --limit 25, --sort-desc '$createdAt', or --filter 'status=active'. Raw --queries values must be Appwrite JSON query strings, for example: ${EXECUTABLE_NAME} tables-db list-rows --queries '{"method":"limit","values":[25]}'`, ); }; diff --git a/lib/shared/typescript-type-utils.ts b/lib/shared/typescript-type-utils.ts index aea8f0e4..c9fb3019 100644 --- a/lib/shared/typescript-type-utils.ts +++ b/lib/shared/typescript-type-utils.ts @@ -53,6 +53,9 @@ export function getTypeScriptType( case "double": type = "number"; break; + case "bigint": + type = "bigint"; + break; case "boolean": type = "boolean"; break; diff --git a/package-lock.json b/package-lock.json index 71929d6b..4f314e2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "appwrite-cli", - "version": "20.2.0-rc.1", + "version": "21.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "20.2.0-rc.1", + "version": "21.0.0", "license": "BSD-3-Clause", "dependencies": { - "@appwrite.io/console": "12.1.0", + "@appwrite.io/console": "13.0.0", "chalk": "4.1.2", "chokidar": "^3.6.0", "cli-progress": "^3.12.0", @@ -52,9 +52,9 @@ } }, "node_modules/@appwrite.io/console": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-12.1.0.tgz", - "integrity": "sha512-pfI4UYCxEo8sGfub6UDDsQZxBu3b38x4d+SIQsZifRvKqCW+F7WRStxSQie6phw5dQaw/5SyEMEGhzURtj2MfQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-13.0.0.tgz", + "integrity": "sha512-zbOSHBI/OjLrwxPpSVwj50Jb1EZMca1hEhGZLle/YOGRX//JGmzMNjhWFqaNVeglNqnx+V15p88VamQ4Kvv57A==", "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0" @@ -2074,9 +2074,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, @@ -2137,17 +2137,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.2.tgz", - "integrity": "sha512-j/bwmkBvHUtPNxzuWe5z6BEk3q54YRyGlBXkSsmfoih7zNrBvl5A9A98anlp/7JbyZcWIJ8KXo/3Tq/DjFLtuQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.3.tgz", + "integrity": "sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.59.2", - "@typescript-eslint/type-utils": "8.59.2", - "@typescript-eslint/utils": "8.59.2", - "@typescript-eslint/visitor-keys": "8.59.2", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/type-utils": "8.59.3", + "@typescript-eslint/utils": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -2160,22 +2160,22 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.59.2", + "@typescript-eslint/parser": "^8.59.3", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.2.tgz", - "integrity": "sha512-plR3pp6D+SSUn1HM7xvSkx12/DhoHInI2YF35KAcVFNZvlC0gtrWqx7Qq1oH2Ssgi0vlFRCTbP+DZc7B9+TtsQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.3.tgz", + "integrity": "sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.59.2", - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/typescript-estree": "8.59.2", - "@typescript-eslint/visitor-keys": "8.59.2", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3" }, "engines": { @@ -2191,14 +2191,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.2.tgz", - "integrity": "sha512-+2hqvEkeyf/0FBor67duF0Ll7Ot8jyKzDQOSrxazF/danillRq2DwR9dLptsXpoZQqxE1UisSmoZewrlPas9Vw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.59.2", - "@typescript-eslint/types": "^8.59.2", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" }, "engines": { @@ -2213,14 +2213,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.2.tgz", - "integrity": "sha512-JzfyEpEtOU89CcFSwyNS3mu4MLvLSXqnmX05+aKBDM+TdR5jzcGOEBwxwGNxrEQ7p/z6kK2WyioCGBf2zZBnvg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/visitor-keys": "8.59.2" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2231,9 +2231,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.2.tgz", - "integrity": "sha512-BKK4alN7oi4C/zv4VqHQ+uRU+lTa6JGIZ7s1juw7b3RHo9OfKB+bKX3u0iVZetdsUCBBkSbdWbarJbmN0fTeSw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true, "license": "MIT", "engines": { @@ -2248,15 +2248,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.2.tgz", - "integrity": "sha512-nhqaj1nmTdVVl/BP5omXNRGO38jn5iosis2vbdmupF2txCf8ylWT8lx+JlvMYYVqzGVKtjojUFoQ3JRWK+mfzQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.3.tgz", + "integrity": "sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/typescript-estree": "8.59.2", - "@typescript-eslint/utils": "8.59.2", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -2273,9 +2273,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.2.tgz", - "integrity": "sha512-e82GVOE8Ps3E++Egvb6Y3Dw0S10u8NkQ9KXmtRhCWJJ8kDhOJTvtMAWnFL16kB1583goCWXsr0NieKCZMs2/0Q==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true, "license": "MIT", "engines": { @@ -2287,16 +2287,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.2.tgz", - "integrity": "sha512-o0XPGNwcWw+FIwStOWn+BwBuEmL6QXP0rsvAFg7ET1dey1Nr6Wb1ac8p5HEsK0ygO/6mUxlk+YWQD9xcb/nnXg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.59.2", - "@typescript-eslint/tsconfig-utils": "8.59.2", - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/visitor-keys": "8.59.2", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -2315,16 +2315,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.2.tgz", - "integrity": "sha512-Juw3EinkXqjaffxz6roowvV7GZT/kET5vSKKZT6upl5TXdWkLkYmNPXwDDL2Vkt2DPn0nODIS4egC/0AGxKo/Q==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.2", - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/typescript-estree": "8.59.2" + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2339,13 +2339,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.2.tgz", - "integrity": "sha512-NwjLUnGy8/Zfx23fl50tRC8rYaYnM52xNRYFAXvmiil9yh1+K6aRVQMnzW6gQB/1DLgWt977lYQn7C+wtgXZiA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.59.2", + "@typescript-eslint/types": "8.59.3", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -2791,9 +2791,9 @@ "license": "MIT" }, "node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "license": "MIT", "dependencies": { @@ -4008,9 +4008,9 @@ "license": "MIT" }, "node_modules/fs-extra": { - "version": "11.3.4", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.4.tgz", - "integrity": "sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz", + "integrity": "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==", "dev": true, "license": "MIT", "dependencies": { @@ -4065,9 +4065,9 @@ } }, "node_modules/get-east-asian-width": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", - "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", "license": "MIT", "engines": { "node": ">=18" @@ -5353,9 +5353,9 @@ "license": "MIT" }, "node_modules/node-abi": { - "version": "3.91.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.91.0.tgz", - "integrity": "sha512-B+S7X/GS3Un6wMICtnsNjQD7oSpVBQrZftHE6GZ1Fe9/k3XOOoqbM5DZZ0GO4x3YiSCQfrM28yj1ppplwgIsfg==", + "version": "3.92.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.92.0.tgz", + "integrity": "sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6178,9 +6178,9 @@ } }, "node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", "dev": true, "license": "ISC", "bin": { @@ -6503,9 +6503,9 @@ } }, "node_modules/tar": { - "version": "7.5.14", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.14.tgz", - "integrity": "sha512-/7sHKgQO3JLP9ESlwTYUUftHUadOURUqq23xs1vjcnp8Vss6k0wCfzulyEtk5g91pjvnuriimGlyG7k6msrzRw==", + "version": "7.5.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.15.tgz", + "integrity": "sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", @@ -6811,16 +6811,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.59.2.tgz", - "integrity": "sha512-pJw051uomb3ZeCzGTpRb8RbEqB5Y4WWet8gl/GcTlU35BSx0PVdZ86/bqkQCyKKuraVQEK7r6kBHQXF+fBhkoQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.59.3.tgz", + "integrity": "sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.59.2", - "@typescript-eslint/parser": "8.59.2", - "@typescript-eslint/typescript-estree": "8.59.2", - "@typescript-eslint/utils": "8.59.2" + "@typescript-eslint/eslint-plugin": "8.59.3", + "@typescript-eslint/parser": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index b46f4723..095df95d 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "20.2.0-rc.1", + "version": "21.0.0", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", @@ -51,7 +51,7 @@ "windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --external:terminal-image --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs --fallback-to-source -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe" }, "dependencies": { - "@appwrite.io/console": "12.1.0", + "@appwrite.io/console": "13.0.0", "chalk": "4.1.2", "chokidar": "^3.6.0", "cli-progress": "^3.12.0", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index e490ed61..69b3cf94 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": "20.2.0-rc.1", + "version": "21.0.0", "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/20.2.0-rc.1/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/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/20.2.0-rc.1/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe",