@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AttributeList, Attributes, Env, TailorPrincipal } from "../runtime/types.mjs";
|
|
2
|
-
import { InferFieldsOutput, output as output$1 } from "../types/helpers.mjs";
|
|
3
1
|
import { ArrayFieldOutput, FieldMetadata, FieldOptions, FieldOutput, TailorFieldType } from "./types/field.types.mjs";
|
|
2
|
+
import { AttributeList, Attributes, Env, TailorPrincipal } from "../runtime/types.mjs";
|
|
3
|
+
import { DeepWritable, NullableToOptional, output as output$1 } from "../types/helpers.mjs";
|
|
4
4
|
import { PluginAttachment } from "./services/tailordb/types.mjs";
|
|
5
5
|
import { AuthConnectionConfig, AuthConnectionOAuth2Config } from "../types/auth-connection.generated.mjs";
|
|
6
6
|
import { BuiltinIdP, IDToken, IdProvider, OAuth2ClientInput, OIDC, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAuthorization, SCIMConfig, SCIMResource, TenantProvider } from "../types/auth.generated.mjs";
|
|
@@ -15,9 +15,12 @@ import { IdPEmailConfig, IdPGqlOperations, IdPGqlOperationsInput } from "../type
|
|
|
15
15
|
import { IdPConfig, IdPExternalConfig } from "./services/idp/types.mjs";
|
|
16
16
|
import { SecretsConfig } from "./services/secrets/types.mjs";
|
|
17
17
|
import { StaticWebsiteConfig } from "./services/staticwebsite/types.mjs";
|
|
18
|
+
import { ExecutionPolicyConcurrency, ExecutionPolicyDefInput, ExecutionPolicyExactInstance, ExecutionPolicyGroupOptions, ExecutionPolicyInstance, ExecutionPolicyWildcardInstance, ResolvedExecutionPolicyInstance } from "./services/workflow/execution-policy.types.mjs";
|
|
18
19
|
import { ExecutorServiceConfig, ExecutorServiceInput, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, WorkflowServiceConfig, WorkflowServiceInput } from "./config/types.mjs";
|
|
19
20
|
import { ConcurrencyPolicy, RetryPolicy } from "../types/workflow.generated.mjs";
|
|
20
21
|
import { TailorAnyField, TailorField } from "./types/type.mjs";
|
|
22
|
+
import "./types/machine-user.mjs";
|
|
23
|
+
import "./types/index.mjs";
|
|
21
24
|
import { IdpName, IdpNameRegistry } from "./types/idp-name.mjs";
|
|
22
25
|
import { ConnectionName, ConnectionNameRegistry } from "./types/connection-name.mjs";
|
|
23
26
|
import { AIGatewayName, AIGatewayNameRegistry } from "./types/aigateway-name.mjs";
|
|
@@ -32,6 +35,7 @@ import { ScheduleArgs, ScheduleTrigger, scheduleTrigger } from "./services/execu
|
|
|
32
35
|
import { IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, incomingWebhookTrigger } from "./services/executor/trigger/webhook.mjs";
|
|
33
36
|
import { Trigger } from "./services/executor/trigger/index.mjs";
|
|
34
37
|
import { createExecutor } from "./services/executor/executor.mjs";
|
|
38
|
+
import { defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy } from "./services/workflow/execution-policy.mjs";
|
|
35
39
|
import { WaitPointInstance, createWaitPoint, createWaitPoints } from "./services/workflow/wait-point.mjs";
|
|
36
40
|
import { defineStaticWebSite } from "./services/staticwebsite/index.mjs";
|
|
37
41
|
import { defineAIGateway } from "./services/aigateway/index.mjs";
|
|
@@ -39,8 +43,8 @@ import { IdPPermission, IdPPermissionCondition, unsafeAllowAllIdPPermission } fr
|
|
|
39
43
|
import { defineIdp } from "./services/idp/index.mjs";
|
|
40
44
|
import { defineSecretManager } from "./services/secrets/index.mjs";
|
|
41
45
|
import { HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, createHttpAdapter } from "./services/http-adapter/http-adapter.mjs";
|
|
46
|
+
import "./services/index.mjs";
|
|
42
47
|
import { defineConfig, definePlugins } from "./config/index.mjs";
|
|
43
|
-
|
|
44
48
|
//#region src/configure/index.d.ts
|
|
45
49
|
type TailorOutput<T> = output$1<T>;
|
|
46
50
|
type infer<T> = TailorOutput<T>;
|
|
@@ -112,11 +116,19 @@ declare const t: {
|
|
|
112
116
|
array: Opt extends {
|
|
113
117
|
array: true;
|
|
114
118
|
} ? true : false;
|
|
115
|
-
}, FieldOutput<
|
|
119
|
+
}, FieldOutput<Omit<DeepWritable<NullableToOptional<{ [K_2 in keyof F]: output$1<F[K_2]>; }> extends (infer T_1) ? { [K_1 in keyof T_1 as string extends K_1 ? never : K_1]: T_1[K_1]; } : never>, { [K_3 in keyof F]: F[K_3] extends {
|
|
120
|
+
_defined: {
|
|
121
|
+
default: true;
|
|
122
|
+
};
|
|
123
|
+
} ? K_3 : never; }[keyof F] & string> & { [K_4 in { [K_3 in keyof F]: F[K_3] extends {
|
|
124
|
+
_defined: {
|
|
125
|
+
default: true;
|
|
126
|
+
};
|
|
127
|
+
} ? K_3 : never; }[keyof F] & keyof F]?: output$1<F[K_4]> | undefined; } extends (infer T) ? { [K in keyof T as string extends K ? never : K]: T[K]; } : never, Opt>, FieldMetadata, TailorFieldType>;
|
|
116
128
|
};
|
|
117
129
|
declare namespace t {
|
|
118
130
|
type output<T> = TailorOutput<T>;
|
|
119
131
|
type infer<T> = TailorOutput<T>;
|
|
120
132
|
}
|
|
121
133
|
//#endregion
|
|
122
|
-
export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type Attributes, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type ConnectionName, type ConnectionNameRegistry, type DefinedAuth, type Env, type ExecutorReadyContext, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, type GeneratorResult, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, type IdpName, type IdpNameRegistry, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedType, type PluginNamespaceProcessContext, type PluginOutput, type PluginProcessContext, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverNamespaceData, type ResolverReadyContext, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, TailorDBTrigger, type TailorDBType, type TailorDBTypeForPlugin, type TailorField, type TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
|
|
134
|
+
export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type Attributes, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type ConnectionName, type ConnectionNameRegistry, type DefinedAuth, type Env, type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ExecutorReadyContext, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, type GeneratorResult, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, type IdpName, type IdpNameRegistry, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedType, type PluginNamespaceProcessContext, type PluginOutput, type PluginProcessContext, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type ResolvedExecutionPolicyInstance, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverNamespaceData, type ResolverReadyContext, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, TailorDBTrigger, type TailorDBType, type TailorDBTypeForPlugin, type TailorField, type TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
|
package/dist/configure/index.mjs
CHANGED
|
@@ -1,9 +1,203 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as parseInternal, r as mapAllowedValues, t as db } from "../schema-iCd1ugGp.mjs";
|
|
2
2
|
import { t as brandValue } from "../brand-Eo4pLXPJ.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { a as registerJob, n as dispatchTriggerJob, r as dispatchTriggerWorkflow } from "../registry-DH4m7eYo.mjs";
|
|
3
|
+
import { a as registerJob, n as dispatchTriggerJob, r as dispatchTriggerWorkflow } from "../registry-BSbq6SPo.mjs";
|
|
5
4
|
import { i as withWorkflowTestInvoker } from "../test-env-key-D7UkZp99.mjs";
|
|
6
5
|
|
|
6
|
+
//#region src/configure/types/type.ts
|
|
7
|
+
function createTailorField(type, options, fields, values, metadata) {
|
|
8
|
+
const _metadata = metadata ? {
|
|
9
|
+
...metadata,
|
|
10
|
+
...metadata.allowedValues && { allowedValues: metadata.allowedValues.map((v) => ({ ...v })) },
|
|
11
|
+
...metadata.validate && { validate: metadata.validate.map((v) => Array.isArray(v) ? [...v] : v) }
|
|
12
|
+
} : { required: true };
|
|
13
|
+
if (!metadata) {
|
|
14
|
+
if (options) {
|
|
15
|
+
if (options.optional === true) _metadata.required = false;
|
|
16
|
+
if (options.array === true) _metadata.array = true;
|
|
17
|
+
}
|
|
18
|
+
if (values) _metadata.allowedValues = mapAllowedValues(values);
|
|
19
|
+
}
|
|
20
|
+
function parseInternal$1(args) {
|
|
21
|
+
return parseInternal({
|
|
22
|
+
...args,
|
|
23
|
+
field
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Clone the field and apply metadata updates to the clone.
|
|
28
|
+
* The original instance is never mutated, so a field shared across places
|
|
29
|
+
* cannot leak metadata between them.
|
|
30
|
+
* @param metadataUpdates - Metadata properties to overwrite on the clone
|
|
31
|
+
* @returns A new field with the updated metadata
|
|
32
|
+
*/
|
|
33
|
+
function cloneWith(metadataUpdates) {
|
|
34
|
+
const cloned = field.clone();
|
|
35
|
+
Object.assign(cloned._metadata, metadataUpdates);
|
|
36
|
+
return cloned;
|
|
37
|
+
}
|
|
38
|
+
const field = {
|
|
39
|
+
type,
|
|
40
|
+
fields: fields ?? {},
|
|
41
|
+
_defined: void 0,
|
|
42
|
+
_output: void 0,
|
|
43
|
+
_metadata,
|
|
44
|
+
get metadata() {
|
|
45
|
+
return { ...this._metadata };
|
|
46
|
+
},
|
|
47
|
+
description(description) {
|
|
48
|
+
return cloneWith({ description });
|
|
49
|
+
},
|
|
50
|
+
typeName(typeName) {
|
|
51
|
+
return cloneWith({ typeName });
|
|
52
|
+
},
|
|
53
|
+
validate(...validateInputs) {
|
|
54
|
+
return cloneWith({ validate: validateInputs });
|
|
55
|
+
},
|
|
56
|
+
parse(args) {
|
|
57
|
+
return parseInternal$1({
|
|
58
|
+
value: args.value,
|
|
59
|
+
data: args.data,
|
|
60
|
+
invoker: args.invoker,
|
|
61
|
+
pathArray: []
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
_parseInternal: parseInternal$1,
|
|
65
|
+
clone() {
|
|
66
|
+
let clonedFields = fields;
|
|
67
|
+
if (fields) {
|
|
68
|
+
const cloned = {};
|
|
69
|
+
for (const [key, nestedField] of Object.entries(fields)) cloned[key] = nestedField.clone();
|
|
70
|
+
clonedFields = cloned;
|
|
71
|
+
}
|
|
72
|
+
return createTailorField(type, options, clonedFields, values, this._metadata);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return field;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Create a UUID field for resolver input/output.
|
|
79
|
+
* @param options - Field configuration options
|
|
80
|
+
* @returns A UUID field
|
|
81
|
+
* @example t.uuid()
|
|
82
|
+
*/
|
|
83
|
+
function uuid(options) {
|
|
84
|
+
return createTailorField("uuid", options);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create a string field for resolver input/output.
|
|
88
|
+
* @param options - Field configuration options
|
|
89
|
+
* @returns A string field
|
|
90
|
+
* @example t.string()
|
|
91
|
+
* @example t.string({ optional: true })
|
|
92
|
+
* @example t.string({ array: true })
|
|
93
|
+
*/
|
|
94
|
+
function string(options) {
|
|
95
|
+
return createTailorField("string", options);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Create a boolean field for resolver input/output.
|
|
99
|
+
* @param options - Field configuration options
|
|
100
|
+
* @returns A boolean field
|
|
101
|
+
* @example t.bool()
|
|
102
|
+
*/
|
|
103
|
+
function bool(options) {
|
|
104
|
+
return createTailorField("boolean", options);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Create an integer field for resolver input/output.
|
|
108
|
+
* @param options - Field configuration options
|
|
109
|
+
* @returns An integer field
|
|
110
|
+
* @example t.int()
|
|
111
|
+
*/
|
|
112
|
+
function int(options) {
|
|
113
|
+
return createTailorField("integer", options);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Create a float field for resolver input/output.
|
|
117
|
+
* @param options - Field configuration options
|
|
118
|
+
* @returns A float field
|
|
119
|
+
* @example t.float()
|
|
120
|
+
*/
|
|
121
|
+
function float(options) {
|
|
122
|
+
return createTailorField("float", options);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Create a decimal field for resolver input/output (stored as string for precision).
|
|
126
|
+
* @param options - Field configuration options
|
|
127
|
+
* @returns A decimal field
|
|
128
|
+
* @example t.decimal()
|
|
129
|
+
* @example t.decimal({ optional: true })
|
|
130
|
+
*/
|
|
131
|
+
function decimal(options) {
|
|
132
|
+
return createTailorField("decimal", options);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a date field for resolver input/output.
|
|
136
|
+
* @param options - Field configuration options
|
|
137
|
+
* @returns A date field
|
|
138
|
+
* @example t.date()
|
|
139
|
+
*/
|
|
140
|
+
function date(options) {
|
|
141
|
+
return createTailorField("date", options);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Create a datetime field for resolver input/output.
|
|
145
|
+
* @param options - Field configuration options
|
|
146
|
+
* @returns A datetime field
|
|
147
|
+
* @example t.datetime()
|
|
148
|
+
*/
|
|
149
|
+
function datetime(options) {
|
|
150
|
+
return createTailorField("datetime", options);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Create a time field for resolver input/output.
|
|
154
|
+
* @param options - Field configuration options
|
|
155
|
+
* @returns A time field
|
|
156
|
+
* @example t.time()
|
|
157
|
+
*/
|
|
158
|
+
function time(options) {
|
|
159
|
+
return createTailorField("time", options);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Create an enum field for resolver input/output.
|
|
163
|
+
* @param values - Array of allowed string values
|
|
164
|
+
* @param options - Field configuration options
|
|
165
|
+
* @returns An enum field
|
|
166
|
+
* @example t.enum(["active", "inactive"])
|
|
167
|
+
*/
|
|
168
|
+
function _enum(values, options) {
|
|
169
|
+
return createTailorField("enum", options, void 0, values);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Create a nested object field for resolver input/output.
|
|
173
|
+
* @param fields - Record of field definitions
|
|
174
|
+
* @param options - Field options (optional, array)
|
|
175
|
+
* @returns A nested object field
|
|
176
|
+
* @example
|
|
177
|
+
* // Single object:
|
|
178
|
+
* output: t.object({ name: t.string(), email: t.string() })
|
|
179
|
+
* @example
|
|
180
|
+
* // Array of objects:
|
|
181
|
+
* items: t.object({ name: t.string() }, { array: true })
|
|
182
|
+
*/
|
|
183
|
+
function object(fields, options) {
|
|
184
|
+
return createTailorField("nested", options, fields);
|
|
185
|
+
}
|
|
186
|
+
const t$1 = {
|
|
187
|
+
uuid,
|
|
188
|
+
string,
|
|
189
|
+
bool,
|
|
190
|
+
int,
|
|
191
|
+
float,
|
|
192
|
+
decimal,
|
|
193
|
+
date,
|
|
194
|
+
datetime,
|
|
195
|
+
time,
|
|
196
|
+
enum: _enum,
|
|
197
|
+
object
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
//#endregion
|
|
7
201
|
//#region src/configure/services/auth/index.ts
|
|
8
202
|
/* @__NO_SIDE_EFFECTS__ */
|
|
9
203
|
function defineAuth(name, config) {
|
|
@@ -349,6 +543,114 @@ function incomingWebhookTrigger(options) {
|
|
|
349
543
|
};
|
|
350
544
|
}
|
|
351
545
|
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region src/configure/services/workflow/execution-policy.ts
|
|
548
|
+
const EXECUTION_POLICY_EXACT_KEY_REGEX = /^[a-z0-9][a-z0-9_:.-]{0,62}[a-z0-9]$/;
|
|
549
|
+
function createExecutionPolicyInstance(initialName, initialKey, concurrencyPolicy, matchType, separator, allowNameSetter, allowKeySetter) {
|
|
550
|
+
const isPrefix = matchType === "prefix";
|
|
551
|
+
const raw = {
|
|
552
|
+
name: initialName,
|
|
553
|
+
key: initialKey,
|
|
554
|
+
matchType,
|
|
555
|
+
...concurrencyPolicy && { concurrencyPolicy },
|
|
556
|
+
...isPrefix && { keyFor: (suffix) => {
|
|
557
|
+
const key = `${raw.key}${separator}${suffix}`;
|
|
558
|
+
if (!EXECUTION_POLICY_EXACT_KEY_REGEX.test(key)) throw new Error(`Invalid execution policy key "${key}" built by keyFor("${suffix}"): must match [a-z0-9_:.-] (2-64 chars; must start and end with [a-z0-9]).`);
|
|
559
|
+
return key;
|
|
560
|
+
} }
|
|
561
|
+
};
|
|
562
|
+
return {
|
|
563
|
+
instance: brandValue(raw, "execution-policy"),
|
|
564
|
+
setName: allowNameSetter ? (n) => {
|
|
565
|
+
raw.name = n;
|
|
566
|
+
} : void 0,
|
|
567
|
+
setKey: allowKeySetter ? (k) => {
|
|
568
|
+
raw.key = k;
|
|
569
|
+
} : void 0
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Define a single workflow job function execution policy.
|
|
574
|
+
*
|
|
575
|
+
* Use this when declaring a policy outside the
|
|
576
|
+
* {@link defineWorkflowExecutionPolicies} builder — for example, when the
|
|
577
|
+
* runtime key prefix needs to differ from the corresponding workspace-unique
|
|
578
|
+
* name.
|
|
579
|
+
*
|
|
580
|
+
* When `matchType: "prefix"` is set, the returned instance has `keyFor(suffix)`
|
|
581
|
+
* instead of a directly-usable `key` (see {@link ExecutionPolicyWildcardInstance}).
|
|
582
|
+
* @param name - Workspace-unique name. Must match `^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$`.
|
|
583
|
+
* @param def - Optional overrides for `key` (defaults to `name`), `matchType`, `separator` (the `keyFor` join character, defaults to `.`), and concurrency
|
|
584
|
+
* @returns An execution policy instance
|
|
585
|
+
* @example
|
|
586
|
+
* export const perTenant = defineWorkflowExecutionPolicy("tenant-api", {
|
|
587
|
+
* matchType: "prefix",
|
|
588
|
+
* concurrencyPolicy: { maxConcurrentExecutions: 3 },
|
|
589
|
+
* });
|
|
590
|
+
*
|
|
591
|
+
* perTenant.keyFor(tenantId); // "tenant-api.<tenantId>"
|
|
592
|
+
*/
|
|
593
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
594
|
+
function defineWorkflowExecutionPolicy(name, def) {
|
|
595
|
+
return createExecutionPolicyInstance(name, def?.key ?? name, def?.concurrencyPolicy, def?.matchType ?? "exact", def?.separator ?? ".", false, false).instance;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Define a group of workflow job function execution policies. Property names
|
|
599
|
+
* become the workspace-unique `name` and default `key` verbatim, matching the
|
|
600
|
+
* mental model of {@link defineWaitPoints}. Provide `name` / `key` explicitly
|
|
601
|
+
* to override the property-name default (for example, when the property name
|
|
602
|
+
* is not valid for the execution policy grammar or when the runtime key
|
|
603
|
+
* prefix needs to differ).
|
|
604
|
+
*
|
|
605
|
+
* When `matchType: "prefix"` is set, the returned instance has `keyFor(suffix)`
|
|
606
|
+
* instead of a directly-usable `key` (see {@link ExecutionPolicyWildcardInstance}).
|
|
607
|
+
* `matchType` can be combined with an explicit `key`, or left to apply to
|
|
608
|
+
* the property-name-derived prefix.
|
|
609
|
+
*
|
|
610
|
+
* The return type mirrors the builder's return type so JSDoc on each property
|
|
611
|
+
* is preserved in IDE autocompletion.
|
|
612
|
+
* @param builder - Callback that receives a `define` factory and returns a record of policies
|
|
613
|
+
* @param options - Group-wide options; `separator` overrides the `.` `keyFor` uses to join the prefix and suffix for every prefix policy in the group
|
|
614
|
+
* @returns The same object returned by the builder (with `name` / `key` resolved on each instance)
|
|
615
|
+
* @example
|
|
616
|
+
* export const executionPolicies = defineWorkflowExecutionPolicies((define) => ({
|
|
617
|
+
* premium: define({ concurrencyPolicy: { maxConcurrentExecutions: 5 } }),
|
|
618
|
+
* "tenant-api": define({
|
|
619
|
+
* matchType: "prefix",
|
|
620
|
+
* concurrencyPolicy: { maxConcurrentExecutions: 3 },
|
|
621
|
+
* }),
|
|
622
|
+
* }));
|
|
623
|
+
*
|
|
624
|
+
* // In a workflow job function:
|
|
625
|
+
* await tailor.workflow.triggerJobFunction("worker", args, {
|
|
626
|
+
* executionPolicyKey: executionPolicies.premium.key,
|
|
627
|
+
* });
|
|
628
|
+
* await tailor.workflow.triggerJobFunction("worker", args, {
|
|
629
|
+
* executionPolicyKey: executionPolicies["tenant-api"].keyFor(input.tenantId),
|
|
630
|
+
* });
|
|
631
|
+
*/
|
|
632
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
633
|
+
function defineWorkflowExecutionPolicies(builder, options) {
|
|
634
|
+
const separator = options?.separator ?? ".";
|
|
635
|
+
const nameSetters = /* @__PURE__ */ new Map();
|
|
636
|
+
const keySetters = /* @__PURE__ */ new Map();
|
|
637
|
+
const define = (def) => {
|
|
638
|
+
const explicitName = def?.name;
|
|
639
|
+
const explicitKey = def?.key;
|
|
640
|
+
const { instance, setName, setKey } = createExecutionPolicyInstance(explicitName ?? "__pending__", explicitKey ?? explicitName ?? "__pending__", def?.concurrencyPolicy, def?.matchType ?? "exact", separator, explicitName === void 0, explicitKey === void 0 && explicitName === void 0);
|
|
641
|
+
if (setName) nameSetters.set(instance, setName);
|
|
642
|
+
if (setKey) keySetters.set(instance, setKey);
|
|
643
|
+
return instance;
|
|
644
|
+
};
|
|
645
|
+
const result = builder(define);
|
|
646
|
+
for (const propName of Object.keys(result)) {
|
|
647
|
+
const instance = result[propName];
|
|
648
|
+
nameSetters.get(instance)?.(propName);
|
|
649
|
+
keySetters.get(instance)?.(propName);
|
|
650
|
+
}
|
|
651
|
+
return result;
|
|
652
|
+
}
|
|
653
|
+
|
|
352
654
|
//#endregion
|
|
353
655
|
//#region src/configure/services/workflow/job.ts
|
|
354
656
|
/**
|
|
@@ -390,7 +692,9 @@ function createWorkflowJob(config) {
|
|
|
390
692
|
if (!process.env.__TAILOR_PLATFORM_BUNDLE) registerJob(config.name, body);
|
|
391
693
|
const trigger = process.env.__TAILOR_PLATFORM_BUNDLE ? () => {
|
|
392
694
|
throw new Error("This workflow job's .trigger() is rewritten at build time and is unavailable in the bundle");
|
|
393
|
-
} : (args
|
|
695
|
+
} : function trigger(args, options) {
|
|
696
|
+
return arguments.length >= 2 ? dispatchTriggerJob(config.name, args, options) : dispatchTriggerJob(config.name, args);
|
|
697
|
+
};
|
|
394
698
|
return brandValue({
|
|
395
699
|
name: config.name,
|
|
396
700
|
trigger,
|
|
@@ -715,5 +1019,5 @@ function definePlugins(...configs) {
|
|
|
715
1019
|
const t = t$1;
|
|
716
1020
|
|
|
717
1021
|
//#endregion
|
|
718
|
-
export { authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
|
|
1022
|
+
export { authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission };
|
|
719
1023
|
//# sourceMappingURL=index.mjs.map
|