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.
@@ -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 signRequest(request: Request) {
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
  }