alchemy 0.75.0 → 0.76.0
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/bin/alchemy.js +302 -287
- package/bin/commands/util.ts +8 -4
- package/bin/services/execute-alchemy.ts +4 -2
- package/bin/services/github-workflow.ts +2 -3
- package/bin/services/package-manager.ts +1 -5
- package/lib/alchemy.d.ts +1 -1
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +1 -1
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.js +10 -0
- package/lib/apply.js.map +1 -1
- package/lib/aws/control/types.d.ts.map +1 -1
- package/lib/aws/control/types.js.map +1 -1
- package/lib/clickhouse/api/sdk.gen.d.ts.map +1 -1
- package/lib/clickhouse/api/sdk.gen.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/bound.d.ts.map +1 -1
- package/lib/cloudflare/bucket.d.ts +1 -1
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +1 -1
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/cloudflare-env-proxy.d.ts.map +1 -1
- package/lib/cloudflare/cloudflare-env-proxy.js +3 -3
- package/lib/cloudflare/cloudflare-env-proxy.js.map +1 -1
- package/lib/cloudflare/compatibility-date.gen.d.ts +1 -1
- package/lib/cloudflare/compatibility-date.gen.js +1 -1
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +0 -4
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/hyperdrive.d.ts +0 -1
- package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
- package/lib/cloudflare/hyperdrive.js.map +1 -1
- package/lib/cloudflare/miniflare/delete.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/delete.js +3 -0
- package/lib/cloudflare/miniflare/delete.js.map +1 -1
- package/lib/cloudflare/miniflare/paths.d.ts +0 -1
- package/lib/cloudflare/miniflare/paths.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/paths.js +4 -17
- package/lib/cloudflare/miniflare/paths.js.map +1 -1
- package/lib/cloudflare/nuxt/plugin.d.ts.map +1 -1
- package/lib/cloudflare/nuxt/plugin.js +2 -2
- package/lib/cloudflare/nuxt/plugin.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +0 -2
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/react-router/plugin.d.ts.map +1 -1
- package/lib/cloudflare/react-router/plugin.js +0 -1
- package/lib/cloudflare/react-router/plugin.js.map +1 -1
- package/lib/cloudflare/vite/plugin.d.ts.map +1 -1
- package/lib/cloudflare/vite/plugin.js +3 -3
- package/lib/cloudflare/vite/plugin.js.map +1 -1
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +0 -4
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-assets.d.ts +1 -1
- package/lib/cloudflare/worker-assets.d.ts.map +1 -1
- package/lib/cloudflare/worker-assets.js +1 -1
- package/lib/cloudflare/worker-assets.js.map +1 -1
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker-tail.d.ts.map +1 -1
- package/lib/cloudflare/worker-tail.js.map +1 -1
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +3 -1
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.js +0 -1
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/cloudflare/zone.d.ts +1 -1
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +3 -28
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/coinbase/evm-account.d.ts.map +1 -1
- package/lib/coinbase/evm-account.js.map +1 -1
- package/lib/coinbase/evm-smart-account.d.ts.map +1 -1
- package/lib/coinbase/evm-smart-account.js.map +1 -1
- package/lib/docker/api.d.ts.map +1 -1
- package/lib/docker/api.js.map +1 -1
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js.map +1 -1
- package/lib/neon/api/sdk.gen.d.ts.map +1 -1
- package/lib/neon/api/sdk.gen.js.map +1 -1
- package/lib/os/exec.d.ts.map +1 -1
- package/lib/os/exec.js.map +1 -1
- package/lib/planetscale/api/sdk.gen.d.ts.map +1 -1
- package/lib/planetscale/api/sdk.gen.js.map +1 -1
- package/lib/prisma-postgres/api/sdk.gen.d.ts.map +1 -1
- package/lib/prisma-postgres/api/sdk.gen.js.map +1 -1
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +2 -2
- package/lib/scope.js.map +1 -1
- package/lib/sentry/client-key.js +1 -1
- package/lib/sentry/client-key.js.map +1 -1
- package/lib/test/bun.d.ts.map +1 -1
- package/lib/test/bun.js.map +1 -1
- package/lib/test/vitest.d.ts.map +1 -1
- package/lib/test/vitest.js.map +1 -1
- package/lib/util/api/client/client.gen.d.ts +1 -1
- package/lib/util/api/client/client.gen.js +45 -45
- package/lib/util/api/client/types.gen.d.ts +22 -22
- package/lib/util/api/client/utils.gen.d.ts +3 -3
- package/lib/util/api/client/utils.gen.d.ts.map +1 -1
- package/lib/util/api/client/utils.gen.js +34 -34
- package/lib/util/api/client/utils.gen.js.map +1 -1
- package/lib/util/api/core/auth.gen.d.ts +3 -3
- package/lib/util/api/core/auth.gen.js +3 -3
- package/lib/util/api/core/bodySerializer.gen.d.ts +1 -1
- package/lib/util/api/core/bodySerializer.gen.js +3 -3
- package/lib/util/api/core/params.gen.d.ts +3 -3
- package/lib/util/api/core/params.gen.js +7 -7
- package/lib/util/api/core/pathSerializer.gen.d.ts +3 -3
- package/lib/util/api/core/pathSerializer.gen.js +36 -36
- package/lib/util/api/core/serverSentEvents.gen.d.ts +3 -3
- package/lib/util/api/core/serverSentEvents.gen.js +18 -18
- package/lib/util/api/core/types.gen.d.ts +4 -4
- package/lib/util/api/core/utils.gen.d.ts +1 -1
- package/lib/util/api/core/utils.gen.js +17 -17
- package/lib/util/camel-to-snake.d.ts.map +1 -1
- package/lib/util/find-workspace-root.d.ts +3 -0
- package/lib/util/find-workspace-root.d.ts.map +1 -0
- package/lib/util/find-workspace-root.js +94 -0
- package/lib/util/find-workspace-root.js.map +1 -0
- package/lib/util/idempotent-spawn.d.ts.map +1 -1
- package/lib/util/idempotent-spawn.js +1 -1
- package/lib/util/idempotent-spawn.js.map +1 -1
- package/lib/util/peer.d.ts.map +1 -1
- package/lib/util/peer.js.map +1 -1
- package/package.json +1 -1
- package/src/alchemy.ts +4 -3
- package/src/apply.ts +16 -1
- package/src/aws/control/types.ts +87107 -85281
- package/src/clickhouse/api/sdk.gen.ts +1 -3
- package/src/cloudflare/account-api-token.ts +3 -1
- package/src/cloudflare/bound.ts +64 -65
- package/src/cloudflare/bucket.ts +4 -7
- package/src/cloudflare/cloudflare-env-proxy.ts +2 -4
- package/src/cloudflare/compatibility-date.gen.ts +1 -1
- package/src/cloudflare/d1-database.ts +0 -9
- package/src/cloudflare/dns-records.ts +3 -1
- package/src/cloudflare/hyperdrive.ts +0 -1
- package/src/cloudflare/miniflare/delete.ts +3 -0
- package/src/cloudflare/miniflare/paths.ts +4 -25
- package/src/cloudflare/nuxt/plugin.ts +1 -4
- package/src/cloudflare/queue-consumer.ts +0 -2
- package/src/cloudflare/react-router/plugin.ts +0 -1
- package/src/cloudflare/vite/plugin.ts +1 -3
- package/src/cloudflare/website.ts +0 -5
- package/src/cloudflare/worker-assets.ts +1 -6
- package/src/cloudflare/worker-metadata.ts +5 -3
- package/src/cloudflare/worker-tail.ts +3 -1
- package/src/cloudflare/worker.ts +3 -1
- package/src/cloudflare/wrangler.json.ts +0 -1
- package/src/cloudflare/zone.ts +6 -38
- package/src/coinbase/evm-account.ts +3 -1
- package/src/coinbase/evm-smart-account.ts +3 -1
- package/src/docker/api.ts +3 -1
- package/src/github/secret.ts +5 -1
- package/src/neon/api/sdk.gen.ts +1 -3
- package/src/os/exec.ts +3 -1
- package/src/planetscale/api/sdk.gen.ts +1 -3
- package/src/prisma-postgres/api/sdk.gen.ts +1 -3
- package/src/scope.ts +2 -2
- package/src/sentry/client-key.ts +1 -5
- package/src/test/bun.ts +3 -1
- package/src/test/vitest.ts +3 -1
- package/src/util/api/client/client.gen.ts +49 -49
- package/src/util/api/client/types.gen.ts +43 -43
- package/src/util/api/client/utils.gen.ts +47 -42
- package/src/util/api/core/auth.gen.ts +6 -6
- package/src/util/api/core/bodySerializer.gen.ts +4 -4
- package/src/util/api/core/params.gen.ts +10 -10
- package/src/util/api/core/pathSerializer.gen.ts +39 -39
- package/src/util/api/core/serverSentEvents.gen.ts +22 -22
- package/src/util/api/core/types.gen.ts +12 -12
- package/src/util/api/core/utils.gen.ts +18 -18
- package/src/util/camel-to-snake.ts +12 -10
- package/src/util/find-workspace-root.ts +112 -0
- package/src/util/idempotent-spawn.ts +1 -5
- package/src/util/peer.ts +3 -1
- package/templates/astro/astro.config.mjs +3 -3
- package/templates/astro/src/pages/api/hello.ts +16 -13
- package/templates/bun-spa/bun-env.d.ts +0 -1
- package/templates/bun-spa/eslint.config.js +11 -12
- package/templates/bun-spa/src/App.tsx +0 -1
- package/templates/bun-spa/src/frontend.tsx +0 -1
- package/templates/hono/src/index.ts +13 -13
- package/templates/nextjs/alchemy.run.ts +1 -1
- package/templates/nextjs/eslint.config.mjs +1 -1
- package/templates/nextjs/next-env.d.ts +1 -1
- package/templates/nextjs/next.config.ts +1 -1
- package/templates/nextjs/open-next.config.ts +1 -1
- package/templates/nextjs/src/app/api/hello/route.ts +2 -2
- package/templates/nextjs/src/app/layout.tsx +1 -1
- package/templates/nextjs/src/app/page.tsx +14 -15
- package/templates/nextjs/types/env.d.ts +4 -4
- package/templates/nuxt/server/middleware/auth.ts +1 -1
- package/templates/nuxt/server/middleware/hello.ts +2 -2
- package/templates/react-router/app/entry.server.tsx +2 -2
- package/templates/react-router/vite.config.ts +1 -1
- package/templates/react-router/workers/app.ts +2 -2
- package/templates/rwsdk/alchemy.run.ts +6 -3
- package/templates/sveltekit/src/app.d.ts +7 -7
- package/templates/sveltekit/svelte.config.js +4 -4
- package/templates/sveltekit/vite.config.ts +3 -3
- package/templates/tanstack-start/src/components/Header.tsx +2 -2
- package/templates/tanstack-start/src/router.tsx +4 -4
- package/templates/tanstack-start/src/routes/__root.tsx +10 -10
- package/templates/tanstack-start/src/routes/api.demo-names.ts +6 -6
- package/templates/tanstack-start/src/routes/demo.start.api-request.tsx +11 -11
- package/templates/tanstack-start/src/routes/demo.start.server-funcs.tsx +30 -30
- package/templates/tanstack-start/src/routes/index.tsx +5 -5
- package/templates/tanstack-start/vite.config.ts +9 -9
- package/templates/typescript/src/worker.ts +5 -1
- package/templates/vite/eslint.config.js +12 -12
- package/templates/vite/src/App.tsx +7 -7
- package/templates/vite/src/main.tsx +6 -6
- package/templates/vite/src/worker.ts +11 -12
- package/templates/vite/vite.config.ts +2 -2
- package/workers/tunnel-proxy.js +1 -1
- package/bin/services/find-workspace-root.ts +0 -48
- package/lib/cloudflare/miniflare/symlink-miniflare-state.d.ts +0 -2
- package/lib/cloudflare/miniflare/symlink-miniflare-state.d.ts.map +0 -1
- package/lib/cloudflare/miniflare/symlink-miniflare-state.js +0 -18
- package/lib/cloudflare/miniflare/symlink-miniflare-state.js.map +0 -1
- package/src/cloudflare/miniflare/symlink-miniflare-state.ts +0 -18
package/src/sentry/client-key.ts
CHANGED
|
@@ -340,11 +340,7 @@ async function findClientKeyByName(
|
|
|
340
340
|
*/
|
|
341
341
|
async function getClientKeyName(
|
|
342
342
|
api: SentryApi,
|
|
343
|
-
{
|
|
344
|
-
organization,
|
|
345
|
-
project,
|
|
346
|
-
keyId,
|
|
347
|
-
}: {
|
|
343
|
+
{ organization, project, keyId }: {
|
|
348
344
|
organization: string;
|
|
349
345
|
project: string;
|
|
350
346
|
keyId: string;
|
package/src/test/bun.ts
CHANGED
|
@@ -98,7 +98,9 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
98
98
|
// Create local test scope based on filename
|
|
99
99
|
const scope = new Scope({
|
|
100
100
|
parent: undefined,
|
|
101
|
-
scopeName: `${
|
|
101
|
+
scopeName: `${
|
|
102
|
+
defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""
|
|
103
|
+
}${path.basename(meta.filename)}`,
|
|
102
104
|
// parent: globalTestScope,
|
|
103
105
|
stateStore: defaultOptions?.stateStore,
|
|
104
106
|
phase: "up",
|
package/src/test/vitest.ts
CHANGED
|
@@ -128,7 +128,9 @@ export function test(
|
|
|
128
128
|
|
|
129
129
|
const scope = new Scope({
|
|
130
130
|
parent: undefined,
|
|
131
|
-
scopeName: `${
|
|
131
|
+
scopeName: `${
|
|
132
|
+
defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""
|
|
133
|
+
}${path.basename(meta.filename)}`,
|
|
132
134
|
stateStore: defaultOptions?.stateStore,
|
|
133
135
|
phase: "up",
|
|
134
136
|
noTrack: true,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
|
-
import { createSseClient } from
|
|
4
|
-
import type { HttpMethod } from
|
|
5
|
-
import { getValidRequestBody } from
|
|
3
|
+
import { createSseClient } from "../core/serverSentEvents.gen";
|
|
4
|
+
import type { HttpMethod } from "../core/types.gen";
|
|
5
|
+
import { getValidRequestBody } from "../core/utils.gen";
|
|
6
6
|
import type {
|
|
7
7
|
Client,
|
|
8
8
|
Config,
|
|
9
9
|
RequestOptions,
|
|
10
10
|
ResolvedRequestOptions,
|
|
11
|
-
} from
|
|
11
|
+
} from "./types.gen";
|
|
12
12
|
import {
|
|
13
13
|
buildUrl,
|
|
14
14
|
createConfig,
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
mergeConfigs,
|
|
18
18
|
mergeHeaders,
|
|
19
19
|
setAuthParams,
|
|
20
|
-
} from
|
|
20
|
+
} from "./utils.gen";
|
|
21
21
|
|
|
22
|
-
type ReqInit = Omit<RequestInit,
|
|
22
|
+
type ReqInit = Omit<RequestInit, "body" | "headers"> & {
|
|
23
23
|
body?: any;
|
|
24
24
|
headers: ReturnType<typeof mergeHeaders>;
|
|
25
25
|
};
|
|
@@ -66,8 +66,8 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
69
|
-
if (opts.body === undefined || opts.serializedBody ===
|
|
70
|
-
opts.headers.delete(
|
|
69
|
+
if (opts.body === undefined || opts.serializedBody === "") {
|
|
70
|
+
opts.headers.delete("Content-Type");
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
const url = buildUrl(opts);
|
|
@@ -75,11 +75,11 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
75
75
|
return { opts, url };
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
const request: Client[
|
|
78
|
+
const request: Client["request"] = async (options) => {
|
|
79
79
|
// @ts-expect-error
|
|
80
80
|
const { opts, url } = await beforeRequest(options);
|
|
81
81
|
const requestInit: ReqInit = {
|
|
82
|
-
redirect:
|
|
82
|
+
redirect: "follow",
|
|
83
83
|
...opts,
|
|
84
84
|
body: getValidRequestBody(opts),
|
|
85
85
|
};
|
|
@@ -110,33 +110,33 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
110
110
|
|
|
111
111
|
if (response.ok) {
|
|
112
112
|
const parseAs =
|
|
113
|
-
(opts.parseAs ===
|
|
114
|
-
? getParseAs(response.headers.get(
|
|
115
|
-
: opts.parseAs) ??
|
|
113
|
+
(opts.parseAs === "auto"
|
|
114
|
+
? getParseAs(response.headers.get("Content-Type"))
|
|
115
|
+
: opts.parseAs) ?? "json";
|
|
116
116
|
|
|
117
117
|
if (
|
|
118
118
|
response.status === 204 ||
|
|
119
|
-
response.headers.get(
|
|
119
|
+
response.headers.get("Content-Length") === "0"
|
|
120
120
|
) {
|
|
121
121
|
let emptyData: any;
|
|
122
122
|
switch (parseAs) {
|
|
123
|
-
case
|
|
124
|
-
case
|
|
125
|
-
case
|
|
123
|
+
case "arrayBuffer":
|
|
124
|
+
case "blob":
|
|
125
|
+
case "text":
|
|
126
126
|
emptyData = await response[parseAs]();
|
|
127
127
|
break;
|
|
128
|
-
case
|
|
128
|
+
case "formData":
|
|
129
129
|
emptyData = new FormData();
|
|
130
130
|
break;
|
|
131
|
-
case
|
|
131
|
+
case "stream":
|
|
132
132
|
emptyData = response.body;
|
|
133
133
|
break;
|
|
134
|
-
case
|
|
134
|
+
case "json":
|
|
135
135
|
default:
|
|
136
136
|
emptyData = {};
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
|
-
return opts.responseStyle ===
|
|
139
|
+
return opts.responseStyle === "data"
|
|
140
140
|
? emptyData
|
|
141
141
|
: {
|
|
142
142
|
data: emptyData,
|
|
@@ -146,15 +146,15 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
146
146
|
|
|
147
147
|
let data: any;
|
|
148
148
|
switch (parseAs) {
|
|
149
|
-
case
|
|
150
|
-
case
|
|
151
|
-
case
|
|
152
|
-
case
|
|
153
|
-
case
|
|
149
|
+
case "arrayBuffer":
|
|
150
|
+
case "blob":
|
|
151
|
+
case "formData":
|
|
152
|
+
case "json":
|
|
153
|
+
case "text":
|
|
154
154
|
data = await response[parseAs]();
|
|
155
155
|
break;
|
|
156
|
-
case
|
|
157
|
-
return opts.responseStyle ===
|
|
156
|
+
case "stream":
|
|
157
|
+
return opts.responseStyle === "data"
|
|
158
158
|
? response.body
|
|
159
159
|
: {
|
|
160
160
|
data: response.body,
|
|
@@ -162,7 +162,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
if (parseAs ===
|
|
165
|
+
if (parseAs === "json") {
|
|
166
166
|
if (opts.responseValidator) {
|
|
167
167
|
await opts.responseValidator(data);
|
|
168
168
|
}
|
|
@@ -172,7 +172,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
return opts.responseStyle ===
|
|
175
|
+
return opts.responseStyle === "data"
|
|
176
176
|
? data
|
|
177
177
|
: {
|
|
178
178
|
data,
|
|
@@ -205,7 +205,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
// TODO: we probably want to return error and improve types
|
|
208
|
-
return opts.responseStyle ===
|
|
208
|
+
return opts.responseStyle === "data"
|
|
209
209
|
? undefined
|
|
210
210
|
: {
|
|
211
211
|
error: finalError,
|
|
@@ -240,29 +240,29 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
240
240
|
|
|
241
241
|
return {
|
|
242
242
|
buildUrl,
|
|
243
|
-
connect: makeMethodFn(
|
|
244
|
-
delete: makeMethodFn(
|
|
245
|
-
get: makeMethodFn(
|
|
243
|
+
connect: makeMethodFn("CONNECT"),
|
|
244
|
+
delete: makeMethodFn("DELETE"),
|
|
245
|
+
get: makeMethodFn("GET"),
|
|
246
246
|
getConfig,
|
|
247
|
-
head: makeMethodFn(
|
|
247
|
+
head: makeMethodFn("HEAD"),
|
|
248
248
|
interceptors,
|
|
249
|
-
options: makeMethodFn(
|
|
250
|
-
patch: makeMethodFn(
|
|
251
|
-
post: makeMethodFn(
|
|
252
|
-
put: makeMethodFn(
|
|
249
|
+
options: makeMethodFn("OPTIONS"),
|
|
250
|
+
patch: makeMethodFn("PATCH"),
|
|
251
|
+
post: makeMethodFn("POST"),
|
|
252
|
+
put: makeMethodFn("PUT"),
|
|
253
253
|
request,
|
|
254
254
|
setConfig,
|
|
255
255
|
sse: {
|
|
256
|
-
connect: makeSseFn(
|
|
257
|
-
delete: makeSseFn(
|
|
258
|
-
get: makeSseFn(
|
|
259
|
-
head: makeSseFn(
|
|
260
|
-
options: makeSseFn(
|
|
261
|
-
patch: makeSseFn(
|
|
262
|
-
post: makeSseFn(
|
|
263
|
-
put: makeSseFn(
|
|
264
|
-
trace: makeSseFn(
|
|
256
|
+
connect: makeSseFn("CONNECT"),
|
|
257
|
+
delete: makeSseFn("DELETE"),
|
|
258
|
+
get: makeSseFn("GET"),
|
|
259
|
+
head: makeSseFn("HEAD"),
|
|
260
|
+
options: makeSseFn("OPTIONS"),
|
|
261
|
+
patch: makeSseFn("PATCH"),
|
|
262
|
+
post: makeSseFn("POST"),
|
|
263
|
+
put: makeSseFn("PUT"),
|
|
264
|
+
trace: makeSseFn("TRACE"),
|
|
265
265
|
},
|
|
266
|
-
trace: makeMethodFn(
|
|
266
|
+
trace: makeMethodFn("TRACE"),
|
|
267
267
|
} as Client;
|
|
268
268
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
|
-
import type { Auth } from
|
|
3
|
+
import type { Auth } from "../core/auth.gen";
|
|
4
4
|
import type {
|
|
5
5
|
ServerSentEventsOptions,
|
|
6
6
|
ServerSentEventsResult,
|
|
7
|
-
} from
|
|
7
|
+
} from "../core/serverSentEvents.gen";
|
|
8
8
|
import type {
|
|
9
9
|
Client as CoreClient,
|
|
10
10
|
Config as CoreConfig,
|
|
11
|
-
} from
|
|
12
|
-
import type { Middleware } from
|
|
11
|
+
} from "../core/types.gen";
|
|
12
|
+
import type { Middleware } from "./utils.gen";
|
|
13
13
|
|
|
14
|
-
export type ResponseStyle =
|
|
14
|
+
export type ResponseStyle = "data" | "fields";
|
|
15
15
|
|
|
16
16
|
export interface Config<T extends ClientOptions = ClientOptions>
|
|
17
|
-
extends Omit<RequestInit,
|
|
17
|
+
extends Omit<RequestInit, "body" | "headers" | "method">,
|
|
18
18
|
CoreConfig {
|
|
19
19
|
/**
|
|
20
20
|
* Base URL for all requests made by this client.
|
|
21
21
|
*/
|
|
22
|
-
baseUrl?: T[
|
|
22
|
+
baseUrl?: T["baseUrl"];
|
|
23
23
|
/**
|
|
24
24
|
* Fetch API implementation. You can use this option to provide a custom
|
|
25
25
|
* fetch instance.
|
|
@@ -43,13 +43,13 @@ export interface Config<T extends ClientOptions = ClientOptions>
|
|
|
43
43
|
* @default 'auto'
|
|
44
44
|
*/
|
|
45
45
|
parseAs?:
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
46
|
+
| "arrayBuffer"
|
|
47
|
+
| "auto"
|
|
48
|
+
| "blob"
|
|
49
|
+
| "formData"
|
|
50
|
+
| "json"
|
|
51
|
+
| "stream"
|
|
52
|
+
| "text";
|
|
53
53
|
/**
|
|
54
54
|
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
55
55
|
*
|
|
@@ -61,12 +61,12 @@ export interface Config<T extends ClientOptions = ClientOptions>
|
|
|
61
61
|
*
|
|
62
62
|
* @default false
|
|
63
63
|
*/
|
|
64
|
-
throwOnError?: T[
|
|
64
|
+
throwOnError?: T["throwOnError"];
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export interface RequestOptions<
|
|
68
68
|
TData = unknown,
|
|
69
|
-
TResponseStyle extends ResponseStyle =
|
|
69
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
70
70
|
ThrowOnError extends boolean = boolean,
|
|
71
71
|
Url extends string = string,
|
|
72
72
|
> extends Config<{
|
|
@@ -75,11 +75,11 @@ export interface RequestOptions<
|
|
|
75
75
|
}>,
|
|
76
76
|
Pick<
|
|
77
77
|
ServerSentEventsOptions<TData>,
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
78
|
+
| "onSseError"
|
|
79
|
+
| "onSseEvent"
|
|
80
|
+
| "sseDefaultRetryDelay"
|
|
81
|
+
| "sseMaxRetryAttempts"
|
|
82
|
+
| "sseMaxRetryDelay"
|
|
83
83
|
> {
|
|
84
84
|
/**
|
|
85
85
|
* Any body that you want to add to your request.
|
|
@@ -97,7 +97,7 @@ export interface RequestOptions<
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
export interface ResolvedRequestOptions<
|
|
100
|
-
TResponseStyle extends ResponseStyle =
|
|
100
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
101
101
|
ThrowOnError extends boolean = boolean,
|
|
102
102
|
Url extends string = string,
|
|
103
103
|
> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
@@ -108,10 +108,10 @@ export type RequestResult<
|
|
|
108
108
|
TData = unknown,
|
|
109
109
|
TError = unknown,
|
|
110
110
|
ThrowOnError extends boolean = boolean,
|
|
111
|
-
TResponseStyle extends ResponseStyle =
|
|
111
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
112
112
|
> = ThrowOnError extends true
|
|
113
113
|
? Promise<
|
|
114
|
-
TResponseStyle extends
|
|
114
|
+
TResponseStyle extends "data"
|
|
115
115
|
? TData extends Record<string, unknown>
|
|
116
116
|
? TData[keyof TData]
|
|
117
117
|
: TData
|
|
@@ -124,7 +124,7 @@ export type RequestResult<
|
|
|
124
124
|
}
|
|
125
125
|
>
|
|
126
126
|
: Promise<
|
|
127
|
-
TResponseStyle extends
|
|
127
|
+
TResponseStyle extends "data"
|
|
128
128
|
?
|
|
129
129
|
| (TData extends Record<string, unknown>
|
|
130
130
|
? TData[keyof TData]
|
|
@@ -159,30 +159,30 @@ type MethodFn = <
|
|
|
159
159
|
TData = unknown,
|
|
160
160
|
TError = unknown,
|
|
161
161
|
ThrowOnError extends boolean = false,
|
|
162
|
-
TResponseStyle extends ResponseStyle =
|
|
162
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
163
163
|
>(
|
|
164
|
-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>,
|
|
164
|
+
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
|
|
165
165
|
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
166
166
|
|
|
167
167
|
type SseFn = <
|
|
168
168
|
TData = unknown,
|
|
169
169
|
TError = unknown,
|
|
170
170
|
ThrowOnError extends boolean = false,
|
|
171
|
-
TResponseStyle extends ResponseStyle =
|
|
171
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
172
172
|
>(
|
|
173
|
-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>,
|
|
173
|
+
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
|
|
174
174
|
) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
175
175
|
|
|
176
176
|
type RequestFn = <
|
|
177
177
|
TData = unknown,
|
|
178
178
|
TError = unknown,
|
|
179
179
|
ThrowOnError extends boolean = false,
|
|
180
|
-
TResponseStyle extends ResponseStyle =
|
|
180
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
181
181
|
>(
|
|
182
|
-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>,
|
|
182
|
+
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> &
|
|
183
183
|
Pick<
|
|
184
184
|
Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>,
|
|
185
|
-
|
|
185
|
+
"method"
|
|
186
186
|
>,
|
|
187
187
|
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
188
188
|
|
|
@@ -194,7 +194,7 @@ type BuildUrlFn = <
|
|
|
194
194
|
url: string;
|
|
195
195
|
},
|
|
196
196
|
>(
|
|
197
|
-
options: Pick<TData,
|
|
197
|
+
options: Pick<TData, "url"> & Options<TData>,
|
|
198
198
|
) => string;
|
|
199
199
|
|
|
200
200
|
export type Client = CoreClient<
|
|
@@ -233,36 +233,36 @@ export type Options<
|
|
|
233
233
|
TData extends TDataShape = TDataShape,
|
|
234
234
|
ThrowOnError extends boolean = boolean,
|
|
235
235
|
TResponse = unknown,
|
|
236
|
-
TResponseStyle extends ResponseStyle =
|
|
236
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
237
237
|
> = OmitKeys<
|
|
238
238
|
RequestOptions<TResponse, TResponseStyle, ThrowOnError>,
|
|
239
|
-
|
|
239
|
+
"body" | "path" | "query" | "url"
|
|
240
240
|
> &
|
|
241
|
-
Omit<TData,
|
|
241
|
+
Omit<TData, "url">;
|
|
242
242
|
|
|
243
243
|
export type OptionsLegacyParser<
|
|
244
244
|
TData = unknown,
|
|
245
245
|
ThrowOnError extends boolean = boolean,
|
|
246
|
-
TResponseStyle extends ResponseStyle =
|
|
246
|
+
TResponseStyle extends ResponseStyle = "fields",
|
|
247
247
|
> = TData extends { body?: any }
|
|
248
248
|
? TData extends { headers?: any }
|
|
249
249
|
? OmitKeys<
|
|
250
250
|
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
|
|
251
|
-
|
|
251
|
+
"body" | "headers" | "url"
|
|
252
252
|
> &
|
|
253
253
|
TData
|
|
254
254
|
: OmitKeys<
|
|
255
255
|
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
|
|
256
|
-
|
|
256
|
+
"body" | "url"
|
|
257
257
|
> &
|
|
258
258
|
TData &
|
|
259
|
-
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>,
|
|
259
|
+
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "headers">
|
|
260
260
|
: TData extends { headers?: any }
|
|
261
261
|
? OmitKeys<
|
|
262
262
|
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
|
|
263
|
-
|
|
263
|
+
"headers" | "url"
|
|
264
264
|
> &
|
|
265
265
|
TData &
|
|
266
|
-
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>,
|
|
267
|
-
: OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>,
|
|
266
|
+
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body">
|
|
267
|
+
: OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "url"> &
|
|
268
268
|
TData;
|