Skip to content

Commit

Permalink
feat: introduce 0.15.x support
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Jun 28, 2022
1 parent 284290a commit 85f8b19
Show file tree
Hide file tree
Showing 50 changed files with 917 additions and 326 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Deno SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-0.14.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-0.15.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 0.14.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-deno/releases).**
**This SDK is compatible with Appwrite server version 0.15.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-deno/releases).**

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Deno SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand Down
21 changes: 21 additions & 0 deletions docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as sdk from "https://deno.land/x/appwrite/mod.ts";

// Init SDK
let client = new sdk.Client();

let account = new sdk.Account(client);

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;


let promise = account.createPhoneVerification();

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
21 changes: 21 additions & 0 deletions docs/examples/account/update-phone-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as sdk from "https://deno.land/x/appwrite/mod.ts";

// Init SDK
let client = new sdk.Client();

let account = new sdk.Account(client);

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;


let promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]');

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
21 changes: 21 additions & 0 deletions docs/examples/account/update-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as sdk from "https://deno.land/x/appwrite/mod.ts";

// Init SDK
let client = new sdk.Client();

let account = new sdk.Account(client);

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;


let promise = account.updatePhone('', 'password');

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createBooleanAttribute('[COLLECTION_ID]', '', false);
let promise = databases.createBooleanAttribute('[COLLECTION_ID]', '', false);

promise.then(function (response) {
console.log(response);
Expand Down
21 changes: 21 additions & 0 deletions docs/examples/databases/create-collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as sdk from "https://deno.land/x/appwrite/mod.ts";

// Init SDK
let client = new sdk.Client();

let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;


let promise = databases.createCollection('[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {});
let promise = databases.createDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {});

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createEmailAttribute('[COLLECTION_ID]', '', false);
let promise = databases.createEmailAttribute('[COLLECTION_ID]', '', false);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createEnumAttribute('[COLLECTION_ID]', '', [], false);
let promise = databases.createEnumAttribute('[COLLECTION_ID]', '', [], false);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createFloatAttribute('[COLLECTION_ID]', '', false);
let promise = databases.createFloatAttribute('[COLLECTION_ID]', '', false);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createIndex('[COLLECTION_ID]', '', 'key', []);
let promise = databases.createIndex('[COLLECTION_ID]', '', 'key', []);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createIntegerAttribute('[COLLECTION_ID]', '', false);
let promise = databases.createIntegerAttribute('[COLLECTION_ID]', '', false);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createIpAttribute('[COLLECTION_ID]', '', false);
let promise = databases.createIpAttribute('[COLLECTION_ID]', '', false);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createStringAttribute('[COLLECTION_ID]', '', 1, false);
let promise = databases.createStringAttribute('[COLLECTION_ID]', '', 1, false);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createUrlAttribute('[COLLECTION_ID]', '', false);
let promise = databases.createUrlAttribute('[COLLECTION_ID]', '', false);

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.updateCollection('[COLLECTION_ID]', '[NAME]', 'document');
let promise = databases.create('[NAME]');

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.deleteAttribute('[COLLECTION_ID]', '');
let promise = databases.deleteAttribute('[COLLECTION_ID]', '');

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.deleteCollection('[COLLECTION_ID]');
let promise = databases.deleteCollection('[COLLECTION_ID]');

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]');
let promise = databases.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]');

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.deleteIndex('[COLLECTION_ID]', '');
let promise = databases.deleteIndex('[COLLECTION_ID]', '');

promise.then(function (response) {
console.log(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sdk from "https://deno.land/x/appwrite/mod.ts";
// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);
let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ client
;


let promise = database.createCollection('[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]);
let promise = databases.delete();

promise.then(function (response) {
console.log(response);
Expand Down
Loading

0 comments on commit 85f8b19

Please sign in to comment.