@zuplo/runtime 6.71.20 → 6.71.21
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/out/esm/{chunk-S4J2WCVZ.js → chunk-I5HLAHUY.js} +69 -69
- package/out/esm/chunk-I5HLAHUY.js.map +1 -0
- package/out/esm/index.js +1 -1
- package/out/esm/index.js.map +1 -1
- package/out/esm/mcp-gateway/index.js +1 -1
- package/out/types/index.d.ts +65 -4
- package/package.json +1 -1
- package/out/esm/chunk-S4J2WCVZ.js.map +0 -1
- /package/out/esm/{chunk-S4J2WCVZ.js.LEGAL.txt → chunk-I5HLAHUY.js.LEGAL.txt} +0 -0
package/out/types/index.d.ts
CHANGED
|
@@ -3357,6 +3357,19 @@ declare const EventType: {
|
|
|
3357
3357
|
|
|
3358
3358
|
declare type EventType = (typeof EventType)[keyof typeof EventType];
|
|
3359
3359
|
|
|
3360
|
+
/**
|
|
3361
|
+
* Parse a response body and extract its GraphQL `errors[]`, including
|
|
3362
|
+
* across an Apollo-style batched (array) response.
|
|
3363
|
+
*
|
|
3364
|
+
* Returns `null` when the body isn't a GraphQL response shape at all
|
|
3365
|
+
* (unparseable JSON, or a JSON scalar), and `[]` for a well-formed
|
|
3366
|
+
* response with no errors — callers treat both as "nothing to report"
|
|
3367
|
+
* but the distinction keeps the function testable.
|
|
3368
|
+
*/
|
|
3369
|
+
export declare function extractGraphqlErrors(
|
|
3370
|
+
bodyText: string
|
|
3371
|
+
): GraphqlResponseError[] | null;
|
|
3372
|
+
|
|
3360
3373
|
declare interface FetchOptions<T> {
|
|
3361
3374
|
method?: HttpMethod_2;
|
|
3362
3375
|
data?: T;
|
|
@@ -3596,8 +3609,11 @@ export declare class GoogleCloudLoggingPlugin extends LogPlugin {
|
|
|
3596
3609
|
* `FORBIDDEN` → `auth`, timeout codes → `timeout`); custom codes can be
|
|
3597
3610
|
* mapped with `errorCodeClassification`, and anything unrecognized falls
|
|
3598
3611
|
* back to `defaultErrorClass` (`resolver`). Optionally set `logErrors` to
|
|
3599
|
-
* also write a structured warning per errored response.
|
|
3600
|
-
*
|
|
3612
|
+
* also write a structured warning per errored response. The policy reads
|
|
3613
|
+
* up to `maxScanBytes` of the body (128 KiB by default, 5 MiB maximum),
|
|
3614
|
+
* scanning it for the `errors` token; a response larger than that is
|
|
3615
|
+
* treated as error-free. When the token is found and the body fits, it is
|
|
3616
|
+
* parsed and its errors reported.
|
|
3601
3617
|
*
|
|
3602
3618
|
* The response always passes through unchanged — the body is read from a
|
|
3603
3619
|
* clone, and any internal failure is swallowed so reporting can never
|
|
@@ -3638,9 +3654,23 @@ export declare interface GraphqlAnalyticsOutboundPolicyOptions {
|
|
|
3638
3654
|
*/
|
|
3639
3655
|
logErrors?: boolean;
|
|
3640
3656
|
/**
|
|
3641
|
-
*
|
|
3657
|
+
* How many bytes of the response body the policy reads to look for GraphQL errors. The body is read and scanned for the `errors` token up to this limit; a body larger than the limit — by `Content-Length`, or measured while reading when the header is absent — is treated as error-free, so any errors it carries go unreported. The default of 128 KiB suits the common case, where servers emit `errors` near the front of the body. Raise it (up to the 5 MiB maximum) to detect errors in larger responses, at the cost of reading more of every response. When the token is found and the body fits within the limit, the body is parsed and its errors are reported.
|
|
3642
3658
|
*/
|
|
3643
|
-
|
|
3659
|
+
maxScanBytes?: number;
|
|
3660
|
+
}
|
|
3661
|
+
|
|
3662
|
+
/**
|
|
3663
|
+
* One GraphQL error extracted from a response body, reduced to the
|
|
3664
|
+
* fields the GraphQL Analytics outbound policy consumes for
|
|
3665
|
+
* classification and (opt-in) logging.
|
|
3666
|
+
*/
|
|
3667
|
+
export declare interface GraphqlResponseError {
|
|
3668
|
+
/** The error's `message`, or `""` when missing/non-string. */
|
|
3669
|
+
message: string;
|
|
3670
|
+
/** The error's `extensions.code`, or `null` when absent. */
|
|
3671
|
+
code: string | null;
|
|
3672
|
+
/** The error's `path` joined with `.` (e.g. `user.posts.0.title`), or `null`. */
|
|
3673
|
+
path: string | null;
|
|
3644
3674
|
}
|
|
3645
3675
|
|
|
3646
3676
|
/**
|
|
@@ -10126,6 +10156,37 @@ declare type ResolveRequestQuery<
|
|
|
10126
10156
|
declare type ResolveUserData<TUserData extends UserDataDefault | undefined> =
|
|
10127
10157
|
TUserData extends UserDataDefault ? TUserData : UserDataDefault;
|
|
10128
10158
|
|
|
10159
|
+
/**
|
|
10160
|
+
* Reports whether a `Response` carries GraphQL errors — a `200 OK` with a
|
|
10161
|
+
* top-level `errors[]` array, as Apollo / graphql-yoga servers return on a
|
|
10162
|
+
* failed operation. Reads the body from a clone, so the original response
|
|
10163
|
+
* stream still flows to the client untouched.
|
|
10164
|
+
*
|
|
10165
|
+
* The result is cached against the `response` object: the body is read,
|
|
10166
|
+
* scanned, and parsed at most once per response, and every later call
|
|
10167
|
+
* (including concurrent ones) resolves to the same cached boolean without
|
|
10168
|
+
* touching the stream again.
|
|
10169
|
+
*
|
|
10170
|
+
* Detection reads at most `maxScanBytes` of the body, scanning it for the
|
|
10171
|
+
* `errors` token; a response larger than that — whether by declared
|
|
10172
|
+
* `Content-Length` or as measured while reading — is treated as error-free
|
|
10173
|
+
* and resolves to `false`. Non-JSON responses also resolve to `false`
|
|
10174
|
+
* without reading. Any internal failure is swallowed and reported as
|
|
10175
|
+
* `false` — detection is best-effort and never throws.
|
|
10176
|
+
*
|
|
10177
|
+
* @param response - The response to inspect; left unconsumed.
|
|
10178
|
+
* @param maxScanBytes - How many bytes of the body to read and scan.
|
|
10179
|
+
* Defaults to {@link DEFAULT_GRAPHQL_SCAN_BYTES} (128 KiB); a body larger
|
|
10180
|
+
* than this goes unreported. Only the first call for a given `response`
|
|
10181
|
+
* observes this value; later calls return the cached result.
|
|
10182
|
+
* @returns `true` when the body contains a top-level `errors[]` with at
|
|
10183
|
+
* least one entry, otherwise `false`.
|
|
10184
|
+
*/
|
|
10185
|
+
export declare function responseHasGraphqlErrors(
|
|
10186
|
+
response: Response,
|
|
10187
|
+
maxScanBytes?: number
|
|
10188
|
+
): Promise<boolean>;
|
|
10189
|
+
|
|
10129
10190
|
/**
|
|
10130
10191
|
* Definition of responses for a route
|
|
10131
10192
|
* @public
|