UNPKG

stellate

Version:

The CLI you need to work with Stellate from your CLI. See https://docs.stellate.co/docs/cli for the complete documentation.

1,238 lines (1,234 loc) 82.6 kB
import * as z from 'zod'; import z__default from 'zod'; type TimeWindow = `${number}${'s' | 'm' | 'h'}` | { value: number; unit: 'seconds' | 'minutes' | 'hours'; }; interface RateLimitConfig { getConsumerIdentifiers?: ConfigFunction<(req: EdgeRequest) => Record<string, unknown>>; rateLimit?: DeprecatedRateLimitRule; rateLimits?: (RateLimitRule | null | undefined)[] | ConfigFunction<(req: EdgeRequest) => RateLimitRules>; complexity?: ComplexityConfig; } interface EdgeRequest { method: string; path: string; queryString: string; queryParams: Record<string, string | string[]>; headers: Record<string, string | string[]>; ip: string; jwt: Record<string, unknown> | null; operation: 'query' | 'mutation' | 'subscription'; rootFields: { name: string; alias: string | null; args: Record<string, unknown>; }[]; } interface ComplexityLimit { type: 'QueryComplexity'; budget: number; warning?: number; window: TimeWindow; } interface RequestLimit { type: 'RequestCount'; budget: number; warning?: number; window: TimeWindow; } type RateLimitGroupBy = 'ip' | { header: string; } | { cookie: string; } | { jwt: string; } | { consumerIdentifier: string; }; interface BaseRateLimitRule { name: string; description?: string; state?: 'enabled' | 'disabled' | 'dryRun'; allowList?: readonly string[]; limit: ComplexityLimit | RequestLimit; } interface RateLimitRule extends BaseRateLimitRule { groupBy: RateLimitGroupBy; } type DynamicRateLimitRule = BaseRateLimitRule & ({ groupBy: RateLimitGroupBy; } | { group: string | number; }); type RateLimitRules = (DynamicRateLimitRule | null | undefined)[]; interface DeprecatedRateLimitRule { name: string; description?: string; state?: 'enabled' | 'disabled' | 'dryRun'; consumerIdentifier: string; allowList?: readonly string[]; limit: ComplexityLimit | RequestLimit; } type ConfigFunction<T> = T | string; interface ComplexityConfig { listSizeArguments?: string[]; maxComplexity?: number; } /** This is the configuration format is kept internally in our application. * It's slightly different from what's in `./input.ts`, which is the exact * format of user-provided configuration inputs, which are converted to * the format as defined here. */ interface ScopeContext { headers: Record<string, string | string[]>; cookies: Record<string, string>; } type ScopeFunctionDefinition = ConfigFunction<(ctx: ScopeContext) => string | null | undefined>; declare const inputSchema: z.ZodObject<{ app: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; originUrl: z.ZodOptional<z.ZodString>; /** * The version of the HTTP protocol to use when contacting the originUrl. */ httpVersion: z.ZodNullable<z.ZodOptional<z.ZodEnum<["1.1", "2", "3"]>>>; schema: z.ZodNullable<z.ZodOptional<z.ZodString>>; schemaPolling: z.ZodNullable<z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { enabled: boolean; }, { enabled: boolean; }>>>; cacheIntrospection: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; blockIntrospection: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; injectHeaders: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; devPortal: z.ZodNullable<z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; title: z.ZodOptional<z.ZodString>; readme: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; urls: z.ZodOptional<z.ZodObject<{ privacy: z.ZodOptional<z.ZodString>; terms: z.ZodOptional<z.ZodString>; website: z.ZodOptional<z.ZodString>; logo: z.ZodOptional<z.ZodString>; favicon: z.ZodOptional<z.ZodString>; support: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, string, string>]>>; }, "strip", z.ZodTypeAny, { privacy?: string | undefined; terms?: string | undefined; website?: string | undefined; logo?: string | undefined; favicon?: string | undefined; support?: string | undefined; }, { privacy?: string | undefined; terms?: string | undefined; website?: string | undefined; logo?: string | undefined; favicon?: string | undefined; support?: string | undefined; }>>; brandColor: z.ZodOptional<z.ZodString>; auth: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { enabled: boolean; title?: string | undefined; readme?: string | undefined; description?: string | undefined; urls?: { privacy?: string | undefined; terms?: string | undefined; website?: string | undefined; logo?: string | undefined; favicon?: string | undefined; support?: string | undefined; } | undefined; brandColor?: string | undefined; auth?: boolean | undefined; }, { enabled: boolean; title?: string | undefined; readme?: string | undefined; description?: string | undefined; urls?: { privacy?: string | undefined; terms?: string | undefined; website?: string | undefined; logo?: string | undefined; favicon?: string | undefined; support?: string | undefined; } | undefined; brandColor?: string | undefined; auth?: boolean | undefined; }>>>; partialQueryCaching: z.ZodNullable<z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; experimentalDeferSupport: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { enabled: boolean; experimentalDeferSupport?: boolean | undefined; }, { enabled: boolean; experimentalDeferSupport?: boolean | undefined; }>>>; ignoreOriginCacheControl: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; queryDepthLimit: z.ZodNullable<z.ZodOptional<z.ZodNumber>>; passThroughOnly: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; mutationPolicy: z.ZodNullable<z.ZodOptional<z.ZodEnum<["Type", "List", "Entity", "None"]>>>; bypassCacheHeaders: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{ name: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; }, { name: string; }>, "many">>>; /** * @deprecated Use the `graphiql` option instead. */ enablePlayground: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; headers: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>; scopes: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodObject<{ headers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>; cookies: z.ZodRecord<z.ZodString, z.ZodString>; }, "strip", z.ZodTypeAny, { headers: Record<string, string | string[]>; cookies: Record<string, string>; }, { headers: Record<string, string | string[]>; cookies: Record<string, string>; }>], z.ZodUnknown>, z.ZodNullable<z.ZodString>>]>, z.ZodObject<{ definition: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodObject<{ headers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>; cookies: z.ZodRecord<z.ZodString, z.ZodString>; }, "strip", z.ZodTypeAny, { headers: Record<string, string | string[]>; cookies: Record<string, string>; }, { headers: Record<string, string | string[]>; cookies: Record<string, string>; }>], z.ZodUnknown>, z.ZodNullable<z.ZodString>>]>>>; jwt: z.ZodNullable<z.ZodOptional<z.ZodObject<{ claim: z.ZodNullable<z.ZodOptional<z.ZodString>>; algorithm: z.ZodNullable<z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES256k", "EdDSA", "PS256", "PS384", "PS512"]>>>; secret: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }>>>; }, "strip", z.ZodTypeAny, { definition?: string | ((args_0: { headers: Record<string, string | string[]>; cookies: Record<string, string>; }, ...args: unknown[]) => string | null) | null | undefined; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }, { definition?: string | ((args_0: { headers: Record<string, string | string[]>; cookies: Record<string, string>; }, ...args: unknown[]) => string | null) | null | undefined; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }>]>>>>; rootTypeNames: z.ZodNullable<z.ZodOptional<z.ZodObject<{ query: z.ZodNullable<z.ZodOptional<z.ZodString>>; mutation: z.ZodNullable<z.ZodOptional<z.ZodString>>; subscription: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { query?: string | null | undefined; mutation?: string | null | undefined; subscription?: string | null | undefined; }, { query?: string | null | undefined; mutation?: string | null | undefined; subscription?: string | null | undefined; }>>>; keyFields: z.ZodNullable<z.ZodOptional<z.ZodObject<{ autoAdd: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; defaults: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>; types: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; }, "strip", z.ZodTypeAny, { types: Record<string, string[]> | null; autoAdd?: boolean | null | undefined; defaults?: string[] | null | undefined; }, { types: Record<string, string[]> | null; autoAdd?: boolean | null | undefined; defaults?: string[] | null | undefined; }>>>; rules: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{ /** Array of types, or dictionary to enable types, fields of types, or list of fields per type. */ types: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodBoolean>]>, z.ZodArray<z.ZodString, "many">]>>, z.ZodArray<z.ZodString, "many">]>>>; /** Array of hashes of operation strings. */ operationHashes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>; maxAge: z.ZodNullable<z.ZodOptional<z.ZodNumber>>; swr: z.ZodNullable<z.ZodOptional<z.ZodNumber>>; scope: z.ZodNullable<z.ZodOptional<z.ZodString>>; description: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { types?: string[] | Record<string, boolean | string[] | Record<string, boolean>> | null | undefined; operationHashes?: string[] | null | undefined; maxAge?: number | null | undefined; swr?: number | null | undefined; scope?: string | null | undefined; description?: string | null | undefined; }, { types?: string[] | Record<string, boolean | string[] | Record<string, boolean>> | null | undefined; operationHashes?: string[] | null | undefined; maxAge?: number | null | undefined; swr?: number | null | undefined; scope?: string | null | undefined; description?: string | null | undefined; }>, "many">>>; nonCacheable: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>; retries: z.ZodNullable<z.ZodOptional<z.ZodObject<{ networkErrors: z.ZodNullable<z.ZodOptional<z.ZodObject<{ isEnabled: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; whenGraphQLResponse: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; }, { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; }>>>; serverErrors: z.ZodNullable<z.ZodOptional<z.ZodObject<{ isEnabled: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; whenGraphQLResponse: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; }, { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; }>>>; }, "strip", z.ZodTypeAny, { networkErrors?: { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; } | null | undefined; serverErrors?: { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; } | null | undefined; }, { networkErrors?: { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; } | null | undefined; serverErrors?: { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; } | null | undefined; }>>>; customAttributes: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{ header: z.ZodString; jwt: z.ZodNullable<z.ZodOptional<z.ZodObject<{ claim: z.ZodNullable<z.ZodOptional<z.ZodString>>; algorithm: z.ZodNullable<z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES256k", "EdDSA", "PS256", "PS384", "PS512"]>>>; secret: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }>>>; }, "strip", z.ZodTypeAny, { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }, { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }>, z.ZodObject<{ cookie: z.ZodString; jwt: z.ZodNullable<z.ZodOptional<z.ZodObject<{ claim: z.ZodNullable<z.ZodOptional<z.ZodString>>; algorithm: z.ZodNullable<z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES256k", "EdDSA", "PS256", "PS384", "PS512"]>>>; secret: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }>>>; }, "strip", z.ZodTypeAny, { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }, { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }>]>>, Record<string, { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; } | { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }>, Record<string, { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; } | { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }>>>>; userId: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ header: z.ZodString; jwt: z.ZodNullable<z.ZodOptional<z.ZodObject<{ claim: z.ZodNullable<z.ZodOptional<z.ZodString>>; algorithm: z.ZodNullable<z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES256k", "EdDSA", "PS256", "PS384", "PS512"]>>>; secret: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }>>>; }, "strip", z.ZodTypeAny, { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }, { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }>, z.ZodObject<{ cookie: z.ZodString; jwt: z.ZodNullable<z.ZodOptional<z.ZodObject<{ claim: z.ZodNullable<z.ZodOptional<z.ZodString>>; algorithm: z.ZodNullable<z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES256k", "EdDSA", "PS256", "PS384", "PS512"]>>>; secret: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }, { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; }>>>; }, "strip", z.ZodTypeAny, { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }, { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }>]>>>; graphiql: z.ZodNullable<z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; title: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { enabled: boolean; title?: string | undefined; }, { enabled: boolean; title?: string | undefined; }>>>; persistedOperations: z.ZodNullable<z.ZodOptional<z.ZodObject<{ apq: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>; sendHashToOrigin: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>; rejectInvalidHashes: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { apq?: boolean | null | undefined; sendHashToOrigin?: boolean | null | undefined; rejectInvalidHashes?: boolean | null | undefined; }, { apq?: boolean | null | undefined; sendHashToOrigin?: boolean | null | undefined; rejectInvalidHashes?: boolean | null | undefined; }>>>; requestSigning: z.ZodNullable<z.ZodOptional<z.ZodObject<{ secret: z.ZodNullable<z.ZodOptional<z.ZodString>>; }, "strip", z.ZodTypeAny, { secret?: string | null | undefined; }, { secret?: string | null | undefined; }>>>; getConsumerIdentifiers: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodString]>>>; rateLimit: z.ZodNullable<z.ZodOptional<z.ZodObject<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; state: z.ZodOptional<z.ZodEnum<["enabled", "disabled", "dryRun"]>>; consumerIdentifier: z.ZodOptional<z.ZodString>; allowList: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; limit: z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"QueryComplexity">; budget: z.ZodNumber; warning: z.ZodOptional<z.ZodNumber>; window: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{ value: z.ZodNumber; unit: z.ZodEnum<["seconds", "minutes", "hours"]>; }, "strict", z.ZodTypeAny, { value: number; unit: "seconds" | "minutes" | "hours"; }, { value: number; unit: "seconds" | "minutes" | "hours"; }>]>; }, "strict", z.ZodTypeAny, { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }, { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"RequestCount">; budget: z.ZodNumber; warning: z.ZodOptional<z.ZodNumber>; window: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{ value: z.ZodNumber; unit: z.ZodEnum<["seconds", "minutes", "hours"]>; }, "strict", z.ZodTypeAny, { value: number; unit: "seconds" | "minutes" | "hours"; }, { value: number; unit: "seconds" | "minutes" | "hours"; }>]>; }, "strict", z.ZodTypeAny, { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }, { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }>]>; }, "strict", z.ZodTypeAny, { name: string; limit: { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; } | { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }; description?: string | undefined; state?: "enabled" | "disabled" | "dryRun" | undefined; consumerIdentifier?: string | undefined; allowList?: string[] | undefined; }, { name: string; limit: { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; } | { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }; description?: string | undefined; state?: "enabled" | "disabled" | "dryRun" | undefined; consumerIdentifier?: string | undefined; allowList?: string[] | undefined; }>>>; rateLimits: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodObject<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; state: z.ZodOptional<z.ZodEnum<["enabled", "disabled", "dryRun"]>>; groupBy: z.ZodUnion<[z.ZodLiteral<"ip">, z.ZodObject<{ header: z.ZodString; }, "strip", z.ZodTypeAny, { header: string; }, { header: string; }>, z.ZodObject<{ cookie: z.ZodString; }, "strip", z.ZodTypeAny, { cookie: string; }, { cookie: string; }>, z.ZodObject<{ jwt: z.ZodString; }, "strip", z.ZodTypeAny, { jwt: string; }, { jwt: string; }>, z.ZodObject<{ consumerIdentifier: z.ZodString; }, "strip", z.ZodTypeAny, { consumerIdentifier: string; }, { consumerIdentifier: string; }>]>; allowList: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; limit: z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"QueryComplexity">; budget: z.ZodNumber; warning: z.ZodOptional<z.ZodNumber>; window: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{ value: z.ZodNumber; unit: z.ZodEnum<["seconds", "minutes", "hours"]>; }, "strict", z.ZodTypeAny, { value: number; unit: "seconds" | "minutes" | "hours"; }, { value: number; unit: "seconds" | "minutes" | "hours"; }>]>; }, "strict", z.ZodTypeAny, { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }, { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"RequestCount">; budget: z.ZodNumber; warning: z.ZodOptional<z.ZodNumber>; window: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{ value: z.ZodNumber; unit: z.ZodEnum<["seconds", "minutes", "hours"]>; }, "strict", z.ZodTypeAny, { value: number; unit: "seconds" | "minutes" | "hours"; }, { value: number; unit: "seconds" | "minutes" | "hours"; }>]>; }, "strict", z.ZodTypeAny, { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }, { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }>]>; }, "strict", z.ZodTypeAny, { name: string; limit: { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; } | { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }; groupBy: ("ip" | { header: string; } | { cookie: string; } | { jwt: string; } | { consumerIdentifier: string; }) & ("ip" | { header: string; } | { cookie: string; } | { jwt: string; } | { consumerIdentifier: string; } | undefined); description?: string | undefined; state?: "enabled" | "disabled" | "dryRun" | undefined; allowList?: string[] | undefined; }, { name: string; limit: { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; } | { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }; groupBy: ("ip" | { header: string; } | { cookie: string; } | { jwt: string; } | { consumerIdentifier: string; }) & ("ip" | { header: string; } | { cookie: string; } | { jwt: string; } | { consumerIdentifier: string; } | undefined); description?: string | undefined; state?: "enabled" | "disabled" | "dryRun" | undefined; allowList?: string[] | undefined; }>, "many">, z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodString]>]>>>; complexity: z.ZodNullable<z.ZodOptional<z.ZodObject<{ listSizeArguments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; maxComplexity: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { listSizeArguments?: string[] | undefined; maxComplexity?: number | undefined; }, { listSizeArguments?: string[] | undefined; maxComplexity?: number | undefined; }>>>; schemaView: z.ZodNullable<z.ZodOptional<z.ZodObject<{ include: z.ZodArray<z.ZodString, "many">; exclude: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { include: string[]; exclude: string[]; }, { include: string[]; exclude: string[]; }>>>; security: z.ZodNullable<z.ZodOptional<z.ZodObject<{ requestSize: z.ZodOptional<z.ZodNullable<z.ZodObject<{ maxBytes: z.ZodNumber; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { enabled: boolean; maxBytes: number; }, { enabled: boolean; maxBytes: number; }>>>; directives: z.ZodOptional<z.ZodNullable<z.ZodObject<{ max: z.ZodNumber; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { enabled: boolean; max: number; }, { enabled: boolean; max: number; }>>>; depth: z.ZodOptional<z.ZodNullable<z.ZodObject<{ max: z.ZodNumber; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { enabled: boolean; max: number; }, { enabled: boolean; max: number; }>>>; aliases: z.ZodOptional<z.ZodNullable<z.ZodObject<{ max: z.ZodNumber; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { enabled: boolean; max: number; }, { enabled: boolean; max: number; }>>>; suggestionsInErrors: z.ZodOptional<z.ZodNullable<z.ZodObject<{ mode: z.ZodEnum<["mask"]>; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { enabled: boolean; mode: "mask"; }, { enabled: boolean; mode: "mask"; }>>>; }, "strip", z.ZodTypeAny, { requestSize?: { enabled: boolean; maxBytes: number; } | null | undefined; directives?: { enabled: boolean; max: number; } | null | undefined; depth?: { enabled: boolean; max: number; } | null | undefined; aliases?: { enabled: boolean; max: number; } | null | undefined; suggestionsInErrors?: { enabled: boolean; mode: "mask"; } | null | undefined; }, { requestSize?: { enabled: boolean; maxBytes: number; } | null | undefined; directives?: { enabled: boolean; max: number; } | null | undefined; depth?: { enabled: boolean; max: number; } | null | undefined; aliases?: { enabled: boolean; max: number; } | null | undefined; suggestionsInErrors?: { enabled: boolean; mode: "mask"; } | null | undefined; }>>>; removeCookies: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>; variableLogging: z.ZodNullable<z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { enabled: boolean; }, { enabled: boolean; }>>>; }, "strip", z.ZodTypeAny, { app?: string | undefined; name?: string | undefined; originUrl?: string | undefined; httpVersion?: "1.1" | "2" | "3" | null | undefined; schema?: string | null | undefined; schemaPolling?: { enabled: boolean; } | null | undefined; cacheIntrospection?: boolean | null | undefined; blockIntrospection?: boolean | null | undefined; injectHeaders?: boolean | null | undefined; devPortal?: { enabled: boolean; title?: string | undefined; readme?: string | undefined; description?: string | undefined; urls?: { privacy?: string | undefined; terms?: string | undefined; website?: string | undefined; logo?: string | undefined; favicon?: string | undefined; support?: string | undefined; } | undefined; brandColor?: string | undefined; auth?: boolean | undefined; } | null | undefined; partialQueryCaching?: { enabled: boolean; experimentalDeferSupport?: boolean | undefined; } | null | undefined; ignoreOriginCacheControl?: boolean | null | undefined; queryDepthLimit?: number | null | undefined; passThroughOnly?: boolean | null | undefined; mutationPolicy?: "Type" | "List" | "Entity" | "None" | null | undefined; bypassCacheHeaders?: { name: string; }[] | null | undefined; enablePlayground?: boolean | null | undefined; headers?: Record<string, string> | null | undefined; scopes?: Record<string, string | ((args_0: { headers: Record<string, string | string[]>; cookies: Record<string, string>; }, ...args: unknown[]) => string | null) | { definition?: string | ((args_0: { headers: Record<string, string | string[]>; cookies: Record<string, string>; }, ...args: unknown[]) => string | null) | null | undefined; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }> | null | undefined; rootTypeNames?: { query?: string | null | undefined; mutation?: string | null | undefined; subscription?: string | null | undefined; } | null | undefined; keyFields?: { types: Record<string, string[]> | null; autoAdd?: boolean | null | undefined; defaults?: string[] | null | undefined; } | null | undefined; rules?: { types?: string[] | Record<string, boolean | string[] | Record<string, boolean>> | null | undefined; operationHashes?: string[] | null | undefined; maxAge?: number | null | undefined; swr?: number | null | undefined; scope?: string | null | undefined; description?: string | null | undefined; }[] | null | undefined; nonCacheable?: string[] | null | undefined; retries?: { networkErrors?: { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; } | null | undefined; serverErrors?: { isEnabled?: boolean | null | undefined; whenGraphQLResponse?: boolean | null | undefined; } | null | undefined; } | null | undefined; customAttributes?: Record<string, { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; } | { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; }> | null | undefined; userId?: { header: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; } | { cookie: string; jwt?: { claim?: string | null | undefined; algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES256k" | "EdDSA" | "PS256" | "PS384" | "PS512" | null | undefined; secret?: string | null | undefined; } | null | undefined; } | null | undefined; graphiql?: { enabled: boolean; title?: string | undefined; } | null | undefined; persistedOperations?: { apq?: boolean | null | undefined; sendHashToOrigin?: boolean | null | undefined; rejectInvalidHashes?: boolean | null | undefined; } | null | undefined; requestSigning?: { secret?: string | null | undefined; } | null | undefined; getConsumerIdentifiers?: string | ((...args: unknown[]) => unknown) | null | undefined; rateLimit?: { name: string; limit: { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; } | { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }; description?: string | undefined; state?: "enabled" | "disabled" | "dryRun" | undefined; consumerIdentifier?: string | undefined; allowList?: string[] | undefined; } | null | undefined; rateLimits?: string | ((...args: unknown[]) => unknown) | { name: string; limit: { type: "QueryComplexity"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; } | { type: "RequestCount"; budget: number; window: (string | { value: number; unit: "seconds" | "minutes" | "hours"; }) & (string | { value: number; unit: "seconds" | "minutes" | "hours"; } | undefined); warning?: number | undefined; }; groupBy: ("ip" | { header: string; } | { cookie: string; } | { jwt: string; } | { consumerIdentifier: string; }) & ("ip" | { header: string; } | { cookie: string; } | { jwt: string; } | { consumerIdentifier: string; } | undefined); description?: string | undefined; state?: "enabled" | "disabled" | "dryRun" | undefined; allowList?: string[] | undefined; }[] | null | undefined; complexity?: { listSizeArguments?: string[] | undefined; maxComplexity?: number | undefined; } | null | undefined; schemaView?: { include: string[]; exclude: string[]; } | null | undefined; security?: { requestSize?: { enabled: boolean; maxBytes: number; } | null | undefined; directives?: { enabled: boolean; max: number; } | null | undefined; depth?: { enabled: boolean; max: number; } | null | undefined; aliases?: { enabled: boolean; max: number; } | null | undefined; suggestionsInErrors?: { enabled: boolean; mode: "mask"; } | null | undefined; } | null | undefined; removeCookies?: string[] | null | undefined; variableLogging?: { enabled: boolean; } | null | undefined; }, { app?: string | undefined; name?: string | undefined; originUrl?: string | undefined; httpVersion?: "1.1" | "2" | "3" | null | undefined; schema?: string | null | undefined; schemaPolling?: { enabled: boolean; } | null | undefined; cacheIntrospection?: boolean | null | undefined; blockIntrospection?: boolean | null | undefined; injectHeaders?: boolean | null | undefined; devPortal?: { enabled: boolean; title?: string | undefined; readme?: string | undefined; description?: string | undefined; urls?: { privacy?: string | undefined; terms?: string | undefined; website?: string | undefined; logo?: string | undefined; favicon?: string | undefined; support?: string | undefined; } | undefined; brandColor?: string | undefined; auth?: boolean | undefined; } | null | undefined; partialQueryCaching