Skip to content

Commit f75abab

Browse files
authored
Merge pull request #104 from appwrite/dev
chore: regenerate sdks
2 parents cd2b306 + 60e9162 commit f75abab

14 files changed

+539
-1062
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "node-appwrite",
33
"homepage": "https://appwrite.io/support",
44
"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",
5-
"version": "15.0.0",
5+
"version": "15.0.1",
66
"license": "BSD-3-Clause",
77
"main": "dist/index.js",
88
"type": "commonjs",

src/client.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AppwriteException extends Error {
3333
}
3434

3535
function getUserAgent() {
36-
let ua = 'AppwriteNodeJSSDK/15.0.0';
36+
let ua = 'AppwriteNodeJSSDK/15.0.1';
3737

3838
// `process` is a global in Node.js, but not fully available in all runtimes.
3939
const platform: string[] = [];
@@ -82,7 +82,7 @@ class Client {
8282
'x-sdk-name': 'Node.js',
8383
'x-sdk-platform': 'server',
8484
'x-sdk-language': 'nodejs',
85-
'x-sdk-version': '15.0.0',
85+
'x-sdk-version': '15.0.1',
8686
'user-agent' : getUserAgent(),
8787
'X-Appwrite-Response-Format': '1.6.0',
8888
};
@@ -328,6 +328,7 @@ class Client {
328328
const { uri, options } = this.prepareRequest(method, url, headers, params);
329329

330330
let data: any = null;
331+
let text: string = '';
331332

332333
const response = await fetch(uri, options);
333334

@@ -338,16 +339,18 @@ class Client {
338339

339340
if (response.headers.get('content-type')?.includes('application/json')) {
340341
data = await response.json();
342+
text = JSON.stringify(data);
341343
} else if (responseType === 'arrayBuffer') {
342344
data = await response.arrayBuffer();
343345
} else {
346+
text = await response.text();
344347
data = {
345-
message: await response.text()
348+
message: text
346349
};
347350
}
348351

349352
if (400 <= response.status) {
350-
throw new AppwriteException(data?.message, response.status, data?.type, data);
353+
throw new AppwriteException(data?.message, response.status, data?.type, text);
351354
}
352355

353356
return data;

src/models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ export namespace Models {
443443
/**
444444
* Collection attributes.
445445
*/
446-
attributes: string[];
446+
attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString)[];
447447
/**
448448
* Collection indexes.
449449
*/
@@ -460,7 +460,7 @@ export namespace Models {
460460
/**
461461
* List of attributes.
462462
*/
463-
attributes: string[];
463+
attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString)[];
464464
}
465465
/**
466466
* AttributeString

0 commit comments

Comments
 (0)