zudoku 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/demo.js +0 -2
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +14 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +5 -4
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/standalone.js +0 -2
- package/dist/app/standalone.js.map +1 -1
- package/dist/codegen.d.ts +3 -0
- package/dist/codegen.js +45 -0
- package/dist/codegen.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +10 -10
- package/dist/config/validators/validate.d.ts +74 -74
- package/dist/lib/authentication/hook.d.ts +5 -4
- package/dist/lib/authentication/hook.js +1 -3
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +11 -11
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +0 -1
- package/dist/lib/authentication/providers/openid.js +11 -26
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +25 -4
- package/dist/lib/authentication/state.js +28 -5
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +3 -1
- package/dist/lib/components/Bootstrap.js +11 -3
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/DeveloperHint.js +2 -1
- package/dist/lib/components/DeveloperHint.js.map +1 -1
- package/dist/lib/components/Header.js +3 -7
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +11 -3
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +6 -7
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +16 -12
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.d.ts +1 -0
- package/dist/lib/components/ThemeSwitch.js +13 -0
- package/dist/lib/components/ThemeSwitch.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +2 -0
- package/dist/lib/components/TopNavigation.js +13 -7
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +4 -5
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +3 -3
- package/dist/lib/components/context/ZudokuContext.js +7 -12
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +14 -3
- package/dist/lib/components/navigation/Sidebar.js +1 -1
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +2 -2
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +0 -4
- package/dist/lib/core/ZudokuContext.js +0 -5
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +5 -9
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
- package/dist/lib/plugins/openapi/OperationList.js +6 -21
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +4 -4
- package/dist/lib/plugins/openapi/Route.js +2 -4
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +8 -11
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +102 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +13 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
- package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
- package/dist/lib/plugins/openapi/client/worker.js +23 -14
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -52
- package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +134 -9
- package/dist/lib/plugins/openapi/graphql/graphql.js +194 -778
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +40 -53
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +7 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +1 -1
- package/dist/vite/config.js +0 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/html.js +0 -2
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-mdx.js +3 -2
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin.js +0 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/remarkStaticGeneration.d.ts +3 -0
- package/dist/vite/remarkStaticGeneration.js +125 -0
- package/dist/vite/remarkStaticGeneration.js.map +1 -0
- package/lib/{AnchorLink-DYbUOP9U.js → AnchorLink-CDlhr8gL.js} +11 -10
- package/lib/{AnchorLink-DYbUOP9U.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
- package/lib/{AuthenticationPlugin-bqGAKfot.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
- package/lib/{AuthenticationPlugin-bqGAKfot.js.map → AuthenticationPlugin-DeGDVa1r.js.map} +1 -1
- package/lib/{Spinner-ChOGyPls.js → Button-jK0EsymC.js} +12 -15
- package/lib/Button-jK0EsymC.js.map +1 -0
- package/lib/Markdown-ievDDhFT.js +15192 -0
- package/lib/Markdown-ievDDhFT.js.map +1 -0
- package/lib/{MdxPage-DRKqyn2b.js → MdxPage-Bwn-VSsH.js} +5 -5
- package/lib/{MdxPage-DRKqyn2b.js.map → MdxPage-Bwn-VSsH.js.map} +1 -1
- package/lib/OperationList-BwBl1xrD.js +4691 -0
- package/lib/OperationList-BwBl1xrD.js.map +1 -0
- package/lib/Route-DlG_HTMu.js +11 -0
- package/lib/Route-DlG_HTMu.js.map +1 -0
- package/lib/{Select-DYKDahHt.js → Select-O9ZM3ZgX.js} +7 -7
- package/lib/Select-O9ZM3ZgX.js.map +1 -0
- package/lib/SidebarBadge-DxFJcJ6V.js +51 -0
- package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
- package/lib/SlotletProvider-DyomlzGx.js +252 -0
- package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
- package/lib/Spinner-3cQDBVGr.js +7 -0
- package/lib/Spinner-3cQDBVGr.js.map +1 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
- package/lib/assets/{worker-YA-aCP3P.js → worker-CPsGZsve.js} +24 -22
- package/lib/assets/{worker-YA-aCP3P.js.map → worker-CPsGZsve.js.map} +1 -1
- package/lib/context-D1nXWxm7.js +22 -0
- package/lib/context-D1nXWxm7.js.map +1 -0
- package/lib/createServer-DK-g7kbB.js +16089 -0
- package/lib/createServer-DK-g7kbB.js.map +1 -0
- package/lib/{hook-CjQERPa7.js → hook-hEqe7fPB.js} +12 -14
- package/lib/hook-hEqe7fPB.js.map +1 -0
- package/lib/index-Czzd9rjU.js +899 -0
- package/lib/index-Czzd9rjU.js.map +1 -0
- package/lib/index-DNxQ_rCt.js +1273 -0
- package/lib/index-DNxQ_rCt.js.map +1 -0
- package/lib/index-Yn8c3UWE.js +921 -0
- package/lib/index-Yn8c3UWE.js.map +1 -0
- package/lib/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
- package/lib/{router-BsfSoK2j.js.map → router-lfyopgBI.js.map} +1 -1
- package/lib/state-tsXBLONe.js +203 -0
- package/lib/state-tsXBLONe.js.map +1 -0
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/useExposedProps-CTPtylCV.js +10 -0
- package/lib/{useExposedProps-BxyHjPNN.js.map → useExposedProps-CTPtylCV.js.map} +1 -1
- package/lib/{utils-DNAltzXc.js → utils-DcpDOncX.js} +197 -202
- package/lib/utils-DcpDOncX.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +24 -18
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +124 -138
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1133 -992
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +10 -16346
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +18 -18
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -9
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +14 -4
- package/src/app/demo.tsx +0 -3
- package/src/app/entry.client.tsx +14 -0
- package/src/app/entry.server.tsx +59 -57
- package/src/app/standalone.tsx +0 -3
- package/src/lib/authentication/hook.ts +1 -3
- package/src/lib/authentication/providers/auth0.tsx +16 -11
- package/src/lib/authentication/providers/openid.tsx +12 -30
- package/src/lib/authentication/state.ts +44 -10
- package/src/lib/components/Bootstrap.tsx +36 -9
- package/src/lib/components/DeveloperHint.tsx +6 -1
- package/src/lib/components/Header.tsx +31 -42
- package/src/lib/components/Layout.tsx +48 -36
- package/src/lib/components/MobileTopNavigation.tsx +15 -18
- package/src/lib/components/SyntaxHighlight.tsx +81 -46
- package/src/lib/components/ThemeSwitch.tsx +26 -0
- package/src/lib/components/TopNavigation.tsx +27 -19
- package/src/lib/components/Zudoku.tsx +5 -10
- package/src/lib/components/context/ZudokuContext.ts +8 -13
- package/src/lib/components/navigation/Sidebar.tsx +3 -3
- package/src/lib/components/navigation/utils.ts +2 -2
- package/src/lib/core/ZudokuContext.ts +0 -8
- package/src/lib/errors/ErrorAlert.tsx +2 -1
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
- package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
- package/src/lib/plugins/openapi/OperationList.tsx +5 -40
- package/src/lib/plugins/openapi/Route.tsx +11 -12
- package/src/lib/plugins/openapi/Sidecar.tsx +10 -13
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +140 -0
- package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
- package/src/lib/plugins/openapi/client/createServer.ts +2 -0
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +18 -0
- package/src/lib/plugins/openapi/client/worker.ts +38 -24
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
- package/src/lib/plugins/openapi/graphql/gql.ts +7 -25
- package/src/lib/plugins/openapi/graphql/graphql.ts +351 -782
- package/src/lib/plugins/openapi/index.tsx +40 -63
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
- package/src/lib/plugins/openapi-worker.ts +11 -1
- package/dist/lib/components/context/ThemeContext.d.ts +0 -2
- package/dist/lib/components/context/ThemeContext.js +0 -7
- package/dist/lib/components/context/ThemeContext.js.map +0 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
- package/dist/lib/components/context/ThemeProvider.js +0 -23
- package/dist/lib/components/context/ThemeProvider.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -9
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -54
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -62
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
- package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
- package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
- package/dist/lib/themeToggle.d.ts +0 -1
- package/dist/lib/themeToggle.js +0 -7
- package/dist/lib/themeToggle.js.map +0 -1
- package/dist/lib/util/createWaitForNotify.d.ts +0 -1
- package/dist/lib/util/createWaitForNotify.js +0 -15
- package/dist/lib/util/createWaitForNotify.js.map +0 -1
- package/dist/vite/plugin-html-transform.d.ts +0 -2
- package/dist/vite/plugin-html-transform.js +0 -15
- package/dist/vite/plugin-html-transform.js.map +0 -1
- package/lib/DeveloperHint-DHdLXGHA.js +0 -16
- package/lib/DeveloperHint-DHdLXGHA.js.map +0 -1
- package/lib/Markdown-D6UxMbZm.js +0 -18059
- package/lib/Markdown-D6UxMbZm.js.map +0 -1
- package/lib/OperationList-BHUBGM0c.js +0 -621
- package/lib/OperationList-BHUBGM0c.js.map +0 -1
- package/lib/Route-B0XuN1oC.js +0 -13
- package/lib/Route-B0XuN1oC.js.map +0 -1
- package/lib/Select-DYKDahHt.js.map +0 -1
- package/lib/SidebarBadge-Bbt92M5K.js +0 -38
- package/lib/SidebarBadge-Bbt92M5K.js.map +0 -1
- package/lib/SlotletProvider-mhjLPG44.js +0 -241
- package/lib/SlotletProvider-mhjLPG44.js.map +0 -1
- package/lib/Spinner-ChOGyPls.js.map +0 -1
- package/lib/StaggeredRender-DDHSzQKE.js +0 -17
- package/lib/StaggeredRender-DDHSzQKE.js.map +0 -1
- package/lib/hook-CjQERPa7.js.map +0 -1
- package/lib/index-BRg5pi5D.js +0 -5902
- package/lib/index-BRg5pi5D.js.map +0 -1
- package/lib/index-DM9hrcCG.js +0 -1783
- package/lib/index-DM9hrcCG.js.map +0 -1
- package/lib/state-BsPrOUAh.js +0 -252
- package/lib/state-BsPrOUAh.js.map +0 -1
- package/lib/urql-core-35Qt_U4i.js +0 -1511
- package/lib/urql-core-35Qt_U4i.js.map +0 -1
- package/lib/useExposedProps-BxyHjPNN.js +0 -9
- package/lib/utils-DNAltzXc.js.map +0 -1
- package/src/lib/components/context/ThemeContext.tsx +0 -8
- package/src/lib/components/context/ThemeProvider.tsx +0 -27
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -65
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -79
- package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
- package/src/lib/themeToggle.ts +0 -7
- package/src/lib/util/createWaitForNotify.ts +0 -18
|
@@ -3,11 +3,11 @@ var je = (t, e, n) => e in t ? Ie(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var b = (t, e, n) => je(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { j as fe } from "./jsx-runtime-B6kdoens.js";
|
|
5
5
|
import { c as Je, g as Oe } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
6
|
-
import { A as
|
|
7
|
-
import { g as
|
|
8
|
-
import { Z as
|
|
9
|
-
import {
|
|
10
|
-
import { u as
|
|
6
|
+
import { A as ze } from "./AuthenticationPlugin-DeGDVa1r.js";
|
|
7
|
+
import { g as De } from "./utils-DcpDOncX.js";
|
|
8
|
+
import { Z as Ne } from "./invariant-Caa8-XvF.js";
|
|
9
|
+
import { l as Ke } from "./index-Czzd9rjU.js";
|
|
10
|
+
import { u as z } from "./state-tsXBLONe.js";
|
|
11
11
|
var pe = { exports: {} };
|
|
12
12
|
(function(t) {
|
|
13
13
|
(function(e, n) {
|
|
@@ -21,8 +21,8 @@ var pe = { exports: {} };
|
|
|
21
21
|
"warn",
|
|
22
22
|
"error"
|
|
23
23
|
], r = {}, i = null;
|
|
24
|
-
function c(l,
|
|
25
|
-
var u = l[
|
|
24
|
+
function c(l, m) {
|
|
25
|
+
var u = l[m];
|
|
26
26
|
if (typeof u.bind == "function")
|
|
27
27
|
return u.bind(l);
|
|
28
28
|
try {
|
|
@@ -40,9 +40,9 @@ var pe = { exports: {} };
|
|
|
40
40
|
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? p : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
|
|
41
41
|
}
|
|
42
42
|
function f() {
|
|
43
|
-
for (var l = this.getLevel(),
|
|
44
|
-
var u = a[
|
|
45
|
-
this[u] =
|
|
43
|
+
for (var l = this.getLevel(), m = 0; m < a.length; m++) {
|
|
44
|
+
var u = a[m];
|
|
45
|
+
this[u] = m < l ? e : this.methodFactory(u, l, this.name);
|
|
46
46
|
}
|
|
47
47
|
if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
|
|
48
48
|
return "No console available for logging";
|
|
@@ -52,27 +52,27 @@ var pe = { exports: {} };
|
|
|
52
52
|
typeof console !== n && (f.call(this), this[l].apply(this, arguments));
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function T(l,
|
|
55
|
+
function T(l, m, u) {
|
|
56
56
|
return _(l) || y.apply(this, arguments);
|
|
57
57
|
}
|
|
58
|
-
function h(l,
|
|
58
|
+
function h(l, m) {
|
|
59
59
|
var u = this, J, F, R, v = "loglevel";
|
|
60
60
|
typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
|
|
61
|
-
function
|
|
62
|
-
var
|
|
61
|
+
function Ce(d) {
|
|
62
|
+
var g = (a[d] || "silent").toUpperCase();
|
|
63
63
|
if (!(typeof window === n || !v)) {
|
|
64
64
|
try {
|
|
65
|
-
window.localStorage[v] =
|
|
65
|
+
window.localStorage[v] = g;
|
|
66
66
|
return;
|
|
67
67
|
} catch {
|
|
68
68
|
}
|
|
69
69
|
try {
|
|
70
|
-
window.document.cookie = encodeURIComponent(v) + "=" +
|
|
70
|
+
window.document.cookie = encodeURIComponent(v) + "=" + g + ";";
|
|
71
71
|
} catch {
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function te() {
|
|
76
76
|
var d;
|
|
77
77
|
if (!(typeof window === n || !v)) {
|
|
78
78
|
try {
|
|
@@ -81,16 +81,16 @@ var pe = { exports: {} };
|
|
|
81
81
|
}
|
|
82
82
|
if (typeof d === n)
|
|
83
83
|
try {
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
var g = window.document.cookie, O = encodeURIComponent(v), re = g.indexOf(O + "=");
|
|
85
|
+
re !== -1 && (d = /^([^;]+)/.exec(
|
|
86
|
+
g.slice(re + O.length + 1)
|
|
87
87
|
)[1]);
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
return u.levels[d] === void 0 && (d = void 0), d;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Le() {
|
|
94
94
|
if (!(typeof window === n || !v)) {
|
|
95
95
|
try {
|
|
96
96
|
window.localStorage.removeItem(v);
|
|
@@ -103,9 +103,9 @@ var pe = { exports: {} };
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
function U(d) {
|
|
106
|
-
var
|
|
107
|
-
if (typeof
|
|
108
|
-
return
|
|
106
|
+
var g = d;
|
|
107
|
+
if (typeof g == "string" && u.levels[g.toUpperCase()] !== void 0 && (g = u.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= u.levels.SILENT)
|
|
108
|
+
return g;
|
|
109
109
|
throw new TypeError("log.setLevel() called with invalid level: " + d);
|
|
110
110
|
}
|
|
111
111
|
u.name = l, u.levels = {
|
|
@@ -115,14 +115,14 @@ var pe = { exports: {} };
|
|
|
115
115
|
WARN: 3,
|
|
116
116
|
ERROR: 4,
|
|
117
117
|
SILENT: 5
|
|
118
|
-
}, u.methodFactory =
|
|
118
|
+
}, u.methodFactory = m || T, u.getLevel = function() {
|
|
119
119
|
return R ?? F ?? J;
|
|
120
|
-
}, u.setLevel = function(d,
|
|
121
|
-
return R = U(d),
|
|
120
|
+
}, u.setLevel = function(d, g) {
|
|
121
|
+
return R = U(d), g !== !1 && Ce(R), f.call(u);
|
|
122
122
|
}, u.setDefaultLevel = function(d) {
|
|
123
|
-
F = U(d),
|
|
123
|
+
F = U(d), te() || u.setLevel(d, !1);
|
|
124
124
|
}, u.resetLevel = function() {
|
|
125
|
-
R = null,
|
|
125
|
+
R = null, Le(), f.call(u);
|
|
126
126
|
}, u.enableAll = function(d) {
|
|
127
127
|
u.setLevel(u.levels.TRACE, d);
|
|
128
128
|
}, u.disableAll = function(d) {
|
|
@@ -134,15 +134,15 @@ var pe = { exports: {} };
|
|
|
134
134
|
}, J = U(
|
|
135
135
|
i ? i.getLevel() : "WARN"
|
|
136
136
|
);
|
|
137
|
-
var
|
|
138
|
-
|
|
137
|
+
var ne = te();
|
|
138
|
+
ne != null && (R = U(ne)), f.call(u);
|
|
139
139
|
}
|
|
140
|
-
i = new h(), i.getLogger = function(
|
|
141
|
-
if (typeof
|
|
140
|
+
i = new h(), i.getLogger = function(m) {
|
|
141
|
+
if (typeof m != "symbol" && typeof m != "string" || m === "")
|
|
142
142
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
143
|
-
var u = r[
|
|
144
|
-
return u || (u = r[
|
|
145
|
-
|
|
143
|
+
var u = r[m];
|
|
144
|
+
return u || (u = r[m] = new h(
|
|
145
|
+
m,
|
|
146
146
|
i.methodFactory
|
|
147
147
|
)), u;
|
|
148
148
|
};
|
|
@@ -155,11 +155,11 @@ var pe = { exports: {} };
|
|
|
155
155
|
});
|
|
156
156
|
})(pe);
|
|
157
157
|
var We = pe.exports;
|
|
158
|
-
const
|
|
159
|
-
let
|
|
160
|
-
var
|
|
161
|
-
(typeof navigator > "u" || !((he = (
|
|
162
|
-
function
|
|
158
|
+
const oe = /* @__PURE__ */ Oe(We);
|
|
159
|
+
let V;
|
|
160
|
+
var D, he;
|
|
161
|
+
(typeof navigator > "u" || !((he = (D = navigator.userAgent) == null ? void 0 : D.startsWith) != null && he.call(D, "Mozilla/5.0 "))) && (V = "oauth4webapi/v2.17.0");
|
|
162
|
+
function Z(t, e) {
|
|
163
163
|
if (t == null)
|
|
164
164
|
return !1;
|
|
165
165
|
try {
|
|
@@ -168,7 +168,7 @@ function Y(t, e) {
|
|
|
168
168
|
return !1;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
const K = Symbol(), He = Symbol(),
|
|
171
|
+
const K = Symbol(), He = Symbol(), Y = Symbol(), we = Symbol(), $e = Symbol(), Fe = Symbol(), Me = new TextEncoder(), Be = new TextDecoder();
|
|
172
172
|
function E(t) {
|
|
173
173
|
return typeof t == "string" ? Me.encode(t) : Be.decode(t);
|
|
174
174
|
}
|
|
@@ -229,37 +229,37 @@ class Ze extends Error {
|
|
|
229
229
|
super(e, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
const s = Ze,
|
|
233
|
-
function
|
|
232
|
+
const s = Ze, me = new Ge(100);
|
|
233
|
+
function ge(t) {
|
|
234
234
|
return t instanceof CryptoKey;
|
|
235
235
|
}
|
|
236
236
|
function ye(t) {
|
|
237
|
-
return
|
|
237
|
+
return ge(t) && t.type === "private";
|
|
238
238
|
}
|
|
239
239
|
function Ye(t) {
|
|
240
|
-
return
|
|
240
|
+
return ge(t) && t.type === "public";
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Q(t) {
|
|
243
243
|
try {
|
|
244
244
|
const e = t.headers.get("dpop-nonce");
|
|
245
|
-
e &&
|
|
245
|
+
e && me.set(new URL(t.url).origin, e);
|
|
246
246
|
} catch {
|
|
247
247
|
}
|
|
248
248
|
return t;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function C(t) {
|
|
251
251
|
return !(t === null || typeof t != "object" || Array.isArray(t));
|
|
252
252
|
}
|
|
253
253
|
function W(t) {
|
|
254
|
-
|
|
254
|
+
Z(t, Headers) && (t = Object.fromEntries(t.entries()));
|
|
255
255
|
const e = new Headers(t);
|
|
256
|
-
if (
|
|
256
|
+
if (V && !e.has("user-agent") && e.set("user-agent", V), e.has("authorization"))
|
|
257
257
|
throw new TypeError('"options.headers" must not include the "authorization" header name');
|
|
258
258
|
if (e.has("dpop"))
|
|
259
259
|
throw new TypeError('"options.headers" must not include the "dpop" header name');
|
|
260
260
|
return e;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function X(t) {
|
|
263
263
|
if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
|
|
264
264
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
265
265
|
return t;
|
|
@@ -282,12 +282,12 @@ async function Qe(t, e) {
|
|
|
282
282
|
throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
|
|
283
283
|
}
|
|
284
284
|
const o = W(e == null ? void 0 : e.headers);
|
|
285
|
-
return o.set("accept", "application/json"), ((e == null ? void 0 : e[
|
|
285
|
+
return o.set("accept", "application/json"), ((e == null ? void 0 : e[Y]) || fetch)(n.href, {
|
|
286
286
|
headers: Object.fromEntries(o.entries()),
|
|
287
287
|
method: "GET",
|
|
288
288
|
redirect: "manual",
|
|
289
|
-
signal: e != null && e.signal ?
|
|
290
|
-
}).then(
|
|
289
|
+
signal: e != null && e.signal ? X(e.signal) : null
|
|
290
|
+
}).then(Q);
|
|
291
291
|
}
|
|
292
292
|
function w(t) {
|
|
293
293
|
return typeof t == "string" && t.length !== 0;
|
|
@@ -295,18 +295,18 @@ function w(t) {
|
|
|
295
295
|
async function Xe(t, e) {
|
|
296
296
|
if (!(t instanceof URL))
|
|
297
297
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
298
|
-
if (!
|
|
298
|
+
if (!Z(e, Response))
|
|
299
299
|
throw new TypeError('"response" must be an instance of Response');
|
|
300
300
|
if (e.status !== 200)
|
|
301
301
|
throw new s('"response" is not a conform Authorization Server Metadata response');
|
|
302
|
-
|
|
302
|
+
ee(e);
|
|
303
303
|
let n;
|
|
304
304
|
try {
|
|
305
305
|
n = await e.json();
|
|
306
306
|
} catch (o) {
|
|
307
307
|
throw new s('failed to parse "response" body as JSON', { cause: o });
|
|
308
308
|
}
|
|
309
|
-
if (!
|
|
309
|
+
if (!C(n))
|
|
310
310
|
throw new s('"response" body must be a top level object');
|
|
311
311
|
if (!w(n.issuer))
|
|
312
312
|
throw new s('"response" body "issuer" property must be a non-empty string');
|
|
@@ -399,7 +399,7 @@ function be(t) {
|
|
|
399
399
|
throw new S("unsupported CryptoKey algorithm name");
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function L(t) {
|
|
403
403
|
const e = t == null ? void 0 : t[K];
|
|
404
404
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
405
405
|
}
|
|
@@ -411,7 +411,7 @@ function $() {
|
|
|
411
411
|
return Math.floor(Date.now() / 1e3);
|
|
412
412
|
}
|
|
413
413
|
function ct(t, e) {
|
|
414
|
-
const n = $() +
|
|
414
|
+
const n = $() + L(e);
|
|
415
415
|
return {
|
|
416
416
|
jti: H(),
|
|
417
417
|
aud: [t.issuer, t.token_endpoint],
|
|
@@ -445,7 +445,7 @@ function se(t) {
|
|
|
445
445
|
throw new TypeError('"client.client_secret" property must be a non-empty string');
|
|
446
446
|
return t;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function M(t, e) {
|
|
449
449
|
if (e !== void 0)
|
|
450
450
|
throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${t} client authentication method is used.`);
|
|
451
451
|
}
|
|
@@ -457,11 +457,11 @@ async function lt(t, e, n, o, a) {
|
|
|
457
457
|
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
|
|
458
458
|
case void 0:
|
|
459
459
|
case "client_secret_basic": {
|
|
460
|
-
|
|
460
|
+
M("client_secret_basic", a), o.set("authorization", ot(e.client_id, se(e.client_secret)));
|
|
461
461
|
break;
|
|
462
462
|
}
|
|
463
463
|
case "client_secret_post": {
|
|
464
|
-
|
|
464
|
+
M("client_secret_post", a), n.set("client_id", e.client_id), n.set("client_secret", se(e.client_secret));
|
|
465
465
|
break;
|
|
466
466
|
}
|
|
467
467
|
case "private_key_jwt": {
|
|
@@ -476,7 +476,7 @@ async function lt(t, e, n, o, a) {
|
|
|
476
476
|
case "tls_client_auth":
|
|
477
477
|
case "self_signed_tls_client_auth":
|
|
478
478
|
case "none": {
|
|
479
|
-
ce(e.token_endpoint_auth_method, e.client_secret),
|
|
479
|
+
ce(e.token_endpoint_auth_method, e.client_secret), M(e.token_endpoint_auth_method, a), n.set("client_id", e.client_id);
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
482
|
default:
|
|
@@ -491,7 +491,7 @@ async function ve(t, e, n) {
|
|
|
491
491
|
}
|
|
492
492
|
async function dt(t, e, n, o, a, r) {
|
|
493
493
|
var T;
|
|
494
|
-
const { privateKey: i, publicKey: c, nonce: p =
|
|
494
|
+
const { privateKey: i, publicKey: c, nonce: p = me.get(n.origin) } = e;
|
|
495
495
|
if (!ye(i))
|
|
496
496
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
497
497
|
if (!Ye(c))
|
|
@@ -514,13 +514,13 @@ async function dt(t, e, n, o, a, r) {
|
|
|
514
514
|
};
|
|
515
515
|
(T = e[we]) == null || T.call(e, f, y), t.set("dpop", await ve(f, y, i));
|
|
516
516
|
}
|
|
517
|
-
let
|
|
517
|
+
let N;
|
|
518
518
|
async function ht(t) {
|
|
519
519
|
const { kty: e, e: n, n: o, x: a, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: a, y: r, crv: i };
|
|
520
|
-
return
|
|
520
|
+
return N.set(t, c), c;
|
|
521
521
|
}
|
|
522
522
|
async function ft(t) {
|
|
523
|
-
return
|
|
523
|
+
return N || (N = /* @__PURE__ */ new WeakMap()), N.get(t) || ht(t);
|
|
524
524
|
}
|
|
525
525
|
function ue(t, e, n) {
|
|
526
526
|
if (typeof t != "string")
|
|
@@ -533,7 +533,7 @@ function Se(t, e, n = !1) {
|
|
|
533
533
|
function Te(t, e) {
|
|
534
534
|
return !!(t.use_mtls_endpoint_aliases || e != null && e[Fe]);
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function G(t) {
|
|
537
537
|
const e = t;
|
|
538
538
|
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
539
539
|
}
|
|
@@ -542,38 +542,38 @@ async function pt(t, e, n, o, a, r) {
|
|
|
542
542
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
543
543
|
if (!(n instanceof URL))
|
|
544
544
|
throw new TypeError('"url" must be an instance of URL');
|
|
545
|
-
return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, r.DPoP, n, e.toUpperCase(),
|
|
545
|
+
return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, r.DPoP, n, e.toUpperCase(), L({ [K]: r == null ? void 0 : r[K] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[Y]) || fetch)(n.href, {
|
|
546
546
|
body: a,
|
|
547
547
|
headers: Object.fromEntries(o.entries()),
|
|
548
548
|
method: e,
|
|
549
549
|
redirect: "manual",
|
|
550
|
-
signal: r != null && r.signal ?
|
|
551
|
-
}).then(
|
|
550
|
+
signal: r != null && r.signal ? X(r.signal) : null
|
|
551
|
+
}).then(Q);
|
|
552
552
|
}
|
|
553
553
|
async function wt(t, e, n, o) {
|
|
554
554
|
x(t), I(e);
|
|
555
555
|
const a = Se(t, "userinfo_endpoint", Te(e, o)), r = W(o == null ? void 0 : o.headers);
|
|
556
556
|
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, {
|
|
557
557
|
...o,
|
|
558
|
-
[K]:
|
|
558
|
+
[K]: L(e)
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
|
-
async function
|
|
562
|
-
return await lt(t, e, a, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[
|
|
561
|
+
async function mt(t, e, n, o, a, r, i) {
|
|
562
|
+
return await lt(t, e, a, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[Y]) || fetch)(o.href, {
|
|
563
563
|
body: a,
|
|
564
564
|
headers: Object.fromEntries(r.entries()),
|
|
565
565
|
method: n,
|
|
566
566
|
redirect: "manual",
|
|
567
|
-
signal: i != null && i.signal ?
|
|
568
|
-
}).then(
|
|
567
|
+
signal: i != null && i.signal ? X(i.signal) : null
|
|
568
|
+
}).then(Q);
|
|
569
569
|
}
|
|
570
570
|
async function ke(t, e, n, o, a) {
|
|
571
571
|
const r = Se(t, "token_endpoint", Te(e, a));
|
|
572
572
|
o.set("grant_type", n);
|
|
573
573
|
const i = W(a == null ? void 0 : a.headers);
|
|
574
|
-
return i.set("accept", "application/json"),
|
|
574
|
+
return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, a);
|
|
575
575
|
}
|
|
576
|
-
async function
|
|
576
|
+
async function gt(t, e, n, o) {
|
|
577
577
|
if (x(t), I(e), !w(n))
|
|
578
578
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
579
579
|
const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
@@ -589,7 +589,7 @@ function yt(t) {
|
|
|
589
589
|
return e[0];
|
|
590
590
|
}
|
|
591
591
|
async function Ee(t, e, n, o = !1, a = !1) {
|
|
592
|
-
if (x(t), I(e), !
|
|
592
|
+
if (x(t), I(e), !Z(n, Response))
|
|
593
593
|
throw new TypeError('"response" must be an instance of Response');
|
|
594
594
|
if (n.status !== 200) {
|
|
595
595
|
let i;
|
|
@@ -597,14 +597,14 @@ async function Ee(t, e, n, o = !1, a = !1) {
|
|
|
597
597
|
return i;
|
|
598
598
|
throw new s('"response" is not a conform Token Endpoint response');
|
|
599
599
|
}
|
|
600
|
-
|
|
600
|
+
ee(n);
|
|
601
601
|
let r;
|
|
602
602
|
try {
|
|
603
603
|
r = await n.json();
|
|
604
604
|
} catch (i) {
|
|
605
605
|
throw new s('failed to parse "response" body as JSON', { cause: i });
|
|
606
606
|
}
|
|
607
|
-
if (!
|
|
607
|
+
if (!C(r))
|
|
608
608
|
throw new s('"response" body must be a top level object');
|
|
609
609
|
if (!w(r.access_token))
|
|
610
610
|
throw new s('"response" body "access_token" property must be a non-empty string');
|
|
@@ -622,7 +622,7 @@ async function Ee(t, e, n, o = !1, a = !1) {
|
|
|
622
622
|
if (r.id_token !== void 0 && !w(r.id_token))
|
|
623
623
|
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
624
624
|
if (r.id_token) {
|
|
625
|
-
const { claims: i, jwt: c } = await
|
|
625
|
+
const { claims: i, jwt: c } = await Lt(r.id_token, xt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ue, L(e), _e(e), e[$e]).then(At.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(vt.bind(void 0, t.issuer)).then(_t.bind(void 0, e.client_id));
|
|
626
626
|
if (Array.isArray(i.aud) && i.aud.length !== 1) {
|
|
627
627
|
if (i.azp === void 0)
|
|
628
628
|
throw new s('ID Token "aud" (audience) claim includes additional untrusted audiences');
|
|
@@ -691,21 +691,21 @@ function At(t, e) {
|
|
|
691
691
|
throw new s(`JWT "${n}" (${kt[n]}) claim missing`);
|
|
692
692
|
return e;
|
|
693
693
|
}
|
|
694
|
-
const Et = Symbol(),
|
|
694
|
+
const Et = Symbol(), B = Symbol();
|
|
695
695
|
async function Rt(t, e, n, o, a) {
|
|
696
696
|
const r = await Ee(t, e, n);
|
|
697
|
-
if (
|
|
697
|
+
if (G(r))
|
|
698
698
|
return r;
|
|
699
699
|
if (!w(r.id_token))
|
|
700
700
|
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
701
|
-
a ?? (a = e.default_max_age ??
|
|
701
|
+
a ?? (a = e.default_max_age ?? B);
|
|
702
702
|
const i = yt(r);
|
|
703
|
-
if ((e.require_auth_time || a !==
|
|
703
|
+
if ((e.require_auth_time || a !== B) && i.auth_time === void 0)
|
|
704
704
|
throw new s('ID Token "auth_time" (authentication time) claim missing');
|
|
705
|
-
if (a !==
|
|
705
|
+
if (a !== B) {
|
|
706
706
|
if (typeof a != "number" || a < 0)
|
|
707
707
|
throw new TypeError('"maxAge" must be a non-negative number');
|
|
708
|
-
const c = $() +
|
|
708
|
+
const c = $() + L(e), p = _e(e);
|
|
709
709
|
if (i.auth_time + a < c - p)
|
|
710
710
|
throw new s("too much time has elapsed since the last End-User authentication");
|
|
711
711
|
}
|
|
@@ -725,16 +725,16 @@ async function Rt(t, e, n, o, a) {
|
|
|
725
725
|
}
|
|
726
726
|
return r;
|
|
727
727
|
}
|
|
728
|
-
function
|
|
728
|
+
function ee(t) {
|
|
729
729
|
if (t.bodyUsed)
|
|
730
730
|
throw new TypeError('"response" body has been used already');
|
|
731
731
|
}
|
|
732
732
|
async function Pt(t) {
|
|
733
733
|
if (t.status > 399 && t.status < 500) {
|
|
734
|
-
|
|
734
|
+
ee(t);
|
|
735
735
|
try {
|
|
736
736
|
const e = await t.json();
|
|
737
|
-
if (
|
|
737
|
+
if (C(e) && typeof e.error == "string" && e.error.length)
|
|
738
738
|
return e.error_description !== void 0 && typeof e.error_description != "string" && delete e.error_description, e.error_uri !== void 0 && typeof e.error_uri != "string" && delete e.error_uri, e.algs !== void 0 && typeof e.algs != "string" && delete e.algs, e.scope !== void 0 && typeof e.scope != "string" && delete e.scope, e;
|
|
739
739
|
} catch {
|
|
740
740
|
}
|
|
@@ -784,12 +784,12 @@ function Pe(t) {
|
|
|
784
784
|
throw new S();
|
|
785
785
|
}
|
|
786
786
|
const Ue = Symbol();
|
|
787
|
-
async function
|
|
787
|
+
async function Ct(t, e, n, o) {
|
|
788
788
|
const a = `${t}.${e}`;
|
|
789
789
|
if (!await crypto.subtle.verify(Pe(n), n, o, E(a)))
|
|
790
790
|
throw new s("JWT signature verification failed");
|
|
791
791
|
}
|
|
792
|
-
async function
|
|
792
|
+
async function Lt(t, e, n, o, a, r) {
|
|
793
793
|
let { 0: i, 1: c, 2: p, length: _ } = t.split(".");
|
|
794
794
|
if (_ === 5)
|
|
795
795
|
if (r !== void 0)
|
|
@@ -804,20 +804,20 @@ async function Ct(t, e, n, o, a, r) {
|
|
|
804
804
|
} catch (l) {
|
|
805
805
|
throw new s("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
|
|
806
806
|
}
|
|
807
|
-
if (!
|
|
807
|
+
if (!C(f))
|
|
808
808
|
throw new s("JWT Header must be a top level object");
|
|
809
809
|
if (e(f), f.crit !== void 0)
|
|
810
810
|
throw new s('unexpected JWT "crit" header parameter');
|
|
811
811
|
const y = A(p);
|
|
812
812
|
let T;
|
|
813
|
-
n !== Ue && (T = await n(f), await
|
|
813
|
+
n !== Ue && (T = await n(f), await Ct(i, c, T, y));
|
|
814
814
|
let h;
|
|
815
815
|
try {
|
|
816
816
|
h = JSON.parse(E(A(c)));
|
|
817
817
|
} catch (l) {
|
|
818
818
|
throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
819
819
|
}
|
|
820
|
-
if (!
|
|
820
|
+
if (!C(h))
|
|
821
821
|
throw new s("JWT Payload must be a top level object");
|
|
822
822
|
const j = $() + o;
|
|
823
823
|
if (h.exp !== void 0) {
|
|
@@ -902,14 +902,14 @@ function Jt(t, e, n, o) {
|
|
|
902
902
|
function Ot({
|
|
903
903
|
handleCallback: t
|
|
904
904
|
}) {
|
|
905
|
-
const e =
|
|
905
|
+
const e = De({
|
|
906
906
|
retry: !1,
|
|
907
907
|
queryKey: ["oauth-callback"],
|
|
908
908
|
queryFn: async () => {
|
|
909
909
|
try {
|
|
910
910
|
return await t();
|
|
911
911
|
} catch (n) {
|
|
912
|
-
throw new
|
|
912
|
+
throw new Ne("Could not validate user", {
|
|
913
913
|
cause: n,
|
|
914
914
|
title: "Authentication Error",
|
|
915
915
|
developerHint: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly."
|
|
@@ -926,8 +926,8 @@ class de extends P {
|
|
|
926
926
|
super(e, o), this.error = n;
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
const
|
|
930
|
-
class
|
|
929
|
+
const q = "code-verifier";
|
|
930
|
+
class zt extends ze {
|
|
931
931
|
constructor(e, n) {
|
|
932
932
|
super(), this.callbackUrlPath = e, this.handleCallback = n;
|
|
933
933
|
}
|
|
@@ -941,7 +941,7 @@ class Nt extends Ne {
|
|
|
941
941
|
];
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
|
-
class
|
|
944
|
+
class Dt {
|
|
945
945
|
constructor({
|
|
946
946
|
issuer: e,
|
|
947
947
|
audience: n,
|
|
@@ -961,11 +961,12 @@ class zt {
|
|
|
961
961
|
b(this, "redirectToAfterSignOut");
|
|
962
962
|
b(this, "audience");
|
|
963
963
|
b(this, "signOut", async () => {
|
|
964
|
-
|
|
964
|
+
z.setState({
|
|
965
965
|
isAuthenticated: !1,
|
|
966
966
|
isPending: !1,
|
|
967
|
-
profile: void 0
|
|
968
|
-
|
|
967
|
+
profile: void 0,
|
|
968
|
+
providerData: void 0
|
|
969
|
+
});
|
|
969
970
|
const e = await this.getAuthServer(), n = new URL(
|
|
970
971
|
window.location.origin + this.redirectToAfterSignOut
|
|
971
972
|
);
|
|
@@ -977,8 +978,8 @@ class zt {
|
|
|
977
978
|
)) : o = n;
|
|
978
979
|
});
|
|
979
980
|
b(this, "handleCallback", async () => {
|
|
980
|
-
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(
|
|
981
|
-
if (sessionStorage.removeItem(
|
|
981
|
+
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(q);
|
|
982
|
+
if (sessionStorage.removeItem(q), !o)
|
|
982
983
|
throw new P("No code verifier found in state.");
|
|
983
984
|
const a = await this.getAuthServer(), r = Jt(
|
|
984
985
|
a,
|
|
@@ -986,8 +987,8 @@ class zt {
|
|
|
986
987
|
e.searchParams,
|
|
987
988
|
n ?? void 0
|
|
988
989
|
);
|
|
989
|
-
if (
|
|
990
|
-
throw
|
|
990
|
+
if (G(r))
|
|
991
|
+
throw oe.error("Error validating OAuth response", r), new de(
|
|
991
992
|
"Error validating OAuth response",
|
|
992
993
|
r
|
|
993
994
|
);
|
|
@@ -1016,14 +1017,11 @@ class zt {
|
|
|
1016
1017
|
emailVerified: y.email_verified ?? !1,
|
|
1017
1018
|
pictureUrl: y.picture
|
|
1018
1019
|
};
|
|
1019
|
-
|
|
1020
|
+
z.setState({
|
|
1020
1021
|
isAuthenticated: !0,
|
|
1021
1022
|
isPending: !1,
|
|
1022
1023
|
profile: T
|
|
1023
|
-
})
|
|
1024
|
-
"profile-state",
|
|
1025
|
-
JSON.stringify(N.getState().profile)
|
|
1026
|
-
);
|
|
1024
|
+
});
|
|
1027
1025
|
const h = sessionStorage.getItem("redirect-to") ?? "/";
|
|
1028
1026
|
return sessionStorage.removeItem("redirect-to"), h;
|
|
1029
1027
|
});
|
|
@@ -1047,8 +1045,8 @@ class zt {
|
|
|
1047
1045
|
* @param response
|
|
1048
1046
|
*/
|
|
1049
1047
|
setTokensFromResponse(e) {
|
|
1050
|
-
if (
|
|
1051
|
-
throw
|
|
1048
|
+
if (G(e))
|
|
1049
|
+
throw oe.error("Bad Token Response", e), new de("Bad Token Response", e);
|
|
1052
1050
|
if (!e.expires_in)
|
|
1053
1051
|
throw new P("No expires_in in response");
|
|
1054
1052
|
const n = {
|
|
@@ -1057,7 +1055,9 @@ class zt {
|
|
|
1057
1055
|
expiresOn: new Date(Date.now() + e.expires_in * 1e3),
|
|
1058
1056
|
tokenType: e.token_type
|
|
1059
1057
|
};
|
|
1060
|
-
|
|
1058
|
+
z.setState({
|
|
1059
|
+
providerData: n
|
|
1060
|
+
});
|
|
1061
1061
|
}
|
|
1062
1062
|
async signUp({ redirectTo: e } = {}) {
|
|
1063
1063
|
return this.authorize({
|
|
@@ -1079,7 +1079,7 @@ class zt {
|
|
|
1079
1079
|
if (!a.authorization_endpoint)
|
|
1080
1080
|
throw new P("No authorization endpoint");
|
|
1081
1081
|
const r = et(), i = await nt(r);
|
|
1082
|
-
sessionStorage.setItem(
|
|
1082
|
+
sessionStorage.setItem(q, r);
|
|
1083
1083
|
const c = new URL(
|
|
1084
1084
|
a.authorization_endpoint
|
|
1085
1085
|
);
|
|
@@ -1098,14 +1098,14 @@ class zt {
|
|
|
1098
1098
|
location.href = c.href;
|
|
1099
1099
|
}
|
|
1100
1100
|
async getAccessToken() {
|
|
1101
|
-
const e = await this.getAuthServer(), n =
|
|
1101
|
+
const e = await this.getAuthServer(), { providerData: n } = z.getState();
|
|
1102
1102
|
if (!n)
|
|
1103
1103
|
throw new P("User is not authenticated");
|
|
1104
|
-
const o =
|
|
1104
|
+
const o = n;
|
|
1105
1105
|
if (o.expiresOn < /* @__PURE__ */ new Date()) {
|
|
1106
1106
|
if (!o.refreshToken)
|
|
1107
1107
|
return await this.signIn(), "";
|
|
1108
|
-
const a = await
|
|
1108
|
+
const a = await gt(
|
|
1109
1109
|
e,
|
|
1110
1110
|
this.client,
|
|
1111
1111
|
o.refreshToken
|
|
@@ -1120,27 +1120,13 @@ class zt {
|
|
|
1120
1120
|
} else
|
|
1121
1121
|
return o.accessToken;
|
|
1122
1122
|
}
|
|
1123
|
-
pageLoad() {
|
|
1124
|
-
const e = sessionStorage.getItem("profile-state");
|
|
1125
|
-
if (e)
|
|
1126
|
-
try {
|
|
1127
|
-
const n = JSON.parse(e);
|
|
1128
|
-
N.setState({
|
|
1129
|
-
isAuthenticated: !0,
|
|
1130
|
-
isPending: !1,
|
|
1131
|
-
profile: n
|
|
1132
|
-
});
|
|
1133
|
-
} catch (n) {
|
|
1134
|
-
M.error("Error parsing auth state", n);
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
1123
|
getAuthenticationPlugin() {
|
|
1138
|
-
return new
|
|
1124
|
+
return new zt(this.callbackUrlPath, this.handleCallback);
|
|
1139
1125
|
}
|
|
1140
1126
|
}
|
|
1141
|
-
const qt = (t) => new
|
|
1127
|
+
const qt = (t) => new Dt(t);
|
|
1142
1128
|
export {
|
|
1143
|
-
|
|
1129
|
+
Dt as OpenIDAuthenticationProvider,
|
|
1144
1130
|
qt as default
|
|
1145
1131
|
};
|
|
1146
1132
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|