From 7194f523691e8301954832da5e0efdb271ebba04 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 20 Aug 2025 03:11:05 +1200 Subject: [PATCH 1/8] Add 1.8.x support --- README.md | 8 +- docs/examples/databases/create.md | 5 +- docs/examples/functions/create-execution.md | 2 +- .../tablesdb/create-boolean-column.md | 17 + .../tablesdb/create-datetime-column.md | 17 + docs/examples/tablesdb/create-email-column.md | 17 + docs/examples/tablesdb/create-enum-column.md | 18 + docs/examples/tablesdb/create-float-column.md | 19 + docs/examples/tablesdb/create-index.md | 18 + .../tablesdb/create-integer-column.md | 19 + docs/examples/tablesdb/create-ip-column.md | 17 + .../tablesdb/create-relationship-column.md | 19 + docs/examples/tablesdb/create-row.md | 16 + docs/examples/tablesdb/create-rows.md | 14 + .../examples/tablesdb/create-string-column.md | 19 + docs/examples/tablesdb/create-table.md | 17 + docs/examples/tablesdb/create-url-column.md | 17 + docs/examples/tablesdb/create.md | 15 + .../examples/tablesdb/decrement-row-column.md | 17 + docs/examples/tablesdb/delete-column.md | 14 + docs/examples/tablesdb/delete-index.md | 14 + docs/examples/tablesdb/delete-row.md | 14 + docs/examples/tablesdb/delete-rows.md | 14 + docs/examples/tablesdb/delete-table.md | 13 + docs/examples/tablesdb/delete.md | 12 + docs/examples/tablesdb/get-column.md | 14 + docs/examples/tablesdb/get-index.md | 14 + docs/examples/tablesdb/get-row.md | 15 + docs/examples/tablesdb/get-table.md | 13 + docs/examples/tablesdb/get.md | 12 + .../examples/tablesdb/increment-row-column.md | 17 + docs/examples/tablesdb/list-columns.md | 14 + docs/examples/tablesdb/list-indexes.md | 14 + docs/examples/tablesdb/list-rows.md | 14 + docs/examples/tablesdb/list-tables.md | 14 + docs/examples/tablesdb/list.md | 13 + .../tablesdb/update-boolean-column.md | 17 + .../tablesdb/update-datetime-column.md | 17 + docs/examples/tablesdb/update-email-column.md | 17 + docs/examples/tablesdb/update-enum-column.md | 18 + docs/examples/tablesdb/update-float-column.md | 19 + .../tablesdb/update-integer-column.md | 19 + docs/examples/tablesdb/update-ip-column.md | 17 + .../tablesdb/update-relationship-column.md | 16 + docs/examples/tablesdb/update-row.md | 16 + docs/examples/tablesdb/update-rows.md | 15 + .../examples/tablesdb/update-string-column.md | 18 + docs/examples/tablesdb/update-table.md | 17 + docs/examples/tablesdb/update-url-column.md | 17 + docs/examples/tablesdb/update.md | 14 + docs/examples/tablesdb/upsert-row.md | 16 + docs/examples/tablesdb/upsert-rows.md | 14 + mod.ts | 4 + src/client.ts | 6 +- src/enums/type.ts | 4 + src/models.d.ts | 727 ++++- src/query.ts | 95 + src/services/account.ts | 2 + src/services/databases.ts | 80 +- src/services/tables-db.ts | 2349 +++++++++++++++++ test/query.test.ts | 55 + test/services/databases.test.ts | 23 +- test/services/tables-db.test.ts | 1114 ++++++++ 63 files changed, 5179 insertions(+), 73 deletions(-) create mode 100644 docs/examples/tablesdb/create-boolean-column.md create mode 100644 docs/examples/tablesdb/create-datetime-column.md create mode 100644 docs/examples/tablesdb/create-email-column.md create mode 100644 docs/examples/tablesdb/create-enum-column.md create mode 100644 docs/examples/tablesdb/create-float-column.md create mode 100644 docs/examples/tablesdb/create-index.md create mode 100644 docs/examples/tablesdb/create-integer-column.md create mode 100644 docs/examples/tablesdb/create-ip-column.md create mode 100644 docs/examples/tablesdb/create-relationship-column.md create mode 100644 docs/examples/tablesdb/create-row.md create mode 100644 docs/examples/tablesdb/create-rows.md create mode 100644 docs/examples/tablesdb/create-string-column.md create mode 100644 docs/examples/tablesdb/create-table.md create mode 100644 docs/examples/tablesdb/create-url-column.md create mode 100644 docs/examples/tablesdb/create.md create mode 100644 docs/examples/tablesdb/decrement-row-column.md create mode 100644 docs/examples/tablesdb/delete-column.md create mode 100644 docs/examples/tablesdb/delete-index.md create mode 100644 docs/examples/tablesdb/delete-row.md create mode 100644 docs/examples/tablesdb/delete-rows.md create mode 100644 docs/examples/tablesdb/delete-table.md create mode 100644 docs/examples/tablesdb/delete.md create mode 100644 docs/examples/tablesdb/get-column.md create mode 100644 docs/examples/tablesdb/get-index.md create mode 100644 docs/examples/tablesdb/get-row.md create mode 100644 docs/examples/tablesdb/get-table.md create mode 100644 docs/examples/tablesdb/get.md create mode 100644 docs/examples/tablesdb/increment-row-column.md create mode 100644 docs/examples/tablesdb/list-columns.md create mode 100644 docs/examples/tablesdb/list-indexes.md create mode 100644 docs/examples/tablesdb/list-rows.md create mode 100644 docs/examples/tablesdb/list-tables.md create mode 100644 docs/examples/tablesdb/list.md create mode 100644 docs/examples/tablesdb/update-boolean-column.md create mode 100644 docs/examples/tablesdb/update-datetime-column.md create mode 100644 docs/examples/tablesdb/update-email-column.md create mode 100644 docs/examples/tablesdb/update-enum-column.md create mode 100644 docs/examples/tablesdb/update-float-column.md create mode 100644 docs/examples/tablesdb/update-integer-column.md create mode 100644 docs/examples/tablesdb/update-ip-column.md create mode 100644 docs/examples/tablesdb/update-relationship-column.md create mode 100644 docs/examples/tablesdb/update-row.md create mode 100644 docs/examples/tablesdb/update-rows.md create mode 100644 docs/examples/tablesdb/update-string-column.md create mode 100644 docs/examples/tablesdb/update-table.md create mode 100644 docs/examples/tablesdb/update-url-column.md create mode 100644 docs/examples/tablesdb/update.md create mode 100644 docs/examples/tablesdb/upsert-row.md create mode 100644 docs/examples/tablesdb/upsert-rows.md create mode 100644 src/enums/type.ts create mode 100644 src/services/tables-db.ts create mode 100644 test/services/tables-db.test.ts diff --git a/README.md b/README.md index e0a6459..3f78aa7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Deno SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.8.0-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) -**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-deno/releases).** +**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-deno/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Deno SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) @@ -23,6 +23,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts"; ## Getting Started ### Init your SDK + Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section. ```typescript @@ -48,6 +49,7 @@ console.log(user); ``` ### Full Example + ```typescript import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -66,6 +68,7 @@ console.log(user); ``` ### Error Handling + The Appwrite Deno SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. ```typescript @@ -79,6 +82,7 @@ try { ``` ### Learn more + You can use the following resources to learn more and get help - 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) - 📜 [Appwrite Docs](https://appwrite.io/docs) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 86795eb..6627b7d 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, Databases, } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,5 +10,6 @@ const databases = new Databases(client); const response = await databases.create( '', // databaseId '', // name - false // enabled (optional) + false, // enabled (optional) + .Tablesdb // type (optional) ); diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index bec6a17..58c6c49 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -14,5 +14,5 @@ const response = await functions.createExecution( '', // path (optional) ExecutionMethod.GET, // method (optional) {}, // headers (optional) - '' // scheduledAt (optional) + '' // scheduledAt (optional) ); diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000..9f48de3 --- /dev/null +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createBooleanColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + false, // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000..bc60829 --- /dev/null +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createDatetimeColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + '', // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000..c8c8e29 --- /dev/null +++ b/docs/examples/tablesdb/create-email-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createEmailColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + 'email@example.com', // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000..a47a1ba --- /dev/null +++ b/docs/examples/tablesdb/create-enum-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createEnumColumn( + '', // databaseId + '', // tableId + '', // key + [], // elements + false, // required + '', // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000..a4bdbcb --- /dev/null +++ b/docs/examples/tablesdb/create-float-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createFloatColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + null, // min (optional) + null, // max (optional) + null, // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md new file mode 100644 index 0000000..b138f28 --- /dev/null +++ b/docs/examples/tablesdb/create-index.md @@ -0,0 +1,18 @@ +import { Client, TablesDb, IndexType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createIndex( + '', // databaseId + '', // tableId + '', // key + IndexType.Key, // type + [], // columns + [], // orders (optional) + [] // lengths (optional) +); diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000..9e2fb18 --- /dev/null +++ b/docs/examples/tablesdb/create-integer-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createIntegerColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + null, // min (optional) + null, // max (optional) + null, // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000..cf9d8d3 --- /dev/null +++ b/docs/examples/tablesdb/create-ip-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createIpColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + '', // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000..3b5dfa3 --- /dev/null +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDb, RelationshipType, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createRelationshipColumn( + '', // databaseId + '', // tableId + '', // relatedTableId + RelationshipType.OneToOne, // type + false, // twoWay (optional) + '', // key (optional) + '', // twoWayKey (optional) + RelationMutate.Cascade // onDelete (optional) +); diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md new file mode 100644 index 0000000..6a8d99a --- /dev/null +++ b/docs/examples/tablesdb/create-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createRow( + '', // databaseId + '', // tableId + '', // rowId + {}, // data + ["read("any")"] // permissions (optional) +); diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md new file mode 100644 index 0000000..4a98f7a --- /dev/null +++ b/docs/examples/tablesdb/create-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createRows( + '', // databaseId + '', // tableId + [] // rows +); diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000..0a23dcd --- /dev/null +++ b/docs/examples/tablesdb/create-string-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createStringColumn( + '', // databaseId + '', // tableId + '', // key + 1, // size + false, // required + '', // default (optional) + false, // array (optional) + false // encrypt (optional) +); diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md new file mode 100644 index 0000000..2460863 --- /dev/null +++ b/docs/examples/tablesdb/create-table.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createTable( + '', // databaseId + '', // tableId + '', // name + ["read("any")"], // permissions (optional) + false, // rowSecurity (optional) + false // enabled (optional) +); diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000..46e0db4 --- /dev/null +++ b/docs/examples/tablesdb/create-url-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.createUrlColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + 'https://example.com', // default (optional) + false // array (optional) +); diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md new file mode 100644 index 0000000..31559b1 --- /dev/null +++ b/docs/examples/tablesdb/create.md @@ -0,0 +1,15 @@ +import { Client, TablesDb, } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.create( + '', // databaseId + '', // name + false, // enabled (optional) + .Tablesdb // type (optional) +); diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000..9a0ad7a --- /dev/null +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.decrementRowColumn( + '', // databaseId + '', // tableId + '', // rowId + '', // column + null, // value (optional) + null // min (optional) +); diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md new file mode 100644 index 0000000..b2db1df --- /dev/null +++ b/docs/examples/tablesdb/delete-column.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.deleteColumn( + '', // databaseId + '', // tableId + '' // key +); diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md new file mode 100644 index 0000000..31a0d98 --- /dev/null +++ b/docs/examples/tablesdb/delete-index.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.deleteIndex( + '', // databaseId + '', // tableId + '' // key +); diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md new file mode 100644 index 0000000..d082865 --- /dev/null +++ b/docs/examples/tablesdb/delete-row.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.deleteRow( + '', // databaseId + '', // tableId + '' // rowId +); diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000..d27de4c --- /dev/null +++ b/docs/examples/tablesdb/delete-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.deleteRows( + '', // databaseId + '', // tableId + [] // queries (optional) +); diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md new file mode 100644 index 0000000..44d5860 --- /dev/null +++ b/docs/examples/tablesdb/delete-table.md @@ -0,0 +1,13 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.deleteTable( + '', // databaseId + '' // tableId +); diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md new file mode 100644 index 0000000..726c612 --- /dev/null +++ b/docs/examples/tablesdb/delete.md @@ -0,0 +1,12 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.delete( + '' // databaseId +); diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md new file mode 100644 index 0000000..cf937b0 --- /dev/null +++ b/docs/examples/tablesdb/get-column.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.getColumn( + '', // databaseId + '', // tableId + '' // key +); diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md new file mode 100644 index 0000000..f743691 --- /dev/null +++ b/docs/examples/tablesdb/get-index.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.getIndex( + '', // databaseId + '', // tableId + '' // key +); diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md new file mode 100644 index 0000000..b12ff45 --- /dev/null +++ b/docs/examples/tablesdb/get-row.md @@ -0,0 +1,15 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.getRow( + '', // databaseId + '', // tableId + '', // rowId + [] // queries (optional) +); diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md new file mode 100644 index 0000000..71b4c7f --- /dev/null +++ b/docs/examples/tablesdb/get-table.md @@ -0,0 +1,13 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.getTable( + '', // databaseId + '' // tableId +); diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md new file mode 100644 index 0000000..ea653a3 --- /dev/null +++ b/docs/examples/tablesdb/get.md @@ -0,0 +1,12 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.get( + '' // databaseId +); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000..5c1f3fe --- /dev/null +++ b/docs/examples/tablesdb/increment-row-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.incrementRowColumn( + '', // databaseId + '', // tableId + '', // rowId + '', // column + null, // value (optional) + null // max (optional) +); diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md new file mode 100644 index 0000000..9b52471 --- /dev/null +++ b/docs/examples/tablesdb/list-columns.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.listColumns( + '', // databaseId + '', // tableId + [] // queries (optional) +); diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000..ffb91e0 --- /dev/null +++ b/docs/examples/tablesdb/list-indexes.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.listIndexes( + '', // databaseId + '', // tableId + [] // queries (optional) +); diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md new file mode 100644 index 0000000..a550efd --- /dev/null +++ b/docs/examples/tablesdb/list-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.listRows( + '', // databaseId + '', // tableId + [] // queries (optional) +); diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md new file mode 100644 index 0000000..2ef6173 --- /dev/null +++ b/docs/examples/tablesdb/list-tables.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.listTables( + '', // databaseId + [], // queries (optional) + '' // search (optional) +); diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md new file mode 100644 index 0000000..77b6abe --- /dev/null +++ b/docs/examples/tablesdb/list.md @@ -0,0 +1,13 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.list( + [], // queries (optional) + '' // search (optional) +); diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000..2e9447e --- /dev/null +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateBooleanColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + false, // default + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000..2390874 --- /dev/null +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateDatetimeColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + '', // default + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000..f48e1a3 --- /dev/null +++ b/docs/examples/tablesdb/update-email-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateEmailColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + 'email@example.com', // default + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000..bd0f34f --- /dev/null +++ b/docs/examples/tablesdb/update-enum-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateEnumColumn( + '', // databaseId + '', // tableId + '', // key + [], // elements + false, // required + '', // default + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000..567eba5 --- /dev/null +++ b/docs/examples/tablesdb/update-float-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateFloatColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + null, // default + null, // min (optional) + null, // max (optional) + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000..dcd84d5 --- /dev/null +++ b/docs/examples/tablesdb/update-integer-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateIntegerColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + null, // default + null, // min (optional) + null, // max (optional) + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000..688a418 --- /dev/null +++ b/docs/examples/tablesdb/update-ip-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateIpColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + '', // default + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000..1388cf8 --- /dev/null +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,16 @@ +import { Client, TablesDb, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateRelationshipColumn( + '', // databaseId + '', // tableId + '', // key + RelationMutate.Cascade, // onDelete (optional) + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md new file mode 100644 index 0000000..33f9d7e --- /dev/null +++ b/docs/examples/tablesdb/update-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateRow( + '', // databaseId + '', // tableId + '', // rowId + {}, // data (optional) + ["read("any")"] // permissions (optional) +); diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md new file mode 100644 index 0000000..5dba0b9 --- /dev/null +++ b/docs/examples/tablesdb/update-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateRows( + '', // databaseId + '', // tableId + {}, // data (optional) + [] // queries (optional) +); diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000..6f6e183 --- /dev/null +++ b/docs/examples/tablesdb/update-string-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateStringColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + '', // default + 1, // size (optional) + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md new file mode 100644 index 0000000..8a6ce97 --- /dev/null +++ b/docs/examples/tablesdb/update-table.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateTable( + '', // databaseId + '', // tableId + '', // name + ["read("any")"], // permissions (optional) + false, // rowSecurity (optional) + false // enabled (optional) +); diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000..205d10a --- /dev/null +++ b/docs/examples/tablesdb/update-url-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.updateUrlColumn( + '', // databaseId + '', // tableId + '', // key + false, // required + 'https://example.com', // default + '' // newKey (optional) +); diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md new file mode 100644 index 0000000..486e684 --- /dev/null +++ b/docs/examples/tablesdb/update.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.update( + '', // databaseId + '', // name + false // enabled (optional) +); diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000..24dddd1 --- /dev/null +++ b/docs/examples/tablesdb/upsert-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.upsertRow( + '', // databaseId + '', // tableId + '', // rowId + {}, // data (optional) + ["read("any")"] // permissions (optional) +); diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000..20e025b --- /dev/null +++ b/docs/examples/tablesdb/upsert-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDb = new TablesDb(client); + +const response = await tablesDb.upsertRows( + '', // databaseId + '', // tableId + [] // rows +); diff --git a/mod.ts b/mod.ts index 35c4e91..93e4d1b 100644 --- a/mod.ts +++ b/mod.ts @@ -15,6 +15,7 @@ import { Locale } from "./src/services/locale.ts"; import { Messaging } from "./src/services/messaging.ts"; import { Sites } from "./src/services/sites.ts"; import { Storage } from "./src/services/storage.ts"; +import { TablesDb } from "./src/services/tables-db.ts"; import { Teams } from "./src/services/teams.ts"; import { Tokens } from "./src/services/tokens.ts"; import { Users } from "./src/services/users.ts"; @@ -24,6 +25,7 @@ import { OAuthProvider } from "./src/enums/o-auth-provider.ts"; import { Browser } from "./src/enums/browser.ts"; import { CreditCard } from "./src/enums/credit-card.ts"; import { Flag } from "./src/enums/flag.ts"; +import { Type } from "./src/enums/type.ts"; import { RelationshipType } from "./src/enums/relationship-type.ts"; import { RelationMutate } from "./src/enums/relation-mutate.ts"; import { IndexType } from "./src/enums/index-type.ts"; @@ -61,6 +63,7 @@ export { Messaging, Sites, Storage, + TablesDb, Teams, Tokens, Users, @@ -70,6 +73,7 @@ export { Browser, CreditCard, Flag, + Type, RelationshipType, RelationMutate, IndexType, diff --git a/src/client.ts b/src/client.ts index 67e36f9..139c77b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,12 +11,12 @@ export class Client { endpoint: string = 'https://cloud.appwrite.io/v1'; headers: Payload = { 'content-type': '', - 'user-agent' : `AppwriteDenoSDK/15.1.0 (${Deno.build.os}; ${Deno.build.arch})`, + 'user-agent' : `AppwriteDenoSDK/16.0.0 (${Deno.build.os}; ${Deno.build.arch})`, 'x-sdk-name': 'Deno', 'x-sdk-platform': 'server', 'x-sdk-language': 'deno', - 'x-sdk-version': '15.1.0', - 'X-Appwrite-Response-Format':'1.7.0', + 'x-sdk-version': '16.0.0', + 'X-Appwrite-Response-Format':'1.8.0', }; /** diff --git a/src/enums/type.ts b/src/enums/type.ts new file mode 100644 index 0000000..6b1c101 --- /dev/null +++ b/src/enums/type.ts @@ -0,0 +1,4 @@ +export enum Type { + Tablesdb = 'tablesdb', + Legacy = 'legacy', +} \ No newline at end of file diff --git a/src/models.d.ts b/src/models.d.ts index b47182e..cce7a8f 100644 --- a/src/models.d.ts +++ b/src/models.d.ts @@ -1,10 +1,23 @@ export namespace Models { + /** + * Rows List + */ + export type RowList = { + /** + * Total number of rows rows that matched your query. + */ + total: number; + /** + * List of rows. + */ + rows: Row[]; + } /** * Documents List */ export type DocumentList = { /** - * Total number of documents documents that matched your query. + * Total number of documents rows that matched your query. */ total: number; /** @@ -12,12 +25,25 @@ export namespace Models { */ documents: Document[]; } + /** + * Tables List + */ + export type TableList = { + /** + * Total number of tables rows that matched your query. + */ + total: number; + /** + * List of tables. + */ + tables: Table[]; + } /** * Collections List */ export type CollectionList = { /** - * Total number of collections documents that matched your query. + * Total number of collections rows that matched your query. */ total: number; /** @@ -30,7 +56,7 @@ export namespace Models { */ export type DatabaseList = { /** - * Total number of databases documents that matched your query. + * Total number of databases rows that matched your query. */ total: number; /** @@ -43,7 +69,7 @@ export namespace Models { */ export type IndexList = { /** - * Total number of indexes documents that matched your query. + * Total number of indexes rows that matched your query. */ total: number; /** @@ -51,12 +77,25 @@ export namespace Models { */ indexes: Index[]; } + /** + * Column Indexes List + */ + export type ColumnIndexList = { + /** + * Total number of indexes rows that matched your query. + */ + total: number; + /** + * List of indexes. + */ + indexes: ColumnIndex[]; + } /** * Users List */ export type UserList = { /** - * Total number of users documents that matched your query. + * Total number of users rows that matched your query. */ total: number; /** @@ -69,7 +108,7 @@ export namespace Models { */ export type SessionList = { /** - * Total number of sessions documents that matched your query. + * Total number of sessions rows that matched your query. */ total: number; /** @@ -82,7 +121,7 @@ export namespace Models { */ export type IdentityList = { /** - * Total number of identities documents that matched your query. + * Total number of identities rows that matched your query. */ total: number; /** @@ -95,7 +134,7 @@ export namespace Models { */ export type LogList = { /** - * Total number of logs documents that matched your query. + * Total number of logs rows that matched your query. */ total: number; /** @@ -108,7 +147,7 @@ export namespace Models { */ export type FileList = { /** - * Total number of files documents that matched your query. + * Total number of files rows that matched your query. */ total: number; /** @@ -121,7 +160,7 @@ export namespace Models { */ export type BucketList = { /** - * Total number of buckets documents that matched your query. + * Total number of buckets rows that matched your query. */ total: number; /** @@ -134,7 +173,7 @@ export namespace Models { */ export type ResourceTokenList = { /** - * Total number of tokens documents that matched your query. + * Total number of tokens rows that matched your query. */ total: number; /** @@ -147,7 +186,7 @@ export namespace Models { */ export type TeamList = { /** - * Total number of teams documents that matched your query. + * Total number of teams rows that matched your query. */ total: number; /** @@ -160,7 +199,7 @@ export namespace Models { */ export type MembershipList = { /** - * Total number of memberships documents that matched your query. + * Total number of memberships rows that matched your query. */ total: number; /** @@ -173,7 +212,7 @@ export namespace Models { */ export type SiteList = { /** - * Total number of sites documents that matched your query. + * Total number of sites rows that matched your query. */ total: number; /** @@ -186,7 +225,7 @@ export namespace Models { */ export type FunctionList = { /** - * Total number of functions documents that matched your query. + * Total number of functions rows that matched your query. */ total: number; /** @@ -199,7 +238,7 @@ export namespace Models { */ export type FrameworkList = { /** - * Total number of frameworks documents that matched your query. + * Total number of frameworks rows that matched your query. */ total: number; /** @@ -212,7 +251,7 @@ export namespace Models { */ export type RuntimeList = { /** - * Total number of runtimes documents that matched your query. + * Total number of runtimes rows that matched your query. */ total: number; /** @@ -225,7 +264,7 @@ export namespace Models { */ export type DeploymentList = { /** - * Total number of deployments documents that matched your query. + * Total number of deployments rows that matched your query. */ total: number; /** @@ -238,7 +277,7 @@ export namespace Models { */ export type ExecutionList = { /** - * Total number of executions documents that matched your query. + * Total number of executions rows that matched your query. */ total: number; /** @@ -251,7 +290,7 @@ export namespace Models { */ export type CountryList = { /** - * Total number of countries documents that matched your query. + * Total number of countries rows that matched your query. */ total: number; /** @@ -264,7 +303,7 @@ export namespace Models { */ export type ContinentList = { /** - * Total number of continents documents that matched your query. + * Total number of continents rows that matched your query. */ total: number; /** @@ -277,7 +316,7 @@ export namespace Models { */ export type LanguageList = { /** - * Total number of languages documents that matched your query. + * Total number of languages rows that matched your query. */ total: number; /** @@ -290,7 +329,7 @@ export namespace Models { */ export type CurrencyList = { /** - * Total number of currencies documents that matched your query. + * Total number of currencies rows that matched your query. */ total: number; /** @@ -303,7 +342,7 @@ export namespace Models { */ export type PhoneList = { /** - * Total number of phones documents that matched your query. + * Total number of phones rows that matched your query. */ total: number; /** @@ -316,7 +355,7 @@ export namespace Models { */ export type VariableList = { /** - * Total number of variables documents that matched your query. + * Total number of variables rows that matched your query. */ total: number; /** @@ -329,7 +368,7 @@ export namespace Models { */ export type LocaleCodeList = { /** - * Total number of localeCodes documents that matched your query. + * Total number of localeCodes rows that matched your query. */ total: number; /** @@ -342,7 +381,7 @@ export namespace Models { */ export type ProviderList = { /** - * Total number of providers documents that matched your query. + * Total number of providers rows that matched your query. */ total: number; /** @@ -355,7 +394,7 @@ export namespace Models { */ export type MessageList = { /** - * Total number of messages documents that matched your query. + * Total number of messages rows that matched your query. */ total: number; /** @@ -368,7 +407,7 @@ export namespace Models { */ export type TopicList = { /** - * Total number of topics documents that matched your query. + * Total number of topics rows that matched your query. */ total: number; /** @@ -381,7 +420,7 @@ export namespace Models { */ export type SubscriberList = { /** - * Total number of subscribers documents that matched your query. + * Total number of subscribers rows that matched your query. */ total: number; /** @@ -394,7 +433,7 @@ export namespace Models { */ export type TargetList = { /** - * Total number of targets documents that matched your query. + * Total number of targets rows that matched your query. */ total: number; /** @@ -407,7 +446,7 @@ export namespace Models { */ export type SpecificationList = { /** - * Total number of specifications documents that matched your query. + * Total number of specifications rows that matched your query. */ total: number; /** @@ -439,6 +478,10 @@ export namespace Models { * If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys. */ enabled: boolean; + /** + * Database type. + */ + type: string; } /** * Collection @@ -976,12 +1019,560 @@ export namespace Models { */ side: string; } + /** + * Table + */ + export type Table = { + /** + * Table ID. + */ + $id: string; + /** + * Table creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Table update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Table permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + $permissions: string[]; + /** + * Database ID. + */ + databaseId: string; + /** + * Table name. + */ + name: string; + /** + * Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. + */ + enabled: boolean; + /** + * Whether row-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + rowSecurity: boolean; + /** + * Table columns. + */ + columns: (ColumnBoolean | ColumnInteger | ColumnFloat | ColumnEmail | ColumnEnum | ColumnUrl | ColumnIp | ColumnDatetime | ColumnRelationship | ColumnString)[]; + /** + * Table indexes. + */ + indexes: ColumnIndex[]; + } + /** + * Columns List + */ + export type ColumnList = { + /** + * Total number of columns in the given table. + */ + total: number; + /** + * List of columns. + */ + columns: (ColumnBoolean | ColumnInteger | ColumnFloat | ColumnEmail | ColumnEnum | ColumnUrl | ColumnIp | ColumnDatetime | ColumnRelationship | ColumnString)[]; + } + /** + * ColumnString + */ + export type ColumnString = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Column size. + */ + size: number; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + xdefault?: string; + /** + * Defines whether this column is encrypted or not. + */ + encrypt?: boolean; + } + /** + * ColumnInteger + */ + export type ColumnInteger = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Minimum value to enforce for new documents. + */ + min?: number; + /** + * Maximum value to enforce for new documents. + */ + max?: number; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + xdefault?: number; + } + /** + * ColumnFloat + */ + export type ColumnFloat = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Minimum value to enforce for new documents. + */ + min?: number; + /** + * Maximum value to enforce for new documents. + */ + max?: number; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + xdefault?: number; + } + /** + * ColumnBoolean + */ + export type ColumnBoolean = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + xdefault?: boolean; + } + /** + * ColumnEmail + */ + export type ColumnEmail = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * String format. + */ + format: string; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + xdefault?: string; + } + /** + * ColumnEnum + */ + export type ColumnEnum = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Array of elements in enumerated type. + */ + elements: string[]; + /** + * String format. + */ + format: string; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + xdefault?: string; + } + /** + * ColumnIP + */ + export type ColumnIp = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * String format. + */ + format: string; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + xdefault?: string; + } + /** + * ColumnURL + */ + export type ColumnUrl = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * String format. + */ + format: string; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + xdefault?: string; + } + /** + * ColumnDatetime + */ + export type ColumnDatetime = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * ISO 8601 format. + */ + format: string; + /** + * Default value for attribute when not provided. Only null is optional + */ + xdefault?: string; + } + /** + * ColumnRelationship + */ + export type ColumnRelationship = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * The ID of the related table. + */ + relatedTable: string; + /** + * The type of the relationship. + */ + relationType: string; + /** + * Is the relationship two-way? + */ + twoWay: boolean; + /** + * The key of the two-way relationship. + */ + twoWayKey: string; + /** + * How deleting the parent document will propagate to child documents. + */ + onDelete: string; + /** + * Whether this is the parent or child side of the relationship + */ + side: string; + } /** * Index */ export type Index = { /** - * Index Key. + * Index ID. + */ + $id: string; + /** + * Index creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Index update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Index key. */ key: string; /** @@ -1008,6 +1599,15 @@ export namespace Models { * Index orders. */ orders?: string[]; + } + /** + * Index + */ + export type ColumnIndex = { + /** + * Index ID. + */ + $id: string; /** * Index creation date in ISO 8601 format. */ @@ -1016,6 +1616,67 @@ export namespace Models { * Index update date in ISO 8601 format. */ $updatedAt: string; + /** + * Index Key. + */ + key: string; + /** + * Index type. + */ + type: string; + /** + * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: string; + /** + * Error message. Displays error generated on failure of creating or deleting an index. + */ + error: string; + /** + * Index columns. + */ + columns: string[]; + /** + * Index columns length. + */ + lengths: number[]; + /** + * Index orders. + */ + orders?: string[]; + } + /** + * Row + */ + export type Row = { + /** + * Row ID. + */ + $id: string; + /** + * Row automatically incrementing ID. + */ + $sequence: number; + /** + * Table ID. + */ + $tableId: string; + /** + * Database ID. + */ + $databaseId: string; + /** + * Row creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Row update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + $permissions: string[]; } /** * Document diff --git a/src/query.ts b/src/query.ts index 98930a2..8788279 100644 --- a/src/query.ts +++ b/src/query.ts @@ -93,9 +93,104 @@ export class Query { static offset = (offset: number): string => new Query("offset", undefined, offset).toString(); + /** + * Filter resources where attribute contains the specified value. + * + * @param {string} attribute + * @param {string | string[]} value + * @returns {string} + */ static contains = (attribute: string, value: string | string[]): string => new Query("contains", attribute, value).toString(); + /** + * Filter resources where attribute does not contain the specified value. + * + * @param {string} attribute + * @param {string | string[]} value + * @returns {string} + */ + static notContains = (attribute: string, value: string | string[]): string => + new Query("notContains", attribute, value).toString(); + + /** + * Filter resources by searching attribute for value (inverse of search). + * A fulltext index on attribute is required for this query to work. + * + * @param {string} attribute + * @param {string} value + * @returns {string} + */ + static notSearch = (attribute: string, value: string): string => + new Query("notSearch", attribute, value).toString(); + + /** + * Filter resources where attribute is not between start and end (exclusive). + * + * @param {string} attribute + * @param {string | number} start + * @param {string | number} end + * @returns {string} + */ + static notBetween = (attribute: string, start: string | number, end: string | number): string => + new Query("notBetween", attribute, [start, end] as QueryTypesList).toString(); + + /** + * Filter resources where attribute does not start with value. + * + * @param {string} attribute + * @param {string} value + * @returns {string} + */ + static notStartsWith = (attribute: string, value: string): string => + new Query("notStartsWith", attribute, value).toString(); + + /** + * Filter resources where attribute does not end with value. + * + * @param {string} attribute + * @param {string} value + * @returns {string} + */ + static notEndsWith = (attribute: string, value: string): string => + new Query("notEndsWith", attribute, value).toString(); + + /** + * Filter resources where document was created before date. + * + * @param {string} value + * @returns {string} + */ + static createdBefore = (value: string): string => + new Query("createdBefore", undefined, value).toString(); + + /** + * Filter resources where document was created after date. + * + * @param {string} value + * @returns {string} + */ + static createdAfter = (value: string): string => + new Query("createdAfter", undefined, value).toString(); + + /** + * Filter resources where document was updated before date. + * + * @param {string} value + * @returns {string} + */ + static updatedBefore = (value: string): string => + new Query("updatedBefore", undefined, value).toString(); + + /** + * Filter resources where document was updated after date. + * + * @param {string} value + * @returns {string} + */ + static updatedAfter = (value: string): string => + new Query("updatedAfter", undefined, value).toString(); + static or = (queries: string[]) => new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString(); diff --git a/src/services/account.ts b/src/services/account.ts index 8969794..29a42b8 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -876,6 +876,7 @@ export class Account extends Service { * @param {string} secret * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated. */ async updateMagicURLSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { @@ -914,6 +915,7 @@ export class Account extends Service { * @param {string} secret * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated. */ async updatePhoneSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { diff --git a/src/services/databases.ts b/src/services/databases.ts index 9881842..587b147 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -5,6 +5,7 @@ import { InputFile } from '../inputFile.ts'; import { AppwriteException } from '../exception.ts'; import type { Models } from '../models.d.ts'; import { Query } from '../query.ts'; +import { Type } from '../enums/type.ts'; import { RelationshipType } from '../enums/relationship-type.ts'; import { RelationMutate } from '../enums/relation-mutate.ts'; import { IndexType } from '../enums/index-type.ts'; @@ -32,6 +33,7 @@ export class Databases extends Service { * @param {string} search * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.list` instead. */ async list(queries?: string[], search?: string): Promise { const apiPath = '/databases'; @@ -61,10 +63,12 @@ export class Databases extends Service { * @param {string} databaseId * @param {string} name * @param {boolean} enabled + * @param {Type} type * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createDatabase` instead. */ - async create(databaseId: string, name: string, enabled?: boolean): Promise { + async create(databaseId: string, name: string, enabled?: boolean, type?: Type): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -85,6 +89,9 @@ export class Databases extends Service { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof type !== 'undefined') { + payload['type'] = type; + } return await this.client.call( 'post', apiPath, @@ -102,6 +109,7 @@ export class Databases extends Service { * @param {string} databaseId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.get` instead. */ async get(databaseId: string): Promise { if (typeof databaseId === 'undefined') { @@ -128,6 +136,7 @@ export class Databases extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.update` instead. */ async update(databaseId: string, name: string, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -164,6 +173,7 @@ export class Databases extends Service { * @param {string} databaseId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.delete` instead. */ async delete(databaseId: string): Promise { if (typeof databaseId === 'undefined') { @@ -192,6 +202,7 @@ export class Databases extends Service { * @param {string} search * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listTables` instead. */ async listCollections(databaseId: string, queries?: string[], search?: string): Promise { if (typeof databaseId === 'undefined') { @@ -232,6 +243,7 @@ export class Databases extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createTable` instead. */ async createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -282,6 +294,7 @@ export class Databases extends Service { * @param {string} collectionId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getTable` instead. */ async getCollection(databaseId: string, collectionId: string): Promise { if (typeof databaseId === 'undefined') { @@ -315,6 +328,7 @@ export class Databases extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateTable` instead. */ async updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -362,6 +376,7 @@ export class Databases extends Service { * @param {string} collectionId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteTable` instead. */ async deleteCollection(databaseId: string, collectionId: string): Promise { if (typeof databaseId === 'undefined') { @@ -393,6 +408,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listColumns` instead. */ async listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { @@ -431,6 +447,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createBooleanColumn` instead. */ async createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -486,6 +503,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateBooleanColumn` instead. */ async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -541,6 +559,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createDatetimeColumn` instead. */ async createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -596,6 +615,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateDatetimeColumn` instead. */ async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -652,6 +672,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createEmailColumn` instead. */ async createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -708,6 +729,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateEmailColumn` instead. */ async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -753,8 +775,8 @@ export class Databases extends Service { ); } /** - * Create an enumeration attribute. The `elements` param acts as a white-list - * of accepted values for this attribute. + * Create an enum attribute. The `elements` param acts as a white-list of + * accepted values for this attribute. * * * @param {string} databaseId @@ -766,6 +788,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createEnumColumn` instead. */ async createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -830,6 +853,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateEnumColumn` instead. */ async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -896,6 +920,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createFloatColumn` instead. */ async createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -960,6 +985,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateFloatColumn` instead. */ async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -1025,6 +1051,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createIntegerColumn` instead. */ async createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -1089,6 +1116,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateIntegerColumn` instead. */ async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -1151,6 +1179,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createIpColumn` instead. */ async createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -1207,6 +1236,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateIpColumn` instead. */ async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -1266,6 +1296,7 @@ export class Databases extends Service { * @param {RelationMutate} onDelete * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createRelationshipColumn` instead. */ async createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise { if (typeof databaseId === 'undefined') { @@ -1329,6 +1360,7 @@ export class Databases extends Service { * @param {boolean} encrypt * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createStringColumn` instead. */ async createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -1396,6 +1428,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateStringColumn` instead. */ async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -1455,6 +1488,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createUrlColumn` instead. */ async createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { @@ -1511,6 +1545,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateUrlColumn` instead. */ async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -1563,6 +1598,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getColumn` instead. */ async getAttribute(databaseId: string, collectionId: string, key: string): Promise { if (typeof databaseId === 'undefined') { @@ -1597,6 +1633,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteColumn` instead. */ async deleteAttribute(databaseId: string, collectionId: string, key: string): Promise { if (typeof databaseId === 'undefined') { @@ -1636,6 +1673,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateRelationshipColumn` instead. */ async updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise { if (typeof databaseId === 'undefined') { @@ -1678,6 +1716,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listRows` instead. */ async listDocuments(databaseId: string, collectionId: string, queries?: string[]): Promise> { if (typeof databaseId === 'undefined') { @@ -1717,6 +1756,7 @@ export class Databases extends Service { * @param {string[]} permissions * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createRow` instead. */ async createDocument(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { @@ -1758,10 +1798,6 @@ export class Databases extends Service { ); } /** - * **WARNING: Experimental Feature** - This endpoint is experimental and not - * yet officially supported. It may be subject to breaking changes or removal - * in future versions. - * * Create new Documents. Before using this route, you should create a new * collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) @@ -1772,6 +1808,7 @@ export class Databases extends Service { * @param {object[]} documents * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createRows` instead. */ async createDocuments(databaseId: string, collectionId: string, documents: object[]): Promise> { if (typeof databaseId === 'undefined') { @@ -1803,10 +1840,6 @@ export class Databases extends Service { ); } /** - * **WARNING: Experimental Feature** - This endpoint is experimental and not - * yet officially supported. It may be subject to breaking changes or removal - * in future versions. - * * Create or update Documents. Before using this route, you should create a * new collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) @@ -1818,6 +1851,7 @@ export class Databases extends Service { * @param {object[]} documents * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRows` instead. */ async upsertDocuments(databaseId: string, collectionId: string, documents: object[]): Promise> { if (typeof databaseId === 'undefined') { @@ -1849,10 +1883,6 @@ export class Databases extends Service { ); } /** - * **WARNING: Experimental Feature** - This endpoint is experimental and not - * yet officially supported. It may be subject to breaking changes or removal - * in future versions. - * * Update all documents that match your queries, if no queries are submitted * then all documents are updated. You can pass only specific fields to be * updated. @@ -1863,6 +1893,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateRows` instead. */ async updateDocuments(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise> { if (typeof databaseId === 'undefined') { @@ -1893,10 +1924,6 @@ export class Databases extends Service { ); } /** - * **WARNING: Experimental Feature** - This endpoint is experimental and not - * yet officially supported. It may be subject to breaking changes or removal - * in future versions. - * * Bulk delete documents using queries, if no queries are passed then all * documents are deleted. * @@ -1905,6 +1932,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRows` instead. */ async deleteDocuments(databaseId: string, collectionId: string, queries?: string[]): Promise> { if (typeof databaseId === 'undefined') { @@ -1941,6 +1969,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getRow` instead. */ async getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { @@ -1972,10 +2001,6 @@ export class Databases extends Service { ); } /** - * **WARNING: Experimental Feature** - This endpoint is experimental and not - * yet officially supported. It may be subject to breaking changes or removal - * in future versions. - * * Create or update a Document. Before using this route, you should create a * new collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) @@ -1988,6 +2013,7 @@ export class Databases extends Service { * @param {string[]} permissions * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRow` instead. */ async upsertDocument(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { @@ -2036,6 +2062,7 @@ export class Databases extends Service { * @param {string[]} permissions * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateRow` instead. */ async updateDocument(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { @@ -2077,6 +2104,7 @@ export class Databases extends Service { * @param {string} documentId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRow` instead. */ async deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise { if (typeof databaseId === 'undefined') { @@ -2115,6 +2143,7 @@ export class Databases extends Service { * @param {number} min * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.decrementRowColumn` instead. */ async decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise { if (typeof databaseId === 'undefined') { @@ -2163,6 +2192,7 @@ export class Databases extends Service { * @param {number} max * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.incrementRowColumn` instead. */ async incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise { if (typeof databaseId === 'undefined') { @@ -2208,6 +2238,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listIndexes` instead. */ async listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { @@ -2248,6 +2279,7 @@ export class Databases extends Service { * @param {number[]} lengths * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createIndex` instead. */ async createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise { if (typeof databaseId === 'undefined') { @@ -2306,6 +2338,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getIndex` instead. */ async getIndex(databaseId: string, collectionId: string, key: string): Promise { if (typeof databaseId === 'undefined') { @@ -2340,6 +2373,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteIndex` instead. */ async deleteIndex(databaseId: string, collectionId: string, key: string): Promise { if (typeof databaseId === 'undefined') { diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts new file mode 100644 index 0000000..f8ee46f --- /dev/null +++ b/src/services/tables-db.ts @@ -0,0 +1,2349 @@ +import { basename } from "https://deno.land/std@0.122.0/path/mod.ts"; +import { Service } from '../service.ts'; +import { Payload, Client } from '../client.ts'; +import { InputFile } from '../inputFile.ts'; +import { AppwriteException } from '../exception.ts'; +import type { Models } from '../models.d.ts'; +import { Query } from '../query.ts'; +import { Type } from '../enums/type.ts'; +import { RelationshipType } from '../enums/relationship-type.ts'; +import { RelationMutate } from '../enums/relation-mutate.ts'; +import { IndexType } from '../enums/index-type.ts'; + +export type UploadProgress = { + $id: string; + progress: number; + sizeUploaded: number; + chunksTotal: number; + chunksUploaded: number; +} + +export class TablesDb extends Service { + + constructor(client: Client) + { + super(client); + } + + /** + * Get a list of all databases from the current Appwrite project. You can use + * the search parameter to filter your results. + * + * @param {string[]} queries + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + async list(queries?: string[], search?: string): Promise { + const apiPath = '/tablesdb'; + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + if (typeof search !== 'undefined') { + payload['search'] = search; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Create a new Database. + * + * + * @param {string} databaseId + * @param {string} name + * @param {boolean} enabled + * @param {Type} type + * @throws {AppwriteException} + * @returns {Promise} + */ + async create(databaseId: string, name: string, enabled?: boolean, type?: Type): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/tablesdb'; + const payload: Payload = {}; + + if (typeof databaseId !== 'undefined') { + payload['databaseId'] = databaseId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a database by its unique ID. This endpoint response returns a JSON + * object with the database metadata. + * + * @param {string} databaseId + * @throws {AppwriteException} + * @returns {Promise} + */ + async get(databaseId: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Update a database by its unique ID. + * + * @param {string} databaseId + * @param {string} name + * @param {boolean} enabled + * @throws {AppwriteException} + * @returns {Promise} + */ + async update(databaseId: string, name: string, enabled?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Delete a database by its unique ID. Only API keys with with databases.write + * scope can delete a database. + * + * @param {string} databaseId + * @throws {AppwriteException} + * @returns {Promise} + */ + async delete(databaseId: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a list of all tables that belong to the provided databaseId. You can + * use the search parameter to filter your results. + * + * @param {string} databaseId + * @param {string[]} queries + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + async listTables(databaseId: string, queries?: string[], search?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + if (typeof search !== 'undefined') { + payload['search'] = search; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Create a new Table. Before using this route, you should create a new + * database resource using either a [server + * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * API or directly from your database console. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} name + * @param {string[]} permissions + * @param {boolean} rowSecurity + * @param {boolean} enabled + * @throws {AppwriteException} + * @returns {Promise} + */ + async createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + + if (typeof tableId !== 'undefined') { + payload['tableId'] = tableId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof rowSecurity !== 'undefined') { + payload['rowSecurity'] = rowSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a table by its unique ID. This endpoint response returns a JSON object + * with the table metadata. + * + * @param {string} databaseId + * @param {string} tableId + * @throws {AppwriteException} + * @returns {Promise} + */ + async getTable(databaseId: string, tableId: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Update a table by its unique ID. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} name + * @param {string[]} permissions + * @param {boolean} rowSecurity + * @param {boolean} enabled + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof rowSecurity !== 'undefined') { + payload['rowSecurity'] = rowSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Delete a table by its unique ID. Only users with write permissions have + * access to delete this resource. + * + * @param {string} databaseId + * @param {string} tableId + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteTable(databaseId: string, tableId: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * List columns in the table. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + async listColumns(databaseId: string, tableId: string, queries?: string[]): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Create a boolean column. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {boolean} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createBooleanColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update a boolean column. Changing the `default` value will not update + * already existing rows. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {boolean} xdefault + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateBooleanColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create a date time column according to the ISO 8601 standard. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createDatetimeColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update a date time column. Changing the `default` value will not update + * already existing rows. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateDatetimeColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create an email column. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createEmailColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update an email column. Changing the `default` value will not update + * already existing rows. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateEmailColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create an enumeration column. The `elements` param acts as a white-list of + * accepted values for this column. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {string[]} elements + * @param {boolean} required + * @param {string} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createEnumColumn(databaseId: string, tableId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof elements === 'undefined') { + throw new AppwriteException('Missing required parameter: "elements"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof elements !== 'undefined') { + payload['elements'] = elements; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update an enum column. Changing the `default` value will not update already + * existing rows. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {string[]} elements + * @param {boolean} required + * @param {string} xdefault + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateEnumColumn(databaseId: string, tableId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof elements === 'undefined') { + throw new AppwriteException('Missing required parameter: "elements"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof elements !== 'undefined') { + payload['elements'] = elements; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create a float column. Optionally, minimum and maximum values can be + * provided. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {number} min + * @param {number} max + * @param {number} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update a float column. Changing the `default` value will not update already + * existing rows. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {number} xdefault + * @param {number} min + * @param {number} max + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateFloatColumn(databaseId: string, tableId: 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"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create an integer column. Optionally, minimum and maximum values can be + * provided. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {number} min + * @param {number} max + * @param {number} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update an integer column. Changing the `default` value will not update + * already existing rows. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {number} xdefault + * @param {number} min + * @param {number} max + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateIntegerColumn(databaseId: string, tableId: 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"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create IP address column. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createIpColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update an ip column. Changing the `default` value will not update already + * existing rows. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateIpColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create relationship column. [Learn more about relationship + * columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} relatedTableId + * @param {RelationshipType} type + * @param {boolean} twoWay + * @param {string} key + * @param {string} twoWayKey + * @param {RelationMutate} onDelete + * @throws {AppwriteException} + * @returns {Promise} + */ + async createRelationshipColumn(databaseId: string, tableId: string, relatedTableId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof relatedTableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "relatedTableId"'); + } + + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof relatedTableId !== 'undefined') { + payload['relatedTableId'] = relatedTableId; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof twoWay !== 'undefined') { + payload['twoWay'] = twoWay; + } + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof twoWayKey !== 'undefined') { + payload['twoWayKey'] = twoWayKey; + } + if (typeof onDelete !== 'undefined') { + payload['onDelete'] = onDelete; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create a string column. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {number} size + * @param {boolean} required + * @param {string} xdefault + * @param {boolean} array + * @param {boolean} encrypt + * @throws {AppwriteException} + * @returns {Promise} + */ + async createStringColumn(databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof size === 'undefined') { + throw new AppwriteException('Missing required parameter: "size"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof size !== 'undefined') { + payload['size'] = size; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + if (typeof encrypt !== 'undefined') { + payload['encrypt'] = encrypt; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update a string column. Changing the `default` value will not update + * already existing rows. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {number} size + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateStringColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof size !== 'undefined') { + payload['size'] = size; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create a URL column. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {boolean} array + * @throws {AppwriteException} + * @returns {Promise} + */ + async createUrlColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update an url column. Changing the `default` value will not update already + * existing rows. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {boolean} required + * @param {string} xdefault + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateUrlColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get column by ID. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @throws {AppwriteException} + * @returns {Promise} + */ + async getColumn(databaseId: string, tableId: string, key: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Deletes a column. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteColumn(databaseId: string, tableId: string, key: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update relationship column. [Learn more about relationship + * columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {RelationMutate} onDelete + * @param {string} newKey + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateRelationshipColumn(databaseId: string, tableId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + if (typeof onDelete !== 'undefined') { + payload['onDelete'] = onDelete; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * List indexes in the collection. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + async listIndexes(databaseId: string, tableId: string, queries?: string[]): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Creates an index on the columns listed. Your index should include all the + * columns you will query in a single request. + * Attributes can be `key`, `fulltext`, and `unique`. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @param {IndexType} type + * @param {string[]} columns + * @param {string[]} orders + * @param {number[]} lengths + * @throws {AppwriteException} + * @returns {Promise} + */ + async createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[]): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + + if (typeof columns === 'undefined') { + throw new AppwriteException('Missing required parameter: "columns"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof columns !== 'undefined') { + payload['columns'] = columns; + } + if (typeof orders !== 'undefined') { + payload['orders'] = orders; + } + if (typeof lengths !== 'undefined') { + payload['lengths'] = lengths; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get index by ID. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @throws {AppwriteException} + * @returns {Promise} + */ + async getIndex(databaseId: string, tableId: string, key: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Delete an index. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} key + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteIndex(databaseId: string, tableId: string, key: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a list of all the user's rows in a given table. You can use the query + * params to filter your results. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + async listRows(databaseId: string, tableId: string, queries?: string[]): Promise> { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Create a new Row. Before using this route, you should create a new table + * resource using either a [server + * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * API or directly from your database console. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} rowId + * @param {object} data + * @param {string[]} permissions + * @throws {AppwriteException} + * @returns {Promise} + */ + async createRow(databaseId: string, tableId: string, rowId: string, data: object, permissions?: string[]): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rowId === 'undefined') { + throw new AppwriteException('Missing required parameter: "rowId"'); + } + + if (typeof data === 'undefined') { + throw new AppwriteException('Missing required parameter: "data"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof rowId !== 'undefined') { + payload['rowId'] = rowId; + } + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create new Rows. Before using this route, you should create a new table + * resource using either a [server + * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * API or directly from your database console. + * + * @param {string} databaseId + * @param {string} tableId + * @param {object[]} rows + * @throws {AppwriteException} + * @returns {Promise} + */ + async createRows(databaseId: string, tableId: string, rows: object[]): Promise> { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rows === 'undefined') { + throw new AppwriteException('Missing required parameter: "rows"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof rows !== 'undefined') { + payload['rows'] = rows; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Create or update Rows. Before using this route, you should create a new + * table resource using either a [server + * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * API or directly from your database console. + * + * + * @param {string} databaseId + * @param {string} tableId + * @param {object[]} rows + * @throws {AppwriteException} + * @returns {Promise} + */ + async upsertRows(databaseId: string, tableId: string, rows: object[]): Promise> { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rows === 'undefined') { + throw new AppwriteException('Missing required parameter: "rows"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof rows !== 'undefined') { + payload['rows'] = rows; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update all rows that match your queries, if no queries are submitted then + * all rows are updated. You can pass only specific fields to be updated. + * + * @param {string} databaseId + * @param {string} tableId + * @param {object} data + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateRows(databaseId: string, tableId: string, data?: object, queries?: string[]): Promise> { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Bulk delete rows using queries, if no queries are passed then all rows are + * deleted. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteRows(databaseId: string, tableId: string, queries?: string[]): Promise> { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a row by its unique ID. This endpoint response returns a JSON object + * with the row data. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} rowId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + async getRow(databaseId: string, tableId: string, rowId: string, queries?: string[]): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rowId === 'undefined') { + throw new AppwriteException('Missing required parameter: "rowId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Create or update a Row. Before using this route, you should create a new + * table resource using either a [server + * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * API or directly from your database console. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} rowId + * @param {object} data + * @param {string[]} permissions + * @throws {AppwriteException} + * @returns {Promise} + */ + async upsertRow(databaseId: string, tableId: string, rowId: string, data?: object, permissions?: string[]): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rowId === 'undefined') { + throw new AppwriteException('Missing required parameter: "rowId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const payload: Payload = {}; + + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Update a row by its unique ID. Using the patch method you can pass only + * specific fields that will get updated. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} rowId + * @param {object} data + * @param {string[]} permissions + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateRow(databaseId: string, tableId: string, rowId: string, data?: object, permissions?: string[]): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rowId === 'undefined') { + throw new AppwriteException('Missing required parameter: "rowId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const payload: Payload = {}; + + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Delete a row by its unique ID. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} rowId + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteRow(databaseId: string, tableId: string, rowId: string): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rowId === 'undefined') { + throw new AppwriteException('Missing required parameter: "rowId"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const payload: Payload = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Decrement a specific column of a row by a given value. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} rowId + * @param {string} column + * @param {number} value + * @param {number} min + * @throws {AppwriteException} + * @returns {Promise} + */ + async decrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rowId === 'undefined') { + throw new AppwriteException('Missing required parameter: "rowId"'); + } + + if (typeof column === 'undefined') { + throw new AppwriteException('Missing required parameter: "column"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column); + const payload: Payload = {}; + + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Increment a specific column of a row by a given value. + * + * @param {string} databaseId + * @param {string} tableId + * @param {string} rowId + * @param {string} column + * @param {number} value + * @param {number} max + * @throws {AppwriteException} + * @returns {Promise} + */ + async incrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number): Promise { + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + + if (typeof rowId === 'undefined') { + throw new AppwriteException('Missing required parameter: "rowId"'); + } + + if (typeof column === 'undefined') { + throw new AppwriteException('Missing required parameter: "column"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column); + const payload: Payload = {}; + + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } +} diff --git a/test/query.test.ts b/test/query.test.ts index d1fac7f..823078b 100644 --- a/test/query.test.ts +++ b/test/query.test.ts @@ -172,4 +172,59 @@ describe('Query', () => { Query.offset(1).toString(), `{"method":"offset","values":[1]}`, )); + + test('notContains', () => assertEquals( + Query.notContains('attr', 'value').toString(), + `{"method":"notContains","attribute":"attr","values":["value"]}`, + )); + + test('notSearch', () => assertEquals( + Query.notSearch('attr', 'keyword1 keyword2').toString(), + '{"method":"notSearch","attribute":"attr","values":["keyword1 keyword2"]}', + )); + + describe('notBetween', () => { + test('with integers', () => assertEquals( + Query.notBetween('attr', 1, 2).toString(), + `{"method":"notBetween","attribute":"attr","values":[1,2]}`, + )); + test('with doubles', () => assertEquals( + Query.notBetween('attr', 1.2, 2.2).toString(), + `{"method":"notBetween","attribute":"attr","values":[1.2,2.2]}`, + )); + test('with strings', () => assertEquals( + Query.notBetween('attr', "a", "z").toString(), + `{"method":"notBetween","attribute":"attr","values":["a","z"]}`, + )); + }); + + test('notStartsWith', () => assertEquals( + Query.notStartsWith('attr', 'prefix').toString(), + `{"method":"notStartsWith","attribute":"attr","values":["prefix"]}`, + )); + + test('notEndsWith', () => assertEquals( + Query.notEndsWith('attr', 'suffix').toString(), + `{"method":"notEndsWith","attribute":"attr","values":["suffix"]}`, + )); + + test('createdBefore', () => assertEquals( + Query.createdBefore('2023-01-01').toString(), + `{"method":"createdBefore","values":["2023-01-01"]}`, + )); + + test('createdAfter', () => assertEquals( + Query.createdAfter('2023-01-01').toString(), + `{"method":"createdAfter","values":["2023-01-01"]}`, + )); + + test('updatedBefore', () => assertEquals( + Query.updatedBefore('2023-01-01').toString(), + `{"method":"updatedBefore","values":["2023-01-01"]}`, + )); + + test('updatedAfter', () => assertEquals( + Query.updatedAfter('2023-01-01').toString(), + `{"method":"updatedAfter","values":["2023-01-01"]}`, + )); }) diff --git a/test/services/databases.test.ts b/test/services/databases.test.ts index a2d03e0..2826d66 100644 --- a/test/services/databases.test.ts +++ b/test/services/databases.test.ts @@ -33,7 +33,8 @@ describe('Databases service', () => { 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'enabled': true,}; + 'enabled': true, + 'type': 'legacy',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -53,7 +54,8 @@ describe('Databases service', () => { 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'enabled': true,}; + 'enabled': true, + 'type': 'legacy',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -72,7 +74,8 @@ describe('Databases service', () => { 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'enabled': true,}; + 'enabled': true, + 'type': 'legacy',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -1043,14 +1046,15 @@ describe('Databases service', () => { test('test method createIndex()', async () => { const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'index1', 'type': 'primary', 'status': 'available', 'error': 'string', 'attributes': [], - 'lengths': [], - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + 'lengths': [],}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); @@ -1069,14 +1073,15 @@ describe('Databases service', () => { test('test method getIndex()', async () => { const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'index1', 'type': 'primary', 'status': 'available', 'error': 'string', 'attributes': [], - 'lengths': [], - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + 'lengths': [],}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); diff --git a/test/services/tables-db.test.ts b/test/services/tables-db.test.ts new file mode 100644 index 0000000..4b07462 --- /dev/null +++ b/test/services/tables-db.test.ts @@ -0,0 +1,1114 @@ +import {afterEach, describe, it as test} from "https://deno.land/std@0.204.0/testing/bdd.ts"; +import {restore, stub} from "https://deno.land/std@0.204.0/testing/mock.ts"; +import {assertEquals} from "https://deno.land/std@0.204.0/assert/assert_equals.ts"; +import { TablesDb } from "../../src/services/tablesDb.ts"; +import {Client} from "../../src/client.ts"; +import {InputFile} from "../../src/inputFile.ts" + +describe('TablesDb service', () => { + const client = new Client(); + const tablesDb = new TablesDb(client); + + afterEach(() => restore()) + + + test('test method list()', async () => { + const data = { + 'total': 5, + 'databases': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.list( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method create()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + 'name': 'My Database', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'enabled': true, + 'type': 'legacy',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.create( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method get()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + 'name': 'My Database', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'enabled': true, + 'type': 'legacy',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.get( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method update()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + 'name': 'My Database', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'enabled': true, + 'type': 'legacy',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.update( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method delete()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await tablesDb.delete( + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method listTables()', async () => { + const data = { + 'total': 5, + 'tables': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.listTables( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createTable()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'databaseId': '5e5ea5c16897e', + 'name': 'My Table', + 'enabled': true, + 'rowSecurity': true, + 'columns': [], + 'indexes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createTable( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method getTable()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'databaseId': '5e5ea5c16897e', + 'name': 'My Table', + 'enabled': true, + 'rowSecurity': true, + 'columns': [], + 'indexes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.getTable( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateTable()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'databaseId': '5e5ea5c16897e', + 'name': 'My Table', + 'enabled': true, + 'rowSecurity': true, + 'columns': [], + 'indexes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateTable( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteTable()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await tablesDb.deleteTable( + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method listColumns()', async () => { + const data = { + 'total': 5, + 'columns': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.listColumns( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createBooleanColumn()', async () => { + const data = { + 'key': 'isEnabled', + 'type': 'boolean', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createBooleanColumn( + '', + '', + '', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateBooleanColumn()', async () => { + const data = { + 'key': 'isEnabled', + 'type': 'boolean', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateBooleanColumn( + '', + '', + '', + true, + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createDatetimeColumn()', async () => { + const data = { + 'key': 'birthDay', + 'type': 'datetime', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'datetime',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createDatetimeColumn( + '', + '', + '', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateDatetimeColumn()', async () => { + const data = { + 'key': 'birthDay', + 'type': 'datetime', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'datetime',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateDatetimeColumn( + '', + '', + '', + true, + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createEmailColumn()', async () => { + const data = { + 'key': 'userEmail', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'email',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createEmailColumn( + '', + '', + '', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateEmailColumn()', async () => { + const data = { + 'key': 'userEmail', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'email',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateEmailColumn( + '', + '', + '', + true, + 'email@example.com', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createEnumColumn()', async () => { + const data = { + 'key': 'status', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'elements': [], + 'format': 'enum',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createEnumColumn( + '', + '', + '', + [], + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateEnumColumn()', async () => { + const data = { + 'key': 'status', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'elements': [], + 'format': 'enum',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateEnumColumn( + '', + '', + '', + [], + true, + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createFloatColumn()', async () => { + const data = { + 'key': 'percentageCompleted', + 'type': 'double', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createFloatColumn( + '', + '', + '', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateFloatColumn()', async () => { + const data = { + 'key': 'percentageCompleted', + 'type': 'double', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateFloatColumn( + '', + '', + '', + true, + 1.0, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createIntegerColumn()', async () => { + const data = { + 'key': 'count', + 'type': 'integer', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createIntegerColumn( + '', + '', + '', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateIntegerColumn()', async () => { + const data = { + 'key': 'count', + 'type': 'integer', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateIntegerColumn( + '', + '', + '', + true, + 1, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createIpColumn()', async () => { + const data = { + 'key': 'ipAddress', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'ip',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createIpColumn( + '', + '', + '', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateIpColumn()', async () => { + const data = { + 'key': 'ipAddress', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'ip',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateIpColumn( + '', + '', + '', + true, + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createRelationshipColumn()', async () => { + const data = { + 'key': 'fullName', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'relatedTable': 'table', + 'relationType': 'oneToOne|oneToMany|manyToOne|manyToMany', + 'twoWay': true, + 'twoWayKey': 'string', + 'onDelete': 'restrict|cascade|setNull', + 'side': 'parent|child',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createRelationshipColumn( + '', + '', + '', + 'oneToOne', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createStringColumn()', async () => { + const data = { + 'key': 'fullName', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'size': 128,}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createStringColumn( + '', + '', + '', + 1, + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateStringColumn()', async () => { + const data = { + 'key': 'fullName', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'size': 128,}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateStringColumn( + '', + '', + '', + true, + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createUrlColumn()', async () => { + const data = { + 'key': 'githubUrl', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'url',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createUrlColumn( + '', + '', + '', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateUrlColumn()', async () => { + const data = { + 'key': 'githubUrl', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'format': 'url',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateUrlColumn( + '', + '', + '', + true, + 'https://example.com', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method getColumn()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await tablesDb.getColumn( + '', + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method deleteColumn()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await tablesDb.deleteColumn( + '', + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method updateRelationshipColumn()', async () => { + const data = { + 'key': 'fullName', + 'type': 'string', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'relatedTable': 'table', + 'relationType': 'oneToOne|oneToMany|manyToOne|manyToMany', + 'twoWay': true, + 'twoWayKey': 'string', + 'onDelete': 'restrict|cascade|setNull', + 'side': 'parent|child',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateRelationshipColumn( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method listIndexes()', async () => { + const data = { + 'total': 5, + 'indexes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.listIndexes( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createIndex()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'index1', + 'type': 'primary', + 'status': 'available', + 'error': 'string', + 'columns': [], + 'lengths': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createIndex( + '', + '', + '', + 'key', + [], + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method getIndex()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'index1', + 'type': 'primary', + 'status': 'available', + 'error': 'string', + 'columns': [], + 'lengths': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.getIndex( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteIndex()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await tablesDb.deleteIndex( + '', + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method listRows()', async () => { + const data = { + 'total': 5, + 'rows': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.listRows( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createRow()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': 1, + '\$tableId': '5e5ea5c15117e', + '\$databaseId': '5e5ea5c15117e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createRow( + '', + '', + '', + {}, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createRows()', async () => { + const data = { + 'total': 5, + 'rows': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.createRows( + '', + '', + [], + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method upsertRows()', async () => { + const data = { + 'total': 5, + 'rows': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.upsertRows( + '', + '', + [], + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateRows()', async () => { + const data = { + 'total': 5, + 'rows': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateRows( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteRows()', async () => { + const data = { + 'total': 5, + 'rows': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.deleteRows( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method getRow()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': 1, + '\$tableId': '5e5ea5c15117e', + '\$databaseId': '5e5ea5c15117e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.getRow( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method upsertRow()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': 1, + '\$tableId': '5e5ea5c15117e', + '\$databaseId': '5e5ea5c15117e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.upsertRow( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateRow()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': 1, + '\$tableId': '5e5ea5c15117e', + '\$databaseId': '5e5ea5c15117e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.updateRow( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteRow()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await tablesDb.deleteRow( + '', + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method decrementRowColumn()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': 1, + '\$tableId': '5e5ea5c15117e', + '\$databaseId': '5e5ea5c15117e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.decrementRowColumn( + '', + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method incrementRowColumn()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': 1, + '\$tableId': '5e5ea5c15117e', + '\$databaseId': '5e5ea5c15117e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tablesDb.incrementRowColumn( + '', + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + }) From e89dabd74f14810246d864825a84a2240295bea1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 20 Aug 2025 18:24:24 +1200 Subject: [PATCH 2/8] Add 1.8.x support --- docs/examples/databases/create.md | 5 ++--- docs/examples/tablesdb/create.md | 5 ++--- mod.ts | 2 -- src/enums/type.ts | 4 ---- src/services/databases.ts | 7 +------ src/services/tables-db.ts | 11 +++-------- 6 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 src/enums/type.ts diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 6627b7d..86795eb 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,4 @@ -import { Client, Databases, } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,6 +10,5 @@ const databases = new Databases(client); const response = await databases.create( '', // databaseId '', // name - false, // enabled (optional) - .Tablesdb // type (optional) + false // enabled (optional) ); diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 31559b1..694058a 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -1,4 +1,4 @@ -import { Client, TablesDb, } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,6 +10,5 @@ const tablesDb = new TablesDb(client); const response = await tablesDb.create( '', // databaseId '', // name - false, // enabled (optional) - .Tablesdb // type (optional) + false // enabled (optional) ); diff --git a/mod.ts b/mod.ts index 93e4d1b..8995fb2 100644 --- a/mod.ts +++ b/mod.ts @@ -25,7 +25,6 @@ import { OAuthProvider } from "./src/enums/o-auth-provider.ts"; import { Browser } from "./src/enums/browser.ts"; import { CreditCard } from "./src/enums/credit-card.ts"; import { Flag } from "./src/enums/flag.ts"; -import { Type } from "./src/enums/type.ts"; import { RelationshipType } from "./src/enums/relationship-type.ts"; import { RelationMutate } from "./src/enums/relation-mutate.ts"; import { IndexType } from "./src/enums/index-type.ts"; @@ -73,7 +72,6 @@ export { Browser, CreditCard, Flag, - Type, RelationshipType, RelationMutate, IndexType, diff --git a/src/enums/type.ts b/src/enums/type.ts deleted file mode 100644 index 6b1c101..0000000 --- a/src/enums/type.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum Type { - Tablesdb = 'tablesdb', - Legacy = 'legacy', -} \ No newline at end of file diff --git a/src/services/databases.ts b/src/services/databases.ts index 587b147..d1a0e19 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -5,7 +5,6 @@ import { InputFile } from '../inputFile.ts'; import { AppwriteException } from '../exception.ts'; import type { Models } from '../models.d.ts'; import { Query } from '../query.ts'; -import { Type } from '../enums/type.ts'; import { RelationshipType } from '../enums/relationship-type.ts'; import { RelationMutate } from '../enums/relation-mutate.ts'; import { IndexType } from '../enums/index-type.ts'; @@ -63,12 +62,11 @@ export class Databases extends Service { * @param {string} databaseId * @param {string} name * @param {boolean} enabled - * @param {Type} type * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createDatabase` instead. */ - async create(databaseId: string, name: string, enabled?: boolean, type?: Type): Promise { + async create(databaseId: string, name: string, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -89,9 +87,6 @@ export class Databases extends Service { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof type !== 'undefined') { - payload['type'] = type; - } return await this.client.call( 'post', apiPath, diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index f8ee46f..7377b3d 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -5,7 +5,6 @@ import { InputFile } from '../inputFile.ts'; import { AppwriteException } from '../exception.ts'; import type { Models } from '../models.d.ts'; import { Query } from '../query.ts'; -import { Type } from '../enums/type.ts'; import { RelationshipType } from '../enums/relationship-type.ts'; import { RelationMutate } from '../enums/relation-mutate.ts'; import { IndexType } from '../enums/index-type.ts'; @@ -62,11 +61,10 @@ export class TablesDb extends Service { * @param {string} databaseId * @param {string} name * @param {boolean} enabled - * @param {Type} type * @throws {AppwriteException} * @returns {Promise} */ - async create(databaseId: string, name: string, enabled?: boolean, type?: Type): Promise { + async create(databaseId: string, name: string, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -87,9 +85,6 @@ export class TablesDb extends Service { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof type !== 'undefined') { - payload['type'] = type; - } return await this.client.call( 'post', apiPath, @@ -1674,7 +1669,7 @@ export class TablesDb extends Service { ); } /** - * List indexes in the collection. + * List indexes on the table. * * @param {string} databaseId * @param {string} tableId @@ -1710,7 +1705,7 @@ export class TablesDb extends Service { /** * Creates an index on the columns listed. Your index should include all the * columns you will query in a single request. - * Attributes can be `key`, `fulltext`, and `unique`. + * Type can be `key`, `fulltext`, or `unique`. * * @param {string} databaseId * @param {string} tableId From af9945578c073693a975493a8913b30c3f823a5e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 20 Aug 2025 19:19:01 +1200 Subject: [PATCH 3/8] Add 1.8.x support --- .../account/create-email-password-session.md | 8 ++-- docs/examples/account/create-email-token.md | 10 ++--- .../account/create-magic-u-r-l-token.md | 12 +++--- .../account/create-mfa-authenticator.md | 6 +-- docs/examples/account/create-mfa-challenge.md | 6 +-- docs/examples/account/create-o-auth2token.md | 12 +++--- docs/examples/account/create-phone-token.md | 8 ++-- docs/examples/account/create-recovery.md | 8 ++-- docs/examples/account/create-session.md | 8 ++-- docs/examples/account/create-verification.md | 6 +-- docs/examples/account/create.md | 12 +++--- docs/examples/account/delete-identity.md | 6 +-- .../account/delete-mfa-authenticator.md | 6 +-- docs/examples/account/delete-session.md | 6 +-- docs/examples/account/get-session.md | 6 +-- docs/examples/account/list-identities.md | 6 +-- docs/examples/account/list-logs.md | 6 +-- docs/examples/account/update-email.md | 8 ++-- docs/examples/account/update-m-f-a.md | 6 +-- .../account/update-magic-u-r-l-session.md | 8 ++-- .../account/update-mfa-authenticator.md | 8 ++-- docs/examples/account/update-mfa-challenge.md | 8 ++-- docs/examples/account/update-name.md | 6 +-- docs/examples/account/update-password.md | 8 ++-- docs/examples/account/update-phone-session.md | 8 ++-- .../account/update-phone-verification.md | 8 ++-- docs/examples/account/update-phone.md | 8 ++-- docs/examples/account/update-prefs.md | 6 +-- docs/examples/account/update-recovery.md | 10 ++--- docs/examples/account/update-session.md | 6 +-- docs/examples/account/update-verification.md | 8 ++-- docs/examples/avatars/get-browser.md | 12 +++--- docs/examples/avatars/get-credit-card.md | 12 +++--- docs/examples/avatars/get-favicon.md | 6 +-- docs/examples/avatars/get-flag.md | 12 +++--- docs/examples/avatars/get-image.md | 10 ++--- docs/examples/avatars/get-initials.md | 12 +++--- docs/examples/avatars/get-q-r.md | 12 +++--- .../databases/create-boolean-attribute.md | 16 +++---- docs/examples/databases/create-collection.md | 16 +++---- .../databases/create-datetime-attribute.md | 16 +++---- docs/examples/databases/create-document.md | 14 +++---- docs/examples/databases/create-documents.md | 10 ++--- .../databases/create-email-attribute.md | 16 +++---- .../databases/create-enum-attribute.md | 18 ++++---- .../databases/create-float-attribute.md | 20 ++++----- docs/examples/databases/create-index.md | 18 ++++---- .../databases/create-integer-attribute.md | 20 ++++----- .../examples/databases/create-ip-attribute.md | 16 +++---- .../create-relationship-attribute.md | 20 ++++----- .../databases/create-string-attribute.md | 20 ++++----- .../databases/create-url-attribute.md | 16 +++---- docs/examples/databases/create.md | 10 ++--- .../databases/decrement-document-attribute.md | 18 ++++---- docs/examples/databases/delete-attribute.md | 10 ++--- docs/examples/databases/delete-collection.md | 8 ++-- docs/examples/databases/delete-document.md | 10 ++--- docs/examples/databases/delete-documents.md | 10 ++--- docs/examples/databases/delete-index.md | 10 ++--- docs/examples/databases/delete.md | 6 +-- docs/examples/databases/get-attribute.md | 10 ++--- docs/examples/databases/get-collection.md | 8 ++-- docs/examples/databases/get-document.md | 12 +++--- docs/examples/databases/get-index.md | 10 ++--- docs/examples/databases/get.md | 6 +-- .../databases/increment-document-attribute.md | 18 ++++---- docs/examples/databases/list-attributes.md | 10 ++--- docs/examples/databases/list-collections.md | 10 ++--- docs/examples/databases/list-documents.md | 10 ++--- docs/examples/databases/list-indexes.md | 10 ++--- docs/examples/databases/list.md | 8 ++-- .../databases/update-boolean-attribute.md | 16 +++---- docs/examples/databases/update-collection.md | 16 +++---- .../databases/update-datetime-attribute.md | 16 +++---- docs/examples/databases/update-document.md | 14 +++---- docs/examples/databases/update-documents.md | 12 +++--- .../databases/update-email-attribute.md | 16 +++---- .../databases/update-enum-attribute.md | 18 ++++---- .../databases/update-float-attribute.md | 20 ++++----- .../databases/update-integer-attribute.md | 20 ++++----- .../examples/databases/update-ip-attribute.md | 16 +++---- .../update-relationship-attribute.md | 14 +++---- .../databases/update-string-attribute.md | 18 ++++---- .../databases/update-url-attribute.md | 16 +++---- docs/examples/databases/update.md | 10 ++--- docs/examples/databases/upsert-document.md | 14 +++---- docs/examples/databases/upsert-documents.md | 10 ++--- docs/examples/functions/create-deployment.md | 14 +++---- .../functions/create-duplicate-deployment.md | 10 ++--- docs/examples/functions/create-execution.md | 18 ++++---- .../functions/create-template-deployment.md | 16 +++---- docs/examples/functions/create-variable.md | 12 +++--- .../functions/create-vcs-deployment.md | 12 +++--- docs/examples/functions/create.md | 40 +++++++++--------- docs/examples/functions/delete-deployment.md | 8 ++-- docs/examples/functions/delete-execution.md | 8 ++-- docs/examples/functions/delete-variable.md | 8 ++-- docs/examples/functions/delete.md | 6 +-- .../functions/get-deployment-download.md | 10 ++--- docs/examples/functions/get-deployment.md | 8 ++-- docs/examples/functions/get-execution.md | 8 ++-- docs/examples/functions/get-variable.md | 8 ++-- docs/examples/functions/get.md | 6 +-- docs/examples/functions/list-deployments.md | 10 ++--- docs/examples/functions/list-executions.md | 8 ++-- docs/examples/functions/list-variables.md | 6 +-- docs/examples/functions/list.md | 8 ++-- .../functions/update-deployment-status.md | 8 ++-- .../functions/update-function-deployment.md | 8 ++-- docs/examples/functions/update-variable.md | 14 +++---- docs/examples/functions/update.md | 40 +++++++++--------- docs/examples/graphql/mutation.md | 6 +-- docs/examples/graphql/query.md | 6 +-- docs/examples/health/get-certificate.md | 6 +-- docs/examples/health/get-failed-jobs.md | 8 ++-- docs/examples/health/get-queue-builds.md | 6 +-- .../examples/health/get-queue-certificates.md | 6 +-- docs/examples/health/get-queue-databases.md | 8 ++-- docs/examples/health/get-queue-deletes.md | 6 +-- docs/examples/health/get-queue-functions.md | 6 +-- docs/examples/health/get-queue-logs.md | 6 +-- docs/examples/health/get-queue-mails.md | 6 +-- docs/examples/health/get-queue-messaging.md | 6 +-- docs/examples/health/get-queue-migrations.md | 6 +-- .../health/get-queue-stats-resources.md | 6 +-- docs/examples/health/get-queue-usage.md | 6 +-- docs/examples/health/get-queue-webhooks.md | 6 +-- .../messaging/create-apns-provider.md | 20 ++++----- docs/examples/messaging/create-email.md | 28 ++++++------- .../examples/messaging/create-fcm-provider.md | 12 +++--- .../messaging/create-mailgun-provider.md | 24 +++++------ .../messaging/create-msg91provider.md | 16 +++---- docs/examples/messaging/create-push.md | 42 +++++++++---------- .../messaging/create-sendgrid-provider.md | 20 ++++----- docs/examples/messaging/create-sms.md | 18 ++++---- .../messaging/create-smtp-provider.md | 32 +++++++------- docs/examples/messaging/create-subscriber.md | 10 ++--- .../messaging/create-telesign-provider.md | 16 +++---- .../messaging/create-textmagic-provider.md | 16 +++---- docs/examples/messaging/create-topic.md | 10 ++--- .../messaging/create-twilio-provider.md | 16 +++---- .../messaging/create-vonage-provider.md | 16 +++---- docs/examples/messaging/delete-provider.md | 6 +-- docs/examples/messaging/delete-subscriber.md | 8 ++-- docs/examples/messaging/delete-topic.md | 6 +-- docs/examples/messaging/delete.md | 6 +-- docs/examples/messaging/get-message.md | 6 +-- docs/examples/messaging/get-provider.md | 6 +-- docs/examples/messaging/get-subscriber.md | 8 ++-- docs/examples/messaging/get-topic.md | 6 +-- docs/examples/messaging/list-message-logs.md | 8 ++-- docs/examples/messaging/list-messages.md | 8 ++-- docs/examples/messaging/list-provider-logs.md | 8 ++-- docs/examples/messaging/list-providers.md | 8 ++-- .../messaging/list-subscriber-logs.md | 8 ++-- docs/examples/messaging/list-subscribers.md | 10 ++--- docs/examples/messaging/list-targets.md | 8 ++-- docs/examples/messaging/list-topic-logs.md | 8 ++-- docs/examples/messaging/list-topics.md | 8 ++-- .../messaging/update-apns-provider.md | 20 ++++----- docs/examples/messaging/update-email.md | 28 ++++++------- .../examples/messaging/update-fcm-provider.md | 12 +++--- .../messaging/update-mailgun-provider.md | 24 +++++------ .../messaging/update-msg91provider.md | 16 +++---- docs/examples/messaging/update-push.md | 42 +++++++++---------- .../messaging/update-sendgrid-provider.md | 20 ++++----- docs/examples/messaging/update-sms.md | 18 ++++---- .../messaging/update-smtp-provider.md | 32 +++++++------- .../messaging/update-telesign-provider.md | 16 +++---- .../messaging/update-textmagic-provider.md | 16 +++---- docs/examples/messaging/update-topic.md | 10 ++--- .../messaging/update-twilio-provider.md | 16 +++---- .../messaging/update-vonage-provider.md | 16 +++---- docs/examples/sites/create-deployment.md | 16 +++---- .../sites/create-duplicate-deployment.md | 8 ++-- .../sites/create-template-deployment.md | 16 +++---- docs/examples/sites/create-variable.md | 12 +++--- docs/examples/sites/create-vcs-deployment.md | 12 +++--- docs/examples/sites/create.md | 40 +++++++++--------- docs/examples/sites/delete-deployment.md | 8 ++-- docs/examples/sites/delete-log.md | 8 ++-- docs/examples/sites/delete-variable.md | 8 ++-- docs/examples/sites/delete.md | 6 +-- .../examples/sites/get-deployment-download.md | 10 ++--- docs/examples/sites/get-deployment.md | 8 ++-- docs/examples/sites/get-log.md | 8 ++-- docs/examples/sites/get-variable.md | 8 ++-- docs/examples/sites/get.md | 6 +-- docs/examples/sites/list-deployments.md | 10 ++--- docs/examples/sites/list-logs.md | 8 ++-- docs/examples/sites/list-variables.md | 6 +-- docs/examples/sites/list.md | 8 ++-- .../sites/update-deployment-status.md | 8 ++-- docs/examples/sites/update-site-deployment.md | 8 ++-- docs/examples/sites/update-variable.md | 14 +++---- docs/examples/sites/update.md | 40 +++++++++--------- docs/examples/storage/create-bucket.md | 24 +++++------ docs/examples/storage/create-file.md | 12 +++--- docs/examples/storage/delete-bucket.md | 6 +-- docs/examples/storage/delete-file.md | 8 ++-- docs/examples/storage/get-bucket.md | 6 +-- docs/examples/storage/get-file-download.md | 10 ++--- docs/examples/storage/get-file-preview.md | 32 +++++++------- docs/examples/storage/get-file-view.md | 10 ++--- docs/examples/storage/get-file.md | 8 ++-- docs/examples/storage/list-buckets.md | 8 ++-- docs/examples/storage/list-files.md | 10 ++--- docs/examples/storage/update-bucket.md | 24 +++++------ docs/examples/storage/update-file.md | 12 +++--- .../tablesdb/create-boolean-column.md | 16 +++---- .../tablesdb/create-datetime-column.md | 16 +++---- docs/examples/tablesdb/create-email-column.md | 16 +++---- docs/examples/tablesdb/create-enum-column.md | 18 ++++---- docs/examples/tablesdb/create-float-column.md | 20 ++++----- docs/examples/tablesdb/create-index.md | 18 ++++---- .../tablesdb/create-integer-column.md | 20 ++++----- docs/examples/tablesdb/create-ip-column.md | 16 +++---- .../tablesdb/create-relationship-column.md | 20 ++++----- docs/examples/tablesdb/create-row.md | 14 +++---- docs/examples/tablesdb/create-rows.md | 10 ++--- .../examples/tablesdb/create-string-column.md | 20 ++++----- docs/examples/tablesdb/create-table.md | 16 +++---- docs/examples/tablesdb/create-url-column.md | 16 +++---- docs/examples/tablesdb/create.md | 10 ++--- .../examples/tablesdb/decrement-row-column.md | 18 ++++---- docs/examples/tablesdb/delete-column.md | 10 ++--- docs/examples/tablesdb/delete-index.md | 10 ++--- docs/examples/tablesdb/delete-row.md | 10 ++--- docs/examples/tablesdb/delete-rows.md | 10 ++--- docs/examples/tablesdb/delete-table.md | 8 ++-- docs/examples/tablesdb/delete.md | 6 +-- docs/examples/tablesdb/get-column.md | 10 ++--- docs/examples/tablesdb/get-index.md | 10 ++--- docs/examples/tablesdb/get-row.md | 12 +++--- docs/examples/tablesdb/get-table.md | 8 ++-- docs/examples/tablesdb/get.md | 6 +-- .../examples/tablesdb/increment-row-column.md | 18 ++++---- docs/examples/tablesdb/list-columns.md | 10 ++--- docs/examples/tablesdb/list-indexes.md | 10 ++--- docs/examples/tablesdb/list-rows.md | 10 ++--- docs/examples/tablesdb/list-tables.md | 10 ++--- docs/examples/tablesdb/list.md | 8 ++-- .../tablesdb/update-boolean-column.md | 16 +++---- .../tablesdb/update-datetime-column.md | 16 +++---- docs/examples/tablesdb/update-email-column.md | 16 +++---- docs/examples/tablesdb/update-enum-column.md | 18 ++++---- docs/examples/tablesdb/update-float-column.md | 20 ++++----- .../tablesdb/update-integer-column.md | 20 ++++----- docs/examples/tablesdb/update-ip-column.md | 16 +++---- .../tablesdb/update-relationship-column.md | 14 +++---- docs/examples/tablesdb/update-row.md | 14 +++---- docs/examples/tablesdb/update-rows.md | 12 +++--- .../examples/tablesdb/update-string-column.md | 18 ++++---- docs/examples/tablesdb/update-table.md | 16 +++---- docs/examples/tablesdb/update-url-column.md | 16 +++---- docs/examples/tablesdb/update.md | 10 ++--- docs/examples/tablesdb/upsert-row.md | 14 +++---- docs/examples/tablesdb/upsert-rows.md | 10 ++--- docs/examples/teams/create-membership.md | 18 ++++---- docs/examples/teams/create.md | 10 ++--- docs/examples/teams/delete-membership.md | 8 ++-- docs/examples/teams/delete.md | 6 +-- docs/examples/teams/get-membership.md | 8 ++-- docs/examples/teams/get-prefs.md | 6 +-- docs/examples/teams/get.md | 6 +-- docs/examples/teams/list-memberships.md | 10 ++--- docs/examples/teams/list.md | 8 ++-- .../teams/update-membership-status.md | 12 +++--- docs/examples/teams/update-membership.md | 10 ++--- docs/examples/teams/update-name.md | 8 ++-- docs/examples/teams/update-prefs.md | 8 ++-- docs/examples/tokens/create-file-token.md | 10 ++--- docs/examples/tokens/delete.md | 6 +-- docs/examples/tokens/get.md | 6 +-- docs/examples/tokens/list.md | 10 ++--- docs/examples/tokens/update.md | 8 ++-- docs/examples/users/create-argon2user.md | 12 +++--- docs/examples/users/create-bcrypt-user.md | 12 +++--- docs/examples/users/create-j-w-t.md | 10 ++--- docs/examples/users/create-m-d5user.md | 12 +++--- .../users/create-mfa-recovery-codes.md | 6 +-- docs/examples/users/create-p-h-pass-user.md | 12 +++--- docs/examples/users/create-s-h-a-user.md | 14 +++---- .../users/create-scrypt-modified-user.md | 18 ++++---- docs/examples/users/create-scrypt-user.md | 22 +++++----- docs/examples/users/create-session.md | 6 +-- docs/examples/users/create-target.md | 16 +++---- docs/examples/users/create-token.md | 10 ++--- docs/examples/users/create.md | 14 +++---- docs/examples/users/delete-identity.md | 6 +-- .../users/delete-mfa-authenticator.md | 8 ++-- docs/examples/users/delete-session.md | 8 ++-- docs/examples/users/delete-sessions.md | 6 +-- docs/examples/users/delete-target.md | 8 ++-- docs/examples/users/delete.md | 6 +-- docs/examples/users/get-mfa-recovery-codes.md | 6 +-- docs/examples/users/get-prefs.md | 6 +-- docs/examples/users/get-target.md | 8 ++-- docs/examples/users/get.md | 6 +-- docs/examples/users/list-identities.md | 8 ++-- docs/examples/users/list-logs.md | 8 ++-- docs/examples/users/list-memberships.md | 10 ++--- docs/examples/users/list-mfa-factors.md | 6 +-- docs/examples/users/list-sessions.md | 6 +-- docs/examples/users/list-targets.md | 8 ++-- docs/examples/users/list.md | 8 ++-- .../users/update-email-verification.md | 8 ++-- docs/examples/users/update-email.md | 8 ++-- docs/examples/users/update-labels.md | 8 ++-- .../users/update-mfa-recovery-codes.md | 6 +-- docs/examples/users/update-mfa.md | 8 ++-- docs/examples/users/update-name.md | 8 ++-- docs/examples/users/update-password.md | 8 ++-- .../users/update-phone-verification.md | 8 ++-- docs/examples/users/update-phone.md | 8 ++-- docs/examples/users/update-prefs.md | 8 ++-- docs/examples/users/update-status.md | 8 ++-- docs/examples/users/update-target.md | 14 +++---- 318 files changed, 1879 insertions(+), 1879 deletions(-) diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index d08a92d..ab71bc3 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -6,7 +6,7 @@ const client = new Client() const account = new Account(client); -const response = await account.createEmailPasswordSession( - 'email@example.com', // email - 'password' // password -); +const response = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password' +}); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 384a3fb..5365f4d 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -6,8 +6,8 @@ const client = new Client() const account = new Account(client); -const response = await account.createEmailToken( - '', // userId - 'email@example.com', // email - false // phrase (optional) -); +const response = await account.createEmailToken({ + userId: '', + email: 'email@example.com', + phrase: false +}); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 29e552a..364dbae 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -6,9 +6,9 @@ const client = new Client() const account = new Account(client); -const response = await account.createMagicURLToken( - '', // userId - 'email@example.com', // email - 'https://example.com', // url (optional) - false // phrase (optional) -); +const response = await account.createMagicURLToken({ + userId: '', + email: 'email@example.com', + url: 'https://example.com', + phrase: false +}); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 52c193a..471225d 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.createMfaAuthenticator( - AuthenticatorType.Totp // type -); +const response = await account.createMfaAuthenticator({ + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 296e36d..a31896b 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -6,6 +6,6 @@ const client = new Client() const account = new Account(client); -const response = await account.createMfaChallenge( - AuthenticationFactor.Email // factor -); +const response = await account.createMfaChallenge({ + factor: AuthenticationFactor.Email +}); diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 24e43a9..b5463a7 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -6,9 +6,9 @@ const client = new Client() const account = new Account(client); -account.createOAuth2Token( - OAuthProvider.Amazon, // provider - 'https://example.com', // success (optional) - 'https://example.com', // failure (optional) - [] // scopes (optional) -); +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', + failure: 'https://example.com', + scopes: [] +}); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 77e4adc..f31ddee 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -6,7 +6,7 @@ const client = new Client() const account = new Account(client); -const response = await account.createPhoneToken( - '', // userId - '+12065550100' // phone -); +const response = await account.createPhoneToken({ + userId: '', + phone: '+12065550100' +}); diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index a3d92d8..cd08f64 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.createRecovery( - 'email@example.com', // email - 'https://example.com' // url -); +const response = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com' +}); diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 888493a..ff238a8 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -6,7 +6,7 @@ const client = new Client() const account = new Account(client); -const response = await account.createSession( - '', // userId - '' // secret -); +const response = await account.createSession({ + userId: '', + secret: '' +}); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 438feee..002c3f6 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.createVerification( - 'https://example.com' // url -); +const response = await account.createVerification({ + url: 'https://example.com' +}); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index c410a0f..1d8bc36 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -6,9 +6,9 @@ const client = new Client() const account = new Account(client); -const response = await account.create( - '', // userId - 'email@example.com', // email - '', // password - '' // name (optional) -); +const response = await account.create({ + userId: '', + email: 'email@example.com', + password: '', + name: '' +}); diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 359c7a3..26490a5 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.deleteIdentity( - '' // identityId -); +const response = await account.deleteIdentity({ + identityId: '' +}); diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index f4b164b..8ab5e26 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.deleteMfaAuthenticator( - AuthenticatorType.Totp // type -); +const response = await account.deleteMfaAuthenticator({ + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index a0b7d19..8472e57 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.deleteSession( - '' // sessionId -); +const response = await account.deleteSession({ + sessionId: '' +}); diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index c380b72..05d1782 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.getSession( - '' // sessionId -); +const response = await account.getSession({ + sessionId: '' +}); diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 1c612f9..e4c9b18 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.listIdentities( - [] // queries (optional) -); +const response = await account.listIdentities({ + queries: [] +}); diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 28ab351..ce26c4d 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.listLogs( - [] // queries (optional) -); +const response = await account.listLogs({ + queries: [] +}); diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 0753cff..746309e 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updateEmail( - 'email@example.com', // email - 'password' // password -); +const response = await account.updateEmail({ + email: 'email@example.com', + password: 'password' +}); diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 24611aa..ab496cd 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.updateMFA( - false // mfa -); +const response = await account.updateMFA({ + mfa: false +}); diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index a83c1d9..b40824b 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -6,7 +6,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updateMagicURLSession( - '', // userId - '' // secret -); +const response = await account.updateMagicURLSession({ + userId: '', + secret: '' +}); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 6b95818..48f8330 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updateMfaAuthenticator( - AuthenticatorType.Totp, // type - '' // otp -); +const response = await account.updateMfaAuthenticator({ + type: AuthenticatorType.Totp, + otp: '' +}); diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 61a7b44..c6325d3 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updateMfaChallenge( - '', // challengeId - '' // otp -); +const response = await account.updateMfaChallenge({ + challengeId: '', + otp: '' +}); diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index a02591b..c62bcf1 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.updateName( - '' // name -); +const response = await account.updateName({ + name: '' +}); diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 088bea8..a61c9fc 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updatePassword( - '', // password - 'password' // oldPassword (optional) -); +const response = await account.updatePassword({ + password: '', + oldPassword: 'password' +}); diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 4710a45..4a86183 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -6,7 +6,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updatePhoneSession( - '', // userId - '' // secret -); +const response = await account.updatePhoneSession({ + userId: '', + secret: '' +}); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 3b150c8..30f9b40 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updatePhoneVerification( - '', // userId - '' // secret -); +const response = await account.updatePhoneVerification({ + userId: '', + secret: '' +}); diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 9c1923c..821c279 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updatePhone( - '+12065550100', // phone - 'password' // password -); +const response = await account.updatePhone({ + phone: '+12065550100', + password: 'password' +}); diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 4b37a64..f7bb254 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.updatePrefs( - {} // prefs -); +const response = await account.updatePrefs({ + prefs: {} +}); diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 5d0d80f..031b6a3 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -7,8 +7,8 @@ const client = new Client() const account = new Account(client); -const response = await account.updateRecovery( - '', // userId - '', // secret - '' // password -); +const response = await account.updateRecovery({ + userId: '', + secret: '', + password: '' +}); diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index cb36b94..cccd5d2 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.updateSession( - '' // sessionId -); +const response = await account.updateSession({ + sessionId: '' +}); diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 9637085..1ef9050 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updateVerification( - '', // userId - '' // secret -); +const response = await account.updateVerification({ + userId: '', + secret: '' +}); diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 5443200..e1525a6 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -7,9 +7,9 @@ const client = new Client() const avatars = new Avatars(client); -const result = avatars.getBrowser( - Browser.AvantBrowser, // code - 0, // width (optional) - 0, // height (optional) - -1 // quality (optional) -); +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, + height: 0, + quality: -1 +}); diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 8bcc67e..54a266f 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -7,9 +7,9 @@ const client = new Client() const avatars = new Avatars(client); -const result = avatars.getCreditCard( - CreditCard.AmericanExpress, // code - 0, // width (optional) - 0, // height (optional) - -1 // quality (optional) -); +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, + height: 0, + quality: -1 +}); diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index cca313a..5a1a002 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -7,6 +7,6 @@ const client = new Client() const avatars = new Avatars(client); -const result = avatars.getFavicon( - 'https://example.com' // url -); +const result = avatars.getFavicon({ + url: 'https://example.com' +}); diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 6837438..5b02485 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -7,9 +7,9 @@ const client = new Client() const avatars = new Avatars(client); -const result = avatars.getFlag( - Flag.Afghanistan, // code - 0, // width (optional) - 0, // height (optional) - -1 // quality (optional) -); +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, + height: 0, + quality: -1 +}); diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 2960dab..a8a5a7f 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -7,8 +7,8 @@ const client = new Client() const avatars = new Avatars(client); -const result = avatars.getImage( - 'https://example.com', // url - 0, // width (optional) - 0 // height (optional) -); +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, + height: 0 +}); diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 10eb2d8..5719506 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -7,9 +7,9 @@ const client = new Client() const avatars = new Avatars(client); -const result = avatars.getInitials( - '', // name (optional) - 0, // width (optional) - 0, // height (optional) - '' // background (optional) -); +const result = avatars.getInitials({ + name: '', + width: 0, + height: 0, + background: '' +}); diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index d9ccc0d..6f9d404 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -7,9 +7,9 @@ const client = new Client() const avatars = new Avatars(client); -const result = avatars.getQR( - '', // text - 1, // size (optional) - 0, // margin (optional) - false // download (optional) -); +const result = avatars.getQR({ + text: '', + size: 1, + margin: 0, + download: false +}); diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index b216c2e..8154a6f 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createBooleanAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - false, // default (optional) - false // array (optional) -); +const response = await databases.createBooleanAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: false, + array: false +}); diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index c7e8026..e198c0c 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createCollection( - '', // databaseId - '', // collectionId - '', // name - ["read("any")"], // permissions (optional) - false, // documentSecurity (optional) - false // enabled (optional) -); +const response = await databases.createCollection({ + databaseId: '', + collectionId: '', + name: '', + permissions: ["read("any")"], + documentSecurity: false, + enabled: false +}); diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 664da19..a3d7984 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createDatetimeAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - '', // default (optional) - false // array (optional) -); +const response = await databases.createDatetimeAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: '', + array: false +}); diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index be8a1bd..1b0fa0c 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -7,10 +7,10 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createDocument( - '', // databaseId - '', // collectionId - '', // documentId - {}, // data - ["read("any")"] // permissions (optional) -); +const response = await databases.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, + permissions: ["read("any")"] +}); diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index 26c9796..71011da 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createDocuments( - '', // databaseId - '', // collectionId - [] // documents -); +const response = await databases.createDocuments({ + databaseId: '', + collectionId: '', + documents: [] +}); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 6c667ed..1b86fd5 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createEmailAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - 'email@example.com', // default (optional) - false // array (optional) -); +const response = await databases.createEmailAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: 'email@example.com', + array: false +}); diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 6fdd277..cbf8a84 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -7,12 +7,12 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createEnumAttribute( - '', // databaseId - '', // collectionId - '', // key - [], // elements - false, // required - '', // default (optional) - false // array (optional) -); +const response = await databases.createEnumAttribute({ + databaseId: '', + collectionId: '', + key: '', + elements: [], + required: false, + default: '', + array: false +}); diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index c5991d4..16f4848 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -7,13 +7,13 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createFloatAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - null, // min (optional) - null, // max (optional) - null, // default (optional) - false // array (optional) -); +const response = await databases.createFloatAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + min: null, + max: null, + default: null, + array: false +}); diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 3ab3c7a..68f29eb 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -7,12 +7,12 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createIndex( - '', // databaseId - '', // collectionId - '', // key - IndexType.Key, // type - [], // attributes - [], // orders (optional) - [] // lengths (optional) -); +const response = await databases.createIndex({ + databaseId: '', + collectionId: '', + key: '', + type: IndexType.Key, + attributes: [], + orders: [], + lengths: [] +}); diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 4a306cd..6f8590d 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -7,13 +7,13 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createIntegerAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - null, // min (optional) - null, // max (optional) - null, // default (optional) - false // array (optional) -); +const response = await databases.createIntegerAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + min: null, + max: null, + default: null, + array: false +}); diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index c043b25..b3361af 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createIpAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - '', // default (optional) - false // array (optional) -); +const response = await databases.createIpAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: '', + array: false +}); diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index d96ee59..29c7488 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -7,13 +7,13 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createRelationshipAttribute( - '', // databaseId - '', // collectionId - '', // relatedCollectionId - RelationshipType.OneToOne, // type - false, // twoWay (optional) - '', // key (optional) - '', // twoWayKey (optional) - RelationMutate.Cascade // onDelete (optional) -); +const response = await databases.createRelationshipAttribute({ + databaseId: '', + collectionId: '', + relatedCollectionId: '', + type: RelationshipType.OneToOne, + twoWay: false, + key: '', + twoWayKey: '', + onDelete: RelationMutate.Cascade +}); diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 5f8e955..b7500bd 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -7,13 +7,13 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createStringAttribute( - '', // databaseId - '', // collectionId - '', // key - 1, // size - false, // required - '', // default (optional) - false, // array (optional) - false // encrypt (optional) -); +const response = await databases.createStringAttribute({ + databaseId: '', + collectionId: '', + key: '', + size: 1, + required: false, + default: '', + array: false, + encrypt: false +}); diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 4639f75..2975cfa 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.createUrlAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - 'https://example.com', // default (optional) - false // array (optional) -); +const response = await databases.createUrlAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: 'https://example.com', + array: false +}); diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 86795eb..666d197 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.create( - '', // databaseId - '', // name - false // enabled (optional) -); +const response = await databases.create({ + databaseId: '', + name: '', + enabled: false +}); diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 0142188..553baaf 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -3,15 +3,15 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID - .setKey(''); // Your secret API key + .setSession(''); // The user session to authenticate with const databases = new Databases(client); -const response = await databases.decrementDocumentAttribute( - '', // databaseId - '', // collectionId - '', // documentId - '', // attribute - null, // value (optional) - null // min (optional) -); +const response = await databases.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: null, + min: null +}); diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index f7ad6b1..d41c512 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.deleteAttribute( - '', // databaseId - '', // collectionId - '' // key -); +const response = await databases.deleteAttribute({ + databaseId: '', + collectionId: '', + key: '' +}); diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 828d48a..d2a2b70 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -7,7 +7,7 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.deleteCollection( - '', // databaseId - '' // collectionId -); +const response = await databases.deleteCollection({ + databaseId: '', + collectionId: '' +}); diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 47d5df4..6efe03f 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.deleteDocument( - '', // databaseId - '', // collectionId - '' // documentId -); +const response = await databases.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '' +}); diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 4768ed4..c958165 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.deleteDocuments( - '', // databaseId - '', // collectionId - [] // queries (optional) -); +const response = await databases.deleteDocuments({ + databaseId: '', + collectionId: '', + queries: [] +}); diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index eee1613..c2f2969 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.deleteIndex( - '', // databaseId - '', // collectionId - '' // key -); +const response = await databases.deleteIndex({ + databaseId: '', + collectionId: '', + key: '' +}); diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 39b3f53..e14a83c 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -7,6 +7,6 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.delete( - '' // databaseId -); +const response = await databases.delete({ + databaseId: '' +}); diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index f2b801b..efe2155 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.getAttribute( - '', // databaseId - '', // collectionId - '' // key -); +const response = await databases.getAttribute({ + databaseId: '', + collectionId: '', + key: '' +}); diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index b94f4fd..0745ad9 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -7,7 +7,7 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.getCollection( - '', // databaseId - '' // collectionId -); +const response = await databases.getCollection({ + databaseId: '', + collectionId: '' +}); diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 5cb02c4..7714f9d 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -7,9 +7,9 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.getDocument( - '', // databaseId - '', // collectionId - '', // documentId - [] // queries (optional) -); +const response = await databases.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [] +}); diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 6c3a3de..235eed6 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.getIndex( - '', // databaseId - '', // collectionId - '' // key -); +const response = await databases.getIndex({ + databaseId: '', + collectionId: '', + key: '' +}); diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 403e467..0891f72 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -7,6 +7,6 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.get( - '' // databaseId -); +const response = await databases.get({ + databaseId: '' +}); diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 9202a94..7c8fbe8 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -3,15 +3,15 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID - .setKey(''); // Your secret API key + .setSession(''); // The user session to authenticate with const databases = new Databases(client); -const response = await databases.incrementDocumentAttribute( - '', // databaseId - '', // collectionId - '', // documentId - '', // attribute - null, // value (optional) - null // max (optional) -); +const response = await databases.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: null, + max: null +}); diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 2171ffe..0b402ee 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.listAttributes( - '', // databaseId - '', // collectionId - [] // queries (optional) -); +const response = await databases.listAttributes({ + databaseId: '', + collectionId: '', + queries: [] +}); diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 408ea2d..7b10446 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.listCollections( - '', // databaseId - [], // queries (optional) - '' // search (optional) -); +const response = await databases.listCollections({ + databaseId: '', + queries: [], + search: '' +}); diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 528e979..d30f262 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.listDocuments( - '', // databaseId - '', // collectionId - [] // queries (optional) -); +const response = await databases.listDocuments({ + databaseId: '', + collectionId: '', + queries: [] +}); diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 88af3b7..b1bb477 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.listIndexes( - '', // databaseId - '', // collectionId - [] // queries (optional) -); +const response = await databases.listIndexes({ + databaseId: '', + collectionId: '', + queries: [] +}); diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index dcae151..9cac22a 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -7,7 +7,7 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.list( - [], // queries (optional) - '' // search (optional) -); +const response = await databases.list({ + queries: [], + search: '' +}); diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index fe1b800..1a320af 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateBooleanAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - false, // default - '' // newKey (optional) -); +const response = await databases.updateBooleanAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: false, + newKey: '' +}); diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 47f1c02..f3de373 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateCollection( - '', // databaseId - '', // collectionId - '', // name - ["read("any")"], // permissions (optional) - false, // documentSecurity (optional) - false // enabled (optional) -); +const response = await databases.updateCollection({ + databaseId: '', + collectionId: '', + name: '', + permissions: ["read("any")"], + documentSecurity: false, + enabled: false +}); diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index ad18d93..686add6 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateDatetimeAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - '', // default - '' // newKey (optional) -); +const response = await databases.updateDatetimeAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: '', + newKey: '' +}); diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 31cce5e..dab3fcd 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -7,10 +7,10 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateDocument( - '', // databaseId - '', // collectionId - '', // documentId - {}, // data (optional) - ["read("any")"] // permissions (optional) -); +const response = await databases.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, + permissions: ["read("any")"] +}); diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index 1eef779..fbfcf77 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -7,9 +7,9 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateDocuments( - '', // databaseId - '', // collectionId - {}, // data (optional) - [] // queries (optional) -); +const response = await databases.updateDocuments({ + databaseId: '', + collectionId: '', + data: {}, + queries: [] +}); diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 116fadc..aab2195 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateEmailAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - 'email@example.com', // default - '' // newKey (optional) -); +const response = await databases.updateEmailAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: 'email@example.com', + newKey: '' +}); diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 663e44b..133f263 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -7,12 +7,12 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateEnumAttribute( - '', // databaseId - '', // collectionId - '', // key - [], // elements - false, // required - '', // default - '' // newKey (optional) -); +const response = await databases.updateEnumAttribute({ + databaseId: '', + collectionId: '', + key: '', + elements: [], + required: false, + default: '', + newKey: '' +}); diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index d9eab5a..3fdf664 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -7,13 +7,13 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateFloatAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - null, // default - null, // min (optional) - null, // max (optional) - '' // newKey (optional) -); +const response = await databases.updateFloatAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: null, + min: null, + max: null, + newKey: '' +}); diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 369b49d..ccdbd97 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -7,13 +7,13 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateIntegerAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - null, // default - null, // min (optional) - null, // max (optional) - '' // newKey (optional) -); +const response = await databases.updateIntegerAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: null, + min: null, + max: null, + newKey: '' +}); diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 049a527..d361cea 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateIpAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - '', // default - '' // newKey (optional) -); +const response = await databases.updateIpAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: '', + newKey: '' +}); diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 7fae26b..224ae20 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -7,10 +7,10 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateRelationshipAttribute( - '', // databaseId - '', // collectionId - '', // key - RelationMutate.Cascade, // onDelete (optional) - '' // newKey (optional) -); +const response = await databases.updateRelationshipAttribute({ + databaseId: '', + collectionId: '', + key: '', + onDelete: RelationMutate.Cascade, + newKey: '' +}); diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index ec91d33..3d814d6 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -7,12 +7,12 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateStringAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - '', // default - 1, // size (optional) - '' // newKey (optional) -); +const response = await databases.updateStringAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: '', + size: 1, + newKey: '' +}); diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 32f44b7..5d8ba70 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -7,11 +7,11 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.updateUrlAttribute( - '', // databaseId - '', // collectionId - '', // key - false, // required - 'https://example.com', // default - '' // newKey (optional) -); +const response = await databases.updateUrlAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: 'https://example.com', + newKey: '' +}); diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index b87ad82..078d9b0 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.update( - '', // databaseId - '', // name - false // enabled (optional) -); +const response = await databases.update({ + databaseId: '', + name: '', + enabled: false +}); diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index f05100e..c20edec 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -7,10 +7,10 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.upsertDocument( - '', // databaseId - '', // collectionId - '', // documentId - {}, // data - ["read("any")"] // permissions (optional) -); +const response = await databases.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, + permissions: ["read("any")"] +}); diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 0cd804b..ea6fea6 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -7,8 +7,8 @@ const client = new Client() const databases = new Databases(client); -const response = await databases.upsertDocuments( - '', // databaseId - '', // collectionId - [] // documents -); +const response = await databases.upsertDocuments({ + databaseId: '', + collectionId: '', + documents: [] +}); diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index a134a38..fadd4f5 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -7,10 +7,10 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.createDeployment( - '', // functionId - InputFile.fromPath('/path/to/file.png', 'file.png'), // code - false, // activate - '', // entrypoint (optional) - '' // commands (optional) -); +const response = await functions.createDeployment({ + functionId: '', + code: InputFile.fromPath('/path/to/file.png', 'file.png'), + activate: false, + entrypoint: '', + commands: '' +}); diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index e22d1da..7868b04 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -7,8 +7,8 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.createDuplicateDeployment( - '', // functionId - '', // deploymentId - '' // buildId (optional) -); +const response = await functions.createDuplicateDeployment({ + functionId: '', + deploymentId: '', + buildId: '' +}); diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 58c6c49..aee2359 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -7,12 +7,12 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.createExecution( - '', // functionId - '', // body (optional) - false, // async (optional) - '', // path (optional) - ExecutionMethod.GET, // method (optional) - {}, // headers (optional) - '' // scheduledAt (optional) -); +const response = await functions.createExecution({ + functionId: '', + body: '', + async: false, + path: '', + method: ExecutionMethod.GET, + headers: {}, + scheduledAt: '' +}); diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index 69503da..32e6f11 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -7,11 +7,11 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.createTemplateDeployment( - '', // functionId - '', // repository - '', // owner - '', // rootDirectory - '', // version - false // activate (optional) -); +const response = await functions.createTemplateDeployment({ + functionId: '', + repository: '', + owner: '', + rootDirectory: '', + version: '', + activate: false +}); diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 2864890..274ced2 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -7,9 +7,9 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.createVariable( - '', // functionId - '', // key - '', // value - false // secret (optional) -); +const response = await functions.createVariable({ + functionId: '', + key: '', + value: '', + secret: false +}); diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index d501b0e..e47d994 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -7,9 +7,9 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.createVcsDeployment( - '', // functionId - VCSDeploymentType.Branch, // type - '', // reference - false // activate (optional) -); +const response = await functions.createVcsDeployment({ + functionId: '', + type: VCSDeploymentType.Branch, + reference: '', + activate: false +}); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 32265de..113da00 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -7,23 +7,23 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.create( - '', // functionId - '', // name - .Node145, // runtime - ["any"], // execute (optional) - [], // events (optional) - '', // schedule (optional) - 1, // timeout (optional) - false, // enabled (optional) - false, // logging (optional) - '', // entrypoint (optional) - '', // commands (optional) - [], // scopes (optional) - '', // installationId (optional) - '', // providerRepositoryId (optional) - '', // providerBranch (optional) - false, // providerSilentMode (optional) - '', // providerRootDirectory (optional) - '' // specification (optional) -); +const response = await functions.create({ + functionId: '', + name: '', + runtime: .Node145, + execute: ["any"], + events: [], + schedule: '', + timeout: 1, + enabled: false, + logging: false, + entrypoint: '', + commands: '', + scopes: [], + installationId: '', + providerRepositoryId: '', + providerBranch: '', + providerSilentMode: false, + providerRootDirectory: '', + specification: '' +}); diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 179bbaf..11c2e92 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.deleteDeployment( - '', // functionId - '' // deploymentId -); +const response = await functions.deleteDeployment({ + functionId: '', + deploymentId: '' +}); diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 4ab7c37..95185ab 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.deleteExecution( - '', // functionId - '' // executionId -); +const response = await functions.deleteExecution({ + functionId: '', + executionId: '' +}); diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 39a9428..d3387fd 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.deleteVariable( - '', // functionId - '' // variableId -); +const response = await functions.deleteVariable({ + functionId: '', + variableId: '' +}); diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 94d58c3..9270762 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -7,6 +7,6 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.delete( - '' // functionId -); +const response = await functions.delete({ + functionId: '' +}); diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index d153036..4dfa322 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -7,8 +7,8 @@ const client = new Client() const functions = new Functions(client); -const result = functions.getDeploymentDownload( - '', // functionId - '', // deploymentId - DeploymentDownloadType.Source // type (optional) -); +const result = functions.getDeploymentDownload({ + functionId: '', + deploymentId: '', + type: DeploymentDownloadType.Source +}); diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 339b99d..e125fa5 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.getDeployment( - '', // functionId - '' // deploymentId -); +const response = await functions.getDeployment({ + functionId: '', + deploymentId: '' +}); diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index adeff02..d52b60e 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.getExecution( - '', // functionId - '' // executionId -); +const response = await functions.getExecution({ + functionId: '', + executionId: '' +}); diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index cbbdd2f..e5916c7 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.getVariable( - '', // functionId - '' // variableId -); +const response = await functions.getVariable({ + functionId: '', + variableId: '' +}); diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 8fec17e..c4678f0 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -7,6 +7,6 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.get( - '' // functionId -); +const response = await functions.get({ + functionId: '' +}); diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 849fe23..1c04aba 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -7,8 +7,8 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.listDeployments( - '', // functionId - [], // queries (optional) - '' // search (optional) -); +const response = await functions.listDeployments({ + functionId: '', + queries: [], + search: '' +}); diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index cd597fb..03e373f 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.listExecutions( - '', // functionId - [] // queries (optional) -); +const response = await functions.listExecutions({ + functionId: '', + queries: [] +}); diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 173d5aa..6bc904b 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -7,6 +7,6 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.listVariables( - '' // functionId -); +const response = await functions.listVariables({ + functionId: '' +}); diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index ecc43d1..3b9c401 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.list( - [], // queries (optional) - '' // search (optional) -); +const response = await functions.list({ + queries: [], + search: '' +}); diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index 4c7e805..d6b6cdd 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.updateDeploymentStatus( - '', // functionId - '' // deploymentId -); +const response = await functions.updateDeploymentStatus({ + functionId: '', + deploymentId: '' +}); diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index 55196c1..1e0b554 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -7,7 +7,7 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.updateFunctionDeployment( - '', // functionId - '' // deploymentId -); +const response = await functions.updateFunctionDeployment({ + functionId: '', + deploymentId: '' +}); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 3da706d..fb80ac9 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -7,10 +7,10 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.updateVariable( - '', // functionId - '', // variableId - '', // key - '', // value (optional) - false // secret (optional) -); +const response = await functions.updateVariable({ + functionId: '', + variableId: '', + key: '', + value: '', + secret: false +}); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 399af05..d37701a 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -7,23 +7,23 @@ const client = new Client() const functions = new Functions(client); -const response = await functions.update( - '', // functionId - '', // name - .Node145, // runtime (optional) - ["any"], // execute (optional) - [], // events (optional) - '', // schedule (optional) - 1, // timeout (optional) - false, // enabled (optional) - false, // logging (optional) - '', // entrypoint (optional) - '', // commands (optional) - [], // scopes (optional) - '', // installationId (optional) - '', // providerRepositoryId (optional) - '', // providerBranch (optional) - false, // providerSilentMode (optional) - '', // providerRootDirectory (optional) - '' // specification (optional) -); +const response = await functions.update({ + functionId: '', + name: '', + runtime: .Node145, + execute: ["any"], + events: [], + schedule: '', + timeout: 1, + enabled: false, + logging: false, + entrypoint: '', + commands: '', + scopes: [], + installationId: '', + providerRepositoryId: '', + providerBranch: '', + providerSilentMode: false, + providerRootDirectory: '', + specification: '' +}); diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 200120f..67716b2 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -7,6 +7,6 @@ const client = new Client() const graphql = new Graphql(client); -const response = await graphql.mutation( - {} // query -); +const response = await graphql.mutation({ + query: {} +}); diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index bb01162..e80f795 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -7,6 +7,6 @@ const client = new Client() const graphql = new Graphql(client); -const response = await graphql.query( - {} // query -); +const response = await graphql.query({ + query: {} +}); diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 828e53d..56afdd6 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getCertificate( - '' // domain (optional) -); +const response = await health.getCertificate({ + domain: '' +}); diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 5e40f76..a330bcf 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -7,7 +7,7 @@ const client = new Client() const health = new Health(client); -const response = await health.getFailedJobs( - .V1Database, // name - null // threshold (optional) -); +const response = await health.getFailedJobs({ + name: .V1Database, + threshold: null +}); diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index f6b9388..10ecfd8 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueBuilds( - null // threshold (optional) -); +const response = await health.getQueueBuilds({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index e783fa5..2268c1e 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueCertificates( - null // threshold (optional) -); +const response = await health.getQueueCertificates({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index e33c7a2..0ba7ca2 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -7,7 +7,7 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueDatabases( - '', // name (optional) - null // threshold (optional) -); +const response = await health.getQueueDatabases({ + name: '', + threshold: null +}); diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index ea7da5b..4afe3ec 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueDeletes( - null // threshold (optional) -); +const response = await health.getQueueDeletes({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index e075a65..5885132 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueFunctions( - null // threshold (optional) -); +const response = await health.getQueueFunctions({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index eb7ffb0..92627fe 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueLogs( - null // threshold (optional) -); +const response = await health.getQueueLogs({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index d9f61bc..1ac6e67 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueMails( - null // threshold (optional) -); +const response = await health.getQueueMails({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 8bc7639..7351be9 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueMessaging( - null // threshold (optional) -); +const response = await health.getQueueMessaging({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index e6f7bf5..a3758fa 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueMigrations( - null // threshold (optional) -); +const response = await health.getQueueMigrations({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index ecc7ebd..227f7f5 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueStatsResources( - null // threshold (optional) -); +const response = await health.getQueueStatsResources({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 46aa4db..c031f63 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueUsage( - null // threshold (optional) -); +const response = await health.getQueueUsage({ + threshold: null +}); diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 75a1c1f..a852a55 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -7,6 +7,6 @@ const client = new Client() const health = new Health(client); -const response = await health.getQueueWebhooks( - null // threshold (optional) -); +const response = await health.getQueueWebhooks({ + threshold: null +}); diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index e2c33fe..b854183 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -7,13 +7,13 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createApnsProvider( - '', // providerId - '', // name - '', // authKey (optional) - '', // authKeyId (optional) - '', // teamId (optional) - '', // bundleId (optional) - false, // sandbox (optional) - false // enabled (optional) -); +const response = await messaging.createApnsProvider({ + providerId: '', + name: '', + authKey: '', + authKeyId: '', + teamId: '', + bundleId: '', + sandbox: false, + enabled: false +}); diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 8db2879..011e1f6 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -7,17 +7,17 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createEmail( - '', // messageId - '', // subject - '', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - [], // attachments (optional) - false, // draft (optional) - false, // html (optional) - '' // scheduledAt (optional) -); +const response = await messaging.createEmail({ + messageId: '', + subject: '', + content: '', + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + attachments: [], + draft: false, + html: false, + scheduledAt: '' +}); diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 3f443d6..1e3596f 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -7,9 +7,9 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createFcmProvider( - '', // providerId - '', // name - {}, // serviceAccountJSON (optional) - false // enabled (optional) -); +const response = await messaging.createFcmProvider({ + providerId: '', + name: '', + serviceAccountJSON: {}, + enabled: false +}); diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 32f7c94..c17a323 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -7,15 +7,15 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createMailgunProvider( - '', // providerId - '', // name - '', // apiKey (optional) - '', // domain (optional) - false, // isEuRegion (optional) - '', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '', // replyToName (optional) - 'email@example.com', // replyToEmail (optional) - false // enabled (optional) -); +const response = await messaging.createMailgunProvider({ + providerId: '', + name: '', + apiKey: '', + domain: '', + isEuRegion: false, + fromName: '', + fromEmail: 'email@example.com', + replyToName: '', + replyToEmail: 'email@example.com', + enabled: false +}); diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 57e9418..c076faa 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createMsg91Provider( - '', // providerId - '', // name - '', // templateId (optional) - '', // senderId (optional) - '', // authKey (optional) - false // enabled (optional) -); +const response = await messaging.createMsg91Provider({ + providerId: '', + name: '', + templateId: '', + senderId: '', + authKey: '', + enabled: false +}); diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 7523c29..2c9004c 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -7,24 +7,24 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createPush( - '', // messageId - '', // title (optional) - '<BODY>', // body (optional) - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - {}, // data (optional) - '<ACTION>', // action (optional) - '[ID1:ID2]', // image (optional) - '<ICON>', // icon (optional) - '<SOUND>', // sound (optional) - '<COLOR>', // color (optional) - '<TAG>', // tag (optional) - null, // badge (optional) - false, // draft (optional) - '', // scheduledAt (optional) - false, // contentAvailable (optional) - false, // critical (optional) - MessagePriority.Normal // priority (optional) -); +const response = await messaging.createPush({ + messageId: '<MESSAGE_ID>', + title: '<TITLE>', + body: '<BODY>', + topics: [], + users: [], + targets: [], + data: {}, + action: '<ACTION>', + image: '[ID1:ID2]', + icon: '<ICON>', + sound: '<SOUND>', + color: '<COLOR>', + tag: '<TAG>', + badge: null, + draft: false, + scheduledAt: '', + contentAvailable: false, + critical: false, + priority: MessagePriority.Normal +}); diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 15fe7b8..62f5ec1 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -7,13 +7,13 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createSendgridProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name - '<API_KEY>', // apiKey (optional) - '<FROM_NAME>', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '<REPLY_TO_NAME>', // replyToName (optional) - 'email@example.com', // replyToEmail (optional) - false // enabled (optional) -); +const response = await messaging.createSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: 'email@example.com', + enabled: false +}); diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 264203a..5b69112 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -7,12 +7,12 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - false, // draft (optional) - '' // scheduledAt (optional) -); +const response = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: '' +}); diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 2d6d33c..426cc98 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -7,19 +7,19 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createSmtpProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name - '<HOST>', // host - 1, // port (optional) - '<USERNAME>', // username (optional) - '<PASSWORD>', // password (optional) - SmtpEncryption.None, // encryption (optional) - false, // autoTLS (optional) - '<MAILER>', // mailer (optional) - '<FROM_NAME>', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '<REPLY_TO_NAME>', // replyToName (optional) - 'email@example.com', // replyToEmail (optional) - false // enabled (optional) -); +const response = await messaging.createSmtpProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, + username: '<USERNAME>', + password: '<PASSWORD>', + encryption: SmtpEncryption.None, + autoTLS: false, + mailer: '<MAILER>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: 'email@example.com', + enabled: false +}); diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 8be79f3..671c6ea 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -7,8 +7,8 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createSubscriber( - '<TOPIC_ID>', // topicId - '<SUBSCRIBER_ID>', // subscriberId - '<TARGET_ID>' // targetId -); +const response = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 2bb95c4..04c4b63 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createTelesignProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name - '+12065550100', // from (optional) - '<CUSTOMER_ID>', // customerId (optional) - '<API_KEY>', // apiKey (optional) - false // enabled (optional) -); +const response = await messaging.createTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', + customerId: '<CUSTOMER_ID>', + apiKey: '<API_KEY>', + enabled: false +}); diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 4657493..7fcdcfe 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createTextmagicProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name - '+12065550100', // from (optional) - '<USERNAME>', // username (optional) - '<API_KEY>', // apiKey (optional) - false // enabled (optional) -); +const response = await messaging.createTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', + username: '<USERNAME>', + apiKey: '<API_KEY>', + enabled: false +}); diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index c2ca3a4..08c1c32 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -7,8 +7,8 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createTopic( - '<TOPIC_ID>', // topicId - '<NAME>', // name - ["any"] // subscribe (optional) -); +const response = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] +}); diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index aa7bbf6..7ea61ad 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createTwilioProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name - '+12065550100', // from (optional) - '<ACCOUNT_SID>', // accountSid (optional) - '<AUTH_TOKEN>', // authToken (optional) - false // enabled (optional) -); +const response = await messaging.createTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', + accountSid: '<ACCOUNT_SID>', + authToken: '<AUTH_TOKEN>', + enabled: false +}); diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 5fe734f..6b24187 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createVonageProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name - '+12065550100', // from (optional) - '<API_KEY>', // apiKey (optional) - '<API_SECRET>', // apiSecret (optional) - false // enabled (optional) -); +const response = await messaging.createVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', + apiKey: '<API_KEY>', + apiSecret: '<API_SECRET>', + enabled: false +}); diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 7bc99ef..2e0855a 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -7,6 +7,6 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.deleteProvider( - '<PROVIDER_ID>' // providerId -); +const response = await messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}); diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 1474568..c48c9de 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.deleteSubscriber( - '<TOPIC_ID>', // topicId - '<SUBSCRIBER_ID>' // subscriberId -); +const response = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index aa1359c..5dd1317 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -7,6 +7,6 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.deleteTopic( - '<TOPIC_ID>' // topicId -); +const response = await messaging.deleteTopic({ + topicId: '<TOPIC_ID>' +}); diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 0442da1..8b4357f 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -7,6 +7,6 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.delete( - '<MESSAGE_ID>' // messageId -); +const response = await messaging.delete({ + messageId: '<MESSAGE_ID>' +}); diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 9565a61..f0e4c5b 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -7,6 +7,6 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.getMessage( - '<MESSAGE_ID>' // messageId -); +const response = await messaging.getMessage({ + messageId: '<MESSAGE_ID>' +}); diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 8e5d426..18ce92a 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -7,6 +7,6 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.getProvider( - '<PROVIDER_ID>' // providerId -); +const response = await messaging.getProvider({ + providerId: '<PROVIDER_ID>' +}); diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index e9377a5..4916e27 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.getSubscriber( - '<TOPIC_ID>', // topicId - '<SUBSCRIBER_ID>' // subscriberId -); +const response = await messaging.getSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 35f1853..baf1f39 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -7,6 +7,6 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.getTopic( - '<TOPIC_ID>' // topicId -); +const response = await messaging.getTopic({ + topicId: '<TOPIC_ID>' +}); diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index f39a900..5772ddd 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listMessageLogs( - '<MESSAGE_ID>', // messageId - [] // queries (optional) -); +const response = await messaging.listMessageLogs({ + messageId: '<MESSAGE_ID>', + queries: [] +}); diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 50b1a10..a487cb7 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listMessages( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await messaging.listMessages({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index c4b20a8..87fbe57 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listProviderLogs( - '<PROVIDER_ID>', // providerId - [] // queries (optional) -); +const response = await messaging.listProviderLogs({ + providerId: '<PROVIDER_ID>', + queries: [] +}); diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 7c877c2..7fc1e06 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listProviders( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await messaging.listProviders({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 0d14f85..d0f3d1c 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listSubscriberLogs( - '<SUBSCRIBER_ID>', // subscriberId - [] // queries (optional) -); +const response = await messaging.listSubscriberLogs({ + subscriberId: '<SUBSCRIBER_ID>', + queries: [] +}); diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 384bb8f..bd0c8af 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -7,8 +7,8 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listSubscribers( - '<TOPIC_ID>', // topicId - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await messaging.listSubscribers({ + topicId: '<TOPIC_ID>', + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 5ce2082..8a18af7 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listTargets( - '<MESSAGE_ID>', // messageId - [] // queries (optional) -); +const response = await messaging.listTargets({ + messageId: '<MESSAGE_ID>', + queries: [] +}); diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index d2c771d..eeebc95 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listTopicLogs( - '<TOPIC_ID>', // topicId - [] // queries (optional) -); +const response = await messaging.listTopicLogs({ + topicId: '<TOPIC_ID>', + queries: [] +}); diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 1d0ec43..cdd1afe 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -7,7 +7,7 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.listTopics( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await messaging.listTopics({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 71bd038..3860fea 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -7,13 +7,13 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateApnsProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<AUTH_KEY>', // authKey (optional) - '<AUTH_KEY_ID>', // authKeyId (optional) - '<TEAM_ID>', // teamId (optional) - '<BUNDLE_ID>', // bundleId (optional) - false // sandbox (optional) -); +const response = await messaging.updateApnsProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + authKey: '<AUTH_KEY>', + authKeyId: '<AUTH_KEY_ID>', + teamId: '<TEAM_ID>', + bundleId: '<BUNDLE_ID>', + sandbox: false +}); diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index c8b0558..a742160 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -7,17 +7,17 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateEmail( - '<MESSAGE_ID>', // messageId - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - '<SUBJECT>', // subject (optional) - '<CONTENT>', // content (optional) - false, // draft (optional) - false, // html (optional) - [], // cc (optional) - [], // bcc (optional) - '', // scheduledAt (optional) - [] // attachments (optional) -); +const response = await messaging.updateEmail({ + messageId: '<MESSAGE_ID>', + topics: [], + users: [], + targets: [], + subject: '<SUBJECT>', + content: '<CONTENT>', + draft: false, + html: false, + cc: [], + bcc: [], + scheduledAt: '', + attachments: [] +}); diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index eb71ddd..17fb741 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -7,9 +7,9 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateFcmProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - {} // serviceAccountJSON (optional) -); +const response = await messaging.updateFcmProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + serviceAccountJSON: {} +}); diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index f80d6a4..aad80a0 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -7,15 +7,15 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateMailgunProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - '<API_KEY>', // apiKey (optional) - '<DOMAIN>', // domain (optional) - false, // isEuRegion (optional) - false, // enabled (optional) - '<FROM_NAME>', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '<REPLY_TO_NAME>', // replyToName (optional) - '<REPLY_TO_EMAIL>' // replyToEmail (optional) -); +const response = await messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', + domain: '<DOMAIN>', + isEuRegion: false, + enabled: false, + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>' +}); diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 36943f2..8f57eec 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateMsg91Provider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<TEMPLATE_ID>', // templateId (optional) - '<SENDER_ID>', // senderId (optional) - '<AUTH_KEY>' // authKey (optional) -); +const response = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + templateId: '<TEMPLATE_ID>', + senderId: '<SENDER_ID>', + authKey: '<AUTH_KEY>' +}); diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index c7f0686..73d2a3c 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -7,24 +7,24 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updatePush( - '<MESSAGE_ID>', // messageId - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - '<TITLE>', // title (optional) - '<BODY>', // body (optional) - {}, // data (optional) - '<ACTION>', // action (optional) - '[ID1:ID2]', // image (optional) - '<ICON>', // icon (optional) - '<SOUND>', // sound (optional) - '<COLOR>', // color (optional) - '<TAG>', // tag (optional) - null, // badge (optional) - false, // draft (optional) - '', // scheduledAt (optional) - false, // contentAvailable (optional) - false, // critical (optional) - MessagePriority.Normal // priority (optional) -); +const response = await messaging.updatePush({ + messageId: '<MESSAGE_ID>', + topics: [], + users: [], + targets: [], + title: '<TITLE>', + body: '<BODY>', + data: {}, + action: '<ACTION>', + image: '[ID1:ID2]', + icon: '<ICON>', + sound: '<SOUND>', + color: '<COLOR>', + tag: '<TAG>', + badge: null, + draft: false, + scheduledAt: '', + contentAvailable: false, + critical: false, + priority: MessagePriority.Normal +}); diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 0ec96db..708886f 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -7,13 +7,13 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateSendgridProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<API_KEY>', // apiKey (optional) - '<FROM_NAME>', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '<REPLY_TO_NAME>', // replyToName (optional) - '<REPLY_TO_EMAIL>' // replyToEmail (optional) -); +const response = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + apiKey: '<API_KEY>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>' +}); diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 9c1dc4a..53ac19a 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -7,12 +7,12 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateSms( - '<MESSAGE_ID>', // messageId - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - '<CONTENT>', // content (optional) - false, // draft (optional) - '' // scheduledAt (optional) -); +const response = await messaging.updateSms({ + messageId: '<MESSAGE_ID>', + topics: [], + users: [], + targets: [], + content: '<CONTENT>', + draft: false, + scheduledAt: '' +}); diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 9d59bb3..35addb7 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -7,19 +7,19 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateSmtpProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - '<HOST>', // host (optional) - 1, // port (optional) - '<USERNAME>', // username (optional) - '<PASSWORD>', // password (optional) - SmtpEncryption.None, // encryption (optional) - false, // autoTLS (optional) - '<MAILER>', // mailer (optional) - '<FROM_NAME>', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '<REPLY_TO_NAME>', // replyToName (optional) - '<REPLY_TO_EMAIL>', // replyToEmail (optional) - false // enabled (optional) -); +const response = await messaging.updateSmtpProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, + username: '<USERNAME>', + password: '<PASSWORD>', + encryption: SmtpEncryption.None, + autoTLS: false, + mailer: '<MAILER>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>', + enabled: false +}); diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 052d394..f41eb54 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateTelesignProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<CUSTOMER_ID>', // customerId (optional) - '<API_KEY>', // apiKey (optional) - '<FROM>' // from (optional) -); +const response = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + customerId: '<CUSTOMER_ID>', + apiKey: '<API_KEY>', + from: '<FROM>' +}); diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 2163792..6c05f5c 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateTextmagicProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<USERNAME>', // username (optional) - '<API_KEY>', // apiKey (optional) - '<FROM>' // from (optional) -); +const response = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + username: '<USERNAME>', + apiKey: '<API_KEY>', + from: '<FROM>' +}); diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 5f7f779..a8e5066 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -7,8 +7,8 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateTopic( - '<TOPIC_ID>', // topicId - '<NAME>', // name (optional) - ["any"] // subscribe (optional) -); +const response = await messaging.updateTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] +}); diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 5abdd65..1c4618d 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateTwilioProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<ACCOUNT_SID>', // accountSid (optional) - '<AUTH_TOKEN>', // authToken (optional) - '<FROM>' // from (optional) -); +const response = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + accountSid: '<ACCOUNT_SID>', + authToken: '<AUTH_TOKEN>', + from: '<FROM>' +}); diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index c8fa90d..c3a2cad 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -7,11 +7,11 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateVonageProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<API_KEY>', // apiKey (optional) - '<API_SECRET>', // apiSecret (optional) - '<FROM>' // from (optional) -); +const response = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + apiKey: '<API_KEY>', + apiSecret: '<API_SECRET>', + from: '<FROM>' +}); diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index f674553..6e94256 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -7,11 +7,11 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.createDeployment( - '<SITE_ID>', // siteId - InputFile.fromPath('/path/to/file.png', 'file.png'), // code - false, // activate - '<INSTALL_COMMAND>', // installCommand (optional) - '<BUILD_COMMAND>', // buildCommand (optional) - '<OUTPUT_DIRECTORY>' // outputDirectory (optional) -); +const response = await sites.createDeployment({ + siteId: '<SITE_ID>', + code: InputFile.fromPath('/path/to/file.png', 'file.png'), + activate: false, + installCommand: '<INSTALL_COMMAND>', + buildCommand: '<BUILD_COMMAND>', + outputDirectory: '<OUTPUT_DIRECTORY>' +}); diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index 317e80b..5152571 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.createDuplicateDeployment( - '<SITE_ID>', // siteId - '<DEPLOYMENT_ID>' // deploymentId -); +const response = await sites.createDuplicateDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 4ef245b..8890b19 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -7,11 +7,11 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.createTemplateDeployment( - '<SITE_ID>', // siteId - '<REPOSITORY>', // repository - '<OWNER>', // owner - '<ROOT_DIRECTORY>', // rootDirectory - '<VERSION>', // version - false // activate (optional) -); +const response = await sites.createTemplateDeployment({ + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false +}); diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 7b07a08..e2bf02d 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -7,9 +7,9 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.createVariable( - '<SITE_ID>', // siteId - '<KEY>', // key - '<VALUE>', // value - false // secret (optional) -); +const response = await sites.createVariable({ + siteId: '<SITE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false +}); diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 5c49808..750a3c0 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -7,9 +7,9 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.createVcsDeployment( - '<SITE_ID>', // siteId - VCSDeploymentType.Branch, // type - '<REFERENCE>', // reference - false // activate (optional) -); +const response = await sites.createVcsDeployment({ + siteId: '<SITE_ID>', + type: VCSDeploymentType.Branch, + reference: '<REFERENCE>', + activate: false +}); diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 420b362..5b1d152 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -7,23 +7,23 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.create( - '<SITE_ID>', // siteId - '<NAME>', // name - .Analog, // framework - .Node145, // buildRuntime - false, // enabled (optional) - false, // logging (optional) - 1, // timeout (optional) - '<INSTALL_COMMAND>', // installCommand (optional) - '<BUILD_COMMAND>', // buildCommand (optional) - '<OUTPUT_DIRECTORY>', // outputDirectory (optional) - .Static, // adapter (optional) - '<INSTALLATION_ID>', // installationId (optional) - '<FALLBACK_FILE>', // fallbackFile (optional) - '<PROVIDER_REPOSITORY_ID>', // providerRepositoryId (optional) - '<PROVIDER_BRANCH>', // providerBranch (optional) - false, // providerSilentMode (optional) - '<PROVIDER_ROOT_DIRECTORY>', // providerRootDirectory (optional) - '' // specification (optional) -); +const response = await sites.create({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .Analog, + buildRuntime: .Node145, + enabled: false, + logging: false, + timeout: 1, + installCommand: '<INSTALL_COMMAND>', + buildCommand: '<BUILD_COMMAND>', + outputDirectory: '<OUTPUT_DIRECTORY>', + adapter: .Static, + installationId: '<INSTALLATION_ID>', + fallbackFile: '<FALLBACK_FILE>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', + providerBranch: '<PROVIDER_BRANCH>', + providerSilentMode: false, + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', + specification: '' +}); diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index cd97673..4164f47 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.deleteDeployment( - '<SITE_ID>', // siteId - '<DEPLOYMENT_ID>' // deploymentId -); +const response = await sites.deleteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index 0b70eb3..f70a8fb 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.deleteLog( - '<SITE_ID>', // siteId - '<LOG_ID>' // logId -); +const response = await sites.deleteLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index 0bbc2e3..226b2f1 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.deleteVariable( - '<SITE_ID>', // siteId - '<VARIABLE_ID>' // variableId -); +const response = await sites.deleteVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index af5dbed..2af4f53 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -7,6 +7,6 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.delete( - '<SITE_ID>' // siteId -); +const response = await sites.delete({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 4c3ceca..ae4d3b3 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -7,8 +7,8 @@ const client = new Client() const sites = new Sites(client); -const result = sites.getDeploymentDownload( - '<SITE_ID>', // siteId - '<DEPLOYMENT_ID>', // deploymentId - DeploymentDownloadType.Source // type (optional) -); +const result = sites.getDeploymentDownload({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.Source +}); diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index 4e614b0..ed23bd1 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.getDeployment( - '<SITE_ID>', // siteId - '<DEPLOYMENT_ID>' // deploymentId -); +const response = await sites.getDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index 9495030..30cd601 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.getLog( - '<SITE_ID>', // siteId - '<LOG_ID>' // logId -); +const response = await sites.getLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 12ab553..e070d2e 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.getVariable( - '<SITE_ID>', // siteId - '<VARIABLE_ID>' // variableId -); +const response = await sites.getVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index 769f426..80cc792 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -7,6 +7,6 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.get( - '<SITE_ID>' // siteId -); +const response = await sites.get({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 09cc521..0f86956 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -7,8 +7,8 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.listDeployments( - '<SITE_ID>', // siteId - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await sites.listDeployments({ + siteId: '<SITE_ID>', + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 3249903..2519ed0 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.listLogs( - '<SITE_ID>', // siteId - [] // queries (optional) -); +const response = await sites.listLogs({ + siteId: '<SITE_ID>', + queries: [] +}); diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 0aac319..ed71762 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -7,6 +7,6 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.listVariables( - '<SITE_ID>' // siteId -); +const response = await sites.listVariables({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index f21433d..828e9c7 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.list( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await sites.list({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 83fe6f8..e634de9 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.updateDeploymentStatus( - '<SITE_ID>', // siteId - '<DEPLOYMENT_ID>' // deploymentId -); +const response = await sites.updateDeploymentStatus({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index 1d9d697..c6ee03b 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -7,7 +7,7 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.updateSiteDeployment( - '<SITE_ID>', // siteId - '<DEPLOYMENT_ID>' // deploymentId -); +const response = await sites.updateSiteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 6776af7..214dfff 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -7,10 +7,10 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.updateVariable( - '<SITE_ID>', // siteId - '<VARIABLE_ID>', // variableId - '<KEY>', // key - '<VALUE>', // value (optional) - false // secret (optional) -); +const response = await sites.updateVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false +}); diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index ba7d195..edb6e76 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -7,23 +7,23 @@ const client = new Client() const sites = new Sites(client); -const response = await sites.update( - '<SITE_ID>', // siteId - '<NAME>', // name - .Analog, // framework - false, // enabled (optional) - false, // logging (optional) - 1, // timeout (optional) - '<INSTALL_COMMAND>', // installCommand (optional) - '<BUILD_COMMAND>', // buildCommand (optional) - '<OUTPUT_DIRECTORY>', // outputDirectory (optional) - .Node145, // buildRuntime (optional) - .Static, // adapter (optional) - '<FALLBACK_FILE>', // fallbackFile (optional) - '<INSTALLATION_ID>', // installationId (optional) - '<PROVIDER_REPOSITORY_ID>', // providerRepositoryId (optional) - '<PROVIDER_BRANCH>', // providerBranch (optional) - false, // providerSilentMode (optional) - '<PROVIDER_ROOT_DIRECTORY>', // providerRootDirectory (optional) - '' // specification (optional) -); +const response = await sites.update({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .Analog, + enabled: false, + logging: false, + timeout: 1, + installCommand: '<INSTALL_COMMAND>', + buildCommand: '<BUILD_COMMAND>', + outputDirectory: '<OUTPUT_DIRECTORY>', + buildRuntime: .Node145, + adapter: .Static, + fallbackFile: '<FALLBACK_FILE>', + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', + providerBranch: '<PROVIDER_BRANCH>', + providerSilentMode: false, + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', + specification: '' +}); diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index e7d3e90..e2daa65 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -7,15 +7,15 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.createBucket( - '<BUCKET_ID>', // bucketId - '<NAME>', // name - ["read("any")"], // permissions (optional) - false, // fileSecurity (optional) - false, // enabled (optional) - 1, // maximumFileSize (optional) - [], // allowedFileExtensions (optional) - .None, // compression (optional) - false, // encryption (optional) - false // antivirus (optional) -); +const response = await storage.createBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], + fileSecurity: false, + enabled: false, + maximumFileSize: 1, + allowedFileExtensions: [], + compression: .None, + encryption: false, + antivirus: false +}); diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index d8912c6..c8565c7 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -7,9 +7,9 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.createFile( - '<BUCKET_ID>', // bucketId - '<FILE_ID>', // fileId - InputFile.fromPath('/path/to/file.png', 'file.png'), // file - ["read("any")"] // permissions (optional) -); +const response = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile.fromPath('/path/to/file.png', 'file.png'), + permissions: ["read("any")"] +}); diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index f0d7146..d5f2e36 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -7,6 +7,6 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.deleteBucket( - '<BUCKET_ID>' // bucketId -); +const response = await storage.deleteBucket({ + bucketId: '<BUCKET_ID>' +}); diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 2a1f95e..3f9f2ac 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.deleteFile( - '<BUCKET_ID>', // bucketId - '<FILE_ID>' // fileId -); +const response = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index a695021..ffb1913 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -7,6 +7,6 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.getBucket( - '<BUCKET_ID>' // bucketId -); +const response = await storage.getBucket({ + bucketId: '<BUCKET_ID>' +}); diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index df11f40..7e0a55b 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -7,8 +7,8 @@ const client = new Client() const storage = new Storage(client); -const result = storage.getFileDownload( - '<BUCKET_ID>', // bucketId - '<FILE_ID>', // fileId - '<TOKEN>' // token (optional) -); +const result = storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' +}); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 6457c78..1efe6d8 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -7,19 +7,19 @@ const client = new Client() const storage = new Storage(client); -const result = storage.getFilePreview( - '<BUCKET_ID>', // bucketId - '<FILE_ID>', // fileId - 0, // width (optional) - 0, // height (optional) - ImageGravity.Center, // gravity (optional) - -1, // quality (optional) - 0, // borderWidth (optional) - '', // borderColor (optional) - 0, // borderRadius (optional) - 0, // opacity (optional) - -360, // rotation (optional) - '', // background (optional) - ImageFormat.Jpg, // output (optional) - '<TOKEN>' // token (optional) -); +const result = storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, + height: 0, + gravity: ImageGravity.Center, + quality: -1, + borderWidth: 0, + borderColor: '', + borderRadius: 0, + opacity: 0, + rotation: -360, + background: '', + output: ImageFormat.Jpg, + token: '<TOKEN>' +}); diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 5a1dbac..f629b40 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -7,8 +7,8 @@ const client = new Client() const storage = new Storage(client); -const result = storage.getFileView( - '<BUCKET_ID>', // bucketId - '<FILE_ID>', // fileId - '<TOKEN>' // token (optional) -); +const result = storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' +}); diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 5479dc5..604696a 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.getFile( - '<BUCKET_ID>', // bucketId - '<FILE_ID>' // fileId -); +const response = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 9286bd4..5319459 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -7,7 +7,7 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.listBuckets( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await storage.listBuckets({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 316875c..f34a0e1 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -7,8 +7,8 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.listFiles( - '<BUCKET_ID>', // bucketId - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 1e70f16..fca45d8 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -7,15 +7,15 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.updateBucket( - '<BUCKET_ID>', // bucketId - '<NAME>', // name - ["read("any")"], // permissions (optional) - false, // fileSecurity (optional) - false, // enabled (optional) - 1, // maximumFileSize (optional) - [], // allowedFileExtensions (optional) - .None, // compression (optional) - false, // encryption (optional) - false // antivirus (optional) -); +const response = await storage.updateBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], + fileSecurity: false, + enabled: false, + maximumFileSize: 1, + allowedFileExtensions: [], + compression: .None, + encryption: false, + antivirus: false +}); diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 683b0b7..65f4dd3 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -7,9 +7,9 @@ const client = new Client() const storage = new Storage(client); -const response = await storage.updateFile( - '<BUCKET_ID>', // bucketId - '<FILE_ID>', // fileId - '<NAME>', // name (optional) - ["read("any")"] // permissions (optional) -); +const response = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', + permissions: ["read("any")"] +}); diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 9f48de3..410cee1 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createBooleanColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - false, // default (optional) - false // array (optional) -); +const response = await tablesDb.createBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, + array: false +}); diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index bc60829..19267e0 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createDatetimeColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - '', // default (optional) - false // array (optional) -); +const response = await tablesDb.createDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + array: false +}); diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index c8c8e29..22b2a9d 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createEmailColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - 'email@example.com', // default (optional) - false // array (optional) -); +const response = await tablesDb.createEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', + array: false +}); diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index a47a1ba..b2dcc88 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -7,12 +7,12 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createEnumColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - [], // elements - false, // required - '<DEFAULT>', // default (optional) - false // array (optional) -); +const response = await tablesDb.createEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + array: false +}); diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index a4bdbcb..4cf2b55 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -7,13 +7,13 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createFloatColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - null, // min (optional) - null, // max (optional) - null, // default (optional) - false // array (optional) -); +const response = await tablesDb.createFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, + max: null, + default: null, + array: false +}); diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index b138f28..efb1f12 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -7,12 +7,12 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createIndex( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - IndexType.Key, // type - [], // columns - [], // orders (optional) - [] // lengths (optional) -); +const response = await tablesDb.createIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + type: IndexType.Key, + columns: [], + orders: [], + lengths: [] +}); diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index 9e2fb18..ccbda0b 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -7,13 +7,13 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createIntegerColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - null, // min (optional) - null, // max (optional) - null, // default (optional) - false // array (optional) -); +const response = await tablesDb.createIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, + max: null, + default: null, + array: false +}); diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index cf9d8d3..c5c2fa6 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createIpColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - '', // default (optional) - false // array (optional) -); +const response = await tablesDb.createIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + array: false +}); diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 3b5dfa3..a50ffcd 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -7,13 +7,13 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createRelationshipColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<RELATED_TABLE_ID>', // relatedTableId - RelationshipType.OneToOne, // type - false, // twoWay (optional) - '', // key (optional) - '', // twoWayKey (optional) - RelationMutate.Cascade // onDelete (optional) -); +const response = await tablesDb.createRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: RelationshipType.OneToOne, + twoWay: false, + key: '', + twoWayKey: '', + onDelete: RelationMutate.Cascade +}); diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 6a8d99a..6f06463 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -7,10 +7,10 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createRow( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<ROW_ID>', // rowId - {}, // data - ["read("any")"] // permissions (optional) -); +const response = await tablesDb.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, + permissions: ["read("any")"] +}); diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 4a98f7a..87f7d2e 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createRows( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - [] // rows -); +const response = await tablesDb.createRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 0a23dcd..3b0bf5b 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -7,13 +7,13 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createStringColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - 1, // size - false, // required - '<DEFAULT>', // default (optional) - false, // array (optional) - false // encrypt (optional) -); +const response = await tablesDb.createStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', + array: false, + encrypt: false +}); diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 2460863..596f4e3 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createTable( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<NAME>', // name - ["read("any")"], // permissions (optional) - false, // rowSecurity (optional) - false // enabled (optional) -); +const response = await tablesDb.createTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], + rowSecurity: false, + enabled: false +}); diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index 46e0db4..014f54b 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.createUrlColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - 'https://example.com', // default (optional) - false // array (optional) -); +const response = await tablesDb.createUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', + array: false +}); diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 694058a..618e4c6 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.create( - '<DATABASE_ID>', // databaseId - '<NAME>', // name - false // enabled (optional) -); +const response = await tablesDb.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false +}); diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 9a0ad7a..67fd811 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -3,15 +3,15 @@ import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 + .setSession(''); // The user session to authenticate with const tablesDb = new TablesDb(client); -const response = await tablesDb.decrementRowColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<ROW_ID>', // rowId - '', // column - null, // value (optional) - null // min (optional) -); +const response = await tablesDb.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, + min: null +}); diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index b2db1df..2ba1140 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.deleteColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '' // key -); +const response = await tablesDb.deleteColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index 31a0d98..e1b77ed 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.deleteIndex( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '' // key -); +const response = await tablesDb.deleteIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index d082865..f18b6ac 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.deleteRow( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<ROW_ID>' // rowId -); +const response = await tablesDb.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>' +}); diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index d27de4c..659150f 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.deleteRows( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - [] // queries (optional) -); +const response = await tablesDb.deleteRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] +}); diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 44d5860..1be63ed 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -7,7 +7,7 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.deleteTable( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>' // tableId -); +const response = await tablesDb.deleteTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 726c612..12c92bf 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -7,6 +7,6 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.delete( - '<DATABASE_ID>' // databaseId -); +const response = await tablesDb.delete({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index cf937b0..5599535 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.getColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '' // key -); +const response = await tablesDb.getColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index f743691..708c22a 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.getIndex( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '' // key -); +const response = await tablesDb.getIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index b12ff45..0e9f079 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -7,9 +7,9 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.getRow( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<ROW_ID>', // rowId - [] // queries (optional) -); +const response = await tablesDb.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] +}); diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 71b4c7f..91b4957 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -7,7 +7,7 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.getTable( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>' // tableId -); +const response = await tablesDb.getTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index ea653a3..b5fc2f7 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -7,6 +7,6 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.get( - '<DATABASE_ID>' // databaseId -); +const response = await tablesDb.get({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 5c1f3fe..03b59d5 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -3,15 +3,15 @@ import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 + .setSession(''); // The user session to authenticate with const tablesDb = new TablesDb(client); -const response = await tablesDb.incrementRowColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<ROW_ID>', // rowId - '', // column - null, // value (optional) - null // max (optional) -); +const response = await tablesDb.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, + max: null +}); diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 9b52471..7c061e9 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.listColumns( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - [] // queries (optional) -); +const response = await tablesDb.listColumns({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] +}); diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index ffb91e0..d2b0010 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.listIndexes( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - [] // queries (optional) -); +const response = await tablesDb.listIndexes({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] +}); diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index a550efd..764bfa7 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.listRows( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - [] // queries (optional) -); +const response = await tablesDb.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] +}); diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 2ef6173..3b74c36 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.listTables( - '<DATABASE_ID>', // databaseId - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await tablesDb.listTables({ + databaseId: '<DATABASE_ID>', + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 77b6abe..5af10e4 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -7,7 +7,7 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.list( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await tablesDb.list({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 2e9447e..af6a962 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateBooleanColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - false, // default - '' // newKey (optional) -); +const response = await tablesDb.updateBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 2390874..b704445 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateDatetimeColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - '', // default - '' // newKey (optional) -); +const response = await tablesDb.updateDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index f48e1a3..28f243c 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateEmailColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - 'email@example.com', // default - '' // newKey (optional) -); +const response = await tablesDb.updateEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index bd0f34f..6f44394 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -7,12 +7,12 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateEnumColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - [], // elements - false, // required - '<DEFAULT>', // default - '' // newKey (optional) -); +const response = await tablesDb.updateEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 567eba5..8b1c50e 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -7,13 +7,13 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateFloatColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - null, // default - null, // min (optional) - null, // max (optional) - '' // newKey (optional) -); +const response = await tablesDb.updateFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, + max: null, + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index dcd84d5..e2b5af0 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -7,13 +7,13 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateIntegerColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - null, // default - null, // min (optional) - null, // max (optional) - '' // newKey (optional) -); +const response = await tablesDb.updateIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, + max: null, + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 688a418..54bf616 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateIpColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - '', // default - '' // newKey (optional) -); +const response = await tablesDb.updateIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 1388cf8..de8d3db 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -7,10 +7,10 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateRelationshipColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - RelationMutate.Cascade, // onDelete (optional) - '' // newKey (optional) -); +const response = await tablesDb.updateRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + onDelete: RelationMutate.Cascade, + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 33f9d7e..35b1b27 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -7,10 +7,10 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateRow( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<ROW_ID>', // rowId - {}, // data (optional) - ["read("any")"] // permissions (optional) -); +const response = await tablesDb.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, + permissions: ["read("any")"] +}); diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 5dba0b9..3e5cba8 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -7,9 +7,9 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateRows( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - {}, // data (optional) - [] // queries (optional) -); +const response = await tablesDb.updateRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: {}, + queries: [] +}); diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index 6f6e183..b763d37 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -7,12 +7,12 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateStringColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - '<DEFAULT>', // default - 1, // size (optional) - '' // newKey (optional) -); +const response = await tablesDb.updateStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, + newKey: '' +}); diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 8a6ce97..54d60ed 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateTable( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<NAME>', // name - ["read("any")"], // permissions (optional) - false, // rowSecurity (optional) - false // enabled (optional) -); +const response = await tablesDb.updateTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], + rowSecurity: false, + enabled: false +}); diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 205d10a..c09ee6e 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -7,11 +7,11 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.updateUrlColumn( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '', // key - false, // required - 'https://example.com', // default - '' // newKey (optional) -); +const response = await tablesDb.updateUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' +}); diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 486e684..8504e63 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.update( - '<DATABASE_ID>', // databaseId - '<NAME>', // name - false // enabled (optional) -); +const response = await tablesDb.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false +}); diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 24dddd1..dda7dad 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -7,10 +7,10 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.upsertRow( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - '<ROW_ID>', // rowId - {}, // data (optional) - ["read("any")"] // permissions (optional) -); +const response = await tablesDb.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, + permissions: ["read("any")"] +}); diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index 20e025b..1732351 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -7,8 +7,8 @@ const client = new Client() const tablesDb = new TablesDb(client); -const response = await tablesDb.upsertRows( - '<DATABASE_ID>', // databaseId - '<TABLE_ID>', // tableId - [] // rows -); +const response = await tablesDb.upsertRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index d8e855f..fc3b8b4 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -7,12 +7,12 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.createMembership( - '<TEAM_ID>', // teamId - [], // roles - 'email@example.com', // email (optional) - '<USER_ID>', // userId (optional) - '+12065550100', // phone (optional) - 'https://example.com', // url (optional) - '<NAME>' // name (optional) -); +const response = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', + userId: '<USER_ID>', + phone: '+12065550100', + url: 'https://example.com', + name: '<NAME>' +}); diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 495f26e..7247da9 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -7,8 +7,8 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.create( - '<TEAM_ID>', // teamId - '<NAME>', // name - [] // roles (optional) -); +const response = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] +}); diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index a5b0387..51fcd0c 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -7,7 +7,7 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.deleteMembership( - '<TEAM_ID>', // teamId - '<MEMBERSHIP_ID>' // membershipId -); +const response = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 556fbb5..e300ad5 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -7,6 +7,6 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.delete( - '<TEAM_ID>' // teamId -); +const response = await teams.delete({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 75283bf..73b6a24 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -7,7 +7,7 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.getMembership( - '<TEAM_ID>', // teamId - '<MEMBERSHIP_ID>' // membershipId -); +const response = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 442d8b1..d2cdd8a 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -7,6 +7,6 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.getPrefs( - '<TEAM_ID>' // teamId -); +const response = await teams.getPrefs({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 2e5803c..41c81bc 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -7,6 +7,6 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.get( - '<TEAM_ID>' // teamId -); +const response = await teams.get({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 0b7e663..1d67b15 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -7,8 +7,8 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.listMemberships( - '<TEAM_ID>', // teamId - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 6c08b5c..0fd5079 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -7,7 +7,7 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.list( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await teams.list({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 48fc9cd..22ac429 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -7,9 +7,9 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.updateMembershipStatus( - '<TEAM_ID>', // teamId - '<MEMBERSHIP_ID>', // membershipId - '<USER_ID>', // userId - '<SECRET>' // secret -); +const response = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index be8651d..3524cc5 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -7,8 +7,8 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.updateMembership( - '<TEAM_ID>', // teamId - '<MEMBERSHIP_ID>', // membershipId - [] // roles -); +const response = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +}); diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 6e2144b..b7d7e0f 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -7,7 +7,7 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.updateName( - '<TEAM_ID>', // teamId - '<NAME>' // name -); +const response = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>' +}); diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index dea8a36..5c7eaec 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -7,7 +7,7 @@ const client = new Client() const teams = new Teams(client); -const response = await teams.updatePrefs( - '<TEAM_ID>', // teamId - {} // prefs -); +const response = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {} +}); diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 7c24738..52fd3c7 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -7,8 +7,8 @@ const client = new Client() const tokens = new Tokens(client); -const response = await tokens.createFileToken( - '<BUCKET_ID>', // bucketId - '<FILE_ID>', // fileId - '' // expire (optional) -); +const response = await tokens.createFileToken({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '' +}); diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index b5e3adf..6c41ea5 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -7,6 +7,6 @@ const client = new Client() const tokens = new Tokens(client); -const response = await tokens.delete( - '<TOKEN_ID>' // tokenId -); +const response = await tokens.delete({ + tokenId: '<TOKEN_ID>' +}); diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 2bb827d..a7bf23a 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -7,6 +7,6 @@ const client = new Client() const tokens = new Tokens(client); -const response = await tokens.get( - '<TOKEN_ID>' // tokenId -); +const response = await tokens.get({ + tokenId: '<TOKEN_ID>' +}); diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 7208a53..93e91d3 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -7,8 +7,8 @@ const client = new Client() const tokens = new Tokens(client); -const response = await tokens.list( - '<BUCKET_ID>', // bucketId - '<FILE_ID>', // fileId - [] // queries (optional) -); +const response = await tokens.list({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [] +}); diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 4464a0c..391118c 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -7,7 +7,7 @@ const client = new Client() const tokens = new Tokens(client); -const response = await tokens.update( - '<TOKEN_ID>', // tokenId - '' // expire (optional) -); +const response = await tokens.update({ + tokenId: '<TOKEN_ID>', + expire: '' +}); diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 7a6e0fb..8ec4edc 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -7,9 +7,9 @@ const client = new Client() const users = new Users(client); -const response = await users.createArgon2User( - '<USER_ID>', // userId - 'email@example.com', // email - 'password', // password - '<NAME>' // name (optional) -); +const response = await users.createArgon2User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' +}); diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index ddfb7f3..75ef72d 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -7,9 +7,9 @@ const client = new Client() const users = new Users(client); -const response = await users.createBcryptUser( - '<USER_ID>', // userId - 'email@example.com', // email - 'password', // password - '<NAME>' // name (optional) -); +const response = await users.createBcryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' +}); diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index 4c433ae..4fef1c6 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -7,8 +7,8 @@ const client = new Client() const users = new Users(client); -const response = await users.createJWT( - '<USER_ID>', // userId - '<SESSION_ID>', // sessionId (optional) - 0 // duration (optional) -); +const response = await users.createJWT({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', + duration: 0 +}); diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 8cc63ce..bf29090 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -7,9 +7,9 @@ const client = new Client() const users = new Users(client); -const response = await users.createMD5User( - '<USER_ID>', // userId - 'email@example.com', // email - 'password', // password - '<NAME>' // name (optional) -); +const response = await users.createMD5User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' +}); diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 98ba71a..cb33377 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.createMfaRecoveryCodes( - '<USER_ID>' // userId -); +const response = await users.createMfaRecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 750b299..d461887 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -7,9 +7,9 @@ const client = new Client() const users = new Users(client); -const response = await users.createPHPassUser( - '<USER_ID>', // userId - 'email@example.com', // email - 'password', // password - '<NAME>' // name (optional) -); +const response = await users.createPHPassUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' +}); diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index e243a1d..3819016 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -7,10 +7,10 @@ const client = new Client() const users = new Users(client); -const response = await users.createSHAUser( - '<USER_ID>', // userId - 'email@example.com', // email - 'password', // password - PasswordHash.Sha1, // passwordVersion (optional) - '<NAME>' // name (optional) -); +const response = await users.createSHAUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: PasswordHash.Sha1, + name: '<NAME>' +}); diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 0d6a65b..7b9c908 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -7,12 +7,12 @@ const client = new Client() const users = new Users(client); -const response = await users.createScryptModifiedUser( - '<USER_ID>', // userId - 'email@example.com', // email - 'password', // password - '<PASSWORD_SALT>', // passwordSalt - '<PASSWORD_SALT_SEPARATOR>', // passwordSaltSeparator - '<PASSWORD_SIGNER_KEY>', // passwordSignerKey - '<NAME>' // name (optional) -); +const response = await users.createScryptModifiedUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' +}); diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 87f2dbb..63c25f4 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -7,14 +7,14 @@ const client = new Client() const users = new Users(client); -const response = await users.createScryptUser( - '<USER_ID>', // userId - 'email@example.com', // email - 'password', // password - '<PASSWORD_SALT>', // passwordSalt - null, // passwordCpu - null, // passwordMemory - null, // passwordParallel - null, // passwordLength - '<NAME>' // name (optional) -); +const response = await users.createScryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: null, + passwordMemory: null, + passwordParallel: null, + passwordLength: null, + name: '<NAME>' +}); diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 37d6948..962d391 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.createSession( - '<USER_ID>' // userId -); +const response = await users.createSession({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index a36072a..cd542d4 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -7,11 +7,11 @@ const client = new Client() const users = new Users(client); -const response = await users.createTarget( - '<USER_ID>', // userId - '<TARGET_ID>', // targetId - MessagingProviderType.Email, // providerType - '<IDENTIFIER>', // identifier - '<PROVIDER_ID>', // providerId (optional) - '<NAME>' // name (optional) -); +const response = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', + name: '<NAME>' +}); diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 91885e1..2a215d9 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -7,8 +7,8 @@ const client = new Client() const users = new Users(client); -const response = await users.createToken( - '<USER_ID>', // userId - 4, // length (optional) - 60 // expire (optional) -); +const response = await users.createToken({ + userId: '<USER_ID>', + length: 4, + expire: 60 +}); diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index e0eb585..cee05f3 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -7,10 +7,10 @@ const client = new Client() const users = new Users(client); -const response = await users.create( - '<USER_ID>', // userId - 'email@example.com', // email (optional) - '+12065550100', // phone (optional) - '', // password (optional) - '<NAME>' // name (optional) -); +const response = await users.create({ + userId: '<USER_ID>', + email: 'email@example.com', + phone: '+12065550100', + password: '', + name: '<NAME>' +}); diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 7aea654..83efe6a 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.deleteIdentity( - '<IDENTITY_ID>' // identityId -); +const response = await users.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 2d75950..2945d5c 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.deleteMfaAuthenticator( - '<USER_ID>', // userId - AuthenticatorType.Totp // type -); +const response = await users.deleteMfaAuthenticator({ + userId: '<USER_ID>', + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 0ce82fe..1d4adc8 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.deleteSession( - '<USER_ID>', // userId - '<SESSION_ID>' // sessionId -); +const response = await users.deleteSession({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index f80300b..ec44531 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.deleteSessions( - '<USER_ID>' // userId -); +const response = await users.deleteSessions({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 9080a96..953ade1 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.deleteTarget( - '<USER_ID>', // userId - '<TARGET_ID>' // targetId -); +const response = await users.deleteTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 7ac1bf1..5ab1f18 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.delete( - '<USER_ID>' // userId -); +const response = await users.delete({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index f78c0bf..7d00af0 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.getMfaRecoveryCodes( - '<USER_ID>' // userId -); +const response = await users.getMfaRecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index ef1be1e..d252ffe 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.getPrefs( - '<USER_ID>' // userId -); +const response = await users.getPrefs({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 301ee6e..7586fae 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.getTarget( - '<USER_ID>', // userId - '<TARGET_ID>' // targetId -); +const response = await users.getTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 8e41ed6..c3e5863 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.get( - '<USER_ID>' // userId -); +const response = await users.get({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 6ac4395..ae7ce5d 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.listIdentities( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await users.listIdentities({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 983ffba..62e5625 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.listLogs( - '<USER_ID>', // userId - [] // queries (optional) -); +const response = await users.listLogs({ + userId: '<USER_ID>', + queries: [] +}); diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index afdd4d4..20993dc 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -7,8 +7,8 @@ const client = new Client() const users = new Users(client); -const response = await users.listMemberships( - '<USER_ID>', // userId - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await users.listMemberships({ + userId: '<USER_ID>', + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 34b65af..e54e9be 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.listMfaFactors( - '<USER_ID>' // userId -); +const response = await users.listMfaFactors({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 314f277..46f4e5c 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.listSessions( - '<USER_ID>' // userId -); +const response = await users.listSessions({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 9ed2dda..a9571dc 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.listTargets( - '<USER_ID>', // userId - [] // queries (optional) -); +const response = await users.listTargets({ + userId: '<USER_ID>', + queries: [] +}); diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 488fbdc..9b8b4fe 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.list( - [], // queries (optional) - '<SEARCH>' // search (optional) -); +const response = await users.list({ + queries: [], + search: '<SEARCH>' +}); diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 3243f21..df2fd03 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updateEmailVerification( - '<USER_ID>', // userId - false // emailVerification -); +const response = await users.updateEmailVerification({ + userId: '<USER_ID>', + emailVerification: false +}); diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index f609cab..fbf34ca 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updateEmail( - '<USER_ID>', // userId - 'email@example.com' // email -); +const response = await users.updateEmail({ + userId: '<USER_ID>', + email: 'email@example.com' +}); diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 5a23298..18cdca2 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updateLabels( - '<USER_ID>', // userId - [] // labels -); +const response = await users.updateLabels({ + userId: '<USER_ID>', + labels: [] +}); diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index a74577e..9bfd395 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.updateMfaRecoveryCodes( - '<USER_ID>' // userId -); +const response = await users.updateMfaRecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 717f8d6..97a1afc 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updateMfa( - '<USER_ID>', // userId - false // mfa -); +const response = await users.updateMfa({ + userId: '<USER_ID>', + mfa: false +}); diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 35fc853..304e833 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updateName( - '<USER_ID>', // userId - '<NAME>' // name -); +const response = await users.updateName({ + userId: '<USER_ID>', + name: '<NAME>' +}); diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 8366b5c..8eecca4 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updatePassword( - '<USER_ID>', // userId - '' // password -); +const response = await users.updatePassword({ + userId: '<USER_ID>', + password: '' +}); diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 088fd1e..713cdac 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updatePhoneVerification( - '<USER_ID>', // userId - false // phoneVerification -); +const response = await users.updatePhoneVerification({ + userId: '<USER_ID>', + phoneVerification: false +}); diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index a8e47a6..1c3926b 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updatePhone( - '<USER_ID>', // userId - '+12065550100' // number -); +const response = await users.updatePhone({ + userId: '<USER_ID>', + number: '+12065550100' +}); diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index cb8919a..555f9b4 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updatePrefs( - '<USER_ID>', // userId - {} // prefs -); +const response = await users.updatePrefs({ + userId: '<USER_ID>', + prefs: {} +}); diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 1c672a4..b6b692e 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updateStatus( - '<USER_ID>', // userId - false // status -); +const response = await users.updateStatus({ + userId: '<USER_ID>', + status: false +}); diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 4524748..437c614 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -7,10 +7,10 @@ const client = new Client() const users = new Users(client); -const response = await users.updateTarget( - '<USER_ID>', // userId - '<TARGET_ID>', // targetId - '<IDENTIFIER>', // identifier (optional) - '<PROVIDER_ID>', // providerId (optional) - '<NAME>' // name (optional) -); +const response = await users.updateTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', + name: '<NAME>' +}); From 347028812aec876fd7637239cbab939cf24a8e2f Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Thu, 21 Aug 2025 22:17:34 +1200 Subject: [PATCH 4/8] Fix casing --- .../account/create-m-f-a-authenticator.md | 12 + .../account/create-m-f-a-challenge.md | 11 + .../account/create-m-f-a-recovery-codes.md | 10 + .../account/delete-m-f-a-authenticator.md | 12 + .../account/get-m-f-a-recovery-codes.md | 10 + docs/examples/account/list-m-f-a-factors.md | 10 + .../account/update-m-f-a-authenticator.md | 13 + .../account/update-m-f-a-challenge.md | 13 + .../account/update-m-f-a-recovery-codes.md | 10 + .../messaging/create-a-p-n-s-provider.md | 19 + .../messaging/create-f-c-m-provider.md | 15 + docs/examples/messaging/create-s-m-s.md | 18 + .../messaging/create-s-m-t-p-provider.md | 25 + .../messaging/update-a-p-n-s-provider.md | 19 + .../messaging/update-f-c-m-provider.md | 15 + docs/examples/messaging/update-s-m-s.md | 18 + .../messaging/update-s-m-t-p-provider.md | 25 + .../tablesdb/create-boolean-column.md | 6 +- .../tablesdb/create-datetime-column.md | 6 +- docs/examples/tablesdb/create-email-column.md | 6 +- docs/examples/tablesdb/create-enum-column.md | 6 +- docs/examples/tablesdb/create-float-column.md | 6 +- docs/examples/tablesdb/create-index.md | 6 +- .../tablesdb/create-integer-column.md | 6 +- docs/examples/tablesdb/create-ip-column.md | 6 +- .../tablesdb/create-relationship-column.md | 6 +- docs/examples/tablesdb/create-row.md | 6 +- docs/examples/tablesdb/create-rows.md | 6 +- .../examples/tablesdb/create-string-column.md | 6 +- docs/examples/tablesdb/create-table.md | 6 +- docs/examples/tablesdb/create-url-column.md | 6 +- docs/examples/tablesdb/create.md | 6 +- .../examples/tablesdb/decrement-row-column.md | 6 +- docs/examples/tablesdb/delete-column.md | 6 +- docs/examples/tablesdb/delete-index.md | 6 +- docs/examples/tablesdb/delete-row.md | 6 +- docs/examples/tablesdb/delete-rows.md | 6 +- docs/examples/tablesdb/delete-table.md | 6 +- docs/examples/tablesdb/delete.md | 6 +- docs/examples/tablesdb/get-column.md | 6 +- docs/examples/tablesdb/get-index.md | 6 +- docs/examples/tablesdb/get-row.md | 6 +- docs/examples/tablesdb/get-table.md | 6 +- docs/examples/tablesdb/get.md | 6 +- .../examples/tablesdb/increment-row-column.md | 6 +- docs/examples/tablesdb/list-columns.md | 6 +- docs/examples/tablesdb/list-indexes.md | 6 +- docs/examples/tablesdb/list-rows.md | 6 +- docs/examples/tablesdb/list-tables.md | 6 +- docs/examples/tablesdb/list.md | 6 +- .../tablesdb/update-boolean-column.md | 6 +- .../tablesdb/update-datetime-column.md | 6 +- docs/examples/tablesdb/update-email-column.md | 6 +- docs/examples/tablesdb/update-enum-column.md | 6 +- docs/examples/tablesdb/update-float-column.md | 6 +- .../tablesdb/update-integer-column.md | 6 +- docs/examples/tablesdb/update-ip-column.md | 6 +- .../tablesdb/update-relationship-column.md | 6 +- docs/examples/tablesdb/update-row.md | 6 +- docs/examples/tablesdb/update-rows.md | 6 +- .../examples/tablesdb/update-string-column.md | 6 +- docs/examples/tablesdb/update-table.md | 6 +- docs/examples/tablesdb/update-url-column.md | 6 +- docs/examples/tablesdb/update.md | 6 +- docs/examples/tablesdb/upsert-row.md | 6 +- docs/examples/tablesdb/upsert-rows.md | 6 +- .../users/create-m-f-a-recovery-codes.md | 12 + .../users/delete-m-f-a-authenticator.md | 13 + .../users/get-m-f-a-recovery-codes.md | 12 + docs/examples/users/list-m-f-a-factors.md | 12 + .../users/update-m-f-a-recovery-codes.md | 12 + docs/examples/users/update-m-f-a.md | 13 + mod.ts | 4 +- src/models.d.ts | 70 +-- src/services/account.ts | 255 ++++++++++ src/services/databases.ts | 98 ++-- src/services/messaging.ts | 475 ++++++++++++++++++ src/services/{tables-db.ts => tables-d-b.ts} | 12 +- src/services/users.ts | 176 +++++++ test/services/account.test.ts | 183 +++++++ test/services/messaging.test.ts | 185 +++++++ .../{tables-db.test.ts => tables-d-b.test.ts} | 104 ++-- test/services/users.test.ts | 110 ++++ 83 files changed, 2004 insertions(+), 291 deletions(-) create mode 100644 docs/examples/account/create-m-f-a-authenticator.md create mode 100644 docs/examples/account/create-m-f-a-challenge.md create mode 100644 docs/examples/account/create-m-f-a-recovery-codes.md create mode 100644 docs/examples/account/delete-m-f-a-authenticator.md create mode 100644 docs/examples/account/get-m-f-a-recovery-codes.md create mode 100644 docs/examples/account/list-m-f-a-factors.md create mode 100644 docs/examples/account/update-m-f-a-authenticator.md create mode 100644 docs/examples/account/update-m-f-a-challenge.md create mode 100644 docs/examples/account/update-m-f-a-recovery-codes.md create mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/create-f-c-m-provider.md create mode 100644 docs/examples/messaging/create-s-m-s.md create mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/update-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/update-f-c-m-provider.md create mode 100644 docs/examples/messaging/update-s-m-s.md create mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md create mode 100644 docs/examples/users/create-m-f-a-recovery-codes.md create mode 100644 docs/examples/users/delete-m-f-a-authenticator.md create mode 100644 docs/examples/users/get-m-f-a-recovery-codes.md create mode 100644 docs/examples/users/list-m-f-a-factors.md create mode 100644 docs/examples/users/update-m-f-a-recovery-codes.md create mode 100644 docs/examples/users/update-m-f-a.md rename src/services/{tables-db.ts => tables-d-b.ts} (99%) rename test/services/{tables-db.test.ts => tables-d-b.test.ts} (91%) diff --git a/docs/examples/account/create-m-f-a-authenticator.md b/docs/examples/account/create-m-f-a-authenticator.md new file mode 100644 index 0000000..0e496e0 --- /dev/null +++ b/docs/examples/account/create-m-f-a-authenticator.md @@ -0,0 +1,12 @@ +import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/account/create-m-f-a-challenge.md b/docs/examples/account/create-m-f-a-challenge.md new file mode 100644 index 0000000..a36e286 --- /dev/null +++ b/docs/examples/account/create-m-f-a-challenge.md @@ -0,0 +1,11 @@ +import { Client, Account, AuthenticationFactor } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email +}); diff --git a/docs/examples/account/create-m-f-a-recovery-codes.md b/docs/examples/account/create-m-f-a-recovery-codes.md new file mode 100644 index 0000000..5a8f6a3 --- /dev/null +++ b/docs/examples/account/create-m-f-a-recovery-codes.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.createMFARecoveryCodes(); diff --git a/docs/examples/account/delete-m-f-a-authenticator.md b/docs/examples/account/delete-m-f-a-authenticator.md new file mode 100644 index 0000000..777347d --- /dev/null +++ b/docs/examples/account/delete-m-f-a-authenticator.md @@ -0,0 +1,12 @@ +import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/account/get-m-f-a-recovery-codes.md b/docs/examples/account/get-m-f-a-recovery-codes.md new file mode 100644 index 0000000..6f631ac --- /dev/null +++ b/docs/examples/account/get-m-f-a-recovery-codes.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.getMFARecoveryCodes(); diff --git a/docs/examples/account/list-m-f-a-factors.md b/docs/examples/account/list-m-f-a-factors.md new file mode 100644 index 0000000..0eb3d5d --- /dev/null +++ b/docs/examples/account/list-m-f-a-factors.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.listMFAFactors(); diff --git a/docs/examples/account/update-m-f-a-authenticator.md b/docs/examples/account/update-m-f-a-authenticator.md new file mode 100644 index 0000000..1049f6a --- /dev/null +++ b/docs/examples/account/update-m-f-a-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '<OTP>' +}); diff --git a/docs/examples/account/update-m-f-a-challenge.md b/docs/examples/account/update-m-f-a-challenge.md new file mode 100644 index 0000000..9ee0825 --- /dev/null +++ b/docs/examples/account/update-m-f-a-challenge.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateMFAChallenge({ + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +}); diff --git a/docs/examples/account/update-m-f-a-recovery-codes.md b/docs/examples/account/update-m-f-a-recovery-codes.md new file mode 100644 index 0000000..eae8560 --- /dev/null +++ b/docs/examples/account/update-m-f-a-recovery-codes.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateMFARecoveryCodes(); diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md new file mode 100644 index 0000000..b117888 --- /dev/null +++ b/docs/examples/messaging/create-a-p-n-s-provider.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.createAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', + authKeyId: '<AUTH_KEY_ID>', + teamId: '<TEAM_ID>', + bundleId: '<BUNDLE_ID>', + sandbox: false, + enabled: false +}); diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md new file mode 100644 index 0000000..5831f79 --- /dev/null +++ b/docs/examples/messaging/create-f-c-m-provider.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.createFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: {}, + enabled: false +}); diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md new file mode 100644 index 0000000..8f4fefc --- /dev/null +++ b/docs/examples/messaging/create-s-m-s.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.createSMS({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: '' +}); diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md new file mode 100644 index 0000000..0a85e7c --- /dev/null +++ b/docs/examples/messaging/create-s-m-t-p-provider.md @@ -0,0 +1,25 @@ +import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.createSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, + username: '<USERNAME>', + password: '<PASSWORD>', + encryption: SmtpEncryption.None, + autoTLS: false, + mailer: '<MAILER>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: 'email@example.com', + enabled: false +}); diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md new file mode 100644 index 0000000..a7b4236 --- /dev/null +++ b/docs/examples/messaging/update-a-p-n-s-provider.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.updateAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + authKey: '<AUTH_KEY>', + authKeyId: '<AUTH_KEY_ID>', + teamId: '<TEAM_ID>', + bundleId: '<BUNDLE_ID>', + sandbox: false +}); diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md new file mode 100644 index 0000000..dafc6ce --- /dev/null +++ b/docs/examples/messaging/update-f-c-m-provider.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + serviceAccountJSON: {} +}); diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md new file mode 100644 index 0000000..d2a3be0 --- /dev/null +++ b/docs/examples/messaging/update-s-m-s.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.updateSMS({ + messageId: '<MESSAGE_ID>', + topics: [], + users: [], + targets: [], + content: '<CONTENT>', + draft: false, + scheduledAt: '' +}); diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md new file mode 100644 index 0000000..ea192a7 --- /dev/null +++ b/docs/examples/messaging/update-s-m-t-p-provider.md @@ -0,0 +1,25 @@ +import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 messaging = new Messaging(client); + +const response = await messaging.updateSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, + username: '<USERNAME>', + password: '<PASSWORD>', + encryption: SmtpEncryption.None, + autoTLS: false, + mailer: '<MAILER>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>', + enabled: false +}); diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 410cee1..336d7c0 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createBooleanColumn({ +const response = await tablesDB.createBooleanColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 19267e0..8aaacad 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createDatetimeColumn({ +const response = await tablesDB.createDatetimeColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 22b2a9d..bc94776 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createEmailColumn({ +const response = await tablesDB.createEmailColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index b2dcc88..aa14fae 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createEnumColumn({ +const response = await tablesDB.createEnumColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 4cf2b55..0ac4222 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createFloatColumn({ +const response = await tablesDB.createFloatColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index efb1f12..87deb28 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -1,13 +1,13 @@ -import { Client, TablesDb, IndexType } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB, IndexType } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createIndex({ +const response = await tablesDB.createIndex({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index ccbda0b..39de99a 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createIntegerColumn({ +const response = await tablesDB.createIntegerColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index c5c2fa6..c2e66bb 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createIpColumn({ +const response = await tablesDB.createIpColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index a50ffcd..ddd2bae 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb, RelationshipType, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB, RelationshipType, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createRelationshipColumn({ +const response = await tablesDB.createRelationshipColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', relatedTableId: '<RELATED_TABLE_ID>', diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 6f06463..96b7456 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createRow({ +const response = await tablesDB.createRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 87f7d2e..a3fafcf 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createRows({ +const response = await tablesDB.createRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rows: [] diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 3b0bf5b..7656947 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createStringColumn({ +const response = await tablesDB.createStringColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 596f4e3..a54a02c 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createTable({ +const response = await tablesDB.createTable({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', name: '<NAME>', diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index 014f54b..124b978 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.createUrlColumn({ +const response = await tablesDB.createUrlColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 618e4c6..5c8f500 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.create({ +const response = await tablesDB.create({ databaseId: '<DATABASE_ID>', name: '<NAME>', enabled: false diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 67fd811..375e324 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.decrementRowColumn({ +const response = await tablesDB.decrementRowColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index 2ba1140..63b567a 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.deleteColumn({ +const response = await tablesDB.deleteColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '' diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index e1b77ed..15a98fb 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.deleteIndex({ +const response = await tablesDB.deleteIndex({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '' diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index f18b6ac..2f63a91 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.deleteRow({ +const response = await tablesDB.deleteRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>' diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index 659150f..bffbf0e 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.deleteRows({ +const response = await tablesDB.deleteRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', queries: [] diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 1be63ed..3f36527 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.deleteTable({ +const response = await tablesDB.deleteTable({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>' }); diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 12c92bf..12249ab 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -1,12 +1,12 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.delete({ +const response = await tablesDB.delete({ databaseId: '<DATABASE_ID>' }); diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 5599535..16bb38a 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.getColumn({ +const response = await tablesDB.getColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '' diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 708c22a..47e7a61 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.getIndex({ +const response = await tablesDB.getIndex({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '' diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 0e9f079..a30bb2a 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.getRow({ +const response = await tablesDB.getRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 91b4957..6a46bbd 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.getTable({ +const response = await tablesDB.getTable({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>' }); diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index b5fc2f7..4304258 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -1,12 +1,12 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.get({ +const response = await tablesDB.get({ databaseId: '<DATABASE_ID>' }); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 03b59d5..1402027 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.incrementRowColumn({ +const response = await tablesDB.incrementRowColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 7c061e9..92e8ce8 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.listColumns({ +const response = await tablesDB.listColumns({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', queries: [] diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index d2b0010..d937e4c 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.listIndexes({ +const response = await tablesDB.listIndexes({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', queries: [] diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index 764bfa7..293fdbd 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.listRows({ +const response = await tablesDB.listRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', queries: [] diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 3b74c36..30fe1c3 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.listTables({ +const response = await tablesDB.listTables({ databaseId: '<DATABASE_ID>', queries: [], search: '<SEARCH>' diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 5af10e4..937e202 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.list({ +const response = await tablesDB.list({ queries: [], search: '<SEARCH>' }); diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index af6a962..5949036 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateBooleanColumn({ +const response = await tablesDB.updateBooleanColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index b704445..f4df6bb 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateDatetimeColumn({ +const response = await tablesDB.updateDatetimeColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 28f243c..ad1f9fc 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateEmailColumn({ +const response = await tablesDB.updateEmailColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 6f44394..3b887f9 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateEnumColumn({ +const response = await tablesDB.updateEnumColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 8b1c50e..4433127 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateFloatColumn({ +const response = await tablesDB.updateFloatColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index e2b5af0..1158973 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateIntegerColumn({ +const response = await tablesDB.updateIntegerColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 54bf616..f2f405a 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateIpColumn({ +const response = await tablesDB.updateIpColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index de8d3db..97b86d7 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateRelationshipColumn({ +const response = await tablesDB.updateRelationshipColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 35b1b27..87e8be8 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateRow({ +const response = await tablesDB.updateRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 3e5cba8..852b7db 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateRows({ +const response = await tablesDB.updateRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', data: {}, diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index b763d37..dab18a2 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateStringColumn({ +const response = await tablesDB.updateStringColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 54d60ed..6a36b09 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateTable({ +const response = await tablesDB.updateTable({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', name: '<NAME>', diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index c09ee6e..3ae1f04 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.updateUrlColumn({ +const response = await tablesDB.updateUrlColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 8504e63..59d58fb 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.update({ +const response = await tablesDB.update({ databaseId: '<DATABASE_ID>', name: '<NAME>', enabled: false diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index dda7dad..ec69e83 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with -const tablesDb = new TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.upsertRow({ +const response = await tablesDB.upsertRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index 1732351..a5fa731 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -1,13 +1,13 @@ -import { Client, TablesDb } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 TablesDb(client); +const tablesDB = new TablesDB(client); -const response = await tablesDb.upsertRows({ +const response = await tablesDB.upsertRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rows: [] diff --git a/docs/examples/users/create-m-f-a-recovery-codes.md b/docs/examples/users/create-m-f-a-recovery-codes.md new file mode 100644 index 0000000..fe8a4af --- /dev/null +++ b/docs/examples/users/create-m-f-a-recovery-codes.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 users = new Users(client); + +const response = await users.createMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/delete-m-f-a-authenticator.md b/docs/examples/users/delete-m-f-a-authenticator.md new file mode 100644 index 0000000..5097cff --- /dev/null +++ b/docs/examples/users/delete-m-f-a-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Users, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 users = new Users(client); + +const response = await users.deleteMFAAuthenticator({ + userId: '<USER_ID>', + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/users/get-m-f-a-recovery-codes.md b/docs/examples/users/get-m-f-a-recovery-codes.md new file mode 100644 index 0000000..c2e4752 --- /dev/null +++ b/docs/examples/users/get-m-f-a-recovery-codes.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 users = new Users(client); + +const response = await users.getMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/list-m-f-a-factors.md b/docs/examples/users/list-m-f-a-factors.md new file mode 100644 index 0000000..c413011 --- /dev/null +++ b/docs/examples/users/list-m-f-a-factors.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 users = new Users(client); + +const response = await users.listMFAFactors({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/update-m-f-a-recovery-codes.md b/docs/examples/users/update-m-f-a-recovery-codes.md new file mode 100644 index 0000000..ce1b875 --- /dev/null +++ b/docs/examples/users/update-m-f-a-recovery-codes.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 users = new Users(client); + +const response = await users.updateMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/users/update-m-f-a.md b/docs/examples/users/update-m-f-a.md new file mode 100644 index 0000000..235357f --- /dev/null +++ b/docs/examples/users/update-m-f-a.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new 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 users = new Users(client); + +const response = await users.updateMFA({ + userId: '<USER_ID>', + mfa: false +}); diff --git a/mod.ts b/mod.ts index 8995fb2..eea37a3 100644 --- a/mod.ts +++ b/mod.ts @@ -15,7 +15,7 @@ import { Locale } from "./src/services/locale.ts"; import { Messaging } from "./src/services/messaging.ts"; import { Sites } from "./src/services/sites.ts"; import { Storage } from "./src/services/storage.ts"; -import { TablesDb } from "./src/services/tables-db.ts"; +import { TablesDB } from "./src/services/tables-d-b.ts"; import { Teams } from "./src/services/teams.ts"; import { Tokens } from "./src/services/tokens.ts"; import { Users } from "./src/services/users.ts"; @@ -62,7 +62,7 @@ export { Messaging, Sites, Storage, - TablesDb, + TablesDB, Teams, Tokens, Users, diff --git a/src/models.d.ts b/src/models.d.ts index cce7a8f..f0ed180 100644 --- a/src/models.d.ts +++ b/src/models.d.ts @@ -4,7 +4,7 @@ export namespace Models { */ export type RowList<Row extends Models.Row> = { /** - * Total number of rows rows that matched your query. + * Total number of rows that matched your query. */ total: number; /** @@ -17,7 +17,7 @@ export namespace Models { */ export type DocumentList<Document extends Models.Document> = { /** - * Total number of documents rows that matched your query. + * Total number of documents that matched your query. */ total: number; /** @@ -30,7 +30,7 @@ export namespace Models { */ export type TableList = { /** - * Total number of tables rows that matched your query. + * Total number of tables that matched your query. */ total: number; /** @@ -43,7 +43,7 @@ export namespace Models { */ export type CollectionList = { /** - * Total number of collections rows that matched your query. + * Total number of collections that matched your query. */ total: number; /** @@ -56,7 +56,7 @@ export namespace Models { */ export type DatabaseList = { /** - * Total number of databases rows that matched your query. + * Total number of databases that matched your query. */ total: number; /** @@ -69,7 +69,7 @@ export namespace Models { */ export type IndexList = { /** - * Total number of indexes rows that matched your query. + * Total number of indexes that matched your query. */ total: number; /** @@ -82,7 +82,7 @@ export namespace Models { */ export type ColumnIndexList = { /** - * Total number of indexes rows that matched your query. + * Total number of indexes that matched your query. */ total: number; /** @@ -95,7 +95,7 @@ export namespace Models { */ export type UserList<Preferences extends Models.Preferences> = { /** - * Total number of users rows that matched your query. + * Total number of users that matched your query. */ total: number; /** @@ -108,7 +108,7 @@ export namespace Models { */ export type SessionList = { /** - * Total number of sessions rows that matched your query. + * Total number of sessions that matched your query. */ total: number; /** @@ -121,7 +121,7 @@ export namespace Models { */ export type IdentityList = { /** - * Total number of identities rows that matched your query. + * Total number of identities that matched your query. */ total: number; /** @@ -134,7 +134,7 @@ export namespace Models { */ export type LogList = { /** - * Total number of logs rows that matched your query. + * Total number of logs that matched your query. */ total: number; /** @@ -147,7 +147,7 @@ export namespace Models { */ export type FileList = { /** - * Total number of files rows that matched your query. + * Total number of files that matched your query. */ total: number; /** @@ -160,7 +160,7 @@ export namespace Models { */ export type BucketList = { /** - * Total number of buckets rows that matched your query. + * Total number of buckets that matched your query. */ total: number; /** @@ -173,7 +173,7 @@ export namespace Models { */ export type ResourceTokenList = { /** - * Total number of tokens rows that matched your query. + * Total number of tokens that matched your query. */ total: number; /** @@ -186,7 +186,7 @@ export namespace Models { */ export type TeamList<Preferences extends Models.Preferences> = { /** - * Total number of teams rows that matched your query. + * Total number of teams that matched your query. */ total: number; /** @@ -199,7 +199,7 @@ export namespace Models { */ export type MembershipList = { /** - * Total number of memberships rows that matched your query. + * Total number of memberships that matched your query. */ total: number; /** @@ -212,7 +212,7 @@ export namespace Models { */ export type SiteList = { /** - * Total number of sites rows that matched your query. + * Total number of sites that matched your query. */ total: number; /** @@ -225,7 +225,7 @@ export namespace Models { */ export type FunctionList = { /** - * Total number of functions rows that matched your query. + * Total number of functions that matched your query. */ total: number; /** @@ -238,7 +238,7 @@ export namespace Models { */ export type FrameworkList = { /** - * Total number of frameworks rows that matched your query. + * Total number of frameworks that matched your query. */ total: number; /** @@ -251,7 +251,7 @@ export namespace Models { */ export type RuntimeList = { /** - * Total number of runtimes rows that matched your query. + * Total number of runtimes that matched your query. */ total: number; /** @@ -264,7 +264,7 @@ export namespace Models { */ export type DeploymentList = { /** - * Total number of deployments rows that matched your query. + * Total number of deployments that matched your query. */ total: number; /** @@ -277,7 +277,7 @@ export namespace Models { */ export type ExecutionList = { /** - * Total number of executions rows that matched your query. + * Total number of executions that matched your query. */ total: number; /** @@ -290,7 +290,7 @@ export namespace Models { */ export type CountryList = { /** - * Total number of countries rows that matched your query. + * Total number of countries that matched your query. */ total: number; /** @@ -303,7 +303,7 @@ export namespace Models { */ export type ContinentList = { /** - * Total number of continents rows that matched your query. + * Total number of continents that matched your query. */ total: number; /** @@ -316,7 +316,7 @@ export namespace Models { */ export type LanguageList = { /** - * Total number of languages rows that matched your query. + * Total number of languages that matched your query. */ total: number; /** @@ -329,7 +329,7 @@ export namespace Models { */ export type CurrencyList = { /** - * Total number of currencies rows that matched your query. + * Total number of currencies that matched your query. */ total: number; /** @@ -342,7 +342,7 @@ export namespace Models { */ export type PhoneList = { /** - * Total number of phones rows that matched your query. + * Total number of phones that matched your query. */ total: number; /** @@ -355,7 +355,7 @@ export namespace Models { */ export type VariableList = { /** - * Total number of variables rows that matched your query. + * Total number of variables that matched your query. */ total: number; /** @@ -368,7 +368,7 @@ export namespace Models { */ export type LocaleCodeList = { /** - * Total number of localeCodes rows that matched your query. + * Total number of localeCodes that matched your query. */ total: number; /** @@ -381,7 +381,7 @@ export namespace Models { */ export type ProviderList = { /** - * Total number of providers rows that matched your query. + * Total number of providers that matched your query. */ total: number; /** @@ -394,7 +394,7 @@ export namespace Models { */ export type MessageList = { /** - * Total number of messages rows that matched your query. + * Total number of messages that matched your query. */ total: number; /** @@ -407,7 +407,7 @@ export namespace Models { */ export type TopicList = { /** - * Total number of topics rows that matched your query. + * Total number of topics that matched your query. */ total: number; /** @@ -420,7 +420,7 @@ export namespace Models { */ export type SubscriberList = { /** - * Total number of subscribers rows that matched your query. + * Total number of subscribers that matched your query. */ total: number; /** @@ -433,7 +433,7 @@ export namespace Models { */ export type TargetList = { /** - * Total number of targets rows that matched your query. + * Total number of targets that matched your query. */ total: number; /** @@ -446,7 +446,7 @@ export namespace Models { */ export type SpecificationList = { /** - * Total number of specifications rows that matched your query. + * Total number of specifications that matched your query. */ total: number; /** diff --git a/src/services/account.ts b/src/services/account.ts index 29a42b8..9f642eb 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -275,6 +275,7 @@ export class Account extends Service { * @param {AuthenticatorType} type * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFAAuthenticator` instead. */ async createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> { if (typeof type === 'undefined') { @@ -294,6 +295,34 @@ export class Account extends Service { 'json' ); } + /** + * Add an authenticator app to be used as an MFA factor. Verify the + * authenticator using the [verify + * authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) + * method. + * + * @param {AuthenticatorType} type + * @throws {AppwriteException} + * @returns {Promise} + */ + async createMFAAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> { + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const payload: Payload = {}; + + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Verify an authenticator app after adding it using the [add * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) @@ -303,6 +332,7 @@ export class Account extends Service { * @param {string} otp * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFAAuthenticator` instead. */ async updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> { if (typeof type === 'undefined') { @@ -329,12 +359,48 @@ export class Account extends Service { 'json' ); } + /** + * Verify an authenticator app after adding it using the [add + * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) + * method. + * + * @param {AuthenticatorType} type + * @param {string} otp + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateMFAAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> { + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + + if (typeof otp === 'undefined') { + throw new AppwriteException('Missing required parameter: "otp"'); + } + + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const payload: Payload = {}; + + if (typeof otp !== 'undefined') { + payload['otp'] = otp; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Delete an authenticator for a user by ID. * * @param {AuthenticatorType} type * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead. */ async deleteMfaAuthenticator(type: AuthenticatorType): Promise<Response> { if (typeof type === 'undefined') { @@ -354,6 +420,31 @@ export class Account extends Service { 'json' ); } + /** + * Delete an authenticator for a user by ID. + * + * @param {AuthenticatorType} type + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteMFAAuthenticator(type: AuthenticatorType): Promise<Response> { + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const payload: Payload = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Begin the process of MFA verification after sign-in. Finish the flow with * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) @@ -362,6 +453,7 @@ export class Account extends Service { * @param {AuthenticationFactor} factor * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFAChallenge` instead. */ async createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> { if (typeof factor === 'undefined') { @@ -384,6 +476,36 @@ export class Account extends Service { 'json' ); } + /** + * Begin the process of MFA verification after sign-in. Finish the flow with + * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) + * method. + * + * @param {AuthenticationFactor} factor + * @throws {AppwriteException} + * @returns {Promise} + */ + async createMFAChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> { + if (typeof factor === 'undefined') { + throw new AppwriteException('Missing required parameter: "factor"'); + } + + const apiPath = '/account/mfa/challenge'; + const payload: Payload = {}; + + if (typeof factor !== 'undefined') { + payload['factor'] = factor; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Complete the MFA challenge by providing the one-time password. Finish the * process of MFA verification by providing the one-time password. To begin @@ -395,6 +517,7 @@ export class Account extends Service { * @param {string} otp * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFAChallenge` instead. */ async updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session> { if (typeof challengeId === 'undefined') { @@ -424,11 +547,52 @@ export class Account extends Service { 'json' ); } + /** + * Complete the MFA challenge by providing the one-time password. Finish the + * process of MFA verification by providing the one-time password. To begin + * the flow, use + * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) + * method. + * + * @param {string} challengeId + * @param {string} otp + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateMFAChallenge(challengeId: string, otp: string): Promise<Models.Session> { + if (typeof challengeId === 'undefined') { + throw new AppwriteException('Missing required parameter: "challengeId"'); + } + + if (typeof otp === 'undefined') { + throw new AppwriteException('Missing required parameter: "otp"'); + } + + const apiPath = '/account/mfa/challenge'; + const payload: Payload = {}; + + if (typeof challengeId !== 'undefined') { + payload['challengeId'] = challengeId; + } + if (typeof otp !== 'undefined') { + payload['otp'] = otp; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * List the factors available on the account to be used as a MFA challange. * * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead. */ async listMfaFactors(): Promise<Models.MfaFactors> { const apiPath = '/account/mfa/factors'; @@ -443,6 +607,25 @@ export class Account extends Service { 'json' ); } + /** + * List the factors available on the account to be used as a MFA challange. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + async listMFAFactors(): Promise<Models.MfaFactors> { + const apiPath = '/account/mfa/factors'; + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } /** * Get recovery codes that can be used as backup for MFA flow. Before getting * codes, they must be generated using @@ -451,6 +634,7 @@ export class Account extends Service { * * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead. */ async getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> { const apiPath = '/account/mfa/recovery-codes'; @@ -465,6 +649,28 @@ export class Account extends Service { 'json' ); } + /** + * Get recovery codes that can be used as backup for MFA flow. Before getting + * codes, they must be generated using + * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + * method. An OTP challenge is required to read recovery codes. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + async getMFARecoveryCodes(): Promise<Models.MfaRecoveryCodes> { + const apiPath = '/account/mfa/recovery-codes'; + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } /** * Generate recovery codes as backup for MFA flow. It's recommended to * generate and show then immediately after user successfully adds their @@ -474,6 +680,7 @@ export class Account extends Service { * * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead. */ async createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> { const apiPath = '/account/mfa/recovery-codes'; @@ -489,6 +696,30 @@ export class Account extends Service { 'json' ); } + /** + * Generate recovery codes as backup for MFA flow. It's recommended to + * generate and show then immediately after user successfully adds their + * authehticator. Recovery codes can be used as a MFA verification type in + * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) + * method. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + async createMFARecoveryCodes(): Promise<Models.MfaRecoveryCodes> { + const apiPath = '/account/mfa/recovery-codes'; + const payload: Payload = {}; + + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Regenerate recovery codes that can be used as backup for MFA flow. Before * regenerating codes, they must be first generated using @@ -497,6 +728,7 @@ export class Account extends Service { * * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead. */ async updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> { const apiPath = '/account/mfa/recovery-codes'; @@ -512,6 +744,29 @@ export class Account extends Service { 'json' ); } + /** + * Regenerate recovery codes that can be used as backup for MFA flow. Before + * regenerating codes, they must be first generated using + * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + * method. An OTP challenge is required to regenreate recovery codes. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateMFARecoveryCodes(): Promise<Models.MfaRecoveryCodes> { + const apiPath = '/account/mfa/recovery-codes'; + const payload: Payload = {}; + + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Update currently logged in user account name. * diff --git a/src/services/databases.ts b/src/services/databases.ts index d1a0e19..56ec236 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -32,7 +32,7 @@ export class Databases extends Service { * @param {string} search * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.list` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.list` instead. */ async list(queries?: string[], search?: string): Promise<Models.DatabaseList> { const apiPath = '/databases'; @@ -64,7 +64,7 @@ export class Databases extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createDatabase` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatabase` instead. */ async create(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database> { if (typeof databaseId === 'undefined') { @@ -104,7 +104,7 @@ export class Databases extends Service { * @param {string} databaseId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.get` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.get` instead. */ async get(databaseId: string): Promise<Models.Database> { if (typeof databaseId === 'undefined') { @@ -131,7 +131,7 @@ export class Databases extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.update` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead. */ async update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database> { if (typeof databaseId === 'undefined') { @@ -168,7 +168,7 @@ export class Databases extends Service { * @param {string} databaseId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.delete` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.delete` instead. */ async delete(databaseId: string): Promise<Response> { if (typeof databaseId === 'undefined') { @@ -197,7 +197,7 @@ export class Databases extends Service { * @param {string} search * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listTables` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTables` instead. */ async listCollections(databaseId: string, queries?: string[], search?: string): Promise<Models.CollectionList> { if (typeof databaseId === 'undefined') { @@ -238,7 +238,7 @@ export class Databases extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createTable` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead. */ async createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection> { if (typeof databaseId === 'undefined') { @@ -289,7 +289,7 @@ export class Databases extends Service { * @param {string} collectionId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getTable` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getTable` instead. */ async getCollection(databaseId: string, collectionId: string): Promise<Models.Collection> { if (typeof databaseId === 'undefined') { @@ -323,7 +323,7 @@ export class Databases extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateTable` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead. */ async updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection> { if (typeof databaseId === 'undefined') { @@ -371,7 +371,7 @@ export class Databases extends Service { * @param {string} collectionId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteTable` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTable` instead. */ async deleteCollection(databaseId: string, collectionId: string): Promise<Response> { if (typeof databaseId === 'undefined') { @@ -403,7 +403,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listColumns` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listColumns` instead. */ async listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.AttributeList> { if (typeof databaseId === 'undefined') { @@ -442,7 +442,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createBooleanColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead. */ async createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean> { if (typeof databaseId === 'undefined') { @@ -498,7 +498,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateBooleanColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead. */ async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string): Promise<Models.AttributeBoolean> { if (typeof databaseId === 'undefined') { @@ -554,7 +554,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createDatetimeColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead. */ async createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime> { if (typeof databaseId === 'undefined') { @@ -610,7 +610,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateDatetimeColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead. */ async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime> { if (typeof databaseId === 'undefined') { @@ -667,7 +667,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createEmailColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead. */ async createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail> { if (typeof databaseId === 'undefined') { @@ -724,7 +724,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateEmailColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead. */ async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail> { if (typeof databaseId === 'undefined') { @@ -783,7 +783,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createEnumColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead. */ async createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum> { if (typeof databaseId === 'undefined') { @@ -848,7 +848,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateEnumColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead. */ async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum> { if (typeof databaseId === 'undefined') { @@ -915,7 +915,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createFloatColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead. */ async createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat> { if (typeof databaseId === 'undefined') { @@ -980,7 +980,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateFloatColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead. */ async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat> { if (typeof databaseId === 'undefined') { @@ -1046,7 +1046,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createIntegerColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead. */ async createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger> { if (typeof databaseId === 'undefined') { @@ -1111,7 +1111,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateIntegerColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead. */ async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger> { if (typeof databaseId === 'undefined') { @@ -1174,7 +1174,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createIpColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIpColumn` instead. */ async createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp> { if (typeof databaseId === 'undefined') { @@ -1231,7 +1231,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateIpColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIpColumn` instead. */ async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp> { if (typeof databaseId === 'undefined') { @@ -1291,7 +1291,7 @@ export class Databases extends Service { * @param {RelationMutate} onDelete * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createRelationshipColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead. */ async createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship> { if (typeof databaseId === 'undefined') { @@ -1355,7 +1355,7 @@ export class Databases extends Service { * @param {boolean} encrypt * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createStringColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead. */ async createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString> { if (typeof databaseId === 'undefined') { @@ -1423,7 +1423,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateStringColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead. */ async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString> { if (typeof databaseId === 'undefined') { @@ -1483,7 +1483,7 @@ export class Databases extends Service { * @param {boolean} array * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createUrlColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createUrlColumn` instead. */ async createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl> { if (typeof databaseId === 'undefined') { @@ -1540,7 +1540,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateUrlColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateUrlColumn` instead. */ async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl> { if (typeof databaseId === 'undefined') { @@ -1593,7 +1593,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead. */ async getAttribute(databaseId: string, collectionId: string, key: string): Promise<Response> { if (typeof databaseId === 'undefined') { @@ -1628,7 +1628,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteColumn` instead. */ async deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<Response> { if (typeof databaseId === 'undefined') { @@ -1668,7 +1668,7 @@ export class Databases extends Service { * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateRelationshipColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead. */ async updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship> { if (typeof databaseId === 'undefined') { @@ -1711,7 +1711,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listRows` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead. */ async listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> { if (typeof databaseId === 'undefined') { @@ -1751,7 +1751,7 @@ export class Databases extends Service { * @param {string[]} permissions * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createRow` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead. */ async createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> { if (typeof databaseId === 'undefined') { @@ -1803,7 +1803,7 @@ export class Databases extends Service { * @param {object[]} documents * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createRows` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead. */ async createDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>> { if (typeof databaseId === 'undefined') { @@ -1846,7 +1846,7 @@ export class Databases extends Service { * @param {object[]} documents * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRows` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead. */ async upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>> { if (typeof databaseId === 'undefined') { @@ -1888,7 +1888,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateRows` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead. */ async updateDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>> { if (typeof databaseId === 'undefined') { @@ -1927,7 +1927,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRows` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead. */ async deleteDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> { if (typeof databaseId === 'undefined') { @@ -1964,7 +1964,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getRow` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead. */ async getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> { if (typeof databaseId === 'undefined') { @@ -2008,7 +2008,7 @@ export class Databases extends Service { * @param {string[]} permissions * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRow` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead. */ async upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> { if (typeof databaseId === 'undefined') { @@ -2057,7 +2057,7 @@ export class Databases extends Service { * @param {string[]} permissions * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.updateRow` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead. */ async updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document> { if (typeof databaseId === 'undefined') { @@ -2099,7 +2099,7 @@ export class Databases extends Service { * @param {string} documentId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRow` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead. */ async deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<Response> { if (typeof databaseId === 'undefined') { @@ -2138,7 +2138,7 @@ export class Databases extends Service { * @param {number} min * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.decrementRowColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead. */ async decrementDocumentAttribute<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document> { if (typeof databaseId === 'undefined') { @@ -2187,7 +2187,7 @@ export class Databases extends Service { * @param {number} max * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.incrementRowColumn` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead. */ async incrementDocumentAttribute<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document> { if (typeof databaseId === 'undefined') { @@ -2233,7 +2233,7 @@ export class Databases extends Service { * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.listIndexes` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listIndexes` instead. */ async listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList> { if (typeof databaseId === 'undefined') { @@ -2274,7 +2274,7 @@ export class Databases extends Service { * @param {number[]} lengths * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.createIndex` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead. */ async createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise<Models.Index> { if (typeof databaseId === 'undefined') { @@ -2333,7 +2333,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.getIndex` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getIndex` instead. */ async getIndex(databaseId: string, collectionId: string, key: string): Promise<Models.Index> { if (typeof databaseId === 'undefined') { @@ -2368,7 +2368,7 @@ export class Databases extends Service { * @param {string} key * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDb.deleteIndex` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteIndex` instead. */ async deleteIndex(databaseId: string, collectionId: string, key: string): Promise<Response> { if (typeof databaseId === 'undefined') { diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 5b9d0ee..2223c5d 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -416,6 +416,7 @@ export class Messaging extends Service { * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateSMS` instead. */ async createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message> { if (typeof messageId === 'undefined') { @@ -460,6 +461,62 @@ export class Messaging extends Service { 'json' ); } + /** + * Create a new SMS message. + * + * @param {string} messageId + * @param {string} content + * @param {string[]} topics + * @param {string[]} users + * @param {string[]} targets + * @param {boolean} draft + * @param {string} scheduledAt + * @throws {AppwriteException} + * @returns {Promise} + */ + async createSMS(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message> { + if (typeof messageId === 'undefined') { + throw new AppwriteException('Missing required parameter: "messageId"'); + } + + if (typeof content === 'undefined') { + throw new AppwriteException('Missing required parameter: "content"'); + } + + const apiPath = '/messaging/messages/sms'; + const payload: Payload = {}; + + if (typeof messageId !== 'undefined') { + payload['messageId'] = messageId; + } + if (typeof content !== 'undefined') { + payload['content'] = content; + } + if (typeof topics !== 'undefined') { + payload['topics'] = topics; + } + if (typeof users !== 'undefined') { + payload['users'] = users; + } + if (typeof targets !== 'undefined') { + payload['targets'] = targets; + } + if (typeof draft !== 'undefined') { + payload['draft'] = draft; + } + if (typeof scheduledAt !== 'undefined') { + payload['scheduledAt'] = scheduledAt; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Update an SMS message by its unique ID. This endpoint only works on * messages that are in draft status. Messages that are already processing, @@ -475,6 +532,7 @@ export class Messaging extends Service { * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateSMS` instead. */ async updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> { if (typeof messageId === 'undefined') { @@ -512,6 +570,58 @@ export class Messaging extends Service { 'json' ); } + /** + * Update an SMS message by its unique ID. This endpoint only works on + * messages that are in draft status. Messages that are already processing, + * sent, or failed cannot be updated. + * + * + * @param {string} messageId + * @param {string[]} topics + * @param {string[]} users + * @param {string[]} targets + * @param {string} content + * @param {boolean} draft + * @param {string} scheduledAt + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateSMS(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> { + if (typeof messageId === 'undefined') { + throw new AppwriteException('Missing required parameter: "messageId"'); + } + + const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId); + const payload: Payload = {}; + + if (typeof topics !== 'undefined') { + payload['topics'] = topics; + } + if (typeof users !== 'undefined') { + payload['users'] = users; + } + if (typeof targets !== 'undefined') { + payload['targets'] = targets; + } + if (typeof content !== 'undefined') { + payload['content'] = content; + } + if (typeof draft !== 'undefined') { + payload['draft'] = draft; + } + if (typeof scheduledAt !== 'undefined') { + payload['scheduledAt'] = scheduledAt; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Get a message by its unique ID. * @@ -663,6 +773,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateAPNSProvider` instead. */ async createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -710,6 +821,66 @@ export class Messaging extends Service { 'json' ); } + /** + * Create a new Apple Push Notification service provider. + * + * @param {string} providerId + * @param {string} name + * @param {string} authKey + * @param {string} authKeyId + * @param {string} teamId + * @param {string} bundleId + * @param {boolean} sandbox + * @param {boolean} enabled + * @throws {AppwriteException} + * @returns {Promise} + */ + async createAPNSProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider> { + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/messaging/providers/apns'; + const payload: Payload = {}; + + if (typeof providerId !== 'undefined') { + payload['providerId'] = providerId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof authKey !== 'undefined') { + payload['authKey'] = authKey; + } + if (typeof authKeyId !== 'undefined') { + payload['authKeyId'] = authKeyId; + } + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + if (typeof bundleId !== 'undefined') { + payload['bundleId'] = bundleId; + } + if (typeof sandbox !== 'undefined') { + payload['sandbox'] = sandbox; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Update a Apple Push Notification service provider by its unique ID. * @@ -723,6 +894,7 @@ export class Messaging extends Service { * @param {boolean} sandbox * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateAPNSProvider` instead. */ async updateApnsProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -763,6 +935,59 @@ export class Messaging extends Service { 'json' ); } + /** + * Update a Apple Push Notification service provider by its unique ID. + * + * @param {string} providerId + * @param {string} name + * @param {boolean} enabled + * @param {string} authKey + * @param {string} authKeyId + * @param {string} teamId + * @param {string} bundleId + * @param {boolean} sandbox + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateAPNSProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider> { + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof authKey !== 'undefined') { + payload['authKey'] = authKey; + } + if (typeof authKeyId !== 'undefined') { + payload['authKeyId'] = authKeyId; + } + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + if (typeof bundleId !== 'undefined') { + payload['bundleId'] = bundleId; + } + if (typeof sandbox !== 'undefined') { + payload['sandbox'] = sandbox; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Create a new Firebase Cloud Messaging provider. * @@ -772,6 +997,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateFCMProvider` instead. */ async createFcmProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -807,6 +1033,50 @@ export class Messaging extends Service { 'json' ); } + /** + * Create a new Firebase Cloud Messaging provider. + * + * @param {string} providerId + * @param {string} name + * @param {object} serviceAccountJSON + * @param {boolean} enabled + * @throws {AppwriteException} + * @returns {Promise} + */ + async createFCMProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider> { + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/messaging/providers/fcm'; + const payload: Payload = {}; + + if (typeof providerId !== 'undefined') { + payload['providerId'] = providerId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof serviceAccountJSON !== 'undefined') { + payload['serviceAccountJSON'] = serviceAccountJSON; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Update a Firebase Cloud Messaging provider by its unique ID. * @@ -816,6 +1086,7 @@ export class Messaging extends Service { * @param {object} serviceAccountJSON * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateFCMProvider` instead. */ async updateFcmProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -844,6 +1115,43 @@ export class Messaging extends Service { 'json' ); } + /** + * Update a Firebase Cloud Messaging provider by its unique ID. + * + * @param {string} providerId + * @param {string} name + * @param {boolean} enabled + * @param {object} serviceAccountJSON + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateFCMProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider> { + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof serviceAccountJSON !== 'undefined') { + payload['serviceAccountJSON'] = serviceAccountJSON; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Create a new Mailgun provider. * @@ -1202,6 +1510,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateSMTPProvider` instead. */ async createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -1271,6 +1580,94 @@ export class Messaging extends Service { 'json' ); } + /** + * Create a new SMTP provider. + * + * @param {string} providerId + * @param {string} name + * @param {string} host + * @param {number} port + * @param {string} username + * @param {string} password + * @param {SmtpEncryption} encryption + * @param {boolean} autoTLS + * @param {string} mailer + * @param {string} fromName + * @param {string} fromEmail + * @param {string} replyToName + * @param {string} replyToEmail + * @param {boolean} enabled + * @throws {AppwriteException} + * @returns {Promise} + */ + async createSMTPProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> { + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + if (typeof host === 'undefined') { + throw new AppwriteException('Missing required parameter: "host"'); + } + + const apiPath = '/messaging/providers/smtp'; + const payload: Payload = {}; + + if (typeof providerId !== 'undefined') { + payload['providerId'] = providerId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof host !== 'undefined') { + payload['host'] = host; + } + if (typeof port !== 'undefined') { + payload['port'] = port; + } + if (typeof username !== 'undefined') { + payload['username'] = username; + } + if (typeof password !== 'undefined') { + payload['password'] = password; + } + if (typeof encryption !== 'undefined') { + payload['encryption'] = encryption; + } + if (typeof autoTLS !== 'undefined') { + payload['autoTLS'] = autoTLS; + } + if (typeof mailer !== 'undefined') { + payload['mailer'] = mailer; + } + if (typeof fromName !== 'undefined') { + payload['fromName'] = fromName; + } + if (typeof fromEmail !== 'undefined') { + payload['fromEmail'] = fromEmail; + } + if (typeof replyToName !== 'undefined') { + payload['replyToName'] = replyToName; + } + if (typeof replyToEmail !== 'undefined') { + payload['replyToEmail'] = replyToEmail; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Update a SMTP provider by its unique ID. * @@ -1290,6 +1687,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateSMTPProvider` instead. */ async updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -1348,6 +1746,83 @@ export class Messaging extends Service { 'json' ); } + /** + * Update a SMTP provider by its unique ID. + * + * @param {string} providerId + * @param {string} name + * @param {string} host + * @param {number} port + * @param {string} username + * @param {string} password + * @param {SmtpEncryption} encryption + * @param {boolean} autoTLS + * @param {string} mailer + * @param {string} fromName + * @param {string} fromEmail + * @param {string} replyToName + * @param {string} replyToEmail + * @param {boolean} enabled + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateSMTPProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> { + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof host !== 'undefined') { + payload['host'] = host; + } + if (typeof port !== 'undefined') { + payload['port'] = port; + } + if (typeof username !== 'undefined') { + payload['username'] = username; + } + if (typeof password !== 'undefined') { + payload['password'] = password; + } + if (typeof encryption !== 'undefined') { + payload['encryption'] = encryption; + } + if (typeof autoTLS !== 'undefined') { + payload['autoTLS'] = autoTLS; + } + if (typeof mailer !== 'undefined') { + payload['mailer'] = mailer; + } + if (typeof fromName !== 'undefined') { + payload['fromName'] = fromName; + } + if (typeof fromEmail !== 'undefined') { + payload['fromEmail'] = fromEmail; + } + if (typeof replyToName !== 'undefined') { + payload['replyToName'] = replyToName; + } + if (typeof replyToEmail !== 'undefined') { + payload['replyToEmail'] = replyToEmail; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Create a new Telesign provider. * diff --git a/src/services/tables-db.ts b/src/services/tables-d-b.ts similarity index 99% rename from src/services/tables-db.ts rename to src/services/tables-d-b.ts index 7377b3d..c7d79c7 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-d-b.ts @@ -17,7 +17,7 @@ export type UploadProgress = { chunksUploaded: number; } -export class TablesDb extends Service { +export class TablesDB extends Service { constructor(client: Client) { @@ -221,7 +221,7 @@ export class TablesDb extends Service { /** * Create a new Table. Before using this route, you should create a new * database resource using either a [server - * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) * API or directly from your database console. * * @param {string} databaseId @@ -1873,7 +1873,7 @@ export class TablesDb extends Service { /** * Create a new Row. Before using this route, you should create a new table * resource using either a [server - * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) * API or directly from your database console. * * @param {string} databaseId @@ -1926,7 +1926,7 @@ export class TablesDb extends Service { /** * Create new Rows. Before using this route, you should create a new table * resource using either a [server - * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) * API or directly from your database console. * * @param {string} databaseId @@ -1967,7 +1967,7 @@ export class TablesDb extends Service { /** * Create or update Rows. Before using this route, you should create a new * table resource using either a [server - * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) * API or directly from your database console. * * @@ -2123,7 +2123,7 @@ export class TablesDb extends Service { /** * Create or update a Row. Before using this route, you should create a new * table resource using either a [server - * integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + * integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) * API or directly from your database console. * * @param {string} databaseId diff --git a/src/services/users.ts b/src/services/users.ts index 3805fe1..808f034 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -808,6 +808,7 @@ export class Users extends Service { * @param {boolean} mfa * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFA` instead. */ async updateMfa<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>> { if (typeof userId === 'undefined') { @@ -834,6 +835,39 @@ export class Users extends Service { 'json' ); } + /** + * Enable or disable MFA on a user account. + * + * @param {string} userId + * @param {boolean} mfa + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateMFA<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>> { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + if (typeof mfa === 'undefined') { + throw new AppwriteException('Missing required parameter: "mfa"'); + } + + const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId); + const payload: Payload = {}; + + if (typeof mfa !== 'undefined') { + payload['mfa'] = mfa; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Delete an authenticator app. * @@ -841,6 +875,7 @@ export class Users extends Service { * @param {AuthenticatorType} type * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead. */ async deleteMfaAuthenticator(userId: string, type: AuthenticatorType): Promise<Response> { if (typeof userId === 'undefined') { @@ -864,12 +899,43 @@ export class Users extends Service { 'json' ); } + /** + * Delete an authenticator app. + * + * @param {string} userId + * @param {AuthenticatorType} type + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteMFAAuthenticator(userId: string, type: AuthenticatorType): Promise<Response> { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + + const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type); + const payload: Payload = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * List the factors available on the account to be used as a MFA challange. * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead. */ async listMfaFactors(userId: string): Promise<Models.MfaFactors> { if (typeof userId === 'undefined') { @@ -888,6 +954,30 @@ export class Users extends Service { 'json' ); } + /** + * List the factors available on the account to be used as a MFA challange. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + async listMFAFactors(userId: string): Promise<Models.MfaFactors> { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId); + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } /** * Get recovery codes that can be used as backup for MFA flow by User ID. * Before getting codes, they must be generated using @@ -897,6 +987,7 @@ export class Users extends Service { * @param {string} userId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead. */ async getMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { if (typeof userId === 'undefined') { @@ -915,6 +1006,33 @@ export class Users extends Service { 'json' ); } + /** + * Get recovery codes that can be used as backup for MFA flow by User ID. + * Before getting codes, they must be generated using + * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + * method. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + async getMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } /** * Regenerate recovery codes that can be used as backup for MFA flow by User * ID. Before regenerating codes, they must be first generated using @@ -924,6 +1042,7 @@ export class Users extends Service { * @param {string} userId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead. */ async updateMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { if (typeof userId === 'undefined') { @@ -943,6 +1062,34 @@ export class Users extends Service { 'json' ); } + /** + * Regenerate recovery codes that can be used as backup for MFA flow by User + * ID. Before regenerating codes, they must be first generated using + * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + * method. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const payload: Payload = {}; + + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Generate recovery codes used as backup for MFA flow for User ID. Recovery * codes can be used as a MFA verification type in @@ -952,6 +1099,7 @@ export class Users extends Service { * @param {string} userId * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead. */ async createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { if (typeof userId === 'undefined') { @@ -971,6 +1119,34 @@ export class Users extends Service { 'json' ); } + /** + * Generate recovery codes used as backup for MFA flow for User ID. Recovery + * codes can be used as a MFA verification type in + * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) + * method by client SDK. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + async createMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const payload: Payload = {}; + + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Update the user name by its unique ID. * diff --git a/test/services/account.test.ts b/test/services/account.test.ts index f558689..a6df744 100644 --- a/test/services/account.test.ts +++ b/test/services/account.test.ts @@ -209,6 +209,22 @@ describe('Account service', () => { }); + test('test method createMFAAuthenticator()', async () => { + const data = { + 'secret': '1', + 'uri': '1',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.createMFAAuthenticator( + 'totp', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateMfaAuthenticator()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -240,6 +256,37 @@ describe('Account service', () => { }); + test('test method updateMFAAuthenticator()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'John Doe', + 'registration': '2020-10-15T06:38:00.000+00:00', + 'status': true, + 'labels': [], + 'passwordUpdate': '2020-10-15T06:38:00.000+00:00', + 'email': 'john@appwrite.io', + 'phone': '+4930901820', + 'emailVerification': true, + 'phoneVerification': true, + 'mfa': true, + 'prefs': {}, + 'targets': [], + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.updateMFAAuthenticator( + 'totp', + '<OTP>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method deleteMfaAuthenticator()', async () => { const data = ''; @@ -255,6 +302,21 @@ describe('Account service', () => { }); + test('test method deleteMFAAuthenticator()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await account.deleteMFAAuthenticator( + 'totp', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + test('test method createMfaChallenge()', async () => { const data = { '\$id': 'bb8ea5c16897e', @@ -273,6 +335,24 @@ describe('Account service', () => { }); + test('test method createMFAChallenge()', async () => { + const data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c168bb8', + 'expire': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.createMFAChallenge( + 'email', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateMfaChallenge()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -317,6 +397,50 @@ describe('Account service', () => { }); + test('test method updateMFAChallenge()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5bb8c16897e', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'provider': 'email', + 'providerUid': 'user@example.com', + 'providerAccessToken': 'MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3', + 'providerAccessTokenExpiry': '2020-10-15T06:38:00.000+00:00', + 'providerRefreshToken': 'MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3', + 'ip': '127.0.0.1', + 'osCode': 'Mac', + 'osName': 'Mac', + 'osVersion': 'Mac', + 'clientType': 'browser', + 'clientCode': 'CM', + 'clientName': 'Chrome Mobile iOS', + 'clientVersion': '84.0', + 'clientEngine': 'WebKit', + 'clientEngineVersion': '605.1.15', + 'deviceName': 'smartphone', + 'deviceBrand': 'Google', + 'deviceModel': 'Nexus 5', + 'countryCode': 'US', + 'countryName': 'United States', + 'current': true, + 'factors': [], + 'secret': '5e5bb8c16897e', + 'mfaUpdatedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.updateMFAChallenge( + '<CHALLENGE_ID>', + '<OTP>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method listMfaFactors()', async () => { const data = { 'totp': true, @@ -334,6 +458,23 @@ describe('Account service', () => { }); + test('test method listMFAFactors()', async () => { + const data = { + 'totp': true, + 'phone': true, + 'email': true, + 'recoveryCode': true,}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.listMFAFactors( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method getMfaRecoveryCodes()', async () => { const data = { 'recoveryCodes': [],}; @@ -348,6 +489,20 @@ describe('Account service', () => { }); + test('test method getMFARecoveryCodes()', async () => { + const data = { + 'recoveryCodes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.getMFARecoveryCodes( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method createMfaRecoveryCodes()', async () => { const data = { 'recoveryCodes': [],}; @@ -362,6 +517,20 @@ describe('Account service', () => { }); + test('test method createMFARecoveryCodes()', async () => { + const data = { + 'recoveryCodes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.createMFARecoveryCodes( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateMfaRecoveryCodes()', async () => { const data = { 'recoveryCodes': [],}; @@ -376,6 +545,20 @@ describe('Account service', () => { }); + test('test method updateMFARecoveryCodes()', async () => { + const data = { + 'recoveryCodes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await account.updateMFARecoveryCodes( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateName()', async () => { const data = { '\$id': '5e5ea5c16897e', diff --git a/test/services/messaging.test.ts b/test/services/messaging.test.ts index 0631ffd..f427559 100644 --- a/test/services/messaging.test.ts +++ b/test/services/messaging.test.ts @@ -150,6 +150,31 @@ describe('Messaging service', () => { }); + test('test method createSMS()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'providerType': 'email', + 'topics': [], + 'users': [], + 'targets': [], + 'deliveredTotal': 1, + 'data': {}, + 'status': 'Message status can be one of the following: draft, processing, scheduled, sent, or failed.',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.createSMS( + '<MESSAGE_ID>', + '<CONTENT>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateSms()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -174,6 +199,30 @@ describe('Messaging service', () => { }); + test('test method updateSMS()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'providerType': 'email', + 'topics': [], + 'users': [], + 'targets': [], + 'deliveredTotal': 1, + 'data': {}, + 'status': 'Message status can be one of the following: draft, processing, scheduled, sent, or failed.',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.updateSMS( + '<MESSAGE_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method getMessage()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -283,6 +332,29 @@ describe('Messaging service', () => { }); + test('test method createAPNSProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.createAPNSProvider( + '<PROVIDER_ID>', + '<NAME>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateApnsProvider()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -305,6 +377,28 @@ describe('Messaging service', () => { }); + test('test method updateAPNSProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.updateAPNSProvider( + '<PROVIDER_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method createFcmProvider()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -328,6 +422,29 @@ describe('Messaging service', () => { }); + test('test method createFCMProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.createFCMProvider( + '<PROVIDER_ID>', + '<NAME>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateFcmProvider()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -350,6 +467,28 @@ describe('Messaging service', () => { }); + test('test method updateFCMProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.updateFCMProvider( + '<PROVIDER_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method createMailgunProvider()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -509,6 +648,30 @@ describe('Messaging service', () => { }); + test('test method createSMTPProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.createSMTPProvider( + '<PROVIDER_ID>', + '<NAME>', + '<HOST>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateSmtpProvider()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -531,6 +694,28 @@ describe('Messaging service', () => { }); + test('test method updateSMTPProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await messaging.updateSMTPProvider( + '<PROVIDER_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method createTelesignProvider()', async () => { const data = { '\$id': '5e5ea5c16897e', diff --git a/test/services/tables-db.test.ts b/test/services/tables-d-b.test.ts similarity index 91% rename from test/services/tables-db.test.ts rename to test/services/tables-d-b.test.ts index 4b07462..25f7054 100644 --- a/test/services/tables-db.test.ts +++ b/test/services/tables-d-b.test.ts @@ -1,13 +1,13 @@ import {afterEach, describe, it as test} from "https://deno.land/std@0.204.0/testing/bdd.ts"; import {restore, stub} from "https://deno.land/std@0.204.0/testing/mock.ts"; import {assertEquals} from "https://deno.land/std@0.204.0/assert/assert_equals.ts"; -import { TablesDb } from "../../src/services/tablesDb.ts"; +import { TablesDB } from "../../src/services/tablesDB.ts"; import {Client} from "../../src/client.ts"; import {InputFile} from "../../src/inputFile.ts" -describe('TablesDb service', () => { +describe('TablesDB service', () => { const client = new Client(); - const tablesDb = new TablesDb(client); + const tablesDB = new TablesDB(client); afterEach(() => restore()) @@ -19,7 +19,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.list( + const response = await tablesDB.list( ); assertEquals(response, data); @@ -38,7 +38,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.create( + const response = await tablesDB.create( '<DATABASE_ID>', '<NAME>', ); @@ -59,7 +59,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.get( + const response = await tablesDB.get( '<DATABASE_ID>', ); @@ -79,7 +79,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.update( + const response = await tablesDB.update( '<DATABASE_ID>', '<NAME>', ); @@ -94,7 +94,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) - const response = await tablesDb.delete( + const response = await tablesDB.delete( '<DATABASE_ID>', ); @@ -111,7 +111,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.listTables( + const response = await tablesDB.listTables( '<DATABASE_ID>', ); @@ -135,7 +135,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createTable( + const response = await tablesDB.createTable( '<DATABASE_ID>', '<TABLE_ID>', '<NAME>', @@ -161,7 +161,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.getTable( + const response = await tablesDB.getTable( '<DATABASE_ID>', '<TABLE_ID>', ); @@ -186,7 +186,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateTable( + const response = await tablesDB.updateTable( '<DATABASE_ID>', '<TABLE_ID>', '<NAME>', @@ -202,7 +202,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) - const response = await tablesDb.deleteTable( + const response = await tablesDB.deleteTable( '<DATABASE_ID>', '<TABLE_ID>', ); @@ -220,7 +220,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.listColumns( + const response = await tablesDB.listColumns( '<DATABASE_ID>', '<TABLE_ID>', ); @@ -242,7 +242,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createBooleanColumn( + const response = await tablesDB.createBooleanColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -266,7 +266,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateBooleanColumn( + const response = await tablesDB.updateBooleanColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -292,7 +292,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createDatetimeColumn( + const response = await tablesDB.createDatetimeColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -317,7 +317,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateDatetimeColumn( + const response = await tablesDB.updateDatetimeColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -343,7 +343,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createEmailColumn( + const response = await tablesDB.createEmailColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -368,7 +368,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateEmailColumn( + const response = await tablesDB.updateEmailColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -395,7 +395,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createEnumColumn( + const response = await tablesDB.createEnumColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -422,7 +422,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateEnumColumn( + const response = await tablesDB.updateEnumColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -448,7 +448,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createFloatColumn( + const response = await tablesDB.createFloatColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -472,7 +472,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateFloatColumn( + const response = await tablesDB.updateFloatColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -497,7 +497,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createIntegerColumn( + const response = await tablesDB.createIntegerColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -521,7 +521,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateIntegerColumn( + const response = await tablesDB.updateIntegerColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -547,7 +547,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createIpColumn( + const response = await tablesDB.createIpColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -572,7 +572,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateIpColumn( + const response = await tablesDB.updateIpColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -603,7 +603,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createRelationshipColumn( + const response = await tablesDB.createRelationshipColumn( '<DATABASE_ID>', '<TABLE_ID>', '<RELATED_TABLE_ID>', @@ -628,7 +628,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createStringColumn( + const response = await tablesDB.createStringColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -654,7 +654,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateStringColumn( + const response = await tablesDB.updateStringColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -680,7 +680,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createUrlColumn( + const response = await tablesDB.createUrlColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -705,7 +705,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateUrlColumn( + const response = await tablesDB.updateUrlColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -723,7 +723,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) - const response = await tablesDb.getColumn( + const response = await tablesDB.getColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -740,7 +740,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) - const response = await tablesDb.deleteColumn( + const response = await tablesDB.deleteColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -770,7 +770,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateRelationshipColumn( + const response = await tablesDB.updateRelationshipColumn( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -788,7 +788,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.listIndexes( + const response = await tablesDB.listIndexes( '<DATABASE_ID>', '<TABLE_ID>', ); @@ -812,7 +812,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createIndex( + const response = await tablesDB.createIndex( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -839,7 +839,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.getIndex( + const response = await tablesDB.getIndex( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -855,7 +855,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) - const response = await tablesDb.deleteIndex( + const response = await tablesDB.deleteIndex( '<DATABASE_ID>', '<TABLE_ID>', '', @@ -874,7 +874,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.listRows( + const response = await tablesDB.listRows( '<DATABASE_ID>', '<TABLE_ID>', ); @@ -896,7 +896,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createRow( + const response = await tablesDB.createRow( '<DATABASE_ID>', '<TABLE_ID>', '<ROW_ID>', @@ -915,7 +915,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.createRows( + const response = await tablesDB.createRows( '<DATABASE_ID>', '<TABLE_ID>', [], @@ -933,7 +933,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.upsertRows( + const response = await tablesDB.upsertRows( '<DATABASE_ID>', '<TABLE_ID>', [], @@ -951,7 +951,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateRows( + const response = await tablesDB.updateRows( '<DATABASE_ID>', '<TABLE_ID>', ); @@ -968,7 +968,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.deleteRows( + const response = await tablesDB.deleteRows( '<DATABASE_ID>', '<TABLE_ID>', ); @@ -990,7 +990,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.getRow( + const response = await tablesDB.getRow( '<DATABASE_ID>', '<TABLE_ID>', '<ROW_ID>', @@ -1013,7 +1013,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.upsertRow( + const response = await tablesDB.upsertRow( '<DATABASE_ID>', '<TABLE_ID>', '<ROW_ID>', @@ -1036,7 +1036,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.updateRow( + const response = await tablesDB.updateRow( '<DATABASE_ID>', '<TABLE_ID>', '<ROW_ID>', @@ -1052,7 +1052,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) - const response = await tablesDb.deleteRow( + const response = await tablesDB.deleteRow( '<DATABASE_ID>', '<TABLE_ID>', '<ROW_ID>', @@ -1076,7 +1076,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.decrementRowColumn( + const response = await tablesDB.decrementRowColumn( '<DATABASE_ID>', '<TABLE_ID>', '<ROW_ID>', @@ -1100,7 +1100,7 @@ describe('TablesDb service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await tablesDb.incrementRowColumn( + const response = await tablesDB.incrementRowColumn( '<DATABASE_ID>', '<TABLE_ID>', '<ROW_ID>', diff --git a/test/services/users.test.ts b/test/services/users.test.ts index 374732e..f5e0de6 100644 --- a/test/services/users.test.ts +++ b/test/services/users.test.ts @@ -504,6 +504,37 @@ describe('Users service', () => { }); + test('test method updateMFA()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'John Doe', + 'registration': '2020-10-15T06:38:00.000+00:00', + 'status': true, + 'labels': [], + 'passwordUpdate': '2020-10-15T06:38:00.000+00:00', + 'email': 'john@appwrite.io', + 'phone': '+4930901820', + 'emailVerification': true, + 'phoneVerification': true, + 'mfa': true, + 'prefs': {}, + 'targets': [], + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await users.updateMFA( + '<USER_ID>', + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method deleteMfaAuthenticator()', async () => { const data = ''; @@ -520,6 +551,22 @@ describe('Users service', () => { }); + test('test method deleteMFAAuthenticator()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await users.deleteMFAAuthenticator( + '<USER_ID>', + 'totp', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + test('test method listMfaFactors()', async () => { const data = { 'totp': true, @@ -538,6 +585,24 @@ describe('Users service', () => { }); + test('test method listMFAFactors()', async () => { + const data = { + 'totp': true, + 'phone': true, + 'email': true, + 'recoveryCode': true,}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await users.listMFAFactors( + '<USER_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method getMfaRecoveryCodes()', async () => { const data = { 'recoveryCodes': [],}; @@ -553,6 +618,21 @@ describe('Users service', () => { }); + test('test method getMFARecoveryCodes()', async () => { + const data = { + 'recoveryCodes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await users.getMFARecoveryCodes( + '<USER_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateMfaRecoveryCodes()', async () => { const data = { 'recoveryCodes': [],}; @@ -568,6 +648,21 @@ describe('Users service', () => { }); + test('test method updateMFARecoveryCodes()', async () => { + const data = { + 'recoveryCodes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await users.updateMFARecoveryCodes( + '<USER_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method createMfaRecoveryCodes()', async () => { const data = { 'recoveryCodes': [],}; @@ -583,6 +678,21 @@ describe('Users service', () => { }); + test('test method createMFARecoveryCodes()', async () => { + const data = { + 'recoveryCodes': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await users.createMFARecoveryCodes( + '<USER_ID>', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method updateName()', async () => { const data = { '\$id': '5e5ea5c16897e', From b5fe2bd07375c8e95942306b94e9214a2361ef66 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Sat, 23 Aug 2025 20:10:44 +1200 Subject: [PATCH 5/8] Add 1.8.x support --- src/models.d.ts | 4 ++++ src/services/account.ts | 8 ++++++-- test/services/functions.test.ts | 2 ++ test/services/sites.test.ts | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/models.d.ts b/src/models.d.ts index f0ed180..4a448e9 100644 --- a/src/models.d.ts +++ b/src/models.d.ts @@ -2922,6 +2922,10 @@ export namespace Models { * Function ID. */ functionId: string; + /** + * Function's deployment ID used to create the execution. + */ + deploymentId: string; /** * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. */ diff --git a/src/services/account.ts b/src/services/account.ts index 9f642eb..eb9b1db 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1343,8 +1343,11 @@ export class Account extends Service { } /** * Sends the user an email with a secret key for creating a session. If the - * provided user ID has not be registered, a new user will be created. Use the - * returned user ID and secret and submit a request to the [POST + * email address has never been used, a **new account is created** using the + * provided `userId`. Otherwise, if the email address is already attached to + * an account, the **user ID is ignored**. Then, the user will receive an + * email with the one-time password. Use the returned user ID and secret and + * submit a request to the [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. The secret sent to the user's email * is valid for 15 minutes. @@ -1352,6 +1355,7 @@ export class Account extends Service { * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). + * * * @param {string} userId * @param {string} email diff --git a/test/services/functions.test.ts b/test/services/functions.test.ts index cd16ee0..edce7f2 100644 --- a/test/services/functions.test.ts +++ b/test/services/functions.test.ts @@ -572,6 +572,7 @@ describe('Functions service', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', '\$permissions': [], 'functionId': '5e5ea6g16897e', + 'deploymentId': '5e5ea5c16897e', 'trigger': 'http', 'status': 'processing', 'requestMethod': 'GET', @@ -602,6 +603,7 @@ describe('Functions service', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', '\$permissions': [], 'functionId': '5e5ea6g16897e', + 'deploymentId': '5e5ea5c16897e', 'trigger': 'http', 'status': 'processing', 'requestMethod': 'GET', diff --git a/test/services/sites.test.ts b/test/services/sites.test.ts index 1dd1116..a1c1a8c 100644 --- a/test/services/sites.test.ts +++ b/test/services/sites.test.ts @@ -578,6 +578,7 @@ describe('Sites service', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', '\$permissions': [], 'functionId': '5e5ea6g16897e', + 'deploymentId': '5e5ea5c16897e', 'trigger': 'http', 'status': 'processing', 'requestMethod': 'GET', From 7cef5a5e76ac7a2130b446f19c4c9cfef4c11fb1 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Sat, 23 Aug 2025 22:16:19 +1200 Subject: [PATCH 6/8] Add 1.8.x support --- src/models.d.ts | 16 ++++++++-------- src/services/account.ts | 18 +++++++++--------- src/services/messaging.ts | 16 ++++++++-------- src/services/users.ts | 12 ++++++------ 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/models.d.ts b/src/models.d.ts index 4a448e9..cc6b414 100644 --- a/src/models.d.ts +++ b/src/models.d.ts @@ -1171,7 +1171,7 @@ export namespace Models { */ max?: number; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ xdefault?: number; } @@ -1220,7 +1220,7 @@ export namespace Models { */ max?: number; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ xdefault?: number; } @@ -1261,7 +1261,7 @@ export namespace Models { */ $updatedAt: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ xdefault?: boolean; } @@ -1306,7 +1306,7 @@ export namespace Models { */ format: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ xdefault?: string; } @@ -1355,7 +1355,7 @@ export namespace Models { */ format: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ xdefault?: string; } @@ -1400,7 +1400,7 @@ export namespace Models { */ format: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ xdefault?: string; } @@ -1490,7 +1490,7 @@ export namespace Models { */ format: string; /** - * Default value for attribute when not provided. Only null is optional + * Default value for column when not provided. Only null is optional */ xdefault?: string; } @@ -2911,7 +2911,7 @@ export namespace Models { */ $createdAt: string; /** - * Execution upate date in ISO 8601 format. + * Execution update date in ISO 8601 format. */ $updatedAt: string; /** diff --git a/src/services/account.ts b/src/services/account.ts index eb9b1db..857bb26 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -275,7 +275,7 @@ export class Account extends Service { * @param {AuthenticatorType} type * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFAAuthenticator` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAAuthenticator` instead. */ async createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> { if (typeof type === 'undefined') { @@ -332,7 +332,7 @@ export class Account extends Service { * @param {string} otp * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFAAuthenticator` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead. */ async updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> { if (typeof type === 'undefined') { @@ -400,7 +400,7 @@ export class Account extends Service { * @param {AuthenticatorType} type * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.deleteMFAAuthenticator` instead. */ async deleteMfaAuthenticator(type: AuthenticatorType): Promise<Response> { if (typeof type === 'undefined') { @@ -453,7 +453,7 @@ export class Account extends Service { * @param {AuthenticationFactor} factor * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFAChallenge` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead. */ async createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> { if (typeof factor === 'undefined') { @@ -517,7 +517,7 @@ export class Account extends Service { * @param {string} otp * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFAChallenge` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFAChallenge` instead. */ async updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session> { if (typeof challengeId === 'undefined') { @@ -592,7 +592,7 @@ export class Account extends Service { * * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.listMFAFactors` instead. */ async listMfaFactors(): Promise<Models.MfaFactors> { const apiPath = '/account/mfa/factors'; @@ -634,7 +634,7 @@ export class Account extends Service { * * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.getMFARecoveryCodes` instead. */ async getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> { const apiPath = '/account/mfa/recovery-codes'; @@ -680,7 +680,7 @@ export class Account extends Service { * * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFARecoveryCodes` instead. */ async createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> { const apiPath = '/account/mfa/recovery-codes'; @@ -728,7 +728,7 @@ export class Account extends Service { * * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFARecoveryCodes` instead. */ async updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> { const apiPath = '/account/mfa/recovery-codes'; diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 2223c5d..0e89fef 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -416,7 +416,7 @@ export class Messaging extends Service { * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateSMS` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMS` instead. */ async createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message> { if (typeof messageId === 'undefined') { @@ -532,7 +532,7 @@ export class Messaging extends Service { * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateSMS` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMS` instead. */ async updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> { if (typeof messageId === 'undefined') { @@ -773,7 +773,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateAPNSProvider` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createAPNSProvider` instead. */ async createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -894,7 +894,7 @@ export class Messaging extends Service { * @param {boolean} sandbox * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateAPNSProvider` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateAPNSProvider` instead. */ async updateApnsProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -997,7 +997,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateFCMProvider` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createFCMProvider` instead. */ async createFcmProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -1086,7 +1086,7 @@ export class Messaging extends Service { * @param {object} serviceAccountJSON * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateFCMProvider` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateFCMProvider` instead. */ async updateFcmProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -1510,7 +1510,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateSMTPProvider` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMTPProvider` instead. */ async createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { @@ -1687,7 +1687,7 @@ export class Messaging extends Service { * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateSMTPProvider` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead. */ async updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> { if (typeof providerId === 'undefined') { diff --git a/src/services/users.ts b/src/services/users.ts index 808f034..339a5d0 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -808,7 +808,7 @@ export class Users extends Service { * @param {boolean} mfa * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFA` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead. */ async updateMfa<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>> { if (typeof userId === 'undefined') { @@ -875,7 +875,7 @@ export class Users extends Service { * @param {AuthenticatorType} type * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead. */ async deleteMfaAuthenticator(userId: string, type: AuthenticatorType): Promise<Response> { if (typeof userId === 'undefined') { @@ -935,7 +935,7 @@ export class Users extends Service { * @param {string} userId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead. */ async listMfaFactors(userId: string): Promise<Models.MfaFactors> { if (typeof userId === 'undefined') { @@ -987,7 +987,7 @@ export class Users extends Service { * @param {string} userId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Users.getMFARecoveryCodes` instead. */ async getMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { if (typeof userId === 'undefined') { @@ -1042,7 +1042,7 @@ export class Users extends Service { * @param {string} userId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFARecoveryCodes` instead. */ async updateMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { if (typeof userId === 'undefined') { @@ -1099,7 +1099,7 @@ export class Users extends Service { * @param {string} userId * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead. + * @deprecated This API has been deprecated since 1.8.0. Please use `Users.createMFARecoveryCodes` instead. */ async createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> { if (typeof userId === 'undefined') { From 6df930e31cf9ed51b8e5403e739d0fa64ebba640 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Tue, 26 Aug 2025 04:23:58 +1200 Subject: [PATCH 7/8] Fix docs --- docs/examples/account/create-email-token.md | 2 +- .../{create-j-w-t.md => create-jwt.md} | 0 .../account/create-m-f-a-authenticator.md | 12 ------- .../account/create-m-f-a-challenge.md | 11 ------ .../account/create-m-f-a-recovery-codes.md | 10 ------ ...r-l-token.md => create-magic-url-token.md} | 4 +-- .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- ...auth2token.md => create-o-auth-2-token.md} | 6 ++-- docs/examples/account/create.md | 2 +- .../account/delete-m-f-a-authenticator.md | 12 ------- .../account/delete-mfa-authenticator.md | 2 +- .../account/get-m-f-a-recovery-codes.md | 10 ------ .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-m-f-a-factors.md | 10 ------ docs/examples/account/list-mfa-factors.md | 2 +- .../account/update-m-f-a-authenticator.md | 13 ------- .../account/update-m-f-a-challenge.md | 13 ------- .../account/update-m-f-a-recovery-codes.md | 10 ------ ...session.md => update-magic-url-session.md} | 0 .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- .../{update-m-f-a.md => update-mfa.md} | 0 docs/examples/account/update-password.md | 2 +- docs/examples/avatars/get-browser.md | 6 ++-- docs/examples/avatars/get-credit-card.md | 6 ++-- docs/examples/avatars/get-flag.md | 6 ++-- docs/examples/avatars/get-image.md | 4 +-- docs/examples/avatars/get-initials.md | 8 ++--- .../avatars/{get-q-r.md => get-qr.md} | 6 ++-- .../databases/create-boolean-attribute.md | 4 +-- docs/examples/databases/create-collection.md | 6 ++-- .../databases/create-datetime-attribute.md | 4 +-- docs/examples/databases/create-document.md | 2 +- .../databases/create-email-attribute.md | 4 +-- .../databases/create-enum-attribute.md | 4 +-- .../databases/create-float-attribute.md | 8 ++--- docs/examples/databases/create-index.md | 4 +-- .../databases/create-integer-attribute.md | 8 ++--- .../examples/databases/create-ip-attribute.md | 4 +-- .../create-relationship-attribute.md | 8 ++--- .../databases/create-string-attribute.md | 6 ++-- .../databases/create-url-attribute.md | 4 +-- docs/examples/databases/create.md | 2 +- .../databases/decrement-document-attribute.md | 4 +-- docs/examples/databases/delete-documents.md | 2 +- docs/examples/databases/get-document.md | 2 +- .../databases/increment-document-attribute.md | 4 +-- docs/examples/databases/list-attributes.md | 2 +- docs/examples/databases/list-collections.md | 4 +-- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 2 +- docs/examples/databases/list.md | 4 +-- .../databases/update-boolean-attribute.md | 2 +- docs/examples/databases/update-collection.md | 6 ++-- .../databases/update-datetime-attribute.md | 2 +- docs/examples/databases/update-document.md | 4 +-- docs/examples/databases/update-documents.md | 4 +-- .../databases/update-email-attribute.md | 2 +- .../databases/update-enum-attribute.md | 2 +- .../databases/update-float-attribute.md | 6 ++-- .../databases/update-integer-attribute.md | 6 ++-- .../examples/databases/update-ip-attribute.md | 2 +- .../update-relationship-attribute.md | 4 +-- .../databases/update-string-attribute.md | 4 +-- .../databases/update-url-attribute.md | 2 +- docs/examples/databases/update.md | 2 +- docs/examples/databases/upsert-document.md | 2 +- docs/examples/functions/create-deployment.md | 4 +-- .../functions/create-duplicate-deployment.md | 2 +- docs/examples/functions/create-execution.md | 12 +++---- .../functions/create-template-deployment.md | 2 +- docs/examples/functions/create-variable.md | 2 +- .../functions/create-vcs-deployment.md | 2 +- docs/examples/functions/create.md | 30 ++++++++-------- .../functions/get-deployment-download.md | 2 +- docs/examples/functions/list-deployments.md | 4 +-- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list.md | 4 +-- docs/examples/functions/update-variable.md | 4 +-- docs/examples/functions/update.md | 32 ++++++++--------- docs/examples/health/get-certificate.md | 2 +- .../examples/health/{get-d-b.md => get-db.md} | 0 docs/examples/health/get-failed-jobs.md | 2 +- docs/examples/health/get-queue-builds.md | 2 +- .../examples/health/get-queue-certificates.md | 2 +- docs/examples/health/get-queue-databases.md | 4 +-- docs/examples/health/get-queue-deletes.md | 2 +- docs/examples/health/get-queue-functions.md | 2 +- docs/examples/health/get-queue-logs.md | 2 +- docs/examples/health/get-queue-mails.md | 2 +- docs/examples/health/get-queue-messaging.md | 2 +- docs/examples/health/get-queue-migrations.md | 2 +- .../health/get-queue-stats-resources.md | 2 +- docs/examples/health/get-queue-usage.md | 2 +- docs/examples/health/get-queue-webhooks.md | 2 +- ...-countries-e-u.md => list-countries-eu.md} | 0 .../messaging/create-a-p-n-s-provider.md | 19 ---------- .../messaging/create-apns-provider.md | 14 ++++---- docs/examples/messaging/create-email.md | 18 +++++----- .../messaging/create-f-c-m-provider.md | 15 -------- .../examples/messaging/create-fcm-provider.md | 6 ++-- .../messaging/create-mailgun-provider.md | 16 ++++----- ...1provider.md => create-msg-91-provider.md} | 8 ++--- docs/examples/messaging/create-push.md | 36 +++++++++---------- docs/examples/messaging/create-s-m-s.md | 18 ---------- .../messaging/create-s-m-t-p-provider.md | 25 ------------- .../messaging/create-sendgrid-provider.md | 12 +++---- docs/examples/messaging/create-sms.md | 12 +++---- .../messaging/create-smtp-provider.md | 24 ++++++------- .../messaging/create-telesign-provider.md | 8 ++--- .../messaging/create-textmagic-provider.md | 8 ++--- docs/examples/messaging/create-topic.md | 2 +- .../messaging/create-twilio-provider.md | 8 ++--- .../messaging/create-vonage-provider.md | 8 ++--- docs/examples/messaging/list-message-logs.md | 2 +- docs/examples/messaging/list-messages.md | 4 +-- docs/examples/messaging/list-provider-logs.md | 2 +- docs/examples/messaging/list-providers.md | 4 +-- .../messaging/list-subscriber-logs.md | 2 +- docs/examples/messaging/list-subscribers.md | 4 +-- docs/examples/messaging/list-targets.md | 2 +- docs/examples/messaging/list-topic-logs.md | 2 +- docs/examples/messaging/list-topics.md | 4 +-- .../messaging/update-a-p-n-s-provider.md | 19 ---------- .../messaging/update-apns-provider.md | 16 ++++----- docs/examples/messaging/update-email.md | 22 ++++++------ .../messaging/update-f-c-m-provider.md | 15 -------- .../examples/messaging/update-fcm-provider.md | 8 ++--- .../messaging/update-mailgun-provider.md | 18 +++++----- ...1provider.md => update-msg-91-provider.md} | 10 +++--- docs/examples/messaging/update-push.md | 36 +++++++++---------- docs/examples/messaging/update-s-m-s.md | 18 ---------- .../messaging/update-s-m-t-p-provider.md | 25 ------------- .../messaging/update-sendgrid-provider.md | 14 ++++---- docs/examples/messaging/update-sms.md | 14 ++++---- .../messaging/update-smtp-provider.md | 28 +++++++-------- .../messaging/update-telesign-provider.md | 10 +++--- .../messaging/update-textmagic-provider.md | 10 +++--- docs/examples/messaging/update-topic.md | 4 +-- .../messaging/update-twilio-provider.md | 10 +++--- .../messaging/update-vonage-provider.md | 10 +++--- docs/examples/sites/create-deployment.md | 6 ++-- .../sites/create-template-deployment.md | 2 +- docs/examples/sites/create-variable.md | 2 +- docs/examples/sites/create-vcs-deployment.md | 2 +- docs/examples/sites/create.md | 28 +++++++-------- .../examples/sites/get-deployment-download.md | 2 +- docs/examples/sites/list-deployments.md | 4 +-- docs/examples/sites/list-logs.md | 2 +- docs/examples/sites/list.md | 4 +-- docs/examples/sites/update-variable.md | 4 +-- docs/examples/sites/update.md | 30 ++++++++-------- docs/examples/storage/create-bucket.md | 16 ++++----- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/get-file-download.md | 2 +- docs/examples/storage/get-file-preview.md | 24 ++++++------- docs/examples/storage/get-file-view.md | 2 +- docs/examples/storage/list-buckets.md | 4 +-- docs/examples/storage/list-files.md | 4 +-- docs/examples/storage/update-bucket.md | 16 ++++----- docs/examples/storage/update-file.md | 4 +-- .../tablesdb/create-boolean-column.md | 4 +-- .../tablesdb/create-datetime-column.md | 4 +-- docs/examples/tablesdb/create-email-column.md | 4 +-- docs/examples/tablesdb/create-enum-column.md | 4 +-- docs/examples/tablesdb/create-float-column.md | 8 ++--- docs/examples/tablesdb/create-index.md | 4 +-- .../tablesdb/create-integer-column.md | 8 ++--- docs/examples/tablesdb/create-ip-column.md | 4 +-- .../tablesdb/create-relationship-column.md | 8 ++--- docs/examples/tablesdb/create-row.md | 2 +- .../examples/tablesdb/create-string-column.md | 6 ++-- docs/examples/tablesdb/create-table.md | 6 ++-- docs/examples/tablesdb/create-url-column.md | 4 +-- docs/examples/tablesdb/create.md | 2 +- .../examples/tablesdb/decrement-row-column.md | 4 +-- docs/examples/tablesdb/delete-rows.md | 2 +- docs/examples/tablesdb/get-row.md | 2 +- .../examples/tablesdb/increment-row-column.md | 4 +-- docs/examples/tablesdb/list-columns.md | 2 +- docs/examples/tablesdb/list-indexes.md | 2 +- docs/examples/tablesdb/list-rows.md | 2 +- docs/examples/tablesdb/list-tables.md | 4 +-- docs/examples/tablesdb/list.md | 4 +-- .../tablesdb/update-boolean-column.md | 2 +- .../tablesdb/update-datetime-column.md | 2 +- docs/examples/tablesdb/update-email-column.md | 2 +- docs/examples/tablesdb/update-enum-column.md | 2 +- docs/examples/tablesdb/update-float-column.md | 6 ++-- .../tablesdb/update-integer-column.md | 6 ++-- docs/examples/tablesdb/update-ip-column.md | 2 +- .../tablesdb/update-relationship-column.md | 4 +-- docs/examples/tablesdb/update-row.md | 4 +-- docs/examples/tablesdb/update-rows.md | 4 +-- .../examples/tablesdb/update-string-column.md | 4 +-- docs/examples/tablesdb/update-table.md | 6 ++-- docs/examples/tablesdb/update-url-column.md | 2 +- docs/examples/tablesdb/update.md | 2 +- docs/examples/tablesdb/upsert-row.md | 4 +-- docs/examples/teams/create-membership.md | 10 +++--- docs/examples/teams/create.md | 2 +- docs/examples/teams/list-memberships.md | 4 +-- docs/examples/teams/list.md | 4 +-- docs/examples/tokens/create-file-token.md | 2 +- docs/examples/tokens/list.md | 2 +- docs/examples/tokens/update.md | 2 +- ...e-argon2user.md => create-argon-2-user.md} | 2 +- docs/examples/users/create-bcrypt-user.md | 2 +- .../users/{create-j-w-t.md => create-jwt.md} | 4 +-- .../users/create-m-f-a-recovery-codes.md | 12 ------- ...create-m-d5user.md => create-md-5-user.md} | 2 +- .../users/create-mfa-recovery-codes.md | 2 +- ...-h-pass-user.md => create-ph-pass-user.md} | 2 +- .../users/create-scrypt-modified-user.md | 2 +- docs/examples/users/create-scrypt-user.md | 2 +- ...reate-s-h-a-user.md => create-sha-user.md} | 4 +-- docs/examples/users/create-target.md | 4 +-- docs/examples/users/create-token.md | 4 +-- docs/examples/users/create.md | 8 ++--- .../users/delete-m-f-a-authenticator.md | 13 ------- .../users/delete-mfa-authenticator.md | 2 +- .../users/get-m-f-a-recovery-codes.md | 12 ------- docs/examples/users/get-mfa-recovery-codes.md | 2 +- docs/examples/users/list-identities.md | 4 +-- docs/examples/users/list-logs.md | 2 +- docs/examples/users/list-m-f-a-factors.md | 12 ------- docs/examples/users/list-memberships.md | 4 +-- docs/examples/users/list-mfa-factors.md | 2 +- docs/examples/users/list-targets.md | 2 +- docs/examples/users/list.md | 4 +-- .../users/update-m-f-a-recovery-codes.md | 12 ------- docs/examples/users/update-m-f-a.md | 13 ------- .../users/update-mfa-recovery-codes.md | 2 +- docs/examples/users/update-mfa.md | 2 +- docs/examples/users/update-target.md | 6 ++-- mod.ts | 2 +- ...loyment-type.ts => vcs-deployment-type.ts} | 0 src/services/functions.ts | 2 +- src/services/sites.ts | 2 +- src/services/{tables-d-b.ts => tables-db.ts} | 0 .../{tables-d-b.test.ts => tables-db.test.ts} | 0 246 files changed, 587 insertions(+), 916 deletions(-) rename docs/examples/account/{create-j-w-t.md => create-jwt.md} (100%) delete mode 100644 docs/examples/account/create-m-f-a-authenticator.md delete mode 100644 docs/examples/account/create-m-f-a-challenge.md delete mode 100644 docs/examples/account/create-m-f-a-recovery-codes.md rename docs/examples/account/{create-magic-u-r-l-token.md => create-magic-url-token.md} (84%) rename docs/examples/account/{create-o-auth2token.md => create-o-auth-2-token.md} (74%) delete mode 100644 docs/examples/account/delete-m-f-a-authenticator.md delete mode 100644 docs/examples/account/get-m-f-a-recovery-codes.md delete mode 100644 docs/examples/account/list-m-f-a-factors.md delete mode 100644 docs/examples/account/update-m-f-a-authenticator.md delete mode 100644 docs/examples/account/update-m-f-a-challenge.md delete mode 100644 docs/examples/account/update-m-f-a-recovery-codes.md rename docs/examples/account/{update-magic-u-r-l-session.md => update-magic-url-session.md} (100%) rename docs/examples/account/{update-m-f-a.md => update-mfa.md} (100%) rename docs/examples/avatars/{get-q-r.md => get-qr.md} (82%) rename docs/examples/health/{get-d-b.md => get-db.md} (100%) rename docs/examples/locale/{list-countries-e-u.md => list-countries-eu.md} (100%) delete mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md delete mode 100644 docs/examples/messaging/create-f-c-m-provider.md rename docs/examples/messaging/{create-msg91provider.md => create-msg-91-provider.md} (74%) delete mode 100644 docs/examples/messaging/create-s-m-s.md delete mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md delete mode 100644 docs/examples/messaging/update-a-p-n-s-provider.md delete mode 100644 docs/examples/messaging/update-f-c-m-provider.md rename docs/examples/messaging/{update-msg91provider.md => update-msg-91-provider.md} (69%) delete mode 100644 docs/examples/messaging/update-s-m-s.md delete mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md rename docs/examples/users/{create-argon2user.md => create-argon-2-user.md} (93%) rename docs/examples/users/{create-j-w-t.md => create-jwt.md} (84%) delete mode 100644 docs/examples/users/create-m-f-a-recovery-codes.md rename docs/examples/users/{create-m-d5user.md => create-md-5-user.md} (93%) rename docs/examples/users/{create-p-h-pass-user.md => create-ph-pass-user.md} (93%) rename docs/examples/users/{create-s-h-a-user.md => create-sha-user.md} (84%) delete mode 100644 docs/examples/users/delete-m-f-a-authenticator.md delete mode 100644 docs/examples/users/get-m-f-a-recovery-codes.md delete mode 100644 docs/examples/users/list-m-f-a-factors.md delete mode 100644 docs/examples/users/update-m-f-a-recovery-codes.md delete mode 100644 docs/examples/users/update-m-f-a.md rename src/enums/{v-c-s-deployment-type.ts => vcs-deployment-type.ts} (100%) rename src/services/{tables-d-b.ts => tables-db.ts} (100%) rename test/services/{tables-d-b.test.ts => tables-db.test.ts} (100%) diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 5365f4d..daab356 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -9,5 +9,5 @@ const account = new Account(client); const response = await account.createEmailToken({ userId: '<USER_ID>', email: 'email@example.com', - phrase: false + phrase: false // optional }); diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-jwt.md similarity index 100% rename from docs/examples/account/create-j-w-t.md rename to docs/examples/account/create-jwt.md diff --git a/docs/examples/account/create-m-f-a-authenticator.md b/docs/examples/account/create-m-f-a-authenticator.md deleted file mode 100644 index 0e496e0..0000000 --- a/docs/examples/account/create-m-f-a-authenticator.md +++ /dev/null @@ -1,12 +0,0 @@ -import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.createMFAAuthenticator({ - type: AuthenticatorType.Totp -}); diff --git a/docs/examples/account/create-m-f-a-challenge.md b/docs/examples/account/create-m-f-a-challenge.md deleted file mode 100644 index a36e286..0000000 --- a/docs/examples/account/create-m-f-a-challenge.md +++ /dev/null @@ -1,11 +0,0 @@ -import { Client, Account, AuthenticationFactor } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID - -const account = new Account(client); - -const response = await account.createMFAChallenge({ - factor: AuthenticationFactor.Email -}); diff --git a/docs/examples/account/create-m-f-a-recovery-codes.md b/docs/examples/account/create-m-f-a-recovery-codes.md deleted file mode 100644 index 5a8f6a3..0000000 --- a/docs/examples/account/create-m-f-a-recovery-codes.md +++ /dev/null @@ -1,10 +0,0 @@ -import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.createMFARecoveryCodes(); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-url-token.md similarity index 84% rename from docs/examples/account/create-magic-u-r-l-token.md rename to docs/examples/account/create-magic-url-token.md index 364dbae..266aa8b 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -9,6 +9,6 @@ const account = new Account(client); const response = await account.createMagicURLToken({ userId: '<USER_ID>', email: 'email@example.com', - url: 'https://example.com', - phrase: false + url: 'https://example.com', // optional + phrase: false // optional }); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 471225d..0e496e0 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.createMfaAuthenticator({ +const response = await account.createMFAAuthenticator({ type: AuthenticatorType.Totp }); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index a31896b..a36e286 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -6,6 +6,6 @@ const client = new Client() const account = new Account(client); -const response = await account.createMfaChallenge({ +const response = await account.createMFAChallenge({ factor: AuthenticationFactor.Email }); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index cfd9aa2..5a8f6a3 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -7,4 +7,4 @@ const client = new Client() const account = new Account(client); -const response = await account.createMfaRecoveryCodes(); +const response = await account.createMFARecoveryCodes(); diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth-2-token.md similarity index 74% rename from docs/examples/account/create-o-auth2token.md rename to docs/examples/account/create-o-auth-2-token.md index b5463a7..bc1f5fc 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -8,7 +8,7 @@ const account = new Account(client); account.createOAuth2Token({ provider: OAuthProvider.Amazon, - success: 'https://example.com', - failure: 'https://example.com', - scopes: [] + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional }); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 1d8bc36..025dad8 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -10,5 +10,5 @@ const response = await account.create({ userId: '<USER_ID>', email: 'email@example.com', password: '', - name: '<NAME>' + name: '<NAME>' // optional }); diff --git a/docs/examples/account/delete-m-f-a-authenticator.md b/docs/examples/account/delete-m-f-a-authenticator.md deleted file mode 100644 index 777347d..0000000 --- a/docs/examples/account/delete-m-f-a-authenticator.md +++ /dev/null @@ -1,12 +0,0 @@ -import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.deleteMFAAuthenticator({ - type: AuthenticatorType.Totp -}); diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 8ab5e26..777347d 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -7,6 +7,6 @@ const client = new Client() const account = new Account(client); -const response = await account.deleteMfaAuthenticator({ +const response = await account.deleteMFAAuthenticator({ type: AuthenticatorType.Totp }); diff --git a/docs/examples/account/get-m-f-a-recovery-codes.md b/docs/examples/account/get-m-f-a-recovery-codes.md deleted file mode 100644 index 6f631ac..0000000 --- a/docs/examples/account/get-m-f-a-recovery-codes.md +++ /dev/null @@ -1,10 +0,0 @@ -import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.getMFARecoveryCodes(); diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 73fc143..6f631ac 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -7,4 +7,4 @@ const client = new Client() const account = new Account(client); -const response = await account.getMfaRecoveryCodes(); +const response = await account.getMFARecoveryCodes(); diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index e4c9b18..cbcac73 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -8,5 +8,5 @@ const client = new Client() const account = new Account(client); const response = await account.listIdentities({ - queries: [] + queries: [] // optional }); diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index ce26c4d..6e7ce67 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -8,5 +8,5 @@ const client = new Client() const account = new Account(client); const response = await account.listLogs({ - queries: [] + queries: [] // optional }); diff --git a/docs/examples/account/list-m-f-a-factors.md b/docs/examples/account/list-m-f-a-factors.md deleted file mode 100644 index 0eb3d5d..0000000 --- a/docs/examples/account/list-m-f-a-factors.md +++ /dev/null @@ -1,10 +0,0 @@ -import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.listMFAFactors(); diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 35fb749..0eb3d5d 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -7,4 +7,4 @@ const client = new Client() const account = new Account(client); -const response = await account.listMfaFactors(); +const response = await account.listMFAFactors(); diff --git a/docs/examples/account/update-m-f-a-authenticator.md b/docs/examples/account/update-m-f-a-authenticator.md deleted file mode 100644 index 1049f6a..0000000 --- a/docs/examples/account/update-m-f-a-authenticator.md +++ /dev/null @@ -1,13 +0,0 @@ -import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.updateMFAAuthenticator({ - type: AuthenticatorType.Totp, - otp: '<OTP>' -}); diff --git a/docs/examples/account/update-m-f-a-challenge.md b/docs/examples/account/update-m-f-a-challenge.md deleted file mode 100644 index 9ee0825..0000000 --- a/docs/examples/account/update-m-f-a-challenge.md +++ /dev/null @@ -1,13 +0,0 @@ -import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.updateMFAChallenge({ - challengeId: '<CHALLENGE_ID>', - otp: '<OTP>' -}); diff --git a/docs/examples/account/update-m-f-a-recovery-codes.md b/docs/examples/account/update-m-f-a-recovery-codes.md deleted file mode 100644 index eae8560..0000000 --- a/docs/examples/account/update-m-f-a-recovery-codes.md +++ /dev/null @@ -1,10 +0,0 @@ -import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new Client() - .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with - -const account = new Account(client); - -const response = await account.updateMFARecoveryCodes(); diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-url-session.md similarity index 100% rename from docs/examples/account/update-magic-u-r-l-session.md rename to docs/examples/account/update-magic-url-session.md diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 48f8330..1049f6a 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updateMfaAuthenticator({ +const response = await account.updateMFAAuthenticator({ type: AuthenticatorType.Totp, otp: '<OTP>' }); diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index c6325d3..9ee0825 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -7,7 +7,7 @@ const client = new Client() const account = new Account(client); -const response = await account.updateMfaChallenge({ +const response = await account.updateMFAChallenge({ challengeId: '<CHALLENGE_ID>', otp: '<OTP>' }); diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 2030e1c..eae8560 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -7,4 +7,4 @@ const client = new Client() const account = new Account(client); -const response = await account.updateMfaRecoveryCodes(); +const response = await account.updateMFARecoveryCodes(); diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-mfa.md similarity index 100% rename from docs/examples/account/update-m-f-a.md rename to docs/examples/account/update-mfa.md diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index a61c9fc..1bd388a 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -9,5 +9,5 @@ const account = new Account(client); const response = await account.updatePassword({ password: '', - oldPassword: 'password' + oldPassword: 'password' // optional }); diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index e1525a6..fbef7ee 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -9,7 +9,7 @@ const avatars = new Avatars(client); const result = avatars.getBrowser({ code: Browser.AvantBrowser, - width: 0, - height: 0, - quality: -1 + width: 0, // optional + height: 0, // optional + quality: -1 // optional }); diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 54a266f..c4323c3 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -9,7 +9,7 @@ const avatars = new Avatars(client); const result = avatars.getCreditCard({ code: CreditCard.AmericanExpress, - width: 0, - height: 0, - quality: -1 + width: 0, // optional + height: 0, // optional + quality: -1 // optional }); diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 5b02485..7032c48 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -9,7 +9,7 @@ const avatars = new Avatars(client); const result = avatars.getFlag({ code: Flag.Afghanistan, - width: 0, - height: 0, - quality: -1 + width: 0, // optional + height: 0, // optional + quality: -1 // optional }); diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index a8a5a7f..d4012ed 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -9,6 +9,6 @@ const avatars = new Avatars(client); const result = avatars.getImage({ url: 'https://example.com', - width: 0, - height: 0 + width: 0, // optional + height: 0 // optional }); diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 5719506..c086997 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -8,8 +8,8 @@ const client = new Client() const avatars = new Avatars(client); const result = avatars.getInitials({ - name: '<NAME>', - width: 0, - height: 0, - background: '' + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '' // optional }); diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-qr.md similarity index 82% rename from docs/examples/avatars/get-q-r.md rename to docs/examples/avatars/get-qr.md index 6f9d404..096014b 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-qr.md @@ -9,7 +9,7 @@ const avatars = new Avatars(client); const result = avatars.getQR({ text: '<TEXT>', - size: 1, - margin: 0, - download: false + size: 1, // optional + margin: 0, // optional + download: false // optional }); diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 8154a6f..fbcdde4 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -12,6 +12,6 @@ const response = await databases.createBooleanAttribute({ collectionId: '<COLLECTION_ID>', key: '', required: false, - default: false, - array: false + default: false, // optional + array: false // optional }); diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index e198c0c..9b2776a 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -11,7 +11,7 @@ const response = await databases.createCollection({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', name: '<NAME>', - permissions: ["read("any")"], - documentSecurity: false, - enabled: false + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional }); diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index a3d7984..80dec8c 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -12,6 +12,6 @@ const response = await databases.createDatetimeAttribute({ collectionId: '<COLLECTION_ID>', key: '', required: false, - default: '', - array: false + default: '', // optional + array: false // optional }); diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 1b0fa0c..784b7dd 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -12,5 +12,5 @@ const response = await databases.createDocument({ collectionId: '<COLLECTION_ID>', documentId: '<DOCUMENT_ID>', data: {}, - permissions: ["read("any")"] + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 1b86fd5..6206a74 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -12,6 +12,6 @@ const response = await databases.createEmailAttribute({ collectionId: '<COLLECTION_ID>', key: '', required: false, - default: 'email@example.com', - array: false + default: 'email@example.com', // optional + array: false // optional }); diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index cbf8a84..b8555bf 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -13,6 +13,6 @@ const response = await databases.createEnumAttribute({ key: '', elements: [], required: false, - default: '<DEFAULT>', - array: false + default: '<DEFAULT>', // optional + array: false // optional }); diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 16f4848..3cec0ee 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -12,8 +12,8 @@ const response = await databases.createFloatAttribute({ collectionId: '<COLLECTION_ID>', key: '', required: false, - min: null, - max: null, - default: null, - array: false + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional }); diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 68f29eb..b2be093 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -13,6 +13,6 @@ const response = await databases.createIndex({ key: '', type: IndexType.Key, attributes: [], - orders: [], - lengths: [] + orders: [], // optional + lengths: [] // optional }); diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 6f8590d..37ba43a 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -12,8 +12,8 @@ const response = await databases.createIntegerAttribute({ collectionId: '<COLLECTION_ID>', key: '', required: false, - min: null, - max: null, - default: null, - array: false + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional }); diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index b3361af..047622d 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -12,6 +12,6 @@ const response = await databases.createIpAttribute({ collectionId: '<COLLECTION_ID>', key: '', required: false, - default: '', - array: false + default: '', // optional + array: false // optional }); diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 29c7488..39c73d0 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -12,8 +12,8 @@ const response = await databases.createRelationshipAttribute({ collectionId: '<COLLECTION_ID>', relatedCollectionId: '<RELATED_COLLECTION_ID>', type: RelationshipType.OneToOne, - twoWay: false, - key: '', - twoWayKey: '', - onDelete: RelationMutate.Cascade + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate.Cascade // optional }); diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index b7500bd..17d4aa1 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -13,7 +13,7 @@ const response = await databases.createStringAttribute({ key: '', size: 1, required: false, - default: '<DEFAULT>', - array: false, - encrypt: false + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional }); diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 2975cfa..f60423c 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -12,6 +12,6 @@ const response = await databases.createUrlAttribute({ collectionId: '<COLLECTION_ID>', key: '', required: false, - default: 'https://example.com', - array: false + default: 'https://example.com', // optional + array: false // optional }); diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 666d197..63e5471 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -10,5 +10,5 @@ const databases = new Databases(client); const response = await databases.create({ databaseId: '<DATABASE_ID>', name: '<NAME>', - enabled: false + enabled: false // optional }); diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 553baaf..52d7192 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -12,6 +12,6 @@ const response = await databases.decrementDocumentAttribute({ collectionId: '<COLLECTION_ID>', documentId: '<DOCUMENT_ID>', attribute: '', - value: null, - min: null + value: null, // optional + min: null // optional }); diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index c958165..b63a960 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -10,5 +10,5 @@ const databases = new Databases(client); const response = await databases.deleteDocuments({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 7714f9d..fb84158 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -11,5 +11,5 @@ const response = await databases.getDocument({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', documentId: '<DOCUMENT_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 7c8fbe8..c32c484 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -12,6 +12,6 @@ const response = await databases.incrementDocumentAttribute({ collectionId: '<COLLECTION_ID>', documentId: '<DOCUMENT_ID>', attribute: '', - value: null, - max: null + value: null, // optional + max: null // optional }); diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 0b402ee..39de5d4 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -10,5 +10,5 @@ const databases = new Databases(client); const response = await databases.listAttributes({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 7b10446..264be3c 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -9,6 +9,6 @@ const databases = new Databases(client); const response = await databases.listCollections({ databaseId: '<DATABASE_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index d30f262..5c38998 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -10,5 +10,5 @@ const databases = new Databases(client); const response = await databases.listDocuments({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index b1bb477..628a434 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -10,5 +10,5 @@ const databases = new Databases(client); const response = await databases.listIndexes({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 9cac22a..4ba17dd 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -8,6 +8,6 @@ const client = new Client() const databases = new Databases(client); const response = await databases.list({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 1a320af..28e4718 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -13,5 +13,5 @@ const response = await databases.updateBooleanAttribute({ key: '', required: false, default: false, - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index f3de373..89b2d0e 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -11,7 +11,7 @@ const response = await databases.updateCollection({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', name: '<NAME>', - permissions: ["read("any")"], - documentSecurity: false, - enabled: false + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional }); diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 686add6..9e9116b 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -13,5 +13,5 @@ const response = await databases.updateDatetimeAttribute({ key: '', required: false, default: '', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index dab3fcd..2a59177 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -11,6 +11,6 @@ const response = await databases.updateDocument({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', documentId: '<DOCUMENT_ID>', - data: {}, - permissions: ["read("any")"] + data: {}, // optional + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index fbfcf77..15c4a90 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -10,6 +10,6 @@ const databases = new Databases(client); const response = await databases.updateDocuments({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', - data: {}, - queries: [] + data: {}, // optional + queries: [] // optional }); diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index aab2195..ff6cf21 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -13,5 +13,5 @@ const response = await databases.updateEmailAttribute({ key: '', required: false, default: 'email@example.com', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 133f263..60f84fd 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -14,5 +14,5 @@ const response = await databases.updateEnumAttribute({ elements: [], required: false, default: '<DEFAULT>', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 3fdf664..3a66407 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -13,7 +13,7 @@ const response = await databases.updateFloatAttribute({ key: '', required: false, default: null, - min: null, - max: null, - newKey: '' + min: null, // optional + max: null, // optional + newKey: '' // optional }); diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index ccdbd97..679eeaa 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -13,7 +13,7 @@ const response = await databases.updateIntegerAttribute({ key: '', required: false, default: null, - min: null, - max: null, - newKey: '' + min: null, // optional + max: null, // optional + newKey: '' // optional }); diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index d361cea..d4145f4 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -13,5 +13,5 @@ const response = await databases.updateIpAttribute({ key: '', required: false, default: '', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 224ae20..3c9e9ac 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -11,6 +11,6 @@ const response = await databases.updateRelationshipAttribute({ databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', key: '', - onDelete: RelationMutate.Cascade, - newKey: '' + onDelete: RelationMutate.Cascade, // optional + newKey: '' // optional }); diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 3d814d6..ec0dd8b 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -13,6 +13,6 @@ const response = await databases.updateStringAttribute({ key: '', required: false, default: '<DEFAULT>', - size: 1, - newKey: '' + size: 1, // optional + newKey: '' // optional }); diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 5d8ba70..f59ae75 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -13,5 +13,5 @@ const response = await databases.updateUrlAttribute({ key: '', required: false, default: 'https://example.com', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 078d9b0..9df4fca 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -10,5 +10,5 @@ const databases = new Databases(client); const response = await databases.update({ databaseId: '<DATABASE_ID>', name: '<NAME>', - enabled: false + enabled: false // optional }); diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index c20edec..27eb1e1 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -12,5 +12,5 @@ const response = await databases.upsertDocument({ collectionId: '<COLLECTION_ID>', documentId: '<DOCUMENT_ID>', data: {}, - permissions: ["read("any")"] + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index fadd4f5..4f27138 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -11,6 +11,6 @@ const response = await functions.createDeployment({ functionId: '<FUNCTION_ID>', code: InputFile.fromPath('/path/to/file.png', 'file.png'), activate: false, - entrypoint: '<ENTRYPOINT>', - commands: '<COMMANDS>' + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>' // optional }); diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index 7868b04..b8c7e43 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -10,5 +10,5 @@ const functions = new Functions(client); const response = await functions.createDuplicateDeployment({ functionId: '<FUNCTION_ID>', deploymentId: '<DEPLOYMENT_ID>', - buildId: '<BUILD_ID>' + buildId: '<BUILD_ID>' // optional }); diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index aee2359..651a5c9 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -9,10 +9,10 @@ const functions = new Functions(client); const response = await functions.createExecution({ functionId: '<FUNCTION_ID>', - body: '<BODY>', - async: false, - path: '<PATH>', - method: ExecutionMethod.GET, - headers: {}, - scheduledAt: '<SCHEDULED_AT>' + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>' // optional }); diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index 32e6f11..6e8b932 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -13,5 +13,5 @@ const response = await functions.createTemplateDeployment({ owner: '<OWNER>', rootDirectory: '<ROOT_DIRECTORY>', version: '<VERSION>', - activate: false + activate: false // optional }); diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 274ced2..4e871c6 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -11,5 +11,5 @@ const response = await functions.createVariable({ functionId: '<FUNCTION_ID>', key: '<KEY>', value: '<VALUE>', - secret: false + secret: false // optional }); diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index e47d994..7a10824 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -11,5 +11,5 @@ const response = await functions.createVcsDeployment({ functionId: '<FUNCTION_ID>', type: VCSDeploymentType.Branch, reference: '<REFERENCE>', - activate: false + activate: false // optional }); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 113da00..4681bd6 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -11,19 +11,19 @@ const response = await functions.create({ functionId: '<FUNCTION_ID>', name: '<NAME>', runtime: .Node145, - execute: ["any"], - events: [], - schedule: '', - timeout: 1, - enabled: false, - logging: false, - entrypoint: '<ENTRYPOINT>', - commands: '<COMMANDS>', - scopes: [], - installationId: '<INSTALLATION_ID>', - providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', - providerBranch: '<PROVIDER_BRANCH>', - providerSilentMode: false, - providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', - specification: '' + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional }); diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 4dfa322..3497111 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -10,5 +10,5 @@ const functions = new Functions(client); const result = functions.getDeploymentDownload({ functionId: '<FUNCTION_ID>', deploymentId: '<DEPLOYMENT_ID>', - type: DeploymentDownloadType.Source + type: DeploymentDownloadType.Source // optional }); diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 1c04aba..6d1718d 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -9,6 +9,6 @@ const functions = new Functions(client); const response = await functions.listDeployments({ functionId: '<FUNCTION_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 03e373f..101d4ec 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -9,5 +9,5 @@ const functions = new Functions(client); const response = await functions.listExecutions({ functionId: '<FUNCTION_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 3b9c401..bb0475d 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -8,6 +8,6 @@ const client = new Client() const functions = new Functions(client); const response = await functions.list({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index fb80ac9..cff5cc4 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -11,6 +11,6 @@ const response = await functions.updateVariable({ functionId: '<FUNCTION_ID>', variableId: '<VARIABLE_ID>', key: '<KEY>', - value: '<VALUE>', - secret: false + value: '<VALUE>', // optional + secret: false // optional }); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index d37701a..0a74369 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -10,20 +10,20 @@ const functions = new Functions(client); const response = await functions.update({ functionId: '<FUNCTION_ID>', name: '<NAME>', - runtime: .Node145, - execute: ["any"], - events: [], - schedule: '', - timeout: 1, - enabled: false, - logging: false, - entrypoint: '<ENTRYPOINT>', - commands: '<COMMANDS>', - scopes: [], - installationId: '<INSTALLATION_ID>', - providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', - providerBranch: '<PROVIDER_BRANCH>', - providerSilentMode: false, - providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', - specification: '' + runtime: .Node145, // optional + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional }); diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 56afdd6..388fce9 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getCertificate({ - domain: '' + domain: '' // optional }); diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-db.md similarity index 100% rename from docs/examples/health/get-d-b.md rename to docs/examples/health/get-db.md diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index a330bcf..a820235 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -9,5 +9,5 @@ const health = new Health(client); const response = await health.getFailedJobs({ name: .V1Database, - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 10ecfd8..d247f48 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueBuilds({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 2268c1e..c43cffb 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueCertificates({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 0ba7ca2..9c126dc 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -8,6 +8,6 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueDatabases({ - name: '<NAME>', - threshold: null + name: '<NAME>', // optional + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 4afe3ec..240cfe3 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueDeletes({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 5885132..333b5ab 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueFunctions({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 92627fe..7877685 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueLogs({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 1ac6e67..3ec4b39 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueMails({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 7351be9..6d5bf48 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueMessaging({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index a3758fa..520b92d 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueMigrations({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index 227f7f5..8f22c23 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueStatsResources({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index c031f63..69ab874 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueUsage({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index a852a55..0e14d7c 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -8,5 +8,5 @@ const client = new Client() const health = new Health(client); const response = await health.getQueueWebhooks({ - threshold: null + threshold: null // optional }); diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-eu.md similarity index 100% rename from docs/examples/locale/list-countries-e-u.md rename to docs/examples/locale/list-countries-eu.md diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md deleted file mode 100644 index b117888..0000000 --- a/docs/examples/messaging/create-a-p-n-s-provider.md +++ /dev/null @@ -1,19 +0,0 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.createAPNSProvider({ - providerId: '<PROVIDER_ID>', - name: '<NAME>', - authKey: '<AUTH_KEY>', - authKeyId: '<AUTH_KEY_ID>', - teamId: '<TEAM_ID>', - bundleId: '<BUNDLE_ID>', - sandbox: false, - enabled: false -}); diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index b854183..b32386b 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -7,13 +7,13 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createApnsProvider({ +const response = await messaging.createAPNSProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - authKey: '<AUTH_KEY>', - authKeyId: '<AUTH_KEY_ID>', - teamId: '<TEAM_ID>', - bundleId: '<BUNDLE_ID>', - sandbox: false, - enabled: false + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 011e1f6..8ba3db8 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -11,13 +11,13 @@ const response = await messaging.createEmail({ messageId: '<MESSAGE_ID>', subject: '<SUBJECT>', content: '<CONTENT>', - topics: [], - users: [], - targets: [], - cc: [], - bcc: [], - attachments: [], - draft: false, - html: false, - scheduledAt: '' + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '' // optional }); diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md deleted file mode 100644 index 5831f79..0000000 --- a/docs/examples/messaging/create-f-c-m-provider.md +++ /dev/null @@ -1,15 +0,0 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.createFCMProvider({ - providerId: '<PROVIDER_ID>', - name: '<NAME>', - serviceAccountJSON: {}, - enabled: false -}); diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 1e3596f..bea200d 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -7,9 +7,9 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createFcmProvider({ +const response = await messaging.createFCMProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - serviceAccountJSON: {}, - enabled: false + serviceAccountJSON: {}, // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index c17a323..2eaa888 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -10,12 +10,12 @@ const messaging = new Messaging(client); const response = await messaging.createMailgunProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - apiKey: '<API_KEY>', - domain: '<DOMAIN>', - isEuRegion: false, - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: 'email@example.com', - enabled: false + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg-91-provider.md similarity index 74% rename from docs/examples/messaging/create-msg91provider.md rename to docs/examples/messaging/create-msg-91-provider.md index c076faa..b9f3238 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -10,8 +10,8 @@ const messaging = new Messaging(client); const response = await messaging.createMsg91Provider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - templateId: '<TEMPLATE_ID>', - senderId: '<SENDER_ID>', - authKey: '<AUTH_KEY>', - enabled: false + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 2c9004c..efa40ce 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -9,22 +9,22 @@ const messaging = new Messaging(client); const response = await messaging.createPush({ messageId: '<MESSAGE_ID>', - title: '<TITLE>', - body: '<BODY>', - topics: [], - users: [], - targets: [], - data: {}, - action: '<ACTION>', - image: '[ID1:ID2]', - icon: '<ICON>', - sound: '<SOUND>', - color: '<COLOR>', - tag: '<TAG>', - badge: null, - draft: false, - scheduledAt: '', - contentAvailable: false, - critical: false, - priority: MessagePriority.Normal + title: '<TITLE>', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional }); diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md deleted file mode 100644 index 8f4fefc..0000000 --- a/docs/examples/messaging/create-s-m-s.md +++ /dev/null @@ -1,18 +0,0 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.createSMS({ - messageId: '<MESSAGE_ID>', - content: '<CONTENT>', - topics: [], - users: [], - targets: [], - draft: false, - scheduledAt: '' -}); diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md deleted file mode 100644 index 0a85e7c..0000000 --- a/docs/examples/messaging/create-s-m-t-p-provider.md +++ /dev/null @@ -1,25 +0,0 @@ -import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.createSMTPProvider({ - providerId: '<PROVIDER_ID>', - name: '<NAME>', - host: '<HOST>', - port: 1, - username: '<USERNAME>', - password: '<PASSWORD>', - encryption: SmtpEncryption.None, - autoTLS: false, - mailer: '<MAILER>', - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: 'email@example.com', - enabled: false -}); diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 62f5ec1..10ce45e 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -10,10 +10,10 @@ const messaging = new Messaging(client); const response = await messaging.createSendgridProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - apiKey: '<API_KEY>', - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: 'email@example.com', - enabled: false + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 5b69112..bf81ff9 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -7,12 +7,12 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createSms({ +const response = await messaging.createSMS({ messageId: '<MESSAGE_ID>', content: '<CONTENT>', - topics: [], - users: [], - targets: [], - draft: false, - scheduledAt: '' + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '' // optional }); diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 426cc98..06307b3 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -7,19 +7,19 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.createSmtpProvider({ +const response = await messaging.createSMTPProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', host: '<HOST>', - port: 1, - username: '<USERNAME>', - password: '<PASSWORD>', - encryption: SmtpEncryption.None, - autoTLS: false, - mailer: '<MAILER>', - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: 'email@example.com', - enabled: false + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 04c4b63..0c9376b 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -10,8 +10,8 @@ const messaging = new Messaging(client); const response = await messaging.createTelesignProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - from: '+12065550100', - customerId: '<CUSTOMER_ID>', - apiKey: '<API_KEY>', - enabled: false + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 7fcdcfe..1bf61f9 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -10,8 +10,8 @@ const messaging = new Messaging(client); const response = await messaging.createTextmagicProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - from: '+12065550100', - username: '<USERNAME>', - apiKey: '<API_KEY>', - enabled: false + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 08c1c32..a15699b 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -10,5 +10,5 @@ const messaging = new Messaging(client); const response = await messaging.createTopic({ topicId: '<TOPIC_ID>', name: '<NAME>', - subscribe: ["any"] + subscribe: ["any"] // optional }); diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 7ea61ad..cd889f0 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -10,8 +10,8 @@ const messaging = new Messaging(client); const response = await messaging.createTwilioProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - from: '+12065550100', - accountSid: '<ACCOUNT_SID>', - authToken: '<AUTH_TOKEN>', - enabled: false + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 6b24187..e03b0b6 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -10,8 +10,8 @@ const messaging = new Messaging(client); const response = await messaging.createVonageProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', - from: '+12065550100', - apiKey: '<API_KEY>', - apiSecret: '<API_SECRET>', - enabled: false + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 5772ddd..b470dbc 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -9,5 +9,5 @@ const messaging = new Messaging(client); const response = await messaging.listMessageLogs({ messageId: '<MESSAGE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index a487cb7..a1bd90a 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -8,6 +8,6 @@ const client = new Client() const messaging = new Messaging(client); const response = await messaging.listMessages({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 87fbe57..9784ff3 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -9,5 +9,5 @@ const messaging = new Messaging(client); const response = await messaging.listProviderLogs({ providerId: '<PROVIDER_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 7fc1e06..150de6f 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -8,6 +8,6 @@ const client = new Client() const messaging = new Messaging(client); const response = await messaging.listProviders({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index d0f3d1c..ccc575c 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -9,5 +9,5 @@ const messaging = new Messaging(client); const response = await messaging.listSubscriberLogs({ subscriberId: '<SUBSCRIBER_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index bd0c8af..68614ec 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -9,6 +9,6 @@ const messaging = new Messaging(client); const response = await messaging.listSubscribers({ topicId: '<TOPIC_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 8a18af7..6d269b7 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -9,5 +9,5 @@ const messaging = new Messaging(client); const response = await messaging.listTargets({ messageId: '<MESSAGE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index eeebc95..70b287a 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -9,5 +9,5 @@ const messaging = new Messaging(client); const response = await messaging.listTopicLogs({ topicId: '<TOPIC_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index cdd1afe..073b78e 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -8,6 +8,6 @@ const client = new Client() const messaging = new Messaging(client); const response = await messaging.listTopics({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md deleted file mode 100644 index a7b4236..0000000 --- a/docs/examples/messaging/update-a-p-n-s-provider.md +++ /dev/null @@ -1,19 +0,0 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.updateAPNSProvider({ - providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - authKey: '<AUTH_KEY>', - authKeyId: '<AUTH_KEY_ID>', - teamId: '<TEAM_ID>', - bundleId: '<BUNDLE_ID>', - sandbox: false -}); diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 3860fea..160786f 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -7,13 +7,13 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateApnsProvider({ +const response = await messaging.updateAPNSProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - authKey: '<AUTH_KEY>', - authKeyId: '<AUTH_KEY_ID>', - teamId: '<TEAM_ID>', - bundleId: '<BUNDLE_ID>', - sandbox: false + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false // optional }); diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a742160..0f281cd 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -9,15 +9,15 @@ const messaging = new Messaging(client); const response = await messaging.updateEmail({ messageId: '<MESSAGE_ID>', - topics: [], - users: [], - targets: [], - subject: '<SUBJECT>', - content: '<CONTENT>', - draft: false, - html: false, - cc: [], - bcc: [], - scheduledAt: '', - attachments: [] + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '', // optional + attachments: [] // optional }); diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md deleted file mode 100644 index dafc6ce..0000000 --- a/docs/examples/messaging/update-f-c-m-provider.md +++ /dev/null @@ -1,15 +0,0 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.updateFCMProvider({ - providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - serviceAccountJSON: {} -}); diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 17fb741..b76e037 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -7,9 +7,9 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateFcmProvider({ +const response = await messaging.updateFCMProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - serviceAccountJSON: {} + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: {} // optional }); diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index aad80a0..b4f88e8 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -9,13 +9,13 @@ const messaging = new Messaging(client); const response = await messaging.updateMailgunProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - apiKey: '<API_KEY>', - domain: '<DOMAIN>', - isEuRegion: false, - enabled: false, - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: '<REPLY_TO_EMAIL>' + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional }); diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg-91-provider.md similarity index 69% rename from docs/examples/messaging/update-msg91provider.md rename to docs/examples/messaging/update-msg-91-provider.md index 8f57eec..5cf61cb 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -9,9 +9,9 @@ const messaging = new Messaging(client); const response = await messaging.updateMsg91Provider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - templateId: '<TEMPLATE_ID>', - senderId: '<SENDER_ID>', - authKey: '<AUTH_KEY>' + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>' // optional }); diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 73d2a3c..fb776fd 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -9,22 +9,22 @@ const messaging = new Messaging(client); const response = await messaging.updatePush({ messageId: '<MESSAGE_ID>', - topics: [], - users: [], - targets: [], - title: '<TITLE>', - body: '<BODY>', - data: {}, - action: '<ACTION>', - image: '[ID1:ID2]', - icon: '<ICON>', - sound: '<SOUND>', - color: '<COLOR>', - tag: '<TAG>', - badge: null, - draft: false, - scheduledAt: '', - contentAvailable: false, - critical: false, - priority: MessagePriority.Normal + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional }); diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md deleted file mode 100644 index d2a3be0..0000000 --- a/docs/examples/messaging/update-s-m-s.md +++ /dev/null @@ -1,18 +0,0 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.updateSMS({ - messageId: '<MESSAGE_ID>', - topics: [], - users: [], - targets: [], - content: '<CONTENT>', - draft: false, - scheduledAt: '' -}); diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md deleted file mode 100644 index ea192a7..0000000 --- a/docs/examples/messaging/update-s-m-t-p-provider.md +++ /dev/null @@ -1,25 +0,0 @@ -import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 messaging = new Messaging(client); - -const response = await messaging.updateSMTPProvider({ - providerId: '<PROVIDER_ID>', - name: '<NAME>', - host: '<HOST>', - port: 1, - username: '<USERNAME>', - password: '<PASSWORD>', - encryption: SmtpEncryption.None, - autoTLS: false, - mailer: '<MAILER>', - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: '<REPLY_TO_EMAIL>', - enabled: false -}); diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 708886f..edf82f6 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -9,11 +9,11 @@ const messaging = new Messaging(client); const response = await messaging.updateSendgridProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - apiKey: '<API_KEY>', - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: '<REPLY_TO_EMAIL>' + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional }); diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 53ac19a..9d7f3a3 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -7,12 +7,12 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateSms({ +const response = await messaging.updateSMS({ messageId: '<MESSAGE_ID>', - topics: [], - users: [], - targets: [], - content: '<CONTENT>', - draft: false, - scheduledAt: '' + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '' // optional }); diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 35addb7..6fc0021 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -7,19 +7,19 @@ const client = new Client() const messaging = new Messaging(client); -const response = await messaging.updateSmtpProvider({ +const response = await messaging.updateSMTPProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - host: '<HOST>', - port: 1, - username: '<USERNAME>', - password: '<PASSWORD>', - encryption: SmtpEncryption.None, - autoTLS: false, - mailer: '<MAILER>', - fromName: '<FROM_NAME>', - fromEmail: 'email@example.com', - replyToName: '<REPLY_TO_NAME>', - replyToEmail: '<REPLY_TO_EMAIL>', - enabled: false + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false // optional }); diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index f41eb54..defb10e 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -9,9 +9,9 @@ const messaging = new Messaging(client); const response = await messaging.updateTelesignProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - customerId: '<CUSTOMER_ID>', - apiKey: '<API_KEY>', - from: '<FROM>' + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional }); diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 6c05f5c..c859643 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -9,9 +9,9 @@ const messaging = new Messaging(client); const response = await messaging.updateTextmagicProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - username: '<USERNAME>', - apiKey: '<API_KEY>', - from: '<FROM>' + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional }); diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index a8e5066..7dc9337 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -9,6 +9,6 @@ const messaging = new Messaging(client); const response = await messaging.updateTopic({ topicId: '<TOPIC_ID>', - name: '<NAME>', - subscribe: ["any"] + name: '<NAME>', // optional + subscribe: ["any"] // optional }); diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 1c4618d..75940f5 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -9,9 +9,9 @@ const messaging = new Messaging(client); const response = await messaging.updateTwilioProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - accountSid: '<ACCOUNT_SID>', - authToken: '<AUTH_TOKEN>', - from: '<FROM>' + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>' // optional }); diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index c3a2cad..fea4465 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -9,9 +9,9 @@ const messaging = new Messaging(client); const response = await messaging.updateVonageProvider({ providerId: '<PROVIDER_ID>', - name: '<NAME>', - enabled: false, - apiKey: '<API_KEY>', - apiSecret: '<API_SECRET>', - from: '<FROM>' + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>' // optional }); diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index 6e94256..81a0527 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -11,7 +11,7 @@ const response = await sites.createDeployment({ siteId: '<SITE_ID>', code: InputFile.fromPath('/path/to/file.png', 'file.png'), activate: false, - installCommand: '<INSTALL_COMMAND>', - buildCommand: '<BUILD_COMMAND>', - outputDirectory: '<OUTPUT_DIRECTORY>' + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>' // optional }); diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 8890b19..e9b569d 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -13,5 +13,5 @@ const response = await sites.createTemplateDeployment({ owner: '<OWNER>', rootDirectory: '<ROOT_DIRECTORY>', version: '<VERSION>', - activate: false + activate: false // optional }); diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index e2bf02d..ab5e143 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -11,5 +11,5 @@ const response = await sites.createVariable({ siteId: '<SITE_ID>', key: '<KEY>', value: '<VALUE>', - secret: false + secret: false // optional }); diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 750a3c0..7c7b7cc 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -11,5 +11,5 @@ const response = await sites.createVcsDeployment({ siteId: '<SITE_ID>', type: VCSDeploymentType.Branch, reference: '<REFERENCE>', - activate: false + activate: false // optional }); diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 5b1d152..7161da5 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -12,18 +12,18 @@ const response = await sites.create({ name: '<NAME>', framework: .Analog, buildRuntime: .Node145, - enabled: false, - logging: false, - timeout: 1, - installCommand: '<INSTALL_COMMAND>', - buildCommand: '<BUILD_COMMAND>', - outputDirectory: '<OUTPUT_DIRECTORY>', - adapter: .Static, - installationId: '<INSTALLATION_ID>', - fallbackFile: '<FALLBACK_FILE>', - providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', - providerBranch: '<PROVIDER_BRANCH>', - providerSilentMode: false, - providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', - specification: '' + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: .Static, // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional }); diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index ae4d3b3..40731b1 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -10,5 +10,5 @@ const sites = new Sites(client); const result = sites.getDeploymentDownload({ siteId: '<SITE_ID>', deploymentId: '<DEPLOYMENT_ID>', - type: DeploymentDownloadType.Source + type: DeploymentDownloadType.Source // optional }); diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 0f86956..013b621 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -9,6 +9,6 @@ const sites = new Sites(client); const response = await sites.listDeployments({ siteId: '<SITE_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 2519ed0..6ab920a 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -9,5 +9,5 @@ const sites = new Sites(client); const response = await sites.listLogs({ siteId: '<SITE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index 828e9c7..87f9ef3 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -8,6 +8,6 @@ const client = new Client() const sites = new Sites(client); const response = await sites.list({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 214dfff..5bc179d 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -11,6 +11,6 @@ const response = await sites.updateVariable({ siteId: '<SITE_ID>', variableId: '<VARIABLE_ID>', key: '<KEY>', - value: '<VALUE>', - secret: false + value: '<VALUE>', // optional + secret: false // optional }); diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index edb6e76..1f5235c 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -11,19 +11,19 @@ const response = await sites.update({ siteId: '<SITE_ID>', name: '<NAME>', framework: .Analog, - enabled: false, - logging: false, - timeout: 1, - installCommand: '<INSTALL_COMMAND>', - buildCommand: '<BUILD_COMMAND>', - outputDirectory: '<OUTPUT_DIRECTORY>', - buildRuntime: .Node145, - adapter: .Static, - fallbackFile: '<FALLBACK_FILE>', - installationId: '<INSTALLATION_ID>', - providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', - providerBranch: '<PROVIDER_BRANCH>', - providerSilentMode: false, - providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', - specification: '' + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: .Node145, // optional + adapter: .Static, // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional }); diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index e2daa65..1f996b1 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -10,12 +10,12 @@ const storage = new Storage(client); const response = await storage.createBucket({ bucketId: '<BUCKET_ID>', name: '<NAME>', - permissions: ["read("any")"], - fileSecurity: false, - enabled: false, - maximumFileSize: 1, - allowedFileExtensions: [], - compression: .None, - encryption: false, - antivirus: false + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional }); diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index c8565c7..4b6c1fd 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -11,5 +11,5 @@ const response = await storage.createFile({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', file: InputFile.fromPath('/path/to/file.png', 'file.png'), - permissions: ["read("any")"] + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 7e0a55b..fa1b465 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -10,5 +10,5 @@ const storage = new Storage(client); const result = storage.getFileDownload({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', - token: '<TOKEN>' + token: '<TOKEN>' // optional }); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 1efe6d8..884a84a 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -10,16 +10,16 @@ const storage = new Storage(client); const result = storage.getFilePreview({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', - width: 0, - height: 0, - gravity: ImageGravity.Center, - quality: -1, - borderWidth: 0, - borderColor: '', - borderRadius: 0, - opacity: 0, - rotation: -360, - background: '', - output: ImageFormat.Jpg, - token: '<TOKEN>' + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: ImageFormat.Jpg, // optional + token: '<TOKEN>' // optional }); diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index f629b40..86a357a 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -10,5 +10,5 @@ const storage = new Storage(client); const result = storage.getFileView({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', - token: '<TOKEN>' + token: '<TOKEN>' // optional }); diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 5319459..56bba16 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -8,6 +8,6 @@ const client = new Client() const storage = new Storage(client); const response = await storage.listBuckets({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index f34a0e1..e2ea466 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -9,6 +9,6 @@ const storage = new Storage(client); const response = await storage.listFiles({ bucketId: '<BUCKET_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index fca45d8..b0adba1 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -10,12 +10,12 @@ const storage = new Storage(client); const response = await storage.updateBucket({ bucketId: '<BUCKET_ID>', name: '<NAME>', - permissions: ["read("any")"], - fileSecurity: false, - enabled: false, - maximumFileSize: 1, - allowedFileExtensions: [], - compression: .None, - encryption: false, - antivirus: false + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional }); diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 65f4dd3..1a28c98 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -10,6 +10,6 @@ const storage = new Storage(client); const response = await storage.updateFile({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', - name: '<NAME>', - permissions: ["read("any")"] + name: '<NAME>', // optional + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 336d7c0..7407b58 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -12,6 +12,6 @@ const response = await tablesDB.createBooleanColumn({ tableId: '<TABLE_ID>', key: '', required: false, - default: false, - array: false + default: false, // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 8aaacad..f139666 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -12,6 +12,6 @@ const response = await tablesDB.createDatetimeColumn({ tableId: '<TABLE_ID>', key: '', required: false, - default: '', - array: false + default: '', // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index bc94776..a004a89 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -12,6 +12,6 @@ const response = await tablesDB.createEmailColumn({ tableId: '<TABLE_ID>', key: '', required: false, - default: 'email@example.com', - array: false + default: 'email@example.com', // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index aa14fae..1f40abd 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -13,6 +13,6 @@ const response = await tablesDB.createEnumColumn({ key: '', elements: [], required: false, - default: '<DEFAULT>', - array: false + default: '<DEFAULT>', // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 0ac4222..5d555a7 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -12,8 +12,8 @@ const response = await tablesDB.createFloatColumn({ tableId: '<TABLE_ID>', key: '', required: false, - min: null, - max: null, - default: null, - array: false + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 87deb28..0e164ed 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -13,6 +13,6 @@ const response = await tablesDB.createIndex({ key: '', type: IndexType.Key, columns: [], - orders: [], - lengths: [] + orders: [], // optional + lengths: [] // optional }); diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index 39de99a..297b096 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -12,8 +12,8 @@ const response = await tablesDB.createIntegerColumn({ tableId: '<TABLE_ID>', key: '', required: false, - min: null, - max: null, - default: null, - array: false + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index c2e66bb..95b20b8 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -12,6 +12,6 @@ const response = await tablesDB.createIpColumn({ tableId: '<TABLE_ID>', key: '', required: false, - default: '', - array: false + default: '', // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index ddd2bae..27952f7 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -12,8 +12,8 @@ const response = await tablesDB.createRelationshipColumn({ tableId: '<TABLE_ID>', relatedTableId: '<RELATED_TABLE_ID>', type: RelationshipType.OneToOne, - twoWay: false, - key: '', - twoWayKey: '', - onDelete: RelationMutate.Cascade + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate.Cascade // optional }); diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 96b7456..dadb5ec 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -12,5 +12,5 @@ const response = await tablesDB.createRow({ tableId: '<TABLE_ID>', rowId: '<ROW_ID>', data: {}, - permissions: ["read("any")"] + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 7656947..ff0816a 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -13,7 +13,7 @@ const response = await tablesDB.createStringColumn({ key: '', size: 1, required: false, - default: '<DEFAULT>', - array: false, - encrypt: false + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional }); diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index a54a02c..5dcaac4 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -11,7 +11,7 @@ const response = await tablesDB.createTable({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', name: '<NAME>', - permissions: ["read("any")"], - rowSecurity: false, - enabled: false + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional }); diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index 124b978..f019bab 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -12,6 +12,6 @@ const response = await tablesDB.createUrlColumn({ tableId: '<TABLE_ID>', key: '', required: false, - default: 'https://example.com', - array: false + default: 'https://example.com', // optional + array: false // optional }); diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 5c8f500..5971eb1 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -10,5 +10,5 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.create({ databaseId: '<DATABASE_ID>', name: '<NAME>', - enabled: false + enabled: false // optional }); diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 375e324..68c2fa4 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -12,6 +12,6 @@ const response = await tablesDB.decrementRowColumn({ tableId: '<TABLE_ID>', rowId: '<ROW_ID>', column: '', - value: null, - min: null + value: null, // optional + min: null // optional }); diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index bffbf0e..310b189 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -10,5 +10,5 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.deleteRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index a30bb2a..c662df2 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -11,5 +11,5 @@ const response = await tablesDB.getRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 1402027..a57683e 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -12,6 +12,6 @@ const response = await tablesDB.incrementRowColumn({ tableId: '<TABLE_ID>', rowId: '<ROW_ID>', column: '', - value: null, - max: null + value: null, // optional + max: null // optional }); diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 92e8ce8..2a1cbe2 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -10,5 +10,5 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.listColumns({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index d937e4c..7a0af70 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -10,5 +10,5 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.listIndexes({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index 293fdbd..2a09499 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -10,5 +10,5 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.listRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 30fe1c3..0ffd1b9 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -9,6 +9,6 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.listTables({ databaseId: '<DATABASE_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 937e202..529bd64 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -8,6 +8,6 @@ const client = new Client() const tablesDB = new TablesDB(client); const response = await tablesDB.list({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 5949036..ebc0bfb 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -13,5 +13,5 @@ const response = await tablesDB.updateBooleanColumn({ key: '', required: false, default: false, - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index f4df6bb..a2672c8 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -13,5 +13,5 @@ const response = await tablesDB.updateDatetimeColumn({ key: '', required: false, default: '', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index ad1f9fc..18fc845 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -13,5 +13,5 @@ const response = await tablesDB.updateEmailColumn({ key: '', required: false, default: 'email@example.com', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 3b887f9..e282ec8 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -14,5 +14,5 @@ const response = await tablesDB.updateEnumColumn({ elements: [], required: false, default: '<DEFAULT>', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 4433127..6ee1c5a 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -13,7 +13,7 @@ const response = await tablesDB.updateFloatColumn({ key: '', required: false, default: null, - min: null, - max: null, - newKey: '' + min: null, // optional + max: null, // optional + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 1158973..1d99683 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -13,7 +13,7 @@ const response = await tablesDB.updateIntegerColumn({ key: '', required: false, default: null, - min: null, - max: null, - newKey: '' + min: null, // optional + max: null, // optional + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index f2f405a..d69e0f1 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -13,5 +13,5 @@ const response = await tablesDB.updateIpColumn({ key: '', required: false, default: '', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 97b86d7..3f361e0 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -11,6 +11,6 @@ const response = await tablesDB.updateRelationshipColumn({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', key: '', - onDelete: RelationMutate.Cascade, - newKey: '' + onDelete: RelationMutate.Cascade, // optional + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 87e8be8..53848c7 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -11,6 +11,6 @@ const response = await tablesDB.updateRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', - data: {}, - permissions: ["read("any")"] + data: {}, // optional + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 852b7db..2a3e3f1 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -10,6 +10,6 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.updateRows({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', - data: {}, - queries: [] + data: {}, // optional + queries: [] // optional }); diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index dab18a2..ff532ae 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -13,6 +13,6 @@ const response = await tablesDB.updateStringColumn({ key: '', required: false, default: '<DEFAULT>', - size: 1, - newKey: '' + size: 1, // optional + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 6a36b09..c0453f6 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -11,7 +11,7 @@ const response = await tablesDB.updateTable({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', name: '<NAME>', - permissions: ["read("any")"], - rowSecurity: false, - enabled: false + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional }); diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 3ae1f04..a594499 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -13,5 +13,5 @@ const response = await tablesDB.updateUrlColumn({ key: '', required: false, default: 'https://example.com', - newKey: '' + newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 59d58fb..f309641 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -10,5 +10,5 @@ const tablesDB = new TablesDB(client); const response = await tablesDB.update({ databaseId: '<DATABASE_ID>', name: '<NAME>', - enabled: false + enabled: false // optional }); diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index ec69e83..701e1a2 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -11,6 +11,6 @@ const response = await tablesDB.upsertRow({ databaseId: '<DATABASE_ID>', tableId: '<TABLE_ID>', rowId: '<ROW_ID>', - data: {}, - permissions: ["read("any")"] + data: {}, // optional + permissions: ["read("any")"] // optional }); diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index fc3b8b4..27e4ec7 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -10,9 +10,9 @@ const teams = new Teams(client); const response = await teams.createMembership({ teamId: '<TEAM_ID>', roles: [], - email: 'email@example.com', - userId: '<USER_ID>', - phone: '+12065550100', - url: 'https://example.com', - name: '<NAME>' + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional }); diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 7247da9..0c92129 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -10,5 +10,5 @@ const teams = new Teams(client); const response = await teams.create({ teamId: '<TEAM_ID>', name: '<NAME>', - roles: [] + roles: [] // optional }); diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 1d67b15..f781fff 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -9,6 +9,6 @@ const teams = new Teams(client); const response = await teams.listMemberships({ teamId: '<TEAM_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 0fd5079..4bb0c41 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -8,6 +8,6 @@ const client = new Client() const teams = new Teams(client); const response = await teams.list({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 52fd3c7..e0d5b4d 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -10,5 +10,5 @@ const tokens = new Tokens(client); const response = await tokens.createFileToken({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', - expire: '' + expire: '' // optional }); diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 93e91d3..a33ac66 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -10,5 +10,5 @@ const tokens = new Tokens(client); const response = await tokens.list({ bucketId: '<BUCKET_ID>', fileId: '<FILE_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 391118c..0524e05 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -9,5 +9,5 @@ const tokens = new Tokens(client); const response = await tokens.update({ tokenId: '<TOKEN_ID>', - expire: '' + expire: '' // optional }); diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon-2-user.md similarity index 93% rename from docs/examples/users/create-argon2user.md rename to docs/examples/users/create-argon-2-user.md index 8ec4edc..b08fbb9 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -11,5 +11,5 @@ const response = await users.createArgon2User({ userId: '<USER_ID>', email: 'email@example.com', password: 'password', - name: '<NAME>' + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 75ef72d..6501c02 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -11,5 +11,5 @@ const response = await users.createBcryptUser({ userId: '<USER_ID>', email: 'email@example.com', password: 'password', - name: '<NAME>' + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-jwt.md similarity index 84% rename from docs/examples/users/create-j-w-t.md rename to docs/examples/users/create-jwt.md index 4fef1c6..6cd2f3d 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-jwt.md @@ -9,6 +9,6 @@ const users = new Users(client); const response = await users.createJWT({ userId: '<USER_ID>', - sessionId: '<SESSION_ID>', - duration: 0 + sessionId: '<SESSION_ID>', // optional + duration: 0 // optional }); diff --git a/docs/examples/users/create-m-f-a-recovery-codes.md b/docs/examples/users/create-m-f-a-recovery-codes.md deleted file mode 100644 index fe8a4af..0000000 --- a/docs/examples/users/create-m-f-a-recovery-codes.md +++ /dev/null @@ -1,12 +0,0 @@ -import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 users = new Users(client); - -const response = await users.createMFARecoveryCodes({ - userId: '<USER_ID>' -}); diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-md-5-user.md similarity index 93% rename from docs/examples/users/create-m-d5user.md rename to docs/examples/users/create-md-5-user.md index bf29090..4af161f 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-md-5-user.md @@ -11,5 +11,5 @@ const response = await users.createMD5User({ userId: '<USER_ID>', email: 'email@example.com', password: 'password', - name: '<NAME>' + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index cb33377..fe8a4af 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.createMfaRecoveryCodes({ +const response = await users.createMFARecoveryCodes({ userId: '<USER_ID>' }); diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-ph-pass-user.md similarity index 93% rename from docs/examples/users/create-p-h-pass-user.md rename to docs/examples/users/create-ph-pass-user.md index d461887..d1f159a 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -11,5 +11,5 @@ const response = await users.createPHPassUser({ userId: '<USER_ID>', email: 'email@example.com', password: 'password', - name: '<NAME>' + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 7b9c908..e382a4a 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -14,5 +14,5 @@ const response = await users.createScryptModifiedUser({ passwordSalt: '<PASSWORD_SALT>', passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', passwordSignerKey: '<PASSWORD_SIGNER_KEY>', - name: '<NAME>' + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 63c25f4..7a6c874 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -16,5 +16,5 @@ const response = await users.createScryptUser({ passwordMemory: null, passwordParallel: null, passwordLength: null, - name: '<NAME>' + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-sha-user.md similarity index 84% rename from docs/examples/users/create-s-h-a-user.md rename to docs/examples/users/create-sha-user.md index 3819016..325da0e 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-sha-user.md @@ -11,6 +11,6 @@ const response = await users.createSHAUser({ userId: '<USER_ID>', email: 'email@example.com', password: 'password', - passwordVersion: PasswordHash.Sha1, - name: '<NAME>' + passwordVersion: PasswordHash.Sha1, // optional + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index cd542d4..861c25a 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -12,6 +12,6 @@ const response = await users.createTarget({ targetId: '<TARGET_ID>', providerType: MessagingProviderType.Email, identifier: '<IDENTIFIER>', - providerId: '<PROVIDER_ID>', - name: '<NAME>' + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional }); diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 2a215d9..b84d095 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -9,6 +9,6 @@ const users = new Users(client); const response = await users.createToken({ userId: '<USER_ID>', - length: 4, - expire: 60 + length: 4, // optional + expire: 60 // optional }); diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index cee05f3..7da9b9a 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -9,8 +9,8 @@ const users = new Users(client); const response = await users.create({ userId: '<USER_ID>', - email: 'email@example.com', - phone: '+12065550100', - password: '', - name: '<NAME>' + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: '', // optional + name: '<NAME>' // optional }); diff --git a/docs/examples/users/delete-m-f-a-authenticator.md b/docs/examples/users/delete-m-f-a-authenticator.md deleted file mode 100644 index 5097cff..0000000 --- a/docs/examples/users/delete-m-f-a-authenticator.md +++ /dev/null @@ -1,13 +0,0 @@ -import { Client, Users, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 users = new Users(client); - -const response = await users.deleteMFAAuthenticator({ - userId: '<USER_ID>', - type: AuthenticatorType.Totp -}); diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 2945d5c..5097cff 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.deleteMfaAuthenticator({ +const response = await users.deleteMFAAuthenticator({ userId: '<USER_ID>', type: AuthenticatorType.Totp }); diff --git a/docs/examples/users/get-m-f-a-recovery-codes.md b/docs/examples/users/get-m-f-a-recovery-codes.md deleted file mode 100644 index c2e4752..0000000 --- a/docs/examples/users/get-m-f-a-recovery-codes.md +++ /dev/null @@ -1,12 +0,0 @@ -import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 users = new Users(client); - -const response = await users.getMFARecoveryCodes({ - userId: '<USER_ID>' -}); diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 7d00af0..c2e4752 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.getMfaRecoveryCodes({ +const response = await users.getMFARecoveryCodes({ userId: '<USER_ID>' }); diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index ae7ce5d..f911007 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -8,6 +8,6 @@ const client = new Client() const users = new Users(client); const response = await users.listIdentities({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 62e5625..a039a74 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -9,5 +9,5 @@ const users = new Users(client); const response = await users.listLogs({ userId: '<USER_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/users/list-m-f-a-factors.md b/docs/examples/users/list-m-f-a-factors.md deleted file mode 100644 index c413011..0000000 --- a/docs/examples/users/list-m-f-a-factors.md +++ /dev/null @@ -1,12 +0,0 @@ -import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 users = new Users(client); - -const response = await users.listMFAFactors({ - userId: '<USER_ID>' -}); diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 20993dc..538a635 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -9,6 +9,6 @@ const users = new Users(client); const response = await users.listMemberships({ userId: '<USER_ID>', - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index e54e9be..c413011 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.listMfaFactors({ +const response = await users.listMFAFactors({ userId: '<USER_ID>' }); diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index a9571dc..9eee79f 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -9,5 +9,5 @@ const users = new Users(client); const response = await users.listTargets({ userId: '<USER_ID>', - queries: [] + queries: [] // optional }); diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 9b8b4fe..df73463 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -8,6 +8,6 @@ const client = new Client() const users = new Users(client); const response = await users.list({ - queries: [], - search: '<SEARCH>' + queries: [], // optional + search: '<SEARCH>' // optional }); diff --git a/docs/examples/users/update-m-f-a-recovery-codes.md b/docs/examples/users/update-m-f-a-recovery-codes.md deleted file mode 100644 index ce1b875..0000000 --- a/docs/examples/users/update-m-f-a-recovery-codes.md +++ /dev/null @@ -1,12 +0,0 @@ -import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 users = new Users(client); - -const response = await users.updateMFARecoveryCodes({ - userId: '<USER_ID>' -}); diff --git a/docs/examples/users/update-m-f-a.md b/docs/examples/users/update-m-f-a.md deleted file mode 100644 index 235357f..0000000 --- a/docs/examples/users/update-m-f-a.md +++ /dev/null @@ -1,13 +0,0 @@ -import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; - -const client = new 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 users = new Users(client); - -const response = await users.updateMFA({ - userId: '<USER_ID>', - mfa: false -}); diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 9bfd395..ce1b875 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -7,6 +7,6 @@ const client = new Client() const users = new Users(client); -const response = await users.updateMfaRecoveryCodes({ +const response = await users.updateMFARecoveryCodes({ userId: '<USER_ID>' }); diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 97a1afc..235357f 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -7,7 +7,7 @@ const client = new Client() const users = new Users(client); -const response = await users.updateMfa({ +const response = await users.updateMFA({ userId: '<USER_ID>', mfa: false }); diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 437c614..ebc039b 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -10,7 +10,7 @@ const users = new Users(client); const response = await users.updateTarget({ userId: '<USER_ID>', targetId: '<TARGET_ID>', - identifier: '<IDENTIFIER>', - providerId: '<PROVIDER_ID>', - name: '<NAME>' + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional }); diff --git a/mod.ts b/mod.ts index eea37a3..d289cc7 100644 --- a/mod.ts +++ b/mod.ts @@ -29,7 +29,7 @@ import { RelationshipType } from "./src/enums/relationship-type.ts"; import { RelationMutate } from "./src/enums/relation-mutate.ts"; import { IndexType } from "./src/enums/index-type.ts"; import { Runtime } from "./src/enums/runtime.ts"; -import { VCSDeploymentType } from "./src/enums/v-c-s-deployment-type.ts"; +import { VCSDeploymentType } from "./src/enums/vcs-deployment-type.ts"; import { DeploymentDownloadType } from "./src/enums/deployment-download-type.ts"; import { ExecutionMethod } from "./src/enums/execution-method.ts"; import { Name } from "./src/enums/name.ts"; diff --git a/src/enums/v-c-s-deployment-type.ts b/src/enums/vcs-deployment-type.ts similarity index 100% rename from src/enums/v-c-s-deployment-type.ts rename to src/enums/vcs-deployment-type.ts diff --git a/src/services/functions.ts b/src/services/functions.ts index 2a5b345..6c30109 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -6,7 +6,7 @@ import { AppwriteException } from '../exception.ts'; import type { Models } from '../models.d.ts'; import { Query } from '../query.ts'; import { Runtime } from '../enums/runtime.ts'; -import { VCSDeploymentType } from '../enums/v-c-s-deployment-type.ts'; +import { VCSDeploymentType } from '../enums/vcs-deployment-type.ts'; import { DeploymentDownloadType } from '../enums/deployment-download-type.ts'; import { ExecutionMethod } from '../enums/execution-method.ts'; diff --git a/src/services/sites.ts b/src/services/sites.ts index f0b06b9..e02e99b 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -8,7 +8,7 @@ import { Query } from '../query.ts'; import { Framework } from '../enums/framework.ts'; import { BuildRuntime } from '../enums/build-runtime.ts'; import { Adapter } from '../enums/adapter.ts'; -import { VCSDeploymentType } from '../enums/v-c-s-deployment-type.ts'; +import { VCSDeploymentType } from '../enums/vcs-deployment-type.ts'; import { DeploymentDownloadType } from '../enums/deployment-download-type.ts'; export type UploadProgress = { diff --git a/src/services/tables-d-b.ts b/src/services/tables-db.ts similarity index 100% rename from src/services/tables-d-b.ts rename to src/services/tables-db.ts diff --git a/test/services/tables-d-b.test.ts b/test/services/tables-db.test.ts similarity index 100% rename from test/services/tables-d-b.test.ts rename to test/services/tables-db.test.ts From 1a9de2104a7df774776f599aa4dabe030a149c49 Mon Sep 17 00:00:00 2001 From: Jake Barnby <jakeb994@gmail.com> Date: Tue, 26 Aug 2025 19:10:12 +1200 Subject: [PATCH 8/8] Fix casing --- mod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod.ts b/mod.ts index d289cc7..b228185 100644 --- a/mod.ts +++ b/mod.ts @@ -15,7 +15,7 @@ import { Locale } from "./src/services/locale.ts"; import { Messaging } from "./src/services/messaging.ts"; import { Sites } from "./src/services/sites.ts"; import { Storage } from "./src/services/storage.ts"; -import { TablesDB } from "./src/services/tables-d-b.ts"; +import { TablesDB } from "./src/services/tables-db.ts"; import { Teams } from "./src/services/teams.ts"; import { Tokens } from "./src/services/tokens.ts"; import { Users } from "./src/services/users.ts";