diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e176f0..6ab2975b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log +## 0.10.1 + +* Fix URL based methods like `getFileViewURL`, `getFilePreviewURL` etc. by adding the missing `projectId` to searchParams +* Add `gif` to ImageFormat enum + ## 0.10.0 * Add generate file URL methods like`getFilePreviewURL`, `getFileViewURL` etc. diff --git a/package.json b/package.json index ebce0e85..c4717855 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-native-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.10.0", + "version": "0.10.1", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 481c7a0f..b404254b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -115,7 +115,7 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.10.0', + 'x-sdk-version': '0.10.1', 'X-Appwrite-Response-Format': '1.7.0', }; diff --git a/src/enums/image-format.ts b/src/enums/image-format.ts index 5aad5f08..758fad74 100644 --- a/src/enums/image-format.ts +++ b/src/enums/image-format.ts @@ -5,4 +5,5 @@ export enum ImageFormat { Webp = 'webp', Heic = 'heic', Avif = 'avif', + Gif = 'gif', } \ No newline at end of file diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 5795bfce..85952b13 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -387,6 +387,11 @@ export class Avatars extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -426,6 +431,11 @@ export class Avatars extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -449,6 +459,11 @@ export class Avatars extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -489,6 +504,11 @@ export class Avatars extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -529,6 +549,11 @@ export class Avatars extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -579,6 +604,11 @@ export class Avatars extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -616,6 +646,11 @@ export class Avatars extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } diff --git a/src/services/databases.ts b/src/services/databases.ts index e8bb0ab8..09186833 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -133,6 +133,10 @@ export class Databases extends Service { } /** + * **WARNING: Experimental Feature** - This endpoint is experimental and not + * yet officially supported. It may be subject to breaking changes or removal + * in future versions. + * * Create or update a Document. Before using this route, you should create a * new collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) diff --git a/src/services/storage.ts b/src/services/storage.ts index e574d6bc..e40614aa 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -442,6 +442,11 @@ export class Storage extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -523,6 +528,11 @@ export class Storage extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; } @@ -547,6 +557,11 @@ export class Storage extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } return uri; }