Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/examples/account/update-prefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ const client = new sdk.Client()
const account = new sdk.Account(client);

const result = await account.updatePrefs({
prefs: {}
prefs: {
"language": "en",
"timezone": "UTC",
"darkTheme": true
}
});
8 changes: 7 additions & 1 deletion docs/examples/databases/create-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const result = await databases.createDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {},
data: {
"username": "walter.obrien",
"email": "[email protected]",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"] // optional
});
16 changes: 16 additions & 0 deletions docs/examples/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const databases = new sdk.Databases(client);

const result = await databases.createLineAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
});
16 changes: 16 additions & 0 deletions docs/examples/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const databases = new sdk.Databases(client);

const result = await databases.createPointAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
});
16 changes: 16 additions & 0 deletions docs/examples/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const databases = new sdk.Databases(client);

const result = await databases.createPolygonAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
});
17 changes: 17 additions & 0 deletions docs/examples/databases/update-line-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const databases = new sdk.Databases(client);

const result = await databases.updateLineAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
newKey: '' // optional
});
17 changes: 17 additions & 0 deletions docs/examples/databases/update-point-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const databases = new sdk.Databases(client);

const result = await databases.updatePointAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
newKey: '' // optional
});
17 changes: 17 additions & 0 deletions docs/examples/databases/update-polygon-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const databases = new sdk.Databases(client);

const result = await databases.updatePolygonAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
newKey: '' // optional
});
16 changes: 16 additions & 0 deletions docs/examples/tablesdb/create-line-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const tablesDB = new sdk.TablesDB(client);

const result = await tablesDB.createLineColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
});
16 changes: 16 additions & 0 deletions docs/examples/tablesdb/create-point-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const tablesDB = new sdk.TablesDB(client);

const result = await tablesDB.createPointColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
});
16 changes: 16 additions & 0 deletions docs/examples/tablesdb/create-polygon-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const tablesDB = new sdk.TablesDB(client);

const result = await tablesDB.createPolygonColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
});
8 changes: 7 additions & 1 deletion docs/examples/tablesdb/create-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const result = await tablesDB.createRow({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {},
data: {
"username": "walter.obrien",
"email": "[email protected]",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"] // optional
});
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/update-line-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const tablesDB = new sdk.TablesDB(client);

const result = await tablesDB.updateLineColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
newKey: '' // optional
});
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/update-point-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const tablesDB = new sdk.TablesDB(client);

const result = await tablesDB.updatePointColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
newKey: '' // optional
});
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/update-polygon-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const tablesDB = new sdk.TablesDB(client);

const result = await tablesDB.updatePolygonColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
newKey: '' // optional
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "18.0.0",
"version": "19.0.0",
"license": "BSD-3-Clause",
"main": "dist/index.js",
"type": "commonjs",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AppwriteException extends Error {
}

function getUserAgent() {
let ua = 'AppwriteNodeJSSDK/18.0.0';
let ua = 'AppwriteNodeJSSDK/19.0.0';

// `process` is a global in Node.js, but not fully available in all runtimes.
const platform: string[] = [];
Expand Down Expand Up @@ -82,7 +82,7 @@ class Client {
'x-sdk-name': 'Node.js',
'x-sdk-platform': 'server',
'x-sdk-language': 'nodejs',
'x-sdk-version': '18.0.0',
'x-sdk-version': '19.0.0',
'user-agent' : getUserAgent(),
'X-Appwrite-Response-Format': '1.8.0',
};
Expand Down
2 changes: 1 addition & 1 deletion src/enums/credit-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum CreditCard {
Mastercard = 'mastercard',
Naranja = 'naranja',
TarjetaShopping = 'targeta-shopping',
UnionChinaPay = 'union-china-pay',
UnionPay = 'unionpay',
Visa = 'visa',
MIR = 'mir',
Maestro = 'maestro',
Expand Down
1 change: 1 addition & 0 deletions src/enums/execution-method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export enum ExecutionMethod {
PATCH = 'PATCH',
DELETE = 'DELETE',
OPTIONS = 'OPTIONS',
HEAD = 'HEAD',
}
1 change: 1 addition & 0 deletions src/enums/index-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export enum IndexType {
Key = 'key',
Fulltext = 'fulltext',
Unique = 'unique',
Spatial = 'spatial',
}
Loading