Skip to content

Commit

Permalink
feat: update to latest client
Browse files Browse the repository at this point in the history
  • Loading branch information
field123 committed Aug 26, 2024
1 parent 996b863 commit 7ef7094
Show file tree
Hide file tree
Showing 7 changed files with 503 additions and 1,453 deletions.
2 changes: 1 addition & 1 deletion packages/sdks/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"next": "^14.0.0"
},
"dependencies": {
"@hey-api/client-fetch": "^0.1.7"
"@hey-api/client-fetch": "^0.2.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { client } from "@hey-api/client-fetch"
import type { Client } from "@hey-api/client-fetch"
import { cookies } from "next/headers"
import { CREDENTIALS_COOKIE_NAME } from "../constants/crendentials"

export type RequestMiddleware = Parameters<
(typeof client)["interceptors"]["request"]["use"]
Client["interceptors"]["request"]["use"]
>[0]

export type ResponseMiddleware = Parameters<
(typeof client)["interceptors"]["response"]["use"]
Client["interceptors"]["response"]["use"]
>[0]

export function createAuthCookieInterceptor(creatOptions?: {
Expand Down Expand Up @@ -53,7 +53,7 @@ export const defaultNextMiddleware: MiddlewareStack = [
},
]

export function applyDefaultNextMiddleware(): void {
export function applyDefaultNextMiddleware(client: Client): void {
for (const middlewareEntry of defaultNextMiddleware) {
if (middlewareEntry.type === "request") {
client.interceptors.request.use(middlewareEntry.middleware)
Expand Down
1 change: 1 addition & 0 deletions packages/sdks/shopper/openapi-ts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export default defineConfig({
enums: false,
dates: "types+transform",
},
plugins: ["@tanstack/react-query"],
})
9 changes: 9 additions & 0 deletions packages/sdks/shopper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
],
"keywords": [],
"devDependencies": {
"@tanstack/react-query": "^5.52.1",
"@hey-api/openapi-ts": "^0.52.10",
"@redocly/cli": "^1.21.0",
"@redocly/openapi-core": "^1.21.0",
Expand All @@ -38,5 +39,13 @@
},
"dependencies": {
"@hey-api/client-fetch": "^0.2.4"
},
"peerDependencies": {
"@tanstack/react-query": "^5.52.1"
},
"peerDependenciesMeta": {
"@tanstack/react-query": {
"optional": true
}
}
}
Loading

0 comments on commit 7ef7094

Please sign in to comment.