@tailor-platform/sdk 2.0.0-next.2 → 2.0.0-next.4
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 +511 -10
- 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-BO4ZF8wP.mjs +3 -0
- package/dist/application-BX13RArL.mjs +6669 -0
- package/dist/application-BX13RArL.mjs.map +1 -0
- package/dist/authconnection-CZvi9ANm.mjs +9 -0
- package/dist/authconnection-CZvi9ANm.mjs.map +1 -0
- package/dist/brand-Eo4pLXPJ.mjs.map +1 -1
- package/dist/cli/cache/bundle-cache.d.mts +1 -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 +3 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +1 -0
- package/dist/cli/commands/deploy/application.d.mts +1 -0
- package/dist/cli/commands/deploy/apply-phases.d.mts +1 -0
- package/dist/cli/commands/deploy/auth.d.mts +1 -0
- package/dist/cli/commands/deploy/deploy.d.mts +24 -0
- package/dist/cli/commands/deploy/executor.d.mts +1 -0
- package/dist/cli/commands/deploy/function-registry-types.d.mts +12 -0
- package/dist/cli/commands/deploy/function-registry.d.mts +2 -0
- package/dist/cli/commands/deploy/idp.d.mts +1 -0
- package/dist/cli/commands/deploy/resolver.d.mts +1 -0
- package/dist/cli/commands/deploy/secret-manager.d.mts +1 -0
- package/dist/cli/commands/deploy/staticwebsite.d.mts +1 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +1 -0
- package/dist/cli/commands/deploy/types.d.mts +1 -0
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -0
- package/dist/cli/commands/deploy/workflow.d.mts +1 -0
- package/dist/cli/commands/executor/get.d.mts +29 -0
- package/dist/cli/commands/executor/jobs.d.mts +123 -0
- package/dist/cli/commands/executor/list.d.mts +19 -0
- package/dist/cli/commands/executor/transform.d.mts +41 -0
- package/dist/cli/commands/executor/trigger.d.mts +41 -0
- package/dist/cli/commands/executor/webhook.d.mts +22 -0
- package/dist/cli/commands/function/get.d.mts +18 -0
- package/dist/cli/commands/function/list.d.mts +22 -0
- package/dist/cli/commands/function/transform.d.mts +11 -0
- package/dist/cli/commands/generate/options.d.mts +7 -0
- package/dist/cli/commands/generate/seed/bundler.d.mts +26 -0
- package/dist/cli/commands/generate/service.d.mts +11 -0
- package/dist/cli/commands/machineuser/list.d.mts +27 -0
- package/dist/cli/commands/machineuser/token.d.mts +22 -0
- package/dist/cli/commands/oauth2client/get.d.mts +18 -0
- package/dist/cli/commands/oauth2client/list.d.mts +20 -0
- package/dist/cli/commands/oauth2client/transform.d.mts +20 -0
- package/dist/cli/commands/organization/folder/create.d.mts +18 -0
- package/dist/cli/commands/organization/folder/delete.d.mts +16 -0
- package/dist/cli/commands/organization/folder/get.d.mts +17 -0
- package/dist/cli/commands/organization/folder/list.d.mts +22 -0
- package/dist/cli/commands/organization/folder/update.d.mts +18 -0
- package/dist/cli/commands/organization/get.d.mts +16 -0
- package/dist/cli/commands/organization/list.d.mts +15 -0
- package/dist/cli/commands/organization/transform.d.mts +27 -0
- package/dist/cli/commands/organization/tree.d.mts +25 -0
- package/dist/cli/commands/organization/update.d.mts +17 -0
- package/dist/cli/commands/remove.d.mts +16 -0
- package/dist/cli/commands/show.d.mts +34 -0
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +28 -0
- package/dist/cli/commands/tailordb/migrate/config.d.mts +19 -0
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +223 -0
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +17 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +202 -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 +19 -0
- package/dist/cli/commands/workflow/executions.d.mts +75 -0
- package/dist/cli/commands/workflow/get.d.mts +29 -0
- package/dist/cli/commands/workflow/list.d.mts +19 -0
- package/dist/cli/commands/workflow/resume.d.mts +23 -0
- package/dist/cli/commands/workflow/start.d.mts +61 -0
- package/dist/cli/commands/workflow/status.d.mts +5 -0
- package/dist/cli/commands/workflow/transform.d.mts +33 -0
- package/dist/cli/commands/workflow/wait.d.mts +16 -0
- package/dist/cli/commands/workflow/waiter.d.mts +23 -0
- package/dist/cli/commands/workspace/app/health.d.mts +18 -0
- package/dist/cli/commands/workspace/app/list.d.mts +22 -0
- package/dist/cli/commands/workspace/app/transform.d.mts +18 -0
- package/dist/cli/commands/workspace/create.d.mts +25 -0
- package/dist/cli/commands/workspace/delete.d.mts +15 -0
- package/dist/cli/commands/workspace/get.d.mts +17 -0
- package/dist/cli/commands/workspace/list.d.mts +17 -0
- package/dist/cli/commands/workspace/restore.d.mts +15 -0
- package/dist/cli/commands/workspace/transform.d.mts +16 -0
- package/dist/cli/commands/workspace/user/invite.d.mts +22 -0
- package/dist/cli/commands/workspace/user/list.d.mts +22 -0
- package/dist/cli/commands/workspace/user/remove.d.mts +17 -0
- package/dist/cli/commands/workspace/user/transform.d.mts +8 -0
- package/dist/cli/commands/workspace/user/update.d.mts +22 -0
- package/dist/cli/erd-viewer-assets/app.js +279 -36
- package/dist/cli/erd-viewer-assets/index.html +4 -0
- package/dist/cli/erd-viewer-assets/styles.css +252 -5
- package/dist/cli/index.d.mts +18 -3
- package/dist/cli/index.mjs +2237 -520
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +81 -21107
- package/dist/cli/lib.mjs +7 -10
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/query/index.d.mts +39 -0
- package/dist/cli/services/application.d.mts +1 -0
- package/dist/cli/services/auth/service.d.mts +1 -0
- package/dist/cli/services/executor/service.d.mts +1 -0
- package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
- package/dist/cli/services/http-adapter/service.d.mts +1 -0
- package/dist/cli/services/resolver/service.d.mts +1 -0
- package/dist/cli/services/tailordb/service.d.mts +1 -0
- package/dist/cli/services/workflow/bundler.d.mts +1 -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 +26 -0
- package/dist/cli/shared/context.d.mts +28 -0
- package/dist/cli/shared/script-executor.d.mts +75 -0
- package/dist/cli/shared/seed-chunker.d.mts +46 -0
- package/dist/cli/shared/trigger-context.d.mts +1 -0
- package/dist/cli/shared/type-generator.d.mts +20 -0
- package/dist/cli/ts-hook.d.mts +4 -0
- package/dist/cli/ts-hook.mjs +333 -0
- package/dist/completion/zsh-worker.zsh +1531 -1131
- package/dist/configure/config/index.d.mts +21 -0
- package/dist/configure/config/types.d.mts +105 -0
- package/dist/configure/index.d.mts +124 -9
- package/dist/configure/index.mjs +136 -23
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/aigateway/index.d.mts +17 -0
- package/dist/configure/services/aigateway/types.d.mts +11 -0
- package/dist/configure/services/auth/index.d.mts +34 -0
- package/dist/configure/services/auth/types.d.mts +172 -0
- package/dist/configure/services/executor/executor.d.mts +81 -0
- package/dist/configure/services/executor/index.d.mts +8 -0
- package/dist/configure/services/executor/operation.d.mts +45 -0
- package/dist/configure/services/executor/trigger/event.d.mts +272 -0
- package/dist/configure/services/executor/trigger/index.d.mts +8 -0
- package/dist/configure/services/executor/trigger/schedule.d.mts +25 -0
- package/dist/configure/services/executor/trigger/webhook.d.mts +44 -0
- package/dist/configure/services/executor/types.d.mts +2 -0
- package/dist/configure/services/http-adapter/http-adapter.d.mts +125 -0
- package/dist/configure/services/http-adapter/index.d.mts +2 -0
- package/dist/configure/services/idp/index.d.mts +64 -0
- package/dist/configure/services/idp/permission.d.mts +80 -0
- package/dist/configure/services/idp/types.d.mts +20 -0
- package/dist/configure/services/index.d.mts +34 -0
- package/dist/configure/services/resolver/index.d.mts +5 -0
- package/dist/configure/services/resolver/resolver.d.mts +75 -0
- package/dist/configure/services/resolver/types.d.mts +6 -0
- package/dist/configure/services/secrets/index.d.mts +38 -0
- package/dist/configure/services/secrets/types.d.mts +11 -0
- package/dist/configure/services/staticwebsite/index.d.mts +19 -0
- package/dist/configure/services/staticwebsite/types.d.mts +11 -0
- package/dist/configure/services/tailordb/index.d.mts +4 -0
- package/dist/configure/services/tailordb/permission.d.mts +119 -0
- package/dist/configure/services/tailordb/schema.d.mts +456 -0
- package/dist/configure/services/tailordb/types.d.mts +149 -0
- package/dist/configure/services/workflow/execution-policy.d.mts +71 -0
- package/dist/configure/services/workflow/execution-policy.types.d.mts +104 -0
- package/dist/configure/services/workflow/index.d.mts +8 -0
- package/dist/configure/services/workflow/job.d.mts +84 -0
- package/dist/configure/services/workflow/types.d.mts +2 -0
- package/dist/configure/services/workflow/wait-point.d.mts +73 -0
- package/dist/configure/services/workflow/workflow.d.mts +54 -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-runtime.d.mts +17 -0
- package/dist/configure/types/field.d.mts +9 -0
- package/dist/configure/types/field.types.d.mts +109 -0
- package/dist/configure/types/idp-name.d.mts +12 -0
- package/dist/configure/types/index.d.mts +4 -0
- package/dist/configure/types/machine-user.d.mts +2 -0
- package/dist/configure/types/type.d.mts +82 -0
- package/dist/{context-Bd266-ru.mjs → context-DYQVYWqZ.mjs} +4 -5
- package/dist/context-DYQVYWqZ.mjs.map +1 -0
- package/dist/{crashreport-DFq-vsU0.mjs → crashreport-Cg-pqRJV.mjs} +6 -6
- package/dist/{crashreport-DFq-vsU0.mjs.map → crashreport-Cg-pqRJV.mjs.map} +1 -1
- package/dist/{crashreport-BMWcxeSE.mjs → crashreport-D3RjuSYb.mjs} +1 -1
- package/dist/enum-constants-j9QBF0cB.mjs.map +1 -1
- package/dist/{errors-Dtf2WPaW.mjs → errors-118wUDRr.mjs} +2 -2
- package/dist/errors-118wUDRr.mjs.map +1 -0
- package/dist/field-runtime-CAnh_oow.mjs +183 -0
- package/dist/field-runtime-CAnh_oow.mjs.map +1 -0
- package/dist/{file-BbdFGdMV.mjs → file-BUcmVIH2.mjs} +12 -14
- package/dist/file-BUcmVIH2.mjs.map +1 -0
- package/dist/{file-utils-CYZnO1pX.mjs → file-utils-yEiIS4nJ.mjs} +2 -2
- package/dist/file-utils-yEiIS4nJ.mjs.map +1 -0
- package/dist/{globals-Cf0sxIt8.mjs → globals-BjhJJ2dN.mjs} +5 -47
- package/dist/globals-BjhJJ2dN.mjs.map +1 -0
- package/dist/iconv-QWaZh0TT.mjs +38 -0
- package/dist/iconv-QWaZh0TT.mjs.map +1 -0
- package/dist/{idp-BDbK5gjm.mjs → idp-RA_swu-h.mjs} +12 -5
- package/dist/idp-RA_swu-h.mjs.map +1 -0
- package/dist/{interceptor-D-q1rvRl.mjs → interceptor-e33JtsC-.mjs} +2 -2
- package/dist/interceptor-e33JtsC-.mjs.map +1 -0
- package/dist/kysely/index.d.mts +2 -3
- package/dist/{kysely-type-DR8uzZTA.mjs → kysely-type-D-zflMGf.mjs} +2 -2
- package/dist/{kysely-type-DR8uzZTA.mjs.map → kysely-type-D-zflMGf.mjs.map} +1 -1
- package/dist/{logger-CxF-Ex5d.mjs → logger-BEiZZ3qT.mjs} +3 -3
- package/dist/{logger-CxF-Ex5d.mjs.map → logger-BEiZZ3qT.mjs.map} +1 -1
- package/dist/parser/service/auth/index.d.mts +1 -0
- package/dist/parser/service/auth/schema.d.mts +1 -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 +4 -0
- package/dist/parser/service/tailordb/types.d.mts +126 -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 +16 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +16 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +16 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +45 -1
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/get-generated-type.d.mts +17 -0
- package/dist/plugin/index.d.mts +3 -118
- package/dist/plugin/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/manager.d.mts +1 -0
- package/dist/plugin/types.d.mts +243 -0
- package/dist/plugin/with-context.d.mts +102 -0
- package/dist/{runtime-CY4JvrDj.mjs → register-ts-hook-BM1caLT0.mjs} +4128 -2744
- package/dist/register-ts-hook-BM1caLT0.mjs.map +1 -0
- package/dist/{registry-DH4m7eYo.mjs → registry-BSbq6SPo.mjs} +4 -3
- package/dist/registry-BSbq6SPo.mjs.map +1 -0
- package/dist/{repl-editor-DmGr9zMw.mjs → repl-editor-BCozyiNq.mjs} +6 -5
- package/dist/{repl-editor-DmGr9zMw.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
- package/dist/resource_pb-BRv7AMXK.mjs +49 -0
- package/dist/resource_pb-BRv7AMXK.mjs.map +1 -0
- package/dist/runtime/aigateway.d.mts +26 -0
- package/dist/runtime/aigateway.mjs +3 -0
- package/dist/runtime/authconnection.d.mts +22 -2
- package/dist/runtime/authconnection.mjs +2 -2
- package/dist/runtime/context.d.mts +55 -2
- package/dist/runtime/context.mjs +2 -2
- package/dist/runtime/file.d.mts +170 -2
- package/dist/runtime/file.mjs +2 -2
- package/dist/runtime/globals.d.mts +31 -19
- package/dist/runtime/iconv.d.mts +73 -2
- package/dist/runtime/iconv.mjs +2 -2
- package/dist/runtime/idp.d.mts +129 -2
- package/dist/runtime/idp.mjs +2 -2
- package/dist/runtime/index.d.mts +47 -9
- package/dist/runtime/index.mjs +9 -8
- package/dist/runtime/secretmanager.d.mts +41 -2
- package/dist/runtime/secretmanager.mjs +2 -2
- package/dist/{types-BZ7QKVE8.d.mts → runtime/types.d.mts} +4 -5
- package/dist/runtime/workflow.d.mts +113 -2
- package/dist/runtime/workflow.mjs +2 -2
- package/dist/{schema-Dtw9Orye.mjs → schema-C4LYbXVG.mjs} +21 -186
- package/dist/schema-C4LYbXVG.mjs.map +1 -0
- package/dist/{secret-file-VSVGy1V0.mjs → secret-file-aoNXJmKa.mjs} +3 -3
- package/dist/secret-file-aoNXJmKa.mjs.map +1 -0
- package/dist/secretmanager-Bd45j7an.mjs +98 -0
- package/dist/secretmanager-Bd45j7an.mjs.map +1 -0
- package/dist/secretmanager-CYlpffsz.mjs +13 -0
- package/dist/secretmanager-CYlpffsz.mjs.map +1 -0
- package/dist/seed/index.d.mts +1 -2
- package/dist/{seed-izIEyP3z.mjs → seed-CRSQJI_z.mjs} +14 -3
- package/dist/seed-CRSQJI_z.mjs.map +1 -0
- package/dist/service-CkIwEctX.mjs +3 -0
- package/dist/{service-DU1mVzri2.mjs → service-DeZeYa06.mjs} +3 -3
- package/dist/service-DeZeYa06.mjs.map +1 -0
- package/dist/{service-DjyqbCaJ.mjs → service-ufH7sS8o.mjs} +396 -58
- package/dist/service-ufH7sS8o.mjs.map +1 -0
- package/dist/service_pb-B2FF59sP.mjs +3 -0
- package/dist/service_pb-B5w9rjPY.mjs +955 -0
- package/dist/service_pb-B5w9rjPY.mjs.map +1 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +204 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +58 -0
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +316 -0
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +161 -0
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +2070 -0
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +861 -0
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +112 -0
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +69 -0
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +439 -0
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +564 -0
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +145 -0
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +451 -0
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +192 -0
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +50 -0
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +407 -0
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +430 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +73 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +17 -0
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +309 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +591 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +330 -0
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +113 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +346 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +54 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +3576 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +187 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +29 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +429 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +90 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +684 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +797 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +330 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +183 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +862 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +310 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2015 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +483 -0
- package/dist/{telemetry-CdqJEzkj.mjs → telemetry-BRVdwh14.mjs} +3 -3
- package/dist/telemetry-BRVdwh14.mjs.map +1 -0
- package/dist/telemetry-CkbkeJxl.mjs +3 -0
- package/dist/types/aigateway.generated.d.mts +9 -0
- package/dist/types/app-config.generated.d.mts +4 -0
- package/dist/types/auth-connection.generated.d.mts +20 -0
- package/dist/types/auth.generated.d.mts +145 -0
- package/dist/types/executor.generated.d.mts +177 -0
- package/dist/types/helpers.d.mts +39 -0
- package/dist/types/http-adapter.generated.d.mts +17 -0
- package/dist/{workflow.generated-ClEjBYhm.d.mts → types/idp.generated.d.mts} +98 -185
- package/dist/types/resolver.generated.d.mts +39 -0
- package/dist/types/secrets.generated.d.mts +14 -0
- package/dist/types/staticwebsite.generated.d.mts +10 -0
- package/dist/{types-CdcQh4Z2.d.mts → types/tailordb.generated.d.mts} +2 -287
- package/dist/types/workflow.generated.d.mts +12 -0
- package/dist/types-C-lQ4se3.mjs +4 -0
- package/dist/types-CXF2OYdR.mjs +199 -0
- package/dist/types-CXF2OYdR.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +5 -89
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/utils/test/mock.d.mts +87 -0
- package/dist/vitest/environment.d.mts +1 -2
- package/dist/vitest/environment.mjs +2 -2
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.d.mts +12 -428
- package/dist/vitest/index.mjs +740 -9
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock-kysely.d.mts +62 -0
- package/dist/vitest/mock.d.mts +9 -0
- package/dist/vitest/mocks/aigateway.d.mts +30 -0
- package/dist/vitest/mocks/authconnection.d.mts +28 -0
- package/dist/vitest/mocks/file.d.mts +41 -0
- package/dist/vitest/mocks/iconv.d.mts +27 -0
- package/dist/vitest/mocks/idp.d.mts +44 -0
- package/dist/vitest/mocks/secretmanager.d.mts +33 -0
- package/dist/vitest/mocks/tailordb.d.mts +71 -0
- package/dist/vitest/mocks/workflow.d.mts +117 -0
- package/dist/vitest/setup.d.mts +1 -2
- package/dist/vitest/setup.mjs +2 -2
- package/dist/vitest/workflow-local.d.mts +40 -0
- package/dist/workflow-GNuSnsTx.mjs +22 -0
- package/dist/workflow-GNuSnsTx.mjs.map +1 -0
- package/docs/cli/application.md +98 -250
- package/docs/cli/auth.md +51 -295
- package/docs/cli/completion.md +1 -25
- package/docs/cli/crashreport.md +3 -61
- package/docs/cli/executor.md +23 -187
- package/docs/cli/function.md +14 -130
- 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 +137 -41
- package/docs/cli/skills.md +50 -39
- package/docs/cli/staticwebsite.md +32 -180
- package/docs/cli/tailordb.md +97 -323
- package/docs/cli/upgrade.md +2 -22
- package/docs/cli/user.md +78 -247
- package/docs/cli/workflow.md +44 -203
- package/docs/cli/workspace.md +165 -538
- package/docs/cli-reference.md +167 -67
- package/docs/configuration.md +34 -4
- package/docs/github-actions.md +46 -19
- package/docs/migration/v2.md +397 -26
- package/docs/multi-environment.md +29 -7
- package/docs/plugin/custom.md +4 -4
- package/docs/plugin/index.md +8 -8
- package/docs/quickstart.md +8 -7
- package/docs/runtime.md +9 -3
- package/docs/services/aigateway.md +18 -2
- package/docs/services/auth.md +34 -42
- package/docs/services/http-adapter.md +16 -1
- package/docs/services/idp.md +55 -2
- package/docs/services/resolver.md +2 -2
- package/docs/services/secret.md +11 -11
- package/docs/services/staticwebsite.md +8 -2
- package/docs/services/tailordb-migration.md +25 -23
- package/docs/services/tailordb.md +55 -32
- package/docs/services/workflow.md +92 -14
- package/docs/testing.md +49 -3
- package/package.json +42 -31
- package/postinstall.mjs +4 -6
- package/dist/application-Dtqap5jM.mjs +0 -3
- package/dist/application-XuMWK4eq.mjs +0 -7257
- package/dist/application-XuMWK4eq.mjs.map +0 -1
- package/dist/authconnection-D2MhtTN5.mjs +0 -15
- package/dist/authconnection-D2MhtTN5.mjs.map +0 -1
- package/dist/authconnection-DvUQAjQS.d.mts +0 -39
- package/dist/context-Bd266-ru.mjs.map +0 -1
- package/dist/context-C2lEi9uw.d.mts +0 -47
- package/dist/errors-Dtf2WPaW.mjs.map +0 -1
- package/dist/field-DOsJCPFa.mjs +0 -22
- package/dist/field-DOsJCPFa.mjs.map +0 -1
- package/dist/file-BbdFGdMV.mjs.map +0 -1
- package/dist/file-Dq3NIt_F.d.mts +0 -211
- package/dist/file-utils-CYZnO1pX.mjs.map +0 -1
- package/dist/globals-Cf0sxIt8.mjs.map +0 -1
- package/dist/http-adapter.generated-DFsXDdm5.d.mts +0 -581
- package/dist/iconv-Co-TOPuH.d.mts +0 -122
- package/dist/iconv-D2vi8G36.mjs +0 -63
- package/dist/iconv-D2vi8G36.mjs.map +0 -1
- package/dist/idp-BDbK5gjm.mjs.map +0 -1
- package/dist/idp-DrhVrLmV.d.mts +0 -160
- package/dist/index-BI-_j9Z3.d.mts +0 -1013
- package/dist/index-C4JirJH8.d.mts +0 -18
- package/dist/index-CZfWhr0a.d.mts +0 -18
- package/dist/index-Cg8VKAdN.d.mts +0 -46
- package/dist/index-DYRjoLXD.d.mts +0 -47
- package/dist/index-lFpcjHPU.d.mts +0 -201
- package/dist/index-nW7hE6oE.d.mts +0 -18
- package/dist/interceptor-D-q1rvRl.mjs.map +0 -1
- package/dist/mock-FPxmnt-y.mjs +0 -759
- package/dist/mock-FPxmnt-y.mjs.map +0 -1
- package/dist/registry-DH4m7eYo.mjs.map +0 -1
- package/dist/rolldown-runtime-DXywRVcq.mjs +0 -20
- package/dist/runtime-CY4JvrDj.mjs.map +0 -1
- package/dist/schema-Dtw9Orye.mjs.map +0 -1
- package/dist/secret-file-VSVGy1V0.mjs.map +0 -1
- package/dist/secretmanager-B3n4KHfm.d.mts +0 -55
- package/dist/secretmanager-BVxw3ih_.mjs +0 -24
- package/dist/secretmanager-BVxw3ih_.mjs.map +0 -1
- package/dist/seed-izIEyP3z.mjs.map +0 -1
- package/dist/service-DCqIWibD.mjs +0 -3
- package/dist/service-DU1mVzri2.mjs.map +0 -1
- package/dist/service-DjyqbCaJ.mjs.map +0 -1
- package/dist/telemetry-CdqJEzkj.mjs.map +0 -1
- package/dist/telemetry-ClwW5ohF.mjs +0 -3
- package/dist/types-74etvaxy.mjs +0 -4
- package/dist/types-BDRml5C3.d.mts +0 -574
- package/dist/types-BQijbo4m.mjs +0 -371
- package/dist/types-BQijbo4m.mjs.map +0 -1
- package/dist/types-BX4q6Mo6.d.mts +0 -339
- package/dist/workflow-BOmaZwwG.mjs +0 -43
- package/dist/workflow-BOmaZwwG.mjs.map +0 -1
- package/dist/workflow-BVy4XWjS.d.mts +0 -101
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { InferredAttributes, TailorPrincipal } from "../../../runtime/types.mjs";
|
|
2
|
+
import { InferFieldsOutput, Prettify, output } from "../../../types/helpers.mjs";
|
|
3
|
+
import { DefinedFieldMetadata, FieldMetadata, TailorField } from "../../types/field.types.mjs";
|
|
4
|
+
import { DBFieldMetadata as DBFieldMetadata$1, GqlOperationsInput, RawPermissions, TailorDBServiceConfigInput } from "../../../types/tailordb.generated.mjs";
|
|
5
|
+
import { NonEmptyObject } from "type-fest";
|
|
6
|
+
|
|
7
|
+
//#region src/configure/services/tailordb/types.d.ts
|
|
8
|
+
type SerialConfig<T extends "string" | "integer" = "string" | "integer"> = Prettify<{
|
|
9
|
+
start: number;
|
|
10
|
+
maxValue?: number;
|
|
11
|
+
} & (T extends "string" ? {
|
|
12
|
+
format?: string;
|
|
13
|
+
} : object)>;
|
|
14
|
+
interface DBFieldMetadata extends FieldMetadata {
|
|
15
|
+
index?: boolean;
|
|
16
|
+
unique?: boolean;
|
|
17
|
+
vector?: boolean;
|
|
18
|
+
foreignKey?: boolean;
|
|
19
|
+
foreignKeyType?: string;
|
|
20
|
+
foreignKeyField?: string;
|
|
21
|
+
/** Lifecycle hooks for the field */
|
|
22
|
+
hooks?: DBFieldMetadata$1["hooks"];
|
|
23
|
+
serial?: SerialConfig;
|
|
24
|
+
relation?: boolean;
|
|
25
|
+
scale?: number;
|
|
26
|
+
}
|
|
27
|
+
interface DefinedDBFieldMetadata extends DefinedFieldMetadata {
|
|
28
|
+
index?: boolean;
|
|
29
|
+
unique?: boolean;
|
|
30
|
+
vector?: boolean;
|
|
31
|
+
foreignKey?: boolean;
|
|
32
|
+
foreignKeyType?: boolean;
|
|
33
|
+
validate?: boolean;
|
|
34
|
+
hooks?: {
|
|
35
|
+
create: boolean;
|
|
36
|
+
update: boolean;
|
|
37
|
+
};
|
|
38
|
+
serial?: boolean;
|
|
39
|
+
relation?: boolean;
|
|
40
|
+
}
|
|
41
|
+
type GqlOperationsConfig = GqlOperationsInput;
|
|
42
|
+
interface RawRelationConfig {
|
|
43
|
+
type: "1-1" | "n-1" | "keyOnly" | "oneToOne" | "manyToOne" | "N-1";
|
|
44
|
+
toward: {
|
|
45
|
+
type: string;
|
|
46
|
+
as?: string;
|
|
47
|
+
key?: string;
|
|
48
|
+
};
|
|
49
|
+
backward?: string;
|
|
50
|
+
}
|
|
51
|
+
interface TailorDBTypeMetadata {
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
settings?: {
|
|
55
|
+
pluralForm?: string;
|
|
56
|
+
aggregation?: boolean;
|
|
57
|
+
bulkUpsert?: boolean;
|
|
58
|
+
gqlOperations?: GqlOperationsConfig;
|
|
59
|
+
publishEvents?: boolean;
|
|
60
|
+
};
|
|
61
|
+
permissions: RawPermissions;
|
|
62
|
+
files: Record<string, string>;
|
|
63
|
+
indexes?: Record<string, {
|
|
64
|
+
fields: string[];
|
|
65
|
+
unique?: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Minimal structural interface for TailorDBField.
|
|
70
|
+
* Defines only the properties needed by parser, plugin, cli, and types layers.
|
|
71
|
+
* The full interface with builder methods (relation, index, unique, hooks, validate, etc.)
|
|
72
|
+
* is defined in configure/services/tailordb/schema.ts.
|
|
73
|
+
*/
|
|
74
|
+
interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldMetadata, Output = any> extends Omit<TailorField<Defined, Output, DBFieldMetadata, Defined["type"]>, "fields"> {
|
|
75
|
+
readonly fields: Record<string, TailorAnyDBField>;
|
|
76
|
+
readonly rawRelation: Readonly<RawRelationConfig> | undefined;
|
|
77
|
+
}
|
|
78
|
+
type TailorAnyDBField = TailorDBField<any, any>;
|
|
79
|
+
/**
|
|
80
|
+
* Minimal structural interface for TailorDBType.
|
|
81
|
+
* Defines only the properties needed by parser, plugin, cli, and types layers.
|
|
82
|
+
* The full interface with builder methods (hooks, validate, features, permission, etc.)
|
|
83
|
+
* is defined in configure/services/tailordb/schema.ts.
|
|
84
|
+
*/
|
|
85
|
+
interface TailorDBType<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributes> {
|
|
86
|
+
readonly name: string;
|
|
87
|
+
readonly fields: Fields;
|
|
88
|
+
readonly _output: InferFieldsOutput<Fields>;
|
|
89
|
+
readonly metadata: TailorDBTypeMetadata;
|
|
90
|
+
readonly plugins: PluginAttachment[];
|
|
91
|
+
}
|
|
92
|
+
type TailorAnyDBType = TailorDBType<any, any>;
|
|
93
|
+
type TailorDBInstance<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributes> = TailorDBType<Fields, User>;
|
|
94
|
+
type HookFn<TValue, TData, TReturn> = (args: {
|
|
95
|
+
value: TValue;
|
|
96
|
+
data: TData extends Record<string, unknown> ? { readonly [K in keyof TData]?: TData[K] | null | undefined } : unknown;
|
|
97
|
+
invoker: TailorPrincipal | null;
|
|
98
|
+
}) => TReturn;
|
|
99
|
+
type Hook<TData, TReturn> = {
|
|
100
|
+
create?: HookFn<TReturn | null, TData, TReturn>;
|
|
101
|
+
update?: HookFn<TReturn | null, TData, TReturn>;
|
|
102
|
+
};
|
|
103
|
+
type Hooks<F extends Record<string, TailorAnyDBField>, TData = { [K in keyof F]: output<F[K]> }> = NonEmptyObject<{ [K in Exclude<keyof F, "id"> as F[K]["_defined"] extends {
|
|
104
|
+
hooks: unknown;
|
|
105
|
+
} ? never : F[K]["_defined"] extends {
|
|
106
|
+
type: "nested";
|
|
107
|
+
} ? never : K]?: Hook<TData, output<F[K]>> }>;
|
|
108
|
+
type ExcludeNestedDBFields<T extends Record<string, TailorAnyDBField>> = { [K in keyof T]: T[K] extends TailorDBField<{
|
|
109
|
+
type: "nested";
|
|
110
|
+
array: boolean;
|
|
111
|
+
}, any> ? never : T[K] };
|
|
112
|
+
interface TypeFeatures {
|
|
113
|
+
pluralForm?: string;
|
|
114
|
+
aggregation?: true;
|
|
115
|
+
bulkUpsert?: true;
|
|
116
|
+
/** Configure GraphQL operations for this type. Use "query" for read-only mode, or an object for granular control. */
|
|
117
|
+
gqlOperations?: GqlOperationsConfig;
|
|
118
|
+
/**
|
|
119
|
+
* Enable publishing events for this type.
|
|
120
|
+
* When enabled, record creation/update/deletion events are published.
|
|
121
|
+
* If not specified, this is automatically set to true when an executor uses this type
|
|
122
|
+
* with recordCreated/recordUpdated/recordDeleted triggers. If explicitly set to false
|
|
123
|
+
* while an executor uses this type, an error will be thrown during apply.
|
|
124
|
+
*/
|
|
125
|
+
publishEvents?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Plugin attachment stored on TailorAnyDBType instances.
|
|
129
|
+
*/
|
|
130
|
+
interface PluginAttachment {
|
|
131
|
+
pluginId: string;
|
|
132
|
+
config: unknown;
|
|
133
|
+
}
|
|
134
|
+
type IndexDef<T extends {
|
|
135
|
+
fields: Record<PropertyKey, unknown>;
|
|
136
|
+
}> = {
|
|
137
|
+
fields: [keyof T["fields"], keyof T["fields"], ...(keyof T["fields"])[]];
|
|
138
|
+
unique?: boolean;
|
|
139
|
+
name?: string;
|
|
140
|
+
};
|
|
141
|
+
type RelationType = "1-1" | "oneToOne" | "n-1" | "manyToOne" | "N-1" | "keyOnly";
|
|
142
|
+
type TailorDBExternalConfig = {
|
|
143
|
+
external: true;
|
|
144
|
+
};
|
|
145
|
+
type TailorDBServiceInput = {
|
|
146
|
+
[namespace: string]: TailorDBServiceConfigInput | TailorDBExternalConfig;
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { DBFieldMetadata, DefinedDBFieldMetadata, ExcludeNestedDBFields, GqlOperationsConfig, Hook, Hooks, IndexDef, PluginAttachment, RawRelationConfig, RelationType, SerialConfig, TailorAnyDBField, TailorAnyDBType, TailorDBExternalConfig, TailorDBField, TailorDBInstance, TailorDBServiceInput, TailorDBType, TailorDBTypeMetadata, TypeFeatures };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ExecutionPolicyConcurrency, ExecutionPolicyDefInput, ExecutionPolicyExactInstance, ExecutionPolicyGroupOptions, ExecutionPolicyInstance, ExecutionPolicyWildcardInstance, ResolvedExecutionPolicyInstance } from "./execution-policy.types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/configure/services/workflow/execution-policy.d.ts
|
|
4
|
+
type ResolveKey<Def, Fallback extends string> = Def extends {
|
|
5
|
+
key: infer K extends string;
|
|
6
|
+
} ? K : Fallback;
|
|
7
|
+
type ResolveMatchType<Def> = Def extends {
|
|
8
|
+
matchType: infer M extends "exact" | "prefix";
|
|
9
|
+
} ? M : "exact";
|
|
10
|
+
/**
|
|
11
|
+
* Define a single workflow job function execution policy.
|
|
12
|
+
*
|
|
13
|
+
* Use this when declaring a policy outside the
|
|
14
|
+
* {@link defineWorkflowExecutionPolicies} builder — for example, when the
|
|
15
|
+
* runtime key prefix needs to differ from the corresponding workspace-unique
|
|
16
|
+
* name.
|
|
17
|
+
*
|
|
18
|
+
* When `matchType: "prefix"` is set, the returned instance has `keyFor(suffix)`
|
|
19
|
+
* instead of a directly-usable `key` (see {@link ExecutionPolicyWildcardInstance}).
|
|
20
|
+
* @param name - Workspace-unique name. Must match `^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$`.
|
|
21
|
+
* @param def - Optional overrides for `key` (defaults to `name`), `matchType`, `separator` (the `keyFor` join character, defaults to `.`), and concurrency
|
|
22
|
+
* @returns An execution policy instance
|
|
23
|
+
* @example
|
|
24
|
+
* export const perTenant = defineWorkflowExecutionPolicy("tenant-api", {
|
|
25
|
+
* matchType: "prefix",
|
|
26
|
+
* concurrencyPolicy: { maxConcurrentExecutions: 3 },
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* perTenant.keyFor(tenantId); // "tenant-api.<tenantId>"
|
|
30
|
+
*/
|
|
31
|
+
declare function defineWorkflowExecutionPolicy<const N extends string, const D extends (Omit<ExecutionPolicyDefInput, "name"> & {
|
|
32
|
+
separator?: string;
|
|
33
|
+
}) | undefined = undefined>(name: N, def?: D): ResolvedExecutionPolicyInstance<ResolveKey<D, N>, ResolveMatchType<D>>;
|
|
34
|
+
/**
|
|
35
|
+
* Define a group of workflow job function execution policies. Property names
|
|
36
|
+
* become the workspace-unique `name` and default `key` verbatim, matching the
|
|
37
|
+
* mental model of {@link defineWaitPoints}. Provide `name` / `key` explicitly
|
|
38
|
+
* to override the property-name default (for example, when the property name
|
|
39
|
+
* is not valid for the execution policy grammar or when the runtime key
|
|
40
|
+
* prefix needs to differ).
|
|
41
|
+
*
|
|
42
|
+
* When `matchType: "prefix"` is set, the returned instance has `keyFor(suffix)`
|
|
43
|
+
* instead of a directly-usable `key` (see {@link ExecutionPolicyWildcardInstance}).
|
|
44
|
+
* `matchType` can be combined with an explicit `key`, or left to apply to
|
|
45
|
+
* the property-name-derived prefix.
|
|
46
|
+
*
|
|
47
|
+
* The return type mirrors the builder's return type so JSDoc on each property
|
|
48
|
+
* is preserved in IDE autocompletion.
|
|
49
|
+
* @param builder - Callback that receives a `define` factory and returns a record of policies
|
|
50
|
+
* @param options - Group-wide options; `separator` overrides the `.` `keyFor` uses to join the prefix and suffix for every prefix policy in the group
|
|
51
|
+
* @returns The same object returned by the builder (with `name` / `key` resolved on each instance)
|
|
52
|
+
* @example
|
|
53
|
+
* export const executionPolicies = defineWorkflowExecutionPolicies((define) => ({
|
|
54
|
+
* premium: define({ concurrencyPolicy: { maxConcurrentExecutions: 5 } }),
|
|
55
|
+
* "tenant-api": define({
|
|
56
|
+
* matchType: "prefix",
|
|
57
|
+
* concurrencyPolicy: { maxConcurrentExecutions: 3 },
|
|
58
|
+
* }),
|
|
59
|
+
* }));
|
|
60
|
+
*
|
|
61
|
+
* // In a workflow job function:
|
|
62
|
+
* await tailor.workflow.triggerJobFunction("worker", args, {
|
|
63
|
+
* executionPolicyKey: executionPolicies.premium.key,
|
|
64
|
+
* });
|
|
65
|
+
* await tailor.workflow.triggerJobFunction("worker", args, {
|
|
66
|
+
* executionPolicyKey: executionPolicies["tenant-api"].keyFor(input.tenantId),
|
|
67
|
+
* });
|
|
68
|
+
*/
|
|
69
|
+
declare function defineWorkflowExecutionPolicies<T extends Record<string, ExecutionPolicyInstance>>(builder: (define: <const D extends ExecutionPolicyDefInput | undefined = undefined>(def?: D) => ResolvedExecutionPolicyInstance<ResolveKey<D, string>, ResolveMatchType<D>>) => T, options?: ExecutionPolicyGroupOptions): T;
|
|
70
|
+
//#endregion
|
|
71
|
+
export { type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ResolvedExecutionPolicyInstance, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ExecutionPolicyKey } from "../../../runtime/workflow.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/configure/services/workflow/execution-policy.types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Optional per-key concurrency cap applied to job function dispatches that
|
|
6
|
+
* resolve to a policy's `executionPolicyKey`.
|
|
7
|
+
*/
|
|
8
|
+
interface ExecutionPolicyConcurrency {
|
|
9
|
+
/** Maximum number of concurrent executions allowed per resolved key. */
|
|
10
|
+
maxConcurrentExecutions: number;
|
|
11
|
+
}
|
|
12
|
+
/** Fields shared by both {@link ExecutionPolicyExactInstance} and {@link ExecutionPolicyWildcardInstance}. */
|
|
13
|
+
interface ExecutionPolicyBase {
|
|
14
|
+
/** Workspace-unique name for this policy. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/** Optional per-key concurrency cap. */
|
|
17
|
+
readonly concurrencyPolicy?: ExecutionPolicyConcurrency;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An execution policy declared with `matchType: "exact"` (the default).
|
|
21
|
+
* `key` is branded as {@link ExecutionPolicyKey}, so it can be passed
|
|
22
|
+
* directly as the `executionPolicyKey` option.
|
|
23
|
+
*/
|
|
24
|
+
interface ExecutionPolicyExactInstance<Key extends string = string> extends ExecutionPolicyBase {
|
|
25
|
+
/** Declared key; the platform registers it verbatim. */
|
|
26
|
+
readonly key: Key & ExecutionPolicyKey;
|
|
27
|
+
readonly matchType: "exact";
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An execution policy declared with `matchType: "prefix"`. The platform
|
|
31
|
+
* registers the declared key prefix with a trailing `*`, and matches every
|
|
32
|
+
* dispatch whose runtime key begins with that prefix. There is no
|
|
33
|
+
* directly-usable `key` — use `keyFor` to build a concrete, branded runtime
|
|
34
|
+
* key at the call site instead of hand-concatenating the prefix and a
|
|
35
|
+
* suffix.
|
|
36
|
+
*/
|
|
37
|
+
interface ExecutionPolicyWildcardInstance extends ExecutionPolicyBase {
|
|
38
|
+
readonly matchType: "prefix";
|
|
39
|
+
/**
|
|
40
|
+
* Build a concrete runtime key by appending `suffix` after this policy's
|
|
41
|
+
* declared key prefix, separated by `.` unless a different separator was
|
|
42
|
+
* configured where this policy was declared.
|
|
43
|
+
* @param suffix - Value appended after the wildcard prefix
|
|
44
|
+
* @returns The concrete key to pass as `executionPolicyKey`
|
|
45
|
+
* @throws If the resulting key does not match the execution policy key
|
|
46
|
+
* grammar (for example, an empty `suffix`)
|
|
47
|
+
* @example
|
|
48
|
+
* // key: "tenant-api", matchType: "prefix"
|
|
49
|
+
* tenantApi.keyFor(tenantId); // "tenant-api.<tenantId>"
|
|
50
|
+
*/
|
|
51
|
+
keyFor(suffix: string): ExecutionPolicyKey;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A declared workflow job function execution policy — either
|
|
55
|
+
* {@link ExecutionPolicyExactInstance} or {@link ExecutionPolicyWildcardInstance}.
|
|
56
|
+
*/
|
|
57
|
+
type ExecutionPolicyInstance<Key extends string = string> = ExecutionPolicyExactInstance<Key> | ExecutionPolicyWildcardInstance;
|
|
58
|
+
/**
|
|
59
|
+
* Resolves to {@link ExecutionPolicyWildcardInstance} when `MatchType` is
|
|
60
|
+
* known at the type level to be `"prefix"`, to {@link ExecutionPolicyExactInstance}
|
|
61
|
+
* when it's known to be `"exact"`, or to their union when `MatchType` is the
|
|
62
|
+
* unnarrowed `"exact" | "prefix"` (e.g. a caller passed a non-literal
|
|
63
|
+
* `matchType`) — narrowing to one branch in that case would claim a `key` or
|
|
64
|
+
* `keyFor` that may not exist on the actual runtime instance.
|
|
65
|
+
*/
|
|
66
|
+
type ResolvedExecutionPolicyInstance<Key extends string, MatchType extends "exact" | "prefix"> = "exact" | "prefix" extends MatchType ? ExecutionPolicyExactInstance<Key> | ExecutionPolicyWildcardInstance : MatchType extends "prefix" ? ExecutionPolicyWildcardInstance : ExecutionPolicyExactInstance<Key>;
|
|
67
|
+
/**
|
|
68
|
+
* Body of an execution policy declaration.
|
|
69
|
+
*
|
|
70
|
+
* When both `name` and `key` are omitted in the `defineWorkflowExecutionPolicies`
|
|
71
|
+
* builder, the property name is used verbatim for both (like
|
|
72
|
+
* `defineWaitPoints`). Provide `name` when the property identifier is not
|
|
73
|
+
* valid execution policy grammar, and provide `key` when the runtime key
|
|
74
|
+
* prefix needs to differ from `name` (e.g. it needs `:` or `.`).
|
|
75
|
+
*/
|
|
76
|
+
interface ExecutionPolicyDefInput {
|
|
77
|
+
/** Overrides the property-name-derived `name`. 3-63 characters from `[a-z0-9-]`; must start and end with `[a-z0-9]`. */
|
|
78
|
+
name?: string;
|
|
79
|
+
/** Overrides the property-name-derived `key` prefix. Independent of `matchType` — both may be set together. */
|
|
80
|
+
key?: string;
|
|
81
|
+
/**
|
|
82
|
+
* `"exact"` (the default) matches a dispatch whose runtime key equals
|
|
83
|
+
* `key` (or the resolved `name`, if `key` is omitted). `"prefix"`
|
|
84
|
+
* registers `key` as a wildcard prefix — the platform appends a trailing
|
|
85
|
+
* `*`, and the resulting instance exposes `keyFor(suffix)` to build
|
|
86
|
+
* concrete dispatch keys instead of a directly-usable `key`.
|
|
87
|
+
*/
|
|
88
|
+
matchType?: "exact" | "prefix";
|
|
89
|
+
/** Optional per-key concurrency cap. */
|
|
90
|
+
concurrencyPolicy?: ExecutionPolicyConcurrency;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Options for {@link defineWorkflowExecutionPolicies}, applying to every
|
|
94
|
+
* policy declared by the builder (not settable per policy).
|
|
95
|
+
*/
|
|
96
|
+
interface ExecutionPolicyGroupOptions {
|
|
97
|
+
/**
|
|
98
|
+
* Separator `keyFor(suffix)` inserts between a wildcard policy's declared
|
|
99
|
+
* `key` prefix and `suffix`. Defaults to `.`.
|
|
100
|
+
*/
|
|
101
|
+
separator?: string;
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { ExecutionPolicyConcurrency, ExecutionPolicyDefInput, ExecutionPolicyExactInstance, ExecutionPolicyGroupOptions, ExecutionPolicyInstance, ExecutionPolicyWildcardInstance, ResolvedExecutionPolicyInstance };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExecutionPolicyConcurrency, ExecutionPolicyDefInput, ExecutionPolicyExactInstance, ExecutionPolicyGroupOptions, ExecutionPolicyInstance, ExecutionPolicyWildcardInstance, ResolvedExecutionPolicyInstance } from "./execution-policy.types.mjs";
|
|
2
|
+
import { WorkflowServiceConfig, WorkflowServiceInput } from "../../config/types.mjs";
|
|
3
|
+
import { ConcurrencyPolicy, RetryPolicy } from "../../../types/workflow.generated.mjs";
|
|
4
|
+
import { WorkflowJob, WorkflowJobContext, createWorkflowJob } from "./job.mjs";
|
|
5
|
+
import { Workflow, WorkflowConfig, createWorkflow } from "./workflow.mjs";
|
|
6
|
+
import { defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy } from "./execution-policy.mjs";
|
|
7
|
+
import { WaitPointInstance, createWaitPoint, createWaitPoints } from "./wait-point.mjs";
|
|
8
|
+
export { type ConcurrencyPolicy, type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ResolvedExecutionPolicyInstance, type RetryPolicy, WaitPointInstance, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, type WorkflowServiceConfig, type WorkflowServiceInput, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TailorEnv, TailorPrincipal } from "../../../runtime/types.mjs";
|
|
2
|
+
import { JsonCompatible, TypeLevelError } from "../../../types/helpers.mjs";
|
|
3
|
+
import { TriggerJobFunctionOptions } from "../../../runtime/workflow.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/configure/services/workflow/job.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Context object passed as the second argument to workflow job body functions.
|
|
8
|
+
*/
|
|
9
|
+
type WorkflowJobContext = {
|
|
10
|
+
env: TailorEnv;
|
|
11
|
+
invoker: TailorPrincipal | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The body function type for a workflow job.
|
|
15
|
+
* Resolves to the callable signature when `I` / `O` are JsonValue-compatible,
|
|
16
|
+
* or to a type-level error that surfaces at the `body:` property.
|
|
17
|
+
*/
|
|
18
|
+
type JobBody<I, O> = [null] extends [I] ? TypeLevelError<"Input cannot be null at the top level"> : [I] extends [undefined] ? [O] extends [JsonCompatible<O> | undefined | void] ? (input: I, context: WorkflowJobContext) => O | Promise<O> : TypeLevelError<"Output must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : [undefined] extends [I] ? TypeLevelError<"Input cannot include undefined at the top level"> : [I] extends [JsonCompatible<I>] ? [O] extends [JsonCompatible<O> | undefined | void] ? (input: I, context: WorkflowJobContext) => O | Promise<O> : TypeLevelError<"Output must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : TypeLevelError<"Input must be JsonValue-compatible (plain objects/arrays; no class instances or functions)">;
|
|
19
|
+
/**
|
|
20
|
+
* WorkflowJob represents a job that can be triggered in a workflow.
|
|
21
|
+
*
|
|
22
|
+
* Type constraints:
|
|
23
|
+
* - Input: Must be JsonValue-compatible (plain objects/arrays; no class instances or functions) or undefined.
|
|
24
|
+
* - Output: Must be JsonValue-compatible (plain objects/arrays; no class instances or functions), undefined, or void.
|
|
25
|
+
* - Trigger returns `Awaited<Output>` as-is (no Promise or Jsonify transformation).
|
|
26
|
+
*/
|
|
27
|
+
interface WorkflowJob<Name extends string = string, Input = undefined, Output = undefined> {
|
|
28
|
+
name: Name;
|
|
29
|
+
/**
|
|
30
|
+
* Trigger this job with the given input and return the job's output value.
|
|
31
|
+
* Accepts an optional second argument to pass `executionPolicyKey` for
|
|
32
|
+
* platform-side concurrency enforcement.
|
|
33
|
+
* @example
|
|
34
|
+
* body: async (input) => {
|
|
35
|
+
* const a = jobA.trigger({ id: input.id });
|
|
36
|
+
* const b = jobB.trigger({ id: input.id }, {
|
|
37
|
+
* executionPolicyKey: `tenant-api.${input.tenantId}`,
|
|
38
|
+
* });
|
|
39
|
+
* return { a, b };
|
|
40
|
+
* }
|
|
41
|
+
*/
|
|
42
|
+
trigger: [Input] extends [undefined] ? (input?: undefined, options?: TriggerJobFunctionOptions) => Awaited<Output> : (input: Input, options?: TriggerJobFunctionOptions) => Awaited<Output>;
|
|
43
|
+
body: (input: Input, context: WorkflowJobContext) => Output | Promise<Output>;
|
|
44
|
+
}
|
|
45
|
+
interface CreateWorkflowJobConfig<Name extends string, I, O> {
|
|
46
|
+
readonly name: Name;
|
|
47
|
+
readonly body: JobBody<I, O>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Create a workflow job definition.
|
|
51
|
+
*
|
|
52
|
+
* All jobs must be named exports from the workflow file.
|
|
53
|
+
* Job names must be unique across the entire project.
|
|
54
|
+
*
|
|
55
|
+
* Input and output must be JsonValue-compatible (primitives, plain objects, arrays).
|
|
56
|
+
* Functions and objects with a `toJSON` method are rejected at the type level;
|
|
57
|
+
* class instances exposing methods are rejected via the property walk.
|
|
58
|
+
* @param config - Job configuration with name and body function.
|
|
59
|
+
* @param config.name - Unique job name across the project.
|
|
60
|
+
* @param config.body - Function that processes the job input.
|
|
61
|
+
* @returns A WorkflowJob that can be triggered from other jobs.
|
|
62
|
+
* @example
|
|
63
|
+
* // Simple job with async body:
|
|
64
|
+
* export const fetchData = createWorkflowJob({
|
|
65
|
+
* name: "fetch-data",
|
|
66
|
+
* body: async (input: { id: string }) => {
|
|
67
|
+
* const db = getDB("tailordb");
|
|
68
|
+
* return await db.selectFrom("Table").selectAll().where("id", "=", input.id).executeTakeFirst();
|
|
69
|
+
* },
|
|
70
|
+
* });
|
|
71
|
+
* @example
|
|
72
|
+
* // Orchestrator job that fans out to other jobs.
|
|
73
|
+
* export const orchestrate = createWorkflowJob({
|
|
74
|
+
* name: "orchestrate",
|
|
75
|
+
* body: (input: { orderId: string }) => {
|
|
76
|
+
* const inventory = checkInventory.trigger({ orderId: input.orderId });
|
|
77
|
+
* const payment = processPayment.trigger({ orderId: input.orderId });
|
|
78
|
+
* return { inventory, payment };
|
|
79
|
+
* },
|
|
80
|
+
* });
|
|
81
|
+
*/
|
|
82
|
+
declare function createWorkflowJob<const Name extends string, I = undefined, O = undefined>(config: CreateWorkflowJobConfig<Name, I, O>): WorkflowJob<Name, I, Awaited<O>>;
|
|
83
|
+
//#endregion
|
|
84
|
+
export { WorkflowJob, WorkflowJobContext, createWorkflowJob };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { JsonCompatible, TypeLevelError } from "../../../types/helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/configure/services/workflow/wait-point.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A single wait point instance with typed `.wait()` and `.resolve()` methods.
|
|
6
|
+
*
|
|
7
|
+
* - `.wait(payload?)` suspends execution until resolved. Returns the result from `.resolve()`.
|
|
8
|
+
* - `.resolve(executionId, callback)` resumes a suspended execution.
|
|
9
|
+
*
|
|
10
|
+
* Both `Payload` and `Result` must be JsonValue-compatible (primitives, plain objects, arrays).
|
|
11
|
+
* Functions and objects with a `toJSON` method are rejected at the type level.
|
|
12
|
+
*/
|
|
13
|
+
interface WaitPointInstance<Payload = undefined, Result = undefined> {
|
|
14
|
+
wait: [Payload] extends [undefined] ? () => Promise<Result> : (payload: Payload) => Promise<Result>;
|
|
15
|
+
resolve: (executionId: string, callback: (payload: [Payload] extends [undefined] ? undefined : Payload) => Result | Promise<Result>) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The type produced by `define<Payload, Result>()` / `createWaitPoint<Payload, Result>(key)`.
|
|
19
|
+
* Resolves to `WaitPointInstance<Payload, Result>` when both types are JsonValue-compatible,
|
|
20
|
+
* or to a type-level error that surfaces at the call site.
|
|
21
|
+
*/
|
|
22
|
+
type WaitPointDef<Payload, Result> = [null] extends [Payload] ? TypeLevelError<"Payload cannot be null at the top level"> : [undefined] extends [Result] ? TypeLevelError<"Result cannot be (or include) undefined (resolve callback must return a value)"> : [Payload] extends [undefined] ? [Result] extends [JsonCompatible<Result>] ? WaitPointInstance<Payload, Result> : TypeLevelError<"Result must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : [undefined] extends [Payload] ? TypeLevelError<"Payload cannot include undefined at the top level"> : [Payload] extends [JsonCompatible<Payload>] ? [Result] extends [JsonCompatible<Result>] ? WaitPointInstance<Payload, Result> : TypeLevelError<"Result must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : TypeLevelError<"Payload must be JsonValue-compatible (plain objects/arrays; no class instances or functions)">;
|
|
23
|
+
/**
|
|
24
|
+
* The `define` function passed to the `createWaitPoints` builder callback.
|
|
25
|
+
* Returns an actual WaitPointInstance (not a phantom marker) so that the
|
|
26
|
+
* builder's return type can flow through as-is, preserving JSDoc comments
|
|
27
|
+
* on each property for IDE autocompletion.
|
|
28
|
+
*
|
|
29
|
+
* JSON validation is encoded in the return type rather than in type-parameter
|
|
30
|
+
* constraints, because tsgo rejects self-referential constraints like
|
|
31
|
+
* `Payload extends JsonCompatible<Payload>` as circular.
|
|
32
|
+
*/
|
|
33
|
+
type DefineFn = <Payload = undefined, Result = undefined>() => WaitPointDef<Payload, Result>;
|
|
34
|
+
/**
|
|
35
|
+
* Create a single typed wait point with an explicit key.
|
|
36
|
+
*
|
|
37
|
+
* `Payload` and `Result` must be JsonValue-compatible.
|
|
38
|
+
* Functions and objects with a `toJSON` method are rejected at the type level;
|
|
39
|
+
* class instances exposing methods are rejected via the property walk.
|
|
40
|
+
* @param key - The wait point key used to match wait and resolve calls
|
|
41
|
+
* @returns A WaitPointInstance with typed `.wait()` and `.resolve()` methods
|
|
42
|
+
* @example
|
|
43
|
+
* export const approval = createWaitPoint<{ message: string }, { approved: boolean }>("approval");
|
|
44
|
+
*
|
|
45
|
+
* await approval.wait({ message: "Please approve" });
|
|
46
|
+
*/
|
|
47
|
+
declare function createWaitPoint<Payload = undefined, Result = undefined>(key: string): WaitPointDef<Payload, Result>;
|
|
48
|
+
/**
|
|
49
|
+
* Create a group of typed wait points for human-in-the-loop workflows.
|
|
50
|
+
* Property names become the wait point keys.
|
|
51
|
+
*
|
|
52
|
+
* The return type is the same as the builder's return type, so JSDoc on each
|
|
53
|
+
* property is preserved and visible in IDE autocompletion.
|
|
54
|
+
*
|
|
55
|
+
* `Payload` and `Result` must be JsonValue-compatible.
|
|
56
|
+
* Functions and objects with a `toJSON` method are rejected at the type level;
|
|
57
|
+
* class instances exposing methods are rejected via the property walk.
|
|
58
|
+
* @param builder - Callback that receives a `define` factory and returns an object of wait points
|
|
59
|
+
* @returns The same object returned by the builder (with correct keys set on each instance)
|
|
60
|
+
* @example
|
|
61
|
+
* export const waitPoints = createWaitPoints(define => ({
|
|
62
|
+
* // Preceding JSDoc on this property is shown in IDE autocompletion
|
|
63
|
+
* approval: define<{ message: string }, { approved: boolean }>(),
|
|
64
|
+
* }));
|
|
65
|
+
*
|
|
66
|
+
* // IDE shows the JSDoc when typing `waitPoints.`
|
|
67
|
+
* await waitPoints.approval.wait({ message: "Please approve" });
|
|
68
|
+
*
|
|
69
|
+
* // For 2-level access, use destructured export with JSDoc attached to the export itself.
|
|
70
|
+
*/
|
|
71
|
+
declare function createWaitPoints<T extends Record<string, WaitPointInstance<any, any>>>(builder: (define: DefineFn) => T): T;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { WaitPointInstance, createWaitPoint, createWaitPoints };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { MachineUserName } from "../auth/types.mjs";
|
|
2
|
+
import { ConcurrencyPolicy, RetryPolicy } from "../../../types/workflow.generated.mjs";
|
|
3
|
+
import { WorkflowJob } from "./job.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/configure/services/workflow/workflow.d.ts
|
|
6
|
+
interface WorkflowConfig<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
7
|
+
name: string;
|
|
8
|
+
mainJob: Job;
|
|
9
|
+
retryPolicy?: RetryPolicy;
|
|
10
|
+
concurrencyPolicy?: ConcurrencyPolicy;
|
|
11
|
+
}
|
|
12
|
+
interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
13
|
+
name: string;
|
|
14
|
+
mainJob: Job;
|
|
15
|
+
retryPolicy?: RetryPolicy;
|
|
16
|
+
concurrencyPolicy?: ConcurrencyPolicy;
|
|
17
|
+
trigger: (args: Parameters<Job["trigger"]>[0], options?: {
|
|
18
|
+
invoker: MachineUserName;
|
|
19
|
+
}) => Promise<string>;
|
|
20
|
+
}
|
|
21
|
+
interface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {
|
|
22
|
+
name: string;
|
|
23
|
+
mainJob: Job;
|
|
24
|
+
retryPolicy?: RetryPolicy;
|
|
25
|
+
concurrencyPolicy?: ConcurrencyPolicy;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a workflow definition that can be triggered via the Tailor SDK.
|
|
29
|
+
* In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().
|
|
30
|
+
*
|
|
31
|
+
* The workflow MUST be the default export of the file.
|
|
32
|
+
* All jobs referenced by the workflow MUST be named exports.
|
|
33
|
+
* @template Job
|
|
34
|
+
* @param config - Workflow configuration
|
|
35
|
+
* @returns Defined workflow
|
|
36
|
+
* @example
|
|
37
|
+
* export const fetchData = createWorkflowJob({ name: "fetch-data", body: async (input: { id: string }) => ({ id: input.id }) });
|
|
38
|
+
* export const processData = createWorkflowJob({
|
|
39
|
+
* name: "process-data",
|
|
40
|
+
* body: (input: { id: string }) => {
|
|
41
|
+
* const data = fetchData.trigger({ id: input.id });
|
|
42
|
+
* return { data };
|
|
43
|
+
* },
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Workflow must be default export; mainJob is the entry point
|
|
47
|
+
* export default createWorkflow({
|
|
48
|
+
* name: "data-processing",
|
|
49
|
+
* mainJob: processData,
|
|
50
|
+
* });
|
|
51
|
+
*/
|
|
52
|
+
declare function createWorkflow<Job extends WorkflowJob<any, any, any>>(config: WorkflowDefinition<Job>): Workflow<Job>;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { type ConcurrencyPolicy, type RetryPolicy, Workflow, WorkflowConfig, createWorkflow };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/configure/types/aigateway-name.d.ts
|
|
2
|
+
interface AIGatewayNameRegistry {}
|
|
3
|
+
/**
|
|
4
|
+
* AI Gateway name.
|
|
5
|
+
*
|
|
6
|
+
* When `tailor.d.ts` is generated (via `tailor deploy`/`generate`), this is narrowed
|
|
7
|
+
* to the union of AI Gateway names defined via `defineAIGateway()`. Falls back to
|
|
8
|
+
* `string` before the first generate run.
|
|
9
|
+
*/
|
|
10
|
+
type AIGatewayName = keyof AIGatewayNameRegistry extends never ? string : keyof AIGatewayNameRegistry & string;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AIGatewayName, AIGatewayNameRegistry };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/configure/types/connection-name.d.ts
|
|
2
|
+
interface ConnectionNameRegistry {}
|
|
3
|
+
/**
|
|
4
|
+
* Auth connection name.
|
|
5
|
+
*
|
|
6
|
+
* When `tailor.d.ts` is generated (via `tailor deploy`/`generate`), this is narrowed
|
|
7
|
+
* to the union of connection names defined in `defineAuth()`'s `connections`. Falls back
|
|
8
|
+
* to `string` before the first generate run.
|
|
9
|
+
*/
|
|
10
|
+
type ConnectionName = keyof ConnectionNameRegistry extends never ? string : keyof ConnectionNameRegistry & string;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ConnectionName, ConnectionNameRegistry };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TailorPrincipal } from "../../runtime/types.mjs";
|
|
2
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
+
|
|
4
|
+
//#region src/configure/types/field-runtime.d.ts
|
|
5
|
+
type FieldParseArgs = {
|
|
6
|
+
value: unknown;
|
|
7
|
+
data: unknown;
|
|
8
|
+
invoker: TailorPrincipal | null;
|
|
9
|
+
};
|
|
10
|
+
type FieldParseInternalArgs = {
|
|
11
|
+
value: unknown;
|
|
12
|
+
data: unknown;
|
|
13
|
+
invoker: TailorPrincipal | null;
|
|
14
|
+
pathArray: string[];
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FieldParseArgs, FieldParseInternalArgs };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnumValue } from "./field.types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/configure/types/field.d.ts
|
|
4
|
+
type AllowedValues = readonly [string | EnumValue, ...(string | EnumValue)[]];
|
|
5
|
+
type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T ? T extends string ? T : T extends {
|
|
6
|
+
value: infer K;
|
|
7
|
+
} ? K : never : never;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AllowedValues, AllowedValuesOutput };
|