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
2 changes: 1 addition & 1 deletion docs/examples/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const result = await databases.createLineAttribute({
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[1, 2], [3, 4], [5, 6]] // optional
});
2 changes: 1 addition & 1 deletion docs/examples/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const result = await databases.createPointAttribute({
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [1, 2] // optional
});
2 changes: 1 addition & 1 deletion docs/examples/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const result = await databases.createPolygonAttribute({
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional
});
2 changes: 1 addition & 1 deletion docs/examples/databases/update-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const result = await databases.updateLineAttribute({
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[1, 2], [3, 4], [5, 6]], // optional
newKey: '' // optional
});
2 changes: 1 addition & 1 deletion docs/examples/databases/update-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const result = await databases.updatePointAttribute({
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [1, 2], // optional
newKey: '' // optional
});
2 changes: 1 addition & 1 deletion docs/examples/databases/update-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const result = await databases.updatePolygonAttribute({
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional
newKey: '' // optional
});
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-line-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const result = await tablesDB.createLineColumn({
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[1, 2], [3, 4], [5, 6]] // optional
});
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-point-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const result = await tablesDB.createPointColumn({
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [1, 2] // optional
});
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-polygon-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const result = await tablesDB.createPolygonColumn({
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional
});
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-line-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const result = await tablesDB.updateLineColumn({
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[1, 2], [3, 4], [5, 6]], // optional
newKey: '' // optional
});
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-point-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const result = await tablesDB.updatePointColumn({
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [1, 2], // optional
newKey: '' // optional
});
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-polygon-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const result = await tablesDB.updatePolygonColumn({
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // 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": "19.0.0",
"version": "19.1.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/19.0.0';
let ua = 'AppwriteNodeJSSDK/19.1.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': '19.0.0',
'x-sdk-version': '19.1.0',
'user-agent' : getUserAgent(),
'X-Appwrite-Response-Format': '1.8.0',
};
Expand Down
14 changes: 7 additions & 7 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3232,10 +3232,6 @@ export namespace Models {
* The url of the vcs provider repository
*/
providerRepositoryUrl: string;
/**
* The branch of the vcs repository
*/
providerBranch: string;
/**
* The commit hash of the vcs commit
*/
Expand All @@ -3256,6 +3252,10 @@ export namespace Models {
* The url of the vcs commit
*/
providerCommitUrl: string;
/**
* The branch of the vcs repository
*/
providerBranch: string;
/**
* The branch of the vcs repository
*/
Expand Down Expand Up @@ -3307,7 +3307,7 @@ export namespace Models {
*/
requestPath: string;
/**
* HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
* HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
*/
requestHeaders: Headers[];
/**
Expand Down Expand Up @@ -3485,7 +3485,7 @@ export namespace Models {
*/
version: string;
/**
* Antivirus status. Possible values can are: `disabled`, `offline`, `online`
* Antivirus status. Possible values are: `disabled`, `offline`, `online`
*/
status: string;
}
Expand Down Expand Up @@ -3513,7 +3513,7 @@ export namespace Models {
*/
ping: number;
/**
* Service status. Possible values can are: `pass`, `fail`
* Service status. Possible values are: `pass`, `fail`
*/
status: string;
}
Expand Down
16 changes: 12 additions & 4 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ export class Query {
* Filter resources where attribute is equal to value.
*
* @param {string} attribute
* @param {QueryTypes | any[]} value
* @param {QueryTypes} value
* @returns {string}
*/
static equal = (attribute: string, value: QueryTypes | any[]): string =>
static equal = (attribute: string, value: QueryTypes): string =>
new Query("equal", attribute, value).toString();

/**
* Filter resources where attribute is not equal to value.
*
* @param {string} attribute
* @param {QueryTypes | any[]} value
* @param {QueryTypes} value
* @returns {string}
*/
static notEqual = (attribute: string, value: QueryTypes | any[]): string =>
static notEqual = (attribute: string, value: QueryTypes): string =>
new Query("notEqual", attribute, value).toString();

/**
Expand Down Expand Up @@ -195,6 +195,14 @@ export class Query {
static orderAsc = (attribute: string): string =>
new Query("orderAsc", attribute).toString();

/**
* Sort results randomly.
*
* @returns {string}
*/
static orderRandom = (): string =>
new Query("orderRandom").toString();

/**
* Return results after documentId.
*
Expand Down
4 changes: 2 additions & 2 deletions src/services/tables-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3898,7 +3898,7 @@ export class TablesDB {
*
* @param {string} params.databaseId - Database ID.
* @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.
* @param {object[]} params.rows - Array of documents data as JSON objects.
* @param {object[]} params.rows - Array of rows data as JSON objects.
* @throws {AppwriteException}
* @returns {Promise<Models.RowList<Row>>}
*/
Expand All @@ -3908,7 +3908,7 @@ export class TablesDB {
*
* @param {string} databaseId - Database ID.
* @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.
* @param {object[]} rows - Array of documents data as JSON objects.
* @param {object[]} rows - Array of rows data as JSON objects.
* @throws {AppwriteException}
* @returns {Promise<Models.RowList<Row>>}
* @deprecated Use the object parameter style method for a better developer experience.
Expand Down