@tailor-platform/sdk 2.0.0-next.4 → 2.0.0-next.6
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 +135 -0
- package/dist/{application-BX13RArL.mjs → application-BJXRpQj5.mjs} +602 -1842
- package/dist/application-BJXRpQj5.mjs.map +1 -0
- package/dist/application-BV-AXawv.mjs +3 -0
- 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 +13 -3
- 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 -1
- 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/options.d.mts +0 -1
- package/dist/cli/commands/generate/service.d.mts +6 -2
- 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/staticwebsite/deploy.d.mts +19 -0
- 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 +3 -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 +1 -1
- package/dist/cli/commands/workspace/restore.d.mts +0 -1
- package/dist/cli/commands/workspace/transform.d.mts +4 -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 +871 -1577
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +10 -4
- package/dist/cli/lib.mjs +50 -4
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/query/index.d.mts +0 -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 +1 -2
- package/dist/cli/shared/context.d.mts +2 -1
- package/dist/cli/shared/readonly-guard.d.mts +25 -0
- package/dist/cli/shared/script-executor.d.mts +0 -1
- package/dist/cli/shared/seed-chunker.d.mts +7 -3
- package/dist/cli/shared/tailordb-namespaces.d.mts +37 -0
- package/dist/cli/shared/type-generator.d.mts +0 -1
- package/dist/cli/shared/workspace-name.d.mts +1 -0
- package/dist/completion/zsh-worker.zsh +15 -303
- package/dist/configure/config/index.d.mts +0 -1
- package/dist/configure/config/types.d.mts +2 -2
- package/dist/configure/index.d.mts +14 -4
- package/dist/configure/index.mjs +201 -6
- 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 +2 -13
- package/dist/configure/services/executor/index.d.mts +1 -0
- package/dist/configure/services/executor/operation.d.mts +9 -4
- 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 +5 -0
- 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 +86 -56
- package/dist/configure/services/tailordb/types.d.mts +66 -17
- package/dist/configure/services/workflow/execution-policy.d.mts +2 -3
- package/dist/configure/services/workflow/execution-policy.types.d.mts +0 -1
- package/dist/configure/services/workflow/index.d.mts +1 -0
- package/dist/configure/services/workflow/job.d.mts +0 -1
- 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.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 +2 -11
- package/dist/{crashreport-D3RjuSYb.mjs → crashreport-0ioNRZ4K.mjs} +1 -1
- package/dist/{crashreport-Cg-pqRJV.mjs → crashreport-CxHne11E.mjs} +4 -3
- package/dist/{crashreport-Cg-pqRJV.mjs.map → crashreport-CxHne11E.mjs.map} +1 -1
- package/dist/errors-DfnF4ibq.mjs +100 -0
- package/dist/errors-DfnF4ibq.mjs.map +1 -0
- package/dist/{globals-BjhJJ2dN.mjs → globals-D-YbJKW-.mjs} +16 -10
- package/dist/globals-D-YbJKW-.mjs.map +1 -0
- package/dist/kysely/index.d.mts +3 -4
- package/dist/{kysely-type-D-zflMGf.mjs → kysely-type-DqIRgDYR.mjs} +4 -3
- package/dist/kysely-type-DqIRgDYR.mjs.map +1 -0
- package/dist/{logger-BEiZZ3qT.mjs → logger-BwS4ppwO.mjs} +3 -3
- package/dist/logger-BwS4ppwO.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/type-source.d.mts +10 -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/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-BM1caLT0.mjs → register-ts-hook-DL31O2W9.mjs} +3076 -1744
- package/dist/register-ts-hook-DL31O2W9.mjs.map +1 -0
- package/dist/{registry-BSbq6SPo.mjs → registry-CC3CbQiF.mjs} +3 -3
- package/dist/registry-CC3CbQiF.mjs.map +1 -0
- package/dist/runtime/aigateway.d.mts +0 -1
- package/dist/runtime/authconnection.d.mts +0 -1
- package/dist/runtime/context.d.mts +0 -1
- package/dist/runtime/field-parse.d.mts +10 -0
- package/dist/runtime/globals.d.mts +5 -3
- package/dist/runtime/index.d.mts +0 -1
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/types.d.mts +9 -4
- package/dist/runtime/workflow.d.mts +70 -10
- package/dist/runtime/workflow.mjs +1 -1
- package/dist/{schema-C4LYbXVG.mjs → schema--xYWRGfe.mjs} +272 -51
- package/dist/schema--xYWRGfe.mjs.map +1 -0
- package/dist/{secret-file-aoNXJmKa.mjs → secret-file-C3J4Gy8r.mjs} +2 -27
- package/dist/secret-file-C3J4Gy8r.mjs.map +1 -0
- package/dist/{secretmanager-Bd45j7an.mjs → secretmanager-IY4UvinW.mjs} +42 -9
- package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
- package/dist/seed/index.d.mts +3 -2
- package/dist/{service-ufH7sS8o.mjs → service-CnHz9rwz.mjs} +47 -20
- package/dist/service-CnHz9rwz.mjs.map +1 -0
- package/dist/{service-DeZeYa06.mjs → service-DaeJlBoH.mjs} +3 -3
- package/dist/{service-DeZeYa06.mjs.map → service-DaeJlBoH.mjs.map} +1 -1
- package/dist/service-nU6ITOHL.mjs +3 -0
- package/dist/service_pb-BoLM0X4K.mjs +167 -0
- package/dist/service_pb-BoLM0X4K.mjs.map +1 -0
- package/dist/{service_pb-B2FF59sP.mjs → service_pb-r1T7kpJc.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 +0 -1
- 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 +0 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +0 -1
- 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 +133 -123
- 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/user-agent-Bgsszb5I.mjs +28 -0
- package/dist/user-agent-Bgsszb5I.mjs.map +1 -0
- 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 +9 -9
- package/dist/vitest/index.mjs +591 -173
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock-kysely.d.mts +0 -1
- package/dist/vitest/mock.d.mts +8 -8
- package/dist/vitest/mocks/aigateway.d.mts +16 -6
- package/dist/vitest/mocks/authconnection.d.mts +16 -6
- package/dist/vitest/mocks/file.d.mts +23 -6
- package/dist/vitest/mocks/iconv.d.mts +28 -4
- package/dist/vitest/mocks/idp.d.mts +26 -10
- package/dist/vitest/mocks/secretmanager.d.mts +16 -5
- package/dist/vitest/mocks/tailordb.d.mts +54 -10
- package/dist/vitest/mocks/workflow.d.mts +72 -21
- package/dist/vitest/setup.mjs +2 -2
- package/dist/vitest/workflow-local.d.mts +1 -0
- package/dist/workflow-9kHGKxF2.mjs +64 -0
- package/dist/workflow-9kHGKxF2.mjs.map +1 -0
- package/dist/{service_pb-B5w9rjPY.mjs → workspace_resource_pb-Db3fv68L.mjs} +57 -165
- package/dist/workspace_resource_pb-Db3fv68L.mjs.map +1 -0
- package/docs/cli/application.md +61 -15
- package/docs/cli/setup.md +1 -1
- package/docs/cli/tailordb.md +8 -140
- package/docs/cli/workspace.md +6 -4
- package/docs/cli-reference.md +18 -14
- package/docs/github-actions.md +8 -0
- package/docs/migration/v2.md +247 -0
- package/docs/runtime.md +5 -6
- package/docs/services/aigateway.md +2 -0
- package/docs/services/executor.md +5 -0
- package/docs/services/tailordb.md +144 -68
- package/docs/services/workflow.md +3 -3
- package/docs/testing.md +105 -89
- package/package.json +22 -25
- package/dist/application-BO4ZF8wP.mjs +0 -3
- package/dist/application-BX13RArL.mjs.map +0 -1
- package/dist/cli/erd-viewer-assets/app.js +0 -1424
- package/dist/cli/erd-viewer-assets/index.html +0 -77
- package/dist/cli/erd-viewer-assets/serve.json +0 -13
- package/dist/cli/erd-viewer-assets/styles.css +0 -1036
- package/dist/cli/shared/trigger-context.d.mts +0 -1
- package/dist/configure/types/field-runtime.d.mts +0 -17
- package/dist/errors-118wUDRr.mjs +0 -42
- package/dist/errors-118wUDRr.mjs.map +0 -1
- package/dist/field-runtime-CAnh_oow.mjs +0 -183
- package/dist/field-runtime-CAnh_oow.mjs.map +0 -1
- package/dist/globals-BjhJJ2dN.mjs.map +0 -1
- package/dist/kysely-type-D-zflMGf.mjs.map +0 -1
- package/dist/logger-BEiZZ3qT.mjs.map +0 -1
- package/dist/register-ts-hook-BM1caLT0.mjs.map +0 -1
- package/dist/registry-BSbq6SPo.mjs.map +0 -1
- package/dist/resource_pb-BRv7AMXK.mjs +0 -49
- package/dist/resource_pb-BRv7AMXK.mjs.map +0 -1
- package/dist/schema-C4LYbXVG.mjs.map +0 -1
- package/dist/secret-file-aoNXJmKa.mjs.map +0 -1
- package/dist/secretmanager-Bd45j7an.mjs.map +0 -1
- package/dist/service-CkIwEctX.mjs +0 -3
- package/dist/service-ufH7sS8o.mjs.map +0 -1
- package/dist/service_pb-B5w9rjPY.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-GNuSnsTx.mjs +0 -22
- package/dist/workflow-GNuSnsTx.mjs.map +0 -1
package/dist/configure/index.mjs
CHANGED
|
@@ -1,9 +1,202 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as parseInternal, n as mapAllowedValues, t as db } from "../schema--xYWRGfe.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-BSbq6SPo.mjs";
|
|
3
|
+
import { a as registerJob, n as dispatchTriggerJob, r as dispatchTriggerWorkflow } from "../registry-CC3CbQiF.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
|
+
clone() {
|
|
65
|
+
let clonedFields = fields;
|
|
66
|
+
if (fields) {
|
|
67
|
+
const cloned = {};
|
|
68
|
+
for (const [key, nestedField] of Object.entries(fields)) cloned[key] = nestedField.clone();
|
|
69
|
+
clonedFields = cloned;
|
|
70
|
+
}
|
|
71
|
+
return createTailorField(type, options, clonedFields, values, this._metadata);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return field;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create a UUID field for resolver input/output.
|
|
78
|
+
* @param options - Field configuration options
|
|
79
|
+
* @returns A UUID field
|
|
80
|
+
* @example t.uuid()
|
|
81
|
+
*/
|
|
82
|
+
function uuid(options) {
|
|
83
|
+
return createTailorField("uuid", options);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a string field for resolver input/output.
|
|
87
|
+
* @param options - Field configuration options
|
|
88
|
+
* @returns A string field
|
|
89
|
+
* @example t.string()
|
|
90
|
+
* @example t.string({ optional: true })
|
|
91
|
+
* @example t.string({ array: true })
|
|
92
|
+
*/
|
|
93
|
+
function string(options) {
|
|
94
|
+
return createTailorField("string", options);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create a boolean field for resolver input/output.
|
|
98
|
+
* @param options - Field configuration options
|
|
99
|
+
* @returns A boolean field
|
|
100
|
+
* @example t.bool()
|
|
101
|
+
*/
|
|
102
|
+
function bool(options) {
|
|
103
|
+
return createTailorField("boolean", options);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Create an integer field for resolver input/output.
|
|
107
|
+
* @param options - Field configuration options
|
|
108
|
+
* @returns An integer field
|
|
109
|
+
* @example t.int()
|
|
110
|
+
*/
|
|
111
|
+
function int(options) {
|
|
112
|
+
return createTailorField("integer", options);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create a float field for resolver input/output.
|
|
116
|
+
* @param options - Field configuration options
|
|
117
|
+
* @returns A float field
|
|
118
|
+
* @example t.float()
|
|
119
|
+
*/
|
|
120
|
+
function float(options) {
|
|
121
|
+
return createTailorField("float", options);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Create a decimal field for resolver input/output (stored as string for precision).
|
|
125
|
+
* @param options - Field configuration options
|
|
126
|
+
* @returns A decimal field
|
|
127
|
+
* @example t.decimal()
|
|
128
|
+
* @example t.decimal({ optional: true })
|
|
129
|
+
*/
|
|
130
|
+
function decimal(options) {
|
|
131
|
+
return createTailorField("decimal", options);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Create a date field for resolver input/output.
|
|
135
|
+
* @param options - Field configuration options
|
|
136
|
+
* @returns A date field
|
|
137
|
+
* @example t.date()
|
|
138
|
+
*/
|
|
139
|
+
function date(options) {
|
|
140
|
+
return createTailorField("date", options);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Create a datetime field for resolver input/output.
|
|
144
|
+
* @param options - Field configuration options
|
|
145
|
+
* @returns A datetime field
|
|
146
|
+
* @example t.datetime()
|
|
147
|
+
*/
|
|
148
|
+
function datetime(options) {
|
|
149
|
+
return createTailorField("datetime", options);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Create a time field for resolver input/output.
|
|
153
|
+
* @param options - Field configuration options
|
|
154
|
+
* @returns A time field
|
|
155
|
+
* @example t.time()
|
|
156
|
+
*/
|
|
157
|
+
function time(options) {
|
|
158
|
+
return createTailorField("time", options);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Create an enum field for resolver input/output.
|
|
162
|
+
* @param values - Array of allowed string values
|
|
163
|
+
* @param options - Field configuration options
|
|
164
|
+
* @returns An enum field
|
|
165
|
+
* @example t.enum(["active", "inactive"])
|
|
166
|
+
*/
|
|
167
|
+
function _enum(values, options) {
|
|
168
|
+
return createTailorField("enum", options, void 0, values);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Create a nested object field for resolver input/output.
|
|
172
|
+
* @param fields - Record of field definitions
|
|
173
|
+
* @param options - Field options (optional, array)
|
|
174
|
+
* @returns A nested object field
|
|
175
|
+
* @example
|
|
176
|
+
* // Single object:
|
|
177
|
+
* output: t.object({ name: t.string(), email: t.string() })
|
|
178
|
+
* @example
|
|
179
|
+
* // Array of objects:
|
|
180
|
+
* items: t.object({ name: t.string() }, { array: true })
|
|
181
|
+
*/
|
|
182
|
+
function object(fields, options) {
|
|
183
|
+
return createTailorField("nested", options, fields);
|
|
184
|
+
}
|
|
185
|
+
const t$1 = {
|
|
186
|
+
uuid,
|
|
187
|
+
string,
|
|
188
|
+
bool,
|
|
189
|
+
int,
|
|
190
|
+
float,
|
|
191
|
+
decimal,
|
|
192
|
+
date,
|
|
193
|
+
datetime,
|
|
194
|
+
time,
|
|
195
|
+
enum: _enum,
|
|
196
|
+
object
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
//#endregion
|
|
7
200
|
//#region src/configure/services/auth/index.ts
|
|
8
201
|
/* @__NO_SIDE_EFFECTS__ */
|
|
9
202
|
function defineAuth(name, config) {
|
|
@@ -428,10 +621,10 @@ function defineWorkflowExecutionPolicy(name, def) {
|
|
|
428
621
|
* }));
|
|
429
622
|
*
|
|
430
623
|
* // In a workflow job function:
|
|
431
|
-
* await tailor.workflow.
|
|
624
|
+
* await tailor.workflow.startJobFunction("worker", args, {
|
|
432
625
|
* executionPolicyKey: executionPolicies.premium.key,
|
|
433
626
|
* });
|
|
434
|
-
* await tailor.workflow.
|
|
627
|
+
* await tailor.workflow.startJobFunction("worker", args, {
|
|
435
628
|
* executionPolicyKey: executionPolicies["tenant-api"].keyFor(input.tenantId),
|
|
436
629
|
* });
|
|
437
630
|
*/
|
|
@@ -623,7 +816,9 @@ function createWorkflow(config) {
|
|
|
623
816
|
...config,
|
|
624
817
|
trigger: process.env.__TAILOR_PLATFORM_BUNDLE ? async () => {
|
|
625
818
|
throw new Error("workflow.trigger() is rewritten at build time and unavailable in the bundle");
|
|
626
|
-
} : async (args, options)
|
|
819
|
+
} : async function trigger(args, options) {
|
|
820
|
+
return arguments.length >= 2 ? await dispatchTriggerWorkflow(config.name, args, options) : await dispatchTriggerWorkflow(config.name, args);
|
|
821
|
+
}
|
|
627
822
|
}, "workflow");
|
|
628
823
|
}
|
|
629
824
|
|