Skip to content

Commit e9315c9

Browse files
committed
chore: regenerate sdk
1 parent 30da60a commit e9315c9

File tree

498 files changed

+28543
-5243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

498 files changed

+28543
-5243
lines changed

.github/workflows/npm-publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
registry-url: 'https://registry.npmjs.org'
1414
- name: Setup binfmt with QEMU
1515
run: |
16-
sudo apt install qemu binfmt-support qemu-user-static
16+
sudo apt update
17+
sudo apt install qemu-system binfmt-support qemu-user-static
1718
update-binfmts --display
1819
- name: Setup ldid
1920
run: |
@@ -31,7 +32,14 @@ jobs:
3132
npm run mac-x64
3233
npm run mac-arm64
3334
- name: Publish NPM library
34-
run: npm publish
35+
run: |
36+
if ${{ contains(github.event.release.tag_name, '-rc') }}; then
37+
echo "Publishing Release Candidate ${{ github.event.release.tag_name}} to NPM"
38+
npm publish --tag next
39+
else
40+
echo "Publishing ${{ github.event.release.tag_name}} to NPM"
41+
npm publish
42+
fi
3543
env:
3644
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3745
- uses: fnkr/github-action-ghr@v1

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Change Log
2+
3+
## 8.1.1
4+
5+
* Type generation fixes:
6+
* Add ability to generate types to specific file
7+
* Fix optional attributes using `?` instead of `| null`
8+
* Fix `Models` import error
9+
* Improve formatting and add auto-generated comments
10+
11+
## 8.1.0
12+
13+
* Add multi-region support to `init` command
14+
* Update `init` command to clear previous configuration in `appwrite.json`
15+
* Update localConfig to store multi-region endpoint
16+
* Fix throw error when creating unknown attribute instead of timing out
17+
* Fix equal comparison of large numbers and BigNumber instances using proper equality checks
18+
* Fix duplication of reasons when comparing localConfig with remoteConfig
19+
* Fix `firstOrNull()` to `firstOrNull` in types generation for dart
20+
* Refactor to use `isCloud()` method consistently
21+
22+
## 8.0.2
23+
24+
* Add Type generation fixes:
25+
* Properly handle enum attributes in dart, java and kotlin
26+
* Fix initialisation of null attributes in dart's fromMap method
27+
* Fix relationships and enums in swift
28+
29+
## 8.0.1
30+
31+
* Add `resourceId` and `resourceType` attributes to `createRedirectRule`
32+
* Add `providerReference` to vcs command for getting repository contents
33+
* Add warning comment to `bulk updateDocuments` method
34+
* Fix type generation for enums in Typescript and PHP language
35+
36+
## 8.0.0
37+
38+
* Add `types` command to generate language specific typings for collections. Currently supports - `php`, `swift`, `dart`, `js`, `ts`, `kotlin` and `java`
39+
* Update bulk operation docs to include experiment feature warnings
40+
* Remove assistant service and commands
41+
42+
## 7.0.0
43+
44+
* Add `sites` command
45+
* Add `tokens` command
46+
* Add `devKeys` support to `projects` command
47+
* Add `init site`, `pull site` and `push site` commands
48+
* Add bulk operation methods like `createDocuments`, `deleteDocuments` etc.
49+
* Add new upsert methods: `upsertDocument` and `upsertDocuments`
50+
* Update GET requests to not include content-type header
51+
52+
## 6.2.3
53+
54+
* Fix hot swapping error in `python-ml` function
55+
56+
## 6.2.2
57+
58+
* Fix GitHub builds by adding `qemu-system` package
59+
* Fix attribute creation timed out
60+
61+
## 6.2.1
62+
63+
* Add `listOrganizations` method to `organizations` service and fix init project command
64+
65+
## 6.2.0
66+
67+
* Add specifications support to CLI
68+
* Update package version
69+
* Fix: Missed specifications param when updating a function

Formula/appwrite.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Appwrite < Formula
44
desc "CLI is a Node based command-line tool for Appwrite API"
55
homepage "https://appwrite.io"
66
license "BSD-3-Clause"
7-
head "https://github.com/appwrite/sdk-for-cli.git", branch: "main"
7+
head "https://github.com/appwrite/sdk-for-cli.git", branch: "master"
88

99
depends_on "node"
1010

LICENSE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -7,6 +7,6 @@ Redistribution and use in source and binary forms, with or without modification,
77

88
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
99

10-
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1111

12-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 157 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Appwrite Command Line SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-0.13.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 0.13.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).**
9+
**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

13-
![Appwrite](https://appwrite.io/images/github.png)
13+
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
1414

1515
## Installation
1616

@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
2929

3030
```sh
3131
$ appwrite -v
32-
0.15.0
32+
8.1.1
3333
```
3434

3535
### Install using prebuilt binaries
@@ -44,21 +44,167 @@ $ wget -q https://appwrite.io/cli/install.sh -O - | /bin/bash
4444

4545
### MacOS via [Homebrew](https://brew.sh)
4646
```bash
47-
$ brew tap appwrite/sdk-for-cli https://github.com/appwrite/sdk-for-cli
48-
$ brew update
49-
$ brew install --HEAD appwrite
47+
$ brew install appwrite
5048
```
51-
> Please note that `--HEAD` will be removed with official release.
5249

5350
### Windows
51+
Via Powershell
5452
```powershell
5553
$ iwr -useb https://appwrite.io/cli/install.ps1 | iex
5654
```
55+
Via [Scoop](https://scoop.sh)
56+
```powershell
57+
$ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/scoop/appwrite.json
58+
```
5759

5860
Once the installation completes, you can verify your install using
5961
```
6062
$ appwrite -v
61-
0.15.0
63+
8.1.1
64+
```
65+
66+
## Getting Started
67+
68+
Before you can use the CLI, you need to login to your Appwrite account.
69+
70+
```sh
71+
$ appwrite login
72+
73+
? Enter your email [email protected]
74+
? Enter your password ********
75+
✓ Success
76+
```
77+
This will also prompt you to enter your Appwrite endpoint ( default: http://localhost/v1 )
78+
79+
* ### Initialising your project
80+
Once logged in, the CLI needs to be initialised before you can use it with your Appwrite project. You can do this with the `appwrite init project` command.
81+
82+
```sh
83+
$ appwrite init project
84+
```
85+
86+
The following prompt will guide you through the setup process. The `init` command also creates an `appwrite.json` file representing your Appwrite project.
87+
88+
The `appwrite.json` file does a lot of things.
89+
* Provides context to the CLI
90+
* Keeps track of all your cloud functions
91+
* Keeps track of all your project's collections
92+
* Helps you deploy your Appwrite project to production and more..
93+
94+
You can also fetch all the collections in your current project using
95+
```sh
96+
appwrite init collection
97+
```
98+
99+
* ### Creating and deploying cloud functions
100+
101+
The CLI makes it extremely easy to create and deploy Appwrite's cloud functions. Initialise your new function using
102+
103+
```
104+
$ appwrite init function
105+
? What would you like to name your function? My Awesome Function
106+
? What runtime would you like to use? Node.js (node-15.5)
107+
✓ Success
108+
```
109+
110+
This will create a new function `My Awesome Function` in your current Appwrite project and also create a template function for you to get started.
111+
112+
```sh
113+
$ tree My\ Awesome\ Function
114+
115+
My Awesome Function
116+
├── README.md
117+
├── index.js
118+
├── package-lock.json
119+
└── package.json
120+
121+
0 directories, 4 files
122+
```
123+
124+
You can now deploy this function using
125+
126+
```sh
127+
$ appwrite push function
128+
129+
? Which functions would you like to deploy? My Awesome Function (61d1a4c81dfcd95bc834)
130+
ℹ Info Deploying function My Awesome Function ( 61d1a4c81dfcd95bc834 )
131+
✓ Success Deployed My Awesome Function ( 61d1a4c81dfcd95bc834 )
132+
```
133+
134+
Your function has now been deployed on your Appwrite server! As soon as the build process is finished, you can start executing the function.
135+
136+
* ### Deploying Collections
137+
138+
Similarly, you can deploy all your collections to your Appwrite server using
139+
140+
```sh
141+
appwrite push collections
142+
```
143+
144+
> ### Note
145+
> By default, requests to domains with self signed SSL certificates (or no certificates) are disabled. If you trust the domain, you can bypass the certificate validation using
146+
```sh
147+
$ appwrite client --selfSigned true
148+
```
149+
150+
## Usage
151+
152+
The Appwrite CLI follows the following general syntax.
153+
```sh
154+
$ appwrite [COMMAND] --[OPTIONS]
155+
```
156+
157+
A few sample commands to get you started
158+
159+
```sh
160+
$ appwrite users create --userId "unique()" --email [email protected] --password very_strong_password
161+
$ appwrite users list
162+
```
163+
164+
To create a document you can use the following command
165+
```sh
166+
$ appwrite databases create-document --database-id <DATABASE_ID> --collection-id <COLLECTION_ID> --document-id "unique()" --data '{"name": "Walter O Brein"}' --permissions 'read("any")' 'read("team:abc")'
167+
```
168+
169+
### Some Gotchas
170+
- `data` must be a valid JSON string where each key and value are enclosed in double quotes `"` like the example above.
171+
- Some arguments like the `read` and `write` permissions are expected to be arrays. In the Appwrite CLI, array values are passed in using space as a separator like in the example above.
172+
173+
174+
To get information about the different services available, you can use
175+
```sh
176+
$ appwrite -h
177+
```
178+
179+
To get information about a particular service and the commands available in a service you can use
180+
```sh
181+
$ appwrite users // or
182+
$ appwrite users --help // or
183+
$ appwrite users help // or
184+
$ appwrite accounts
185+
```
186+
187+
To get information about a particular command and the parameters it accepts, you can use
188+
189+
```sh
190+
$ appwrite users list --help
191+
$ appwrite account get --help
192+
```
193+
194+
At any point, you can view or reset the CLI configuration using the `client` service.
195+
196+
```
197+
$ appwrite client --debug
198+
// This will display your endpoint, projectID, API key and so on.
199+
$ appwrite client --reset
200+
```
201+
202+
## CI mode
203+
204+
The Appwrite CLI can also work in a CI environment. The initialisation of the CLI works a bit differently in CI. In CI, you set your `endpoint`, `projectId` and `API Key` using
205+
206+
```sh
207+
appwrite client --endpoint http://localhost/v1 --projectId <PROJECT_ID> --key <API KEY>
62208
```
63209

64210

@@ -79,7 +225,7 @@ $ cd sdk-generator
79225
$ docker run --rm --interactive --tty --volume "$(pwd)":/app composer install --ignore-platform-reqs --optimize-autoloader --no-plugins --no-scripts --prefer-dist
80226

81227
# Generate the SDKs
82-
$ docker run --rm -v $(pwd):/app -w /app php:7.4-cli php example.php
228+
$ docker run --rm -v $(pwd):/app -w /app php:8.1-cli php example.php
83229
```
84230

85231
3. Head over to the generated SDK and install the dependencies.
@@ -99,4 +245,4 @@ $ appwrite -v
99245
```
100246
## License
101247

102-
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
248+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
appwrite account createEmailPasswordSession \
2+
3+
--password password
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
appwrite account createEmailToken \
2+
--userId <USER_ID> \
3+
4+

docs/examples/account/create-magic-u-r-l-session.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
appwrite account createMagicURLToken \
2+
--userId <USER_ID> \
3+
4+
5+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
appwrite account createMfaAuthenticator \
2+
--type totp

0 commit comments

Comments
 (0)