@octane-xplat/biometrics 0.0.1 → 0.8.0
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/LICENSE +21 -0
- package/package.json +60 -10
- package/src/biometrics.macos.ts +9 -0
- package/src/biometrics.ts +24 -0
- package/src/biometrics.web.ts +13 -0
- package/src/index.macos.ts +2 -0
- package/src/index.ts +2 -0
- package/src/types.ts +11 -0
- package/README.md +0 -3
- package/index.d.ts +0 -1
- package/index.js +0 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alec Larson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,19 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octane-xplat/biometrics",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Biometric verification (FaceID/TouchID/fingerprint) for Octane xplat — matching web + NativeScript implementations",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"octane",
|
|
7
|
+
"xplat",
|
|
8
|
+
"cross-platform",
|
|
9
|
+
"biometrics",
|
|
10
|
+
"faceid",
|
|
11
|
+
"touchid",
|
|
12
|
+
"fingerprint",
|
|
13
|
+
"nativescript",
|
|
14
|
+
"ios",
|
|
15
|
+
"android",
|
|
16
|
+
"web"
|
|
17
|
+
],
|
|
5
18
|
"license": "MIT",
|
|
19
|
+
"homepage": "https://github.com/octane-xplat/octane-xplat/tree/main/packages/biometrics",
|
|
6
20
|
"repository": {
|
|
7
21
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/octane-xplat/octane-xplat.git",
|
|
22
|
+
"url": "git+https://github.com/octane-xplat/octane-xplat.git",
|
|
9
23
|
"directory": "packages/biometrics"
|
|
10
24
|
},
|
|
11
|
-
"homepage": "https://github.com/octane-xplat/octane-xplat/tree/main/packages/biometrics",
|
|
12
|
-
"main": "./index.js",
|
|
13
|
-
"types": "./index.d.ts",
|
|
14
25
|
"files": [
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
"src"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"macos": "./src/index.macos.ts",
|
|
32
|
+
"default": "./src/index.ts"
|
|
33
|
+
},
|
|
34
|
+
"./*": "./src/*"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@nativescript/biometrics": "1.3.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@nativescript-community/octane": "0.2.4",
|
|
44
|
+
"@nativescript/core": "9.1.2",
|
|
45
|
+
"octane": "0.6.3"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@nativescript-community/octane": ">=0.2.1 <1",
|
|
49
|
+
"@nativescript/core": ">=9.1.0 <10",
|
|
50
|
+
"octane": ">=0.6.3 <1"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@nativescript-community/octane": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"@nativescript/core": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"nativescript": {
|
|
61
|
+
"platforms": {
|
|
62
|
+
"android": "9.1.0",
|
|
63
|
+
"ios": "9.1.0"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"test:packed": "node tests/packed-consumer.mjs"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Biometrics — AppKit host leaf. No LocalAuthentication bridge exists on the
|
|
2
|
+
// dev host.
|
|
3
|
+
import type { Capability, BiometricsImpl } from './types'
|
|
4
|
+
|
|
5
|
+
export const biometrics: Capability<BiometricsImpl> = {
|
|
6
|
+
supported: false,
|
|
7
|
+
ensure: async () => 'unsupported',
|
|
8
|
+
impl: null,
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Biometrics — FaceID/TouchID/fingerprint via @nativescript/biometrics.
|
|
2
|
+
import { BiometricAuth } from '@nativescript/biometrics'
|
|
3
|
+
import type { Capability } from './types'
|
|
4
|
+
import type { BiometricsImpl } from './types'
|
|
5
|
+
|
|
6
|
+
const bio = new BiometricAuth()
|
|
7
|
+
|
|
8
|
+
export const biometrics: Capability<BiometricsImpl> = {
|
|
9
|
+
supported: true,
|
|
10
|
+
async ensure() {
|
|
11
|
+
const r = await bio.available()
|
|
12
|
+
return r.any ? 'granted' : 'unsupported'
|
|
13
|
+
},
|
|
14
|
+
impl: {
|
|
15
|
+
async verify(reason) {
|
|
16
|
+
try {
|
|
17
|
+
const r = await bio.verifyBiometric({ title: reason })
|
|
18
|
+
return r.code === 0
|
|
19
|
+
} catch {
|
|
20
|
+
return false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Biometrics — web leaf. WebAuthn is an authentication ceremony, not a
|
|
2
|
+
// standalone local-presence API: it requires an RP challenge and a registered
|
|
3
|
+
// credential, and may require a user gesture. Do not claim it implements the
|
|
4
|
+
// native verify(reason) contract by creating an ephemeral passkey.
|
|
5
|
+
import type { BiometricsImpl, Capability } from './types'
|
|
6
|
+
|
|
7
|
+
export const biometrics: Capability<BiometricsImpl> = {
|
|
8
|
+
supported: false,
|
|
9
|
+
async ensure() {
|
|
10
|
+
return 'unsupported'
|
|
11
|
+
},
|
|
12
|
+
impl: null,
|
|
13
|
+
}
|
package/src/index.ts
ADDED
package/src/types.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Optional capability — never throws for absence (docs/platform-services.md). */
|
|
2
|
+
export interface Capability<T> {
|
|
3
|
+
supported: boolean
|
|
4
|
+
ensure(): Promise<'granted' | 'denied' | 'unsupported'>
|
|
5
|
+
/** usable iff supported && ensured */
|
|
6
|
+
impl: T | null
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface BiometricsImpl {
|
|
10
|
+
verify(reason: string): Promise<boolean>
|
|
11
|
+
}
|
package/README.md
DELETED
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/index.js
DELETED