@getpara/core-sdk 2.0.0-alpha.35 → 2.0.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -891,8 +891,8 @@ const _ParaCore = class _ParaCore {
|
|
|
891
891
|
return __privateGet(this, _authInfo);
|
|
892
892
|
});
|
|
893
893
|
}
|
|
894
|
-
assertUserId() {
|
|
895
|
-
if (!this.userId || this.isGuestMode) {
|
|
894
|
+
assertUserId({ allowGuestMode = false } = {}) {
|
|
895
|
+
if (!this.userId || !allowGuestMode && this.isGuestMode) {
|
|
896
896
|
throw new Error("no userId is set");
|
|
897
897
|
}
|
|
898
898
|
return this.userId;
|
|
@@ -1535,7 +1535,7 @@ const _ParaCore = class _ParaCore {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
break;
|
|
1537
1537
|
}
|
|
1538
|
-
const userId = this.assertUserId();
|
|
1538
|
+
const userId = this.assertUserId({ allowGuestMode: true });
|
|
1539
1539
|
if (type !== "EMAIL" && type !== "PHONE") {
|
|
1540
1540
|
throw new Error("invalid auth type for verification code");
|
|
1541
1541
|
}
|
|
@@ -3032,7 +3032,7 @@ const _ParaCore = class _ParaCore {
|
|
|
3032
3032
|
"verificationCode"
|
|
3033
3033
|
]);
|
|
3034
3034
|
this.assertIsAuthSet(["email", "phone"]);
|
|
3035
|
-
const userId = this.assertUserId();
|
|
3035
|
+
const userId = this.assertUserId({ allowGuestMode: true });
|
|
3036
3036
|
const serverAuthState = yield this.ctx.client.verifyNewAccount(userId, {
|
|
3037
3037
|
verificationCode
|
|
3038
3038
|
});
|
package/dist/cjs/constants.js
CHANGED
|
@@ -40,7 +40,7 @@ __export(constants_exports, {
|
|
|
40
40
|
SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(constants_exports);
|
|
43
|
-
const PARA_CORE_VERSION = "2.0.0-alpha.
|
|
43
|
+
const PARA_CORE_VERSION = "2.0.0-alpha.36";
|
|
44
44
|
const PREFIX = "@CAPSULE/";
|
|
45
45
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
46
46
|
const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -856,8 +856,8 @@ const _ParaCore = class _ParaCore {
|
|
|
856
856
|
return __privateGet(this, _authInfo);
|
|
857
857
|
});
|
|
858
858
|
}
|
|
859
|
-
assertUserId() {
|
|
860
|
-
if (!this.userId || this.isGuestMode) {
|
|
859
|
+
assertUserId({ allowGuestMode = false } = {}) {
|
|
860
|
+
if (!this.userId || !allowGuestMode && this.isGuestMode) {
|
|
861
861
|
throw new Error("no userId is set");
|
|
862
862
|
}
|
|
863
863
|
return this.userId;
|
|
@@ -1500,7 +1500,7 @@ const _ParaCore = class _ParaCore {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
break;
|
|
1502
1502
|
}
|
|
1503
|
-
const userId = this.assertUserId();
|
|
1503
|
+
const userId = this.assertUserId({ allowGuestMode: true });
|
|
1504
1504
|
if (type !== "EMAIL" && type !== "PHONE") {
|
|
1505
1505
|
throw new Error("invalid auth type for verification code");
|
|
1506
1506
|
}
|
|
@@ -2997,7 +2997,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2997
2997
|
"verificationCode"
|
|
2998
2998
|
]);
|
|
2999
2999
|
this.assertIsAuthSet(["email", "phone"]);
|
|
3000
|
-
const userId = this.assertUserId();
|
|
3000
|
+
const userId = this.assertUserId({ allowGuestMode: true });
|
|
3001
3001
|
const serverAuthState = yield this.ctx.client.verifyNewAccount(userId, {
|
|
3002
3002
|
verificationCode
|
|
3003
3003
|
});
|
package/dist/esm/constants.js
CHANGED
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -222,7 +222,9 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
222
222
|
extras?: AuthExtras;
|
|
223
223
|
userId?: string;
|
|
224
224
|
}): Promise<typeof this.authInfo>;
|
|
225
|
-
protected assertUserId(
|
|
225
|
+
protected assertUserId({ allowGuestMode }?: {
|
|
226
|
+
allowGuestMode?: boolean;
|
|
227
|
+
}): string;
|
|
226
228
|
protected assertIsAuthSet(allowed?: AuthType[]): PrimaryAuthInfo;
|
|
227
229
|
/**
|
|
228
230
|
* Sets the email associated with the `ParaCore` instance.
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.37",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@celo/utils": "^8.0.2",
|
|
6
6
|
"@cosmjs/encoding": "^0.32.4",
|
|
7
7
|
"@ethereumjs/util": "^9.1.0",
|
|
8
|
-
"@getpara/user-management-client": "2.0.0-alpha.
|
|
8
|
+
"@getpara/user-management-client": "2.0.0-alpha.37",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"base64url": "^3.0.1",
|
|
11
11
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist",
|
|
28
28
|
"package.json"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "7386ccd1590142e086a1f7608e02eef55be75a12",
|
|
31
31
|
"main": "dist/cjs/index.js",
|
|
32
32
|
"module": "dist/esm/index.js",
|
|
33
33
|
"scripts": {
|