@emeryld/rrroutes-client 2.3.6 → 2.3.7
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/index.cjs +21 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +21 -18
- package/dist/index.mjs.map +1 -1
- package/dist/routesV3.client.types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -246,6 +246,7 @@ function createRouteClient(opts) {
|
|
|
246
246
|
const isGet = leaf.method === "get";
|
|
247
247
|
const isFeed = !!leaf.cfg.feed;
|
|
248
248
|
const leafCfg = leaf.cfg;
|
|
249
|
+
const validateResponses = opts.validateResponses ?? true;
|
|
249
250
|
const method = toUpper(leaf.method);
|
|
250
251
|
const expectsArgs = Boolean(leafCfg.paramsSchema || leafCfg.querySchema);
|
|
251
252
|
const leafLabel = `${leaf.method.toUpperCase()} ${String(leaf.path)}`;
|
|
@@ -347,24 +348,26 @@ function createRouteClient(opts) {
|
|
|
347
348
|
} : void 0
|
|
348
349
|
)
|
|
349
350
|
);
|
|
350
|
-
const parsed = leafCfg.outputSchema ? (0, import_rrroutes_contract.lowProfileParse)(leafCfg.outputSchema, out) : void 0;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
351
|
+
const parsed = validateResponses && leafCfg.outputSchema ? (0, import_rrroutes_contract.lowProfileParse)(leafCfg.outputSchema, out) : void 0;
|
|
352
|
+
if (validateResponses) {
|
|
353
|
+
emit(
|
|
354
|
+
decorateDebugEvent(
|
|
355
|
+
{
|
|
356
|
+
type: "fetch",
|
|
357
|
+
stage: "parsed",
|
|
358
|
+
method,
|
|
359
|
+
url,
|
|
360
|
+
leaf: leafLabel,
|
|
361
|
+
durationMs: Date.now() - startedAt
|
|
362
|
+
},
|
|
363
|
+
isVerboseDebug ? {
|
|
364
|
+
params: normalizedParams,
|
|
365
|
+
query: normalizedQuery,
|
|
366
|
+
output: parsed
|
|
367
|
+
} : void 0
|
|
368
|
+
)
|
|
369
|
+
);
|
|
370
|
+
}
|
|
368
371
|
options?.onReceive?.(parsed);
|
|
369
372
|
return parsed;
|
|
370
373
|
} catch (error) {
|