@tailor-platform/sdk 2.0.0-next.3 → 2.0.0-next.5
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 +142 -0
- package/dist/aigateway-DR4Kwuik.mjs +9 -0
- package/dist/{aigateway-B3oZZE6v.mjs.map → aigateway-DR4Kwuik.mjs.map} +1 -1
- package/dist/{application-eHp9jXld.mjs → application-Bf8wxOi6.mjs} +701 -597
- package/dist/application-Bf8wxOi6.mjs.map +1 -0
- package/dist/application-CUkjzfij.mjs +3 -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 +2 -1
- package/dist/cli/cache/store.d.mts +1 -1
- package/dist/cli/commands/api/index.d.mts +1 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +5 -1
- package/dist/cli/commands/deploy/application.d.mts +7 -1
- package/dist/cli/commands/deploy/apply-phases.d.mts +14 -1
- package/dist/cli/commands/deploy/auth.d.mts +5 -1
- package/dist/cli/commands/deploy/deploy.d.mts +5 -0
- package/dist/cli/commands/deploy/executor.d.mts +7 -1
- package/dist/cli/commands/deploy/function-registry.d.mts +5 -0
- package/dist/cli/commands/deploy/idp.d.mts +5 -1
- package/dist/cli/commands/deploy/resolver.d.mts +5 -1
- package/dist/cli/commands/deploy/secret-manager.d.mts +5 -1
- package/dist/cli/commands/deploy/staticwebsite.d.mts +5 -1
- package/dist/cli/commands/deploy/tailordb/index.d.mts +8 -1
- package/dist/cli/commands/deploy/types.d.mts +3 -1
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +3 -0
- package/dist/cli/commands/deploy/workflow.d.mts +4 -1
- package/dist/cli/commands/executor/get.d.mts +0 -1
- package/dist/cli/commands/executor/jobs.d.mts +0 -1
- package/dist/cli/commands/executor/list.d.mts +0 -1
- package/dist/cli/commands/executor/transform.d.mts +1 -0
- package/dist/cli/commands/executor/trigger.d.mts +0 -1
- package/dist/cli/commands/executor/webhook.d.mts +0 -1
- package/dist/cli/commands/function/get.d.mts +0 -1
- package/dist/cli/commands/function/list.d.mts +0 -1
- package/dist/cli/commands/function/transform.d.mts +1 -0
- package/dist/cli/commands/generate/service.d.mts +5 -1
- package/dist/cli/commands/machineuser/list.d.mts +0 -1
- package/dist/cli/commands/machineuser/token.d.mts +0 -1
- package/dist/cli/commands/oauth2client/get.d.mts +0 -1
- package/dist/cli/commands/oauth2client/list.d.mts +0 -1
- package/dist/cli/commands/oauth2client/transform.d.mts +1 -0
- package/dist/cli/commands/organization/folder/create.d.mts +0 -1
- package/dist/cli/commands/organization/folder/delete.d.mts +0 -1
- package/dist/cli/commands/organization/folder/get.d.mts +0 -1
- package/dist/cli/commands/organization/folder/list.d.mts +0 -1
- package/dist/cli/commands/organization/folder/update.d.mts +0 -1
- package/dist/cli/commands/organization/get.d.mts +0 -1
- package/dist/cli/commands/organization/list.d.mts +0 -1
- package/dist/cli/commands/organization/transform.d.mts +2 -0
- package/dist/cli/commands/organization/tree.d.mts +0 -1
- package/dist/cli/commands/organization/update.d.mts +0 -1
- package/dist/cli/commands/remove.d.mts +0 -1
- package/dist/cli/commands/show.d.mts +9 -4
- package/dist/cli/commands/tailordb/migrate/config.d.mts +0 -1
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +16 -3
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +0 -1
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +6 -0
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -1
- package/dist/cli/commands/tailordb/truncate.d.mts +0 -1
- package/dist/cli/commands/workflow/executions.d.mts +0 -1
- package/dist/cli/commands/workflow/get.d.mts +2 -1
- package/dist/cli/commands/workflow/list.d.mts +0 -1
- package/dist/cli/commands/workflow/resume.d.mts +0 -1
- package/dist/cli/commands/workflow/start.d.mts +0 -1
- package/dist/cli/commands/workflow/status.d.mts +1 -0
- package/dist/cli/commands/workflow/transform.d.mts +1 -0
- package/dist/cli/commands/workflow/wait.d.mts +0 -1
- package/dist/cli/commands/workflow/waiter.d.mts +1 -1
- package/dist/cli/commands/workspace/app/health.d.mts +0 -1
- package/dist/cli/commands/workspace/app/list.d.mts +0 -1
- package/dist/cli/commands/workspace/app/transform.d.mts +2 -0
- package/dist/cli/commands/workspace/create.d.mts +0 -1
- package/dist/cli/commands/workspace/delete.d.mts +0 -1
- package/dist/cli/commands/workspace/get.d.mts +0 -1
- package/dist/cli/commands/workspace/list.d.mts +0 -1
- package/dist/cli/commands/workspace/restore.d.mts +0 -1
- package/dist/cli/commands/workspace/transform.d.mts +2 -0
- package/dist/cli/commands/workspace/user/invite.d.mts +0 -1
- package/dist/cli/commands/workspace/user/list.d.mts +0 -1
- package/dist/cli/commands/workspace/user/remove.d.mts +0 -1
- package/dist/cli/commands/workspace/user/transform.d.mts +1 -0
- package/dist/cli/commands/workspace/user/update.d.mts +0 -1
- package/dist/cli/index.d.mts +6 -3
- package/dist/cli/index.mjs +273 -104
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +4 -2
- package/dist/cli/lib.mjs +4 -4
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/query/index.d.mts +4 -1
- package/dist/cli/services/application.d.mts +12 -1
- package/dist/cli/services/auth/service.d.mts +2 -0
- package/dist/cli/services/executor/service.d.mts +1 -1
- package/dist/cli/services/http-adapter/bundler.d.mts +3 -1
- package/dist/cli/services/http-adapter/service.d.mts +2 -1
- package/dist/cli/services/resolver/service.d.mts +1 -1
- package/dist/cli/services/tailordb/service.d.mts +3 -1
- package/dist/cli/services/workflow/bundler.d.mts +2 -1
- package/dist/cli/services/workflow/service.d.mts +1 -1
- package/dist/cli/shared/args.d.mts +1 -1
- package/dist/cli/shared/client.d.mts +1 -1
- package/dist/cli/shared/config-loader.d.mts +0 -1
- package/dist/cli/shared/context.d.mts +2 -1
- package/dist/cli/shared/script-executor.d.mts +0 -1
- package/dist/cli/shared/seed-chunker.d.mts +7 -3
- package/dist/cli/shared/type-generator.d.mts +0 -1
- package/dist/cli/ts-hook.mjs +43 -13
- package/dist/completion/zsh-worker.zsh +10 -10
- package/dist/configure/config/index.d.mts +0 -1
- package/dist/configure/config/types.d.mts +3 -1
- package/dist/configure/index.d.mts +17 -5
- package/dist/configure/index.mjs +309 -5
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/aigateway/index.d.mts +0 -1
- package/dist/configure/services/aigateway/types.d.mts +0 -1
- package/dist/configure/services/auth/index.d.mts +0 -1
- package/dist/configure/services/auth/types.d.mts +15 -14
- package/dist/configure/services/executor/executor.d.mts +1 -1
- package/dist/configure/services/executor/index.d.mts +1 -0
- package/dist/configure/services/executor/operation.d.mts +2 -2
- package/dist/configure/services/executor/trigger/event.d.mts +0 -1
- package/dist/configure/services/executor/trigger/index.d.mts +0 -1
- package/dist/configure/services/executor/trigger/schedule.d.mts +0 -1
- package/dist/configure/services/executor/trigger/webhook.d.mts +0 -1
- package/dist/configure/services/http-adapter/http-adapter.d.mts +1 -2
- package/dist/configure/services/idp/index.d.mts +1 -5
- package/dist/configure/services/idp/permission.d.mts +4 -5
- package/dist/configure/services/idp/types.d.mts +0 -1
- package/dist/configure/services/index.d.mts +8 -1
- package/dist/configure/services/resolver/resolver.d.mts +1 -0
- package/dist/configure/services/resolver/types.d.mts +0 -1
- package/dist/configure/services/secrets/index.d.mts +0 -1
- package/dist/configure/services/secrets/types.d.mts +0 -1
- package/dist/configure/services/staticwebsite/index.d.mts +0 -1
- package/dist/configure/services/staticwebsite/types.d.mts +0 -1
- package/dist/configure/services/tailordb/permission.d.mts +4 -5
- package/dist/configure/services/tailordb/schema.d.mts +104 -68
- package/dist/configure/services/tailordb/types.d.mts +66 -17
- package/dist/configure/services/workflow/execution-policy.d.mts +70 -0
- package/dist/configure/services/workflow/execution-policy.types.d.mts +103 -0
- package/dist/configure/services/workflow/index.d.mts +4 -1
- package/dist/configure/services/workflow/job.d.mts +7 -3
- package/dist/configure/services/workflow/wait-point.d.mts +0 -1
- package/dist/configure/services/workflow/workflow.d.mts +1 -1
- package/dist/configure/types/field-runtime.d.mts +0 -1
- package/dist/configure/types/field.d.mts +1 -2
- package/dist/configure/types/field.types.d.mts +6 -45
- package/dist/configure/types/index.d.mts +1 -0
- package/dist/configure/types/type.d.mts +1 -2
- package/dist/{context-Bd266-ru.mjs → context-DYQVYWqZ.mjs} +4 -5
- package/dist/{context-Bd266-ru.mjs.map → context-DYQVYWqZ.mjs.map} +1 -1
- 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-DhwZj0RB.mjs → globals-BjhJJ2dN.mjs} +2 -2
- 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-Bx25ZBdN.mjs → idp-RA_swu-h.mjs} +4 -5
- package/dist/idp-RA_swu-h.mjs.map +1 -0
- package/dist/kysely/index.d.mts +3 -4
- package/dist/{kysely-type-5eAChaHO.mjs → kysely-type-DqIRgDYR.mjs} +4 -5
- package/dist/kysely-type-DqIRgDYR.mjs.map +1 -0
- package/dist/parser/service/auth/index.d.mts +1 -1
- package/dist/parser/service/auth/schema.d.mts +2 -0
- package/dist/parser/service/http-adapter/index.d.mts +1 -1
- package/dist/parser/service/idp/types.d.mts +1 -0
- package/dist/parser/service/tailordb/types.d.mts +6 -1
- package/dist/plugin/builtin/enum-constants/index.d.mts +0 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +0 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +0 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +0 -1
- package/dist/plugin/get-generated-type.d.mts +0 -1
- package/dist/plugin/manager.d.mts +2 -1
- package/dist/plugin/types.d.mts +0 -1
- package/dist/plugin/with-context.d.mts +0 -1
- package/dist/{register-ts-hook-ZpBacA07.mjs → register-ts-hook-BhzVkej0.mjs} +799 -446
- package/dist/register-ts-hook-BhzVkej0.mjs.map +1 -0
- package/dist/{registry-DH4m7eYo.mjs → registry-BSbq6SPo.mjs} +4 -3
- package/dist/registry-BSbq6SPo.mjs.map +1 -0
- package/dist/resource_pb-BRv7AMXK.mjs +49 -0
- package/dist/resource_pb-BRv7AMXK.mjs.map +1 -0
- package/dist/runtime/aigateway.d.mts +5 -15
- package/dist/runtime/aigateway.mjs +2 -2
- package/dist/runtime/authconnection.d.mts +5 -15
- package/dist/runtime/authconnection.mjs +2 -2
- package/dist/runtime/context.d.mts +14 -6
- package/dist/runtime/context.mjs +2 -2
- package/dist/runtime/file.d.mts +14 -54
- package/dist/runtime/file.mjs +2 -2
- package/dist/runtime/globals.d.mts +1 -2
- package/dist/runtime/iconv.d.mts +5 -53
- package/dist/runtime/iconv.mjs +2 -2
- package/dist/runtime/idp.d.mts +13 -70
- package/dist/runtime/idp.mjs +2 -2
- package/dist/runtime/index.d.mts +11 -12
- package/dist/runtime/index.mjs +9 -9
- package/dist/runtime/secretmanager.d.mts +7 -20
- package/dist/runtime/secretmanager.mjs +2 -2
- package/dist/runtime/types.d.mts +9 -4
- package/dist/runtime/workflow.d.mts +42 -41
- package/dist/runtime/workflow.mjs +2 -2
- package/dist/{schema-89dYxNC2.mjs → schema-iCd1ugGp.mjs} +257 -54
- package/dist/schema-iCd1ugGp.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 +3 -2
- package/dist/service-BT0GPd01.mjs +3 -0
- package/dist/{service-ufH7sS8o.mjs → service-CzZEVrp9.mjs} +14 -9
- package/dist/service-CzZEVrp9.mjs.map +1 -0
- package/dist/{service_pb-CIrhGwHk.mjs → service_pb-Bk7dL-yT.mjs} +27 -50
- package/dist/service_pb-Bk7dL-yT.mjs.map +1 -0
- package/dist/{service_pb-DjwIn4jO.mjs → service_pb-DZkfjB_6.mjs} +1 -1
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +1 -2
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +29 -10
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +35 -2
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +0 -1
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +0 -1
- package/dist/types/aigateway.generated.d.mts +5 -2
- package/dist/types/auth-connection.generated.d.mts +24 -11
- package/dist/types/auth.generated.d.mts +115 -84
- package/dist/types/executor.generated.d.mts +76 -84
- package/dist/types/helpers.d.mts +7 -6
- package/dist/types/http-adapter.generated.d.mts +11 -5
- package/dist/types/idp.generated.d.mts +536 -524
- package/dist/types/resolver.generated.d.mts +26 -11
- package/dist/types/staticwebsite.generated.d.mts +7 -3
- package/dist/types/tailordb.generated.d.mts +57 -29
- package/dist/types/workflow.generated.d.mts +9 -4
- package/dist/utils/test/index.d.mts +1 -2
- package/dist/utils/test/index.mjs +36 -10
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/utils/test/mock.d.mts +0 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +1 -1
- package/dist/vitest/index.mjs +11 -11
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock-kysely.d.mts +0 -1
- package/dist/vitest/mocks/aigateway.d.mts +2 -2
- package/dist/vitest/mocks/authconnection.d.mts +2 -2
- package/dist/vitest/mocks/idp.d.mts +2 -2
- package/dist/vitest/mocks/secretmanager.d.mts +3 -1
- package/dist/vitest/mocks/tailordb.d.mts +6 -3
- package/dist/vitest/mocks/workflow.d.mts +15 -8
- package/dist/vitest/setup.mjs +1 -1
- package/dist/vitest/workflow-local.d.mts +1 -0
- package/dist/workflow-GNuSnsTx.mjs +22 -0
- package/dist/workflow-GNuSnsTx.mjs.map +1 -0
- package/docs/cli/auth.md +3 -3
- package/docs/cli/setup.md +9 -9
- package/docs/cli-reference.md +7 -6
- package/docs/configuration.md +24 -0
- package/docs/migration/v2.md +317 -0
- package/docs/plugin/custom.md +4 -4
- package/docs/plugin/index.md +2 -2
- package/docs/runtime.md +4 -2
- package/docs/services/aigateway.md +2 -0
- package/docs/services/auth.md +2 -2
- package/docs/services/resolver.md +1 -1
- package/docs/services/tailordb-migration.md +1 -1
- package/docs/services/tailordb.md +125 -93
- package/docs/services/workflow.md +78 -0
- package/package.json +22 -22
- package/dist/aigateway-B3oZZE6v.mjs +0 -15
- package/dist/application-D2hSK1ZL.mjs +0 -3
- package/dist/application-eHp9jXld.mjs.map +0 -1
- package/dist/authconnection-BGQM8FZI.mjs +0 -15
- package/dist/authconnection-BGQM8FZI.mjs.map +0 -1
- package/dist/cli/shared/trigger-context.d.mts +0 -1
- package/dist/field-runtime-CAnh_oow.mjs +0 -183
- package/dist/field-runtime-CAnh_oow.mjs.map +0 -1
- package/dist/file-BbdFGdMV.mjs.map +0 -1
- package/dist/file-utils-CYZnO1pX.mjs.map +0 -1
- package/dist/globals-DhwZj0RB.mjs.map +0 -1
- package/dist/iconv-D2vi8G36.mjs +0 -63
- package/dist/iconv-D2vi8G36.mjs.map +0 -1
- package/dist/idp-Bx25ZBdN.mjs.map +0 -1
- package/dist/kysely-type-5eAChaHO.mjs.map +0 -1
- package/dist/register-ts-hook-ZpBacA07.mjs.map +0 -1
- package/dist/registry-DH4m7eYo.mjs.map +0 -1
- package/dist/rolldown-runtime-DXywRVcq.mjs +0 -20
- package/dist/schema-89dYxNC2.mjs.map +0 -1
- package/dist/secretmanager-BVxw3ih_.mjs +0 -24
- package/dist/secretmanager-BVxw3ih_.mjs.map +0 -1
- package/dist/service-CkIwEctX.mjs +0 -3
- package/dist/service-ufH7sS8o.mjs.map +0 -1
- package/dist/service_pb-CIrhGwHk.mjs.map +0 -1
- package/dist/types-C-lQ4se3.mjs +0 -4
- package/dist/types-CXF2OYdR.mjs +0 -199
- package/dist/types-CXF2OYdR.mjs.map +0 -1
- package/dist/workflow-Bo59B75H.mjs +0 -50
- package/dist/workflow-Bo59B75H.mjs.map +0 -1
package/dist/cli/lib.d.mts
CHANGED
|
@@ -7,6 +7,7 @@ import { GeneratorResult } from "../plugin/types.mjs";
|
|
|
7
7
|
import { LoadedConfig, loadConfig } from "./shared/config-loader.mjs";
|
|
8
8
|
import { AuthInvoker } from "../tailor-proto/src/tailor/v1/auth_resource_pb.mjs";
|
|
9
9
|
import { OperatorClient, initOperatorClient } from "./shared/client.mjs";
|
|
10
|
+
import "./commands/deploy/function-registry.mjs";
|
|
10
11
|
import { NormalizedSchemaSnapshot, SchemaSnapshot, SnapshotFieldConfig, TailorDBSnapshotType } from "./commands/tailordb/migrate/snapshot-types.mjs";
|
|
11
12
|
import { BreakingChangeInfo, MigrationDiff, formatDiffSummary, formatMigrationDiff, hasChanges } from "./commands/tailordb/migrate/diff-calculator.mjs";
|
|
12
13
|
import { MIGRATION_LABEL_KEY } from "./commands/tailordb/migrate/types.mjs";
|
|
@@ -19,7 +20,7 @@ import { kyselyTypePlugin } from "../plugin/builtin/kysely-type/index.mjs";
|
|
|
19
20
|
import { enumConstantsPlugin } from "../plugin/builtin/enum-constants/index.mjs";
|
|
20
21
|
import { fileUtilsPlugin } from "../plugin/builtin/file-utils/index.mjs";
|
|
21
22
|
import { seedPlugin } from "../plugin/builtin/seed/index.mjs";
|
|
22
|
-
import { ApplicationInfo, ShowOptions, show } from "./commands/show.mjs";
|
|
23
|
+
import { AIGatewayInfo, ApplicationInfo, ShowInfo, ShowOptions, show } from "./commands/show.mjs";
|
|
23
24
|
import { RemoveOptions, remove } from "./commands/remove.mjs";
|
|
24
25
|
import { WorkspaceDetails, WorkspaceInfo } from "./commands/workspace/transform.mjs";
|
|
25
26
|
import { CreateWorkspaceOptions, createWorkspace } from "./commands/workspace/create.mjs";
|
|
@@ -69,6 +70,7 @@ import { UpdateFolderOptions, updateFolder } from "./commands/organization/folde
|
|
|
69
70
|
import { DeleteFolderOptions, deleteFolder } from "./commands/organization/folder/delete.mjs";
|
|
70
71
|
import { loadAccessToken, loadWorkspaceId } from "./shared/context.mjs";
|
|
71
72
|
import { ApiCallOptions, ApiCallResult, apiCall } from "./commands/api/api-call.mjs";
|
|
73
|
+
import "./commands/api/index.mjs";
|
|
72
74
|
import { query } from "./query/index.mjs";
|
|
73
75
|
import { TruncateOptions, truncate } from "./commands/tailordb/truncate.mjs";
|
|
74
76
|
import { GenerateOptions as GenerateOptions$1, generate as generate$1 } from "./commands/tailordb/migrate/generate.mjs";
|
|
@@ -78,4 +80,4 @@ import { SeedBundleResult, bundleSeedScript } from "./commands/generate/seed/bun
|
|
|
78
80
|
import { MigrationBundleResult, bundleMigrationScript } from "./commands/tailordb/migrate/bundler.mjs";
|
|
79
81
|
import { ExecutionWaitResult, ScriptExecutionOptions, ScriptExecutionResult, executeScript, waitForExecution } from "./shared/script-executor.mjs";
|
|
80
82
|
import { MachineUserName } from "@tailor-platform/sdk";
|
|
81
|
-
export { type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, type AuthInvoker, type BreakingChangeInfo, type BundledScripts, type ChunkSeedDataOptions, type CreateFolderOptions, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteFolderOptions, type DeleteWorkspaceOptions, type DeployOptions, type ExecutionWaitResult, type Executor, type ExecutorInfo, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type ExecutorListInfo, type FolderInfo, type FolderListInfo, type FunctionRegistryInfo, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobOptions, type GetExecutorJobTypedOptions, type GetExecutorOptions, type GetExecutorTypedOptions, type GetFolderOptions, type GetFunctionRegistryOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetOrganizationOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type GetWorkflowTypedOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsOptions, type ListExecutorJobsTypedOptions, type ListExecutorsOptions, type ListFoldersOptions, type ListFunctionRegistriesOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListOrganizationsOptions, type ListUsersOptions, type ListWebhookExecutorsOptions, type ListWorkflowExecutionsOptions, type ListWorkflowExecutionsTypedOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadedConfig, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserName, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationBundleResult, type MigrationDiff, type NamespaceWithMigrations, type NormalizedSchemaSnapshot, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type OrganizationInfo, type OrganizationTreeOptions, type PluginAttachment, type RemoveOptions, type RemoveUserOptions, type Resolver, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type SeedBundleResult, type SeedChunk, type ShowOptions, type SnapshotFieldConfig, type StartWorkflowOptions, type StartWorkflowResultWithWait, type StartWorkflowTypedOptions, type TailorDBSnapshotType, type TailorDBType, type TriggerExecutorOptions, type TriggerExecutorResult, type TriggerExecutorTypedOptions, type TruncateOptions, type TypeSourceInfoEntry, type UpdateFolderOptions, type UpdateOrganizationOptions, type UpdateUserOptions, type UserInfo, type UserOrganizationInfo, type WaitOptions, type WaitWorkflowExecutionOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowExecutionWaitInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkflowWaitOutput, type WorkflowWaitResult, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deploy, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, kyselyTypePlugin, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, seedPlugin, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, waitWorkflowExecution, watchExecutorJob };
|
|
83
|
+
export { type AIGatewayInfo, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, type AuthInvoker, type BreakingChangeInfo, type BundledScripts, type ChunkSeedDataOptions, type CreateFolderOptions, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteFolderOptions, type DeleteWorkspaceOptions, type DeployOptions, type ExecutionWaitResult, type Executor, type ExecutorInfo, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type ExecutorListInfo, type FolderInfo, type FolderListInfo, type FunctionRegistryInfo, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobOptions, type GetExecutorJobTypedOptions, type GetExecutorOptions, type GetExecutorTypedOptions, type GetFolderOptions, type GetFunctionRegistryOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetOrganizationOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type GetWorkflowTypedOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsOptions, type ListExecutorJobsTypedOptions, type ListExecutorsOptions, type ListFoldersOptions, type ListFunctionRegistriesOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListOrganizationsOptions, type ListUsersOptions, type ListWebhookExecutorsOptions, type ListWorkflowExecutionsOptions, type ListWorkflowExecutionsTypedOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadedConfig, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserName, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationBundleResult, type MigrationDiff, type NamespaceWithMigrations, type NormalizedSchemaSnapshot, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type OrganizationInfo, type OrganizationTreeOptions, type PluginAttachment, type RemoveOptions, type RemoveUserOptions, type Resolver, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type SeedBundleResult, type SeedChunk, type ShowInfo, type ShowOptions, type SnapshotFieldConfig, type StartWorkflowOptions, type StartWorkflowResultWithWait, type StartWorkflowTypedOptions, type TailorDBSnapshotType, type TailorDBType, type TriggerExecutorOptions, type TriggerExecutorResult, type TriggerExecutorTypedOptions, type TruncateOptions, type TypeSourceInfoEntry, type UpdateFolderOptions, type UpdateOrganizationOptions, type UpdateUserOptions, type UserInfo, type UserOrganizationInfo, type WaitOptions, type WaitWorkflowExecutionOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowExecutionWaitInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkflowWaitOutput, type WorkflowWaitResult, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deploy, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, kyselyTypePlugin, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, seedPlugin, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, waitWorkflowExecution, watchExecutorJob };
|
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { D as loadConfig, M as loadAccessToken, R as loadWorkspaceId, _ as platformBundleDefinePlugin, at as initOperatorClient, w as getDistDir } from "../application-Bf8wxOi6.mjs";
|
|
3
|
+
import { $ as getOrganization, At as getExecutorWaitFailureMessage, B as show, Bt as listWorkflowExecutions, Cn as hasChanges, Ct as listWebhookExecutors, D as waitWorkflowExecution, Et as triggerExecutor, Ft as startWorkflow, Gt as deploy, J as organizationTree, Jt as waitForExecution, Lt as getWorkflow, M as truncate, Mt as listExecutorJobs, Nt as watchExecutorJob, On as generateUserTypes, Ot as listExecutors, P as generate$1, S as listApps, Sn as formatMigrationDiff, St as getFunctionRegistry, W as remove, Wt as getExecutor, Xt as MIGRATION_LABEL_KEY, Yt as bundleMigrationScript, Z as listOrganizations, _ as getWorkspace, _t as listMachineUsers, a as updateUser, an as MIGRATE_FILE_NAME, at as getFolder, bt as listFunctionRegistries, cn as compareLocalTypesWithSnapshot, d as inviteUser, dn as getLatestMigrationNumber, dt as listOAuth2Clients, fn as getMigrationDirPath, h as listWorkspaces, hn as getNextMigrationNumber, in as INITIAL_SCHEMA_NUMBER, j as listWorkflows, jn as apiCall, k as resumeWorkflow, kt as getExecutorJob, l as listUsers, ln as compareSnapshots, lt as createFolder, mn as getMigrationFiles, mt as getMachineUserToken, n as query, nn as DB_TYPES_FILE_NAME, on as SCHEMA_FILE_NAME, p as restoreWorkspace, pn as getMigrationFilePath, pt as getOAuth2Client, q as updateOrganization, qt as executeScript, rn as DIFF_FILE_NAME, rt as listFolders, s as removeUser, st as deleteFolder, t as registerTsHook, tt as updateFolder, un as createSnapshotFromLocalTypes, vn as reconstructSnapshotFromMigrations, vt as generate, w as getAppHealth, wn as getNamespacesWithMigrations, x as createWorkspace, xn as formatDiffSummary, y as deleteWorkspace, zt as getWorkflowExecution } from "../register-ts-hook-BhzVkej0.mjs";
|
|
4
4
|
import { t as multiline } from "../multiline-sfHpTZZK.mjs";
|
|
5
|
-
import { n as kyselyTypePlugin } from "../kysely-type-
|
|
5
|
+
import { n as kyselyTypePlugin } from "../kysely-type-DqIRgDYR.mjs";
|
|
6
6
|
import { n as enumConstantsPlugin } from "../enum-constants-j9QBF0cB.mjs";
|
|
7
|
-
import { n as fileUtilsPlugin } from "../file-utils-
|
|
7
|
+
import { n as fileUtilsPlugin } from "../file-utils-yEiIS4nJ.mjs";
|
|
8
8
|
import { n as seedPlugin } from "../seed-CRSQJI_z.mjs";
|
|
9
9
|
import * as path from "pathe";
|
|
10
10
|
import { resolveTSConfig } from "pkg-types";
|
package/dist/cli/lib.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/shared/seed-chunker.ts","../../src/cli/commands/generate/seed/bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["/**\n * Seed data chunker for splitting large seed data into manageable message sizes.\n *\n * When seed data exceeds the gRPC message size limit, this module splits the data\n * into multiple chunks at type boundaries (or record boundaries for large types).\n */\n\nimport { assertDefined } from \"#/utils/assert\";\n\n/**\n * Seed data keyed by type name, with an array of records per type.\n */\nexport type SeedData = Record<string, Record<string, unknown>[]>;\n\n/**\n * A single chunk of seed data with metadata for ordered execution.\n */\nexport type SeedChunk = {\n data: SeedData;\n order: string[];\n index: number;\n total: number;\n};\n\n/**\n * Options for chunking seed data.\n */\nexport type ChunkSeedDataOptions = {\n /** Seed data keyed by type name */\n data: SeedData;\n /** Ordered list of type names (dependency order) */\n order: string[];\n /** Byte size of the bundled seed script code */\n codeByteSize: number;\n /** Maximum gRPC message size in bytes (default: 3.5MB) */\n maxMessageSize?: number;\n};\n\n/** Default maximum message size: 3.5MB (conservative limit for gRPC) */\nexport const DEFAULT_MAX_MESSAGE_SIZE = 3.5 * 1024 * 1024;\n\n/** Reserved bytes for message metadata overhead */\nconst METADATA_OVERHEAD = 1024;\n\n/**\n * Split seed data into chunks that fit within the gRPC message size limit.\n *\n * Algorithm:\n * 1. Calculate the available budget for the arg field (maxMessageSize - codeByteSize - overhead)\n * 2. If all data fits in one message, return a single chunk\n * 3. Otherwise, iterate through types in dependency order:\n * - If a type fits in the current chunk, add it\n * - If adding a type would exceed the budget, finalize the current chunk and start a new one\n * - If a single type exceeds the budget, split its records across multiple chunks\n * - If a single record exceeds the budget, throw an error\n * @param options - Chunking options\n * @returns Array of seed chunks\n */\nexport function chunkSeedData(options: ChunkSeedDataOptions): SeedChunk[] {\n const { data, order, codeByteSize, maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE } = options;\n\n const argBudget = maxMessageSize - codeByteSize - METADATA_OVERHEAD;\n if (argBudget <= 0) {\n throw new Error(\n `Code size (${codeByteSize} bytes) exceeds the message size limit (${maxMessageSize} bytes). ` +\n `No space left for seed data.`,\n );\n }\n\n // Filter to types that have data\n const typesWithData = order.filter((type) => (data[type]?.length ?? 0) > 0);\n\n if (typesWithData.length === 0) {\n return [];\n }\n\n // Check if all data fits in a single message\n const fullArg = JSON.stringify({ data, order });\n if (byteSize(fullArg) <= argBudget) {\n return [{ data, order, index: 0, total: 1 }];\n }\n\n // Split into multiple chunks\n const chunks: Omit<SeedChunk, \"total\">[] = [];\n let currentData: SeedData = {};\n let currentOrder: string[] = [];\n\n for (const type of typesWithData) {\n const typeRecords = assertDefined(data[type], `seed data missing for type: ${type}`);\n\n // Check if the type fits in the current chunk\n if (currentOrder.length > 0) {\n const testData = { ...currentData, [type]: typeRecords };\n const testOrder = [...currentOrder, type];\n if (byteSize(JSON.stringify({ data: testData, order: testOrder })) > argBudget) {\n // Finalize the current chunk\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n }\n\n // Check if the entire type fits in an empty chunk\n if (byteSize(JSON.stringify({ data: { [type]: typeRecords }, order: [type] })) <= argBudget) {\n currentData[type] = typeRecords;\n currentOrder.push(type);\n continue;\n }\n\n // Type is too large — split by records\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n\n let recordBatch: Record<string, unknown>[] = [];\n for (const record of typeRecords) {\n if (byteSize(JSON.stringify({ data: { [type]: [record] }, order: [type] })) > argBudget) {\n const singleRecordSize = byteSize(JSON.stringify(record));\n throw new Error(\n `A single record in type \"${type}\" (${singleRecordSize} bytes) exceeds the message size budget ` +\n `(${argBudget} bytes). Consider increasing maxMessageSize or reducing the record size.`,\n );\n }\n\n const testBatch = [...recordBatch, record];\n const testData = { ...currentData, [type]: testBatch };\n const testOrder = currentOrder.includes(type) ? currentOrder : [...currentOrder, type];\n const testSize = byteSize(JSON.stringify({ data: testData, order: testOrder }));\n\n if (testSize > argBudget && recordBatch.length > 0) {\n // Finalize current chunk with accumulated records\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n recordBatch = [record];\n } else {\n recordBatch = testBatch;\n }\n }\n\n // Add remaining records\n if (recordBatch.length > 0) {\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n }\n }\n\n // Finalize the last chunk\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n }\n\n const total = chunks.length;\n return chunks.map((chunk) => ({ ...chunk, total }));\n}\n\nfunction byteSize(str: string): number {\n return new TextEncoder().encode(str).length;\n}\n","/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"#/cli/shared/dist-dir\";\nimport { platformBundleDefinePlugin } from \"#/cli/shared/platform-bundle-plugin\";\nimport ml from \"#/utils/multiline\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely, TailordbDialect } from \"@tailor-platform/sdk/kysely\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n selfRefTypes: string[];\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, number>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<string, number> = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = 0;\n const hasSelfRef = (input.selfRefTypes || []).includes(typeName);\n\n try {\n if (hasSelfRef) {\n // Insert one-by-one to respect self-referencing foreign key order\n for (const record of records) {\n await db.insertInto(typeName).values(record).execute();\n processed[typeName] += 1;\n }\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length} (one-by-one)\\`);\n } else {\n for (let i = 0; i < records.length; i += BATCH_SIZE) {\n const batch = records.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName] += batch.length;\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length}\\`);\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n): Promise<SeedBundleResult> {\n // Output directory in .tailor (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig();\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking (write: false to avoid unnecessary disk I/O)\n const result = await rolldown.build({\n plugins: [platformBundleDefinePlugin],\n input: entryPath,\n write: false,\n output: {\n format: \"esm\",\n sourcemap: false,\n minify: false,\n codeSplitting: false,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n logLevel: \"silent\",\n } as rolldown.BuildOptions);\n\n const bundledCode = result.output[0].code;\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { registerTsHook } from \"./shared/register-ts-hook\";\n\nawait registerTsHook(new URL(\"./ts-hook.mjs\", import.meta.url));\n\nexport { deploy, deploy as apply } from \"./commands/deploy/deploy\";\nexport type { DeployOptions, DeployOptions as ApplyOptions } from \"./commands/deploy/deploy\";\nexport type { BundledScripts } from \"./commands/deploy/function-registry\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport type { GeneratorResult, PluginAttachment } from \"#/plugin/types\";\nexport type { TailorDBType, TypeSourceInfoEntry } from \"#/parser/service/tailordb/types\";\nexport type { Resolver } from \"#/types/resolver.generated\";\nexport type { Executor } from \"#/types/executor.generated\";\n\n/** @deprecated Import from '@tailor-platform/sdk/plugin/kysely-type' instead */\nexport { kyselyTypePlugin } from \"#/plugin/builtin/kysely-type/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/enum-constants' instead */\nexport { enumConstantsPlugin } from \"#/plugin/builtin/enum-constants/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/file-utils' instead */\nexport { fileUtilsPlugin } from \"#/plugin/builtin/file-utils/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/seed' instead */\nexport { seedPlugin } from \"#/plugin/builtin/seed/index\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./commands/show\";\nexport { remove, type RemoveOptions } from \"./commands/remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./commands/workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./commands/workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./commands/workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./commands/workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./commands/workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./commands/workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./commands/workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./commands/workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./commands/workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./commands/workspace/user/remove\";\nexport type { UserInfo } from \"./commands/workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./commands/workspace/app/list\";\nexport {\n getAppHealth,\n type HealthOptions as GetAppHealthOptions,\n} from \"./commands/workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./commands/workspace/app/transform\";\nexport { getFunctionRegistry, type GetFunctionRegistryOptions } from \"./commands/function/get\";\nexport {\n listFunctionRegistries,\n type ListFunctionRegistriesOptions,\n} from \"./commands/function/list\";\nexport type { FunctionRegistryInfo } from \"./commands/function/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./commands/machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./commands/machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./commands/oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./commands/oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./commands/oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./commands/workflow/list\";\nexport {\n getWorkflow,\n type GetWorkflowOptions,\n type GetWorkflowTypedOptions,\n} from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type ListWorkflowExecutionsTypedOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n type WorkflowExecutionWaitInfo,\n} from \"./commands/workflow/executions\";\nexport { waitWorkflowExecution, type WorkflowWaitOutput } from \"./commands/workflow/wait\";\nexport type { WaitWorkflowExecutionOptions, WorkflowWaitResult } from \"./commands/workflow/waiter\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./commands/workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./commands/workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorOptions,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n getExecutorWaitFailureMessage,\n watchExecutorJob,\n type ListExecutorJobsOptions,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport {\n getExecutor,\n type GetExecutorOptions,\n type GetExecutorTypedOptions,\n} from \"./commands/executor/get\";\nexport {\n listWebhookExecutors,\n type ListWebhookExecutorsOptions,\n type WebhookExecutorInfo,\n} from \"./commands/executor/webhook\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n ExecutorListInfo,\n ExecutorInfo,\n} from \"./commands/executor/transform\";\nexport { listOrganizations, type ListOrganizationsOptions } from \"./commands/organization/list\";\nexport { getOrganization, type GetOrganizationOptions } from \"./commands/organization/get\";\nexport { updateOrganization, type UpdateOrganizationOptions } from \"./commands/organization/update\";\nexport { organizationTree, type OrganizationTreeOptions } from \"./commands/organization/tree\";\nexport type {\n UserOrganizationInfo,\n OrganizationInfo,\n FolderListInfo,\n FolderInfo,\n} from \"./commands/organization/transform\";\nexport { listFolders, type ListFoldersOptions } from \"./commands/organization/folder/list\";\nexport { getFolder, type GetFolderOptions } from \"./commands/organization/folder/get\";\nexport { createFolder, type CreateFolderOptions } from \"./commands/organization/folder/create\";\nexport { updateFolder, type UpdateFolderOptions } from \"./commands/organization/folder/update\";\nexport { deleteFolder, type DeleteFolderOptions } from \"./commands/organization/folder/delete\";\nexport { loadAccessToken, loadWorkspaceId } from \"./shared/context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./commands/api\";\nexport { query } from \"./query\";\nexport { truncate, type TruncateOptions } from \"./commands/tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./commands/tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./commands/tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./commands/tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type NormalizedSchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./commands/tailordb/migrate/types\";\n\n// Seed exports\nexport { chunkSeedData, type SeedChunk, type ChunkSeedDataOptions } from \"./shared/seed-chunker\";\nexport { bundleSeedScript, type SeedBundleResult } from \"./commands/generate/seed/bundler\";\nexport {\n bundleMigrationScript,\n type MigrationBundleResult,\n} from \"./commands/tailordb/migrate/bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ExecutionWaitResult,\n} from \"./shared/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./shared/client\";\nexport type { AuthInvoker } from \"@tailor-platform/tailor-proto/auth_resource_pb\";\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/shared/seed-chunker.ts","../../src/cli/commands/generate/seed/bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["/**\n * Seed data chunker for splitting large seed data into manageable message sizes.\n *\n * When seed data exceeds the gRPC message size limit, this module splits the data\n * into multiple chunks at type boundaries (or record boundaries for large types).\n */\n\nimport { assertDefined } from \"#/utils/assert\";\n\n/**\n * Seed data keyed by type name, with an array of records per type.\n */\nexport type SeedData = Record<string, Record<string, unknown>[]>;\n\n/**\n * A single chunk of seed data with metadata for ordered execution.\n */\nexport type SeedChunk = {\n data: SeedData;\n order: string[];\n index: number;\n total: number;\n};\n\n/**\n * Options for chunking seed data.\n */\nexport type ChunkSeedDataOptions = {\n /** Seed data keyed by type name */\n data: SeedData;\n /** Ordered list of type names (dependency order) */\n order: string[];\n /** Byte size of the bundled seed script code */\n codeByteSize: number;\n /** Maximum gRPC message size in bytes (default: 3.5MB) */\n maxMessageSize?: number;\n};\n\n/** Default maximum message size: 3.5MB (conservative limit for gRPC) */\nexport const DEFAULT_MAX_MESSAGE_SIZE = 3.5 * 1024 * 1024;\n\n/** Reserved bytes for message metadata overhead */\nconst METADATA_OVERHEAD = 1024;\n\n/**\n * Split seed data into chunks that fit within the gRPC message size limit.\n *\n * Algorithm:\n * 1. Calculate the available budget for the arg field (maxMessageSize - codeByteSize - overhead)\n * 2. If all data fits in one message, return a single chunk\n * 3. Otherwise, iterate through types in dependency order:\n * - If a type fits in the current chunk, add it\n * - If adding a type would exceed the budget, finalize the current chunk and start a new one\n * - If a single type exceeds the budget, split its records across multiple chunks\n * - If a single record exceeds the budget, throw an error\n * @param options - Chunking options\n * @returns Array of seed chunks\n */\nexport function chunkSeedData(options: ChunkSeedDataOptions): SeedChunk[] {\n const { data, order, codeByteSize, maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE } = options;\n\n const argBudget = maxMessageSize - codeByteSize - METADATA_OVERHEAD;\n if (argBudget <= 0) {\n throw new Error(\n `Code size (${codeByteSize} bytes) exceeds the message size limit (${maxMessageSize} bytes). ` +\n `No space left for seed data.`,\n );\n }\n\n // Filter to types that have data\n const typesWithData = order.filter((type) => (data[type]?.length ?? 0) > 0);\n\n if (typesWithData.length === 0) {\n return [];\n }\n\n // Check if all data fits in a single message\n const fullArg = JSON.stringify({ data, order });\n if (byteSize(fullArg) <= argBudget) {\n return [{ data, order, index: 0, total: 1 }];\n }\n\n // Split into multiple chunks\n const chunks: Omit<SeedChunk, \"total\">[] = [];\n let currentData: SeedData = {};\n let currentOrder: string[] = [];\n\n for (const type of typesWithData) {\n const typeRecords = assertDefined(data[type], `seed data missing for type: ${type}`);\n\n // Check if the type fits in the current chunk\n if (currentOrder.length > 0) {\n const testData = { ...currentData, [type]: typeRecords };\n const testOrder = [...currentOrder, type];\n if (byteSize(JSON.stringify({ data: testData, order: testOrder })) > argBudget) {\n // Finalize the current chunk\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n }\n\n // Check if the entire type fits in an empty chunk\n if (byteSize(JSON.stringify({ data: { [type]: typeRecords }, order: [type] })) <= argBudget) {\n currentData[type] = typeRecords;\n currentOrder.push(type);\n continue;\n }\n\n // Type is too large — split by records\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n\n let recordBatch: Record<string, unknown>[] = [];\n for (const record of typeRecords) {\n if (byteSize(JSON.stringify({ data: { [type]: [record] }, order: [type] })) > argBudget) {\n const singleRecordSize = byteSize(JSON.stringify(record));\n throw new Error(\n `A single record in type \"${type}\" (${singleRecordSize} bytes) exceeds the message size budget ` +\n `(${argBudget} bytes). Consider increasing maxMessageSize or reducing the record size.`,\n );\n }\n\n const testBatch = [...recordBatch, record];\n const testData = { ...currentData, [type]: testBatch };\n const testOrder = currentOrder.includes(type) ? currentOrder : [...currentOrder, type];\n const testSize = byteSize(JSON.stringify({ data: testData, order: testOrder }));\n\n if (testSize > argBudget && recordBatch.length > 0) {\n // Finalize current chunk with accumulated records\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n recordBatch = [record];\n } else {\n recordBatch = testBatch;\n }\n }\n\n // Add remaining records\n if (recordBatch.length > 0) {\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n }\n }\n\n // Finalize the last chunk\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n }\n\n const total = chunks.length;\n return chunks.map((chunk) => ({ ...chunk, total }));\n}\n\nfunction byteSize(str: string): number {\n return new TextEncoder().encode(str).length;\n}\n","/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"#/cli/shared/dist-dir\";\nimport { platformBundleDefinePlugin } from \"#/cli/shared/platform-bundle-plugin\";\nimport ml from \"#/utils/multiline\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely, TailordbDialect } from \"@tailor-platform/sdk/kysely\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n selfRefTypes: string[];\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, number>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<string, number> = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = 0;\n const hasSelfRef = (input.selfRefTypes || []).includes(typeName);\n\n try {\n if (hasSelfRef) {\n // Insert one-by-one to respect self-referencing foreign key order\n for (const record of records) {\n await db.insertInto(typeName).values(record).execute();\n processed[typeName] += 1;\n }\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length} (one-by-one)\\`);\n } else {\n for (let i = 0; i < records.length; i += BATCH_SIZE) {\n const batch = records.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName] += batch.length;\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length}\\`);\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n): Promise<SeedBundleResult> {\n // Output directory in .tailor (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig();\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking (write: false to avoid unnecessary disk I/O)\n const result = await rolldown.build({\n plugins: [platformBundleDefinePlugin],\n input: entryPath,\n write: false,\n output: {\n format: \"esm\",\n sourcemap: false,\n minify: false,\n codeSplitting: false,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n logLevel: \"silent\",\n } as rolldown.BuildOptions);\n\n const bundledCode = result.output[0].code;\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { registerTsHook } from \"./shared/register-ts-hook\";\n\nawait registerTsHook(new URL(\"./ts-hook.mjs\", import.meta.url));\n\nexport { deploy, deploy as apply } from \"./commands/deploy/deploy\";\nexport type { DeployOptions, DeployOptions as ApplyOptions } from \"./commands/deploy/deploy\";\nexport type { BundledScripts } from \"./commands/deploy/function-registry\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport type { GeneratorResult, PluginAttachment } from \"#/plugin/types\";\nexport type { TailorDBType, TypeSourceInfoEntry } from \"#/parser/service/tailordb/types\";\nexport type { Resolver } from \"#/types/resolver.generated\";\nexport type { Executor } from \"#/types/executor.generated\";\n\n/** @deprecated Import from '@tailor-platform/sdk/plugin/kysely-type' instead */\nexport { kyselyTypePlugin } from \"#/plugin/builtin/kysely-type/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/enum-constants' instead */\nexport { enumConstantsPlugin } from \"#/plugin/builtin/enum-constants/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/file-utils' instead */\nexport { fileUtilsPlugin } from \"#/plugin/builtin/file-utils/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/seed' instead */\nexport { seedPlugin } from \"#/plugin/builtin/seed/index\";\n\nexport {\n show,\n type ShowOptions,\n type ApplicationInfo,\n type ShowInfo,\n type AIGatewayInfo,\n} from \"./commands/show\";\nexport { remove, type RemoveOptions } from \"./commands/remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./commands/workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./commands/workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./commands/workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./commands/workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./commands/workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./commands/workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./commands/workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./commands/workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./commands/workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./commands/workspace/user/remove\";\nexport type { UserInfo } from \"./commands/workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./commands/workspace/app/list\";\nexport {\n getAppHealth,\n type HealthOptions as GetAppHealthOptions,\n} from \"./commands/workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./commands/workspace/app/transform\";\nexport { getFunctionRegistry, type GetFunctionRegistryOptions } from \"./commands/function/get\";\nexport {\n listFunctionRegistries,\n type ListFunctionRegistriesOptions,\n} from \"./commands/function/list\";\nexport type { FunctionRegistryInfo } from \"./commands/function/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./commands/machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./commands/machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./commands/oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./commands/oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./commands/oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./commands/workflow/list\";\nexport {\n getWorkflow,\n type GetWorkflowOptions,\n type GetWorkflowTypedOptions,\n} from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type ListWorkflowExecutionsTypedOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n type WorkflowExecutionWaitInfo,\n} from \"./commands/workflow/executions\";\nexport { waitWorkflowExecution, type WorkflowWaitOutput } from \"./commands/workflow/wait\";\nexport type { WaitWorkflowExecutionOptions, WorkflowWaitResult } from \"./commands/workflow/waiter\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./commands/workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./commands/workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorOptions,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n getExecutorWaitFailureMessage,\n watchExecutorJob,\n type ListExecutorJobsOptions,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport {\n getExecutor,\n type GetExecutorOptions,\n type GetExecutorTypedOptions,\n} from \"./commands/executor/get\";\nexport {\n listWebhookExecutors,\n type ListWebhookExecutorsOptions,\n type WebhookExecutorInfo,\n} from \"./commands/executor/webhook\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n ExecutorListInfo,\n ExecutorInfo,\n} from \"./commands/executor/transform\";\nexport { listOrganizations, type ListOrganizationsOptions } from \"./commands/organization/list\";\nexport { getOrganization, type GetOrganizationOptions } from \"./commands/organization/get\";\nexport { updateOrganization, type UpdateOrganizationOptions } from \"./commands/organization/update\";\nexport { organizationTree, type OrganizationTreeOptions } from \"./commands/organization/tree\";\nexport type {\n UserOrganizationInfo,\n OrganizationInfo,\n FolderListInfo,\n FolderInfo,\n} from \"./commands/organization/transform\";\nexport { listFolders, type ListFoldersOptions } from \"./commands/organization/folder/list\";\nexport { getFolder, type GetFolderOptions } from \"./commands/organization/folder/get\";\nexport { createFolder, type CreateFolderOptions } from \"./commands/organization/folder/create\";\nexport { updateFolder, type UpdateFolderOptions } from \"./commands/organization/folder/update\";\nexport { deleteFolder, type DeleteFolderOptions } from \"./commands/organization/folder/delete\";\nexport { loadAccessToken, loadWorkspaceId } from \"./shared/context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./commands/api\";\nexport { query } from \"./query\";\nexport { truncate, type TruncateOptions } from \"./commands/tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./commands/tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./commands/tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./commands/tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type NormalizedSchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./commands/tailordb/migrate/types\";\n\n// Seed exports\nexport { chunkSeedData, type SeedChunk, type ChunkSeedDataOptions } from \"./shared/seed-chunker\";\nexport { bundleSeedScript, type SeedBundleResult } from \"./commands/generate/seed/bundler\";\nexport {\n bundleMigrationScript,\n type MigrationBundleResult,\n} from \"./commands/tailordb/migrate/bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ExecutionWaitResult,\n} from \"./shared/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./shared/client\";\nexport type { AuthInvoker } from \"@tailor-platform/tailor-proto/auth_resource_pb\";\n"],"mappings":"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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
//#region src/cli/query/index.d.ts
|
|
4
3
|
declare const queryOptionsSchema: z.ZodObject<{
|
|
5
4
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
@@ -10,6 +9,10 @@ declare const queryOptionsSchema: z.ZodObject<{
|
|
|
10
9
|
gql: "gql";
|
|
11
10
|
}>;
|
|
12
11
|
machineUser: z.ZodOptional<z.ZodString>;
|
|
12
|
+
machineUserSource: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
env: "env";
|
|
14
|
+
option: "option";
|
|
15
|
+
}>>;
|
|
13
16
|
query: z.ZodString;
|
|
14
17
|
}, z.core.$strip>;
|
|
15
18
|
type QueryOptions = z.input<typeof queryOptionsSchema>;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import "../../plugin/manager.mjs";
|
|
2
|
+
import "./tailordb/service.mjs";
|
|
3
|
+
import "./auth/service.mjs";
|
|
4
|
+
import "../../configure/config/types.mjs";
|
|
5
|
+
import "./executor/service.mjs";
|
|
6
|
+
import "../cache/bundle-cache.mjs";
|
|
7
|
+
import "./http-adapter/bundler.mjs";
|
|
8
|
+
import "./http-adapter/service.mjs";
|
|
9
|
+
import "./resolver/service.mjs";
|
|
10
|
+
import "./workflow/bundler.mjs";
|
|
11
|
+
import "./workflow/service.mjs";
|
|
12
|
+
import "../shared/config-loader.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "../../../configure/config/types.mjs";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import "../../../configure/config/types.mjs";
|
|
2
|
+
import "../../../parser/service/http-adapter/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "../../../configure/config/types.mjs";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import "../../../configure/config/types.mjs";
|
|
2
|
+
import "../../cache/bundle-cache.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "../../../configure/config/types.mjs";
|
|
@@ -17,8 +17,8 @@ import { CreateWorkflowJobFunctionExecutionPolicyRequestSchema, CreateWorkflowJo
|
|
|
17
17
|
import { GetMetadataRequestSchema, GetMetadataResponseSchema, SetMetadataRequestSchema, SetMetadataResponseSchema } from "../../tailor-proto/src/tailor/v1/metadata_pb.mjs";
|
|
18
18
|
import { CreateOTLPExporterRequestSchema, CreateOTLPExporterResponseSchema, CreateResourceAttributesConfigRequestSchema, CreateResourceAttributesConfigResponseSchema, DeleteOTLPExporterRequestSchema, DeleteOTLPExporterResponseSchema, DeleteResourceAttributesConfigRequestSchema, DeleteResourceAttributesConfigResponseSchema, GetOTLPExporterRequestSchema, GetOTLPExporterResponseSchema, GetResourceAttributesConfigRequestSchema, GetResourceAttributesConfigResponseSchema, ListOTLPExportersRequestSchema, ListOTLPExportersResponseSchema, TestOTLPExporterRequestSchema, TestOTLPExporterResponseSchema, UpdateOTLPExporterRequestSchema, UpdateOTLPExporterResponseSchema, UpdateResourceAttributesConfigRequestSchema, UpdateResourceAttributesConfigResponseSchema } from "../../tailor-proto/src/tailor/v1/telemetryrouter_pb.mjs";
|
|
19
19
|
import { OperatorService, PingRequestSchema, PingResponseSchema } from "../../tailor-proto/src/tailor/v1/service_pb.mjs";
|
|
20
|
+
import "@badgateway/oauth2-client";
|
|
20
21
|
import { Client } from "@connectrpc/connect";
|
|
21
|
-
|
|
22
22
|
//#region src/cli/shared/client.d.ts
|
|
23
23
|
type PlatformClientConfig = {
|
|
24
24
|
platformUrl?: string;
|
|
@@ -2,7 +2,6 @@ import { AuthInvoker } from "../../tailor-proto/src/tailor/v1/auth_resource_pb.m
|
|
|
2
2
|
import { FunctionExecution_Status } from "../../tailor-proto/src/tailor/v1/function_resource_pb.mjs";
|
|
3
3
|
import { OperatorClient } from "./client.mjs";
|
|
4
4
|
import { Jsonifiable } from "type-fest";
|
|
5
|
-
|
|
6
5
|
//#region src/cli/shared/script-executor.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Options for script execution
|
|
@@ -22,9 +22,13 @@ type SeedChunk = {
|
|
|
22
22
|
* Options for chunking seed data.
|
|
23
23
|
*/
|
|
24
24
|
type ChunkSeedDataOptions = {
|
|
25
|
-
/** Seed data keyed by type name */
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
/** Seed data keyed by type name */
|
|
26
|
+
data: SeedData;
|
|
27
|
+
/** Ordered list of type names (dependency order) */
|
|
28
|
+
order: string[];
|
|
29
|
+
/** Byte size of the bundled seed script code */
|
|
30
|
+
codeByteSize: number;
|
|
31
|
+
/** Maximum gRPC message size in bytes (default: 3.5MB) */
|
|
28
32
|
maxMessageSize?: number;
|
|
29
33
|
};
|
|
30
34
|
/**
|
package/dist/cli/ts-hook.mjs
CHANGED
|
@@ -12,41 +12,71 @@ const JS_TO_TS = new Map([
|
|
|
12
12
|
[".js", ".ts"],
|
|
13
13
|
[".mjs", ".mts"],
|
|
14
14
|
]);
|
|
15
|
+
const KNOWN_EXTENSIONS = [".ts", ".tsx", ".mts", ".js", ".mjs", ".json"];
|
|
15
16
|
|
|
16
17
|
// --- tsconfig paths resolution ---
|
|
17
18
|
|
|
18
19
|
const tsconfigPathsCache = new Map();
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
// Walks the `extends` chain and returns the nearest-defined `baseUrl` (which
|
|
22
|
+
// may come from a different config than the one defining `paths`), the
|
|
23
|
+
// nearest-defined `paths` object (TypeScript replaces, not merges, inherited
|
|
24
|
+
// `paths` once a config defines its own), and the directory of the config
|
|
25
|
+
// that defines that `paths` object (the TS 5.0+ fallback base when no
|
|
26
|
+
// `baseUrl` is defined anywhere in the chain).
|
|
27
|
+
function resolveEffectiveConfig(configFilePath, content, visited) {
|
|
28
|
+
if (visited.has(configFilePath)) return {};
|
|
22
29
|
visited.add(configFilePath);
|
|
23
30
|
|
|
24
31
|
const baseDir = dirname(configFilePath);
|
|
32
|
+
const opts = content.compilerOptions ?? {};
|
|
33
|
+
const ownBaseUrl =
|
|
34
|
+
typeof opts.baseUrl === "string" ? resolvePath(baseDir, opts.baseUrl) : undefined;
|
|
35
|
+
const ownRawPaths =
|
|
36
|
+
opts.paths && typeof opts.paths === "object" && !Array.isArray(opts.paths)
|
|
37
|
+
? opts.paths
|
|
38
|
+
: undefined;
|
|
25
39
|
|
|
40
|
+
let inherited = {};
|
|
26
41
|
const extendsField = content.extends;
|
|
27
42
|
if (typeof extendsField === "string") {
|
|
28
43
|
const base = resolvePath(baseDir, extendsField);
|
|
29
44
|
const extendsPath = base.endsWith(".json") ? base : base + ".json";
|
|
30
45
|
try {
|
|
31
46
|
const sub = JSON.parse(readFileSync(extendsPath, "utf-8"));
|
|
32
|
-
|
|
47
|
+
inherited = resolveEffectiveConfig(extendsPath, sub, visited);
|
|
33
48
|
} catch (e) {
|
|
34
49
|
if (e?.code !== "ENOENT" && !(e instanceof SyntaxError)) throw e;
|
|
35
50
|
}
|
|
36
51
|
}
|
|
37
52
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
return {
|
|
54
|
+
baseUrl: ownBaseUrl ?? inherited.baseUrl,
|
|
55
|
+
rawPaths: ownRawPaths ?? inherited.rawPaths,
|
|
56
|
+
pathsBaseDir: ownRawPaths ? baseDir : inherited.pathsBaseDir,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function collectPathsInto(out, configFilePath, content, visited) {
|
|
61
|
+
const { baseUrl, rawPaths, pathsBaseDir } = resolveEffectiveConfig(
|
|
62
|
+
configFilePath,
|
|
63
|
+
content,
|
|
64
|
+
visited,
|
|
65
|
+
);
|
|
66
|
+
if (!rawPaths) return;
|
|
67
|
+
|
|
68
|
+
const absBase = baseUrl ?? pathsBaseDir ?? dirname(configFilePath);
|
|
69
|
+
for (const [alias, targets] of Object.entries(rawPaths)) {
|
|
70
|
+
if (!Array.isArray(targets)) continue;
|
|
71
|
+
const normalized = targets
|
|
72
|
+
.filter((t) => typeof t === "string")
|
|
73
|
+
.map((t) => {
|
|
45
74
|
const isWildcard = t.endsWith("/*");
|
|
46
75
|
const resolved = resolvePath(absBase, isWildcard ? t.slice(0, -2) : t);
|
|
47
76
|
return pathToFileURL(resolved).href + (isWildcard ? "/*" : "");
|
|
48
77
|
});
|
|
49
|
-
|
|
78
|
+
if (normalized.length === 0) continue;
|
|
79
|
+
out[alias] = normalized;
|
|
50
80
|
}
|
|
51
81
|
}
|
|
52
82
|
|
|
@@ -175,7 +205,7 @@ export async function resolve(specifier, context, nextResolve) {
|
|
|
175
205
|
}
|
|
176
206
|
|
|
177
207
|
const lastSegment = specifier.split("/").pop() ?? "";
|
|
178
|
-
if (!lastSegment.
|
|
208
|
+
if (!KNOWN_EXTENSIONS.some((ext) => lastSegment.endsWith(ext))) {
|
|
179
209
|
for (const ext of TS_EXTENSIONS) {
|
|
180
210
|
try {
|
|
181
211
|
return await nextResolve(specifier + ext, context);
|
|
@@ -259,7 +289,7 @@ export function resolveSync(specifier, context, nextResolve) {
|
|
|
259
289
|
}
|
|
260
290
|
|
|
261
291
|
const lastSegment = specifier.split("/").pop() ?? "";
|
|
262
|
-
if (!lastSegment.
|
|
292
|
+
if (!KNOWN_EXTENSIONS.some((ext) => lastSegment.endsWith(ext))) {
|
|
263
293
|
for (const ext of TS_EXTENSIONS) {
|
|
264
294
|
try {
|
|
265
295
|
return nextResolve(specifier + ext, context);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# politty-completion-version: 1
|
|
2
|
-
# politty-bin-sig:
|
|
2
|
+
# politty-bin-sig: 1784091365
|
|
3
3
|
# politty-bin-path: /home/runner/work/sdk/sdk/node_modules/.bin/tailor
|
|
4
4
|
# program: tailor
|
|
5
5
|
# shell: zsh
|
|
@@ -45,7 +45,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
45
45
|
$'CreateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
|
|
46
46
|
$'CreateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
47
47
|
$'CreateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
|
|
48
|
-
$'CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
48
|
+
$'CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions\nexecutionPolicyName=:Set executionPolicyName'
|
|
49
49
|
$'CreateWorkspace' $'workspaceName=:Set workspaceName\nworkspaceRegion=:Set workspaceRegion\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false'
|
|
50
50
|
$'DeleteAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
|
|
51
51
|
$'DeleteApplication' $'workspaceId=:Set workspaceId\napplicationName=:Set applicationName'
|
|
@@ -82,7 +82,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
82
82
|
$'DeleteUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName'
|
|
83
83
|
$'DeleteWorkflow' $'workspaceId=:Set workspaceId\nworkflowId=:Set workflowId'
|
|
84
84
|
$'DeleteWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
|
|
85
|
-
$'DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\
|
|
85
|
+
$'DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
|
|
86
86
|
$'DeleteWorkspace' $'workspaceId=:Set workspaceId'
|
|
87
87
|
$'ExchangeAuthConnectionAuthorizationCode' $'workspaceId=:Set workspaceId\nconnectionName=:Set connectionName\nauthorizationCode=:Set authorizationCode\nredirectUri=:Set redirectUri'
|
|
88
88
|
$'GetAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
|
|
@@ -134,7 +134,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
134
134
|
$'GetWorkflowExecution' $'workspaceId=:Set workspaceId\nexecutionId=:Set executionId'
|
|
135
135
|
$'GetWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionId=:Set jobFunctionId'
|
|
136
136
|
$'GetWorkflowJobFunctionByName' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
|
|
137
|
-
$'GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\
|
|
137
|
+
$'GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
|
|
138
138
|
$'GetWorkflowJobFunctionExecutionPolicyByKey' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey'
|
|
139
139
|
$'GetWorkspace' $'workspaceId=:Set workspaceId'
|
|
140
140
|
$'GetWorkspacePlatformUser' $'workspaceId=:Set workspaceId'
|
|
@@ -241,7 +241,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
241
241
|
$'UpdateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
|
|
242
242
|
$'UpdateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
243
243
|
$'UpdateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
|
|
244
|
-
$'UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\
|
|
244
|
+
$'UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
245
245
|
$'UpdateWorkspace' $'workspaceId=:Set workspaceId\nworkspaceName=:Set workspaceName\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false\nupdateMask=:Set updateMask'
|
|
246
246
|
$'UpdateWorkspacePlatformUser' $'workspaceId=:Set workspaceId\nemail=:Set email\nrole=:Set role\nrole=WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED:WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED\nrole=WORKSPACE_PLATFORM_USER_ROLE_ADMIN:WORKSPACE_PLATFORM_USER_ROLE_ADMIN\nrole=WORKSPACE_PLATFORM_USER_ROLE_EDITOR:WORKSPACE_PLATFORM_USER_ROLE_EDITOR\nrole=WORKSPACE_PLATFORM_USER_ROLE_VIEWER:WORKSPACE_PLATFORM_USER_ROLE_VIEWER'
|
|
247
247
|
$'UpsertOrganizationFolderIPRestriction' $'organizationId=:Set organizationId\nfolderId=:Set folderId'
|
|
@@ -283,7 +283,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
283
283
|
$'tailor.v1.OperatorService/CreateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
|
|
284
284
|
$'tailor.v1.OperatorService/CreateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
285
285
|
$'tailor.v1.OperatorService/CreateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
|
|
286
|
-
$'tailor.v1.OperatorService/CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
286
|
+
$'tailor.v1.OperatorService/CreateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions\nexecutionPolicyName=:Set executionPolicyName'
|
|
287
287
|
$'tailor.v1.OperatorService/CreateWorkspace' $'workspaceName=:Set workspaceName\nworkspaceRegion=:Set workspaceRegion\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false'
|
|
288
288
|
$'tailor.v1.OperatorService/DeleteAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
|
|
289
289
|
$'tailor.v1.OperatorService/DeleteApplication' $'workspaceId=:Set workspaceId\napplicationName=:Set applicationName'
|
|
@@ -320,7 +320,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
320
320
|
$'tailor.v1.OperatorService/DeleteUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName'
|
|
321
321
|
$'tailor.v1.OperatorService/DeleteWorkflow' $'workspaceId=:Set workspaceId\nworkflowId=:Set workflowId'
|
|
322
322
|
$'tailor.v1.OperatorService/DeleteWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
|
|
323
|
-
$'tailor.v1.OperatorService/DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\
|
|
323
|
+
$'tailor.v1.OperatorService/DeleteWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
|
|
324
324
|
$'tailor.v1.OperatorService/DeleteWorkspace' $'workspaceId=:Set workspaceId'
|
|
325
325
|
$'tailor.v1.OperatorService/ExchangeAuthConnectionAuthorizationCode' $'workspaceId=:Set workspaceId\nconnectionName=:Set connectionName\nauthorizationCode=:Set authorizationCode\nredirectUri=:Set redirectUri'
|
|
326
326
|
$'tailor.v1.OperatorService/GetAIGateway' $'workspaceId=:Set workspaceId\naigatewayName=:Set aigatewayName'
|
|
@@ -372,7 +372,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
372
372
|
$'tailor.v1.OperatorService/GetWorkflowExecution' $'workspaceId=:Set workspaceId\nexecutionId=:Set executionId'
|
|
373
373
|
$'tailor.v1.OperatorService/GetWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionId=:Set jobFunctionId'
|
|
374
374
|
$'tailor.v1.OperatorService/GetWorkflowJobFunctionByName' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName'
|
|
375
|
-
$'tailor.v1.OperatorService/GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\
|
|
375
|
+
$'tailor.v1.OperatorService/GetWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName'
|
|
376
376
|
$'tailor.v1.OperatorService/GetWorkflowJobFunctionExecutionPolicyByKey' $'workspaceId=:Set workspaceId\nexecutionPolicyKey=:Set executionPolicyKey'
|
|
377
377
|
$'tailor.v1.OperatorService/GetWorkspace' $'workspaceId=:Set workspaceId'
|
|
378
378
|
$'tailor.v1.OperatorService/GetWorkspacePlatformUser' $'workspaceId=:Set workspaceId'
|
|
@@ -479,7 +479,7 @@ typeset -gA __tailor_worker_expand_api__field=(
|
|
|
479
479
|
$'tailor.v1.OperatorService/UpdateUserProfileConfig' $'workspaceId=:Set workspaceId\nnamespaceName=:Set namespaceName\nuserProfileProviderConfig.:userProfileProviderConfig (message)\nuserProfileProviderConfig.provider=:Set userProfileProviderConfig.provider\nuserProfileProviderConfig.providerType=:Set userProfileProviderConfig.providerType\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED:USER_PROFILE_PROVIDER_TYPE_UNSPECIFIED\nuserProfileProviderConfig.providerType=USER_PROFILE_PROVIDER_TYPE_TAILORDB:USER_PROFILE_PROVIDER_TYPE_TAILORDB\nuserProfileProviderConfig.config.:userProfileProviderConfig.config (message)\nuserProfileProviderConfig.config.tailordb.:userProfileProviderConfig.config.tailordb (message)\nuserProfileProviderConfig.config.tailordb.namespace=:Set userProfileProviderConfig.config.tailordb.namespace\nuserProfileProviderConfig.config.tailordb.type=:Set userProfileProviderConfig.config.tailordb.type\nuserProfileProviderConfig.config.tailordb.usernameField=:Set userProfileProviderConfig.config.tailordb.usernameField\nuserProfileProviderConfig.config.tailordb.tenantIdField=:Set userProfileProviderConfig.config.tailordb.tenantIdField'
|
|
480
480
|
$'tailor.v1.OperatorService/UpdateWorkflow' $'workspaceId=:Set workspaceId\nworkflowName=:Set workflowName\nmainJobFunctionName=:Set mainJobFunctionName\nretryPolicy.:retryPolicy (message)\nretryPolicy.maxRetries=:Set retryPolicy.maxRetries\nretryPolicy.initialBackoff=:Set retryPolicy.initialBackoff\nretryPolicy.maxBackoff=:Set retryPolicy.maxBackoff\nretryPolicy.backoffMultiplier=:Set retryPolicy.backoffMultiplier\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
481
481
|
$'tailor.v1.OperatorService/UpdateWorkflowJobFunction' $'workspaceId=:Set workspaceId\njobFunctionName=:Set jobFunctionName\nscript=:Set script\nscriptRef=:Set scriptRef'
|
|
482
|
-
$'tailor.v1.OperatorService/UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\
|
|
482
|
+
$'tailor.v1.OperatorService/UpdateWorkflowJobFunctionExecutionPolicy' $'workspaceId=:Set workspaceId\nexecutionPolicyName=:Set executionPolicyName\nconcurrencyPolicy.:concurrencyPolicy (message)\nconcurrencyPolicy.maxConcurrentExecutions=:Set concurrencyPolicy.maxConcurrentExecutions'
|
|
483
483
|
$'tailor.v1.OperatorService/UpdateWorkspace' $'workspaceId=:Set workspaceId\nworkspaceName=:Set workspaceName\norganizationId=:Set organizationId\nfolderId=:Set folderId\ndeleteProtection=:Set deleteProtection\ndeleteProtection=true:true\ndeleteProtection=false:false\nupdateMask=:Set updateMask'
|
|
484
484
|
$'tailor.v1.OperatorService/UpdateWorkspacePlatformUser' $'workspaceId=:Set workspaceId\nemail=:Set email\nrole=:Set role\nrole=WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED:WORKSPACE_PLATFORM_USER_ROLE_UNSPECIFIED\nrole=WORKSPACE_PLATFORM_USER_ROLE_ADMIN:WORKSPACE_PLATFORM_USER_ROLE_ADMIN\nrole=WORKSPACE_PLATFORM_USER_ROLE_EDITOR:WORKSPACE_PLATFORM_USER_ROLE_EDITOR\nrole=WORKSPACE_PLATFORM_USER_ROLE_VIEWER:WORKSPACE_PLATFORM_USER_ROLE_VIEWER'
|
|
485
485
|
$'tailor.v1.OperatorService/UpsertOrganizationFolderIPRestriction' $'organizationId=:Set organizationId\nfolderId=:Set folderId'
|
|
@@ -2674,7 +2674,7 @@ __tailor_worker_complete_setup_coordinate() {
|
|
|
2674
2674
|
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
2675
2675
|
local -a _opts=()
|
|
2676
2676
|
__tailor_worker_not_used "--name" "-n" "--n" && _opts+=("--name:Coordinator name (used in the generated workflow file name and job names)")
|
|
2677
|
-
_opts+=("--action:Composite action to include
|
|
2677
|
+
_opts+=("--action:Composite action to include. Repeat for separate deploy steps, or use commas to deploy actions as one multi-config group. tailor- prefix optional.")
|
|
2678
2678
|
__tailor_worker_not_used "--branch" && _opts+=("--branch:Branch target\: deploy trigger branch (defaults to the detected default branch)")
|
|
2679
2679
|
__tailor_worker_not_used "--tag" && _opts+=("--tag:Generate a tag target coordinator")
|
|
2680
2680
|
__tailor_worker_not_used "--environment" && _opts+=("--environment:GitHub Environment for the plan/deploy jobs")
|
|
@@ -4,8 +4,8 @@ import { AIGatewayConfig } from "../services/aigateway/types.mjs";
|
|
|
4
4
|
import { IdPConfig } from "../services/idp/types.mjs";
|
|
5
5
|
import { SecretsConfig } from "../services/secrets/types.mjs";
|
|
6
6
|
import { StaticWebsiteConfig } from "../services/staticwebsite/types.mjs";
|
|
7
|
+
import { ExecutionPolicyInstance } from "../services/workflow/execution-policy.types.mjs";
|
|
7
8
|
import { LogLevelEnum } from "../../types/app-config.generated.mjs";
|
|
8
|
-
|
|
9
9
|
//#region src/configure/config/types.d.ts
|
|
10
10
|
type LogLevel = LogLevelEnum;
|
|
11
11
|
type LogLevelInput = LogLevel | (string & {});
|
|
@@ -33,6 +33,8 @@ type WorkflowServiceConfig = {
|
|
|
33
33
|
job_files?: string[];
|
|
34
34
|
ignores?: string[];
|
|
35
35
|
job_ignores?: string[];
|
|
36
|
+
/** Workspace-level execution policies for workflow job functions. */
|
|
37
|
+
executionPolicies?: Record<string, ExecutionPolicyInstance>;
|
|
36
38
|
};
|
|
37
39
|
type WorkflowServiceInput = WorkflowServiceConfig;
|
|
38
40
|
/**
|