zudoku 0.3.0-dev.50 → 0.3.0-dev.51
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/lib/core/DevPortalContext.d.ts +1 -6
- package/dist/lib/core/DevPortalContext.js +2 -6
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/lib/{hook-DCYGmylw.js → hook-CGFJQf_n.js} +2 -2
- package/lib/{hook-DCYGmylw.js.map → hook-CGFJQf_n.js.map} +1 -1
- package/lib/{state-D36MLDHk.js → state-DKdaQzvh.js} +1 -2
- package/lib/{state-D36MLDHk.js.map → state-DKdaQzvh.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +92 -94
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/package.json +1 -1
- package/src/lib/core/DevPortalContext.ts +2 -12
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
-
import { create } from "zustand";
|
|
4
3
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
4
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
5
|
import { type DevPortalPath } from "../components/DevPortal.js";
|
|
@@ -54,14 +53,8 @@ export type NavigationItem = {
|
|
|
54
53
|
categories?: NavigationCategory[];
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
export type RoutingState = {
|
|
58
|
-
path?: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
56
|
export const queryClient = new QueryClient();
|
|
62
57
|
|
|
63
|
-
export const useRoutingState = create<RoutingState>(() => ({}));
|
|
64
|
-
|
|
65
58
|
export type ApiKeyCache = "api-keys";
|
|
66
59
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
67
60
|
|
|
@@ -98,8 +91,6 @@ export class DevPortalContext {
|
|
|
98
91
|
public meta: ZudokuContextOptions["metadata"];
|
|
99
92
|
public page: ZudokuContextOptions["page"];
|
|
100
93
|
public authentication?: ZudokuContextOptions["authentication"];
|
|
101
|
-
|
|
102
|
-
public state: typeof useRoutingState;
|
|
103
94
|
private navigationPlugins: NavigationPlugin[];
|
|
104
95
|
|
|
105
96
|
constructor(config: ZudokuContextOptions) {
|
|
@@ -109,7 +100,6 @@ export class DevPortalContext {
|
|
|
109
100
|
this.authentication = config.authentication;
|
|
110
101
|
this.meta = config.metadata;
|
|
111
102
|
this.page = config.page;
|
|
112
|
-
this.state = useRoutingState;
|
|
113
103
|
}
|
|
114
104
|
|
|
115
105
|
initialize = async () => {
|
|
@@ -144,7 +134,7 @@ export class DevPortalContext {
|
|
|
144
134
|
return navigations.flatMap((nav) => nav ?? []);
|
|
145
135
|
};
|
|
146
136
|
|
|
147
|
-
async
|
|
137
|
+
signRequest = async (request: Request) => {
|
|
148
138
|
if (!this.authentication) {
|
|
149
139
|
throw new Error("No authentication provider configured");
|
|
150
140
|
}
|
|
@@ -154,5 +144,5 @@ export class DevPortalContext {
|
|
|
154
144
|
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
155
145
|
|
|
156
146
|
return request;
|
|
157
|
-
}
|
|
147
|
+
};
|
|
158
148
|
}
|