-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from appwrite/dev
Dev
- Loading branch information
Showing
311 changed files
with
15,026 additions
and
3,463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Appwrite Deno SDK | ||
|
||
![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?style=flat-square) | ||
![Version](https://img.shields.io/badge/api%20version-1.4.12-blue.svg?style=flat-square) | ||
![Version](https://img.shields.io/badge/api%20version-1.5.0-blue.svg?style=flat-square) | ||
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) | ||
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) | ||
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) | ||
|
||
**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-deno/releases).** | ||
**This SDK is compatible with Appwrite server version 1.5.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) | ||
|
||
|
||
![Appwrite](https://appwrite.io/images/github.png) | ||
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png) | ||
|
||
## Installation | ||
|
||
|
@@ -43,7 +43,7 @@ Once your SDK object is set, create any of the Appwrite service objects and choo | |
```typescript | ||
let users = new sdk.Users(client); | ||
|
||
let user = await users.create(ID.unique(), '[email protected]', 'password'); | ||
let user = await users.create(ID.unique(), "[email protected]", "+123456789", "password", "Walter O'Brien"); | ||
console.log(user); | ||
``` | ||
|
||
|
@@ -61,7 +61,7 @@ client | |
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert | ||
; | ||
|
||
let user = await users.create(ID.unique(), '[email protected]', 'password'); | ||
let user = await users.create(ID.unique(), "[email protected]", "+123456789", "password", "Walter O'Brien"); | ||
console.log(user); | ||
``` | ||
|
||
|
@@ -72,7 +72,7 @@ The Appwrite Deno SDK raises `AppwriteException` object with `message`, `code` a | |
let users = new sdk.Users(client); | ||
|
||
try { | ||
let user = await users.create(ID.unique(), '[email protected]', 'password'); | ||
let user = await users.create(ID.unique(), "[email protected]", "+123456789", "password", "Walter O'Brien"); | ||
} catch(e) { | ||
console.log(e.message); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createAnonymousSession(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createEmailPasswordSession( | ||
'[email protected]', // email | ||
'password' // password | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createEmailToken( | ||
'<USER_ID>', // userId | ||
'[email protected]', // email | ||
false // phrase (optional) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createJWT(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createMagicURLToken( | ||
'<USER_ID>', // userId | ||
'[email protected]', // email | ||
'https://example.com', // url (optional) | ||
false // phrase (optional) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setSession(''); // The user session to authenticate with | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createMfaAuthenticator( | ||
AuthenticatorType.Totp // type | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Client, Account, AuthenticationFactor } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createMfaChallenge( | ||
AuthenticationFactor.Email // factor | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setSession(''); // The user session to authenticate with | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createMfaRecoveryCodes(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Client, Account, OAuthProvider } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
account.createOAuth2Token( | ||
OAuthProvider.Amazon, // provider | ||
'https://example.com', // success (optional) | ||
'https://example.com', // failure (optional) | ||
[] // scopes (optional) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createPhoneToken( | ||
'<USER_ID>', // userId | ||
'+12065550100' // phone | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
// Init SDK | ||
let client = new sdk.Client(); | ||
|
||
let account = new sdk.Account(client); | ||
|
||
client | ||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token | ||
; | ||
|
||
.setSession(''); // The user session to authenticate with | ||
|
||
let promise = account.createPhoneVerification(); | ||
const account = new Account(client); | ||
|
||
promise.then(function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
const response = await account.createPhoneVerification(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
// Init SDK | ||
let client = new sdk.Client(); | ||
|
||
let account = new sdk.Account(client); | ||
|
||
client | ||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token | ||
; | ||
|
||
.setSession(''); // The user session to authenticate with | ||
|
||
let promise = account.createRecovery('[email protected]', 'https://example.com'); | ||
const account = new Account(client); | ||
|
||
promise.then(function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
const response = await account.createRecovery( | ||
'[email protected]', // email | ||
'https://example.com' // url | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.createSession( | ||
'<USER_ID>', // userId | ||
'<SECRET>' // secret | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,12 @@ | ||
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
// Init SDK | ||
let client = new sdk.Client(); | ||
|
||
let account = new sdk.Account(client); | ||
|
||
client | ||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token | ||
; | ||
|
||
.setSession(''); // The user session to authenticate with | ||
|
||
let promise = account.createVerification('https://example.com'); | ||
const account = new Account(client); | ||
|
||
promise.then(function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
const response = await account.createVerification( | ||
'https://example.com' // url | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.create( | ||
'<USER_ID>', // userId | ||
'[email protected]', // email | ||
'', // password | ||
'<NAME>' // name (optional) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,12 @@ | ||
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
// Init SDK | ||
let client = new sdk.Client(); | ||
|
||
let account = new sdk.Account(client); | ||
|
||
client | ||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token | ||
; | ||
|
||
.setSession(''); // The user session to authenticate with | ||
|
||
let promise = account.deleteIdentity('[IDENTITY_ID]'); | ||
const account = new Account(client); | ||
|
||
promise.then(function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
const response = await account.deleteIdentity( | ||
'<IDENTITY_ID>' // identityId | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setSession(''); // The user session to authenticate with | ||
|
||
const account = new Account(client); | ||
|
||
const response = await account.deleteMfaAuthenticator( | ||
AuthenticatorType.Totp, // type | ||
'<OTP>' // otp | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,12 @@ | ||
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
// Init SDK | ||
let client = new sdk.Client(); | ||
|
||
let account = new sdk.Account(client); | ||
|
||
client | ||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token | ||
; | ||
|
||
.setSession(''); // The user session to authenticate with | ||
|
||
let promise = account.deleteSession('[SESSION_ID]'); | ||
const account = new Account(client); | ||
|
||
promise.then(function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
const response = await account.deleteSession( | ||
'<SESSION_ID>' // sessionId | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; | ||
import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; | ||
|
||
// Init SDK | ||
let client = new sdk.Client(); | ||
|
||
let account = new sdk.Account(client); | ||
|
||
client | ||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('5df5acd0d48c2') // Your project ID | ||
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token | ||
; | ||
|
||
.setSession(''); // The user session to authenticate with | ||
|
||
let promise = account.deleteSessions(); | ||
const account = new Account(client); | ||
|
||
promise.then(function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
const response = await account.deleteSessions(); |
Oops, something went wrong.