diff --git a/scripts/generate-commands.ts b/scripts/generate-commands.ts index e956fe3..67a4f54 100644 --- a/scripts/generate-commands.ts +++ b/scripts/generate-commands.ts @@ -1,7 +1,7 @@ import { Effect, Runtime } from "effect"; import { Command, Flag } from "effect/unstable/cli"; -import type { CommandDefinition } from "../src/runtime/registry"; +import type { CommandBody, CommandDefinition } from "../src/runtime/registry"; import { ScriptFiles, ScriptHostFailure, @@ -29,6 +29,7 @@ interface OpenApiOperation { readonly summary?: string; readonly security?: readonly OpenApiSecurityRequirement[]; readonly parameters?: readonly OpenApiParameter[]; + readonly requestBody?: unknown; readonly "x-platform-visibility"?: string; } interface OpenApiSecurityRequirement { @@ -120,6 +121,7 @@ export function collectPublicCommands( path, rawOperation, rootSecurity, + spec, ), ); } @@ -135,12 +137,14 @@ function toCommandDefinition( path: string, operation: OpenApiOperation, rootSecurity: readonly OpenApiSecurityRequirement[], + spec: Record, ): Effect.Effect { const operationId = operation.operationId; if (operationId === undefined || operationId === "") return invalidSpec("Operation ID is required"); const [resource, rawAction = method] = operationId.split("."); const action = kebab(rawAction); + const body = commandBody(spec, operation.requestBody); return Effect.succeed({ operation_id: operationId, command: `${kebab(resource)} ${action}`, @@ -164,8 +168,82 @@ function toCommandDefinition( in: parameter.in ?? "query", required: parameter.required === true, })), + ...(body === undefined ? {} : { body }), }); } + +// Mirrors scripts/generate-effect-api.ts: an operation has a body when +// requestBody is an object, and the body is required when required === true. +function commandBody( + spec: Record, + requestBody: unknown, +): CommandBody | undefined { + if (!isRecord(requestBody)) return undefined; + const content = isRecord(requestBody.content) + ? requestBody.content + : undefined; + const json = + content !== undefined && isRecord(content["application/json"]) + ? content["application/json"] + : undefined; + const schema = + json === undefined ? undefined : resolveSchema(spec, json.schema); + return { + required: requestBody.required === true, + example: bodyExample(spec, schema), + }; +} + +function resolveSchema( + spec: Record, + schema: unknown, +): Record | undefined { + if (!isRecord(schema)) return undefined; + const ref = schema.$ref; + if (typeof ref !== "string") return schema; + const prefix = "#/components/schemas/"; + if (!ref.startsWith(prefix)) return undefined; + const components = isRecord(spec.components) ? spec.components : undefined; + const schemas = + components !== undefined && isRecord(components.schemas) + ? components.schemas + : undefined; + const resolved = + schemas === undefined ? undefined : schemas[ref.slice(prefix.length)]; + return isRecord(resolved) ? resolved : undefined; +} + +function bodyExample( + spec: Record, + schema: Record | undefined, +): Record { + if (schema === undefined) return {}; + const required = Array.isArray(schema.required) + ? schema.required.filter((name) => typeof name === "string") + : []; + const properties = isRecord(schema.properties) ? schema.properties : {}; + const example: Record = {}; + for (const name of required) { + example[name] = placeholderFor(name, resolveSchema(spec, properties[name])); + } + return example; +} + +function placeholderFor( + name: string, + property: Record | undefined, +): unknown { + if (property === undefined) return `<${name}>`; + if (Array.isArray(property.enum) && property.enum.length > 0) { + return property.enum[0]; + } + const type = property.type; + if (type === "integer" || type === "number") return 0; + if (type === "boolean") return false; + if (type === "array") return []; + if (type === "object") return {}; + return `<${name}>`; +} function renderCommandRegistry(commands: readonly CommandDefinition[]): string { return ( `// Generated by scripts/generate-commands.ts. Do not edit by hand.\n` + diff --git a/scripts/generate-effect-api.ts b/scripts/generate-effect-api.ts index e1ac4de..6e9b138 100644 --- a/scripts/generate-effect-api.ts +++ b/scripts/generate-effect-api.ts @@ -260,7 +260,7 @@ function renderExecutorSource(operations: readonly PublicOperation[]): string { .join("\n"); const cases = operations.map(renderOperationCase).join("\n"); return `// Generated by scripts/generate-effect-api.ts. Do not edit by hand. -import { Data, Effect, Ref, Schema, Stream } from "effect"; +import { Data, Effect, Ref, Schema, SchemaIssue, Stream } from "effect"; import type * as SchemaAST from "effect/SchemaAST"; import * as Api from "./openapi-api.gen"; @@ -318,6 +318,17 @@ const strictParseOptions = { onExcessProperty: "error", } satisfies SchemaAST.ParseOptions; +function atEnvelopeKey( + key: "path" | "query" | "headers" | "body", + effect: Effect.Effect, +): Effect.Effect { + return Effect.mapError( + effect, + (error) => + new Schema.SchemaError(new SchemaIssue.Pointer([key], error.issue)), + ); +} + export function executePublicOperation( client: PublicApiClientValue, operationId: OperationId, @@ -435,11 +446,12 @@ function renderPartDecoder( : part === "headers" ? "Headers" : "RequestJson"; - const fallback = part === "query" || part === "headers" ? " ?? {}" : ""; + const source = part === "body" ? "input.body" : `input.${part} ?? {}`; + const decode = `atEnvelopeKey(${JSON.stringify(part)}, Schema.decodeUnknownEffect(\n Api.${operation.schemaBase}${suffix},\n strictParseOptions,\n )(${source}))`; if (part === "body" && !operation.bodyRequired) { - return ` const ${localName} = input.body === undefined\n ? undefined\n : yield* Schema.decodeUnknownEffect(\n Api.${operation.schemaBase}${suffix},\n strictParseOptions,\n )(input.body);`; + return ` const ${localName} = input.body === undefined\n ? undefined\n : yield* ${decode};`; } - return ` const ${localName} = yield* Schema.decodeUnknownEffect(\n Api.${operation.schemaBase}${suffix},\n strictParseOptions,\n )(input.${part}${fallback});`; + return ` const ${localName} = yield* ${decode};`; } function executorGenerationFailure( diff --git a/src/commands/generated.ts b/src/commands/generated.ts index 37cef5f..57c1281 100644 --- a/src/commands/generated.ts +++ b/src/commands/generated.ts @@ -1,5 +1,6 @@ -import { Data, Effect, Schema, Stream } from "effect"; +import { Cause, Data, Effect, Exit, Schema, SchemaIssue, Stream } from "effect"; import { HttpClientError } from "effect/unstable/http"; +import type { HttpClientResponse } from "effect/unstable/http"; import { executeAnyPublicOperation, @@ -14,6 +15,11 @@ import { PublicInput } from "../runtime/services"; type ApiErrorResponse = typeof Api.ApiErrorResponse.Type; +export interface PublicInputIssue { + readonly path: readonly string[]; + readonly message: string; +} + export class GeneratedCommandFailure extends Data.TaggedError( "GeneratedCommandFailure", )<{ @@ -25,9 +31,15 @@ export class GeneratedCommandFailure extends Data.TaggedError( | "auth" | "api" | "response" - | "transport"; + | "transport" + | "internal"; readonly status?: number; readonly apiError?: ApiErrorResponse; + readonly command?: string; + readonly issues?: readonly PublicInputIssue[]; + readonly inputExample?: string; + readonly responseBody?: string; + readonly responseMessage?: string; }> {} export function generatedCommandView( @@ -41,15 +53,15 @@ export function generatedCommandView( return Effect.gen(function* () { const inputSource = yield* parseInputFlag(definition.operation_id, argv); const rawInput = yield* readPublicInput(definition.operation_id, inputSource); - const input = yield* parsePublicInput(definition.operation_id, rawInput); + const input = yield* parsePublicInput(definition, rawInput); const client = yield* PublicApiClient; const result = yield* executeAnyPublicOperation( client, definition.operation_id, input, ).pipe( - Effect.mapError((failure) => - mapGeneratedFailure(definition.operation_id, failure), + Effect.catch((failure) => + Effect.flatMap(describeGeneratedFailure(definition, failure), Effect.fail), ), ); const command = `akua ${definition.command}`; @@ -57,11 +69,7 @@ export function generatedCommandView( ? { command, data: result.value } : { command, - stream: result.stream.pipe( - Stream.mapError((failure) => - mapGeneratedFailure(definition.operation_id, failure), - ), - ), + stream: result.stream.pipe(describeStreamFailures(definition)), }; }); } @@ -95,37 +103,240 @@ function readPublicInput( } function parsePublicInput( - operationId: string, + definition: CommandDefinition, rawInput: string, ): Effect.Effect { return Effect.try({ try: () => JSON.parse(rawInput), - catch: () => new GeneratedCommandFailure({ operationId, reason: "input" }), + catch: (cause) => + new GeneratedCommandFailure({ + operationId: definition.operation_id, + reason: "input", + command: definition.command, + issues: [ + { + path: [], + message: + cause instanceof Error + ? `Input is not valid JSON: ${cause.message}` + : "Input is not valid JSON", + }, + ], + inputExample: inputExampleFor(definition), + }), + }); +} + +const MAX_RESPONSE_BODY_CHARS = 2000; + +function describeGeneratedFailure( + definition: CommandDefinition, + failure: unknown, +): Effect.Effect { + const mapped = mapGeneratedFailure(definition, failure); + if (mapped.reason !== "api" || mapped.apiError !== undefined) { + return Effect.succeed(mapped); + } + const response = failureResponse(failure); + if (response === undefined) return Effect.succeed(mapped); + return readResponseBody(response).pipe( + Effect.map((body) => + body === undefined ? mapped : withResponseDetail(mapped, body), + ), + ); +} + +function describeStreamFailures( + definition: CommandDefinition, +): ( + stream: Stream.Stream, +) => Stream.Stream { + return (stream) => + stream.pipe( + Stream.catchCause((cause) => { + const failed = cause.reasons.find(Cause.isFailReason); + if (failed === undefined) { + // Defect/interrupt-only causes carry no failure to map; re-raise. + return Stream.failCause( + Cause.map(cause, (error) => + mapGeneratedFailure(definition, error), + ), + ); + } + return Stream.unwrap( + Effect.map( + describeGeneratedFailure(definition, failed.error), + Stream.fail, + ), + ); + }), + ); +} + +function failureResponse( + failure: unknown, +): HttpClientResponse.HttpClientResponse | undefined { + if (!(failure instanceof PublicOperationResponseFailure)) return undefined; + const error: unknown = failure.error; + return HttpClientError.isHttpClientError(error) ? error.response : undefined; +} + +function withResponseDetail( + mapped: GeneratedCommandFailure, + body: string, +): GeneratedCommandFailure { + const apiError = decodeApiErrorBody(body); + if (apiError !== undefined) { + return new GeneratedCommandFailure({ + operationId: mapped.operationId, + reason: "api", + status: mapped.status, + apiError, + }); + } + return new GeneratedCommandFailure({ + operationId: mapped.operationId, + reason: "api", + status: mapped.status, + responseBody: truncateBody(body), + responseMessage: extractResponseMessage(body), }); } function mapGeneratedFailure( - operationId: string, + definition: CommandDefinition, failure: unknown, ): GeneratedCommandFailure { + const operationId = definition.operation_id; if (failure instanceof PublicOperationResponseFailure) { - if (Schema.is(Api.ApiErrorResponse)(failure.error)) { + const error: unknown = failure.error; + if (Schema.is(Api.ApiErrorResponse)(error)) { return new GeneratedCommandFailure({ operationId, reason: "api", status: failure.status, - apiError: failure.error, + apiError: error, + }); + } + if (HttpClientError.isHttpClientError(error)) { + return new GeneratedCommandFailure({ + operationId, + // A 2xx/3xx status means the API accepted the request; a client + // error after that (for example a dropped stream) is transport-level. + reason: + failure.status !== undefined && failure.status >= 400 + ? "api" + : "transport", + status: failure.status, }); } return new GeneratedCommandFailure({ operationId, - reason: HttpClientError.isHttpClientError(failure.error) - ? failure.status === undefined - ? "transport" - : "api" - : "response", + reason: "response", status: failure.status, }); } - return new GeneratedCommandFailure({ operationId, reason: "input" }); + if (Schema.isSchemaError(failure)) { + return new GeneratedCommandFailure({ + operationId, + reason: "input", + command: definition.command, + issues: schemaIssues(failure), + inputExample: inputExampleFor(definition), + }); + } + return new GeneratedCommandFailure({ operationId, reason: "internal" }); +} + +const formatStandardIssues = SchemaIssue.makeFormatterStandardSchemaV1(); + +function schemaIssues( + error: Schema.SchemaError, +): readonly PublicInputIssue[] { + return formatStandardIssues(error.issue).issues.map((issue) => ({ + path: (issue.path ?? []).map(pathSegmentToString), + message: issue.message, + })); +} + +function pathSegmentToString( + segment: PropertyKey | { readonly key: PropertyKey }, +): string { + return typeof segment === "object" ? String(segment.key) : String(segment); +} + +function inputExampleFor( + definition: CommandDefinition, +): string { + const sections: { + path?: Record; + query?: Record; + headers?: Record; + body?: Readonly>; + } = {}; + for (const parameter of definition.parameters) { + if (!parameter.required) continue; + if (parameter.in === "path") { + (sections.path ??= {})[parameter.name] = `<${parameter.name}>`; + } else if (parameter.in === "query") { + (sections.query ??= {})[parameter.name] = `<${parameter.name}>`; + } else if (parameter.in === "header") { + (sections.headers ??= {})[parameter.name] = `<${parameter.name}>`; + } + } + const body = definition.body; + if ( + body !== undefined && + (body.required || Object.keys(body.example).length > 0) + ) { + sections.body = body.example; + } + return JSON.stringify(sections); +} + +function readResponseBody( + response: HttpClientResponse.HttpClientResponse, +): Effect.Effect { + return response.text.pipe( + Effect.map((body) => (body === "" ? undefined : body)), + Effect.catch(() => Effect.succeed(undefined)), + ); +} + +function truncateBody(body: string): string { + return body.length > MAX_RESPONSE_BODY_CHARS + ? body.slice(0, MAX_RESPONSE_BODY_CHARS) + : body; +} + +const ApiErrorResponseJson = Schema.fromJsonString(Api.ApiErrorResponse); + +function decodeApiErrorBody(body: string): ApiErrorResponse | undefined { + const exit = Schema.decodeUnknownExit(ApiErrorResponseJson)(body); + return Exit.isSuccess(exit) ? exit.value : undefined; +} + +const ErrorsEnvelopeJson = Schema.fromJsonString( + Schema.Struct({ + errors: Schema.Array( + Schema.Struct({ message: Schema.optionalKey(Schema.String) }), + ), + }), +); + +const TopLevelMessageJson = Schema.fromJsonString( + Schema.Struct({ message: Schema.String }), +); + +function extractResponseMessage(body: string): string | undefined { + const envelope = Schema.decodeUnknownExit(ErrorsEnvelopeJson)(body); + if (Exit.isSuccess(envelope)) { + const message = envelope.value.errors[0]?.message; + if (message !== undefined && message !== "") return message; + } + const topLevel = Schema.decodeUnknownExit(TopLevelMessageJson)(body); + if (Exit.isSuccess(topLevel) && topLevel.value.message !== "") { + return topLevel.value.message; + } + return undefined; } diff --git a/src/generated/commands.gen.ts b/src/generated/commands.gen.ts index e2534ec..0caa0f2 100644 --- a/src/generated/commands.gen.ts +++ b/src/generated/commands.gen.ts @@ -20,7 +20,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "accessDecisions.explainBatch", @@ -39,7 +43,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "requests": [] + } + } }, { "operation_id": "agentEvents.list", @@ -205,7 +215,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "communication_profile": "BEGINNER", + "learning_mode_enabled": false, + "seen_concepts": [] + } + } }, { "operation_id": "agentProviderExchanges.list", @@ -272,7 +290,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "instructions": "", + "capabilities": [] + } + } }, { "operation_id": "agents.enable", @@ -368,7 +394,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "agentSessions.archive", @@ -406,7 +436,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "agent_id": "" + } + } }, { "operation_id": "agentSessions.detectConflicts", @@ -532,7 +568,16 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "path", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "events_retained_until": 0, + "filesystem_retained_until": 0, + "filesystem_pinned": false, + "retention_reason": "SESSION_ACTIVE" + } + } }, { "operation_id": "agentSkills.get", @@ -676,7 +721,14 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "session_id": "", + "message": "" + } + } }, { "operation_id": "agentTurns.emit", @@ -705,7 +757,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "agentTurns.get", @@ -777,7 +833,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "" + } + } }, { "operation_id": "apiTokens.list", @@ -903,7 +965,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "decision": "APPROVE" + } + } }, { "operation_id": "cloudflare.createCredential", @@ -922,7 +990,17 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "account_id": "", + "origin_zone_id": "", + "origin_hostname_suffix": "", + "api_token": "" + } + } }, { "operation_id": "cloudflare.deleteCredential", @@ -999,7 +1077,14 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "region_id": "" + } + } }, { "operation_id": "clusters.createWorkerBootstrap", @@ -1028,7 +1113,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "clusters.delete", @@ -1096,7 +1185,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "namespace": "", + "pod": "", + "command": [] + } + } }, { "operation_id": "clusters.get", @@ -1245,7 +1342,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "region_id": "", + "kubeconfig": "" + } + } }, { "operation_id": "clusters.list", @@ -1507,7 +1612,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "clusters.updateComputeSettings", @@ -1536,7 +1645,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": {} + } }, { "operation_id": "computeConfigs.create", @@ -1560,7 +1673,16 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "provider": "hcloud", + "provider_config": {}, + "credential_scope": "" + } + } }, { "operation_id": "computeConfigs.delete", @@ -1686,7 +1808,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "customDomains.create", @@ -1710,7 +1836,14 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "hostname": "", + "target": "" + } + } }, { "operation_id": "customDomains.delete", @@ -1841,7 +1974,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "dashboards.create", @@ -1860,7 +1997,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "" + } + } }, { "operation_id": "dashboards.createRevision", @@ -1889,7 +2032,17 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": { + "name": "", + "description": "", + "filter_definitions": [], + "default_filter_values": {}, + "widgets": [] + } + } }, { "operation_id": "dashboards.createWidget", @@ -1918,7 +2071,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "dashboards.delete", @@ -2212,7 +2369,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": { + "summary": "" + } + } }, { "operation_id": "dashboards.update", @@ -2236,7 +2399,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "dashboards.updateWidget", @@ -2275,7 +2442,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "entitlements.list", @@ -2338,7 +2509,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "installs.createRender", @@ -2367,7 +2542,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "installs.delete", @@ -2653,7 +2832,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": { + "render_id": "" + } + } }, { "operation_id": "installs.setAutomaticUpdates", @@ -2687,7 +2872,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": { + "automatic_updates_enabled": false + } + } }, { "operation_id": "installs.updateVersion", @@ -2721,7 +2912,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": { + "package_version_id": "" + } + } }, { "operation_id": "machines.create", @@ -2745,7 +2942,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "cluster_id": "", + "instance_type": "", + "compute_config_id": "" + } + } }, { "operation_id": "machines.createDriftReport", @@ -2774,7 +2979,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "machines.delete", @@ -3046,7 +3255,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "machines.suspend", @@ -3080,7 +3293,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "machines.update", @@ -3114,7 +3331,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "notifications.getUnreadCount", @@ -3236,7 +3457,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": true, + "example": {} + } }, { "operation_id": "offers.get", @@ -3506,7 +3731,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": { + "claim_token": "" + } + } }, { "operation_id": "orderDrafts.create", @@ -3573,7 +3804,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "path", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "orderDrafts.get", @@ -3708,7 +3943,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": {} + } }, { "operation_id": "orderDrafts.submitConfigure", @@ -3732,7 +3971,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": true, + "example": { + "field_values": {} + } + } }, { "operation_id": "organizations.acceptInvitation", @@ -3745,7 +3990,13 @@ export const commandRegistry: readonly CommandDefinition[] = "summary": "Accept an organization invitation", "visibility": "PUBLIC", "requires_auth": true, - "parameters": [] + "parameters": [], + "body": { + "required": false, + "example": { + "token": "" + } + } }, { "operation_id": "organizations.addMember", @@ -3774,7 +4025,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "user_id": "" + } + } }, { "operation_id": "organizations.cancelInvitation", @@ -3817,7 +4074,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "" + } + } }, { "operation_id": "organizations.createInvitation", @@ -3836,7 +4099,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "path", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "email": "" + } + } }, { "operation_id": "organizations.delete", @@ -4082,7 +4351,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "organizations.updateMemberRole", @@ -4116,7 +4389,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "role": "owner" + } + } }, { "operation_id": "packages.create", @@ -4140,7 +4419,14 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "sources": [] + } + } }, { "operation_id": "packages.createVersion", @@ -4164,7 +4450,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "semver": "", + "ref": "", + "input_schema": "" + } + } }, { "operation_id": "packages.delete", @@ -4338,7 +4632,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "oci_ref": "", + "version": {} + } + } }, { "operation_id": "packages.list", @@ -4435,7 +4737,14 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "track": "", + "render_id": "" + } + } }, { "operation_id": "previewHostnames.bindPinned", @@ -4464,7 +4773,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "render_id": "" + } + } }, { "operation_id": "previewHostnames.delete", @@ -4615,7 +4930,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "products.create", @@ -4639,7 +4958,15 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "package_id": "", + "package_version_pin": "" + } + } }, { "operation_id": "products.get", @@ -4726,7 +5053,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "products.update", @@ -4760,7 +5091,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "quotas.get", @@ -4822,7 +5157,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "" + } + } }, { "operation_id": "regions.list", @@ -4875,7 +5216,16 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "name": "", + "registry_url": "", + "type": "basic", + "credentials": {} + } + } }, { "operation_id": "registry.deleteCredential", @@ -5054,7 +5404,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "repositoryChangeRequests.createToken", @@ -5083,7 +5437,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "repositoryChangeRequests.get", @@ -5190,7 +5548,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "rejection_reason": "" + } + } }, { "operation_id": "repositoryChangeRequests.withdraw", @@ -5277,7 +5641,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "secrets.createVersion", @@ -5306,7 +5674,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "value": "" + } + } }, { "operation_id": "secrets.delete", @@ -5636,7 +6010,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "secrets.validateToken", @@ -5649,7 +6027,14 @@ export const commandRegistry: readonly CommandDefinition[] = "summary": "Validate a provider token", "visibility": "PUBLIC", "requires_auth": true, - "parameters": [] + "parameters": [], + "body": { + "required": false, + "example": { + "provider": "hcloud", + "value": "" + } + } }, { "operation_id": "snippetRuns.get", @@ -5740,7 +6125,11 @@ export const commandRegistry: readonly CommandDefinition[] = "summary": "Create snippet", "visibility": "PUBLIC", "requires_auth": true, - "parameters": [] + "parameters": [], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "snippets.createRun", @@ -5769,7 +6158,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "snippets.delete", @@ -5812,7 +6205,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "code": "" + } + } }, { "operation_id": "snippets.executeStored", @@ -5831,7 +6230,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "path", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "snippets.get", @@ -6004,7 +6407,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "workspaces.addMember", @@ -6033,7 +6440,14 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "user_id": "", + "role": "admin" + } + } }, { "operation_id": "workspaces.cancelSubscription", @@ -6067,7 +6481,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "effective": "period_end" + } + } }, { "operation_id": "workspaces.changeSubscriptionTier", @@ -6096,7 +6516,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "tier": "" + } + } }, { "operation_id": "workspaces.create", @@ -6109,7 +6535,13 @@ export const commandRegistry: readonly CommandDefinition[] = "summary": "Create workspace", "visibility": "PUBLIC", "requires_auth": true, - "parameters": [] + "parameters": [], + "body": { + "required": false, + "example": { + "name": "" + } + } }, { "operation_id": "workspaces.delete", @@ -6374,7 +6806,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "workspaces.removeMember", @@ -6471,7 +6907,11 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": {} + } }, { "operation_id": "workspaces.updateMember", @@ -6505,7 +6945,13 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": false } - ] + ], + "body": { + "required": false, + "example": { + "role": "admin" + } + } }, { "operation_id": "workspaceSubdomains.get", @@ -6553,6 +6999,12 @@ export const commandRegistry: readonly CommandDefinition[] = "in": "header", "required": true } - ] + ], + "body": { + "required": false, + "example": { + "name": "" + } + } } ]; diff --git a/src/generated/public-operation-executor.gen.ts b/src/generated/public-operation-executor.gen.ts index 4f487b2..d0616a8 100644 --- a/src/generated/public-operation-executor.gen.ts +++ b/src/generated/public-operation-executor.gen.ts @@ -1,5 +1,5 @@ // Generated by scripts/generate-effect-api.ts. Do not edit by hand. -import { Data, Effect, Ref, Schema, Stream } from "effect"; +import { Data, Effect, Ref, Schema, SchemaIssue, Stream } from "effect"; import type * as SchemaAST from "effect/SchemaAST"; import * as Api from "./openapi-api.gen"; @@ -519,6 +519,17 @@ const strictParseOptions = { onExcessProperty: "error", } satisfies SchemaAST.ParseOptions; +function atEnvelopeKey( + key: "path" | "query" | "headers" | "body", + effect: Effect.Effect, +): Effect.Effect { + return Effect.mapError( + effect, + (error) => + new Schema.SchemaError(new SchemaIssue.Pointer([key], error.issue)), + ); +} + export function executePublicOperation( client: PublicApiClientValue, operationId: OperationId, @@ -558,16 +569,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AccessDecisionsExplainHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AccessDecisionsExplainRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AccessDecisionsExplainRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Access Decisions"]["accessDecisionsExplain"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -577,16 +588,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AccessDecisionsExplainBatchHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AccessDecisionsExplainBatchRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AccessDecisionsExplainBatchRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Access Decisions"]["accessDecisionsExplainBatch"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -596,14 +607,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentEventsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentEventsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent events"]["agentEventsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -613,14 +624,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentEventsStreamQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentEventsStreamHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent events"]["agentEventsStream"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -630,10 +641,10 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentPreferencesGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent preferences"]["agentPreferencesGet"]({ headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -643,16 +654,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentPreferencesUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AgentPreferencesUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AgentPreferencesUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Agent preferences"]["agentPreferencesUpdate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -662,14 +673,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentProviderExchangesListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentProviderExchangesListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent provider exchanges"]["agentProviderExchangesList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -679,10 +690,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentsArchivePathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agents"]["agentsArchive"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -692,16 +703,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AgentsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AgentsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Agents"]["agentsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -711,10 +722,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentsEnablePathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agents"]["agentsEnable"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -724,10 +735,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agents"]["agentsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -737,14 +748,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agents"]["agentsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -754,20 +765,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AgentsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AgentsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Agents"]["agentsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -777,10 +788,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentSessionsArchivePathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agent sessions"]["agentSessionsArchive"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -790,16 +801,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentSessionsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AgentSessionsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AgentSessionsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Agent sessions"]["agentSessionsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -809,14 +820,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentSessionsDetectConflictsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentSessionsDetectConflictsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent sessions"]["agentSessionsDetectConflicts"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -826,10 +837,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentSessionsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agent sessions"]["agentSessionsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -839,14 +850,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentSessionsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentSessionsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent sessions"]["agentSessionsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -856,16 +867,16 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentSessionsSetRetentionPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AgentSessionsSetRetentionRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AgentSessionsSetRetentionRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Agent sessions"]["agentSessionsSetRetention"]({ params: path, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -875,10 +886,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentSkillsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agent skills"]["agentSkillsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -888,14 +899,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentSkillsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentSkillsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent skills"]["agentSkillsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -905,10 +916,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentTemplatesGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agent templates"]["agentTemplatesGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -918,14 +929,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentTemplatesListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentTemplatesListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent templates"]["agentTemplatesList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -935,14 +946,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentTurnsCancelPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentTurnsCancelHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent turns"]["agentTurnsCancel"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -952,16 +963,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentTurnsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AgentTurnsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AgentTurnsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Agent turns"]["agentTurnsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -971,20 +982,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentTurnsEmitPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentTurnsEmitHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.AgentTurnsEmitRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.AgentTurnsEmitRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Agent turns"]["agentTurnsEmit"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -994,10 +1005,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.AgentTurnsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Agent turns"]["agentTurnsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1007,14 +1018,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.AgentTurnsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.AgentTurnsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Agent turns"]["agentTurnsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1024,16 +1035,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ApiTokensCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ApiTokensCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ApiTokensCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["API Tokens"]["apiTokensCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1043,14 +1054,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.ApiTokensListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ApiTokensListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["API Tokens"]["apiTokensList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1060,14 +1071,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ApiTokensRevokePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ApiTokensRevokeHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["API Tokens"]["apiTokensRevoke"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1077,14 +1088,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.ApprovalRequestsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ApprovalRequestsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Approval requests"]["approvalRequestsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1094,20 +1105,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ApprovalRequestsResolvePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ApprovalRequestsResolveHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ApprovalRequestsResolveRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ApprovalRequestsResolveRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Approval requests"]["approvalRequestsResolve"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1117,16 +1128,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.CloudflareCreateCredentialHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.CloudflareCreateCredentialRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.CloudflareCreateCredentialRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Cloudflare"]["cloudflareCreateCredential"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1136,14 +1147,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.CloudflareDeleteCredentialPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.CloudflareDeleteCredentialHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Cloudflare"]["cloudflareDeleteCredential"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1153,14 +1164,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.CloudflareListCredentialsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.CloudflareListCredentialsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Cloudflare"]["cloudflareListCredentials"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1170,16 +1181,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ClustersCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ClustersCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1189,20 +1200,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersCreateWorkerBootstrapPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersCreateWorkerBootstrapHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ClustersCreateWorkerBootstrapRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ClustersCreateWorkerBootstrapRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersCreateWorkerBootstrap"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1212,14 +1223,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1229,20 +1240,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersExecPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersExecHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ClustersExecRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ClustersExecRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersExec"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1252,14 +1263,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1269,14 +1280,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersGetCapabilitiesPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersGetCapabilitiesHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersGetCapabilities"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1286,14 +1297,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersGetComputeSettingsPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersGetComputeSettingsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersGetComputeSettings"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1303,14 +1314,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersGetKubeconfigPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersGetKubeconfigHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersGetKubeconfig"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1320,14 +1331,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersGetWorkerBootstrapPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersGetWorkerBootstrapHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersGetWorkerBootstrap"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1337,16 +1348,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersImportHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ClustersImportRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ClustersImportRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersImport"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1356,14 +1367,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.ClustersListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1373,18 +1384,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersListWorkerBootstrapsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.ClustersListWorkerBootstrapsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersListWorkerBootstrapsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersListWorkerBootstraps"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1394,14 +1405,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersProxyKubePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersProxyKubeHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersProxyKube"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1411,14 +1422,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersRefreshCapabilitiesPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersRefreshCapabilitiesHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersRefreshCapabilities"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1428,14 +1439,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersResumePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersResumeHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersResume"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1445,14 +1456,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersRevokeWorkerBootstrapPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersRevokeWorkerBootstrapHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersRevokeWorkerBootstrap"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1462,14 +1473,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersSuspendPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersSuspendHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersSuspend"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1479,20 +1490,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ClustersUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ClustersUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1502,18 +1513,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ClustersUpdateComputeSettingsPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ClustersUpdateComputeSettingsHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.ClustersUpdateComputeSettingsRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Clusters"]["clustersUpdateComputeSettings"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1523,16 +1534,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ComputeConfigsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ComputeConfigsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ComputeConfigsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["ComputeConfigs"]["computeConfigsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1542,14 +1553,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ComputeConfigsDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ComputeConfigsDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["ComputeConfigs"]["computeConfigsDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1559,14 +1570,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ComputeConfigsGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ComputeConfigsGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["ComputeConfigs"]["computeConfigsGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1576,14 +1587,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.ComputeConfigsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ComputeConfigsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["ComputeConfigs"]["computeConfigsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1593,20 +1604,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ComputeConfigsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ComputeConfigsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ComputeConfigsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ComputeConfigsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["ComputeConfigs"]["computeConfigsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1616,20 +1627,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.CustomDomainsCreatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.CustomDomainsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.CustomDomainsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.CustomDomainsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Custom domains"]["customDomainsCreate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1639,14 +1650,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.CustomDomainsDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.CustomDomainsDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Custom domains"]["customDomainsDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1656,10 +1667,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.CustomDomainsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Custom domains"]["customDomainsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1669,14 +1680,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.CustomDomainsListPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.CustomDomainsListQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Custom domains"]["customDomainsList"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1686,20 +1697,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.CustomDomainsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.CustomDomainsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.CustomDomainsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.CustomDomainsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Custom domains"]["customDomainsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1709,16 +1720,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.DashboardsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.DashboardsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1728,18 +1739,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsCreateRevisionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsCreateRevisionHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.DashboardsCreateRevisionRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsCreateRevision"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1749,20 +1760,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsCreateWidgetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsCreateWidgetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.DashboardsCreateWidgetRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.DashboardsCreateWidgetRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsCreateWidget"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1772,14 +1783,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1789,14 +1800,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsDeleteWidgetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsDeleteWidgetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsDeleteWidget"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1806,10 +1817,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1819,10 +1830,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsGetRevisionPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsGetRevision"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1832,10 +1843,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsGetWidgetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsGetWidget"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1845,10 +1856,10 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsGetWorkspaceOverviewHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsGetWorkspaceOverview"]({ headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1858,14 +1869,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.DashboardsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1875,14 +1886,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsListRevisionsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.DashboardsListRevisionsQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsListRevisions"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1892,14 +1903,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsListWidgetsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.DashboardsListWidgetsQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsListWidgets"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1909,14 +1920,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsResetToRecommendedPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsResetToRecommendedHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsResetToRecommended"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1926,18 +1937,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsRestoreRevisionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsRestoreRevisionHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.DashboardsRestoreRevisionRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsRestoreRevision"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1947,20 +1958,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.DashboardsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.DashboardsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1970,20 +1981,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.DashboardsUpdateWidgetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.DashboardsUpdateWidgetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.DashboardsUpdateWidgetRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.DashboardsUpdateWidgetRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Dashboards"]["dashboardsUpdateWidget"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -1993,10 +2004,10 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.EntitlementsListQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Entitlements"]["entitlementsList"]({ query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2006,16 +2017,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.InstallsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.InstallsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Installs"]["installsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2025,20 +2036,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsCreateRenderPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsCreateRenderHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.InstallsCreateRenderRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.InstallsCreateRenderRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Installs"]["installsCreateRender"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2048,14 +2059,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Installs"]["installsDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2065,14 +2076,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Installs"]["installsGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2082,18 +2093,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsGetLogsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.InstallsGetLogsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsGetLogsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const stream = yield* executeClientOperation(client, client.client["Installs"]["installsGetLogs"]({ params: path, query, headers })); if (mode === "raw") return stream; const status = yield* Ref.get(client.responseStatus); @@ -2113,14 +2124,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsGetRenderPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsGetRenderHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Installs"]["installsGetRender"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2130,14 +2141,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsGetStatusPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsGetStatusHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Installs"]["installsGetStatus"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2147,14 +2158,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.InstallsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Installs"]["installsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2164,14 +2175,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsListPodsPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsListPodsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Installs"]["installsListPods"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2181,18 +2192,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsListRendersPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.InstallsListRendersQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsListRendersHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Installs"]["installsListRenders"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2202,18 +2213,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsRestorePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsRestoreHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.InstallsRestoreRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Installs"]["installsRestore"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2223,18 +2234,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsSetAutomaticUpdatesPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsSetAutomaticUpdatesHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.InstallsSetAutomaticUpdatesRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Installs"]["installsSetAutomaticUpdates"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2244,18 +2255,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.InstallsUpdateVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.InstallsUpdateVersionHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.InstallsUpdateVersionRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Installs"]["installsUpdateVersion"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2265,16 +2276,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.MachinesCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.MachinesCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2284,20 +2295,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesCreateDriftReportPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesCreateDriftReportHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.MachinesCreateDriftReportRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.MachinesCreateDriftReportRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesCreateDriftReport"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2307,14 +2318,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2324,14 +2335,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2341,14 +2352,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesGetDriftReportPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesGetDriftReportHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesGetDriftReport"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2358,14 +2369,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesGetSuspensionEventPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesGetSuspensionEventHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesGetSuspensionEvent"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2375,14 +2386,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.MachinesListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2392,18 +2403,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesListDriftReportsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.MachinesListDriftReportsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesListDriftReportsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesListDriftReports"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2413,18 +2424,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesListSuspensionEventsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.MachinesListSuspensionEventsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesListSuspensionEventsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesListSuspensionEvents"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2434,20 +2445,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesResumePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesResumeHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.MachinesResumeRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.MachinesResumeRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesResume"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2457,20 +2468,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesSuspendPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesSuspendHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.MachinesSuspendRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.MachinesSuspendRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesSuspend"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2480,20 +2491,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.MachinesUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.MachinesUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.MachinesUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.MachinesUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Machines"]["machinesUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2512,10 +2523,10 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.NotificationsListQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Notifications"]["notificationsList"]({ query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2534,10 +2545,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.NotificationsMarkReadPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Notifications"]["notificationsMarkRead"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2547,14 +2558,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OffersArchivePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OffersArchiveHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Offers"]["offersArchive"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2564,14 +2575,14 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OffersCreateHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.OffersCreateRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Offers"]["offersCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2581,10 +2592,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OffersGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Offers"]["offersGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2594,14 +2605,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OffersListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OffersListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Offers"]["offersList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2611,10 +2622,10 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OffersResolveQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Offers"]["offersResolve"]({ query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2624,14 +2635,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OffersUnarchivePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OffersUnarchiveHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Offers"]["offersUnarchive"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2641,14 +2652,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OperationsCancelPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OperationsCancelHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Operations"]["operationsCancel"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2658,14 +2669,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OperationsGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OperationsGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Operations"]["operationsGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2675,10 +2686,10 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OperationsListQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Operations"]["operationsList"]({ query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2688,14 +2699,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OperationsWaitPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OperationsWaitQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Operations"]["operationsWait"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2705,14 +2716,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsCancelPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrderDraftsCancelHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsCancel"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2722,18 +2733,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsClaimPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrderDraftsClaimHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.OrderDraftsClaimRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsClaim"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2743,14 +2754,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsCreatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrderDraftsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsCreate"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2760,14 +2771,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsCreateCheckoutSessionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrderDraftsCreateCheckoutSessionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsCreateCheckoutSession"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2777,16 +2788,16 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsCreateWorkerBootstrapPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.OrderDraftsCreateWorkerBootstrapRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.OrderDraftsCreateWorkerBootstrapRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsCreateWorkerBootstrap"]({ params: path, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2796,10 +2807,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2809,10 +2820,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsGetCheckoutSessionPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsGetCheckoutSession"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2822,14 +2833,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OrderDraftsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrderDraftsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2839,14 +2850,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsListCheckoutSessionsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OrderDraftsListCheckoutSessionsQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsListCheckoutSessions"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2856,18 +2867,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsSelectWorkspacePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrderDraftsSelectWorkspaceHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.OrderDraftsSelectWorkspaceRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsSelectWorkspace"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2877,18 +2888,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrderDraftsSubmitConfigurePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrderDraftsSubmitConfigureHeaders, strictParseOptions, - )(input.headers ?? {}); - const payload = yield* Schema.decodeUnknownEffect( + )(input.headers ?? {})); + const payload = yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( Api.OrderDraftsSubmitConfigureRequestJson, strictParseOptions, - )(input.body); + )(input.body)); const value = yield* executeClientOperation(client, client.client["Order Drafts"]["orderDraftsSubmitConfigure"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2900,10 +2911,10 @@ function executeOperation( )(rawInput); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.OrganizationsAcceptInvitationRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.OrganizationsAcceptInvitationRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsAcceptInvitation"]({ payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2913,20 +2924,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsAddMemberPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrganizationsAddMemberHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.OrganizationsAddMemberRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.OrganizationsAddMemberRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsAddMember"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2936,10 +2947,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsCancelInvitationPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsCancelInvitation"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2949,16 +2960,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrganizationsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.OrganizationsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.OrganizationsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2968,16 +2979,16 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsCreateInvitationPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.OrganizationsCreateInvitationRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.OrganizationsCreateInvitationRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsCreateInvitation"]({ params: path, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -2987,14 +2998,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrganizationsDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3004,10 +3015,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3017,10 +3028,10 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OrganizationsListQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsList"]({ query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3030,14 +3041,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsListInvitationsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OrganizationsListInvitationsQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsListInvitations"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3047,14 +3058,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsListManagedWorkspacesPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OrganizationsListManagedWorkspacesQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsListManagedWorkspaces"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3064,14 +3075,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsListMembersPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.OrganizationsListMembersQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsListMembers"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3081,14 +3092,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsRemoveMemberPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrganizationsRemoveMemberHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsRemoveMember"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3098,10 +3109,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsResendInvitationPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsResendInvitation"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3111,20 +3122,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrganizationsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.OrganizationsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.OrganizationsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3134,20 +3145,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.OrganizationsUpdateMemberRolePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.OrganizationsUpdateMemberRoleHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.OrganizationsUpdateMemberRoleRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.OrganizationsUpdateMemberRoleRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Organizations"]["organizationsUpdateMemberRole"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3157,16 +3168,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.PackagesCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.PackagesCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3176,20 +3187,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PackagesCreateVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesCreateVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.PackagesCreateVersionRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.PackagesCreateVersionRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesCreateVersion"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3199,14 +3210,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PackagesDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3216,18 +3227,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PackagesGetPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.PackagesGetQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesGet"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3237,14 +3248,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PackagesGetArtifacthubValuesSchemaPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.PackagesGetArtifacthubValuesSchemaQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesGetArtifacthubValuesSchema"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3254,14 +3265,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PackagesGetVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesGetVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesGetVersion"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3271,14 +3282,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PackagesGetVersionInputsPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesGetVersionInputsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesGetVersionInputs"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3288,16 +3299,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesImportPublishedHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.PackagesImportPublishedRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.PackagesImportPublishedRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesImportPublished"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3307,14 +3318,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.PackagesListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3324,18 +3335,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PackagesListVersionsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.PackagesListVersionsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PackagesListVersionsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Packages"]["packagesListVersions"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3345,20 +3356,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PreviewHostnamesBindFloatingPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PreviewHostnamesBindFloatingHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.PreviewHostnamesBindFloatingRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.PreviewHostnamesBindFloatingRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Preview hostnames"]["previewHostnamesBindFloating"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3368,20 +3379,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PreviewHostnamesBindPinnedPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PreviewHostnamesBindPinnedHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.PreviewHostnamesBindPinnedRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.PreviewHostnamesBindPinnedRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Preview hostnames"]["previewHostnamesBindPinned"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3391,14 +3402,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PreviewHostnamesDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PreviewHostnamesDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Preview hostnames"]["previewHostnamesDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3408,14 +3419,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PreviewHostnamesGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PreviewHostnamesGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Preview hostnames"]["previewHostnamesGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3425,18 +3436,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.PreviewHostnamesListPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.PreviewHostnamesListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.PreviewHostnamesListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Preview hostnames"]["previewHostnamesList"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3446,20 +3457,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ProductsArchivePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ProductsArchiveHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ProductsArchiveRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ProductsArchiveRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Products"]["productsArchive"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3469,16 +3480,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ProductsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ProductsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ProductsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Products"]["productsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3488,14 +3499,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ProductsGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ProductsGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Products"]["productsGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3505,14 +3516,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.ProductsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ProductsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Products"]["productsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3522,20 +3533,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ProductsUnarchivePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ProductsUnarchiveHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ProductsUnarchiveRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ProductsUnarchiveRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Products"]["productsUnarchive"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3545,20 +3556,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.ProductsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.ProductsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.ProductsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.ProductsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Products"]["productsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3568,10 +3579,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.QuotasGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Quotas"]["quotasGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3581,14 +3592,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.QuotasListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.QuotasListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Quotas"]["quotasList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3598,16 +3609,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RegionsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.RegionsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.RegionsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Regions"]["regionsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3617,14 +3628,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.RegionsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RegionsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Regions"]["regionsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3634,16 +3645,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RegistryCreateCredentialHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.RegistryCreateCredentialRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.RegistryCreateCredentialRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Registry"]["registryCreateCredential"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3653,14 +3664,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.RegistryDeleteCredentialPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RegistryDeleteCredentialHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Registry"]["registryDeleteCredential"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3670,14 +3681,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.RegistryListCredentialsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RegistryListCredentialsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Registry"]["registryListCredentials"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3687,18 +3698,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.RepositoriesGetPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.RepositoriesGetQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoriesGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Repositories"]["repositoriesGet"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3708,14 +3719,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.RepositoriesListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoriesListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Repositories"]["repositoriesList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3725,14 +3736,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsAcceptPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsAcceptHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Repository change requests"]["repositoryChangeRequestsAccept"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3742,16 +3753,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.RepositoryChangeRequestsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.RepositoryChangeRequestsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Repository change requests"]["repositoryChangeRequestsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3761,20 +3772,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsCreateTokenPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsCreateTokenHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.RepositoryChangeRequestsCreateTokenRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.RepositoryChangeRequestsCreateTokenRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Repository change requests"]["repositoryChangeRequestsCreateToken"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3784,14 +3795,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Repository change requests"]["repositoryChangeRequestsGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3801,14 +3812,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Repository change requests"]["repositoryChangeRequestsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3818,20 +3829,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsRejectPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsRejectHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.RepositoryChangeRequestsRejectRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.RepositoryChangeRequestsRejectRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Repository change requests"]["repositoryChangeRequestsReject"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3841,14 +3852,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsWithdrawPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.RepositoryChangeRequestsWithdrawHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Repository change requests"]["repositoryChangeRequestsWithdraw"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3858,14 +3869,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsAccessVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsAccessVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsAccessVersion"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3875,16 +3886,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsCreateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SecretsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SecretsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsCreate"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3894,20 +3905,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsCreateVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsCreateVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SecretsCreateVersionRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SecretsCreateVersionRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsCreateVersion"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3917,18 +3928,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsDeletePathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.SecretsDeleteQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsDelete"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3938,14 +3949,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsDestroyVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsDestroyVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsDestroyVersion"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3955,14 +3966,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsDisableVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsDisableVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsDisableVersion"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3972,14 +3983,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsEnableVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsEnableVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsEnableVersion"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -3989,14 +4000,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4006,14 +4017,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsGetVersionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsGetVersionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsGetVersion"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4023,14 +4034,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.SecretsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4040,18 +4051,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsListVersionsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.SecretsListVersionsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsListVersionsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsListVersions"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4061,14 +4072,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsUndeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsUndeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsUndelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4078,20 +4089,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SecretsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SecretsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SecretsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SecretsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4103,10 +4114,10 @@ function executeOperation( )(rawInput); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SecretsValidateTokenRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SecretsValidateTokenRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Secrets"]["secretsValidateToken"]({ payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4116,14 +4127,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetRunsGetPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetRunsGetHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Snippet Runs"]["snippetRunsGet"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4133,14 +4144,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.SnippetRunsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetRunsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Snippet Runs"]["snippetRunsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4152,10 +4163,10 @@ function executeOperation( )(rawInput); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SnippetsCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SnippetsCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsCreate"]({ payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4165,20 +4176,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsCreateRunPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetsCreateRunHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SnippetsCreateRunRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SnippetsCreateRunRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsCreateRun"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4188,14 +4199,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetsDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4205,16 +4216,16 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetsExecuteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SnippetsExecuteRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SnippetsExecuteRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsExecute"]({ headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4224,16 +4235,16 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsExecuteStoredPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SnippetsExecuteStoredRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SnippetsExecuteStoredRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsExecuteStored"]({ params: path, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4243,10 +4254,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4256,10 +4267,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsGetRunPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsGetRun"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4269,10 +4280,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsGetUsagePathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsGetUsage"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4282,14 +4293,14 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.SnippetsListQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetsListHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsList"]({ query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4299,14 +4310,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsListRunsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.SnippetsListRunsQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsListRuns"]({ params: path, query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4316,10 +4327,10 @@ function executeOperation( Schema.Struct({ headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const headers = yield* Schema.decodeUnknownEffect( + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetsListUsageHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsListUsage"]({ headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4329,20 +4340,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.SnippetsUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.SnippetsUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.SnippetsUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.SnippetsUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Snippets"]["snippetsUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4352,20 +4363,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesAddMemberPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesAddMemberHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspacesAddMemberRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspacesAddMemberRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesAddMember"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4375,20 +4386,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesCancelSubscriptionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesCancelSubscriptionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspacesCancelSubscriptionRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspacesCancelSubscriptionRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesCancelSubscription"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4398,20 +4409,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesChangeSubscriptionTierPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesChangeSubscriptionTierHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspacesChangeSubscriptionTierRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspacesChangeSubscriptionTierRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesChangeSubscriptionTier"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4423,10 +4434,10 @@ function executeOperation( )(rawInput); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspacesCreateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspacesCreateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesCreate"]({ payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4436,14 +4447,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesDeletePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesDeleteHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesDelete"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4453,10 +4464,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4466,14 +4477,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesGetAccessStatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesGetAccessStateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesGetAccessState"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4483,14 +4494,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesGetManagementPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesGetManagementHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesGetManagement"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4500,14 +4511,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesGetSubscriptionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesGetSubscriptionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesGetSubscription"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4517,14 +4528,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesGetSubscriptionChangeRequestPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesGetSubscriptionChangeRequestHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesGetSubscriptionChangeRequest"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4534,10 +4545,10 @@ function executeOperation( Schema.Struct({ query: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const query = yield* Schema.decodeUnknownEffect( + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.WorkspacesListQuery, strictParseOptions, - )(input.query ?? {}); + )(input.query ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesList"]({ query })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4547,14 +4558,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesListMembersPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesListMembersHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesListMembers"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4564,18 +4575,18 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), query: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesListSubscriptionChangeRequestsPathParams, strictParseOptions, - )(input.path); - const query = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const query = yield* atEnvelopeKey("query", Schema.decodeUnknownEffect( Api.WorkspacesListSubscriptionChangeRequestsQuery, strictParseOptions, - )(input.query ?? {}); - const headers = yield* Schema.decodeUnknownEffect( + )(input.query ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesListSubscriptionChangeRequestsHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesListSubscriptionChangeRequests"]({ params: path, query, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4585,20 +4596,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesReactivateSubscriptionPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesReactivateSubscriptionHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspacesReactivateSubscriptionRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspacesReactivateSubscriptionRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesReactivateSubscription"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4608,14 +4619,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesRemoveMemberPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesRemoveMemberHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesRemoveMember"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4625,14 +4636,14 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesRevokeManagementPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesRevokeManagementHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesRevokeManagement"]({ params: path, headers })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4642,20 +4653,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesUpdatePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesUpdateHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspacesUpdateRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspacesUpdateRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesUpdate"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4665,20 +4676,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspacesUpdateMemberPathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspacesUpdateMemberHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspacesUpdateMemberRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspacesUpdateMemberRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspaces"]["workspacesUpdateMember"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4688,10 +4699,10 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspaceSubdomainsGetPathParams, strictParseOptions, - )(input.path); + )(input.path ?? {})); const value = yield* executeClientOperation(client, client.client["Workspace subdomains"]["workspaceSubdomainsGet"]({ params: path })); return mode === "raw" ? value : { _tag: "Value", value }; }); @@ -4701,20 +4712,20 @@ function executeOperation( Schema.Struct({ path: Schema.optionalKey(Schema.Unknown), headers: Schema.optionalKey(Schema.Unknown), body: Schema.optionalKey(Schema.Unknown) }), strictParseOptions, )(rawInput); - const path = yield* Schema.decodeUnknownEffect( + const path = yield* atEnvelopeKey("path", Schema.decodeUnknownEffect( Api.WorkspaceSubdomainsSetNamePathParams, strictParseOptions, - )(input.path); - const headers = yield* Schema.decodeUnknownEffect( + )(input.path ?? {})); + const headers = yield* atEnvelopeKey("headers", Schema.decodeUnknownEffect( Api.WorkspaceSubdomainsSetNameHeaders, strictParseOptions, - )(input.headers ?? {}); + )(input.headers ?? {})); const payload = input.body === undefined ? undefined - : yield* Schema.decodeUnknownEffect( - Api.WorkspaceSubdomainsSetNameRequestJson, - strictParseOptions, - )(input.body); + : yield* atEnvelopeKey("body", Schema.decodeUnknownEffect( + Api.WorkspaceSubdomainsSetNameRequestJson, + strictParseOptions, + )(input.body)); const value = yield* executeClientOperation(client, client.client["Workspace subdomains"]["workspaceSubdomainsSetName"]({ params: path, headers, payload })); return mode === "raw" ? value : { _tag: "Value", value }; }); diff --git a/src/runtime/errors.ts b/src/runtime/errors.ts index 47898b0..c7a719c 100644 --- a/src/runtime/errors.ts +++ b/src/runtime/errors.ts @@ -1,5 +1,8 @@ import { ExitCodes, type ExitCode } from "./exit-codes"; -import type { GeneratedCommandFailure } from "../commands/generated"; +import type { + GeneratedCommandFailure, + PublicInputIssue, +} from "../commands/generated"; export interface NextStep { command: string; @@ -80,11 +83,16 @@ export function generatedCommandError( ); } if (failure.reason === "input") { + const detail = (failure.issues ?? []).map(formatInputIssue).join("; "); return new AkuaCliError({ type: "input_error", code: "AKUA_INPUT_INVALID", - message: `Input for ${failure.operationId} does not match the public API contract.`, + message: + detail === "" + ? `Input for ${failure.operationId} does not match the public API contract.` + : `Input for ${failure.operationId} does not match the public API contract: ${detail}.`, exitCode: ExitCodes.Usage, + nextSteps: inputNextSteps(failure), }); } if (failure.reason === "source") { @@ -110,9 +118,20 @@ export function generatedCommandError( type: "api_error", code: first === undefined ? "AKUA_API_ERROR" : `AKUA_API_${first.code}`, - message: first?.message ?? "The public API rejected the request.", + message: + first?.message ?? + failure.responseMessage ?? + "The public API rejected the request.", status: failure.status, - response: failure.apiError, + response: failure.apiError ?? rawResponse(failure.responseBody), + }); + } + if (failure.reason === "internal") { + return new AkuaCliError({ + type: "internal_error", + code: "AKUA_CLI_INTERNAL", + message: `The CLI failed internally while executing ${failure.operationId}. This is a CLI bug, not an input problem.`, + exitCode: ExitCodes.Runtime, }); } if (failure.reason === "response") { @@ -132,6 +151,37 @@ export function generatedCommandError( }); } +// Raw bodies are wrapped so the JSON-mode response field stays object-typed +// (matching structured ApiErrorResponse payloads) and flattened so the +// line-oriented agent renderer emits one value per line. +function rawResponse( + body: string | undefined, +): { readonly raw: string } | undefined { + if (body === undefined) return undefined; + return { raw: body.split(/\r\n|[\r\n]/).join("\\n") }; +} + +function formatInputIssue(issue: PublicInputIssue): string { + return issue.path.length === 0 + ? issue.message + : `${issue.path.join(".")}: ${issue.message}`; +} + +function inputNextSteps( + failure: GeneratedCommandFailure, +): readonly NextStep[] { + if (failure.command === undefined || failure.inputExample === undefined) { + return []; + } + return [ + { + command: `echo '${failure.inputExample}' | akua ${failure.command} --input -`, + description: + 'Pass a JSON envelope whose keys mirror the OpenAPI parameter locations: {"path":{...},"query":{...},"headers":{...},"body":{...}}.', + }, + ]; +} + function exitCodeForStatus(status: number | undefined): ExitCode { if (status === 401) { return ExitCodes.AuthRequired; diff --git a/src/runtime/mode.ts b/src/runtime/mode.ts index 2fc77b3..0ece384 100644 --- a/src/runtime/mode.ts +++ b/src/runtime/mode.ts @@ -59,7 +59,9 @@ export function detectOutputMode( ) { return "agent"; } - if (input.stdoutIsTTY === false) { + // Node/Bun report isTTY as undefined (not false) for piped stdout, so + // anything short of a confirmed TTY selects structured output. + if (input.stdoutIsTTY !== true) { return "agent"; } return "human"; diff --git a/src/runtime/registry.ts b/src/runtime/registry.ts index fce78af..3407826 100644 --- a/src/runtime/registry.ts +++ b/src/runtime/registry.ts @@ -10,6 +10,12 @@ export interface CommandDefinition { visibility: "PUBLIC"; requires_auth: boolean; parameters: readonly CommandParameter[]; + body?: CommandBody; +} + +export interface CommandBody { + required: boolean; + example: Readonly>; } export interface CommandParameter { diff --git a/src/runtime/services-live.ts b/src/runtime/services-live.ts index 2c70770..baf2df8 100644 --- a/src/runtime/services-live.ts +++ b/src/runtime/services-live.ts @@ -109,7 +109,9 @@ export const ProcessLive = Layer.succeed(Process, { }); export const ConsoleLive = Layer.succeed(Console, { - stdoutIsTTY: process.stdout.isTTY, + // isTTY is undefined (not false) when stdout is piped; normalize so the + // declared boolean service contract holds at runtime. + stdoutIsTTY: process.stdout.isTTY === true, writeStderr: (value) => Effect.sync(() => process.stderr.write(value)), writeStdout: (value) => Effect.sync(() => process.stdout.write(value)), }); diff --git a/test/cli.test.ts b/test/cli.test.ts index 4d72f92..4409d12 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -40,8 +40,9 @@ describe("akua entrypoint", () => { const invalid = await runAkua(["commands", "--not-a-real-flag"]); expect(invalid.exitCode).toBe(2); - expect(invalid.stdout).toContain("USAGE"); - expect(invalid.stderr).toContain("Unrecognized flag: --not-a-real-flag"); + expect(invalid.stdout).toContain("type: usage_error"); + expect(invalid.stdout).toContain("code: AKUA_USAGE_ERROR"); + expect(invalid.stdout).toContain("--not-a-real-flag"); }); test("home and help describe executable generated commands", async () => { @@ -264,7 +265,7 @@ describe("akua entrypoint", () => { error: { code: "AKUA_INPUT_INVALID", message: - "Input for machines.create does not match the public API contract.", + "Input for machines.create does not match the public API contract: body.undeclared: Expected no excess property.", }, }); expect(result.stdout).not.toContain(sentinel); diff --git a/test/generate-commands.test.ts b/test/generate-commands.test.ts index d0be28e..2a41e27 100644 --- a/test/generate-commands.test.ts +++ b/test/generate-commands.test.ts @@ -159,6 +159,88 @@ describe("collectPublicCommands", () => { expect(commands[0]?.requires_auth).toBe(false); }); + test("projects request-body requirement and placeholder examples", () => { + const commands = Effect.runSync( + collectPublicCommands({ + components: { + schemas: { + AddMemberBody: { + type: "object", + properties: { + email: { type: "string" }, + role: { type: "string", enum: ["admin", "member"] }, + seats: { type: "integer" }, + notify: { type: "boolean" }, + tags: { type: "array", items: { type: "string" } }, + metadata: { type: "object" }, + }, + required: ["email", "role", "seats", "notify", "tags", "metadata"], + }, + }, + }, + paths: { + "/v1/workspaces/{id}/members": { + post: { + "x-platform-visibility": "PUBLIC", + operationId: "workspaces.addMember", + requestBody: { + required: true, + content: { + "application/json": { + schema: { $ref: "#/components/schemas/AddMemberBody" }, + }, + }, + }, + }, + }, + "/v1/machines": { + post: { + "x-platform-visibility": "PUBLIC", + operationId: "machines.create", + requestBody: { + content: { + "application/json": { + schema: { + type: "object", + properties: { cluster_id: { type: "string" } }, + required: ["cluster_id"], + }, + }, + }, + }, + }, + }, + "/v1/offers/{id}:archive": { + post: { + "x-platform-visibility": "PUBLIC", + operationId: "offers.archive", + }, + }, + }, + }), + ); + + const byId = new Map( + commands.map((command) => [command.operation_id, command]), + ); + expect(byId.get("workspaces.addMember")?.body).toEqual({ + required: true, + example: { + email: "", + role: "admin", + seats: 0, + notify: false, + tags: [], + metadata: {}, + }, + }); + expect(byId.get("machines.create")?.body).toEqual({ + required: false, + example: { cluster_id: "" }, + }); + expect(byId.get("offers.archive")?.body).toBeUndefined(); + }); + test("sorts generated commands deterministically by operationId", () => { const commands = Effect.runSync( collectPublicCommands({ diff --git a/test/generated-command.test.ts b/test/generated-command.test.ts index 517447e..2352142 100644 --- a/test/generated-command.test.ts +++ b/test/generated-command.test.ts @@ -273,6 +273,290 @@ describe("generated public commands", () => { }); }); + test("input schema failures carry issue details and a runnable example", async () => { + await expect( + runGenerated("workspaces.listMembers", [], "{}", () => + Promise.resolve(Response.json({})), + ), + ).rejects.toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "input", + command: "workspaces list-members", + issues: [{ path: ["path", "id"], message: "Missing key" }], + inputExample: '{"path":{"id":""}}', + }); + }); + + test("input excess-property failures name the offending body key", async () => { + await expect( + runGenerated( + "machines.create", + ["--input", "-"], + '{"body":{"cluster_id":"clu_123","instance_type":"cx23","compute_config_id":"ccfg_123","secret":"sentinel"}}', + () => Promise.resolve(Response.json({})), + ), + ).rejects.toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "input", + issues: [ + { path: ["body", "secret"], message: "Expected no excess property" }, + ], + inputExample: + '{"body":{"cluster_id":"","instance_type":"","compute_config_id":""}}', + }); + }); + + test("input examples follow the operation body contract, not the HTTP method", async () => { + // Bodyless POST: the example must not suggest a body envelope key. + await expect( + runGenerated( + "offers.archive", + ["--input", "-"], + '{"path":{"id":"off_1"},"bogus":{}}', + () => Promise.resolve(Response.json({})), + ), + ).rejects.toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "input", + inputExample: '{"path":{"id":""},"headers":{"if-match":""}}', + }); + + // Optional body without required fields: the example omits the body. + await expect( + runGenerated( + "machines.update", + ["--input", "-"], + '{"path":{"id":"mch_1"},"bogus":{}}', + () => Promise.resolve(Response.json({})), + ), + ).rejects.toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "input", + inputExample: '{"path":{"id":""},"headers":{"if-match":""}}', + }); + }); + + test("renders input issues with envelope hint and runnable next step", () => { + const payload = generatedCommandError( + new GeneratedCommandFailure({ + operationId: "workspaces.listMembers", + reason: "input", + command: "workspaces list-members", + issues: [{ path: ["path", "id"], message: "Missing key" }], + inputExample: '{"path":{"id":""}}', + }), + ).toPayload(); + + expect(payload.error.message).toBe( + "Input for workspaces.listMembers does not match the public API contract: path.id: Missing key.", + ); + expect(payload.error.next_steps).toEqual([ + { + command: + "echo '{\"path\":{\"id\":\"\"}}' | akua workspaces list-members --input -", + description: + 'Pass a JSON envelope whose keys mirror the OpenAPI parameter locations: {"path":{...},"query":{...},"headers":{...},"body":{...}}.', + }, + ]); + }); + + test("decodes undeclared-status ApiErrorResponse bodies structurally", async () => { + const body = { + success: false, + errors: [ + { + code: 9001, + message: "Workspace member listing is not implemented yet", + }, + ], + result: {}, + }; + const failure = await runGenerated( + "workspaces.listMembers", + ["--input", "-"], + '{"path":{"id":"ws_123"}}', + () => Promise.resolve(Response.json(body, { status: 501 })), + ).then( + () => undefined, + (caught: unknown) => caught, + ); + + expect(failure).toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "api", + status: 501, + apiError: body, + }); + if (!(failure instanceof GeneratedCommandFailure)) return; + const payload = generatedCommandError(failure).toPayload(); + expect(payload.error).toMatchObject({ + status: 501, + code: "AKUA_API_9001", + message: "Workspace member listing is not implemented yet", + response: body, + }); + }); + + test("extracts the server message from long undeclared-status JSON bodies", async () => { + const body = JSON.stringify({ + message: "Not implemented yet", + detail: "x".repeat(3000), + }); + await expect( + runGenerated( + "workspaces.listMembers", + ["--input", "-"], + '{"path":{"id":"ws_123"}}', + () => + Promise.resolve( + new Response(body, { + status: 501, + headers: { "content-type": "application/json" }, + }), + ), + ), + ).rejects.toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "api", + status: 501, + responseBody: body.slice(0, 2000), + responseMessage: "Not implemented yet", + }); + }); + + test("falls back to the top-level message when the errors array is empty", async () => { + await expect( + runGenerated( + "workspaces.listMembers", + ["--input", "-"], + '{"path":{"id":"ws_123"}}', + () => + Promise.resolve( + Response.json( + { errors: [], message: "fallback message wins" }, + { status: 501 }, + ), + ), + ), + ).rejects.toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "api", + status: 501, + responseMessage: "fallback message wins", + }); + }); + + test("keeps undeclared-status non-JSON bodies as truncated response detail", async () => { + const longBody = `upstream said:\nbad gateway\n${"x".repeat(3000)}`; + const failure = await runGenerated( + "workspaces.listMembers", + ["--input", "-"], + '{"path":{"id":"ws_123"}}', + () => + Promise.resolve( + new Response(longBody, { + status: 502, + headers: { "content-type": "text/plain" }, + }), + ), + ).then( + () => undefined, + (caught: unknown) => caught, + ); + + expect(failure).toBeInstanceOf(GeneratedCommandFailure); + if (!(failure instanceof GeneratedCommandFailure)) return; + expect(failure.reason).toBe("api"); + expect(failure.status).toBe(502); + expect(failure.responseMessage).toBeUndefined(); + expect(failure.responseBody).toHaveLength(2000); + expect(failure.responseBody).toBe(longBody.slice(0, 2000)); + + const payload = generatedCommandError(failure).toPayload(); + expect(payload.error.message).toBe( + "The public API rejected the request.", + ); + // Raw bodies render wrapped and flattened so line-oriented output stays + // one value per line and the JSON response field stays object-typed. + expect(payload.error.response).toEqual({ + raw: longBody.slice(0, 2000).replaceAll("\n", "\\n"), + }); + }); + + test("renders the extracted server message for undeclared statuses", () => { + const payload = generatedCommandError( + new GeneratedCommandFailure({ + operationId: "workspaces.listMembers", + reason: "api", + status: 501, + responseBody: '{"message":"Not implemented"}', + responseMessage: "Not implemented", + }), + ).toPayload(); + + expect(payload.error).toMatchObject({ + status: 501, + code: "AKUA_API_ERROR", + message: "Not implemented", + response: { raw: '{"message":"Not implemented"}' }, + }); + }); + + test("classifies unknown internal failures as internal, not input", () => { + const error = generatedCommandError( + new GeneratedCommandFailure({ + operationId: "workspaces.listMembers", + reason: "internal", + }), + ); + + expect(error.toPayload().error).toMatchObject({ + type: "internal_error", + code: "AKUA_CLI_INTERNAL", + }); + expect(error.exitCode).toBe(1); + }); + + test("enriches mid-stream failures instead of labeling them api errors", async () => { + const encoder = new TextEncoder(); + let pulls = 0; + const body = new ReadableStream({ + pull(controller) { + pulls += 1; + if (pulls === 1) { + controller.enqueue( + encoder.encode("event: message\ndata: first line\n\n"), + ); + return; + } + controller.error(new Error("connection reset")); + }, + }); + const result = await runGenerated( + "installs.getLogs", + ["--input", "-"], + '{"path":{"id":"inst_123"},"query":{"follow":false}}', + () => + Promise.resolve( + new Response(body, { + headers: { "content-type": "text/event-stream" }, + }), + ), + ); + const stream = result.stream; + expect(Stream.isStream(stream)).toBe(true); + if (!Stream.isStream(stream)) return; + + const failure = await Effect.runPromise(Stream.runCollect(stream)).then( + () => undefined, + (caught: unknown) => caught, + ); + expect(failure).toMatchObject({ + _tag: "GeneratedCommandFailure", + reason: "transport", + }); + }); + test("keeps HTTP status separate from the structured API error", () => { const apiError: typeof Api.ApiErrorResponse.Type = { success: false, diff --git a/test/mode.test.ts b/test/mode.test.ts index d27ec41..41c243f 100644 --- a/test/mode.test.ts +++ b/test/mode.test.ts @@ -82,6 +82,15 @@ describe("detectOutputMode", () => { ); }); + test("treats an unknown TTY state as non-interactive", () => { + // Node/Bun report isTTY as undefined (not false) for piped stdout, so + // undefined must select structured output for piped consumers. + expect(expectMode({ argv: [], env: {}, stdoutIsTTY: undefined })).toBe( + "agent", + ); + expect(expectMode({ argv: [], env: {} })).toBe("agent"); + }); + test("uses human output for interactive sessions without automation signals", () => { expect(expectMode({ argv: [], env: {}, stdoutIsTTY: true })).toBe("human"); });