@aparajita/capacitor-biometric-auth 2.0.5 β 2.0.8
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/README.md +10 -9
- package/dist/esm/definitions.d.ts +3 -2
- package/dist/esm/index.js +2 -3
- package/dist/esm/pkg.d.ts +4 -0
- package/dist/esm/pkg.js +4 -0
- package/dist/plugin.cjs.js +4 -3
- package/dist/plugin.js +4 -3
- package/package.json +25 -20
- package/dist/esm/package.json +0 -113
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ This plugin for [Capacitor 3](https://capacitorjs.com) provides access to native
|
|
|
6
6
|
|
|
7
7
|
π **NOTE:** This plugin only works with Capacitor 3. If you are upgrading from the Capacitor 2 version, note that the plugin name has changed to `BiometricAuth`.
|
|
8
8
|
|
|
9
|
+
π **IMPORTANT:** If you are upgrading from a version prior to 2.0.5, please note that `androidMaxAttempts` in [`AuthenticateOptions`](#authenticateoptions) is now the maximum consecutive failed attempts that are allowed, vs. the previous behavior which was maximum consecutive failed attempts + 1 (which was a bug). So if `androidMaxAttempts` is set to 3, [`authenticate`](#authenticate) will return `BiometryErrorType.authenticationFailed`as soon as the third consecutive attempt fails.
|
|
10
|
+
|
|
9
11
|
## Demos
|
|
10
12
|
|
|
11
13
|
Here is `capacitor-biometric-auth` running on the [demo app](https://github.com/aparajita/capacitor-biometric-auth-demo) on both iOS and Android.
|
|
@@ -60,14 +62,13 @@ On Android, fingerprint, face, and iris authentication are supported. Note that
|
|
|
60
62
|
## API
|
|
61
63
|
<docgen-index>
|
|
62
64
|
|
|
63
|
-
[checkBiometry()](#checkbiometry)
|
|
64
|
-
[setBiometryType(...)](#setbiometrytype)
|
|
65
|
-
[authenticate(...)](#authenticate)
|
|
66
|
-
[addResumeListener(...)](#addresumelistener)
|
|
67
|
-
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[Enums](#enums)
|
|
65
|
+
* [`checkBiometry()`](#checkbiometry)
|
|
66
|
+
* [`setBiometryType(...)`](#setbiometrytype)
|
|
67
|
+
* [`authenticate(...)`](#authenticate)
|
|
68
|
+
* [`addResumeListener(...)`](#addresumelistener)
|
|
69
|
+
* [Interfaces](#interfaces)
|
|
70
|
+
* [Type Aliases](#type-aliases)
|
|
71
|
+
* [Enums](#enums)
|
|
71
72
|
|
|
72
73
|
</docgen-index>
|
|
73
74
|
<docgen-api>
|
|
@@ -155,7 +156,7 @@ Register a function that will be called when the app resumes. The function will
|
|
|
155
156
|
|iosFallbackTitle|string| The system presents a fallback button when biometric authentication fails β for example, because the system doesnβt recognize the presented finger, or after several failed attempts to recognize the userβs face.<br><br>If `allowDeviceCredential` is false, tapping this button dismisses the authentication dialog and returns the error code userFallback. If undefined, the localized systetm default title is used. Passing an empty string hides the fallback button completely.<br><br>If `allowDeviceCredential` is true and this is undefined, the localized system default title is used. |
|
|
156
157
|
|androidTitle|string| Title for the Android dialog. If not supplied, the system default is used. |
|
|
157
158
|
|androidSubtitle|string| Subtitle for the Android dialog. If not supplied, the system default is used. |
|
|
158
|
-
|androidMaxAttempts|number|
|
|
159
|
+
|androidMaxAttempts|number| When this many consecutive biometric verification attempts fail, `authenticate` returns `BiometryErrorType.authenticationFailed`. The default is 3. |
|
|
159
160
|
|
|
160
161
|
|
|
161
162
|
#### PluginListenerHandle
|
|
@@ -102,8 +102,9 @@ export interface AuthenticateOptions {
|
|
|
102
102
|
*/
|
|
103
103
|
androidSubtitle?: string;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
105
|
+
* When this many consecutive biometric verification attempts fail,
|
|
106
|
+
* `authenticate` returns `BiometryErrorType.authenticationFailed`.
|
|
107
|
+
* The default is 3.
|
|
107
108
|
*/
|
|
108
109
|
androidMaxAttempts?: number;
|
|
109
110
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
import { kPluginName } from './definitions';
|
|
3
|
-
import
|
|
3
|
+
import pkg from './pkg';
|
|
4
4
|
import { BiometricAuth } from './web';
|
|
5
|
-
console.log(`loaded ${name}`);
|
|
5
|
+
console.log(`loaded ${pkg.name}`);
|
|
6
6
|
// Because we are using @aparajita/capacitor-native-decorator,
|
|
7
7
|
// we have one version of the TS code to rule them all, and there
|
|
8
8
|
// is no need to lazy load. π
|
|
9
9
|
const plugin = new BiometricAuth();
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
10
|
const biometricAuth = registerPlugin(kPluginName, {
|
|
12
11
|
web: plugin,
|
|
13
12
|
ios: plugin,
|
package/dist/esm/pkg.js
ADDED
package/dist/plugin.cjs.js
CHANGED
|
@@ -64,7 +64,9 @@ class BiometryError {
|
|
|
64
64
|
}
|
|
65
65
|
const kPluginName = 'BiometricAuth';
|
|
66
66
|
|
|
67
|
-
const
|
|
67
|
+
const pkg = {
|
|
68
|
+
name: '@aparajita/capacitor-biometric-auth'
|
|
69
|
+
};
|
|
68
70
|
|
|
69
71
|
var __decorate = (window && window.__decorate) || function (decorators, target, key, desc) {
|
|
70
72
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -154,12 +156,11 @@ function getBiometryName(type) {
|
|
|
154
156
|
return kBiometryTypeNameMap[type] || '';
|
|
155
157
|
}
|
|
156
158
|
|
|
157
|
-
console.log(`loaded ${name}`);
|
|
159
|
+
console.log(`loaded ${pkg.name}`);
|
|
158
160
|
// Because we are using @aparajita/capacitor-native-decorator,
|
|
159
161
|
// we have one version of the TS code to rule them all, and there
|
|
160
162
|
// is no need to lazy load. π
|
|
161
163
|
const plugin = new BiometricAuth();
|
|
162
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
163
164
|
const biometricAuth = core.registerPlugin(kPluginName, {
|
|
164
165
|
web: plugin,
|
|
165
166
|
ios: plugin,
|
package/dist/plugin.js
CHANGED
|
@@ -59,7 +59,9 @@ var capacitorBiometricAuth = (function (exports, core, capacitorNativeDecorator,
|
|
|
59
59
|
}
|
|
60
60
|
const kPluginName = 'BiometricAuth';
|
|
61
61
|
|
|
62
|
-
const
|
|
62
|
+
const pkg = {
|
|
63
|
+
name: '@aparajita/capacitor-biometric-auth'
|
|
64
|
+
};
|
|
63
65
|
|
|
64
66
|
var __decorate = (window && window.__decorate) || function (decorators, target, key, desc) {
|
|
65
67
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -149,12 +151,11 @@ var capacitorBiometricAuth = (function (exports, core, capacitorNativeDecorator,
|
|
|
149
151
|
return kBiometryTypeNameMap[type] || '';
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
console.log(`loaded ${name}`);
|
|
154
|
+
console.log(`loaded ${pkg.name}`);
|
|
153
155
|
// Because we are using @aparajita/capacitor-native-decorator,
|
|
154
156
|
// we have one version of the TS code to rule them all, and there
|
|
155
157
|
// is no need to lazy load. π
|
|
156
158
|
const plugin = new BiometricAuth();
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
158
159
|
const biometricAuth = core.registerPlugin(kPluginName, {
|
|
159
160
|
web: plugin,
|
|
160
161
|
ios: plugin,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aparajita/capacitor-biometric-auth",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Provides access to the native biometric auth APIs for Capacitor apps",
|
|
5
5
|
"author": "Aparajita Fishman",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,34 +48,35 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@aparajita/capacitor-docgen": "github:aparajita/capacitor-docgen",
|
|
50
50
|
"@aparajita/capacitor-docgen-format": "github:aparajita/capacitor-docgen-format",
|
|
51
|
-
"@aparajita/eslint-config-base": "^1.1.
|
|
51
|
+
"@aparajita/eslint-config-base": "^1.1.5",
|
|
52
52
|
"@aparajita/prettier-config": "^1.0.0",
|
|
53
|
-
"@aparajita/swiftly": "^1.0.
|
|
53
|
+
"@aparajita/swiftly": "^1.0.4",
|
|
54
54
|
"@capacitor/core": "^3.6.0",
|
|
55
55
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
56
56
|
"@rollup/plugin-json": "^4.1.0",
|
|
57
|
-
"@types/node": "^18.0
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^5.30.
|
|
59
|
-
"@typescript-eslint/parser": "^5.30.
|
|
57
|
+
"@types/node": "^18.6.0",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
|
59
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
60
60
|
"chalk": "^5.0.1",
|
|
61
61
|
"commit-and-tag-version": "^10.0.1",
|
|
62
|
-
"eslint": "^8.
|
|
62
|
+
"eslint": "^8.20.0",
|
|
63
63
|
"eslint-config-prettier": "^8.5.0",
|
|
64
64
|
"eslint-config-standard": "^17.0.0",
|
|
65
|
-
"eslint-import-resolver-typescript": "^3.
|
|
65
|
+
"eslint-import-resolver-typescript": "^3.3.0",
|
|
66
66
|
"eslint-plugin-import": "^2.26.0",
|
|
67
67
|
"eslint-plugin-n": "^15.2.4",
|
|
68
68
|
"eslint-plugin-prettier": "^4.2.1",
|
|
69
69
|
"eslint-plugin-promise": "^6.0.0",
|
|
70
|
-
"nodemon": "^2.0.
|
|
70
|
+
"nodemon": "^2.0.19",
|
|
71
71
|
"prettier": "^2.7.1",
|
|
72
72
|
"prettier-plugin-java": "^1.6.2",
|
|
73
73
|
"rimraf": "^3.0.2",
|
|
74
|
-
"rollup": "^2.
|
|
74
|
+
"rollup": "^2.77.0",
|
|
75
|
+
"swiftlint": "^1.0.1",
|
|
75
76
|
"typescript": "~4.7.4"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
|
-
"@aparajita/capacitor-native-decorator": "^2.0.
|
|
79
|
+
"@aparajita/capacitor-native-decorator": "^2.0.8",
|
|
79
80
|
"@capacitor/android": "^3.6.0",
|
|
80
81
|
"@capacitor/app": "^1.1.1",
|
|
81
82
|
"@capacitor/ios": "^3.6.0"
|
|
@@ -85,14 +86,17 @@
|
|
|
85
86
|
},
|
|
86
87
|
"scripts": {
|
|
87
88
|
"clean": "rimraf ./dist",
|
|
88
|
-
"
|
|
89
|
-
"build
|
|
90
|
-
"build.
|
|
91
|
-
"
|
|
89
|
+
"extract-pkg": "node scripts/packageJsonToTS.js",
|
|
90
|
+
"build": "pnpm extract-pkg && pnpm check.fix && pnpm builder",
|
|
91
|
+
"build.dev": "pnpm extract-pkg && pnpm check.fix && pnpm builder.dev",
|
|
92
|
+
"builder": "pnpm clean && tsc $SOURCE_MAP && pnpm rollup && make-ios-plugin && pnpm docgen",
|
|
93
|
+
"builder.dev": "SOURCE_MAP=--sourceMap pnpm builder",
|
|
92
94
|
"rollup": "rollup -c rollup.config.mjs",
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
95
|
+
"watcher": "nodemon -w ./src -w tsconfig.json -w rollup.config.mjs --exec 'pnpm --silent $BUILD' -e ts,json,md",
|
|
96
|
+
"watch": "BUILD=build pnpm watcher",
|
|
97
|
+
"watch.dev": "BUILD=build.dev pnpm watcher",
|
|
98
|
+
"lint": "eslint --cache . && pnpm typecheck",
|
|
99
|
+
"lint.fix": "eslint --cache --fix . && pnpm typecheck",
|
|
96
100
|
"typecheck": "tsc --noEmit",
|
|
97
101
|
"lint.swift": "pnpm swiftlint",
|
|
98
102
|
"prettier": "prettier --check \"**/*.{css,html,ts,js,json,java}\"",
|
|
@@ -107,7 +111,8 @@
|
|
|
107
111
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
108
112
|
"verify:web": "pnpm build",
|
|
109
113
|
"push": "git push --follow-tags origin main",
|
|
110
|
-
"release.check": "commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run",
|
|
111
|
-
"release": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm
|
|
114
|
+
"release.check": "pnpm check.fix && commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run",
|
|
115
|
+
"release.prepare": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm builder",
|
|
116
|
+
"release": "pnpm push && pnpm publish"
|
|
112
117
|
}
|
|
113
118
|
}
|
package/dist/esm/package.json
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@aparajita/capacitor-biometric-auth",
|
|
3
|
-
"version": "2.0.4",
|
|
4
|
-
"description": "Provides access to the native biometric auth APIs for Capacitor apps",
|
|
5
|
-
"author": "Aparajita Fishman",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "dist/plugin.cjs.js",
|
|
8
|
-
"module": "dist/esm/index.js",
|
|
9
|
-
"types": "dist/esm/index.d.ts",
|
|
10
|
-
"unpkg": "dist/plugin.js",
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=16.15.1"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"android/src/main/",
|
|
16
|
-
"android/build.gradle",
|
|
17
|
-
"dist/",
|
|
18
|
-
"ios/Plugin/",
|
|
19
|
-
"*.podspec",
|
|
20
|
-
"LICENSE"
|
|
21
|
-
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"clean": "rimraf ./dist",
|
|
24
|
-
"build": "pnpm check && pnpm build.only",
|
|
25
|
-
"build.dev": "pnpm check && pnpm build.only.dev",
|
|
26
|
-
"build.only": "pnpm clean && tsc $SOURCE_MAP && pnpm rollup && make-ios-plugin && pnpm docgen",
|
|
27
|
-
"build.only.dev": "SOURCE_MAP=--sourceMap pnpm build.only",
|
|
28
|
-
"rollup": "rollup -c rollup.config.mjs",
|
|
29
|
-
"watch": "nodemon -w ./src -w tsconfig.json -w rollup.config.mjs --exec 'pnpm build --silent' -e ts",
|
|
30
|
-
"lint": "eslint . && pnpm typecheck",
|
|
31
|
-
"lint.fix": "eslint --fix . && pnpm typecheck",
|
|
32
|
-
"typecheck": "tsc --noEmit",
|
|
33
|
-
"lint.swift": "pnpm swiftlint",
|
|
34
|
-
"prettier": "prettier --check \"**/*.{css,html,ts,js,json,java}\"",
|
|
35
|
-
"prettier.fix": "pnpm prettier --write",
|
|
36
|
-
"swiftlint": "swiftly ios",
|
|
37
|
-
"swiftlint.fix": "swiftly --fix ios",
|
|
38
|
-
"check": "pnpm lint && pnpm prettier && pnpm swiftlint",
|
|
39
|
-
"check.fix": "pnpm lint.fix && pnpm prettier.fix && pnpm swiftlint.fix",
|
|
40
|
-
"docgen": "docgen --api BiometricAuthPlugin --output-readme README.md && docgen-format",
|
|
41
|
-
"verify": "pnpm verify:ios && pnpm verify:android && pnpm verify:web",
|
|
42
|
-
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
|
|
43
|
-
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
44
|
-
"verify:web": "pnpm build",
|
|
45
|
-
"push": "git push --follow-tags origin main",
|
|
46
|
-
"release.check": "commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run",
|
|
47
|
-
"release": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm push && pnpm publish"
|
|
48
|
-
},
|
|
49
|
-
"keywords": [
|
|
50
|
-
"capacitor",
|
|
51
|
-
"plugin",
|
|
52
|
-
"native",
|
|
53
|
-
"biometry",
|
|
54
|
-
"biometric",
|
|
55
|
-
"auth",
|
|
56
|
-
"faceid",
|
|
57
|
-
"touchid"
|
|
58
|
-
],
|
|
59
|
-
"capacitor": {
|
|
60
|
-
"ios": {
|
|
61
|
-
"src": "ios"
|
|
62
|
-
},
|
|
63
|
-
"android": {
|
|
64
|
-
"src": "android"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"swiftlint": "@ionic/swiftlint-config",
|
|
68
|
-
"repository": {
|
|
69
|
-
"type": "git",
|
|
70
|
-
"url": "https://github.com/aparajita/capacitor-biometric-auth.git"
|
|
71
|
-
},
|
|
72
|
-
"bugs": {
|
|
73
|
-
"url": "https://github.com/aparajita/capacitor-biometric-auth/issues"
|
|
74
|
-
},
|
|
75
|
-
"devDependencies": {
|
|
76
|
-
"@aparajita/capacitor-docgen": "github:aparajita/capacitor-docgen",
|
|
77
|
-
"@aparajita/capacitor-docgen-format": "github:aparajita/capacitor-docgen-format",
|
|
78
|
-
"@aparajita/eslint-config-base": "^1.1.2",
|
|
79
|
-
"@aparajita/prettier-config": "^1.0.0",
|
|
80
|
-
"@aparajita/swiftly": "^1.0.1",
|
|
81
|
-
"@capacitor/core": "^3.6.0",
|
|
82
|
-
"@ionic/swiftlint-config": "^1.1.2",
|
|
83
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
84
|
-
"@types/node": "^18.0.1",
|
|
85
|
-
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
86
|
-
"@typescript-eslint/parser": "^5.30.5",
|
|
87
|
-
"chalk": "^5.0.1",
|
|
88
|
-
"commit-and-tag-version": "^10.0.1",
|
|
89
|
-
"eslint": "^8.19.0",
|
|
90
|
-
"eslint-config-prettier": "^8.5.0",
|
|
91
|
-
"eslint-config-standard": "^17.0.0",
|
|
92
|
-
"eslint-import-resolver-typescript": "^3.2.1",
|
|
93
|
-
"eslint-plugin-import": "^2.26.0",
|
|
94
|
-
"eslint-plugin-n": "^15.2.4",
|
|
95
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
96
|
-
"eslint-plugin-promise": "^6.0.0",
|
|
97
|
-
"nodemon": "^2.0.18",
|
|
98
|
-
"prettier": "^2.7.1",
|
|
99
|
-
"prettier-plugin-java": "^1.6.2",
|
|
100
|
-
"rimraf": "^3.0.2",
|
|
101
|
-
"rollup": "^2.75.7",
|
|
102
|
-
"typescript": "~4.7.4"
|
|
103
|
-
},
|
|
104
|
-
"dependencies": {
|
|
105
|
-
"@aparajita/capacitor-native-decorator": "^2.0.4",
|
|
106
|
-
"@capacitor/android": "^3.6.0",
|
|
107
|
-
"@capacitor/app": "^1.1.1",
|
|
108
|
-
"@capacitor/ios": "^3.6.0"
|
|
109
|
-
},
|
|
110
|
-
"peerDependencies": {
|
|
111
|
-
"@capacitor/core": "^3.6.0"
|
|
112
|
-
}
|
|
113
|
-
}
|