@portal-hq/passkey-storage 4.1.0 → 4.1.1
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/index.js +4 -4
- package/lib/esm/index.js +3 -3
- package/package.json +4 -4
- package/lib/commonjs/PasskeyAuth.js +0 -1
- package/lib/commonjs/example/src/App.js +0 -51
- package/lib/commonjs/src/__tests__/index.test.js +0 -2
- package/lib/commonjs/src/index.js +0 -19
- package/lib/esm/PasskeyAuth.js +0 -1
package/lib/commonjs/index.js
CHANGED
|
@@ -33,8 +33,8 @@ class PasskeyStorage {
|
|
|
33
33
|
}
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
35
35
|
read() {
|
|
36
|
-
var _a;
|
|
37
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
var _a;
|
|
38
38
|
try {
|
|
39
39
|
if (!((_a = this.api) === null || _a === void 0 ? void 0 : _a.apiKey)) {
|
|
40
40
|
throw new Error('API key is not set');
|
|
@@ -62,8 +62,8 @@ class PasskeyStorage {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
write(privateKey) {
|
|
65
|
-
var _a;
|
|
66
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
var _a;
|
|
67
67
|
try {
|
|
68
68
|
if (!((_a = this.api) === null || _a === void 0 ? void 0 : _a.apiKey)) {
|
|
69
69
|
throw new Error('API key is not set');
|
|
@@ -197,8 +197,8 @@ class PasskeyStorage {
|
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
getEncryptionKey(assertion) {
|
|
200
|
-
var _a;
|
|
201
200
|
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
var _a;
|
|
202
202
|
if (((_a = this.api) === null || _a === void 0 ? void 0 : _a.apiKey) === undefined) {
|
|
203
203
|
throw new Error('API key is not set');
|
|
204
204
|
}
|
|
@@ -243,5 +243,5 @@ var PasskeyStatus;
|
|
|
243
243
|
PasskeyStatus["NotRegistered"] = "not registered";
|
|
244
244
|
PasskeyStatus["Registered"] = "registered";
|
|
245
245
|
PasskeyStatus["RegisteredWithCredential"] = "registered with credential";
|
|
246
|
-
})(PasskeyStatus
|
|
246
|
+
})(PasskeyStatus || (exports.PasskeyStatus = PasskeyStatus = {}));
|
|
247
247
|
exports.default = PasskeyStorage;
|
package/lib/esm/index.js
CHANGED
|
@@ -30,8 +30,8 @@ export class PasskeyStorage {
|
|
|
30
30
|
}
|
|
31
31
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
32
32
|
read() {
|
|
33
|
-
var _a;
|
|
34
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
var _a;
|
|
35
35
|
try {
|
|
36
36
|
if (!((_a = this.api) === null || _a === void 0 ? void 0 : _a.apiKey)) {
|
|
37
37
|
throw new Error('API key is not set');
|
|
@@ -59,8 +59,8 @@ export class PasskeyStorage {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
write(privateKey) {
|
|
62
|
-
var _a;
|
|
63
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
var _a;
|
|
64
64
|
try {
|
|
65
65
|
if (!((_a = this.api) === null || _a === void 0 ? void 0 : _a.apiKey)) {
|
|
66
66
|
throw new Error('API key is not set');
|
|
@@ -194,8 +194,8 @@ export class PasskeyStorage {
|
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
getEncryptionKey(assertion) {
|
|
197
|
-
var _a;
|
|
198
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
var _a;
|
|
199
199
|
if (((_a = this.api) === null || _a === void 0 ? void 0 : _a.apiKey) === undefined) {
|
|
200
200
|
throw new Error('API key is not set');
|
|
201
201
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portal-hq/passkey-storage",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Portal's Passkey storage adapter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Portal Labs, Inc.",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"test": "jest --pass-with-no-tests"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@portal-hq/core": "^4.1.
|
|
26
|
-
"@portal-hq/utils": "^4.1.
|
|
25
|
+
"@portal-hq/core": "^4.1.1",
|
|
26
|
+
"@portal-hq/utils": "^4.1.1",
|
|
27
27
|
"react-native-passkey": "^2.1.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react-native-passkey": "^2.1.1"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "3c03bd4a6573b23865f655856cd0161706f3f30d"
|
|
41
41
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const React = __importStar(require("react"));
|
|
27
|
-
const react_native_1 = require("react-native");
|
|
28
|
-
const passkey_storage_1 = require("@portal-hq/passkey-storage");
|
|
29
|
-
function App() {
|
|
30
|
-
const [result, setResult] = React.useState();
|
|
31
|
-
React.useEffect(() => {
|
|
32
|
-
(0, passkey_storage_1.multiply)(3, 7).then(setResult);
|
|
33
|
-
}, []);
|
|
34
|
-
return (React.createElement(react_native_1.View, { style: styles.container },
|
|
35
|
-
React.createElement(react_native_1.Text, null,
|
|
36
|
-
"Result: ",
|
|
37
|
-
result)));
|
|
38
|
-
}
|
|
39
|
-
exports.default = App;
|
|
40
|
-
const styles = react_native_1.StyleSheet.create({
|
|
41
|
-
container: {
|
|
42
|
-
flex: 1,
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'center',
|
|
45
|
-
},
|
|
46
|
-
box: {
|
|
47
|
-
width: 60,
|
|
48
|
-
height: 60,
|
|
49
|
-
marginVertical: 20,
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.multiply = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
const LINKING_ERROR = `The package '@portal-hq/passkey-storage' doesn't seem to be linked. Make sure: \n\n` +
|
|
6
|
-
react_native_1.Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
7
|
-
'- You rebuilt the app after installing the package\n' +
|
|
8
|
-
'- You are not using Expo Go\n';
|
|
9
|
-
const PasskeyStorage = react_native_1.NativeModules.PasskeyStorage
|
|
10
|
-
? react_native_1.NativeModules.PasskeyStorage
|
|
11
|
-
: new Proxy({}, {
|
|
12
|
-
get() {
|
|
13
|
-
throw new Error(LINKING_ERROR);
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
function multiply(a, b) {
|
|
17
|
-
return PasskeyStorage.multiply(a, b);
|
|
18
|
-
}
|
|
19
|
-
exports.multiply = multiply;
|
package/lib/esm/PasskeyAuth.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|