node-appwrite 21.0.0 → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/client.mjs.map +1 -1
- package/dist/services/databases.d.mts +7 -1
- package/dist/services/databases.d.ts +7 -1
- package/dist/services/databases.js +11 -1
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +11 -1
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +7 -1
- package/dist/services/tables-db.d.ts +7 -1
- package/dist/services/tables-db.js +11 -1
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +11 -1
- package/dist/services/tables-db.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -293,6 +293,8 @@ declare class TablesDB {
|
|
|
293
293
|
* @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
294
294
|
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
295
295
|
* @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
296
|
+
* @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
297
|
+
* @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
296
298
|
* @throws {AppwriteException}
|
|
297
299
|
* @returns {Promise<Models.Table>}
|
|
298
300
|
*/
|
|
@@ -303,6 +305,8 @@ declare class TablesDB {
|
|
|
303
305
|
permissions?: string[];
|
|
304
306
|
rowSecurity?: boolean;
|
|
305
307
|
enabled?: boolean;
|
|
308
|
+
columns?: object[];
|
|
309
|
+
indexes?: object[];
|
|
306
310
|
}): Promise<Models.Table>;
|
|
307
311
|
/**
|
|
308
312
|
* Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
@@ -313,11 +317,13 @@ declare class TablesDB {
|
|
|
313
317
|
* @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
314
318
|
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
315
319
|
* @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
320
|
+
* @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
321
|
+
* @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
316
322
|
* @throws {AppwriteException}
|
|
317
323
|
* @returns {Promise<Models.Table>}
|
|
318
324
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
319
325
|
*/
|
|
320
|
-
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise<Models.Table>;
|
|
326
|
+
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[]): Promise<Models.Table>;
|
|
321
327
|
/**
|
|
322
328
|
* Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.
|
|
323
329
|
*
|
|
@@ -293,6 +293,8 @@ declare class TablesDB {
|
|
|
293
293
|
* @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
294
294
|
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
295
295
|
* @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
296
|
+
* @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
297
|
+
* @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
296
298
|
* @throws {AppwriteException}
|
|
297
299
|
* @returns {Promise<Models.Table>}
|
|
298
300
|
*/
|
|
@@ -303,6 +305,8 @@ declare class TablesDB {
|
|
|
303
305
|
permissions?: string[];
|
|
304
306
|
rowSecurity?: boolean;
|
|
305
307
|
enabled?: boolean;
|
|
308
|
+
columns?: object[];
|
|
309
|
+
indexes?: object[];
|
|
306
310
|
}): Promise<Models.Table>;
|
|
307
311
|
/**
|
|
308
312
|
* Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
@@ -313,11 +317,13 @@ declare class TablesDB {
|
|
|
313
317
|
* @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
314
318
|
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
315
319
|
* @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
320
|
+
* @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
321
|
+
* @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
316
322
|
* @throws {AppwriteException}
|
|
317
323
|
* @returns {Promise<Models.Table>}
|
|
318
324
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
319
325
|
*/
|
|
320
|
-
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise<Models.Table>;
|
|
326
|
+
createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[]): Promise<Models.Table>;
|
|
321
327
|
/**
|
|
322
328
|
* Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.
|
|
323
329
|
*
|
|
@@ -388,7 +388,9 @@ class TablesDB {
|
|
|
388
388
|
name: rest[1],
|
|
389
389
|
permissions: rest[2],
|
|
390
390
|
rowSecurity: rest[3],
|
|
391
|
-
enabled: rest[4]
|
|
391
|
+
enabled: rest[4],
|
|
392
|
+
columns: rest[5],
|
|
393
|
+
indexes: rest[6]
|
|
392
394
|
};
|
|
393
395
|
}
|
|
394
396
|
const databaseId = params.databaseId;
|
|
@@ -397,6 +399,8 @@ class TablesDB {
|
|
|
397
399
|
const permissions = params.permissions;
|
|
398
400
|
const rowSecurity = params.rowSecurity;
|
|
399
401
|
const enabled = params.enabled;
|
|
402
|
+
const columns = params.columns;
|
|
403
|
+
const indexes = params.indexes;
|
|
400
404
|
if (typeof databaseId === "undefined") {
|
|
401
405
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
402
406
|
}
|
|
@@ -423,6 +427,12 @@ class TablesDB {
|
|
|
423
427
|
if (typeof enabled !== "undefined") {
|
|
424
428
|
payload["enabled"] = enabled;
|
|
425
429
|
}
|
|
430
|
+
if (typeof columns !== "undefined") {
|
|
431
|
+
payload["columns"] = columns;
|
|
432
|
+
}
|
|
433
|
+
if (typeof indexes !== "undefined") {
|
|
434
|
+
payload["indexes"] = indexes;
|
|
435
|
+
}
|
|
426
436
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
427
437
|
const apiHeaders = {
|
|
428
438
|
"content-type": "application/json"
|