@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.
Files changed (100) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/__generated__/services/coordinator/public/v1/public_api.client.js +9 -7
  3. package/dist/__generated__/services/coordinator/public/v1/public_api.client.js.map +1 -1
  4. package/dist/{esm/__generated__/services/coordinator/public/v1/public_api.client.js → __generated__/services/coordinator/public/v1/public_api.client.mjs} +7 -3
  5. package/dist/__generated__/services/coordinator/public/v1/public_api.client.mjs.map +1 -0
  6. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js +201 -201
  7. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +1 -1
  8. package/dist/{esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js → __generated__/services/coordinator/public/v1/public_api.fetcher.mjs} +103 -100
  9. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.mjs.map +1 -0
  10. package/dist/async.js +16 -15
  11. package/dist/async.js.map +1 -1
  12. package/dist/{esm/async.js → async.mjs} +9 -6
  13. package/dist/async.mjs.map +1 -0
  14. package/dist/base.js +27 -23
  15. package/dist/base.js.map +1 -1
  16. package/dist/{esm/base.js → base.mjs} +13 -11
  17. package/dist/base.mjs.map +1 -0
  18. package/dist/config.js +8 -8
  19. package/dist/config.js.map +1 -1
  20. package/dist/{esm/config.js → config.mjs} +7 -5
  21. package/dist/config.mjs.map +1 -0
  22. package/dist/encoding.js +5 -9
  23. package/dist/encoding.js.map +1 -1
  24. package/dist/{esm/encoding.js → encoding.mjs} +5 -6
  25. package/dist/encoding.mjs.map +1 -0
  26. package/dist/index.js +23 -23
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +15 -0
  29. package/dist/index.mjs.map +1 -0
  30. package/dist/shared.js +4 -8
  31. package/dist/shared.js.map +1 -1
  32. package/dist/{esm/shared.js → shared.mjs} +4 -5
  33. package/dist/shared.mjs.map +1 -0
  34. package/dist/universal.js +6 -7
  35. package/dist/universal.js.map +1 -1
  36. package/dist/{esm/universal.js → universal.mjs} +2 -1
  37. package/dist/universal.mjs.map +1 -0
  38. package/dist/webauthn-json/api.js +11 -28
  39. package/dist/webauthn-json/api.js.map +1 -1
  40. package/dist/webauthn-json/api.mjs +13 -0
  41. package/dist/webauthn-json/api.mjs.map +1 -0
  42. package/dist/webauthn-json/base64url.js +4 -19
  43. package/dist/webauthn-json/base64url.js.map +1 -1
  44. package/dist/webauthn-json/base64url.mjs +20 -0
  45. package/dist/webauthn-json/base64url.mjs.map +1 -0
  46. package/dist/webauthn-json/convert.js +13 -11
  47. package/dist/webauthn-json/convert.js.map +1 -1
  48. package/dist/{esm/webauthn-json/convert.js → webauthn-json/convert.mjs} +9 -7
  49. package/dist/webauthn-json/convert.mjs.map +1 -0
  50. package/dist/webauthn-json/index.js +9 -10
  51. package/dist/webauthn-json/index.js.map +1 -1
  52. package/dist/webauthn-json/index.mjs +15 -0
  53. package/dist/webauthn-json/index.mjs.map +1 -0
  54. package/dist/webauthn-json/schema.js +32 -78
  55. package/dist/webauthn-json/schema.js.map +1 -1
  56. package/dist/webauthn-json/schema.mjs +37 -0
  57. package/dist/webauthn-json/schema.mjs.map +1 -0
  58. package/dist/webauthn.js +11 -10
  59. package/dist/webauthn.js.map +1 -1
  60. package/dist/{esm/webauthn.js → webauthn.mjs} +10 -7
  61. package/dist/webauthn.mjs.map +1 -0
  62. package/package.json +7 -8
  63. package/dist/__generated__/barrel.js +0 -29
  64. package/dist/__generated__/barrel.js.map +0 -1
  65. package/dist/__generated__/services/coordinator/public/v1/public_api.swagger.json +0 -5975
  66. package/dist/__generated__/services/coordinator/public/v1/public_api.types.js +0 -7
  67. package/dist/__generated__/services/coordinator/public/v1/public_api.types.js.map +0 -1
  68. package/dist/esm/__generated__/barrel.js +0 -4
  69. package/dist/esm/__generated__/barrel.js.map +0 -1
  70. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.client.js.map +0 -1
  71. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +0 -1
  72. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.swagger.json +0 -5975
  73. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js +0 -6
  74. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js.map +0 -1
  75. package/dist/esm/async.js.map +0 -1
  76. package/dist/esm/base.js.map +0 -1
  77. package/dist/esm/config.js.map +0 -1
  78. package/dist/esm/encoding.js.map +0 -1
  79. package/dist/esm/index.js +0 -15
  80. package/dist/esm/index.js.map +0 -1
  81. package/dist/esm/shared.js.map +0 -1
  82. package/dist/esm/universal.js.map +0 -1
  83. package/dist/esm/webauthn-json/api.js +0 -24
  84. package/dist/esm/webauthn-json/api.js.map +0 -1
  85. package/dist/esm/webauthn-json/base64url.js +0 -32
  86. package/dist/esm/webauthn-json/base64url.js.map +0 -1
  87. package/dist/esm/webauthn-json/convert.js.map +0 -1
  88. package/dist/esm/webauthn-json/index.js +0 -13
  89. package/dist/esm/webauthn-json/index.js.map +0 -1
  90. package/dist/esm/webauthn-json/json.js +0 -2
  91. package/dist/esm/webauthn-json/json.js.map +0 -1
  92. package/dist/esm/webauthn-json/schema-format.js +0 -2
  93. package/dist/esm/webauthn-json/schema-format.js.map +0 -1
  94. package/dist/esm/webauthn-json/schema.js +0 -83
  95. package/dist/esm/webauthn-json/schema.js.map +0 -1
  96. package/dist/esm/webauthn.js.map +0 -1
  97. package/dist/webauthn-json/json.js +0 -3
  98. package/dist/webauthn-json/json.js.map +0 -1
  99. package/dist/webauthn-json/schema-format.js +0 -3
  100. package/dist/webauthn-json/schema-format.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,27 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sealAndStampRequestBody = exports.PublicApiService = exports.TurnkeyApi = exports.createActivityPoller = exports.withAsyncPolling = exports.getWebAuthnAttestation = exports.TurnkeyActivityError = exports.TurnkeyRequestError = exports.browserInit = exports.init = exports.TurnkeyClient = void 0;
4
- const barrel_1 = require("./__generated__/barrel");
5
- Object.defineProperty(exports, "TurnkeyApi", { enumerable: true, get: function () { return barrel_1.PublicApiService; } });
6
- var public_api_client_1 = require("./__generated__/services/coordinator/public/v1/public_api.client");
7
- Object.defineProperty(exports, "TurnkeyClient", { enumerable: true, get: function () { return public_api_client_1.TurnkeyClient; } });
8
- var config_1 = require("./config");
9
- Object.defineProperty(exports, "init", { enumerable: true, get: function () { return config_1.init; } });
10
- Object.defineProperty(exports, "browserInit", { enumerable: true, get: function () { return config_1.browserInit; } });
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 = barrel_1.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
- var base_2 = require("./base");
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","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwE;AAY/D,2FAZoB,yBAAU,OAYpB;AAVnB,sGAAiG;AAAxF,kHAAA,aAAa,OAAA;AACtB,mCAA6C;AAApC,8FAAA,IAAI,OAAA;AAAE,qGAAA,WAAW,OAAA;AAE1B,+BAA6C;AAApC,2GAAA,mBAAmB,OAAA;AAC5B,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAE7B,uCAAoD;AAA3C,kHAAA,sBAAsB,OAAA;AAE/B,iCAAiE;AAAxD,yGAAA,gBAAgB,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAI/C;;GAEG;AACH,MAAM,gBAAgB,GAAG,yBAAU,CAAC;AAE3B,4CAAgB;AAEzB,+BAAiD;AAAxC,+GAAA,uBAAuB,OAAA"}
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
- function stableStringify(input) {
17
- return JSON.stringify(input);
18
- }
19
- exports.stableStringify = stableStringify;
20
- //# sourceMappingURL=shared.js.map
16
+ //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":";;;AAQA,MAAa,oBAAqB,SAAQ,KAAK;IAM7C,YAAY,KAMX;QACC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;QAC3E,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,IAAI,IAAI,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,IAAI,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC;IAC7B,CAAC;CACF;AAtBD,oDAsBC;AAED,SAAgB,eAAe,CAAC,KAA0B;IACxD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAFD,0CAEC"}
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
- export class TurnkeyActivityError extends Error {
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
- export function stableStringify(input) {
13
- return JSON.stringify(input);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetch = void 0;
1
+ 'use strict';
2
+
4
3
  /// <reference lib="dom" />
5
- let fetch;
4
+ exports.fetch = void 0;
6
5
  if (typeof globalThis?.fetch !== "undefined") {
7
- exports.fetch = fetch = globalThis.fetch;
6
+ exports.fetch = globalThis.fetch;
8
7
  }
9
8
  else {
10
- exports.fetch = fetch = require("cross-fetch");
9
+ exports.fetch = require("cross-fetch");
11
10
  }
12
- //# sourceMappingURL=universal.js.map
11
+ //# sourceMappingURL=universal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"universal.js","sourceRoot":"","sources":["../src/universal.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,IAAI,KAA8B,CAAC;AAEnC,IAAI,OAAO,UAAU,EAAE,KAAK,KAAK,WAAW,EAAE;IAC5C,gBAAA,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;CAC1B;KAAM;IACL,gBAAA,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAChC"}
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;;"}
@@ -6,5 +6,6 @@ if (typeof globalThis?.fetch !== "undefined") {
6
6
  else {
7
7
  fetch = require("cross-fetch");
8
8
  }
9
+
9
10
  export { fetch };
10
- //# sourceMappingURL=universal.js.map
11
+ //# sourceMappingURL=universal.mjs.map
@@ -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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get = exports.getResponseToJSON = exports.getRequestFromJSON = exports.create = exports.createResponseToJSON = exports.createRequestFromJSON = void 0;
4
- const base64url_1 = require("./base64url");
5
- const convert_1 = require("./convert");
6
- const schema_1 = require("./schema");
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 (0, convert_1.convert)(base64url_1.bufferToBase64url, schema_1.publicKeyCredentialWithAttestation, credential);
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 (0, convert_1.convert)(base64url_1.bufferToBase64url, schema_1.publicKeyCredentialWithAssertion, credential);
11
+ return convert.convert(base64url.bufferToBase64url, schema.publicKeyCredentialWithAssertion, credential);
26
12
  }
13
+
14
+ exports.createResponseToJSON = createResponseToJSON;
27
15
  exports.getResponseToJSON = getResponseToJSON;
28
- async function get(requestJSON) {
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","sourceRoot":"","sources":["../../src/webauthn-json/api.ts"],"names":[],"mappings":";;;AAAA,2CAAmE;AACnE,uCAAoC;AAOpC,qCAKkB;AAElB,SAAgB,qBAAqB,CACnC,WAA0C;IAE1C,OAAO,IAAA,iBAAO,EAAC,6BAAiB,EAAE,kCAAyB,EAAE,WAAW,CAAC,CAAC;AAC5E,CAAC;AAJD,sDAIC;AAED,SAAgB,oBAAoB,CAClC,UAA+B;IAE/B,OAAO,IAAA,iBAAO,EACZ,6BAAiB,EACjB,2CAAkC,EAClC,UAAU,CACX,CAAC;AACJ,CAAC;AARD,oDAQC;AAEM,KAAK,UAAU,MAAM,CAC1B,WAA0C;IAE1C,MAAM,UAAU,GAAG,CAAC,MAAM,SAAS,CAAC,WAAW,CAAC,MAAM,CACpD,qBAAqB,CAAC,WAAW,CAAC,CACnC,CAAwB,CAAC;IAC1B,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC1C,CAAC;AAPD,wBAOC;AAED,SAAgB,kBAAkB,CAChC,WAAyC;IAEzC,OAAO,IAAA,iBAAO,EAAC,6BAAiB,EAAE,iCAAwB,EAAE,WAAW,CAAC,CAAC;AAC3E,CAAC;AAJD,gDAIC;AAED,SAAgB,iBAAiB,CAC/B,UAA+B;IAE/B,OAAO,IAAA,iBAAO,EACZ,6BAAiB,EACjB,yCAAgC,EAChC,UAAU,CACX,CAAC;AACJ,CAAC;AARD,8CAQC;AAEM,KAAK,UAAU,GAAG,CACvB,WAAyC;IAEzC,MAAM,UAAU,GAAG,CAAC,MAAM,SAAS,CAAC,WAAW,CAAC,GAAG,CACjD,kBAAkB,CAAC,WAAW,CAAC,CAChC,CAAwB,CAAC;IAC1B,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAC;AACvC,CAAC;AAPD,kBAOC"}
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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","sourceRoot":"","sources":["../../src/webauthn-json/base64url.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAC/B,eAAgC;IAEhC,sBAAsB;IACtB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,MAAM,YAAY,GAChB,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;IAElE,0BAA0B;IAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IAE/B,0BAA0B;IAC1B,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACjC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAlBD,8CAkBC;AAED,SAAgB,iBAAiB,CAAC,MAAmB;IACnD,0BAA0B;IAC1B,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE;QAC/B,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;KACtC;IAED,0BAA0B;IAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAE/B,sBAAsB;IACtB,sDAAsD;IACtD,MAAM,eAAe,GAAG,YAAY;SACjC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrB,OAAO,eAAe,CAAC;AACzB,CAAC;AAlBD,8CAkBC"}
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
- "use strict";
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
- exports.copyValue = "copy";
8
- exports.convertValue = "convert";
6
+ const copyValue = "copy";
7
+ const convertValue = "convert";
9
8
  function convert(conversionFn, schema, input) {
10
- if (schema === exports.copyValue) {
9
+ if (schema === copyValue) {
11
10
  return input;
12
11
  }
13
- if (schema === exports.convertValue) {
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
- //# sourceMappingURL=convert.js.map
70
+ exports.required = required;
71
+ //# sourceMappingURL=convert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../src/webauthn-json/convert.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,0CAA0C;;;AAI1C,iDAAiD;AACpC,QAAA,SAAS,GAAG,MAAM,CAAC;AACnB,QAAA,YAAY,GAAG,SAAS,CAAC;AAEtC,SAAgB,OAAO,CACrB,YAA6B,EAC7B,MAAc,EACd,KAAU;IAEV,IAAI,MAAM,KAAK,iBAAS,EAAE;QACxB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,MAAM,KAAK,oBAAY,EAAE;QAC3B,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;KAC5B;IACD,IAAI,MAAM,YAAY,KAAK,EAAE;QAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAW,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC7E;IACD,IAAI,MAAM,YAAY,MAAM,EAAE;QAC5B,MAAM,MAAM,GAAQ,EAAE,CAAC;QACvB,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;oBACnB,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;iBAChB;aACF;YAED,IAAI,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE;gBACnB,IAAI,WAAW,CAAC,QAAQ,EAAE;oBACxB,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC;iBACxC;gBACD,SAAS;aACV;YACD,oEAAoE;YACpE,8DAA8D;YAC9D,uEAAuE;YACvE,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;gBACtB,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBACnB,SAAS;aACV;YACD,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CACnB,YAAY,EACZ,WAAW,CAAC,MAAM,EAClB,KAAK,CAAC,GAAG,CAAC,CACX,CAAC;SACH;QACD,OAAO,MAAM,CAAC;KACf;AACH,CAAC;AA7CD,0BA6CC;AAED,SAAgB,OAAO,CACrB,MAAc,EACd,MAAuB;IAEvB,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,MAAM;QACN,MAAM;KACP,CAAC;AACJ,CAAC;AATD,0BASC;AAED,SAAgB,QAAQ,CAAC,MAAc;IACrC,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AALD,4BAKC;AAED,SAAgB,QAAQ,CAAC,MAAc;IACrC,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,MAAM;KACP,CAAC;AACJ,CAAC;AALD,4BAKC"}
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
- export const copyValue = "copy";
5
- export const convertValue = "convert";
6
- export function convert(conversionFn, schema, input) {
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
- export function derived(schema, derive) {
43
+ function derived(schema, derive) {
44
44
  return {
45
45
  required: true,
46
46
  schema,
47
47
  derive,
48
48
  };
49
49
  }
50
- export function required(schema) {
50
+ function required(schema) {
51
51
  return {
52
52
  required: true,
53
53
  schema,
54
54
  };
55
55
  }
56
- export function optional(schema) {
56
+ function optional(schema) {
57
57
  return {
58
58
  required: false,
59
59
  schema,
60
60
  };
61
61
  }
62
- //# sourceMappingURL=convert.js.map
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get = exports.create = exports.parseRequestOptionsFromJSON = exports.parseCreationOptionsFromJSON = void 0;
4
- const api_1 = require("./api");
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 = () => (0, api_1.createResponseToJSON)(response);
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 = () => (0, api_1.getResponseToJSON)(response);
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","sourceRoot":"","sources":["../../src/webauthn-json/index.ts"],"names":[],"mappings":";;;AAAA,+BAKe;AAcN,6GAlBkB,2BAA4B,OAkBlB;AAAE,4GAhBf,wBAA2B,OAgBe;AAY3D,KAAK,UAAU,MAAM,CAC1B,OAAkC;IAElC,MAAM,QAAQ,GAAG,CAAC,MAAM,SAAS,CAAC,WAAW,CAAC,MAAM,CAClD,OAAO,CACR,CAAoC,CAAC;IACtC,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,IAAA,0BAAoB,EAAC,QAAQ,CAAC,CAAC;IACvD,OAAO,QAAQ,CAAC;AAClB,CAAC;AARD,wBAQC;AAMM,KAAK,UAAU,GAAG,CACvB,OAAiC;IAEjC,MAAM,QAAQ,GAAG,CAAC,MAAM,SAAS,CAAC,WAAW,CAAC,GAAG,CAC/C,OAAO,CACR,CAAsC,CAAC;IACxC,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,IAAA,uBAAiB,EAAC,QAAQ,CAAC,CAAC;IACpD,OAAO,QAAQ,CAAC;AAClB,CAAC;AARD,kBAQC"}
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schema = exports.publicKeyCredentialWithAssertion = exports.credentialRequestOptions = exports.publicKeyCredentialWithAttestation = exports.credentialCreationOptions = void 0;
4
- const convert_1 = require("./convert");
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: (0, convert_1.optional)(convert_1.copyValue),
18
- appidExclude: (0, convert_1.optional)(convert_1.copyValue),
19
- credProps: (0, convert_1.optional)(convert_1.copyValue),
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
- exports.publicKeyCredentialWithAttestation = {
42
- type: (0, convert_1.required)(convert_1.copyValue),
43
- id: (0, convert_1.required)(convert_1.copyValue),
44
- rawId: (0, convert_1.required)(convert_1.convertValue),
45
- authenticatorAttachment: (0, convert_1.optional)(convert_1.copyValue),
46
- response: (0, convert_1.required)({
47
- clientDataJSON: (0, convert_1.required)(convert_1.convertValue),
48
- attestationObject: (0, convert_1.required)(convert_1.convertValue),
49
- transports: (0, convert_1.derived)(convert_1.copyValue, (response) => response.getTransports?.() || []),
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: (0, convert_1.derived)(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults()),
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
- exports.publicKeyCredentialWithAssertion = {
68
- type: (0, convert_1.required)(convert_1.copyValue),
69
- id: (0, convert_1.required)(convert_1.copyValue),
70
- rawId: (0, convert_1.required)(convert_1.convertValue),
71
- authenticatorAttachment: (0, convert_1.optional)(convert_1.copyValue),
72
- response: (0, convert_1.required)({
73
- clientDataJSON: (0, convert_1.required)(convert_1.convertValue),
74
- authenticatorData: (0, convert_1.required)(convert_1.convertValue),
75
- signature: (0, convert_1.required)(convert_1.convertValue),
76
- userHandle: (0, convert_1.required)(convert_1.convertValue),
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: (0, convert_1.derived)(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults()),
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
- //# sourceMappingURL=schema.js.map
37
+
38
+ exports.publicKeyCredentialWithAssertion = publicKeyCredentialWithAssertion;
39
+ exports.publicKeyCredentialWithAttestation = publicKeyCredentialWithAttestation;
40
+ //# sourceMappingURL=schema.js.map