zudoku 0.32.5 → 0.33.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/cli.js +3 -0
- package/dist/app/main.js +1 -1
- package/dist/app/main.js.map +1 -1
- package/dist/cli/build/handler.d.ts +1 -3
- package/dist/cli/build/handler.js +7 -0
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/cli/cli.js +5 -0
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/cmds/build.d.ts +11 -3
- package/dist/cli/cmds/build.js +20 -13
- package/dist/cli/cmds/build.js.map +1 -1
- package/dist/cli/cmds/preview.d.ts +16 -0
- package/dist/cli/cmds/preview.js +25 -0
- package/dist/cli/cmds/preview.js.map +1 -0
- package/dist/cli/preview/handler.d.ts +3 -0
- package/dist/cli/preview/handler.js +37 -0
- package/dist/cli/preview/handler.js.map +1 -0
- package/dist/config/common.d.ts +5 -2
- package/dist/config/config.d.ts +2 -7
- package/dist/config/loader.d.ts +4 -4
- package/dist/config/loader.js +7 -4
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/validate.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.d.ts +2 -2
- package/dist/lib/authentication/providers/auth0.js +1 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +4 -3
- package/dist/lib/authentication/providers/openid.js +4 -2
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.js +1 -1
- package/dist/lib/components/ThemeSwitch.js.map +1 -1
- package/dist/lib/components/Zudoku.d.ts +1 -1
- package/dist/lib/components/Zudoku.js +7 -6
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
- package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
- package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
- package/dist/lib/core/RouteGuard.js +12 -5
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +10 -0
- package/dist/lib/core/ZudokuContext.js +17 -1
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +8 -2
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +3 -0
- package/dist/lib/hooks/index.js +5 -0
- package/dist/lib/hooks/index.js.map +1 -0
- package/dist/lib/hooks/useEvent.d.ts +11 -0
- package/dist/lib/hooks/useEvent.js +19 -0
- package/dist/lib/hooks/useEvent.js.map +1 -0
- package/dist/lib/hooks/useEvent.test.d.ts +1 -0
- package/dist/lib/hooks/useEvent.test.js +100 -0
- package/dist/lib/hooks/useEvent.test.js.map +1 -0
- package/dist/lib/ui/Stepper.d.ts +4 -0
- package/dist/lib/ui/Stepper.js +7 -0
- package/dist/lib/ui/Stepper.js.map +1 -0
- package/dist/lib/util/MdxComponents.d.ts +3 -1
- package/dist/lib/util/MdxComponents.js +3 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/config.d.ts +2 -5
- package/dist/vite/config.js +21 -33
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +1 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/css/plugin.d.ts +2 -2
- package/dist/vite/css/plugin.js.map +1 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api-keys.d.ts +2 -2
- package/dist/vite/plugin-api-keys.js +3 -3
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +2 -2
- package/dist/vite/plugin-api.js +5 -5
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.d.ts +2 -2
- package/dist/vite/plugin-auth.js +3 -3
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +2 -2
- package/dist/vite/plugin-component.js +3 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +4 -3
- package/dist/vite/plugin-config-reload.js +11 -6
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +2 -2
- package/dist/vite/plugin-config.js +2 -2
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +2 -2
- package/dist/vite/plugin-custom-pages.js +3 -3
- package/dist/vite/plugin-custom-pages.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +2 -2
- package/dist/vite/plugin-docs.js +5 -5
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -2
- package/dist/vite/plugin-frontmatter.js +5 -4
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +2 -2
- package/dist/vite/plugin-mdx.js +1 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-redirect.d.ts +2 -2
- package/dist/vite/plugin-redirect.js +3 -3
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +2 -2
- package/dist/vite/plugin-search.js +1 -1
- package/dist/vite/plugin-search.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +2 -2
- package/dist/vite/plugin-sidebar.js +2 -2
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin-theme-css.d.ts +2 -2
- package/dist/vite/plugin-theme-css.js.map +1 -1
- package/dist/vite/plugin.d.ts +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender/FileWritingResponse.d.ts +2 -1
- package/dist/vite/prerender/FileWritingResponse.js +4 -1
- package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
- package/dist/vite/prerender/worker.d.ts +1 -1
- package/dist/vite/prerender/worker.js +3 -0
- package/dist/vite/prerender/worker.js.map +1 -1
- package/lib/{AuthenticationPlugin-BlxA4Mbn.js → AuthenticationPlugin-_gUMnGxb.js} +2 -2
- package/lib/{AuthenticationPlugin-BlxA4Mbn.js.map → AuthenticationPlugin-_gUMnGxb.js.map} +1 -1
- package/lib/{Markdown-Cr9sYpR_.js → Markdown-DePfm7oQ.js} +1384 -1381
- package/lib/{Markdown-Cr9sYpR_.js.map → Markdown-DePfm7oQ.js.map} +1 -1
- package/lib/{MdxPage-Dt-UEQl8.js → MdxPage-DM9mE-G-.js} +4 -4
- package/lib/{MdxPage-Dt-UEQl8.js.map → MdxPage-DM9mE-G-.js.map} +1 -1
- package/lib/{OasProvider-WVtvHP5H.js → OasProvider-Bvu4dDpX.js} +3 -3
- package/lib/{OasProvider-WVtvHP5H.js.map → OasProvider-Bvu4dDpX.js.map} +1 -1
- package/lib/{OperationList-DhOwupvv.js → OperationList-DWnNbwVg.js} +241 -240
- package/lib/OperationList-DWnNbwVg.js.map +1 -0
- package/lib/{Select-D9hI1G-y.js → Select-BmoX1iTH.js} +36 -36
- package/lib/{Select-D9hI1G-y.js.map → Select-BmoX1iTH.js.map} +1 -1
- package/lib/{SlotletProvider-CEfNOA8i.js → SlotletProvider-DdtIOUi6.js} +2 -2
- package/lib/{SlotletProvider-CEfNOA8i.js.map → SlotletProvider-DdtIOUi6.js.map} +1 -1
- package/lib/{createServer-DMf6O2Rz.js → createServer-DmusVVsi.js} +987 -967
- package/lib/createServer-DmusVVsi.js.map +1 -0
- package/lib/{hook-CWwSAAlH.js → hook-4_6pQSo4.js} +29 -29
- package/lib/{hook-CWwSAAlH.js.map → hook-4_6pQSo4.js.map} +1 -1
- package/lib/{index-Do_30Hpk.js → index-DVBlM15k.js} +83 -82
- package/lib/{index-Do_30Hpk.js.map → index-DVBlM15k.js.map} +1 -1
- package/lib/index-DwT-v3zK.js +86 -0
- package/lib/index-DwT-v3zK.js.map +1 -0
- package/lib/{mutation-B0wxqzSN.js → mutation-DTunCQKB.js} +2 -2
- package/lib/{mutation-B0wxqzSN.js.map → mutation-DTunCQKB.js.map} +1 -1
- package/lib/objectEntries-yMIkr2mI.js +5 -0
- package/lib/objectEntries-yMIkr2mI.js.map +1 -0
- package/lib/ui/Stepper.js +6 -0
- package/lib/ui/Stepper.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +2902 -7
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/{useScrollToAnchor-C-sRxs9o.js → useScrollToAnchor-BW8y_cwU.js} +3 -3
- package/lib/{useScrollToAnchor-C-sRxs9o.js.map → useScrollToAnchor-BW8y_cwU.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +15 -14
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +126 -124
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +497 -456
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.css +1 -0
- package/lib/zudoku.hooks.js +19 -0
- package/lib/zudoku.hooks.js.map +1 -0
- package/lib/zudoku.plugin-api-catalog.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +12 -4
- package/src/app/main.tsx +1 -1
- package/src/lib/authentication/providers/auth0.tsx +3 -2
- package/src/lib/authentication/providers/openid.tsx +8 -5
- package/src/lib/components/ThemeSwitch.tsx +1 -1
- package/src/lib/components/Zudoku.tsx +9 -5
- package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
- package/src/lib/core/RouteGuard.tsx +13 -5
- package/src/lib/core/ZudokuContext.ts +31 -0
- package/src/lib/core/plugins.ts +16 -2
- package/src/lib/hooks/index.ts +5 -0
- package/src/lib/hooks/useEvent.test.tsx +149 -0
- package/src/lib/hooks/useEvent.ts +41 -0
- package/src/lib/ui/Stepper.css +43 -0
- package/src/lib/ui/Stepper.tsx +8 -0
- package/src/lib/util/MdxComponents.tsx +4 -1
- package/lib/OperationList-DhOwupvv.js.map +0 -1
- package/lib/SyntaxHighlight-CcnUjERD.js +0 -2986
- package/lib/SyntaxHighlight-CcnUjERD.js.map +0 -1
- package/lib/createServer-DMf6O2Rz.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var Ue = Object.defineProperty;
|
|
2
2
|
var Le = (t, e, n) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
-
var
|
|
3
|
+
var _ = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { j as q } from "./jsx-runtime-CYK1ROHF.js";
|
|
5
5
|
import { g as xe } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
6
6
|
import { C as Ce } from "./ClientOnly-E7hGysn1.js";
|
|
7
7
|
import { j as oe } from "./joinUrl-10po2Jdj.js";
|
|
8
|
-
import { A as
|
|
9
|
-
import {
|
|
8
|
+
import { A as je } from "./AuthenticationPlugin-_gUMnGxb.js";
|
|
9
|
+
import { b as Ie, u as L } from "./hook-4_6pQSo4.js";
|
|
10
10
|
import { N as Je } from "./chunk-IR6S3I6Y-D_3UmFIn.js";
|
|
11
11
|
import { Z as Oe } from "./invariant-Caa8-XvF.js";
|
|
12
12
|
var D = { exports: {} }, ze = D.exports, ie;
|
|
@@ -23,8 +23,8 @@ function De() {
|
|
|
23
23
|
"warn",
|
|
24
24
|
"error"
|
|
25
25
|
], r = {}, i = null;
|
|
26
|
-
function c(l,
|
|
27
|
-
var u = l[
|
|
26
|
+
function c(l, g) {
|
|
27
|
+
var u = l[g];
|
|
28
28
|
if (typeof u.bind == "function")
|
|
29
29
|
return u.bind(l);
|
|
30
30
|
try {
|
|
@@ -35,41 +35,41 @@ function De() {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function f() {
|
|
39
39
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ?
|
|
41
|
+
function w(l) {
|
|
42
|
+
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? f : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
|
|
43
43
|
}
|
|
44
44
|
function p() {
|
|
45
|
-
for (var l = this.getLevel(),
|
|
46
|
-
var u = a[
|
|
47
|
-
this[u] =
|
|
45
|
+
for (var l = this.getLevel(), g = 0; g < a.length; g++) {
|
|
46
|
+
var u = a[g];
|
|
47
|
+
this[u] = g < l ? e : this.methodFactory(u, l, this.name);
|
|
48
48
|
}
|
|
49
49
|
if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
|
|
50
50
|
return "No console available for logging";
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function b(l) {
|
|
53
53
|
return function() {
|
|
54
54
|
typeof console !== n && (p.call(this), this[l].apply(this, arguments));
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function T(l,
|
|
58
|
-
return
|
|
57
|
+
function T(l, g, u) {
|
|
58
|
+
return w(l) || b.apply(this, arguments);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function h(l, g) {
|
|
61
61
|
var u = this, J, $, R, v = "loglevel";
|
|
62
62
|
typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
|
|
63
63
|
function Ee(d) {
|
|
64
|
-
var
|
|
64
|
+
var y = (a[d] || "silent").toUpperCase();
|
|
65
65
|
if (!(typeof window === n || !v)) {
|
|
66
66
|
try {
|
|
67
|
-
window.localStorage[v] =
|
|
67
|
+
window.localStorage[v] = y;
|
|
68
68
|
return;
|
|
69
69
|
} catch {
|
|
70
70
|
}
|
|
71
71
|
try {
|
|
72
|
-
window.document.cookie = encodeURIComponent(v) + "=" +
|
|
72
|
+
window.document.cookie = encodeURIComponent(v) + "=" + y + ";";
|
|
73
73
|
} catch {
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -83,9 +83,9 @@ function De() {
|
|
|
83
83
|
}
|
|
84
84
|
if (typeof d === n)
|
|
85
85
|
try {
|
|
86
|
-
var
|
|
86
|
+
var y = window.document.cookie, O = encodeURIComponent(v), re = y.indexOf(O + "=");
|
|
87
87
|
re !== -1 && (d = /^([^;]+)/.exec(
|
|
88
|
-
|
|
88
|
+
y.slice(re + O.length + 1)
|
|
89
89
|
)[1]);
|
|
90
90
|
} catch {
|
|
91
91
|
}
|
|
@@ -105,9 +105,9 @@ function De() {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
function U(d) {
|
|
108
|
-
var
|
|
109
|
-
if (typeof
|
|
110
|
-
return
|
|
108
|
+
var y = d;
|
|
109
|
+
if (typeof y == "string" && u.levels[y.toUpperCase()] !== void 0 && (y = u.levels[y.toUpperCase()]), typeof y == "number" && y >= 0 && y <= u.levels.SILENT)
|
|
110
|
+
return y;
|
|
111
111
|
throw new TypeError("log.setLevel() called with invalid level: " + d);
|
|
112
112
|
}
|
|
113
113
|
u.name = l, u.levels = {
|
|
@@ -117,10 +117,10 @@ function De() {
|
|
|
117
117
|
WARN: 3,
|
|
118
118
|
ERROR: 4,
|
|
119
119
|
SILENT: 5
|
|
120
|
-
}, u.methodFactory =
|
|
120
|
+
}, u.methodFactory = g || T, u.getLevel = function() {
|
|
121
121
|
return R ?? $ ?? J;
|
|
122
|
-
}, u.setLevel = function(d,
|
|
123
|
-
return R = U(d),
|
|
122
|
+
}, u.setLevel = function(d, y) {
|
|
123
|
+
return R = U(d), y !== !1 && Ee(R), p.call(u);
|
|
124
124
|
}, u.setDefaultLevel = function(d) {
|
|
125
125
|
$ = U(d), te() || u.setLevel(d, !1);
|
|
126
126
|
}, u.resetLevel = function() {
|
|
@@ -139,18 +139,18 @@ function De() {
|
|
|
139
139
|
var ne = te();
|
|
140
140
|
ne != null && (R = U(ne)), p.call(u);
|
|
141
141
|
}
|
|
142
|
-
i = new
|
|
143
|
-
if (typeof
|
|
142
|
+
i = new h(), i.getLogger = function(g) {
|
|
143
|
+
if (typeof g != "symbol" && typeof g != "string" || g === "")
|
|
144
144
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
145
|
-
var u = r[
|
|
146
|
-
return u || (u = r[
|
|
147
|
-
|
|
145
|
+
var u = r[g];
|
|
146
|
+
return u || (u = r[g] = new h(
|
|
147
|
+
g,
|
|
148
148
|
i.methodFactory
|
|
149
149
|
)), u;
|
|
150
150
|
};
|
|
151
|
-
var
|
|
151
|
+
var I = typeof window !== n ? window.log : void 0;
|
|
152
152
|
return i.noConflict = function() {
|
|
153
|
-
return typeof window !== n && window.log === i && (window.log =
|
|
153
|
+
return typeof window !== n && window.log === i && (window.log = I), i;
|
|
154
154
|
}, i.getLoggers = function() {
|
|
155
155
|
return r;
|
|
156
156
|
}, i.default = i, i;
|
|
@@ -292,7 +292,7 @@ async function Xe(t, e) {
|
|
|
292
292
|
signal: null
|
|
293
293
|
}).then(Y);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function m(t) {
|
|
296
296
|
return typeof t == "string" && t.length !== 0;
|
|
297
297
|
}
|
|
298
298
|
async function et(t, e) {
|
|
@@ -311,7 +311,7 @@ async function et(t, e) {
|
|
|
311
311
|
}
|
|
312
312
|
if (!x(n))
|
|
313
313
|
throw new s('"response" body must be a top level object');
|
|
314
|
-
if (!
|
|
314
|
+
if (!m(n.issuer))
|
|
315
315
|
throw new s('"response" body "issuer" property must be a non-empty string');
|
|
316
316
|
if (new URL(n.issuer).href !== t.href)
|
|
317
317
|
throw new s('"response" body "issuer" does not match "expectedIssuer"');
|
|
@@ -327,7 +327,7 @@ function nt() {
|
|
|
327
327
|
return Q();
|
|
328
328
|
}
|
|
329
329
|
async function rt(t) {
|
|
330
|
-
if (!
|
|
330
|
+
if (!m(t))
|
|
331
331
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
332
332
|
return k(await crypto.subtle.digest("SHA-256", E(t)));
|
|
333
333
|
}
|
|
@@ -403,19 +403,19 @@ function X() {
|
|
|
403
403
|
function C(t) {
|
|
404
404
|
if (typeof t != "object" || t === null)
|
|
405
405
|
throw new TypeError('"as" must be an object');
|
|
406
|
-
if (!
|
|
406
|
+
if (!m(t.issuer))
|
|
407
407
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
408
408
|
return !0;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function j(t) {
|
|
411
411
|
if (typeof t != "object" || t === null)
|
|
412
412
|
throw new TypeError('"client" must be an object');
|
|
413
|
-
if (!
|
|
413
|
+
if (!m(t.client_id))
|
|
414
414
|
throw new TypeError('"client.client_id" property must be a non-empty string');
|
|
415
415
|
return !0;
|
|
416
416
|
}
|
|
417
417
|
function ue(t) {
|
|
418
|
-
if (!
|
|
418
|
+
if (!m(t))
|
|
419
419
|
throw new TypeError('"client.client_secret" property must be a non-empty string');
|
|
420
420
|
return t;
|
|
421
421
|
}
|
|
@@ -454,28 +454,28 @@ async function lt(t, e, n) {
|
|
|
454
454
|
}
|
|
455
455
|
async function dt(t, e, n, o, a, r) {
|
|
456
456
|
var T;
|
|
457
|
-
const { privateKey: i, publicKey: c, nonce:
|
|
457
|
+
const { privateKey: i, publicKey: c, nonce: f = we.get(n.origin) } = e;
|
|
458
458
|
if (!Ze(i))
|
|
459
459
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
460
460
|
if (!Ye(c))
|
|
461
461
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
462
|
-
if (
|
|
462
|
+
if (f !== void 0 && !m(f))
|
|
463
463
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
464
464
|
if (!c.extractable)
|
|
465
465
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
466
|
-
const
|
|
466
|
+
const w = X() + a, p = {
|
|
467
467
|
alg: ct(i),
|
|
468
468
|
typ: "dpop+jwt",
|
|
469
469
|
jwk: await ft(c)
|
|
470
|
-
},
|
|
471
|
-
iat:
|
|
470
|
+
}, b = {
|
|
471
|
+
iat: w,
|
|
472
472
|
jti: Q(),
|
|
473
473
|
htm: o,
|
|
474
|
-
nonce:
|
|
474
|
+
nonce: f,
|
|
475
475
|
htu: `${n.origin}${n.pathname}`,
|
|
476
476
|
ath: r ? k(await crypto.subtle.digest("SHA-256", E(r))) : void 0
|
|
477
477
|
};
|
|
478
|
-
(T = e[Ke]) == null || T.call(e, p,
|
|
478
|
+
(T = e[Ke]) == null || T.call(e, p, b), t.set("dpop", await lt(p, b, i));
|
|
479
479
|
}
|
|
480
480
|
let N;
|
|
481
481
|
async function ht(t) {
|
|
@@ -501,7 +501,7 @@ function V(t) {
|
|
|
501
501
|
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
502
502
|
}
|
|
503
503
|
async function pt(t, e, n, o, a, r) {
|
|
504
|
-
if (!
|
|
504
|
+
if (!m(t))
|
|
505
505
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
506
506
|
if (!(n instanceof URL))
|
|
507
507
|
throw new TypeError('"url" must be an instance of URL');
|
|
@@ -514,7 +514,7 @@ async function pt(t, e, n, o, a, r) {
|
|
|
514
514
|
}).then(Y);
|
|
515
515
|
}
|
|
516
516
|
async function wt(t, e, n, o) {
|
|
517
|
-
C(t),
|
|
517
|
+
C(t), j(e);
|
|
518
518
|
const a = ye(t, "userinfo_endpoint", be(e, o)), r = K(o == null ? void 0 : o.headers);
|
|
519
519
|
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), pt(n, "GET", a, r, null, {
|
|
520
520
|
...o,
|
|
@@ -537,7 +537,7 @@ async function _e(t, e, n, o, a) {
|
|
|
537
537
|
return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, a);
|
|
538
538
|
}
|
|
539
539
|
async function gt(t, e, n, o) {
|
|
540
|
-
if (C(t),
|
|
540
|
+
if (C(t), j(e), !m(n))
|
|
541
541
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
542
542
|
const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
543
543
|
return a.set("refresh_token", n), _e(t, e, "refresh_token", a, o);
|
|
@@ -552,7 +552,7 @@ function yt(t) {
|
|
|
552
552
|
return e[0];
|
|
553
553
|
}
|
|
554
554
|
async function Se(t, e, n, o = !1, a = !1) {
|
|
555
|
-
if (C(t),
|
|
555
|
+
if (C(t), j(e), !G(n, Response))
|
|
556
556
|
throw new TypeError('"response" must be an instance of Response');
|
|
557
557
|
if (n.status !== 200) {
|
|
558
558
|
let i;
|
|
@@ -569,20 +569,20 @@ async function Se(t, e, n, o = !1, a = !1) {
|
|
|
569
569
|
}
|
|
570
570
|
if (!x(r))
|
|
571
571
|
throw new s('"response" body must be a top level object');
|
|
572
|
-
if (!
|
|
572
|
+
if (!m(r.access_token))
|
|
573
573
|
throw new s('"response" body "access_token" property must be a non-empty string');
|
|
574
|
-
if (!
|
|
574
|
+
if (!m(r.token_type))
|
|
575
575
|
throw new s('"response" body "token_type" property must be a non-empty string');
|
|
576
576
|
if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
|
|
577
577
|
throw new S("unsupported `token_type` value");
|
|
578
578
|
if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
|
|
579
579
|
throw new s('"response" body "expires_in" property must be a positive number');
|
|
580
|
-
if (!a && r.refresh_token !== void 0 && !
|
|
580
|
+
if (!a && r.refresh_token !== void 0 && !m(r.refresh_token))
|
|
581
581
|
throw new s('"response" body "refresh_token" property must be a non-empty string');
|
|
582
582
|
if (r.scope !== void 0 && typeof r.scope != "string")
|
|
583
583
|
throw new s('"response" body "scope" property must be a string');
|
|
584
584
|
if (!o) {
|
|
585
|
-
if (r.id_token !== void 0 && !
|
|
585
|
+
if (r.id_token !== void 0 && !m(r.id_token))
|
|
586
586
|
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
587
587
|
if (r.id_token) {
|
|
588
588
|
const { claims: i, jwt: c } = await xt(r.id_token, Ct.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), ke, H(e), ge(e), e[He]).then(kt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(vt.bind(void 0, t.issuer)).then(_t.bind(void 0, e.client_id));
|
|
@@ -620,11 +620,11 @@ function St(t) {
|
|
|
620
620
|
return Te.add(t), t;
|
|
621
621
|
}
|
|
622
622
|
async function Tt(t, e, n, o, a, r) {
|
|
623
|
-
if (C(t),
|
|
623
|
+
if (C(t), j(e), !Te.has(n))
|
|
624
624
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
625
|
-
if (!
|
|
625
|
+
if (!m(o))
|
|
626
626
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
627
|
-
if (!
|
|
627
|
+
if (!m(a))
|
|
628
628
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
629
629
|
const i = A(n, "code");
|
|
630
630
|
if (!i)
|
|
@@ -659,7 +659,7 @@ async function Rt(t, e, n, o, a) {
|
|
|
659
659
|
const r = await Se(t, e, n);
|
|
660
660
|
if (V(r))
|
|
661
661
|
return r;
|
|
662
|
-
if (!
|
|
662
|
+
if (!m(r.id_token))
|
|
663
663
|
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
664
664
|
a ?? (a = e.default_max_age ?? F);
|
|
665
665
|
const i = yt(r);
|
|
@@ -668,8 +668,8 @@ async function Rt(t, e, n, o, a) {
|
|
|
668
668
|
if (a !== F) {
|
|
669
669
|
if (typeof a != "number" || a < 0)
|
|
670
670
|
throw new TypeError('"maxAge" must be a non-negative number');
|
|
671
|
-
const c = X() + H(e),
|
|
672
|
-
if (i.auth_time + a < c -
|
|
671
|
+
const c = X() + H(e), f = ge(e);
|
|
672
|
+
if (i.auth_time + a < c - f)
|
|
673
673
|
throw new s("too much time has elapsed since the last End-User authentication");
|
|
674
674
|
}
|
|
675
675
|
switch (o) {
|
|
@@ -679,7 +679,7 @@ async function Rt(t, e, n, o, a) {
|
|
|
679
679
|
throw new s('unexpected ID Token "nonce" claim value');
|
|
680
680
|
break;
|
|
681
681
|
default:
|
|
682
|
-
if (!
|
|
682
|
+
if (!m(o))
|
|
683
683
|
throw new TypeError('"expectedNonce" must be a non-empty string');
|
|
684
684
|
if (i.nonce === void 0)
|
|
685
685
|
throw new s('ID Token "nonce" claim missing');
|
|
@@ -753,13 +753,13 @@ async function Lt(t, e, n, o) {
|
|
|
753
753
|
throw new s("JWT signature verification failed");
|
|
754
754
|
}
|
|
755
755
|
async function xt(t, e, n, o, a, r) {
|
|
756
|
-
let { 0: i, 1: c, 2:
|
|
757
|
-
if (
|
|
756
|
+
let { 0: i, 1: c, 2: f, length: w } = t.split(".");
|
|
757
|
+
if (w === 5)
|
|
758
758
|
if (r !== void 0)
|
|
759
|
-
t = await r(t), { 0: i, 1: c, 2:
|
|
759
|
+
t = await r(t), { 0: i, 1: c, 2: f, length: w } = t.split(".");
|
|
760
760
|
else
|
|
761
761
|
throw new S("JWE structure JWTs are not supported");
|
|
762
|
-
if (
|
|
762
|
+
if (w !== 3)
|
|
763
763
|
throw new s("Invalid JWT");
|
|
764
764
|
let p;
|
|
765
765
|
try {
|
|
@@ -771,37 +771,37 @@ async function xt(t, e, n, o, a, r) {
|
|
|
771
771
|
throw new s("JWT Header must be a top level object");
|
|
772
772
|
if (e(p), p.crit !== void 0)
|
|
773
773
|
throw new s('unexpected JWT "crit" header parameter');
|
|
774
|
-
const
|
|
774
|
+
const b = k(f);
|
|
775
775
|
let T;
|
|
776
|
-
n !== ke && (T = await n(p), await Lt(i, c, T,
|
|
777
|
-
let
|
|
776
|
+
n !== ke && (T = await n(p), await Lt(i, c, T, b));
|
|
777
|
+
let h;
|
|
778
778
|
try {
|
|
779
|
-
|
|
779
|
+
h = JSON.parse(E(k(c)));
|
|
780
780
|
} catch (l) {
|
|
781
781
|
throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
782
782
|
}
|
|
783
|
-
if (!x(
|
|
783
|
+
if (!x(h))
|
|
784
784
|
throw new s("JWT Payload must be a top level object");
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
if (typeof
|
|
785
|
+
const I = X() + o;
|
|
786
|
+
if (h.exp !== void 0) {
|
|
787
|
+
if (typeof h.exp != "number")
|
|
788
788
|
throw new s('unexpected JWT "exp" (expiration time) claim type');
|
|
789
|
-
if (
|
|
789
|
+
if (h.exp <= I - a)
|
|
790
790
|
throw new s('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
|
|
791
791
|
}
|
|
792
|
-
if (
|
|
792
|
+
if (h.iat !== void 0 && typeof h.iat != "number")
|
|
793
793
|
throw new s('unexpected JWT "iat" (issued at) claim type');
|
|
794
|
-
if (
|
|
794
|
+
if (h.iss !== void 0 && typeof h.iss != "string")
|
|
795
795
|
throw new s('unexpected JWT "iss" (issuer) claim type');
|
|
796
|
-
if (
|
|
797
|
-
if (typeof
|
|
796
|
+
if (h.nbf !== void 0) {
|
|
797
|
+
if (typeof h.nbf != "number")
|
|
798
798
|
throw new s('unexpected JWT "nbf" (not before) claim type');
|
|
799
|
-
if (
|
|
799
|
+
if (h.nbf > I + a)
|
|
800
800
|
throw new s('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
|
|
801
801
|
}
|
|
802
|
-
if (
|
|
802
|
+
if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
|
|
803
803
|
throw new s('unexpected JWT "aud" (audience) claim type');
|
|
804
|
-
return { header: p, claims:
|
|
804
|
+
return { header: p, claims: h, signature: b, key: T, jwt: t };
|
|
805
805
|
}
|
|
806
806
|
function Ct(t, e, n) {
|
|
807
807
|
if (t !== void 0) {
|
|
@@ -823,9 +823,9 @@ function A(t, e) {
|
|
|
823
823
|
throw new s(`"${e}" parameter must be provided only once`);
|
|
824
824
|
return n;
|
|
825
825
|
}
|
|
826
|
-
const
|
|
826
|
+
const jt = Symbol(), It = Symbol();
|
|
827
827
|
function Jt(t, e, n, o) {
|
|
828
|
-
if (C(t),
|
|
828
|
+
if (C(t), j(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
829
829
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
830
830
|
if (A(n, "response"))
|
|
831
831
|
throw new s('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
@@ -836,14 +836,14 @@ function Jt(t, e, n, o) {
|
|
|
836
836
|
throw new s('unexpected "iss" (issuer) response parameter value');
|
|
837
837
|
switch (o) {
|
|
838
838
|
case void 0:
|
|
839
|
-
case
|
|
839
|
+
case It:
|
|
840
840
|
if (r !== void 0)
|
|
841
841
|
throw new s('unexpected "state" response parameter encountered');
|
|
842
842
|
break;
|
|
843
|
-
case
|
|
843
|
+
case jt:
|
|
844
844
|
break;
|
|
845
845
|
default:
|
|
846
|
-
if (!
|
|
846
|
+
if (!m(o))
|
|
847
847
|
throw new s('"expectedState" must be a non-empty string');
|
|
848
848
|
if (r === void 0)
|
|
849
849
|
throw new s('response parameter "state" missing');
|
|
@@ -857,15 +857,15 @@ function Jt(t, e, n, o) {
|
|
|
857
857
|
error_description: A(n, "error_description"),
|
|
858
858
|
error_uri: A(n, "error_uri")
|
|
859
859
|
};
|
|
860
|
-
const c = A(n, "id_token"),
|
|
861
|
-
if (c !== void 0 ||
|
|
860
|
+
const c = A(n, "id_token"), f = A(n, "token");
|
|
861
|
+
if (c !== void 0 || f !== void 0)
|
|
862
862
|
throw new S("implicit and hybrid flows are not supported");
|
|
863
863
|
return St(new URLSearchParams(n));
|
|
864
864
|
}
|
|
865
865
|
function Ot({
|
|
866
866
|
handleCallback: t
|
|
867
867
|
}) {
|
|
868
|
-
const e =
|
|
868
|
+
const e = Ie({
|
|
869
869
|
retry: !1,
|
|
870
870
|
queryKey: ["oauth-callback"],
|
|
871
871
|
queryFn: async () => {
|
|
@@ -890,7 +890,7 @@ class fe extends P {
|
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
892
|
const M = "code-verifier";
|
|
893
|
-
class zt extends
|
|
893
|
+
class zt extends je {
|
|
894
894
|
constructor(e, n) {
|
|
895
895
|
super(), this.callbackUrlPath = e, this.handleCallback = n;
|
|
896
896
|
}
|
|
@@ -912,19 +912,21 @@ class Dt {
|
|
|
912
912
|
redirectToAfterSignUp: a,
|
|
913
913
|
redirectToAfterSignIn: r,
|
|
914
914
|
redirectToAfterSignOut: i,
|
|
915
|
-
basePath: c
|
|
915
|
+
basePath: c,
|
|
916
|
+
scopes: f
|
|
916
917
|
}) {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
918
|
+
_(this, "client");
|
|
919
|
+
_(this, "issuer");
|
|
920
|
+
_(this, "authorizationServer");
|
|
921
|
+
_(this, "callbackUrlPath");
|
|
922
|
+
_(this, "logoutRedirectUrlPath");
|
|
923
|
+
_(this, "onAuthorizationUrl");
|
|
924
|
+
_(this, "redirectToAfterSignUp");
|
|
925
|
+
_(this, "redirectToAfterSignIn");
|
|
926
|
+
_(this, "redirectToAfterSignOut");
|
|
927
|
+
_(this, "audience");
|
|
928
|
+
_(this, "scopes");
|
|
929
|
+
_(this, "signOut", async () => {
|
|
928
930
|
L.setState({
|
|
929
931
|
isAuthenticated: !1,
|
|
930
932
|
isPending: !1,
|
|
@@ -941,7 +943,7 @@ class Dt {
|
|
|
941
943
|
n.toString()
|
|
942
944
|
)) : o = n;
|
|
943
945
|
});
|
|
944
|
-
|
|
946
|
+
_(this, "handleCallback", async () => {
|
|
945
947
|
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(M);
|
|
946
948
|
if (sessionStorage.removeItem(M), !o)
|
|
947
949
|
throw new P("No code verifier found in state.");
|
|
@@ -964,37 +966,37 @@ class Dt {
|
|
|
964
966
|
r,
|
|
965
967
|
i.toString(),
|
|
966
968
|
o
|
|
967
|
-
),
|
|
969
|
+
), f = await Rt(
|
|
968
970
|
a,
|
|
969
971
|
this.client,
|
|
970
972
|
c
|
|
971
973
|
);
|
|
972
|
-
this.setTokensFromResponse(
|
|
973
|
-
const
|
|
974
|
+
this.setTokensFromResponse(f);
|
|
975
|
+
const w = await this.getAccessToken(), b = await (await wt(
|
|
974
976
|
a,
|
|
975
977
|
this.client,
|
|
976
|
-
|
|
978
|
+
w
|
|
977
979
|
)).json(), T = {
|
|
978
|
-
sub:
|
|
979
|
-
email:
|
|
980
|
-
name:
|
|
981
|
-
emailVerified:
|
|
982
|
-
pictureUrl:
|
|
980
|
+
sub: b.sub,
|
|
981
|
+
email: b.email,
|
|
982
|
+
name: b.name,
|
|
983
|
+
emailVerified: b.email_verified ?? !1,
|
|
984
|
+
pictureUrl: b.picture
|
|
983
985
|
};
|
|
984
986
|
L.setState({
|
|
985
987
|
isAuthenticated: !0,
|
|
986
988
|
isPending: !1,
|
|
987
989
|
profile: T
|
|
988
990
|
});
|
|
989
|
-
const
|
|
990
|
-
return sessionStorage.removeItem("redirect-to"),
|
|
991
|
+
const h = sessionStorage.getItem("redirect-to") ?? "/";
|
|
992
|
+
return sessionStorage.removeItem("redirect-to"), h;
|
|
991
993
|
});
|
|
992
994
|
this.client = {
|
|
993
995
|
client_id: o,
|
|
994
996
|
token_endpoint_auth_method: "none"
|
|
995
|
-
}, this.audience = n, this.issuer = e, this.callbackUrlPath = oe(c, "/oauth/callback");
|
|
996
|
-
const
|
|
997
|
-
this.logoutRedirectUrlPath =
|
|
997
|
+
}, this.audience = n, this.issuer = e, this.callbackUrlPath = oe(c, "/oauth/callback"), this.scopes = f ?? ["openid", "profile", "email"];
|
|
998
|
+
const w = oe(c, "/");
|
|
999
|
+
this.logoutRedirectUrlPath = w, this.redirectToAfterSignUp = a ?? w, this.redirectToAfterSignIn = r ?? w, this.redirectToAfterSignOut = i ?? w;
|
|
998
1000
|
}
|
|
999
1001
|
async getAuthServer() {
|
|
1000
1002
|
if (!this.authorizationServer) {
|
|
@@ -1041,7 +1043,7 @@ class Dt {
|
|
|
1041
1043
|
redirectTo: e,
|
|
1042
1044
|
isSignUp: n = !1
|
|
1043
1045
|
}) {
|
|
1044
|
-
var
|
|
1046
|
+
var w, p;
|
|
1045
1047
|
const o = "S256", a = await this.getAuthServer();
|
|
1046
1048
|
if (!a.authorization_endpoint)
|
|
1047
1049
|
throw new P("No authorization endpoint");
|
|
@@ -1051,16 +1053,16 @@ class Dt {
|
|
|
1051
1053
|
a.authorization_endpoint
|
|
1052
1054
|
);
|
|
1053
1055
|
sessionStorage.setItem("redirect-to", e);
|
|
1054
|
-
const
|
|
1055
|
-
if (
|
|
1056
|
+
const f = new URL(window.location.origin);
|
|
1057
|
+
if (f.pathname = this.callbackUrlPath, f.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", f.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
|
|
1056
1058
|
"code_challenge_method",
|
|
1057
1059
|
o
|
|
1058
|
-
), this.audience && c.searchParams.set("audience", this.audience), (
|
|
1060
|
+
), this.audience && c.searchParams.set("audience", this.audience), (w = this.onAuthorizationUrl) == null || w.call(this, c, {
|
|
1059
1061
|
isSignIn: !n,
|
|
1060
1062
|
isSignUp: n
|
|
1061
1063
|
}), ((p = a.code_challenge_methods_supported) == null ? void 0 : p.includes("S256")) !== !0) {
|
|
1062
|
-
const
|
|
1063
|
-
c.searchParams.set("state",
|
|
1064
|
+
const b = nt();
|
|
1065
|
+
c.searchParams.set("state", b);
|
|
1064
1066
|
}
|
|
1065
1067
|
location.href = c.href;
|
|
1066
1068
|
}
|