From 8f831b2be35998d849a0d1ee9c7224174158a771 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 6 Jun 2022 18:27:05 -0400 Subject: [PATCH 01/33] Allows to update permissions without payload --- app/controllers/api/database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 0ed47d4b5f..228420f353 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1992,8 +1992,8 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array - if (empty($data)) { - throw new Exception('Missing payload', 400); + if (empty($data) && empty($read) && empty($write)) { + throw new Exception('Missing payload or read/write permissions', 400); } if (!\is_array($data)) { From 3cf26d19bcd0b31175f283bf4fd2b53882648bbe Mon Sep 17 00:00:00 2001 From: gepd Date: Tue, 7 Jun 2022 21:08:11 -0400 Subject: [PATCH 02/33] make data optional --- app/controllers/api/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 1e67f4d4e6..2a36f2b5f7 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1868,7 +1868,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->inject('usage') ->inject('events') ->inject('mode') - ->action(function (string $collectionId, string $documentId, string|array $data, ?array $read, ?array $write, Response $response, Database $dbForProject, EventAudit $audits, Stats $usage, Event $events, string $mode) { + ->action(function (string $collectionId, string $documentId, string|array|null $data, ?array $read, ?array $write, Response $response, Database $dbForProject, EventAudit $audits, Stats $usage, Event $events, string $mode) { /** * Skip Authorization to get the collection. Needed in case of empty permissions for document level permissions. From 2e05afe35abe58c27cb3b90bee5866d1af27de15 Mon Sep 17 00:00:00 2001 From: gepd Date: Wed, 8 Jun 2022 20:49:27 -0400 Subject: [PATCH 03/33] Make param optional from utopia --- app/controllers/api/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 2a36f2b5f7..5e8a0a6b1d 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1859,7 +1859,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->label('sdk.response.model', Response::MODEL_DOCUMENT) ->param('collectionId', null, new UID(), 'Collection ID.') ->param('documentId', null, new UID(), 'Document ID.') - ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.') + ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) ->param('read', null, new Permissions(), 'An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->param('write', null, new Permissions(), 'An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->inject('response') From d96b077d222e3a10cf5564ab401517531cb688b8 Mon Sep 17 00:00:00 2001 From: gepd Date: Thu, 9 Jun 2022 15:32:34 -0400 Subject: [PATCH 04/33] remove null as param is already nullable Co-authored-by: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> --- app/controllers/api/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 5e8a0a6b1d..db5d743ed7 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1868,7 +1868,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->inject('usage') ->inject('events') ->inject('mode') - ->action(function (string $collectionId, string $documentId, string|array|null $data, ?array $read, ?array $write, Response $response, Database $dbForProject, EventAudit $audits, Stats $usage, Event $events, string $mode) { + ->action(function (string $collectionId, string $documentId, string|array $data, ?array $read, ?array $write, Response $response, Database $dbForProject, EventAudit $audits, Stats $usage, Event $events, string $mode) { /** * Skip Authorization to get the collection. Needed in case of empty permissions for document level permissions. From d1505917a311278863db48a2514afe94e02d3b4b Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 12:18:00 -0400 Subject: [PATCH 05/33] committed suggested changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- app/controllers/api/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index db5d743ed7..abd22d3faf 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1901,7 +1901,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array if (empty($data) && empty($read) && empty($write)) { - throw new Exception('Missing payload or read/write permissions', 400); + throw new Exception('Missing payload or read/write permissions', 400, Exception::DOCUMENT_MISSING_PAYLOAD); } if (!\is_array($data)) { From 7b60a36eead964d880eda4283f79534b22a3e7ab Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 13:49:34 -0400 Subject: [PATCH 06/33] added test to update permissions with empty payload --- tests/e2e/Services/Database/DatabaseBase.php | 60 ++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index f59e5ad56b..0ea07f70bc 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2160,6 +2160,66 @@ trait DatabaseBase $this->assertEquals(409, $duplicate['headers']['status-code']); + return $data; + } + + /** + * @depends testCreateIndexes + */ + public function testUpdatePermissionsWithEmptyPayload(array $data): array + { + $document1 = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'unique()', + 'data' => [ + 'title' => 'Captain America', + 'releaseYear' => 1944, + 'actors' => [ + 'Chris Evans', + 'Samuel Jackson', + ] + ], + 'read' => ['user:' . $this->getUser()['$id']], + 'write' => ['user:' . $this->getUser()['$id']], + ]); + + $id = $document['body']['$id']; + + $document2 = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/'.$id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'read' => [], + 'write' => [], + ]); + + $this->assertEquals($document1['headers']['status-code'], 201); + $this->assertEquals($document1['body']['title'], 'Captain America'); + $this->assertEquals($document1['body']['releaseYear'], 1944); + $this->assertIsArray($document1['body']['$read']); + $this->assertIsArray($document1['body']['$write']); + $this->assertCount(1, $document1['body']['$read']); + $this->assertCount(1, $document1['body']['$write']); + $this->assertCount(2, $document1['body']['actors']); + $this->assertEquals($document1['body']['actors'][0], 'Chris Evans'); + $this->assertEquals($document1['body']['actors'][1], 'Samuel Jackson'); + + if ($this->getSide() == 'client') { + $this->assertEquals($document2['headers']['status-code'], 401); + } + + if ($this->getSide() == 'server') { + $this->assertEquals($document2['headers']['status-code'], 200); + $this->assertEquals($document2['body']['title'], 'Captain America'); + $this->assertEquals($document2['body']['releaseYear'], 1944); + $this->assertCount(0, $document2['body']['$read']); + $this->assertCount(0, $document2['body']['$write']); + $this->assertEquals([], $document2['body']['$read']); + $this->assertEquals([], $document2['body']['$write']); + } + return $data; } } From ca455b380efcf63ea9c52510270af7797a4612d4 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 14:03:15 -0400 Subject: [PATCH 07/33] Fixed linting errors --- tests/e2e/Services/Database/DatabaseBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 0ea07f70bc..17073bd894 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2187,7 +2187,7 @@ trait DatabaseBase $id = $document['body']['$id']; - $document2 = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/'.$id, array_merge([ + $document2 = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2206,7 +2206,7 @@ trait DatabaseBase $this->assertEquals($document1['body']['actors'][0], 'Chris Evans'); $this->assertEquals($document1['body']['actors'][1], 'Samuel Jackson'); - if ($this->getSide() == 'client') { + if ($this->getSide() == 'client') { $this->assertEquals($document2['headers']['status-code'], 401); } From 7cb19a725f79115b5737c84e0c224eca5ef72a23 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 14:24:49 -0400 Subject: [PATCH 08/33] fixed minor typo --- tests/e2e/Services/Database/DatabaseBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 17073bd894..b0b02f103a 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2185,7 +2185,7 @@ trait DatabaseBase 'write' => ['user:' . $this->getUser()['$id']], ]); - $id = $document['body']['$id']; + $id = $document1['body']['$id']; $document2 = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', From 0bade37a260d103628c449afabbabec5ad9ba32c Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 15:15:49 -0400 Subject: [PATCH 09/33] updated test --- tests/e2e/Services/Database/DatabaseBase.php | 60 +++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index b0b02f103a..202206e2ff 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2168,7 +2168,7 @@ trait DatabaseBase */ public function testUpdatePermissionsWithEmptyPayload(array $data): array { - $document1 = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ + $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2176,18 +2176,35 @@ trait DatabaseBase 'data' => [ 'title' => 'Captain America', 'releaseYear' => 1944, - 'actors' => [ - 'Chris Evans', - 'Samuel Jackson', - ] + 'actors' => [], ], - 'read' => ['user:' . $this->getUser()['$id']], - 'write' => ['user:' . $this->getUser()['$id']], ]); - $id = $document1['body']['$id']; + $id = $document['body']['$id']; - $document2 = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + $this->assertEquals($document['headers']['status-code'], 201); + $this->assertEquals($document['body']['title'], 'Captain America'); + $this->assertEquals($document['body']['releaseYear'], 1944); + $this->assertIsArray($document['body']['$read']); + $this->assertIsArray($document['body']['$write']); + + if ($this->getSide() == 'client') { + $this->assertCount(1, $document['body']['$read']); + $this->assertCount(1, $document['body']['$write']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); + } + + if ($this->getSide() == 'server') { + $this->assertCount(0, $document['body']['$read']); + $this->assertCount(0, $document['body']['$write']); + $this->assertEquals([], $document['body']['$read']); + $this->assertEquals([], $document['body']['$write']); + } + + // Reset Permissions + + $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2195,29 +2212,16 @@ trait DatabaseBase 'write' => [], ]); - $this->assertEquals($document1['headers']['status-code'], 201); - $this->assertEquals($document1['body']['title'], 'Captain America'); - $this->assertEquals($document1['body']['releaseYear'], 1944); - $this->assertIsArray($document1['body']['$read']); - $this->assertIsArray($document1['body']['$write']); - $this->assertCount(1, $document1['body']['$read']); - $this->assertCount(1, $document1['body']['$write']); - $this->assertCount(2, $document1['body']['actors']); - $this->assertEquals($document1['body']['actors'][0], 'Chris Evans'); - $this->assertEquals($document1['body']['actors'][1], 'Samuel Jackson'); - if ($this->getSide() == 'client') { - $this->assertEquals($document2['headers']['status-code'], 401); + $this->assertEquals($document['headers']['status-code'], 401); } if ($this->getSide() == 'server') { - $this->assertEquals($document2['headers']['status-code'], 200); - $this->assertEquals($document2['body']['title'], 'Captain America'); - $this->assertEquals($document2['body']['releaseYear'], 1944); - $this->assertCount(0, $document2['body']['$read']); - $this->assertCount(0, $document2['body']['$write']); - $this->assertEquals([], $document2['body']['$read']); - $this->assertEquals([], $document2['body']['$write']); + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertCount(0, $document['body']['$read']); + $this->assertCount(0, $document['body']['$write']); + $this->assertEquals([], $document['body']['$read']); + $this->assertEquals([], $document['body']['$write']); } return $data; From 52757ef89fddda43a488ec2442d0ad5e2bfa48aa Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 15:53:41 -0400 Subject: [PATCH 10/33] updated test --- tests/e2e/Services/Database/DatabaseBase.php | 128 +++++++++---------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 202206e2ff..9843864150 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -1294,6 +1294,70 @@ trait DatabaseBase return []; } + /** + * @depends testCreateDocument + */ + public function testUpdatePermissionsWithEmptyPayload(array $data): array + { + $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'unique()', + 'data' => [ + 'title' => 'Captain America', + 'releaseYear' => 1944, + 'actors' => [], + ], + ]); + + $id = $document['body']['$id']; + + $this->assertEquals($document['headers']['status-code'], 201); + $this->assertEquals($document['body']['title'], 'Captain America'); + $this->assertEquals($document['body']['releaseYear'], 1944); + $this->assertIsArray($document['body']['$read']); + $this->assertIsArray($document['body']['$write']); + + if ($this->getSide() == 'client') { + $this->assertCount(1, $document['body']['$read']); + $this->assertCount(1, $document['body']['$write']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); + } + + if ($this->getSide() == 'server') { + $this->assertCount(0, $document['body']['$read']); + $this->assertCount(0, $document['body']['$write']); + $this->assertEquals([], $document['body']['$read']); + $this->assertEquals([], $document['body']['$write']); + } + + // Reset Permissions + + $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'read' => [], + 'write' => [], + ]); + + if ($this->getSide() == 'client') { + $this->assertEquals($document['headers']['status-code'], 401); + } + + if ($this->getSide() == 'server') { + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertCount(0, $document['body']['$read']); + $this->assertCount(0, $document['body']['$write']); + $this->assertEquals([], $document['body']['$read']); + $this->assertEquals([], $document['body']['$write']); + } + + return $data; + } + /** * @depends testCreateDocument */ @@ -2160,70 +2224,6 @@ trait DatabaseBase $this->assertEquals(409, $duplicate['headers']['status-code']); - return $data; - } - - /** - * @depends testCreateIndexes - */ - public function testUpdatePermissionsWithEmptyPayload(array $data): array - { - $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => 'unique()', - 'data' => [ - 'title' => 'Captain America', - 'releaseYear' => 1944, - 'actors' => [], - ], - ]); - - $id = $document['body']['$id']; - - $this->assertEquals($document['headers']['status-code'], 201); - $this->assertEquals($document['body']['title'], 'Captain America'); - $this->assertEquals($document['body']['releaseYear'], 1944); - $this->assertIsArray($document['body']['$read']); - $this->assertIsArray($document['body']['$write']); - - if ($this->getSide() == 'client') { - $this->assertCount(1, $document['body']['$read']); - $this->assertCount(1, $document['body']['$write']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); - } - - if ($this->getSide() == 'server') { - $this->assertCount(0, $document['body']['$read']); - $this->assertCount(0, $document['body']['$write']); - $this->assertEquals([], $document['body']['$read']); - $this->assertEquals([], $document['body']['$write']); - } - - // Reset Permissions - - $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'read' => [], - 'write' => [], - ]); - - if ($this->getSide() == 'client') { - $this->assertEquals($document['headers']['status-code'], 401); - } - - if ($this->getSide() == 'server') { - $this->assertEquals($document['headers']['status-code'], 200); - $this->assertCount(0, $document['body']['$read']); - $this->assertCount(0, $document['body']['$write']); - $this->assertEquals([], $document['body']['$read']); - $this->assertEquals([], $document['body']['$write']); - } - return $data; } } From 43ed2591d0f81dce08854191cee0d075c8fb6323 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 16:28:45 -0400 Subject: [PATCH 11/33] added empty array as default --- tests/e2e/Services/Database/DatabaseBase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 9843864150..7ca908e8a8 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -1339,6 +1339,7 @@ trait DatabaseBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ + 'data' => [], 'read' => [], 'write' => [], ]); From dab6f97a313899e830a6fe635413edc8a3d3e242 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 18:24:51 -0400 Subject: [PATCH 12/33] remove dependency --- tests/e2e/Services/Database/DatabaseBase.php | 127 +++++++++---------- 1 file changed, 62 insertions(+), 65 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 7ca908e8a8..dc9ab1cbd8 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -1294,71 +1294,6 @@ trait DatabaseBase return []; } - /** - * @depends testCreateDocument - */ - public function testUpdatePermissionsWithEmptyPayload(array $data): array - { - $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => 'unique()', - 'data' => [ - 'title' => 'Captain America', - 'releaseYear' => 1944, - 'actors' => [], - ], - ]); - - $id = $document['body']['$id']; - - $this->assertEquals($document['headers']['status-code'], 201); - $this->assertEquals($document['body']['title'], 'Captain America'); - $this->assertEquals($document['body']['releaseYear'], 1944); - $this->assertIsArray($document['body']['$read']); - $this->assertIsArray($document['body']['$write']); - - if ($this->getSide() == 'client') { - $this->assertCount(1, $document['body']['$read']); - $this->assertCount(1, $document['body']['$write']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); - } - - if ($this->getSide() == 'server') { - $this->assertCount(0, $document['body']['$read']); - $this->assertCount(0, $document['body']['$write']); - $this->assertEquals([], $document['body']['$read']); - $this->assertEquals([], $document['body']['$write']); - } - - // Reset Permissions - - $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [], - 'read' => [], - 'write' => [], - ]); - - if ($this->getSide() == 'client') { - $this->assertEquals($document['headers']['status-code'], 401); - } - - if ($this->getSide() == 'server') { - $this->assertEquals($document['headers']['status-code'], 200); - $this->assertCount(0, $document['body']['$read']); - $this->assertCount(0, $document['body']['$write']); - $this->assertEquals([], $document['body']['$read']); - $this->assertEquals([], $document['body']['$write']); - } - - return $data; - } - /** * @depends testCreateDocument */ @@ -2227,4 +2162,66 @@ trait DatabaseBase return $data; } + + public function testUpdatePermissionsWithEmptyPayload(array $data): array + { + $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'unique()', + 'data' => [ + 'title' => 'Captain America', + 'releaseYear' => 1944, + 'actors' => [], + ], + ]); + + $id = $document['body']['$id']; + + $this->assertEquals($document['headers']['status-code'], 201); + $this->assertEquals($document['body']['title'], 'Captain America'); + $this->assertEquals($document['body']['releaseYear'], 1944); + $this->assertIsArray($document['body']['$read']); + $this->assertIsArray($document['body']['$write']); + + if ($this->getSide() == 'client') { + $this->assertCount(1, $document['body']['$read']); + $this->assertCount(1, $document['body']['$write']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); + } + + if ($this->getSide() == 'server') { + $this->assertCount(0, $document['body']['$read']); + $this->assertCount(0, $document['body']['$write']); + $this->assertEquals([], $document['body']['$read']); + $this->assertEquals([], $document['body']['$write']); + } + + // Reset Permissions + + $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [], + 'read' => [], + 'write' => [], + ]); + + if ($this->getSide() == 'client') { + $this->assertEquals($document['headers']['status-code'], 401); + } + + if ($this->getSide() == 'server') { + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertCount(0, $document['body']['$read']); + $this->assertCount(0, $document['body']['$write']); + $this->assertEquals([], $document['body']['$read']); + $this->assertEquals([], $document['body']['$write']); + } + + return $data; + } } From bfe3cdecc506e1125d5bd0e8a2169ff861dafe6b Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 18:33:26 -0400 Subject: [PATCH 13/33] create collection and attribute --- tests/e2e/Services/Database/DatabaseBase.php | 41 ++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index dc9ab1cbd8..85933f29ff 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2165,6 +2165,44 @@ trait DatabaseBase public function testUpdatePermissionsWithEmptyPayload(array $data): array { + // Create collection + $movies = $this->client->call(Client::METHOD_POST, '/database/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => 'unique()', + 'name' => 'Movies', + 'read' => [], + 'write' => [], + 'permission' => 'document', + ]); + + $this->assertEquals($movies['headers']['status-code'], 201); + $this->assertEquals($movies['body']['name'], 'Movies'); + + // create attribute + + $title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals($title['headers']['status-code'], 201); + $this->assertEquals($title['body']['key'], 'title'); + $this->assertEquals($title['body']['type'], 'string'); + $this->assertEquals($title['body']['size'], 256); + $this->assertEquals($title['body']['required'], true); + + // wait for database worker to create attributes + sleep(2); + + // add document $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -2172,8 +2210,6 @@ trait DatabaseBase 'documentId' => 'unique()', 'data' => [ 'title' => 'Captain America', - 'releaseYear' => 1944, - 'actors' => [], ], ]); @@ -2181,7 +2217,6 @@ trait DatabaseBase $this->assertEquals($document['headers']['status-code'], 201); $this->assertEquals($document['body']['title'], 'Captain America'); - $this->assertEquals($document['body']['releaseYear'], 1944); $this->assertIsArray($document['body']['$read']); $this->assertIsArray($document['body']['$write']); From 5067a4640bd1d2970ea4de3eddc3d9f64f02fe5b Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 19:04:40 -0400 Subject: [PATCH 14/33] Remove $data argument --- tests/e2e/Services/Database/DatabaseBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 85933f29ff..9049537988 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2163,7 +2163,7 @@ trait DatabaseBase return $data; } - public function testUpdatePermissionsWithEmptyPayload(array $data): array + public function testUpdatePermissionsWithEmptyPayload(): array { // Create collection $movies = $this->client->call(Client::METHOD_POST, '/database/collections', array_merge([ From 9dab76f3577d476bf017e6a7b768f401b9eb937f Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 19:32:24 -0400 Subject: [PATCH 15/33] get $id from response --- tests/e2e/Services/Database/DatabaseBase.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 9049537988..ccffbb2d77 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2183,7 +2183,9 @@ trait DatabaseBase // create attribute - $title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes/string', array_merge([ + $moviesId = $movies['body']['$id']; + + $title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $moviesId . '/attributes/string', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2203,7 +2205,7 @@ trait DatabaseBase sleep(2); // add document - $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ + $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $moviesId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2236,7 +2238,7 @@ trait DatabaseBase // Reset Permissions - $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $moviesId . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ From c2ce37e6f3fa6a0e9cf345893923fe6d0b961a92 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 20:41:12 -0400 Subject: [PATCH 16/33] added read and write permissions --- tests/e2e/Services/Database/DatabaseBase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index ccffbb2d77..326a89beeb 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2213,6 +2213,8 @@ trait DatabaseBase 'data' => [ 'title' => 'Captain America', ], + 'read' => ['user:' . $this->getUser()['$id']], + 'write' => ['user:' . $this->getUser()['$id']], ]); $id = $document['body']['$id']; From 6cc6928ce9b7376e6a5c488cc73b785f8d1f7a48 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 20 Jun 2022 22:11:47 -0400 Subject: [PATCH 17/33] simplified test --- tests/e2e/Services/Database/DatabaseBase.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 326a89beeb..042590ca35 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2223,20 +2223,10 @@ trait DatabaseBase $this->assertEquals($document['body']['title'], 'Captain America'); $this->assertIsArray($document['body']['$read']); $this->assertIsArray($document['body']['$write']); - - if ($this->getSide() == 'client') { - $this->assertCount(1, $document['body']['$read']); - $this->assertCount(1, $document['body']['$write']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); - } - - if ($this->getSide() == 'server') { - $this->assertCount(0, $document['body']['$read']); - $this->assertCount(0, $document['body']['$write']); - $this->assertEquals([], $document['body']['$read']); - $this->assertEquals([], $document['body']['$write']); - } + $this->assertCount(1, $document['body']['$read']); + $this->assertCount(1, $document['body']['$write']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); // Reset Permissions From addfae2f46331a63e588ae6d43dd14c03ae261dc Mon Sep 17 00:00:00 2001 From: gepd Date: Wed, 22 Jun 2022 19:38:56 -0400 Subject: [PATCH 18/33] fix tests --- tests/e2e/Services/Database/DatabaseBase.php | 67 ++++++++++++-------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 042590ca35..13ec60bfb0 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2180,11 +2180,10 @@ trait DatabaseBase $this->assertEquals($movies['headers']['status-code'], 201); $this->assertEquals($movies['body']['name'], 'Movies'); - - // create attribute - + $moviesId = $movies['body']['$id']; - + + // create attribute $title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $moviesId . '/attributes/string', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -2196,10 +2195,6 @@ trait DatabaseBase ]); $this->assertEquals($title['headers']['status-code'], 201); - $this->assertEquals($title['body']['key'], 'title'); - $this->assertEquals($title['body']['type'], 'string'); - $this->assertEquals($title['body']['size'], 256); - $this->assertEquals($title['body']['required'], true); // wait for database worker to create attributes sleep(2); @@ -2213,44 +2208,60 @@ trait DatabaseBase 'data' => [ 'title' => 'Captain America', ], - 'read' => ['user:' . $this->getUser()['$id']], - 'write' => ['user:' . $this->getUser()['$id']], + 'read' => ['role:all'], + 'write' => ['role:all'], ]); $id = $document['body']['$id']; $this->assertEquals($document['headers']['status-code'], 201); - $this->assertEquals($document['body']['title'], 'Captain America'); - $this->assertIsArray($document['body']['$read']); - $this->assertIsArray($document['body']['$write']); $this->assertCount(1, $document['body']['$read']); $this->assertCount(1, $document['body']['$write']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); - $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); - - // Reset Permissions + $this->assertEquals(['role:all'], $document['body']['$read']); + $this->assertEquals(['role:all'], $document['body']['$write']); + // Send only read permission $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $moviesId . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [], - 'read' => [], - 'write' => [], + ], $this->getHeaders()), [ + 'read' => ['user:' . $this->getUser()['$id']], ]); if ($this->getSide() == 'client') { - $this->assertEquals($document['headers']['status-code'], 401); + $this->assertEquals($document['headers']['status-code'], 200); } if ($this->getSide() == 'server') { $this->assertEquals($document['headers']['status-code'], 200); - $this->assertCount(0, $document['body']['$read']); - $this->assertCount(0, $document['body']['$write']); - $this->assertEquals([], $document['body']['$read']); - $this->assertEquals([], $document['body']['$write']); + $this->assertCount(1, $document['body']['$read']); + $this->assertCount(1, $document['body']['$write']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); + $this->assertEquals(['role:all'], $document['body']['$write']); } - return $data; + // send only write permission + $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $moviesId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'write' => ['user:' . $this->getUser()['$id']], + ]); + + if ($this->getSide() == 'server') { + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertCount(1, $document['body']['$read']); + $this->assertCount(1, $document['body']['$write']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$read']); + $this->assertEquals(['user:' . $this->getUser()['$id']], $document['body']['$write']); + } + + // remove collection + $this->client->call(Client::METHOD_DELETE, '/database/collections/' . $moviesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + return []; } -} +} \ No newline at end of file From 020e08143e516f6f38c5d7716a0d1d4c86443f67 Mon Sep 17 00:00:00 2001 From: gepd Date: Wed, 22 Jun 2022 20:45:33 -0400 Subject: [PATCH 19/33] fix linter --- tests/e2e/Services/Database/DatabaseBase.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 13ec60bfb0..1e31b9d188 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -2180,9 +2180,9 @@ trait DatabaseBase $this->assertEquals($movies['headers']['status-code'], 201); $this->assertEquals($movies['body']['name'], 'Movies'); - + $moviesId = $movies['body']['$id']; - + // create attribute $title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $moviesId . '/attributes/string', array_merge([ 'content-type' => 'application/json', @@ -2264,4 +2264,4 @@ trait DatabaseBase return []; } -} \ No newline at end of file +} From 3f8ab486c2bc0ce6e8d88ee5d413b1ef8e76f9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 23 Jun 2022 08:17:02 +0000 Subject: [PATCH 20/33] Lock createdAt --- app/controllers/api/databases.php | 1 + tests/e2e/Services/Databases/DatabasesBase.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index f288ac5391..be4b36aab1 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2221,6 +2221,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $data = \array_merge($document->getArrayCopy(), $data); $data['$collection'] = $collection->getId(); // Make sure user don't switch collectionID + $data['$createdAt'] = $collection->getCreatedAt(); // Make sure user don't switch createdAt $data['$id'] = $document->getId(); // Make sure user don't switch document unique ID $data['$read'] = (is_null($read)) ? ($document->getRead() ?? []) : $read; // By default inherit read permissions $data['$write'] = (is_null($write)) ? ($document->getWrite() ?? []) : $write; // By default inherit write permissions diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 20319add1a..ecc859a6bf 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -1320,6 +1320,7 @@ trait DatabasesBase 'title' => 'Thor: Ragnaroc', 'releaseYear' => 2017, 'actors' => [], + '$createdAt' => 5 // Should be ignored ], 'read' => ['user:' . $this->getUser()['$id']], 'write' => ['user:' . $this->getUser()['$id']], @@ -1330,6 +1331,7 @@ trait DatabasesBase $this->assertEquals($document['headers']['status-code'], 201); $this->assertEquals($document['body']['title'], 'Thor: Ragnaroc'); $this->assertEquals($document['body']['releaseYear'], 2017); + $this->assertNotEquals($document['body']['$createdAt'], 5); $this->assertEquals('user:' . $this->getUser()['$id'], $document['body']['$read'][0]); $this->assertEquals('user:' . $this->getUser()['$id'], $document['body']['$write'][0]); From 1a034d45f67f0051e92d1141491efaaea6481cac Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 23 Jun 2022 08:50:11 +0000 Subject: [PATCH 21/33] alias --- app/controllers/api/databases.php | 614 ++++++++++++++++-------------- 1 file changed, 321 insertions(+), 293 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index f288ac5391..36e4e2f455 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -482,6 +482,7 @@ App::delete('/v1/databases/:databaseId') }); App::post('/v1/databases/:databaseId/collections') + ->alias('/v1/database/collections', ['databaseId' => 'default']) ->desc('Create Collection') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].create') @@ -554,6 +555,7 @@ App::post('/v1/databases/:databaseId/collections') }); App::get('/v1/databases/:databaseId/collections') + ->alias('/v1/database/collections', ['databaseId' => 'default']) ->desc('List Collections') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -607,6 +609,7 @@ App::get('/v1/databases/:databaseId/collections') }); App::get('/v1/databases/:databaseId/collections/:collectionId') + ->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default']) ->desc('Get Collection') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -643,6 +646,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') }); App::get('/v1/databases/:databaseId/collections/:collectionId/logs') + ->alias('/v1/database/collections/:collectionId/logs', ['databaseId' => 'default']) ->desc('List Collection Logs') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -732,6 +736,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') App::put('/v1/databases/:databaseId/collections/:collectionId') + ->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default']) ->desc('Update Collection') ->groups(['api', 'database']) ->label('scope', 'collections.write') @@ -804,6 +809,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') }); App::delete('/v1/databases/:databaseId/collections/:collectionId') + ->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default']) ->desc('Delete Collection') ->groups(['api', 'database']) ->label('scope', 'collections.write') @@ -867,6 +873,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string') + ->alias('/v1/database/collections/:collectionId/attributes/string', ['databaseId' => 'default']) ->desc('Create String Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -912,6 +919,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email') + ->alias('/v1/database/collections/:collectionId/attributes/email', ['databaseId' => 'default']) ->desc('Create Email Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -951,6 +959,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email' }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') + ->alias('/v1/database/collections/:collectionId/attributes/enum', ['databaseId' => 'default']) ->desc('Create Enum Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -1006,6 +1015,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') + ->alias('/v1/database/collections/:collectionId/attributes/ip', ['databaseId' => 'default']) ->desc('Create IP Address Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -1045,6 +1055,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') + ->alias('/v1/database/collections/:collectionId/attributes/url', ['databaseId' => 'default']) ->desc('Create URL Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -1084,6 +1095,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/integer') + ->alias('/v1/database/collections/:collectionId/attributes/integer', ['databaseId' => 'default']) ->desc('Create Integer Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -1152,6 +1164,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float') + ->alias('/v1/database/collections/:collectionId/attributes/float', ['databaseId' => 'default']) ->desc('Create Float Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -1223,6 +1236,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float' }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean') + ->alias('/v1/database/collections/:collectionId/attributes/boolean', ['databaseId' => 'default']) ->desc('Create Boolean Attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') @@ -1261,6 +1275,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea }); App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') + ->alias('/v1/database/collections/:collectionId/attributes', ['databaseId' => 'default']) ->desc('List Attributes') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -1302,6 +1317,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') }); App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') + ->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default']) ->desc('Get Attribute') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -1372,6 +1388,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') }); App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') + ->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default']) ->desc('Delete Attribute') ->groups(['api', 'database']) ->label('scope', 'collections.write') @@ -1465,6 +1482,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key }); App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') + ->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default']) ->desc('Create Index') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].create') @@ -1588,6 +1606,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') }); App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') + ->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default']) ->desc('List Indexes') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -1629,6 +1648,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') }); App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') + ->alias('/v1/database/collections/:collectionId/indexes/:key', ['databaseId' => 'default']) ->desc('Get Index') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -1679,6 +1699,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') }); App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') + ->alias('/v1/database/collections/:collectionId/indexes/:key', ['databaseId' => 'default']) ->desc('Delete Index') ->groups(['api', 'database']) ->label('scope', 'collections.write') @@ -1753,6 +1774,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') }); App::post('/v1/databases/:databaseId/collections/:collectionId/documents') + ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) ->desc('Create Document') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create') @@ -1875,6 +1897,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') }); App::get('/v1/databases/:databaseId/collections/:collectionId/documents') + ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) ->desc('List Documents') ->groups(['api', 'database']) ->label('scope', 'documents.read') @@ -1988,6 +2011,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') }); App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') + ->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default']) ->desc('Get Document') ->groups(['api', 'database']) ->label('scope', 'documents.read') @@ -2057,6 +2081,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen }); App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/logs') + ->alias('/v1/database/collections/:collectionId/documents/:documentId/logs', ['databaseId' => 'default']) ->desc('List Document Logs') ->groups(['api', 'database']) ->label('scope', 'documents.read') @@ -2150,6 +2175,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen }); App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') + ->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default']) ->desc('Update Document') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update') @@ -2287,6 +2313,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum }); App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') + ->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default']) ->desc('Delete Document') ->groups(['api', 'database']) ->label('scope', 'documents.write') @@ -2386,330 +2413,331 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu }); App::get('/v1/databases/usage') -->desc('Get usage stats for the database') -->groups(['api', 'database']) -->label('scope', 'collections.read') -->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) -->label('sdk.namespace', 'databases') -->label('sdk.method', 'getUsage') -->label('sdk.response.code', Response::STATUS_CODE_OK) -->label('sdk.response.type', Response::CONTENT_TYPE_JSON) -->label('sdk.response.model', Response::MODEL_USAGE_DATABASES) -->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), '`Date range.', true) -->inject('response') -->inject('dbForProject') -->action(function (string $range, Response $response, Database $dbForProject) { + ->desc('Get usage stats for the database') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'databases') + ->label('sdk.method', 'getUsage') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_USAGE_DATABASES) + ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), '`Date range.', true) + ->inject('response') + ->inject('dbForProject') + ->action(function (string $range, Response $response, Database $dbForProject) { - $usage = []; - if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { - $periods = [ - '24h' => [ - 'period' => '30m', - 'limit' => 48, - ], - '7d' => [ - 'period' => '1d', - 'limit' => 7, - ], - '30d' => [ - 'period' => '1d', - 'limit' => 30, - ], - '90d' => [ - 'period' => '1d', - 'limit' => 90, - ], - ]; + $usage = []; + if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { + $periods = [ + '24h' => [ + 'period' => '30m', + 'limit' => 48, + ], + '7d' => [ + 'period' => '1d', + 'limit' => 7, + ], + '30d' => [ + 'period' => '1d', + 'limit' => 30, + ], + '90d' => [ + 'period' => '1d', + 'limit' => 90, + ], + ]; - $metrics = [ - 'databases.count', - 'databases.documents.count', - 'databases.collections.count', - 'databases.create', - 'databases.read', - 'databases.update', - 'databases.delete', - 'databases.collections.create', - 'databases.collections.read', - 'databases.collections.update', - 'databases.collections.delete', - 'databases.documents.create', - 'databases.documents.read', - 'databases.documents.update', - 'databases.documents.delete' - ]; + $metrics = [ + 'databases.count', + 'databases.documents.count', + 'databases.collections.count', + 'databases.create', + 'databases.read', + 'databases.update', + 'databases.delete', + 'databases.collections.create', + 'databases.collections.read', + 'databases.collections.update', + 'databases.collections.delete', + 'databases.documents.create', + 'databases.documents.read', + 'databases.documents.update', + 'databases.documents.delete' + ]; - $stats = []; + $stats = []; - Authorization::skip(function () use ($dbForProject, $periods, $range, $metrics, &$stats) { - foreach ($metrics as $metric) { - $limit = $periods[$range]['limit']; - $period = $periods[$range]['period']; + Authorization::skip(function () use ($dbForProject, $periods, $range, $metrics, &$stats) { + foreach ($metrics as $metric) { + $limit = $periods[$range]['limit']; + $period = $periods[$range]['period']; - $requestDocs = $dbForProject->find('stats', [ - new Query('period', Query::TYPE_EQUAL, [$period]), - new Query('metric', Query::TYPE_EQUAL, [$metric]), - ], $limit, 0, ['time'], [Database::ORDER_DESC]); + $requestDocs = $dbForProject->find('stats', [ + new Query('period', Query::TYPE_EQUAL, [$period]), + new Query('metric', Query::TYPE_EQUAL, [$metric]), + ], $limit, 0, ['time'], [Database::ORDER_DESC]); - $stats[$metric] = []; - foreach ($requestDocs as $requestDoc) { - $stats[$metric][] = [ - 'value' => $requestDoc->getAttribute('value'), - 'date' => $requestDoc->getAttribute('time'), - ]; + $stats[$metric] = []; + foreach ($requestDocs as $requestDoc) { + $stats[$metric][] = [ + 'value' => $requestDoc->getAttribute('value'), + 'date' => $requestDoc->getAttribute('time'), + ]; + } + + // backfill metrics with empty values for graphs + $backfill = $limit - \count($requestDocs); + while ($backfill > 0) { + $last = $limit - $backfill - 1; // array index of last added metric + $diff = match ($period) { // convert period to seconds for unix timestamp math + '30m' => 1800, + '1d' => 86400, + }; + $stats[$metric][] = [ + 'value' => 0, + 'date' => ($stats[$metric][$last]['date'] ?? \time()) - $diff, // time of last metric minus period + ]; + $backfill--; + } + // TODO@kodumbeats explore performance if query is ordered by time ASC + $stats[$metric] = array_reverse($stats[$metric]); } + }); - // backfill metrics with empty values for graphs - $backfill = $limit - \count($requestDocs); - while ($backfill > 0) { - $last = $limit - $backfill - 1; // array index of last added metric - $diff = match ($period) { // convert period to seconds for unix timestamp math - '30m' => 1800, - '1d' => 86400, - }; - $stats[$metric][] = [ - 'value' => 0, - 'date' => ($stats[$metric][$last]['date'] ?? \time()) - $diff, // time of last metric minus period - ]; - $backfill--; - } - // TODO@kodumbeats explore performance if query is ordered by time ASC - $stats[$metric] = array_reverse($stats[$metric]); - } - }); + $usage = new Document([ + 'range' => $range, + 'databasesCount' => $stats["databases.count"], + 'documentsCount' => $stats["databases.documents.count"], + 'collectionsCount' => $stats["databases.collections.count"], + 'documentsCreate' => $stats["databases.documents.create"], + 'documentsRead' => $stats["databases.documents.read"], + 'documentsUpdate' => $stats["databases.documents.update"], + 'documentsDelete' => $stats["databases.documents.delete"], + 'collectionsCreate' => $stats["databases.collections.create"], + 'collectionsRead' => $stats["databases.collections.read"], + 'collectionsUpdate' => $stats["databases.collections.update"], + 'collectionsDelete' => $stats["databases.collections.delete"], + 'databasesCreate' => $stats["databases.create"], + 'databasesRead' => $stats["databases.read"], + 'databasesUpdate' => $stats["databases.update"], + 'databasesDelete' => $stats["databases.delete"], + ]); + } - $usage = new Document([ - 'range' => $range, - 'databasesCount' => $stats["databases.count"], - 'documentsCount' => $stats["databases.documents.count"], - 'collectionsCount' => $stats["databases.collections.count"], - 'documentsCreate' => $stats["databases.documents.create"], - 'documentsRead' => $stats["databases.documents.read"], - 'documentsUpdate' => $stats["databases.documents.update"], - 'documentsDelete' => $stats["databases.documents.delete"], - 'collectionsCreate' => $stats["databases.collections.create"], - 'collectionsRead' => $stats["databases.collections.read"], - 'collectionsUpdate' => $stats["databases.collections.update"], - 'collectionsDelete' => $stats["databases.collections.delete"], - 'databasesCreate' => $stats["databases.create"], - 'databasesRead' => $stats["databases.read"], - 'databasesUpdate' => $stats["databases.update"], - 'databasesDelete' => $stats["databases.delete"], - ]); - } - - $response->dynamic($usage, Response::MODEL_USAGE_DATABASES); -}); + $response->dynamic($usage, Response::MODEL_USAGE_DATABASES); + }); App::get('/v1/databases/:databaseId/usage') -->desc('Get usage stats for the database') -->groups(['api', 'database']) -->label('scope', 'collections.read') -->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) -->label('sdk.namespace', 'databases') -->label('sdk.method', 'getDatabaseUsage') -->label('sdk.response.code', Response::STATUS_CODE_OK) -->label('sdk.response.type', Response::CONTENT_TYPE_JSON) -->label('sdk.response.model', Response::MODEL_USAGE_DATABASE) -->param('databaseId', '', new UID(), 'Database ID.') -->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), '`Date range.', true) -->inject('response') -->inject('dbForProject') -->action(function (string $databaseId, string $range, Response $response, Database $dbForProject) { + ->desc('Get usage stats for the database') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'databases') + ->label('sdk.method', 'getDatabaseUsage') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_USAGE_DATABASE) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), '`Date range.', true) + ->inject('response') + ->inject('dbForProject') + ->action(function (string $databaseId, string $range, Response $response, Database $dbForProject) { - $usage = []; - if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { - $periods = [ - '24h' => [ - 'period' => '30m', - 'limit' => 48, - ], - '7d' => [ - 'period' => '1d', - 'limit' => 7, - ], - '30d' => [ - 'period' => '1d', - 'limit' => 30, - ], - '90d' => [ - 'period' => '1d', - 'limit' => 90, - ], - ]; + $usage = []; + if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { + $periods = [ + '24h' => [ + 'period' => '30m', + 'limit' => 48, + ], + '7d' => [ + 'period' => '1d', + 'limit' => 7, + ], + '30d' => [ + 'period' => '1d', + 'limit' => 30, + ], + '90d' => [ + 'period' => '1d', + 'limit' => 90, + ], + ]; - $metrics = [ - 'databases.' . $databaseId . '.documents.count', - 'databases.' . $databaseId . '.collections.count', - 'databases.' . $databaseId . '.collections.create', - 'databases.' . $databaseId . '.collections.read', - 'databases.' . $databaseId . '.collections.update', - 'databases.' . $databaseId . '.collections.delete', - 'databases.' . $databaseId . '.documents.create', - 'databases.' . $databaseId . '.documents.read', - 'databases.' . $databaseId . '.documents.update', - 'databases.' . $databaseId . '.documents.delete' - ]; + $metrics = [ + 'databases.' . $databaseId . '.documents.count', + 'databases.' . $databaseId . '.collections.count', + 'databases.' . $databaseId . '.collections.create', + 'databases.' . $databaseId . '.collections.read', + 'databases.' . $databaseId . '.collections.update', + 'databases.' . $databaseId . '.collections.delete', + 'databases.' . $databaseId . '.documents.create', + 'databases.' . $databaseId . '.documents.read', + 'databases.' . $databaseId . '.documents.update', + 'databases.' . $databaseId . '.documents.delete' + ]; - $stats = []; + $stats = []; - Authorization::skip(function () use ($dbForProject, $periods, $range, $metrics, &$stats) { - foreach ($metrics as $metric) { - $limit = $periods[$range]['limit']; - $period = $periods[$range]['period']; + Authorization::skip(function () use ($dbForProject, $periods, $range, $metrics, &$stats) { + foreach ($metrics as $metric) { + $limit = $periods[$range]['limit']; + $period = $periods[$range]['period']; - $requestDocs = $dbForProject->find('stats', [ - new Query('period', Query::TYPE_EQUAL, [$period]), - new Query('metric', Query::TYPE_EQUAL, [$metric]), - ], $limit, 0, ['time'], [Database::ORDER_DESC]); + $requestDocs = $dbForProject->find('stats', [ + new Query('period', Query::TYPE_EQUAL, [$period]), + new Query('metric', Query::TYPE_EQUAL, [$metric]), + ], $limit, 0, ['time'], [Database::ORDER_DESC]); - $stats[$metric] = []; - foreach ($requestDocs as $requestDoc) { - $stats[$metric][] = [ - 'value' => $requestDoc->getAttribute('value'), - 'date' => $requestDoc->getAttribute('time'), - ]; + $stats[$metric] = []; + foreach ($requestDocs as $requestDoc) { + $stats[$metric][] = [ + 'value' => $requestDoc->getAttribute('value'), + 'date' => $requestDoc->getAttribute('time'), + ]; + } + + // backfill metrics with empty values for graphs + $backfill = $limit - \count($requestDocs); + while ($backfill > 0) { + $last = $limit - $backfill - 1; // array index of last added metric + $diff = match ($period) { // convert period to seconds for unix timestamp math + '30m' => 1800, + '1d' => 86400, + }; + $stats[$metric][] = [ + 'value' => 0, + 'date' => ($stats[$metric][$last]['date'] ?? \time()) - $diff, // time of last metric minus period + ]; + $backfill--; + } + // TODO@kodumbeats explore performance if query is ordered by time ASC + $stats[$metric] = array_reverse($stats[$metric]); } + }); - // backfill metrics with empty values for graphs - $backfill = $limit - \count($requestDocs); - while ($backfill > 0) { - $last = $limit - $backfill - 1; // array index of last added metric - $diff = match ($period) { // convert period to seconds for unix timestamp math - '30m' => 1800, - '1d' => 86400, - }; - $stats[$metric][] = [ - 'value' => 0, - 'date' => ($stats[$metric][$last]['date'] ?? \time()) - $diff, // time of last metric minus period - ]; - $backfill--; - } - // TODO@kodumbeats explore performance if query is ordered by time ASC - $stats[$metric] = array_reverse($stats[$metric]); - } - }); + $usage = new Document([ + 'range' => $range, + 'documentsCount' => $stats["databases.{$databaseId}.documents.count"], + 'collectionsCount' => $stats["databases.{$databaseId}.collections.count"], + 'documentsCreate' => $stats["databases.{$databaseId}.documents.create"], + 'documentsRead' => $stats["databases.{$databaseId}.documents.read"], + 'documentsUpdate' => $stats["databases.{$databaseId}.documents.update"], + 'documentsDelete' => $stats["databases.{$databaseId}.documents.delete"], + 'collectionsCreate' => $stats["databases.{$databaseId}.collections.create"], + 'collectionsRead' => $stats["databases.{$databaseId}.collections.read"], + 'collectionsUpdate' => $stats["databases.{$databaseId}.collections.update"], + 'collectionsDelete' => $stats["databases.{$databaseId}.collections.delete"], + ]); + } - $usage = new Document([ - 'range' => $range, - 'documentsCount' => $stats["databases.{$databaseId}.documents.count"], - 'collectionsCount' => $stats["databases.{$databaseId}.collections.count"], - 'documentsCreate' => $stats["databases.{$databaseId}.documents.create"], - 'documentsRead' => $stats["databases.{$databaseId}.documents.read"], - 'documentsUpdate' => $stats["databases.{$databaseId}.documents.update"], - 'documentsDelete' => $stats["databases.{$databaseId}.documents.delete"], - 'collectionsCreate' => $stats["databases.{$databaseId}.collections.create"], - 'collectionsRead' => $stats["databases.{$databaseId}.collections.read"], - 'collectionsUpdate' => $stats["databases.{$databaseId}.collections.update"], - 'collectionsDelete' => $stats["databases.{$databaseId}.collections.delete"], - ]); - } - - $response->dynamic($usage, Response::MODEL_USAGE_DATABASE); -}); + $response->dynamic($usage, Response::MODEL_USAGE_DATABASE); + }); App::get('/v1/databases/:databaseId/collections/:collectionId/usage') -->desc('Get usage stats for a collection') -->groups(['api', 'database']) -->label('scope', 'collections.read') -->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) -->label('sdk.namespace', 'databases') -->label('sdk.method', 'getCollectionUsage') -->label('sdk.response.code', Response::STATUS_CODE_OK) -->label('sdk.response.type', Response::CONTENT_TYPE_JSON) -->label('sdk.response.model', Response::MODEL_USAGE_COLLECTION) -->param('databaseId', '', new UID(), 'Database ID.') -->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), 'Date range.', true) -->param('collectionId', '', new UID(), 'Collection ID.') -->inject('response') -->inject('dbForProject') -->action(function (string $databaseId, string $range, string $collectionId, Response $response, Database $dbForProject) { + ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) + ->desc('Get usage stats for a collection') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'databases') + ->label('sdk.method', 'getCollectionUsage') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_USAGE_COLLECTION) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), 'Date range.', true) + ->param('collectionId', '', new UID(), 'Collection ID.') + ->inject('response') + ->inject('dbForProject') + ->action(function (string $databaseId, string $range, string $collectionId, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); + $database = $dbForProject->getDocument('databases', $databaseId); - $collectionDocument = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); - $collection = $dbForProject->getCollection('database_' . $database->getInternalId() . '_collection_' . $collectionDocument->getInternalId()); + $collectionDocument = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getCollection('database_' . $database->getInternalId() . '_collection_' . $collectionDocument->getInternalId()); - if ($collection->isEmpty()) { - throw new Exception('Collection not found', 404, Exception::COLLECTION_NOT_FOUND); - } + if ($collection->isEmpty()) { + throw new Exception('Collection not found', 404, Exception::COLLECTION_NOT_FOUND); + } - $usage = []; - if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { - $periods = [ - '24h' => [ - 'period' => '30m', - 'limit' => 48, - ], - '7d' => [ - 'period' => '1d', - 'limit' => 7, - ], - '30d' => [ - 'period' => '1d', - 'limit' => 30, - ], - '90d' => [ - 'period' => '1d', - 'limit' => 90, - ], - ]; + $usage = []; + if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { + $periods = [ + '24h' => [ + 'period' => '30m', + 'limit' => 48, + ], + '7d' => [ + 'period' => '1d', + 'limit' => 7, + ], + '30d' => [ + 'period' => '1d', + 'limit' => 30, + ], + '90d' => [ + 'period' => '1d', + 'limit' => 90, + ], + ]; - $metrics = [ - "databases.{$databaseId}.collections.{$collectionId}.documents.count", - "databases.{$databaseId}.collections.{$collectionId}.documents.create", - "databases.{$databaseId}.collections.{$collectionId}.documents.read", - "databases.{$databaseId}.collections.{$collectionId}.documents.update", - "databases.{$databaseId}.collections.{$collectionId}.documents.delete", - ]; + $metrics = [ + "databases.{$databaseId}.collections.{$collectionId}.documents.count", + "databases.{$databaseId}.collections.{$collectionId}.documents.create", + "databases.{$databaseId}.collections.{$collectionId}.documents.read", + "databases.{$databaseId}.collections.{$collectionId}.documents.update", + "databases.{$databaseId}.collections.{$collectionId}.documents.delete", + ]; - $stats = []; + $stats = []; - Authorization::skip(function () use ($dbForProject, $periods, $range, $metrics, &$stats) { - foreach ($metrics as $metric) { - $limit = $periods[$range]['limit']; - $period = $periods[$range]['period']; + Authorization::skip(function () use ($dbForProject, $periods, $range, $metrics, &$stats) { + foreach ($metrics as $metric) { + $limit = $periods[$range]['limit']; + $period = $periods[$range]['period']; - $requestDocs = $dbForProject->find('stats', [ - new Query('period', Query::TYPE_EQUAL, [$period]), - new Query('metric', Query::TYPE_EQUAL, [$metric]), - ], $limit, 0, ['time'], [Database::ORDER_DESC]); + $requestDocs = $dbForProject->find('stats', [ + new Query('period', Query::TYPE_EQUAL, [$period]), + new Query('metric', Query::TYPE_EQUAL, [$metric]), + ], $limit, 0, ['time'], [Database::ORDER_DESC]); - $stats[$metric] = []; - foreach ($requestDocs as $requestDoc) { - $stats[$metric][] = [ - 'value' => $requestDoc->getAttribute('value'), - 'date' => $requestDoc->getAttribute('time'), - ]; + $stats[$metric] = []; + foreach ($requestDocs as $requestDoc) { + $stats[$metric][] = [ + 'value' => $requestDoc->getAttribute('value'), + 'date' => $requestDoc->getAttribute('time'), + ]; + } + + // backfill metrics with empty values for graphs + $backfill = $limit - \count($requestDocs); + while ($backfill > 0) { + $last = $limit - $backfill - 1; // array index of last added metric + $diff = match ($period) { // convert period to seconds for unix timestamp math + '30m' => 1800, + '1d' => 86400, + }; + $stats[$metric][] = [ + 'value' => 0, + 'date' => ($stats[$metric][$last]['date'] ?? \time()) - $diff, // time of last metric minus period + ]; + $backfill--; + } + $stats[$metric] = array_reverse($stats[$metric]); } + }); - // backfill metrics with empty values for graphs - $backfill = $limit - \count($requestDocs); - while ($backfill > 0) { - $last = $limit - $backfill - 1; // array index of last added metric - $diff = match ($period) { // convert period to seconds for unix timestamp math - '30m' => 1800, - '1d' => 86400, - }; - $stats[$metric][] = [ - 'value' => 0, - 'date' => ($stats[$metric][$last]['date'] ?? \time()) - $diff, // time of last metric minus period - ]; - $backfill--; - } - $stats[$metric] = array_reverse($stats[$metric]); - } - }); + $usage = new Document([ + 'range' => $range, + 'documentsCount' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.count"], + 'documentsCreate' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.create"], + 'documentsRead' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.read"], + 'documentsUpdate' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.update"], + 'documentsDelete' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.delete"] + ]); + } - $usage = new Document([ - 'range' => $range, - 'documentsCount' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.count"], - 'documentsCreate' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.create"], - 'documentsRead' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.read"], - 'documentsUpdate' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.update"], - 'documentsDelete' => $stats["databases.{$databaseId}.collections.{$collectionId}.documents.delete"] - ]); - } - - $response->dynamic($usage, Response::MODEL_USAGE_COLLECTION); -}); + $response->dynamic($usage, Response::MODEL_USAGE_COLLECTION); + }); From e169d3b019c5a1bf644b8b10bced1dd4b63d2e49 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 23 Jun 2022 08:58:47 +0000 Subject: [PATCH 22/33] fix usage stats on dashboard --- app/controllers/api/projects.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 429ebeb52f..12122e1f7b 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -278,8 +278,8 @@ App::get('/v1/projects/:projectId/usage') 'network', 'executions', 'users.count', - 'database.documents.count', - 'database.collections.count', + 'databases.documents.count', + 'databases.collections.count', 'storage.total' ]; @@ -326,8 +326,8 @@ App::get('/v1/projects/:projectId/usage') 'requests' => $stats['requests'], 'network' => $stats['network'], 'functions' => $stats['executions'], - 'documents' => $stats['database.documents.count'], - 'collections' => $stats['database.collections.count'], + 'documents' => $stats['databases.documents.count'], + 'collections' => $stats['databases.collections.count'], 'users' => $stats['users.count'], 'storage' => $stats['storage.total'] ]); From 4a1a150f84f373af2ea4810617a4e7cc1f85243c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 23 Jun 2022 09:57:50 +0000 Subject: [PATCH 23/33] Add databaseId to UI url --- app/views/console/databases/document.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/console/databases/document.phtml b/app/views/console/databases/document.phtml index f485a25eeb..3c1bb0485d 100644 --- a/app/views/console/databases/document.phtml +++ b/app/views/console/databases/document.phtml @@ -24,7 +24,7 @@ $logs = $this->getParam('logs', null);

- +
From 12cd0ee839ba2ea2c3a0e2c94d0b85b5f771672e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 23 Jun 2022 12:04:54 +0200 Subject: [PATCH 24/33] chore: clean up docs --- .../java/database/create-document.md | 50 ------------------- .../java/database/delete-document.md | 49 ------------------ .../java/database/get-document.md | 49 ------------------ .../java/database/list-documents.md | 48 ------------------ .../java/database/update-document.md | 50 ------------------- .../kotlin/database/create-document.md | 28 ----------- .../kotlin/database/delete-document.md | 27 ---------- .../kotlin/database/get-document.md | 27 ---------- .../kotlin/database/list-documents.md | 26 ---------- .../kotlin/database/update-document.md | 28 ----------- .../examples/account/update-prefs.md | 2 +- .../examples/database/create-document.md | 15 ------ .../examples/database/delete-document.md | 14 ------ .../examples/database/get-document.md | 14 ------ .../examples/database/list-documents.md | 13 ----- .../examples/database/update-document.md | 15 ------ .../examples/database/create-document.md | 23 --------- .../examples/database/delete-document.md | 22 -------- .../examples/database/get-document.md | 22 -------- .../examples/database/list-documents.md | 21 -------- .../examples/database/update-document.md | 23 --------- .../account/create-anonymous-session.md | 10 ++-- .../examples/account/create-email-session.md | 10 ++-- .../examples/account/create-j-w-t.md | 10 ++-- .../account/create-magic-u-r-l-session.md | 10 ++-- .../examples/account/create-o-auth2session.md | 10 ++-- .../examples/account/create-phone-session.md | 10 ++-- .../account/create-phone-verification.md | 10 ++-- .../examples/account/create-recovery.md | 10 ++-- .../examples/account/create-session.md | 14 ------ .../examples/account/create-verification.md | 10 ++-- .../client-web/examples/account/create.md | 10 ++-- .../examples/account/delete-session.md | 10 ++-- .../examples/account/delete-sessions.md | 10 ++-- .../client-web/examples/account/get-logs.md | 10 ++-- .../client-web/examples/account/get-prefs.md | 10 ++-- .../examples/account/get-session.md | 10 ++-- .../examples/account/get-sessions.md | 10 ++-- .../0.15.x/client-web/examples/account/get.md | 10 ++-- .../examples/account/update-email.md | 10 ++-- .../account/update-magic-u-r-l-session.md | 10 ++-- .../examples/account/update-name.md | 10 ++-- .../examples/account/update-password.md | 10 ++-- .../examples/account/update-phone-session.md | 10 ++-- .../account/update-phone-verification.md | 10 ++-- .../examples/account/update-phone.md | 10 ++-- .../examples/account/update-prefs.md | 10 ++-- .../examples/account/update-recovery.md | 10 ++-- .../examples/account/update-session.md | 10 ++-- .../examples/account/update-status.md | 10 ++-- .../examples/account/update-verification.md | 10 ++-- .../examples/avatars/get-browser.md | 10 ++-- .../examples/avatars/get-credit-card.md | 10 ++-- .../examples/avatars/get-favicon.md | 10 ++-- .../client-web/examples/avatars/get-flag.md | 10 ++-- .../client-web/examples/avatars/get-image.md | 10 ++-- .../examples/avatars/get-initials.md | 10 ++-- .../client-web/examples/avatars/get-q-r.md | 10 ++-- .../examples/database/create-document.md | 14 ------ .../examples/database/delete-document.md | 14 ------ .../examples/database/get-document.md | 14 ------ .../examples/database/list-documents.md | 14 ------ .../examples/database/update-document.md | 14 ------ .../examples/functions/create-execution.md | 10 ++-- .../examples/functions/get-execution.md | 10 ++-- .../examples/functions/list-executions.md | 10 ++-- .../examples/functions/retry-build.md | 10 ++-- .../examples/locale/get-continents.md | 10 ++-- .../examples/locale/get-countries-e-u.md | 10 ++-- .../examples/locale/get-countries-phones.md | 10 ++-- .../examples/locale/get-countries.md | 10 ++-- .../examples/locale/get-currencies.md | 10 ++-- .../examples/locale/get-languages.md | 10 ++-- .../0.15.x/client-web/examples/locale/get.md | 10 ++-- .../examples/storage/create-file.md | 10 ++-- .../examples/storage/delete-file.md | 10 ++-- .../examples/storage/get-file-download.md | 10 ++-- .../examples/storage/get-file-preview.md | 10 ++-- .../examples/storage/get-file-view.md | 10 ++-- .../client-web/examples/storage/get-file.md | 10 ++-- .../client-web/examples/storage/list-files.md | 10 ++-- .../examples/storage/update-file.md | 10 ++-- .../examples/teams/create-membership.md | 10 ++-- .../client-web/examples/teams/create.md | 10 ++-- .../examples/teams/delete-membership.md | 10 ++-- .../client-web/examples/teams/delete.md | 10 ++-- .../examples/teams/get-membership.md | 10 ++-- .../examples/teams/get-memberships.md | 10 ++-- .../0.15.x/client-web/examples/teams/get.md | 10 ++-- .../0.15.x/client-web/examples/teams/list.md | 10 ++-- .../examples/teams/update-membership-roles.md | 10 ++-- .../teams/update-membership-status.md | 10 ++-- .../client-web/examples/teams/update.md | 10 ++-- .../database/create-boolean-attribute.md | 6 --- .../examples/database/create-collection.md | 6 --- .../examples/database/create-document.md | 6 --- .../database/create-email-attribute.md | 6 --- .../database/create-enum-attribute.md | 7 --- .../database/create-float-attribute.md | 8 --- .../examples/database/create-index.md | 6 --- .../database/create-integer-attribute.md | 8 --- .../examples/database/create-ip-attribute.md | 6 --- .../database/create-string-attribute.md | 7 --- .../examples/database/create-url-attribute.md | 6 --- .../examples/database/delete-attribute.md | 3 -- .../examples/database/delete-collection.md | 2 - .../examples/database/delete-document.md | 3 -- .../examples/database/delete-index.md | 3 -- .../examples/database/get-attribute.md | 3 -- .../examples/database/get-collection-usage.md | 3 -- .../examples/database/get-collection.md | 2 - .../examples/database/get-document.md | 3 -- .../examples/database/get-index.md | 3 -- .../examples/database/get-usage.md | 2 - .../examples/database/list-attributes.md | 2 - .../examples/database/list-collection-logs.md | 4 -- .../examples/database/list-collections.md | 7 --- .../examples/database/list-document-logs.md | 5 -- .../examples/database/list-documents.md | 9 ---- .../examples/database/list-indexes.md | 2 - .../examples/database/update-collection.md | 7 --- .../examples/database/update-document.md | 6 --- .../account/create-anonymous-session.md | 10 ++-- .../examples/account/create-email-session.md | 10 ++-- .../examples/account/create-j-w-t.md | 10 ++-- .../account/create-magic-u-r-l-session.md | 10 ++-- .../examples/account/create-o-auth2session.md | 10 ++-- .../examples/account/create-phone-session.md | 10 ++-- .../account/create-phone-verification.md | 10 ++-- .../examples/account/create-recovery.md | 10 ++-- .../examples/account/create-session.md | 14 ------ .../examples/account/create-verification.md | 10 ++-- .../console-web/examples/account/create.md | 10 ++-- .../examples/account/delete-session.md | 10 ++-- .../examples/account/delete-sessions.md | 10 ++-- .../console-web/examples/account/get-logs.md | 10 ++-- .../console-web/examples/account/get-prefs.md | 10 ++-- .../examples/account/get-session.md | 10 ++-- .../examples/account/get-sessions.md | 10 ++-- .../console-web/examples/account/get.md | 10 ++-- .../examples/account/update-email.md | 10 ++-- .../account/update-magic-u-r-l-session.md | 10 ++-- .../examples/account/update-name.md | 10 ++-- .../examples/account/update-password.md | 10 ++-- .../examples/account/update-phone-session.md | 10 ++-- .../account/update-phone-verification.md | 10 ++-- .../examples/account/update-phone.md | 10 ++-- .../examples/account/update-prefs.md | 10 ++-- .../examples/account/update-recovery.md | 10 ++-- .../examples/account/update-session.md | 10 ++-- .../examples/account/update-status.md | 10 ++-- .../examples/account/update-verification.md | 10 ++-- .../examples/avatars/get-browser.md | 10 ++-- .../examples/avatars/get-credit-card.md | 10 ++-- .../examples/avatars/get-favicon.md | 10 ++-- .../console-web/examples/avatars/get-flag.md | 10 ++-- .../console-web/examples/avatars/get-image.md | 10 ++-- .../examples/avatars/get-initials.md | 10 ++-- .../console-web/examples/avatars/get-q-r.md | 10 ++-- .../database/create-boolean-attribute.md | 14 ------ .../examples/database/create-collection.md | 14 ------ .../examples/database/create-document.md | 14 ------ .../database/create-email-attribute.md | 14 ------ .../database/create-enum-attribute.md | 14 ------ .../database/create-float-attribute.md | 14 ------ .../examples/database/create-index.md | 14 ------ .../database/create-integer-attribute.md | 14 ------ .../examples/database/create-ip-attribute.md | 14 ------ .../database/create-string-attribute.md | 14 ------ .../examples/database/create-url-attribute.md | 14 ------ .../examples/database/delete-attribute.md | 14 ------ .../examples/database/delete-collection.md | 14 ------ .../examples/database/delete-document.md | 14 ------ .../examples/database/delete-index.md | 14 ------ .../examples/database/get-attribute.md | 14 ------ .../examples/database/get-collection-usage.md | 14 ------ .../examples/database/get-collection.md | 14 ------ .../examples/database/get-document.md | 14 ------ .../examples/database/get-index.md | 14 ------ .../examples/database/get-usage.md | 14 ------ .../examples/database/list-attributes.md | 14 ------ .../examples/database/list-collection-logs.md | 14 ------ .../examples/database/list-collections.md | 14 ------ .../examples/database/list-document-logs.md | 14 ------ .../examples/database/list-documents.md | 14 ------ .../examples/database/list-indexes.md | 14 ------ .../examples/database/update-collection.md | 14 ------ .../examples/database/update-document.md | 14 ------ .../examples/functions/create-deployment.md | 10 ++-- .../examples/functions/create-execution.md | 10 ++-- .../console-web/examples/functions/create.md | 10 ++-- .../examples/functions/delete-deployment.md | 10 ++-- .../console-web/examples/functions/delete.md | 10 ++-- .../examples/functions/get-deployment.md | 10 ++-- .../examples/functions/get-execution.md | 10 ++-- .../examples/functions/get-usage.md | 10 ++-- .../console-web/examples/functions/get.md | 10 ++-- .../examples/functions/list-deployments.md | 10 ++-- .../examples/functions/list-executions.md | 10 ++-- .../examples/functions/list-runtimes.md | 10 ++-- .../console-web/examples/functions/list.md | 10 ++-- .../examples/functions/retry-build.md | 10 ++-- .../examples/functions/update-deployment.md | 10 ++-- .../console-web/examples/functions/update.md | 10 ++-- .../examples/health/get-antivirus.md | 10 ++-- .../console-web/examples/health/get-cache.md | 10 ++-- .../console-web/examples/health/get-d-b.md | 10 ++-- .../examples/health/get-queue-certificates.md | 10 ++-- .../examples/health/get-queue-functions.md | 10 ++-- .../examples/health/get-queue-logs.md | 10 ++-- .../examples/health/get-queue-webhooks.md | 10 ++-- .../examples/health/get-storage-local.md | 10 ++-- .../console-web/examples/health/get-time.md | 10 ++-- .../0.15.x/console-web/examples/health/get.md | 10 ++-- .../examples/locale/get-continents.md | 10 ++-- .../examples/locale/get-countries-e-u.md | 10 ++-- .../examples/locale/get-countries-phones.md | 10 ++-- .../examples/locale/get-countries.md | 10 ++-- .../examples/locale/get-currencies.md | 10 ++-- .../examples/locale/get-languages.md | 10 ++-- .../0.15.x/console-web/examples/locale/get.md | 10 ++-- .../examples/projects/create-domain.md | 10 ++-- .../examples/projects/create-key.md | 10 ++-- .../examples/projects/create-platform.md | 10 ++-- .../examples/projects/create-webhook.md | 10 ++-- .../console-web/examples/projects/create.md | 10 ++-- .../examples/projects/delete-domain.md | 10 ++-- .../examples/projects/delete-key.md | 10 ++-- .../examples/projects/delete-platform.md | 10 ++-- .../examples/projects/delete-webhook.md | 10 ++-- .../console-web/examples/projects/delete.md | 10 ++-- .../examples/projects/get-domain.md | 10 ++-- .../console-web/examples/projects/get-key.md | 10 ++-- .../examples/projects/get-platform.md | 10 ++-- .../examples/projects/get-usage.md | 10 ++-- .../examples/projects/get-webhook.md | 10 ++-- .../console-web/examples/projects/get.md | 10 ++-- .../examples/projects/list-domains.md | 10 ++-- .../examples/projects/list-keys.md | 10 ++-- .../examples/projects/list-platforms.md | 10 ++-- .../examples/projects/list-webhooks.md | 10 ++-- .../console-web/examples/projects/list.md | 10 ++-- .../examples/projects/update-auth-limit.md | 10 ++-- .../examples/projects/update-auth-status.md | 10 ++-- .../projects/update-domain-verification.md | 10 ++-- .../examples/projects/update-key.md | 10 ++-- .../examples/projects/update-o-auth2.md | 10 ++-- .../examples/projects/update-platform.md | 10 ++-- .../projects/update-service-status.md | 10 ++-- .../projects/update-webhook-signature.md | 10 ++-- .../examples/projects/update-webhook.md | 10 ++-- .../console-web/examples/projects/update.md | 10 ++-- .../examples/storage/create-bucket.md | 10 ++-- .../examples/storage/create-file.md | 10 ++-- .../examples/storage/delete-bucket.md | 10 ++-- .../examples/storage/delete-file.md | 10 ++-- .../examples/storage/get-bucket-usage.md | 10 ++-- .../examples/storage/get-bucket.md | 10 ++-- .../examples/storage/get-file-download.md | 10 ++-- .../examples/storage/get-file-preview.md | 10 ++-- .../examples/storage/get-file-view.md | 10 ++-- .../console-web/examples/storage/get-file.md | 10 ++-- .../console-web/examples/storage/get-usage.md | 10 ++-- .../examples/storage/list-buckets.md | 10 ++-- .../examples/storage/list-files.md | 10 ++-- .../examples/storage/update-bucket.md | 10 ++-- .../examples/storage/update-file.md | 10 ++-- .../examples/teams/create-membership.md | 10 ++-- .../console-web/examples/teams/create.md | 10 ++-- .../examples/teams/delete-membership.md | 10 ++-- .../console-web/examples/teams/delete.md | 10 ++-- .../examples/teams/get-membership.md | 10 ++-- .../examples/teams/get-memberships.md | 10 ++-- .../0.15.x/console-web/examples/teams/get.md | 10 ++-- .../console-web/examples/teams/list-logs.md | 10 ++-- .../0.15.x/console-web/examples/teams/list.md | 10 ++-- .../examples/teams/update-membership-roles.md | 10 ++-- .../teams/update-membership-status.md | 10 ++-- .../console-web/examples/teams/update.md | 10 ++-- .../console-web/examples/users/create.md | 10 ++-- .../examples/users/delete-session.md | 10 ++-- .../examples/users/delete-sessions.md | 10 ++-- .../console-web/examples/users/delete.md | 10 ++-- .../console-web/examples/users/get-logs.md | 10 ++-- .../examples/users/get-memberships.md | 10 ++-- .../console-web/examples/users/get-prefs.md | 10 ++-- .../examples/users/get-sessions.md | 10 ++-- .../console-web/examples/users/get-usage.md | 10 ++-- .../0.15.x/console-web/examples/users/get.md | 10 ++-- .../0.15.x/console-web/examples/users/list.md | 10 ++-- .../users/update-email-verification.md | 10 ++-- .../examples/users/update-email.md | 10 ++-- .../console-web/examples/users/update-name.md | 10 ++-- .../examples/users/update-password.md | 10 ++-- .../users/update-phone-verification.md | 10 ++-- .../examples/users/update-phone.md | 10 ++-- .../examples/users/update-prefs.md | 10 ++-- .../examples/users/update-status.md | 10 ++-- .../examples/users/update-verification.md | 14 ------ .../database/create-boolean-attribute.md | 25 ---------- .../examples/database/create-collection.md | 27 ---------- .../examples/database/create-document.md | 25 ---------- .../database/create-email-attribute.md | 25 ---------- .../database/create-enum-attribute.md | 26 ---------- .../database/create-float-attribute.md | 25 ---------- .../examples/database/create-index.md | 26 ---------- .../database/create-integer-attribute.md | 25 ---------- .../examples/database/create-ip-attribute.md | 25 ---------- .../database/create-string-attribute.md | 26 ---------- .../examples/database/create-url-attribute.md | 25 ---------- .../examples/database/delete-attribute.md | 24 --------- .../examples/database/delete-collection.md | 23 --------- .../examples/database/delete-document.md | 24 --------- .../examples/database/delete-index.md | 24 --------- .../examples/database/get-attribute.md | 24 --------- .../examples/database/get-collection.md | 23 --------- .../examples/database/get-document.md | 24 --------- .../examples/database/get-index.md | 24 --------- .../examples/database/list-attributes.md | 23 --------- .../examples/database/list-collections.md | 22 -------- .../examples/database/list-documents.md | 23 --------- .../examples/database/list-indexes.md | 23 --------- .../examples/database/update-collection.md | 25 ---------- .../examples/database/update-document.md | 25 ---------- .../database/create-boolean-attribute.md | 21 -------- .../examples/database/create-collection.md | 21 -------- .../examples/database/create-document.md | 21 -------- .../database/create-email-attribute.md | 21 -------- .../database/create-enum-attribute.md | 21 -------- .../database/create-float-attribute.md | 21 -------- .../examples/database/create-index.md | 21 -------- .../database/create-integer-attribute.md | 21 -------- .../examples/database/create-ip-attribute.md | 21 -------- .../database/create-string-attribute.md | 21 -------- .../examples/database/create-url-attribute.md | 21 -------- .../examples/database/delete-attribute.md | 21 -------- .../examples/database/delete-collection.md | 21 -------- .../examples/database/delete-document.md | 21 -------- .../examples/database/delete-index.md | 21 -------- .../examples/database/get-attribute.md | 21 -------- .../examples/database/get-collection.md | 21 -------- .../examples/database/get-document.md | 21 -------- .../examples/database/get-index.md | 21 -------- .../examples/database/list-attributes.md | 21 -------- .../examples/database/list-collections.md | 21 -------- .../examples/database/list-documents.md | 21 -------- .../examples/database/list-indexes.md | 21 -------- .../examples/database/update-collection.md | 21 -------- .../examples/database/update-document.md | 21 -------- .../java/database/create-boolean-attribute.md | 38 -------------- .../java/database/create-collection.md | 40 --------------- .../java/database/create-document.md | 38 -------------- .../java/database/create-email-attribute.md | 38 -------------- .../java/database/create-enum-attribute.md | 39 --------------- .../java/database/create-float-attribute.md | 38 -------------- .../java/database/create-index.md | 39 --------------- .../java/database/create-integer-attribute.md | 38 -------------- .../java/database/create-ip-attribute.md | 38 -------------- .../java/database/create-string-attribute.md | 39 --------------- .../java/database/create-url-attribute.md | 38 -------------- .../java/database/delete-attribute.md | 37 -------------- .../java/database/delete-collection.md | 36 ------------- .../java/database/delete-document.md | 37 -------------- .../java/database/delete-index.md | 37 -------------- .../java/database/get-attribute.md | 37 -------------- .../java/database/get-collection.md | 36 ------------- .../java/database/get-document.md | 37 -------------- .../server-kotlin/java/database/get-index.md | 37 -------------- .../java/database/list-attributes.md | 36 ------------- .../java/database/list-collections.md | 35 ------------- .../java/database/list-documents.md | 36 ------------- .../java/database/list-indexes.md | 36 ------------- .../java/database/update-collection.md | 38 -------------- .../java/database/update-document.md | 38 -------------- .../database/create-boolean-attribute.md | 17 ------- .../kotlin/database/create-collection.md | 19 ------- .../kotlin/database/create-document.md | 17 ------- .../kotlin/database/create-email-attribute.md | 17 ------- .../kotlin/database/create-enum-attribute.md | 18 ------- .../kotlin/database/create-float-attribute.md | 17 ------- .../kotlin/database/create-index.md | 18 ------- .../database/create-integer-attribute.md | 17 ------- .../kotlin/database/create-ip-attribute.md | 17 ------- .../database/create-string-attribute.md | 18 ------- .../kotlin/database/create-url-attribute.md | 17 ------- .../kotlin/database/delete-attribute.md | 16 ------ .../kotlin/database/delete-collection.md | 15 ------ .../kotlin/database/delete-document.md | 16 ------ .../kotlin/database/delete-index.md | 16 ------ .../kotlin/database/get-attribute.md | 16 ------ .../kotlin/database/get-collection.md | 15 ------ .../kotlin/database/get-document.md | 16 ------ .../kotlin/database/get-index.md | 16 ------ .../kotlin/database/list-attributes.md | 15 ------ .../kotlin/database/list-collections.md | 14 ------ .../kotlin/database/list-documents.md | 15 ------ .../kotlin/database/list-indexes.md | 15 ------ .../kotlin/database/update-collection.md | 17 ------- .../kotlin/database/update-document.md | 17 ------- .../account/create-phone-verification.md | 6 +-- .../examples/account/create-recovery.md | 6 +-- .../examples/account/create-verification.md | 6 +-- .../examples/account/delete-session.md | 6 +-- .../examples/account/delete-sessions.md | 6 +-- .../examples/account/get-logs.md | 6 +-- .../examples/account/get-prefs.md | 6 +-- .../examples/account/get-session.md | 6 +-- .../examples/account/get-sessions.md | 6 +-- .../server-nodejs/examples/account/get.md | 6 +-- .../examples/account/update-email.md | 6 +-- .../examples/account/update-name.md | 6 +-- .../examples/account/update-password.md | 6 +-- .../account/update-phone-verification.md | 6 +-- .../examples/account/update-phone.md | 6 +-- .../examples/account/update-prefs.md | 6 +-- .../examples/account/update-recovery.md | 6 +-- .../examples/account/update-session.md | 6 +-- .../examples/account/update-status.md | 6 +-- .../examples/account/update-verification.md | 6 +-- .../examples/avatars/get-browser.md | 6 +-- .../examples/avatars/get-credit-card.md | 6 +-- .../examples/avatars/get-favicon.md | 6 +-- .../examples/avatars/get-flag.md | 6 +-- .../examples/avatars/get-image.md | 6 +-- .../examples/avatars/get-initials.md | 6 +-- .../server-nodejs/examples/avatars/get-q-r.md | 6 +-- .../database/create-boolean-attribute.md | 20 -------- .../examples/database/create-collection.md | 20 -------- .../examples/database/create-document.md | 20 -------- .../database/create-email-attribute.md | 20 -------- .../database/create-enum-attribute.md | 20 -------- .../database/create-float-attribute.md | 20 -------- .../examples/database/create-index.md | 20 -------- .../database/create-integer-attribute.md | 20 -------- .../examples/database/create-ip-attribute.md | 20 -------- .../database/create-string-attribute.md | 20 -------- .../examples/database/create-url-attribute.md | 20 -------- .../examples/database/delete-attribute.md | 20 -------- .../examples/database/delete-collection.md | 20 -------- .../examples/database/delete-document.md | 20 -------- .../examples/database/delete-index.md | 20 -------- .../examples/database/get-attribute.md | 20 -------- .../examples/database/get-collection.md | 20 -------- .../examples/database/get-document.md | 20 -------- .../examples/database/get-index.md | 20 -------- .../examples/database/list-attributes.md | 20 -------- .../examples/database/list-collections.md | 20 -------- .../examples/database/list-documents.md | 20 -------- .../examples/database/list-indexes.md | 20 -------- .../examples/database/update-collection.md | 20 -------- .../examples/database/update-document.md | 20 -------- .../examples/functions/create-deployment.md | 6 +-- .../examples/functions/create-execution.md | 6 +-- .../examples/functions/create.md | 6 +-- .../examples/functions/delete-deployment.md | 6 +-- .../examples/functions/delete.md | 6 +-- .../examples/functions/get-deployment.md | 6 +-- .../examples/functions/get-execution.md | 6 +-- .../server-nodejs/examples/functions/get.md | 6 +-- .../examples/functions/list-deployments.md | 6 +-- .../examples/functions/list-executions.md | 6 +-- .../examples/functions/list-runtimes.md | 6 +-- .../server-nodejs/examples/functions/list.md | 6 +-- .../examples/functions/retry-build.md | 6 +-- .../examples/functions/update-deployment.md | 6 +-- .../examples/functions/update.md | 6 +-- .../examples/health/get-antivirus.md | 6 +-- .../examples/health/get-cache.md | 6 +-- .../server-nodejs/examples/health/get-d-b.md | 6 +-- .../examples/health/get-queue-certificates.md | 6 +-- .../examples/health/get-queue-functions.md | 6 +-- .../examples/health/get-queue-logs.md | 6 +-- .../examples/health/get-queue-webhooks.md | 6 +-- .../examples/health/get-storage-local.md | 6 +-- .../server-nodejs/examples/health/get-time.md | 6 +-- .../server-nodejs/examples/health/get.md | 6 +-- .../examples/locale/get-continents.md | 6 +-- .../examples/locale/get-countries-e-u.md | 6 +-- .../examples/locale/get-countries-phones.md | 6 +-- .../examples/locale/get-countries.md | 6 +-- .../examples/locale/get-currencies.md | 6 +-- .../examples/locale/get-languages.md | 6 +-- .../server-nodejs/examples/locale/get.md | 6 +-- .../examples/storage/create-bucket.md | 6 +-- .../examples/storage/create-file.md | 6 +-- .../examples/storage/delete-bucket.md | 6 +-- .../examples/storage/delete-file.md | 6 +-- .../examples/storage/get-bucket.md | 6 +-- .../examples/storage/get-file-download.md | 6 +-- .../examples/storage/get-file-preview.md | 6 +-- .../examples/storage/get-file-view.md | 6 +-- .../examples/storage/get-file.md | 6 +-- .../examples/storage/list-buckets.md | 6 +-- .../examples/storage/list-files.md | 6 +-- .../examples/storage/update-bucket.md | 6 +-- .../examples/storage/update-file.md | 6 +-- .../examples/teams/create-membership.md | 6 +-- .../server-nodejs/examples/teams/create.md | 6 +-- .../examples/teams/delete-membership.md | 6 +-- .../server-nodejs/examples/teams/delete.md | 6 +-- .../examples/teams/get-membership.md | 6 +-- .../examples/teams/get-memberships.md | 6 +-- .../server-nodejs/examples/teams/get.md | 6 +-- .../server-nodejs/examples/teams/list.md | 6 +-- .../examples/teams/update-membership-roles.md | 6 +-- .../teams/update-membership-status.md | 6 +-- .../server-nodejs/examples/teams/update.md | 6 +-- .../server-nodejs/examples/users/create.md | 6 +-- .../examples/users/delete-session.md | 6 +-- .../examples/users/delete-sessions.md | 6 +-- .../server-nodejs/examples/users/delete.md | 6 +-- .../server-nodejs/examples/users/get-logs.md | 6 +-- .../examples/users/get-memberships.md | 6 +-- .../server-nodejs/examples/users/get-prefs.md | 6 +-- .../examples/users/get-sessions.md | 6 +-- .../server-nodejs/examples/users/get.md | 6 +-- .../server-nodejs/examples/users/list.md | 6 +-- .../users/update-email-verification.md | 6 +-- .../examples/users/update-email.md | 6 +-- .../examples/users/update-name.md | 6 +-- .../examples/users/update-password.md | 6 +-- .../users/update-phone-verification.md | 6 +-- .../examples/users/update-phone.md | 6 +-- .../examples/users/update-prefs.md | 6 +-- .../examples/users/update-status.md | 6 +-- .../database/create-boolean-attribute.md | 16 ------ .../examples/database/create-collection.md | 16 ------ .../examples/database/create-document.md | 16 ------ .../database/create-email-attribute.md | 16 ------ .../database/create-enum-attribute.md | 16 ------ .../database/create-float-attribute.md | 16 ------ .../examples/database/create-index.md | 16 ------ .../database/create-integer-attribute.md | 16 ------ .../examples/database/create-ip-attribute.md | 16 ------ .../database/create-string-attribute.md | 16 ------ .../examples/database/create-url-attribute.md | 16 ------ .../examples/database/delete-attribute.md | 16 ------ .../examples/database/delete-collection.md | 16 ------ .../examples/database/delete-document.md | 16 ------ .../examples/database/delete-index.md | 16 ------ .../examples/database/get-attribute.md | 16 ------ .../examples/database/get-collection.md | 16 ------ .../examples/database/get-document.md | 16 ------ .../server-php/examples/database/get-index.md | 16 ------ .../examples/database/list-attributes.md | 16 ------ .../examples/database/list-collections.md | 16 ------ .../examples/database/list-documents.md | 16 ------ .../examples/database/list-indexes.md | 16 ------ .../examples/database/update-collection.md | 16 ------ .../examples/database/update-document.md | 16 ------ .../database/create-boolean-attribute.md | 14 ------ .../examples/database/create-collection.md | 14 ------ .../examples/database/create-document.md | 14 ------ .../database/create-email-attribute.md | 14 ------ .../database/create-enum-attribute.md | 14 ------ .../database/create-float-attribute.md | 14 ------ .../examples/database/create-index.md | 14 ------ .../database/create-integer-attribute.md | 14 ------ .../examples/database/create-ip-attribute.md | 14 ------ .../database/create-string-attribute.md | 14 ------ .../examples/database/create-url-attribute.md | 14 ------ .../examples/database/delete-attribute.md | 14 ------ .../examples/database/delete-collection.md | 14 ------ .../examples/database/delete-document.md | 14 ------ .../examples/database/delete-index.md | 14 ------ .../examples/database/get-attribute.md | 14 ------ .../examples/database/get-collection.md | 14 ------ .../examples/database/get-document.md | 14 ------ .../examples/database/get-index.md | 14 ------ .../examples/database/list-attributes.md | 14 ------ .../examples/database/list-collections.md | 14 ------ .../examples/database/list-documents.md | 14 ------ .../examples/database/list-indexes.md | 14 ------ .../examples/database/update-collection.md | 14 ------ .../examples/database/update-document.md | 14 ------ .../database/create-boolean-attribute.md | 14 ------ .../examples/database/create-collection.md | 14 ------ .../examples/database/create-document.md | 14 ------ .../database/create-email-attribute.md | 14 ------ .../database/create-enum-attribute.md | 14 ------ .../database/create-float-attribute.md | 14 ------ .../examples/database/create-index.md | 14 ------ .../database/create-integer-attribute.md | 14 ------ .../examples/database/create-ip-attribute.md | 14 ------ .../database/create-string-attribute.md | 14 ------ .../examples/database/create-url-attribute.md | 14 ------ .../examples/database/delete-attribute.md | 14 ------ .../examples/database/delete-collection.md | 14 ------ .../examples/database/delete-document.md | 14 ------ .../examples/database/delete-index.md | 14 ------ .../examples/database/get-attribute.md | 14 ------ .../examples/database/get-collection.md | 14 ------ .../examples/database/get-document.md | 14 ------ .../examples/database/get-index.md | 14 ------ .../examples/database/list-attributes.md | 14 ------ .../examples/database/list-collections.md | 14 ------ .../examples/database/list-documents.md | 14 ------ .../examples/database/list-indexes.md | 14 ------ .../examples/database/update-collection.md | 14 ------ .../examples/database/update-document.md | 14 ------ .../examples/account/update-prefs.md | 2 +- .../database/create-boolean-attribute.md | 16 ------ .../examples/database/create-collection.md | 18 ------- .../examples/database/create-document.md | 16 ------ .../database/create-email-attribute.md | 16 ------ .../database/create-enum-attribute.md | 17 ------- .../database/create-float-attribute.md | 16 ------ .../examples/database/create-index.md | 17 ------- .../database/create-integer-attribute.md | 16 ------ .../examples/database/create-ip-attribute.md | 16 ------ .../database/create-string-attribute.md | 17 ------- .../examples/database/create-url-attribute.md | 16 ------ .../examples/database/delete-attribute.md | 15 ------ .../examples/database/delete-collection.md | 14 ------ .../examples/database/delete-document.md | 15 ------ .../examples/database/delete-index.md | 15 ------ .../examples/database/get-attribute.md | 15 ------ .../examples/database/get-collection.md | 14 ------ .../examples/database/get-document.md | 15 ------ .../examples/database/get-index.md | 15 ------ .../examples/database/list-attributes.md | 14 ------ .../examples/database/list-collections.md | 12 ----- .../examples/database/list-documents.md | 14 ------ .../examples/database/list-indexes.md | 14 ------ .../examples/database/update-collection.md | 16 ------ .../examples/database/update-document.md | 16 ------ .../examples/users/update-prefs.md | 2 +- 627 files changed, 1790 insertions(+), 6633 deletions(-) delete mode 100644 docs/examples/0.15.x/client-android/java/database/create-document.md delete mode 100644 docs/examples/0.15.x/client-android/java/database/delete-document.md delete mode 100644 docs/examples/0.15.x/client-android/java/database/get-document.md delete mode 100644 docs/examples/0.15.x/client-android/java/database/list-documents.md delete mode 100644 docs/examples/0.15.x/client-android/java/database/update-document.md delete mode 100644 docs/examples/0.15.x/client-android/kotlin/database/create-document.md delete mode 100644 docs/examples/0.15.x/client-android/kotlin/database/delete-document.md delete mode 100644 docs/examples/0.15.x/client-android/kotlin/database/get-document.md delete mode 100644 docs/examples/0.15.x/client-android/kotlin/database/list-documents.md delete mode 100644 docs/examples/0.15.x/client-android/kotlin/database/update-document.md delete mode 100644 docs/examples/0.15.x/client-apple/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/client-apple/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/client-apple/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/client-apple/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/client-apple/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/client-flutter/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/client-flutter/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/client-flutter/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/client-flutter/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/client-flutter/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/client-web/examples/account/create-session.md delete mode 100644 docs/examples/0.15.x/client-web/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/client-web/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/client-web/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/client-web/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/client-web/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/get-collection-usage.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/get-usage.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/list-collection-logs.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/list-document-logs.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/console-cli/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/console-web/examples/account/create-session.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/get-collection-usage.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/get-usage.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/list-collection-logs.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/list-document-logs.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/console-web/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/console-web/examples/users/update-verification.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-dart/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-deno/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/java/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-kotlin/kotlin/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-nodejs/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-php/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-python/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-ruby/examples/database/update-document.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-boolean-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-collection.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-document.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-email-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-enum-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-float-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-index.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-integer-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-ip-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-string-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/create-url-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/delete-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/delete-collection.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/delete-document.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/delete-index.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/get-attribute.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/get-collection.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/get-document.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/get-index.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/list-attributes.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/list-collections.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/list-documents.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/list-indexes.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/update-collection.md delete mode 100644 docs/examples/0.15.x/server-swift/examples/database/update-document.md diff --git a/docs/examples/0.15.x/client-android/java/database/create-document.md b/docs/examples/0.15.x/client-android/java/database/create-document.md deleted file mode 100644 index 059a42ed66..0000000000 --- a/docs/examples/0.15.x/client-android/java/database/create-document.md +++ /dev/null @@ -1,50 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Client client = new Client(getApplicationContext()) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID - - Database database = new Database(client); - - database.createDocument( - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - mapOf( "a" to "b" ), - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - json = response.body().string(); - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/java/database/delete-document.md b/docs/examples/0.15.x/client-android/java/database/delete-document.md deleted file mode 100644 index 75877c470a..0000000000 --- a/docs/examples/0.15.x/client-android/java/database/delete-document.md +++ /dev/null @@ -1,49 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Client client = new Client(getApplicationContext()) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID - - Database database = new Database(client); - - database.deleteDocument( - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - json = response.body().string(); - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/java/database/get-document.md b/docs/examples/0.15.x/client-android/java/database/get-document.md deleted file mode 100644 index 69aff1df2c..0000000000 --- a/docs/examples/0.15.x/client-android/java/database/get-document.md +++ /dev/null @@ -1,49 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Client client = new Client(getApplicationContext()) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID - - Database database = new Database(client); - - database.getDocument( - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - json = response.body().string(); - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/java/database/list-documents.md b/docs/examples/0.15.x/client-android/java/database/list-documents.md deleted file mode 100644 index 711aa412c0..0000000000 --- a/docs/examples/0.15.x/client-android/java/database/list-documents.md +++ /dev/null @@ -1,48 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Client client = new Client(getApplicationContext()) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID - - Database database = new Database(client); - - database.listDocuments( - "[COLLECTION_ID]", - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - json = response.body().string(); - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/java/database/update-document.md b/docs/examples/0.15.x/client-android/java/database/update-document.md deleted file mode 100644 index a14c91f48c..0000000000 --- a/docs/examples/0.15.x/client-android/java/database/update-document.md +++ /dev/null @@ -1,50 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Client client = new Client(getApplicationContext()) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID - - Database database = new Database(client); - - database.updateDocument( - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - mapOf( "a" to "b" ), - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - json = response.body().string(); - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/kotlin/database/create-document.md b/docs/examples/0.15.x/client-android/kotlin/database/create-document.md deleted file mode 100644 index d207383e62..0000000000 --- a/docs/examples/0.15.x/client-android/kotlin/database/create-document.md +++ /dev/null @@ -1,28 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val client = Client(applicationContext) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - - val database = Database(client) - - GlobalScope.launch { - val response = database.createDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), - ) - val json = response.body?.string() - } - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/kotlin/database/delete-document.md b/docs/examples/0.15.x/client-android/kotlin/database/delete-document.md deleted file mode 100644 index 49a85c8ebb..0000000000 --- a/docs/examples/0.15.x/client-android/kotlin/database/delete-document.md +++ /dev/null @@ -1,27 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val client = Client(applicationContext) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - - val database = Database(client) - - GlobalScope.launch { - val response = database.deleteDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" - ) - val json = response.body?.string() - } - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/kotlin/database/get-document.md b/docs/examples/0.15.x/client-android/kotlin/database/get-document.md deleted file mode 100644 index 3dd65c085d..0000000000 --- a/docs/examples/0.15.x/client-android/kotlin/database/get-document.md +++ /dev/null @@ -1,27 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val client = Client(applicationContext) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - - val database = Database(client) - - GlobalScope.launch { - val response = database.getDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" - ) - val json = response.body?.string() - } - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/kotlin/database/list-documents.md b/docs/examples/0.15.x/client-android/kotlin/database/list-documents.md deleted file mode 100644 index 65119819fd..0000000000 --- a/docs/examples/0.15.x/client-android/kotlin/database/list-documents.md +++ /dev/null @@ -1,26 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val client = Client(applicationContext) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - - val database = Database(client) - - GlobalScope.launch { - val response = database.listDocuments( - collectionId = "[COLLECTION_ID]", - ) - val json = response.body?.string() - } - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-android/kotlin/database/update-document.md b/docs/examples/0.15.x/client-android/kotlin/database/update-document.md deleted file mode 100644 index e19ce4a994..0000000000 --- a/docs/examples/0.15.x/client-android/kotlin/database/update-document.md +++ /dev/null @@ -1,28 +0,0 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch -import io.appwrite.Client -import io.appwrite.services.Database - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val client = Client(applicationContext) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - - val database = Database(client) - - GlobalScope.launch { - val response = database.updateDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), - ) - val json = response.body?.string() - } - } -} \ No newline at end of file diff --git a/docs/examples/0.15.x/client-apple/examples/account/update-prefs.md b/docs/examples/0.15.x/client-apple/examples/account/update-prefs.md index d9197a5482..2717ecb35e 100644 --- a/docs/examples/0.15.x/client-apple/examples/account/update-prefs.md +++ b/docs/examples/0.15.x/client-apple/examples/account/update-prefs.md @@ -6,7 +6,7 @@ func main() async throws { .setProject("5df5acd0d48c2") // Your project ID let account = Account(client) let user = try await account.updatePrefs( - prefs: + prefs: [:] ) print(String(describing: user) diff --git a/docs/examples/0.15.x/client-apple/examples/database/create-document.md b/docs/examples/0.15.x/client-apple/examples/database/create-document.md deleted file mode 100644 index 416580a46f..0000000000 --- a/docs/examples/0.15.x/client-apple/examples/database/create-document.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - let database = Database(client) - let document = try await database.createDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: - ) - - print(String(describing: document) -} diff --git a/docs/examples/0.15.x/client-apple/examples/database/delete-document.md b/docs/examples/0.15.x/client-apple/examples/database/delete-document.md deleted file mode 100644 index 04eecbf316..0000000000 --- a/docs/examples/0.15.x/client-apple/examples/database/delete-document.md +++ /dev/null @@ -1,14 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - let database = Database(client) - let result = try await database.deleteDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" - ) - - print(String(describing: result) -} diff --git a/docs/examples/0.15.x/client-apple/examples/database/get-document.md b/docs/examples/0.15.x/client-apple/examples/database/get-document.md deleted file mode 100644 index 26ad5a0b17..0000000000 --- a/docs/examples/0.15.x/client-apple/examples/database/get-document.md +++ /dev/null @@ -1,14 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - let database = Database(client) - let document = try await database.getDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" - ) - - print(String(describing: document) -} diff --git a/docs/examples/0.15.x/client-apple/examples/database/list-documents.md b/docs/examples/0.15.x/client-apple/examples/database/list-documents.md deleted file mode 100644 index f11cc2793f..0000000000 --- a/docs/examples/0.15.x/client-apple/examples/database/list-documents.md +++ /dev/null @@ -1,13 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - let database = Database(client) - let documentList = try await database.listDocuments( - collectionId: "[COLLECTION_ID]" - ) - - print(String(describing: documentList) -} diff --git a/docs/examples/0.15.x/client-apple/examples/database/update-document.md b/docs/examples/0.15.x/client-apple/examples/database/update-document.md deleted file mode 100644 index dc1e5646ac..0000000000 --- a/docs/examples/0.15.x/client-apple/examples/database/update-document.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - let database = Database(client) - let document = try await database.updateDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: - ) - - print(String(describing: document) -} diff --git a/docs/examples/0.15.x/client-flutter/examples/database/create-document.md b/docs/examples/0.15.x/client-flutter/examples/database/create-document.md deleted file mode 100644 index 9027b71dca..0000000000 --- a/docs/examples/0.15.x/client-flutter/examples/database/create-document.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - Future result = database.createDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - data: {}, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} diff --git a/docs/examples/0.15.x/client-flutter/examples/database/delete-document.md b/docs/examples/0.15.x/client-flutter/examples/database/delete-document.md deleted file mode 100644 index 94479a0949..0000000000 --- a/docs/examples/0.15.x/client-flutter/examples/database/delete-document.md +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - Future result = database.deleteDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} diff --git a/docs/examples/0.15.x/client-flutter/examples/database/get-document.md b/docs/examples/0.15.x/client-flutter/examples/database/get-document.md deleted file mode 100644 index 153ad8e0f9..0000000000 --- a/docs/examples/0.15.x/client-flutter/examples/database/get-document.md +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - Future result = database.getDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} diff --git a/docs/examples/0.15.x/client-flutter/examples/database/list-documents.md b/docs/examples/0.15.x/client-flutter/examples/database/list-documents.md deleted file mode 100644 index dc6893a285..0000000000 --- a/docs/examples/0.15.x/client-flutter/examples/database/list-documents.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - Future result = database.listDocuments( - collectionId: '[COLLECTION_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} diff --git a/docs/examples/0.15.x/client-flutter/examples/database/update-document.md b/docs/examples/0.15.x/client-flutter/examples/database/update-document.md deleted file mode 100644 index 65c23a297e..0000000000 --- a/docs/examples/0.15.x/client-flutter/examples/database/update-document.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - Future result = database.updateDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - data: {}, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} diff --git a/docs/examples/0.15.x/client-web/examples/account/create-anonymous-session.md b/docs/examples/0.15.x/client-web/examples/account/create-anonymous-session.md index 8979218e0f..a1ff484477 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-anonymous-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-anonymous-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createAnonymousSession(); +const promise = account.createAnonymousSession(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create-email-session.md b/docs/examples/0.15.x/client-web/examples/account/create-email-session.md index 449d257747..43a0aa25a0 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-email-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-email-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createEmailSession('email@example.com', 'password'); +const promise = account.createEmailSession('email@example.com', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create-j-w-t.md b/docs/examples/0.15.x/client-web/examples/account/create-j-w-t.md index cf00356375..3b5c7ed679 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-j-w-t.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-j-w-t.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createJWT(); +const promise = account.createJWT(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create-magic-u-r-l-session.md b/docs/examples/0.15.x/client-web/examples/account/create-magic-u-r-l-session.md index 5318f5f276..9339d6742c 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-magic-u-r-l-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createMagicURLSession('[USER_ID]', 'email@example.com'); +const promise = account.createMagicURLSession('[USER_ID]', 'email@example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create-o-auth2session.md b/docs/examples/0.15.x/client-web/examples/account/create-o-auth2session.md index 886a8f8480..25e67b15ec 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-o-auth2session.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-o-auth2session.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; // Go to OAuth provider login page -sdk.account.createOAuth2Session('amazon'); +account.createOAuth2Session('amazon'); diff --git a/docs/examples/0.15.x/client-web/examples/account/create-phone-session.md b/docs/examples/0.15.x/client-web/examples/account/create-phone-session.md index cf16e83b27..465dbe4e49 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-phone-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-phone-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createPhoneSession('[USER_ID]', ''); +const promise = account.createPhoneSession('[USER_ID]', ''); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create-phone-verification.md b/docs/examples/0.15.x/client-web/examples/account/create-phone-verification.md index a8bd195a45..f325a9210f 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-phone-verification.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-phone-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createPhoneVerification(); +const promise = account.createPhoneVerification(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create-recovery.md b/docs/examples/0.15.x/client-web/examples/account/create-recovery.md index f57e926e9b..4f737edf3d 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-recovery.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-recovery.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createRecovery('email@example.com', 'https://example.com'); +const promise = account.createRecovery('email@example.com', 'https://example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create-session.md b/docs/examples/0.15.x/client-web/examples/account/create-session.md deleted file mode 100644 index f41438306e..0000000000 --- a/docs/examples/0.15.x/client-web/examples/account/create-session.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.account.createSession('email@example.com', 'password'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/account/create-verification.md b/docs/examples/0.15.x/client-web/examples/account/create-verification.md index 6a00f1a3e1..0e7162c8cf 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create-verification.md +++ b/docs/examples/0.15.x/client-web/examples/account/create-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createVerification('https://example.com'); +const promise = account.createVerification('https://example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/create.md b/docs/examples/0.15.x/client-web/examples/account/create.md index 18f2fbbdc6..5b275bd1ba 100644 --- a/docs/examples/0.15.x/client-web/examples/account/create.md +++ b/docs/examples/0.15.x/client-web/examples/account/create.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.create('[USER_ID]', 'email@example.com', 'password'); +const promise = account.create('[USER_ID]', 'email@example.com', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/delete-session.md b/docs/examples/0.15.x/client-web/examples/account/delete-session.md index b3f46d15a9..a23a1f25e5 100644 --- a/docs/examples/0.15.x/client-web/examples/account/delete-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/delete-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.deleteSession('[SESSION_ID]'); +const promise = account.deleteSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/delete-sessions.md b/docs/examples/0.15.x/client-web/examples/account/delete-sessions.md index e89ba3087a..58495385f1 100644 --- a/docs/examples/0.15.x/client-web/examples/account/delete-sessions.md +++ b/docs/examples/0.15.x/client-web/examples/account/delete-sessions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.deleteSessions(); +const promise = account.deleteSessions(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/get-logs.md b/docs/examples/0.15.x/client-web/examples/account/get-logs.md index f382d7216c..934a4c251f 100644 --- a/docs/examples/0.15.x/client-web/examples/account/get-logs.md +++ b/docs/examples/0.15.x/client-web/examples/account/get-logs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getLogs(); +const promise = account.getLogs(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/get-prefs.md b/docs/examples/0.15.x/client-web/examples/account/get-prefs.md index 99e86d4f1d..a355c68ee0 100644 --- a/docs/examples/0.15.x/client-web/examples/account/get-prefs.md +++ b/docs/examples/0.15.x/client-web/examples/account/get-prefs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getPrefs(); +const promise = account.getPrefs(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/get-session.md b/docs/examples/0.15.x/client-web/examples/account/get-session.md index 79ec93f6e9..dd0c08633e 100644 --- a/docs/examples/0.15.x/client-web/examples/account/get-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/get-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getSession('[SESSION_ID]'); +const promise = account.getSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/get-sessions.md b/docs/examples/0.15.x/client-web/examples/account/get-sessions.md index 384e6fa347..ce3bc6130e 100644 --- a/docs/examples/0.15.x/client-web/examples/account/get-sessions.md +++ b/docs/examples/0.15.x/client-web/examples/account/get-sessions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getSessions(); +const promise = account.getSessions(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/get.md b/docs/examples/0.15.x/client-web/examples/account/get.md index cc933152a2..fd26ad70dc 100644 --- a/docs/examples/0.15.x/client-web/examples/account/get.md +++ b/docs/examples/0.15.x/client-web/examples/account/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.get(); +const promise = account.get(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-email.md b/docs/examples/0.15.x/client-web/examples/account/update-email.md index e4a68e25c9..6e3d603801 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-email.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-email.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateEmail('email@example.com', 'password'); +const promise = account.updateEmail('email@example.com', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-magic-u-r-l-session.md b/docs/examples/0.15.x/client-web/examples/account/update-magic-u-r-l-session.md index 3c00386b7f..1934263b69 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-magic-u-r-l-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateMagicURLSession('[USER_ID]', '[SECRET]'); +const promise = account.updateMagicURLSession('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-name.md b/docs/examples/0.15.x/client-web/examples/account/update-name.md index ff782195b1..24a27f1363 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-name.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-name.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateName('[NAME]'); +const promise = account.updateName('[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-password.md b/docs/examples/0.15.x/client-web/examples/account/update-password.md index d551ed726f..5ace968e6b 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-password.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-password.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePassword('password'); +const promise = account.updatePassword('password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-phone-session.md b/docs/examples/0.15.x/client-web/examples/account/update-phone-session.md index 59b6012ec0..8ad2051057 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-phone-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-phone-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePhoneSession('[USER_ID]', '[SECRET]'); +const promise = account.updatePhoneSession('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-phone-verification.md b/docs/examples/0.15.x/client-web/examples/account/update-phone-verification.md index 6b60f35dc3..b96f3bea21 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-phone-verification.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-phone-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePhoneVerification('[USER_ID]', '[SECRET]'); +const promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-phone.md b/docs/examples/0.15.x/client-web/examples/account/update-phone.md index f501ed55a7..852ab16538 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-phone.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-phone.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePhone('', 'password'); +const promise = account.updatePhone('', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-prefs.md b/docs/examples/0.15.x/client-web/examples/account/update-prefs.md index 232b77025b..4948631a27 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-prefs.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-prefs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePrefs({}); +const promise = account.updatePrefs({}); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-recovery.md b/docs/examples/0.15.x/client-web/examples/account/update-recovery.md index 6fe36c017e..85915f1ab9 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-recovery.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-recovery.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); +const promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-session.md b/docs/examples/0.15.x/client-web/examples/account/update-session.md index cfb61b679a..70fe5faa11 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-session.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateSession('[SESSION_ID]'); +const promise = account.updateSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-status.md b/docs/examples/0.15.x/client-web/examples/account/update-status.md index 1b22ae81ad..a7c7817338 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-status.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-status.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateStatus(); +const promise = account.updateStatus(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/account/update-verification.md b/docs/examples/0.15.x/client-web/examples/account/update-verification.md index e3312c5d5b..27d5cbc2f7 100644 --- a/docs/examples/0.15.x/client-web/examples/account/update-verification.md +++ b/docs/examples/0.15.x/client-web/examples/account/update-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateVerification('[USER_ID]', '[SECRET]'); +const promise = account.updateVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/avatars/get-browser.md b/docs/examples/0.15.x/client-web/examples/avatars/get-browser.md index fe0143b818..20480ce124 100644 --- a/docs/examples/0.15.x/client-web/examples/avatars/get-browser.md +++ b/docs/examples/0.15.x/client-web/examples/avatars/get-browser.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getBrowser('aa'); +const result = avatars.getBrowser('aa'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/avatars/get-credit-card.md b/docs/examples/0.15.x/client-web/examples/avatars/get-credit-card.md index 5477094ca5..cdbc4a0067 100644 --- a/docs/examples/0.15.x/client-web/examples/avatars/get-credit-card.md +++ b/docs/examples/0.15.x/client-web/examples/avatars/get-credit-card.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getCreditCard('amex'); +const result = avatars.getCreditCard('amex'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/avatars/get-favicon.md b/docs/examples/0.15.x/client-web/examples/avatars/get-favicon.md index 1327bb7384..f8db5c378c 100644 --- a/docs/examples/0.15.x/client-web/examples/avatars/get-favicon.md +++ b/docs/examples/0.15.x/client-web/examples/avatars/get-favicon.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getFavicon('https://example.com'); +const result = avatars.getFavicon('https://example.com'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/avatars/get-flag.md b/docs/examples/0.15.x/client-web/examples/avatars/get-flag.md index 13a90c3075..e609fb299d 100644 --- a/docs/examples/0.15.x/client-web/examples/avatars/get-flag.md +++ b/docs/examples/0.15.x/client-web/examples/avatars/get-flag.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getFlag('af'); +const result = avatars.getFlag('af'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/avatars/get-image.md b/docs/examples/0.15.x/client-web/examples/avatars/get-image.md index 82cb205a74..468f6a3c54 100644 --- a/docs/examples/0.15.x/client-web/examples/avatars/get-image.md +++ b/docs/examples/0.15.x/client-web/examples/avatars/get-image.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getImage('https://example.com'); +const result = avatars.getImage('https://example.com'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/avatars/get-initials.md b/docs/examples/0.15.x/client-web/examples/avatars/get-initials.md index a3da13d460..d061813297 100644 --- a/docs/examples/0.15.x/client-web/examples/avatars/get-initials.md +++ b/docs/examples/0.15.x/client-web/examples/avatars/get-initials.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getInitials(); +const result = avatars.getInitials(); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/avatars/get-q-r.md b/docs/examples/0.15.x/client-web/examples/avatars/get-q-r.md index c900a63531..86fed127e9 100644 --- a/docs/examples/0.15.x/client-web/examples/avatars/get-q-r.md +++ b/docs/examples/0.15.x/client-web/examples/avatars/get-q-r.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getQR('[TEXT]'); +const result = avatars.getQR('[TEXT]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/database/create-document.md b/docs/examples/0.15.x/client-web/examples/database/create-document.md deleted file mode 100644 index 5f57b2fc3d..0000000000 --- a/docs/examples/0.15.x/client-web/examples/database/create-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/database/delete-document.md b/docs/examples/0.15.x/client-web/examples/database/delete-document.md deleted file mode 100644 index 557662966d..0000000000 --- a/docs/examples/0.15.x/client-web/examples/database/delete-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/database/get-document.md b/docs/examples/0.15.x/client-web/examples/database/get-document.md deleted file mode 100644 index 841157f551..0000000000 --- a/docs/examples/0.15.x/client-web/examples/database/get-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/database/list-documents.md b/docs/examples/0.15.x/client-web/examples/database/list-documents.md deleted file mode 100644 index 620137cf8e..0000000000 --- a/docs/examples/0.15.x/client-web/examples/database/list-documents.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.listDocuments('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/database/update-document.md b/docs/examples/0.15.x/client-web/examples/database/update-document.md deleted file mode 100644 index b07b2ecac1..0000000000 --- a/docs/examples/0.15.x/client-web/examples/database/update-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/functions/create-execution.md b/docs/examples/0.15.x/client-web/examples/functions/create-execution.md index 87dc73a205..2b64bc9f7b 100644 --- a/docs/examples/0.15.x/client-web/examples/functions/create-execution.md +++ b/docs/examples/0.15.x/client-web/examples/functions/create-execution.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.createExecution('[FUNCTION_ID]'); +const promise = functions.createExecution('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/functions/get-execution.md b/docs/examples/0.15.x/client-web/examples/functions/get-execution.md index a8a0c4a0c8..f5046a08c4 100644 --- a/docs/examples/0.15.x/client-web/examples/functions/get-execution.md +++ b/docs/examples/0.15.x/client-web/examples/functions/get-execution.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); +const promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/functions/list-executions.md b/docs/examples/0.15.x/client-web/examples/functions/list-executions.md index 82652ddb6c..99186a95de 100644 --- a/docs/examples/0.15.x/client-web/examples/functions/list-executions.md +++ b/docs/examples/0.15.x/client-web/examples/functions/list-executions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.listExecutions('[FUNCTION_ID]'); +const promise = functions.listExecutions('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/functions/retry-build.md b/docs/examples/0.15.x/client-web/examples/functions/retry-build.md index e0f49976b0..1ef690a227 100644 --- a/docs/examples/0.15.x/client-web/examples/functions/retry-build.md +++ b/docs/examples/0.15.x/client-web/examples/functions/retry-build.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); +const promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/locale/get-continents.md b/docs/examples/0.15.x/client-web/examples/locale/get-continents.md index f0798a820c..9717181464 100644 --- a/docs/examples/0.15.x/client-web/examples/locale/get-continents.md +++ b/docs/examples/0.15.x/client-web/examples/locale/get-continents.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getContinents(); +const promise = locale.getContinents(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/locale/get-countries-e-u.md b/docs/examples/0.15.x/client-web/examples/locale/get-countries-e-u.md index 7bc6aa2d50..0439449721 100644 --- a/docs/examples/0.15.x/client-web/examples/locale/get-countries-e-u.md +++ b/docs/examples/0.15.x/client-web/examples/locale/get-countries-e-u.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCountriesEU(); +const promise = locale.getCountriesEU(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/locale/get-countries-phones.md b/docs/examples/0.15.x/client-web/examples/locale/get-countries-phones.md index e92982c1a2..26f104c5ac 100644 --- a/docs/examples/0.15.x/client-web/examples/locale/get-countries-phones.md +++ b/docs/examples/0.15.x/client-web/examples/locale/get-countries-phones.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCountriesPhones(); +const promise = locale.getCountriesPhones(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/locale/get-countries.md b/docs/examples/0.15.x/client-web/examples/locale/get-countries.md index bb12e6ab5f..ce80e526a4 100644 --- a/docs/examples/0.15.x/client-web/examples/locale/get-countries.md +++ b/docs/examples/0.15.x/client-web/examples/locale/get-countries.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCountries(); +const promise = locale.getCountries(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/locale/get-currencies.md b/docs/examples/0.15.x/client-web/examples/locale/get-currencies.md index 3382c2015c..14259a2453 100644 --- a/docs/examples/0.15.x/client-web/examples/locale/get-currencies.md +++ b/docs/examples/0.15.x/client-web/examples/locale/get-currencies.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCurrencies(); +const promise = locale.getCurrencies(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/locale/get-languages.md b/docs/examples/0.15.x/client-web/examples/locale/get-languages.md index a7fa4a0170..8866fb609b 100644 --- a/docs/examples/0.15.x/client-web/examples/locale/get-languages.md +++ b/docs/examples/0.15.x/client-web/examples/locale/get-languages.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getLanguages(); +const promise = locale.getLanguages(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/locale/get.md b/docs/examples/0.15.x/client-web/examples/locale/get.md index 89ade06941..634256c83e 100644 --- a/docs/examples/0.15.x/client-web/examples/locale/get.md +++ b/docs/examples/0.15.x/client-web/examples/locale/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.get(); +const promise = locale.get(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/storage/create-file.md b/docs/examples/0.15.x/client-web/examples/storage/create-file.md index f464fe608e..10992d2b89 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/create-file.md +++ b/docs/examples/0.15.x/client-web/examples/storage/create-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.createFile('[BUCKET_ID]', '[FILE_ID]', document.getElementById('uploader').files[0]); +const promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', document.getElementById('uploader').files[0]); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/storage/delete-file.md b/docs/examples/0.15.x/client-web/examples/storage/delete-file.md index 94c9e3112c..4512a8c1ce 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/delete-file.md +++ b/docs/examples/0.15.x/client-web/examples/storage/delete-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.deleteFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.deleteFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/storage/get-file-download.md b/docs/examples/0.15.x/client-web/examples/storage/get-file-download.md index 18a01aaa91..17c06600b3 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/get-file-download.md +++ b/docs/examples/0.15.x/client-web/examples/storage/get-file-download.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]'); +const result = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/storage/get-file-preview.md b/docs/examples/0.15.x/client-web/examples/storage/get-file-preview.md index b9d9377e1f..52866d108a 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/get-file-preview.md +++ b/docs/examples/0.15.x/client-web/examples/storage/get-file-preview.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]'); +const result = storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/storage/get-file-view.md b/docs/examples/0.15.x/client-web/examples/storage/get-file-view.md index eae4e78d6a..7bb6c67d51 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/get-file-view.md +++ b/docs/examples/0.15.x/client-web/examples/storage/get-file-view.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); +const result = storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/client-web/examples/storage/get-file.md b/docs/examples/0.15.x/client-web/examples/storage/get-file.md index 4a8eb23038..3263865c73 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/get-file.md +++ b/docs/examples/0.15.x/client-web/examples/storage/get-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.getFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.getFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/storage/list-files.md b/docs/examples/0.15.x/client-web/examples/storage/list-files.md index f4a83cd29d..92d75742a5 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/list-files.md +++ b/docs/examples/0.15.x/client-web/examples/storage/list-files.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.listFiles('[BUCKET_ID]'); +const promise = storage.listFiles('[BUCKET_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/storage/update-file.md b/docs/examples/0.15.x/client-web/examples/storage/update-file.md index fbb04a9bda..1313e30cff 100644 --- a/docs/examples/0.15.x/client-web/examples/storage/update-file.md +++ b/docs/examples/0.15.x/client-web/examples/storage/update-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.updateFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.updateFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/create-membership.md b/docs/examples/0.15.x/client-web/examples/teams/create-membership.md index 68b7f2be17..6cb7d87b7f 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/create-membership.md +++ b/docs/examples/0.15.x/client-web/examples/teams/create-membership.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); +const promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/create.md b/docs/examples/0.15.x/client-web/examples/teams/create.md index c0b5e6aa06..2c40c9017d 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/create.md +++ b/docs/examples/0.15.x/client-web/examples/teams/create.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.create('[TEAM_ID]', '[NAME]'); +const promise = teams.create('[TEAM_ID]', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/delete-membership.md b/docs/examples/0.15.x/client-web/examples/teams/delete-membership.md index 46916ab1f4..828674a86f 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/delete-membership.md +++ b/docs/examples/0.15.x/client-web/examples/teams/delete-membership.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); +const promise = teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/delete.md b/docs/examples/0.15.x/client-web/examples/teams/delete.md index e04f9f505a..b9b79ed1b7 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/delete.md +++ b/docs/examples/0.15.x/client-web/examples/teams/delete.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.delete('[TEAM_ID]'); +const promise = teams.delete('[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/get-membership.md b/docs/examples/0.15.x/client-web/examples/teams/get-membership.md index 0ff21ca48e..cce63e7fba 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/get-membership.md +++ b/docs/examples/0.15.x/client-web/examples/teams/get-membership.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); +const promise = teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/get-memberships.md b/docs/examples/0.15.x/client-web/examples/teams/get-memberships.md index c23f190cbe..41c1df2867 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/get-memberships.md +++ b/docs/examples/0.15.x/client-web/examples/teams/get-memberships.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.getMemberships('[TEAM_ID]'); +const promise = teams.getMemberships('[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/get.md b/docs/examples/0.15.x/client-web/examples/teams/get.md index c05bd59a0b..3a7185319a 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/get.md +++ b/docs/examples/0.15.x/client-web/examples/teams/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.get('[TEAM_ID]'); +const promise = teams.get('[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/list.md b/docs/examples/0.15.x/client-web/examples/teams/list.md index 1e1a974d80..1aea267038 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/list.md +++ b/docs/examples/0.15.x/client-web/examples/teams/list.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.list(); +const promise = teams.list(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/update-membership-roles.md b/docs/examples/0.15.x/client-web/examples/teams/update-membership-roles.md index 1d25e2601e..ca76ead1d6 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/update-membership-roles.md +++ b/docs/examples/0.15.x/client-web/examples/teams/update-membership-roles.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []); +const promise = teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/update-membership-status.md b/docs/examples/0.15.x/client-web/examples/teams/update-membership-status.md index 032f162501..4a29cdc116 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/update-membership-status.md +++ b/docs/examples/0.15.x/client-web/examples/teams/update-membership-status.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]'); +const promise = teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/client-web/examples/teams/update.md b/docs/examples/0.15.x/client-web/examples/teams/update.md index bcf53d1605..a59cc80000 100644 --- a/docs/examples/0.15.x/client-web/examples/teams/update.md +++ b/docs/examples/0.15.x/client-web/examples/teams/update.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.update('[TEAM_ID]', '[NAME]'); +const promise = teams.update('[TEAM_ID]', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-boolean-attribute.md deleted file mode 100644 index 4fa1b8f8b8..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database createBooleanAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --required false \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-collection.md b/docs/examples/0.15.x/console-cli/examples/database/create-collection.md deleted file mode 100644 index c08c5dad9e..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-collection.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database createCollection \ - --collectionId [COLLECTION_ID] \ - --name [NAME] \ - --permission document \ - --read "role:all" \ - --write "role:all" diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-document.md b/docs/examples/0.15.x/console-cli/examples/database/create-document.md deleted file mode 100644 index 7fc2e7d49a..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-document.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database createDocument \ - --collectionId [COLLECTION_ID] \ - --documentId [DOCUMENT_ID] \ - --data '{ "key": "value" }' \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-email-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-email-attribute.md deleted file mode 100644 index 649072b53c..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-email-attribute.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database createEmailAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --required false \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-enum-attribute.md deleted file mode 100644 index 309a57b566..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,7 +0,0 @@ -appwrite database createEnumAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --elements one two three \ - --required false \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-float-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-float-attribute.md deleted file mode 100644 index 5fff529cbb..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-float-attribute.md +++ /dev/null @@ -1,8 +0,0 @@ -appwrite database createFloatAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --required false \ - - - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-index.md b/docs/examples/0.15.x/console-cli/examples/database/create-index.md deleted file mode 100644 index e2b3b5d021..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-index.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database createIndex \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --type key \ - --attributes one two three \ - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-integer-attribute.md deleted file mode 100644 index 61546febf9..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,8 +0,0 @@ -appwrite database createIntegerAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --required false \ - - - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-ip-attribute.md deleted file mode 100644 index 19d40a73ef..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database createIpAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --required false \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-string-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-string-attribute.md deleted file mode 100644 index 542bc8e10b..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-string-attribute.md +++ /dev/null @@ -1,7 +0,0 @@ -appwrite database createStringAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --size 1 \ - --required false \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/create-url-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/create-url-attribute.md deleted file mode 100644 index 1ff338026d..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/create-url-attribute.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database createUrlAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' \ - --required false \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/delete-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/delete-attribute.md deleted file mode 100644 index 435919b006..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/delete-attribute.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite database deleteAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' diff --git a/docs/examples/0.15.x/console-cli/examples/database/delete-collection.md b/docs/examples/0.15.x/console-cli/examples/database/delete-collection.md deleted file mode 100644 index 90cfde5885..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/delete-collection.md +++ /dev/null @@ -1,2 +0,0 @@ -appwrite database deleteCollection \ - --collectionId [COLLECTION_ID] diff --git a/docs/examples/0.15.x/console-cli/examples/database/delete-document.md b/docs/examples/0.15.x/console-cli/examples/database/delete-document.md deleted file mode 100644 index 3987f90779..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/delete-document.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite database deleteDocument \ - --collectionId [COLLECTION_ID] \ - --documentId [DOCUMENT_ID] diff --git a/docs/examples/0.15.x/console-cli/examples/database/delete-index.md b/docs/examples/0.15.x/console-cli/examples/database/delete-index.md deleted file mode 100644 index d3ac3c6a54..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/delete-index.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite database deleteIndex \ - --collectionId [COLLECTION_ID] \ - --key '' diff --git a/docs/examples/0.15.x/console-cli/examples/database/get-attribute.md b/docs/examples/0.15.x/console-cli/examples/database/get-attribute.md deleted file mode 100644 index ef0a004b41..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/get-attribute.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite database getAttribute \ - --collectionId [COLLECTION_ID] \ - --key '' diff --git a/docs/examples/0.15.x/console-cli/examples/database/get-collection-usage.md b/docs/examples/0.15.x/console-cli/examples/database/get-collection-usage.md deleted file mode 100644 index e945936251..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/get-collection-usage.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite database getCollectionUsage \ - --collectionId [COLLECTION_ID] \ - diff --git a/docs/examples/0.15.x/console-cli/examples/database/get-collection.md b/docs/examples/0.15.x/console-cli/examples/database/get-collection.md deleted file mode 100644 index bfee02ff60..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/get-collection.md +++ /dev/null @@ -1,2 +0,0 @@ -appwrite database getCollection \ - --collectionId [COLLECTION_ID] diff --git a/docs/examples/0.15.x/console-cli/examples/database/get-document.md b/docs/examples/0.15.x/console-cli/examples/database/get-document.md deleted file mode 100644 index d1082b3967..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/get-document.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite database getDocument \ - --collectionId [COLLECTION_ID] \ - --documentId [DOCUMENT_ID] diff --git a/docs/examples/0.15.x/console-cli/examples/database/get-index.md b/docs/examples/0.15.x/console-cli/examples/database/get-index.md deleted file mode 100644 index d931f64b79..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/get-index.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite database getIndex \ - --collectionId [COLLECTION_ID] \ - --key '' diff --git a/docs/examples/0.15.x/console-cli/examples/database/get-usage.md b/docs/examples/0.15.x/console-cli/examples/database/get-usage.md deleted file mode 100644 index 4c0611a64e..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/get-usage.md +++ /dev/null @@ -1,2 +0,0 @@ -appwrite database getUsage \ - diff --git a/docs/examples/0.15.x/console-cli/examples/database/list-attributes.md b/docs/examples/0.15.x/console-cli/examples/database/list-attributes.md deleted file mode 100644 index 164f110d14..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/list-attributes.md +++ /dev/null @@ -1,2 +0,0 @@ -appwrite database listAttributes \ - --collectionId [COLLECTION_ID] diff --git a/docs/examples/0.15.x/console-cli/examples/database/list-collection-logs.md b/docs/examples/0.15.x/console-cli/examples/database/list-collection-logs.md deleted file mode 100644 index d6dfcf5163..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/list-collection-logs.md +++ /dev/null @@ -1,4 +0,0 @@ -appwrite database listCollectionLogs \ - --collectionId [COLLECTION_ID] \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/list-collections.md b/docs/examples/0.15.x/console-cli/examples/database/list-collections.md deleted file mode 100644 index a81fd940dc..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/list-collections.md +++ /dev/null @@ -1,7 +0,0 @@ -appwrite database listCollections \ - - - - - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/list-document-logs.md b/docs/examples/0.15.x/console-cli/examples/database/list-document-logs.md deleted file mode 100644 index dfe192e6ed..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/list-document-logs.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite database listDocumentLogs \ - --collectionId [COLLECTION_ID] \ - --documentId [DOCUMENT_ID] \ - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/list-documents.md b/docs/examples/0.15.x/console-cli/examples/database/list-documents.md deleted file mode 100644 index cd295c64c7..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/list-documents.md +++ /dev/null @@ -1,9 +0,0 @@ -appwrite database listDocuments \ - --collectionId [COLLECTION_ID] \ - - - - - - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/list-indexes.md b/docs/examples/0.15.x/console-cli/examples/database/list-indexes.md deleted file mode 100644 index ccfc13f2ab..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/list-indexes.md +++ /dev/null @@ -1,2 +0,0 @@ -appwrite database listIndexes \ - --collectionId [COLLECTION_ID] diff --git a/docs/examples/0.15.x/console-cli/examples/database/update-collection.md b/docs/examples/0.15.x/console-cli/examples/database/update-collection.md deleted file mode 100644 index 576fbe5c71..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/update-collection.md +++ /dev/null @@ -1,7 +0,0 @@ -appwrite database updateCollection \ - --collectionId [COLLECTION_ID] \ - --name [NAME] \ - --permission document \ - - - diff --git a/docs/examples/0.15.x/console-cli/examples/database/update-document.md b/docs/examples/0.15.x/console-cli/examples/database/update-document.md deleted file mode 100644 index 475ff0d557..0000000000 --- a/docs/examples/0.15.x/console-cli/examples/database/update-document.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite database updateDocument \ - --collectionId [COLLECTION_ID] \ - --documentId [DOCUMENT_ID] \ - --data '{ "key": "value" }' \ - - diff --git a/docs/examples/0.15.x/console-web/examples/account/create-anonymous-session.md b/docs/examples/0.15.x/console-web/examples/account/create-anonymous-session.md index 8979218e0f..a1ff484477 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-anonymous-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-anonymous-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createAnonymousSession(); +const promise = account.createAnonymousSession(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create-email-session.md b/docs/examples/0.15.x/console-web/examples/account/create-email-session.md index 449d257747..43a0aa25a0 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-email-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-email-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createEmailSession('email@example.com', 'password'); +const promise = account.createEmailSession('email@example.com', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create-j-w-t.md b/docs/examples/0.15.x/console-web/examples/account/create-j-w-t.md index cf00356375..3b5c7ed679 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-j-w-t.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-j-w-t.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createJWT(); +const promise = account.createJWT(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create-magic-u-r-l-session.md b/docs/examples/0.15.x/console-web/examples/account/create-magic-u-r-l-session.md index 5318f5f276..9339d6742c 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-magic-u-r-l-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createMagicURLSession('[USER_ID]', 'email@example.com'); +const promise = account.createMagicURLSession('[USER_ID]', 'email@example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create-o-auth2session.md b/docs/examples/0.15.x/console-web/examples/account/create-o-auth2session.md index 886a8f8480..25e67b15ec 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-o-auth2session.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-o-auth2session.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; // Go to OAuth provider login page -sdk.account.createOAuth2Session('amazon'); +account.createOAuth2Session('amazon'); diff --git a/docs/examples/0.15.x/console-web/examples/account/create-phone-session.md b/docs/examples/0.15.x/console-web/examples/account/create-phone-session.md index cf16e83b27..465dbe4e49 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-phone-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-phone-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createPhoneSession('[USER_ID]', ''); +const promise = account.createPhoneSession('[USER_ID]', ''); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create-phone-verification.md b/docs/examples/0.15.x/console-web/examples/account/create-phone-verification.md index a8bd195a45..f325a9210f 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-phone-verification.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-phone-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createPhoneVerification(); +const promise = account.createPhoneVerification(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create-recovery.md b/docs/examples/0.15.x/console-web/examples/account/create-recovery.md index f57e926e9b..4f737edf3d 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-recovery.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-recovery.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createRecovery('email@example.com', 'https://example.com'); +const promise = account.createRecovery('email@example.com', 'https://example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create-session.md b/docs/examples/0.15.x/console-web/examples/account/create-session.md deleted file mode 100644 index f41438306e..0000000000 --- a/docs/examples/0.15.x/console-web/examples/account/create-session.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.account.createSession('email@example.com', 'password'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/account/create-verification.md b/docs/examples/0.15.x/console-web/examples/account/create-verification.md index 6a00f1a3e1..0e7162c8cf 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create-verification.md +++ b/docs/examples/0.15.x/console-web/examples/account/create-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createVerification('https://example.com'); +const promise = account.createVerification('https://example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/create.md b/docs/examples/0.15.x/console-web/examples/account/create.md index 18f2fbbdc6..5b275bd1ba 100644 --- a/docs/examples/0.15.x/console-web/examples/account/create.md +++ b/docs/examples/0.15.x/console-web/examples/account/create.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.create('[USER_ID]', 'email@example.com', 'password'); +const promise = account.create('[USER_ID]', 'email@example.com', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/delete-session.md b/docs/examples/0.15.x/console-web/examples/account/delete-session.md index b3f46d15a9..a23a1f25e5 100644 --- a/docs/examples/0.15.x/console-web/examples/account/delete-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/delete-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.deleteSession('[SESSION_ID]'); +const promise = account.deleteSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/delete-sessions.md b/docs/examples/0.15.x/console-web/examples/account/delete-sessions.md index e89ba3087a..58495385f1 100644 --- a/docs/examples/0.15.x/console-web/examples/account/delete-sessions.md +++ b/docs/examples/0.15.x/console-web/examples/account/delete-sessions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.deleteSessions(); +const promise = account.deleteSessions(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/get-logs.md b/docs/examples/0.15.x/console-web/examples/account/get-logs.md index f382d7216c..934a4c251f 100644 --- a/docs/examples/0.15.x/console-web/examples/account/get-logs.md +++ b/docs/examples/0.15.x/console-web/examples/account/get-logs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getLogs(); +const promise = account.getLogs(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/get-prefs.md b/docs/examples/0.15.x/console-web/examples/account/get-prefs.md index 99e86d4f1d..a355c68ee0 100644 --- a/docs/examples/0.15.x/console-web/examples/account/get-prefs.md +++ b/docs/examples/0.15.x/console-web/examples/account/get-prefs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getPrefs(); +const promise = account.getPrefs(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/get-session.md b/docs/examples/0.15.x/console-web/examples/account/get-session.md index 79ec93f6e9..dd0c08633e 100644 --- a/docs/examples/0.15.x/console-web/examples/account/get-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/get-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getSession('[SESSION_ID]'); +const promise = account.getSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/get-sessions.md b/docs/examples/0.15.x/console-web/examples/account/get-sessions.md index 384e6fa347..ce3bc6130e 100644 --- a/docs/examples/0.15.x/console-web/examples/account/get-sessions.md +++ b/docs/examples/0.15.x/console-web/examples/account/get-sessions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.getSessions(); +const promise = account.getSessions(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/get.md b/docs/examples/0.15.x/console-web/examples/account/get.md index cc933152a2..fd26ad70dc 100644 --- a/docs/examples/0.15.x/console-web/examples/account/get.md +++ b/docs/examples/0.15.x/console-web/examples/account/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.get(); +const promise = account.get(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-email.md b/docs/examples/0.15.x/console-web/examples/account/update-email.md index e4a68e25c9..6e3d603801 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-email.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-email.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateEmail('email@example.com', 'password'); +const promise = account.updateEmail('email@example.com', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-magic-u-r-l-session.md b/docs/examples/0.15.x/console-web/examples/account/update-magic-u-r-l-session.md index 3c00386b7f..1934263b69 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-magic-u-r-l-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateMagicURLSession('[USER_ID]', '[SECRET]'); +const promise = account.updateMagicURLSession('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-name.md b/docs/examples/0.15.x/console-web/examples/account/update-name.md index ff782195b1..24a27f1363 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-name.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-name.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateName('[NAME]'); +const promise = account.updateName('[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-password.md b/docs/examples/0.15.x/console-web/examples/account/update-password.md index d551ed726f..5ace968e6b 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-password.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-password.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePassword('password'); +const promise = account.updatePassword('password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-phone-session.md b/docs/examples/0.15.x/console-web/examples/account/update-phone-session.md index 59b6012ec0..8ad2051057 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-phone-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-phone-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePhoneSession('[USER_ID]', '[SECRET]'); +const promise = account.updatePhoneSession('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-phone-verification.md b/docs/examples/0.15.x/console-web/examples/account/update-phone-verification.md index 6b60f35dc3..b96f3bea21 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-phone-verification.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-phone-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePhoneVerification('[USER_ID]', '[SECRET]'); +const promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-phone.md b/docs/examples/0.15.x/console-web/examples/account/update-phone.md index f501ed55a7..852ab16538 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-phone.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-phone.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePhone('', 'password'); +const promise = account.updatePhone('', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-prefs.md b/docs/examples/0.15.x/console-web/examples/account/update-prefs.md index 232b77025b..4948631a27 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-prefs.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-prefs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updatePrefs({}); +const promise = account.updatePrefs({}); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-recovery.md b/docs/examples/0.15.x/console-web/examples/account/update-recovery.md index 6fe36c017e..85915f1ab9 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-recovery.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-recovery.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); +const promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-session.md b/docs/examples/0.15.x/console-web/examples/account/update-session.md index cfb61b679a..70fe5faa11 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-session.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateSession('[SESSION_ID]'); +const promise = account.updateSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-status.md b/docs/examples/0.15.x/console-web/examples/account/update-status.md index 1b22ae81ad..a7c7817338 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-status.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-status.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateStatus(); +const promise = account.updateStatus(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/account/update-verification.md b/docs/examples/0.15.x/console-web/examples/account/update-verification.md index e3312c5d5b..27d5cbc2f7 100644 --- a/docs/examples/0.15.x/console-web/examples/account/update-verification.md +++ b/docs/examples/0.15.x/console-web/examples/account/update-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Account } from "appwrite"; -sdk +const client = new Client(); + +const account = new Account(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.updateVerification('[USER_ID]', '[SECRET]'); +const promise = account.updateVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/avatars/get-browser.md b/docs/examples/0.15.x/console-web/examples/avatars/get-browser.md index fe0143b818..20480ce124 100644 --- a/docs/examples/0.15.x/console-web/examples/avatars/get-browser.md +++ b/docs/examples/0.15.x/console-web/examples/avatars/get-browser.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getBrowser('aa'); +const result = avatars.getBrowser('aa'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/avatars/get-credit-card.md b/docs/examples/0.15.x/console-web/examples/avatars/get-credit-card.md index 5477094ca5..cdbc4a0067 100644 --- a/docs/examples/0.15.x/console-web/examples/avatars/get-credit-card.md +++ b/docs/examples/0.15.x/console-web/examples/avatars/get-credit-card.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getCreditCard('amex'); +const result = avatars.getCreditCard('amex'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/avatars/get-favicon.md b/docs/examples/0.15.x/console-web/examples/avatars/get-favicon.md index 1327bb7384..f8db5c378c 100644 --- a/docs/examples/0.15.x/console-web/examples/avatars/get-favicon.md +++ b/docs/examples/0.15.x/console-web/examples/avatars/get-favicon.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getFavicon('https://example.com'); +const result = avatars.getFavicon('https://example.com'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/avatars/get-flag.md b/docs/examples/0.15.x/console-web/examples/avatars/get-flag.md index 13a90c3075..e609fb299d 100644 --- a/docs/examples/0.15.x/console-web/examples/avatars/get-flag.md +++ b/docs/examples/0.15.x/console-web/examples/avatars/get-flag.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getFlag('af'); +const result = avatars.getFlag('af'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/avatars/get-image.md b/docs/examples/0.15.x/console-web/examples/avatars/get-image.md index 82cb205a74..468f6a3c54 100644 --- a/docs/examples/0.15.x/console-web/examples/avatars/get-image.md +++ b/docs/examples/0.15.x/console-web/examples/avatars/get-image.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getImage('https://example.com'); +const result = avatars.getImage('https://example.com'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/avatars/get-initials.md b/docs/examples/0.15.x/console-web/examples/avatars/get-initials.md index a3da13d460..d061813297 100644 --- a/docs/examples/0.15.x/console-web/examples/avatars/get-initials.md +++ b/docs/examples/0.15.x/console-web/examples/avatars/get-initials.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getInitials(); +const result = avatars.getInitials(); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/avatars/get-q-r.md b/docs/examples/0.15.x/console-web/examples/avatars/get-q-r.md index c900a63531..86fed127e9 100644 --- a/docs/examples/0.15.x/console-web/examples/avatars/get-q-r.md +++ b/docs/examples/0.15.x/console-web/examples/avatars/get-q-r.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Avatars } from "appwrite"; -sdk +const client = new Client(); + +const avatars = new Avatars(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.avatars.getQR('[TEXT]'); +const result = avatars.getQR('[TEXT]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-boolean-attribute.md deleted file mode 100644 index cfa1ea0e8d..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createBooleanAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-collection.md b/docs/examples/0.15.x/console-web/examples/database/create-collection.md deleted file mode 100644 index c4add41814..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createCollection('[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-document.md b/docs/examples/0.15.x/console-web/examples/database/create-document.md deleted file mode 100644 index 5f57b2fc3d..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-email-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-email-attribute.md deleted file mode 100644 index c6dc762917..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-email-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createEmailAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-enum-attribute.md deleted file mode 100644 index e1d8146d3d..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createEnumAttribute('[COLLECTION_ID]', '', [], false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-float-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-float-attribute.md deleted file mode 100644 index 302a6fdfa3..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-float-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createFloatAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-index.md b/docs/examples/0.15.x/console-web/examples/database/create-index.md deleted file mode 100644 index 4dc3b43fef..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-index.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createIndex('[COLLECTION_ID]', '', 'key', []); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-integer-attribute.md deleted file mode 100644 index e9d50a2525..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createIntegerAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-ip-attribute.md deleted file mode 100644 index 62fad8c742..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createIpAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-string-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-string-attribute.md deleted file mode 100644 index 2a5b6169fd..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-string-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createStringAttribute('[COLLECTION_ID]', '', 1, false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/create-url-attribute.md b/docs/examples/0.15.x/console-web/examples/database/create-url-attribute.md deleted file mode 100644 index e95c5f0a72..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/create-url-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.createUrlAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/delete-attribute.md b/docs/examples/0.15.x/console-web/examples/database/delete-attribute.md deleted file mode 100644 index 574137390b..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/delete-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.deleteAttribute('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/delete-collection.md b/docs/examples/0.15.x/console-web/examples/database/delete-collection.md deleted file mode 100644 index 94ff0a6f06..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/delete-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.deleteCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/delete-document.md b/docs/examples/0.15.x/console-web/examples/database/delete-document.md deleted file mode 100644 index 557662966d..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/delete-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/delete-index.md b/docs/examples/0.15.x/console-web/examples/database/delete-index.md deleted file mode 100644 index 0ffb7b626b..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/delete-index.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.deleteIndex('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/get-attribute.md b/docs/examples/0.15.x/console-web/examples/database/get-attribute.md deleted file mode 100644 index 38f96614e1..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/get-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.getAttribute('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/get-collection-usage.md b/docs/examples/0.15.x/console-web/examples/database/get-collection-usage.md deleted file mode 100644 index 80bb7a8acd..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/get-collection-usage.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.getCollectionUsage('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/get-collection.md b/docs/examples/0.15.x/console-web/examples/database/get-collection.md deleted file mode 100644 index 4180a5c7db..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/get-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.getCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/get-document.md b/docs/examples/0.15.x/console-web/examples/database/get-document.md deleted file mode 100644 index 841157f551..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/get-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/get-index.md b/docs/examples/0.15.x/console-web/examples/database/get-index.md deleted file mode 100644 index 1994f9c8a3..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/get-index.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.getIndex('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/get-usage.md b/docs/examples/0.15.x/console-web/examples/database/get-usage.md deleted file mode 100644 index 1e4316ac62..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/get-usage.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.getUsage(); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/list-attributes.md b/docs/examples/0.15.x/console-web/examples/database/list-attributes.md deleted file mode 100644 index e05c5e778f..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/list-attributes.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.listAttributes('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/list-collection-logs.md b/docs/examples/0.15.x/console-web/examples/database/list-collection-logs.md deleted file mode 100644 index 536b1c698b..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/list-collection-logs.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.listCollectionLogs('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/list-collections.md b/docs/examples/0.15.x/console-web/examples/database/list-collections.md deleted file mode 100644 index d06151dcee..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/list-collections.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.listCollections(); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/list-document-logs.md b/docs/examples/0.15.x/console-web/examples/database/list-document-logs.md deleted file mode 100644 index 761328157c..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/list-document-logs.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.listDocumentLogs('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/list-documents.md b/docs/examples/0.15.x/console-web/examples/database/list-documents.md deleted file mode 100644 index 620137cf8e..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/list-documents.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.listDocuments('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/list-indexes.md b/docs/examples/0.15.x/console-web/examples/database/list-indexes.md deleted file mode 100644 index 4d755d929b..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/list-indexes.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.listIndexes('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/update-collection.md b/docs/examples/0.15.x/console-web/examples/database/update-collection.md deleted file mode 100644 index efca04d443..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/update-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.updateCollection('[COLLECTION_ID]', '[NAME]', 'document'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/database/update-document.md b/docs/examples/0.15.x/console-web/examples/database/update-document.md deleted file mode 100644 index b07b2ecac1..0000000000 --- a/docs/examples/0.15.x/console-web/examples/database/update-document.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/functions/create-deployment.md b/docs/examples/0.15.x/console-web/examples/functions/create-deployment.md index 6076987a56..57687bc535 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/create-deployment.md +++ b/docs/examples/0.15.x/console-web/examples/functions/create-deployment.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', document.getElementById('uploader').files[0], false); +const promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', document.getElementById('uploader').files[0], false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/create-execution.md b/docs/examples/0.15.x/console-web/examples/functions/create-execution.md index 87dc73a205..2b64bc9f7b 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/create-execution.md +++ b/docs/examples/0.15.x/console-web/examples/functions/create-execution.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.createExecution('[FUNCTION_ID]'); +const promise = functions.createExecution('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/create.md b/docs/examples/0.15.x/console-web/examples/functions/create.md index 296e2798c6..7a1a0921af 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/create.md +++ b/docs/examples/0.15.x/console-web/examples/functions/create.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5'); +const promise = functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/delete-deployment.md b/docs/examples/0.15.x/console-web/examples/functions/delete-deployment.md index 1bea4d90fc..8f2c646401 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/delete-deployment.md +++ b/docs/examples/0.15.x/console-web/examples/functions/delete-deployment.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); +const promise = functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/delete.md b/docs/examples/0.15.x/console-web/examples/functions/delete.md index d080c101bf..4ac987df81 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/delete.md +++ b/docs/examples/0.15.x/console-web/examples/functions/delete.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.delete('[FUNCTION_ID]'); +const promise = functions.delete('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/get-deployment.md b/docs/examples/0.15.x/console-web/examples/functions/get-deployment.md index 3eb536f9ee..a07fb7e844 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/get-deployment.md +++ b/docs/examples/0.15.x/console-web/examples/functions/get-deployment.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); +const promise = functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/get-execution.md b/docs/examples/0.15.x/console-web/examples/functions/get-execution.md index a8a0c4a0c8..f5046a08c4 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/get-execution.md +++ b/docs/examples/0.15.x/console-web/examples/functions/get-execution.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); +const promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/get-usage.md b/docs/examples/0.15.x/console-web/examples/functions/get-usage.md index 3a14e5d0be..c01af9b6dc 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/get-usage.md +++ b/docs/examples/0.15.x/console-web/examples/functions/get-usage.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.getUsage('[FUNCTION_ID]'); +const promise = functions.getUsage('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/get.md b/docs/examples/0.15.x/console-web/examples/functions/get.md index eeeee205bd..b6e32b5171 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/get.md +++ b/docs/examples/0.15.x/console-web/examples/functions/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.get('[FUNCTION_ID]'); +const promise = functions.get('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/list-deployments.md b/docs/examples/0.15.x/console-web/examples/functions/list-deployments.md index 04ef5bf9c4..843dd07a61 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/list-deployments.md +++ b/docs/examples/0.15.x/console-web/examples/functions/list-deployments.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.listDeployments('[FUNCTION_ID]'); +const promise = functions.listDeployments('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/list-executions.md b/docs/examples/0.15.x/console-web/examples/functions/list-executions.md index 82652ddb6c..99186a95de 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/list-executions.md +++ b/docs/examples/0.15.x/console-web/examples/functions/list-executions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.listExecutions('[FUNCTION_ID]'); +const promise = functions.listExecutions('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/list-runtimes.md b/docs/examples/0.15.x/console-web/examples/functions/list-runtimes.md index a6d0099e1b..d5e1f6630e 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/list-runtimes.md +++ b/docs/examples/0.15.x/console-web/examples/functions/list-runtimes.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.listRuntimes(); +const promise = functions.listRuntimes(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/list.md b/docs/examples/0.15.x/console-web/examples/functions/list.md index 3002e2d8ee..730a90fff6 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/list.md +++ b/docs/examples/0.15.x/console-web/examples/functions/list.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.list(); +const promise = functions.list(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/retry-build.md b/docs/examples/0.15.x/console-web/examples/functions/retry-build.md index e0f49976b0..1ef690a227 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/retry-build.md +++ b/docs/examples/0.15.x/console-web/examples/functions/retry-build.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); +const promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/update-deployment.md b/docs/examples/0.15.x/console-web/examples/functions/update-deployment.md index e8e3ad2faa..b231ae593e 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/update-deployment.md +++ b/docs/examples/0.15.x/console-web/examples/functions/update-deployment.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); +const promise = functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/functions/update.md b/docs/examples/0.15.x/console-web/examples/functions/update.md index 4243843568..4ffbe859cf 100644 --- a/docs/examples/0.15.x/console-web/examples/functions/update.md +++ b/docs/examples/0.15.x/console-web/examples/functions/update.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Functions } from "appwrite"; -sdk +const client = new Client(); + +const functions = new Functions(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.functions.update('[FUNCTION_ID]', '[NAME]', []); +const promise = functions.update('[FUNCTION_ID]', '[NAME]', []); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-antivirus.md b/docs/examples/0.15.x/console-web/examples/health/get-antivirus.md index 71e16bd903..0b14fa8acf 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-antivirus.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-antivirus.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getAntivirus(); +const promise = health.getAntivirus(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-cache.md b/docs/examples/0.15.x/console-web/examples/health/get-cache.md index a087d8db58..a754f9be93 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-cache.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-cache.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getCache(); +const promise = health.getCache(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-d-b.md b/docs/examples/0.15.x/console-web/examples/health/get-d-b.md index fa4810de41..86ff4a7d84 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-d-b.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-d-b.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getDB(); +const promise = health.getDB(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-queue-certificates.md b/docs/examples/0.15.x/console-web/examples/health/get-queue-certificates.md index 9395664549..2b4dc05c37 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-queue-certificates.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-queue-certificates.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getQueueCertificates(); +const promise = health.getQueueCertificates(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-queue-functions.md b/docs/examples/0.15.x/console-web/examples/health/get-queue-functions.md index 9153497870..9d6f3b7f7d 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-queue-functions.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-queue-functions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getQueueFunctions(); +const promise = health.getQueueFunctions(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-queue-logs.md b/docs/examples/0.15.x/console-web/examples/health/get-queue-logs.md index 32b58757a3..010e603f92 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-queue-logs.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-queue-logs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getQueueLogs(); +const promise = health.getQueueLogs(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-queue-webhooks.md b/docs/examples/0.15.x/console-web/examples/health/get-queue-webhooks.md index 8a23b957d7..2687863f12 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-queue-webhooks.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-queue-webhooks.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getQueueWebhooks(); +const promise = health.getQueueWebhooks(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-storage-local.md b/docs/examples/0.15.x/console-web/examples/health/get-storage-local.md index 8fb72d9538..b11daa2fec 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-storage-local.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-storage-local.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getStorageLocal(); +const promise = health.getStorageLocal(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get-time.md b/docs/examples/0.15.x/console-web/examples/health/get-time.md index 49c9848e9b..1f617e13a2 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get-time.md +++ b/docs/examples/0.15.x/console-web/examples/health/get-time.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.getTime(); +const promise = health.getTime(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/health/get.md b/docs/examples/0.15.x/console-web/examples/health/get.md index b933fb70f0..b1d6be4509 100644 --- a/docs/examples/0.15.x/console-web/examples/health/get.md +++ b/docs/examples/0.15.x/console-web/examples/health/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Health } from "appwrite"; -sdk +const client = new Client(); + +const health = new Health(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.health.get(); +const promise = health.get(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/locale/get-continents.md b/docs/examples/0.15.x/console-web/examples/locale/get-continents.md index f0798a820c..9717181464 100644 --- a/docs/examples/0.15.x/console-web/examples/locale/get-continents.md +++ b/docs/examples/0.15.x/console-web/examples/locale/get-continents.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getContinents(); +const promise = locale.getContinents(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/locale/get-countries-e-u.md b/docs/examples/0.15.x/console-web/examples/locale/get-countries-e-u.md index 7bc6aa2d50..0439449721 100644 --- a/docs/examples/0.15.x/console-web/examples/locale/get-countries-e-u.md +++ b/docs/examples/0.15.x/console-web/examples/locale/get-countries-e-u.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCountriesEU(); +const promise = locale.getCountriesEU(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/locale/get-countries-phones.md b/docs/examples/0.15.x/console-web/examples/locale/get-countries-phones.md index e92982c1a2..26f104c5ac 100644 --- a/docs/examples/0.15.x/console-web/examples/locale/get-countries-phones.md +++ b/docs/examples/0.15.x/console-web/examples/locale/get-countries-phones.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCountriesPhones(); +const promise = locale.getCountriesPhones(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/locale/get-countries.md b/docs/examples/0.15.x/console-web/examples/locale/get-countries.md index bb12e6ab5f..ce80e526a4 100644 --- a/docs/examples/0.15.x/console-web/examples/locale/get-countries.md +++ b/docs/examples/0.15.x/console-web/examples/locale/get-countries.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCountries(); +const promise = locale.getCountries(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/locale/get-currencies.md b/docs/examples/0.15.x/console-web/examples/locale/get-currencies.md index 3382c2015c..14259a2453 100644 --- a/docs/examples/0.15.x/console-web/examples/locale/get-currencies.md +++ b/docs/examples/0.15.x/console-web/examples/locale/get-currencies.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getCurrencies(); +const promise = locale.getCurrencies(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/locale/get-languages.md b/docs/examples/0.15.x/console-web/examples/locale/get-languages.md index a7fa4a0170..8866fb609b 100644 --- a/docs/examples/0.15.x/console-web/examples/locale/get-languages.md +++ b/docs/examples/0.15.x/console-web/examples/locale/get-languages.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.getLanguages(); +const promise = locale.getLanguages(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/locale/get.md b/docs/examples/0.15.x/console-web/examples/locale/get.md index 89ade06941..634256c83e 100644 --- a/docs/examples/0.15.x/console-web/examples/locale/get.md +++ b/docs/examples/0.15.x/console-web/examples/locale/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Locale } from "appwrite"; -sdk +const client = new Client(); + +const locale = new Locale(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.locale.get(); +const promise = locale.get(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/create-domain.md b/docs/examples/0.15.x/console-web/examples/projects/create-domain.md index 1382106c03..452a594c48 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/create-domain.md +++ b/docs/examples/0.15.x/console-web/examples/projects/create-domain.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.createDomain('[PROJECT_ID]', ''); +const promise = projects.createDomain('[PROJECT_ID]', ''); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/create-key.md b/docs/examples/0.15.x/console-web/examples/projects/create-key.md index 95157eab7b..8bd57d54c6 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/create-key.md +++ b/docs/examples/0.15.x/console-web/examples/projects/create-key.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.createKey('[PROJECT_ID]', '[NAME]', []); +const promise = projects.createKey('[PROJECT_ID]', '[NAME]', []); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/create-platform.md b/docs/examples/0.15.x/console-web/examples/projects/create-platform.md index 177fe89e01..c2c6a030b4 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/create-platform.md +++ b/docs/examples/0.15.x/console-web/examples/projects/create-platform.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.createPlatform('[PROJECT_ID]', 'web', '[NAME]'); +const promise = projects.createPlatform('[PROJECT_ID]', 'web', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/create-webhook.md b/docs/examples/0.15.x/console-web/examples/projects/create-webhook.md index f3a1271d34..1469e6b30f 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/create-webhook.md +++ b/docs/examples/0.15.x/console-web/examples/projects/create-webhook.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], 'https://example.com', false); +const promise = projects.createWebhook('[PROJECT_ID]', '[NAME]', [], 'https://example.com', false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/create.md b/docs/examples/0.15.x/console-web/examples/projects/create.md index 5321ffa040..792515c35b 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/create.md +++ b/docs/examples/0.15.x/console-web/examples/projects/create.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.create('[PROJECT_ID]', '[NAME]', '[TEAM_ID]'); +const promise = projects.create('[PROJECT_ID]', '[NAME]', '[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/delete-domain.md b/docs/examples/0.15.x/console-web/examples/projects/delete-domain.md index 53aaa577f7..266d343ae1 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/delete-domain.md +++ b/docs/examples/0.15.x/console-web/examples/projects/delete-domain.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.deleteDomain('[PROJECT_ID]', '[DOMAIN_ID]'); +const promise = projects.deleteDomain('[PROJECT_ID]', '[DOMAIN_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/delete-key.md b/docs/examples/0.15.x/console-web/examples/projects/delete-key.md index 205f357a70..0b227e7f1a 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/delete-key.md +++ b/docs/examples/0.15.x/console-web/examples/projects/delete-key.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.deleteKey('[PROJECT_ID]', '[KEY_ID]'); +const promise = projects.deleteKey('[PROJECT_ID]', '[KEY_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/delete-platform.md b/docs/examples/0.15.x/console-web/examples/projects/delete-platform.md index 3f770290ad..681362017c 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/delete-platform.md +++ b/docs/examples/0.15.x/console-web/examples/projects/delete-platform.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.deletePlatform('[PROJECT_ID]', '[PLATFORM_ID]'); +const promise = projects.deletePlatform('[PROJECT_ID]', '[PLATFORM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/delete-webhook.md b/docs/examples/0.15.x/console-web/examples/projects/delete-webhook.md index 5e698f398f..3edbdadb07 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/delete-webhook.md +++ b/docs/examples/0.15.x/console-web/examples/projects/delete-webhook.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.deleteWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); +const promise = projects.deleteWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/delete.md b/docs/examples/0.15.x/console-web/examples/projects/delete.md index 506bba2f42..1e479709e9 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/delete.md +++ b/docs/examples/0.15.x/console-web/examples/projects/delete.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.delete('[PROJECT_ID]', 'password'); +const promise = projects.delete('[PROJECT_ID]', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/get-domain.md b/docs/examples/0.15.x/console-web/examples/projects/get-domain.md index f81b67f3ab..a90d5eec33 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/get-domain.md +++ b/docs/examples/0.15.x/console-web/examples/projects/get-domain.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.getDomain('[PROJECT_ID]', '[DOMAIN_ID]'); +const promise = projects.getDomain('[PROJECT_ID]', '[DOMAIN_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/get-key.md b/docs/examples/0.15.x/console-web/examples/projects/get-key.md index 0780229ecf..59a4224f78 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/get-key.md +++ b/docs/examples/0.15.x/console-web/examples/projects/get-key.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.getKey('[PROJECT_ID]', '[KEY_ID]'); +const promise = projects.getKey('[PROJECT_ID]', '[KEY_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/get-platform.md b/docs/examples/0.15.x/console-web/examples/projects/get-platform.md index a2229a2c59..8eaea3371b 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/get-platform.md +++ b/docs/examples/0.15.x/console-web/examples/projects/get-platform.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.getPlatform('[PROJECT_ID]', '[PLATFORM_ID]'); +const promise = projects.getPlatform('[PROJECT_ID]', '[PLATFORM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/get-usage.md b/docs/examples/0.15.x/console-web/examples/projects/get-usage.md index db4f2d84f9..be7ee4379e 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/get-usage.md +++ b/docs/examples/0.15.x/console-web/examples/projects/get-usage.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.getUsage('[PROJECT_ID]'); +const promise = projects.getUsage('[PROJECT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/get-webhook.md b/docs/examples/0.15.x/console-web/examples/projects/get-webhook.md index 849cf75ee0..b636a797ee 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/get-webhook.md +++ b/docs/examples/0.15.x/console-web/examples/projects/get-webhook.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.getWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); +const promise = projects.getWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/get.md b/docs/examples/0.15.x/console-web/examples/projects/get.md index 3e3e10f023..ac20f56023 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/get.md +++ b/docs/examples/0.15.x/console-web/examples/projects/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.get('[PROJECT_ID]'); +const promise = projects.get('[PROJECT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/list-domains.md b/docs/examples/0.15.x/console-web/examples/projects/list-domains.md index f6537d86bf..2c4a7415d2 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/list-domains.md +++ b/docs/examples/0.15.x/console-web/examples/projects/list-domains.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.listDomains('[PROJECT_ID]'); +const promise = projects.listDomains('[PROJECT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/list-keys.md b/docs/examples/0.15.x/console-web/examples/projects/list-keys.md index 1ce0040051..957531a892 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/list-keys.md +++ b/docs/examples/0.15.x/console-web/examples/projects/list-keys.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.listKeys('[PROJECT_ID]'); +const promise = projects.listKeys('[PROJECT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/list-platforms.md b/docs/examples/0.15.x/console-web/examples/projects/list-platforms.md index 7851b80b44..100be04115 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/list-platforms.md +++ b/docs/examples/0.15.x/console-web/examples/projects/list-platforms.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.listPlatforms('[PROJECT_ID]'); +const promise = projects.listPlatforms('[PROJECT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/list-webhooks.md b/docs/examples/0.15.x/console-web/examples/projects/list-webhooks.md index eef35c531e..093b9e91f7 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/list-webhooks.md +++ b/docs/examples/0.15.x/console-web/examples/projects/list-webhooks.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.listWebhooks('[PROJECT_ID]'); +const promise = projects.listWebhooks('[PROJECT_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/list.md b/docs/examples/0.15.x/console-web/examples/projects/list.md index 2dae186849..a576843401 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/list.md +++ b/docs/examples/0.15.x/console-web/examples/projects/list.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.list(); +const promise = projects.list(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-auth-limit.md b/docs/examples/0.15.x/console-web/examples/projects/update-auth-limit.md index 68e3a4a764..7cc850ad2e 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-auth-limit.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-auth-limit.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateAuthLimit('[PROJECT_ID]', 0); +const promise = projects.updateAuthLimit('[PROJECT_ID]', 0); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-auth-status.md b/docs/examples/0.15.x/console-web/examples/projects/update-auth-status.md index 7e325972b3..400d5a4f7b 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-auth-status.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-auth-status.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateAuthStatus('[PROJECT_ID]', 'email-password', false); +const promise = projects.updateAuthStatus('[PROJECT_ID]', 'email-password', false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-domain-verification.md b/docs/examples/0.15.x/console-web/examples/projects/update-domain-verification.md index c00aea2724..c632ad10fb 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-domain-verification.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-domain-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateDomainVerification('[PROJECT_ID]', '[DOMAIN_ID]'); +const promise = projects.updateDomainVerification('[PROJECT_ID]', '[DOMAIN_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-key.md b/docs/examples/0.15.x/console-web/examples/projects/update-key.md index 90209de5e1..627bf6c38b 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-key.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-key.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateKey('[PROJECT_ID]', '[KEY_ID]', '[NAME]', []); +const promise = projects.updateKey('[PROJECT_ID]', '[KEY_ID]', '[NAME]', []); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-o-auth2.md b/docs/examples/0.15.x/console-web/examples/projects/update-o-auth2.md index 126a45e425..df22de53d3 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-o-auth2.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-o-auth2.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'amazon'); +const promise = projects.updateOAuth2('[PROJECT_ID]', 'amazon'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-platform.md b/docs/examples/0.15.x/console-web/examples/projects/update-platform.md index 17d3773ea9..0d6b91999e 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-platform.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-platform.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updatePlatform('[PROJECT_ID]', '[PLATFORM_ID]', '[NAME]'); +const promise = projects.updatePlatform('[PROJECT_ID]', '[PLATFORM_ID]', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-service-status.md b/docs/examples/0.15.x/console-web/examples/projects/update-service-status.md index 3fdaa5ad6d..ae95091908 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-service-status.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-service-status.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateServiceStatus('[PROJECT_ID]', 'account', false); +const promise = projects.updateServiceStatus('[PROJECT_ID]', 'account', false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-webhook-signature.md b/docs/examples/0.15.x/console-web/examples/projects/update-webhook-signature.md index e36f325282..3545f9a50a 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-webhook-signature.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-webhook-signature.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateWebhookSignature('[PROJECT_ID]', '[WEBHOOK_ID]'); +const promise = projects.updateWebhookSignature('[PROJECT_ID]', '[WEBHOOK_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update-webhook.md b/docs/examples/0.15.x/console-web/examples/projects/update-webhook.md index cf12bcb209..45ecb8b02d 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update-webhook.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update-webhook.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], 'https://example.com', false); +const promise = projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], 'https://example.com', false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/projects/update.md b/docs/examples/0.15.x/console-web/examples/projects/update.md index 835779e30f..661eb11920 100644 --- a/docs/examples/0.15.x/console-web/examples/projects/update.md +++ b/docs/examples/0.15.x/console-web/examples/projects/update.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Projects } from "appwrite"; -sdk +const client = new Client(); + +const projects = new Projects(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.projects.update('[PROJECT_ID]', '[NAME]'); +const promise = projects.update('[PROJECT_ID]', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/create-bucket.md b/docs/examples/0.15.x/console-web/examples/storage/create-bucket.md index 5af19f6264..5c2026d0af 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/create-bucket.md +++ b/docs/examples/0.15.x/console-web/examples/storage/create-bucket.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.createBucket('[BUCKET_ID]', '[NAME]', 'file'); +const promise = storage.createBucket('[BUCKET_ID]', '[NAME]', 'file'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/create-file.md b/docs/examples/0.15.x/console-web/examples/storage/create-file.md index f464fe608e..10992d2b89 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/create-file.md +++ b/docs/examples/0.15.x/console-web/examples/storage/create-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.createFile('[BUCKET_ID]', '[FILE_ID]', document.getElementById('uploader').files[0]); +const promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', document.getElementById('uploader').files[0]); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/delete-bucket.md b/docs/examples/0.15.x/console-web/examples/storage/delete-bucket.md index 02d11d5846..a8580f9a08 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/delete-bucket.md +++ b/docs/examples/0.15.x/console-web/examples/storage/delete-bucket.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.deleteBucket('[BUCKET_ID]'); +const promise = storage.deleteBucket('[BUCKET_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/delete-file.md b/docs/examples/0.15.x/console-web/examples/storage/delete-file.md index 94c9e3112c..4512a8c1ce 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/delete-file.md +++ b/docs/examples/0.15.x/console-web/examples/storage/delete-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.deleteFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.deleteFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/get-bucket-usage.md b/docs/examples/0.15.x/console-web/examples/storage/get-bucket-usage.md index 7cc74b6665..61ef7fa956 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/get-bucket-usage.md +++ b/docs/examples/0.15.x/console-web/examples/storage/get-bucket-usage.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.getBucketUsage('[BUCKET_ID]'); +const promise = storage.getBucketUsage('[BUCKET_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/get-bucket.md b/docs/examples/0.15.x/console-web/examples/storage/get-bucket.md index 57c32e138b..3ffd9f3b42 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/get-bucket.md +++ b/docs/examples/0.15.x/console-web/examples/storage/get-bucket.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.getBucket('[BUCKET_ID]'); +const promise = storage.getBucket('[BUCKET_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/get-file-download.md b/docs/examples/0.15.x/console-web/examples/storage/get-file-download.md index 18a01aaa91..17c06600b3 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/get-file-download.md +++ b/docs/examples/0.15.x/console-web/examples/storage/get-file-download.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]'); +const result = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/storage/get-file-preview.md b/docs/examples/0.15.x/console-web/examples/storage/get-file-preview.md index b9d9377e1f..52866d108a 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/get-file-preview.md +++ b/docs/examples/0.15.x/console-web/examples/storage/get-file-preview.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]'); +const result = storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/storage/get-file-view.md b/docs/examples/0.15.x/console-web/examples/storage/get-file-view.md index eae4e78d6a..7bb6c67d51 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/get-file-view.md +++ b/docs/examples/0.15.x/console-web/examples/storage/get-file-view.md @@ -1,10 +1,14 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let result = sdk.storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); +const result = storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.15.x/console-web/examples/storage/get-file.md b/docs/examples/0.15.x/console-web/examples/storage/get-file.md index 4a8eb23038..3263865c73 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/get-file.md +++ b/docs/examples/0.15.x/console-web/examples/storage/get-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.getFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.getFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/get-usage.md b/docs/examples/0.15.x/console-web/examples/storage/get-usage.md index a232301ba6..a5ce5853e9 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/get-usage.md +++ b/docs/examples/0.15.x/console-web/examples/storage/get-usage.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.getUsage(); +const promise = storage.getUsage(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/list-buckets.md b/docs/examples/0.15.x/console-web/examples/storage/list-buckets.md index f44b2d232d..4f916c1536 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/list-buckets.md +++ b/docs/examples/0.15.x/console-web/examples/storage/list-buckets.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.listBuckets(); +const promise = storage.listBuckets(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/list-files.md b/docs/examples/0.15.x/console-web/examples/storage/list-files.md index f4a83cd29d..92d75742a5 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/list-files.md +++ b/docs/examples/0.15.x/console-web/examples/storage/list-files.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.listFiles('[BUCKET_ID]'); +const promise = storage.listFiles('[BUCKET_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/update-bucket.md b/docs/examples/0.15.x/console-web/examples/storage/update-bucket.md index 06eaf14176..0716a8b2c0 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/update-bucket.md +++ b/docs/examples/0.15.x/console-web/examples/storage/update-bucket.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.updateBucket('[BUCKET_ID]', '[NAME]', 'file'); +const promise = storage.updateBucket('[BUCKET_ID]', '[NAME]', 'file'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/storage/update-file.md b/docs/examples/0.15.x/console-web/examples/storage/update-file.md index fbb04a9bda..1313e30cff 100644 --- a/docs/examples/0.15.x/console-web/examples/storage/update-file.md +++ b/docs/examples/0.15.x/console-web/examples/storage/update-file.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Storage } from "appwrite"; -sdk +const client = new Client(); + +const storage = new Storage(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.storage.updateFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.updateFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/create-membership.md b/docs/examples/0.15.x/console-web/examples/teams/create-membership.md index 68b7f2be17..6cb7d87b7f 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/create-membership.md +++ b/docs/examples/0.15.x/console-web/examples/teams/create-membership.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); +const promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/create.md b/docs/examples/0.15.x/console-web/examples/teams/create.md index c0b5e6aa06..2c40c9017d 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/create.md +++ b/docs/examples/0.15.x/console-web/examples/teams/create.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.create('[TEAM_ID]', '[NAME]'); +const promise = teams.create('[TEAM_ID]', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/delete-membership.md b/docs/examples/0.15.x/console-web/examples/teams/delete-membership.md index 46916ab1f4..828674a86f 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/delete-membership.md +++ b/docs/examples/0.15.x/console-web/examples/teams/delete-membership.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); +const promise = teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/delete.md b/docs/examples/0.15.x/console-web/examples/teams/delete.md index e04f9f505a..b9b79ed1b7 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/delete.md +++ b/docs/examples/0.15.x/console-web/examples/teams/delete.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.delete('[TEAM_ID]'); +const promise = teams.delete('[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/get-membership.md b/docs/examples/0.15.x/console-web/examples/teams/get-membership.md index 0ff21ca48e..cce63e7fba 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/get-membership.md +++ b/docs/examples/0.15.x/console-web/examples/teams/get-membership.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); +const promise = teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/get-memberships.md b/docs/examples/0.15.x/console-web/examples/teams/get-memberships.md index c23f190cbe..41c1df2867 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/get-memberships.md +++ b/docs/examples/0.15.x/console-web/examples/teams/get-memberships.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.getMemberships('[TEAM_ID]'); +const promise = teams.getMemberships('[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/get.md b/docs/examples/0.15.x/console-web/examples/teams/get.md index c05bd59a0b..3a7185319a 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/get.md +++ b/docs/examples/0.15.x/console-web/examples/teams/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.get('[TEAM_ID]'); +const promise = teams.get('[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/list-logs.md b/docs/examples/0.15.x/console-web/examples/teams/list-logs.md index 79ee8e965f..f5120d5b21 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/list-logs.md +++ b/docs/examples/0.15.x/console-web/examples/teams/list-logs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.listLogs('[TEAM_ID]'); +const promise = teams.listLogs('[TEAM_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/list.md b/docs/examples/0.15.x/console-web/examples/teams/list.md index 1e1a974d80..1aea267038 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/list.md +++ b/docs/examples/0.15.x/console-web/examples/teams/list.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.list(); +const promise = teams.list(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/update-membership-roles.md b/docs/examples/0.15.x/console-web/examples/teams/update-membership-roles.md index 1d25e2601e..ca76ead1d6 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/update-membership-roles.md +++ b/docs/examples/0.15.x/console-web/examples/teams/update-membership-roles.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []); +const promise = teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/update-membership-status.md b/docs/examples/0.15.x/console-web/examples/teams/update-membership-status.md index 032f162501..4a29cdc116 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/update-membership-status.md +++ b/docs/examples/0.15.x/console-web/examples/teams/update-membership-status.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]'); +const promise = teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/teams/update.md b/docs/examples/0.15.x/console-web/examples/teams/update.md index bcf53d1605..a59cc80000 100644 --- a/docs/examples/0.15.x/console-web/examples/teams/update.md +++ b/docs/examples/0.15.x/console-web/examples/teams/update.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Teams } from "appwrite"; -sdk +const client = new Client(); + +const teams = new Teams(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.teams.update('[TEAM_ID]', '[NAME]'); +const promise = teams.update('[TEAM_ID]', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/create.md b/docs/examples/0.15.x/console-web/examples/users/create.md index 180589f554..8ae12a8581 100644 --- a/docs/examples/0.15.x/console-web/examples/users/create.md +++ b/docs/examples/0.15.x/console-web/examples/users/create.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.create('[USER_ID]', 'email@example.com', 'password'); +const promise = users.create('[USER_ID]', 'email@example.com', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/delete-session.md b/docs/examples/0.15.x/console-web/examples/users/delete-session.md index 12e225032f..90f0f301ff 100644 --- a/docs/examples/0.15.x/console-web/examples/users/delete-session.md +++ b/docs/examples/0.15.x/console-web/examples/users/delete-session.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.deleteSession('[USER_ID]', '[SESSION_ID]'); +const promise = users.deleteSession('[USER_ID]', '[SESSION_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/delete-sessions.md b/docs/examples/0.15.x/console-web/examples/users/delete-sessions.md index df330210fe..3df8c7bdb6 100644 --- a/docs/examples/0.15.x/console-web/examples/users/delete-sessions.md +++ b/docs/examples/0.15.x/console-web/examples/users/delete-sessions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.deleteSessions('[USER_ID]'); +const promise = users.deleteSessions('[USER_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/delete.md b/docs/examples/0.15.x/console-web/examples/users/delete.md index f9cb4c0e0e..f7c21f3d55 100644 --- a/docs/examples/0.15.x/console-web/examples/users/delete.md +++ b/docs/examples/0.15.x/console-web/examples/users/delete.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.delete('[USER_ID]'); +const promise = users.delete('[USER_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/get-logs.md b/docs/examples/0.15.x/console-web/examples/users/get-logs.md index 7ad392a78b..c75e8bdf89 100644 --- a/docs/examples/0.15.x/console-web/examples/users/get-logs.md +++ b/docs/examples/0.15.x/console-web/examples/users/get-logs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.getLogs('[USER_ID]'); +const promise = users.getLogs('[USER_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/get-memberships.md b/docs/examples/0.15.x/console-web/examples/users/get-memberships.md index b421e59afc..33571733b0 100644 --- a/docs/examples/0.15.x/console-web/examples/users/get-memberships.md +++ b/docs/examples/0.15.x/console-web/examples/users/get-memberships.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.getMemberships('[USER_ID]'); +const promise = users.getMemberships('[USER_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/get-prefs.md b/docs/examples/0.15.x/console-web/examples/users/get-prefs.md index f3f5d6a3db..959c68c7c0 100644 --- a/docs/examples/0.15.x/console-web/examples/users/get-prefs.md +++ b/docs/examples/0.15.x/console-web/examples/users/get-prefs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.getPrefs('[USER_ID]'); +const promise = users.getPrefs('[USER_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/get-sessions.md b/docs/examples/0.15.x/console-web/examples/users/get-sessions.md index f50f5221eb..f68b21277b 100644 --- a/docs/examples/0.15.x/console-web/examples/users/get-sessions.md +++ b/docs/examples/0.15.x/console-web/examples/users/get-sessions.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.getSessions('[USER_ID]'); +const promise = users.getSessions('[USER_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/get-usage.md b/docs/examples/0.15.x/console-web/examples/users/get-usage.md index 15464df92a..cca80da32d 100644 --- a/docs/examples/0.15.x/console-web/examples/users/get-usage.md +++ b/docs/examples/0.15.x/console-web/examples/users/get-usage.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.getUsage(); +const promise = users.getUsage(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/get.md b/docs/examples/0.15.x/console-web/examples/users/get.md index 48069a70f2..500263dad6 100644 --- a/docs/examples/0.15.x/console-web/examples/users/get.md +++ b/docs/examples/0.15.x/console-web/examples/users/get.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.get('[USER_ID]'); +const promise = users.get('[USER_ID]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/list.md b/docs/examples/0.15.x/console-web/examples/users/list.md index 4a37dd985d..49838da24d 100644 --- a/docs/examples/0.15.x/console-web/examples/users/list.md +++ b/docs/examples/0.15.x/console-web/examples/users/list.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.list(); +const promise = users.list(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-email-verification.md b/docs/examples/0.15.x/console-web/examples/users/update-email-verification.md index 7113d3b053..2abfff8244 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-email-verification.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-email-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updateEmailVerification('[USER_ID]', false); +const promise = users.updateEmailVerification('[USER_ID]', false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-email.md b/docs/examples/0.15.x/console-web/examples/users/update-email.md index 97236c4b7c..c0427ac6af 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-email.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-email.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updateEmail('[USER_ID]', 'email@example.com'); +const promise = users.updateEmail('[USER_ID]', 'email@example.com'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-name.md b/docs/examples/0.15.x/console-web/examples/users/update-name.md index 332f076fb6..ed13672a5c 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-name.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-name.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updateName('[USER_ID]', '[NAME]'); +const promise = users.updateName('[USER_ID]', '[NAME]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-password.md b/docs/examples/0.15.x/console-web/examples/users/update-password.md index d2647ca200..e13d9bcafa 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-password.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-password.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updatePassword('[USER_ID]', 'password'); +const promise = users.updatePassword('[USER_ID]', 'password'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-phone-verification.md b/docs/examples/0.15.x/console-web/examples/users/update-phone-verification.md index c48736fa34..63edc56cab 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-phone-verification.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-phone-verification.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updatePhoneVerification('[USER_ID]', false); +const promise = users.updatePhoneVerification('[USER_ID]', false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-phone.md b/docs/examples/0.15.x/console-web/examples/users/update-phone.md index 654ffb038a..593570d73b 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-phone.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-phone.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updatePhone('[USER_ID]', ''); +const promise = users.updatePhone('[USER_ID]', ''); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-prefs.md b/docs/examples/0.15.x/console-web/examples/users/update-prefs.md index d6abb5914d..d1d0a8b1ec 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-prefs.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-prefs.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updatePrefs('[USER_ID]', {}); +const promise = users.updatePrefs('[USER_ID]', {}); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-status.md b/docs/examples/0.15.x/console-web/examples/users/update-status.md index 00b94ba3eb..189cbca6d4 100644 --- a/docs/examples/0.15.x/console-web/examples/users/update-status.md +++ b/docs/examples/0.15.x/console-web/examples/users/update-status.md @@ -1,11 +1,15 @@ -const sdk = new Appwrite(); +import { Client, Users } from "appwrite"; -sdk +const client = new Client(); + +const users = new Users(client); + +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.users.updateStatus('[USER_ID]', false); +const promise = users.updateStatus('[USER_ID]', false); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.15.x/console-web/examples/users/update-verification.md b/docs/examples/0.15.x/console-web/examples/users/update-verification.md deleted file mode 100644 index a07f9e8433..0000000000 --- a/docs/examples/0.15.x/console-web/examples/users/update-verification.md +++ /dev/null @@ -1,14 +0,0 @@ -const sdk = new Appwrite(); - -sdk - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.users.updateVerification('[USER_ID]', false); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-boolean-attribute.md deleted file mode 100644 index 81e66e1ab6..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createBooleanAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-collection.md b/docs/examples/0.15.x/server-dart/examples/database/create-collection.md deleted file mode 100644 index aff5643ff5..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-collection.md +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createCollection( - collectionId: '[COLLECTION_ID]', - name: '[NAME]', - permission: 'document', - read: ["role:all"], - write: ["role:all"], - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-document.md b/docs/examples/0.15.x/server-dart/examples/database/create-document.md deleted file mode 100644 index 2775f740ab..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-document.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - data: {}, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-email-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-email-attribute.md deleted file mode 100644 index d0eca5cc73..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-email-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createEmailAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-enum-attribute.md deleted file mode 100644 index d50c76efb3..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createEnumAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - elements: [], - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-float-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-float-attribute.md deleted file mode 100644 index 5fa831b682..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-float-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createFloatAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-index.md b/docs/examples/0.15.x/server-dart/examples/database/create-index.md deleted file mode 100644 index 41b118d6af..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-index.md +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createIndex( - collectionId: '[COLLECTION_ID]', - key: '', - type: 'key', - attributes: [], - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-integer-attribute.md deleted file mode 100644 index 161a5c9812..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createIntegerAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-ip-attribute.md deleted file mode 100644 index 94990f9cf1..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createIpAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-string-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-string-attribute.md deleted file mode 100644 index e9119e11c0..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-string-attribute.md +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createStringAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - size: 1, - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/create-url-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/create-url-attribute.md deleted file mode 100644 index 3bea728890..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/create-url-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.createUrlAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - required: false, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/delete-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/delete-attribute.md deleted file mode 100644 index 50d5f345c7..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/delete-attribute.md +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.deleteAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/delete-collection.md b/docs/examples/0.15.x/server-dart/examples/database/delete-collection.md deleted file mode 100644 index 6543cc1491..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/delete-collection.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.deleteCollection( - collectionId: '[COLLECTION_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/delete-document.md b/docs/examples/0.15.x/server-dart/examples/database/delete-document.md deleted file mode 100644 index 89204f6d81..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/delete-document.md +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.deleteDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/delete-index.md b/docs/examples/0.15.x/server-dart/examples/database/delete-index.md deleted file mode 100644 index fe6cd43f11..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/delete-index.md +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.deleteIndex( - collectionId: '[COLLECTION_ID]', - key: '', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/get-attribute.md b/docs/examples/0.15.x/server-dart/examples/database/get-attribute.md deleted file mode 100644 index 41a0fbee21..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/get-attribute.md +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.getAttribute( - collectionId: '[COLLECTION_ID]', - key: '', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/get-collection.md b/docs/examples/0.15.x/server-dart/examples/database/get-collection.md deleted file mode 100644 index 6b0cb526ca..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/get-collection.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.getCollection( - collectionId: '[COLLECTION_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/get-document.md b/docs/examples/0.15.x/server-dart/examples/database/get-document.md deleted file mode 100644 index efe007aadf..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/get-document.md +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.getDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/get-index.md b/docs/examples/0.15.x/server-dart/examples/database/get-index.md deleted file mode 100644 index 736e860f30..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/get-index.md +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.getIndex( - collectionId: '[COLLECTION_ID]', - key: '', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/list-attributes.md b/docs/examples/0.15.x/server-dart/examples/database/list-attributes.md deleted file mode 100644 index ffbc556e71..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/list-attributes.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.listAttributes( - collectionId: '[COLLECTION_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/list-collections.md b/docs/examples/0.15.x/server-dart/examples/database/list-collections.md deleted file mode 100644 index aecd08a54a..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/list-collections.md +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.listCollections( - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/list-documents.md b/docs/examples/0.15.x/server-dart/examples/database/list-documents.md deleted file mode 100644 index 9323fd34be..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/list-documents.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.listDocuments( - collectionId: '[COLLECTION_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/list-indexes.md b/docs/examples/0.15.x/server-dart/examples/database/list-indexes.md deleted file mode 100644 index 3f22632bc7..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/list-indexes.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.listIndexes( - collectionId: '[COLLECTION_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/update-collection.md b/docs/examples/0.15.x/server-dart/examples/database/update-collection.md deleted file mode 100644 index 7430ef8673..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/update-collection.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.updateCollection( - collectionId: '[COLLECTION_ID]', - name: '[NAME]', - permission: 'document', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-dart/examples/database/update-document.md b/docs/examples/0.15.x/server-dart/examples/database/update-document.md deleted file mode 100644 index b2c78752e5..0000000000 --- a/docs/examples/0.15.x/server-dart/examples/database/update-document.md +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Database database = Database(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = database.updateDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - data: {}, - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-boolean-attribute.md deleted file mode 100644 index b332758ef3..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createBooleanAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-collection.md b/docs/examples/0.15.x/server-deno/examples/database/create-collection.md deleted file mode 100644 index 9646b8c0a4..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createCollection('[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-document.md b/docs/examples/0.15.x/server-deno/examples/database/create-document.md deleted file mode 100644 index 5180caf05c..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-document.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-email-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-email-attribute.md deleted file mode 100644 index 0b192f60cc..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-email-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createEmailAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-enum-attribute.md deleted file mode 100644 index 7b30a6139f..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createEnumAttribute('[COLLECTION_ID]', '', [], false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-float-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-float-attribute.md deleted file mode 100644 index 75a8afc0a5..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-float-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createFloatAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-index.md b/docs/examples/0.15.x/server-deno/examples/database/create-index.md deleted file mode 100644 index f519d1f4bb..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-index.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createIndex('[COLLECTION_ID]', '', 'key', []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-integer-attribute.md deleted file mode 100644 index ef09167d6f..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createIntegerAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-ip-attribute.md deleted file mode 100644 index c4daa5508e..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createIpAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-string-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-string-attribute.md deleted file mode 100644 index 57b310105f..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-string-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createStringAttribute('[COLLECTION_ID]', '', 1, false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/create-url-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/create-url-attribute.md deleted file mode 100644 index f298e07baa..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/create-url-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.createUrlAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/delete-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/delete-attribute.md deleted file mode 100644 index e817850cc9..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/delete-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.deleteAttribute('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/delete-collection.md b/docs/examples/0.15.x/server-deno/examples/database/delete-collection.md deleted file mode 100644 index d62c8d0974..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/delete-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.deleteCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/delete-document.md b/docs/examples/0.15.x/server-deno/examples/database/delete-document.md deleted file mode 100644 index 558a4bbe67..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/delete-document.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/delete-index.md b/docs/examples/0.15.x/server-deno/examples/database/delete-index.md deleted file mode 100644 index 87bf839b82..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/delete-index.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.deleteIndex('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/get-attribute.md b/docs/examples/0.15.x/server-deno/examples/database/get-attribute.md deleted file mode 100644 index fc2e6227c6..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/get-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.getAttribute('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/get-collection.md b/docs/examples/0.15.x/server-deno/examples/database/get-collection.md deleted file mode 100644 index 0ca917a3c3..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/get-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.getCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/get-document.md b/docs/examples/0.15.x/server-deno/examples/database/get-document.md deleted file mode 100644 index 59ec5e4141..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/get-document.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/get-index.md b/docs/examples/0.15.x/server-deno/examples/database/get-index.md deleted file mode 100644 index af51b343fe..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/get-index.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.getIndex('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/list-attributes.md b/docs/examples/0.15.x/server-deno/examples/database/list-attributes.md deleted file mode 100644 index 65ad1b197e..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/list-attributes.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.listAttributes('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/list-collections.md b/docs/examples/0.15.x/server-deno/examples/database/list-collections.md deleted file mode 100644 index 0bb6bf1679..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/list-collections.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.listCollections(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/list-documents.md b/docs/examples/0.15.x/server-deno/examples/database/list-documents.md deleted file mode 100644 index ead202aaa9..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/list-documents.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.listDocuments('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/list-indexes.md b/docs/examples/0.15.x/server-deno/examples/database/list-indexes.md deleted file mode 100644 index aff6da5698..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/list-indexes.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.listIndexes('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/update-collection.md b/docs/examples/0.15.x/server-deno/examples/database/update-collection.md deleted file mode 100644 index c105fe1204..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/update-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.updateCollection('[COLLECTION_ID]', '[NAME]', 'document'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-deno/examples/database/update-document.md b/docs/examples/0.15.x/server-deno/examples/database/update-document.md deleted file mode 100644 index de19da7f7d..0000000000 --- a/docs/examples/0.15.x/server-deno/examples/database/update-document.md +++ /dev/null @@ -1,21 +0,0 @@ -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - - -let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-boolean-attribute.md deleted file mode 100644 index 1ab665e341..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-boolean-attribute.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createBooleanAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-collection.md b/docs/examples/0.15.x/server-kotlin/java/database/create-collection.md deleted file mode 100644 index c028333c88..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-collection.md +++ /dev/null @@ -1,40 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createCollection( - collectionId = "[COLLECTION_ID]", - name = "[NAME]", - permission = "document", - read = ["role:all"], - write = ["role:all"] - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-document.md b/docs/examples/0.15.x/server-kotlin/java/database/create-document.md deleted file mode 100644 index 45d80217d1..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-document.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-email-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-email-attribute.md deleted file mode 100644 index 82d5b3f891..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-email-attribute.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createEmailAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-enum-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-enum-attribute.md deleted file mode 100644 index 37c1a760b0..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-enum-attribute.md +++ /dev/null @@ -1,39 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createEnumAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - elements = listOf(), - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-float-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-float-attribute.md deleted file mode 100644 index 57014cfb1c..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-float-attribute.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createFloatAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-index.md b/docs/examples/0.15.x/server-kotlin/java/database/create-index.md deleted file mode 100644 index fd1cbfe992..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-index.md +++ /dev/null @@ -1,39 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createIndex( - collectionId = "[COLLECTION_ID]", - key = "", - type = "key", - attributes = listOf(), - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-integer-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-integer-attribute.md deleted file mode 100644 index b3aef2296b..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-integer-attribute.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createIntegerAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-ip-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-ip-attribute.md deleted file mode 100644 index 6cf941f05a..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-ip-attribute.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createIpAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-string-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-string-attribute.md deleted file mode 100644 index 05492e9f76..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-string-attribute.md +++ /dev/null @@ -1,39 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createStringAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - size = 1, - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/create-url-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/create-url-attribute.md deleted file mode 100644 index cb94279946..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/create-url-attribute.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.createUrlAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/delete-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/delete-attribute.md deleted file mode 100644 index 46689fc559..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/delete-attribute.md +++ /dev/null @@ -1,37 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.deleteAttribute( - collectionId = "[COLLECTION_ID]", - key = "" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/delete-collection.md b/docs/examples/0.15.x/server-kotlin/java/database/delete-collection.md deleted file mode 100644 index ea666ca565..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/delete-collection.md +++ /dev/null @@ -1,36 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.deleteCollection( - collectionId = "[COLLECTION_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/delete-document.md b/docs/examples/0.15.x/server-kotlin/java/database/delete-document.md deleted file mode 100644 index 9bc26e85f0..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/delete-document.md +++ /dev/null @@ -1,37 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.deleteDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/delete-index.md b/docs/examples/0.15.x/server-kotlin/java/database/delete-index.md deleted file mode 100644 index 1845609def..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/delete-index.md +++ /dev/null @@ -1,37 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.deleteIndex( - collectionId = "[COLLECTION_ID]", - key = "" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/get-attribute.md b/docs/examples/0.15.x/server-kotlin/java/database/get-attribute.md deleted file mode 100644 index 699e933601..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/get-attribute.md +++ /dev/null @@ -1,37 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.getAttribute( - collectionId = "[COLLECTION_ID]", - key = "" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/get-collection.md b/docs/examples/0.15.x/server-kotlin/java/database/get-collection.md deleted file mode 100644 index 1d6e96e45d..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/get-collection.md +++ /dev/null @@ -1,36 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.getCollection( - collectionId = "[COLLECTION_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/get-document.md b/docs/examples/0.15.x/server-kotlin/java/database/get-document.md deleted file mode 100644 index 4ed6fe7ff9..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/get-document.md +++ /dev/null @@ -1,37 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.getDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/get-index.md b/docs/examples/0.15.x/server-kotlin/java/database/get-index.md deleted file mode 100644 index 5399ec431b..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/get-index.md +++ /dev/null @@ -1,37 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.getIndex( - collectionId = "[COLLECTION_ID]", - key = "" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/list-attributes.md b/docs/examples/0.15.x/server-kotlin/java/database/list-attributes.md deleted file mode 100644 index 98a6c21732..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/list-attributes.md +++ /dev/null @@ -1,36 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.listAttributes( - collectionId = "[COLLECTION_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/list-collections.md b/docs/examples/0.15.x/server-kotlin/java/database/list-collections.md deleted file mode 100644 index 9fbda9f9c6..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/list-collections.md +++ /dev/null @@ -1,35 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.listCollections( - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/list-documents.md b/docs/examples/0.15.x/server-kotlin/java/database/list-documents.md deleted file mode 100644 index 05e890783a..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/list-documents.md +++ /dev/null @@ -1,36 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.listDocuments( - collectionId = "[COLLECTION_ID]", - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/list-indexes.md b/docs/examples/0.15.x/server-kotlin/java/database/list-indexes.md deleted file mode 100644 index 394b661630..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/list-indexes.md +++ /dev/null @@ -1,36 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.listIndexes( - collectionId = "[COLLECTION_ID]" - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/update-collection.md b/docs/examples/0.15.x/server-kotlin/java/database/update-collection.md deleted file mode 100644 index f6319e0603..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/update-collection.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.updateCollection( - collectionId = "[COLLECTION_ID]", - name = "[NAME]", - permission = "document", - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/java/database/update-document.md b/docs/examples/0.15.x/server-kotlin/java/database/update-document.md deleted file mode 100644 index 9c06624d4b..0000000000 --- a/docs/examples/0.15.x/server-kotlin/java/database/update-document.md +++ /dev/null @@ -1,38 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -public void main() { - Client client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - - Database database = new Database(client); - database.updateDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - } - ); -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-boolean-attribute.md deleted file mode 100644 index 0d5cb9f9ef..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-boolean-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createBooleanAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-collection.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-collection.md deleted file mode 100644 index 2c54cff28e..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-collection.md +++ /dev/null @@ -1,19 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createCollection( - collectionId = "[COLLECTION_ID]", - name = "[NAME]", - permission = "document", - read = ["role:all"], - write = ["role:all"] - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-document.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-document.md deleted file mode 100644 index 34e7718ac2..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-document.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-email-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-email-attribute.md deleted file mode 100644 index 8b89e8e3ee..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-email-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createEmailAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-enum-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-enum-attribute.md deleted file mode 100644 index ceef6b79d4..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-enum-attribute.md +++ /dev/null @@ -1,18 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createEnumAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - elements = listOf(), - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-float-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-float-attribute.md deleted file mode 100644 index 1304096185..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-float-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createFloatAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-index.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-index.md deleted file mode 100644 index 53432cef33..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-index.md +++ /dev/null @@ -1,18 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createIndex( - collectionId = "[COLLECTION_ID]", - key = "", - type = "key", - attributes = listOf(), - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-integer-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-integer-attribute.md deleted file mode 100644 index 2f00c8d858..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-integer-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createIntegerAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-ip-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-ip-attribute.md deleted file mode 100644 index c0d49b0a94..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-ip-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createIpAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-string-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-string-attribute.md deleted file mode 100644 index da95ee02f6..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-string-attribute.md +++ /dev/null @@ -1,18 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createStringAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - size = 1, - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-url-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/create-url-attribute.md deleted file mode 100644 index 3f151b6690..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/create-url-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.createUrlAttribute( - collectionId = "[COLLECTION_ID]", - key = "", - required = false, - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-attribute.md deleted file mode 100644 index a2d1746d78..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.deleteAttribute( - collectionId = "[COLLECTION_ID]", - key = "" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-collection.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-collection.md deleted file mode 100644 index a535003ce8..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-collection.md +++ /dev/null @@ -1,15 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.deleteCollection( - collectionId = "[COLLECTION_ID]" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-document.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-document.md deleted file mode 100644 index 16f652b822..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-document.md +++ /dev/null @@ -1,16 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.deleteDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-index.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-index.md deleted file mode 100644 index e73ce5ea46..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/delete-index.md +++ /dev/null @@ -1,16 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.deleteIndex( - collectionId = "[COLLECTION_ID]", - key = "" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-attribute.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/get-attribute.md deleted file mode 100644 index 43a9a8f793..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.getAttribute( - collectionId = "[COLLECTION_ID]", - key = "" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-collection.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/get-collection.md deleted file mode 100644 index df4b735c66..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-collection.md +++ /dev/null @@ -1,15 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.getCollection( - collectionId = "[COLLECTION_ID]" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-document.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/get-document.md deleted file mode 100644 index e4fd93ca6e..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-document.md +++ /dev/null @@ -1,16 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.getDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-index.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/get-index.md deleted file mode 100644 index 225cc26d67..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/get-index.md +++ /dev/null @@ -1,16 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.getIndex( - collectionId = "[COLLECTION_ID]", - key = "" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-attributes.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/list-attributes.md deleted file mode 100644 index 7e93658a72..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-attributes.md +++ /dev/null @@ -1,15 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.listAttributes( - collectionId = "[COLLECTION_ID]" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-collections.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/list-collections.md deleted file mode 100644 index 731fac6a31..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-collections.md +++ /dev/null @@ -1,14 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.listCollections( - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-documents.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/list-documents.md deleted file mode 100644 index 45719af073..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-documents.md +++ /dev/null @@ -1,15 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.listDocuments( - collectionId = "[COLLECTION_ID]", - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-indexes.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/list-indexes.md deleted file mode 100644 index df971f9957..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/list-indexes.md +++ /dev/null @@ -1,15 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.listIndexes( - collectionId = "[COLLECTION_ID]" - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/update-collection.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/update-collection.md deleted file mode 100644 index 35a8f52866..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/update-collection.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.updateCollection( - collectionId = "[COLLECTION_ID]", - name = "[NAME]", - permission = "document", - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-kotlin/kotlin/database/update-document.md b/docs/examples/0.15.x/server-kotlin/kotlin/database/update-document.md deleted file mode 100644 index 921a3a4b5f..0000000000 --- a/docs/examples/0.15.x/server-kotlin/kotlin/database/update-document.md +++ /dev/null @@ -1,17 +0,0 @@ -import io.appwrite.Client -import io.appwrite.services.Database - -suspend fun main() { - val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - val database = Database(client) - val response = database.updateDocument( - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), - ) - val json = response.body?.string() -} \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/create-phone-verification.md b/docs/examples/0.15.x/server-nodejs/examples/account/create-phone-verification.md index ff259472d3..4ed86de6f4 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/create-phone-verification.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/create-phone-verification.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.createPhoneVerification(); +const promise = account.createPhoneVerification(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/create-recovery.md b/docs/examples/0.15.x/server-nodejs/examples/account/create-recovery.md index 8d86e0fbab..2c445584fb 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/create-recovery.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/create-recovery.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.createRecovery('email@example.com', 'https://example.com'); +const promise = account.createRecovery('email@example.com', 'https://example.com'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/create-verification.md b/docs/examples/0.15.x/server-nodejs/examples/account/create-verification.md index 8ec31eb060..520af2ece8 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/create-verification.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/create-verification.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.createVerification('https://example.com'); +const promise = account.createVerification('https://example.com'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/delete-session.md b/docs/examples/0.15.x/server-nodejs/examples/account/delete-session.md index 4bcd2d2ce2..fbfa985b5d 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/delete-session.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/delete-session.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.deleteSession('[SESSION_ID]'); +const promise = account.deleteSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/delete-sessions.md b/docs/examples/0.15.x/server-nodejs/examples/account/delete-sessions.md index 3ccc6556b3..2dce206215 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/delete-sessions.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/delete-sessions.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.deleteSessions(); +const promise = account.deleteSessions(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/get-logs.md b/docs/examples/0.15.x/server-nodejs/examples/account/get-logs.md index dd8e26a045..7e99f07f05 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/get-logs.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/get-logs.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.getLogs(); +const promise = account.getLogs(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/get-prefs.md b/docs/examples/0.15.x/server-nodejs/examples/account/get-prefs.md index a10879ddd5..2b11f4a399 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/get-prefs.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/get-prefs.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.getPrefs(); +const promise = account.getPrefs(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/get-session.md b/docs/examples/0.15.x/server-nodejs/examples/account/get-session.md index c6dac22365..e83d97f198 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/get-session.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/get-session.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.getSession('[SESSION_ID]'); +const promise = account.getSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/get-sessions.md b/docs/examples/0.15.x/server-nodejs/examples/account/get-sessions.md index b25b91cfe6..05acf87e9f 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/get-sessions.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/get-sessions.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.getSessions(); +const promise = account.getSessions(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/get.md b/docs/examples/0.15.x/server-nodejs/examples/account/get.md index 862cfd3cd3..f1ebc9e921 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/get.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/get.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.get(); +const promise = account.get(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-email.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-email.md index 493bad30f5..b550142d13 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-email.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-email.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updateEmail('email@example.com', 'password'); +const promise = account.updateEmail('email@example.com', 'password'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-name.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-name.md index ef4b47a3d8..196a9b272e 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-name.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-name.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updateName('[NAME]'); +const promise = account.updateName('[NAME]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-password.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-password.md index 59db404cc1..bc7fb758d1 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-password.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-password.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updatePassword('password'); +const promise = account.updatePassword('password'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-phone-verification.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-phone-verification.md index f21a1d58f3..4bedf42b8d 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-phone-verification.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-phone-verification.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]'); +const promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-phone.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-phone.md index 3d7806b0d6..81b64290cd 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-phone.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-phone.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updatePhone('', 'password'); +const promise = account.updatePhone('', 'password'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-prefs.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-prefs.md index d9c518f1a2..f8a2bcb797 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-prefs.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-prefs.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updatePrefs({}); +const promise = account.updatePrefs({}); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-recovery.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-recovery.md index 796c88ad9c..1e1fb8d708 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-recovery.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-recovery.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); +const promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-session.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-session.md index 8d19064d12..d9e1853884 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-session.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-session.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updateSession('[SESSION_ID]'); +const promise = account.updateSession('[SESSION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-status.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-status.md index e4af6e9828..adde842881 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-status.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-status.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updateStatus(); +const promise = account.updateStatus(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/account/update-verification.md b/docs/examples/0.15.x/server-nodejs/examples/account/update-verification.md index 1e264ecdc7..c5b7356414 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/account/update-verification.md +++ b/docs/examples/0.15.x/server-nodejs/examples/account/update-verification.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let account = new sdk.Account(client); +const account = new sdk.Account(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = account.updateVerification('[USER_ID]', '[SECRET]'); +const promise = account.updateVerification('[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-browser.md b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-browser.md index 2a670ce08b..350d154894 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-browser.md +++ b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-browser.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let avatars = new sdk.Avatars(client); +const avatars = new sdk.Avatars(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = avatars.getBrowser('aa'); +const promise = avatars.getBrowser('aa'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-credit-card.md b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-credit-card.md index afd38f5a97..3f685ff39c 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-credit-card.md +++ b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-credit-card.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let avatars = new sdk.Avatars(client); +const avatars = new sdk.Avatars(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = avatars.getCreditCard('amex'); +const promise = avatars.getCreditCard('amex'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-favicon.md b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-favicon.md index bb347371d4..89a496aaa4 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-favicon.md +++ b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-favicon.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let avatars = new sdk.Avatars(client); +const avatars = new sdk.Avatars(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = avatars.getFavicon('https://example.com'); +const promise = avatars.getFavicon('https://example.com'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-flag.md b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-flag.md index db677bc4f8..53fde28188 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-flag.md +++ b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-flag.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let avatars = new sdk.Avatars(client); +const avatars = new sdk.Avatars(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = avatars.getFlag('af'); +const promise = avatars.getFlag('af'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-image.md b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-image.md index efa871ea63..2b07d62411 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-image.md +++ b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-image.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let avatars = new sdk.Avatars(client); +const avatars = new sdk.Avatars(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = avatars.getImage('https://example.com'); +const promise = avatars.getImage('https://example.com'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-initials.md b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-initials.md index d6175bff13..fc00f8fbbc 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-initials.md +++ b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-initials.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let avatars = new sdk.Avatars(client); +const avatars = new sdk.Avatars(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = avatars.getInitials(); +const promise = avatars.getInitials(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-q-r.md b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-q-r.md index e79b3235af..63cac53562 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/avatars/get-q-r.md +++ b/docs/examples/0.15.x/server-nodejs/examples/avatars/get-q-r.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let avatars = new sdk.Avatars(client); +const avatars = new sdk.Avatars(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = avatars.getQR('[TEXT]'); +const promise = avatars.getQR('[TEXT]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-boolean-attribute.md deleted file mode 100644 index 1f6db6a604..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createBooleanAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-collection.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-collection.md deleted file mode 100644 index b39336e4f5..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-collection.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createCollection('[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-document.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-document.md deleted file mode 100644 index 6ba0670838..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-document.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-email-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-email-attribute.md deleted file mode 100644 index cf49202552..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-email-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createEmailAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-enum-attribute.md deleted file mode 100644 index 64629ec6ce..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createEnumAttribute('[COLLECTION_ID]', '', [], false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-float-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-float-attribute.md deleted file mode 100644 index ec362226aa..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-float-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createFloatAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-index.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-index.md deleted file mode 100644 index e23eca2292..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-index.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createIndex('[COLLECTION_ID]', '', 'key', []); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-integer-attribute.md deleted file mode 100644 index b05d0b35c5..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createIntegerAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-ip-attribute.md deleted file mode 100644 index 6048a2acbe..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createIpAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-string-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-string-attribute.md deleted file mode 100644 index ad176de552..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-string-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createStringAttribute('[COLLECTION_ID]', '', 1, false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/create-url-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/create-url-attribute.md deleted file mode 100644 index 6461cb2c31..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/create-url-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.createUrlAttribute('[COLLECTION_ID]', '', false); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/delete-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/delete-attribute.md deleted file mode 100644 index 8704ff6d73..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/delete-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.deleteAttribute('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/delete-collection.md b/docs/examples/0.15.x/server-nodejs/examples/database/delete-collection.md deleted file mode 100644 index 503da98a73..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/delete-collection.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.deleteCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/delete-document.md b/docs/examples/0.15.x/server-nodejs/examples/database/delete-document.md deleted file mode 100644 index f14c985e83..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/delete-document.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/delete-index.md b/docs/examples/0.15.x/server-nodejs/examples/database/delete-index.md deleted file mode 100644 index 8e61399e3e..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/delete-index.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.deleteIndex('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/get-attribute.md b/docs/examples/0.15.x/server-nodejs/examples/database/get-attribute.md deleted file mode 100644 index 60c08084ab..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/get-attribute.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.getAttribute('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/get-collection.md b/docs/examples/0.15.x/server-nodejs/examples/database/get-collection.md deleted file mode 100644 index a14ce0d49a..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/get-collection.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.getCollection('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/get-document.md b/docs/examples/0.15.x/server-nodejs/examples/database/get-document.md deleted file mode 100644 index 55cce32b9b..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/get-document.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/get-index.md b/docs/examples/0.15.x/server-nodejs/examples/database/get-index.md deleted file mode 100644 index 799eef88f7..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/get-index.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.getIndex('[COLLECTION_ID]', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/list-attributes.md b/docs/examples/0.15.x/server-nodejs/examples/database/list-attributes.md deleted file mode 100644 index 23475ea654..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/list-attributes.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.listAttributes('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/list-collections.md b/docs/examples/0.15.x/server-nodejs/examples/database/list-collections.md deleted file mode 100644 index bacfdb062c..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/list-collections.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.listCollections(); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/list-documents.md b/docs/examples/0.15.x/server-nodejs/examples/database/list-documents.md deleted file mode 100644 index ad02d05e2a..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/list-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.listDocuments('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/list-indexes.md b/docs/examples/0.15.x/server-nodejs/examples/database/list-indexes.md deleted file mode 100644 index 85b2d1f227..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/list-indexes.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.listIndexes('[COLLECTION_ID]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/update-collection.md b/docs/examples/0.15.x/server-nodejs/examples/database/update-collection.md deleted file mode 100644 index bed47c3613..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/update-collection.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.updateCollection('[COLLECTION_ID]', '[NAME]', 'document'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/database/update-document.md b/docs/examples/0.15.x/server-nodejs/examples/database/update-document.md deleted file mode 100644 index 40e9488a6b..0000000000 --- a/docs/examples/0.15.x/server-nodejs/examples/database/update-document.md +++ /dev/null @@ -1,20 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let database = new sdk.Database(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/create-deployment.md b/docs/examples/0.15.x/server-nodejs/examples/functions/create-deployment.md index 00717651f9..ce8e480215 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/create-deployment.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/create-deployment.md @@ -2,9 +2,9 @@ const sdk = require('node-appwrite'); const fs = require('fs'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -12,7 +12,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false); +const promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/create-execution.md b/docs/examples/0.15.x/server-nodejs/examples/functions/create-execution.md index 895b70cd1b..35114aa170 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/create-execution.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/create-execution.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.createExecution('[FUNCTION_ID]'); +const promise = functions.createExecution('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/create.md b/docs/examples/0.15.x/server-nodejs/examples/functions/create.md index d1df9635f6..47865bc107 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/create.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/create.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5'); +const promise = functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/delete-deployment.md b/docs/examples/0.15.x/server-nodejs/examples/functions/delete-deployment.md index cab6ffde0b..536e5c530b 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/delete-deployment.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/delete-deployment.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); +const promise = functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/delete.md b/docs/examples/0.15.x/server-nodejs/examples/functions/delete.md index 6f079cb7f7..1362dd5ac7 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/delete.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/delete.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.delete('[FUNCTION_ID]'); +const promise = functions.delete('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/get-deployment.md b/docs/examples/0.15.x/server-nodejs/examples/functions/get-deployment.md index dad6cf9aa7..c4256a6b64 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/get-deployment.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/get-deployment.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); +const promise = functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/get-execution.md b/docs/examples/0.15.x/server-nodejs/examples/functions/get-execution.md index 1e2f5ea88a..f3370ecc5d 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/get-execution.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/get-execution.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); +const promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/get.md b/docs/examples/0.15.x/server-nodejs/examples/functions/get.md index 620deec88c..5b35a3ddb1 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/get.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/get.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.get('[FUNCTION_ID]'); +const promise = functions.get('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/list-deployments.md b/docs/examples/0.15.x/server-nodejs/examples/functions/list-deployments.md index b2bc8853c2..354c157f13 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/list-deployments.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/list-deployments.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.listDeployments('[FUNCTION_ID]'); +const promise = functions.listDeployments('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/list-executions.md b/docs/examples/0.15.x/server-nodejs/examples/functions/list-executions.md index 40c44b12e5..21ee1f65df 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/list-executions.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/list-executions.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.listExecutions('[FUNCTION_ID]'); +const promise = functions.listExecutions('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/list-runtimes.md b/docs/examples/0.15.x/server-nodejs/examples/functions/list-runtimes.md index e2aa34abfe..bab36ebff3 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/list-runtimes.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/list-runtimes.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.listRuntimes(); +const promise = functions.listRuntimes(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/list.md b/docs/examples/0.15.x/server-nodejs/examples/functions/list.md index 9ecd37237d..98343cbf07 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/list.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/list.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.list(); +const promise = functions.list(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/retry-build.md b/docs/examples/0.15.x/server-nodejs/examples/functions/retry-build.md index aa1daccc86..322306efa4 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/retry-build.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/retry-build.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); +const promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/update-deployment.md b/docs/examples/0.15.x/server-nodejs/examples/functions/update-deployment.md index 67ba6f94f9..f6f2dc293a 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/update-deployment.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/update-deployment.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); +const promise = functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/functions/update.md b/docs/examples/0.15.x/server-nodejs/examples/functions/update.md index 83e25b9cdc..b7f3a4d7f6 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/functions/update.md +++ b/docs/examples/0.15.x/server-nodejs/examples/functions/update.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let functions = new sdk.Functions(client); +const functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.update('[FUNCTION_ID]', '[NAME]', []); +const promise = functions.update('[FUNCTION_ID]', '[NAME]', []); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-antivirus.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-antivirus.md index 2df53eb37f..66886e3454 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-antivirus.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-antivirus.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getAntivirus(); +const promise = health.getAntivirus(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-cache.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-cache.md index d19cc8abd5..af57c75309 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-cache.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-cache.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getCache(); +const promise = health.getCache(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-d-b.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-d-b.md index 08505367d4..d871648ab5 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-d-b.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-d-b.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getDB(); +const promise = health.getDB(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-certificates.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-certificates.md index 2eb69e0126..ef0ecefe69 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-certificates.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-certificates.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getQueueCertificates(); +const promise = health.getQueueCertificates(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-functions.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-functions.md index 9470e11646..6ba0265f26 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-functions.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-functions.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getQueueFunctions(); +const promise = health.getQueueFunctions(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-logs.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-logs.md index 10f1cb24e3..82f48a7adb 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-logs.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-logs.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getQueueLogs(); +const promise = health.getQueueLogs(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-webhooks.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-webhooks.md index 3a788eb895..e46403c751 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-webhooks.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-queue-webhooks.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getQueueWebhooks(); +const promise = health.getQueueWebhooks(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-storage-local.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-storage-local.md index 84b8fb47a6..9d65f712e1 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-storage-local.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-storage-local.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getStorageLocal(); +const promise = health.getStorageLocal(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get-time.md b/docs/examples/0.15.x/server-nodejs/examples/health/get-time.md index 563bf2fb52..143885f0fa 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get-time.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get-time.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getTime(); +const promise = health.getTime(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/health/get.md b/docs/examples/0.15.x/server-nodejs/examples/health/get.md index 20c3d40801..fc6d1b9f5d 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/health/get.md +++ b/docs/examples/0.15.x/server-nodejs/examples/health/get.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let health = new sdk.Health(client); +const health = new sdk.Health(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.get(); +const promise = health.get(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/locale/get-continents.md b/docs/examples/0.15.x/server-nodejs/examples/locale/get-continents.md index 323237b4ab..b8a0966a0e 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/locale/get-continents.md +++ b/docs/examples/0.15.x/server-nodejs/examples/locale/get-continents.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let locale = new sdk.Locale(client); +const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = locale.getContinents(); +const promise = locale.getContinents(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-e-u.md b/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-e-u.md index fc9170dba4..bb48ad45a8 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-e-u.md +++ b/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-e-u.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let locale = new sdk.Locale(client); +const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = locale.getCountriesEU(); +const promise = locale.getCountriesEU(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-phones.md b/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-phones.md index 42be901677..d0f1d1119a 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-phones.md +++ b/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries-phones.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let locale = new sdk.Locale(client); +const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = locale.getCountriesPhones(); +const promise = locale.getCountriesPhones(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries.md b/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries.md index 437c9bb502..9d46699d31 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries.md +++ b/docs/examples/0.15.x/server-nodejs/examples/locale/get-countries.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let locale = new sdk.Locale(client); +const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = locale.getCountries(); +const promise = locale.getCountries(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/locale/get-currencies.md b/docs/examples/0.15.x/server-nodejs/examples/locale/get-currencies.md index 1b7d605760..6dc13bf3b4 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/locale/get-currencies.md +++ b/docs/examples/0.15.x/server-nodejs/examples/locale/get-currencies.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let locale = new sdk.Locale(client); +const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = locale.getCurrencies(); +const promise = locale.getCurrencies(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/locale/get-languages.md b/docs/examples/0.15.x/server-nodejs/examples/locale/get-languages.md index b6f45311b3..f1e51988dd 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/locale/get-languages.md +++ b/docs/examples/0.15.x/server-nodejs/examples/locale/get-languages.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let locale = new sdk.Locale(client); +const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = locale.getLanguages(); +const promise = locale.getLanguages(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/locale/get.md b/docs/examples/0.15.x/server-nodejs/examples/locale/get.md index 2f2eb95d90..79ceda7e5b 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/locale/get.md +++ b/docs/examples/0.15.x/server-nodejs/examples/locale/get.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let locale = new sdk.Locale(client); +const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = locale.get(); +const promise = locale.get(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/create-bucket.md b/docs/examples/0.15.x/server-nodejs/examples/storage/create-bucket.md index c55f512606..c95c15407d 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/create-bucket.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/create-bucket.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.createBucket('[BUCKET_ID]', '[NAME]', 'file'); +const promise = storage.createBucket('[BUCKET_ID]', '[NAME]', 'file'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/create-file.md b/docs/examples/0.15.x/server-nodejs/examples/storage/create-file.md index 185a9147c4..d74cfd9edd 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/create-file.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/create-file.md @@ -2,9 +2,9 @@ const sdk = require('node-appwrite'); const fs = require('fs'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -12,7 +12,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', 'file.png'); +const promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', 'file.png'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/delete-bucket.md b/docs/examples/0.15.x/server-nodejs/examples/storage/delete-bucket.md index f11a5a54a6..f755d7471a 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/delete-bucket.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/delete-bucket.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.deleteBucket('[BUCKET_ID]'); +const promise = storage.deleteBucket('[BUCKET_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/delete-file.md b/docs/examples/0.15.x/server-nodejs/examples/storage/delete-file.md index 88797c0695..4e39b047b7 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/delete-file.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/delete-file.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.deleteFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.deleteFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/get-bucket.md b/docs/examples/0.15.x/server-nodejs/examples/storage/get-bucket.md index 3afe5b49cd..4a00412e66 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/get-bucket.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/get-bucket.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.getBucket('[BUCKET_ID]'); +const promise = storage.getBucket('[BUCKET_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-download.md b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-download.md index 6e902150ac..b14988c3a9 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-download.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-download.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-preview.md b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-preview.md index 81007a2e44..f3c46dc7ab 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-preview.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-preview.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.getFilePreview('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-view.md b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-view.md index 91e5318d14..fdaa77eba0 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-view.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file-view.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file.md b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file.md index de5efacb14..181bfcfcdf 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/get-file.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/get-file.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.getFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.getFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/list-buckets.md b/docs/examples/0.15.x/server-nodejs/examples/storage/list-buckets.md index 21edaeb226..f8aae65a87 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/list-buckets.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/list-buckets.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.listBuckets(); +const promise = storage.listBuckets(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/list-files.md b/docs/examples/0.15.x/server-nodejs/examples/storage/list-files.md index 8ceada8d0f..2cab3df3ae 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/list-files.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/list-files.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.listFiles('[BUCKET_ID]'); +const promise = storage.listFiles('[BUCKET_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/update-bucket.md b/docs/examples/0.15.x/server-nodejs/examples/storage/update-bucket.md index 804ae0dd0a..70863a84be 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/update-bucket.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/update-bucket.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.updateBucket('[BUCKET_ID]', '[NAME]', 'file'); +const promise = storage.updateBucket('[BUCKET_ID]', '[NAME]', 'file'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/storage/update-file.md b/docs/examples/0.15.x/server-nodejs/examples/storage/update-file.md index 9fa83780c9..2bca7e90a0 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/storage/update-file.md +++ b/docs/examples/0.15.x/server-nodejs/examples/storage/update-file.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let storage = new sdk.Storage(client); +const storage = new sdk.Storage(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = storage.updateFile('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.updateFile('[BUCKET_ID]', '[FILE_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/create-membership.md b/docs/examples/0.15.x/server-nodejs/examples/teams/create-membership.md index cd17042e58..e36ff45235 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/create-membership.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/create-membership.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); +const promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/create.md b/docs/examples/0.15.x/server-nodejs/examples/teams/create.md index 2c2739bb1e..9d53f883d4 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/create.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/create.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.create('[TEAM_ID]', '[NAME]'); +const promise = teams.create('[TEAM_ID]', '[NAME]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/delete-membership.md b/docs/examples/0.15.x/server-nodejs/examples/teams/delete-membership.md index 82df7161f8..4a5576dc60 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/delete-membership.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/delete-membership.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); +const promise = teams.deleteMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/delete.md b/docs/examples/0.15.x/server-nodejs/examples/teams/delete.md index e833fdfb9b..3af8ad3fdc 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/delete.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/delete.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.delete('[TEAM_ID]'); +const promise = teams.delete('[TEAM_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/get-membership.md b/docs/examples/0.15.x/server-nodejs/examples/teams/get-membership.md index 920b6de0fd..895bcdd3a0 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/get-membership.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/get-membership.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); +const promise = teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/get-memberships.md b/docs/examples/0.15.x/server-nodejs/examples/teams/get-memberships.md index 75cdf38e5c..7b2ac99449 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/get-memberships.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/get-memberships.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.getMemberships('[TEAM_ID]'); +const promise = teams.getMemberships('[TEAM_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/get.md b/docs/examples/0.15.x/server-nodejs/examples/teams/get.md index a51322df27..ef25505520 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/get.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/get.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.get('[TEAM_ID]'); +const promise = teams.get('[TEAM_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/list.md b/docs/examples/0.15.x/server-nodejs/examples/teams/list.md index 259bbd22b2..209b6a1605 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/list.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/list.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.list(); +const promise = teams.list(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-roles.md b/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-roles.md index dc78af59f8..44deb3bbe0 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-roles.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-roles.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []); +const promise = teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-status.md b/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-status.md index 13f8578037..0020e6f555 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-status.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/update-membership-status.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token ; -let promise = teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]'); +const promise = teams.updateMembershipStatus('[TEAM_ID]', '[MEMBERSHIP_ID]', '[USER_ID]', '[SECRET]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/teams/update.md b/docs/examples/0.15.x/server-nodejs/examples/teams/update.md index 2118e8a90f..fea84c5c0b 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/teams/update.md +++ b/docs/examples/0.15.x/server-nodejs/examples/teams/update.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let teams = new sdk.Teams(client); +const teams = new sdk.Teams(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = teams.update('[TEAM_ID]', '[NAME]'); +const promise = teams.update('[TEAM_ID]', '[NAME]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/create.md b/docs/examples/0.15.x/server-nodejs/examples/users/create.md index a4a2febca9..d7a5406be9 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/create.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/create.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.create('[USER_ID]', 'email@example.com', 'password'); +const promise = users.create('[USER_ID]', 'email@example.com', 'password'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/delete-session.md b/docs/examples/0.15.x/server-nodejs/examples/users/delete-session.md index 22308d4fa6..ed161dcc89 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/delete-session.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/delete-session.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.deleteSession('[USER_ID]', '[SESSION_ID]'); +const promise = users.deleteSession('[USER_ID]', '[SESSION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/delete-sessions.md b/docs/examples/0.15.x/server-nodejs/examples/users/delete-sessions.md index 75f8f96bda..9b6abfcb02 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/delete-sessions.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/delete-sessions.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.deleteSessions('[USER_ID]'); +const promise = users.deleteSessions('[USER_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/delete.md b/docs/examples/0.15.x/server-nodejs/examples/users/delete.md index 3d834c33e3..65ed7187b6 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/delete.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/delete.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.delete('[USER_ID]'); +const promise = users.delete('[USER_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/get-logs.md b/docs/examples/0.15.x/server-nodejs/examples/users/get-logs.md index 1287b5ef5f..5bc20b7c4e 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/get-logs.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/get-logs.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.getLogs('[USER_ID]'); +const promise = users.getLogs('[USER_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/get-memberships.md b/docs/examples/0.15.x/server-nodejs/examples/users/get-memberships.md index 116ae92cac..8c26b12b7b 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/get-memberships.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/get-memberships.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.getMemberships('[USER_ID]'); +const promise = users.getMemberships('[USER_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/get-prefs.md b/docs/examples/0.15.x/server-nodejs/examples/users/get-prefs.md index 088e6b0811..bac42c8da7 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/get-prefs.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/get-prefs.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.getPrefs('[USER_ID]'); +const promise = users.getPrefs('[USER_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/get-sessions.md b/docs/examples/0.15.x/server-nodejs/examples/users/get-sessions.md index f5ad029ebe..1b3e7d3e86 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/get-sessions.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/get-sessions.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.getSessions('[USER_ID]'); +const promise = users.getSessions('[USER_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/get.md b/docs/examples/0.15.x/server-nodejs/examples/users/get.md index 5b91577284..fa1579ec44 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/get.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/get.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.get('[USER_ID]'); +const promise = users.get('[USER_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/list.md b/docs/examples/0.15.x/server-nodejs/examples/users/list.md index 0bc83b06bf..bddb2e7fa3 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/list.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/list.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.list(); +const promise = users.list(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-email-verification.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-email-verification.md index 3cff4c3808..c80a7816b9 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-email-verification.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-email-verification.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updateEmailVerification('[USER_ID]', false); +const promise = users.updateEmailVerification('[USER_ID]', false); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-email.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-email.md index 7e9477656b..627de271b6 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-email.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-email.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updateEmail('[USER_ID]', 'email@example.com'); +const promise = users.updateEmail('[USER_ID]', 'email@example.com'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-name.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-name.md index 31366a7652..cd515cb522 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-name.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-name.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updateName('[USER_ID]', '[NAME]'); +const promise = users.updateName('[USER_ID]', '[NAME]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-password.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-password.md index afee0b3732..6348c7d8e7 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-password.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-password.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updatePassword('[USER_ID]', 'password'); +const promise = users.updatePassword('[USER_ID]', 'password'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-phone-verification.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-phone-verification.md index c13b6eb949..7c88651ce6 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-phone-verification.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-phone-verification.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updatePhoneVerification('[USER_ID]', false); +const promise = users.updatePhoneVerification('[USER_ID]', false); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-phone.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-phone.md index d5b7b24eb8..acb7bbb2d6 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-phone.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-phone.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updatePhone('[USER_ID]', ''); +const promise = users.updatePhone('[USER_ID]', ''); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-prefs.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-prefs.md index 7d1011d6be..f9e16da0b7 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-prefs.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-prefs.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updatePrefs('[USER_ID]', {}); +const promise = users.updatePrefs('[USER_ID]', {}); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-nodejs/examples/users/update-status.md b/docs/examples/0.15.x/server-nodejs/examples/users/update-status.md index 02aa2d33ae..08c79ef63f 100644 --- a/docs/examples/0.15.x/server-nodejs/examples/users/update-status.md +++ b/docs/examples/0.15.x/server-nodejs/examples/users/update-status.md @@ -1,9 +1,9 @@ const sdk = require('node-appwrite'); // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let users = new sdk.Users(client); +const users = new sdk.Users(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = users.updateStatus('[USER_ID]', false); +const promise = users.updateStatus('[USER_ID]', false); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.15.x/server-php/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-boolean-attribute.md deleted file mode 100644 index dcbb8e2ccb..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createBooleanAttribute('[COLLECTION_ID]', '', false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-collection.md b/docs/examples/0.15.x/server-php/examples/database/create-collection.md deleted file mode 100644 index 66ee4f1264..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createCollection('[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-document.md b/docs/examples/0.15.x/server-php/examples/database/create-document.md deleted file mode 100644 index e3c15abc65..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-document.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', []); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-email-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-email-attribute.md deleted file mode 100644 index cc7c82290f..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-email-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createEmailAttribute('[COLLECTION_ID]', '', false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-enum-attribute.md deleted file mode 100644 index 92f3294a10..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createEnumAttribute('[COLLECTION_ID]', '', [], false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-float-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-float-attribute.md deleted file mode 100644 index 0d9e9656dd..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-float-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createFloatAttribute('[COLLECTION_ID]', '', false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-index.md b/docs/examples/0.15.x/server-php/examples/database/create-index.md deleted file mode 100644 index 2ca255242c..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-index.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createIndex('[COLLECTION_ID]', '', 'key', []); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-integer-attribute.md deleted file mode 100644 index 9c64c4d7e3..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createIntegerAttribute('[COLLECTION_ID]', '', false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-ip-attribute.md deleted file mode 100644 index aee0526df8..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createIpAttribute('[COLLECTION_ID]', '', false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-string-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-string-attribute.md deleted file mode 100644 index e6f8b1252a..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-string-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createStringAttribute('[COLLECTION_ID]', '', 1, false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/create-url-attribute.md b/docs/examples/0.15.x/server-php/examples/database/create-url-attribute.md deleted file mode 100644 index fe8ed393e2..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/create-url-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->createUrlAttribute('[COLLECTION_ID]', '', false); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/delete-attribute.md b/docs/examples/0.15.x/server-php/examples/database/delete-attribute.md deleted file mode 100644 index 036dc7304a..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/delete-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->deleteAttribute('[COLLECTION_ID]', ''); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/delete-collection.md b/docs/examples/0.15.x/server-php/examples/database/delete-collection.md deleted file mode 100644 index 4018420188..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/delete-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->deleteCollection('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/delete-document.md b/docs/examples/0.15.x/server-php/examples/database/delete-document.md deleted file mode 100644 index 3ed45d6ee1..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/delete-document.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/delete-index.md b/docs/examples/0.15.x/server-php/examples/database/delete-index.md deleted file mode 100644 index 353c03c8c0..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/delete-index.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->deleteIndex('[COLLECTION_ID]', ''); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/get-attribute.md b/docs/examples/0.15.x/server-php/examples/database/get-attribute.md deleted file mode 100644 index 020f91597a..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/get-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->getAttribute('[COLLECTION_ID]', ''); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/get-collection.md b/docs/examples/0.15.x/server-php/examples/database/get-collection.md deleted file mode 100644 index a088b24bb6..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/get-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->getCollection('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/get-document.md b/docs/examples/0.15.x/server-php/examples/database/get-document.md deleted file mode 100644 index d506bd8414..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/get-document.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/get-index.md b/docs/examples/0.15.x/server-php/examples/database/get-index.md deleted file mode 100644 index af700b7184..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/get-index.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->getIndex('[COLLECTION_ID]', ''); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/list-attributes.md b/docs/examples/0.15.x/server-php/examples/database/list-attributes.md deleted file mode 100644 index 8d0e2b6fc5..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/list-attributes.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->listAttributes('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/list-collections.md b/docs/examples/0.15.x/server-php/examples/database/list-collections.md deleted file mode 100644 index 4f4aa1b775..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/list-collections.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->listCollections(); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/list-documents.md b/docs/examples/0.15.x/server-php/examples/database/list-documents.md deleted file mode 100644 index 359da4ce33..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/list-documents.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->listDocuments('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/list-indexes.md b/docs/examples/0.15.x/server-php/examples/database/list-indexes.md deleted file mode 100644 index ab8e40753c..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/list-indexes.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->listIndexes('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/update-collection.md b/docs/examples/0.15.x/server-php/examples/database/update-collection.md deleted file mode 100644 index 190838b949..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/update-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->updateCollection('[COLLECTION_ID]', '[NAME]', 'document'); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-php/examples/database/update-document.md b/docs/examples/0.15.x/server-php/examples/database/update-document.md deleted file mode 100644 index b4c2eac092..0000000000 --- a/docs/examples/0.15.x/server-php/examples/database/update-document.md +++ /dev/null @@ -1,16 +0,0 @@ -setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$database = new Database($client); - -$result = $database->updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', []); \ No newline at end of file diff --git a/docs/examples/0.15.x/server-python/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-boolean-attribute.md deleted file mode 100644 index ca3d549876..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_boolean_attribute('[COLLECTION_ID]', '', False) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-collection.md b/docs/examples/0.15.x/server-python/examples/database/create-collection.md deleted file mode 100644 index c1bf0b4082..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_collection('[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-document.md b/docs/examples/0.15.x/server-python/examples/database/create-document.md deleted file mode 100644 index 8cef31cfd6..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-document.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_document('[COLLECTION_ID]', '[DOCUMENT_ID]', {}) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-email-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-email-attribute.md deleted file mode 100644 index 339b4b7b13..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-email-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_email_attribute('[COLLECTION_ID]', '', False) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-enum-attribute.md deleted file mode 100644 index e9014ef2ce..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_enum_attribute('[COLLECTION_ID]', '', [], False) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-float-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-float-attribute.md deleted file mode 100644 index 22d6ed37c5..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-float-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_float_attribute('[COLLECTION_ID]', '', False) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-index.md b/docs/examples/0.15.x/server-python/examples/database/create-index.md deleted file mode 100644 index 7553e75392..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-index.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_index('[COLLECTION_ID]', '', 'key', []) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-integer-attribute.md deleted file mode 100644 index 5b4ae60f24..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_integer_attribute('[COLLECTION_ID]', '', False) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-ip-attribute.md deleted file mode 100644 index 6e79f0b147..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_ip_attribute('[COLLECTION_ID]', '', False) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-string-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-string-attribute.md deleted file mode 100644 index 96f3410fde..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-string-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_string_attribute('[COLLECTION_ID]', '', 1, False) diff --git a/docs/examples/0.15.x/server-python/examples/database/create-url-attribute.md b/docs/examples/0.15.x/server-python/examples/database/create-url-attribute.md deleted file mode 100644 index dc8efd5beb..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/create-url-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.create_url_attribute('[COLLECTION_ID]', '', False) diff --git a/docs/examples/0.15.x/server-python/examples/database/delete-attribute.md b/docs/examples/0.15.x/server-python/examples/database/delete-attribute.md deleted file mode 100644 index 9cc8b4cefb..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/delete-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.delete_attribute('[COLLECTION_ID]', '') diff --git a/docs/examples/0.15.x/server-python/examples/database/delete-collection.md b/docs/examples/0.15.x/server-python/examples/database/delete-collection.md deleted file mode 100644 index 0e188ade41..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/delete-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.delete_collection('[COLLECTION_ID]') diff --git a/docs/examples/0.15.x/server-python/examples/database/delete-document.md b/docs/examples/0.15.x/server-python/examples/database/delete-document.md deleted file mode 100644 index c085547c16..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/delete-document.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.delete_document('[COLLECTION_ID]', '[DOCUMENT_ID]') diff --git a/docs/examples/0.15.x/server-python/examples/database/delete-index.md b/docs/examples/0.15.x/server-python/examples/database/delete-index.md deleted file mode 100644 index 5289b13fef..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/delete-index.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.delete_index('[COLLECTION_ID]', '') diff --git a/docs/examples/0.15.x/server-python/examples/database/get-attribute.md b/docs/examples/0.15.x/server-python/examples/database/get-attribute.md deleted file mode 100644 index 584a51c77e..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/get-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.get_attribute('[COLLECTION_ID]', '') diff --git a/docs/examples/0.15.x/server-python/examples/database/get-collection.md b/docs/examples/0.15.x/server-python/examples/database/get-collection.md deleted file mode 100644 index f90f51f48b..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/get-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.get_collection('[COLLECTION_ID]') diff --git a/docs/examples/0.15.x/server-python/examples/database/get-document.md b/docs/examples/0.15.x/server-python/examples/database/get-document.md deleted file mode 100644 index 79891709d1..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/get-document.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.get_document('[COLLECTION_ID]', '[DOCUMENT_ID]') diff --git a/docs/examples/0.15.x/server-python/examples/database/get-index.md b/docs/examples/0.15.x/server-python/examples/database/get-index.md deleted file mode 100644 index 0a492e1050..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/get-index.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.get_index('[COLLECTION_ID]', '') diff --git a/docs/examples/0.15.x/server-python/examples/database/list-attributes.md b/docs/examples/0.15.x/server-python/examples/database/list-attributes.md deleted file mode 100644 index ba69433b72..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/list-attributes.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.list_attributes('[COLLECTION_ID]') diff --git a/docs/examples/0.15.x/server-python/examples/database/list-collections.md b/docs/examples/0.15.x/server-python/examples/database/list-collections.md deleted file mode 100644 index f60d4b90e5..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/list-collections.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.list_collections() diff --git a/docs/examples/0.15.x/server-python/examples/database/list-documents.md b/docs/examples/0.15.x/server-python/examples/database/list-documents.md deleted file mode 100644 index cecb57d2fa..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/list-documents.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.list_documents('[COLLECTION_ID]') diff --git a/docs/examples/0.15.x/server-python/examples/database/list-indexes.md b/docs/examples/0.15.x/server-python/examples/database/list-indexes.md deleted file mode 100644 index 0c7b7dbd51..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/list-indexes.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.list_indexes('[COLLECTION_ID]') diff --git a/docs/examples/0.15.x/server-python/examples/database/update-collection.md b/docs/examples/0.15.x/server-python/examples/database/update-collection.md deleted file mode 100644 index adb809c942..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/update-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.update_collection('[COLLECTION_ID]', '[NAME]', 'document') diff --git a/docs/examples/0.15.x/server-python/examples/database/update-document.md b/docs/examples/0.15.x/server-python/examples/database/update-document.md deleted file mode 100644 index 2f4f89fc14..0000000000 --- a/docs/examples/0.15.x/server-python/examples/database/update-document.md +++ /dev/null @@ -1,14 +0,0 @@ -from appwrite.client import Client -from appwrite.services.database import Database - -client = Client() - -(client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -database = Database(client) - -result = database.update_document('[COLLECTION_ID]', '[DOCUMENT_ID]', {}) diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-boolean-attribute.md deleted file mode 100644 index b3228f27fe..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_boolean_attribute(collection_id: '[COLLECTION_ID]', key: '', required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-collection.md b/docs/examples/0.15.x/server-ruby/examples/database/create-collection.md deleted file mode 100644 index 81325a8b79..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_collection(collection_id: '[COLLECTION_ID]', name: '[NAME]', permission: 'document', read: ["role:all"], write: ["role:all"]) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-document.md b/docs/examples/0.15.x/server-ruby/examples/database/create-document.md deleted file mode 100644 index 97300f92d8..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-document.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]', data: {}) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-email-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-email-attribute.md deleted file mode 100644 index fbf9d4fbe0..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-email-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_email_attribute(collection_id: '[COLLECTION_ID]', key: '', required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-enum-attribute.md deleted file mode 100644 index 9d0c372f4c..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_enum_attribute(collection_id: '[COLLECTION_ID]', key: '', elements: [], required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-float-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-float-attribute.md deleted file mode 100644 index 753191b586..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-float-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_float_attribute(collection_id: '[COLLECTION_ID]', key: '', required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-index.md b/docs/examples/0.15.x/server-ruby/examples/database/create-index.md deleted file mode 100644 index 3404c76763..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-index.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_index(collection_id: '[COLLECTION_ID]', key: '', type: 'key', attributes: []) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-integer-attribute.md deleted file mode 100644 index 870405e478..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_integer_attribute(collection_id: '[COLLECTION_ID]', key: '', required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-ip-attribute.md deleted file mode 100644 index f956cb1eb8..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_ip_attribute(collection_id: '[COLLECTION_ID]', key: '', required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-string-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-string-attribute.md deleted file mode 100644 index 5d42170fa4..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-string-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_string_attribute(collection_id: '[COLLECTION_ID]', key: '', size: 1, required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/create-url-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/create-url-attribute.md deleted file mode 100644 index a91948f1d5..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/create-url-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.create_url_attribute(collection_id: '[COLLECTION_ID]', key: '', required: false) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/delete-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/delete-attribute.md deleted file mode 100644 index 2b38d31bea..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/delete-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.delete_attribute(collection_id: '[COLLECTION_ID]', key: '') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/delete-collection.md b/docs/examples/0.15.x/server-ruby/examples/database/delete-collection.md deleted file mode 100644 index 9694d36cc0..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/delete-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.delete_collection(collection_id: '[COLLECTION_ID]') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/delete-document.md b/docs/examples/0.15.x/server-ruby/examples/database/delete-document.md deleted file mode 100644 index 87a6436550..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/delete-document.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.delete_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/delete-index.md b/docs/examples/0.15.x/server-ruby/examples/database/delete-index.md deleted file mode 100644 index 50b8a8d1f4..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/delete-index.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.delete_index(collection_id: '[COLLECTION_ID]', key: '') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/get-attribute.md b/docs/examples/0.15.x/server-ruby/examples/database/get-attribute.md deleted file mode 100644 index 7315a50ae3..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/get-attribute.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.get_attribute(collection_id: '[COLLECTION_ID]', key: '') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/get-collection.md b/docs/examples/0.15.x/server-ruby/examples/database/get-collection.md deleted file mode 100644 index 213c19cc7f..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/get-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.get_collection(collection_id: '[COLLECTION_ID]') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/get-document.md b/docs/examples/0.15.x/server-ruby/examples/database/get-document.md deleted file mode 100644 index c2d3da2a78..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/get-document.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.get_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/get-index.md b/docs/examples/0.15.x/server-ruby/examples/database/get-index.md deleted file mode 100644 index 69d190d8fd..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/get-index.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.get_index(collection_id: '[COLLECTION_ID]', key: '') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/list-attributes.md b/docs/examples/0.15.x/server-ruby/examples/database/list-attributes.md deleted file mode 100644 index 84162b9087..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/list-attributes.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.list_attributes(collection_id: '[COLLECTION_ID]') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/list-collections.md b/docs/examples/0.15.x/server-ruby/examples/database/list-collections.md deleted file mode 100644 index f26ad8f281..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/list-collections.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.list_collections() - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/list-documents.md b/docs/examples/0.15.x/server-ruby/examples/database/list-documents.md deleted file mode 100644 index 4e4e9ab5ab..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/list-documents.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.list_documents(collection_id: '[COLLECTION_ID]') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/list-indexes.md b/docs/examples/0.15.x/server-ruby/examples/database/list-indexes.md deleted file mode 100644 index bf6df474f4..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/list-indexes.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.list_indexes(collection_id: '[COLLECTION_ID]') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/update-collection.md b/docs/examples/0.15.x/server-ruby/examples/database/update-collection.md deleted file mode 100644 index 0cbda72a3f..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/update-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.update_collection(collection_id: '[COLLECTION_ID]', name: '[NAME]', permission: 'document') - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-ruby/examples/database/update-document.md b/docs/examples/0.15.x/server-ruby/examples/database/update-document.md deleted file mode 100644 index 4b5344b5d7..0000000000 --- a/docs/examples/0.15.x/server-ruby/examples/database/update-document.md +++ /dev/null @@ -1,14 +0,0 @@ -require 'appwrite' - -client = Appwrite::Client.new - -client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -database = Appwrite::Database.new(client) - -response = database.update_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]', data: {}) - -puts response.inspect \ No newline at end of file diff --git a/docs/examples/0.15.x/server-swift/examples/account/update-prefs.md b/docs/examples/0.15.x/server-swift/examples/account/update-prefs.md index 95de4632dd..6d98f351cb 100644 --- a/docs/examples/0.15.x/server-swift/examples/account/update-prefs.md +++ b/docs/examples/0.15.x/server-swift/examples/account/update-prefs.md @@ -7,7 +7,7 @@ func main() async throws { .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token let account = Account(client) let user = try await account.updatePrefs( - prefs: + prefs: [:] ) print(String(describing: user) diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-boolean-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-boolean-attribute.md deleted file mode 100644 index 1a59923305..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-boolean-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeBoolean = try await database.createBooleanAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse - ) - - print(String(describing: attributeBoolean) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-collection.md b/docs/examples/0.15.x/server-swift/examples/database/create-collection.md deleted file mode 100644 index 4c5e2987a5..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-collection.md +++ /dev/null @@ -1,18 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let collection = try await database.createCollection( - collectionId: "[COLLECTION_ID]", - name: "[NAME]", - permission: "document", - read: ["role:all"], - write: ["role:all"] - ) - - print(String(describing: collection) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-document.md b/docs/examples/0.15.x/server-swift/examples/database/create-document.md deleted file mode 100644 index c2b4c47759..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-document.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let document = try await database.createDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: - ) - - print(String(describing: document) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-email-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-email-attribute.md deleted file mode 100644 index 90ce11c6e4..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-email-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeEmail = try await database.createEmailAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse - ) - - print(String(describing: attributeEmail) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-enum-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-enum-attribute.md deleted file mode 100644 index 6595e2b002..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-enum-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeEnum = try await database.createEnumAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - elements: [], - required: xfalse - ) - - print(String(describing: attributeEnum) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-float-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-float-attribute.md deleted file mode 100644 index 573e201648..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-float-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeFloat = try await database.createFloatAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse - ) - - print(String(describing: attributeFloat) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-index.md b/docs/examples/0.15.x/server-swift/examples/database/create-index.md deleted file mode 100644 index 0ee0ceb9a0..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-index.md +++ /dev/null @@ -1,17 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let index = try await database.createIndex( - collectionId: "[COLLECTION_ID]", - key: "", - type: "key", - attributes: [] - ) - - print(String(describing: index) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-integer-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-integer-attribute.md deleted file mode 100644 index a893203994..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-integer-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeInteger = try await database.createIntegerAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse - ) - - print(String(describing: attributeInteger) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-ip-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-ip-attribute.md deleted file mode 100644 index 26b14ab126..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-ip-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeIp = try await database.createIpAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse - ) - - print(String(describing: attributeIp) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-string-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-string-attribute.md deleted file mode 100644 index 126415bac0..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-string-attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeString = try await database.createStringAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - size: 1, - required: xfalse - ) - - print(String(describing: attributeString) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/create-url-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/create-url-attribute.md deleted file mode 100644 index 24d7f668af..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/create-url-attribute.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeUrl = try await database.createUrlAttribute( - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse - ) - - print(String(describing: attributeUrl) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/delete-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/delete-attribute.md deleted file mode 100644 index 1202fd4147..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/delete-attribute.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let result = try await database.deleteAttribute( - collectionId: "[COLLECTION_ID]", - key: "" - ) - - print(String(describing: result) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/delete-collection.md b/docs/examples/0.15.x/server-swift/examples/database/delete-collection.md deleted file mode 100644 index 63c7261758..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/delete-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let result = try await database.deleteCollection( - collectionId: "[COLLECTION_ID]" - ) - - print(String(describing: result) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/delete-document.md b/docs/examples/0.15.x/server-swift/examples/database/delete-document.md deleted file mode 100644 index d481ca5828..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/delete-document.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let result = try await database.deleteDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" - ) - - print(String(describing: result) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/delete-index.md b/docs/examples/0.15.x/server-swift/examples/database/delete-index.md deleted file mode 100644 index 317de6a3df..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/delete-index.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let result = try await database.deleteIndex( - collectionId: "[COLLECTION_ID]", - key: "" - ) - - print(String(describing: result) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/get-attribute.md b/docs/examples/0.15.x/server-swift/examples/database/get-attribute.md deleted file mode 100644 index 9bcbf53f61..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/get-attribute.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let result = try await database.getAttribute( - collectionId: "[COLLECTION_ID]", - key: "" - ) - - print(String(describing: result) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/get-collection.md b/docs/examples/0.15.x/server-swift/examples/database/get-collection.md deleted file mode 100644 index 08206a8241..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/get-collection.md +++ /dev/null @@ -1,14 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let collection = try await database.getCollection( - collectionId: "[COLLECTION_ID]" - ) - - print(String(describing: collection) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/get-document.md b/docs/examples/0.15.x/server-swift/examples/database/get-document.md deleted file mode 100644 index f10b7da615..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/get-document.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let document = try await database.getDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" - ) - - print(String(describing: document) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/get-index.md b/docs/examples/0.15.x/server-swift/examples/database/get-index.md deleted file mode 100644 index c7ef827359..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/get-index.md +++ /dev/null @@ -1,15 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let index = try await database.getIndex( - collectionId: "[COLLECTION_ID]", - key: "" - ) - - print(String(describing: index) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/list-attributes.md b/docs/examples/0.15.x/server-swift/examples/database/list-attributes.md deleted file mode 100644 index d51bb9577b..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/list-attributes.md +++ /dev/null @@ -1,14 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let attributeList = try await database.listAttributes( - collectionId: "[COLLECTION_ID]" - ) - - print(String(describing: attributeList) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/list-collections.md b/docs/examples/0.15.x/server-swift/examples/database/list-collections.md deleted file mode 100644 index 87dc2386ed..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/list-collections.md +++ /dev/null @@ -1,12 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let collectionList = try await database.listCollections() - - print(String(describing: collectionList) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/list-documents.md b/docs/examples/0.15.x/server-swift/examples/database/list-documents.md deleted file mode 100644 index 27c32f5e27..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/list-documents.md +++ /dev/null @@ -1,14 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let documentList = try await database.listDocuments( - collectionId: "[COLLECTION_ID]" - ) - - print(String(describing: documentList) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/list-indexes.md b/docs/examples/0.15.x/server-swift/examples/database/list-indexes.md deleted file mode 100644 index 6210d6f79c..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/list-indexes.md +++ /dev/null @@ -1,14 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let indexList = try await database.listIndexes( - collectionId: "[COLLECTION_ID]" - ) - - print(String(describing: indexList) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/update-collection.md b/docs/examples/0.15.x/server-swift/examples/database/update-collection.md deleted file mode 100644 index 817be46374..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/update-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let collection = try await database.updateCollection( - collectionId: "[COLLECTION_ID]", - name: "[NAME]", - permission: "document" - ) - - print(String(describing: collection) -} diff --git a/docs/examples/0.15.x/server-swift/examples/database/update-document.md b/docs/examples/0.15.x/server-swift/examples/database/update-document.md deleted file mode 100644 index 82222ddb20..0000000000 --- a/docs/examples/0.15.x/server-swift/examples/database/update-document.md +++ /dev/null @@ -1,16 +0,0 @@ -import Appwrite - -func main() async throws { - let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - let database = Database(client) - let document = try await database.updateDocument( - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: - ) - - print(String(describing: document) -} diff --git a/docs/examples/0.15.x/server-swift/examples/users/update-prefs.md b/docs/examples/0.15.x/server-swift/examples/users/update-prefs.md index 9fee0fc012..78e8bc274e 100644 --- a/docs/examples/0.15.x/server-swift/examples/users/update-prefs.md +++ b/docs/examples/0.15.x/server-swift/examples/users/update-prefs.md @@ -8,7 +8,7 @@ func main() async throws { let users = Users(client) let preferences = try await users.updatePrefs( userId: "[USER_ID]", - prefs: + prefs: [:] ) print(String(describing: preferences) From f571979259fa181a4d99219e885972d2c7b06210 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 06:08:25 +0000 Subject: [PATCH 25/33] fix usage collection --- src/Appwrite/Stats/UsageDB.php | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Appwrite/Stats/UsageDB.php b/src/Appwrite/Stats/UsageDB.php index 1561e52a66..44f9e92bb0 100644 --- a/src/Appwrite/Stats/UsageDB.php +++ b/src/Appwrite/Stats/UsageDB.php @@ -28,9 +28,7 @@ class UsageDB extends Usage $period = $options['key']; $time = (int) (floor(time() / $options['multiplier']) * $options['multiplier']); $id = \md5("{$time}_{$period}_{$metric}"); - $this->database->setNamespace('_console'); - $project = $this->database->getDocument('projects', $projectId); - $this->database->setNamespace('_' . $project->getInternalId()); + $this->database->setNamespace('_' . $projectId); try { $document = $this->database->getDocument('stats', $id); @@ -73,21 +71,15 @@ class UsageDB extends Usage */ private function foreachDocument(string $projectId, string $collection, array $queries, callable $callback): void { - if ($projectId === 'console') { - return; - } - $limit = 50; $results = []; $sum = $limit; $latestDocument = null; - $this->database->setNamespace('_console'); - $project = $this->database->getDocument('projects', $projectId); - $this->database->setNamespace('_' . $project->getInternalId()); + $this->database->setNamespace('_' . $projectId); while ($sum === $limit) { try { - $results = $this->database->find($collection, $queries, $limit, cursor: $latestDocument); + $results = $this->database->find($collection, $queries, $limit, cursor:$latestDocument); } catch (\Exception $e) { if (is_callable($this->errorHandler)) { call_user_func($this->errorHandler, $e, "fetch_documents_project_{$projectId}_collection_{$collection}"); @@ -124,9 +116,7 @@ class UsageDB extends Usage */ private function sum(string $projectId, string $collection, string $attribute, string $metric): int { - $this->database->setNamespace('_console'); - $project = $this->database->getDocument('projects', $projectId); - $this->database->setNamespace('_' . $project->getInternalId()); + $this->database->setNamespace('_' . $projectId); try { $sum = (int) $this->database->sum($collection, $attribute); @@ -153,9 +143,7 @@ class UsageDB extends Usage */ private function count(string $projectId, string $collection, string $metric): int { - $this->database->setNamespace('_console'); - $project = $this->database->getDocument('projects', $projectId); - $this->database->setNamespace('_' . $project->getInternalId()); + $this->database->setNamespace('_' . $projectId); try { $count = $this->database->count($collection); @@ -279,7 +267,7 @@ class UsageDB extends Usage public function collect(): void { $this->foreachDocument('console', 'projects', [], function (Document $project) { - $projectId = $project->getId(); + $projectId = $project->getInternalId(); $this->usersStats($projectId); $this->databaseStats($projectId); From dfbb9b2b3bb333bea12e7cfeb9d43c22e3f7c6bd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 12:51:21 +0545 Subject: [PATCH 26/33] fix-response-model-for-database-list --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index eee26bd73a..f3f47affee 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -240,7 +240,7 @@ App::get('/v1/databases') ->label('sdk.description', '/docs/references/databases/list.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION_LIST) + ->label('sdk.response.model', Response::MODEL_DATABASE_LIST) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->param('limit', 25, new Range(0, 100), 'Maximum number of collection to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, APP_LIMIT_COUNT), 'Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)', true) From 45941e52daf134db311c353470092a86ce674c95 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 24 Jun 2022 10:14:49 +0200 Subject: [PATCH 27/33] docs: rename database to databases --- docs/services/{database.md => databases.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/services/{database.md => databases.md} (100%) diff --git a/docs/services/database.md b/docs/services/databases.md similarity index 100% rename from docs/services/database.md rename to docs/services/databases.md From 0166681ddef4a8bef17637a53ec3280aecbe6f7e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 24 Jun 2022 11:12:29 +0200 Subject: [PATCH 28/33] feat: add analytics label for view as JSON --- app/views/console/database/collection.phtml | 11 ++++++++++- app/views/console/database/document.phtml | 11 ++++++++++- app/views/console/functions/function.phtml | 22 +++++++++++++++++++-- app/views/console/storage/bucket.phtml | 11 ++++++++++- app/views/console/users/team.phtml | 11 ++++++++++- app/views/console/users/user.phtml | 11 ++++++++++- 6 files changed, 70 insertions(+), 7 deletions(-) diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index 48662ead17..ee8b1a5d07 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -567,7 +567,16 @@ $logs = $this->getParam('logs', null);
    -
  • +
  • + +
  • Last Updated:
  • Created:
diff --git a/app/views/console/database/document.phtml b/app/views/console/database/document.phtml index a48d533830..3b9fad6dba 100644 --- a/app/views/console/database/document.phtml +++ b/app/views/console/database/document.phtml @@ -346,7 +346,16 @@ $logs = $this->getParam('logs', null);
    -
  • +
  • + +
diff --git a/app/views/console/functions/function.phtml b/app/views/console/functions/function.phtml index 17bb873ee5..48f2fc4e92 100644 --- a/app/views/console/functions/function.phtml +++ b/app/views/console/functions/function.phtml @@ -245,7 +245,16 @@ sort($patterns);
    -
  • +
  • + +
  • Last Updated:
  • Created:
@@ -595,7 +604,16 @@ sort($patterns);
    -
  • +
  • + +
  • Last Updated:
  • Created:
diff --git a/app/views/console/storage/bucket.phtml b/app/views/console/storage/bucket.phtml index 3200ad72c5..39abcd97ce 100644 --- a/app/views/console/storage/bucket.phtml +++ b/app/views/console/storage/bucket.phtml @@ -471,7 +471,16 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
    -
  • +
  • + +
  • Last Updated:
  • Created:
diff --git a/app/views/console/users/team.phtml b/app/views/console/users/team.phtml index 1fbe5d622d..d4c14295f3 100644 --- a/app/views/console/users/team.phtml +++ b/app/views/console/users/team.phtml @@ -206,7 +206,16 @@
    -
  • +
  • + +
  • Created:
diff --git a/app/views/console/users/user.phtml b/app/views/console/users/user.phtml index 9db057b226..304b3576a7 100644 --- a/app/views/console/users/user.phtml +++ b/app/views/console/users/user.phtml @@ -239,7 +239,16 @@
  • -
  • +
  • + +
  • From 2750e607687b91fee5e9c314c4aa76bb6e12fcfb Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 15:24:44 +0545 Subject: [PATCH 29/33] fix for ruby and go SDK as file params seems to be string --- app/controllers/api/functions.php | 2 +- app/controllers/api/storage.php | 2 +- app/controllers/mock.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 6b07c97045..02dbbf07ca 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -470,7 +470,7 @@ App::post('/v1/functions/:functionId/deployments') ->inject('project') ->inject('deviceFunctions') ->inject('deviceLocal') - ->action(function (string $functionId, string $entrypoint, array $file, bool $activate, Request $request, Response $response, Database $dbForProject, Stats $usage, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) { + ->action(function (string $functionId, string $entrypoint, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Stats $usage, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) { $function = $dbForProject->getDocument('functions', $functionId); diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 2f55d97205..a3e5c249e0 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -356,7 +356,7 @@ App::post('/v1/storage/buckets/:bucketId/files') ->inject('mode') ->inject('deviceFiles') ->inject('deviceLocal') - ->action(function (string $bucketId, string $fileId, array $file, ?array $read, ?array $write, Request $request, Response $response, Database $dbForProject, Document $user, Audit $audits, Stats $usage, Event $events, string $mode, Device $deviceFiles, Device $deviceLocal) { + ->action(function (string $bucketId, string $fileId, mixed $file, ?array $read, ?array $write, Request $request, Response $response, Database $dbForProject, Document $user, Audit $audits, Stats $usage, Event $events, string $mode, Device $deviceFiles, Device $deviceLocal) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); if ( diff --git a/app/controllers/mock.php b/app/controllers/mock.php index fb3369efc7..f681cb2482 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -237,7 +237,7 @@ App::post('/v1/mock/tests/general/upload') ->param('file', [], new File(), 'Sample file param', false) ->inject('request') ->inject('response') - ->action(function (string $x, int $y, array $z, array $file, Request $request, Response $response) { + ->action(function (string $x, int $y, array $z, mixed $file, Request $request, Response $response) { $file = $request->getFiles('file'); From 4a2dac9d46c92237a70d166bdd61715ab433dda7 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 24 Jun 2022 11:48:55 +0200 Subject: [PATCH 30/33] feat: add OAuth name in event label --- app/init.php | 2 +- app/views/console/users/index.phtml | 2 +- composer.lock | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/init.php b/app/init.php index 0e1848b2c3..107188514e 100644 --- a/app/init.php +++ b/app/init.php @@ -426,7 +426,7 @@ Structure::addFormat(APP_DATABASE_ATTRIBUTE_FLOAT_RANGE, function ($attribute) { * Registry */ $register->set('logger', function () { - // Register error logger + // Register error logger $providerName = App::getEnv('_APP_LOGGING_PROVIDER', ''); $providerConfig = App::getEnv('_APP_LOGGING_CONFIG', ''); diff --git a/app/views/console/users/index.phtml b/app/views/console/users/index.phtml index 777c3a5cc5..f6a9993a31 100644 --- a/app/views/console/users/index.phtml +++ b/app/views/console/users/index.phtml @@ -453,7 +453,7 @@ $smtpEnabled = $this->getParam('smtpEnabled', false); data-analytics-activity data-analytics-event="submit" data-analytics-category="console" - data-analytics-label="Update Project OAuth2" + data-analytics-label="Update Project OAuth2 (escape($name); ?>)" data-service="projects.updateOAuth2" data-scope="console" data-event="submit" diff --git a/composer.lock b/composer.lock index bde110f878..4e32ff04f5 100644 --- a/composer.lock +++ b/composer.lock @@ -300,16 +300,16 @@ }, { "name": "colinmollenhour/credis", - "version": "v1.13.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/colinmollenhour/credis.git", - "reference": "afec8e58ec93d2291c127fa19709a048f28641e5" + "reference": "85df015088e00daf8ce395189de22c8eb45c8d49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/afec8e58ec93d2291c127fa19709a048f28641e5", - "reference": "afec8e58ec93d2291c127fa19709a048f28641e5", + "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/85df015088e00daf8ce395189de22c8eb45c8d49", + "reference": "85df015088e00daf8ce395189de22c8eb45c8d49", "shasum": "" }, "require": { @@ -341,9 +341,9 @@ "homepage": "https://github.com/colinmollenhour/credis", "support": { "issues": "https://github.com/colinmollenhour/credis/issues", - "source": "https://github.com/colinmollenhour/credis/tree/v1.13.0" + "source": "https://github.com/colinmollenhour/credis/tree/v1.13.1" }, - "time": "2022-04-07T14:57:22+00:00" + "time": "2022-06-20T22:56:59+00:00" }, { "name": "composer/package-versions-deprecated", From 43f834c0bdc2829c68859887ee9e2a59df716786 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 24 Jun 2022 12:49:00 +0200 Subject: [PATCH 31/33] feat: add new errors for phone auth --- .env | 2 +- app/config/errors.php | 15 +++++++++++++++ app/controllers/api/account.php | 10 +++++----- src/Appwrite/Extend/Exception.php | 3 +++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.env b/.env index f9ee06b57a..e9ca6cc70e 100644 --- a/.env +++ b/.env @@ -56,7 +56,7 @@ _APP_SMTP_PORT=1025 _APP_SMTP_SECURE= _APP_SMTP_USERNAME= _APP_SMTP_PASSWORD= -_APP_PHONE_PROVIDER=phone://mock +_APP_PHONE_PROVIDER= _APP_PHONE_FROM= _APP_STORAGE_LIMIT=30000000 _APP_STORAGE_PREVIEW_LIMIT=20000000 diff --git a/app/config/errors.php b/app/config/errors.php index b1e418e517..8420ddbb74 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -48,6 +48,11 @@ return [ 'description' => 'SMTP is disabled on your Appwrite instance. You can learn more about setting up SMTP in our docs.', 'code' => 503, ], + Exception::GENERAL_PHONE_DISABLED => [ + 'name' => Exception::GENERAL_PHONE_DISABLED, + 'description' => 'Phone provider is not configured. Please check the _APP_PHONE_PROVIDER environment variable of your Appwrite server.', + 'code' => 503, + ], Exception::GENERAL_ARGUMENT_INVALID => [ 'name' => Exception::GENERAL_ARGUMENT_INVALID, 'description' => 'The request contains one or more invalid arguments. Please refer to the endpoint documentation.', @@ -170,6 +175,16 @@ return [ 'description' => 'The requested authentication method is either disabled or unsupported. Please check the supported authentication methods in the Appwrite console.', 'code' => 501, ], + Exception::USER_PHONE_ALREADY_EXISTS => [ + 'name' => Exception::USER_PHONE_ALREADY_EXISTS, + 'description' => 'A user with the same phone number already exists in the current project.', + 'code' => 409, + ], + Exception::USER_PHONE_NOT_FOUND => [ + 'name' => Exception::USER_PHONE_NOT_FOUND, + 'description' => 'The current user does not have a phone number associated with their account.', + 'code' => 400, + ], /** Teams */ Exception::TEAM_NOT_FOUND => [ diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 0d5613beac..f61490b116 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -859,7 +859,7 @@ App::post('/v1/account/sessions/phone') ->inject('phone') ->action(function (string $userId, string $number, Request $request, Response $response, Document $project, Database $dbForProject, Audit $audits, Event $events, EventPhone $messaging, Phone $phone) { if (empty(App::getEnv('_APP_PHONE_PROVIDER'))) { - throw new Exception('Phone Disabled', 503, Exception::GENERAL_SMTP_DISABLED); + throw new Exception('Phone provider not configured', 503, Exception::GENERAL_PHONE_DISABLED); } $roles = Authorization::getRoles(); @@ -1596,7 +1596,7 @@ App::patch('/v1/account/phone') try { $user = $dbForProject->updateDocument('users', $user->getId(), $user); } catch (Duplicate $th) { - throw new Exception('Phone number already exists', 409, Exception::USER_EMAIL_ALREADY_EXISTS); + throw new Exception('Phone number already exists', 409, Exception::USER_PHONE_ALREADY_EXISTS); } $audits @@ -2263,12 +2263,12 @@ App::post('/v1/account/verification/phone') ->inject('messaging') ->action(function (Request $request, Response $response, Phone $phone, Document $user, Database $dbForProject, Audit $audits, Event $events, Stats $usage, EventPhone $messaging) { - if (empty(App::getEnv('_APP_SMTP_HOST'))) { - throw new Exception('SMTP Disabled', 503, Exception::GENERAL_SMTP_DISABLED); + if (empty(App::getEnv('_APP_PHONE_PROVIDER'))) { + throw new Exception('Phone provider not configured', 503, Exception::GENERAL_PHONE_DISABLED); } if (empty($user->getAttribute('phone'))) { - throw new Exception('User has no phone number.', 400); + throw new Exception('User has no phone number.', 400, Exception::USER_PHONE_NOT_FOUND); } $roles = Authorization::getRoles(); diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index 94130f41a3..69cc32b715 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -40,6 +40,7 @@ class Exception extends \Exception public const GENERAL_UNAUTHORIZED_SCOPE = 'general_unauthorized_scope'; public const GENERAL_RATE_LIMIT_EXCEEDED = 'general_rate_limit_exceeded'; public const GENERAL_SMTP_DISABLED = 'general_smtp_disabled'; + public const GENERAL_PHONE_DISABLED = 'general_phone_disabled'; public const GENERAL_ARGUMENT_INVALID = 'general_argument_invalid'; public const GENERAL_QUERY_LIMIT_EXCEEDED = 'general_query_limit_exceeded'; public const GENERAL_QUERY_INVALID = 'general_query_invalid'; @@ -66,6 +67,8 @@ class Exception extends \Exception public const USER_SESSION_NOT_FOUND = 'user_session_not_found'; public const USER_UNAUTHORIZED = 'user_unauthorized'; public const USER_AUTH_METHOD_UNSUPPORTED = 'user_auth_method_unsupported'; + public const USER_PHONE_ALREADY_EXISTS = 'user_phone_already_exists'; + public const USER_PHONE_NOT_FOUND = 'user_phone_not_found'; /** Teams */ public const TEAM_NOT_FOUND = 'team_not_found'; From 600eb0d0d04789f3c6fed1c7e3761e8a4c1f126a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 24 Jun 2022 12:54:30 +0200 Subject: [PATCH 32/33] feat: revert .env change --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index e9ca6cc70e..f9ee06b57a 100644 --- a/.env +++ b/.env @@ -56,7 +56,7 @@ _APP_SMTP_PORT=1025 _APP_SMTP_SECURE= _APP_SMTP_USERNAME= _APP_SMTP_PASSWORD= -_APP_PHONE_PROVIDER= +_APP_PHONE_PROVIDER=phone://mock _APP_PHONE_FROM= _APP_STORAGE_LIMIT=30000000 _APP_STORAGE_PREVIEW_LIMIT=20000000 From 4593fc9ef29303c16c02b51743df3a26f525af72 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 24 Jun 2022 14:18:10 +0200 Subject: [PATCH 33/33] tests: fix tests from master --- .../e2e/Services/Databases/DatabasesBase.php | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 0c7a7272ec..afa6090161 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -2266,8 +2266,21 @@ trait DatabasesBase public function testUpdatePermissionsWithEmptyPayload(): array { + // Create Database + $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => 'unique()', + 'name' => 'Empty Permissions', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + + $databaseId = $database['body']['$id']; + // Create collection - $movies = $this->client->call(Client::METHOD_POST, '/database/collections', array_merge([ + $movies = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2285,7 +2298,7 @@ trait DatabasesBase $moviesId = $movies['body']['$id']; // create attribute - $title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $moviesId . '/attributes/string', array_merge([ + $title = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $moviesId . '/attributes/string', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2301,7 +2314,7 @@ trait DatabasesBase sleep(2); // add document - $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $moviesId . '/documents', array_merge([ + $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2322,7 +2335,7 @@ trait DatabasesBase $this->assertEquals(['role:all'], $document['body']['$write']); // Send only read permission - $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $moviesId . '/documents/' . $id, array_merge([ + $document = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $moviesId . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2342,7 +2355,7 @@ trait DatabasesBase } // send only write permission - $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $moviesId . '/documents/' . $id, array_merge([ + $document = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $moviesId . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2358,7 +2371,7 @@ trait DatabasesBase } // remove collection - $this->client->call(Client::METHOD_DELETE, '/database/collections/' . $moviesId, array_merge([ + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $moviesId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()));