/** * Pure helpers for reading routing-relevant codes out of a GraphQL error response. * * This module is intentionally dependency-free: it is imported by both the grouping logic * (`error-grouping.ts`) and the crash-report suppression logic (`../../public/node/error.ts`). * `error.ts` cannot import `error-grouping.ts` directly — that would create an * `error.ts → headers.ts → error.ts` import cycle — so the shared scanning logic lives here, * where it imports nothing from cli-kit. */ /** * Collects every routing-relevant code from a GraphQL `errors` value. * * Scans *all* errors (not just the first), reading both the top-level `extensions.code` and the * nested App Management shape `extensions.app_errors.errors[].category`. The API can also return * `errors` as a string (e.g. some 401s), which yields no codes. * * @param errors - The `errors` value from a GraphQL response (array, string, or undefined). * @returns Every string code/category found, in document order. */ export declare function graphQLErrorCodes(errors: unknown): string[]; /** * Whether a single code is a rate-limit signal (`THROTTLED` or `429`). * * Mirrors the established shape detected by `errorsIncludeStatus429` in `private/node/api.ts`, * where `extensions.code === '429'` signals rate limiting even at HTTP 200. */ export declare function isRateLimitCode(code: string | undefined): boolean; /** * Whether a single code/category is a permission / access-denied signal. */ export declare function isPermissionCode(code: string | undefined): boolean; /** * Whether any GraphQL error carries a rate-limit code. Convenience for suppression logic that only * needs a boolean over the raw `errors` value. * * @param errors - The `errors` value from a GraphQL response. * @returns True when a rate-limit code is present in any error. */ export declare function hasRateLimitCode(errors: unknown): boolean;