Skip to content

stainless: v0.1.0

Compare
Choose a tag to compare
@github-actions github-actions released this 06 Dec 17:39
c621d4b

0.1.0 (2023-12-06)

⚠ BREAKING CHANGES

  • stl: rename prepareRequest to parseParamsWithContext
  • t: use type parameters more
  • the following have been renamed:
    • z.expands -> z.includes
    • z.(...).expandable() -> z.(...).includable()
    • z.ExpandableInput -> z.IncludableInput
    • z.ExpandableOutput -> z.IncludableOutput
    • z.ExpandableZodType -> z.IncludableZodType
    • z.isExpandable -> z.isIncludable
    • z.expandableSymbol -> z.includableSymbol
  • removed UserContext type parameter in favor of using declaration merging to add custom props to StlContext. Also removed PartialStlContext type.
  • .stlMetadata has been replaced with .withMetadata, z.WithStlMetadata has been replaced with z.ZodMetadata, and z.ExtractStlMetadata has been replaced with z.extractMetadata/ z.extractDeepMetadata.
  • create stl instance with new Stl(...) instead of makeStl(...)
  • the following functions have been moved:
    • stl.next.plugins.appRoute -> stlNextAppRoute
    • stl.next.plugins.pageRoute -> stlNextPageRoute
    • stl.next.plugins.appCatchAllRouter -> stlNextAppCatchAllRouter
    • stl.next.plugins.pageCatchAllRouter -> stlNextPageCatchAllRouter
      All of these functions can be imported from @stl-api/next.
  • *StainlessMetadata has been renamed to *StlMetadata:
    • WithStainlessMetadata -> WithStlMetadata
    • ExtractStainlessMetadata -> ExtractStlMetadata
    • extractStainlessMetadata -> extractStlMetadata
  • the following have been moved from the stl instance to import { z } from 'stainless':
    • stl.expands -> z.expands
    • stl.selects -> z.selects
    • stl.PaginationParams -> z.PaginationParams
    • stl.pageResponse -> z.pageResponse
  • the way to define selectable fields has changed slightly
  • for recursive schemas with expandable or selectable properties, it's now necessary to declare input and output types for those schemas. Unfortunately, I can't see any way around this.
  • remove stl.response; use z.response instead (from import { z } from 'stainless')
  • rename the @stl-api/stl package to stainless

Features

  • add stl.magic function (eb364e2)
  • add stl.magic function (f1f4964)
  • add z.CircularModel helper (8b09e67)
  • add z.path, z.query, z.body, z.response (b67ab2e)
  • better typing (c9cf3a0)
  • cli: allow endpoint handler to be optional (d3283e9)
  • complex value schema generation within user folder (b2beb37)
  • complex value schema generation within user folder (a85c704)
  • implement include and select magic schema generation (1eace8f)
  • implement include and select magic schema generation (61cda64)
  • implement magic schema generation for selection, pageResponse (a2416cd)
  • implement magic schema generation for selection, pageResponse (74d9d5a)
  • implement stl.types.endpoint support, along with CJS and ESM support. (1ad5450)
  • implement stl.types.endpoint support, along with CJS and ESM support. (fbeb815)
  • initial schema class with validate transform implementation (9aaf3d5)
  • make depth parameter of z.expands/z.selects optional (7566a02)
  • react-query: implement useMutation and getQueryKey, add more documentation (#21) (9663cd8)
  • rename magic to codegenSchema (90eb489)
  • stainless: add stl.prepareRequest method (c58dc22)
  • stl: add parseParams, rename prepareRequest (e21f8e2)
  • support authenticated: true config (7f6112a)
  • support default schema values (1ddcae3)
  • use all caps instead of lowercased HTTP methods in endpoints (6c25c78)

Bug Fixes

  • a bunch of issues with include/select (66fdf7e)
  • client query issues and make react-query client wrap base client (2458151)
  • client: throw error on 4xx/5xx (585e0c3)
  • client: use GET for retrieve actions (6049df4)
  • coerceParams: fix bugs and test (1f5294f)
  • endpoint ident mangling, index generation (827c75b)
  • error messages and expansion/selection docs (fd135d8)
  • expand + select bug (a9d7125)
  • expand types (2e3f635)
  • fix stl.magic and t.input types (#23) (7b71730)
  • fix stl.magic and t.input types (#23) (4e1c182)
  • include transform-refine type conversion (566ff1e)
  • make Endpoint type non-recursive (c676b52)
  • make openapi generation work with new TypeSchemas (ad5ef4f)
  • mark expands and selects params (2869e8c)
  • pagination bugs (0be9aa1)
  • propagate stl metadata in .optional()/.nullable()/.nullish() (ac7d368)
  • react-query: fix ESM/CJS issue (ffc6c52)
  • remove debugger/print statements (0f555cc)
  • remove stray debugger and console.log statements (0d35c5b)
  • selectable field strategy (f6c4633)
  • stainless: auto-coerce path and query params (068df62)
  • stainless: fix openapi endpoint (e8767aa)
  • stainless: fix openapi generation (56133a1)
  • stainless: fix toZod and make handler optional (2dcd256)
  • stainless: fix typo (370b936)
  • stainless: implement more practical param coercion (ac98106)
  • stainless: improve coerceParams function (4859154)
  • stainless: tweak and document param coercion (5188fd2)
  • stl.magic type signature (b72c569)
  • stl.magic type signature (1bdbc98)
  • things that are breaking openapi generation (91e40be)
  • use import { z } from "stainless" (85520c1)
  • use our zod-openapi build for now (2893287)
  • various new schema type fixes (02145d7)

Code Refactoring

  • allow extend context via declaration merging instead of generic (afba2e7)
  • convert Stl instance to a class (9604c4e)
  • improve code organization, rename StainlessMetadata -> StlMetadata (f423e33)
  • move expand, select and pagination types to extended z (bd4cb04)
  • rename @stl-api/stl to stainless (bb60f65)
  • rename expand to include (7b35e50)
  • stainless schema metadata (0e93a50)
  • t: use type parameters more (a3a84a4)
  • use standalone next route adapter functions (#6) (cb26747)