zudoku 0.25.0 → 0.25.2
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/config/validators/InputSidebarSchema.d.ts +15 -0
- package/dist/config/validators/InputSidebarSchema.js +1 -0
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +45 -34
- package/dist/config/validators/common.js +2 -1
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +19 -14
- package/dist/lib/authentication/components/SignOut.js +1 -1
- package/dist/lib/authentication/components/SignOut.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +29 -6
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.js +1 -1
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.d.ts +11 -1
- package/dist/lib/components/navigation/SidebarBadge.js +11 -2
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +16 -3
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.js +17 -3
- package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +2 -0
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/ExampleDisplay.d.ts +12 -0
- package/dist/lib/plugins/openapi/ExampleDisplay.js +78 -0
- package/dist/lib/plugins/openapi/ExampleDisplay.js.map +1 -0
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +2 -4
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +6 -13
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +11 -13
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +1 -0
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/vite/build.js +10 -8
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +10 -0
- package/dist/vite/config.js.map +1 -1
- package/lib/{AuthenticationPlugin-DVLEc6cm.js → AuthenticationPlugin-D7G3me8L.js} +16 -16
- package/lib/AuthenticationPlugin-D7G3me8L.js.map +1 -0
- package/lib/{OperationList-c6V_vcgz.js → OperationList-BLdHAQ39.js} +1594 -1525
- package/lib/OperationList-BLdHAQ39.js.map +1 -0
- package/lib/assets/{worker-DV9Ecqy9.js → worker-Cbp2r2BQ.js} +26 -14
- package/lib/assets/{worker-DV9Ecqy9.js.map → worker-Cbp2r2BQ.js.map} +1 -1
- package/lib/{createServer-C4C0OO0m.js → createServer-Bf5_6o6G.js} +796 -784
- package/lib/{createServer-C4C0OO0m.js.map → createServer-Bf5_6o6G.js.map} +1 -1
- package/lib/{index-DkwDHnit.js → index-BNx95gkf.js} +5 -4
- package/lib/{index-DkwDHnit.js.map → index-BNx95gkf.js.map} +1 -1
- package/lib/zudoku.auth-clerk.js +80 -52
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +37 -37
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +89 -85
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +4 -4
- package/src/lib/authentication/components/SignOut.tsx +2 -1
- package/src/lib/authentication/providers/clerk.tsx +38 -7
- package/src/lib/authentication/providers/openid.tsx +1 -1
- package/src/lib/components/navigation/SidebarBadge.tsx +13 -1
- package/src/lib/components/navigation/SidebarCategory.tsx +3 -7
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -0
- package/src/lib/oas/graphql/index.ts +16 -7
- package/src/lib/oas/parser/upgrade/index.ts +19 -4
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +1 -1
- package/src/lib/plugins/openapi/Endpoint.tsx +2 -0
- package/src/lib/plugins/openapi/ExampleDisplay.tsx +163 -0
- package/src/lib/plugins/openapi/OperationListItem.tsx +5 -3
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -1
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +11 -37
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +49 -63
- package/src/lib/plugins/openapi/Sidecar.tsx +2 -4
- package/src/lib/plugins/openapi/index.tsx +1 -0
- package/lib/AuthenticationPlugin-DVLEc6cm.js.map +0 -1
- package/lib/OperationList-c6V_vcgz.js.map +0 -1
package/lib/zudoku.auth-clerk.js
CHANGED
|
@@ -1,79 +1,107 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { A as
|
|
5
|
-
import { u as
|
|
6
|
-
class
|
|
7
|
-
constructor(
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var g = (t, s, i) => s in t ? w(t, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[s] = i;
|
|
3
|
+
var u = (t, s, i) => g(t, typeof s != "symbol" ? s + "" : s, i);
|
|
4
|
+
import { A as m } from "./AuthenticationPlugin-D7G3me8L.js";
|
|
5
|
+
import { u as d } from "./state-CFQsUZUP.js";
|
|
6
|
+
class h extends m {
|
|
7
|
+
constructor(i) {
|
|
8
8
|
super();
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
u(this, "initialize", async () => {
|
|
10
|
+
var r;
|
|
11
|
+
const i = await this.clerk;
|
|
12
|
+
if (i)
|
|
13
|
+
if (i.session) {
|
|
14
|
+
const e = i.session.user.emailAddresses.find(
|
|
15
|
+
(n) => n.verification.status === "verified"
|
|
16
|
+
);
|
|
17
|
+
d.setState({
|
|
18
|
+
isAuthenticated: !0,
|
|
19
|
+
isPending: !1,
|
|
20
|
+
profile: {
|
|
21
|
+
sub: i.session.user.id,
|
|
22
|
+
name: i.session.user.fullName ?? void 0,
|
|
23
|
+
email: (e == null ? void 0 : e.emailAddress) ?? ((r = i.session.user.emailAddresses[0]) == null ? void 0 : r.emailAddress),
|
|
24
|
+
emailVerified: e !== void 0,
|
|
25
|
+
pictureUrl: i.session.user.imageUrl
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
} else
|
|
29
|
+
d.setState({
|
|
30
|
+
isAuthenticated: !1,
|
|
31
|
+
isPending: !1,
|
|
32
|
+
profile: void 0
|
|
33
|
+
});
|
|
28
34
|
});
|
|
29
|
-
this.clerk =
|
|
35
|
+
this.clerk = i;
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
|
-
const
|
|
33
|
-
clerkPubKey:
|
|
34
|
-
redirectToAfterSignOut:
|
|
35
|
-
redirectToAfterSignUp:
|
|
36
|
-
redirectToAfterSignIn:
|
|
38
|
+
const v = ({
|
|
39
|
+
clerkPubKey: t,
|
|
40
|
+
redirectToAfterSignOut: s = "/",
|
|
41
|
+
redirectToAfterSignUp: i = "/",
|
|
42
|
+
redirectToAfterSignIn: r = "/"
|
|
37
43
|
}) => {
|
|
38
|
-
let
|
|
39
|
-
const
|
|
44
|
+
let e;
|
|
45
|
+
const n = (async () => {
|
|
46
|
+
var l;
|
|
40
47
|
if (typeof window > "u") return;
|
|
41
|
-
const { Clerk:
|
|
42
|
-
|
|
48
|
+
const { Clerk: a } = await import("@clerk/clerk-js");
|
|
49
|
+
if (e = new a(t), await e.load(), e.user) {
|
|
50
|
+
const o = e.user.emailAddresses.find(
|
|
51
|
+
(f) => f.verification.status === "verified"
|
|
52
|
+
);
|
|
53
|
+
d.setState({
|
|
54
|
+
isAuthenticated: !0,
|
|
55
|
+
isPending: !1,
|
|
56
|
+
profile: {
|
|
57
|
+
sub: e.user.id,
|
|
58
|
+
name: e.user.fullName ?? void 0,
|
|
59
|
+
email: (o == null ? void 0 : o.emailAddress) ?? ((l = e.user.emailAddresses[0]) == null ? void 0 : l.emailAddress),
|
|
60
|
+
emailVerified: o !== void 0,
|
|
61
|
+
pictureUrl: e.user.imageUrl
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return e;
|
|
43
66
|
})();
|
|
44
67
|
async function c() {
|
|
45
|
-
if (await
|
|
68
|
+
if (await n, !(e != null && e.session))
|
|
46
69
|
throw new Error("No session available");
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
70
|
+
const a = await e.session.getToken();
|
|
71
|
+
if (!a)
|
|
49
72
|
throw new Error("Could not get access token from Clerk");
|
|
50
|
-
return
|
|
73
|
+
return a;
|
|
51
74
|
}
|
|
52
75
|
return {
|
|
53
76
|
getAccessToken: c,
|
|
54
77
|
signOut: async () => {
|
|
55
|
-
await
|
|
56
|
-
redirectUrl: window.location.origin +
|
|
78
|
+
await n, await (e == null ? void 0 : e.signOut({
|
|
79
|
+
redirectUrl: window.location.origin + s
|
|
80
|
+
})), d.setState({
|
|
81
|
+
isAuthenticated: !1,
|
|
82
|
+
isPending: !1,
|
|
83
|
+
profile: null,
|
|
84
|
+
providerData: null
|
|
57
85
|
});
|
|
58
86
|
},
|
|
59
87
|
signIn: async () => {
|
|
60
|
-
await
|
|
61
|
-
signInForceRedirectUrl: window.location.origin +
|
|
62
|
-
signUpForceRedirectUrl: window.location.origin +
|
|
63
|
-
});
|
|
88
|
+
await n, await (e == null ? void 0 : e.redirectToSignIn({
|
|
89
|
+
signInForceRedirectUrl: window.location.origin + r,
|
|
90
|
+
signUpForceRedirectUrl: window.location.origin + i
|
|
91
|
+
}));
|
|
64
92
|
},
|
|
65
93
|
signUp: async () => {
|
|
66
|
-
await
|
|
67
|
-
signInForceRedirectUrl: window.location.origin +
|
|
68
|
-
signUpForceRedirectUrl: window.location.origin +
|
|
69
|
-
});
|
|
94
|
+
await n, await (e == null ? void 0 : e.redirectToSignUp({
|
|
95
|
+
signInForceRedirectUrl: window.location.origin + r,
|
|
96
|
+
signUpForceRedirectUrl: window.location.origin + i
|
|
97
|
+
}));
|
|
70
98
|
},
|
|
71
99
|
getAuthenticationPlugin() {
|
|
72
|
-
return new
|
|
100
|
+
return new h(n);
|
|
73
101
|
}
|
|
74
102
|
};
|
|
75
103
|
};
|
|
76
104
|
export {
|
|
77
|
-
|
|
105
|
+
v as default
|
|
78
106
|
};
|
|
79
107
|
//# sourceMappingURL=zudoku.auth-clerk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.auth-clerk.js","sources":["../src/lib/authentication/providers/clerk.tsx"],"sourcesContent":["import type { Clerk } from \"@clerk/clerk-js\";\nimport { ClerkAuthenticationConfig } from \"../../../config/config.js\";\nimport { AuthenticationProviderInitializer } from \"../authentication.js\";\nimport { AuthenticationPlugin } from \"../AuthenticationPlugin.js\";\nimport { useAuthState } from \"../state.js\";\n\nclass ClerkAuthPlugin extends AuthenticationPlugin {\n constructor(private clerk: Promise<Clerk | undefined>) {\n super();\n }\n initialize = async () => {\n const clerk = await this.clerk;\n\n if (!clerk) {\n return;\n }\n\n if (clerk.session) {\n useAuthState.setState({\n isAuthenticated: true,\n isPending: false,\n profile: {\n sub: clerk.session.user.id,\n name: clerk.session.user.fullName ?? undefined,\n email
|
|
1
|
+
{"version":3,"file":"zudoku.auth-clerk.js","sources":["../src/lib/authentication/providers/clerk.tsx"],"sourcesContent":["import type { Clerk } from \"@clerk/clerk-js\";\nimport { ClerkAuthenticationConfig } from \"../../../config/config.js\";\nimport { AuthenticationProviderInitializer } from \"../authentication.js\";\nimport { AuthenticationPlugin } from \"../AuthenticationPlugin.js\";\nimport { useAuthState } from \"../state.js\";\n\nclass ClerkAuthPlugin extends AuthenticationPlugin {\n constructor(private clerk: Promise<Clerk | undefined>) {\n super();\n }\n initialize = async () => {\n const clerk = await this.clerk;\n\n if (!clerk) {\n return;\n }\n\n if (clerk.session) {\n const verifiedEmail = clerk.session.user.emailAddresses.find(\n (email) => email.verification.status === \"verified\",\n );\n useAuthState.setState({\n isAuthenticated: true,\n isPending: false,\n profile: {\n sub: clerk.session.user.id,\n name: clerk.session.user.fullName ?? undefined,\n email:\n verifiedEmail?.emailAddress ??\n clerk.session.user.emailAddresses[0]?.emailAddress,\n emailVerified: verifiedEmail !== undefined,\n pictureUrl: clerk.session.user.imageUrl,\n },\n });\n } else {\n useAuthState.setState({\n isAuthenticated: false,\n isPending: false,\n profile: undefined,\n });\n }\n };\n}\n\nconst clerkAuth: AuthenticationProviderInitializer<\n ClerkAuthenticationConfig\n> = ({\n clerkPubKey,\n redirectToAfterSignOut = \"/\",\n redirectToAfterSignUp = \"/\",\n redirectToAfterSignIn = \"/\",\n}) => {\n let clerkApi: Clerk | undefined;\n const ensureLoaded = (async () => {\n if (typeof window === \"undefined\") return;\n const { Clerk } = await import(\"@clerk/clerk-js\");\n clerkApi = new Clerk(clerkPubKey);\n\n await clerkApi.load();\n\n if (clerkApi.user) {\n const verifiedEmail = clerkApi.user.emailAddresses.find(\n (email) => email.verification.status === \"verified\",\n );\n useAuthState.setState({\n isAuthenticated: true,\n isPending: false,\n profile: {\n sub: clerkApi.user.id,\n name: clerkApi.user.fullName ?? undefined,\n email:\n verifiedEmail?.emailAddress ??\n clerkApi.user.emailAddresses[0]?.emailAddress,\n emailVerified: verifiedEmail !== undefined,\n pictureUrl: clerkApi.user.imageUrl,\n },\n });\n }\n\n return clerkApi;\n })();\n\n async function getAccessToken() {\n await ensureLoaded;\n if (!clerkApi?.session) {\n throw new Error(\"No session available\");\n }\n const response = await clerkApi.session.getToken();\n if (!response) {\n throw new Error(\"Could not get access token from Clerk\");\n }\n return response;\n }\n\n return {\n getAccessToken,\n signOut: async () => {\n await ensureLoaded;\n await clerkApi?.signOut({\n redirectUrl: window.location.origin + redirectToAfterSignOut,\n });\n useAuthState.setState({\n isAuthenticated: false,\n isPending: false,\n profile: null,\n providerData: null,\n });\n },\n signIn: async () => {\n await ensureLoaded;\n await clerkApi?.redirectToSignIn({\n signInForceRedirectUrl: window.location.origin + redirectToAfterSignIn,\n signUpForceRedirectUrl: window.location.origin + redirectToAfterSignUp,\n });\n },\n signUp: async () => {\n await ensureLoaded;\n await clerkApi?.redirectToSignUp({\n signInForceRedirectUrl: window.location.origin + redirectToAfterSignIn,\n signUpForceRedirectUrl: window.location.origin + redirectToAfterSignUp,\n });\n },\n getAuthenticationPlugin() {\n return new ClerkAuthPlugin(ensureLoaded);\n },\n };\n};\n\nexport default clerkAuth;\n"],"names":["ClerkAuthPlugin","AuthenticationPlugin","clerk","__publicField","verifiedEmail","email","useAuthState","_a","clerkAuth","clerkPubKey","redirectToAfterSignOut","redirectToAfterSignUp","redirectToAfterSignIn","clerkApi","ensureLoaded","Clerk","getAccessToken","response"],"mappings":";;;;;AAMA,MAAMA,UAAwBC,EAAqB;AAAA,EACjD,YAAoBC,GAAmC;AAC/C,UAAA;AAER,IAAAC,EAAA,oBAAa,YAAY;;AACjB,YAAAD,IAAQ,MAAM,KAAK;AAEzB,UAAKA;AAIL,YAAIA,EAAM,SAAS;AACjB,gBAAME,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e, n) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
-
var
|
|
3
|
+
var b = (t, e, n) => Je(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { j as G } from "./jsx-runtime-Dx-03ztt.js";
|
|
5
5
|
import { g as Oe } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
6
6
|
import { C as ze } from "./ClientOnly-E7hGysn1.js";
|
|
7
|
-
import { A as De } from "./AuthenticationPlugin-
|
|
7
|
+
import { A as De } from "./AuthenticationPlugin-D7G3me8L.js";
|
|
8
8
|
import { u as Ne } from "./ZudokuContext-hmLMUdf2.js";
|
|
9
9
|
import { N as Ke } from "./chunk-D52XG6IA-Dl7HLe6j.js";
|
|
10
10
|
import { Z as We } from "./invariant-Caa8-XvF.js";
|
|
@@ -38,7 +38,7 @@ function $e() {
|
|
|
38
38
|
function p() {
|
|
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
|
|
41
|
+
function _(l) {
|
|
42
42
|
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;
|
|
43
43
|
}
|
|
44
44
|
function f() {
|
|
@@ -55,7 +55,7 @@ function $e() {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
function T(l, m, u) {
|
|
58
|
-
return
|
|
58
|
+
return _(l) || y.apply(this, arguments);
|
|
59
59
|
}
|
|
60
60
|
function h(l, m) {
|
|
61
61
|
var u = this, O, M, R, v = "loglevel";
|
|
@@ -236,7 +236,7 @@ const s = Xe, ge = new Qe(100);
|
|
|
236
236
|
function ye(t) {
|
|
237
237
|
return t instanceof CryptoKey;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function be(t) {
|
|
240
240
|
return ye(t) && t.type === "private";
|
|
241
241
|
}
|
|
242
242
|
function et(t) {
|
|
@@ -387,7 +387,7 @@ function lt(t) {
|
|
|
387
387
|
throw new S("unsupported EcKeyAlgorithm namedCurve");
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function _e(t) {
|
|
391
391
|
switch (t.algorithm.name) {
|
|
392
392
|
case "RSA-PSS":
|
|
393
393
|
return ct(t);
|
|
@@ -426,7 +426,7 @@ function dt(t, e) {
|
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
428
|
async function ht(t, e, n, o, a) {
|
|
429
|
-
const r = { alg:
|
|
429
|
+
const r = { alg: _e(n), kid: o }, i = dt(t, e);
|
|
430
430
|
return a == null || a(r, i), Se(r, i, n);
|
|
431
431
|
}
|
|
432
432
|
function I(t) {
|
|
@@ -471,7 +471,7 @@ async function ft(t, e, n, o, a) {
|
|
|
471
471
|
if (de("private_key_jwt", e.client_secret), a === void 0)
|
|
472
472
|
throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
|
|
473
473
|
const { key: r, kid: i, modifyAssertion: c } = at(a);
|
|
474
|
-
if (!
|
|
474
|
+
if (!be(r))
|
|
475
475
|
throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
|
|
476
476
|
n.set("client_id", e.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await ht(t, e, r, i, c));
|
|
477
477
|
break;
|
|
@@ -495,7 +495,7 @@ async function Se(t, e, n) {
|
|
|
495
495
|
async function pt(t, e, n, o, a, r) {
|
|
496
496
|
var T;
|
|
497
497
|
const { privateKey: i, publicKey: c, nonce: p = ge.get(n.origin) } = e;
|
|
498
|
-
if (!
|
|
498
|
+
if (!be(i))
|
|
499
499
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
500
500
|
if (!et(c))
|
|
501
501
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
@@ -503,12 +503,12 @@ async function pt(t, e, n, o, a, r) {
|
|
|
503
503
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
504
504
|
if (!c.extractable)
|
|
505
505
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
506
|
-
const
|
|
507
|
-
alg:
|
|
506
|
+
const _ = F() + a, f = {
|
|
507
|
+
alg: _e(i),
|
|
508
508
|
typ: "dpop+jwt",
|
|
509
509
|
jwk: await mt(c)
|
|
510
510
|
}, y = {
|
|
511
|
-
iat:
|
|
511
|
+
iat: _,
|
|
512
512
|
jti: $(),
|
|
513
513
|
htm: o,
|
|
514
514
|
nonce: p,
|
|
@@ -561,7 +561,7 @@ async function yt(t, e, n, o) {
|
|
|
561
561
|
[W]: L(e)
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
|
-
async function
|
|
564
|
+
async function bt(t, e, n, o, a, r, i) {
|
|
565
565
|
return await ft(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[X]) || fetch)(o.href, {
|
|
566
566
|
body: a,
|
|
567
567
|
headers: Object.fromEntries(r.entries()),
|
|
@@ -574,9 +574,9 @@ async function Ae(t, e, n, o, a) {
|
|
|
574
574
|
const r = Te(t, "token_endpoint", ke(e, a));
|
|
575
575
|
o.set("grant_type", n);
|
|
576
576
|
const i = H(a == null ? void 0 : a.headers);
|
|
577
|
-
return i.set("accept", "application/json"),
|
|
577
|
+
return i.set("accept", "application/json"), bt(t, e, "POST", r, o, i, a);
|
|
578
578
|
}
|
|
579
|
-
async function
|
|
579
|
+
async function _t(t, e, n, o) {
|
|
580
580
|
if (I(t), j(e), !w(n))
|
|
581
581
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
582
582
|
const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
@@ -793,13 +793,13 @@ async function It(t, e, n, o) {
|
|
|
793
793
|
throw new s("JWT signature verification failed");
|
|
794
794
|
}
|
|
795
795
|
async function jt(t, e, n, o, a, r) {
|
|
796
|
-
let { 0: i, 1: c, 2: p, length:
|
|
797
|
-
if (
|
|
796
|
+
let { 0: i, 1: c, 2: p, length: _ } = t.split(".");
|
|
797
|
+
if (_ === 5)
|
|
798
798
|
if (r !== void 0)
|
|
799
|
-
t = await r(t), { 0: i, 1: c, 2: p, length:
|
|
799
|
+
t = await r(t), { 0: i, 1: c, 2: p, length: _ } = t.split(".");
|
|
800
800
|
else
|
|
801
801
|
throw new S("JWE structure JWTs are not supported");
|
|
802
|
-
if (
|
|
802
|
+
if (_ !== 3)
|
|
803
803
|
throw new s("Invalid JWT");
|
|
804
804
|
let f;
|
|
805
805
|
try {
|
|
@@ -953,17 +953,17 @@ class Wt {
|
|
|
953
953
|
redirectToAfterSignIn: r,
|
|
954
954
|
redirectToAfterSignOut: i
|
|
955
955
|
}) {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
956
|
+
b(this, "client");
|
|
957
|
+
b(this, "issuer");
|
|
958
|
+
b(this, "authorizationServer");
|
|
959
|
+
b(this, "callbackUrlPath", "/oauth/callback");
|
|
960
|
+
b(this, "logoutRedirectUrlPath", "/");
|
|
961
|
+
b(this, "onAuthorizationUrl");
|
|
962
|
+
b(this, "redirectToAfterSignUp");
|
|
963
|
+
b(this, "redirectToAfterSignIn");
|
|
964
|
+
b(this, "redirectToAfterSignOut");
|
|
965
|
+
b(this, "audience");
|
|
966
|
+
b(this, "signOut", async () => {
|
|
967
967
|
x.setState({
|
|
968
968
|
isAuthenticated: !1,
|
|
969
969
|
isPending: !1,
|
|
@@ -980,7 +980,7 @@ class Wt {
|
|
|
980
980
|
n.toString()
|
|
981
981
|
)) : o = n;
|
|
982
982
|
});
|
|
983
|
-
|
|
983
|
+
b(this, "handleCallback", async () => {
|
|
984
984
|
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(V);
|
|
985
985
|
if (sessionStorage.removeItem(V), !o)
|
|
986
986
|
throw new P("No code verifier found in state.");
|
|
@@ -996,7 +996,7 @@ class Wt {
|
|
|
996
996
|
r
|
|
997
997
|
);
|
|
998
998
|
const i = new URL(e);
|
|
999
|
-
i.pathname = this.
|
|
999
|
+
i.pathname = this.callbackUrlPath, i.search = "";
|
|
1000
1000
|
const c = await Et(
|
|
1001
1001
|
a,
|
|
1002
1002
|
this.client,
|
|
@@ -1009,10 +1009,10 @@ class Wt {
|
|
|
1009
1009
|
c
|
|
1010
1010
|
);
|
|
1011
1011
|
this.setTokensFromResponse(p);
|
|
1012
|
-
const
|
|
1012
|
+
const _ = await this.getAccessToken(), y = await (await yt(
|
|
1013
1013
|
a,
|
|
1014
1014
|
this.client,
|
|
1015
|
-
|
|
1015
|
+
_
|
|
1016
1016
|
)).json(), T = {
|
|
1017
1017
|
sub: y.sub,
|
|
1018
1018
|
email: y.email,
|
|
@@ -1078,7 +1078,7 @@ class Wt {
|
|
|
1078
1078
|
redirectTo: e,
|
|
1079
1079
|
isSignUp: n = !1
|
|
1080
1080
|
}) {
|
|
1081
|
-
var
|
|
1081
|
+
var _, f;
|
|
1082
1082
|
const o = "S256", a = await this.getAuthServer();
|
|
1083
1083
|
if (!a.authorization_endpoint)
|
|
1084
1084
|
throw new P("No authorization endpoint");
|
|
@@ -1092,7 +1092,7 @@ class Wt {
|
|
|
1092
1092
|
if (p.pathname = this.callbackUrlPath, p.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", p.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", "openid profile email"), c.searchParams.set("code_challenge", i), c.searchParams.set(
|
|
1093
1093
|
"code_challenge_method",
|
|
1094
1094
|
o
|
|
1095
|
-
), this.audience && c.searchParams.set("audience", this.audience), (
|
|
1095
|
+
), this.audience && c.searchParams.set("audience", this.audience), (_ = this.onAuthorizationUrl) == null || _.call(this, c, {
|
|
1096
1096
|
isSignIn: !n,
|
|
1097
1097
|
isSignUp: n
|
|
1098
1098
|
}), ((f = a.code_challenge_methods_supported) == null ? void 0 : f.includes("S256")) !== !0) {
|
|
@@ -1114,7 +1114,7 @@ class Wt {
|
|
|
1114
1114
|
profile: null,
|
|
1115
1115
|
providerData: null
|
|
1116
1116
|
}), "";
|
|
1117
|
-
const a = await
|
|
1117
|
+
const a = await _t(
|
|
1118
1118
|
e,
|
|
1119
1119
|
this.client,
|
|
1120
1120
|
o.refreshToken
|