Skip to content

Commit f642ef1

Browse files
committed
feat: (breaking) methods to generate file URLs
1 parent ca2b06a commit f642ef1

File tree

12 files changed

+478
-34
lines changed

12 files changed

+478
-34
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change log
22

3+
## 0.9.0
4+
5+
* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage
6+
* Update default `quality` for `getFilePreview` from 0 to -1
7+
* Remove `Gif` from ImageFormat enum
8+
* Remove `search` param from `listExecutions` method
9+
310
## 0.7.4
411

512
* Upgrade dependencies to resolve PlatformConstants error with Expo 53

docs/examples/databases/create-document.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { Client, Databases } from "react-native-appwrite";
22

33
const client = new Client()
44
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5-
.setSession('') // The user session to authenticate with
6-
.setKey('') //
7-
.setJWT('<YOUR_JWT>'); // Your secret JSON Web Token
5+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
86

97
const databases = new Databases(client);
108

src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ class Client {
416416
}
417417
}
418418

419-
async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise<any> {
419+
async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}, responseType = 'json'): Promise<any> {
420420
method = method.toUpperCase();
421421

422422
headers = Object.assign({}, this.headers, headers);
@@ -469,6 +469,8 @@ class Client {
469469

470470
if (response.headers.get('content-type')?.includes('application/json')) {
471471
data = await response.json();
472+
} else if (responseType === 'arrayBuffer') {
473+
data = await response.arrayBuffer();
472474
} else {
473475
data = {
474476
message: await response.text()

src/services/account.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,5 @@ export class Account extends Service {
14571457
'content-type': 'application/json',
14581458
}, payload);
14591459
}
1460+
14601461
};

0 commit comments

Comments
 (0)