Skip to content

Commit f68adfb

Browse files
committed
Release candidate for 1.5.x
1 parent 92552af commit f68adfb

15 files changed

+40
-40
lines changed

docs/examples/account/add-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setSession('') // The user session to authenticate with
1212
;
1313

14-
const promise = account.addAuthenticator(sdk..Totp);
14+
const promise = account.addAuthenticator(sdk.AuthenticatorType.Totp);
1515

1616
promise.then(function (response) {
1717
console.log(response);

docs/examples/account/create2f-a-challenge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ client
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
;
1212

13-
const promise = account.create2FAChallenge(sdk..Totp);
13+
const promise = account.create2FAChallenge(sdk.AuthenticationFactor.Totp);
1414

1515
promise.then(function (response) {
1616
console.log(response);

docs/examples/account/delete-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setSession('') // The user session to authenticate with
1212
;
1313

14-
const promise = account.deleteAuthenticator(sdk..Totp, '[OTP]');
14+
const promise = account.deleteAuthenticator(sdk.AuthenticatorType.Totp, '[OTP]');
1515

1616
promise.then(function (response) {
1717
console.log(response);

docs/examples/account/verify-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setSession('') // The user session to authenticate with
1212
;
1313

14-
const promise = account.verifyAuthenticator(sdk..Totp, '[OTP]');
14+
const promise = account.verifyAuthenticator(sdk.AuthenticatorType.Totp, '[OTP]');
1515

1616
promise.then(function (response) {
1717
console.log(response);

docs/examples/users/delete-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1212
;
1313

14-
const promise = users.deleteAuthenticator('[USER_ID]', sdk..Totp, '[OTP]');
14+
const promise = users.deleteAuthenticator('[USER_ID]', sdk.AuthenticatorType.Totp, '[OTP]');
1515

1616
promise.then(function (response) {
1717
console.log(response);

index.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,11 +2691,11 @@ declare module "node-appwrite" {
26912691
/**
26922692
* Create 2FA Challenge
26932693
*
2694-
* @param {Factor} factor
2694+
* @param {AuthenticationFactor} factor
26952695
* @throws {AppwriteException}
26962696
* @returns {Promise}
26972697
*/
2698-
create2FAChallenge(factor: Factor): Promise<Models.MfaChallenge>;
2698+
create2FAChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge>;
26992699
/**
27002700
* Create MFA Challenge (confirmation)
27012701
*
@@ -2715,29 +2715,29 @@ declare module "node-appwrite" {
27152715
/**
27162716
* Add Authenticator
27172717
*
2718-
* @param {Type} type
2718+
* @param {AuthenticatorType} type
27192719
* @throws {AppwriteException}
27202720
* @returns {Promise}
27212721
*/
2722-
addAuthenticator(type: Type): Promise<Models.MfaType>;
2722+
addAuthenticator(type: AuthenticatorType): Promise<Models.MfaType>;
27232723
/**
27242724
* Verify Authenticator
27252725
*
2726-
* @param {Type} type
2726+
* @param {AuthenticatorType} type
27272727
* @param {string} otp
27282728
* @throws {AppwriteException}
27292729
* @returns {Promise}
27302730
*/
2731-
verifyAuthenticator<Preferences extends Models.Preferences>(type: Type, otp: string): Promise<Models.User<Preferences>>;
2731+
verifyAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
27322732
/**
27332733
* Delete Authenticator
27342734
*
2735-
* @param {Type} type
2735+
* @param {AuthenticatorType} type
27362736
* @param {string} otp
27372737
* @throws {AppwriteException}
27382738
* @returns {Promise}
27392739
*/
2740-
deleteAuthenticator<Preferences extends Models.Preferences>(type: Type, otp: string): Promise<Models.User<Preferences>>;
2740+
deleteAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
27412741
/**
27422742
* Update name
27432743
*
@@ -5744,12 +5744,12 @@ declare module "node-appwrite" {
57445744
* Delete Authenticator
57455745
*
57465746
* @param {string} userId
5747-
* @param {Type} type
5747+
* @param {AuthenticatorType} type
57485748
* @param {string} otp
57495749
* @throws {AppwriteException}
57505750
* @returns {Promise}
57515751
*/
5752-
deleteAuthenticator<Preferences extends Models.Preferences>(userId: string, type: Type, otp: string): Promise<Models.User<Preferences>>;
5752+
deleteAuthenticator<Preferences extends Models.Preferences>(userId: string, type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
57535753
/**
57545754
* Update name
57555755
*

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const Messaging = require('./lib/services/messaging.js');
1616
const Storage = require('./lib/services/storage.js');
1717
const Teams = require('./lib/services/teams.js');
1818
const Users = require('./lib/services/users.js');
19-
const Factor = require("./lib/enums/factor.js");
20-
const Type = require("./lib/enums/type.js");
19+
const AuthenticationFactor = require("./lib/enums/authentication-factor.js");
20+
const AuthenticatorType = require("./lib/enums/authenticator-type.js");
2121
const OAuthProvider = require("./lib/enums/o-auth-provider.js");
2222
const Browser = require("./lib/enums/browser.js");
2323
const CreditCard = require("./lib/enums/credit-card.js");
@@ -55,8 +55,8 @@ module.exports = {
5555
Storage,
5656
Teams,
5757
Users,
58-
Factor,
59-
Type,
58+
AuthenticationFactor,
59+
AuthenticatorType,
6060
OAuthProvider,
6161
Browser,
6262
CreditCard,

lib/client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ class Client {
1212
this.headers = {
1313
'accept-encoding': '*',
1414
'content-type': '',
15-
'user-agent' : `AppwriteNodeJSSDK/12.0.0-rc.2 (${os.type()}; ${os.version()}; ${os.arch()})`,
15+
'user-agent' : `AppwriteNodeJSSDK/12.0.0-rc.3 (${os.type()}; ${os.version()}; ${os.arch()})`,
1616
'x-sdk-name': 'Node.js',
1717
'x-sdk-platform': 'server',
1818
'x-sdk-language': 'nodejs',
19-
'x-sdk-version': '12.0.0-rc.2',
20-
'X-Appwrite-Response-Format' : '1.4.0',
19+
'x-sdk-version': '12.0.0-rc.3',
20+
'X-Appwrite-Response-Format' : '1.5.0',
2121
};
2222
this.selfSigned = false;
2323
}

lib/enums/authentication-factor.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const AuthenticationFactor = {
2+
Totp: 'totp' ,
3+
Phone: 'phone' ,
4+
Email: 'email'
5+
}
6+
7+
module.exports = AuthenticationFactor;

lib/enums/authenticator-type.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const AuthenticatorType = {
2+
Totp: 'totp'
3+
}
4+
5+
module.exports = AuthenticatorType;

lib/enums/factor.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/enums/type.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/services/account.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class Account extends Service {
245245
/**
246246
* Create 2FA Challenge
247247
*
248-
* @param {Factor} factor
248+
* @param {AuthenticationFactor} factor
249249
* @throws {AppwriteException}
250250
* @returns {Promise}
251251
*/
@@ -317,7 +317,7 @@ class Account extends Service {
317317
/**
318318
* Add Authenticator
319319
*
320-
* @param {Type} type
320+
* @param {AuthenticatorType} type
321321
* @throws {AppwriteException}
322322
* @returns {Promise}
323323
*/
@@ -337,7 +337,7 @@ class Account extends Service {
337337
/**
338338
* Verify Authenticator
339339
*
340-
* @param {Type} type
340+
* @param {AuthenticatorType} type
341341
* @param {string} otp
342342
* @throws {AppwriteException}
343343
* @returns {Promise}
@@ -366,7 +366,7 @@ class Account extends Service {
366366
/**
367367
* Delete Authenticator
368368
*
369-
* @param {Type} type
369+
* @param {AuthenticatorType} type
370370
* @param {string} otp
371371
* @throws {AppwriteException}
372372
* @returns {Promise}

lib/services/users.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ class Users extends Service {
799799
* Delete Authenticator
800800
*
801801
* @param {string} userId
802-
* @param {Type} type
802+
* @param {AuthenticatorType} type
803803
* @param {string} otp
804804
* @throws {AppwriteException}
805805
* @returns {Promise}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "node-appwrite",
33
"homepage": "https://appwrite.io/support",
44
"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",
5-
"version": "12.0.0-rc.2",
5+
"version": "12.0.0-rc.3",
66
"license": "BSD-3-Clause",
77
"main": "./index.js",
88
"types": "./index.d.ts",

0 commit comments

Comments
 (0)