diff --git a/README.md b/README.md index af47ac1..b7fd566 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.2-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) diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 6833f87..b064bf7 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -12,8 +12,8 @@ const result = await databases.updateFloatAttribute( '', // collectionId '', // key false, // required - null, // min - null, // max null, // default + null, // min (optional) + null, // max (optional) '' // newKey (optional) ); diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index d6d16f5..f686612 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -12,8 +12,8 @@ const result = await databases.updateIntegerAttribute( '', // collectionId '', // key false, // required - null, // min - null, // max null, // default + null, // min (optional) + null, // max (optional) '' // newKey (optional) ); diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-stats-resources.md similarity index 86% rename from docs/examples/health/get-queue-usage-dump.md rename to docs/examples/health/get-queue-stats-resources.md index 412015c..e469391 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -7,6 +7,6 @@ const client = new sdk.Client() const health = new sdk.Health(client); -const result = await health.getQueueUsageDump( +const result = await health.getQueueStatsResources( null // threshold (optional) ); diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md deleted file mode 100644 index b63d2f1..0000000 --- a/docs/examples/health/get-queue.md +++ /dev/null @@ -1,10 +0,0 @@ -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueue(); diff --git a/package.json b/package.json index d8b7209..d10ade1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-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": "15.0.1", + "version": "16.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index e0f7263..8d8ef2f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -33,7 +33,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/15.0.1'; + let ua = 'AppwriteNodeJSSDK/16.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -82,7 +82,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '15.0.1', + 'x-sdk-version': '16.0.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.6.0', }; @@ -97,8 +97,11 @@ class Client { * @returns {this} */ setEndpoint(endpoint: string): this { - this.config.endpoint = endpoint; + if (!endpoint.startsWith('http://') && !endpoint.startsWith('https://')) { + throw new AppwriteException('Invalid endpoint URL: ' + endpoint); + } + this.config.endpoint = endpoint; return this; } @@ -265,6 +268,10 @@ class Client { async chunkedUpload(method: string, url: URL, headers: Headers = {}, originalPayload: Payload = {}, onProgress: (progress: UploadProgress) => void) { const file = Object.values(originalPayload).find((value) => value instanceof File); + if (!file) { + throw new Error('File not found in payload'); + } + if (file.size <= Client.CHUNK_SIZE) { return await this.call(method, url, headers, originalPayload); } @@ -328,7 +335,6 @@ class Client { const { uri, options } = this.prepareRequest(method, url, headers, params); let data: any = null; - let text: string = ''; const response = await fetch(uri, options); @@ -339,18 +345,22 @@ class Client { if (response.headers.get('content-type')?.includes('application/json')) { data = await response.json(); - text = JSON.stringify(data); } else if (responseType === 'arrayBuffer') { data = await response.arrayBuffer(); } else { - text = await response.text(); data = { - message: text + message: await response.text() }; } if (400 <= response.status) { - throw new AppwriteException(data?.message, response.status, data?.type, text); + let responseText = ''; + if (response.headers.get('content-type')?.includes('application/json') || responseType === 'arrayBuffer') { + responseText = JSON.stringify(data); + } else { + responseText = data?.message; + } + throw new AppwriteException(data?.message, response.status, data?.type, responseText); } return data; diff --git a/src/enums/credit-card.ts b/src/enums/credit-card.ts index daf43c7..a96c73a 100644 --- a/src/enums/credit-card.ts +++ b/src/enums/credit-card.ts @@ -15,4 +15,5 @@ export enum CreditCard { Visa = 'visa', MIR = 'mir', Maestro = 'maestro', + Rupay = 'rupay', } \ No newline at end of file diff --git a/src/enums/name.ts b/src/enums/name.ts index 52e91aa..76e8469 100644 --- a/src/enums/name.ts +++ b/src/enums/name.ts @@ -4,8 +4,8 @@ export enum Name { V1audits = 'v1-audits', V1mails = 'v1-mails', V1functions = 'v1-functions', - V1usage = 'v1-usage', - V1usagedump = 'v1-usage-dump', + V1statsresources = 'v1-stats-resources', + V1statsusage = 'v1-stats-usage', V1webhooks = 'v1-webhooks', V1certificates = 'v1-certificates', V1builds = 'v1-builds', diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index b2bf4d1..7a3fcb3 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -13,6 +13,7 @@ export enum OAuthProvider { Dropbox = 'dropbox', Etsy = 'etsy', Facebook = 'facebook', + Figma = 'figma', Github = 'github', Gitlab = 'gitlab', Google = 'google', diff --git a/src/services/account.ts b/src/services/account.ts index 05cceea..7d1b34c 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -23,7 +23,6 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -134,7 +133,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -208,7 +206,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -409,7 +406,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -431,7 +427,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -595,7 +590,6 @@ This endpoint can also be used to convert an anonymous account to a normal one, const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -727,7 +721,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -943,7 +936,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1148,7 +1140,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.redirect( diff --git a/src/services/avatars.ts b/src/services/avatars.ts index dfe3870..c977c9b 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -41,7 +41,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -83,7 +82,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -115,7 +113,6 @@ This endpoint does not follow HTTP redirects. const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -157,7 +154,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -199,7 +195,6 @@ This endpoint does not follow HTTP redirects. const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -243,7 +238,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -286,7 +280,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/databases.ts b/src/services/databases.ts index fc0c5bd..265b72a 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -31,7 +31,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -98,7 +97,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -195,7 +193,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -277,7 +274,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -390,7 +386,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -904,14 +899,14 @@ export class Databases { * @param {string} collectionId * @param {string} key * @param {boolean} required + * @param {number} xdefault * @param {number} min * @param {number} max - * @param {number} xdefault * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} */ - updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number, newKey?: string): Promise { + updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -924,12 +919,6 @@ export class Databases { if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof min === 'undefined') { - throw new AppwriteException('Missing required parameter: "min"'); - } - if (typeof max === 'undefined') { - throw new AppwriteException('Missing required parameter: "max"'); - } if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } @@ -1032,14 +1021,14 @@ export class Databases { * @param {string} collectionId * @param {string} key * @param {boolean} required + * @param {number} xdefault * @param {number} min * @param {number} max - * @param {number} xdefault * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} */ - updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number, newKey?: string): Promise { + updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1052,12 +1041,6 @@ export class Databases { if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof min === 'undefined') { - throw new AppwriteException('Missing required parameter: "min"'); - } - if (typeof max === 'undefined') { - throw new AppwriteException('Missing required parameter: "max"'); - } if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } @@ -1509,7 +1492,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1620,7 +1602,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1632,6 +1613,7 @@ export class Databases { } /** * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + * * @param {string} databaseId * @param {string} collectionId @@ -1706,7 +1688,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1816,7 +1797,6 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1906,7 +1886,6 @@ Attributes can be `key`, `fulltext`, and `unique`. const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/functions.ts b/src/services/functions.ts index 451e131..0c77700 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -30,7 +30,6 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -171,7 +170,6 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -194,7 +192,6 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -220,7 +217,6 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -377,7 +373,6 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -460,7 +455,6 @@ Use the "command" param to set the entrypoint used to execute your cod const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -614,7 +608,6 @@ Use the "command" param to set the entrypoint used to execute your cod const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -649,7 +642,6 @@ Use the "command" param to set the entrypoint used to execute your cod const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -729,7 +721,6 @@ Use the "command" param to set the entrypoint used to execute your cod const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -786,7 +777,6 @@ Use the "command" param to set the entrypoint used to execute your cod const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -856,7 +846,6 @@ Use the "command" param to set the entrypoint used to execute your cod const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/health.ts b/src/services/health.ts index 9682c3c..d8d579c 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -21,7 +21,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -43,7 +42,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -65,7 +63,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -91,7 +88,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -113,7 +109,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -135,29 +130,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** - * Check the Appwrite queue messaging servers are up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueue(): Promise { - const apiPath = '/health/queue'; - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -183,7 +155,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -209,7 +180,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -239,7 +209,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -265,7 +234,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -296,7 +264,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -322,7 +289,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -348,7 +314,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -374,7 +339,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -400,7 +364,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -426,7 +389,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -437,14 +399,14 @@ export class Health { ); } /** - * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. + * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * * @param {number} threshold * @throws {AppwriteException} * @returns {Promise} */ - getQueueUsage(threshold?: number): Promise { - const apiPath = '/health/queue/usage'; + getQueueStatsResources(threshold?: number): Promise { + const apiPath = '/health/queue/stats-resources'; const payload: Payload = {}; if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; @@ -452,7 +414,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -463,14 +424,14 @@ export class Health { ); } /** - * Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server. + * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} * @returns {Promise} */ - getQueueUsageDump(threshold?: number): Promise { - const apiPath = '/health/queue/usage-dump'; + getQueueUsage(threshold?: number): Promise { + const apiPath = '/health/queue/stats-usage'; const payload: Payload = {}; if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; @@ -478,7 +439,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -504,7 +464,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -526,7 +485,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -548,7 +506,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -570,7 +527,6 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/locale.ts b/src/services/locale.ts index d6e0525..57c74d8 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -22,7 +22,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -44,7 +43,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -66,7 +64,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -88,7 +85,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -110,7 +106,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -132,7 +127,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -154,7 +148,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -176,7 +169,6 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/messaging.ts b/src/services/messaging.ts index e86a015..3d7f6b5 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -30,7 +30,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -514,7 +513,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -570,7 +568,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -600,7 +597,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -630,7 +626,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1752,7 +1747,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1808,7 +1802,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1838,7 +1831,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1868,7 +1860,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1935,7 +1926,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -2026,7 +2016,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -2060,7 +2049,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -2131,7 +2119,6 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/storage.ts b/src/services/storage.ts index 9015be4..4a27f22 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -31,7 +31,6 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -125,7 +124,6 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -250,7 +248,6 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -332,7 +329,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -430,7 +426,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -505,7 +500,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -536,7 +530,6 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/teams.ts b/src/services/teams.ts index 172ed06..ae6fde3 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -28,7 +28,6 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -94,7 +93,6 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -187,7 +185,6 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -277,7 +274,6 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -418,7 +414,6 @@ If the request is successful, a session for the user is automatically created. const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( diff --git a/src/services/users.ts b/src/services/users.ts index 543f66d..84b0a54 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -31,7 +31,6 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -200,7 +199,6 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -547,7 +545,6 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -705,7 +702,6 @@ Labels can be used to grant access to resources. While teams are a way for user& const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -731,7 +727,6 @@ Labels can be used to grant access to resources. While teams are a way for user& const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -820,7 +815,6 @@ Labels can be used to grant access to resources. While teams are a way for user& const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -846,7 +840,6 @@ Labels can be used to grant access to resources. While teams are a way for user& const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1023,7 +1016,6 @@ Labels can be used to grant access to resources. While teams are a way for user& const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1082,7 +1074,6 @@ Labels can be used to grant access to resources. While teams are a way for user& const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1229,7 +1220,6 @@ If you want to generate a token for a custom authentication flow, use the [POST const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( @@ -1314,7 +1304,6 @@ If you want to generate a token for a custom authentication flow, use the [POST const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call(