@getpara/core-sdk 2.0.0-alpha.57 → 2.0.0-alpha.58

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.
@@ -922,7 +922,7 @@ const _ParaCore = class _ParaCore {
922
922
  throw error;
923
923
  }
924
924
  if (!this.partner || ((_a = this.partner) == null ? void 0 : _a.id) !== session.partnerId || !(0, import_utils2.supportedWalletTypesEq)(((_b = this.partner) == null ? void 0 : _b.supportedWalletTypes) || [], session.supportedWalletTypes) || (((_c = this.partner) == null ? void 0 : _c.cosmosPrefix) || "cosmos") !== session.cosmosPrefix) {
925
- if (!session.partnerId) {
925
+ if (!session.partnerId && !this.isPortal()) {
926
926
  this.displayModalError(
927
927
  `Invalid API Key. Please ensure you have a valid API key for the current environment: ${(_d = this.ctx.env) == null ? void 0 : _d.toUpperCase()}.`
928
928
  );
@@ -3711,10 +3711,11 @@ prepareLoginState_fn = function(_0, _1) {
3711
3711
  portalTheme,
3712
3712
  sessionLookupId
3713
3713
  }) {
3714
- const _a = loginState, { loginAuthMethods, hasPasswordWithoutPIN } = _a, authState = __objRest(_a, ["loginAuthMethods", "hasPasswordWithoutPIN"]);
3714
+ const _a = loginState, { loginAuthMethods = [], hasPasswordWithoutPIN } = _a, authState = __objRest(_a, ["loginAuthMethods", "hasPasswordWithoutPIN"]);
3715
3715
  const isPasskeySupported = yield this.isPasskeySupported(), isPasskeyPossible = loginAuthMethods.includes(import_user_management_client.AuthMethod.PASSKEY) && !this.isNativePasskey, isPasswordPossible = loginAuthMethods.includes(import_user_management_client.AuthMethod.PASSWORD) && hasPasswordWithoutPIN, isPINPossible = loginAuthMethods.includes(import_user_management_client.AuthMethod.PIN);
3716
3716
  return __spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, authState), {
3717
- isPasskeySupported
3717
+ isPasskeySupported,
3718
+ loginAuthMethods
3718
3719
  }), isPasskeyPossible ? {
3719
3720
  passkeyUrl: yield this.getLoginUrl({ sessionId: sessionLookupId, shorten, portalTheme }),
3720
3721
  passkeyKnownDeviceUrl: yield this.constructPortalUrl("loginAuth", {
@@ -3745,7 +3746,7 @@ prepareLoginState_fn = function(_0, _1) {
3745
3746
  };
3746
3747
  prepareSignUpState_fn = function(_0, _1) {
3747
3748
  return __async(this, arguments, function* (serverSignupState, { useShortUrls: shorten = false, portalTheme }) {
3748
- const _a = serverSignupState, { signupAuthMethods } = _a, authState = __objRest(_a, ["signupAuthMethods"]);
3749
+ const _a = serverSignupState, { signupAuthMethods = [] } = _a, authState = __objRest(_a, ["signupAuthMethods"]);
3749
3750
  const isPasskeySupported = yield this.isPasskeySupported();
3750
3751
  const [isPasskey, isPassword, isPIN] = [
3751
3752
  signupAuthMethods.includes(import_user_management_client.AuthMethod.PASSKEY),
@@ -3757,7 +3758,10 @@ prepareSignUpState_fn = function(_0, _1) {
3757
3758
  "No supported authentication methods found. Please ensure you have enabled either WebAuth passkeys, passwords or PINs in your Developer Portal settings."
3758
3759
  );
3759
3760
  }
3760
- const signupState = __spreadProps(__spreadValues({}, authState), { isPasskeySupported });
3761
+ const signupState = __spreadProps(__spreadValues({}, authState), {
3762
+ isPasskeySupported,
3763
+ signupAuthMethods
3764
+ });
3761
3765
  if (isPasskey) {
3762
3766
  const { url: passkeyUrl, credentialId: passkeyId } = yield this.getNewCredentialAndUrl({
3763
3767
  authMethod: "PASSKEY",
@@ -43,7 +43,7 @@ __export(constants_exports, {
43
43
  SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
44
44
  });
45
45
  module.exports = __toCommonJS(constants_exports);
46
- const PARA_CORE_VERSION = "2.0.0-alpha.57";
46
+ const PARA_CORE_VERSION = "2.0.0-alpha.58";
47
47
  const PREFIX = "@CAPSULE/";
48
48
  const PARA_PREFIX = "@PARA/";
49
49
  const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
@@ -886,7 +886,7 @@ const _ParaCore = class _ParaCore {
886
886
  throw error;
887
887
  }
888
888
  if (!this.partner || ((_a = this.partner) == null ? void 0 : _a.id) !== session.partnerId || !supportedWalletTypesEq(((_b = this.partner) == null ? void 0 : _b.supportedWalletTypes) || [], session.supportedWalletTypes) || (((_c = this.partner) == null ? void 0 : _c.cosmosPrefix) || "cosmos") !== session.cosmosPrefix) {
889
- if (!session.partnerId) {
889
+ if (!session.partnerId && !this.isPortal()) {
890
890
  this.displayModalError(
891
891
  `Invalid API Key. Please ensure you have a valid API key for the current environment: ${(_d = this.ctx.env) == null ? void 0 : _d.toUpperCase()}.`
892
892
  );
@@ -3675,10 +3675,11 @@ prepareLoginState_fn = function(_0, _1) {
3675
3675
  portalTheme,
3676
3676
  sessionLookupId
3677
3677
  }) {
3678
- const _a = loginState, { loginAuthMethods, hasPasswordWithoutPIN } = _a, authState = __objRest(_a, ["loginAuthMethods", "hasPasswordWithoutPIN"]);
3678
+ const _a = loginState, { loginAuthMethods = [], hasPasswordWithoutPIN } = _a, authState = __objRest(_a, ["loginAuthMethods", "hasPasswordWithoutPIN"]);
3679
3679
  const isPasskeySupported = yield this.isPasskeySupported(), isPasskeyPossible = loginAuthMethods.includes(AuthMethod.PASSKEY) && !this.isNativePasskey, isPasswordPossible = loginAuthMethods.includes(AuthMethod.PASSWORD) && hasPasswordWithoutPIN, isPINPossible = loginAuthMethods.includes(AuthMethod.PIN);
3680
3680
  return __spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, authState), {
3681
- isPasskeySupported
3681
+ isPasskeySupported,
3682
+ loginAuthMethods
3682
3683
  }), isPasskeyPossible ? {
3683
3684
  passkeyUrl: yield this.getLoginUrl({ sessionId: sessionLookupId, shorten, portalTheme }),
3684
3685
  passkeyKnownDeviceUrl: yield this.constructPortalUrl("loginAuth", {
@@ -3709,7 +3710,7 @@ prepareLoginState_fn = function(_0, _1) {
3709
3710
  };
3710
3711
  prepareSignUpState_fn = function(_0, _1) {
3711
3712
  return __async(this, arguments, function* (serverSignupState, { useShortUrls: shorten = false, portalTheme }) {
3712
- const _a = serverSignupState, { signupAuthMethods } = _a, authState = __objRest(_a, ["signupAuthMethods"]);
3713
+ const _a = serverSignupState, { signupAuthMethods = [] } = _a, authState = __objRest(_a, ["signupAuthMethods"]);
3713
3714
  const isPasskeySupported = yield this.isPasskeySupported();
3714
3715
  const [isPasskey, isPassword, isPIN] = [
3715
3716
  signupAuthMethods.includes(AuthMethod.PASSKEY),
@@ -3721,7 +3722,10 @@ prepareSignUpState_fn = function(_0, _1) {
3721
3722
  "No supported authentication methods found. Please ensure you have enabled either WebAuth passkeys, passwords or PINs in your Developer Portal settings."
3722
3723
  );
3723
3724
  }
3724
- const signupState = __spreadProps(__spreadValues({}, authState), { isPasskeySupported });
3725
+ const signupState = __spreadProps(__spreadValues({}, authState), {
3726
+ isPasskeySupported,
3727
+ signupAuthMethods
3728
+ });
3725
3729
  if (isPasskey) {
3726
3730
  const { url: passkeyUrl, credentialId: passkeyId } = yield this.getNewCredentialAndUrl({
3727
3731
  authMethod: "PASSKEY",
@@ -1,5 +1,5 @@
1
1
  import "./chunk-W5CT3TVS.js";
2
- const PARA_CORE_VERSION = "2.0.0-alpha.57";
2
+ const PARA_CORE_VERSION = "2.0.0-alpha.58";
3
3
  const PREFIX = "@CAPSULE/";
4
4
  const PARA_PREFIX = "@PARA/";
5
5
  const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
@@ -146,6 +146,10 @@ export type AuthStateLogin = Omit<ServerAuthStateLogin, 'loginAuthMethods'> & Wi
146
146
  * A Para Portal URL for logging in via a PIN.
147
147
  */
148
148
  pinUrl?: string;
149
+ /**
150
+ * Supported login auth methods for this session.
151
+ */
152
+ loginAuthMethods?: AuthMethod[];
149
153
  };
150
154
  export type AuthStateSignup = Omit<ServerAuthStateSignup, 'signupAuthMethods'> & WithIsPasskeySupported & {
151
155
  /**
@@ -172,8 +176,14 @@ export type AuthStateSignup = Omit<ServerAuthStateSignup, 'signupAuthMethods'> &
172
176
  * The Para system ID for the newly generated PIN.
173
177
  */
174
178
  pinId?: string;
179
+ /**
180
+ * Supported signup auth methods for this session.
181
+ */
182
+ signupAuthMethods?: AuthMethod[];
183
+ };
184
+ export type AuthStateDone = Omit<ServerAuthStateDone, 'authMethods'> & {
185
+ authMethods: AuthMethod[];
175
186
  };
176
- export type AuthStateDone = ServerAuthStateDone;
177
187
  export type AuthStateVerifyOrLogin = AuthStateVerify | AuthStateLogin;
178
188
  export type AuthStateSignupOrLoginOrDone = AuthStateSignup | AuthStateLogin | AuthStateDone;
179
189
  export type OAuthResponse = AuthStateSignupOrLoginOrDone;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@getpara/core-sdk",
3
- "version": "2.0.0-alpha.57",
3
+ "version": "2.0.0-alpha.58",
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.57",
8
+ "@getpara/user-management-client": "2.0.0-alpha.58",
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": "6af8b61e587b4c2f3cd0f8d8accc2f0878667552",
30
+ "gitHead": "58c87796dc0a10da5b7c3ed9658cfd9656f122cb",
31
31
  "main": "dist/cjs/index.js",
32
32
  "module": "dist/esm/index.js",
33
33
  "scripts": {