@portal-hq/web 0.1.2 → 0.1.3-rca
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/lib/commonjs/mpc/index.js +2 -1
- package/lib/esm/mpc/index.js +2 -1
- package/package.json +2 -2
- package/src/mpc/index.ts +3 -6
- package/types.d.ts +11 -2
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.MpcErrorCodes = exports.MpcError = void 0;
|
|
13
13
|
const errors_1 = require("./errors");
|
|
14
14
|
const index_1 = require("../index");
|
|
15
|
-
const WEB_SDK_VERSION = '0.1.
|
|
15
|
+
const WEB_SDK_VERSION = '0.1.3-rca';
|
|
16
16
|
class Mpc {
|
|
17
17
|
constructor({ portal }) {
|
|
18
18
|
this.configureIframe = () => {
|
|
@@ -666,6 +666,7 @@ class Mpc {
|
|
|
666
666
|
iframe.width = '0';
|
|
667
667
|
iframe.src = source;
|
|
668
668
|
iframe.addEventListener('load', this.configureIframe);
|
|
669
|
+
iframe.allow = 'publickey-credentials-get publickey-credentials-create';
|
|
669
670
|
document.body.appendChild(iframe);
|
|
670
671
|
this.iframe = iframe;
|
|
671
672
|
}
|
package/lib/esm/mpc/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { PortalMpcError } from './errors';
|
|
11
11
|
import { BackupMethods } from '../index';
|
|
12
|
-
const WEB_SDK_VERSION = '0.1.
|
|
12
|
+
const WEB_SDK_VERSION = '0.1.3-rca';
|
|
13
13
|
class Mpc {
|
|
14
14
|
constructor({ portal }) {
|
|
15
15
|
this.configureIframe = () => {
|
|
@@ -663,6 +663,7 @@ class Mpc {
|
|
|
663
663
|
iframe.width = '0';
|
|
664
664
|
iframe.src = source;
|
|
665
665
|
iframe.addEventListener('load', this.configureIframe);
|
|
666
|
+
iframe.allow = 'publickey-credentials-get publickey-credentials-create';
|
|
666
667
|
document.body.appendChild(iframe);
|
|
667
668
|
this.iframe = iframe;
|
|
668
669
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Portal MPC Support for Web",
|
|
4
4
|
"author": "Portal Labs, Inc.",
|
|
5
5
|
"homepage": "https://portalhq.io/",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.3-rca",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "lib/commonjs/index",
|
|
9
9
|
"module": "lib/esm/index",
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"webpack": "^5.87.0",
|
|
47
47
|
"webpack-cli": "^5.1.4"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
package/src/mpc/index.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type {
|
|
|
24
24
|
WorkerResult,
|
|
25
25
|
} from '../../types'
|
|
26
26
|
|
|
27
|
-
const WEB_SDK_VERSION = '0.1.
|
|
27
|
+
const WEB_SDK_VERSION = '0.1.3-rca'
|
|
28
28
|
|
|
29
29
|
class Mpc {
|
|
30
30
|
public iframe?: HTMLIFrameElement
|
|
@@ -294,10 +294,7 @@ class Mpc {
|
|
|
294
294
|
})
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
|
|
298
|
-
public async eject(
|
|
299
|
-
data: EjectArgs,
|
|
300
|
-
): Promise<string> {
|
|
297
|
+
public async eject(data: EjectArgs): Promise<string> {
|
|
301
298
|
return new Promise((resolve, reject) => {
|
|
302
299
|
const handleEject = (message: MessageEvent<WorkerResult>) => {
|
|
303
300
|
const { type, data } = message.data
|
|
@@ -786,7 +783,7 @@ class Mpc {
|
|
|
786
783
|
iframe.width = '0'
|
|
787
784
|
iframe.src = source
|
|
788
785
|
iframe.addEventListener('load', this.configureIframe)
|
|
789
|
-
|
|
786
|
+
iframe.allow = 'publickey-credentials-get publickey-credentials-create'
|
|
790
787
|
document.body.appendChild(iframe)
|
|
791
788
|
|
|
792
789
|
this.iframe = iframe
|
package/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { MpcErrorCodes } from './src/mpc/errors'
|
|
|
3
3
|
|
|
4
4
|
import Api from '../iframe/core/api'
|
|
5
5
|
import GDriveStorage from '../iframe/core/storage/gdrive'
|
|
6
|
+
import PasskeyStorage from '../iframe/core/storage/passkey'
|
|
6
7
|
import Portal from './src/index'
|
|
7
8
|
import Provider from './src/provider'
|
|
8
9
|
|
|
@@ -18,7 +19,6 @@ export type MessageData =
|
|
|
18
19
|
| SignArgs
|
|
19
20
|
export type ProgressCallback = (status: MpcStatus) => void | Promise<void>
|
|
20
21
|
export type ValidRpcErrorCodes = 4001 | 4100 | 4200 | 4900 | 4901
|
|
21
|
-
export type PasskeyConfig = PasskeyConfig
|
|
22
22
|
// Interfaces
|
|
23
23
|
|
|
24
24
|
export interface FeatureFlags {
|
|
@@ -179,7 +179,16 @@ export interface GDriveStorageOptions {
|
|
|
179
179
|
export type GenerateArgs = MpcOperationArgs
|
|
180
180
|
|
|
181
181
|
export interface PasskeyConfig {
|
|
182
|
-
relyingParty?: string = '
|
|
182
|
+
relyingParty?: string = 'portalhq.io'
|
|
183
|
+
relyingPartyOrigins?: [string] = ['https://web.portalhq.io']
|
|
184
|
+
webAuthnHost?: string = 'backup.web.portalhq.io'
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface PasskeyStorageOptions {
|
|
188
|
+
portal: IPortal
|
|
189
|
+
relyingParty?: string = 'portalhq.io'
|
|
190
|
+
relyingPartyOrigins?: [string] = ['https://web.portalhq.io']
|
|
191
|
+
webAuthnHost?: string = 'backup.web.portalhq.io'
|
|
183
192
|
}
|
|
184
193
|
|
|
185
194
|
export interface PasskeyStatusResponse {
|