-
-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'drwpow:main' into fix/converting-by-glob
- Loading branch information
Showing
56 changed files
with
7,691 additions
and
6,700 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "openapi-fetch", | ||
"description": "Fetch using your OpenAPI types. Weighs 2 kb and has virtually zero runtime. Works with React, Vue, Svelte, or vanilla JS.", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"author": { | ||
"name": "Drew Powers", | ||
"email": "[email protected]" | ||
|
@@ -59,10 +59,9 @@ | |
}, | ||
"devDependencies": { | ||
"del-cli": "^5.0.0", | ||
"esbuild": "^0.18.17", | ||
"esbuild": "^0.19.0", | ||
"nanostores": "^0.9.3", | ||
"openapi-typescript": "*", | ||
"prettier": "^2.8.8", | ||
"openapi-typescript": "^6.4.2", | ||
"typescript": "^5.1.6", | ||
"vitest": "^0.33.0", | ||
"vitest-fetch-mock": "^0.2.2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,7 +235,7 @@ describe("client", () => { | |
|
||
// expect error on missing `body` | ||
// @ts-expect-error | ||
await client.GET("/blogposts", {}); | ||
await client.PUT("/blogposts", {}); | ||
|
||
// expect error on missing fields | ||
// @ts-expect-error | ||
|
@@ -318,7 +318,7 @@ describe("client", () => { | |
new Headers({ | ||
...headers, // assert new header got passed | ||
"Content-Type": "application/json", // probably doesn’t need to get tested, but this was simpler than writing lots of code to ignore these | ||
}) | ||
}), | ||
); | ||
}); | ||
|
||
|
@@ -333,7 +333,7 @@ describe("client", () => { | |
new Headers({ | ||
"Cache-Control": "no-cache", | ||
"Content-Type": "application/json", | ||
}) | ||
}), | ||
); | ||
}); | ||
|
||
|
@@ -372,7 +372,7 @@ describe("client", () => { | |
it("multipart/form-data", async () => { | ||
const client = createClient<paths>(); | ||
mockFetchOnce({ status: 200, body: "{}" }); | ||
const { data } = await client.PUT("/contact", { | ||
await client.PUT("/contact", { | ||
body: { | ||
name: "John Doe", | ||
email: "[email protected]", | ||
|
@@ -401,9 +401,8 @@ describe("client", () => { | |
it("returns empty object on 204", async () => { | ||
const client = createClient<paths>(); | ||
mockFetchOnce({ status: 204, body: "" }); | ||
const { data, error, response } = await client.PUT("/tag/{name}", { | ||
const { data, error, response } = await client.DELETE("/tag/{name}", { | ||
params: { path: { name: "New Tag" } }, | ||
body: { description: "This is a new tag" }, | ||
}); | ||
|
||
// assert correct data was returned | ||
|
@@ -445,6 +444,7 @@ describe("client", () => { | |
const client = createClient<paths>(); | ||
mockFetchOnce({ status: 200, body: "{}" }); | ||
const { data } = await client.GET("/anyMethod", { parseAs: "blob" }); | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
expect((data as any).constructor.name).toBe("Blob"); | ||
}); | ||
|
||
|
@@ -681,7 +681,7 @@ describe("examples", () => { | |
setTimeout(() => { | ||
token.set(tokenVal); // simulate promise-like token setting | ||
resolve(); | ||
}, 0) | ||
}, 0), | ||
); | ||
await client.get().GET("/blogposts/{post_id}", { params: { path: { post_id: "1234" } } }); | ||
expect(fetchMocker.mock.calls[1][1].headers.get("authorization")).toBe(`Bearer ${tokenVal}`); | ||
|
@@ -710,7 +710,7 @@ describe("examples", () => { | |
setTimeout(() => { | ||
token = tokenVal; // simulate promise-like token setting | ||
resolve(); | ||
}, 0) | ||
}, 0), | ||
); | ||
await client.GET("/blogposts/{post_id}", { params: { path: { post_id: "1234" } } }); | ||
expect(fetchMocker.mock.calls[1][1].headers.get("authorization")).toBe(`Bearer ${tokenVal}`); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/create_alert.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_alert_create | ||
operationId: uptime_create_alert | ||
|
||
summary: Create a New Alert | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/create_check.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_check_create | ||
operationId: uptime_create_check | ||
|
||
summary: Create a New Check | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/delete_alert.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_alert_delete | ||
operationId: uptime_delete_alert | ||
|
||
summary: Delete an Alert | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/delete_check.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_check_delete | ||
operationId: uptime_delete_check | ||
|
||
summary: Delete a Check | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/get_alert.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_alert_get | ||
operationId: uptime_get_alert | ||
|
||
summary: Retrieve an Existing Alert | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/get_check.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_check_get | ||
operationId: uptime_get_check | ||
|
||
summary: Retrieve an Existing Check | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/get_check_state.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_check_state_get | ||
operationId: uptime_get_checkState | ||
|
||
summary: Retrieve Check State | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/list_alerts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_check_alerts_list | ||
operationId: uptime_list_alerts | ||
|
||
summary: List All Alerts | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/list_checks.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_checks_list | ||
operationId: uptime_list_checks | ||
|
||
summary: List All Checks | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/update_alert.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_alert_update | ||
operationId: uptime_update_alert | ||
|
||
summary: Update an Alert | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/openapi-typescript/examples/digital-ocean-api/resources/uptime/update_check.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
operationId: uptime_check_update | ||
operationId: uptime_update_check | ||
|
||
summary: Update a Check | ||
|
||
|
Oops, something went wrong.