@tailor-platform/sdk 2.0.0-next.0 → 2.0.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +972 -0
- package/README.md +9 -9
- package/agent-skills/{tailor-sdk → tailor}/SKILL.md +3 -1
- package/dist/aigateway-DR4Kwuik.mjs +9 -0
- package/dist/aigateway-DR4Kwuik.mjs.map +1 -0
- package/dist/application-DArFTTJ9.mjs +3 -0
- package/dist/{application-76hhIhnJ.mjs → application-miwiXtB4.mjs} +1963 -1953
- package/dist/application-miwiXtB4.mjs.map +1 -0
- package/dist/{assert-CKfwrmCV.mjs → assert-DBxo8jPo.mjs} +1 -2
- package/dist/{assert-CKfwrmCV.mjs.map → assert-DBxo8jPo.mjs.map} +1 -1
- package/dist/authconnection-CZvi9ANm.mjs +9 -0
- package/dist/authconnection-CZvi9ANm.mjs.map +1 -0
- package/dist/{brand-DlnJ375c.mjs → brand-Eo4pLXPJ.mjs} +1 -2
- package/dist/brand-Eo4pLXPJ.mjs.map +1 -0
- package/dist/cli/cache/bundle-cache.d.mts +2 -0
- package/dist/cli/cache/store.d.mts +1 -0
- package/dist/cli/cache/types.d.mts +1 -0
- package/dist/cli/commands/api/api-call.d.mts +19 -0
- package/dist/cli/commands/api/index.d.mts +4 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +5 -0
- package/dist/cli/commands/deploy/application.d.mts +7 -0
- package/dist/cli/commands/deploy/apply-phases.d.mts +14 -0
- package/dist/cli/commands/deploy/auth.d.mts +5 -0
- package/dist/cli/commands/deploy/deploy.d.mts +34 -0
- package/dist/cli/commands/deploy/executor.d.mts +7 -0
- package/dist/cli/commands/deploy/function-registry-types.d.mts +12 -0
- package/dist/cli/commands/deploy/function-registry.d.mts +7 -0
- package/dist/cli/commands/deploy/idp.d.mts +5 -0
- package/dist/cli/commands/deploy/resolver.d.mts +5 -0
- package/dist/cli/commands/deploy/secret-manager.d.mts +5 -0
- package/dist/cli/commands/deploy/staticwebsite.d.mts +5 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +9 -0
- package/dist/cli/commands/deploy/types.d.mts +3 -0
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +3 -0
- package/dist/cli/commands/deploy/workflow.d.mts +4 -0
- package/dist/cli/commands/executor/get.d.mts +28 -0
- package/dist/cli/commands/executor/jobs.d.mts +122 -0
- package/dist/cli/commands/executor/list.d.mts +18 -0
- package/dist/cli/commands/executor/transform.d.mts +42 -0
- package/dist/cli/commands/executor/trigger.d.mts +40 -0
- package/dist/cli/commands/executor/webhook.d.mts +21 -0
- package/dist/cli/commands/function/get.d.mts +17 -0
- package/dist/cli/commands/function/list.d.mts +21 -0
- package/dist/cli/commands/function/transform.d.mts +12 -0
- package/dist/cli/commands/generate/options.d.mts +6 -0
- package/dist/cli/commands/generate/seed/bundler.d.mts +26 -0
- package/dist/cli/commands/generate/service.d.mts +15 -0
- package/dist/cli/commands/machineuser/list.d.mts +26 -0
- package/dist/cli/commands/machineuser/token.d.mts +21 -0
- package/dist/cli/commands/oauth2client/get.d.mts +17 -0
- package/dist/cli/commands/oauth2client/list.d.mts +19 -0
- package/dist/cli/commands/oauth2client/transform.d.mts +21 -0
- package/dist/cli/commands/organization/folder/create.d.mts +17 -0
- package/dist/cli/commands/organization/folder/delete.d.mts +15 -0
- package/dist/cli/commands/organization/folder/get.d.mts +16 -0
- package/dist/cli/commands/organization/folder/list.d.mts +21 -0
- package/dist/cli/commands/organization/folder/update.d.mts +17 -0
- package/dist/cli/commands/organization/get.d.mts +15 -0
- package/dist/cli/commands/organization/list.d.mts +14 -0
- package/dist/cli/commands/organization/transform.d.mts +29 -0
- package/dist/cli/commands/organization/tree.d.mts +24 -0
- package/dist/cli/commands/organization/update.d.mts +16 -0
- package/dist/cli/commands/remove.d.mts +15 -0
- package/dist/cli/commands/show.d.mts +39 -0
- package/dist/cli/commands/staticwebsite/deploy.d.mts +19 -0
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +29 -0
- package/dist/cli/commands/tailordb/migrate/config.d.mts +18 -0
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +246 -0
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +16 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +208 -0
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +98 -0
- package/dist/cli/commands/tailordb/migrate/types.d.mts +7 -0
- package/dist/cli/commands/tailordb/truncate.d.mts +18 -0
- package/dist/cli/commands/workflow/executions.d.mts +74 -0
- package/dist/cli/commands/workflow/get.d.mts +30 -0
- package/dist/cli/commands/workflow/list.d.mts +18 -0
- package/dist/cli/commands/workflow/resume.d.mts +22 -0
- package/dist/cli/commands/workflow/start.d.mts +60 -0
- package/dist/cli/commands/workflow/status.d.mts +6 -0
- package/dist/cli/commands/workflow/transform.d.mts +34 -0
- package/dist/cli/commands/workflow/wait.d.mts +15 -0
- package/dist/cli/commands/workflow/waiter.d.mts +23 -0
- package/dist/cli/commands/workspace/app/health.d.mts +17 -0
- package/dist/cli/commands/workspace/app/list.d.mts +21 -0
- package/dist/cli/commands/workspace/app/transform.d.mts +20 -0
- package/dist/cli/commands/workspace/create.d.mts +27 -0
- package/dist/cli/commands/workspace/delete.d.mts +14 -0
- package/dist/cli/commands/workspace/get.d.mts +16 -0
- package/dist/cli/commands/workspace/list.d.mts +17 -0
- package/dist/cli/commands/workspace/restore.d.mts +14 -0
- package/dist/cli/commands/workspace/transform.d.mts +20 -0
- package/dist/cli/commands/workspace/user/invite.d.mts +21 -0
- package/dist/cli/commands/workspace/user/list.d.mts +21 -0
- package/dist/cli/commands/workspace/user/remove.d.mts +16 -0
- package/dist/cli/commands/workspace/user/transform.d.mts +9 -0
- package/dist/cli/commands/workspace/user/update.d.mts +21 -0
- package/dist/cli/index.mjs +12 -5534
- package/dist/cli/lib.d.mts +90 -21180
- package/dist/cli/lib.mjs +157 -16
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -0
- package/dist/cli/main.mjs +6583 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/query/index.d.mts +38 -0
- package/dist/cli/services/application.d.mts +12 -0
- package/dist/cli/services/auth/service.d.mts +3 -0
- package/dist/cli/services/executor/service.d.mts +1 -0
- package/dist/cli/services/http-adapter/bundler.d.mts +3 -0
- package/dist/cli/services/http-adapter/service.d.mts +2 -0
- package/dist/cli/services/resolver/service.d.mts +1 -0
- package/dist/cli/services/tailordb/service.d.mts +3 -0
- package/dist/cli/services/workflow/bundler.d.mts +2 -0
- package/dist/cli/services/workflow/service.d.mts +1 -0
- package/dist/cli/shared/args.d.mts +13 -0
- package/dist/cli/shared/client.d.mts +1273 -0
- package/dist/cli/shared/config-loader.d.mts +25 -0
- package/dist/cli/shared/context.d.mts +29 -0
- package/dist/cli/shared/error-json.d.mts +23 -0
- package/dist/cli/shared/readonly-guard.d.mts +25 -0
- package/dist/cli/shared/script-executor.d.mts +77 -0
- package/dist/cli/shared/seed-chunker.d.mts +45 -0
- package/dist/cli/shared/seed-context.d.mts +49 -0
- package/dist/cli/shared/tailordb-namespaces.d.mts +40 -0
- package/dist/cli/shared/type-generator.d.mts +19 -0
- package/dist/cli/shared/workspace-name.d.mts +1 -0
- package/dist/cli/ts-hook.d.mts +4 -0
- package/dist/cli/ts-hook.mjs +333 -0
- package/dist/completion/zsh-worker.zsh +4223 -0
- package/dist/configure/config/index.d.mts +20 -0
- package/dist/configure/config/types.d.mts +111 -0
- package/dist/configure/index.d.mts +135 -7
- package/dist/configure/index.mjs +409 -56
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/aigateway/index.d.mts +16 -0
- package/dist/configure/services/aigateway/types.d.mts +10 -0
- package/dist/configure/services/auth/index.d.mts +33 -0
- package/dist/configure/services/auth/types.d.mts +168 -0
- package/dist/configure/services/executor/executor.d.mts +70 -0
- package/dist/configure/services/executor/index.d.mts +9 -0
- package/dist/configure/services/executor/operation.d.mts +50 -0
- package/dist/configure/services/executor/trigger/event.d.mts +271 -0
- package/dist/configure/services/executor/trigger/index.d.mts +7 -0
- package/dist/configure/services/executor/trigger/schedule.d.mts +24 -0
- package/dist/configure/services/executor/trigger/webhook.d.mts +43 -0
- package/dist/configure/services/executor/types.d.mts +2 -0
- package/dist/configure/services/http-adapter/http-adapter.d.mts +124 -0
- package/dist/configure/services/http-adapter/index.d.mts +2 -0
- package/dist/configure/services/idp/index.d.mts +60 -0
- package/dist/configure/services/idp/permission.d.mts +64 -0
- package/dist/configure/services/idp/types.d.mts +23 -0
- package/dist/configure/services/index.d.mts +40 -0
- package/dist/configure/services/resolver/index.d.mts +6 -0
- package/dist/configure/services/resolver/permission.d.mts +64 -0
- package/dist/configure/services/resolver/resolver.d.mts +88 -0
- package/dist/configure/services/resolver/types.d.mts +5 -0
- package/dist/configure/services/secrets/index.d.mts +37 -0
- package/dist/configure/services/secrets/types.d.mts +10 -0
- package/dist/configure/services/staticwebsite/index.d.mts +18 -0
- package/dist/configure/services/staticwebsite/types.d.mts +10 -0
- package/dist/configure/services/tailordb/index.d.mts +4 -0
- package/dist/configure/services/tailordb/permission.d.mts +103 -0
- package/dist/configure/services/tailordb/schema.d.mts +486 -0
- package/dist/configure/services/tailordb/types.d.mts +198 -0
- package/dist/configure/services/workflow/execution-policy.d.mts +70 -0
- package/dist/configure/services/workflow/execution-policy.types.d.mts +103 -0
- package/dist/configure/services/workflow/index.d.mts +9 -0
- package/dist/configure/services/workflow/job.d.mts +83 -0
- package/dist/configure/services/workflow/types.d.mts +2 -0
- package/dist/configure/services/workflow/wait-point.d.mts +72 -0
- package/dist/configure/services/workflow/workflow.d.mts +56 -0
- package/dist/configure/types/aigateway-name.d.mts +12 -0
- package/dist/configure/types/connection-name.d.mts +12 -0
- package/dist/configure/types/field.d.mts +8 -0
- package/dist/configure/types/field.types.d.mts +70 -0
- package/dist/configure/types/idp-name.d.mts +12 -0
- package/dist/configure/types/index.d.mts +5 -0
- package/dist/configure/types/machine-user.d.mts +2 -0
- package/dist/configure/types/permission-operand.types.d.mts +20 -0
- package/dist/configure/types/type.d.mts +73 -0
- package/dist/{context-s0lxhu8_.mjs → context-DYQVYWqZ.mjs} +4 -6
- package/dist/context-DYQVYWqZ.mjs.map +1 -0
- package/dist/{crashreport-BhD0y14F.mjs → crashreport-B5LqCTfF.mjs} +25 -17
- package/dist/{crashreport-BhD0y14F.mjs.map → crashreport-B5LqCTfF.mjs.map} +1 -1
- package/dist/{crashreport-D1wKBJ8N.mjs → crashreport-eI7ty7ok.mjs} +1 -2
- package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
- package/dist/enum-constants-j9QBF0cB.mjs.map +1 -0
- package/dist/{errors-EsY4XO6O.mjs → errors-D7583Zz7.mjs} +18 -3
- package/dist/errors-D7583Zz7.mjs.map +1 -0
- package/dist/{file-B58Dm-2P.mjs → file-BUcmVIH2.mjs} +12 -23
- package/dist/file-BUcmVIH2.mjs.map +1 -0
- package/dist/{file-utils-BHPxPXmn.mjs → file-utils-yEiIS4nJ.mjs} +7 -8
- package/dist/file-utils-yEiIS4nJ.mjs.map +1 -0
- package/dist/{globals-ByrCoDip.mjs → globals-DQotNuwK.mjs} +32 -6
- package/dist/globals-DQotNuwK.mjs.map +1 -0
- package/dist/iconv-QWaZh0TT.mjs +38 -0
- package/dist/iconv-QWaZh0TT.mjs.map +1 -0
- package/dist/{idp-Ch95ag8h.mjs → idp-RA_swu-h.mjs} +12 -6
- package/dist/idp-RA_swu-h.mjs.map +1 -0
- package/dist/{interceptor-DOqRkCya.mjs → interceptor-e33JtsC-.mjs} +2 -3
- package/dist/interceptor-e33JtsC-.mjs.map +1 -0
- package/dist/kysely/index.d.mts +5 -7
- package/dist/kysely/index.mjs +0 -1
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/{kysely-type-D1e0Vwkd.mjs → kysely-type-DqIRgDYR.mjs} +6 -6
- package/dist/kysely-type-DqIRgDYR.mjs.map +1 -0
- package/dist/logger-BtX0suGY.mjs +48 -0
- package/dist/logger-BtX0suGY.mjs.map +1 -0
- package/dist/logger-CXQq9YIp.mjs +317 -0
- package/dist/logger-CXQq9YIp.mjs.map +1 -0
- package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
- package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
- package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
- package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
- package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
- package/dist/parser/service/auth/index.d.mts +1 -0
- package/dist/parser/service/auth/schema.d.mts +3 -0
- package/dist/parser/service/http-adapter/index.d.mts +1 -0
- package/dist/parser/service/http-adapter/schema.d.mts +1 -0
- package/dist/parser/service/idp/types.d.mts +5 -0
- package/dist/parser/service/tailordb/type-source.d.mts +10 -0
- package/dist/parser/service/tailordb/types.d.mts +131 -0
- package/dist/platform-serialize-RoRtBS0v.mjs +46 -0
- package/dist/platform-serialize-RoRtBS0v.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +15 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
- package/dist/plugin/builtin/file-utils/index.d.mts +15 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -2
- package/dist/plugin/builtin/kysely-type/index.d.mts +15 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
- package/dist/plugin/builtin/seed/index.d.mts +46 -2
- package/dist/plugin/builtin/seed/index.mjs +1 -2
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +19 -0
- package/dist/plugin/builtin/seed/types.d.mts +2 -0
- package/dist/plugin/get-generated-type.d.mts +16 -0
- package/dist/plugin/index.d.mts +3 -119
- package/dist/plugin/index.mjs +1 -2
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/manager.d.mts +2 -0
- package/dist/plugin/types.d.mts +242 -0
- package/dist/plugin/with-context.d.mts +101 -0
- package/dist/{runtime-C7qTBDD2.mjs → register-ts-hook-BAHMwxfG.mjs} +12374 -8672
- package/dist/register-ts-hook-BAHMwxfG.mjs.map +1 -0
- package/dist/registry-BIGVUrMB.mjs +54 -0
- package/dist/registry-BIGVUrMB.mjs.map +1 -0
- package/dist/{repl-editor-CJG3sz7A.mjs → repl-editor-BCozyiNq.mjs} +7 -7
- package/dist/{repl-editor-CJG3sz7A.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
- package/dist/runtime/aigateway.d.mts +25 -0
- package/dist/runtime/aigateway.mjs +3 -0
- package/dist/runtime/authconnection.d.mts +21 -2
- package/dist/runtime/authconnection.mjs +2 -3
- package/dist/runtime/context.d.mts +54 -2
- package/dist/runtime/context.mjs +2 -3
- package/dist/runtime/field-parse.d.mts +10 -0
- package/dist/runtime/file.d.mts +170 -2
- package/dist/runtime/file.mjs +2 -3
- package/dist/runtime/globals.d.mts +38 -53
- package/dist/runtime/globals.mjs +0 -1
- package/dist/runtime/iconv.d.mts +73 -2
- package/dist/runtime/iconv.mjs +2 -3
- package/dist/runtime/idp.d.mts +129 -2
- package/dist/runtime/idp.mjs +2 -3
- package/dist/runtime/index.d.mts +48 -9
- package/dist/runtime/index.mjs +10 -9
- package/dist/runtime/logger.d.mts +98 -0
- package/dist/runtime/logger.mjs +3 -0
- package/dist/runtime/secretmanager.d.mts +41 -2
- package/dist/runtime/secretmanager.mjs +2 -3
- package/dist/runtime/types.d.mts +25 -0
- package/dist/runtime/workflow.d.mts +124 -2
- package/dist/runtime/workflow.mjs +2 -3
- package/dist/{schema-1msIhXwA.mjs → schema--xYWRGfe.mjs} +289 -231
- package/dist/schema--xYWRGfe.mjs.map +1 -0
- package/dist/{secret-file-CWzF8rry.mjs → secret-file-C3J4Gy8r.mjs} +2 -3
- package/dist/{secret-file-CWzF8rry.mjs.map → secret-file-C3J4Gy8r.mjs.map} +1 -1
- package/dist/secretmanager-CYlpffsz.mjs +13 -0
- package/dist/secretmanager-CYlpffsz.mjs.map +1 -0
- package/dist/secretmanager-IY4UvinW.mjs +131 -0
- package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
- package/dist/seed/index.d.mts +4 -4
- package/dist/seed/index.mjs +0 -1
- package/dist/seed/index.mjs.map +1 -1
- package/dist/seed-LUVr7jHL.mjs +444 -0
- package/dist/seed-LUVr7jHL.mjs.map +1 -0
- package/dist/{service-DMohAx8a2.mjs → service-B5WynBHQ.mjs} +3 -4
- package/dist/service-B5WynBHQ.mjs.map +1 -0
- package/dist/service-BNtPsK9Q.mjs +837 -0
- package/dist/service-BNtPsK9Q.mjs.map +1 -0
- package/dist/service-D5jn05ZI.mjs +3 -0
- package/dist/service_pb-BwZRiNug.mjs +167 -0
- package/dist/service_pb-BwZRiNug.mjs.map +1 -0
- package/dist/service_pb-wRkxUta6.mjs +3 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +203 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +57 -0
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +315 -0
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +160 -0
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +2069 -0
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +865 -0
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +111 -0
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +68 -0
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +438 -0
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +563 -0
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +144 -0
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +450 -0
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +191 -0
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +49 -0
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +406 -0
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +429 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +72 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +16 -0
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +308 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +590 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +329 -0
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +112 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +345 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +53 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +3575 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +186 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +28 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +428 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +89 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +683 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +796 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +329 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +182 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +861 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +309 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2014 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +482 -0
- package/dist/{telemetry-BQbbVo2t.mjs → telemetry-BRVdwh14.mjs} +4 -5
- package/dist/telemetry-BRVdwh14.mjs.map +1 -0
- package/dist/telemetry-CkbkeJxl.mjs +3 -0
- package/dist/test-env-key-D7UkZp99.mjs +75 -0
- package/dist/test-env-key-D7UkZp99.mjs.map +1 -0
- package/dist/type-source-DH_LH20p.mjs +13 -0
- package/dist/type-source-DH_LH20p.mjs.map +1 -0
- package/dist/types/aigateway.generated.d.mts +12 -0
- package/dist/types/app-config.generated.d.mts +4 -0
- package/dist/types/auth-connection.generated.d.mts +33 -0
- package/dist/types/auth.generated.d.mts +188 -0
- package/dist/types/executor.generated.d.mts +209 -0
- package/dist/types/helpers.d.mts +40 -0
- package/dist/types/http-adapter.generated.d.mts +28 -0
- package/dist/types/idp.generated.d.mts +626 -0
- package/dist/types/resolver.generated.d.mts +82 -0
- package/dist/types/secrets.generated.d.mts +14 -0
- package/dist/types/staticwebsite.generated.d.mts +14 -0
- package/dist/types/tailordb.generated.d.mts +468 -0
- package/dist/types/workflow.generated.d.mts +17 -0
- package/dist/user-agent-Bgsszb5I.mjs +28 -0
- package/dist/user-agent-Bgsszb5I.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +6 -99
- package/dist/utils/test/index.mjs +60 -40
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/utils/test/mock.d.mts +86 -0
- package/dist/vitest/environment.d.mts +1 -2
- package/dist/vitest/environment.mjs +2 -3
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.d.mts +15 -392
- package/dist/vitest/index.mjs +1347 -9
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock-kysely.d.mts +61 -0
- package/dist/vitest/mock.d.mts +10 -0
- package/dist/vitest/mocks/aigateway.d.mts +40 -0
- package/dist/vitest/mocks/authconnection.d.mts +38 -0
- package/dist/vitest/mocks/file.d.mts +58 -0
- package/dist/vitest/mocks/iconv.d.mts +51 -0
- package/dist/vitest/mocks/idp.d.mts +60 -0
- package/dist/vitest/mocks/logger.d.mts +45 -0
- package/dist/vitest/mocks/secretmanager.d.mts +44 -0
- package/dist/vitest/mocks/tailordb.d.mts +115 -0
- package/dist/vitest/mocks/workflow.d.mts +157 -0
- package/dist/vitest/setup.d.mts +1 -2
- package/dist/vitest/setup.mjs +2 -3
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/vitest/workflow-local.d.mts +41 -0
- package/dist/workflow-CsaQ9qK-.mjs +42 -0
- package/dist/workflow-CsaQ9qK-.mjs.map +1 -0
- package/dist/{client-CobIRHl-.mjs → workspace_resource_pb-UGK1SSn_.mjs} +55 -616
- package/dist/workspace_resource_pb-UGK1SSn_.mjs.map +1 -0
- package/docs/cli/application.md +150 -252
- package/docs/cli/auth.md +51 -295
- package/docs/cli/completion.md +4 -25
- package/docs/cli/crashreport.md +3 -63
- package/docs/cli/executor.md +72 -183
- package/docs/cli/function.md +17 -133
- package/docs/cli/organization.md +11 -221
- package/docs/cli/plugin.md +29 -0
- package/docs/cli/query.md +2 -22
- package/docs/cli/secret.md +71 -251
- package/docs/cli/setup.md +138 -40
- package/docs/cli/skills.md +50 -39
- package/docs/cli/staticwebsite.md +32 -180
- package/docs/cli/tailordb.md +71 -427
- package/docs/cli/upgrade.md +2 -22
- package/docs/cli/user.md +78 -247
- package/docs/cli/workflow.md +150 -172
- package/docs/cli/workspace.md +167 -538
- package/docs/cli-reference.md +213 -96
- package/docs/configuration.md +40 -8
- package/docs/github-actions.md +72 -24
- package/docs/migration/v2.md +1316 -0
- package/docs/multi-environment.md +29 -7
- package/docs/plugin/custom.md +6 -6
- package/docs/plugin/index.md +9 -9
- package/docs/quickstart.md +8 -7
- package/docs/runtime.md +21 -12
- package/docs/services/aigateway.md +115 -0
- package/docs/services/auth.md +70 -61
- package/docs/services/executor.md +8 -5
- package/docs/services/http-adapter.md +16 -1
- package/docs/services/idp.md +55 -2
- package/docs/services/resolver.md +63 -11
- package/docs/services/secret.md +11 -11
- package/docs/services/staticwebsite.md +8 -2
- package/docs/services/tailordb-migration.md +43 -28
- package/docs/services/tailordb.md +200 -99
- package/docs/services/workflow.md +135 -59
- package/docs/testing.md +253 -145
- package/package.json +61 -47
- package/postinstall.mjs +4 -6
- package/dist/actor-J2gJ0eK5.d.mts +0 -24
- package/dist/application-76hhIhnJ.mjs.map +0 -1
- package/dist/application-av2raLs6.mjs +0 -4
- package/dist/authconnection-BIYzEh2p.d.mts +0 -39
- package/dist/authconnection-D8SJGMpj.mjs +0 -16
- package/dist/authconnection-D8SJGMpj.mjs.map +0 -1
- package/dist/brand-DlnJ375c.mjs.map +0 -1
- package/dist/chunk-BkoGK1jX.mjs +0 -21
- package/dist/cli/erd-viewer-assets/app.js +0 -1181
- package/dist/cli/erd-viewer-assets/index.html +0 -73
- package/dist/cli/erd-viewer-assets/serve.json +0 -13
- package/dist/cli/erd-viewer-assets/styles.css +0 -789
- package/dist/cli/index.d.mts +0 -5
- package/dist/cli/index.mjs.map +0 -1
- package/dist/cli/skills.d.mts +0 -1
- package/dist/cli/skills.mjs +0 -22
- package/dist/cli/skills.mjs.map +0 -1
- package/dist/client-C68VWo4g.mjs +0 -4
- package/dist/client-CobIRHl-.mjs.map +0 -1
- package/dist/context-CUBwSBq4.d.mts +0 -68
- package/dist/context-s0lxhu8_.mjs.map +0 -1
- package/dist/enum-constants-C7DaWeQo.mjs.map +0 -1
- package/dist/env-B-g-qgE4.d.mts +0 -7
- package/dist/errors-EsY4XO6O.mjs.map +0 -1
- package/dist/field-C4zdJLW5.mjs +0 -23
- package/dist/field-C4zdJLW5.mjs.map +0 -1
- package/dist/file-B58Dm-2P.mjs.map +0 -1
- package/dist/file-BzK8z3X-.d.mts +0 -250
- package/dist/file-utils-BHPxPXmn.mjs.map +0 -1
- package/dist/globals-ByrCoDip.mjs.map +0 -1
- package/dist/iconv-DreIffeM.mjs +0 -64
- package/dist/iconv-DreIffeM.mjs.map +0 -1
- package/dist/iconv-kwrmd1U_.d.mts +0 -122
- package/dist/idp-BlBPtXJ-.d.mts +0 -160
- package/dist/idp-Ch95ag8h.mjs.map +0 -1
- package/dist/index-CLxubakC.d.mts +0 -1225
- package/dist/index-CPRnOjjt.d.mts +0 -18
- package/dist/index-CQZVJ5SX.d.mts +0 -18
- package/dist/index-CfRFkXIO.d.mts +0 -47
- package/dist/index-DRhMpdnA.d.mts +0 -46
- package/dist/index-DUupuPhZ.d.mts +0 -18
- package/dist/interceptor-DOqRkCya.mjs.map +0 -1
- package/dist/job-BpsFXPbi.mjs +0 -54
- package/dist/job-BpsFXPbi.mjs.map +0 -1
- package/dist/kysely-type-D1e0Vwkd.mjs.map +0 -1
- package/dist/logger-DpJyJvNz.mjs +0 -221
- package/dist/logger-DpJyJvNz.mjs.map +0 -1
- package/dist/mock-DMgIygjE.mjs +0 -806
- package/dist/mock-DMgIygjE.mjs.map +0 -1
- package/dist/package-json-wzO6nV9O.mjs +0 -4
- package/dist/plugin-C_FyVSdl.d.mts +0 -634
- package/dist/registry-D0uB0OrK.mjs +0 -178
- package/dist/registry-D0uB0OrK.mjs.map +0 -1
- package/dist/runtime-C7qTBDD2.mjs.map +0 -1
- package/dist/schema-1msIhXwA.mjs.map +0 -1
- package/dist/secretmanager-B9h-U_8U.mjs +0 -25
- package/dist/secretmanager-B9h-U_8U.mjs.map +0 -1
- package/dist/secretmanager-CKLB3wAQ.d.mts +0 -55
- package/dist/seed-BH2FbrPV.mjs +0 -1171
- package/dist/seed-BH2FbrPV.mjs.map +0 -1
- package/dist/service-BHQIerYh.mjs +0 -4
- package/dist/service-DMohAx8a2.mjs.map +0 -1
- package/dist/service-wI3Hvrgx.mjs +0 -460
- package/dist/service-wI3Hvrgx.mjs.map +0 -1
- package/dist/tailordb-BlBGmQK-.d.mts +0 -863
- package/dist/telemetry-BQbbVo2t.mjs.map +0 -1
- package/dist/telemetry-w92bvGdC.mjs +0 -4
- package/dist/types-2Be3wSMc.mjs +0 -5
- package/dist/types-CmzfQP_m.mjs +0 -372
- package/dist/types-CmzfQP_m.mjs.map +0 -1
- package/dist/workflow--aPbA8Uq.mjs +0 -39
- package/dist/workflow--aPbA8Uq.mjs.map +0 -1
- package/dist/workflow-CMamswkK.d.mts +0 -96
- package/dist/workflow.generated-Bf1tWylx.d.mts +0 -1416
- package/docs/generator/builtin.md +0 -257
- package/docs/generator/custom.md +0 -147
- package/docs/generator/index.md +0 -66
|
@@ -0,0 +1,1316 @@
|
|
|
1
|
+
# Migrating to v2
|
|
2
|
+
|
|
3
|
+
<!-- Generated from the sdk-codemod registry. Run `pnpm codemod:docs:update` and edit `packages/sdk-codemod/src/registry.ts` instead of this file. -->
|
|
4
|
+
|
|
5
|
+
Run the codemods, then finish anything reported as not migrated automatically:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx @tailor-platform/sdk-codemod --from <current-version> --to <target-version>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## defineGenerators → definePlugins
|
|
12
|
+
|
|
13
|
+
**Migration:** Partially automatic
|
|
14
|
+
|
|
15
|
+
Migrate defineGenerators() tuple syntax to definePlugins() with explicit plugin imports
|
|
16
|
+
|
|
17
|
+
Before:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { defineGenerators } from "@tailor-platform/sdk";
|
|
21
|
+
|
|
22
|
+
export const generators = defineGenerators(
|
|
23
|
+
["@tailor-platform/kysely-type", { distPath: "db.ts" }],
|
|
24
|
+
);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
After:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { definePlugins } from "@tailor-platform/sdk";
|
|
31
|
+
import { kyselyTypePlugin } from "@tailor-platform/sdk/plugin/kysely-type";
|
|
32
|
+
|
|
33
|
+
export const generators = definePlugins(kyselyTypePlugin({ distPath: "db.ts" }));
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
<details>
|
|
37
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
defineGenerators() is replaced by definePlugins() in v2. The codemod rewrites the
|
|
41
|
+
known plugin tuples (kysely-type, enum-constants, file-utils, seed). For any
|
|
42
|
+
remaining defineGenerators([...]) the codemod left in place — a plugin it does not
|
|
43
|
+
know, or a non-tuple/spread form — convert it to definePlugins(pluginFn(config)),
|
|
44
|
+
importing the matching plugin from its @tailor-platform/sdk/plugin/<name> subpath.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
## @tailor-platform/sdk/cli plugin imports → dedicated subpaths
|
|
50
|
+
|
|
51
|
+
**Migration:** Automatic
|
|
52
|
+
|
|
53
|
+
Rewrite deprecated plugin re-export imports (kyselyTypePlugin, enumConstantsPlugin, fileUtilsPlugin, seedPlugin) from `@tailor-platform/sdk/cli` to their dedicated plugin subpaths
|
|
54
|
+
|
|
55
|
+
Before:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { kyselyTypePlugin } from "@tailor-platform/sdk/cli";
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
After:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { kyselyTypePlugin } from "@tailor-platform/sdk/plugin/kysely-type";
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## function test-run --arg input unwrap
|
|
68
|
+
|
|
69
|
+
**Migration:** Automatic
|
|
70
|
+
|
|
71
|
+
Strip the deprecated {input: ...} wrapper from `tailor function test-run --arg` JSON in scripts and docs
|
|
72
|
+
|
|
73
|
+
Before:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
tailor function test-run resolvers/add.ts --arg '{"input":{"a":1}}'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
After:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
tailor function test-run resolvers/add.ts --arg '{"a":1}'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## tailor-sdk-skills → tailor skills add
|
|
86
|
+
|
|
87
|
+
**Migration:** Partially automatic
|
|
88
|
+
|
|
89
|
+
Replace deprecated `tailor-sdk-skills` invocations with `tailor skills add`
|
|
90
|
+
|
|
91
|
+
Before:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
npx tailor-sdk-skills
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
After:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
tailor skills add
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
<details>
|
|
104
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
The standalone tailor-sdk-skills binary is removed in v2; call the skills add
|
|
108
|
+
subcommand on the main tailor CLI instead. Replace any remaining
|
|
109
|
+
tailor-sdk-skills invocations the codemod did not rewrite with
|
|
110
|
+
`tailor skills add`.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
</details>
|
|
114
|
+
|
|
115
|
+
## Unify TailorUser/TailorActor/TailorActorType/TailorInvoker → TailorPrincipal
|
|
116
|
+
|
|
117
|
+
**Migration:** Partially automatic
|
|
118
|
+
|
|
119
|
+
Rename TailorUser/TailorActor/TailorActorType/TailorInvoker to TailorPrincipal, drop unauthenticatedTailorUser, rename resolver body `user` to `caller`, and rename TailorDB callback `user` to `invoker`
|
|
120
|
+
|
|
121
|
+
Type references unify under `TailorPrincipal`:
|
|
122
|
+
|
|
123
|
+
Before:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
import type { TailorUser } from "@tailor-platform/sdk";
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
After:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
import type { TailorPrincipal } from "@tailor-platform/sdk";
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The resolver body `user` becomes `caller`:
|
|
136
|
+
|
|
137
|
+
Before:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
body: ({ input, user }) => user.id,
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
After:
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
body: ({ input, caller }) => caller.id,
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
<details>
|
|
150
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
Finish the cases the codemod left for manual migration:
|
|
154
|
+
- Rename user -> caller in resolver bodies the codemod skipped because a `caller`
|
|
155
|
+
binding already exists or renaming would shadow/collide with another value.
|
|
156
|
+
- Replace member-access on the removed unauthenticatedTailorUser (e.g.
|
|
157
|
+
unauthenticatedTailorUser.id); the codemod only replaced standalone references
|
|
158
|
+
with null and left member access to surface a type error.
|
|
159
|
+
- Review helper adapters that still accept or read `context.user`; v2 resolver
|
|
160
|
+
context uses nullable `caller` and `invoker`, so project-specific helper
|
|
161
|
+
semantics for anonymous callers and command invokers must be chosen explicitly.
|
|
162
|
+
- Review `caller?.` values passed to APIs that require non-null values. If the
|
|
163
|
+
resolver requires authentication, throw or otherwise narrow before the call;
|
|
164
|
+
if anonymous callers are allowed, keep the nullable flow explicit.
|
|
165
|
+
Use TailorPrincipal for the unified user/actor/invoker type.
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
</details>
|
|
169
|
+
|
|
170
|
+
## AttributeMap → Attributes
|
|
171
|
+
|
|
172
|
+
**Migration:** Partially automatic
|
|
173
|
+
|
|
174
|
+
Rename auth attribute module augmentation and related SDK type names from `AttributeMap` to `Attributes`
|
|
175
|
+
|
|
176
|
+
Module augmentation uses `Attributes`:
|
|
177
|
+
|
|
178
|
+
Before:
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
declare module "@tailor-platform/sdk" {
|
|
182
|
+
interface AttributeMap {
|
|
183
|
+
role: string;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
After:
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
declare module "@tailor-platform/sdk" {
|
|
192
|
+
interface Attributes {
|
|
193
|
+
role: string;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
<details>
|
|
199
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
In Tailor SDK v2, the auth attribute type API is renamed from `AttributeMap`
|
|
203
|
+
to `Attributes`; related SDK types are renamed to `UserAttributes` and
|
|
204
|
+
`InferredAttributes`. The codemod rewrites SDK imports, re-exports,
|
|
205
|
+
namespace-qualified references, import() type references, and module
|
|
206
|
+
augmentations. Review any remaining matches manually and leave unrelated
|
|
207
|
+
local names or deploy/proto wire field names unchanged.
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
## tailor-sdk apply → tailor-sdk deploy
|
|
213
|
+
|
|
214
|
+
**Migration:** Automatic
|
|
215
|
+
|
|
216
|
+
Rewrite `tailor-sdk apply` invocations in package.json scripts, shell scripts, CI configs, and docs to the canonical v2 `tailor-sdk deploy` command
|
|
217
|
+
|
|
218
|
+
Before:
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
tailor-sdk apply --profile prod
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
After:
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
tailor-sdk deploy --profile prod
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## v2 CLI rename
|
|
231
|
+
|
|
232
|
+
**Migration:** Partially automatic
|
|
233
|
+
|
|
234
|
+
Rewrite `tailor-sdk crash-report` to `tailor-sdk crashreport` and `--machineuser` to `--machine-user` across package.json scripts, shell scripts, CI configs, and docs
|
|
235
|
+
|
|
236
|
+
Before:
|
|
237
|
+
|
|
238
|
+
```sh
|
|
239
|
+
tailor-sdk crash-report list
|
|
240
|
+
tailor-sdk login --machineuser
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
After:
|
|
244
|
+
|
|
245
|
+
```sh
|
|
246
|
+
tailor-sdk crashreport list
|
|
247
|
+
tailor-sdk login --machine-user
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
<details>
|
|
251
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
252
|
+
|
|
253
|
+
```text
|
|
254
|
+
Apply the v2 CLI renames the codemod did not reach (only `tailor-sdk`-prefixed
|
|
255
|
+
invocations are rewritten): `tailor-sdk crash-report` -> `tailor-sdk crashreport`
|
|
256
|
+
and the `--machineuser` option -> `--machine-user`. Leave unrelated commands that
|
|
257
|
+
happen to use `--machineuser` alone.
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
</details>
|
|
261
|
+
|
|
262
|
+
## SDK environment variable rename
|
|
263
|
+
|
|
264
|
+
**Migration:** Partially automatic
|
|
265
|
+
|
|
266
|
+
Rewrite unambiguous removed SDK environment variable names to their v2 `TAILOR_*` names and flag generic names for manual review
|
|
267
|
+
|
|
268
|
+
Before:
|
|
269
|
+
|
|
270
|
+
```sh
|
|
271
|
+
TAILOR_PLATFORM_SDK_BUILD_ONLY=true tailor-sdk deploy
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
After:
|
|
275
|
+
|
|
276
|
+
```sh
|
|
277
|
+
TAILOR_DEPLOY_BUILD_ONLY=true tailor-sdk deploy
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Before:
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
const token = process.env.TAILOR_TOKEN;
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
After:
|
|
287
|
+
|
|
288
|
+
```ts
|
|
289
|
+
const token = process.env.TAILOR_PLATFORM_TOKEN;
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
<details>
|
|
293
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
294
|
+
|
|
295
|
+
```text
|
|
296
|
+
Review any remaining removed SDK environment variable names after the codemod
|
|
297
|
+
runs. The codemod intentionally leaves generic names such as `LOG_LEVEL`,
|
|
298
|
+
`PLATFORM_URL`, and `PLATFORM_OAUTH2_CLIENT_ID` for manual review because
|
|
299
|
+
they can configure non-SDK tools. Replace only actual SDK usages with their
|
|
300
|
+
v2 names. If a remaining match is an unrelated local identifier, fixture
|
|
301
|
+
label, or historical documentation that intentionally does not configure the
|
|
302
|
+
SDK, leave it unchanged.
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
</details>
|
|
306
|
+
|
|
307
|
+
## auth.invoker("name") → "name"
|
|
308
|
+
|
|
309
|
+
**Migration:** Partially automatic
|
|
310
|
+
|
|
311
|
+
Replace statically identified SDK `auth.invoker("name")` option values with the bare `"name"` string while preserving the `authInvoker` key for SDK versions before the option rename.
|
|
312
|
+
|
|
313
|
+
Before:
|
|
314
|
+
|
|
315
|
+
```ts
|
|
316
|
+
createResolver({ authInvoker: auth.invoker("manager") });
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
After:
|
|
320
|
+
|
|
321
|
+
```ts
|
|
322
|
+
createResolver({ authInvoker: "manager" });
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
<details>
|
|
326
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
327
|
+
|
|
328
|
+
```text
|
|
329
|
+
In Tailor SDK v2 the auth.invoker() helper is removed; an invoker is now the
|
|
330
|
+
machine user name passed directly as a string. The codemod already rewrote the
|
|
331
|
+
statically identified SDK option form authInvoker: auth.invoker("name") to authInvoker: "name". These files still contain
|
|
332
|
+
auth.invoker(...) calls that need manual review.
|
|
333
|
+
|
|
334
|
+
For each remaining auth.invoker(<expr>) call:
|
|
335
|
+
1. Replace the whole call with <expr> only where the target option expects a
|
|
336
|
+
machine user name string; platform/runtime authInvoker payloads still expect
|
|
337
|
+
the object form.
|
|
338
|
+
2. Keep the authInvoker key when targeting SDK versions before the invoker
|
|
339
|
+
option rename; later v2 targets run a separate codemod for that key rename.
|
|
340
|
+
3. After removing every auth.invoker usage in a file, delete the now-unused auth
|
|
341
|
+
import (keeping it pulls Node-only config modules into runtime bundles); leave
|
|
342
|
+
the import if auth is still referenced elsewhere.
|
|
343
|
+
|
|
344
|
+
Do not change behavior beyond the auth.invoker() removal.
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
</details>
|
|
348
|
+
|
|
349
|
+
## auth.invoker("name") → invoker: "name"
|
|
350
|
+
|
|
351
|
+
**Migration:** Partially automatic
|
|
352
|
+
|
|
353
|
+
Rename statically identified SDK `authInvoker` options to `invoker`, replace `auth.invoker("name")` there with the bare `"name"` string, and drop the `auth` import when no other reference remains. Ambiguous workflow `.start()` calls are left for manual review. The `auth.invoker()` helper is removed in v2 because importing `auth` from `tailor.config.ts` into runtime files pulls Node-only modules into the bundle.
|
|
354
|
+
|
|
355
|
+
Before:
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
createResolver({ invoker: auth.invoker("manager") });
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
After:
|
|
362
|
+
|
|
363
|
+
```ts
|
|
364
|
+
createResolver({ invoker: "manager" });
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
<details>
|
|
368
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
369
|
+
|
|
370
|
+
```text
|
|
371
|
+
In Tailor SDK v2 the auth.invoker() helper is removed; an invoker is now the
|
|
372
|
+
machine user name passed directly as a string. The codemod already rewrote the
|
|
373
|
+
statically identified SDK option form authInvoker: auth.invoker("name") to invoker: "name" and renamed supported authInvoker option keys. These files still contain
|
|
374
|
+
auth.invoker(...) calls or authInvoker keys that need manual review.
|
|
375
|
+
|
|
376
|
+
For each remaining auth.invoker(<expr>) call:
|
|
377
|
+
1. Replace the whole call with <expr> only where the target option expects a
|
|
378
|
+
machine user name string; platform/runtime authInvoker payloads still expect
|
|
379
|
+
the object form.
|
|
380
|
+
2. Rename remaining authInvoker option keys to invoker only for SDK resolver,
|
|
381
|
+
executor, workflow.start(), or startWorkflow() options. Keep platform/runtime
|
|
382
|
+
payload keys such as tailor.workflow.startWorkflow(..., { authInvoker: ... }).
|
|
383
|
+
3. After removing every auth.invoker usage in a file, delete the now-unused auth
|
|
384
|
+
import (keeping it pulls Node-only config modules into runtime bundles); leave
|
|
385
|
+
the import if auth is still referenced elsewhere.
|
|
386
|
+
|
|
387
|
+
Do not change behavior beyond the SDK option rename and auth.invoker() removal.
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
</details>
|
|
391
|
+
|
|
392
|
+
## auth.getConnectionToken() → runtime authconnection
|
|
393
|
+
|
|
394
|
+
**Migration:** Partially automatic
|
|
395
|
+
|
|
396
|
+
The deprecated `auth.getConnectionToken()` helper returned by `defineAuth()` is removed in v2. Use `authconnection.getConnectionToken(...)` from `@tailor-platform/sdk/runtime` in resolvers, executors, and workflows instead.
|
|
397
|
+
|
|
398
|
+
Before:
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
import { auth } from "../tailor.config";
|
|
402
|
+
|
|
403
|
+
const token = await auth.getConnectionToken("google");
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
After:
|
|
407
|
+
|
|
408
|
+
```ts
|
|
409
|
+
import { authconnection } from "@tailor-platform/sdk/runtime";
|
|
410
|
+
|
|
411
|
+
const token = await authconnection.getConnectionToken("google");
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
<details>
|
|
415
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
416
|
+
|
|
417
|
+
```text
|
|
418
|
+
In Tailor SDK v2 the auth.getConnectionToken() helper returned by defineAuth()
|
|
419
|
+
is removed. Runtime code should call authconnection.getConnectionToken(...) from
|
|
420
|
+
@tailor-platform/sdk/runtime instead of importing auth from tailor.config.ts.
|
|
421
|
+
|
|
422
|
+
For each getConnectionToken usage where <receiver> is a defineAuth() result
|
|
423
|
+
imported from tailor.config.ts:
|
|
424
|
+
1. Replace <receiver>.getConnectionToken(<expr>) calls with
|
|
425
|
+
authconnection.getConnectionToken(<expr>).
|
|
426
|
+
2. Update non-call references, including <receiver>.getConnectionToken,
|
|
427
|
+
<receiver>["getConnectionToken"], and destructuring from <receiver>, to
|
|
428
|
+
reference authconnection instead.
|
|
429
|
+
3. Add or reuse `import { authconnection } from "@tailor-platform/sdk/runtime"`.
|
|
430
|
+
4. Remove the auth import from tailor.config.ts only when no other auth reference
|
|
431
|
+
remains in the file.
|
|
432
|
+
|
|
433
|
+
Leave usages unchanged when the receiver is already the runtime authconnection
|
|
434
|
+
wrapper or global tailor.authconnection.
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
</details>
|
|
438
|
+
|
|
439
|
+
## Runtime subpath imports use namespace objects
|
|
440
|
+
|
|
441
|
+
**Migration:** Partially automatic
|
|
442
|
+
|
|
443
|
+
Rewrite `@tailor-platform/sdk/runtime/*` namespace-star and flat value imports to self-named namespace imports, and aggregate `file.deleteFile` calls to `file.delete`. `TailorContextAPI` and `TailorWorkflowAPI` now describe SDK wrappers; direct platform globals use `PlatformContextAPI` and `PlatformWorkflowAPI`.
|
|
444
|
+
|
|
445
|
+
Before:
|
|
446
|
+
|
|
447
|
+
```ts
|
|
448
|
+
import * as iconv from "@tailor-platform/sdk/runtime/iconv";
|
|
449
|
+
iconv.convert(value, "UTF-8", "Shift_JIS");
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
After:
|
|
453
|
+
|
|
454
|
+
```ts
|
|
455
|
+
import { iconv } from "@tailor-platform/sdk/runtime/iconv";
|
|
456
|
+
iconv.convert(value, "UTF-8", "Shift_JIS");
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
Before:
|
|
460
|
+
|
|
461
|
+
```ts
|
|
462
|
+
import { get } from "@tailor-platform/sdk/runtime/aigateway";
|
|
463
|
+
const gateway = await get("main");
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
After:
|
|
467
|
+
|
|
468
|
+
```ts
|
|
469
|
+
import { aigateway } from "@tailor-platform/sdk/runtime/aigateway";
|
|
470
|
+
const gateway = await aigateway.get("main");
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
Before:
|
|
474
|
+
|
|
475
|
+
```ts
|
|
476
|
+
import { file } from "@tailor-platform/sdk/runtime";
|
|
477
|
+
await file.deleteFile("ns", "Doc", "blob", "record-id");
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
After:
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
import { file } from "@tailor-platform/sdk/runtime";
|
|
484
|
+
await file.delete("ns", "Doc", "blob", "record-id");
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
<details>
|
|
488
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
489
|
+
|
|
490
|
+
```text
|
|
491
|
+
In Tailor SDK v2, runtime subpath modules export only a self-named namespace
|
|
492
|
+
object (for example, `iconv` from `@tailor-platform/sdk/runtime/iconv`).
|
|
493
|
+
Default and flat value imports such as
|
|
494
|
+
`import { get } from "@tailor-platform/sdk/runtime/aigateway"` are removed.
|
|
495
|
+
The codemod rewrites straightforward namespace-star imports and flat named value
|
|
496
|
+
imports. It also rewrites direct `file.deleteFile` calls on the aggregate runtime
|
|
497
|
+
namespace to `file.delete`. Destructured aggregate `deleteFile` references require
|
|
498
|
+
manual migration. Review any remaining runtime imports manually, especially when
|
|
499
|
+
a local binding or nested scope shadows an imported value, or when
|
|
500
|
+
type-position namespace member references need explicit top-level type imports.
|
|
501
|
+
For direct platform globals, replace `TailorContextAPI` and `TailorWorkflowAPI`
|
|
502
|
+
type references with `PlatformContextAPI` and `PlatformWorkflowAPI` respectively.
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
</details>
|
|
506
|
+
|
|
507
|
+
## Tailordb → tailordb (lowercase ambient namespace)
|
|
508
|
+
|
|
509
|
+
**Migration:** Partially automatic
|
|
510
|
+
|
|
511
|
+
Rewrite references to the removed capital-cased `Tailordb` ambient namespace (`Tailordb.QueryResult`, `Tailordb.CommandType`, `Tailordb.Client`, `typeof Tailordb.Client`) to the lowercase `tailordb.*` namespace exposed by `@tailor-platform/sdk/runtime/globals`. Because v2 no longer activates ambient declarations automatically, each file that contains `tailordb.*` references after the rewrite must also add `import "@tailor-platform/sdk/runtime/globals"`.
|
|
512
|
+
|
|
513
|
+
Before:
|
|
514
|
+
|
|
515
|
+
```ts
|
|
516
|
+
const command: Tailordb.CommandType = "SELECT";
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
After:
|
|
520
|
+
|
|
521
|
+
```ts
|
|
522
|
+
import "@tailor-platform/sdk/runtime/globals";
|
|
523
|
+
const command: tailordb.CommandType = "SELECT";
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
<details>
|
|
527
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
528
|
+
|
|
529
|
+
```text
|
|
530
|
+
The capital-cased Tailordb ambient namespace is removed in v2; use the lowercase
|
|
531
|
+
tailordb.* namespace from @tailor-platform/sdk/runtime/globals. The codemod rewrites
|
|
532
|
+
the known members (QueryResult, CommandType, Client). Rewrite any other remaining
|
|
533
|
+
Tailordb.* reference to its tailordb.* equivalent (and confirm the member still
|
|
534
|
+
exists on the lowercase namespace).
|
|
535
|
+
Also add `import "@tailor-platform/sdk/runtime/globals"` at the top of each file
|
|
536
|
+
that contains any tailordb.* type reference — v2 no longer activates ambient
|
|
537
|
+
declarations automatically on SDK import.
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
</details>
|
|
541
|
+
|
|
542
|
+
## db.type() → db.table()
|
|
543
|
+
|
|
544
|
+
**Migration:** Partially automatic
|
|
545
|
+
|
|
546
|
+
Rename TailorDB schema builder calls from `db.type()` to `db.table()`. TailorDB schema definitions now use table terminology in SDK projects.
|
|
547
|
+
|
|
548
|
+
Before:
|
|
549
|
+
|
|
550
|
+
```ts
|
|
551
|
+
import { db } from "@tailor-platform/sdk";
|
|
552
|
+
|
|
553
|
+
export const user = db.type("User", {
|
|
554
|
+
name: db.string(),
|
|
555
|
+
});
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
After:
|
|
559
|
+
|
|
560
|
+
```ts
|
|
561
|
+
import { db } from "@tailor-platform/sdk";
|
|
562
|
+
|
|
563
|
+
export const user = db.table("User", {
|
|
564
|
+
name: db.string(),
|
|
565
|
+
});
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
<details>
|
|
569
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
570
|
+
|
|
571
|
+
```text
|
|
572
|
+
In Tailor SDK v2, TailorDB schema definitions use db.table(...) instead of
|
|
573
|
+
db.type(...). The codemod rewrites member accesses on db imported from
|
|
574
|
+
@tailor-platform/sdk, including aliases such as `import { db as schema }`.
|
|
575
|
+
It flags destructured builder aliases such as `const { type } = db` and
|
|
576
|
+
local builder aliases such as `const schema = db`, `schema = db`, or
|
|
577
|
+
`function make(schema = db) { ... }` for manual review because the local
|
|
578
|
+
alias may require call-site renaming.
|
|
579
|
+
Review any remaining db.type references and rename SDK TailorDB schema builder
|
|
580
|
+
calls to db.table. Leave unrelated local objects with a .type() method unchanged.
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
</details>
|
|
584
|
+
|
|
585
|
+
## TailorDB forward relation names derive from field names
|
|
586
|
+
|
|
587
|
+
**Migration:** Partially automatic
|
|
588
|
+
|
|
589
|
+
Review TailorDB relations that omit `toward.as`. Their forward GraphQL field names now derive from the relation field name with a trailing `ID`, `Id`, or `id` removed, instead of from the target table name.
|
|
590
|
+
|
|
591
|
+
Preserve the v1 GraphQL field name by making it explicit:
|
|
592
|
+
|
|
593
|
+
Before:
|
|
594
|
+
|
|
595
|
+
```ts
|
|
596
|
+
ownerId: db.uuid().relation({
|
|
597
|
+
type: "n-1",
|
|
598
|
+
toward: { type: user },
|
|
599
|
+
}),
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
After:
|
|
603
|
+
|
|
604
|
+
```ts
|
|
605
|
+
ownerId: db.uuid().relation({
|
|
606
|
+
type: "n-1",
|
|
607
|
+
toward: { type: user, as: "user" },
|
|
608
|
+
}),
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
<details>
|
|
612
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
613
|
+
|
|
614
|
+
```text
|
|
615
|
+
Tailor SDK v2 derives a default forward GraphQL relation name from the source
|
|
616
|
+
field name by removing a trailing ID, Id, or id. V1 derived it from the target
|
|
617
|
+
table name. Review each reported non-self relation that omits toward.as.
|
|
618
|
+
|
|
619
|
+
If consumers must keep using the v1 GraphQL field name, inspect the v1 schema and
|
|
620
|
+
copy that exact field name into toward.as. Otherwise, update GraphQL operations
|
|
621
|
+
and consumer code to use the new field-based name. No change is needed when the old
|
|
622
|
+
and new names are identical. Relations with a guaranteed non-empty toward.as,
|
|
623
|
+
self-relations, and keyOnly relations are unchanged. For an empty or dynamic
|
|
624
|
+
toward.as, determine whether its runtime value can be falsy; if so, treat the
|
|
625
|
+
relation as using the default name.
|
|
626
|
+
|
|
627
|
+
A relation field without a trailing ID, Id, or id would default to its own scalar
|
|
628
|
+
field name and therefore conflict. Give that relation an explicit toward.as.
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
</details>
|
|
632
|
+
|
|
633
|
+
## executeScript arg JSON.stringify → value
|
|
634
|
+
|
|
635
|
+
**Migration:** Partially automatic
|
|
636
|
+
|
|
637
|
+
Unwrap `JSON.stringify(...)` passed as the `executeScript` `arg` option. In v2 `arg` takes a JSON-serializable value and is serialized internally, so a pre-stringified argument double-encodes.
|
|
638
|
+
|
|
639
|
+
Before:
|
|
640
|
+
|
|
641
|
+
```ts
|
|
642
|
+
await executeScript({ ...opts, arg: JSON.stringify({ a: 1 }) });
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
After:
|
|
646
|
+
|
|
647
|
+
```ts
|
|
648
|
+
await executeScript({ ...opts, arg: { a: 1 } });
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
<details>
|
|
652
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
653
|
+
|
|
654
|
+
```text
|
|
655
|
+
In Tailor SDK v2 the executeScript() arg option takes a JSON-serializable value
|
|
656
|
+
and is serialized internally, so a pre-stringified argument double-encodes. The
|
|
657
|
+
codemod already rewrote the direct form arg: JSON.stringify(X) to arg: X. Review
|
|
658
|
+
the executeScript calls in these files for cases it could not rewrite — where the
|
|
659
|
+
arg value is reached indirectly, for example:
|
|
660
|
+
- a variable holding a JSON.stringify(...) result (const s = JSON.stringify(x); ... arg: s)
|
|
661
|
+
- JSON.stringify(x, null, 2) or another multi-argument form
|
|
662
|
+
- an options object built or spread dynamically
|
|
663
|
+
|
|
664
|
+
For each such call, pass the underlying value directly as arg (drop the
|
|
665
|
+
JSON.stringify wrapper) so executeScript serializes it once. Leave calls that
|
|
666
|
+
already pass a plain value unchanged.
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
</details>
|
|
670
|
+
|
|
671
|
+
## defineWaitPoint/defineWaitPoints → createWaitPoint/createWaitPoints
|
|
672
|
+
|
|
673
|
+
**Migration:** Partially automatic
|
|
674
|
+
|
|
675
|
+
Rename `defineWaitPoint` and `defineWaitPoints` to `createWaitPoint` and `createWaitPoints`. The functions create runtime instances with `.wait()` / `.resolve()` methods, so the `create*` prefix is used consistently.
|
|
676
|
+
|
|
677
|
+
Before:
|
|
678
|
+
|
|
679
|
+
```ts
|
|
680
|
+
import { defineWaitPoints } from "@tailor-platform/sdk";
|
|
681
|
+
|
|
682
|
+
export const { approval } = defineWaitPoints((define) => ({
|
|
683
|
+
approval: define<{ message: string }, { approved: boolean }>(),
|
|
684
|
+
}));
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
After:
|
|
688
|
+
|
|
689
|
+
```ts
|
|
690
|
+
import { createWaitPoints } from "@tailor-platform/sdk";
|
|
691
|
+
|
|
692
|
+
export const { approval } = createWaitPoints((define) => ({
|
|
693
|
+
approval: define<{ message: string }, { approved: boolean }>(),
|
|
694
|
+
}));
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
## workflow.triggerWorkflow/triggerJobFunction/resumeWorkflow → startWorkflow/startJobFunction/resumeWorkflowExecution
|
|
698
|
+
|
|
699
|
+
**Migration:** Partially automatic
|
|
700
|
+
|
|
701
|
+
Rename tailor.workflow call sites from the pre-alignment triggerWorkflow/triggerJobFunction/resumeWorkflow names to the canonical startWorkflow/startJobFunction/resumeWorkflowExecution names, on both the ambient tailor.workflow global and a workflow value imported from @tailor-platform/sdk/runtime(/workflow). For a renamed triggerWorkflow call, also renames a literal `invoker` option key to `authInvoker` — startWorkflow's options expect the platform shape directly, unlike the removed triggerWorkflow wrapper, which converted invoker to authInvoker internally.
|
|
702
|
+
|
|
703
|
+
Before:
|
|
704
|
+
|
|
705
|
+
```ts
|
|
706
|
+
import { workflow } from "@tailor-platform/sdk/runtime";
|
|
707
|
+
|
|
708
|
+
await workflow.triggerWorkflow("myWorkflow", { data: "value" });
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
After:
|
|
712
|
+
|
|
713
|
+
```ts
|
|
714
|
+
import { workflow } from "@tailor-platform/sdk/runtime";
|
|
715
|
+
|
|
716
|
+
await workflow.startWorkflow("myWorkflow", { data: "value" });
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
A literal invoker option is renamed to authInvoker:
|
|
720
|
+
|
|
721
|
+
Before:
|
|
722
|
+
|
|
723
|
+
```ts
|
|
724
|
+
await workflow.triggerWorkflow("myWorkflow", { data: "value" }, { invoker: myInvoker });
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
After:
|
|
728
|
+
|
|
729
|
+
```ts
|
|
730
|
+
await workflow.startWorkflow("myWorkflow", { data: "value" }, { authInvoker: myInvoker });
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
<details>
|
|
734
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
735
|
+
|
|
736
|
+
```text
|
|
737
|
+
The pre-alignment tailor.workflow names triggerWorkflow, triggerJobFunction, and
|
|
738
|
+
resumeWorkflow are removed from the SDK's type surface in v2; use the canonical
|
|
739
|
+
startWorkflow, startJobFunction, and resumeWorkflowExecution names instead. The
|
|
740
|
+
codemod rewrites direct member-access call sites on the ambient tailor.workflow
|
|
741
|
+
global and on a workflow value imported from @tailor-platform/sdk/runtime or
|
|
742
|
+
@tailor-platform/sdk/runtime/workflow (including aliased imports). It skips a
|
|
743
|
+
file entirely when a local declaration shadows the workflow import or the
|
|
744
|
+
ambient tailor name, to avoid rewriting an unrelated same-named value — review
|
|
745
|
+
those manually.
|
|
746
|
+
|
|
747
|
+
For a renamed triggerWorkflow call, the codemod also renames a literal invoker
|
|
748
|
+
option key (including shorthand { invoker }) to authInvoker, since startWorkflow
|
|
749
|
+
expects the platform's authInvoker shape directly while triggerWorkflow's removed
|
|
750
|
+
wrapper converted invoker to authInvoker internally.
|
|
751
|
+
|
|
752
|
+
Also review, and migrate by hand:
|
|
753
|
+
- Destructured references (e.g. const { triggerWorkflow } = workflow) — the
|
|
754
|
+
codemod only rewrites direct member-access calls.
|
|
755
|
+
- Imported TriggerWorkflowOptions / TriggerJobFunctionOptions types — rename
|
|
756
|
+
them to StartWorkflowOptions / StartJobFunctionOptions.
|
|
757
|
+
- An invoker option passed via a variable or spread (not a literal object) —
|
|
758
|
+
the codemod only inspects literal object arguments; rename the invoker key
|
|
759
|
+
to authInvoker in the options object's own definition.
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
</details>
|
|
763
|
+
|
|
764
|
+
## openDownloadStream → downloadStream
|
|
765
|
+
|
|
766
|
+
**Migration:** Manual
|
|
767
|
+
|
|
768
|
+
The deprecated `openDownloadStream` file-streaming API is removed in v2. Use `downloadStream` for streamed file downloads. The generated file utilities now emit `downloadFileStream` (which calls `downloadStream` and returns `FileDownloadStreamResponse`) instead of the removed `openFileDownloadStream` helper.
|
|
769
|
+
|
|
770
|
+
Before:
|
|
771
|
+
|
|
772
|
+
```ts
|
|
773
|
+
const res = await openDownloadStream(namespace, typeName, fieldName, recordId);
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
After:
|
|
777
|
+
|
|
778
|
+
```ts
|
|
779
|
+
const res = await downloadStream(namespace, typeName, fieldName, recordId);
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
<details>
|
|
783
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
784
|
+
|
|
785
|
+
```text
|
|
786
|
+
The openDownloadStream file-streaming API is removed in v2. Replace every call to
|
|
787
|
+
openDownloadStream with downloadStream (same arguments). If you used the generated
|
|
788
|
+
openFileDownloadStream helper, switch to downloadFileStream, which calls
|
|
789
|
+
downloadStream and returns FileDownloadStreamResponse.
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
</details>
|
|
793
|
+
|
|
794
|
+
## Ambient runtime globals are opt-in
|
|
795
|
+
|
|
796
|
+
**Migration:** Partially automatic
|
|
797
|
+
|
|
798
|
+
Importing `@tailor-platform/sdk` no longer activates the ambient `tailor.*` / `tailordb.*` global declarations. The codemod rewrites simple direct `new tailor.idp.Client(...)` calls to the typed `idp.Client` wrapper from `@tailor-platform/sdk/runtime`; broader runtime global usage remains review-only. Only if you relied on the ambient globals directly, add `import "@tailor-platform/sdk/runtime/globals"`. (The capital-cased `Tailordb.*` namespace is removed separately — see the `Tailordb → tailordb` codemod.)
|
|
799
|
+
|
|
800
|
+
Preferred: switch to the typed wrappers from `@tailor-platform/sdk/runtime` and drop the ambient globals:
|
|
801
|
+
|
|
802
|
+
Before:
|
|
803
|
+
|
|
804
|
+
```ts
|
|
805
|
+
const client = new tailor.idp.Client();
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
After:
|
|
809
|
+
|
|
810
|
+
```ts
|
|
811
|
+
import { idp } from "@tailor-platform/sdk/runtime";
|
|
812
|
+
const client = new idp.Client({ namespace: "my-namespace" });
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
Fallback: only if you must keep referencing the bare `tailor.*` names, opt into the global declarations:
|
|
816
|
+
|
|
817
|
+
Before:
|
|
818
|
+
|
|
819
|
+
```ts
|
|
820
|
+
const client = new tailor.idp.Client();
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
After:
|
|
824
|
+
|
|
825
|
+
```ts
|
|
826
|
+
import "@tailor-platform/sdk/runtime/globals";
|
|
827
|
+
const client = new tailor.idp.Client();
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
<details>
|
|
831
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
832
|
+
|
|
833
|
+
```text
|
|
834
|
+
The v2 SDK no longer enables ambient Tailor runtime globals from
|
|
835
|
+
`@tailor-platform/sdk`. For each flagged file that uses `tailor.*`,
|
|
836
|
+
`tailordb.*`, or Tailor runtime error globals, prefer migrating to the
|
|
837
|
+
typed wrappers from `@tailor-platform/sdk/runtime`. The codemod already
|
|
838
|
+
rewrites direct `new tailor.idp.Client(...)` calls to `new idp.Client(...)`
|
|
839
|
+
when the file has no conflicting `tailor` or `idp` binding. For any remaining
|
|
840
|
+
`tailor.idp.Client` references, either resolve the binding collision and use
|
|
841
|
+
`idp.Client`, or keep the ambient global deliberately.
|
|
842
|
+
|
|
843
|
+
Only when the file must keep referencing the bare `tailor.*` names directly,
|
|
844
|
+
opt into the global declarations instead by adding one of these:
|
|
845
|
+
- per-file: `import "@tailor-platform/sdk/runtime/globals";`
|
|
846
|
+
- project-wide: `"types": ["@tailor-platform/sdk/runtime/globals"]` in
|
|
847
|
+
the relevant tsconfig compilerOptions
|
|
848
|
+
|
|
849
|
+
Leave files unchanged when the matching name is local, imported from another
|
|
850
|
+
module, or appears only in comments or prose strings. Embedded code strings
|
|
851
|
+
that use runtime globals are review-only findings; do not insert imports inside
|
|
852
|
+
string literals.
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
</details>
|
|
856
|
+
|
|
857
|
+
## Workflow job start() and start tests
|
|
858
|
+
|
|
859
|
+
**Migration:** Manual
|
|
860
|
+
|
|
861
|
+
Workflow job `.start()` (previously `.trigger()`) now aligns with the platform runtime: it returns the job result directly instead of a Promise wrapper, and tests no longer run job bodies locally. Mock start responses with `mockWorkflow()` (`setJobHandler` / `enqueueResult`, assert via `startedJobs`), or use `runWorkflowLocally()` for a full-chain local run.
|
|
862
|
+
|
|
863
|
+
Tests must mock the workflow runtime instead of running bodies locally:
|
|
864
|
+
|
|
865
|
+
Before:
|
|
866
|
+
|
|
867
|
+
```ts
|
|
868
|
+
const result = await orderJob.start({ id });
|
|
869
|
+
expect(result.status).toBe("done");
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
After:
|
|
873
|
+
|
|
874
|
+
```ts
|
|
875
|
+
using wf = mockWorkflow();
|
|
876
|
+
wf.setJobHandler((jobName) => (jobName === "order-job" ? { status: "done" } : null));
|
|
877
|
+
const result = await orderJob.start({ id });
|
|
878
|
+
expect(result.status).toBe("done");
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
<details>
|
|
882
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
883
|
+
|
|
884
|
+
```text
|
|
885
|
+
Workflow job .start() now uses the platform workflow runtime instead of running
|
|
886
|
+
the job body locally. In tests, acquire `using wf = mockWorkflow()` and provide
|
|
887
|
+
start responses (setJobHandler / enqueueResult), or use runWorkflowLocally() for a
|
|
888
|
+
full-chain local run; an unmocked start now throws. Outside tests, treat the
|
|
889
|
+
start result as the job output directly (no Promise wrapper to unwrap).
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
</details>
|
|
893
|
+
|
|
894
|
+
## Workflow.trigger()/WorkflowJob.trigger() → .start()
|
|
895
|
+
|
|
896
|
+
**Migration:** Manual
|
|
897
|
+
|
|
898
|
+
Rename `Workflow.trigger()` (returned by `createWorkflow()`) and `WorkflowJob.trigger()` (returned by `createWorkflowJob()`) to `.start()`, aligning the SDK's ergonomic verb with the platform's `start*` RPC vocabulary. No codemod ships for this rename: distinguishing a workflow/job `.trigger()` call from an unrelated object's own `.trigger()` method requires resolving the receiver back to a `createWorkflow`/`createWorkflowJob` result across files, which the SDK's own CLI bundler already does for build-time rewriting. Reusing that logic in a standalone script is a nontrivial lift, and — unlike the bundler, which fails loudly when it cannot rewrite a call — a codemod false positive would silently rewrite an unrelated `.trigger()` call with no error. For the call-site volume this rename typically involves, manual review guided by the prompt below is the safer trade-off.
|
|
899
|
+
|
|
900
|
+
Before:
|
|
901
|
+
|
|
902
|
+
```ts
|
|
903
|
+
const inventory = checkInventory.trigger({ orderId: input.orderId });
|
|
904
|
+
const workflowRunId = await orderProcessingWorkflow.trigger(args, { invoker: "manager" });
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
After:
|
|
908
|
+
|
|
909
|
+
```ts
|
|
910
|
+
const inventory = checkInventory.start({ orderId: input.orderId });
|
|
911
|
+
const workflowRunId = await orderProcessingWorkflow.start(args, { invoker: "manager" });
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
<details>
|
|
915
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
916
|
+
|
|
917
|
+
```text
|
|
918
|
+
In Tailor SDK v2, the ergonomic .trigger() method on a createWorkflow() or
|
|
919
|
+
createWorkflowJob() result is renamed to .start(). This is unrelated to the
|
|
920
|
+
separate tailor.workflow.triggerWorkflow/triggerJobFunction/resumeWorkflow removal
|
|
921
|
+
(see the workflow-trigger-rename codemod) — this rename targets the SDK's own
|
|
922
|
+
ergonomic wrapper, not the low-level platform call.
|
|
923
|
+
|
|
924
|
+
For each flagged `.trigger(` call in these files:
|
|
925
|
+
1. Confirm the receiver is a workflow or job object — typically a local const
|
|
926
|
+
assigned from createWorkflow(...)/createWorkflowJob(...), a named import of one,
|
|
927
|
+
or the default import of a workflow module. Skip receivers that are unrelated
|
|
928
|
+
objects with their own .trigger() method (state machines, event emitters, etc.).
|
|
929
|
+
2. Rename the call from .trigger(...) to .start(...); the argument list is unchanged.
|
|
930
|
+
3. Update any mock/test code that reads WorkflowJob['trigger'] / Workflow['trigger']
|
|
931
|
+
as a type, or that mocks the ergonomic method via a wrapper — for example,
|
|
932
|
+
`wf.job(definition)` / `wf.workflow(definition)` from mockWorkflow() now return a
|
|
933
|
+
mock of the `.start` method.
|
|
934
|
+
4. Update prose/docs/comments that say "trigger the workflow/job" to "start" only
|
|
935
|
+
where they describe this SDK verb specifically, not unrelated event terminology.
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
</details>
|
|
939
|
+
|
|
940
|
+
## tailor-sdk binary → tailor
|
|
941
|
+
|
|
942
|
+
**Migration:** Partially automatic
|
|
943
|
+
|
|
944
|
+
Rename the CLI binary from `tailor-sdk` to `tailor` in package.json scripts, shell scripts, CI workflows, source files, generated declaration comments, and documentation. Does not rename `.tailor-sdk` directory paths or the `create-tailor-sdk` scaffolding package. Note: v2 also changes the default generated output directory from `.tailor-sdk/` to `.tailor/` and the setup lock file from `.github/tailor-sdk.lock` to `.github/tailor.lock`. Run `mv .tailor-sdk .tailor` to migrate the generated output directory (preserves auth connection state and other local files). Run `git mv .github/tailor-sdk.lock .github/tailor.lock` if the old lock file exists; without it `tailor setup check` will treat all managed workflows as missing. Exact ignore-file entries for `.tailor-sdk/` are handled by the generated-output ignore codemod. If your CI workflows were generated by `tailor setup`, re-run `tailor setup` afterwards so they pin tailor-platform/actions v2 — the v1 actions invoke the removed `tailor-sdk` bin.
|
|
945
|
+
|
|
946
|
+
Before:
|
|
947
|
+
|
|
948
|
+
```sh
|
|
949
|
+
tailor-sdk deploy
|
|
950
|
+
npx tailor-sdk@latest login
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
After:
|
|
954
|
+
|
|
955
|
+
```sh
|
|
956
|
+
tailor deploy
|
|
957
|
+
npx @tailor-platform/sdk@latest login
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
<details>
|
|
961
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
962
|
+
|
|
963
|
+
```text
|
|
964
|
+
Rename any remaining `tailor-sdk` binary invocations to `tailor`. Only rewrite
|
|
965
|
+
the binary name — leave `.tailor-sdk` directory paths and `create-tailor-sdk`
|
|
966
|
+
package references unchanged.
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
</details>
|
|
970
|
+
|
|
971
|
+
## .tailor-sdk ignore entries → .tailor
|
|
972
|
+
|
|
973
|
+
**Migration:** Automatic
|
|
974
|
+
|
|
975
|
+
Rewrite exact ignore-file entries for the v1 generated output directory from `.tailor-sdk` to the v2 `.tailor` directory. Other `.tailor-sdk` paths and prose are left unchanged.
|
|
976
|
+
|
|
977
|
+
Before:
|
|
978
|
+
|
|
979
|
+
```gitignore
|
|
980
|
+
.tailor-sdk/
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
After:
|
|
984
|
+
|
|
985
|
+
```gitignore
|
|
986
|
+
.tailor/
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
## ValidateFn simplification and type-level validate
|
|
990
|
+
|
|
991
|
+
**Migration:** Manual
|
|
992
|
+
|
|
993
|
+
Field-level `ValidateFn` is simplified from `(args: { value, data, invoker }) => boolean` to `(args: { value }) => string | void` — the function now returns the error message directly instead of a separate `[fn, message]` tuple. The `ValidateConfig` tuple form and `Validators<F>` record syntax on `db.type().validate()` are removed. Type-level validation uses `db.type().validate((args, issues) => void)` with `{ newRecord, oldRecord, invoker }` args and an `issues(field, message)` callback for cross-field rules.
|
|
994
|
+
|
|
995
|
+
Field-level validate: return an error message string instead of a boolean (tuple form removed):
|
|
996
|
+
|
|
997
|
+
Before:
|
|
998
|
+
|
|
999
|
+
```ts
|
|
1000
|
+
.validate(
|
|
1001
|
+
[({ value }) => value.length > 5, "Name must be longer than 5 characters"],
|
|
1002
|
+
)
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
After:
|
|
1006
|
+
|
|
1007
|
+
```ts
|
|
1008
|
+
.validate(({ value }) =>
|
|
1009
|
+
value.length <= 5 ? "Name must be longer than 5 characters" : undefined,
|
|
1010
|
+
)
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
Type-level validate: per-field record syntax replaced by a single function with `issues()` callback:
|
|
1014
|
+
|
|
1015
|
+
Before:
|
|
1016
|
+
|
|
1017
|
+
```ts
|
|
1018
|
+
.validate({
|
|
1019
|
+
name: [({ value }) => value.length > 5, "Name must be longer than 5"],
|
|
1020
|
+
})
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
After:
|
|
1024
|
+
|
|
1025
|
+
```ts
|
|
1026
|
+
.validate(({ newRecord }, issues) => {
|
|
1027
|
+
if (newRecord.name && newRecord.name.length <= 5) {
|
|
1028
|
+
issues("name", "Name must be longer than 5");
|
|
1029
|
+
}
|
|
1030
|
+
})
|
|
1031
|
+
```
|
|
1032
|
+
|
|
1033
|
+
<details>
|
|
1034
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
1035
|
+
|
|
1036
|
+
```text
|
|
1037
|
+
The v2 SDK simplifies field validation and introduces type-level validation.
|
|
1038
|
+
|
|
1039
|
+
Field-level `.validate()` changes:
|
|
1040
|
+
- Signature: `(args: { value, data, invoker }) => boolean` → `(args: { value }) => string | void`
|
|
1041
|
+
- The function now returns the error message string directly (or undefined/void to pass)
|
|
1042
|
+
instead of returning a boolean with the message in a separate tuple.
|
|
1043
|
+
- The `[fn, errorMessage]` tuple form (`ValidateConfig`) is removed.
|
|
1044
|
+
- `data` and `invoker` are no longer available in field-level validators.
|
|
1045
|
+
Use type-level `.validate()` for cross-field or invoker-dependent rules.
|
|
1046
|
+
|
|
1047
|
+
Type-level `.validate()` on `db.type()` changes:
|
|
1048
|
+
- Old: `.validate({ fieldName: fn | [fn, msg] | fn[] })` (per-field record, `Validators<F>` type)
|
|
1049
|
+
- New: `.validate((args, issues) => void)` (single function, `TypeValidateFn<F>` type)
|
|
1050
|
+
- Args: `{ newRecord, oldRecord, invoker }` — `newRecord` is the record after hooks run
|
|
1051
|
+
- Call `issues(field, message)` to report validation errors; `field` supports dotted paths
|
|
1052
|
+
- Move per-field validators that need `data`/`invoker` to the type-level function
|
|
1053
|
+
|
|
1054
|
+
For each remaining `ValidateConfig`, `Validators<`, or old-signature `.validate()` usage:
|
|
1055
|
+
1. Rewrite field-level validators to return the error string directly
|
|
1056
|
+
2. Move cross-field / invoker-dependent validators to the type-level function
|
|
1057
|
+
3. Remove unused `ValidateConfig` / `Validators` type imports
|
|
1058
|
+
```
|
|
1059
|
+
|
|
1060
|
+
</details>
|
|
1061
|
+
|
|
1062
|
+
## TailorDB hook redesign: field-level args and type-level hooks
|
|
1063
|
+
|
|
1064
|
+
**Migration:** Manual
|
|
1065
|
+
|
|
1066
|
+
Field-level `HookFn` args change from `{ value, data, invoker }` to create `{ input, invoker, now }` / update `{ input, oldValue, invoker, now }` — `value` is renamed to `input`, matching the `input` arg on type-level hooks (same pre-hook data, narrowed to one field); `data` (the full record) is removed; `oldValue` (previous field value) is added for update hooks only; `now` (operation timestamp) is shared across all hooks. Type-level hooks on `db.type().hooks()` change from per-field mapping `{ fieldName: { create, update } }` (`Hooks<F>`) to a single `{ create, update }` object (`TypeHook<F>`) — create hooks take `{ input, invoker, now }`, update hooks take `{ input, oldRecord, invoker, now }` (oldRecord is always non-null). Both return partial field overrides.
|
|
1067
|
+
|
|
1068
|
+
Field-level hooks: `value` renamed to `input`, `data` replaced by `oldValue` and `now`; use `now` instead of `new Date()`:
|
|
1069
|
+
|
|
1070
|
+
Before:
|
|
1071
|
+
|
|
1072
|
+
```ts
|
|
1073
|
+
db.datetime().hooks({
|
|
1074
|
+
create: ({ value }) => value ?? new Date(),
|
|
1075
|
+
update: () => new Date(),
|
|
1076
|
+
})
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
After:
|
|
1080
|
+
|
|
1081
|
+
```ts
|
|
1082
|
+
db.datetime().hooks({
|
|
1083
|
+
create: ({ input, now }) => input ?? now,
|
|
1084
|
+
update: ({ now }) => now,
|
|
1085
|
+
})
|
|
1086
|
+
```
|
|
1087
|
+
|
|
1088
|
+
Type-level hooks: per-field mapping replaced by single create/update functions:
|
|
1089
|
+
|
|
1090
|
+
Before:
|
|
1091
|
+
|
|
1092
|
+
```ts
|
|
1093
|
+
.hooks({
|
|
1094
|
+
fullAddress: {
|
|
1095
|
+
create: ({ data }) => `${data.postalCode} ${data.address}`,
|
|
1096
|
+
update: ({ data }) => `${data.postalCode} ${data.address}`,
|
|
1097
|
+
},
|
|
1098
|
+
})
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
After:
|
|
1102
|
+
|
|
1103
|
+
```ts
|
|
1104
|
+
.hooks({
|
|
1105
|
+
create: ({ input }) => ({
|
|
1106
|
+
fullAddress: `${input.postalCode} ${input.address}`,
|
|
1107
|
+
}),
|
|
1108
|
+
update: ({ input }) => ({
|
|
1109
|
+
fullAddress: `${input.postalCode} ${input.address}`,
|
|
1110
|
+
}),
|
|
1111
|
+
})
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
<details>
|
|
1115
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
1116
|
+
|
|
1117
|
+
```text
|
|
1118
|
+
The v2 SDK redesigns TailorDB hooks at both field and type levels.
|
|
1119
|
+
|
|
1120
|
+
Field-level `.hooks()` on individual fields:
|
|
1121
|
+
- Create args: `{ value, data, invoker }` → `{ input, invoker, now }` (no `oldValue`)
|
|
1122
|
+
- Update args: `{ value, data, invoker }` → `{ input, oldValue, invoker, now }`
|
|
1123
|
+
- `value` is renamed to `input`, matching the type-level hook's `input` arg — both are
|
|
1124
|
+
the same pre-hook data, at different granularity
|
|
1125
|
+
- `data` (full record) is removed; update hooks get `oldValue` (previous field value) instead
|
|
1126
|
+
- `now` provides the operation timestamp — use `now` instead of `new Date()`
|
|
1127
|
+
- If a field-level hook needs the full record (other fields), move it to a type-level hook
|
|
1128
|
+
|
|
1129
|
+
Type-level `.hooks()` on `db.type()`:
|
|
1130
|
+
- Old: `.hooks({ fieldName: { create: fn, update: fn } })` (per-field mapping, `Hooks<F>` type)
|
|
1131
|
+
- New: `.hooks({ create: fn, update: fn })` (single object, `TypeHook<F>` type)
|
|
1132
|
+
- Each function: `({ input, oldRecord, invoker, now }) => ({ fieldName: value, ... })`
|
|
1133
|
+
- `input` is the pre-hook input (may have nullish values for optional/defaulted fields)
|
|
1134
|
+
- Create hooks do not receive `oldRecord`; update hooks receive `oldRecord` (always non-null)
|
|
1135
|
+
- Return an object with only the fields to override; unmentioned fields are unchanged
|
|
1136
|
+
|
|
1137
|
+
Migration steps for each `.hooks()` call on a `db.type()`:
|
|
1138
|
+
1. If the old per-field hooks only use `value`/`invoker` and don't reference `data`,
|
|
1139
|
+
convert them to field-level hooks with the new args (`value` → `input`, plus `oldValue`, `now`)
|
|
1140
|
+
2. If the old hooks reference `data` (cross-field access), convert to a type-level hook
|
|
1141
|
+
using `input`/`oldRecord`
|
|
1142
|
+
3. Remove unused `Hooks<F>` / `HookFn<>` type imports
|
|
1143
|
+
```
|
|
1144
|
+
|
|
1145
|
+
</details>
|
|
1146
|
+
|
|
1147
|
+
## `db.<namespace>.erdSite` → `tailordbErdPlugin({ sites })`
|
|
1148
|
+
|
|
1149
|
+
**Migration:** Partially automatic
|
|
1150
|
+
|
|
1151
|
+
Move the TailorDB `erdSite` setting from `db.<namespace>` in tailor.config.ts into `tailordbErdPlugin({ sites })` from `@tailor-platform/sdk-plugin-tailordb-erd`, registered via definePlugins(). The core config schema no longer accepts `erdSite`; the `tailor tailordb erd` commands read the target static website from the plugin configuration and validate each site name against `staticWebsites`. Install `@tailor-platform/sdk-plugin-tailordb-erd` as a dev dependency: the migrated config imports it, so config loading fails with a module-not-found error until it is installed.
|
|
1152
|
+
|
|
1153
|
+
Before:
|
|
1154
|
+
|
|
1155
|
+
```ts
|
|
1156
|
+
export default defineConfig({
|
|
1157
|
+
db: {
|
|
1158
|
+
tailordb: {
|
|
1159
|
+
files: ["./tailordb/*.ts"],
|
|
1160
|
+
erdSite: "my-erd-site",
|
|
1161
|
+
},
|
|
1162
|
+
},
|
|
1163
|
+
});
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
After:
|
|
1167
|
+
|
|
1168
|
+
```ts
|
|
1169
|
+
import { tailordbErdPlugin } from "@tailor-platform/sdk-plugin-tailordb-erd";
|
|
1170
|
+
|
|
1171
|
+
export default defineConfig({
|
|
1172
|
+
db: {
|
|
1173
|
+
tailordb: {
|
|
1174
|
+
files: ["./tailordb/*.ts"],
|
|
1175
|
+
},
|
|
1176
|
+
},
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
export const plugins = definePlugins(
|
|
1180
|
+
tailordbErdPlugin({ sites: { tailordb: "my-erd-site" } }),
|
|
1181
|
+
);
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
<details>
|
|
1185
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
1186
|
+
|
|
1187
|
+
```text
|
|
1188
|
+
In Tailor SDK v2 the TailorDB `erdSite` setting is removed from the core config
|
|
1189
|
+
schema; the ERD deploy target is configured on the ERD CLI plugin instead. The
|
|
1190
|
+
codemod rewrites literal `db.<namespace>.erdSite` entries inside top-level
|
|
1191
|
+
defineConfig() calls into a `tailordbErdPlugin({ sites: { <namespace>: <value> } })`
|
|
1192
|
+
argument of definePlugins(), importing it from @tailor-platform/sdk-plugin-tailordb-erd.
|
|
1193
|
+
|
|
1194
|
+
First, for every config that now registers tailordbErdPlugin, make sure
|
|
1195
|
+
@tailor-platform/sdk-plugin-tailordb-erd is installed as a dev dependency — the
|
|
1196
|
+
migrated config imports it, so config loading fails with ERR_MODULE_NOT_FOUND
|
|
1197
|
+
until it is installed.
|
|
1198
|
+
|
|
1199
|
+
For any remaining `erdSite` config keys the codemod did not rewrite — a db config
|
|
1200
|
+
built dynamically or passed via a variable, quoted or computed keys, spread
|
|
1201
|
+
properties, a defineConfig() call inside a factory function, or a file that
|
|
1202
|
+
already registers tailordbErdPlugin — move the namespace → static-website-name
|
|
1203
|
+
mapping into tailordbErdPlugin({ sites }) and delete the `erdSite` key. For
|
|
1204
|
+
factory-built configs, keep any referenced parameters or locals in scope when
|
|
1205
|
+
moving the value to the module-level definePlugins() export. Each site name
|
|
1206
|
+
must match a static website defined in staticWebsites. Leave unrelated
|
|
1207
|
+
identifiers that merely contain the name (e.g. a defineStaticWebSite variable
|
|
1208
|
+
named erdSite) unchanged.
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
</details>
|
|
1212
|
+
|
|
1213
|
+
## generate --watch flag removed
|
|
1214
|
+
|
|
1215
|
+
**Migration:** Manual
|
|
1216
|
+
|
|
1217
|
+
Review and remove `tailor generate --watch` / `-W` invocations and the `watch` option on `GenerateOptions`. The flag, its dependency watcher, and the self-restart-on-change logic are removed; `generate` now always performs a single generation pass.
|
|
1218
|
+
|
|
1219
|
+
The --watch/-W flag no longer exists; re-run generate after each change:
|
|
1220
|
+
|
|
1221
|
+
Before:
|
|
1222
|
+
|
|
1223
|
+
```sh
|
|
1224
|
+
tailor generate --watch
|
|
1225
|
+
```
|
|
1226
|
+
|
|
1227
|
+
After:
|
|
1228
|
+
|
|
1229
|
+
```sh
|
|
1230
|
+
tailor generate
|
|
1231
|
+
```
|
|
1232
|
+
|
|
1233
|
+
<details>
|
|
1234
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
1235
|
+
|
|
1236
|
+
```text
|
|
1237
|
+
Tailor SDK v2 removes the `generate --watch` (`-W`) flag along with the
|
|
1238
|
+
dependency watcher and self-restart logic that powered it. `tailor generate`
|
|
1239
|
+
now always runs a single generation pass and exits.
|
|
1240
|
+
|
|
1241
|
+
For each flagged `tailor generate ... --watch` / `-W` invocation (package.json
|
|
1242
|
+
scripts, shell scripts, CI configs, or docs), drop the flag and re-run
|
|
1243
|
+
`tailor generate` after each change instead. If automatic regeneration on file
|
|
1244
|
+
change is still needed, wrap the command with a general-purpose file watcher
|
|
1245
|
+
(e.g. `chokidar-cli`, `nodemon`) at the project level.
|
|
1246
|
+
|
|
1247
|
+
For programmatic use of `generate()` from `@tailor-platform/sdk/cli`, remove the
|
|
1248
|
+
`watch` field from the `GenerateOptions` argument — the function now performs a
|
|
1249
|
+
single generation pass and resolves once it completes.
|
|
1250
|
+
```
|
|
1251
|
+
|
|
1252
|
+
</details>
|
|
1253
|
+
|
|
1254
|
+
## Generated seed exec.mjs → tailor seed CLI plugin
|
|
1255
|
+
|
|
1256
|
+
**Migration:** Manual
|
|
1257
|
+
|
|
1258
|
+
`seedPlugin` no longer generates the `exec.mjs` seed runner. Seeding and validation move to the `tailor seed` commands provided by the `@tailor-platform/sdk-plugin-seed` CLI plugin: install it as a devDependency, replace `node <distPath>/exec.mjs` invocations with `tailor seed apply` and `node <distPath>/exec.mjs validate` with `tailor seed validate`, and delete the stale generated `<distPath>/exec.mjs` file. Seed data and schema generation (`data/*.jsonl`, `data/*.schema.ts`) is unchanged, and the `tailor seed apply` options mirror the old script (`--machine-user`, `--namespace`, `--skip-idp`, `--truncate`, `--yes`, type-name arguments).
|
|
1259
|
+
|
|
1260
|
+
Before:
|
|
1261
|
+
|
|
1262
|
+
```jsonc
|
|
1263
|
+
"seed": "node ./seed/exec.mjs",
|
|
1264
|
+
"seed:validate": "node ./seed/exec.mjs validate"
|
|
1265
|
+
```
|
|
1266
|
+
|
|
1267
|
+
After:
|
|
1268
|
+
|
|
1269
|
+
```jsonc
|
|
1270
|
+
"seed": "tailor seed apply",
|
|
1271
|
+
"seed:validate": "tailor seed validate"
|
|
1272
|
+
```
|
|
1273
|
+
|
|
1274
|
+
<details>
|
|
1275
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
1276
|
+
|
|
1277
|
+
```text
|
|
1278
|
+
seedPlugin no longer generates the exec.mjs seed runner in v2. The tailor seed
|
|
1279
|
+
CLI plugin (@tailor-platform/sdk-plugin-seed) replaces it:
|
|
1280
|
+
|
|
1281
|
+
- Install @tailor-platform/sdk-plugin-seed as a devDependency next to
|
|
1282
|
+
@tailor-platform/sdk.
|
|
1283
|
+
- Replace `node <distPath>/exec.mjs [options] [types...]` invocations with
|
|
1284
|
+
`tailor seed apply [options] [types...]` (same options: --machine-user/-m,
|
|
1285
|
+
--namespace/-n, --skip-idp, --truncate, --yes, and type-name arguments).
|
|
1286
|
+
- Replace `node <distPath>/exec.mjs validate [path]` with
|
|
1287
|
+
`tailor seed validate [path]`.
|
|
1288
|
+
- Delete the stale generated `<distPath>/exec.mjs` file; keep the data/
|
|
1289
|
+
directory (JSONL data and generated schemas) as-is.
|
|
1290
|
+
```
|
|
1291
|
+
|
|
1292
|
+
</details>
|
|
1293
|
+
|
|
1294
|
+
## Behavioral changes (no migration required)
|
|
1295
|
+
|
|
1296
|
+
These v2 changes alter runtime or CLI behavior; no source change is needed.
|
|
1297
|
+
|
|
1298
|
+
### CLI tokens stored in the OS keyring
|
|
1299
|
+
|
|
1300
|
+
CLI login tokens are stored in the OS keyring by default when available, falling back to the platform config file when it is not. No source change is required; re-login if you need tokens moved into the keyring.
|
|
1301
|
+
|
|
1302
|
+
### CLI users keyed by subject ID
|
|
1303
|
+
|
|
1304
|
+
The CLI stores human users by their stable subject ID instead of email (email is kept for display). Legacy email-keyed entries are migrated automatically on the next login or token refresh. No source change is required.
|
|
1305
|
+
|
|
1306
|
+
### function logs require a content hash for source mapping
|
|
1307
|
+
|
|
1308
|
+
`tailor function logs` maps stack traces against the function bundle only when the execution recorded a `contentHash`. Executions without one now show raw stack traces instead of mapped frames. No source change is required.
|
|
1309
|
+
|
|
1310
|
+
### Node.js minimum version raised to 22.15.0
|
|
1311
|
+
|
|
1312
|
+
v2 requires Node.js **22.15.0** or later. This is the first version that includes `module.registerHooks()`, which the SDK uses to register its TypeScript loader hook synchronously in the main thread. No source change is required; ensure your environment runs Node.js 22.15.0+.
|
|
1313
|
+
|
|
1314
|
+
### Legacy bundle artifact cleanup removed from deploy
|
|
1315
|
+
|
|
1316
|
+
`tailor deploy` no longer deletes on-disk bundle artifacts (`.entry.js` files, workflow-job bundles, and the `hooks-validate-scripts/` directory) left in the SDK output directory (`.tailor` by default) by SDK versions that predate the current in-memory bundling approach. Current bundlers no longer write these files. No source change is required; if such stale files remain from a very old SDK version, delete only those specific files/directories manually — do not delete the output directory itself, since it also holds deploy state (e.g. `secrets-state/`, `*.context.json`) that existing secrets and Auth Connections depend on.
|