electron-webauthn 0.0.9 → 0.0.10
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/helpers.d.ts +20 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +24 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +10 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -13
- package/dist/index.js.map +1 -1
- package/dist/objc/authentication-services/as-authorization-controller-delegate.d.ts +2 -1
- package/dist/objc/authentication-services/as-authorization-controller-delegate.d.ts.map +1 -1
- package/dist/objc/authentication-services/as-authorization-controller-delegate.js.map +1 -1
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.d.ts +18 -0
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.d.ts.map +1 -0
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.js +3 -0
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.js.map +1 -0
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.d.ts +39 -0
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.d.ts.map +1 -0
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.js +13 -0
- package/dist/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.js.map +1 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.d.ts +9 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.d.ts.map +1 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.js +3 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.js.map +1 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.d.ts +9 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.d.ts.map +1 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.js +3 -0
- package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.js.map +1 -0
- package/dist/objc/authentication-services/as-authorization.d.ts +42 -0
- package/dist/objc/authentication-services/as-authorization.d.ts.map +1 -0
- package/dist/objc/authentication-services/as-authorization.js +3 -0
- package/dist/objc/authentication-services/as-authorization.js.map +1 -0
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.d.ts +8 -0
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.d.ts.map +1 -0
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.js +9 -0
- package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.js.map +1 -0
- package/dist/objc/helpers.d.ts +0 -13
- package/dist/objc/helpers.d.ts.map +1 -1
- package/dist/objc/helpers.js +0 -21
- package/dist/objc/helpers.js.map +1 -1
- package/package.json +2 -2
- package/dist/test/example.d.ts +0 -2
- package/dist/test/example.d.ts.map +0 -1
- package/dist/test/example.js +0 -24
- package/dist/test/example.js.map +0 -1
- package/dist/test/index.d.ts +0 -2
- package/dist/test/index.d.ts.map +0 -1
- package/dist/test/index.js +0 -9
- package/dist/test/index.js.map +0 -1
- package/dist/test/window.d.ts +0 -5
- package/dist/test/window.d.ts.map +0 -1
- package/dist/test/window.js +0 -58
- package/dist/test/window.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a Promise along with its resolve and reject callbacks.
|
|
3
|
+
* This is a polyfill for the native Promise.withResolvers() method.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of value the promise resolves to
|
|
6
|
+
* @returns An object containing the promise and its associated resolve and reject functions
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const { promise, resolve, reject } = PromiseWithResolvers<string>();
|
|
11
|
+
* promise.then(value => console.log(value)); // "Hello"
|
|
12
|
+
* resolve("Hello");
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function PromiseWithResolvers<T = void>(): {
|
|
16
|
+
promise: Promise<T>;
|
|
17
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
18
|
+
reject: (reason?: unknown) => void;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,IAAI,KAAK;IAChD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAQA"}
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a Promise along with its resolve and reject callbacks.
|
|
3
|
+
* This is a polyfill for the native Promise.withResolvers() method.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of value the promise resolves to
|
|
6
|
+
* @returns An object containing the promise and its associated resolve and reject functions
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const { promise, resolve, reject } = PromiseWithResolvers<string>();
|
|
11
|
+
* promise.then(value => console.log(value)); // "Hello"
|
|
12
|
+
* resolve("Hello");
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export function PromiseWithResolvers() {
|
|
16
|
+
let resolve;
|
|
17
|
+
let reject;
|
|
18
|
+
const promise = new Promise((res, rej) => {
|
|
19
|
+
resolve = res;
|
|
20
|
+
reject = rej;
|
|
21
|
+
});
|
|
22
|
+
return { promise, resolve: resolve, reject: reject };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB;IAKlC,IAAI,OAA4C,CAAC;IACjD,IAAI,MAAkC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAQ,EAAE,MAAM,EAAE,MAAO,EAAE,CAAC;AACzD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
presentationContextProvider(): import("objc-js").NobjcObject;
|
|
12
|
-
};
|
|
1
|
+
type AuthenticatorAttachment = "platform" | "cross-platform";
|
|
2
|
+
export interface GetCredentialResult {
|
|
3
|
+
id: Buffer;
|
|
4
|
+
authenticatorAttachment: AuthenticatorAttachment;
|
|
5
|
+
clientDataJSON: Buffer;
|
|
6
|
+
authenticatorData: Buffer;
|
|
7
|
+
signature: Buffer;
|
|
8
|
+
userHandle: Buffer;
|
|
9
|
+
}
|
|
10
|
+
declare function getCredential(rpid: string, challenge: Buffer, nativeWindowHandle: Buffer, allowedCredentialIds: Buffer[]): Promise<GetCredentialResult>;
|
|
13
11
|
export { getCredential };
|
|
14
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,KAAK,uBAAuB,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,aAAa,CACpB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,MAAM,EAC1B,oBAAoB,EAAE,MAAM,EAAE,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CAwF9B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { fromPointer
|
|
1
|
+
import { fromPointer } from "objc-js";
|
|
2
2
|
import { createAuthorizationControllerDelegate } from "./objc/authentication-services/as-authorization-controller-delegate.js";
|
|
3
3
|
import { createAuthorizationController } from "./objc/authentication-services/as-authorization-controller.js";
|
|
4
4
|
import { createPresentationContextProvider } from "./objc/authentication-services/as-authorization-controller-presentation-context-providing.js";
|
|
5
5
|
import { createPlatformPublicKeyCredentialProvider } from "./objc/authentication-services/as-authorization-platform-public-key-credential-provider.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { createPlatformPublicKeyCredentialDescriptor } from "./objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.js";
|
|
7
|
+
import { NSArray, NSArrayFromObjects } from "./objc/foundation/nsarray.js";
|
|
8
|
+
import { bufferFromNSDataDirect, NSDataFromBuffer, } from "./objc/foundation/nsdata.js";
|
|
8
9
|
import { NSStringFromString } from "./objc/foundation/nsstring.js";
|
|
9
|
-
|
|
10
|
+
import { PromiseWithResolvers } from "./helpers.js";
|
|
11
|
+
import { ASAuthorizationPublicKeyCredentialAttachment } from "./objc/authentication-services/enums/as-authorization-public-key-credential-attachment.js";
|
|
12
|
+
function getCredential(rpid, challenge, nativeWindowHandle, allowedCredentialIds) {
|
|
13
|
+
const { promise, resolve, reject } = PromiseWithResolvers();
|
|
14
|
+
// Create NS objects
|
|
10
15
|
const NS_rpID = NSStringFromString(rpid);
|
|
11
16
|
// let challenge: Data // Obtain this from the server.
|
|
12
17
|
const NS_challenge = NSDataFromBuffer(challenge);
|
|
@@ -17,34 +22,55 @@ function getCredential(rpid, challenge, nativeWindowHandle) {
|
|
|
17
22
|
// let authController = ASAuthorizationController(authorizationRequests: [platformKeyRequest])
|
|
18
23
|
const requestsArray = NSArray.arrayWithObject$(platformKeyRequest);
|
|
19
24
|
const authController = createAuthorizationController(requestsArray);
|
|
25
|
+
// Set allowed credentials if provided
|
|
26
|
+
if (allowedCredentialIds.length > 0) {
|
|
27
|
+
const allowedCredentials = NSArrayFromObjects(allowedCredentialIds.map((id) => createPlatformPublicKeyCredentialDescriptor(NSDataFromBuffer(id))));
|
|
28
|
+
platformKeyRequest.setAllowedCredentials$(allowedCredentials);
|
|
29
|
+
}
|
|
20
30
|
// authController.delegate = self
|
|
21
31
|
const delegate = createAuthorizationControllerDelegate({
|
|
22
|
-
didCompleteWithAuthorization: (
|
|
23
|
-
|
|
32
|
+
didCompleteWithAuthorization: (_, authorization) => {
|
|
33
|
+
// Cast to _ASAuthorization to access typed methods
|
|
34
|
+
const credential = authorization.credential();
|
|
35
|
+
console.log("Authorization succeeded:", credential);
|
|
36
|
+
const id_data = credential.credentialID();
|
|
37
|
+
const id = bufferFromNSDataDirect(id_data);
|
|
38
|
+
let authenticatorAttachment = "platform";
|
|
39
|
+
if (credential.attachment() ===
|
|
40
|
+
ASAuthorizationPublicKeyCredentialAttachment.ASAuthorizationPublicKeyCredentialAttachmentCrossPlatform) {
|
|
41
|
+
authenticatorAttachment = "cross-platform";
|
|
42
|
+
}
|
|
43
|
+
resolve({
|
|
44
|
+
id,
|
|
45
|
+
authenticatorAttachment,
|
|
46
|
+
clientDataJSON: bufferFromNSDataDirect(credential.rawClientDataJSON()),
|
|
47
|
+
authenticatorData: bufferFromNSDataDirect(credential.rawAuthenticatorData()),
|
|
48
|
+
signature: bufferFromNSDataDirect(credential.signature()),
|
|
49
|
+
userHandle: bufferFromNSDataDirect(credential.userID()),
|
|
50
|
+
});
|
|
24
51
|
},
|
|
25
|
-
didCompleteWithError: (
|
|
52
|
+
didCompleteWithError: (_, error) => {
|
|
26
53
|
// Parse the NSError into a readable format
|
|
27
54
|
const parsedError = error;
|
|
28
|
-
|
|
55
|
+
const errorMessage = parsedError.localizedDescription().UTF8String();
|
|
56
|
+
console.error("Authorization failed:", errorMessage);
|
|
57
|
+
reject(new Error(errorMessage));
|
|
29
58
|
},
|
|
30
59
|
});
|
|
31
60
|
authController.setDelegate$(delegate);
|
|
32
61
|
// authController.presentationContextProvider = self
|
|
33
62
|
const presentationContextProvider = createPresentationContextProvider({
|
|
34
|
-
presentationAnchorForAuthorizationController: (
|
|
35
|
-
// return NSStringFromString("Hello, world!");
|
|
63
|
+
presentationAnchorForAuthorizationController: () => {
|
|
36
64
|
// Return the NSWindow to present the authorization UI in
|
|
37
65
|
const nsView = fromPointer(nativeWindowHandle);
|
|
38
|
-
console.log("nsView", nsView);
|
|
39
66
|
const nsWindow = nsView.window();
|
|
40
|
-
console.log("nsWindow", nsWindow);
|
|
41
67
|
return nsWindow;
|
|
42
68
|
},
|
|
43
69
|
});
|
|
44
70
|
authController.setPresentationContextProvider$(presentationContextProvider);
|
|
45
71
|
// authController.performRequests()
|
|
46
72
|
authController.performRequests();
|
|
47
|
-
return
|
|
73
|
+
return promise;
|
|
48
74
|
}
|
|
49
75
|
export { getCredential };
|
|
50
76
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":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,EAAE,CAAC;aACxD,CAAC,CAAC;QACL,CAAC;QACD,oBAAoB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;YACjC,2CAA2C;YAC3C,MAAM,WAAW,GAAG,KAA6C,CAAC;YAClE,MAAM,YAAY,GAAG,WAAW,CAAC,oBAAoB,EAAE,CAAC,UAAU,EAAE,CAAC;YACrE,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC;YACrD,MAAM,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,CAAC;KACF,CAAC,CAAC;IACH,cAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEtC,oDAAoD;IACpD,MAAM,2BAA2B,GAAG,iCAAiC,CAAC;QACpE,4CAA4C,EAAE,GAAG,EAAE;YACjD,yDAAyD;YACzD,MAAM,MAAM,GAAG,WAAW,CAAC,kBAAkB,CAAuB,CAAC;YACrE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACjC,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC,CAAC;IACH,cAAc,CAAC,+BAA+B,CAAC,2BAA2B,CAAC,CAAC;IAE5E,mCAAmC;IACnC,cAAc,CAAC,eAAe,EAAE,CAAC;IAEjC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NobjcObject } from "objc-js";
|
|
2
|
+
import type { _ASAuthorization } from "./as-authorization.js";
|
|
2
3
|
/**
|
|
3
4
|
* ASAuthorizationControllerDelegate Protocol
|
|
4
5
|
*
|
|
@@ -15,7 +16,7 @@ export interface ASAuthorizationControllerDelegateCallbacks {
|
|
|
15
16
|
* @param controller The authorization controller that completed.
|
|
16
17
|
* @param authorization The authorization object containing the credential.
|
|
17
18
|
*/
|
|
18
|
-
didCompleteWithAuthorization?: (controller: NobjcObject, authorization:
|
|
19
|
+
didCompleteWithAuthorization?: (controller: NobjcObject, authorization: _ASAuthorization) => void;
|
|
19
20
|
/**
|
|
20
21
|
* Tells the delegate that authorization failed with an error.
|
|
21
22
|
* @param controller The authorization controller that failed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"as-authorization-controller-delegate.d.ts","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-controller-delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"as-authorization-controller-delegate.d.ts","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-controller-delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;GASG;AAEH,MAAM,WAAW,0CAA0C;IACzD;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,CAC7B,UAAU,EAAE,WAAW,EACvB,aAAa,EAAE,gBAAgB,KAC5B,IAAI,CAAC;IAEV;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,qCAAqC,CACnD,SAAS,EAAE,0CAA0C,GACpD,WAAW,CAoBb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"as-authorization-controller-delegate.js","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-controller-delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"as-authorization-controller-delegate.js","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-controller-delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiCrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,qCAAqC,CACnD,SAAqD;IAErD,MAAM,qBAAqB,GAA4C,EAAE,CAAC;IAE1E,iEAAiE;IACjE,IAAI,SAAS,CAAC,4BAA4B,EAAE,CAAC;QAC3C,qBAAqB,CACnB,uDAAuD,CACxD,GAAG,SAAS,CAAC,4BAA4B,CAAC;IAC7C,CAAC;IAED,IAAI,SAAS,CAAC,oBAAoB,EAAE,CAAC;QACnC,qBAAqB,CAAC,+CAA+C,CAAC;YACpE,SAAS,CAAC,oBAAoB,CAAC;IACnC,CAAC;IAED,gDAAgD;IAChD,OAAO,aAAa,CAAC,SAAS,CAC5B,mCAAmC,EACnC,qBAAqB,CACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NobjcObject } from "objc-js";
|
|
2
|
+
import type { _ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput } from "./as-authorization-public-key-credential-large-blob-assertion.js";
|
|
3
|
+
import type { _ASAuthorizationPublicKeyCredentialPRFAssertionOutput } from "./as-authorization-public-key-credential-prf-assertion.js";
|
|
4
|
+
import type { _NSData } from "../foundation/nsdata.js";
|
|
5
|
+
import type { ASAuthorizationPublicKeyCredentialAttachment } from "./enums/as-authorization-public-key-credential-attachment.js";
|
|
6
|
+
declare class _ASAuthorizationPlatformPublicKeyCredentialAssertion extends NobjcObject {
|
|
7
|
+
attachment(): ASAuthorizationPublicKeyCredentialAttachment;
|
|
8
|
+
largeBlob(): _ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput;
|
|
9
|
+
prf(): _ASAuthorizationPublicKeyCredentialPRFAssertionOutput;
|
|
10
|
+
rawClientDataJSON(): _NSData;
|
|
11
|
+
credentialID(): _NSData;
|
|
12
|
+
rawAuthenticatorData(): _NSData;
|
|
13
|
+
userID(): _NSData;
|
|
14
|
+
signature(): _NSData;
|
|
15
|
+
}
|
|
16
|
+
export declare const ASAuthorizationPlatformPublicKeyCredentialAssertion: typeof _ASAuthorizationPlatformPublicKeyCredentialAssertion;
|
|
17
|
+
export type { _ASAuthorizationPlatformPublicKeyCredentialAssertion };
|
|
18
|
+
//# sourceMappingURL=as-authorization-platform-public-key-credential-assertion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-platform-public-key-credential-assertion.d.ts","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,2DAA2D,EAAE,MAAM,kEAAkE,CAAC;AACpJ,OAAO,KAAK,EAAE,qDAAqD,EAAE,MAAM,2DAA2D,CAAC;AACvI,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,8DAA8D,CAAC;AAEjI,OAAO,OAAO,oDAAqD,SAAQ,WAAW;IACpF,UAAU,IAAI,4CAA4C;IAE1D,SAAS,IAAI,2DAA2D;IAExE,GAAG,IAAI,qDAAqD;IAE5D,iBAAiB,IAAI,OAAO;IAE5B,YAAY,IAAI,OAAO;IAEvB,oBAAoB,IAAI,OAAO;IAE/B,MAAM,IAAI,OAAO;IAEjB,SAAS,IAAI,OAAO;CACrB;AAED,eAAO,MAAM,mDAAmD,EAC2B,OAAO,oDAAoD,CAAC;AAEvJ,YAAY,EAAE,oDAAoD,EAAE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AuthenticationServices } from "./index.js";
|
|
2
|
+
export const ASAuthorizationPlatformPublicKeyCredentialAssertion = AuthenticationServices.ASAuthorizationPlatformPublicKeyCredentialAssertion;
|
|
3
|
+
//# sourceMappingURL=as-authorization-platform-public-key-credential-assertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-platform-public-key-credential-assertion.js","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-platform-public-key-credential-assertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAyBpD,MAAM,CAAC,MAAM,mDAAmD,GAC9D,sBAAsB,CAAC,mDAA6H,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { NobjcObject } from "objc-js";
|
|
2
|
+
/**
|
|
3
|
+
* ASAuthorizationPlatformPublicKeyCredentialDescriptor
|
|
4
|
+
*
|
|
5
|
+
* A descriptor that identifies a public key credential.
|
|
6
|
+
* https://developer.apple.com/documentation/authenticationservices/asauthorizationplatformpublickeycredentialdescriptor?language=objc
|
|
7
|
+
*
|
|
8
|
+
* This class is used to specify which credentials are acceptable for authentication.
|
|
9
|
+
* It's typically used in assertion requests to indicate which credentials the relying
|
|
10
|
+
* party is willing to accept.
|
|
11
|
+
*/
|
|
12
|
+
declare class _ASAuthorizationPlatformPublicKeyCredentialDescriptor extends NobjcObject {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a credential descriptor with the specified credential identifier.
|
|
15
|
+
*
|
|
16
|
+
* @param credentialID The credential identifier as NSData
|
|
17
|
+
* @returns An initialized credential descriptor
|
|
18
|
+
* @private Do not use this method directly. Use the helper function instead.
|
|
19
|
+
*/
|
|
20
|
+
initWithCredentialID$(credentialID: NobjcObject): _ASAuthorizationPlatformPublicKeyCredentialDescriptor;
|
|
21
|
+
/**
|
|
22
|
+
* The credential identifier.
|
|
23
|
+
*
|
|
24
|
+
* This is the unique identifier for the credential, typically obtained
|
|
25
|
+
* during the registration process.
|
|
26
|
+
*
|
|
27
|
+
* @returns NSData containing the credential ID
|
|
28
|
+
*/
|
|
29
|
+
credentialID(): NobjcObject;
|
|
30
|
+
}
|
|
31
|
+
export declare const ASAuthorizationPlatformPublicKeyCredentialDescriptor: typeof _ASAuthorizationPlatformPublicKeyCredentialDescriptor;
|
|
32
|
+
export type { _ASAuthorizationPlatformPublicKeyCredentialDescriptor };
|
|
33
|
+
/**
|
|
34
|
+
* Create an ASAuthorizationPlatformPublicKeyCredentialDescriptor instance
|
|
35
|
+
* @param credentialID The credential identifier (NSData)
|
|
36
|
+
* @returns An initialized credential descriptor
|
|
37
|
+
*/
|
|
38
|
+
export declare function createPlatformPublicKeyCredentialDescriptor(credentialID: NobjcObject): _ASAuthorizationPlatformPublicKeyCredentialDescriptor;
|
|
39
|
+
//# sourceMappingURL=as-authorization-platform-public-key-credential-descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-platform-public-key-credential-descriptor.d.ts","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;GASG;AACH,OAAO,OAAO,qDAAsD,SAAQ,WAAW;IACrF;;;;;;OAMG;IACH,qBAAqB,CACnB,YAAY,EAAE,WAAW,GACxB,qDAAqD;IAExD;;;;;;;OAOG;IACH,YAAY,IAAI,WAAW;CAC5B;AAED,eAAO,MAAM,oDAAoD,EAC2B,OAAO,qDAAqD,CAAC;AAEzJ,YAAY,EAAE,qDAAqD,EAAE,CAAC;AAItE;;;;GAIG;AACH,wBAAgB,2CAA2C,CACzD,YAAY,EAAE,WAAW,GACxB,qDAAqD,CAKvD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuthenticationServices } from "./index.js";
|
|
2
|
+
export const ASAuthorizationPlatformPublicKeyCredentialDescriptor = AuthenticationServices.ASAuthorizationPlatformPublicKeyCredentialDescriptor;
|
|
3
|
+
// Helper Functions
|
|
4
|
+
/**
|
|
5
|
+
* Create an ASAuthorizationPlatformPublicKeyCredentialDescriptor instance
|
|
6
|
+
* @param credentialID The credential identifier (NSData)
|
|
7
|
+
* @returns An initialized credential descriptor
|
|
8
|
+
*/
|
|
9
|
+
export function createPlatformPublicKeyCredentialDescriptor(credentialID) {
|
|
10
|
+
const instance = ASAuthorizationPlatformPublicKeyCredentialDescriptor.alloc();
|
|
11
|
+
return instance.initWithCredentialID$(credentialID);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=as-authorization-platform-public-key-credential-descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-platform-public-key-credential-descriptor.js","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-platform-public-key-credential-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAoCpD,MAAM,CAAC,MAAM,oDAAoD,GAC/D,sBAAsB,CAAC,oDAA+H,CAAC;AAIzJ,mBAAmB;AAEnB;;;;GAIG;AACH,MAAM,UAAU,2CAA2C,CACzD,YAAyB;IAEzB,MAAM,QAAQ,GACZ,oDACD,CAAC,KAAK,EAAE,CAAC;IACV,OAAO,QAAQ,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NobjcObject } from "objc-js";
|
|
2
|
+
import type { _NSData } from "../foundation/nsdata.js";
|
|
3
|
+
declare class _ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput extends NobjcObject {
|
|
4
|
+
readData(): _NSData;
|
|
5
|
+
didWrite(): boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput: typeof _ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput;
|
|
8
|
+
export type { _ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput };
|
|
9
|
+
//# sourceMappingURL=as-authorization-public-key-credential-large-blob-assertion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-public-key-credential-large-blob-assertion.d.ts","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,OAAO,2DAA4D,SAAQ,WAAW;IAC3F,QAAQ,IAAI,OAAO;IAEnB,QAAQ,IAAI,OAAO;CACpB;AAED,eAAO,MAAM,0DAA0D,EAC2B,OAAO,2DAA2D,CAAC;AAErK,YAAY,EAAE,2DAA2D,EAAE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AuthenticationServices } from "./index.js";
|
|
2
|
+
export const ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput = AuthenticationServices.ASAuthorizationPublicKeyCredentialLargeBlobAssertionOutput;
|
|
3
|
+
//# sourceMappingURL=as-authorization-public-key-credential-large-blob-assertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-public-key-credential-large-blob-assertion.js","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-public-key-credential-large-blob-assertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAUpD,MAAM,CAAC,MAAM,0DAA0D,GACrE,sBAAsB,CAAC,0DAA2I,CAAC"}
|
package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NobjcObject } from "objc-js";
|
|
2
|
+
import type { _NSData } from "../foundation/nsdata.js";
|
|
3
|
+
declare class _ASAuthorizationPublicKeyCredentialPRFAssertionOutput extends NobjcObject {
|
|
4
|
+
first(): _NSData;
|
|
5
|
+
second(): _NSData;
|
|
6
|
+
}
|
|
7
|
+
export declare const ASAuthorizationPublicKeyCredentialPRFAssertionOutput: typeof _ASAuthorizationPublicKeyCredentialPRFAssertionOutput;
|
|
8
|
+
export type { _ASAuthorizationPublicKeyCredentialPRFAssertionOutput };
|
|
9
|
+
//# sourceMappingURL=as-authorization-public-key-credential-prf-assertion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-public-key-credential-prf-assertion.d.ts","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,OAAO,qDAAsD,SAAQ,WAAW;IACrF,KAAK,IAAI,OAAO;IAEhB,MAAM,IAAI,OAAO;CAClB;AAED,eAAO,MAAM,oDAAoD,EAC2B,OAAO,qDAAqD,CAAC;AAEzJ,YAAY,EAAE,qDAAqD,EAAE,CAAC"}
|
package/dist/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AuthenticationServices } from "./index.js";
|
|
2
|
+
export const ASAuthorizationPublicKeyCredentialPRFAssertionOutput = AuthenticationServices.ASAuthorizationPublicKeyCredentialPRFAssertionOutput;
|
|
3
|
+
//# sourceMappingURL=as-authorization-public-key-credential-prf-assertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-public-key-credential-prf-assertion.js","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization-public-key-credential-prf-assertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAUpD,MAAM,CAAC,MAAM,oDAAoD,GAC/D,sBAAsB,CAAC,oDAA+H,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { NobjcObject } from "objc-js";
|
|
2
|
+
/**
|
|
3
|
+
* ASAuthorization
|
|
4
|
+
*
|
|
5
|
+
* An authorization that a user grants to your app.
|
|
6
|
+
* https://developer.apple.com/documentation/authenticationservices/asauthorization?language=objc
|
|
7
|
+
*
|
|
8
|
+
* This class represents the result of a successful authorization request.
|
|
9
|
+
* It contains the credential that was authorized and the provider that created it.
|
|
10
|
+
*/
|
|
11
|
+
declare class _ASAuthorization extends NobjcObject {
|
|
12
|
+
/**
|
|
13
|
+
* The credential that the user authorized.
|
|
14
|
+
*
|
|
15
|
+
* The type of credential depends on the authorization request:
|
|
16
|
+
* - ASAuthorizationPlatformPublicKeyCredentialAssertion for platform credential assertions
|
|
17
|
+
* - ASAuthorizationPlatformPublicKeyCredentialRegistration for platform credential registrations
|
|
18
|
+
* - ASAuthorizationSecurityKeyPublicKeyCredentialAssertion for security key assertions
|
|
19
|
+
* - ASAuthorizationSecurityKeyPublicKeyCredentialRegistration for security key registrations
|
|
20
|
+
* - ASAuthorizationAppleIDCredential for Sign in with Apple
|
|
21
|
+
* - ASAuthorizationPasswordCredential for password credentials
|
|
22
|
+
* - ASAuthorizationSingleSignOnCredential for single sign-on
|
|
23
|
+
*
|
|
24
|
+
* @returns The credential object
|
|
25
|
+
*/
|
|
26
|
+
credential(): NobjcObject;
|
|
27
|
+
/**
|
|
28
|
+
* The authorization provider that created the credential.
|
|
29
|
+
*
|
|
30
|
+
* This is typically one of:
|
|
31
|
+
* - ASAuthorizationPlatformPublicKeyCredentialProvider
|
|
32
|
+
* - ASAuthorizationSecurityKeyPublicKeyCredentialProvider
|
|
33
|
+
* - ASAuthorizationAppleIDProvider
|
|
34
|
+
* - ASAuthorizationPasswordProvider
|
|
35
|
+
*
|
|
36
|
+
* @returns The provider object
|
|
37
|
+
*/
|
|
38
|
+
provider(): NobjcObject;
|
|
39
|
+
}
|
|
40
|
+
export declare const ASAuthorization: typeof _ASAuthorization;
|
|
41
|
+
export type { _ASAuthorization };
|
|
42
|
+
//# sourceMappingURL=as-authorization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization.d.ts","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;GAQG;AACH,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IAChD;;;;;;;;;;;;;OAaG;IACH,UAAU,IAAI,WAAW;IAEzB;;;;;;;;;;OAUG;IACH,QAAQ,IAAI,WAAW;CACxB;AAED,eAAO,MAAM,eAAe,EAC2B,OAAO,gBAAgB,CAAC;AAE/E,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization.js","sourceRoot":"","sources":["../../../src/objc/authentication-services/as-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA2CpD,MAAM,CAAC,MAAM,eAAe,GAC1B,sBAAsB,CAAC,eAAqD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ASAuthorizationPublicKeyCredentialAttachment
|
|
3
|
+
*/
|
|
4
|
+
export declare const enum ASAuthorizationPublicKeyCredentialAttachment {
|
|
5
|
+
ASAuthorizationPublicKeyCredentialAttachmentPlatform = 0,
|
|
6
|
+
ASAuthorizationPublicKeyCredentialAttachmentCrossPlatform = 1
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=as-authorization-public-key-credential-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-public-key-credential-attachment.d.ts","sourceRoot":"","sources":["../../../../src/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,0BAAkB,4CAA4C;IAC5D,oDAAoD,IAAI;IACxD,yDAAyD,IAAI;CAC9D"}
|
package/dist/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ASAuthorizationPublicKeyCredentialAttachment
|
|
3
|
+
*/
|
|
4
|
+
export var ASAuthorizationPublicKeyCredentialAttachment;
|
|
5
|
+
(function (ASAuthorizationPublicKeyCredentialAttachment) {
|
|
6
|
+
ASAuthorizationPublicKeyCredentialAttachment[ASAuthorizationPublicKeyCredentialAttachment["ASAuthorizationPublicKeyCredentialAttachmentPlatform"] = 0] = "ASAuthorizationPublicKeyCredentialAttachmentPlatform";
|
|
7
|
+
ASAuthorizationPublicKeyCredentialAttachment[ASAuthorizationPublicKeyCredentialAttachment["ASAuthorizationPublicKeyCredentialAttachmentCrossPlatform"] = 1] = "ASAuthorizationPublicKeyCredentialAttachmentCrossPlatform";
|
|
8
|
+
})(ASAuthorizationPublicKeyCredentialAttachment || (ASAuthorizationPublicKeyCredentialAttachment = {}));
|
|
9
|
+
//# sourceMappingURL=as-authorization-public-key-credential-attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-authorization-public-key-credential-attachment.js","sourceRoot":"","sources":["../../../../src/objc/authentication-services/enums/as-authorization-public-key-credential-attachment.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAkB,4CAGjB;AAHD,WAAkB,4CAA4C;IAC5D,+MAAwD,CAAA;IACxD,yNAA6D,CAAA;AAC/D,CAAC,EAHiB,4CAA4C,KAA5C,4CAA4C,QAG7D"}
|
package/dist/objc/helpers.d.ts
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import type { NobjcObject } from "objc-js";
|
|
2
|
-
export declare class NobjcInstanceWrapper {
|
|
3
|
-
private _instance;
|
|
4
|
-
constructor(instance: NobjcObject);
|
|
5
|
-
get instance(): NobjcObject;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Helper to allocate and initialize an Objective-C object with a single argument initializer
|
|
9
|
-
* @param cls The Objective-C class
|
|
10
|
-
* @param initMethod The initializer method name (e.g., "initWithRelyingPartyIdentifier:")
|
|
11
|
-
* @param arg The argument to pass to the initializer
|
|
12
|
-
* @returns The initialized instance
|
|
13
|
-
*/
|
|
14
|
-
export declare function allocInit(cls: NobjcObject, initMethod: string, arg: NobjcObject): NobjcObject;
|
|
15
2
|
/**
|
|
16
3
|
* Helper to allocate and initialize an Objective-C object with no arguments
|
|
17
4
|
* @param cls The Objective-C class
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/objc/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/objc/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,CAI5D"}
|
package/dist/objc/helpers.js
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
export class NobjcInstanceWrapper {
|
|
2
|
-
_instance;
|
|
3
|
-
constructor(instance) {
|
|
4
|
-
this._instance = instance;
|
|
5
|
-
}
|
|
6
|
-
get instance() {
|
|
7
|
-
return this._instance;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Helper to allocate and initialize an Objective-C object with a single argument initializer
|
|
12
|
-
* @param cls The Objective-C class
|
|
13
|
-
* @param initMethod The initializer method name (e.g., "initWithRelyingPartyIdentifier:")
|
|
14
|
-
* @param arg The argument to pass to the initializer
|
|
15
|
-
* @returns The initialized instance
|
|
16
|
-
*/
|
|
17
|
-
export function allocInit(cls, initMethod, arg) {
|
|
18
|
-
const instance = cls["alloc"]();
|
|
19
|
-
const initializer = instance[initMethod];
|
|
20
|
-
return initializer(arg);
|
|
21
|
-
}
|
|
22
1
|
/**
|
|
23
2
|
* Helper to allocate and initialize an Objective-C object with no arguments
|
|
24
3
|
* @param cls The Objective-C class
|
package/dist/objc/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/objc/helpers.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/objc/helpers.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAgB;IAC7C,MAAM,QAAQ,GAAI,GAAG,CAAC,OAAO,CAAkC,EAAE,CAAC;IAClE,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAiC,CAAC;IACrE,OAAO,WAAW,EAAE,CAAC;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-webauthn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"repository": "https://github.com/iamEvanYT/electron-webauthn",
|
|
5
5
|
"description": "Add support for WebAuthn for Electron.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"typescript": "^5"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"objc-js": "^0.0.
|
|
31
|
+
"objc-js": "^0.0.13"
|
|
32
32
|
},
|
|
33
33
|
"trustedDependencies": [
|
|
34
34
|
"objc-js"
|
package/dist/test/example.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../src/test/example.ts"],"names":[],"mappings":""}
|
package/dist/test/example.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NSData } from "../objc/foundation/nsdata.js";
|
|
2
|
-
import { NSString } from "../objc/foundation/nsstring.js";
|
|
3
|
-
import { NSArray } from "../objc/foundation/nsarray.js";
|
|
4
|
-
const myString = NSString.stringWithUTF8String$("Hello from Objective-C!");
|
|
5
|
-
console.log("Created NSString:", myString);
|
|
6
|
-
const buf = Buffer.from("Hello from Objective-C!");
|
|
7
|
-
const myData = NSData.dataWithBytes$length$(buf, buf.length);
|
|
8
|
-
console.log("Created NSData:", myData);
|
|
9
|
-
// Test NSArray
|
|
10
|
-
const str1 = NSString.stringWithUTF8String$("First");
|
|
11
|
-
const str2 = NSString.stringWithUTF8String$("Second");
|
|
12
|
-
const str3 = NSString.stringWithUTF8String$("Third");
|
|
13
|
-
// Create array with one object, then add more
|
|
14
|
-
let myArray = NSArray.arrayWithObject$(str1);
|
|
15
|
-
myArray = myArray.arrayByAddingObject$(str2);
|
|
16
|
-
myArray = myArray.arrayByAddingObject$(str3);
|
|
17
|
-
console.log("Created NSArray with count:", myArray.count());
|
|
18
|
-
// Access elements
|
|
19
|
-
for (let i = 0; i < myArray.count(); i++) {
|
|
20
|
-
const obj = myArray.objectAtIndex$(i);
|
|
21
|
-
const nsString = obj;
|
|
22
|
-
console.log(`Array[${i}]:`, nsString.UTF8String());
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=example.js.map
|
package/dist/test/example.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/test/example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,QAAQ,GAAG,QAAQ,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,CAAC;AAC3E,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;AAE3C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;AACnD,MAAM,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;AAC7D,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAEvC,eAAe;AACf,MAAM,IAAI,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AACtD,MAAM,IAAI,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAErD,8CAA8C;AAC9C,IAAI,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAC7C,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;AAC7C,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;AAE7C,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AAE5D,kBAAkB;AAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAQ,CAAC;IAC7C,MAAM,QAAQ,GAAG,GAAkB,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
package/dist/test/index.d.ts
DELETED
package/dist/test/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":""}
|
package/dist/test/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { getPointer } from "objc-js";
|
|
2
|
-
import { createEmptyWindow, getNativeWindowHandle } from "./window.js";
|
|
3
|
-
import { getCredential } from "../index.js";
|
|
4
|
-
const window = createEmptyWindow();
|
|
5
|
-
const nsView = getNativeWindowHandle(window);
|
|
6
|
-
const nsViewPointer = getPointer(nsView);
|
|
7
|
-
const result = getCredential("example.com", Buffer.from("challenge"), nsViewPointer);
|
|
8
|
-
console.log("Result:", result);
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/test/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;AACnC,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,MAAM,GAAG,aAAa,CAC1B,aAAa,EACb,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EACxB,aAAa,CACd,CAAC;AACF,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC"}
|
package/dist/test/window.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/test/window.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAWxE,iBAAS,iBAAiB,IAAI,WAAW,CAmDxC;AAED,iBAAS,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAG/D;AAED,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/test/window.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { NobjcLibrary, NobjcProtocol } from "objc-js";
|
|
2
|
-
import { allocInitPlain } from "../objc/helpers.js";
|
|
3
|
-
import { NSStringFromString } from "../objc/foundation/nsstring.js";
|
|
4
|
-
const AppKit = new NobjcLibrary("/System/Library/Frameworks/AppKit.framework/AppKit");
|
|
5
|
-
const Foundation = new NobjcLibrary("/System/Library/Frameworks/Foundation.framework/Foundation");
|
|
6
|
-
function createEmptyWindow() {
|
|
7
|
-
const NSApp = AppKit.NSApplication.sharedApplication();
|
|
8
|
-
const window = allocInitPlain(AppKit.NSWindow);
|
|
9
|
-
const styleMask = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3); // titled, closable, miniaturizable, resizable
|
|
10
|
-
// Make the app active and show the window.
|
|
11
|
-
window.setStyleMask$(styleMask);
|
|
12
|
-
window.setFrameFromString$(NSStringFromString("{{100, 100}, {800, 600}}"));
|
|
13
|
-
NSApp.setActivationPolicy$(0);
|
|
14
|
-
NSApp.finishLaunching();
|
|
15
|
-
NSApp.activateIgnoringOtherApps$(true);
|
|
16
|
-
window.setIsVisible$(true);
|
|
17
|
-
window.makeKeyWindow();
|
|
18
|
-
window.orderFrontRegardless();
|
|
19
|
-
const delegate = NobjcProtocol.implement("NSWindowDelegate", {
|
|
20
|
-
windowShouldClose$: () => {
|
|
21
|
-
NSApp.terminate$(NSApp);
|
|
22
|
-
return true;
|
|
23
|
-
},
|
|
24
|
-
windowWillClose$: () => {
|
|
25
|
-
NSApp.terminate$(NSApp);
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
window.setDelegate$(delegate);
|
|
29
|
-
const shutdown = () => {
|
|
30
|
-
try {
|
|
31
|
-
window.close();
|
|
32
|
-
}
|
|
33
|
-
finally {
|
|
34
|
-
NSApp.stop$(NSApp);
|
|
35
|
-
NSApp.terminate$(NSApp);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const handleSignal = () => shutdown();
|
|
39
|
-
process.once("exit", shutdown);
|
|
40
|
-
process.once("SIGINT", handleSignal);
|
|
41
|
-
process.once("SIGTERM", handleSignal);
|
|
42
|
-
process.once("SIGQUIT", handleSignal);
|
|
43
|
-
// Pump the AppKit run loop for a short tick to keep JS responsive.
|
|
44
|
-
const runLoop = Foundation.NSRunLoop.currentRunLoop();
|
|
45
|
-
const pump = () => {
|
|
46
|
-
const untilDate = Foundation.NSDate.dateWithTimeIntervalSinceNow$(0.01);
|
|
47
|
-
runLoop.runUntilDate$(untilDate);
|
|
48
|
-
};
|
|
49
|
-
const pumpId = setInterval(pump, 10);
|
|
50
|
-
process.once("exit", () => clearInterval(pumpId));
|
|
51
|
-
return window;
|
|
52
|
-
}
|
|
53
|
-
function getNativeWindowHandle(window) {
|
|
54
|
-
// Electron expects an NSView* on macOS; contentView returns that NSView.
|
|
55
|
-
return window.contentView();
|
|
56
|
-
}
|
|
57
|
-
export { createEmptyWindow, getNativeWindowHandle };
|
|
58
|
-
//# sourceMappingURL=window.js.map
|
package/dist/test/window.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"window.js","sourceRoot":"","sources":["../../src/test/window.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAoB,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7B,oDAAoD,CACrD,CAAC;AACF,MAAM,UAAU,GAAG,IAAI,YAAY,CACjC,4DAA4D,CAC7D,CAAC;AAEF,SAAS,iBAAiB;IACxB,MAAM,KAAK,GAAG,MAAM,CAAC,aAAc,CAAC,iBAAiB,EAAG,CAAC;IACzD,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,QA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