Skip to content

docs(sdk): update v1 code samples for SDK v2 breaking changes - #180

Merged
toiroakr merged 6 commits into
mainfrom
sdk-v2
Aug 3, 2026
Merged

docs(sdk): update v1 code samples for SDK v2 breaking changes#180
toiroakr merged 6 commits into
mainfrom
sdk-v2

Conversation

@toiroakr

@toiroakr toiroakr commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Updates hand-written SDK code samples in getting-started, guides, tutorials, administration, and reference ahead of the SDK v2 release line merging into main (a breaking major version bump). docs/sdk/ and docs/app-shell/ are auto-synced from their source repos and are not touched here.
  • Renames: db.type() -> db.table() (including the "type" terminology in surrounding prose/headings), CLI binary tailor-sdk -> tailor, tailor.workflow.triggerWorkflow -> startWorkflow, tailor.workflow.triggerJobFunction -> execJobFunction, tailor.workflow.resumeWorkflow -> resumeWorkflowExecution, defineGenerators/@tailor-platform/kysely-type -> definePlugins/kyselyTypePlugin.
  • Resolver context user -> caller, executor context user -> invoker (TailorUser/TailorActor/TailorInvoker unified into TailorPrincipal).
  • TailorDB hooks/validators updated to the v2 argument shape ({value,data,user} -> {input,invoker,now,oldValue}), type-level hooks changed from a per-field map to a single object, and validators now return string | void instead of boolean/tuple.
  • Rewrote the Wait/Resolve guide around createWaitPoint/createWaitPoints, and removed references to the deleted openDownloadStream API.
  • Added notes about the new required @tailor-platform/sdk/runtime/globals opt-in import for ambient tailor.*/tailordb.* globals.
  • Merged main twice to pick up the SDK's own doc auto-syncs (including the Generator -> Plugin docs rename) and verified against the actually published @tailor-platform/sdk@2.0.0 package, not just the prerelease.

Notes

  • The companion runnable samples in tailor-platform/templates (docs/build-from-scratch/sdk) still need the same updates; tracked separately.

toiroakr added 3 commits July 24, 2026 11:56
Update code samples in getting-started/guides/tutorials/administration/
reference to match the SDK v2 API ahead of tailor-platform/sdk#1808
(v2 release line merge into main). docs/sdk/ and docs/app-shell/ are
auto-synced and untouched.

- db.type() -> db.table()
- CLI binary tailor-sdk -> tailor
- tailor.workflow.triggerWorkflow/triggerJobFunction -> startWorkflow/startJobFunction
- tailor.workflow.resumeWorkflow -> resumeWorkflowExecution
- resolver context.user -> context.caller; executor context.user -> context.invoker
  (TailorUser/TailorActor/TailorInvoker unified into TailorPrincipal)
- TailorDB hooks/validators: {value,data,user} -> {input,invoker,now,oldValue};
  type-level hooks take a single object instead of a per-field map; validators
  return string | void instead of boolean/tuple
- Wait/Resolve guide rewritten around createWaitPoint/createWaitPoints
- Removed references to the deleted openDownloadStream API
- Noted the new @tailor-platform/sdk/runtime/globals opt-in import
# Conflicts:
#	docs/guides/function/builtin-interfaces.md
#	docs/guides/workflow/creating-workflows.md
#	docs/guides/workflow/index.md
#	docs/guides/workflow/monitoring-executions.md
#	docs/guides/workflow/wait-resolve.md
@toiroakr
toiroakr marked this pull request as ready for review July 31, 2026 13:07
@toiroakr
toiroakr requested a review from a team as a code owner July 31, 2026 13:07
Fix chained db
  .type() call sites the earlier single-line sed missed,
and align prose describing the schema-definition concept (headings,
folder-structure comments, tutorial steps) with the v2 db.type() -> db.table()
rename. Leaves literal config keys that are still named 'type' (relation()'s
toward.type, executor trigger's type option) and field-level data-type
wording (Field Types, GraphQL scalar types) unchanged, matching the
published SDK's own reference docs.
…rator link

The SDK's own docs (auto-synced under docs/sdk/) removed docs/sdk/generator/
in the latest sync — defineGenerators() is replaced by definePlugins() in v2,
with the kysely-type generator becoming the kyselyTypePlugin plugin.

- Point the hand-maintained docs/sdk/index.md 'Generator' quick link at the
  new plugin/ docs instead of the now-removed generator/ path (was breaking
  the VitePress dead-link check on CI).
- Update the develop-from-scratch step-03/step-04 tailor.config.ts samples
  from defineGenerators(["@tailor-platform/kysely-type", ...]) to
  definePlugins(kyselyTypePlugin({ ... })).
@toiroakr
toiroakr merged commit 68da8e8 into main Aug 3, 2026
3 checks passed
@toiroakr
toiroakr deleted the sdk-v2 branch August 3, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants