@capgo/capacitor-native-biometric 8.1.0 → 8.2.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/README.md +5 -5
- package/dist/esm/web.d.ts +6 -0
- package/dist/esm/web.js +38 -17
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +38 -17
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +38 -17
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NativeBiometricPlugin/NativeBiometricPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -590,13 +590,13 @@ The `biometryType` field indicates what biometric hardware is present, but **har
|
|
|
590
590
|
|
|
591
591
|
## Web Platform
|
|
592
592
|
|
|
593
|
-
This plugin
|
|
594
|
-
- `isAvailable()` returns `{ isAvailable:
|
|
593
|
+
This plugin provides a dummy implementation for in-browser development and testing. On web:
|
|
594
|
+
- `isAvailable()` returns `{ isAvailable: true, ... }` simulating biometric availability
|
|
595
595
|
- `addListener()` returns a no-op handle
|
|
596
|
-
- `verifyIdentity()`
|
|
597
|
-
- Credential methods
|
|
596
|
+
- `verifyIdentity()` always succeeds (no actual authentication)
|
|
597
|
+
- Credential methods use in-memory storage (credentials stored in a Map, cleared on page refresh)
|
|
598
598
|
|
|
599
|
-
This allows you to
|
|
599
|
+
This allows you to develop and test your app in the browser without errors. Note that real biometric authentication is only available on iOS and Android platforms.
|
|
600
600
|
|
|
601
601
|
## Contributors
|
|
602
602
|
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { WebPlugin } from '@capacitor/core';
|
|
|
2
2
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
3
3
|
import type { NativeBiometricPlugin, AvailableResult, BiometricOptions, GetCredentialOptions, SetCredentialOptions, DeleteCredentialOptions, IsCredentialsSavedOptions, IsCredentialsSavedResult, Credentials, BiometryChangeListener } from './definitions';
|
|
4
4
|
export declare class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {
|
|
5
|
+
/**
|
|
6
|
+
* In-memory credential storage for browser development/testing.
|
|
7
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
8
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
9
|
+
*/
|
|
10
|
+
private credentialStore;
|
|
5
11
|
constructor();
|
|
6
12
|
isAvailable(): Promise<AvailableResult>;
|
|
7
13
|
addListener(_eventName: 'biometryChange', _listener: BiometryChangeListener): Promise<PluginListenerHandle>;
|
package/dist/esm/web.js
CHANGED
|
@@ -3,15 +3,22 @@ import { BiometryType, AuthenticationStrength } from './definitions';
|
|
|
3
3
|
export class NativeBiometricWeb extends WebPlugin {
|
|
4
4
|
constructor() {
|
|
5
5
|
super();
|
|
6
|
+
/**
|
|
7
|
+
* In-memory credential storage for browser development/testing.
|
|
8
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
9
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
10
|
+
*/
|
|
11
|
+
this.credentialStore = new Map();
|
|
6
12
|
}
|
|
7
13
|
isAvailable() {
|
|
8
|
-
// Web platform:
|
|
14
|
+
// Web platform: return a dummy implementation for development/testing
|
|
15
|
+
// Using TOUCH_ID as a generic placeholder for simulated biometric authentication
|
|
9
16
|
return Promise.resolve({
|
|
10
|
-
isAvailable:
|
|
11
|
-
authenticationStrength: AuthenticationStrength.
|
|
12
|
-
biometryType: BiometryType.
|
|
13
|
-
deviceIsSecure:
|
|
14
|
-
strongBiometryIsAvailable:
|
|
17
|
+
isAvailable: true,
|
|
18
|
+
authenticationStrength: AuthenticationStrength.STRONG,
|
|
19
|
+
biometryType: BiometryType.TOUCH_ID,
|
|
20
|
+
deviceIsSecure: true,
|
|
21
|
+
strongBiometryIsAvailable: true,
|
|
15
22
|
});
|
|
16
23
|
}
|
|
17
24
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -23,26 +30,40 @@ export class NativeBiometricWeb extends WebPlugin {
|
|
|
23
30
|
},
|
|
24
31
|
};
|
|
25
32
|
}
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
34
|
verifyIdentity(_options) {
|
|
27
|
-
console.log('verifyIdentity
|
|
28
|
-
|
|
35
|
+
console.log('verifyIdentity (dummy implementation)');
|
|
36
|
+
// Dummy implementation: always succeeds for browser testing
|
|
37
|
+
return Promise.resolve();
|
|
29
38
|
}
|
|
30
39
|
getCredentials(_options) {
|
|
31
|
-
console.log('getCredentials', _options);
|
|
32
|
-
|
|
40
|
+
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
41
|
+
// Dummy implementation: retrieve from in-memory store
|
|
42
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
43
|
+
if (!credentials) {
|
|
44
|
+
throw new Error('No credentials found for the specified server');
|
|
45
|
+
}
|
|
46
|
+
return Promise.resolve(credentials);
|
|
33
47
|
}
|
|
34
48
|
setCredentials(_options) {
|
|
35
|
-
console.log('setCredentials', _options);
|
|
36
|
-
|
|
49
|
+
console.log('setCredentials (dummy implementation)', { server: _options.server });
|
|
50
|
+
// Dummy implementation: store in memory
|
|
51
|
+
this.credentialStore.set(_options.server, {
|
|
52
|
+
username: _options.username,
|
|
53
|
+
password: _options.password,
|
|
54
|
+
});
|
|
55
|
+
return Promise.resolve();
|
|
37
56
|
}
|
|
38
57
|
deleteCredentials(_options) {
|
|
39
|
-
console.log('deleteCredentials', _options);
|
|
40
|
-
|
|
58
|
+
console.log('deleteCredentials (dummy implementation)', { server: _options.server });
|
|
59
|
+
// Dummy implementation: remove from in-memory store
|
|
60
|
+
this.credentialStore.delete(_options.server);
|
|
61
|
+
return Promise.resolve();
|
|
41
62
|
}
|
|
42
63
|
isCredentialsSaved(_options) {
|
|
43
|
-
console.log('isCredentialsSaved', _options);
|
|
44
|
-
//
|
|
45
|
-
return Promise.resolve({ isSaved:
|
|
64
|
+
console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });
|
|
65
|
+
// Dummy implementation: check in-memory store
|
|
66
|
+
return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });
|
|
46
67
|
}
|
|
47
68
|
async getPluginVersion() {
|
|
48
69
|
return { version: 'web' };
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,OAAO,kBAAmB,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAQ/C;QACE,KAAK,EAAE,CAAC;QARV;;;;WAIG;QACK,oBAAe,GAA6B,IAAI,GAAG,EAAE,CAAC;IAI9D,CAAC;IAED,WAAW;QACT,sEAAsE;QACtE,iFAAiF;QACjF,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,WAAW,EAAE,IAAI;YACjB,sBAAsB,EAAE,sBAAsB,CAAC,MAAM;YACrD,YAAY,EAAE,YAAY,CAAC,QAAQ;YACnC,cAAc,EAAE,IAAI;YACpB,yBAAyB,EAAE,IAAI;SAChC,CAAC,CAAC;IACL,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,WAAW,CAAC,UAA4B,EAAE,SAAiC;QAC/E,iDAAiD;QACjD,OAAO;YACL,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,2BAA2B;YAC7B,CAAC;SACF,CAAC;IACJ,CAAC;IAED,6DAA6D;IAC7D,cAAc,CAAC,QAA2B;QACxC,OAAO,CAAC,GAAG,CAAC,uCAA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C,CAAC;QACtF,8CAA8C;QAC9C,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PluginListenerHandle } from '@capacitor/core';\n\nimport type {\n NativeBiometricPlugin,\n AvailableResult,\n BiometricOptions,\n GetCredentialOptions,\n SetCredentialOptions,\n DeleteCredentialOptions,\n IsCredentialsSavedOptions,\n IsCredentialsSavedResult,\n Credentials,\n BiometryChangeListener,\n} from './definitions';\nimport { BiometryType, AuthenticationStrength } from './definitions';\n\nexport class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {\n /**\n * In-memory credential storage for browser development/testing.\n * Credentials are stored temporarily and cleared on page refresh.\n * This is NOT secure storage and should only be used for development purposes.\n */\n private credentialStore: Map<string, Credentials> = new Map();\n\n constructor() {\n super();\n }\n\n isAvailable(): Promise<AvailableResult> {\n // Web platform: return a dummy implementation for development/testing\n // Using TOUCH_ID as a generic placeholder for simulated biometric authentication\n return Promise.resolve({\n isAvailable: true,\n authenticationStrength: AuthenticationStrength.STRONG,\n biometryType: BiometryType.TOUCH_ID,\n deviceIsSecure: true,\n strongBiometryIsAvailable: true,\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName: 'biometryChange', _listener: BiometryChangeListener): Promise<PluginListenerHandle> {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n verifyIdentity(_options?: BiometricOptions): Promise<void> {\n console.log('verifyIdentity (dummy implementation)');\n // Dummy implementation: always succeeds for browser testing\n return Promise.resolve();\n }\n\n getCredentials(_options: GetCredentialOptions): Promise<Credentials> {\n console.log('getCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: retrieve from in-memory store\n const credentials = this.credentialStore.get(_options.server);\n if (!credentials) {\n throw new Error('No credentials found for the specified server');\n }\n return Promise.resolve(credentials);\n }\n\n setCredentials(_options: SetCredentialOptions): Promise<void> {\n console.log('setCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: store in memory\n this.credentialStore.set(_options.server, {\n username: _options.username,\n password: _options.password,\n });\n return Promise.resolve();\n }\n\n deleteCredentials(_options: DeleteCredentialOptions): Promise<void> {\n console.log('deleteCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: remove from in-memory store\n this.credentialStore.delete(_options.server);\n return Promise.resolve();\n }\n\n isCredentialsSaved(_options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult> {\n console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });\n // Dummy implementation: check in-memory store\n return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -120,15 +120,22 @@ const NativeBiometric = core.registerPlugin('NativeBiometric', {
|
|
|
120
120
|
class NativeBiometricWeb extends core.WebPlugin {
|
|
121
121
|
constructor() {
|
|
122
122
|
super();
|
|
123
|
+
/**
|
|
124
|
+
* In-memory credential storage for browser development/testing.
|
|
125
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
126
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
127
|
+
*/
|
|
128
|
+
this.credentialStore = new Map();
|
|
123
129
|
}
|
|
124
130
|
isAvailable() {
|
|
125
|
-
// Web platform:
|
|
131
|
+
// Web platform: return a dummy implementation for development/testing
|
|
132
|
+
// Using TOUCH_ID as a generic placeholder for simulated biometric authentication
|
|
126
133
|
return Promise.resolve({
|
|
127
|
-
isAvailable:
|
|
128
|
-
authenticationStrength: exports.AuthenticationStrength.
|
|
129
|
-
biometryType: exports.BiometryType.
|
|
130
|
-
deviceIsSecure:
|
|
131
|
-
strongBiometryIsAvailable:
|
|
134
|
+
isAvailable: true,
|
|
135
|
+
authenticationStrength: exports.AuthenticationStrength.STRONG,
|
|
136
|
+
biometryType: exports.BiometryType.TOUCH_ID,
|
|
137
|
+
deviceIsSecure: true,
|
|
138
|
+
strongBiometryIsAvailable: true,
|
|
132
139
|
});
|
|
133
140
|
}
|
|
134
141
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -140,26 +147,40 @@ class NativeBiometricWeb extends core.WebPlugin {
|
|
|
140
147
|
},
|
|
141
148
|
};
|
|
142
149
|
}
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
143
151
|
verifyIdentity(_options) {
|
|
144
|
-
console.log('verifyIdentity
|
|
145
|
-
|
|
152
|
+
console.log('verifyIdentity (dummy implementation)');
|
|
153
|
+
// Dummy implementation: always succeeds for browser testing
|
|
154
|
+
return Promise.resolve();
|
|
146
155
|
}
|
|
147
156
|
getCredentials(_options) {
|
|
148
|
-
console.log('getCredentials', _options);
|
|
149
|
-
|
|
157
|
+
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
158
|
+
// Dummy implementation: retrieve from in-memory store
|
|
159
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
160
|
+
if (!credentials) {
|
|
161
|
+
throw new Error('No credentials found for the specified server');
|
|
162
|
+
}
|
|
163
|
+
return Promise.resolve(credentials);
|
|
150
164
|
}
|
|
151
165
|
setCredentials(_options) {
|
|
152
|
-
console.log('setCredentials', _options);
|
|
153
|
-
|
|
166
|
+
console.log('setCredentials (dummy implementation)', { server: _options.server });
|
|
167
|
+
// Dummy implementation: store in memory
|
|
168
|
+
this.credentialStore.set(_options.server, {
|
|
169
|
+
username: _options.username,
|
|
170
|
+
password: _options.password,
|
|
171
|
+
});
|
|
172
|
+
return Promise.resolve();
|
|
154
173
|
}
|
|
155
174
|
deleteCredentials(_options) {
|
|
156
|
-
console.log('deleteCredentials', _options);
|
|
157
|
-
|
|
175
|
+
console.log('deleteCredentials (dummy implementation)', { server: _options.server });
|
|
176
|
+
// Dummy implementation: remove from in-memory store
|
|
177
|
+
this.credentialStore.delete(_options.server);
|
|
178
|
+
return Promise.resolve();
|
|
158
179
|
}
|
|
159
180
|
isCredentialsSaved(_options) {
|
|
160
|
-
console.log('isCredentialsSaved', _options);
|
|
161
|
-
//
|
|
162
|
-
return Promise.resolve({ isSaved:
|
|
181
|
+
console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });
|
|
182
|
+
// Dummy implementation: check in-memory store
|
|
183
|
+
return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });
|
|
163
184
|
}
|
|
164
185
|
async getPluginVersion() {
|
|
165
186
|
return { version: 'web' };
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n // Android - Device credentials (PIN, pattern, or password)\n BiometryType[BiometryType[\"DEVICE_CREDENTIAL\"] = 7] = \"DEVICE_CREDENTIAL\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACnD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;AACzD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;AACjE;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,C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,OAAO,EAAE,KAAK,EAAE,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n // Android - Device credentials (PIN, pattern, or password)\n BiometryType[BiometryType[\"DEVICE_CREDENTIAL\"] = 7] = \"DEVICE_CREDENTIAL\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n /**\n * In-memory credential storage for browser development/testing.\n * Credentials are stored temporarily and cleared on page refresh.\n * This is NOT secure storage and should only be used for development purposes.\n */\n this.credentialStore = new Map();\n }\n isAvailable() {\n // Web platform: return a dummy implementation for development/testing\n // Using TOUCH_ID as a generic placeholder for simulated biometric authentication\n return Promise.resolve({\n isAvailable: true,\n authenticationStrength: AuthenticationStrength.STRONG,\n biometryType: BiometryType.TOUCH_ID,\n deviceIsSecure: true,\n strongBiometryIsAvailable: true,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n verifyIdentity(_options) {\n console.log('verifyIdentity (dummy implementation)');\n // Dummy implementation: always succeeds for browser testing\n return Promise.resolve();\n }\n getCredentials(_options) {\n console.log('getCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: retrieve from in-memory store\n const credentials = this.credentialStore.get(_options.server);\n if (!credentials) {\n throw new Error('No credentials found for the specified server');\n }\n return Promise.resolve(credentials);\n }\n setCredentials(_options) {\n console.log('setCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: store in memory\n this.credentialStore.set(_options.server, {\n username: _options.username,\n password: _options.password,\n });\n return Promise.resolve();\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: remove from in-memory store\n this.credentialStore.delete(_options.server);\n return Promise.resolve();\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });\n // Dummy implementation: check in-memory store\n return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACnD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;AACzD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;AACjE;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,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A,QAAQ,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE;AAClD,YAAY,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AACvC,YAAY,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AACvC,SAAS,CAAC;AACV,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC5F;AACA,QAAQ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AACpD,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ,IAAI,kBAAkB,CAAC,QAAQ,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,2CAA2C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC7F;AACA,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;AACtF,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -119,15 +119,22 @@ var capacitorCapacitorBiometric = (function (exports, core) {
|
|
|
119
119
|
class NativeBiometricWeb extends core.WebPlugin {
|
|
120
120
|
constructor() {
|
|
121
121
|
super();
|
|
122
|
+
/**
|
|
123
|
+
* In-memory credential storage for browser development/testing.
|
|
124
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
125
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
126
|
+
*/
|
|
127
|
+
this.credentialStore = new Map();
|
|
122
128
|
}
|
|
123
129
|
isAvailable() {
|
|
124
|
-
// Web platform:
|
|
130
|
+
// Web platform: return a dummy implementation for development/testing
|
|
131
|
+
// Using TOUCH_ID as a generic placeholder for simulated biometric authentication
|
|
125
132
|
return Promise.resolve({
|
|
126
|
-
isAvailable:
|
|
127
|
-
authenticationStrength: exports.AuthenticationStrength.
|
|
128
|
-
biometryType: exports.BiometryType.
|
|
129
|
-
deviceIsSecure:
|
|
130
|
-
strongBiometryIsAvailable:
|
|
133
|
+
isAvailable: true,
|
|
134
|
+
authenticationStrength: exports.AuthenticationStrength.STRONG,
|
|
135
|
+
biometryType: exports.BiometryType.TOUCH_ID,
|
|
136
|
+
deviceIsSecure: true,
|
|
137
|
+
strongBiometryIsAvailable: true,
|
|
131
138
|
});
|
|
132
139
|
}
|
|
133
140
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -139,26 +146,40 @@ var capacitorCapacitorBiometric = (function (exports, core) {
|
|
|
139
146
|
},
|
|
140
147
|
};
|
|
141
148
|
}
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
142
150
|
verifyIdentity(_options) {
|
|
143
|
-
console.log('verifyIdentity
|
|
144
|
-
|
|
151
|
+
console.log('verifyIdentity (dummy implementation)');
|
|
152
|
+
// Dummy implementation: always succeeds for browser testing
|
|
153
|
+
return Promise.resolve();
|
|
145
154
|
}
|
|
146
155
|
getCredentials(_options) {
|
|
147
|
-
console.log('getCredentials', _options);
|
|
148
|
-
|
|
156
|
+
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
157
|
+
// Dummy implementation: retrieve from in-memory store
|
|
158
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
159
|
+
if (!credentials) {
|
|
160
|
+
throw new Error('No credentials found for the specified server');
|
|
161
|
+
}
|
|
162
|
+
return Promise.resolve(credentials);
|
|
149
163
|
}
|
|
150
164
|
setCredentials(_options) {
|
|
151
|
-
console.log('setCredentials', _options);
|
|
152
|
-
|
|
165
|
+
console.log('setCredentials (dummy implementation)', { server: _options.server });
|
|
166
|
+
// Dummy implementation: store in memory
|
|
167
|
+
this.credentialStore.set(_options.server, {
|
|
168
|
+
username: _options.username,
|
|
169
|
+
password: _options.password,
|
|
170
|
+
});
|
|
171
|
+
return Promise.resolve();
|
|
153
172
|
}
|
|
154
173
|
deleteCredentials(_options) {
|
|
155
|
-
console.log('deleteCredentials', _options);
|
|
156
|
-
|
|
174
|
+
console.log('deleteCredentials (dummy implementation)', { server: _options.server });
|
|
175
|
+
// Dummy implementation: remove from in-memory store
|
|
176
|
+
this.credentialStore.delete(_options.server);
|
|
177
|
+
return Promise.resolve();
|
|
157
178
|
}
|
|
158
179
|
isCredentialsSaved(_options) {
|
|
159
|
-
console.log('isCredentialsSaved', _options);
|
|
160
|
-
//
|
|
161
|
-
return Promise.resolve({ isSaved:
|
|
180
|
+
console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });
|
|
181
|
+
// Dummy implementation: check in-memory store
|
|
182
|
+
return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });
|
|
162
183
|
}
|
|
163
184
|
async getPluginVersion() {
|
|
164
185
|
return { version: 'web' };
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n // Android - Device credentials (PIN, pattern, or password)\n BiometryType[BiometryType[\"DEVICE_CREDENTIAL\"] = 7] = \"DEVICE_CREDENTIAL\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACnD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IAC3D;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IACzD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,C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QAAQ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;IAC/E,IAAI;IACJ,IAAI,kBAAkB,CAAC,QAAQ,EAAE;IACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC;IACnD;IACA,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n // Android - Device credentials (PIN, pattern, or password)\n BiometryType[BiometryType[\"DEVICE_CREDENTIAL\"] = 7] = \"DEVICE_CREDENTIAL\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n /**\n * In-memory credential storage for browser development/testing.\n * Credentials are stored temporarily and cleared on page refresh.\n * This is NOT secure storage and should only be used for development purposes.\n */\n this.credentialStore = new Map();\n }\n isAvailable() {\n // Web platform: return a dummy implementation for development/testing\n // Using TOUCH_ID as a generic placeholder for simulated biometric authentication\n return Promise.resolve({\n isAvailable: true,\n authenticationStrength: AuthenticationStrength.STRONG,\n biometryType: BiometryType.TOUCH_ID,\n deviceIsSecure: true,\n strongBiometryIsAvailable: true,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n verifyIdentity(_options) {\n console.log('verifyIdentity (dummy implementation)');\n // Dummy implementation: always succeeds for browser testing\n return Promise.resolve();\n }\n getCredentials(_options) {\n console.log('getCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: retrieve from in-memory store\n const credentials = this.credentialStore.get(_options.server);\n if (!credentials) {\n throw new Error('No credentials found for the specified server');\n }\n return Promise.resolve(credentials);\n }\n setCredentials(_options) {\n console.log('setCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: store in memory\n this.credentialStore.set(_options.server, {\n username: _options.username,\n password: _options.password,\n });\n return Promise.resolve();\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: remove from in-memory store\n this.credentialStore.delete(_options.server);\n return Promise.resolve();\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });\n // Dummy implementation: check in-memory store\n return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACnD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IAC3D;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IACzD;IACA,IAAI,YAAY,CAA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13
13
|
public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
14
|
-
private let pluginVersion: String = "8.
|
|
14
|
+
private let pluginVersion: String = "8.2.0"
|
|
15
15
|
public let identifier = "NativeBiometricPlugin"
|
|
16
16
|
public let jsName = "NativeBiometric"
|
|
17
17
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED