@turnkey/http 2.3.1 → 2.4.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/CHANGELOG.md +12 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.js +9 -7
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.js.map +1 -1
- package/dist/{esm/__generated__/services/coordinator/public/v1/public_api.client.js → __generated__/services/coordinator/public/v1/public_api.client.mjs} +7 -3
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.mjs.map +1 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js +201 -201
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +1 -1
- package/dist/{esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js → __generated__/services/coordinator/public/v1/public_api.fetcher.mjs} +103 -100
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.mjs.map +1 -0
- package/dist/async.js +16 -15
- package/dist/async.js.map +1 -1
- package/dist/{esm/async.js → async.mjs} +9 -6
- package/dist/async.mjs.map +1 -0
- package/dist/base.js +27 -23
- package/dist/base.js.map +1 -1
- package/dist/{esm/base.js → base.mjs} +13 -11
- package/dist/base.mjs.map +1 -0
- package/dist/config.js +8 -8
- package/dist/config.js.map +1 -1
- package/dist/{esm/config.js → config.mjs} +7 -5
- package/dist/config.mjs.map +1 -0
- package/dist/encoding.js +5 -9
- package/dist/encoding.js.map +1 -1
- package/dist/{esm/encoding.js → encoding.mjs} +5 -6
- package/dist/encoding.mjs.map +1 -0
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -0
- package/dist/index.mjs.map +1 -0
- package/dist/shared.js +4 -8
- package/dist/shared.js.map +1 -1
- package/dist/{esm/shared.js → shared.mjs} +4 -5
- package/dist/shared.mjs.map +1 -0
- package/dist/universal.js +6 -7
- package/dist/universal.js.map +1 -1
- package/dist/{esm/universal.js → universal.mjs} +2 -1
- package/dist/universal.mjs.map +1 -0
- package/dist/webauthn-json/api.js +11 -28
- package/dist/webauthn-json/api.js.map +1 -1
- package/dist/webauthn-json/api.mjs +13 -0
- package/dist/webauthn-json/api.mjs.map +1 -0
- package/dist/webauthn-json/base64url.js +4 -19
- package/dist/webauthn-json/base64url.js.map +1 -1
- package/dist/webauthn-json/base64url.mjs +20 -0
- package/dist/webauthn-json/base64url.mjs.map +1 -0
- package/dist/webauthn-json/convert.js +13 -11
- package/dist/webauthn-json/convert.js.map +1 -1
- package/dist/{esm/webauthn-json/convert.js → webauthn-json/convert.mjs} +9 -7
- package/dist/webauthn-json/convert.mjs.map +1 -0
- package/dist/webauthn-json/index.js +9 -10
- package/dist/webauthn-json/index.js.map +1 -1
- package/dist/webauthn-json/index.mjs +15 -0
- package/dist/webauthn-json/index.mjs.map +1 -0
- package/dist/webauthn-json/schema.js +32 -78
- package/dist/webauthn-json/schema.js.map +1 -1
- package/dist/webauthn-json/schema.mjs +37 -0
- package/dist/webauthn-json/schema.mjs.map +1 -0
- package/dist/webauthn.js +11 -10
- package/dist/webauthn.js.map +1 -1
- package/dist/{esm/webauthn.js → webauthn.mjs} +10 -7
- package/dist/webauthn.mjs.map +1 -0
- package/package.json +7 -8
- package/dist/__generated__/barrel.js +0 -29
- package/dist/__generated__/barrel.js.map +0 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.swagger.json +0 -5975
- package/dist/__generated__/services/coordinator/public/v1/public_api.types.js +0 -7
- package/dist/__generated__/services/coordinator/public/v1/public_api.types.js.map +0 -1
- package/dist/esm/__generated__/barrel.js +0 -4
- package/dist/esm/__generated__/barrel.js.map +0 -1
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.client.js.map +0 -1
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +0 -1
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.swagger.json +0 -5975
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js +0 -6
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js.map +0 -1
- package/dist/esm/async.js.map +0 -1
- package/dist/esm/base.js.map +0 -1
- package/dist/esm/config.js.map +0 -1
- package/dist/esm/encoding.js.map +0 -1
- package/dist/esm/index.js +0 -15
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/shared.js.map +0 -1
- package/dist/esm/universal.js.map +0 -1
- package/dist/esm/webauthn-json/api.js +0 -24
- package/dist/esm/webauthn-json/api.js.map +0 -1
- package/dist/esm/webauthn-json/base64url.js +0 -32
- package/dist/esm/webauthn-json/base64url.js.map +0 -1
- package/dist/esm/webauthn-json/convert.js.map +0 -1
- package/dist/esm/webauthn-json/index.js +0 -13
- package/dist/esm/webauthn-json/index.js.map +0 -1
- package/dist/esm/webauthn-json/json.js +0 -2
- package/dist/esm/webauthn-json/json.js.map +0 -1
- package/dist/esm/webauthn-json/schema-format.js +0 -2
- package/dist/esm/webauthn-json/schema-format.js.map +0 -1
- package/dist/esm/webauthn-json/schema.js +0 -83
- package/dist/esm/webauthn-json/schema.js.map +0 -1
- package/dist/esm/webauthn.js.map +0 -1
- package/dist/webauthn-json/json.js +0 -3
- package/dist/webauthn-json/json.js.map +0 -1
- package/dist/webauthn-json/schema-format.js +0 -3
- package/dist/webauthn-json/schema-format.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var base_1 = require("./base");
|
|
12
|
-
Object.defineProperty(exports, "TurnkeyRequestError", { enumerable: true, get: function () { return base_1.TurnkeyRequestError; } });
|
|
13
|
-
var shared_1 = require("./shared");
|
|
14
|
-
Object.defineProperty(exports, "TurnkeyActivityError", { enumerable: true, get: function () { return shared_1.TurnkeyActivityError; } });
|
|
15
|
-
var webauthn_1 = require("./webauthn");
|
|
16
|
-
Object.defineProperty(exports, "getWebAuthnAttestation", { enumerable: true, get: function () { return webauthn_1.getWebAuthnAttestation; } });
|
|
17
|
-
var async_1 = require("./async");
|
|
18
|
-
Object.defineProperty(exports, "withAsyncPolling", { enumerable: true, get: function () { return async_1.withAsyncPolling; } });
|
|
19
|
-
Object.defineProperty(exports, "createActivityPoller", { enumerable: true, get: function () { return async_1.createActivityPoller; } });
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var public_api_fetcher = require('./__generated__/services/coordinator/public/v1/public_api.fetcher.js');
|
|
4
|
+
var public_api_client = require('./__generated__/services/coordinator/public/v1/public_api.client.js');
|
|
5
|
+
var config = require('./config.js');
|
|
6
|
+
var base = require('./base.js');
|
|
7
|
+
var shared = require('./shared.js');
|
|
8
|
+
var webauthn = require('./webauthn.js');
|
|
9
|
+
var async = require('./async.js');
|
|
10
|
+
|
|
20
11
|
/**
|
|
21
12
|
* @deprecated use `TurnkeyApi` instead
|
|
22
13
|
*/
|
|
23
|
-
const PublicApiService =
|
|
14
|
+
const PublicApiService = public_api_fetcher;
|
|
15
|
+
|
|
16
|
+
exports.TurnkeyApi = public_api_fetcher;
|
|
17
|
+
exports.TurnkeyClient = public_api_client.TurnkeyClient;
|
|
18
|
+
exports.browserInit = config.browserInit;
|
|
19
|
+
exports.init = config.init;
|
|
20
|
+
exports.TurnkeyRequestError = base.TurnkeyRequestError;
|
|
21
|
+
exports.sealAndStampRequestBody = base.sealAndStampRequestBody;
|
|
22
|
+
exports.TurnkeyActivityError = shared.TurnkeyActivityError;
|
|
23
|
+
exports.getWebAuthnAttestation = webauthn.getWebAuthnAttestation;
|
|
24
|
+
exports.createActivityPoller = async.createActivityPoller;
|
|
25
|
+
exports.withAsyncPolling = async.withAsyncPolling;
|
|
24
26
|
exports.PublicApiService = PublicApiService;
|
|
25
|
-
|
|
26
|
-
Object.defineProperty(exports, "sealAndStampRequestBody", { enumerable: true, get: function () { return base_2.sealAndStampRequestBody; } });
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":["TurnkeyApi"],"mappings":";;;;;;;;;;AAcA;;AAEG;AACG,MAAA,gBAAgB,GAAGA;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as public_api_fetcher from './__generated__/services/coordinator/public/v1/public_api.fetcher.mjs';
|
|
2
|
+
export { TurnkeyClient } from './__generated__/services/coordinator/public/v1/public_api.client.mjs';
|
|
3
|
+
export { browserInit, init } from './config.mjs';
|
|
4
|
+
export { TurnkeyRequestError, sealAndStampRequestBody } from './base.mjs';
|
|
5
|
+
export { TurnkeyActivityError } from './shared.mjs';
|
|
6
|
+
export { getWebAuthnAttestation } from './webauthn.mjs';
|
|
7
|
+
export { createActivityPoller, withAsyncPolling } from './async.mjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use `TurnkeyApi` instead
|
|
11
|
+
*/
|
|
12
|
+
const PublicApiService = public_api_fetcher;
|
|
13
|
+
|
|
14
|
+
export { PublicApiService, public_api_fetcher as TurnkeyApi };
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":["TurnkeyApi"],"mappings":";;;;;;;;AAcA;;AAEG;AACG,MAAA,gBAAgB,GAAGA;;;;"}
|
package/dist/shared.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.stableStringify = exports.TurnkeyActivityError = void 0;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
4
3
|
class TurnkeyActivityError extends Error {
|
|
5
4
|
constructor(input) {
|
|
6
5
|
const { message, cause, activityId, activityStatus, activityType } = input;
|
|
@@ -12,9 +11,6 @@ class TurnkeyActivityError extends Error {
|
|
|
12
11
|
this.cause = cause ?? null;
|
|
13
12
|
}
|
|
14
13
|
}
|
|
14
|
+
|
|
15
15
|
exports.TurnkeyActivityError = TurnkeyActivityError;
|
|
16
|
-
|
|
17
|
-
return JSON.stringify(input);
|
|
18
|
-
}
|
|
19
|
-
exports.stableStringify = stableStringify;
|
|
20
|
-
//# sourceMappingURL=shared.js.map
|
|
16
|
+
//# sourceMappingURL=shared.js.map
|
package/dist/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","
|
|
1
|
+
{"version":3,"file":"shared.js","sources":["../src/shared.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAQM,MAAO,oBAAqB,SAAQ,KAAK,CAAA;AAM7C,IAAA,WAAA,CAAY,KAMX,EAAA;AACC,QAAA,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;QAC3E,KAAK,CAAC,OAAO,CAAC,CAAC;AAEf,QAAA,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;AACnC,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,IAAI,IAAI,CAAC;AACrC,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,IAAI,CAAC;AAC7C,QAAA,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;AACzC,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC;KAC5B;AACF;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
class TurnkeyActivityError extends Error {
|
|
2
2
|
constructor(input) {
|
|
3
3
|
const { message, cause, activityId, activityStatus, activityType } = input;
|
|
4
4
|
super(message);
|
|
@@ -9,7 +9,6 @@ export class TurnkeyActivityError extends Error {
|
|
|
9
9
|
this.cause = cause ?? null;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=shared.js.map
|
|
12
|
+
|
|
13
|
+
export { TurnkeyActivityError };
|
|
14
|
+
//# sourceMappingURL=shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.mjs","sources":["../src/shared.ts"],"sourcesContent":[null],"names":[],"mappings":"AAQM,MAAO,oBAAqB,SAAQ,KAAK,CAAA;AAM7C,IAAA,WAAA,CAAY,KAMX,EAAA;AACC,QAAA,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;QAC3E,KAAK,CAAC,OAAO,CAAC,CAAC;AAEf,QAAA,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;AACnC,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,IAAI,IAAI,CAAC;AACrC,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,IAAI,CAAC;AAC7C,QAAA,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;AACzC,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC;KAC5B;AACF;;;;"}
|
package/dist/universal.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.fetch = void 0;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
4
3
|
/// <reference lib="dom" />
|
|
5
|
-
|
|
4
|
+
exports.fetch = void 0;
|
|
6
5
|
if (typeof globalThis?.fetch !== "undefined") {
|
|
7
|
-
exports.fetch =
|
|
6
|
+
exports.fetch = globalThis.fetch;
|
|
8
7
|
}
|
|
9
8
|
else {
|
|
10
|
-
exports.fetch =
|
|
9
|
+
exports.fetch = require("cross-fetch");
|
|
11
10
|
}
|
|
12
|
-
//# sourceMappingURL=universal.js.map
|
|
11
|
+
//# sourceMappingURL=universal.js.map
|
package/dist/universal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal.js","
|
|
1
|
+
{"version":3,"file":"universal.js","sources":["../src/universal.ts"],"sourcesContent":[null],"names":["fetch"],"mappings":";;AAAA;AACIA,uBAA+B;AAEnC,IAAI,OAAO,UAAU,EAAE,KAAK,KAAK,WAAW,EAAE;AAC5C,IAAAA,aAAK,GAAG,UAAU,CAAC,KAAK,CAAC;AAC1B,CAAA;AAAM,KAAA;AACL,IAAAA,aAAK,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAChC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universal.mjs","sources":["../src/universal.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,IAAI,MAA+B;AAEnC,IAAI,OAAO,UAAU,EAAE,KAAK,KAAK,WAAW,EAAE;AAC5C,IAAA,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;AAC1B,CAAA;AAAM,KAAA;AACL,IAAA,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAChC;;;;"}
|
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function createRequestFromJSON(requestJSON) {
|
|
8
|
-
return (0, convert_1.convert)(base64url_1.base64urlToBuffer, schema_1.credentialCreationOptions, requestJSON);
|
|
9
|
-
}
|
|
10
|
-
exports.createRequestFromJSON = createRequestFromJSON;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var base64url = require('./base64url.js');
|
|
4
|
+
var convert = require('./convert.js');
|
|
5
|
+
var schema = require('./schema.js');
|
|
6
|
+
|
|
11
7
|
function createResponseToJSON(credential) {
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
exports.createResponseToJSON = createResponseToJSON;
|
|
15
|
-
async function create(requestJSON) {
|
|
16
|
-
const credential = (await navigator.credentials.create(createRequestFromJSON(requestJSON)));
|
|
17
|
-
return createResponseToJSON(credential);
|
|
8
|
+
return convert.convert(base64url.bufferToBase64url, schema.publicKeyCredentialWithAttestation, credential);
|
|
18
9
|
}
|
|
19
|
-
exports.create = create;
|
|
20
|
-
function getRequestFromJSON(requestJSON) {
|
|
21
|
-
return (0, convert_1.convert)(base64url_1.base64urlToBuffer, schema_1.credentialRequestOptions, requestJSON);
|
|
22
|
-
}
|
|
23
|
-
exports.getRequestFromJSON = getRequestFromJSON;
|
|
24
10
|
function getResponseToJSON(credential) {
|
|
25
|
-
return
|
|
11
|
+
return convert.convert(base64url.bufferToBase64url, schema.publicKeyCredentialWithAssertion, credential);
|
|
26
12
|
}
|
|
13
|
+
|
|
14
|
+
exports.createResponseToJSON = createResponseToJSON;
|
|
27
15
|
exports.getResponseToJSON = getResponseToJSON;
|
|
28
|
-
|
|
29
|
-
const credential = (await navigator.credentials.get(getRequestFromJSON(requestJSON)));
|
|
30
|
-
return getResponseToJSON(credential);
|
|
31
|
-
}
|
|
32
|
-
exports.get = get;
|
|
33
|
-
//# sourceMappingURL=api.js.map
|
|
16
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../../src/webauthn-json/api.ts"],"sourcesContent":[null],"names":["convert","bufferToBase64url","publicKeyCredentialWithAttestation","publicKeyCredentialWithAssertion"],"mappings":";;;;;;AAqBM,SAAU,oBAAoB,CAClC,UAA+B,EAAA;IAE/B,OAAOA,eAAO,CACZC,2BAAiB,EACjBC,yCAAkC,EAClC,UAAU,CACX,CAAC;AACJ,CAAC;AAiBK,SAAU,iBAAiB,CAC/B,UAA+B,EAAA;IAE/B,OAAOF,eAAO,CACZC,2BAAiB,EACjBE,uCAAgC,EAChC,UAAU,CACX,CAAC;AACJ;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { bufferToBase64url } from './base64url.mjs';
|
|
2
|
+
import { convert } from './convert.mjs';
|
|
3
|
+
import { publicKeyCredentialWithAttestation, publicKeyCredentialWithAssertion } from './schema.mjs';
|
|
4
|
+
|
|
5
|
+
function createResponseToJSON(credential) {
|
|
6
|
+
return convert(bufferToBase64url, publicKeyCredentialWithAttestation, credential);
|
|
7
|
+
}
|
|
8
|
+
function getResponseToJSON(credential) {
|
|
9
|
+
return convert(bufferToBase64url, publicKeyCredentialWithAssertion, credential);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { createResponseToJSON, getResponseToJSON };
|
|
13
|
+
//# sourceMappingURL=api.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.mjs","sources":["../../src/webauthn-json/api.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAqBM,SAAU,oBAAoB,CAClC,UAA+B,EAAA;IAE/B,OAAO,OAAO,CACZ,iBAAiB,EACjB,kCAAkC,EAClC,UAAU,CACX,CAAC;AACJ,CAAC;AAiBK,SAAU,iBAAiB,CAC/B,UAA+B,EAAA;IAE/B,OAAO,OAAO,CACZ,iBAAiB,EACjB,gCAAgC,EAChC,UAAU,CACX,CAAC;AACJ;;;;"}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.bufferToBase64url = exports.base64urlToBuffer = void 0;
|
|
4
|
-
function base64urlToBuffer(baseurl64String) {
|
|
5
|
-
// Base64url to Base64
|
|
6
|
-
const padding = "==".slice(0, (4 - (baseurl64String.length % 4)) % 4);
|
|
7
|
-
const base64String = baseurl64String.replace(/-/g, "+").replace(/_/g, "/") + padding;
|
|
8
|
-
// Base64 to binary string
|
|
9
|
-
const str = atob(base64String);
|
|
10
|
-
// Binary string to buffer
|
|
11
|
-
const buffer = new ArrayBuffer(str.length);
|
|
12
|
-
const byteView = new Uint8Array(buffer);
|
|
13
|
-
for (let i = 0; i < str.length; i++) {
|
|
14
|
-
byteView[i] = str.charCodeAt(i);
|
|
15
|
-
}
|
|
16
|
-
return buffer;
|
|
17
|
-
}
|
|
18
|
-
exports.base64urlToBuffer = base64urlToBuffer;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
19
3
|
function bufferToBase64url(buffer) {
|
|
20
4
|
// Buffer to binary string
|
|
21
5
|
const byteView = new Uint8Array(buffer);
|
|
@@ -33,5 +17,6 @@ function bufferToBase64url(buffer) {
|
|
|
33
17
|
.replace(/=/g, "");
|
|
34
18
|
return base64urlString;
|
|
35
19
|
}
|
|
20
|
+
|
|
36
21
|
exports.bufferToBase64url = bufferToBase64url;
|
|
37
|
-
//# sourceMappingURL=base64url.js.map
|
|
22
|
+
//# sourceMappingURL=base64url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base64url.js","
|
|
1
|
+
{"version":3,"file":"base64url.js","sources":["../../src/webauthn-json/base64url.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAsBM,SAAU,iBAAiB,CAAC,MAAmB,EAAA;;AAEnD,IAAA,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,GAAG,GAAG,EAAE,CAAC;AACb,IAAA,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE;AAC/B,QAAA,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AACtC,KAAA;;AAGD,IAAA,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;;;IAI/B,MAAM,eAAe,GAAG,YAAY;AACjC,SAAA,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AACnB,SAAA,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AACnB,SAAA,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACrB,IAAA,OAAO,eAAe,CAAC;AACzB;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function bufferToBase64url(buffer) {
|
|
2
|
+
// Buffer to binary string
|
|
3
|
+
const byteView = new Uint8Array(buffer);
|
|
4
|
+
let str = "";
|
|
5
|
+
for (const charCode of byteView) {
|
|
6
|
+
str += String.fromCharCode(charCode);
|
|
7
|
+
}
|
|
8
|
+
// Binary string to base64
|
|
9
|
+
const base64String = btoa(str);
|
|
10
|
+
// Base64 to base64url
|
|
11
|
+
// We assume that the base64url string is well-formed.
|
|
12
|
+
const base64urlString = base64String
|
|
13
|
+
.replace(/\+/g, "-")
|
|
14
|
+
.replace(/\//g, "_")
|
|
15
|
+
.replace(/=/g, "");
|
|
16
|
+
return base64urlString;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { bufferToBase64url };
|
|
20
|
+
//# sourceMappingURL=base64url.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64url.mjs","sources":["../../src/webauthn-json/base64url.ts"],"sourcesContent":[null],"names":[],"mappings":"AAsBM,SAAU,iBAAiB,CAAC,MAAmB,EAAA;;AAEnD,IAAA,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,GAAG,GAAG,EAAE,CAAC;AACb,IAAA,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE;AAC/B,QAAA,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AACtC,KAAA;;AAGD,IAAA,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;;;IAI/B,MAAM,eAAe,GAAG,YAAY;AACjC,SAAA,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AACnB,SAAA,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AACnB,SAAA,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACrB,IAAA,OAAO,eAAe,CAAC;AACzB;;;;"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
2
3
|
// We export these values in order so that they can be used to deduplicate
|
|
3
4
|
// schema definitions in minified JS code.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.optional = exports.required = exports.derived = exports.convert = exports.convertValue = exports.copyValue = void 0;
|
|
6
5
|
// TODO: Parcel isn't deduplicating these values.
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const copyValue = "copy";
|
|
7
|
+
const convertValue = "convert";
|
|
9
8
|
function convert(conversionFn, schema, input) {
|
|
10
|
-
if (schema ===
|
|
9
|
+
if (schema === copyValue) {
|
|
11
10
|
return input;
|
|
12
11
|
}
|
|
13
|
-
if (schema ===
|
|
12
|
+
if (schema === convertValue) {
|
|
14
13
|
return conversionFn(input);
|
|
15
14
|
}
|
|
16
15
|
if (schema instanceof Array) {
|
|
@@ -43,7 +42,6 @@ function convert(conversionFn, schema, input) {
|
|
|
43
42
|
return output;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
exports.convert = convert;
|
|
47
45
|
function derived(schema, derive) {
|
|
48
46
|
return {
|
|
49
47
|
required: true,
|
|
@@ -51,19 +49,23 @@ function derived(schema, derive) {
|
|
|
51
49
|
derive,
|
|
52
50
|
};
|
|
53
51
|
}
|
|
54
|
-
exports.derived = derived;
|
|
55
52
|
function required(schema) {
|
|
56
53
|
return {
|
|
57
54
|
required: true,
|
|
58
55
|
schema,
|
|
59
56
|
};
|
|
60
57
|
}
|
|
61
|
-
exports.required = required;
|
|
62
58
|
function optional(schema) {
|
|
63
59
|
return {
|
|
64
60
|
required: false,
|
|
65
61
|
schema,
|
|
66
62
|
};
|
|
67
63
|
}
|
|
64
|
+
|
|
65
|
+
exports.convert = convert;
|
|
66
|
+
exports.convertValue = convertValue;
|
|
67
|
+
exports.copyValue = copyValue;
|
|
68
|
+
exports.derived = derived;
|
|
68
69
|
exports.optional = optional;
|
|
69
|
-
|
|
70
|
+
exports.required = required;
|
|
71
|
+
//# sourceMappingURL=convert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.js","
|
|
1
|
+
{"version":3,"file":"convert.js","sources":["../../src/webauthn-json/convert.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;AAIA;AACO,MAAM,SAAS,GAAG,OAAO;AACzB,MAAM,YAAY,GAAG,UAAU;SAEtB,OAAO,CACrB,YAA6B,EAC7B,MAAc,EACd,KAAU,EAAA;IAEV,IAAI,MAAM,KAAK,SAAS,EAAE;AACxB,QAAA,OAAO,KAAK,CAAC;AACd,KAAA;IACD,IAAI,MAAM,KAAK,YAAY,EAAE;AAC3B,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC5B,KAAA;IACD,IAAI,MAAM,YAAY,KAAK,EAAE;QAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAM,KAAK,OAAO,CAAW,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7E,KAAA;IACD,IAAI,MAAM,YAAY,MAAM,EAAE;QAC5B,MAAM,MAAM,GAAQ,EAAE,CAAC;AACvB,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACvD,IAAI,WAAW,CAAC,MAAM,EAAE;gBACtB,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACpC,IAAI,CAAC,KAAK,SAAS,EAAE;AACnB,oBAAA,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChB,iBAAA;AACF,aAAA;AAED,YAAA,IAAI,EAAE,GAAG,IAAI,KAAK,CAAC,EAAE;gBACnB,IAAI,WAAW,CAAC,QAAQ,EAAE;AACxB,oBAAA,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAA,CAAE,CAAC,CAAC;AACxC,iBAAA;gBACD,SAAS;AACV,aAAA;;;;AAID,YAAA,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;AACtB,gBAAA,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBACnB,SAAS;AACV,aAAA;AACD,YAAA,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CACnB,YAAY,EACZ,WAAW,CAAC,MAAM,EAClB,KAAK,CAAC,GAAG,CAAC,CACX,CAAC;AACH,SAAA;AACD,QAAA,OAAO,MAAM,CAAC;AACf,KAAA;AACH,CAAC;AAEe,SAAA,OAAO,CACrB,MAAc,EACd,MAAuB,EAAA;IAEvB,OAAO;AACL,QAAA,QAAQ,EAAE,IAAI;QACd,MAAM;QACN,MAAM;KACP,CAAC;AACJ,CAAC;AAEK,SAAU,QAAQ,CAAC,MAAc,EAAA;IACrC,OAAO;AACL,QAAA,QAAQ,EAAE,IAAI;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AAEK,SAAU,QAAQ,CAAC,MAAc,EAAA;IACrC,OAAO;AACL,QAAA,QAAQ,EAAE,KAAK;QACf,MAAM;KACP,CAAC;AACJ;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// We export these values in order so that they can be used to deduplicate
|
|
2
2
|
// schema definitions in minified JS code.
|
|
3
3
|
// TODO: Parcel isn't deduplicating these values.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const copyValue = "copy";
|
|
5
|
+
const convertValue = "convert";
|
|
6
|
+
function convert(conversionFn, schema, input) {
|
|
7
7
|
if (schema === copyValue) {
|
|
8
8
|
return input;
|
|
9
9
|
}
|
|
@@ -40,23 +40,25 @@ export function convert(conversionFn, schema, input) {
|
|
|
40
40
|
return output;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
function derived(schema, derive) {
|
|
44
44
|
return {
|
|
45
45
|
required: true,
|
|
46
46
|
schema,
|
|
47
47
|
derive,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
function required(schema) {
|
|
51
51
|
return {
|
|
52
52
|
required: true,
|
|
53
53
|
schema,
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
function optional(schema) {
|
|
57
57
|
return {
|
|
58
58
|
required: false,
|
|
59
59
|
schema,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
|
|
63
|
+
export { convert, convertValue, copyValue, derived, optional, required };
|
|
64
|
+
//# sourceMappingURL=convert.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.mjs","sources":["../../src/webauthn-json/convert.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AAIA;AACO,MAAM,SAAS,GAAG,OAAO;AACzB,MAAM,YAAY,GAAG,UAAU;SAEtB,OAAO,CACrB,YAA6B,EAC7B,MAAc,EACd,KAAU,EAAA;IAEV,IAAI,MAAM,KAAK,SAAS,EAAE;AACxB,QAAA,OAAO,KAAK,CAAC;AACd,KAAA;IACD,IAAI,MAAM,KAAK,YAAY,EAAE;AAC3B,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC5B,KAAA;IACD,IAAI,MAAM,YAAY,KAAK,EAAE;QAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAM,KAAK,OAAO,CAAW,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7E,KAAA;IACD,IAAI,MAAM,YAAY,MAAM,EAAE;QAC5B,MAAM,MAAM,GAAQ,EAAE,CAAC;AACvB,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACvD,IAAI,WAAW,CAAC,MAAM,EAAE;gBACtB,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACpC,IAAI,CAAC,KAAK,SAAS,EAAE;AACnB,oBAAA,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChB,iBAAA;AACF,aAAA;AAED,YAAA,IAAI,EAAE,GAAG,IAAI,KAAK,CAAC,EAAE;gBACnB,IAAI,WAAW,CAAC,QAAQ,EAAE;AACxB,oBAAA,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAA,CAAE,CAAC,CAAC;AACxC,iBAAA;gBACD,SAAS;AACV,aAAA;;;;AAID,YAAA,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;AACtB,gBAAA,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBACnB,SAAS;AACV,aAAA;AACD,YAAA,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CACnB,YAAY,EACZ,WAAW,CAAC,MAAM,EAClB,KAAK,CAAC,GAAG,CAAC,CACX,CAAC;AACH,SAAA;AACD,QAAA,OAAO,MAAM,CAAC;AACf,KAAA;AACH,CAAC;AAEe,SAAA,OAAO,CACrB,MAAc,EACd,MAAuB,EAAA;IAEvB,OAAO;AACL,QAAA,QAAQ,EAAE,IAAI;QACd,MAAM;QACN,MAAM;KACP,CAAC;AACJ,CAAC;AAEK,SAAU,QAAQ,CAAC,MAAc,EAAA;IACrC,OAAO;AACL,QAAA,QAAQ,EAAE,IAAI;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AAEK,SAAU,QAAQ,CAAC,MAAc,EAAA;IACrC,OAAO;AACL,QAAA,QAAQ,EAAE,KAAK;QACf,MAAM;KACP,CAAC;AACJ;;;;"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "parseCreationOptionsFromJSON", { enumerable: true, get: function () { return api_1.createRequestFromJSON; } });
|
|
6
|
-
Object.defineProperty(exports, "parseRequestOptionsFromJSON", { enumerable: true, get: function () { return api_1.getRequestFromJSON; } });
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var api = require('./api.js');
|
|
4
|
+
|
|
7
5
|
async function create(options) {
|
|
8
6
|
const response = (await navigator.credentials.create(options));
|
|
9
|
-
response.toJSON = () =>
|
|
7
|
+
response.toJSON = () => api.createResponseToJSON(response);
|
|
10
8
|
return response;
|
|
11
9
|
}
|
|
12
|
-
exports.create = create;
|
|
13
10
|
async function get(options) {
|
|
14
11
|
const response = (await navigator.credentials.get(options));
|
|
15
|
-
response.toJSON = () =>
|
|
12
|
+
response.toJSON = () => api.getResponseToJSON(response);
|
|
16
13
|
return response;
|
|
17
14
|
}
|
|
15
|
+
|
|
16
|
+
exports.create = create;
|
|
18
17
|
exports.get = get;
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/webauthn-json/index.ts"],"sourcesContent":[null],"names":["createResponseToJSON","getResponseToJSON"],"mappings":";;;;AA+BO,eAAe,MAAM,CAC1B,OAAkC,EAAA;AAElC,IAAA,MAAM,QAAQ,IAAI,MAAM,SAAS,CAAC,WAAW,CAAC,MAAM,CAClD,OAAO,CACR,CAAoC,CAAC;IACtC,QAAQ,CAAC,MAAM,GAAG,MAAMA,wBAAoB,CAAC,QAAQ,CAAC,CAAC;AACvD,IAAA,OAAO,QAAQ,CAAC;AAClB,CAAC;AAMM,eAAe,GAAG,CACvB,OAAiC,EAAA;AAEjC,IAAA,MAAM,QAAQ,IAAI,MAAM,SAAS,CAAC,WAAW,CAAC,GAAG,CAC/C,OAAO,CACR,CAAsC,CAAC;IACxC,QAAQ,CAAC,MAAM,GAAG,MAAMC,qBAAiB,CAAC,QAAQ,CAAC,CAAC;AACpD,IAAA,OAAO,QAAQ,CAAC;AAClB;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createResponseToJSON, getResponseToJSON } from './api.mjs';
|
|
2
|
+
|
|
3
|
+
async function create(options) {
|
|
4
|
+
const response = (await navigator.credentials.create(options));
|
|
5
|
+
response.toJSON = () => createResponseToJSON(response);
|
|
6
|
+
return response;
|
|
7
|
+
}
|
|
8
|
+
async function get(options) {
|
|
9
|
+
const response = (await navigator.credentials.get(options));
|
|
10
|
+
response.toJSON = () => getResponseToJSON(response);
|
|
11
|
+
return response;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { create, get };
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/webauthn-json/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA+BO,eAAe,MAAM,CAC1B,OAAkC,EAAA;AAElC,IAAA,MAAM,QAAQ,IAAI,MAAM,SAAS,CAAC,WAAW,CAAC,MAAM,CAClD,OAAO,CACR,CAAoC,CAAC;IACtC,QAAQ,CAAC,MAAM,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACvD,IAAA,OAAO,QAAQ,CAAC;AAClB,CAAC;AAMM,eAAe,GAAG,CACvB,OAAiC,EAAA;AAEjC,IAAA,MAAM,QAAQ,IAAI,MAAM,SAAS,CAAC,WAAW,CAAC,GAAG,CAC/C,OAAO,CACR,CAAsC,CAAC;IACxC,QAAQ,CAAC,MAAM,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACpD,IAAA,OAAO,QAAQ,CAAC;AAClB;;;;"}
|
|
@@ -1,86 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Shared by `create()` and `get()`.
|
|
6
|
-
const publicKeyCredentialDescriptorSchema = {
|
|
7
|
-
type: (0, convert_1.required)(convert_1.copyValue),
|
|
8
|
-
id: (0, convert_1.required)(convert_1.convertValue),
|
|
9
|
-
transports: (0, convert_1.optional)(convert_1.copyValue),
|
|
10
|
-
};
|
|
11
|
-
const simplifiedExtensionsSchema = {
|
|
12
|
-
appid: (0, convert_1.optional)(convert_1.copyValue),
|
|
13
|
-
appidExclude: (0, convert_1.optional)(convert_1.copyValue),
|
|
14
|
-
credProps: (0, convert_1.optional)(convert_1.copyValue),
|
|
15
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var convert = require('./convert.js');
|
|
4
|
+
|
|
16
5
|
const simplifiedClientExtensionResultsSchema = {
|
|
17
|
-
appid:
|
|
18
|
-
appidExclude:
|
|
19
|
-
credProps:
|
|
20
|
-
};
|
|
21
|
-
// `navigator.create()` request
|
|
22
|
-
exports.credentialCreationOptions = {
|
|
23
|
-
publicKey: (0, convert_1.required)({
|
|
24
|
-
rp: (0, convert_1.required)(convert_1.copyValue),
|
|
25
|
-
user: (0, convert_1.required)({
|
|
26
|
-
id: (0, convert_1.required)(convert_1.convertValue),
|
|
27
|
-
name: (0, convert_1.required)(convert_1.copyValue),
|
|
28
|
-
displayName: (0, convert_1.required)(convert_1.copyValue),
|
|
29
|
-
}),
|
|
30
|
-
challenge: (0, convert_1.required)(convert_1.convertValue),
|
|
31
|
-
pubKeyCredParams: (0, convert_1.required)(convert_1.copyValue),
|
|
32
|
-
timeout: (0, convert_1.optional)(convert_1.copyValue),
|
|
33
|
-
excludeCredentials: (0, convert_1.optional)([publicKeyCredentialDescriptorSchema]),
|
|
34
|
-
authenticatorSelection: (0, convert_1.optional)(convert_1.copyValue),
|
|
35
|
-
attestation: (0, convert_1.optional)(convert_1.copyValue),
|
|
36
|
-
extensions: (0, convert_1.optional)(simplifiedExtensionsSchema),
|
|
37
|
-
}),
|
|
38
|
-
signal: (0, convert_1.optional)(convert_1.copyValue),
|
|
6
|
+
appid: convert.optional(convert.copyValue),
|
|
7
|
+
appidExclude: convert.optional(convert.copyValue),
|
|
8
|
+
credProps: convert.optional(convert.copyValue),
|
|
39
9
|
};
|
|
40
10
|
// `navigator.create()` response
|
|
41
|
-
|
|
42
|
-
type:
|
|
43
|
-
id:
|
|
44
|
-
rawId:
|
|
45
|
-
authenticatorAttachment:
|
|
46
|
-
response:
|
|
47
|
-
clientDataJSON:
|
|
48
|
-
attestationObject:
|
|
49
|
-
transports:
|
|
11
|
+
const publicKeyCredentialWithAttestation = {
|
|
12
|
+
type: convert.required(convert.copyValue),
|
|
13
|
+
id: convert.required(convert.copyValue),
|
|
14
|
+
rawId: convert.required(convert.convertValue),
|
|
15
|
+
authenticatorAttachment: convert.optional(convert.copyValue),
|
|
16
|
+
response: convert.required({
|
|
17
|
+
clientDataJSON: convert.required(convert.convertValue),
|
|
18
|
+
attestationObject: convert.required(convert.convertValue),
|
|
19
|
+
transports: convert.derived(convert.copyValue, (response) => response.getTransports?.() || []),
|
|
50
20
|
}),
|
|
51
|
-
clientExtensionResults:
|
|
52
|
-
};
|
|
53
|
-
// `navigator.get()` request
|
|
54
|
-
exports.credentialRequestOptions = {
|
|
55
|
-
mediation: (0, convert_1.optional)(convert_1.copyValue),
|
|
56
|
-
publicKey: (0, convert_1.required)({
|
|
57
|
-
challenge: (0, convert_1.required)(convert_1.convertValue),
|
|
58
|
-
timeout: (0, convert_1.optional)(convert_1.copyValue),
|
|
59
|
-
rpId: (0, convert_1.optional)(convert_1.copyValue),
|
|
60
|
-
allowCredentials: (0, convert_1.optional)([publicKeyCredentialDescriptorSchema]),
|
|
61
|
-
userVerification: (0, convert_1.optional)(convert_1.copyValue),
|
|
62
|
-
extensions: (0, convert_1.optional)(simplifiedExtensionsSchema),
|
|
63
|
-
}),
|
|
64
|
-
signal: (0, convert_1.optional)(convert_1.copyValue),
|
|
21
|
+
clientExtensionResults: convert.derived(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults()),
|
|
65
22
|
};
|
|
66
23
|
// `navigator.get()` response
|
|
67
|
-
|
|
68
|
-
type:
|
|
69
|
-
id:
|
|
70
|
-
rawId:
|
|
71
|
-
authenticatorAttachment:
|
|
72
|
-
response:
|
|
73
|
-
clientDataJSON:
|
|
74
|
-
authenticatorData:
|
|
75
|
-
signature:
|
|
76
|
-
userHandle:
|
|
24
|
+
const publicKeyCredentialWithAssertion = {
|
|
25
|
+
type: convert.required(convert.copyValue),
|
|
26
|
+
id: convert.required(convert.copyValue),
|
|
27
|
+
rawId: convert.required(convert.convertValue),
|
|
28
|
+
authenticatorAttachment: convert.optional(convert.copyValue),
|
|
29
|
+
response: convert.required({
|
|
30
|
+
clientDataJSON: convert.required(convert.convertValue),
|
|
31
|
+
authenticatorData: convert.required(convert.convertValue),
|
|
32
|
+
signature: convert.required(convert.convertValue),
|
|
33
|
+
userHandle: convert.required(convert.convertValue),
|
|
77
34
|
}),
|
|
78
|
-
clientExtensionResults:
|
|
79
|
-
};
|
|
80
|
-
exports.schema = {
|
|
81
|
-
credentialCreationOptions: exports.credentialCreationOptions,
|
|
82
|
-
publicKeyCredentialWithAttestation: exports.publicKeyCredentialWithAttestation,
|
|
83
|
-
credentialRequestOptions: exports.credentialRequestOptions,
|
|
84
|
-
publicKeyCredentialWithAssertion: exports.publicKeyCredentialWithAssertion,
|
|
35
|
+
clientExtensionResults: convert.derived(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults()),
|
|
85
36
|
};
|
|
86
|
-
|
|
37
|
+
|
|
38
|
+
exports.publicKeyCredentialWithAssertion = publicKeyCredentialWithAssertion;
|
|
39
|
+
exports.publicKeyCredentialWithAttestation = publicKeyCredentialWithAttestation;
|
|
40
|
+
//# sourceMappingURL=schema.js.map
|