electron-webauthn 1.0.4 → 1.1.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/dist/additional-objc/ASCPublicKeyCredentialDescriptor.d.ts +12 -0
- package/dist/additional-objc/ASCPublicKeyCredentialDescriptor.js +2 -0
- package/dist/create/authorization-controller.d.ts +2 -1
- package/dist/create/authorization-controller.js +7 -7
- package/dist/create/internal-handler.js +29 -28
- package/dist/get/authorization-controller.d.ts +2 -1
- package/dist/get/authorization-controller.js +1 -1
- package/dist/get/internal-handler.js +30 -30
- package/dist/helpers/objc.d.ts +5 -0
- package/dist/helpers/objc.js +10 -0
- package/dist/helpers/presentation.js +3 -4
- package/dist/helpers/prf.d.ts +1 -1
- package/dist/helpers/prf.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/list/handler.d.ts +2 -0
- package/dist/list/handler.js +65 -0
- package/dist/list/types.d.ts +14 -0
- package/dist/list/types.js +1 -0
- package/package.json +3 -2
- package/dist/objc/authentication-services/as-authorization-c-public-key-credential-descriptor.d.ts +0 -9
- package/dist/objc/authentication-services/as-authorization-c-public-key-credential-descriptor.js +0 -6
- package/dist/objc/authentication-services/as-authorization-controller-delegate.d.ts +0 -7
- package/dist/objc/authentication-services/as-authorization-controller-delegate.js +0 -12
- package/dist/objc/authentication-services/as-authorization-controller-presentation-context-providing.d.ts +0 -5
- package/dist/objc/authentication-services/as-authorization-controller-presentation-context-providing.js +0 -7
- package/dist/objc/authentication-services/as-authorization-controller.d.ts +0 -15
- package/dist/objc/authentication-services/as-authorization-controller.js +0 -6
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.d.ts +0 -17
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.js +0 -2
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.d.ts +0 -8
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.js +0 -6
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-provider.d.ts +0 -11
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-provider.js +0 -6
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-registration.d.ts +0 -15
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-registration.js +0 -2
- package/dist/objc/authentication-services/as-authorization-platform-security-key-credential-assertion.d.ts +0 -17
- package/dist/objc/authentication-services/as-authorization-platform-security-key-credential-assertion.js +0 -2
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion-input.d.ts +0 -9
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion-input.js +0 -6
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.d.ts +0 -8
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.js +0 -2
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-registration-input.d.ts +0 -7
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-registration-input.js +0 -6
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-registration-output.d.ts +0 -5
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-registration-output.js +0 -2
- package/dist/objc/authentication-services/as-authorization-public-key-credential-parameters.d.ts +0 -8
- package/dist/objc/authentication-services/as-authorization-public-key-credential-parameters.js +0 -6
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion-input-valuesas-authorization-public-key-credential-prf-assertion-input-values.d.ts +0 -7
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion-input-valuesas-authorization-public-key-credential-prf-assertion-input-values.js +0 -6
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion-input.d.ts +0 -8
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion-input.js +0 -6
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.d.ts +0 -8
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.js +0 -2
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-registration-input.d.ts +0 -9
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-registration-input.js +0 -6
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-registration-output.d.ts +0 -9
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-registration-output.js +0 -2
- package/dist/objc/authentication-services/as-authorization-security-key-public-key-credential-provider.d.ts +0 -11
- package/dist/objc/authentication-services/as-authorization-security-key-public-key-credential-provider.js +0 -6
- package/dist/objc/authentication-services/as-authorization.d.ts +0 -7
- package/dist/objc/authentication-services/as-authorization.js +0 -2
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.d.ts +0 -4
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.js +0 -5
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attestation-kind.d.ts +0 -6
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attestation-kind.js +0 -7
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-large-blob-assertion-operation.d.ts +0 -4
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-large-blob-assertion-operation.js +0 -5
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-large-blob-support-requirement.d.ts +0 -4
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-large-blob-support-requirement.js +0 -5
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-user-verification-preference.d.ts +0 -5
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-user-verification-preference.js +0 -6
- package/dist/objc/authentication-services/index.d.ts +0 -2
- package/dist/objc/authentication-services/index.js +0 -2
- package/dist/objc/foundation/index.d.ts +0 -2
- package/dist/objc/foundation/index.js +0 -2
- package/dist/objc/foundation/nsarray.d.ts +0 -11
- package/dist/objc/foundation/nsarray.js +0 -12
- package/dist/objc/foundation/nsdata.d.ts +0 -35
- package/dist/objc/foundation/nsdata.js +0 -56
- package/dist/objc/foundation/nsdictionary.d.ts +0 -37
- package/dist/objc/foundation/nsdictionary.js +0 -64
- package/dist/objc/foundation/nserror.d.ts +0 -21
- package/dist/objc/foundation/nserror.js +0 -53
- package/dist/objc/foundation/nsinteger.d.ts +0 -50
- package/dist/objc/foundation/nsinteger.js +0 -124
- package/dist/objc/foundation/nsstring.d.ts +0 -9
- package/dist/objc/foundation/nsstring.js +0 -5
- package/dist/objc/foundation/nsview.d.ts +0 -6
- package/dist/objc/foundation/nsview.js +0 -2
- package/dist/objc/foundation/nswindow.d.ts +0 -4
- package/dist/objc/foundation/nswindow.js +0 -2
- package/dist/objc/helpers.d.ts +0 -2
- package/dist/objc/helpers.js +0 -5
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Foundation } from "./index.js";
|
|
2
|
-
import {} from "./nsstring.js";
|
|
3
|
-
export const NSError = Foundation.NSError;
|
|
4
|
-
export function parseNSError(error) {
|
|
5
|
-
const nsError = error;
|
|
6
|
-
const domain = nsError.domain().UTF8String();
|
|
7
|
-
const code = nsError.code();
|
|
8
|
-
const localizedDescription = nsError.localizedDescription().UTF8String();
|
|
9
|
-
let localizedFailureReason;
|
|
10
|
-
try {
|
|
11
|
-
const reason = nsError.localizedFailureReason();
|
|
12
|
-
if (reason) {
|
|
13
|
-
localizedFailureReason = reason.UTF8String();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
}
|
|
18
|
-
let localizedRecoverySuggestion;
|
|
19
|
-
try {
|
|
20
|
-
const suggestion = nsError.localizedRecoverySuggestion();
|
|
21
|
-
if (suggestion) {
|
|
22
|
-
localizedRecoverySuggestion = suggestion.UTF8String();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
}
|
|
27
|
-
let userInfo;
|
|
28
|
-
try {
|
|
29
|
-
const userInfoDict = nsError.userInfo();
|
|
30
|
-
if (userInfoDict) {
|
|
31
|
-
userInfo = {
|
|
32
|
-
description: userInfoDict.description().UTF8String(),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
domain,
|
|
40
|
-
code,
|
|
41
|
-
localizedDescription,
|
|
42
|
-
...(localizedFailureReason && { localizedFailureReason }),
|
|
43
|
-
...(localizedRecoverySuggestion && { localizedRecoverySuggestion }),
|
|
44
|
-
...(userInfo && { userInfo }),
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export function nsErrorToJSError(error) {
|
|
48
|
-
const parsed = parseNSError(error);
|
|
49
|
-
const jsError = new Error(parsed.localizedDescription);
|
|
50
|
-
jsError.name = `${parsed.domain} (${parsed.code})`;
|
|
51
|
-
jsError.nsError = parsed;
|
|
52
|
-
return jsError;
|
|
53
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { NobjcObject } from "objc-js";
|
|
2
|
-
export declare const NSIntegerMax = 9223372036854775807n;
|
|
3
|
-
export declare const NSIntegerMin = -9223372036854775808n;
|
|
4
|
-
export declare const NSUIntegerMax = 18446744073709551615n;
|
|
5
|
-
export declare const JS_SAFE_INTEGER_MAX: number;
|
|
6
|
-
export declare const JS_SAFE_INTEGER_MIN: number;
|
|
7
|
-
export declare class _NSNumber extends NobjcObject {
|
|
8
|
-
static numberWithInteger$(value: number): _NSNumber;
|
|
9
|
-
static numberWithUnsignedInteger$(value: number): _NSNumber;
|
|
10
|
-
static numberWithLong$(value: number): _NSNumber;
|
|
11
|
-
static numberWithUnsignedLong$(value: number): _NSNumber;
|
|
12
|
-
integerValue(): number;
|
|
13
|
-
unsignedIntegerValue(): number;
|
|
14
|
-
longValue(): number;
|
|
15
|
-
unsignedLongValue(): number;
|
|
16
|
-
intValue(): number;
|
|
17
|
-
longLongValue(): number;
|
|
18
|
-
unsignedLongLongValue(): number;
|
|
19
|
-
doubleValue(): number;
|
|
20
|
-
boolValue(): boolean;
|
|
21
|
-
compare$(other: _NSNumber): number;
|
|
22
|
-
isEqualToNumber$(other: _NSNumber): boolean;
|
|
23
|
-
stringValue(): NobjcObject;
|
|
24
|
-
descriptionWithLocale$(locale: NobjcObject | null): NobjcObject;
|
|
25
|
-
}
|
|
26
|
-
export declare const NSNumber: typeof _NSNumber;
|
|
27
|
-
export declare function NSNumberFromInteger(value: number): _NSNumber;
|
|
28
|
-
export declare function NSNumberFromUnsignedInteger(value: number): _NSNumber;
|
|
29
|
-
export declare function integerFromNSNumber(number: NobjcObject): number;
|
|
30
|
-
export declare function unsignedIntegerFromNSNumber(number: NobjcObject): number;
|
|
31
|
-
export declare function NSNumberFromBigInt(value: bigint): _NSNumber;
|
|
32
|
-
export declare function isValidNSInteger(value: number): boolean;
|
|
33
|
-
export declare function isValidNSUInteger(value: number): boolean;
|
|
34
|
-
export declare function isSafeInteger(value: number): boolean;
|
|
35
|
-
export declare function safeNSInteger(value: number, defaultValue?: number): _NSNumber;
|
|
36
|
-
export declare function safeNSUInteger(value: number, defaultValue?: number): _NSNumber;
|
|
37
|
-
export declare function clampToNSInteger(value: number): number;
|
|
38
|
-
export declare function clampToNSUInteger(value: number): number;
|
|
39
|
-
export declare function compareNSNumbers(num1: NobjcObject, num2: NobjcObject): number;
|
|
40
|
-
export declare function NSNumbersAreEqual(num1: NobjcObject, num2: NobjcObject): boolean;
|
|
41
|
-
export declare function NSNumberArrayFromNumbers(values: number[], unsigned?: boolean): _NSNumber[];
|
|
42
|
-
export declare function numbersFromNSNumberArray(numbers: NobjcObject[], unsigned?: boolean): number[];
|
|
43
|
-
export declare function stringFromNSNumber(number: NobjcObject): string;
|
|
44
|
-
export declare function formatNSInteger(value: number): string;
|
|
45
|
-
export declare function NSIntegerToHex(value: number, prefix?: boolean): string;
|
|
46
|
-
export declare function NSIntegerFromHex(hexString: string): number;
|
|
47
|
-
export declare function absNSInteger(value: number): _NSNumber;
|
|
48
|
-
export declare function minNSInteger(a: number, b: number): _NSNumber;
|
|
49
|
-
export declare function maxNSInteger(a: number, b: number): _NSNumber;
|
|
50
|
-
export declare function isNSNumber(value: any): value is _NSNumber;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Foundation } from "./index.js";
|
|
2
|
-
export const NSIntegerMax = 9223372036854775807n;
|
|
3
|
-
export const NSIntegerMin = -9223372036854775808n;
|
|
4
|
-
export const NSUIntegerMax = 18446744073709551615n;
|
|
5
|
-
export const JS_SAFE_INTEGER_MAX = Number.MAX_SAFE_INTEGER;
|
|
6
|
-
export const JS_SAFE_INTEGER_MIN = Number.MIN_SAFE_INTEGER;
|
|
7
|
-
export const NSNumber = Foundation.NSNumber;
|
|
8
|
-
export function NSNumberFromInteger(value) {
|
|
9
|
-
return NSNumber.numberWithInteger$(value);
|
|
10
|
-
}
|
|
11
|
-
export function NSNumberFromUnsignedInteger(value) {
|
|
12
|
-
return NSNumber.numberWithUnsignedInteger$(value);
|
|
13
|
-
}
|
|
14
|
-
export function integerFromNSNumber(number) {
|
|
15
|
-
const nsNumber = number;
|
|
16
|
-
return nsNumber.integerValue();
|
|
17
|
-
}
|
|
18
|
-
export function unsignedIntegerFromNSNumber(number) {
|
|
19
|
-
const nsNumber = number;
|
|
20
|
-
return nsNumber.unsignedIntegerValue();
|
|
21
|
-
}
|
|
22
|
-
export function NSNumberFromBigInt(value) {
|
|
23
|
-
if (value >= BigInt(JS_SAFE_INTEGER_MIN) && value <= BigInt(JS_SAFE_INTEGER_MAX)) {
|
|
24
|
-
return NSNumber.numberWithInteger$(Number(value));
|
|
25
|
-
}
|
|
26
|
-
return NSNumber.numberWithLong$(Number(value));
|
|
27
|
-
}
|
|
28
|
-
export function isValidNSInteger(value) {
|
|
29
|
-
return Number.isInteger(value) &&
|
|
30
|
-
value >= Number(NSIntegerMin) &&
|
|
31
|
-
value <= Number(NSIntegerMax);
|
|
32
|
-
}
|
|
33
|
-
export function isValidNSUInteger(value) {
|
|
34
|
-
return Number.isInteger(value) &&
|
|
35
|
-
value >= 0 &&
|
|
36
|
-
value <= Number(NSUIntegerMax);
|
|
37
|
-
}
|
|
38
|
-
export function isSafeInteger(value) {
|
|
39
|
-
return Number.isSafeInteger(value);
|
|
40
|
-
}
|
|
41
|
-
export function safeNSInteger(value, defaultValue) {
|
|
42
|
-
if (!isValidNSInteger(value)) {
|
|
43
|
-
if (defaultValue !== undefined) {
|
|
44
|
-
return NSNumber.numberWithInteger$(defaultValue);
|
|
45
|
-
}
|
|
46
|
-
throw new RangeError(`Value ${value} is out of NSInteger range [${NSIntegerMin}, ${NSIntegerMax}]`);
|
|
47
|
-
}
|
|
48
|
-
return NSNumber.numberWithInteger$(value);
|
|
49
|
-
}
|
|
50
|
-
export function safeNSUInteger(value, defaultValue) {
|
|
51
|
-
if (!isValidNSUInteger(value)) {
|
|
52
|
-
if (defaultValue !== undefined) {
|
|
53
|
-
return NSNumber.numberWithUnsignedInteger$(defaultValue);
|
|
54
|
-
}
|
|
55
|
-
throw new RangeError(`Value ${value} is out of NSUInteger range [0, ${NSUIntegerMax}]`);
|
|
56
|
-
}
|
|
57
|
-
return NSNumber.numberWithUnsignedInteger$(value);
|
|
58
|
-
}
|
|
59
|
-
export function clampToNSInteger(value) {
|
|
60
|
-
const min = Number(NSIntegerMin);
|
|
61
|
-
const max = Number(NSIntegerMax);
|
|
62
|
-
return Math.max(min, Math.min(max, Math.floor(value)));
|
|
63
|
-
}
|
|
64
|
-
export function clampToNSUInteger(value) {
|
|
65
|
-
const max = Number(NSUIntegerMax);
|
|
66
|
-
return Math.max(0, Math.min(max, Math.floor(value)));
|
|
67
|
-
}
|
|
68
|
-
export function compareNSNumbers(num1, num2) {
|
|
69
|
-
const nsNum1 = num1;
|
|
70
|
-
return nsNum1.compare$(num2);
|
|
71
|
-
}
|
|
72
|
-
export function NSNumbersAreEqual(num1, num2) {
|
|
73
|
-
const nsNum1 = num1;
|
|
74
|
-
return nsNum1.isEqualToNumber$(num2);
|
|
75
|
-
}
|
|
76
|
-
export function NSNumberArrayFromNumbers(values, unsigned = false) {
|
|
77
|
-
return values.map(value => unsigned
|
|
78
|
-
? NSNumber.numberWithUnsignedInteger$(value)
|
|
79
|
-
: NSNumber.numberWithInteger$(value));
|
|
80
|
-
}
|
|
81
|
-
export function numbersFromNSNumberArray(numbers, unsigned = false) {
|
|
82
|
-
return numbers.map(num => {
|
|
83
|
-
const nsNum = num;
|
|
84
|
-
return unsigned ? nsNum.unsignedIntegerValue() : nsNum.integerValue();
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
export function stringFromNSNumber(number) {
|
|
88
|
-
const nsNumber = number;
|
|
89
|
-
const nsString = nsNumber.stringValue();
|
|
90
|
-
return nsString.UTF8String();
|
|
91
|
-
}
|
|
92
|
-
export function formatNSInteger(value) {
|
|
93
|
-
return value.toLocaleString('en-US', {
|
|
94
|
-
maximumFractionDigits: 0,
|
|
95
|
-
useGrouping: true
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
export function NSIntegerToHex(value, prefix = true) {
|
|
99
|
-
const hex = Math.abs(value).toString(16).toUpperCase();
|
|
100
|
-
const sign = value < 0 ? '-' : '';
|
|
101
|
-
return `${sign}${prefix ? '0x' : ''}${hex}`;
|
|
102
|
-
}
|
|
103
|
-
export function NSIntegerFromHex(hexString) {
|
|
104
|
-
const cleaned = hexString.replace(/^0x/i, '');
|
|
105
|
-
return parseInt(cleaned, 16);
|
|
106
|
-
}
|
|
107
|
-
export function absNSInteger(value) {
|
|
108
|
-
return NSNumber.numberWithInteger$(Math.abs(value));
|
|
109
|
-
}
|
|
110
|
-
export function minNSInteger(a, b) {
|
|
111
|
-
return NSNumber.numberWithInteger$(Math.min(a, b));
|
|
112
|
-
}
|
|
113
|
-
export function maxNSInteger(a, b) {
|
|
114
|
-
return NSNumber.numberWithInteger$(Math.max(a, b));
|
|
115
|
-
}
|
|
116
|
-
export function isNSNumber(value) {
|
|
117
|
-
try {
|
|
118
|
-
return value && typeof value === 'object' &&
|
|
119
|
-
typeof value.integerValue === 'function';
|
|
120
|
-
}
|
|
121
|
-
catch {
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { NobjcObject } from "objc-js";
|
|
2
|
-
export declare class _NSString extends NobjcObject {
|
|
3
|
-
static stringWithUTF8String$(str: string): _NSString;
|
|
4
|
-
UTF8String(): string;
|
|
5
|
-
length(): number;
|
|
6
|
-
toString(): string;
|
|
7
|
-
}
|
|
8
|
-
export declare const NSString: typeof _NSString;
|
|
9
|
-
export declare function NSStringFromString(str: string): _NSString;
|
package/dist/objc/helpers.d.ts
DELETED