Skip to content

Commit

Permalink
Release candidate for 1.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Feb 19, 2024
1 parent 57c6575 commit 3a3a030
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:

```html
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.6.0-rc.10"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.6.0-rc.11"></script>
```


Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/add-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, , Account } from "@appwrite.io/console";
import { Client, AuthenticatorType, Account } from "@appwrite.io/console";

const client = new Client();

Expand All @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.addAuthenticator(.Totp);
const promise = account.addAuthenticator(AuthenticatorType.Totp);

promise.then(function (response) {
console.log(response); // Success
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create2f-a-challenge.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, , Account } from "@appwrite.io/console";
import { Client, AuthenticationFactor, Account } from "@appwrite.io/console";

const client = new Client();

Expand All @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.create2FAChallenge(.Totp);
const promise = account.create2FAChallenge(AuthenticationFactor.Totp);

promise.then(function (response) {
console.log(response); // Success
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/delete-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, , Account } from "@appwrite.io/console";
import { Client, AuthenticatorType, Account } from "@appwrite.io/console";

const client = new Client();

Expand All @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.deleteAuthenticator(.Totp, '[OTP]');
const promise = account.deleteAuthenticator(AuthenticatorType.Totp, '[OTP]');

promise.then(function (response) {
console.log(response); // Success
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/verify-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, , Account } from "@appwrite.io/console";
import { Client, AuthenticatorType, Account } from "@appwrite.io/console";

const client = new Client();

Expand All @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.verifyAuthenticator(.Totp, '[OTP]');
const promise = account.verifyAuthenticator(AuthenticatorType.Totp, '[OTP]');

promise.then(function (response) {
console.log(response); // Success
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/users/delete-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, , Users } from "@appwrite.io/console";
import { Client, AuthenticatorType, Users } from "@appwrite.io/console";

const client = new Client();

Expand All @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = users.deleteAuthenticator('[USER_ID]', .Totp, '[OTP]');
const promise = users.deleteAuthenticator('[USER_ID]', AuthenticatorType.Totp, '[OTP]');

promise.then(function (response) {
console.log(response); // Success
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@appwrite.io/console",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "0.6.0-rc.10",
"version": "0.6.0-rc.11",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class Client {
'x-sdk-name': 'Console',
'x-sdk-platform': 'console',
'x-sdk-language': 'web',
'x-sdk-version': '0.6.0-rc.10',
'X-Appwrite-Response-Format': '1.4.0',
'x-sdk-version': '0.6.0-rc.11',
'X-Appwrite-Response-Format': '1.5.0',
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/enums/factor.ts → src/enums/authentication-factor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum Factor {
export enum AuthenticationFactor {
Totp = 'totp',
Phone = 'phone',
Email = 'email',
Expand Down
3 changes: 3 additions & 0 deletions src/enums/authenticator-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export enum AuthenticatorType {
Totp = 'totp',
}
3 changes: 0 additions & 3 deletions src/enums/type.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export type { QueryTypes, QueryTypesList } from './query';
export { Permission } from './permission';
export { Role } from './role';
export { ID } from './id';
export { Factor } from './enums/factor';
export { Type } from './enums/type';
export { AuthenticationFactor } from './enums/authentication-factor';
export { AuthenticatorType } from './enums/authenticator-type';
export { OAuthProvider } from './enums/o-auth-provider';
export { Browser } from './enums/browser';
export { CreditCard } from './enums/credit-card';
Expand Down
20 changes: 10 additions & 10 deletions src/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { AppwriteException, Client } from '../client';
import type { Models } from '../models';
import type { UploadProgress, Payload } from '../client';
import { Query } from '../query';
import { Factor } from '../enums/factor';
import { Type } from '../enums/type';
import { AuthenticationFactor } from '../enums/authentication-factor';
import { AuthenticatorType } from '../enums/authenticator-type';
import { OAuthProvider } from '../enums/o-auth-provider';

export class Account extends Service {
Expand Down Expand Up @@ -271,11 +271,11 @@ export class Account extends Service {
* Create 2FA Challenge
*
*
* @param {Factor} factor
* @param {AuthenticationFactor} factor
* @throws {AppwriteException}
* @returns {Promise}
*/
async create2FAChallenge(factor: Factor): Promise<Models.MfaChallenge> {
async create2FAChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> {
if (typeof factor === 'undefined') {
throw new AppwriteException('Missing required parameter: "factor"');
}
Expand Down Expand Up @@ -349,11 +349,11 @@ export class Account extends Service {
* Add Authenticator
*
*
* @param {Type} type
* @param {AuthenticatorType} type
* @throws {AppwriteException}
* @returns {Promise}
*/
async addAuthenticator(type: Type): Promise<Models.MfaType> {
async addAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> {
if (typeof type === 'undefined') {
throw new AppwriteException('Missing required parameter: "type"');
}
Expand All @@ -371,12 +371,12 @@ export class Account extends Service {
* Verify Authenticator
*
*
* @param {Type} type
* @param {AuthenticatorType} type
* @param {string} otp
* @throws {AppwriteException}
* @returns {Promise}
*/
async verifyAuthenticator<Preferences extends Models.Preferences>(type: Type, otp: string): Promise<Models.User<Preferences>> {
async verifyAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
if (typeof type === 'undefined') {
throw new AppwriteException('Missing required parameter: "type"');
}
Expand All @@ -402,12 +402,12 @@ export class Account extends Service {
* Delete Authenticator
*
*
* @param {Type} type
* @param {AuthenticatorType} type
* @param {string} otp
* @throws {AppwriteException}
* @returns {Promise}
*/
async deleteAuthenticator<Preferences extends Models.Preferences>(type: Type, otp: string): Promise<Models.User<Preferences>> {
async deleteAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
if (typeof type === 'undefined') {
throw new AppwriteException('Missing required parameter: "type"');
}
Expand Down
6 changes: 3 additions & 3 deletions src/services/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { UploadProgress, Payload } from '../client';
import { Query } from '../query';
import { PasswordHash } from '../enums/password-hash';
import { UserUsageRange } from '../enums/user-usage-range';
import { Type } from '../enums/type';
import { AuthenticatorType } from '../enums/authenticator-type';
import { MessagingProviderType } from '../enums/messaging-provider-type';

export class Users extends Service {
Expand Down Expand Up @@ -842,12 +842,12 @@ export class Users extends Service {
*
*
* @param {string} userId
* @param {Type} type
* @param {AuthenticatorType} type
* @param {string} otp
* @throws {AppwriteException}
* @returns {Promise}
*/
async deleteAuthenticator<Preferences extends Models.Preferences>(userId: string, type: Type, otp: string): Promise<Models.User<Preferences>> {
async deleteAuthenticator<Preferences extends Models.Preferences>(userId: string, type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
if (typeof userId === 'undefined') {
throw new AppwriteException('Missing required parameter: "userId"');
}
Expand Down

0 comments on commit 3a3a030

Please sign in to comment.