@distilled.cloud/core 1.0.0-rc.16 → 1.0.0-rc.17
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/lib/_bundle/aws.js +2 -0
- package/lib/_bundle/aws.js.map +1 -0
- package/lib/_bundle/base.js +5 -0
- package/lib/_bundle/base.js.map +1 -0
- package/lib/_bundle/graphql.js +3 -0
- package/lib/_bundle/graphql.js.map +1 -0
- package/lib/_bundle/rest.js +2 -0
- package/lib/_bundle/rest.js.map +1 -0
- package/lib/_bundle/xml.js +4 -0
- package/lib/_bundle/xml.js.map +1 -0
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +1 -796
- package/lib/category.js +1 -278
- package/lib/chunks.js +1 -11
- package/lib/config.js +1 -161
- package/lib/crypto.js +1 -130
- package/lib/debug.js +1 -8
- package/lib/error-category.js +1 -47
- package/lib/errors.js +1 -198
- package/lib/graphql.js +1 -1058
- package/lib/graphql.types.js +1 -6
- package/lib/index.js +0 -15
- package/lib/json-patch.js +1 -226
- package/lib/json-patch.js.map +1 -1
- package/lib/pagination.js +1 -271
- package/lib/plain-values.js +1 -39
- package/lib/plain-values.js.map +1 -1
- package/lib/protocol-http.js +1 -812
- package/lib/protocol-rest.js +1 -375
- package/lib/query.js +1 -27
- package/lib/response-validation-strict.js +1 -284
- package/lib/response-validation.js +1 -118
- package/lib/retry-after.js +1 -112
- package/lib/retry.js +1 -197
- package/lib/schema-lite-impl.js +1 -341
- package/lib/schema-lite-typed.js +1 -26
- package/lib/schema-lite-typed.js.map +1 -1
- package/lib/schema-lite.js +1 -31
- package/lib/schema.js +1 -220
- package/lib/testing.js +1 -41
- package/lib/testing.js.map +1 -1
- package/lib/trait.js +1 -131
- package/lib/xml.js +1 -323
- package/package.json +1 -1
- package/src/api.ts +7 -6
- package/lib/api.js.map +0 -1
- package/lib/category.js.map +0 -1
- package/lib/chunks.js.map +0 -1
- package/lib/config.js.map +0 -1
- package/lib/crypto.js.map +0 -1
- package/lib/debug.js.map +0 -1
- package/lib/error-category.js.map +0 -1
- package/lib/errors.js.map +0 -1
- package/lib/graphql.js.map +0 -1
- package/lib/graphql.types.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/pagination.js.map +0 -1
- package/lib/protocol-http.js.map +0 -1
- package/lib/protocol-rest.js.map +0 -1
- package/lib/query.js.map +0 -1
- package/lib/response-validation-strict.js.map +0 -1
- package/lib/response-validation.js.map +0 -1
- package/lib/retry-after.js.map +0 -1
- package/lib/retry.js.map +0 -1
- package/lib/schema-lite-impl.js.map +0 -1
- package/lib/schema-lite.js.map +0 -1
- package/lib/schema.js.map +0 -1
- package/lib/trait.js.map +0 -1
- package/lib/xml.js.map +0 -1
package/lib/protocol-http.js
CHANGED
|
@@ -1,812 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as HttpBody from "effect/http/HttpBody";
|
|
3
|
-
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
4
|
-
import { debugHttp } from "./debug.js";
|
|
5
|
-
import { isOpaqueValue } from "./plain-values.js";
|
|
6
|
-
import { bodySymbol, deepQuerySymbol, formDataFileSymbol, getErrorMatchers, headerSymbol, httpBodySymbol, httpSymbol, keyDictionarySymbol, labelSymbol, labelEncodingSymbol, querySymbol, stringEncodedSymbol, unionCasesSymbol, } from "./trait.js";
|
|
7
|
-
//#region AST helpers (survive S.optional / Suspend / transforms)
|
|
8
|
-
export const getProps = (ast) => {
|
|
9
|
-
if (ast._tag === "Objects")
|
|
10
|
-
return ast.propertySignatures;
|
|
11
|
-
if (ast._tag === "Suspend")
|
|
12
|
-
return getProps(ast.thunk());
|
|
13
|
-
if (ast.encoding && ast.encoding.length > 0)
|
|
14
|
-
return getProps(ast.encoding[0].to);
|
|
15
|
-
return [];
|
|
16
|
-
};
|
|
17
|
-
export const getAnn = (ast, symbol) => {
|
|
18
|
-
const direct = ast.annotations?.[symbol];
|
|
19
|
-
if (direct !== undefined)
|
|
20
|
-
return direct;
|
|
21
|
-
if (ast._tag === "Suspend")
|
|
22
|
-
return getAnn(ast.thunk(), symbol);
|
|
23
|
-
if (ast.encoding && ast.encoding.length > 0)
|
|
24
|
-
return getAnn(ast.encoding[0].to, symbol);
|
|
25
|
-
// S.optional -> Union[self, Undefined]; descend into the single real member.
|
|
26
|
-
if (ast._tag === "Union") {
|
|
27
|
-
const real = ast.types.filter((t) => t._tag !== "Undefined" && !(t._tag === "Literal" && t.literal === null));
|
|
28
|
-
if (real.length === 1)
|
|
29
|
-
return getAnn(real[0], symbol);
|
|
30
|
-
}
|
|
31
|
-
return undefined;
|
|
32
|
-
};
|
|
33
|
-
export const getPropAnn = (prop, symbol) => getAnn(prop.type, symbol);
|
|
34
|
-
export const hasPropAnn = (prop, symbol) => getPropAnn(prop, symbol) !== undefined;
|
|
35
|
-
export const nameOf = (prop, symbol) => {
|
|
36
|
-
const v = getPropAnn(prop, symbol);
|
|
37
|
-
return typeof v === "string" ? v : String(prop.name);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const resolveNode = (ast) => {
|
|
41
|
-
if (ast._tag === "Suspend")
|
|
42
|
-
return resolveNode(ast.thunk());
|
|
43
|
-
if (ast.encoding && ast.encoding.length > 0)
|
|
44
|
-
return resolveNode(ast.encoding[0].to);
|
|
45
|
-
if (ast._tag === "Union") {
|
|
46
|
-
const real = ast.types.filter((t) => t._tag !== "Undefined" &&
|
|
47
|
-
t._tag !== "Null" &&
|
|
48
|
-
!(t._tag === "Literal" && t.literal === null));
|
|
49
|
-
if (real.length === 1)
|
|
50
|
-
return resolveNode(real[0]);
|
|
51
|
-
}
|
|
52
|
-
return ast;
|
|
53
|
-
};
|
|
54
|
-
const noHeaderMembers = [];
|
|
55
|
-
const headerMemberCache = /*@__PURE__*/ new WeakMap();
|
|
56
|
-
|
|
57
|
-
export const responseHeaderMembers = (outputAst) => {
|
|
58
|
-
let members = headerMemberCache.get(outputAst);
|
|
59
|
-
if (members !== undefined)
|
|
60
|
-
return members;
|
|
61
|
-
const found = [];
|
|
62
|
-
for (const prop of getProps(outputAst)) {
|
|
63
|
-
if (!hasPropAnn(prop, headerSymbol))
|
|
64
|
-
continue;
|
|
65
|
-
found.push({
|
|
66
|
-
key: String(prop.name),
|
|
67
|
-
wire: nameOf(prop, headerSymbol).toLowerCase(),
|
|
68
|
-
number: resolveNode(prop.type)._tag === "Number",
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
members = found.length === 0 ? noHeaderMembers : found;
|
|
72
|
-
headerMemberCache.set(outputAst, members);
|
|
73
|
-
return members;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export const withResponseHeaders = (members, body, headers) => {
|
|
82
|
-
if (members.length === 0 || body === null || typeof body !== "object" || Array.isArray(body)) {
|
|
83
|
-
return body;
|
|
84
|
-
}
|
|
85
|
-
let result;
|
|
86
|
-
for (const m of members) {
|
|
87
|
-
const raw = headers[m.wire];
|
|
88
|
-
if (raw === undefined)
|
|
89
|
-
continue;
|
|
90
|
-
result ??= { ...body };
|
|
91
|
-
const parsed = m.number && raw.trim() !== "" ? Number(raw) : Number.NaN;
|
|
92
|
-
result[m.key] = Number.isNaN(parsed) ? raw : parsed;
|
|
93
|
-
}
|
|
94
|
-
return result ?? body;
|
|
95
|
-
};
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region Recursive wire-name mapping
|
|
98
|
-
export { isOpaqueValue };
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
export const mapKeysByDictionary = (dict, value, direction) => {
|
|
105
|
-
if (value === null || typeof value !== "object" || isOpaqueValue(value)) {
|
|
106
|
-
return value;
|
|
107
|
-
}
|
|
108
|
-
if (Array.isArray(value)) {
|
|
109
|
-
return value.map((v) => mapKeysByDictionary(dict, v, direction));
|
|
110
|
-
}
|
|
111
|
-
const rename = direction === "decode"
|
|
112
|
-
? Object.fromEntries(Object.entries(dict).flatMap(([ts, wire]) => typeof wire === "string" ? [[wire, ts]] : wire.map((w) => [w, ts])))
|
|
113
|
-
: Object.fromEntries(Object.entries(dict).map(([ts, wire]) => [
|
|
114
|
-
ts,
|
|
115
|
-
typeof wire === "string" ? wire : wire[0],
|
|
116
|
-
]));
|
|
117
|
-
const out = {};
|
|
118
|
-
for (const [k, v] of Object.entries(value)) {
|
|
119
|
-
if (v === undefined)
|
|
120
|
-
continue;
|
|
121
|
-
out[rename[k] ?? k] = mapKeysByDictionary(dict, v, direction);
|
|
122
|
-
}
|
|
123
|
-
return out;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const stringEncode = (value) => value === null ? null : Array.isArray(value) ? value.map(stringEncode) : String(value);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
export const mapsVerbatim = (root, direction) => {
|
|
148
|
-
const cache = direction === "encode" ? verbatimEncode : verbatimDecode;
|
|
149
|
-
let result = cache.get(root);
|
|
150
|
-
if (result !== undefined)
|
|
151
|
-
return result;
|
|
152
|
-
result = true;
|
|
153
|
-
const seen = new Set();
|
|
154
|
-
const stack = [root];
|
|
155
|
-
walk: while (stack.length > 0) {
|
|
156
|
-
const ast = stack.pop();
|
|
157
|
-
if (seen.has(ast))
|
|
158
|
-
continue;
|
|
159
|
-
seen.add(ast);
|
|
160
|
-
if (getAnn(ast, keyDictionarySymbol) !== undefined) {
|
|
161
|
-
result = false;
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
if (direction === "decode" && getAnn(ast, unionCasesSymbol) !== undefined) {
|
|
165
|
-
result = false;
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
const node = resolveNode(ast);
|
|
169
|
-
if (node._tag === "Union") {
|
|
170
|
-
for (const t of node.types)
|
|
171
|
-
stack.push(resolveNode(t));
|
|
172
|
-
}
|
|
173
|
-
else if (node._tag === "Arrays") {
|
|
174
|
-
const elem = node.rest?.[0];
|
|
175
|
-
if (elem)
|
|
176
|
-
stack.push(elem);
|
|
177
|
-
}
|
|
178
|
-
else if (node._tag === "Objects") {
|
|
179
|
-
for (const p of node.propertySignatures) {
|
|
180
|
-
if (nameOf(p, bodySymbol) !== String(p.name) ||
|
|
181
|
-
(direction === "encode" && hasPropAnn(p, stringEncodedSymbol))) {
|
|
182
|
-
result = false;
|
|
183
|
-
break walk;
|
|
184
|
-
}
|
|
185
|
-
stack.push(p.type);
|
|
186
|
-
}
|
|
187
|
-
for (const s of (node.indexSignatures ?? [])) {
|
|
188
|
-
stack.push(s.type);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
cache.set(root, result);
|
|
193
|
-
return result;
|
|
194
|
-
};
|
|
195
|
-
const verbatimEncode = /*@__PURE__*/ new WeakMap();
|
|
196
|
-
const verbatimDecode = /*@__PURE__*/ new WeakMap();
|
|
197
|
-
export const mapKeys = (ast, value, direction, fallback) => {
|
|
198
|
-
if (value === null || value === undefined || typeof value !== "object" || isOpaqueValue(value)) {
|
|
199
|
-
return value;
|
|
200
|
-
}
|
|
201
|
-
const dict = getAnn(ast, keyDictionarySymbol) ?? fallback;
|
|
202
|
-
// Discriminated union whose cases the API returns merged (every case's
|
|
203
|
-
// keys present, `null` for the inactive ones). Map wire names, then keep
|
|
204
|
-
// only the active case's keys. The case is read off the union's
|
|
205
|
-
// discriminator when it has one -- cases that share a key set (every
|
|
206
|
-
// resource kind of `resource_tagging`, every page-rule action) are
|
|
207
|
-
// indistinguishable by keys alone. Without one, a case does NOT need every
|
|
208
|
-
// key present -- arms carry optional members the wire may omit -- so the
|
|
209
|
-
// active case is the one that best EXPLAINS the value: most present,
|
|
210
|
-
// non-null keys covered, minus present keys the case cannot explain (ties
|
|
211
|
-
// break by coverage, then declaration order).
|
|
212
|
-
const unionCases = getAnn(ast, unionCasesSymbol);
|
|
213
|
-
if (unionCases && direction === "decode" && !Array.isArray(value)) {
|
|
214
|
-
const obj = (dict ? mapKeysByDictionary(dict, value, "decode") : value);
|
|
215
|
-
const present = Object.keys(obj).filter((k) => obj[k] !== undefined && obj[k] !== null);
|
|
216
|
-
const disc = unionCases.discriminator;
|
|
217
|
-
const tag = disc ? obj[disc.key] : undefined;
|
|
218
|
-
const tagged = typeof tag === "string" ? disc.values.indexOf(tag) : -1;
|
|
219
|
-
let best;
|
|
220
|
-
if (tagged >= 0) {
|
|
221
|
-
best = { keys: unionCases.cases[tagged], score: 0, matched: 0 };
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
for (const keys of unionCases.cases) {
|
|
225
|
-
const set = new Set(keys);
|
|
226
|
-
let matched = 0;
|
|
227
|
-
let excess = 0;
|
|
228
|
-
for (const k of present) {
|
|
229
|
-
if (set.has(k))
|
|
230
|
-
matched++;
|
|
231
|
-
else
|
|
232
|
-
excess++;
|
|
233
|
-
}
|
|
234
|
-
const score = matched - excess;
|
|
235
|
-
if (matched > 0 &&
|
|
236
|
-
(!best || score > best.score || (score === best.score && matched > best.matched))) {
|
|
237
|
-
best = { keys, score, matched };
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
if (best) {
|
|
242
|
-
const out = {};
|
|
243
|
-
for (const k of best.keys)
|
|
244
|
-
out[k] = obj[k];
|
|
245
|
-
return out;
|
|
246
|
-
}
|
|
247
|
-
return obj;
|
|
248
|
-
}
|
|
249
|
-
const node = resolveNode(ast);
|
|
250
|
-
// Schema-level union member (a merged response struct whose arms disagree
|
|
251
|
-
// on a member's type -- see the codegen's response-union merge): pick the
|
|
252
|
-
// arm that explains the value best and map with it. Object values score
|
|
253
|
-
// arms by how many of their declared keys are present; array values take
|
|
254
|
-
// the first array arm. Anything unmatched deep-renames via the dictionary
|
|
255
|
-
// fallback, like other opaque content. (Single-real-member unions --
|
|
256
|
-
// optional/null wrappers -- were already collapsed by resolveNode; the
|
|
257
|
-
// opaque `T.UnionCases` mechanism never produces a Union node and is
|
|
258
|
-
// handled above.)
|
|
259
|
-
if (node._tag === "Union") {
|
|
260
|
-
const arms = node.types.map(resolveNode);
|
|
261
|
-
if (Array.isArray(value)) {
|
|
262
|
-
const arr = arms.find((t) => t._tag === "Arrays");
|
|
263
|
-
if (arr)
|
|
264
|
-
return mapKeys(arr, value, direction, dict);
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
let best;
|
|
268
|
-
let bestScore = 0;
|
|
269
|
-
for (const t of arms) {
|
|
270
|
-
if (t._tag !== "Objects")
|
|
271
|
-
continue;
|
|
272
|
-
let score = 0;
|
|
273
|
-
for (const p of t.propertySignatures) {
|
|
274
|
-
const from = direction === "encode" ? String(p.name) : nameOf(p, bodySymbol);
|
|
275
|
-
if (value[from] !== undefined)
|
|
276
|
-
score++;
|
|
277
|
-
}
|
|
278
|
-
if (score > bestScore) {
|
|
279
|
-
best = t;
|
|
280
|
-
bestScore = score;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
if (best)
|
|
284
|
-
return mapKeys(best, value, direction, dict);
|
|
285
|
-
}
|
|
286
|
-
return dict ? mapKeysByDictionary(dict, value, direction) : value;
|
|
287
|
-
}
|
|
288
|
-
if (node._tag === "Arrays") {
|
|
289
|
-
if (!Array.isArray(value))
|
|
290
|
-
return value;
|
|
291
|
-
const elem = node.rest?.[0];
|
|
292
|
-
return elem
|
|
293
|
-
? value.map((v) => mapKeys(elem, v, direction, dict))
|
|
294
|
-
: dict
|
|
295
|
-
? mapKeysByDictionary(dict, value, direction)
|
|
296
|
-
: value;
|
|
297
|
-
}
|
|
298
|
-
if (node._tag === "Objects" && !Array.isArray(value)) {
|
|
299
|
-
const props = node.propertySignatures;
|
|
300
|
-
const isigs = node.indexSignatures;
|
|
301
|
-
if (props.length === 0 && !(isigs && isigs.length)) {
|
|
302
|
-
// opaque object -- dictionary fallback or verbatim
|
|
303
|
-
return dict ? mapKeysByDictionary(dict, value, direction) : value;
|
|
304
|
-
}
|
|
305
|
-
const out = {};
|
|
306
|
-
const consumed = new Set();
|
|
307
|
-
for (const p of props) {
|
|
308
|
-
const tsName = String(p.name);
|
|
309
|
-
const wire = nameOf(p, bodySymbol);
|
|
310
|
-
const from = direction === "encode" ? tsName : wire;
|
|
311
|
-
const to = direction === "encode" ? wire : tsName;
|
|
312
|
-
consumed.add(from);
|
|
313
|
-
const v = value[from];
|
|
314
|
-
if (v === undefined)
|
|
315
|
-
continue;
|
|
316
|
-
// A `StringEncoded()` member nested in a body struct (e.g. Azure's
|
|
317
|
-
// `hardwareProfile.dynamicMemoryEnabled`) stringifies here -- the
|
|
318
|
-
// top-level pass in `buildRequest` only sees the outermost member.
|
|
319
|
-
out[to] =
|
|
320
|
-
direction === "encode" && hasPropAnn(p, stringEncodedSymbol)
|
|
321
|
-
? stringEncode(v)
|
|
322
|
-
: mapKeys(p.type, v, direction, dict);
|
|
323
|
-
}
|
|
324
|
-
for (const [k, v] of Object.entries(value)) {
|
|
325
|
-
if (consumed.has(k) || v === undefined)
|
|
326
|
-
continue;
|
|
327
|
-
const renamed = dict
|
|
328
|
-
? direction === "encode"
|
|
329
|
-
? (dict[k] ?? k)
|
|
330
|
-
: (Object.entries(dict).find(([, w]) => w === k)?.[0] ?? k)
|
|
331
|
-
: k;
|
|
332
|
-
out[typeof renamed === "string" ? renamed : renamed[0]] =
|
|
333
|
-
isigs && isigs.length
|
|
334
|
-
? mapKeys(isigs[0].type, v, direction, dict)
|
|
335
|
-
: dict
|
|
336
|
-
? mapKeysByDictionary(dict, v, direction)
|
|
337
|
-
: v;
|
|
338
|
-
}
|
|
339
|
-
return out;
|
|
340
|
-
}
|
|
341
|
-
// Scalar-typed schema node holding object content (spec drift) --
|
|
342
|
-
// dictionary fallback or verbatim.
|
|
343
|
-
return dict ? mapKeysByDictionary(dict, value, direction) : value;
|
|
344
|
-
};
|
|
345
|
-
//#endregion
|
|
346
|
-
//#region Request building
|
|
347
|
-
const BODYLESS = /*@__PURE__*/ new Set(["GET", "HEAD"]);
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const appendQuery = (query, name, value) => {
|
|
359
|
-
if (Array.isArray(value)) {
|
|
360
|
-
for (const v of value)
|
|
361
|
-
appendQuery(query, name, v);
|
|
362
|
-
}
|
|
363
|
-
else if (value !== null && typeof value === "object" && !(value instanceof Date)) {
|
|
364
|
-
for (const [k, v] of Object.entries(value)) {
|
|
365
|
-
if (v !== undefined)
|
|
366
|
-
appendQuery(query, `${name}.${k}`, v);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
query.append(name, String(value));
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
export const encodeGreedyLabel = (value) => value.replace(/^\/+/, "").split("/").map(encodeURIComponent).join("/");
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const flattenToFormPairs = (obj, prefix = "") => {
|
|
386
|
-
const pairs = [];
|
|
387
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
388
|
-
if (value === undefined || value === null)
|
|
389
|
-
continue;
|
|
390
|
-
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
391
|
-
if (Array.isArray(value)) {
|
|
392
|
-
for (let i = 0; i < value.length; i++) {
|
|
393
|
-
const item = value[i];
|
|
394
|
-
if (item === undefined || item === null)
|
|
395
|
-
continue;
|
|
396
|
-
if (typeof item === "object" && !Array.isArray(item)) {
|
|
397
|
-
pairs.push(...flattenToFormPairs(item, `${fullKey}[${i}]`));
|
|
398
|
-
}
|
|
399
|
-
else {
|
|
400
|
-
pairs.push([`${fullKey}[${i}]`, String(item)]);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
else if (typeof value === "object") {
|
|
405
|
-
pairs.push(...flattenToFormPairs(value, fullKey));
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
pairs.push([fullKey, String(value)]);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
return pairs;
|
|
412
|
-
};
|
|
413
|
-
const plans = /*@__PURE__*/ new WeakMap();
|
|
414
|
-
const planFor = (inputAst) => {
|
|
415
|
-
let plan = plans.get(inputAst);
|
|
416
|
-
if (plan !== undefined)
|
|
417
|
-
return plan;
|
|
418
|
-
const http = getAnn(inputAst, httpSymbol);
|
|
419
|
-
if (!http) {
|
|
420
|
-
throw new Error("operation input is missing the Http() trait");
|
|
421
|
-
}
|
|
422
|
-
const rootDict = getAnn(inputAst, keyDictionarySymbol);
|
|
423
|
-
const members = [];
|
|
424
|
-
const known = new Set();
|
|
425
|
-
let hasBodyMembers = false;
|
|
426
|
-
for (const prop of getProps(inputAst)) {
|
|
427
|
-
const key = String(prop.name);
|
|
428
|
-
known.add(key);
|
|
429
|
-
let bind;
|
|
430
|
-
let name;
|
|
431
|
-
let greedy = false;
|
|
432
|
-
if (hasPropAnn(prop, labelSymbol)) {
|
|
433
|
-
bind = "label";
|
|
434
|
-
name = nameOf(prop, labelSymbol);
|
|
435
|
-
greedy = http.uri.includes(`{${name}+}`);
|
|
436
|
-
}
|
|
437
|
-
else if (hasPropAnn(prop, headerSymbol)) {
|
|
438
|
-
bind = "header";
|
|
439
|
-
name = nameOf(prop, headerSymbol).toLowerCase();
|
|
440
|
-
}
|
|
441
|
-
else if (hasPropAnn(prop, querySymbol)) {
|
|
442
|
-
bind = "query";
|
|
443
|
-
name = nameOf(prop, querySymbol);
|
|
444
|
-
}
|
|
445
|
-
else if (hasPropAnn(prop, deepQuerySymbol)) {
|
|
446
|
-
bind = "deepQuery";
|
|
447
|
-
name = nameOf(prop, deepQuerySymbol);
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
hasBodyMembers = true;
|
|
451
|
-
bind = hasPropAnn(prop, formDataFileSymbol)
|
|
452
|
-
? "file"
|
|
453
|
-
: hasPropAnn(prop, httpBodySymbol)
|
|
454
|
-
? "httpBody"
|
|
455
|
-
: "body";
|
|
456
|
-
name = nameOf(prop, bodySymbol);
|
|
457
|
-
}
|
|
458
|
-
const preserve = getPropAnn(prop, labelEncodingSymbol);
|
|
459
|
-
members.push({
|
|
460
|
-
key,
|
|
461
|
-
bind,
|
|
462
|
-
name,
|
|
463
|
-
type: prop.type,
|
|
464
|
-
preserve: typeof preserve === "string" ? preserve : undefined,
|
|
465
|
-
greedy,
|
|
466
|
-
stringEncoded: hasPropAnn(prop, stringEncodedSymbol),
|
|
467
|
-
verbatim: rootDict === undefined && mapsVerbatim(prop.type, "encode"),
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
plan = { http, rootDict, members, known, hasBodyMembers };
|
|
471
|
-
plans.set(inputAst, plan);
|
|
472
|
-
return plan;
|
|
473
|
-
};
|
|
474
|
-
const emptyRequest = /*@__PURE__*/ HttpClientRequest.get("");
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
export const makeRequest = (method, url, headers) => HttpClientRequest.makeWith(method, url, emptyRequest.urlParams, emptyRequest.hash, Headers.fromInput(headers), HttpBody.empty);
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
export const buildRequest = ({ input, inputAst, baseUrl, headers: baseHeaders, mapMemberHeader, unknownKeyToWire, }) => {
|
|
499
|
-
const inputObj = (input ?? {});
|
|
500
|
-
const plan = planFor(inputAst);
|
|
501
|
-
const { http, rootDict, members, known } = plan;
|
|
502
|
-
let hasBodyMembers = plan.hasBodyMembers;
|
|
503
|
-
const headers = { ...baseHeaders };
|
|
504
|
-
const body = {};
|
|
505
|
-
let bodyKeys = 0;
|
|
506
|
-
let rawBody; // whole-body member (T.HttpBody) -- sent as-is
|
|
507
|
-
let files;
|
|
508
|
-
let query;
|
|
509
|
-
let uri = http.uri;
|
|
510
|
-
// Value of a modeled `Content-Type` header member, e.g. R2 putObject's
|
|
511
|
-
// `contentType`. A raw body is sent under it (see below).
|
|
512
|
-
let memberContentType;
|
|
513
|
-
for (let i = 0; i < members.length; i++) {
|
|
514
|
-
const m = members[i];
|
|
515
|
-
const value = inputObj[m.key];
|
|
516
|
-
if (value === undefined)
|
|
517
|
-
continue;
|
|
518
|
-
switch (m.bind) {
|
|
519
|
-
case "label": {
|
|
520
|
-
// The URL parser resolves a `.` or `..` segment, percent-encoded or
|
|
521
|
-
// not, so no encoding can carry one: it would address another path
|
|
522
|
-
// (`/projects/p1/branches/..` -> `/projects/p1/`). A greedy label keeps
|
|
523
|
-
// its `/`, so each of its segments counts.
|
|
524
|
-
if ((m.greedy ? String(value).split("/") : [String(value)]).some((s) => s === "." || s === "..")) {
|
|
525
|
-
throw new Error(`invalid value for input HTTP label: ${m.key}`);
|
|
526
|
-
}
|
|
527
|
-
const encoded = encodeURIComponent(String(value));
|
|
528
|
-
const preserve = m.preserve;
|
|
529
|
-
const label = preserve !== undefined
|
|
530
|
-
? encoded.replace(/%[0-9A-F]{2}/g, (escape) => {
|
|
531
|
-
const character = String.fromCharCode(Number.parseInt(escape.slice(1), 16));
|
|
532
|
-
return preserve.includes(character) ? character : escape;
|
|
533
|
-
})
|
|
534
|
-
: encoded;
|
|
535
|
-
uri = m.greedy
|
|
536
|
-
? uri.replace(`{${m.name}+}`, () => encodeGreedyLabel(String(value)))
|
|
537
|
-
: uri.replace(`{${m.name}}`, () => label);
|
|
538
|
-
break;
|
|
539
|
-
}
|
|
540
|
-
case "header": {
|
|
541
|
-
const hVal = String(value);
|
|
542
|
-
headers[m.name] = mapMemberHeader ? mapMemberHeader(m.name, hVal) : hVal;
|
|
543
|
-
if (m.name === "content-type")
|
|
544
|
-
memberContentType = headers[m.name];
|
|
545
|
-
break;
|
|
546
|
-
}
|
|
547
|
-
case "query":
|
|
548
|
-
appendQuery((query ??= new URLSearchParams()), m.name, value);
|
|
549
|
-
break;
|
|
550
|
-
case "deepQuery": {
|
|
551
|
-
// Deep-object query member (T.DeepQuery): a nested struct expands into
|
|
552
|
-
// dotted query keys (`account.id=...`) under the member's wire name.
|
|
553
|
-
// Wire-name the nested content via the schema first, skip null/
|
|
554
|
-
// undefined entries; deeper nesting recurses through appendQuery.
|
|
555
|
-
const mapped = m.verbatim ? value : mapKeys(m.type, value, "encode", rootDict);
|
|
556
|
-
if (mapped !== null && typeof mapped === "object") {
|
|
557
|
-
for (const [k, v] of Object.entries(mapped)) {
|
|
558
|
-
if (v !== undefined && v !== null) {
|
|
559
|
-
appendQuery((query ??= new URLSearchParams()), `${m.name}.${k}`, v);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
break;
|
|
564
|
-
}
|
|
565
|
-
case "file":
|
|
566
|
-
files ??= [];
|
|
567
|
-
for (const f of Array.isArray(value) ? value : [value]) {
|
|
568
|
-
files.push(f);
|
|
569
|
-
}
|
|
570
|
-
break;
|
|
571
|
-
case "httpBody":
|
|
572
|
-
rawBody = m.verbatim ? value : mapKeys(m.type, value, "encode", rootDict);
|
|
573
|
-
break;
|
|
574
|
-
default:
|
|
575
|
-
// T.StringEncoded(): the API takes this member's value only as its
|
|
576
|
-
// string spelling (`true` -> `"true"`), while the TS surface keeps the
|
|
577
|
-
// natural type. Explicit here so a JSON body carries the string too,
|
|
578
|
-
// rather than relying on the multipart encoder's own `String()`.
|
|
579
|
-
body[m.name] = m.stringEncoded
|
|
580
|
-
? stringEncode(value)
|
|
581
|
-
: m.verbatim
|
|
582
|
-
? value
|
|
583
|
-
: mapKeys(m.type, value, "encode", rootDict);
|
|
584
|
-
bodyKeys++;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
// Input keys the schema doesn't know pass through as body fields -- the
|
|
588
|
-
// generated schemas can lag the real API, and silently dropping them
|
|
589
|
-
// would break working callers. The key dictionary maps them when it knows
|
|
590
|
-
// the key, otherwise `unknownKeyToWire` decides the wire name.
|
|
591
|
-
for (const key in inputObj) {
|
|
592
|
-
if (known.has(key) || !Object.hasOwn(inputObj, key))
|
|
593
|
-
continue;
|
|
594
|
-
const value = inputObj[key];
|
|
595
|
-
if (value === undefined)
|
|
596
|
-
continue;
|
|
597
|
-
const wire = rootDict?.[key] ?? (unknownKeyToWire ? unknownKeyToWire(key) : key);
|
|
598
|
-
body[typeof wire === "string" ? wire : wire[0]] = rootDict
|
|
599
|
-
? mapKeysByDictionary(rootDict, value, "encode")
|
|
600
|
-
: value;
|
|
601
|
-
bodyKeys++;
|
|
602
|
-
hasBodyMembers = true;
|
|
603
|
-
}
|
|
604
|
-
const qs = query === undefined ? "" : query.toString();
|
|
605
|
-
const url = qs ? `${baseUrl}${uri}?${qs}` : `${baseUrl}${uri}`;
|
|
606
|
-
if (debugHttp()) {
|
|
607
|
-
console.error(`[distilled] -> ${http.method} ${http.uri}`);
|
|
608
|
-
}
|
|
609
|
-
const request = makeRequest(http.method, url, headers);
|
|
610
|
-
const bodied = !BODYLESS.has(http.method);
|
|
611
|
-
if (http.contentType === "multipart") {
|
|
612
|
-
// Multipart upload: each body member is a form part (objects
|
|
613
|
-
// JSON-encoded under their wire name), each file appends under its own
|
|
614
|
-
// filename. A whole-body member (T.HttpBody) that is a record of files
|
|
615
|
-
// becomes one part per entry (e.g. asset upload: { <hash>: File }).
|
|
616
|
-
// Files and byte buffers become binary parts; objects become JSON parts.
|
|
617
|
-
const form = new FormData();
|
|
618
|
-
const parts = rawBody !== undefined && typeof rawBody === "object"
|
|
619
|
-
? rawBody
|
|
620
|
-
: body;
|
|
621
|
-
const isFileOrBlob = (v) => v instanceof Blob || v instanceof File;
|
|
622
|
-
for (const [key, value] of Object.entries(parts)) {
|
|
623
|
-
if (value === undefined || value === null)
|
|
624
|
-
continue;
|
|
625
|
-
if (isFileOrBlob(value)) {
|
|
626
|
-
form.append(key, value, value instanceof File ? value.name : key);
|
|
627
|
-
}
|
|
628
|
-
else if (value instanceof Uint8Array || value instanceof ArrayBuffer) {
|
|
629
|
-
const bytes = value instanceof Uint8Array ? new Uint8Array(value).buffer : value;
|
|
630
|
-
form.append(key, new Blob([bytes]), key);
|
|
631
|
-
}
|
|
632
|
-
else if (Array.isArray(value) && value.length > 0 && isFileOrBlob(value[0])) {
|
|
633
|
-
for (const file of value) {
|
|
634
|
-
if (isFileOrBlob(file)) {
|
|
635
|
-
form.append(file instanceof File ? file.name : key, file, file instanceof File ? file.name : undefined);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
else if (typeof value === "object") {
|
|
640
|
-
form.append(key, JSON.stringify(value));
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
form.append(key, String(value));
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
for (const f of files ?? []) {
|
|
647
|
-
const filename = f.name ?? "file";
|
|
648
|
-
form.append(filename, f, filename);
|
|
649
|
-
}
|
|
650
|
-
return HttpClientRequest.setBody(request, HttpBody.formData(form));
|
|
651
|
-
}
|
|
652
|
-
if (http.contentType === "form-urlencoded" && bodied) {
|
|
653
|
-
// application/x-www-form-urlencoded with Stripe-style deepObject bracket
|
|
654
|
-
// notation: { shipping: { address: { city } } } -> shipping[address][city],
|
|
655
|
-
// arrays indexed ({ expand: ["a"] } -> expand[0]=a).
|
|
656
|
-
const source = rawBody !== undefined && typeof rawBody === "object"
|
|
657
|
-
? rawBody
|
|
658
|
-
: body;
|
|
659
|
-
const params = new URLSearchParams();
|
|
660
|
-
for (const [k, v] of flattenToFormPairs(source))
|
|
661
|
-
params.append(k, v);
|
|
662
|
-
return HttpClientRequest.setBody(request, HttpBody.text(params.toString(), "application/x-www-form-urlencoded"));
|
|
663
|
-
}
|
|
664
|
-
if (rawBody !== undefined && bodied) {
|
|
665
|
-
// Whole-body member (raw arrays/scalars) -- sent as the body itself.
|
|
666
|
-
// Binary payloads (Blob / ArrayBuffer / Uint8Array) send verbatim
|
|
667
|
-
// (raw object uploads). With a bodyMediaType, the member is a
|
|
668
|
-
// preserialized payload (string / bytes) sent verbatim; otherwise it's
|
|
669
|
-
// JSON.
|
|
670
|
-
//
|
|
671
|
-
// `setBody` overwrites the Content-Type header with the body's media
|
|
672
|
-
// type (and removes it when that is undefined), so the body carries the
|
|
673
|
-
// modeled Content-Type member when the caller set one, else the declared
|
|
674
|
-
// bodyMediaType (e.g. application/x-ndjson for Vectorize insert/upsert).
|
|
675
|
-
const mediaType = memberContentType ?? http.bodyMediaType;
|
|
676
|
-
if (rawBody instanceof Blob || rawBody instanceof ArrayBuffer) {
|
|
677
|
-
// With no media type at all, fetch falls back to the Blob's own type.
|
|
678
|
-
return HttpClientRequest.setBody(request, HttpBody.raw(rawBody, { contentType: mediaType }));
|
|
679
|
-
}
|
|
680
|
-
if (rawBody instanceof Uint8Array) {
|
|
681
|
-
return HttpClientRequest.setBody(request, HttpBody.uint8Array(rawBody, mediaType));
|
|
682
|
-
}
|
|
683
|
-
if (http.bodyMediaType) {
|
|
684
|
-
return HttpClientRequest.setBody(request, typeof rawBody === "string"
|
|
685
|
-
? HttpBody.text(rawBody, mediaType)
|
|
686
|
-
: HttpBody.uint8Array(rawBody, mediaType));
|
|
687
|
-
}
|
|
688
|
-
return HttpClientRequest.setBody(request, HttpBody.jsonUnsafe(rawBody));
|
|
689
|
-
}
|
|
690
|
-
if (
|
|
691
|
-
// A GET/HEAD sends a body only when body members actually carry values.
|
|
692
|
-
// Some APIs really do document GET-with-body: MongoDB Atlas's
|
|
693
|
-
// `.../lineItems:search` declares a `requestBody` on `get`, and AWS EFS's
|
|
694
|
-
// DescribeAccountPreferences takes `{ MaxResults, NextToken }` on a GET.
|
|
695
|
-
// Suppressing it outright dropped those members silently -- the request
|
|
696
|
-
// succeeded, unfiltered, with nothing on the wire to show why.
|
|
697
|
-
//
|
|
698
|
-
// The `{}`-when-empty rule below stays limited to methods that expect a
|
|
699
|
-
// body, so a bodyless method with nothing set still sends nothing.
|
|
700
|
-
bodyKeys > 0 ||
|
|
701
|
-
(hasBodyMembers && bodied && http.method !== "DELETE")) {
|
|
702
|
-
// Send `{}` rather than no body when the schema declares body members --
|
|
703
|
-
// some endpoints reject a missing JSON body outright.
|
|
704
|
-
return HttpClientRequest.setBody(request, HttpBody.jsonUnsafe(body));
|
|
705
|
-
}
|
|
706
|
-
return request;
|
|
707
|
-
};
|
|
708
|
-
const matchesText = (matcher, value) => {
|
|
709
|
-
if (typeof value !== "string")
|
|
710
|
-
return false;
|
|
711
|
-
if (typeof matcher === "string")
|
|
712
|
-
return matcher === value;
|
|
713
|
-
const { includes, matches } = matcher;
|
|
714
|
-
return ((includes !== undefined || matches !== undefined) &&
|
|
715
|
-
(includes === undefined || value.includes(includes)) &&
|
|
716
|
-
(matches === undefined || new RegExp(matches).test(value)));
|
|
717
|
-
};
|
|
718
|
-
// Own properties only: inherited properties are not JSON response members.
|
|
719
|
-
const atPointer = (body, pointer) => {
|
|
720
|
-
if (pointer === "")
|
|
721
|
-
return body;
|
|
722
|
-
if (!pointer.startsWith("/") || /~(?![01])/u.test(pointer))
|
|
723
|
-
return undefined;
|
|
724
|
-
let value = body;
|
|
725
|
-
for (const segment of pointer.slice(1).split("/")) {
|
|
726
|
-
const key = segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
727
|
-
if (value === null ||
|
|
728
|
-
typeof value !== "object" ||
|
|
729
|
-
!Object.hasOwn(value, key) ||
|
|
730
|
-
(Array.isArray(value) && !/^(0|[1-9][0-9]*)$/.test(key)))
|
|
731
|
-
return undefined;
|
|
732
|
-
value = value[key];
|
|
733
|
-
}
|
|
734
|
-
return value;
|
|
735
|
-
};
|
|
736
|
-
const matcherSpecificity = (m) => (m.code !== undefined ? 1 : 0) +
|
|
737
|
-
(m.status !== undefined ? 1 : 0) +
|
|
738
|
-
(m.message !== undefined ? 1 : 0) +
|
|
739
|
-
(m.body === undefined ? 0 : Object.keys(m.body).length) +
|
|
740
|
-
(m.headers === undefined ? 0 : Object.keys(m.headers).length);
|
|
741
|
-
|
|
742
|
-
export const matchesExpression = (m, code, status, message, response = {}) => {
|
|
743
|
-
if (m.code === undefined &&
|
|
744
|
-
m.status === undefined &&
|
|
745
|
-
m.message === undefined &&
|
|
746
|
-
matcherSpecificity(m) === 0)
|
|
747
|
-
return false;
|
|
748
|
-
if (m.code !== undefined && m.code !== code)
|
|
749
|
-
return false;
|
|
750
|
-
if (m.status !== undefined && m.status !== status)
|
|
751
|
-
return false;
|
|
752
|
-
if (m.message !== undefined && !matchesText(m.message, message))
|
|
753
|
-
return false;
|
|
754
|
-
if (m.body !== undefined) {
|
|
755
|
-
for (const [pointer, expected] of Object.entries(m.body)) {
|
|
756
|
-
const actual = atPointer(response.body, pointer);
|
|
757
|
-
if (typeof expected === "string" || (expected !== null && typeof expected === "object")) {
|
|
758
|
-
if (!matchesText(expected, actual))
|
|
759
|
-
return false;
|
|
760
|
-
}
|
|
761
|
-
else if (actual !== expected)
|
|
762
|
-
return false;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
if (m.headers !== undefined) {
|
|
766
|
-
for (const [name, expected] of Object.entries(m.headers)) {
|
|
767
|
-
if (response.headers === undefined)
|
|
768
|
-
return false;
|
|
769
|
-
const actual = Object.entries(response.headers).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
|
|
770
|
-
if (!matchesText(expected, actual))
|
|
771
|
-
return false;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
return true;
|
|
775
|
-
};
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
export const matchTypedError = (errorClasses, status, errors, response = {}) => {
|
|
785
|
-
let best;
|
|
786
|
-
const wireErrors = errors.length > 0 ? errors : [{ message: `HTTP ${status}` }];
|
|
787
|
-
for (const cls of errorClasses) {
|
|
788
|
-
const matchers = getErrorMatchers(cls);
|
|
789
|
-
if (!matchers)
|
|
790
|
-
continue;
|
|
791
|
-
for (const m of matchers) {
|
|
792
|
-
for (const e of wireErrors) {
|
|
793
|
-
if (!matchesExpression(m, e.code, status, e.message, response))
|
|
794
|
-
continue;
|
|
795
|
-
const specificity = matcherSpecificity(m);
|
|
796
|
-
if (!best || specificity > best.specificity) {
|
|
797
|
-
best = { cls, specificity, code: e.code, message: e.message };
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
if (!best)
|
|
803
|
-
return undefined;
|
|
804
|
-
return new best.cls({
|
|
805
|
-
code: best.code ?? 0,
|
|
806
|
-
message: best.message,
|
|
807
|
-
body: response.body,
|
|
808
|
-
headers: response.headers,
|
|
809
|
-
});
|
|
810
|
-
};
|
|
811
|
-
//#endregion
|
|
812
|
-
//# sourceMappingURL=protocol-http.js.map
|
|
1
|
+
export { protocol_http$buildRequest as buildRequest, protocol_http$encodeGreedyLabel as encodeGreedyLabel, protocol_http$getAnn as getAnn, protocol_http$getPropAnn as getPropAnn, protocol_http$getProps as getProps, protocol_http$hasPropAnn as hasPropAnn, protocol_http$isOpaqueValue as isOpaqueValue, protocol_http$makeRequest as makeRequest, protocol_http$mapKeys as mapKeys, protocol_http$mapKeysByDictionary as mapKeysByDictionary, protocol_http$mapsVerbatim as mapsVerbatim, protocol_http$matchTypedError as matchTypedError, protocol_http$matchesExpression as matchesExpression, protocol_http$nameOf as nameOf, protocol_http$resolveNode as resolveNode, protocol_http$responseHeaderMembers as responseHeaderMembers, protocol_http$withResponseHeaders as withResponseHeaders } from "./_bundle/rest.js";
|