@tailor-platform/sdk 2.0.0-next.1 → 2.0.0-next.11
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 +1056 -24
- package/README.md +9 -9
- package/agent-skills/{tailor-sdk → tailor}/SKILL.md +3 -1
- package/dist/aigateway-DR4Kwuik.mjs +9 -0
- package/dist/aigateway-DR4Kwuik.mjs.map +1 -0
- package/dist/{application-DqS1yBg3.mjs → application-CM6hKnSK.mjs} +2155 -2008
- package/dist/application-CM6hKnSK.mjs.map +1 -0
- package/dist/application-CXNaUNhv.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 -0
- package/dist/cli/cache/store.d.mts +1 -0
- package/dist/cli/cache/types.d.mts +1 -0
- package/dist/cli/commands/api/api-call.d.mts +19 -0
- package/dist/cli/commands/api/index.d.mts +4 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +5 -0
- package/dist/cli/commands/deploy/application.d.mts +7 -0
- package/dist/cli/commands/deploy/apply-phases.d.mts +14 -0
- package/dist/cli/commands/deploy/auth.d.mts +5 -0
- package/dist/cli/commands/deploy/deploy.d.mts +35 -0
- package/dist/cli/commands/deploy/executor.d.mts +7 -0
- package/dist/cli/commands/deploy/function-registry-types.d.mts +12 -0
- package/dist/cli/commands/deploy/function-registry.d.mts +6 -0
- package/dist/cli/commands/deploy/idp.d.mts +5 -0
- package/dist/cli/commands/deploy/label.d.mts +2 -0
- package/dist/cli/commands/deploy/resolver.d.mts +5 -0
- package/dist/cli/commands/deploy/secret-manager.d.mts +5 -0
- package/dist/cli/commands/deploy/staticwebsite.d.mts +5 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +10 -0
- package/dist/cli/commands/deploy/types.d.mts +4 -0
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +2 -0
- package/dist/cli/commands/deploy/workflow.d.mts +4 -0
- package/dist/cli/commands/executor/get.d.mts +19 -0
- package/dist/cli/commands/executor/jobs.d.mts +85 -0
- package/dist/cli/commands/executor/list.d.mts +18 -0
- package/dist/cli/commands/executor/transform.d.mts +42 -0
- package/dist/cli/commands/executor/trigger.d.mts +30 -0
- package/dist/cli/commands/executor/webhook.d.mts +21 -0
- package/dist/cli/commands/function/get.d.mts +17 -0
- package/dist/cli/commands/function/list.d.mts +21 -0
- package/dist/cli/commands/function/transform.d.mts +12 -0
- package/dist/cli/commands/generate/options.d.mts +6 -0
- package/dist/cli/commands/generate/seed/bundler.d.mts +27 -0
- package/dist/cli/commands/generate/service.d.mts +15 -0
- package/dist/cli/commands/machineuser/list.d.mts +26 -0
- package/dist/cli/commands/machineuser/token.d.mts +21 -0
- package/dist/cli/commands/oauth2client/get.d.mts +17 -0
- package/dist/cli/commands/oauth2client/list.d.mts +19 -0
- package/dist/cli/commands/oauth2client/transform.d.mts +21 -0
- package/dist/cli/commands/organization/folder/create.d.mts +17 -0
- package/dist/cli/commands/organization/folder/delete.d.mts +15 -0
- package/dist/cli/commands/organization/folder/get.d.mts +16 -0
- package/dist/cli/commands/organization/folder/list.d.mts +21 -0
- package/dist/cli/commands/organization/folder/update.d.mts +17 -0
- package/dist/cli/commands/organization/get.d.mts +15 -0
- package/dist/cli/commands/organization/list.d.mts +14 -0
- package/dist/cli/commands/organization/transform.d.mts +29 -0
- package/dist/cli/commands/organization/tree.d.mts +24 -0
- package/dist/cli/commands/organization/update.d.mts +16 -0
- package/dist/cli/commands/remove.d.mts +15 -0
- package/dist/cli/commands/show.d.mts +39 -0
- package/dist/cli/commands/staticwebsite/deploy.d.mts +19 -0
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +29 -0
- package/dist/cli/commands/tailordb/migrate/config.d.mts +18 -0
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +246 -0
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +16 -0
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +5 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +208 -0
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +98 -0
- package/dist/cli/commands/tailordb/migrate/types.d.mts +7 -0
- package/dist/cli/commands/tailordb/truncate.d.mts +18 -0
- package/dist/cli/commands/workflow/executions.d.mts +62 -0
- package/dist/cli/commands/workflow/get.d.mts +21 -0
- package/dist/cli/commands/workflow/list.d.mts +18 -0
- package/dist/cli/commands/workflow/resume.d.mts +22 -0
- package/dist/cli/commands/workflow/start.d.mts +48 -0
- package/dist/cli/commands/workflow/status.d.mts +6 -0
- package/dist/cli/commands/workflow/transform.d.mts +34 -0
- package/dist/cli/commands/workflow/wait.d.mts +15 -0
- package/dist/cli/commands/workflow/waiter.d.mts +23 -0
- package/dist/cli/commands/workspace/app/health.d.mts +17 -0
- package/dist/cli/commands/workspace/app/list.d.mts +21 -0
- package/dist/cli/commands/workspace/app/transform.d.mts +20 -0
- package/dist/cli/commands/workspace/create.d.mts +27 -0
- package/dist/cli/commands/workspace/delete.d.mts +14 -0
- package/dist/cli/commands/workspace/get.d.mts +16 -0
- package/dist/cli/commands/workspace/list.d.mts +17 -0
- package/dist/cli/commands/workspace/restore.d.mts +14 -0
- package/dist/cli/commands/workspace/transform.d.mts +20 -0
- package/dist/cli/commands/workspace/user/invite.d.mts +21 -0
- package/dist/cli/commands/workspace/user/list.d.mts +21 -0
- package/dist/cli/commands/workspace/user/remove.d.mts +16 -0
- package/dist/cli/commands/workspace/user/transform.d.mts +9 -0
- package/dist/cli/commands/workspace/user/update.d.mts +21 -0
- package/dist/cli/index.mjs +12 -5481
- package/dist/cli/lib.d.mts +86 -21048
- package/dist/cli/lib.mjs +245 -46
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -0
- package/dist/cli/main.mjs +6777 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/query/index.d.mts +38 -0
- package/dist/cli/services/application.d.mts +12 -0
- package/dist/cli/services/auth/service.d.mts +3 -0
- package/dist/cli/services/executor/service.d.mts +1 -0
- package/dist/cli/services/http-adapter/bundler.d.mts +4 -0
- package/dist/cli/services/http-adapter/service.d.mts +2 -0
- package/dist/cli/services/resolver/service.d.mts +1 -0
- package/dist/cli/services/tailordb/service.d.mts +3 -0
- package/dist/cli/services/workflow/bundler.d.mts +3 -0
- package/dist/cli/services/workflow/service.d.mts +1 -0
- package/dist/cli/shared/args.d.mts +13 -0
- package/dist/cli/shared/client.d.mts +1298 -0
- package/dist/cli/shared/config-loader.d.mts +32 -0
- package/dist/cli/shared/context.d.mts +29 -0
- package/dist/cli/shared/error-json.d.mts +23 -0
- package/dist/cli/shared/readonly-guard.d.mts +25 -0
- package/dist/cli/shared/script-executor.d.mts +77 -0
- package/dist/cli/shared/seed-chunker.d.mts +45 -0
- package/dist/cli/shared/seed-context.d.mts +49 -0
- package/dist/cli/shared/tailordb-namespaces.d.mts +40 -0
- package/dist/cli/shared/tsconfig-paths-plugin.d.mts +2 -0
- package/dist/cli/shared/type-generator.d.mts +20 -0
- package/dist/cli/shared/workspace-name.d.mts +1 -0
- package/dist/cli/ts-hook.d.mts +4 -0
- package/dist/cli/ts-hook.mjs +333 -0
- package/dist/completion/zsh-worker.zsh +1471 -1217
- package/dist/configure/config/index.d.mts +20 -0
- package/dist/configure/config/types.d.mts +134 -0
- package/dist/configure/index.d.mts +135 -8
- package/dist/configure/index.mjs +558 -36
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/aigateway/index.d.mts +16 -0
- package/dist/configure/services/aigateway/types.d.mts +10 -0
- package/dist/configure/services/auth/index.d.mts +33 -0
- package/dist/configure/services/auth/types.d.mts +168 -0
- package/dist/configure/services/executor/executor.d.mts +70 -0
- package/dist/configure/services/executor/index.d.mts +9 -0
- package/dist/configure/services/executor/operation.d.mts +50 -0
- package/dist/configure/services/executor/trigger/event.d.mts +514 -0
- package/dist/configure/services/executor/trigger/index.d.mts +7 -0
- package/dist/configure/services/executor/trigger/schedule.d.mts +24 -0
- package/dist/configure/services/executor/trigger/webhook.d.mts +43 -0
- package/dist/configure/services/executor/types.d.mts +2 -0
- package/dist/configure/services/http-adapter/http-adapter.d.mts +124 -0
- package/dist/configure/services/http-adapter/index.d.mts +2 -0
- package/dist/configure/services/idp/index.d.mts +60 -0
- package/dist/configure/services/idp/permission.d.mts +64 -0
- package/dist/configure/services/idp/types.d.mts +23 -0
- package/dist/configure/services/index.d.mts +40 -0
- package/dist/configure/services/resolver/index.d.mts +6 -0
- package/dist/configure/services/resolver/permission.d.mts +64 -0
- package/dist/configure/services/resolver/resolver.d.mts +88 -0
- package/dist/configure/services/resolver/types.d.mts +5 -0
- package/dist/configure/services/secrets/index.d.mts +37 -0
- package/dist/configure/services/secrets/types.d.mts +10 -0
- package/dist/configure/services/staticwebsite/index.d.mts +18 -0
- package/dist/configure/services/staticwebsite/types.d.mts +10 -0
- package/dist/configure/services/tailordb/index.d.mts +3 -0
- package/dist/configure/services/tailordb/permission.d.mts +103 -0
- package/dist/configure/services/tailordb/schema.d.mts +486 -0
- package/dist/configure/services/tailordb/types.d.mts +198 -0
- 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 +9 -0
- package/dist/configure/services/workflow/job.d.mts +92 -0
- package/dist/configure/services/workflow/types.d.mts +2 -0
- package/dist/configure/services/workflow/wait-point.d.mts +72 -0
- package/dist/configure/services/workflow/workflow.d.mts +66 -0
- package/dist/configure/types/aigateway-name.d.mts +12 -0
- package/dist/configure/types/connection-name.d.mts +12 -0
- package/dist/configure/types/field.d.mts +8 -0
- package/dist/configure/types/field.types.d.mts +70 -0
- package/dist/configure/types/idp-name.d.mts +12 -0
- package/dist/configure/types/index.d.mts +5 -0
- package/dist/configure/types/machine-user.d.mts +2 -0
- package/dist/configure/types/permission-operand.types.d.mts +20 -0
- package/dist/configure/types/type.d.mts +73 -0
- package/dist/{context-Bd266-ru.mjs → context-DYQVYWqZ.mjs} +4 -5
- package/dist/context-DYQVYWqZ.mjs.map +1 -0
- package/dist/{crashreport-BsjAkFWw.mjs → crashreport-B5LqCTfF.mjs} +10 -11
- package/dist/{crashreport-BsjAkFWw.mjs.map → crashreport-B5LqCTfF.mjs.map} +1 -1
- package/dist/{crashreport-pr6Rhvza.mjs → crashreport-eI7ty7ok.mjs} +1 -1
- package/dist/{errors-Dtf2WPaW.mjs → errors-D7583Zz7.mjs} +18 -2
- package/dist/errors-D7583Zz7.mjs.map +1 -0
- package/dist/{file-_oUZo76X.mjs → file-BUcmVIH2.mjs} +12 -22
- package/dist/file-BUcmVIH2.mjs.map +1 -0
- package/dist/{globals-Crz8o65k.mjs → globals-TfAVItuK.mjs} +32 -55
- package/dist/globals-TfAVItuK.mjs.map +1 -0
- package/dist/iconv-QWaZh0TT.mjs +38 -0
- package/dist/iconv-QWaZh0TT.mjs.map +1 -0
- package/dist/{idp-BDbK5gjm.mjs → idp-RA_swu-h.mjs} +12 -5
- package/dist/idp-RA_swu-h.mjs.map +1 -0
- package/dist/{interceptor-D-q1rvRl.mjs → interceptor-e33JtsC-.mjs} +2 -2
- package/dist/interceptor-e33JtsC-.mjs.map +1 -0
- package/dist/kysely/index.d.mts +5 -7
- package/dist/logger-BtX0suGY.mjs +48 -0
- package/dist/logger-BtX0suGY.mjs.map +1 -0
- package/dist/logger-CXQq9YIp.mjs +317 -0
- package/dist/logger-CXQq9YIp.mjs.map +1 -0
- package/dist/node-builtins-CmaL2Cbq.mjs +36 -0
- package/dist/node-builtins-CmaL2Cbq.mjs.map +1 -0
- package/dist/parser/service/auth/index.d.mts +1 -0
- package/dist/parser/service/auth/schema.d.mts +3 -0
- package/dist/parser/service/http-adapter/index.d.mts +1 -0
- package/dist/parser/service/http-adapter/schema.d.mts +1 -0
- package/dist/parser/service/idp/types.d.mts +5 -0
- package/dist/parser/service/tailordb/type-source.d.mts +10 -0
- package/dist/parser/service/tailordb/types.d.mts +131 -0
- package/dist/platform-serialize-RoRtBS0v.mjs +46 -0
- package/dist/platform-serialize-RoRtBS0v.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +15 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +115 -2
- package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -0
- package/dist/plugin/builtin/file-utils/index.d.mts +15 -1
- package/dist/plugin/builtin/file-utils/index.mjs +149 -2
- package/dist/plugin/builtin/file-utils/index.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.d.mts +15 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +274 -2
- package/dist/plugin/builtin/kysely-type/index.mjs.map +1 -0
- package/dist/plugin/builtin/seed/index.d.mts +46 -2
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +21 -0
- package/dist/plugin/builtin/seed/types.d.mts +2 -0
- package/dist/plugin/get-generated-type.d.mts +16 -0
- package/dist/plugin/index.d.mts +3 -117
- package/dist/plugin/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/manager.d.mts +2 -0
- package/dist/plugin/types.d.mts +242 -0
- package/dist/plugin/with-context.d.mts +101 -0
- package/dist/{runtime-n9NCkjee.mjs → register-ts-hook-LYV7zH-e.mjs} +9652 -4479
- package/dist/register-ts-hook-LYV7zH-e.mjs.map +1 -0
- package/dist/{registry-DdsYlL_P.mjs → registry-BIGVUrMB.mjs} +12 -9
- package/dist/registry-BIGVUrMB.mjs.map +1 -0
- package/dist/{repl-editor-DmGr9zMw.mjs → repl-editor-BCozyiNq.mjs} +6 -5
- package/dist/{repl-editor-DmGr9zMw.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
- package/dist/runtime/aigateway.d.mts +25 -0
- package/dist/runtime/aigateway.mjs +3 -0
- package/dist/runtime/authconnection.d.mts +21 -2
- package/dist/runtime/authconnection.mjs +2 -2
- package/dist/runtime/context.d.mts +54 -2
- package/dist/runtime/context.mjs +2 -2
- package/dist/runtime/field-parse.d.mts +10 -0
- package/dist/runtime/file.d.mts +170 -2
- package/dist/runtime/file.mjs +2 -2
- package/dist/runtime/globals.d.mts +38 -20
- package/dist/runtime/iconv.d.mts +73 -2
- package/dist/runtime/iconv.mjs +2 -2
- package/dist/runtime/idp.d.mts +129 -2
- package/dist/runtime/idp.mjs +2 -2
- package/dist/runtime/index.d.mts +48 -9
- package/dist/runtime/index.mjs +10 -8
- package/dist/runtime/logger.d.mts +98 -0
- package/dist/runtime/logger.mjs +3 -0
- package/dist/runtime/secretmanager.d.mts +41 -2
- package/dist/runtime/secretmanager.mjs +2 -2
- package/dist/runtime/types.d.mts +25 -0
- package/dist/runtime/workflow.d.mts +106 -2
- package/dist/runtime/workflow.mjs +2 -2
- package/dist/{schema-BhkpP5Hw.mjs → schema--xYWRGfe.mjs} +288 -229
- package/dist/schema--xYWRGfe.mjs.map +1 -0
- package/dist/{secret-file-DBqZhjFQ.mjs → secret-file-C3J4Gy8r.mjs} +2 -2
- package/dist/{secret-file-DBqZhjFQ.mjs.map → secret-file-C3J4Gy8r.mjs.map} +1 -1
- package/dist/secretmanager-CYlpffsz.mjs +13 -0
- package/dist/secretmanager-CYlpffsz.mjs.map +1 -0
- package/dist/secretmanager-IY4UvinW.mjs +131 -0
- package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
- package/dist/seed/index.d.mts +4 -4
- package/dist/seed-B-yckgQY.mjs +483 -0
- package/dist/seed-B-yckgQY.mjs.map +1 -0
- package/dist/{service-DU1mVzri.mjs → service-B5WynBHQ.mjs} +3 -3
- package/dist/{service-DU1mVzri.mjs.map → service-B5WynBHQ.mjs.map} +1 -1
- package/dist/service-M7OYziQP.mjs +3 -0
- package/dist/service-k1xy_A5G.mjs +864 -0
- package/dist/service-k1xy_A5G.mjs.map +1 -0
- package/dist/service_pb-D5--My_M.mjs +167 -0
- package/dist/service_pb-D5--My_M.mjs.map +1 -0
- package/dist/service_pb-i8CmnQP4.mjs +3 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +203 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +57 -0
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +420 -0
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +160 -0
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +2069 -0
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +865 -0
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +111 -0
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +68 -0
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +438 -0
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +586 -0
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +192 -0
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +450 -0
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +191 -0
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +49 -0
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +406 -0
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +429 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +72 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +16 -0
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +308 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +590 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +329 -0
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +112 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +345 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +53 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +3658 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +186 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +28 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +428 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +89 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +683 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +796 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +329 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +207 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +961 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +330 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2014 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +482 -0
- package/dist/{telemetry-CdqJEzkj.mjs → telemetry-BRVdwh14.mjs} +3 -3
- package/dist/telemetry-BRVdwh14.mjs.map +1 -0
- package/dist/telemetry-CkbkeJxl.mjs +3 -0
- package/dist/test-env-key-D7UkZp99.mjs +75 -0
- package/dist/test-env-key-D7UkZp99.mjs.map +1 -0
- package/dist/types/aigateway.generated.d.mts +12 -0
- package/dist/types/app-config.generated.d.mts +4 -0
- package/dist/types/auth-connection.generated.d.mts +33 -0
- package/dist/types/auth.generated.d.mts +188 -0
- package/dist/types/executor.generated.d.mts +229 -0
- package/dist/types/helpers.d.mts +40 -0
- package/dist/types/http-adapter.generated.d.mts +28 -0
- package/dist/types/idp.generated.d.mts +626 -0
- package/dist/types/resolver.generated.d.mts +82 -0
- package/dist/types/secrets.generated.d.mts +14 -0
- package/dist/types/staticwebsite.generated.d.mts +14 -0
- package/dist/types/tailordb.generated.d.mts +468 -0
- package/dist/types/workflow.generated.d.mts +17 -0
- package/dist/user-agent-Bgsszb5I.mjs +28 -0
- package/dist/user-agent-Bgsszb5I.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +5 -100
- package/dist/utils/test/index.mjs +38 -189
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.d.mts +1 -2
- package/dist/vitest/environment.mjs +2 -2
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.d.mts +17 -431
- package/dist/vitest/index.mjs +1234 -67
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock-kysely.d.mts +61 -0
- package/dist/vitest/mock.d.mts +10 -0
- package/dist/vitest/mocks/aigateway.d.mts +40 -0
- package/dist/vitest/mocks/authconnection.d.mts +38 -0
- package/dist/vitest/mocks/file.d.mts +58 -0
- package/dist/vitest/mocks/iconv.d.mts +51 -0
- package/dist/vitest/mocks/idp.d.mts +60 -0
- package/dist/vitest/mocks/logger.d.mts +45 -0
- package/dist/vitest/mocks/secretmanager.d.mts +44 -0
- package/dist/vitest/mocks/tailordb.d.mts +115 -0
- package/dist/vitest/mocks/workflow.d.mts +148 -0
- package/dist/vitest/setup.d.mts +1 -2
- package/dist/vitest/setup.mjs +2 -2
- package/dist/vitest/workflow-local.d.mts +41 -0
- package/dist/workflow-Bamae_Yc.mjs +34 -0
- package/dist/workflow-Bamae_Yc.mjs.map +1 -0
- package/dist/{client-z_oHGVNy.mjs → workspace_resource_pb-DXnO2AT-.mjs} +57 -621
- package/dist/workspace_resource_pb-DXnO2AT-.mjs.map +1 -0
- package/docs/cli/application.md +150 -250
- package/docs/cli/auth.md +51 -295
- package/docs/cli/completion.md +1 -25
- package/docs/cli/crashreport.md +3 -61
- package/docs/cli/executor.md +72 -183
- package/docs/cli/function.md +16 -132
- package/docs/cli/organization.md +11 -221
- package/docs/cli/plugin.md +29 -0
- package/docs/cli/query.md +2 -22
- package/docs/cli/secret.md +71 -251
- package/docs/cli/setup.md +138 -40
- package/docs/cli/skills.md +50 -39
- package/docs/cli/staticwebsite.md +32 -180
- package/docs/cli/tailordb.md +89 -413
- package/docs/cli/upgrade.md +2 -22
- package/docs/cli/user.md +78 -247
- package/docs/cli/workflow.md +150 -172
- package/docs/cli/workspace.md +167 -538
- package/docs/cli-reference.md +214 -96
- package/docs/configuration.md +90 -6
- package/docs/github-actions.md +72 -24
- package/docs/migration/v2.md +1613 -0
- package/docs/multi-environment.md +29 -7
- package/docs/plugin/custom.md +4 -4
- package/docs/plugin/index.md +8 -8
- package/docs/quickstart.md +8 -7
- package/docs/runtime.md +18 -9
- package/docs/services/aigateway.md +20 -2
- package/docs/services/auth.md +51 -59
- package/docs/services/executor.md +91 -6
- package/docs/services/http-adapter.md +16 -1
- package/docs/services/idp.md +62 -7
- package/docs/services/resolver.md +67 -11
- package/docs/services/secret.md +11 -11
- package/docs/services/staticwebsite.md +8 -2
- package/docs/services/tailordb-migration.md +55 -29
- package/docs/services/tailordb.md +205 -102
- package/docs/services/workflow.md +163 -55
- package/docs/testing.md +244 -143
- package/package.json +61 -46
- package/postinstall.mjs +4 -6
- package/dist/application-DB2r36Et.mjs +0 -3
- package/dist/application-DqS1yBg3.mjs.map +0 -1
- package/dist/authconnection-D2MhtTN5.mjs +0 -15
- package/dist/authconnection-D2MhtTN5.mjs.map +0 -1
- package/dist/authconnection-DvUQAjQS.d.mts +0 -39
- package/dist/cli/erd-viewer-assets/app.js +0 -1181
- package/dist/cli/erd-viewer-assets/index.html +0 -73
- package/dist/cli/erd-viewer-assets/serve.json +0 -13
- package/dist/cli/erd-viewer-assets/styles.css +0 -789
- package/dist/cli/index.d.mts +0 -5
- package/dist/cli/index.mjs.map +0 -1
- package/dist/client-Dbohmtkv.mjs +0 -3
- package/dist/client-z_oHGVNy.mjs.map +0 -1
- package/dist/context-Bd266-ru.mjs.map +0 -1
- package/dist/context-BuuIb8CC.d.mts +0 -68
- package/dist/enum-constants-j9QBF0cB.mjs +0 -116
- package/dist/enum-constants-j9QBF0cB.mjs.map +0 -1
- package/dist/errors-Dtf2WPaW.mjs.map +0 -1
- package/dist/field-DOsJCPFa.mjs +0 -22
- package/dist/field-DOsJCPFa.mjs.map +0 -1
- package/dist/file-BB8Vs9O_.d.mts +0 -250
- package/dist/file-_oUZo76X.mjs.map +0 -1
- package/dist/file-utils-DcyIPFQh.mjs +0 -150
- package/dist/file-utils-DcyIPFQh.mjs.map +0 -1
- package/dist/globals-Crz8o65k.mjs.map +0 -1
- package/dist/http-adapter.generated-WgMnb7Sb.d.mts +0 -580
- package/dist/iconv-Co-TOPuH.d.mts +0 -122
- package/dist/iconv-D2vi8G36.mjs +0 -63
- package/dist/iconv-D2vi8G36.mjs.map +0 -1
- package/dist/idp-BDbK5gjm.mjs.map +0 -1
- package/dist/idp-DrhVrLmV.d.mts +0 -160
- package/dist/index-5vPyRu1y.d.mts +0 -18
- package/dist/index-B7AKc18V.d.mts +0 -47
- package/dist/index-BlpzXncY.d.mts +0 -1016
- package/dist/index-CK7u9isy.d.mts +0 -46
- package/dist/index-CNYe5lnW.d.mts +0 -18
- package/dist/index-DjUdWlzf.d.mts +0 -18
- package/dist/index-ZePLwxw7.d.mts +0 -208
- package/dist/interceptor-D-q1rvRl.mjs.map +0 -1
- package/dist/job-fuc3j1Ma.mjs +0 -53
- package/dist/job-fuc3j1Ma.mjs.map +0 -1
- package/dist/kysely-type-DR8uzZTA.mjs +0 -274
- package/dist/kysely-type-DR8uzZTA.mjs.map +0 -1
- package/dist/logger-CxF-Ex5d.mjs +0 -220
- package/dist/logger-CxF-Ex5d.mjs.map +0 -1
- package/dist/mock-BjFj5o1I.mjs +0 -804
- package/dist/mock-BjFj5o1I.mjs.map +0 -1
- package/dist/registry-DdsYlL_P.mjs.map +0 -1
- package/dist/rolldown-runtime-DXywRVcq.mjs +0 -20
- package/dist/runtime-n9NCkjee.mjs.map +0 -1
- package/dist/schema-BhkpP5Hw.mjs.map +0 -1
- package/dist/secretmanager-B3n4KHfm.d.mts +0 -55
- package/dist/secretmanager-BVxw3ih_.mjs +0 -24
- package/dist/secretmanager-BVxw3ih_.mjs.map +0 -1
- package/dist/seed-jf3008-h.mjs +0 -1160
- package/dist/seed-jf3008-h.mjs.map +0 -1
- package/dist/service-CCL8ruDf.mjs +0 -459
- package/dist/service-CCL8ruDf.mjs.map +0 -1
- package/dist/service-D6yonf2I.mjs +0 -3
- package/dist/telemetry-CdqJEzkj.mjs.map +0 -1
- package/dist/telemetry-ClwW5ohF.mjs +0 -3
- package/dist/test-env-key-D9kM6ETE.mjs +0 -49
- package/dist/test-env-key-D9kM6ETE.mjs.map +0 -1
- package/dist/types-B2RpYyA_.mjs +0 -371
- package/dist/types-B2RpYyA_.mjs.map +0 -1
- package/dist/types-ClhIrW_C.mjs +0 -4
- package/dist/types-DCUhgpyI.d.mts +0 -784
- package/dist/types-DhO_VEZd.d.mts +0 -574
- package/dist/types-DwDgacni.d.mts +0 -338
- package/dist/workflow-BbKvGLQg.d.mts +0 -96
- package/dist/workflow-DgemCAz3.mjs +0 -38
- package/dist/workflow-DgemCAz3.mjs.map +0 -1
- package/dist/workflow.generated-DtQwEo-x.d.mts +0 -671
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AIGatewayInput } from "../../../types/aigateway.generated.mjs";
|
|
2
|
+
import { AIGatewayConfig, AIGatewayDefinitionBrand } from "./types.mjs";
|
|
3
|
+
//#region src/configure/services/aigateway/index.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Define an AI Gateway configuration for the Tailor SDK.
|
|
6
|
+
* @param name - AI Gateway name
|
|
7
|
+
* @param config - AI Gateway configuration
|
|
8
|
+
* @returns Defined AI Gateway
|
|
9
|
+
*/
|
|
10
|
+
declare function defineAIGateway(name: string, config: Omit<AIGatewayInput, "name">): {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly cors?: string[] | undefined;
|
|
13
|
+
readonly authNamespace: string;
|
|
14
|
+
} & AIGatewayDefinitionBrand;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { type AIGatewayConfig, defineAIGateway };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AIGatewayInput } from "../../../types/aigateway.generated.mjs";
|
|
2
|
+
//#region src/configure/services/aigateway/types.d.ts
|
|
3
|
+
declare const aiGatewayDefinitionBrand: unique symbol;
|
|
4
|
+
type AIGatewayDefinitionBrand = {
|
|
5
|
+
readonly [aiGatewayDefinitionBrand]: true;
|
|
6
|
+
};
|
|
7
|
+
/** Type accepted by `AppConfig.aiGateways`. Only values returned by `defineAIGateway()` satisfy this. */
|
|
8
|
+
type AIGatewayConfig = AIGatewayInput & AIGatewayDefinitionBrand;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AIGatewayConfig, AIGatewayDefinitionBrand };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DefinedFieldMetadata, FieldMetadata, TailorField, TailorFieldType } from "../../types/field.types.mjs";
|
|
2
|
+
import { AuthConnectionConfig, AuthConnectionOAuth2Config } from "../../../types/auth-connection.generated.mjs";
|
|
3
|
+
import { BuiltinIdP, IDToken, IdProvider, OAuth2ClientInput, OIDC, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAuthorization, SCIMConfig, SCIMResource, TenantProvider } from "../../../types/auth.generated.mjs";
|
|
4
|
+
import { AuthConfig, AuthConnectionTokenResult, AuthExternalConfig, AuthOwnConfig, AuthServiceInput, BeforeLoginClaims, BeforeLoginHookArgs, DefinedAuth, FederatedIdentity, FederatedIdentityClaims, FederatedIdentityProvider, OAuth2ClientGrantType, SCIMAttributeType, UserAttributeKey, UserAttributeListKey, UserAttributes, UsernameFieldKey, ValueOperand } from "./types.mjs";
|
|
5
|
+
import { TailorDBInstance } from "../tailordb/schema.mjs";
|
|
6
|
+
//#region src/configure/services/auth/index.d.ts
|
|
7
|
+
type MachineUserAttributeFields = Record<string, TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
|
|
8
|
+
type PlaceholderUser = TailorDBInstance<Record<string, never>, Record<string, never>>;
|
|
9
|
+
type PlaceholderAttributes = UserAttributes<PlaceholderUser>;
|
|
10
|
+
type PlaceholderAttributeList = UserAttributeListKey<PlaceholderUser>[];
|
|
11
|
+
type UserProfileAuthInput<User extends TailorDBInstance, Attributes extends UserAttributes<User>, AttributeList extends UserAttributeListKey<User>[], MachineUserNames extends string, ConnectionNames extends string = string> = Omit<AuthServiceInput<User, Attributes, AttributeList, MachineUserNames, undefined, ConnectionNames>, "userProfile" | "machineUserAttributes"> & {
|
|
12
|
+
userProfile: NonNullable<AuthServiceInput<User, Attributes, AttributeList, MachineUserNames, undefined>["userProfile"]>;
|
|
13
|
+
machineUserAttributes?: never;
|
|
14
|
+
};
|
|
15
|
+
type MachineUserOnlyAuthInput<MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields, ConnectionNames extends string = string> = Omit<AuthServiceInput<PlaceholderUser, PlaceholderAttributes, PlaceholderAttributeList, MachineUserNames, MachineUserAttributes, ConnectionNames>, "userProfile" | "machineUserAttributes"> & {
|
|
16
|
+
userProfile?: never;
|
|
17
|
+
machineUserAttributes: MachineUserAttributes;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Define an auth service for the Tailor SDK.
|
|
21
|
+
* @template Name
|
|
22
|
+
* @template User
|
|
23
|
+
* @template Attributes
|
|
24
|
+
* @template AttributeList
|
|
25
|
+
* @template MachineUserNames
|
|
26
|
+
* @param name - Auth service name
|
|
27
|
+
* @param config - Auth service configuration
|
|
28
|
+
* @returns Defined auth service
|
|
29
|
+
*/
|
|
30
|
+
declare function defineAuth<const Name extends string, const User extends TailorDBInstance, const Attributes extends UserAttributes<User>, const AttributeList extends UserAttributeListKey<User>[], const MachineUserNames extends string, const ConnectionNames extends string = string>(name: Name, config: UserProfileAuthInput<User, Attributes, AttributeList, MachineUserNames, ConnectionNames>): DefinedAuth<Name, UserProfileAuthInput<User, Attributes, AttributeList, MachineUserNames, ConnectionNames>>;
|
|
31
|
+
declare function defineAuth<const Name extends string, const MachineUserAttributes extends MachineUserAttributeFields, const MachineUserNames extends string, const ConnectionNames extends string = string>(name: Name, config: MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes, ConnectionNames>): DefinedAuth<Name, MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes, ConnectionNames>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type DefinedAuth, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, type IDToken, type IdProvider as IdProviderConfig, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, type TenantProvider as TenantProviderConfig, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, defineAuth };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { DefinedFieldMetadata, FieldMetadata, TailorField, TailorFieldType } from "../../types/field.types.mjs";
|
|
2
|
+
import { TailorEnv } from "../../../runtime/types.mjs";
|
|
3
|
+
import { NullableToOptional, output } from "../../../types/helpers.mjs";
|
|
4
|
+
import { TailorDBInstance } from "../tailordb/types.mjs";
|
|
5
|
+
import { AuthConnectionConfig } from "../../../types/auth-connection.generated.mjs";
|
|
6
|
+
import { IdProvider, OAuth2Client, OAuth2ClientInput, SCIMAttribute, SCIMConfig, TenantProvider } from "../../../types/auth.generated.mjs";
|
|
7
|
+
import { IsAny, JsonObject, JsonValue } from "type-fest";
|
|
8
|
+
//#region src/configure/services/auth/types.d.ts
|
|
9
|
+
type OAuth2ClientGrantType = OAuth2Client["grantTypes"][number];
|
|
10
|
+
type SCIMAttributeType = SCIMAttribute["type"];
|
|
11
|
+
interface MachineUserNameRegistry {}
|
|
12
|
+
/**
|
|
13
|
+
* Machine user name.
|
|
14
|
+
*
|
|
15
|
+
* When `tailor.d.ts` is generated (via `tailor deploy`/`generate`), this is narrowed
|
|
16
|
+
* to the union of defined machine user names. When no machine users are registered yet,
|
|
17
|
+
* falls back to `string` to avoid blocking editing before the first generate run.
|
|
18
|
+
*/
|
|
19
|
+
type MachineUserName = keyof MachineUserNameRegistry extends never ? string : keyof MachineUserNameRegistry & string;
|
|
20
|
+
/** Result of retrieving a connection token at runtime. */
|
|
21
|
+
type AuthConnectionTokenResult = {
|
|
22
|
+
access_token: string;
|
|
23
|
+
};
|
|
24
|
+
type ValueOperand = string | boolean | string[] | boolean[];
|
|
25
|
+
type AuthAttributeValue = ValueOperand | null | undefined;
|
|
26
|
+
type UserFieldKeys<User extends TailorDBInstance> = keyof output<User> & string;
|
|
27
|
+
type FieldDefined<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = User["fields"][Key] extends {
|
|
28
|
+
_defined: infer Defined;
|
|
29
|
+
} ? Defined : never;
|
|
30
|
+
type FieldOutput<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = output<User>[Key];
|
|
31
|
+
type FieldIsRequired<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = undefined extends FieldOutput<User, Key> ? false : true;
|
|
32
|
+
type FieldIsOfType<User extends TailorDBInstance, Key extends UserFieldKeys<User>, Type extends string> = FieldDefined<User, Key> extends {
|
|
33
|
+
type: Type;
|
|
34
|
+
} ? true : false;
|
|
35
|
+
type FieldIsArray<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
|
|
36
|
+
array: true;
|
|
37
|
+
} ? true : false;
|
|
38
|
+
type FieldIsUnique<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
|
|
39
|
+
unique: true;
|
|
40
|
+
} ? true : false;
|
|
41
|
+
type FieldSupportsValueOperand<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldOutput<User, Key> extends ValueOperand | null | undefined ? true : false;
|
|
42
|
+
type UsernameFieldKey<User extends TailorDBInstance> = IsAny<User> extends true ? string : { [K in UserFieldKeys<User>]: FieldIsRequired<User, K> extends true ? FieldIsOfType<User, K, "string"> extends true ? FieldIsArray<User, K> extends true ? never : FieldIsUnique<User, K> extends true ? K : never : never : never; }[UserFieldKeys<User>];
|
|
43
|
+
type UserAttributeKey<User extends TailorDBInstance> = { [K in UserFieldKeys<User>]: K extends "id" ? never : FieldSupportsValueOperand<User, K> extends true ? FieldIsOfType<User, K, "datetime" | "date" | "time"> extends true ? never : K : never; }[UserFieldKeys<User>];
|
|
44
|
+
type UserAttributeListKey<User extends TailorDBInstance> = { [K in UserFieldKeys<User>]: K extends "id" ? never : FieldIsOfType<User, K, "uuid"> extends true ? FieldIsArray<User, K> extends true ? never : K : never; }[UserFieldKeys<User>];
|
|
45
|
+
type UserAttributes<User extends TailorDBInstance> = { [K in UserAttributeKey<User>]?: true; };
|
|
46
|
+
type DisallowExtraKeys<T, Allowed extends PropertyKey> = T & { [K in Exclude<keyof T, Allowed>]: never; };
|
|
47
|
+
type AttributeListValue<User extends TailorDBInstance, Key extends UserAttributeListKey<User>> = Key extends keyof output<User> ? output<User>[Key] : never;
|
|
48
|
+
type AttributeListToTuple<User extends TailorDBInstance, AttributeList extends readonly UserAttributeListKey<User>[]> = { [Index in keyof AttributeList]: AttributeList[Index] extends UserAttributeListKey<User> ? AttributeListValue<User, AttributeList[Index]> : never; };
|
|
49
|
+
type SelectedAttributeKeys<User extends TailorDBInstance, Attributes extends UserAttributes<User>> = Extract<{ [K in keyof Attributes]-?: undefined extends Attributes[K] ? never : K; }[keyof Attributes], UserAttributeKey<User>>;
|
|
50
|
+
type UserProfile<User extends TailorDBInstance, Attributes extends UserAttributes<User>, AttributeList extends UserAttributeListKey<User>[]> = {
|
|
51
|
+
/**
|
|
52
|
+
* TailorDB namespace where the user type is defined.
|
|
53
|
+
*
|
|
54
|
+
* Usually auto-resolved, so you don't need to specify this.
|
|
55
|
+
* Required only when multiple TailorDBs exist and the type is in an external TailorDB.
|
|
56
|
+
*/
|
|
57
|
+
namespace?: string;
|
|
58
|
+
type: User;
|
|
59
|
+
usernameField: UsernameFieldKey<User>;
|
|
60
|
+
attributes?: DisallowExtraKeys<Attributes, UserAttributeKey<User>>;
|
|
61
|
+
attributeList?: AttributeList;
|
|
62
|
+
};
|
|
63
|
+
type MachineUserAttributeFields = Record<string, TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
|
|
64
|
+
type TailorFieldOutputValue<Field> = Field extends TailorField<DefinedFieldMetadata, infer Output, FieldMetadata, TailorFieldType> ? Output : never;
|
|
65
|
+
type MachineUserAttributeValues<Fields extends MachineUserAttributeFields> = NullableToOptional<{ [K in keyof Fields]: TailorFieldOutputValue<Fields[K]> extends ValueOperand | null | undefined ? TailorFieldOutputValue<Fields[K]> : never; }>;
|
|
66
|
+
type OptionalIfNoRequiredKeys<Attributes> = Record<never, never> extends Attributes ? {
|
|
67
|
+
attributes?: Attributes;
|
|
68
|
+
} : {
|
|
69
|
+
attributes: Attributes;
|
|
70
|
+
};
|
|
71
|
+
type MachineUserFromAttributes<Fields extends MachineUserAttributeFields> = (keyof Fields extends never ? {
|
|
72
|
+
attributes?: never;
|
|
73
|
+
} : OptionalIfNoRequiredKeys<DisallowExtraKeys<MachineUserAttributeValues<Fields>, keyof Fields>>) & {
|
|
74
|
+
attributeList?: string[];
|
|
75
|
+
};
|
|
76
|
+
type MachineUserProfileAttributes<User extends TailorDBInstance, Attributes extends UserAttributes<User>> = NullableToOptional<{ [K in SelectedAttributeKeys<User, Attributes>]: K extends keyof output<User> ? output<User>[K] : never; }> & { [K in Exclude<keyof output<User>, SelectedAttributeKeys<User, Attributes>>]?: never; };
|
|
77
|
+
type MachineUserFromUserProfile<User extends TailorDBInstance, Attributes extends UserAttributes<User>, AttributeList extends UserAttributeListKey<User>[]> = (SelectedAttributeKeys<User, Attributes> extends never ? {
|
|
78
|
+
attributes?: never;
|
|
79
|
+
} : OptionalIfNoRequiredKeys<MachineUserProfileAttributes<User, Attributes>>) & ([] extends AttributeList ? {
|
|
80
|
+
attributeList?: never;
|
|
81
|
+
} : {
|
|
82
|
+
attributeList: AttributeListToTuple<User, AttributeList>;
|
|
83
|
+
});
|
|
84
|
+
type MachineUser<User extends TailorDBInstance, Attributes extends UserAttributes<User> = UserAttributes<User>, AttributeList extends UserAttributeListKey<User>[] = [], MachineUserAttributes extends MachineUserAttributeFields | undefined = undefined> = IsAny<MachineUserAttributes> extends true ? IsAny<User> extends true ? {
|
|
85
|
+
attributes?: Record<string, AuthAttributeValue>;
|
|
86
|
+
attributeList?: string[];
|
|
87
|
+
} : MachineUserFromUserProfile<User, Attributes, AttributeList> : [MachineUserAttributes] extends [MachineUserAttributeFields] ? MachineUserFromAttributes<MachineUserAttributes> : IsAny<User> extends true ? {
|
|
88
|
+
attributes?: Record<string, AuthAttributeValue>;
|
|
89
|
+
attributeList?: string[];
|
|
90
|
+
} : MachineUserFromUserProfile<User, Attributes, AttributeList>;
|
|
91
|
+
/** Upstream OAuth provider that federated a login through the Built-in IdP. */
|
|
92
|
+
type FederatedIdentityProvider = "google" | "microsoft";
|
|
93
|
+
/**
|
|
94
|
+
* Profile claims forwarded from the upstream OAuth provider's ID token.
|
|
95
|
+
*
|
|
96
|
+
* Commonly present claims are typed; any other claim the provider issues is
|
|
97
|
+
* forwarded as-is and reachable through the index signature. Availability
|
|
98
|
+
* varies by provider (e.g. Microsoft does not issue `picture`).
|
|
99
|
+
*/
|
|
100
|
+
type FederatedIdentityClaims = {
|
|
101
|
+
name?: string;
|
|
102
|
+
given_name?: string;
|
|
103
|
+
family_name?: string;
|
|
104
|
+
picture?: string;
|
|
105
|
+
locale?: string;
|
|
106
|
+
[claim: string]: JsonValue | undefined;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* The upstream identity that federated this login, populated when a user signs
|
|
110
|
+
* in through a Built-in IdP OAuth provider (Google or Microsoft).
|
|
111
|
+
*
|
|
112
|
+
* Available on {@link BeforeLoginClaims.federated_identity}; `undefined` for
|
|
113
|
+
* password logins.
|
|
114
|
+
*/
|
|
115
|
+
type FederatedIdentity = {
|
|
116
|
+
provider: FederatedIdentityProvider;
|
|
117
|
+
claims: FederatedIdentityClaims;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Token claims passed to the {@link BeforeLoginHook} handler. Carries the IdP's
|
|
121
|
+
* own claims (e.g. `sub`, `email`) plus, for federated logins, the upstream
|
|
122
|
+
* provider's profile under {@link BeforeLoginClaims.federated_identity}.
|
|
123
|
+
*/
|
|
124
|
+
type BeforeLoginClaims = JsonObject & {
|
|
125
|
+
/** Present only for federated (Google/Microsoft) logins; `undefined` for password logins. */
|
|
126
|
+
federated_identity?: FederatedIdentity;
|
|
127
|
+
};
|
|
128
|
+
type BeforeLoginHookArgs = {
|
|
129
|
+
claims: BeforeLoginClaims;
|
|
130
|
+
idpConfigName: string;
|
|
131
|
+
/** Environment variables defined in `defineConfig({ env })`. */
|
|
132
|
+
env: TailorEnv;
|
|
133
|
+
};
|
|
134
|
+
type BeforeLoginHook<MachineUserNames extends string> = {
|
|
135
|
+
handler(args: BeforeLoginHookArgs): Promise<void>;
|
|
136
|
+
invoker: NoInfer<MachineUserNames>;
|
|
137
|
+
};
|
|
138
|
+
type AuthHooks<MachineUserNames extends string> = {
|
|
139
|
+
beforeLogin?: BeforeLoginHook<MachineUserNames>;
|
|
140
|
+
};
|
|
141
|
+
type AuthServiceInput<User extends TailorDBInstance, Attributes extends UserAttributes<User>, AttributeList extends UserAttributeListKey<User>[], MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields | undefined = MachineUserAttributeFields | undefined, ConnectionNames extends string = string> = {
|
|
142
|
+
hooks?: AuthHooks<MachineUserNames>;
|
|
143
|
+
userProfile?: UserProfile<User, Attributes, AttributeList>;
|
|
144
|
+
machineUserAttributes?: MachineUserAttributes;
|
|
145
|
+
machineUsers?: Record<MachineUserNames, MachineUser<User, Attributes, AttributeList, MachineUserAttributes>>;
|
|
146
|
+
oauth2Clients?: Record<string, OAuth2ClientInput>;
|
|
147
|
+
idProvider?: IdProvider;
|
|
148
|
+
scim?: SCIMConfig;
|
|
149
|
+
tenantProvider?: TenantProvider;
|
|
150
|
+
connections?: Record<ConnectionNames, AuthConnectionConfig>;
|
|
151
|
+
publishSessionEvents?: boolean;
|
|
152
|
+
};
|
|
153
|
+
declare const authDefinitionBrand: unique symbol;
|
|
154
|
+
type AuthDefinitionBrand = {
|
|
155
|
+
readonly [authDefinitionBrand]: true;
|
|
156
|
+
};
|
|
157
|
+
type DefinedAuth<Name extends string, Config> = Config & {
|
|
158
|
+
name: Name;
|
|
159
|
+
} & AuthDefinitionBrand;
|
|
160
|
+
type AuthExternalConfig = {
|
|
161
|
+
name: string;
|
|
162
|
+
external: true;
|
|
163
|
+
};
|
|
164
|
+
type AuthServiceInputLoose = AuthServiceInput<any, any, any, string, any>;
|
|
165
|
+
type AuthOwnConfig = DefinedAuth<string, AuthServiceInputLoose>;
|
|
166
|
+
type AuthConfig = AuthOwnConfig | AuthExternalConfig;
|
|
167
|
+
//#endregion
|
|
168
|
+
export { AuthAttributeValue, AuthConfig, AuthConnectionTokenResult, AuthDefinitionBrand, AuthExternalConfig, AuthHooks, AuthOwnConfig, AuthServiceInput, BeforeLoginClaims, BeforeLoginHook, BeforeLoginHookArgs, DefinedAuth, FederatedIdentity, FederatedIdentityClaims, FederatedIdentityProvider, MachineUserName, MachineUserNameRegistry, OAuth2ClientGrantType, SCIMAttributeType, UserAttributeKey, UserAttributeListKey, UserAttributes, UsernameFieldKey, ValueOperand };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ExecutorInput } from "../../../types/executor.generated.mjs";
|
|
2
|
+
import { Workflow } from "../workflow/workflow.mjs";
|
|
3
|
+
import { Operation, WorkflowOperation } from "./operation.mjs";
|
|
4
|
+
import { Trigger } from "./trigger/index.mjs";
|
|
5
|
+
//#region src/configure/services/executor/executor.d.ts
|
|
6
|
+
type TriggerArgs<T extends Trigger<unknown>> = T extends {
|
|
7
|
+
__args: infer Args;
|
|
8
|
+
} ? Args : never;
|
|
9
|
+
type ExecutorBase<T extends Trigger<unknown>> = Omit<ExecutorInput, "trigger" | "operation"> & {
|
|
10
|
+
trigger: T;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Executor type with conditional inference for workflow operations.
|
|
14
|
+
* When operation.kind is "workflow", infers W from the workflow property
|
|
15
|
+
* to ensure args type matches the workflow's mainJob input type.
|
|
16
|
+
*/
|
|
17
|
+
type Executor<T extends Trigger<unknown>, O> = O extends {
|
|
18
|
+
kind: "workflow";
|
|
19
|
+
workflow: infer W extends Workflow;
|
|
20
|
+
} ? ExecutorBase<T> & {
|
|
21
|
+
operation: WorkflowOperation<TriggerArgs<T>, W>;
|
|
22
|
+
} : ExecutorBase<T> & {
|
|
23
|
+
operation: O;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Create an executor configuration for the Tailor SDK.
|
|
27
|
+
*
|
|
28
|
+
* Executors are event-driven handlers that respond to record changes,
|
|
29
|
+
* resolver executions, or other events.
|
|
30
|
+
*
|
|
31
|
+
* Operation kinds: "function", "graphql", "webhook", "workflow".
|
|
32
|
+
* @template T
|
|
33
|
+
* @template O
|
|
34
|
+
* @param config - Executor configuration
|
|
35
|
+
* @returns The same executor configuration
|
|
36
|
+
* @example
|
|
37
|
+
* import { createExecutor, recordCreatedTrigger } from "@tailor-platform/sdk";
|
|
38
|
+
* import { order } from "../tailordb/order";
|
|
39
|
+
*
|
|
40
|
+
* export default createExecutor({
|
|
41
|
+
* name: "order-created",
|
|
42
|
+
* description: "Handles new order creation",
|
|
43
|
+
* trigger: recordCreatedTrigger({ type: order }),
|
|
44
|
+
* operation: {
|
|
45
|
+
* kind: "function",
|
|
46
|
+
* body: async ({ newRecord }) => {
|
|
47
|
+
* console.log("New order:", newRecord.id);
|
|
48
|
+
* },
|
|
49
|
+
* },
|
|
50
|
+
* });
|
|
51
|
+
*/
|
|
52
|
+
declare function createExecutor<T extends Trigger<unknown>, O extends Operation<TriggerArgs<T>> | {
|
|
53
|
+
kind: "workflow";
|
|
54
|
+
workflow: Workflow;
|
|
55
|
+
}>(config: Executor<T, O>): Executor<T, O>;
|
|
56
|
+
/**
|
|
57
|
+
* Create an executor configuration for the Tailor SDK.
|
|
58
|
+
* This overload preserves source compatibility for legacy explicit generic calls,
|
|
59
|
+
* where the first generic argument represents trigger args.
|
|
60
|
+
* @template Args
|
|
61
|
+
* @template O
|
|
62
|
+
* @param config - Executor configuration
|
|
63
|
+
* @returns The same executor configuration
|
|
64
|
+
*/
|
|
65
|
+
declare function createExecutor<Args, O extends Operation<Args> | {
|
|
66
|
+
kind: "workflow";
|
|
67
|
+
workflow: Workflow;
|
|
68
|
+
}>(config: Executor<Trigger<Args>, O>): Executor<Trigger<Args>, O>;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { createExecutor };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExecutorServiceConfig, ExecutorServiceInput } from "../../config/types.mjs";
|
|
2
|
+
import { FunctionOperation, GqlOperation, Operation, WebhookOperation, WorkflowOperation } from "./operation.mjs";
|
|
3
|
+
import { AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, ResolverExecutedArgs, ResolverExecutedTrigger, TailorDBTrigger, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger } from "./trigger/event.mjs";
|
|
4
|
+
import { ScheduleArgs, ScheduleTrigger, scheduleTrigger } from "./trigger/schedule.mjs";
|
|
5
|
+
import { IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, incomingWebhookTrigger } from "./trigger/webhook.mjs";
|
|
6
|
+
import { Trigger } from "./trigger/index.mjs";
|
|
7
|
+
import { createExecutor } from "./executor.mjs";
|
|
8
|
+
import "./types.mjs";
|
|
9
|
+
export { AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type ExecutorServiceConfig, type ExecutorServiceInput, FunctionOperation, GqlOperation, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, Operation, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, ResolverExecutedArgs, ResolverExecutedTrigger, ScheduleArgs, ScheduleTrigger, TailorDBTrigger, Trigger, WebhookOperation, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, WorkflowOperation, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TailorPrincipal } from "../../../runtime/types.mjs";
|
|
2
|
+
import { MachineUserName } from "../auth/types.mjs";
|
|
3
|
+
import { FunctionOperation as FunctionOperation$1, GqlOperation as GqlOperation$1, WebhookOperation as WebhookOperation$1, WorkflowOperation as WorkflowOperation$1 } from "../../../types/executor.generated.mjs";
|
|
4
|
+
import "../../types/machine-user.mjs";
|
|
5
|
+
import { Workflow } from "../workflow/workflow.mjs";
|
|
6
|
+
import { Client } from "@urql/core";
|
|
7
|
+
//#region src/configure/services/executor/operation.d.ts
|
|
8
|
+
/** Function-based executor operation. The body receives the trigger args and the `invoker`. */
|
|
9
|
+
type FunctionOperation<Args> = Omit<FunctionOperation$1, "body" | "invoker"> & {
|
|
10
|
+
body: (args: Args & {
|
|
11
|
+
invoker: TailorPrincipal | null;
|
|
12
|
+
}) => void | Promise<void>;
|
|
13
|
+
invoker?: MachineUserName;
|
|
14
|
+
};
|
|
15
|
+
type UrqlOperationArgs = Parameters<Client["query"] | Client["mutation"]>;
|
|
16
|
+
/** GraphQL-based executor operation. Executes a GraphQL query or mutation. */
|
|
17
|
+
type GqlOperation<Args> = Omit<GqlOperation$1, "query" | "variables" | "invoker"> & {
|
|
18
|
+
query: UrqlOperationArgs[0];
|
|
19
|
+
variables?: (args: Args) => UrqlOperationArgs[1];
|
|
20
|
+
invoker?: MachineUserName;
|
|
21
|
+
};
|
|
22
|
+
type RequestHeader = "A-IM" | "Accept" | "Accept-Additions" | "Accept-CH" | "Accept-Charset" | "Accept-Datetime" | "Accept-Encoding" | "Accept-Features" | "Accept-Language" | "Accept-Patch" | "Accept-Post" | "Accept-Ranges" | "Accept-Signature" | "Access-Control" | "Access-Control-Allow-Credentials" | "Access-Control-Allow-Headers" | "Access-Control-Allow-Methods" | "Access-Control-Allow-Origin" | "Access-Control-Expose-Headers" | "Access-Control-Max-Age" | "Access-Control-Request-Headers" | "Access-Control-Request-Method" | "Age" | "Allow" | "ALPN" | "Alt-Svc" | "Alt-Used" | "Alternates" | "AMP-Cache-Transform" | "Apply-To-Redirect-Ref" | "Authentication-Control" | "Authentication-Info" | "Authorization" | "Available-Dictionary" | "C-Ext" | "C-Man" | "C-Opt" | "C-PEP" | "C-PEP-Info" | "Cache-Control" | "Cache-Status" | "Cal-Managed-ID" | "CalDAV-Timezones" | "Capsule-Protocol" | "CDN-Cache-Control" | "CDN-Loop" | "Cert-Not-After" | "Cert-Not-Before" | "Clear-Site-Data" | "Client-Cert" | "Client-Cert-Chain" | "Close" | "CMCD-Object" | "CMCD-Request" | "CMCD-Session" | "CMCD-Status" | "CMSD-Dynamic" | "CMSD-Static" | "Concealed-Auth-Export" | "Configuration-Context" | "Connection" | "Content-Base" | "Content-Digest" | "Content-Disposition" | "Content-Encoding" | "Content-ID" | "Content-Language" | "Content-Length" | "Content-Location" | "Content-MD5" | "Content-Range" | "Content-Script-Type" | "Content-Security-Policy" | "Content-Security-Policy-Report-Only" | "Content-Style-Type" | "Content-Type" | "Content-Version" | "Cookie" | "Cookie2" | "Cross-Origin-Embedder-Policy" | "Cross-Origin-Embedder-Policy-Report-Only" | "Cross-Origin-Opener-Policy" | "Cross-Origin-Opener-Policy-Report-Only" | "Cross-Origin-Resource-Policy" | "CTA-Common-Access-Token" | "DASL" | "Date" | "DAV" | "Default-Style" | "Delta-Base" | "Deprecation" | "Depth" | "Derived-From" | "Destination" | "Differential-ID" | "Dictionary-ID" | "Digest" | "DPoP" | "DPoP-Nonce" | "Early-Data" | "EDIINT-Features" | "ETag" | "Expect" | "Expect-CT" | "Expires" | "Ext" | "Forwarded" | "From" | "GetProfile" | "Hobareg" | "Host" | "HTTP2-Settings" | "If" | "If-Match" | "If-Modified-Since" | "If-None-Match" | "If-Range" | "If-Schedule-Tag-Match" | "If-Unmodified-Since" | "IM" | "Include-Referred-Token-Binding-ID" | "Isolation" | "Keep-Alive" | "Label" | "Last-Event-ID" | "Last-Modified" | "Link" | "Link-Template" | "Location" | "Lock-Token" | "Man" | "Max-Forwards" | "Memento-Datetime" | "Meter" | "Method-Check" | "Method-Check-Expires" | "MIME-Version" | "Negotiate" | "NEL" | "OData-EntityId" | "OData-Isolation" | "OData-MaxVersion" | "OData-Version" | "Opt" | "Optional-WWW-Authenticate" | "Ordering-Type" | "Origin" | "Origin-Agent-Cluster" | "OSCORE" | "OSLC-Core-Version" | "Overwrite" | "P3P" | "PEP" | "PEP-Info" | "Permissions-Policy" | "PICS-Label" | "Ping-From" | "Ping-To" | "Position" | "Pragma" | "Prefer" | "Preference-Applied" | "Priority" | "ProfileObject" | "Protocol" | "Protocol-Info" | "Protocol-Query" | "Protocol-Request" | "Proxy-Authenticate" | "Proxy-Authentication-Info" | "Proxy-Authorization" | "Proxy-Features" | "Proxy-Instruction" | "Proxy-Status" | "Public" | "Public-Key-Pins" | "Public-Key-Pins-Report-Only" | "Range" | "Redirect-Ref" | "Referer" | "Referer-Root" | "Referrer-Policy" | "Refresh" | "Repeatability-Client-ID" | "Repeatability-First-Sent" | "Repeatability-Request-ID" | "Repeatability-Result" | "Replay-Nonce" | "Reporting-Endpoints" | "Repr-Digest" | "Retry-After" | "Safe" | "Schedule-Reply" | "Schedule-Tag" | "Sec-GPC" | "Sec-Purpose" | "Sec-Token-Binding" | "Sec-WebSocket-Accept" | "Sec-WebSocket-Extensions" | "Sec-WebSocket-Key" | "Sec-WebSocket-Protocol" | "Sec-WebSocket-Version" | "Security-Scheme" | "Server" | "Server-Timing" | "Set-Cookie" | "Set-Cookie2" | "SetProfile" | "Signature" | "Signature-Input" | "SLUG" | "SoapAction" | "Status-URI" | "Strict-Transport-Security" | "Sunset" | "Surrogate-Capability" | "Surrogate-Control" | "TCN" | "TE" | "Timeout" | "Timing-Allow-Origin" | "Topic" | "Traceparent" | "Tracestate" | "Trailer" | "Transfer-Encoding" | "TTL" | "Upgrade" | "Urgency" | "URI" | "Use-As-Dictionary" | "User-Agent" | "Variant-Vary" | "Vary" | "Via" | "Want-Content-Digest" | "Want-Digest" | "Want-Repr-Digest" | "Warning" | "WWW-Authenticate" | "X-Content-Type-Options" | "X-Frame-Options" | (string & {});
|
|
23
|
+
/** Outbound webhook executor operation. Sends HTTP requests to external URLs. */
|
|
24
|
+
type WebhookOperation<Args> = Omit<WebhookOperation$1, "url" | "requestBody" | "headers"> & {
|
|
25
|
+
url: (args: Args) => string;
|
|
26
|
+
requestBody?: (args: Args) => Record<string, unknown>;
|
|
27
|
+
headers?: { [key in RequestHeader]?: string | {
|
|
28
|
+
vault: string;
|
|
29
|
+
key: string;
|
|
30
|
+
}; };
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Extract mainJob's Input type from Workflow.
|
|
34
|
+
* Workflow<Job> -> Job is WorkflowJob<Name, Input, Output> -> Input
|
|
35
|
+
*/
|
|
36
|
+
type WorkflowInput<W extends Workflow> = Parameters<W["start"]>[0];
|
|
37
|
+
type WorkflowArgs<Args, W extends Workflow> = WorkflowInput<W> | ((args: Args) => WorkflowInput<W>);
|
|
38
|
+
type WorkflowArgsProperty<Args, W extends Workflow> = undefined extends WorkflowInput<W> ? {
|
|
39
|
+
args?: WorkflowArgs<Args, W>;
|
|
40
|
+
} : {
|
|
41
|
+
args: WorkflowArgs<Args, W>;
|
|
42
|
+
};
|
|
43
|
+
/** Workflow-triggering executor operation. Triggers a workflow in response to an event. */
|
|
44
|
+
type WorkflowOperation<Args, W extends Workflow = Workflow> = Omit<WorkflowOperation$1, "workflowName" | "args" | "invoker"> & {
|
|
45
|
+
workflow: W;
|
|
46
|
+
invoker?: MachineUserName;
|
|
47
|
+
} & WorkflowArgsProperty<Args, W>;
|
|
48
|
+
type Operation<Args> = FunctionOperation<Args> | GqlOperation<Args> | WebhookOperation<Args> | WorkflowOperation<Args>;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { FunctionOperation, GqlOperation, Operation, WebhookOperation, WorkflowOperation };
|