@waldofyi/sdk 0.1.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.
Potentially problematic release.
This version of @waldofyi/sdk might be problematic. Click here for more details.
- package/LICENSE +40 -0
- package/README.md +37 -0
- package/dist/client/client.gen.d.ts +3 -0
- package/dist/client/client.gen.d.ts.map +1 -0
- package/dist/client/client.gen.js +218 -0
- package/dist/client/client.gen.js.map +1 -0
- package/dist/client/index.d.ts +11 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/types.gen.d.ts +121 -0
- package/dist/client/types.gen.d.ts.map +1 -0
- package/dist/client/types.gen.js +3 -0
- package/dist/client/types.gen.js.map +1 -0
- package/dist/client/utils.gen.d.ts +38 -0
- package/dist/client/utils.gen.d.ts.map +1 -0
- package/dist/client/utils.gen.js +232 -0
- package/dist/client/utils.gen.js.map +1 -0
- package/dist/client.gen.d.ts +13 -0
- package/dist/client.gen.d.ts.map +1 -0
- package/dist/client.gen.js +4 -0
- package/dist/client.gen.js.map +1 -0
- package/dist/core/auth.gen.d.ts +26 -0
- package/dist/core/auth.gen.d.ts.map +1 -0
- package/dist/core/auth.gen.js +15 -0
- package/dist/core/auth.gen.js.map +1 -0
- package/dist/core/bodySerializer.gen.d.ts +26 -0
- package/dist/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/core/bodySerializer.gen.js +58 -0
- package/dist/core/bodySerializer.gen.js.map +1 -0
- package/dist/core/params.gen.d.ts +44 -0
- package/dist/core/params.gen.d.ts.map +1 -0
- package/dist/core/params.gen.js +113 -0
- package/dist/core/params.gen.js.map +1 -0
- package/dist/core/pathSerializer.gen.d.ts +34 -0
- package/dist/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/core/pathSerializer.gen.js +115 -0
- package/dist/core/pathSerializer.gen.js.map +1 -0
- package/dist/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/core/queryKeySerializer.gen.js +100 -0
- package/dist/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/core/serverSentEvents.gen.js +137 -0
- package/dist/core/serverSentEvents.gen.js.map +1 -0
- package/dist/core/types.gen.d.ts +84 -0
- package/dist/core/types.gen.d.ts.map +1 -0
- package/dist/core/types.gen.js +3 -0
- package/dist/core/types.gen.js.map +1 -0
- package/dist/core/utils.gen.d.ts +20 -0
- package/dist/core/utils.gen.d.ts.map +1 -0
- package/dist/core/utils.gen.js +88 -0
- package/dist/core/utils.gen.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/sdk.gen.d.ts +408 -0
- package/dist/sdk.gen.d.ts.map +1 -0
- package/dist/sdk.gen.js +455 -0
- package/dist/sdk.gen.js.map +1 -0
- package/dist/types.gen.d.ts +2701 -0
- package/dist/types.gen.d.ts.map +1 -0
- package/dist/types.gen.js +3 -0
- package/dist/types.gen.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Waldo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This package's client runtime is generated by and bundled from hey-api
|
|
26
|
+
(@hey-api/openapi-ts, @hey-api/client-fetch), used under the MIT License:
|
|
27
|
+
|
|
28
|
+
Copyright (c) Hey API
|
|
29
|
+
|
|
30
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
31
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
32
|
+
in the Software without restriction, including without limitation the rights
|
|
33
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
34
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
35
|
+
furnished to do so, subject to the following conditions:
|
|
36
|
+
|
|
37
|
+
The above copyright notice and this permission notice shall be included in
|
|
38
|
+
all copies or substantial portions of the Software.
|
|
39
|
+
|
|
40
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @waldofyi/sdk
|
|
2
|
+
|
|
3
|
+
Official TypeScript SDK for the **public** Waldo API. Generated from the OpenAPI
|
|
4
|
+
spec with [hey-api](https://heyapi.dev) — do not hand-edit `src/`.
|
|
5
|
+
|
|
6
|
+
## Regenerate
|
|
7
|
+
|
|
8
|
+
The OpenAPI input (`openapi.json`) is built **locally from this repo's own REST
|
|
9
|
+
app** — not fetched from a deployed URL — so the SDK always matches the code
|
|
10
|
+
being shipped (no drift, no deploy dependency).
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm --filter @waldo/graphql-api gen:sdk-spec # rebuild the committed openapi.json
|
|
14
|
+
pnpm --filter @waldofyi/sdk codegen # generate src/ from openapi.json
|
|
15
|
+
pnpm --filter @waldofyi/sdk build # compile to dist/
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`codegen` + `build` also run automatically via `prepublishOnly`.
|
|
19
|
+
|
|
20
|
+
## What's in / out
|
|
21
|
+
|
|
22
|
+
`gen:sdk-spec` builds the spec for the public SDK flag set (see
|
|
23
|
+
`packages/api/scripts/gen-sdk-spec.ts`). Admin/platform routes are excluded;
|
|
24
|
+
brand-intelligence routes are **included** (v0.1.0). The server's feature-flag
|
|
25
|
+
exposure system stays the single source of truth for what's public — the
|
|
26
|
+
generator only picks the flag set.
|
|
27
|
+
|
|
28
|
+
Method names come from each route's `operationId`, which the API emits from the
|
|
29
|
+
operation registry's `operationName` (`packages/api/src/rest/lib/operation-route.ts`)
|
|
30
|
+
and stamps onto the spec in `buildFilteredOpenApiSpec`.
|
|
31
|
+
|
|
32
|
+
The internal, admin-capable client used by the CLI lives at
|
|
33
|
+
`packages/cli/src/sdk/` (hand-written, GraphQL + REST).
|
|
34
|
+
|
|
35
|
+
> Generated `src/*.gen.ts` is not committed (gitignored) — it's produced fresh
|
|
36
|
+
> from the committed `openapi.json` at codegen/publish. Only `openapi.json` and
|
|
37
|
+
> the placeholder `src/index.ts` are committed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../src/client/client.gen.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EAGP,MAAM,aAAa,CAAC;AAgBrB,eAAO,MAAM,YAAY,YAAY,MAAM,KAAQ,MAoRlD,CAAC"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { createSseClient } from "../core/serverSentEvents.gen";
|
|
3
|
+
import { getValidRequestBody } from "../core/utils.gen";
|
|
4
|
+
import { buildUrl, createConfig, createInterceptors, getParseAs, mergeConfigs, mergeHeaders, setAuthParams, } from "./utils.gen";
|
|
5
|
+
export const createClient = (config = {}) => {
|
|
6
|
+
let _config = mergeConfigs(createConfig(), config);
|
|
7
|
+
const getConfig = () => ({ ..._config });
|
|
8
|
+
const setConfig = (config) => {
|
|
9
|
+
_config = mergeConfigs(_config, config);
|
|
10
|
+
return getConfig();
|
|
11
|
+
};
|
|
12
|
+
const interceptors = createInterceptors();
|
|
13
|
+
const beforeRequest = async (options) => {
|
|
14
|
+
const opts = {
|
|
15
|
+
..._config,
|
|
16
|
+
...options,
|
|
17
|
+
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
18
|
+
headers: mergeHeaders(_config.headers, options.headers),
|
|
19
|
+
serializedBody: undefined,
|
|
20
|
+
};
|
|
21
|
+
if (opts.security) {
|
|
22
|
+
await setAuthParams(opts);
|
|
23
|
+
}
|
|
24
|
+
if (opts.requestValidator) {
|
|
25
|
+
await opts.requestValidator(opts);
|
|
26
|
+
}
|
|
27
|
+
if (opts.body !== undefined && opts.bodySerializer) {
|
|
28
|
+
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
29
|
+
}
|
|
30
|
+
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
31
|
+
if (opts.body === undefined || opts.serializedBody === "") {
|
|
32
|
+
opts.headers.delete("Content-Type");
|
|
33
|
+
}
|
|
34
|
+
const resolvedOpts = opts;
|
|
35
|
+
const url = buildUrl(resolvedOpts);
|
|
36
|
+
return { opts: resolvedOpts, url };
|
|
37
|
+
};
|
|
38
|
+
const request = async (options) => {
|
|
39
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
40
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
41
|
+
let request;
|
|
42
|
+
let response;
|
|
43
|
+
try {
|
|
44
|
+
const { opts, url } = await beforeRequest(options);
|
|
45
|
+
const requestInit = {
|
|
46
|
+
redirect: "follow",
|
|
47
|
+
...opts,
|
|
48
|
+
body: getValidRequestBody(opts),
|
|
49
|
+
};
|
|
50
|
+
request = new Request(url, requestInit);
|
|
51
|
+
for (const fn of interceptors.request.fns) {
|
|
52
|
+
if (fn) {
|
|
53
|
+
request = await fn(request, opts);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// fetch must be assigned here, otherwise it would throw the error:
|
|
57
|
+
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
|
58
|
+
const _fetch = opts.fetch;
|
|
59
|
+
response = await _fetch(request);
|
|
60
|
+
for (const fn of interceptors.response.fns) {
|
|
61
|
+
if (fn) {
|
|
62
|
+
response = await fn(response, request, opts);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const result = {
|
|
66
|
+
request,
|
|
67
|
+
response,
|
|
68
|
+
};
|
|
69
|
+
if (response.ok) {
|
|
70
|
+
const parseAs = (opts.parseAs === "auto"
|
|
71
|
+
? getParseAs(response.headers.get("Content-Type"))
|
|
72
|
+
: opts.parseAs) ?? "json";
|
|
73
|
+
if (response.status === 204 ||
|
|
74
|
+
response.headers.get("Content-Length") === "0") {
|
|
75
|
+
let emptyData;
|
|
76
|
+
switch (parseAs) {
|
|
77
|
+
case "arrayBuffer":
|
|
78
|
+
case "blob":
|
|
79
|
+
case "text":
|
|
80
|
+
emptyData = await response[parseAs]();
|
|
81
|
+
break;
|
|
82
|
+
case "formData":
|
|
83
|
+
emptyData = new FormData();
|
|
84
|
+
break;
|
|
85
|
+
case "stream":
|
|
86
|
+
emptyData = response.body;
|
|
87
|
+
break;
|
|
88
|
+
case "json":
|
|
89
|
+
default:
|
|
90
|
+
emptyData = {};
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
return opts.responseStyle === "data"
|
|
94
|
+
? emptyData
|
|
95
|
+
: {
|
|
96
|
+
data: emptyData,
|
|
97
|
+
...result,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
let data;
|
|
101
|
+
switch (parseAs) {
|
|
102
|
+
case "arrayBuffer":
|
|
103
|
+
case "blob":
|
|
104
|
+
case "formData":
|
|
105
|
+
case "text":
|
|
106
|
+
data = await response[parseAs]();
|
|
107
|
+
break;
|
|
108
|
+
case "json": {
|
|
109
|
+
// Some servers return 200 with no Content-Length and empty body.
|
|
110
|
+
// response.json() would throw; read as text and parse if non-empty.
|
|
111
|
+
const text = await response.text();
|
|
112
|
+
data = text ? JSON.parse(text) : {};
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
case "stream":
|
|
116
|
+
return opts.responseStyle === "data"
|
|
117
|
+
? response.body
|
|
118
|
+
: {
|
|
119
|
+
data: response.body,
|
|
120
|
+
...result,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (parseAs === "json") {
|
|
124
|
+
if (opts.responseValidator) {
|
|
125
|
+
await opts.responseValidator(data);
|
|
126
|
+
}
|
|
127
|
+
if (opts.responseTransformer) {
|
|
128
|
+
data = await opts.responseTransformer(data);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return opts.responseStyle === "data"
|
|
132
|
+
? data
|
|
133
|
+
: {
|
|
134
|
+
data,
|
|
135
|
+
...result,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const textError = await response.text();
|
|
139
|
+
let jsonError;
|
|
140
|
+
try {
|
|
141
|
+
jsonError = JSON.parse(textError);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// noop
|
|
145
|
+
}
|
|
146
|
+
throw jsonError ?? textError;
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
let finalError = error;
|
|
150
|
+
for (const fn of interceptors.error.fns) {
|
|
151
|
+
if (fn) {
|
|
152
|
+
finalError = await fn(finalError, response, request, options);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
finalError = finalError || {};
|
|
156
|
+
if (throwOnError) {
|
|
157
|
+
throw finalError;
|
|
158
|
+
}
|
|
159
|
+
// TODO: we probably want to return error and improve types
|
|
160
|
+
return responseStyle === "data"
|
|
161
|
+
? undefined
|
|
162
|
+
: {
|
|
163
|
+
error: finalError,
|
|
164
|
+
request,
|
|
165
|
+
response,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
170
|
+
const makeSseFn = (method) => async (options) => {
|
|
171
|
+
const { opts, url } = await beforeRequest(options);
|
|
172
|
+
return createSseClient({
|
|
173
|
+
...opts,
|
|
174
|
+
body: opts.body,
|
|
175
|
+
method,
|
|
176
|
+
onRequest: async (url, init) => {
|
|
177
|
+
let request = new Request(url, init);
|
|
178
|
+
for (const fn of interceptors.request.fns) {
|
|
179
|
+
if (fn) {
|
|
180
|
+
request = await fn(request, opts);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return request;
|
|
184
|
+
},
|
|
185
|
+
serializedBody: getValidRequestBody(opts),
|
|
186
|
+
url,
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
const _buildUrl = (options) => buildUrl({ ..._config, ...options });
|
|
190
|
+
return {
|
|
191
|
+
buildUrl: _buildUrl,
|
|
192
|
+
connect: makeMethodFn("CONNECT"),
|
|
193
|
+
delete: makeMethodFn("DELETE"),
|
|
194
|
+
get: makeMethodFn("GET"),
|
|
195
|
+
getConfig,
|
|
196
|
+
head: makeMethodFn("HEAD"),
|
|
197
|
+
interceptors,
|
|
198
|
+
options: makeMethodFn("OPTIONS"),
|
|
199
|
+
patch: makeMethodFn("PATCH"),
|
|
200
|
+
post: makeMethodFn("POST"),
|
|
201
|
+
put: makeMethodFn("PUT"),
|
|
202
|
+
request,
|
|
203
|
+
setConfig,
|
|
204
|
+
sse: {
|
|
205
|
+
connect: makeSseFn("CONNECT"),
|
|
206
|
+
delete: makeSseFn("DELETE"),
|
|
207
|
+
get: makeSseFn("GET"),
|
|
208
|
+
head: makeSseFn("HEAD"),
|
|
209
|
+
options: makeSseFn("OPTIONS"),
|
|
210
|
+
patch: makeSseFn("PATCH"),
|
|
211
|
+
post: makeSseFn("POST"),
|
|
212
|
+
put: makeSseFn("PUT"),
|
|
213
|
+
trace: makeSseFn("TRACE"),
|
|
214
|
+
},
|
|
215
|
+
trace: makeMethodFn("TRACE"),
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
//# sourceMappingURL=client.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.js","sourceRoot":"","sources":["../../src/client/client.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAOxD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,aAAa,CAAC;AAOrB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAE,EAAU,EAAE;IAC1D,IAAI,OAAO,GAAG,YAAY,CAAC,YAAY,EAAE,EAAE,MAAM,CAAC,CAAC;IAEnD,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,CAAC,MAAc,EAAU,EAAE;QAC3C,OAAO,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,SAAS,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,kBAAkB,EAKpC,CAAC;IAEJ,MAAM,aAAa,GAAG,KAAK,EAMzB,OAAi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AChC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC;QAC9B,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC;QACxB,SAAS;QACT,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;QAC1B,YAAY;QACZ,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC;QAChC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC;QAC5B,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;QAC1B,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC;QACxB,OAAO;QACP,SAAS;QACT,GAAG,EAAE;YACH,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;YAC7B,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC;YAC3B,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC;YACrB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;YAC7B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;YACzB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;YACvB,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC;YACrB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;SAC1B;QACD,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC;KACnB,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { Auth } from "../core/auth.gen";
|
|
2
|
+
export type { QuerySerializerOptions } from "../core/bodySerializer.gen";
|
|
3
|
+
export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer, } from "../core/bodySerializer.gen";
|
|
4
|
+
export { buildClientParams } from "../core/params.gen";
|
|
5
|
+
export { serializeQueryKeyValue } from "../core/queryKeySerializer.gen";
|
|
6
|
+
export type { ServerSentEventsResult } from "../core/serverSentEvents.gen";
|
|
7
|
+
export type { ClientMeta } from "../core/types.gen";
|
|
8
|
+
export { createClient } from "./client.gen";
|
|
9
|
+
export type { Client, ClientOptions, Config, CreateClientConfig, Options, RequestOptions, RequestResult, ResolvedRequestOptions, ResponseStyle, TDataShape, } from "./types.gen";
|
|
10
|
+
export { createConfig, mergeHeaders } from "./utils.gen";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,YAAY,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,MAAM,EACN,aAAa,EACb,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer, } from "../core/bodySerializer.gen";
|
|
3
|
+
export { buildClientParams } from "../core/params.gen";
|
|
4
|
+
export { serializeQueryKeyValue } from "../core/queryKeySerializer.gen";
|
|
5
|
+
export { createClient } from "./client.gen";
|
|
6
|
+
export { createConfig, mergeHeaders } from "./utils.gen";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAIrD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { Auth } from "../core/auth.gen";
|
|
2
|
+
import type { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen";
|
|
3
|
+
import type { Client as CoreClient, Config as CoreConfig } from "../core/types.gen";
|
|
4
|
+
import type { Middleware } from "./utils.gen";
|
|
5
|
+
export type ResponseStyle = "data" | "fields";
|
|
6
|
+
export interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, "body" | "headers" | "method">, CoreConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Base URL for all requests made by this client.
|
|
9
|
+
*/
|
|
10
|
+
baseUrl?: T["baseUrl"];
|
|
11
|
+
/**
|
|
12
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
13
|
+
* fetch instance.
|
|
14
|
+
*
|
|
15
|
+
* @default globalThis.fetch
|
|
16
|
+
*/
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
/**
|
|
19
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
20
|
+
* options won't have any effect.
|
|
21
|
+
*
|
|
22
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
23
|
+
*/
|
|
24
|
+
next?: never;
|
|
25
|
+
/**
|
|
26
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
27
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
28
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
29
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
30
|
+
*
|
|
31
|
+
* @default 'auto'
|
|
32
|
+
*/
|
|
33
|
+
parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text";
|
|
34
|
+
/**
|
|
35
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
36
|
+
*
|
|
37
|
+
* @default 'fields'
|
|
38
|
+
*/
|
|
39
|
+
responseStyle?: ResponseStyle;
|
|
40
|
+
/**
|
|
41
|
+
* Throw an error instead of returning it in the response?
|
|
42
|
+
*
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
throwOnError?: T["throwOnError"];
|
|
46
|
+
}
|
|
47
|
+
export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
48
|
+
responseStyle: TResponseStyle;
|
|
49
|
+
throwOnError: ThrowOnError;
|
|
50
|
+
}>, Pick<ServerSentEventsOptions<TData>, "onRequest" | "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
|
|
51
|
+
/**
|
|
52
|
+
* Any body that you want to add to your request.
|
|
53
|
+
*
|
|
54
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
55
|
+
*/
|
|
56
|
+
body?: unknown;
|
|
57
|
+
path?: Record<string, unknown>;
|
|
58
|
+
query?: Record<string, unknown>;
|
|
59
|
+
/**
|
|
60
|
+
* Security mechanism(s) to use for the request.
|
|
61
|
+
*/
|
|
62
|
+
security?: ReadonlyArray<Auth>;
|
|
63
|
+
url: Url;
|
|
64
|
+
}
|
|
65
|
+
export interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
66
|
+
headers: Headers;
|
|
67
|
+
serializedBody?: string;
|
|
68
|
+
}
|
|
69
|
+
export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
70
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
71
|
+
request: Request;
|
|
72
|
+
response: Response;
|
|
73
|
+
}> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
74
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
75
|
+
error: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
data: undefined;
|
|
78
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
79
|
+
}) & {
|
|
80
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
81
|
+
request?: Request;
|
|
82
|
+
/** response may be undefined, because error may be from building the request object itself or from a network error */
|
|
83
|
+
response?: Response;
|
|
84
|
+
}>;
|
|
85
|
+
export interface ClientOptions {
|
|
86
|
+
baseUrl?: string;
|
|
87
|
+
responseStyle?: ResponseStyle;
|
|
88
|
+
throwOnError?: boolean;
|
|
89
|
+
}
|
|
90
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
91
|
+
type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData>>;
|
|
92
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
93
|
+
type BuildUrlFn = <TData extends {
|
|
94
|
+
body?: unknown;
|
|
95
|
+
path?: Record<string, unknown>;
|
|
96
|
+
query?: Record<string, unknown>;
|
|
97
|
+
url: string;
|
|
98
|
+
}>(options: TData & Options<TData>) => string;
|
|
99
|
+
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
100
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* The `createClientConfig()` function will be called on client initialization
|
|
104
|
+
* and the returned object will become the client's initial configuration.
|
|
105
|
+
*
|
|
106
|
+
* You may want to initialize your client this way instead of calling
|
|
107
|
+
* `setConfig()`. This is useful for example if you're using Next.js
|
|
108
|
+
* to ensure your client always has the correct values.
|
|
109
|
+
*/
|
|
110
|
+
export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
|
111
|
+
export interface TDataShape {
|
|
112
|
+
body?: unknown;
|
|
113
|
+
headers?: unknown;
|
|
114
|
+
path?: unknown;
|
|
115
|
+
query?: unknown;
|
|
116
|
+
url: string;
|
|
117
|
+
}
|
|
118
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
119
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & ([TData] extends [never] ? unknown : Omit<TData, "url">);
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=types.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AC,CAAC,KACjC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,KAAK,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEnD,MAAM,MAAM,OAAO,CACjB,KAAK,SAAS,UAAU,GAAG,UAAU,EACrC,YAAY,SAAS,OAAO,GAAG,OAAO,EACtC,SAAS,GAAG,OAAO,EACnB,cAAc,SAAS,aAAa,GAAG,QAAQ,IAC7C,QAAQ,CACV,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,YAAY,CAAC,EACvD,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAClC,GACC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../src/client/types.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { QuerySerializerOptions } from "../core/bodySerializer.gen";
|
|
2
|
+
import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen";
|
|
3
|
+
export declare const createQuerySerializer: <T = unknown>({ parameters, ...args }?: QuerySerializerOptions) => ((queryParams: T) => string);
|
|
4
|
+
/**
|
|
5
|
+
* Infers parseAs value from provided Content-Type header.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getParseAs: (contentType: string | null) => Exclude<Config["parseAs"], "auto">;
|
|
8
|
+
export declare function setAuthParams(options: Pick<RequestOptions, "auth" | "query" | "security"> & {
|
|
9
|
+
headers: Headers;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare const buildUrl: Client["buildUrl"];
|
|
12
|
+
export declare const mergeConfigs: (a: Config, b: Config) => Config;
|
|
13
|
+
export declare const mergeHeaders: (...headers: Array<Required<Config>["headers"] | undefined>) => Headers;
|
|
14
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
15
|
+
/** response may be undefined due to a network error where no response object is produced */
|
|
16
|
+
response: Res | undefined,
|
|
17
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
18
|
+
request: Req | undefined, options: Options) => Err | Promise<Err>;
|
|
19
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
20
|
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
21
|
+
declare class Interceptors<Interceptor> {
|
|
22
|
+
fns: Array<Interceptor | null>;
|
|
23
|
+
clear(): void;
|
|
24
|
+
eject(id: number | Interceptor): void;
|
|
25
|
+
exists(id: number | Interceptor): boolean;
|
|
26
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
27
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
28
|
+
use(fn: Interceptor): number;
|
|
29
|
+
}
|
|
30
|
+
export interface Middleware<Req, Res, Err, Options> {
|
|
31
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
32
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
33
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
34
|
+
}
|
|
35
|
+
export declare const createInterceptors: <Req, Res, Err, Options>() => Middleware<Req, Res, Err, Options>;
|
|
36
|
+
export declare const createConfig: <T extends ClientOptions = ClientOptions>(override?: Config<Omit<ClientOptions, keyof T> & T>) => Config<Omit<ClientOptions, keyof T> & T>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=utils.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.gen.d.ts","sourceRoot":"","sources":["../../src/client/utils.gen.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAQzE,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,MAAM,EACN,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,qBAAqB,GAAI,CAAC,sCAGpC,sBAAsB,KAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,MAAM,CA8C3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,gBACR,MAAM,GAAG,IAAI,KACzB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,CAqCnC,CAAC;AAqBF,wBAAsB,aAAa,CACjC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,GAAG;IAC7D,OAAO,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,UAAU,CAUpC,CAAC;AAEL,eAAO,MAAM,YAAY,MAAO,MAAM,KAAK,MAAM,KAAG,MAOnD,CAAC;AAUF,eAAO,MAAM,YAAY,eACX,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,KACzD,OA8BF,CAAC;AAEF,KAAK,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,IAAI,CAC5C,KAAK,EAAE,GAAG;AACV,4FAA4F;AAC5F,QAAQ,EAAE,GAAG,GAAG,SAAS;AACzB,6FAA6F;AAC7F,OAAO,EAAE,GAAG,GAAG,SAAS,EACxB,OAAO,EAAE,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