@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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { n as isSdkBranded } from "./brand-Eo4pLXPJ.mjs";
|
|
2
|
-
import { n as logger, r as styles } from "./logger-
|
|
2
|
+
import { n as logger, r as styles } from "./logger-BEiZZ3qT.mjs";
|
|
3
|
+
import * as path from "pathe";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import * as fs from "node:fs";
|
|
5
|
-
import * as path from "pathe";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
|
+
import * as inflection from "inflection";
|
|
7
8
|
|
|
8
9
|
//#region src/parser/service/common.ts
|
|
9
10
|
const functionSchema = z.custom((val) => typeof val === "function");
|
|
@@ -41,9 +42,316 @@ function loadFilesWithIgnores(config) {
|
|
|
41
42
|
return files;
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/parser/service/tailordb/relation.ts
|
|
47
|
+
const relationTypes = {
|
|
48
|
+
"1-1": "1-1",
|
|
49
|
+
oneToOne: "1-1",
|
|
50
|
+
"n-1": "n-1",
|
|
51
|
+
manyToOne: "n-1",
|
|
52
|
+
"N-1": "n-1",
|
|
53
|
+
keyOnly: "keyOnly"
|
|
54
|
+
};
|
|
55
|
+
const relationTypesKeys = Object.keys(relationTypes);
|
|
56
|
+
function fieldRef(context) {
|
|
57
|
+
return `Field "${context.fieldName}" on type "${context.typeName}"`;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Validate relation configuration.
|
|
61
|
+
* @param rawRelation - Raw relation configuration from TailorDB type definition
|
|
62
|
+
* @param context - Context information for the relation (type name, field name, all type names)
|
|
63
|
+
*/
|
|
64
|
+
function validateRelationConfig(rawRelation, context) {
|
|
65
|
+
if (!rawRelation.type) throw new Error(`${fieldRef(context)} has a relation but is missing the required 'type' property. Valid values: ${relationTypesKeys.join(", ")}.`);
|
|
66
|
+
if (!(rawRelation.type in relationTypes)) throw new Error(`${fieldRef(context)} has invalid relation type '${rawRelation.type}'. Valid values: ${relationTypesKeys.join(", ")}.`);
|
|
67
|
+
if (rawRelation.toward.type !== "self" && !context.allTypeNames.has(rawRelation.toward.type)) throw new Error(`${fieldRef(context)} references unknown type "${rawRelation.toward.type}".`);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Process raw relation config and compute derived metadata values.
|
|
71
|
+
* @param rawRelation - Raw relation configuration
|
|
72
|
+
* @param context - Context information for the relation
|
|
73
|
+
* @param isArrayField - Whether the target field is an array field
|
|
74
|
+
* @returns Computed relation metadata to apply to field config
|
|
75
|
+
*/
|
|
76
|
+
function processRelationMetadata(rawRelation, context, isArrayField = false) {
|
|
77
|
+
const isUnique = relationTypes[rawRelation.type] === "1-1";
|
|
78
|
+
const key = rawRelation.toward.key ?? "id";
|
|
79
|
+
const targetTypeName = rawRelation.toward.type === "self" ? context.typeName : rawRelation.toward.type;
|
|
80
|
+
const shouldSetIndex = !isArrayField;
|
|
81
|
+
const shouldSetUnique = !isArrayField && isUnique;
|
|
82
|
+
return {
|
|
83
|
+
index: shouldSetIndex,
|
|
84
|
+
foreignKey: true,
|
|
85
|
+
relationType: rawRelation.type,
|
|
86
|
+
unique: shouldSetUnique,
|
|
87
|
+
foreignKeyType: targetTypeName,
|
|
88
|
+
foreignKeyField: key
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Build relation info for creating forward/backward relationships.
|
|
93
|
+
* Returns undefined for keyOnly relations.
|
|
94
|
+
* @param rawRelation - Raw relation configuration
|
|
95
|
+
* @param context - Context information for the relation
|
|
96
|
+
* @returns Relation information or undefined for keyOnly relations
|
|
97
|
+
*/
|
|
98
|
+
function buildRelationInfo(rawRelation, context) {
|
|
99
|
+
if (rawRelation.type === "keyOnly") return;
|
|
100
|
+
const isUnique = relationTypes[rawRelation.type] === "1-1";
|
|
101
|
+
const key = rawRelation.toward.key ?? "id";
|
|
102
|
+
const targetTypeName = rawRelation.toward.type === "self" ? context.typeName : rawRelation.toward.type;
|
|
103
|
+
let forwardName = rawRelation.toward.as;
|
|
104
|
+
if (!forwardName) if (rawRelation.toward.type === "self") forwardName = context.fieldName.replace(/(ID|Id|id)$/u, "");
|
|
105
|
+
else forwardName = inflection.camelize(targetTypeName, true);
|
|
106
|
+
return {
|
|
107
|
+
targetType: targetTypeName,
|
|
108
|
+
forwardName,
|
|
109
|
+
backwardName: rawRelation.backward ?? "",
|
|
110
|
+
key,
|
|
111
|
+
unique: isUnique
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Apply processed relation metadata to field config.
|
|
116
|
+
* @param fieldConfig - Original operator field configuration
|
|
117
|
+
* @param metadata - Processed relation metadata to apply
|
|
118
|
+
* @returns Field config with relation metadata applied
|
|
119
|
+
*/
|
|
120
|
+
function applyRelationMetadataToFieldConfig(fieldConfig, metadata) {
|
|
121
|
+
return {
|
|
122
|
+
...fieldConfig,
|
|
123
|
+
index: metadata.index,
|
|
124
|
+
foreignKey: metadata.foreignKey,
|
|
125
|
+
unique: metadata.unique,
|
|
126
|
+
foreignKeyType: metadata.foreignKeyType,
|
|
127
|
+
foreignKeyField: metadata.foreignKeyField
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/parser/service/tailordb/schema.ts
|
|
133
|
+
/**
|
|
134
|
+
* Normalize GqlOperationsConfig (alias or object) to GqlOperations object.
|
|
135
|
+
* "query" alias expands to read-only mode: { create: false, update: false, delete: false, read: true }
|
|
136
|
+
* @param config - The config to normalize
|
|
137
|
+
* @returns The normalized GqlOperations object
|
|
138
|
+
*/
|
|
139
|
+
function normalizeGqlOperations(config) {
|
|
140
|
+
if (config === "query") return {
|
|
141
|
+
create: false,
|
|
142
|
+
update: false,
|
|
143
|
+
delete: false,
|
|
144
|
+
read: true
|
|
145
|
+
};
|
|
146
|
+
return config;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Zod schema for GqlOperations configuration with normalization transform.
|
|
150
|
+
* Accepts "query" alias or detailed object, normalizes to GqlOperations object.
|
|
151
|
+
*/
|
|
152
|
+
const GqlOperationsSchema = z.union([z.literal("query"), z.strictObject({
|
|
153
|
+
create: z.boolean().optional().describe("Enable create mutation (default: true)"),
|
|
154
|
+
update: z.boolean().optional().describe("Enable update mutation (default: true)"),
|
|
155
|
+
delete: z.boolean().optional().describe("Enable delete mutation (default: true)"),
|
|
156
|
+
read: z.boolean().optional().describe("Enable read queries - get, list, aggregation (default: true)")
|
|
157
|
+
})]).describe("Configuration for GraphQL operations on a TailorDB type.\nAll operations are enabled by default (undefined or true = enabled, false = disabled).").transform((val) => normalizeGqlOperations(val));
|
|
158
|
+
const TailorFieldTypeSchema$1 = z.enum([
|
|
159
|
+
"uuid",
|
|
160
|
+
"string",
|
|
161
|
+
"boolean",
|
|
162
|
+
"integer",
|
|
163
|
+
"float",
|
|
164
|
+
"decimal",
|
|
165
|
+
"enum",
|
|
166
|
+
"date",
|
|
167
|
+
"datetime",
|
|
168
|
+
"time",
|
|
169
|
+
"nested"
|
|
170
|
+
]);
|
|
171
|
+
const AllowedValueSchema$1 = z.strictObject({
|
|
172
|
+
value: z.string(),
|
|
173
|
+
description: z.string().optional()
|
|
174
|
+
});
|
|
175
|
+
const DBFieldMetadataSchema = z.strictObject({
|
|
176
|
+
required: z.boolean().optional().describe("Whether the field is required"),
|
|
177
|
+
array: z.boolean().optional().describe("Whether the field is an array"),
|
|
178
|
+
description: z.string().optional().describe("Field description"),
|
|
179
|
+
typeName: z.string().optional().describe("Type name for nested or enum fields"),
|
|
180
|
+
allowedValues: z.array(AllowedValueSchema$1).optional().describe("Allowed values for enum fields"),
|
|
181
|
+
index: z.boolean().optional().describe("Whether the field is indexed for faster queries"),
|
|
182
|
+
unique: z.boolean().optional().describe("Whether the field value must be unique"),
|
|
183
|
+
vector: z.boolean().optional().describe("Whether the field is a vector field for similarity search"),
|
|
184
|
+
foreignKey: z.boolean().optional().describe("Whether the field is a foreign key"),
|
|
185
|
+
foreignKeyType: z.string().optional().describe("Target type name for foreign key relations"),
|
|
186
|
+
foreignKeyField: z.string().optional().describe("Target field name for foreign key relations"),
|
|
187
|
+
hooks: z.strictObject({
|
|
188
|
+
create: functionSchema.optional().describe("Hook function called on record creation"),
|
|
189
|
+
update: functionSchema.optional().describe("Hook function called on record update")
|
|
190
|
+
}).optional().describe("Lifecycle hooks for the field"),
|
|
191
|
+
validate: z.array(z.union([functionSchema, z.tuple([functionSchema, z.string()])])).optional().describe("Validation functions for the field"),
|
|
192
|
+
serial: z.strictObject({
|
|
193
|
+
start: z.number().describe("Starting value for the serial sequence"),
|
|
194
|
+
maxValue: z.number().optional().describe("Maximum value for the serial sequence"),
|
|
195
|
+
format: z.string().optional().describe("Format string for serial value (string type only)")
|
|
196
|
+
}).optional().describe("Serial (auto-increment) configuration"),
|
|
197
|
+
scale: z.number().int().min(0).max(12).optional().describe("Decimal scale (number of digits after decimal point, 0-12)")
|
|
198
|
+
});
|
|
199
|
+
const RelationTypeSchema = z.enum(relationTypesKeys);
|
|
200
|
+
const RawRelationConfigSchema = z.strictObject({
|
|
201
|
+
type: RelationTypeSchema.describe("Relation cardinality type"),
|
|
202
|
+
toward: z.strictObject({
|
|
203
|
+
type: z.string().describe("Target type name, or 'self' for self-relations"),
|
|
204
|
+
as: z.string().optional().describe("Custom forward relation name"),
|
|
205
|
+
key: z.string().optional().describe("Target field to join on (default: 'id')")
|
|
206
|
+
}),
|
|
207
|
+
backward: z.string().optional().describe("Backward relation name on the target type")
|
|
208
|
+
});
|
|
209
|
+
const TailorDBFieldSchema = z.lazy(() => z.object({
|
|
210
|
+
type: TailorFieldTypeSchema$1,
|
|
211
|
+
fields: z.record(z.string(), TailorDBFieldSchema).optional(),
|
|
212
|
+
metadata: DBFieldMetadataSchema,
|
|
213
|
+
rawRelation: RawRelationConfigSchema.optional()
|
|
214
|
+
}));
|
|
215
|
+
/**
|
|
216
|
+
* Schema for TailorDB type settings.
|
|
217
|
+
* Normalizes gqlOperations from alias ("query") to object format.
|
|
218
|
+
*/
|
|
219
|
+
const TailorDBTypeSettingsSchema = z.strictObject({
|
|
220
|
+
pluralForm: z.string().optional().describe("Custom plural form of the type name for GraphQL"),
|
|
221
|
+
aggregation: z.boolean().optional().describe("Enable aggregation queries for this type"),
|
|
222
|
+
bulkUpsert: z.boolean().optional().describe("Enable bulk upsert mutation for this type"),
|
|
223
|
+
gqlOperations: GqlOperationsSchema.optional().describe("Configure GraphQL operations for this type. Use \"query\" for read-only mode, or an object for granular control."),
|
|
224
|
+
publishEvents: z.boolean().optional().describe("Enable publishing events for this type.\nWhen enabled, record creation/update/deletion events are published.\nIf not specified, this is automatically set to true when an executor uses this type\nwith recordCreated/recordUpdated/recordDeleted triggers. If explicitly set to false\nwhile an executor uses this type, an error will be thrown during apply.")
|
|
225
|
+
});
|
|
226
|
+
const GQL_PERMISSION_INVALID_OPERAND_MESSAGE = "operand is not supported in gqlPermission. Use permission() for record-level conditions.";
|
|
227
|
+
const GqlPermissionOperandSchema = z.union([
|
|
228
|
+
z.strictObject({ user: z.string() }),
|
|
229
|
+
z.string(),
|
|
230
|
+
z.boolean(),
|
|
231
|
+
z.array(z.string()),
|
|
232
|
+
z.array(z.boolean())
|
|
233
|
+
], { error: (issue) => {
|
|
234
|
+
if (typeof issue.input === "object" && issue.input !== null) {
|
|
235
|
+
const keys = Object.keys(issue.input);
|
|
236
|
+
if (keys.length === 1) return `"${keys[0]}" ${GQL_PERMISSION_INVALID_OPERAND_MESSAGE}`;
|
|
237
|
+
return "Operand object must have exactly 1 key";
|
|
238
|
+
}
|
|
239
|
+
return "Invalid operand in gqlPermission";
|
|
240
|
+
} });
|
|
241
|
+
const RecordPermissionOperandSchema = z.union([
|
|
242
|
+
GqlPermissionOperandSchema,
|
|
243
|
+
z.strictObject({ record: z.string() }),
|
|
244
|
+
z.strictObject({ oldRecord: z.string() }),
|
|
245
|
+
z.strictObject({ newRecord: z.string() })
|
|
246
|
+
]);
|
|
247
|
+
const PermissionOperatorSchema = z.enum([
|
|
248
|
+
"=",
|
|
249
|
+
"!=",
|
|
250
|
+
"in",
|
|
251
|
+
"not in",
|
|
252
|
+
"hasAny",
|
|
253
|
+
"not hasAny"
|
|
254
|
+
]);
|
|
255
|
+
const RecordPermissionConditionSchema = z.tuple([
|
|
256
|
+
RecordPermissionOperandSchema,
|
|
257
|
+
PermissionOperatorSchema,
|
|
258
|
+
RecordPermissionOperandSchema
|
|
259
|
+
]).readonly();
|
|
260
|
+
const GqlPermissionConditionSchema = z.tuple([
|
|
261
|
+
GqlPermissionOperandSchema,
|
|
262
|
+
PermissionOperatorSchema,
|
|
263
|
+
GqlPermissionOperandSchema
|
|
264
|
+
]).readonly();
|
|
265
|
+
const ActionPermissionSchema = z.union([
|
|
266
|
+
z.strictObject({
|
|
267
|
+
conditions: z.union([RecordPermissionConditionSchema, z.array(RecordPermissionConditionSchema).readonly()]),
|
|
268
|
+
description: z.string().optional(),
|
|
269
|
+
permit: z.boolean().optional()
|
|
270
|
+
}),
|
|
271
|
+
z.tuple([
|
|
272
|
+
RecordPermissionOperandSchema,
|
|
273
|
+
PermissionOperatorSchema,
|
|
274
|
+
RecordPermissionOperandSchema
|
|
275
|
+
]).readonly(),
|
|
276
|
+
z.tuple([
|
|
277
|
+
RecordPermissionOperandSchema,
|
|
278
|
+
PermissionOperatorSchema,
|
|
279
|
+
RecordPermissionOperandSchema,
|
|
280
|
+
z.boolean()
|
|
281
|
+
]).readonly(),
|
|
282
|
+
z.array(z.union([RecordPermissionConditionSchema, z.boolean()])).refine((arr) => {
|
|
283
|
+
const boolIndex = arr.findIndex((item) => typeof item === "boolean");
|
|
284
|
+
return boolIndex === -1 || boolIndex === arr.length - 1;
|
|
285
|
+
}, { message: "Boolean permit flag must only appear at the end" }).readonly()
|
|
286
|
+
]);
|
|
287
|
+
const GqlPermissionActionSchema = z.enum([
|
|
288
|
+
"read",
|
|
289
|
+
"create",
|
|
290
|
+
"update",
|
|
291
|
+
"delete",
|
|
292
|
+
"aggregate",
|
|
293
|
+
"bulkUpsert"
|
|
294
|
+
]);
|
|
295
|
+
const GqlPermissionPolicySchema = z.strictObject({
|
|
296
|
+
conditions: z.array(GqlPermissionConditionSchema).readonly(),
|
|
297
|
+
actions: z.union([z.literal("all"), z.array(GqlPermissionActionSchema).readonly()]),
|
|
298
|
+
permit: z.boolean().optional(),
|
|
299
|
+
description: z.string().optional()
|
|
300
|
+
});
|
|
301
|
+
const RawPermissionsSchema = z.strictObject({
|
|
302
|
+
record: z.strictObject({
|
|
303
|
+
create: z.array(ActionPermissionSchema).readonly(),
|
|
304
|
+
read: z.array(ActionPermissionSchema).readonly(),
|
|
305
|
+
update: z.array(ActionPermissionSchema).readonly(),
|
|
306
|
+
delete: z.array(ActionPermissionSchema).readonly()
|
|
307
|
+
}).optional(),
|
|
308
|
+
gql: z.array(GqlPermissionPolicySchema).readonly().optional()
|
|
309
|
+
});
|
|
310
|
+
const TailorDBTypeSchema = z.strictObject({
|
|
311
|
+
name: z.string(),
|
|
312
|
+
fields: z.record(z.string(), TailorDBFieldSchema),
|
|
313
|
+
metadata: z.object({
|
|
314
|
+
name: z.string(),
|
|
315
|
+
description: z.string().optional(),
|
|
316
|
+
settings: TailorDBTypeSettingsSchema.optional(),
|
|
317
|
+
permissions: RawPermissionsSchema,
|
|
318
|
+
files: z.record(z.string(), z.string()),
|
|
319
|
+
indexes: z.record(z.string(), z.strictObject({
|
|
320
|
+
fields: z.array(z.string()),
|
|
321
|
+
unique: z.boolean().optional()
|
|
322
|
+
})).optional()
|
|
323
|
+
}).strict()
|
|
324
|
+
});
|
|
325
|
+
const TailorDBMigrationConfigSchema = z.strictObject({
|
|
326
|
+
directory: z.string().describe("Directory containing migration files"),
|
|
327
|
+
machineUser: z.string().optional().describe("Machine user name for migration execution")
|
|
328
|
+
});
|
|
329
|
+
/**
|
|
330
|
+
* Schema for TailorDB service configuration.
|
|
331
|
+
* Normalizes gqlOperations from alias ("query") to object format.
|
|
332
|
+
*/
|
|
333
|
+
const TailorDBServiceConfigSchema = z.strictObject({
|
|
334
|
+
files: z.array(z.string()).describe("Glob patterns for TailorDB type definition files"),
|
|
335
|
+
ignores: z.array(z.string()).optional().describe("Glob patterns to exclude from type discovery"),
|
|
336
|
+
erdSite: z.string().optional().describe("URL for the ERD (Entity Relationship Diagram) site"),
|
|
337
|
+
migration: TailorDBMigrationConfigSchema.optional().describe("Migration configuration"),
|
|
338
|
+
gqlOperations: GqlOperationsSchema.optional().describe("Default GraphQL operations for all types in this service")
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/parser/service/tailordb/builder-helpers.ts
|
|
343
|
+
const TAILORDB_TYPE_SCHEMA_KEYS = TailorDBTypeSchema.keyof().options;
|
|
344
|
+
function stripTailorDBTypeBuilderHelpers(type) {
|
|
345
|
+
if (!isSdkBranded(type, "tailordb-type")) return type;
|
|
346
|
+
const config = {};
|
|
347
|
+
const input = type;
|
|
348
|
+
for (const key of TAILORDB_TYPE_SCHEMA_KEYS) if (Object.prototype.hasOwnProperty.call(input, key)) config[key] = input[key];
|
|
349
|
+
return config;
|
|
350
|
+
}
|
|
351
|
+
|
|
44
352
|
//#endregion
|
|
45
353
|
//#region src/parser/service/auth-connection/schema.ts
|
|
46
|
-
const AuthConnectionOAuth2ConfigSchema = z.
|
|
354
|
+
const AuthConnectionOAuth2ConfigSchema = z.strictObject({
|
|
47
355
|
providerUrl: z.string().describe("OAuth2 provider URL"),
|
|
48
356
|
issuerUrl: z.string().describe("OAuth2 issuer URL"),
|
|
49
357
|
clientId: z.string().describe("OAuth2 client ID"),
|
|
@@ -51,7 +359,7 @@ const AuthConnectionOAuth2ConfigSchema = z.object({
|
|
|
51
359
|
authUrl: z.string().optional().describe("OAuth2 authorization endpoint override"),
|
|
52
360
|
tokenUrl: z.string().optional().describe("OAuth2 token endpoint override")
|
|
53
361
|
});
|
|
54
|
-
const AuthConnectionConfigSchema =
|
|
362
|
+
const AuthConnectionConfigSchema = AuthConnectionOAuth2ConfigSchema.extend({ type: z.literal("oauth2").describe("Connection type") });
|
|
55
363
|
|
|
56
364
|
//#endregion
|
|
57
365
|
//#region src/parser/service/field/schema.ts
|
|
@@ -68,19 +376,20 @@ const TailorFieldTypeSchema = z.enum([
|
|
|
68
376
|
"time",
|
|
69
377
|
"nested"
|
|
70
378
|
]);
|
|
71
|
-
const AllowedValueSchema = z.
|
|
379
|
+
const AllowedValueSchema = z.strictObject({
|
|
72
380
|
value: z.string().describe("The allowed value"),
|
|
73
381
|
description: z.string().optional().describe("Description of the allowed value")
|
|
74
382
|
});
|
|
75
|
-
const FieldMetadataSchema = z.
|
|
383
|
+
const FieldMetadataSchema = z.strictObject({
|
|
76
384
|
required: z.boolean().optional().describe("Whether the field is required"),
|
|
77
385
|
array: z.boolean().optional().describe("Whether the field is an array"),
|
|
78
386
|
description: z.string().optional().describe("Field description"),
|
|
79
387
|
allowedValues: z.array(AllowedValueSchema).optional().describe("Allowed values for enum fields"),
|
|
80
|
-
hooks: z.
|
|
388
|
+
hooks: z.strictObject({
|
|
81
389
|
create: functionSchema.optional().describe("Hook function called on creation"),
|
|
82
390
|
update: functionSchema.optional().describe("Hook function called on update")
|
|
83
391
|
}).optional().describe("Lifecycle hooks"),
|
|
392
|
+
validate: z.array(z.union([functionSchema, z.tuple([functionSchema, z.string()])])).optional().describe("Validation functions for the field"),
|
|
84
393
|
typeName: z.string().optional().describe("Type name for nested or enum fields")
|
|
85
394
|
});
|
|
86
395
|
const TailorFieldSchema = z.object({
|
|
@@ -93,16 +402,16 @@ const TailorFieldSchema = z.object({
|
|
|
93
402
|
|
|
94
403
|
//#endregion
|
|
95
404
|
//#region src/parser/service/auth/schema.ts
|
|
96
|
-
const AuthInvokerObjectSchema = z.
|
|
405
|
+
const AuthInvokerObjectSchema = z.strictObject({
|
|
97
406
|
namespace: z.string().describe("Auth namespace"),
|
|
98
407
|
machineUserName: z.string().describe("Machine user name for authentication")
|
|
99
408
|
});
|
|
100
409
|
const AuthInvokerSchema = z.union([z.string().describe("Machine user name (namespace auto-resolved from auth service)"), AuthInvokerObjectSchema]);
|
|
101
|
-
const secretValueSchema = z.
|
|
410
|
+
const secretValueSchema = z.strictObject({
|
|
102
411
|
vaultName: z.string().describe("Vault name containing the secret"),
|
|
103
412
|
secretKey: z.string().describe("Key of the secret in the vault")
|
|
104
413
|
});
|
|
105
|
-
const OIDCSchema = z.
|
|
414
|
+
const OIDCSchema = z.strictObject({
|
|
106
415
|
name: z.string().describe("Identity provider name"),
|
|
107
416
|
kind: z.literal("OIDC"),
|
|
108
417
|
clientID: z.string().describe("OAuth2 client ID"),
|
|
@@ -111,7 +420,7 @@ const OIDCSchema = z.object({
|
|
|
111
420
|
issuerURL: z.string().optional().describe("OIDC issuer URL (defaults to providerURL)"),
|
|
112
421
|
usernameClaim: z.string().optional().describe("JWT claim to use as username")
|
|
113
422
|
});
|
|
114
|
-
const SAMLSchema = z.
|
|
423
|
+
const SAMLSchema = z.strictObject({
|
|
115
424
|
name: z.string().describe("Identity provider name"),
|
|
116
425
|
kind: z.literal("SAML"),
|
|
117
426
|
enableSignRequest: z.boolean().default(false).describe("Enable signing of SAML requests"),
|
|
@@ -121,7 +430,7 @@ const SAMLSchema = z.object({
|
|
|
121
430
|
}).refine((value) => {
|
|
122
431
|
return value.metadataURL !== void 0 !== (value.rawMetadata !== void 0);
|
|
123
432
|
}, "Provide either metadataURL or rawMetadata");
|
|
124
|
-
const IDTokenSchema = z.
|
|
433
|
+
const IDTokenSchema = z.strictObject({
|
|
125
434
|
name: z.string().describe("Identity provider name"),
|
|
126
435
|
kind: z.literal("IDToken"),
|
|
127
436
|
providerURL: z.string().describe("ID token provider URL"),
|
|
@@ -129,7 +438,7 @@ const IDTokenSchema = z.object({
|
|
|
129
438
|
clientID: z.string().describe("Client ID for ID token validation"),
|
|
130
439
|
usernameClaim: z.string().optional().describe("JWT claim to use as username")
|
|
131
440
|
});
|
|
132
|
-
const BuiltinIdPSchema = z.
|
|
441
|
+
const BuiltinIdPSchema = z.strictObject({
|
|
133
442
|
name: z.string().describe("Identity provider name"),
|
|
134
443
|
kind: z.literal("BuiltInIdP"),
|
|
135
444
|
namespace: z.string().describe("IdP namespace"),
|
|
@@ -142,7 +451,7 @@ const IdProviderSchema = z.discriminatedUnion("kind", [
|
|
|
142
451
|
BuiltinIdPSchema
|
|
143
452
|
]);
|
|
144
453
|
const OAuth2ClientGrantTypeSchema = z.union([z.literal("authorization_code"), z.literal("refresh_token")]).describe("OAuth2 grant type");
|
|
145
|
-
const OAuth2ClientSchema = z.
|
|
454
|
+
const OAuth2ClientSchema = z.strictObject({
|
|
146
455
|
description: z.string().optional().describe("Client description"),
|
|
147
456
|
grantTypes: z.array(OAuth2ClientGrantTypeSchema).default(["authorization_code", "refresh_token"]).describe("Allowed OAuth2 grant types"),
|
|
148
457
|
redirectURIs: z.array(z.union([
|
|
@@ -173,7 +482,7 @@ const OAuth2ClientSchema = z.object({
|
|
|
173
482
|
message: "requireDpop cannot be set to true for browser clients as they don't support DPoP",
|
|
174
483
|
path: ["requireDpop"]
|
|
175
484
|
});
|
|
176
|
-
const SCIMAuthorizationSchema = z.
|
|
485
|
+
const SCIMAuthorizationSchema = z.strictObject({
|
|
177
486
|
type: z.union([z.literal("oauth2"), z.literal("bearer")]).describe("SCIM authorization type"),
|
|
178
487
|
bearerSecret: secretValueSchema.optional().describe("Bearer token secret (required for bearer type)")
|
|
179
488
|
});
|
|
@@ -184,7 +493,7 @@ const SCIMAttributeTypeSchema = z.union([
|
|
|
184
493
|
z.literal("datetime"),
|
|
185
494
|
z.literal("complex")
|
|
186
495
|
]).describe("SCIM attribute data type");
|
|
187
|
-
const SCIMAttributeSchema = z.
|
|
496
|
+
const SCIMAttributeSchema = z.strictObject({
|
|
188
497
|
type: SCIMAttributeTypeSchema.describe("Attribute data type"),
|
|
189
498
|
name: z.string().describe("Attribute name"),
|
|
190
499
|
description: z.string().optional().describe("Attribute description"),
|
|
@@ -205,46 +514,34 @@ const SCIMAttributeSchema = z.object({
|
|
|
205
514
|
return z.array(SCIMAttributeSchema).nullable().optional();
|
|
206
515
|
}
|
|
207
516
|
});
|
|
208
|
-
const SCIMSchemaSchema = z.
|
|
517
|
+
const SCIMSchemaSchema = z.strictObject({
|
|
209
518
|
name: z.string().describe("SCIM schema name"),
|
|
210
519
|
attributes: z.array(SCIMAttributeSchema).describe("Schema attributes")
|
|
211
520
|
});
|
|
212
|
-
const SCIMAttributeMappingSchema = z.
|
|
521
|
+
const SCIMAttributeMappingSchema = z.strictObject({
|
|
213
522
|
tailorDBField: z.string().describe("TailorDB field name to map to"),
|
|
214
523
|
scimPath: z.string().describe("SCIM attribute path")
|
|
215
524
|
});
|
|
216
|
-
const SCIMResourceSchema = z.
|
|
525
|
+
const SCIMResourceSchema = z.strictObject({
|
|
217
526
|
name: z.string().describe("SCIM resource name"),
|
|
218
527
|
tailorDBNamespace: z.string().describe("TailorDB namespace for the resource"),
|
|
219
528
|
tailorDBType: z.string().describe("TailorDB type name for the resource"),
|
|
220
529
|
coreSchema: SCIMSchemaSchema.describe("Core SCIM schema definition"),
|
|
221
530
|
attributeMapping: z.array(SCIMAttributeMappingSchema).describe("Attribute mapping configuration")
|
|
222
531
|
});
|
|
223
|
-
const SCIMSchema = z.
|
|
532
|
+
const SCIMSchema = z.strictObject({
|
|
224
533
|
machineUserName: z.string().describe("Machine user name for SCIM operations"),
|
|
225
534
|
authorization: SCIMAuthorizationSchema.describe("SCIM authorization configuration"),
|
|
226
535
|
resources: z.array(SCIMResourceSchema).describe("SCIM resource definitions")
|
|
227
536
|
});
|
|
228
|
-
const TenantProviderSchema = z.
|
|
537
|
+
const TenantProviderSchema = z.strictObject({
|
|
229
538
|
namespace: z.string().describe("TailorDB namespace for the tenant type"),
|
|
230
539
|
type: z.string().describe("TailorDB type name for tenants"),
|
|
231
540
|
signatureField: z.string().describe("Field used as the tenant signature")
|
|
232
541
|
});
|
|
233
|
-
const UserProfileSchema = z.
|
|
542
|
+
const UserProfileSchema = z.strictObject({
|
|
234
543
|
namespace: z.string().optional().describe("TailorDB namespace where the user type is defined"),
|
|
235
|
-
type: z.
|
|
236
|
-
name: z.string(),
|
|
237
|
-
fields: z.any(),
|
|
238
|
-
metadata: z.any(),
|
|
239
|
-
hooks: z.any(),
|
|
240
|
-
validate: z.any(),
|
|
241
|
-
features: z.any(),
|
|
242
|
-
indexes: z.any(),
|
|
243
|
-
files: z.any(),
|
|
244
|
-
permission: z.any(),
|
|
245
|
-
gqlPermission: z.any(),
|
|
246
|
-
_output: z.any()
|
|
247
|
-
}),
|
|
544
|
+
type: z.custom().transform(stripTailorDBTypeBuilderHelpers).pipe(TailorDBTypeSchema),
|
|
248
545
|
usernameField: z.string(),
|
|
249
546
|
attributes: z.record(z.string(), z.literal(true)).optional(),
|
|
250
547
|
attributeList: z.array(z.string()).optional()
|
|
@@ -255,17 +552,17 @@ const ValueOperandSchema = z.union([
|
|
|
255
552
|
z.array(z.string()),
|
|
256
553
|
z.array(z.boolean())
|
|
257
554
|
]);
|
|
258
|
-
const MachineUserSchema = z.
|
|
555
|
+
const MachineUserSchema = z.strictObject({
|
|
259
556
|
attributes: z.record(z.string(), ValueOperandSchema).optional(),
|
|
260
557
|
attributeList: z.array(z.uuid()).optional()
|
|
261
558
|
});
|
|
262
|
-
const BeforeLoginHookSchema = z.
|
|
559
|
+
const BeforeLoginHookSchema = z.strictObject({
|
|
263
560
|
handler: z.function(),
|
|
264
561
|
invoker: z.string()
|
|
265
562
|
});
|
|
266
|
-
const AuthConfigBaseSchema = z.
|
|
563
|
+
const AuthConfigBaseSchema = z.strictObject({
|
|
267
564
|
name: z.string().describe("Auth service name"),
|
|
268
|
-
hooks: z.
|
|
565
|
+
hooks: z.strictObject({ beforeLogin: BeforeLoginHookSchema.optional().describe("Before login auth hook") }).optional().describe("Auth hooks"),
|
|
269
566
|
machineUsers: z.record(z.string(), MachineUserSchema).optional().describe("Machine user definitions"),
|
|
270
567
|
oauth2Clients: z.record(z.string(), OAuth2ClientSchema).optional().describe("OAuth2 client definitions"),
|
|
271
568
|
idProvider: IdProviderSchema.optional().describe("Identity provider configuration"),
|
|
@@ -288,7 +585,7 @@ const AuthConfigSchema = z.xor([AuthConfigBaseSchema.extend({
|
|
|
288
585
|
|
|
289
586
|
//#endregion
|
|
290
587
|
//#region src/parser/service/executor/schema.ts
|
|
291
|
-
const TailorDBTriggerSchema = z.
|
|
588
|
+
const TailorDBTriggerSchema = z.strictObject({
|
|
292
589
|
kind: z.literal("tailordb").describe("TailorDB record event trigger"),
|
|
293
590
|
events: z.array(z.enum([
|
|
294
591
|
"tailordb.type_record.created",
|
|
@@ -298,25 +595,25 @@ const TailorDBTriggerSchema = z.object({
|
|
|
298
595
|
typeName: z.string().describe("TailorDB type name to watch for events"),
|
|
299
596
|
condition: functionSchema.optional().describe("Condition function to filter events")
|
|
300
597
|
});
|
|
301
|
-
const ResolverExecutedTriggerSchema = z.
|
|
598
|
+
const ResolverExecutedTriggerSchema = z.strictObject({
|
|
302
599
|
kind: z.literal("resolverExecuted"),
|
|
303
600
|
resolverName: z.string().describe("Name of the resolver to trigger on"),
|
|
304
601
|
condition: functionSchema.optional().describe("Condition function to filter events")
|
|
305
602
|
});
|
|
306
|
-
const ScheduleTriggerSchema = z.
|
|
603
|
+
const ScheduleTriggerSchema = z.strictObject({
|
|
307
604
|
kind: z.literal("schedule"),
|
|
308
605
|
cron: z.string().describe("CRON expression for the schedule"),
|
|
309
606
|
timezone: z.string().optional().default("UTC").describe("Timezone for the CRON schedule (default: UTC)")
|
|
310
607
|
});
|
|
311
|
-
const IncomingWebhookTriggerResponseSchema = z.
|
|
608
|
+
const IncomingWebhookTriggerResponseSchema = z.strictObject({
|
|
312
609
|
body: functionSchema.optional().describe("Function returning the response body"),
|
|
313
610
|
statusCode: z.number().int().optional().describe("HTTP status code for the response")
|
|
314
611
|
});
|
|
315
|
-
const IncomingWebhookTriggerSchema = z.
|
|
612
|
+
const IncomingWebhookTriggerSchema = z.strictObject({
|
|
316
613
|
kind: z.literal("incomingWebhook"),
|
|
317
614
|
response: IncomingWebhookTriggerResponseSchema.optional().describe("Response configuration")
|
|
318
615
|
});
|
|
319
|
-
const IdpUserTriggerSchema = z.
|
|
616
|
+
const IdpUserTriggerSchema = z.strictObject({
|
|
320
617
|
kind: z.literal("idpUser").describe("IdP user event trigger"),
|
|
321
618
|
events: z.array(z.enum([
|
|
322
619
|
"idp.user.created",
|
|
@@ -325,7 +622,7 @@ const IdpUserTriggerSchema = z.object({
|
|
|
325
622
|
])).min(1).transform((arr) => [...new Set(arr)]).describe("IdP user event types to trigger on"),
|
|
326
623
|
idp: z.string().optional().describe("IdP namespace name to subscribe to. If omitted, the project's only IdP is used; throws when multiple IdPs exist.")
|
|
327
624
|
});
|
|
328
|
-
const AuthAccessTokenTriggerSchema = z.
|
|
625
|
+
const AuthAccessTokenTriggerSchema = z.strictObject({
|
|
329
626
|
kind: z.literal("authAccessToken").describe("Auth access token event trigger"),
|
|
330
627
|
events: z.array(z.enum([
|
|
331
628
|
"auth.access_token.issued",
|
|
@@ -341,23 +638,23 @@ const TriggerSchema = z.discriminatedUnion("kind", [
|
|
|
341
638
|
IdpUserTriggerSchema,
|
|
342
639
|
AuthAccessTokenTriggerSchema
|
|
343
640
|
]);
|
|
344
|
-
const FunctionOperationSchema = z.
|
|
641
|
+
const FunctionOperationSchema = z.strictObject({
|
|
345
642
|
kind: z.enum(["function", "jobFunction"]),
|
|
346
643
|
body: functionSchema.describe("Function implementation"),
|
|
347
644
|
invoker: AuthInvokerSchema.optional().describe("Invoker for the function execution")
|
|
348
|
-
})
|
|
349
|
-
const GqlOperationSchema = z.
|
|
645
|
+
});
|
|
646
|
+
const GqlOperationSchema = z.strictObject({
|
|
350
647
|
kind: z.literal("graphql"),
|
|
351
648
|
appName: z.string().optional().describe("Target application name for the GraphQL query"),
|
|
352
649
|
query: z.preprocess((val) => String(val), z.string().describe("GraphQL query string")),
|
|
353
650
|
variables: functionSchema.optional().describe("Function to compute GraphQL variables"),
|
|
354
651
|
invoker: AuthInvokerSchema.optional().describe("Invoker for the GraphQL execution")
|
|
355
|
-
})
|
|
356
|
-
const WebhookOperationSchema = z.
|
|
652
|
+
});
|
|
653
|
+
const WebhookOperationSchema = z.strictObject({
|
|
357
654
|
kind: z.literal("webhook"),
|
|
358
655
|
url: functionSchema.describe("Function returning the webhook URL"),
|
|
359
656
|
requestBody: functionSchema.optional().describe("Function to compute the request body"),
|
|
360
|
-
headers: z.record(z.string(), z.union([z.string(), z.
|
|
657
|
+
headers: z.record(z.string(), z.union([z.string(), z.strictObject({
|
|
361
658
|
vault: z.string(),
|
|
362
659
|
key: z.string()
|
|
363
660
|
})])).optional().describe("HTTP headers for the webhook request")
|
|
@@ -369,19 +666,19 @@ const WorkflowOperationSchema = z.preprocess((val) => {
|
|
|
369
666
|
...rest,
|
|
370
667
|
workflowName: workflow.name
|
|
371
668
|
};
|
|
372
|
-
}, z.
|
|
669
|
+
}, z.strictObject({
|
|
373
670
|
kind: z.literal("workflow"),
|
|
374
671
|
workflowName: z.string().describe("Name of the workflow to execute"),
|
|
375
672
|
args: z.union([z.record(z.string(), z.unknown()), functionSchema]).optional().describe("Arguments to pass to the workflow"),
|
|
376
673
|
invoker: AuthInvokerSchema.optional().describe("Invoker for the workflow execution")
|
|
377
|
-
})
|
|
674
|
+
}));
|
|
378
675
|
const OperationSchema = z.union([
|
|
379
676
|
FunctionOperationSchema,
|
|
380
677
|
GqlOperationSchema,
|
|
381
678
|
WebhookOperationSchema,
|
|
382
679
|
WorkflowOperationSchema
|
|
383
680
|
]);
|
|
384
|
-
const ExecutorSchema = z.
|
|
681
|
+
const ExecutorSchema = z.strictObject({
|
|
385
682
|
name: z.string().describe("Executor name"),
|
|
386
683
|
description: z.string().optional().describe("Executor description"),
|
|
387
684
|
disabled: z.boolean().optional().default(false).describe("Whether the executor is disabled"),
|
|
@@ -389,6 +686,30 @@ const ExecutorSchema = z.object({
|
|
|
389
686
|
operation: OperationSchema.describe("Operation to execute when triggered")
|
|
390
687
|
});
|
|
391
688
|
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region src/cli/services/executor/loader.ts
|
|
691
|
+
function stripExecutorTriggerArgs(executor) {
|
|
692
|
+
if (!isSdkBranded(executor, "executor")) return executor;
|
|
693
|
+
const trigger = executor.trigger;
|
|
694
|
+
if (trigger === null || typeof trigger !== "object" || !("__args" in trigger)) return executor;
|
|
695
|
+
const { __args: _args, ...triggerConfig } = trigger;
|
|
696
|
+
return {
|
|
697
|
+
...executor,
|
|
698
|
+
trigger: triggerConfig
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Load and validate an executor definition from a file.
|
|
703
|
+
* @param executorFilePath - Path to the executor file
|
|
704
|
+
* @returns Parsed executor or null if invalid
|
|
705
|
+
*/
|
|
706
|
+
async function loadExecutor(executorFilePath) {
|
|
707
|
+
const executor = (await import(pathToFileURL(executorFilePath).href)).default;
|
|
708
|
+
const parseResult = ExecutorSchema.safeParse(stripExecutorTriggerArgs(executor));
|
|
709
|
+
if (!parseResult.success) return null;
|
|
710
|
+
return parseResult.data;
|
|
711
|
+
}
|
|
712
|
+
|
|
392
713
|
//#endregion
|
|
393
714
|
//#region src/cli/services/executor/service.ts
|
|
394
715
|
/**
|
|
@@ -404,7 +725,7 @@ function createExecutorService(params) {
|
|
|
404
725
|
const loadExecutorForFile = async (executorFile) => {
|
|
405
726
|
try {
|
|
406
727
|
const executorModule = await import(pathToFileURL(executorFile).href);
|
|
407
|
-
const result = ExecutorSchema.safeParse(executorModule.default);
|
|
728
|
+
const result = ExecutorSchema.safeParse(stripExecutorTriggerArgs(executorModule.default));
|
|
408
729
|
if (result.success) {
|
|
409
730
|
const relativePath = path.relative(process.cwd(), executorFile);
|
|
410
731
|
logger.log(`Executor: ${styles.successBright(`"${result.data.name}"`)} loaded from ${styles.path(relativePath)}`);
|
|
@@ -434,6 +755,7 @@ function createExecutorService(params) {
|
|
|
434
755
|
logger.newline();
|
|
435
756
|
logger.log(`Found ${styles.highlight(executorFiles.length.toString())} executor files`);
|
|
436
757
|
await Promise.all(executorFiles.map((executorFile) => loadExecutorForFile(executorFile)));
|
|
758
|
+
assertUniqueExecutorNames(executors);
|
|
437
759
|
return executors;
|
|
438
760
|
})();
|
|
439
761
|
return loadPromise;
|
|
@@ -450,10 +772,26 @@ function createExecutorService(params) {
|
|
|
450
772
|
sourceTypeName: void 0
|
|
451
773
|
});
|
|
452
774
|
}
|
|
775
|
+
assertUniqueExecutorNames(executors);
|
|
453
776
|
}
|
|
454
777
|
};
|
|
455
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* Assert that every loaded executor has a unique name.
|
|
781
|
+
* Executors are stored by source file, so two files declaring the same
|
|
782
|
+
* `name` would otherwise silently share a single bundle cache entry.
|
|
783
|
+
* @param executors - Loaded executors keyed by source file
|
|
784
|
+
*/
|
|
785
|
+
function assertUniqueExecutorNames(executors) {
|
|
786
|
+
const seenNames = /* @__PURE__ */ new Map();
|
|
787
|
+
for (const [file, executor] of Object.entries(executors)) {
|
|
788
|
+
const relativePath = path.relative(process.cwd(), file);
|
|
789
|
+
const existing = seenNames.get(executor.name);
|
|
790
|
+
if (existing) throw new Error(`Duplicate executor name "${executor.name}" found:\n - ${existing}\n - ${relativePath}\nEach executor must have a unique name.`);
|
|
791
|
+
seenNames.set(executor.name, relativePath);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
456
794
|
|
|
457
795
|
//#endregion
|
|
458
|
-
export {
|
|
459
|
-
//# sourceMappingURL=service-
|
|
796
|
+
export { AuthConfigSchema as a, stripTailorDBTypeBuilderHelpers as c, applyRelationMetadataToFieldConfig as d, buildRelationInfo as f, functionSchema as g, loadFilesWithIgnores as h, ExecutorSchema as i, TailorDBServiceConfigSchema as l, validateRelationConfig as m, loadExecutor as n, AuthInvokerSchema as o, processRelationMetadata as p, stripExecutorTriggerArgs as r, TailorFieldSchema as s, createExecutorService as t, TailorDBTypeSchema as u };
|
|
797
|
+
//# sourceMappingURL=service-ufH7sS8o.mjs.map
|