Skip to content

counterfact@4.0.0

Latest

Choose a tag to compare

@pmcelhaney pmcelhaney released this 30 Nov 20:54
· 4 commits to main since this release
983a191

Major Changes

  • 7cf6324: Coalesce case-variant generated paths using the spelling that sorts first, independent of declaration order, while preserving CamelCase and exact OpenAPI URLs. Only routes that share a file use case-keyed method exports and route metadata; other routes keep the ordinary layout, and generated types share the canonical module. Generation migrates supported authored handlers and middleware with a backup and rejects ambiguous migrations.

Minor Changes

  • 0bc24a0: Generate Fetch clients for Swagger 2.0 in normal and client-only generation.
    The fluent client and named SDK use Swagger response schemas for validation
    and support legacy array encodings, form fields, file bodies, and Basic
    authentication.

  • 6ea99b0: OpenAPI 3.x type generation now includes a Fetch client under client/. Use
    --generate-client to generate only the client. Reuse route prefixes with
    segment() and send requests once all required inputs are present. Validated
    responses narrow by matched status. Responses outside the contract reject with
    an error. Response validators are compiled during generation.

    Generated clients apply OpenAPI security requirements and support per-request
    authentication, credentials, redirect handling, and cancellation.

    Completed fluent requests can call stream() to read declared byte responses
    as they arrive.

    Use createSdk() for named operations grouped by path segment or OpenAPI tag.
    The named SDK shares request handling and validated response types with the fluent client.

  • de2bd09: Accept typed OpenAPI 3.x multipart objects in the fluent client and named SDK.
    File fields accept File, Blob, or Uint8Array.

  • 31b46b0: Generate one Fetch client entry point per versioned API group. Fluent clients select the request and response types from the configured URL prefix in the route path, such as route("/v2/greeting"). Named SDKs select the contract with version().

    Import the root fluent client to call every configured API from one route function. Import a specific group or version to include only its contracts in your application.

Patch Changes

  • Updated dependencies [7cf6324]
  • Updated dependencies [7563291]
  • Updated dependencies [0bc24a0]
  • Updated dependencies [6ea99b0]
  • Updated dependencies [de2bd09]
  • Updated dependencies [31b46b0]
    • @counterfact/generator@2.0.0
    • @counterfact/runtime@1.0.0
    • @counterfact/client@0.3.0
    • @counterfact/repl@0.1.14