@orpc/openapi 2.0.0-beta.49 → 2.0.0-beta.50
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/dist/adapters/aws-lambda/index.d.ts +3 -15
- package/dist/adapters/aws-lambda/index.js +1 -1
- package/dist/adapters/aws-lambda/openapi-handler.d.ts +8 -9
- package/dist/adapters/aws-lambda/openapi-handler.js +19 -17
- package/dist/adapters/fastify/index.d.ts +2 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/fastify/openapi-handler.d.ts +8 -9
- package/dist/adapters/fastify/openapi-handler.js +16 -14
- package/dist/adapters/fetch/index.d.ts +3 -2
- package/dist/adapters/fetch/index.js +2 -2
- package/dist/adapters/fetch/openapi-handler.d.ts +8 -9
- package/dist/adapters/fetch/openapi-handler.js +16 -14
- package/dist/adapters/fetch/openapi-link.d.ts +9 -10
- package/dist/adapters/fetch/openapi-link.js +21 -19
- package/dist/adapters/node/index.d.ts +2 -1
- package/dist/adapters/node/index.js +1 -1
- package/dist/adapters/node/openapi-handler.d.ts +8 -9
- package/dist/adapters/node/openapi-handler.js +16 -14
- package/dist/adapters/standard/index.d.ts +4 -3
- package/dist/adapters/standard/index.js +3 -3
- package/dist/adapters/standard/openapi-handler-codec.d.ts +56 -57
- package/dist/adapters/standard/openapi-handler-codec.js +143 -205
- package/dist/adapters/standard/openapi-link-codec.d.ts +55 -59
- package/dist/adapters/standard/openapi-link-codec.js +262 -377
- package/dist/adapters/standard/openapi-matcher.d.ts +26 -26
- package/dist/adapters/standard/openapi-matcher.js +78 -108
- package/dist/adapters/standard/utils.js +28 -44
- package/dist/bracket-notation.d.ts +22 -22
- package/dist/bracket-notation.js +123 -173
- package/dist/client-factory.d.ts +12 -12
- package/dist/client-factory.js +13 -11
- package/dist/constants.d.ts +1 -4
- package/dist/constants.js +5 -4
- package/dist/extensions/route.d.ts +36 -36
- package/dist/extensions/route.js +7 -6
- package/dist/helpers/form-data.d.ts +1 -1
- package/dist/helpers/form-data.js +74 -86
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.js +1 -1
- package/dist/index.d.ts +15 -13
- package/dist/index.js +11 -11
- package/dist/meta.d.ts +298 -298
- package/dist/meta.js +54 -72
- package/dist/openapi-generator-components.d.ts +2 -31
- package/dist/openapi-generator-components.js +200 -248
- package/dist/openapi-generator-operation.d.ts +12 -33
- package/dist/openapi-generator-operation.js +369 -437
- package/dist/openapi-generator.d.ts +75 -80
- package/dist/openapi-generator.js +114 -142
- package/dist/openapi-json-serializer.d.ts +65 -65
- package/dist/openapi-json-serializer.js +218 -257
- package/dist/openapi-serializer.d.ts +31 -32
- package/dist/openapi-serializer.js +68 -92
- package/dist/plugins/index.d.ts +2 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/openapi-reference.d.ts +99 -102
- package/dist/plugins/openapi-reference.js +109 -132
- package/dist/router-utils.d.ts +7 -10
- package/dist/router-utils.js +30 -34
- package/dist/types.d.ts +8 -12
- package/dist/utils.d.ts +5 -10
- package/dist/utils.js +39 -42
- package/package.json +12 -12
- package/dist/adapters/standard/utils.d.ts +0 -4
- package/dist/types.js +0 -1
|
@@ -1,72 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const meta = getOpenAPIMeta(procedure);
|
|
58
|
-
const successStatus = meta?.successStatus ?? DEFAULT_SUCCESS_STATUS;
|
|
59
|
-
const outputStructure = meta?.outputStructure ?? DEFAULT_OPENAPI_OUTPUT_STRUCTURE;
|
|
60
|
-
if (outputStructure === 'compact') {
|
|
61
|
-
return {
|
|
62
|
-
status: successStatus,
|
|
63
|
-
headers: {},
|
|
64
|
-
body: this.serializer.serialize(output),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
if (!isValidDetailedOutput(output)) {
|
|
68
|
-
throw new TypeError(`
|
|
69
|
-
Invalid "detailed" output structure returned by procedure (${path.join('.')}):
|
|
1
|
+
import "../../constants.js";
|
|
2
|
+
import { getOpenAPIMeta } from "../../meta.js";
|
|
3
|
+
import { OpenAPISerializer } from "../../openapi-serializer.js";
|
|
4
|
+
import { isBodylessMethod } from "../../utils.js";
|
|
5
|
+
import { OpenAPIMatcher } from "./openapi-matcher.js";
|
|
6
|
+
import { serializeHeaders } from "./utils.js";
|
|
7
|
+
import { NullProtoObj, getOwn, isNonPrimitive, isPlainObject, parseEmptyableJSON, stringifyJSON } from "@orpc/shared";
|
|
8
|
+
import { COMMON_ERROR_STATUS_MAP } from "@orpc/client";
|
|
9
|
+
import { DEFAULT_ERROR_STATUS, DEFAULT_SUCCESS_STATUS } from "@orpc/server";
|
|
10
|
+
import { parseStandardUrl } from "@standard-server/core";
|
|
11
|
+
// src/adapters/standard/openapi-handler-codec.ts
|
|
12
|
+
var OpenAPIHandlerCodecCore = class {
|
|
13
|
+
serializer;
|
|
14
|
+
errorStatusMap;
|
|
15
|
+
errorResponseBodyEncoder;
|
|
16
|
+
errorResponseContentType;
|
|
17
|
+
constructor(options = {}) {
|
|
18
|
+
this.serializer = options.serializer ?? new OpenAPISerializer();
|
|
19
|
+
this.errorStatusMap = options.errorStatusMap ?? COMMON_ERROR_STATUS_MAP;
|
|
20
|
+
this.errorResponseBodyEncoder = options.errorResponseBodyEncoder ?? ((e) => e.toJSON());
|
|
21
|
+
this.errorResponseContentType = options.errorResponseContentType;
|
|
22
|
+
}
|
|
23
|
+
async decodeInput(matched, request) {
|
|
24
|
+
const meta = getOpenAPIMeta(matched.procedure);
|
|
25
|
+
const inputStructure = meta?.inputStructure ?? "compact";
|
|
26
|
+
const params = this.deserializeParams(matched.params, meta?.paramsStyles);
|
|
27
|
+
if (inputStructure === "compact") {
|
|
28
|
+
const data = isBodylessMethod(request.method) ? this.deserializeQuery(request.url, meta?.queryStyles) : this.serializer.deserialize(await request.resolveBody(meta?.requestBodyHint));
|
|
29
|
+
if (data === void 0) return params;
|
|
30
|
+
if (!params || Object.keys(params).length < 1) return data;
|
|
31
|
+
if (!isPlainObject(data)) return params;
|
|
32
|
+
return {
|
|
33
|
+
...data,
|
|
34
|
+
...params
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
params,
|
|
39
|
+
query: this.deserializeQuery(request.url, meta?.queryStyles),
|
|
40
|
+
headers: request.headers,
|
|
41
|
+
body: this.serializer.deserialize(await request.resolveBody(meta?.requestBodyHint))
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @throws {TypeError} If `outputStructure` is "detailed" and the output doesn't match the expected structure.
|
|
46
|
+
*/
|
|
47
|
+
encodeOutput(output, procedure, path) {
|
|
48
|
+
const meta = getOpenAPIMeta(procedure);
|
|
49
|
+
const successStatus = meta?.successStatus ?? DEFAULT_SUCCESS_STATUS;
|
|
50
|
+
if ((meta?.outputStructure ?? "compact") === "compact") return {
|
|
51
|
+
status: successStatus,
|
|
52
|
+
headers: {},
|
|
53
|
+
body: this.serializer.serialize(output)
|
|
54
|
+
};
|
|
55
|
+
if (!isValidDetailedOutput(output)) throw new TypeError(`
|
|
56
|
+
Invalid "detailed" output structure returned by procedure (${path.join(".")}):
|
|
70
57
|
• Expected an object with optional properties:
|
|
71
58
|
- status (number <400)
|
|
72
59
|
- headers (object)
|
|
@@ -76,145 +63,96 @@ export class OpenAPIHandlerCodecCore {
|
|
|
76
63
|
Actual value:
|
|
77
64
|
${stringifyJSON(output)}
|
|
78
65
|
`);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
const parsed = { ...params };
|
|
152
|
-
Object.entries(styles).forEach(([key, hint]) => {
|
|
153
|
-
const value = getOwn(params, key);
|
|
154
|
-
if (hint === undefined || hint === 'primitive' || value === undefined) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
if (hint === 'comma-delimited-array') {
|
|
158
|
-
parsed[key] = decodeDelimitedArray(value, ',');
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
const _expect = hint;
|
|
162
|
-
parsed[key] = decodeDelimitedObject(value, ',');
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
return parsed;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
export class OpenAPIHandlerCodec extends OpenAPIHandlerCodecCore {
|
|
169
|
-
matcher;
|
|
170
|
-
constructor(router, options = {}) {
|
|
171
|
-
super(options);
|
|
172
|
-
this.matcher = new OpenAPIMatcher(router, options);
|
|
173
|
-
}
|
|
174
|
-
async resolveProcedure(request, options) {
|
|
175
|
-
const [pathname] = parseStandardUrl(request.url);
|
|
176
|
-
const matched = await this.matcher.match(request.method, pathname, options.prefix);
|
|
177
|
-
if (!matched) {
|
|
178
|
-
return undefined;
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
181
|
-
procedure: matched.procedure,
|
|
182
|
-
path: matched.path,
|
|
183
|
-
decodeInput: () => this.decodeInput(matched, request),
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}
|
|
66
|
+
return {
|
|
67
|
+
status: output.status ?? successStatus,
|
|
68
|
+
headers: output.headers !== void 0 ? serializeHeaders(output.headers, this.serializer) : {},
|
|
69
|
+
body: this.serializer.serialize(output.body)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
encodeError(error) {
|
|
73
|
+
return {
|
|
74
|
+
status: getOwn(this.errorStatusMap, error.code) ?? DEFAULT_ERROR_STATUS,
|
|
75
|
+
headers: this.errorResponseContentType !== void 0 ? { "content-type": this.errorResponseContentType } : {},
|
|
76
|
+
body: this.serializer.serialize(this.errorResponseBodyEncoder(error))
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
deserializeQuery(url, styles) {
|
|
80
|
+
const [, search] = parseStandardUrl(url);
|
|
81
|
+
const searchParams = new URLSearchParams(search);
|
|
82
|
+
const parsed = this.serializer.deserialize(searchParams);
|
|
83
|
+
if (!styles || !isPlainObject(parsed)) return parsed;
|
|
84
|
+
Object.entries(styles).forEach(([key, hint]) => {
|
|
85
|
+
if (hint === void 0) return;
|
|
86
|
+
const values = searchParams.getAll(key);
|
|
87
|
+
let parsedValue;
|
|
88
|
+
if (hint === "primitive") parsedValue = values.at(-1);
|
|
89
|
+
else if (hint === "array") parsedValue = values;
|
|
90
|
+
else if (hint === "comma-delimited-array") parsedValue = decodeDelimitedArray(values.at(-1), ",");
|
|
91
|
+
else if (hint === "comma-delimited-object") parsedValue = decodeDelimitedObject(values.at(-1), ",");
|
|
92
|
+
else if (hint === "space-delimited-array") parsedValue = decodeDelimitedArray(values.at(-1), " ");
|
|
93
|
+
else if (hint === "space-delimited-object") parsedValue = decodeDelimitedObject(values.at(-1), " ");
|
|
94
|
+
else if (hint === "pipe-delimited-array") parsedValue = decodeDelimitedArray(values.at(-1), "|");
|
|
95
|
+
else if (hint === "pipe-delimited-object") parsedValue = decodeDelimitedObject(values.at(-1), "|");
|
|
96
|
+
else {
|
|
97
|
+
const last = values.at(-1);
|
|
98
|
+
try {
|
|
99
|
+
parsedValue = parseEmptyableJSON(last);
|
|
100
|
+
} catch {
|
|
101
|
+
parsedValue = last;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
parsed[key] = this.serializer.deserialize(parsedValue);
|
|
105
|
+
});
|
|
106
|
+
return parsed;
|
|
107
|
+
}
|
|
108
|
+
deserializeParams(params, styles) {
|
|
109
|
+
if (!params || !styles) return params;
|
|
110
|
+
const parsed = { ...params };
|
|
111
|
+
Object.entries(styles).forEach(([key, hint]) => {
|
|
112
|
+
const value = getOwn(params, key);
|
|
113
|
+
if (hint === void 0 || hint === "primitive" || value === void 0) return;
|
|
114
|
+
if (hint === "comma-delimited-array") parsed[key] = decodeDelimitedArray(value, ",");
|
|
115
|
+
else parsed[key] = decodeDelimitedObject(value, ",");
|
|
116
|
+
});
|
|
117
|
+
return parsed;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var OpenAPIHandlerCodec = class extends OpenAPIHandlerCodecCore {
|
|
121
|
+
matcher;
|
|
122
|
+
constructor(router, options = {}) {
|
|
123
|
+
super(options);
|
|
124
|
+
this.matcher = new OpenAPIMatcher(router, options);
|
|
125
|
+
}
|
|
126
|
+
async resolveProcedure(request, options) {
|
|
127
|
+
const [pathname] = parseStandardUrl(request.url);
|
|
128
|
+
const matched = await this.matcher.match(request.method, pathname, options.prefix);
|
|
129
|
+
if (!matched) return;
|
|
130
|
+
return {
|
|
131
|
+
procedure: matched.procedure,
|
|
132
|
+
path: matched.path,
|
|
133
|
+
decodeInput: () => this.decodeInput(matched, request)
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
};
|
|
187
137
|
function isValidDetailedOutput(output) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
if (output.status !== undefined &&
|
|
195
|
-
(typeof output.status !== 'number' || !Number.isInteger(output.status) || output.status > 399)) {
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
if (output.headers !== undefined && !isNonPrimitive(output.headers)) {
|
|
199
|
-
return false;
|
|
200
|
-
}
|
|
201
|
-
return true;
|
|
138
|
+
if (!isNonPrimitive(output)) return false;
|
|
139
|
+
if (Object.keys(output).some((key) => key !== "status" && key !== "headers" && key !== "body")) return false;
|
|
140
|
+
if (output.status !== void 0 && (typeof output.status !== "number" || !Number.isInteger(output.status) || output.status > 399)) return false;
|
|
141
|
+
if (output.headers !== void 0 && !isNonPrimitive(output.headers)) return false;
|
|
142
|
+
return true;
|
|
202
143
|
}
|
|
203
144
|
function decodeDelimitedArray(value, delimiter) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
return value.split(delimiter);
|
|
145
|
+
if (value === void 0) return;
|
|
146
|
+
return value.split(delimiter);
|
|
208
147
|
}
|
|
209
148
|
function decodeDelimitedObject(value, delimiter) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
return obj;
|
|
149
|
+
if (value === void 0) return;
|
|
150
|
+
const obj = new NullProtoObj();
|
|
151
|
+
const parts = value.split(delimiter);
|
|
152
|
+
for (let i = 0; i < parts.length; i += 2) {
|
|
153
|
+
const key = parts[i];
|
|
154
|
+
obj[key] = parts[i + 1];
|
|
155
|
+
}
|
|
156
|
+
return obj;
|
|
220
157
|
}
|
|
158
|
+
export { OpenAPIHandlerCodec, OpenAPIHandlerCodecCore };
|
|
@@ -1,62 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { OpenAPISerializer } from "../../openapi-serializer.js";
|
|
2
|
+
import { Promisable, Public, Value } from "@orpc/shared";
|
|
3
|
+
import { RouterContract } from "@orpc/contract";
|
|
4
|
+
import { ClientContext, ClientOptions } from "@orpc/client";
|
|
5
|
+
import { StandardHeaders, StandardLazyResponse, StandardRequest, StandardUrl } from "@standard-server/core";
|
|
6
|
+
import { StandardLinkCodec, StandardLinkCodecDecodedResponse } from "@orpc/client/standard";
|
|
7
7
|
export interface OpenAPILinkCodecOptions<T extends ClientContext> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
* @example 'application/problem+json'
|
|
41
|
-
*/
|
|
42
|
-
errorResponseContentType?: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Base URL for all requests, without origin. Should match the OpenAPI handler mount path.
|
|
10
|
+
*
|
|
11
|
+
* @example '/api'
|
|
12
|
+
* @default '/'
|
|
13
|
+
*/
|
|
14
|
+
url?: Value<Promisable<StandardUrl>, [options: ClientOptions<T>, path: string[], input: unknown]> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Inject headers into the request.
|
|
17
|
+
*/
|
|
18
|
+
headers?: Value<Promisable<StandardHeaders | Headers>, [options: ClientOptions<T>, path: string[], input: unknown]> | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Override the default OpenAPI serializer.
|
|
21
|
+
*/
|
|
22
|
+
serializer?: Public<OpenAPISerializer> | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Customize how an error response body is converted into the error thrown by the client.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* - Return `defaultError()` to keep the default decoding (a `MalformedResponseError` for bodies that are not ORPC errors)
|
|
28
|
+
*
|
|
29
|
+
* @default ((body, response, defaultError) => defaultError())
|
|
30
|
+
*/
|
|
31
|
+
errorResponseBodyDecoder?: ((deserializedBody: unknown, response: StandardLazyResponse, defaultError: () => Error) => Error) | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Parse error responses with this `content-type` as JSON, ignoring case and parameters such as `charset`.
|
|
34
|
+
* Should match the handler's `errorResponseContentType`.
|
|
35
|
+
*
|
|
36
|
+
* @example 'application/problem+json'
|
|
37
|
+
*/
|
|
38
|
+
errorResponseContentType?: string | undefined;
|
|
43
39
|
}
|
|
44
40
|
export declare class OpenAPILinkCodec<T extends ClientContext> implements StandardLinkCodec<T> {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
41
|
+
private readonly router;
|
|
42
|
+
private readonly baseUrl;
|
|
43
|
+
private readonly headers;
|
|
44
|
+
private readonly serializer;
|
|
45
|
+
private readonly errorResponseBodyDecoder;
|
|
46
|
+
private readonly errorResponseMediaType;
|
|
47
|
+
constructor(router: RouterContract, options?: OpenAPILinkCodecOptions<T>);
|
|
48
|
+
encodeInput(input: unknown, path: string[], options: ClientOptions<T>): Promise<StandardRequest>;
|
|
49
|
+
private encodePathParam;
|
|
50
|
+
/**
|
|
51
|
+
* Serializes a single path/query value, like header values, so body-level
|
|
52
|
+
* serialize defaults (e.g. `asFormData`) never apply to URLs.
|
|
53
|
+
*/
|
|
54
|
+
private serializeURLValue;
|
|
55
|
+
private serializeQueryString;
|
|
56
|
+
decodeResponse(response: StandardLazyResponse, path: string[], _options: ClientOptions<T>): Promise<StandardLinkCodecDecodedResponse>;
|
|
57
|
+
private resolveProcedure;
|
|
58
|
+
}
|