@tailor-platform/sdk 1.72.0 → 1.73.1
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 +42 -0
- package/dist/aigateway-B3oZZE6v.mjs +15 -0
- package/dist/aigateway-B3oZZE6v.mjs.map +1 -0
- package/dist/application-BXdCl6bp.mjs +3 -0
- package/dist/{application-DmjIKQ-a.mjs → application-Bb9NNp5m.mjs} +54 -28
- package/dist/application-Bb9NNp5m.mjs.map +1 -0
- package/dist/{assert-CKfwrmCV.mjs → assert-DBxo8jPo.mjs} +1 -2
- package/dist/{assert-CKfwrmCV.mjs.map → assert-DBxo8jPo.mjs.map} +1 -1
- package/dist/{authconnection-D7lsvsKY.mjs → authconnection-BGQM8FZI.mjs} +2 -3
- package/dist/{authconnection-D7lsvsKY.mjs.map → authconnection-BGQM8FZI.mjs.map} +1 -1
- package/dist/{brand-DlnJ375c.mjs → brand-Eo4pLXPJ.mjs} +1 -2
- package/dist/{brand-DlnJ375c.mjs.map → brand-Eo4pLXPJ.mjs.map} +1 -1
- package/dist/cli/cache/bundle-cache.d.mts +1 -0
- package/dist/cli/cache/store.d.mts +1 -0
- package/dist/cli/cache/types.d.mts +1 -0
- package/dist/cli/commands/api/api-call.d.mts +19 -0
- package/dist/cli/commands/api/index.d.mts +3 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +1 -0
- package/dist/cli/commands/deploy/application.d.mts +1 -0
- package/dist/cli/commands/deploy/auth.d.mts +1 -0
- package/dist/cli/commands/deploy/deploy.d.mts +24 -0
- package/dist/cli/commands/deploy/executor.d.mts +1 -0
- package/dist/cli/commands/deploy/function-registry-types.d.mts +12 -0
- package/dist/cli/commands/deploy/function-registry.d.mts +2 -0
- package/dist/cli/commands/deploy/idp.d.mts +1 -0
- package/dist/cli/commands/deploy/resolver.d.mts +1 -0
- package/dist/cli/commands/deploy/secret-manager.d.mts +1 -0
- package/dist/cli/commands/deploy/staticwebsite.d.mts +1 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +1 -0
- package/dist/cli/commands/deploy/types.d.mts +1 -0
- package/dist/cli/commands/deploy/workflow.d.mts +1 -0
- package/dist/cli/commands/executor/get.d.mts +29 -0
- package/dist/cli/commands/executor/jobs.d.mts +123 -0
- package/dist/cli/commands/executor/list.d.mts +19 -0
- package/dist/cli/commands/executor/transform.d.mts +41 -0
- package/dist/cli/commands/executor/trigger.d.mts +41 -0
- package/dist/cli/commands/executor/webhook.d.mts +22 -0
- package/dist/cli/commands/function/get.d.mts +18 -0
- package/dist/cli/commands/function/list.d.mts +22 -0
- package/dist/cli/commands/function/transform.d.mts +11 -0
- package/dist/cli/commands/generate/options.d.mts +7 -0
- package/dist/cli/commands/generate/seed/bundler.d.mts +26 -0
- package/dist/cli/commands/generate/service.d.mts +12 -0
- package/dist/cli/commands/generate/types.d.mts +126 -0
- package/dist/cli/commands/machineuser/list.d.mts +27 -0
- package/dist/cli/commands/machineuser/token.d.mts +22 -0
- package/dist/cli/commands/oauth2client/get.d.mts +18 -0
- package/dist/cli/commands/oauth2client/list.d.mts +20 -0
- package/dist/cli/commands/oauth2client/transform.d.mts +20 -0
- package/dist/cli/commands/organization/folder/create.d.mts +18 -0
- package/dist/cli/commands/organization/folder/delete.d.mts +16 -0
- package/dist/cli/commands/organization/folder/get.d.mts +17 -0
- package/dist/cli/commands/organization/folder/list.d.mts +22 -0
- package/dist/cli/commands/organization/folder/update.d.mts +18 -0
- package/dist/cli/commands/organization/get.d.mts +16 -0
- package/dist/cli/commands/organization/list.d.mts +15 -0
- package/dist/cli/commands/organization/transform.d.mts +27 -0
- package/dist/cli/commands/organization/tree.d.mts +25 -0
- package/dist/cli/commands/organization/update.d.mts +17 -0
- package/dist/cli/commands/remove.d.mts +16 -0
- package/dist/cli/commands/show.d.mts +34 -0
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +28 -0
- package/dist/cli/commands/tailordb/migrate/config.d.mts +19 -0
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +223 -0
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +17 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +202 -0
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +113 -0
- package/dist/cli/commands/tailordb/migrate/types.d.mts +7 -0
- package/dist/cli/commands/tailordb/truncate.d.mts +19 -0
- package/dist/cli/commands/workflow/executions.d.mts +75 -0
- package/dist/cli/commands/workflow/get.d.mts +29 -0
- package/dist/cli/commands/workflow/list.d.mts +19 -0
- package/dist/cli/commands/workflow/resume.d.mts +23 -0
- package/dist/cli/commands/workflow/start.d.mts +63 -0
- package/dist/cli/commands/workflow/status.d.mts +5 -0
- package/dist/cli/commands/workflow/transform.d.mts +33 -0
- package/dist/cli/commands/workflow/wait.d.mts +16 -0
- package/dist/cli/commands/workflow/waiter.d.mts +23 -0
- package/dist/cli/commands/workspace/app/health.d.mts +18 -0
- package/dist/cli/commands/workspace/app/list.d.mts +22 -0
- package/dist/cli/commands/workspace/app/transform.d.mts +18 -0
- package/dist/cli/commands/workspace/create.d.mts +25 -0
- package/dist/cli/commands/workspace/delete.d.mts +15 -0
- package/dist/cli/commands/workspace/get.d.mts +17 -0
- package/dist/cli/commands/workspace/list.d.mts +17 -0
- package/dist/cli/commands/workspace/restore.d.mts +15 -0
- package/dist/cli/commands/workspace/transform.d.mts +16 -0
- package/dist/cli/commands/workspace/user/invite.d.mts +22 -0
- package/dist/cli/commands/workspace/user/list.d.mts +22 -0
- package/dist/cli/commands/workspace/user/remove.d.mts +17 -0
- package/dist/cli/commands/workspace/user/transform.d.mts +8 -0
- package/dist/cli/commands/workspace/user/update.d.mts +22 -0
- package/dist/cli/index.d.mts +1 -2
- package/dist/cli/index.mjs +24 -25
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +80 -21402
- package/dist/cli/lib.mjs +8 -9
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/query/index.d.mts +35 -0
- package/dist/cli/services/application.d.mts +1 -0
- package/dist/cli/services/auth/service.d.mts +1 -0
- package/dist/cli/services/executor/service.d.mts +1 -0
- package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
- package/dist/cli/services/http-adapter/service.d.mts +1 -0
- package/dist/cli/services/resolver/service.d.mts +1 -0
- package/dist/cli/services/tailordb/service.d.mts +1 -0
- package/dist/cli/services/workflow/bundler.d.mts +1 -0
- package/dist/cli/services/workflow/service.d.mts +1 -0
- package/dist/cli/shared/args.d.mts +13 -0
- package/dist/cli/shared/client.d.mts +1273 -0
- package/dist/cli/shared/config-loader.d.mts +44 -0
- package/dist/cli/shared/context.d.mts +28 -0
- package/dist/cli/shared/script-executor.d.mts +74 -0
- package/dist/cli/shared/seed-chunker.d.mts +46 -0
- package/dist/cli/shared/trigger-context.d.mts +1 -0
- package/dist/cli/shared/type-generator.d.mts +20 -0
- package/dist/cli/skills.mjs +1 -2
- package/dist/cli/skills.mjs.map +1 -1
- package/dist/completion/zsh-worker.zsh +1 -1
- package/dist/configure/config/index.d.mts +29 -0
- package/dist/configure/config/types.d.mts +103 -0
- package/dist/configure/index.d.mts +125 -7
- package/dist/configure/index.mjs +5 -6
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/aigateway/index.d.mts +17 -0
- package/dist/configure/services/aigateway/types.d.mts +11 -0
- package/dist/configure/services/auth/index.d.mts +43 -0
- package/dist/{types-v_ErzNUF.d.mts → configure/services/auth/types.d.mts} +7 -172
- package/dist/configure/services/executor/executor.d.mts +82 -0
- package/dist/configure/services/executor/index.d.mts +8 -0
- package/dist/configure/services/executor/operation.d.mts +46 -0
- package/dist/configure/services/executor/trigger/event.d.mts +272 -0
- package/dist/configure/services/executor/trigger/index.d.mts +8 -0
- package/dist/configure/services/executor/trigger/schedule.d.mts +25 -0
- package/dist/configure/services/executor/trigger/webhook.d.mts +44 -0
- package/dist/configure/services/executor/types.d.mts +2 -0
- package/dist/configure/services/http-adapter/http-adapter.d.mts +125 -0
- package/dist/configure/services/http-adapter/index.d.mts +2 -0
- package/dist/configure/services/idp/index.d.mts +64 -0
- package/dist/configure/services/idp/permission.d.mts +80 -0
- package/dist/configure/services/idp/types.d.mts +20 -0
- package/dist/configure/services/index.d.mts +33 -0
- package/dist/configure/services/resolver/index.d.mts +5 -0
- package/dist/configure/services/resolver/resolver.d.mts +77 -0
- package/dist/configure/services/resolver/types.d.mts +6 -0
- package/dist/configure/services/secrets/index.d.mts +38 -0
- package/dist/configure/services/secrets/types.d.mts +11 -0
- package/dist/configure/services/staticwebsite/index.d.mts +19 -0
- package/dist/configure/services/staticwebsite/types.d.mts +11 -0
- package/dist/configure/services/tailordb/index.d.mts +4 -0
- package/dist/configure/services/tailordb/permission.d.mts +119 -0
- package/dist/configure/services/tailordb/schema.d.mts +451 -0
- package/dist/configure/services/tailordb/types.d.mts +149 -0
- package/dist/configure/services/workflow/index.d.mts +7 -0
- package/dist/configure/services/workflow/job.d.mts +81 -0
- package/dist/configure/services/workflow/test-env-key.d.mts +9 -0
- package/dist/configure/services/workflow/types.d.mts +2 -0
- package/dist/configure/services/workflow/wait-point.d.mts +73 -0
- package/dist/configure/services/workflow/workflow.d.mts +55 -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 +9 -0
- package/dist/configure/types/field.types.d.mts +109 -0
- package/dist/configure/types/idp-name.d.mts +12 -0
- package/dist/configure/types/index.d.mts +4 -0
- package/dist/configure/types/machine-user.d.mts +12 -0
- package/dist/configure/types/type.d.mts +99 -0
- package/dist/configure/user.d.mts +7 -0
- package/dist/{context-CDQqIv4u.mjs → context-Bd266-ru.mjs} +2 -3
- package/dist/{context-CDQqIv4u.mjs.map → context-Bd266-ru.mjs.map} +1 -1
- package/dist/{crashreport-BwF8cHF0.mjs → crashreport-Dy4ZzSkd.mjs} +1 -2
- package/dist/{crashreport-BqyvFk-_.mjs → crashreport-ayWANEZ6.mjs} +4 -5
- package/dist/{crashreport-BqyvFk-_.mjs.map → crashreport-ayWANEZ6.mjs.map} +1 -1
- package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
- package/dist/{enum-constants-C7DaWeQo.mjs.map → enum-constants-j9QBF0cB.mjs.map} +1 -1
- package/dist/{errors-EsY4XO6O.mjs → errors-Dtf2WPaW.mjs} +1 -2
- package/dist/{errors-EsY4XO6O.mjs.map → errors-Dtf2WPaW.mjs.map} +1 -1
- package/dist/{field-C4zdJLW5.mjs → field-DOsJCPFa.mjs} +1 -2
- package/dist/{field-C4zdJLW5.mjs.map → field-DOsJCPFa.mjs.map} +1 -1
- package/dist/{file-BkxupbYP.mjs → file-_oUZo76X.mjs} +2 -3
- package/dist/{file-BkxupbYP.mjs.map → file-_oUZo76X.mjs.map} +1 -1
- package/dist/{file-utils-BHPxPXmn.mjs → file-utils-DcyIPFQh.mjs} +2 -3
- package/dist/{file-utils-BHPxPXmn.mjs.map → file-utils-DcyIPFQh.mjs.map} +1 -1
- package/dist/{globals-ByrCoDip.mjs → globals-B8XX5TRB.mjs} +3 -3
- package/dist/globals-B8XX5TRB.mjs.map +1 -0
- package/dist/{iconv-D1zmPjvi.mjs → iconv-D2vi8G36.mjs} +2 -3
- package/dist/{iconv-D1zmPjvi.mjs.map → iconv-D2vi8G36.mjs.map} +1 -1
- package/dist/{idp-ynUfzwpz.mjs → idp-Bx25ZBdN.mjs} +2 -3
- package/dist/{idp-ynUfzwpz.mjs.map → idp-Bx25ZBdN.mjs.map} +1 -1
- package/dist/{interceptor-DOqRkCya.mjs → interceptor-D-q1rvRl.mjs} +1 -2
- package/dist/{interceptor-DOqRkCya.mjs.map → interceptor-D-q1rvRl.mjs.map} +1 -1
- package/dist/{job-BpsFXPbi.mjs → job-CtU73PGa.mjs} +3 -4
- package/dist/job-CtU73PGa.mjs.map +1 -0
- package/dist/kysely/index.d.mts +2 -3
- package/dist/kysely/index.mjs +0 -1
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/{kysely-type-CSoZxVKN.mjs → kysely-type-D-zflMGf.mjs} +2 -3
- package/dist/{kysely-type-CSoZxVKN.mjs.map → kysely-type-D-zflMGf.mjs.map} +1 -1
- package/dist/{logger-DKF-JsAK.mjs → logger-BEiZZ3qT.mjs} +1 -2
- package/dist/{logger-DKF-JsAK.mjs.map → logger-BEiZZ3qT.mjs.map} +1 -1
- package/dist/{mock-wf5qeZLi.mjs → mock-Ce1GCi4-.mjs} +60 -5
- package/dist/mock-Ce1GCi4-.mjs.map +1 -0
- package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
- package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
- package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
- package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
- package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
- package/dist/parser/generator-config/schema.d.mts +1 -0
- package/dist/parser/service/auth/index.d.mts +1 -0
- package/dist/parser/service/auth/schema.d.mts +1 -0
- package/dist/parser/service/http-adapter/index.d.mts +1 -0
- package/dist/parser/service/http-adapter/schema.d.mts +1 -0
- package/dist/parser/service/idp/types.d.mts +4 -0
- package/dist/parser/service/tailordb/types.d.mts +126 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +16 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
- package/dist/plugin/builtin/file-utils/index.d.mts +16 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -2
- package/dist/plugin/builtin/kysely-type/index.d.mts +16 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
- package/dist/plugin/builtin/seed/index.d.mts +45 -1
- package/dist/plugin/builtin/seed/index.mjs +1 -2
- package/dist/plugin/get-generated-type.d.mts +17 -0
- package/dist/plugin/index.d.mts +3 -118
- package/dist/plugin/index.mjs +0 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/manager.d.mts +1 -0
- package/dist/plugin/types.d.mts +245 -0
- package/dist/plugin/with-context.d.mts +102 -0
- package/dist/{registry-D0uB0OrK.mjs → registry-BozuxbPp.mjs} +1 -2
- package/dist/{registry-D0uB0OrK.mjs.map → registry-BozuxbPp.mjs.map} +1 -1
- package/dist/{repl-editor-DD5YP5mt.mjs → repl-editor-BmQOyZJd.mjs} +2 -3
- package/dist/{repl-editor-DD5YP5mt.mjs.map → repl-editor-BmQOyZJd.mjs.map} +1 -1
- package/dist/{rolldown-runtime-BkoGK1jX.mjs → rolldown-runtime-DXywRVcq.mjs} +0 -1
- package/dist/runtime/aigateway.d.mts +35 -0
- package/dist/runtime/aigateway.mjs +3 -0
- package/dist/runtime/authconnection.d.mts +31 -2
- package/dist/runtime/authconnection.mjs +1 -2
- package/dist/runtime/context.d.mts +67 -2
- package/dist/runtime/context.mjs +1 -2
- package/dist/runtime/file.d.mts +249 -2
- package/dist/runtime/file.mjs +1 -2
- package/dist/runtime/globals.d.mts +31 -20
- package/dist/runtime/globals.mjs +0 -1
- package/dist/runtime/iconv.d.mts +121 -2
- package/dist/runtime/iconv.mjs +1 -2
- package/dist/runtime/idp.d.mts +186 -2
- package/dist/runtime/idp.mjs +1 -2
- package/dist/runtime/index.d.mts +47 -9
- package/dist/runtime/index.mjs +9 -9
- package/dist/runtime/secretmanager.d.mts +54 -2
- package/dist/runtime/secretmanager.mjs +1 -2
- package/dist/{types-DTcZ2Yax.d.mts → runtime/types.d.mts} +1 -2
- package/dist/runtime/workflow.d.mts +107 -2
- package/dist/runtime/workflow.mjs +2 -3
- package/dist/{runtime-Cd375HD-.mjs → runtime-B8O6JFS2.mjs} +752 -256
- package/dist/runtime-B8O6JFS2.mjs.map +1 -0
- package/dist/{schema-C4fkpWV_.mjs → schema-DAdZSFOd.mjs} +3 -4
- package/dist/{schema-C4fkpWV_.mjs.map → schema-DAdZSFOd.mjs.map} +1 -1
- package/dist/{secret-file-eB3R3Fil.mjs → secret-file-VSVGy1V0.mjs} +2 -3
- package/dist/{secret-file-eB3R3Fil.mjs.map → secret-file-VSVGy1V0.mjs.map} +1 -1
- package/dist/{secretmanager-h3tBJV8f.mjs → secretmanager-BVxw3ih_.mjs} +2 -3
- package/dist/{secretmanager-h3tBJV8f.mjs.map → secretmanager-BVxw3ih_.mjs.map} +1 -1
- package/dist/seed/index.d.mts +1 -2
- package/dist/seed/index.mjs +0 -1
- package/dist/seed/index.mjs.map +1 -1
- package/dist/{seed-YAbtMy65.mjs → seed-DoMTMLcm.mjs} +3 -4
- package/dist/{seed-YAbtMy65.mjs.map → seed-DoMTMLcm.mjs.map} +1 -1
- package/dist/service-BXmdFwSH.mjs +3 -0
- package/dist/{service-DDWgZL_L2.mjs → service-DBFZQloR.mjs} +3 -4
- package/dist/service-DBFZQloR.mjs.map +1 -0
- package/dist/{service-B2Jd9CxS.mjs → service-DiEtAsvc.mjs} +3 -4
- package/dist/{service-B2Jd9CxS.mjs.map → service-DiEtAsvc.mjs.map} +1 -1
- package/dist/{service_pb-BsBR6yW5.mjs → service_pb-CIrhGwHk.mjs} +1 -2
- package/dist/{service_pb-BsBR6yW5.mjs.map → service_pb-CIrhGwHk.mjs.map} +1 -1
- package/dist/{service_pb-BJ9GsAnW.mjs → service_pb-DjwIn4jO.mjs} +1 -2
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +204 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +58 -0
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +316 -0
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +161 -0
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +2070 -0
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +861 -0
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +112 -0
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +69 -0
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +439 -0
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +564 -0
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +145 -0
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +451 -0
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +192 -0
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +50 -0
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +407 -0
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +430 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +73 -0
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +17 -0
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +309 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +591 -0
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +330 -0
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +113 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +346 -0
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +54 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +3576 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +187 -0
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +29 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +429 -0
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +90 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +684 -0
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +797 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +330 -0
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +183 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +842 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +276 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2015 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +483 -0
- package/dist/{telemetry-BQbbVo2t.mjs → telemetry-CdqJEzkj.mjs} +2 -3
- package/dist/{telemetry-BQbbVo2t.mjs.map → telemetry-CdqJEzkj.mjs.map} +1 -1
- package/dist/telemetry-ClwW5ohF.mjs +3 -0
- package/dist/types/aigateway.generated.d.mts +9 -0
- package/dist/types/app-config.generated.d.mts +4 -0
- package/dist/types/auth-connection.generated.d.mts +20 -0
- package/dist/types/auth.generated.d.mts +150 -0
- package/dist/types/executor.generated.d.mts +177 -0
- package/dist/types/generator-config.generated.d.mts +28 -0
- package/dist/types/helpers.d.mts +39 -0
- package/dist/types/http-adapter.generated.d.mts +17 -0
- package/dist/types/idp.generated.d.mts +584 -0
- package/dist/types/resolver.generated.d.mts +38 -0
- package/dist/types/secrets.generated.d.mts +14 -0
- package/dist/types/staticwebsite.generated.d.mts +10 -0
- package/dist/{types-rj8YJcEe.d.mts → types/tailordb.generated.d.mts} +2 -290
- package/dist/types/workflow.generated.d.mts +12 -0
- package/dist/types-qhFZ8y9B.mjs +4 -0
- package/dist/{types-D4QMmNWh.mjs → types-ywCGpzDZ.mjs} +2 -3
- package/dist/{types-D4QMmNWh.mjs.map → types-ywCGpzDZ.mjs.map} +1 -1
- package/dist/utils/test/index.d.mts +6 -89
- package/dist/utils/test/index.mjs +1 -2
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/utils/test/mock.d.mts +87 -0
- package/dist/vitest/environment.d.mts +1 -2
- package/dist/vitest/environment.mjs +1 -2
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.d.mts +4 -392
- package/dist/vitest/index.mjs +4 -5
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock-kysely.d.mts +62 -0
- package/dist/vitest/mock.d.mts +364 -0
- package/dist/vitest/setup.d.mts +1 -2
- package/dist/vitest/setup.mjs +2 -3
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/{workflow-C8I7shjM.mjs → workflow-DSwnYPPP.mjs} +10 -4
- package/dist/workflow-DSwnYPPP.mjs.map +1 -0
- package/docs/runtime.md +5 -1
- package/docs/services/aigateway.md +14 -0
- package/docs/services/tailordb-migration.md +2 -0
- package/docs/testing.md +48 -2
- package/package.json +6 -1
- package/dist/application-DmjIKQ-a.mjs.map +0 -1
- package/dist/application-a_ApFuPh.mjs +0 -4
- package/dist/authconnection-CqfaJfrC.d.mts +0 -32
- package/dist/context-CUBwSBq4.d.mts +0 -68
- package/dist/file-BzK8z3X-.d.mts +0 -250
- package/dist/globals-ByrCoDip.mjs.map +0 -1
- package/dist/iconv-kwrmd1U_.d.mts +0 -122
- package/dist/idp-BmYwCXnJ.d.mts +0 -187
- package/dist/index-BDBU7x-i.d.mts +0 -18
- package/dist/index-BSlv_YrG.d.mts +0 -46
- package/dist/index-BzGqTY5x.d.mts +0 -1315
- package/dist/index-D3_Au3wu.d.mts +0 -47
- package/dist/index-DtFRlrww.d.mts +0 -18
- package/dist/index-jeE3UvF2.d.mts +0 -18
- package/dist/job-BpsFXPbi.mjs.map +0 -1
- package/dist/mock-wf5qeZLi.mjs.map +0 -1
- package/dist/package-json-wzO6nV9O.mjs +0 -4
- package/dist/runtime-Cd375HD-.mjs.map +0 -1
- package/dist/secretmanager-CKLB3wAQ.d.mts +0 -55
- package/dist/service-CRaa4Joe.mjs +0 -4
- package/dist/service-DDWgZL_L2.mjs.map +0 -1
- package/dist/telemetry-w92bvGdC.mjs +0 -4
- package/dist/types-32lUMToj.mjs +0 -5
- package/dist/types-aqnqTCfO.d.mts +0 -602
- package/dist/workflow-C8I7shjM.mjs.map +0 -1
- package/dist/workflow-CMamswkK.d.mts +0 -96
- package/dist/workflow.generated-Da1zECDw.d.mts +0 -1348
|
@@ -1,1315 +0,0 @@
|
|
|
1
|
-
import { a as TailorActor, c as TailorUser, i as InferredAttributeMap, o as TailorEnv, s as TailorInvoker } from "./types-DTcZ2Yax.mjs";
|
|
2
|
-
import { C as FieldMetadata, D as TailorField$1, E as FieldValidateInput, F as output$1, M as JsonCompatible, N as JsonValue, O as TailorFieldType, P as TypeLevelError, T as FieldOutput, b as ArrayFieldOutput, j as InferFieldsOutput, w as FieldOptions, x as DefinedFieldMetadata } from "./types-rj8YJcEe.mjs";
|
|
3
|
-
import { a as AuthServiceInput, c as DefinedAuth, g as UserAttributeMap, h as UserAttributeListKey, y as AuthInvoker$1 } from "./types-v_ErzNUF.mjs";
|
|
4
|
-
import { A as IncomingWebhookTrigger$1, C as ResolverInput, D as FunctionOperation$1, E as ExecutorInput, F as WorkflowOperation$1, I as BaseGeneratorConfig, M as ScheduleTriggerInput, N as TailorDBTrigger$1, O as GqlOperation$1, P as WebhookOperation$1, S as Resolver, a as Plugin, j as ResolverExecutedTrigger$1, k as IdpUserTrigger$1, n as GeneratorConfig, w as AuthAccessTokenTrigger$1 } from "./types-aqnqTCfO.mjs";
|
|
5
|
-
import { A as TailorDBInstance, C as IdPInput, E as AIGatewayInput, R as AllowedValues, T as AIGatewayDefinitionBrand, g as SecretsDefinitionBrand, i as AppConfig, j as TailorDBType, m as StaticWebsiteInput, n as RetryPolicy, p as StaticWebsiteDefinitionBrand, r as HttpAdapterConfigInput, t as ConcurrencyPolicy, y as IdpDefinitionBrand, z as AllowedValuesOutput } from "./workflow.generated-Da1zECDw.mjs";
|
|
6
|
-
import { DocumentNode } from "graphql";
|
|
7
|
-
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
8
|
-
import { Client } from "@urql/core";
|
|
9
|
-
import { StandardCRON } from "ts-cron-validator";
|
|
10
|
-
|
|
11
|
-
//#region src/configure/types/type.d.ts
|
|
12
|
-
type AnyBuilderMethod = any;
|
|
13
|
-
type TailorAnyField = Omit<TailorField$1<AnyBuilderMethod, AnyBuilderMethod, FieldMetadata, TailorFieldType>, "fields"> & {
|
|
14
|
-
readonly fields: Record<string, AnyBuilderMethod>;
|
|
15
|
-
_metadata: FieldMetadata;
|
|
16
|
-
description: AnyBuilderMethod;
|
|
17
|
-
typeName: AnyBuilderMethod;
|
|
18
|
-
validate: AnyBuilderMethod;
|
|
19
|
-
parse: AnyBuilderMethod;
|
|
20
|
-
_parseInternal: AnyBuilderMethod;
|
|
21
|
-
};
|
|
22
|
-
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
23
|
-
type WithFieldDescription<Defined> = Defined & {
|
|
24
|
-
description: true;
|
|
25
|
-
};
|
|
26
|
-
type WithFieldTypeName<Defined> = Defined & {
|
|
27
|
-
typeName: true;
|
|
28
|
-
};
|
|
29
|
-
type WithFieldValidate<Defined> = Defined & {
|
|
30
|
-
validate: true;
|
|
31
|
-
};
|
|
32
|
-
type FieldDescriptionFn<Defined extends DefinedFieldMetadata, Output> = (description: string) => TailorField<WithFieldDescription<Defined>, Output>;
|
|
33
|
-
type FieldTypeNameFn<Defined extends DefinedFieldMetadata, Output> = (typeName: string) => TailorField<WithFieldTypeName<Defined>, Output>;
|
|
34
|
-
type FieldValidateFn<Defined extends DefinedFieldMetadata, Output> = (...validate: FieldValidateInput<Output>[]) => TailorField<WithFieldValidate<Defined>, Output>;
|
|
35
|
-
type FieldDescriptionMethod<Defined extends DefinedFieldMetadata, Output> = IsAny<Defined> extends true ? FieldDescriptionFn<Defined, Output> : Defined extends {
|
|
36
|
-
description: unknown;
|
|
37
|
-
} ? TypeLevelError<".description() has already been set"> : FieldDescriptionFn<Defined, Output>;
|
|
38
|
-
type FieldTypeNameMethod<Defined extends DefinedFieldMetadata, Output> = IsAny<Defined> extends true ? TypeLevelError<string> : Defined extends {
|
|
39
|
-
typeName: unknown;
|
|
40
|
-
} ? TypeLevelError<".typeName() has already been set"> : Defined extends {
|
|
41
|
-
type: "enum" | "nested";
|
|
42
|
-
} ? FieldTypeNameFn<Defined, Output> : TypeLevelError<"typeName can only be set on enum or object fields">;
|
|
43
|
-
type FieldValidateMethod<Defined extends DefinedFieldMetadata, Output> = IsAny<Defined> extends true ? FieldValidateFn<Defined, Output> : Defined extends {
|
|
44
|
-
validate: unknown;
|
|
45
|
-
} ? TypeLevelError<".validate() has already been set"> : FieldValidateFn<Defined, Output>;
|
|
46
|
-
/**
|
|
47
|
-
* Full TailorField interface with builder methods.
|
|
48
|
-
* Extends the minimal structural interface from types/ with fluent API methods.
|
|
49
|
-
*/
|
|
50
|
-
interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> extends TailorField$1<Defined, Output, M, T> {
|
|
51
|
-
readonly fields: Record<string, TailorAnyField>;
|
|
52
|
-
_metadata: M;
|
|
53
|
-
/**
|
|
54
|
-
* Set a description for the field
|
|
55
|
-
* @param description - The description text
|
|
56
|
-
* @returns The field with updated metadata
|
|
57
|
-
*/
|
|
58
|
-
description: FieldDescriptionMethod<Defined, Output>;
|
|
59
|
-
/**
|
|
60
|
-
* Set a custom type name for enum or nested types
|
|
61
|
-
* @param typeName - The custom type name
|
|
62
|
-
* @returns The field with updated metadata
|
|
63
|
-
*/
|
|
64
|
-
typeName: FieldTypeNameMethod<Defined, Output>;
|
|
65
|
-
/**
|
|
66
|
-
* Add validation functions to the field
|
|
67
|
-
* @param validate - One or more validation functions
|
|
68
|
-
* @returns The field with updated metadata
|
|
69
|
-
*/
|
|
70
|
-
validate: FieldValidateMethod<Defined, Output>;
|
|
71
|
-
/**
|
|
72
|
-
* Parse and validate a value against this field's validation rules
|
|
73
|
-
* Returns StandardSchema Result type with success or failure
|
|
74
|
-
* @param args - Value, context data, and user
|
|
75
|
-
* @returns Validation result
|
|
76
|
-
*/
|
|
77
|
-
parse(args: FieldParseArgs): StandardSchemaV1.Result<Output>;
|
|
78
|
-
/**
|
|
79
|
-
* Internal parse method that tracks field path for nested validation
|
|
80
|
-
* @private
|
|
81
|
-
* @param args - Parse arguments
|
|
82
|
-
* @returns Validation result
|
|
83
|
-
*/
|
|
84
|
-
_parseInternal(args: FieldParseInternalArgs): StandardSchemaV1.Result<Output>;
|
|
85
|
-
}
|
|
86
|
-
type FieldParseArgs = {
|
|
87
|
-
value: unknown;
|
|
88
|
-
data: unknown;
|
|
89
|
-
user: TailorUser;
|
|
90
|
-
};
|
|
91
|
-
type FieldParseInternalArgs = {
|
|
92
|
-
value: any;
|
|
93
|
-
data: unknown;
|
|
94
|
-
user: TailorUser;
|
|
95
|
-
pathArray: string[];
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Create a UUID field for resolver input/output.
|
|
99
|
-
* @param options - Field configuration options
|
|
100
|
-
* @returns A UUID field
|
|
101
|
-
* @example t.uuid()
|
|
102
|
-
*/
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/configure/types/machine-user.d.ts
|
|
105
|
-
interface MachineUserNameRegistry {}
|
|
106
|
-
/**
|
|
107
|
-
* Machine user name.
|
|
108
|
-
*
|
|
109
|
-
* When `tailor.d.ts` is generated (via `tailor-sdk deploy`/`generate`), this is narrowed
|
|
110
|
-
* to the union of defined machine user names. When no machine users are registered yet,
|
|
111
|
-
* falls back to `string` to avoid blocking editing before the first generate run.
|
|
112
|
-
*/
|
|
113
|
-
type MachineUserName = keyof MachineUserNameRegistry extends never ? string : keyof MachineUserNameRegistry & string;
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/configure/user.d.ts
|
|
116
|
-
/** Represents an unauthenticated user in the Tailor platform. */
|
|
117
|
-
declare const unauthenticatedTailorUser: TailorUser;
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region src/configure/types/idp-name.d.ts
|
|
120
|
-
interface IdpNameRegistry {}
|
|
121
|
-
/**
|
|
122
|
-
* IdP namespace name.
|
|
123
|
-
*
|
|
124
|
-
* When `tailor.d.ts` is generated (via `tailor-sdk deploy`/`generate`), this is narrowed
|
|
125
|
-
* to the union of defined IdP names. When no IdPs are registered yet, falls back to
|
|
126
|
-
* `string` to avoid blocking editing before the first generate run.
|
|
127
|
-
*/
|
|
128
|
-
type IdpName = keyof IdpNameRegistry extends never ? string : keyof IdpNameRegistry & string;
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/configure/types/connection-name.d.ts
|
|
131
|
-
interface ConnectionNameRegistry {}
|
|
132
|
-
/**
|
|
133
|
-
* Auth connection name.
|
|
134
|
-
*
|
|
135
|
-
* When `tailor.d.ts` is generated (via `tailor-sdk deploy`/`generate`), this is narrowed
|
|
136
|
-
* to the union of connection names defined in `defineAuth()`'s `connections`. Falls back
|
|
137
|
-
* to `string` before the first generate run.
|
|
138
|
-
*/
|
|
139
|
-
type ConnectionName = keyof ConnectionNameRegistry extends never ? string : keyof ConnectionNameRegistry & string;
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region src/configure/services/auth/index.d.ts
|
|
142
|
-
type MachineUserAttributeFields = Record<string, TailorField$1<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
|
|
143
|
-
type PlaceholderUser = TailorDBInstance<Record<string, never>, Record<string, never>>;
|
|
144
|
-
type PlaceholderAttributeMap = UserAttributeMap<PlaceholderUser>;
|
|
145
|
-
type PlaceholderAttributeList = UserAttributeListKey<PlaceholderUser>[];
|
|
146
|
-
type UserProfileAuthInput<User extends TailorDBInstance, AttributeMap extends UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[], MachineUserNames extends string, ConnectionNames extends string = string> = Omit<AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined, ConnectionNames>, "userProfile" | "machineUserAttributes"> & {
|
|
147
|
-
userProfile: NonNullable<AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>["userProfile"]>;
|
|
148
|
-
machineUserAttributes?: never;
|
|
149
|
-
};
|
|
150
|
-
type MachineUserOnlyAuthInput<MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields, ConnectionNames extends string = string> = Omit<AuthServiceInput<PlaceholderUser, PlaceholderAttributeMap, PlaceholderAttributeList, MachineUserNames, MachineUserAttributes, ConnectionNames>, "userProfile" | "machineUserAttributes"> & {
|
|
151
|
-
userProfile?: never;
|
|
152
|
-
machineUserAttributes: MachineUserAttributes;
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* Invoker type compatible with tailor.v1.AuthInvoker
|
|
156
|
-
* - namespace: auth service name
|
|
157
|
-
* - machineUserName: machine user name
|
|
158
|
-
*/
|
|
159
|
-
type AuthInvoker<M extends string> = Omit<AuthInvoker$1, "machineUserName"> & {
|
|
160
|
-
machineUserName: M;
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Define an auth service for the Tailor SDK.
|
|
164
|
-
* @template Name
|
|
165
|
-
* @template User
|
|
166
|
-
* @template AttributeMap
|
|
167
|
-
* @template AttributeList
|
|
168
|
-
* @template MachineUserNames
|
|
169
|
-
* @template M
|
|
170
|
-
* @param name - Auth service name
|
|
171
|
-
* @param config - Auth service configuration
|
|
172
|
-
* @returns Defined auth service
|
|
173
|
-
*/
|
|
174
|
-
declare function defineAuth<const Name extends string, const User extends TailorDBInstance, const AttributeMap extends UserAttributeMap<User>, const AttributeList extends UserAttributeListKey<User>[], const MachineUserNames extends string, const ConnectionNames extends string = string>(name: Name, config: UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames, ConnectionNames>): DefinedAuth<Name, UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames, ConnectionNames>, MachineUserNames>;
|
|
175
|
-
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>, MachineUserNames>;
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region src/configure/services/resolver/resolver.d.ts
|
|
178
|
-
type Context<Input extends Record<string, TailorAnyField> | undefined> = {
|
|
179
|
-
input: Input extends Record<string, TailorAnyField> ? InferFieldsOutput<Input> : never;
|
|
180
|
-
user: TailorUser;
|
|
181
|
-
invoker?: TailorInvoker;
|
|
182
|
-
env: TailorEnv;
|
|
183
|
-
};
|
|
184
|
-
type OutputType<O> = O extends TailorAnyField ? output$1<O> : O extends Record<string, TailorAnyField> ? InferFieldsOutput<O> : never;
|
|
185
|
-
/**
|
|
186
|
-
* Normalized output type that preserves generic type information.
|
|
187
|
-
* - If Output is already a TailorField, use it as-is
|
|
188
|
-
* - If Output is a Record of fields, wrap it as a nested TailorField
|
|
189
|
-
*/
|
|
190
|
-
type NormalizedOutput<Output extends TailorAnyField | Record<string, TailorAnyField>> = Output extends TailorAnyField ? Output : TailorField<{
|
|
191
|
-
type: "nested";
|
|
192
|
-
array: false;
|
|
193
|
-
}, InferFieldsOutput<Extract<Output, Record<string, TailorAnyField>>>>;
|
|
194
|
-
type ResolverReturn<Input extends Record<string, TailorAnyField> | undefined, Output extends TailorAnyField | Record<string, TailorAnyField>> = Omit<ResolverInput, "input" | "output" | "body" | "authInvoker"> & Readonly<{
|
|
195
|
-
input?: Input;
|
|
196
|
-
output: NormalizedOutput<Output>;
|
|
197
|
-
body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;
|
|
198
|
-
authInvoker?: AuthInvoker<string> | MachineUserName;
|
|
199
|
-
}>;
|
|
200
|
-
/**
|
|
201
|
-
* Create a resolver definition for the Tailor SDK.
|
|
202
|
-
*
|
|
203
|
-
* The `body` function receives a context with `input` (typed from `config.input`),
|
|
204
|
-
* `user`, `invoker` (reflects `authInvoker` delegation), and `env`.
|
|
205
|
-
* The return value of `body` must match the `output` type.
|
|
206
|
-
*
|
|
207
|
-
* `output` accepts either a single TailorField (e.g. `t.string()`) or a
|
|
208
|
-
* Record of fields (e.g. `{ name: t.string(), age: t.int() }`).
|
|
209
|
-
*
|
|
210
|
-
* `publishEvents` enables publishing execution events for this resolver.
|
|
211
|
-
* If not specified, this is automatically set to true when an executor uses this resolver
|
|
212
|
-
* with `resolverExecutedTrigger`. If explicitly set to false while an executor uses this
|
|
213
|
-
* resolver, an error will be thrown during apply.
|
|
214
|
-
* @template Input
|
|
215
|
-
* @template Output
|
|
216
|
-
* @param config - Resolver configuration
|
|
217
|
-
* @returns Normalized resolver configuration
|
|
218
|
-
* @example
|
|
219
|
-
* import { createResolver, t } from "@tailor-platform/sdk";
|
|
220
|
-
*
|
|
221
|
-
* export default createResolver({
|
|
222
|
-
* name: "getUser",
|
|
223
|
-
* operation: "query",
|
|
224
|
-
* input: {
|
|
225
|
-
* id: t.string(),
|
|
226
|
-
* },
|
|
227
|
-
* body: async ({ input, user }) => {
|
|
228
|
-
* const db = getDB("tailordb");
|
|
229
|
-
* const result = await db.selectFrom("User").selectAll().where("id", "=", input.id).executeTakeFirst();
|
|
230
|
-
* return { name: result?.name ?? "", email: result?.email ?? "" };
|
|
231
|
-
* },
|
|
232
|
-
* output: t.object({
|
|
233
|
-
* name: t.string(),
|
|
234
|
-
* email: t.string(),
|
|
235
|
-
* }),
|
|
236
|
-
* });
|
|
237
|
-
*/
|
|
238
|
-
declare function createResolver<Input extends Record<string, TailorAnyField> | undefined = undefined, Output extends TailorAnyField | Record<string, TailorAnyField> = TailorAnyField>(config: Omit<ResolverInput, "input" | "output" | "body" | "authInvoker"> & Readonly<{
|
|
239
|
-
input?: Input;
|
|
240
|
-
output: Output;
|
|
241
|
-
body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;
|
|
242
|
-
authInvoker?: AuthInvoker<string> | MachineUserName;
|
|
243
|
-
}>): ResolverReturn<Input, Output>;
|
|
244
|
-
type ResolverConfig = ReturnType<typeof createResolver<any, any>>;
|
|
245
|
-
//#endregion
|
|
246
|
-
//#region src/configure/services/resolver/types.d.ts
|
|
247
|
-
type QueryType = Resolver["operation"];
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/configure/services/workflow/test-env-key.d.ts
|
|
250
|
-
/**
|
|
251
|
-
* Env-var fallback read by `.trigger()` when `mockWorkflow().setEnv()` is unset.
|
|
252
|
-
* @deprecated Use `mockWorkflow().setEnv()` from `@tailor-platform/sdk/vitest`.
|
|
253
|
-
* @internal
|
|
254
|
-
*/
|
|
255
|
-
declare const WORKFLOW_TEST_ENV_KEY = "TAILOR_TEST_WORKFLOW_ENV";
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/configure/services/workflow/job.d.ts
|
|
258
|
-
/**
|
|
259
|
-
* Context object passed as the second argument to workflow job body functions.
|
|
260
|
-
*/
|
|
261
|
-
type WorkflowJobContext = {
|
|
262
|
-
env: TailorEnv;
|
|
263
|
-
invoker?: TailorInvoker;
|
|
264
|
-
};
|
|
265
|
-
/**
|
|
266
|
-
* The body function type for a workflow job.
|
|
267
|
-
* Resolves to the callable signature when `I` / `O` are JsonValue-compatible,
|
|
268
|
-
* or to a template-literal error string that surfaces at the `body:` property.
|
|
269
|
-
*/
|
|
270
|
-
type JobBody<I, O> = [null] extends [I] ? "ERROR: Input cannot be null at the top level" : [I] extends [undefined] ? [O] extends [JsonCompatible<O> | undefined | void] ? (input: I, context: WorkflowJobContext) => O | Promise<O> : "ERROR: Output must be JsonValue-compatible (plain objects/arrays; no class instances or functions)" : [undefined] extends [I] ? "ERROR: Input cannot include undefined at the top level" : [I] extends [JsonCompatible<I>] ? [O] extends [JsonCompatible<O> | undefined | void] ? (input: I, context: WorkflowJobContext) => O | Promise<O> : "ERROR: Output must be JsonValue-compatible (plain objects/arrays; no class instances or functions)" : "ERROR: Input must be JsonValue-compatible (plain objects/arrays; no class instances or functions)";
|
|
271
|
-
/**
|
|
272
|
-
* WorkflowJob represents a job that can be triggered in a workflow.
|
|
273
|
-
*
|
|
274
|
-
* Type constraints:
|
|
275
|
-
* - Input: Must be JsonValue-compatible (plain objects/arrays; no class instances or functions) or undefined.
|
|
276
|
-
* - Output: Must be JsonValue-compatible (plain objects/arrays; no class instances or functions), undefined, or void.
|
|
277
|
-
* - Trigger returns `Awaited<Output>` as-is (no Jsonify transformation).
|
|
278
|
-
*/
|
|
279
|
-
interface WorkflowJob<Name extends string = string, Input = undefined, Output = undefined> {
|
|
280
|
-
name: Name;
|
|
281
|
-
/**
|
|
282
|
-
* Trigger this job with the given input. Returns a Promise that resolves
|
|
283
|
-
* to the job's output value.
|
|
284
|
-
* @example
|
|
285
|
-
* body: async (input) => {
|
|
286
|
-
* const a = await jobA.trigger({ id: input.id });
|
|
287
|
-
* const b = await jobB.trigger({ id: input.id });
|
|
288
|
-
* return { a, b };
|
|
289
|
-
* }
|
|
290
|
-
*/
|
|
291
|
-
trigger: [Input] extends [undefined] ? () => Promise<Awaited<Output>> : (input: Input) => Promise<Awaited<Output>>;
|
|
292
|
-
body: (input: Input, context: WorkflowJobContext) => Output | Promise<Output>;
|
|
293
|
-
}
|
|
294
|
-
interface CreateWorkflowJobConfig<Name extends string, I, O> {
|
|
295
|
-
readonly name: Name;
|
|
296
|
-
readonly body: JobBody<I, O>;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Create a workflow job definition.
|
|
300
|
-
*
|
|
301
|
-
* All jobs must be named exports from the workflow file.
|
|
302
|
-
* Job names must be unique across the entire project.
|
|
303
|
-
*
|
|
304
|
-
* Input and output must be JsonValue-compatible (primitives, plain objects, arrays).
|
|
305
|
-
* Functions and objects with a `toJSON` method are rejected at the type level;
|
|
306
|
-
* class instances exposing methods are rejected via the property walk.
|
|
307
|
-
* @param config - Job configuration with name and body function.
|
|
308
|
-
* @param config.name - Unique job name across the project.
|
|
309
|
-
* @param config.body - Async function that processes the job input.
|
|
310
|
-
* @returns A WorkflowJob that can be triggered from other jobs.
|
|
311
|
-
* @example
|
|
312
|
-
* // Simple job with async body:
|
|
313
|
-
* export const fetchData = createWorkflowJob({
|
|
314
|
-
* name: "fetch-data",
|
|
315
|
-
* body: async (input: { id: string }) => {
|
|
316
|
-
* const db = getDB("tailordb");
|
|
317
|
-
* return await db.selectFrom("Table").selectAll().where("id", "=", input.id).executeTakeFirst();
|
|
318
|
-
* },
|
|
319
|
-
* });
|
|
320
|
-
* @example
|
|
321
|
-
* // Orchestrator job that fans out to other jobs.
|
|
322
|
-
* export const orchestrate = createWorkflowJob({
|
|
323
|
-
* name: "orchestrate",
|
|
324
|
-
* body: async (input: { orderId: string }) => {
|
|
325
|
-
* const inventory = await checkInventory.trigger({ orderId: input.orderId });
|
|
326
|
-
* const payment = await processPayment.trigger({ orderId: input.orderId });
|
|
327
|
-
* return { inventory, payment };
|
|
328
|
-
* },
|
|
329
|
-
* });
|
|
330
|
-
*/
|
|
331
|
-
declare function createWorkflowJob<const Name extends string, I = undefined, O = undefined>(config: CreateWorkflowJobConfig<Name, I, O>): WorkflowJob<Name, I, Awaited<O>>;
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region src/configure/services/workflow/workflow.d.ts
|
|
334
|
-
interface WorkflowConfig<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
335
|
-
name: string;
|
|
336
|
-
mainJob: Job;
|
|
337
|
-
retryPolicy?: RetryPolicy;
|
|
338
|
-
concurrencyPolicy?: ConcurrencyPolicy;
|
|
339
|
-
}
|
|
340
|
-
interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
341
|
-
name: string;
|
|
342
|
-
mainJob: Job;
|
|
343
|
-
retryPolicy?: RetryPolicy;
|
|
344
|
-
concurrencyPolicy?: ConcurrencyPolicy;
|
|
345
|
-
trigger: (args: Parameters<Job["trigger"]>[0], options?: {
|
|
346
|
-
authInvoker: AuthInvoker<string> | MachineUserName;
|
|
347
|
-
}) => Promise<string>;
|
|
348
|
-
}
|
|
349
|
-
interface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {
|
|
350
|
-
name: string;
|
|
351
|
-
mainJob: Job;
|
|
352
|
-
retryPolicy?: RetryPolicy;
|
|
353
|
-
concurrencyPolicy?: ConcurrencyPolicy;
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Create a workflow definition that can be triggered via the Tailor SDK.
|
|
357
|
-
* In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().
|
|
358
|
-
*
|
|
359
|
-
* The workflow MUST be the default export of the file.
|
|
360
|
-
* All jobs referenced by the workflow MUST be named exports.
|
|
361
|
-
* @template Job
|
|
362
|
-
* @param config - Workflow configuration
|
|
363
|
-
* @returns Defined workflow
|
|
364
|
-
* @example
|
|
365
|
-
* export const fetchData = createWorkflowJob({ name: "fetch-data", body: async (input: { id: string }) => ({ id: input.id }) });
|
|
366
|
-
* export const processData = createWorkflowJob({
|
|
367
|
-
* name: "process-data",
|
|
368
|
-
* body: async (input: { id: string }) => {
|
|
369
|
-
* const data = await fetchData.trigger({ id: input.id });
|
|
370
|
-
* return { data };
|
|
371
|
-
* },
|
|
372
|
-
* });
|
|
373
|
-
*
|
|
374
|
-
* // Workflow must be default export; mainJob is the entry point
|
|
375
|
-
* export default createWorkflow({
|
|
376
|
-
* name: "data-processing",
|
|
377
|
-
* mainJob: processData,
|
|
378
|
-
* });
|
|
379
|
-
*/
|
|
380
|
-
declare function createWorkflow<Job extends WorkflowJob<any, any, any>>(config: WorkflowDefinition<Job>): Workflow<Job>;
|
|
381
|
-
//#endregion
|
|
382
|
-
//#region src/configure/services/executor/operation.d.ts
|
|
383
|
-
/** Function-based executor operation. The body receives the trigger args and the `invoker`. */
|
|
384
|
-
type FunctionOperation<Args> = Omit<FunctionOperation$1, "body" | "authInvoker"> & {
|
|
385
|
-
body: (args: Args & {
|
|
386
|
-
invoker?: TailorInvoker;
|
|
387
|
-
}) => void | Promise<void>;
|
|
388
|
-
authInvoker?: AuthInvoker<string> | MachineUserName;
|
|
389
|
-
};
|
|
390
|
-
type UrqlOperationArgs = Parameters<Client["query"] | Client["mutation"]>;
|
|
391
|
-
/** GraphQL-based executor operation. Executes a GraphQL query or mutation. */
|
|
392
|
-
type GqlOperation<Args> = Omit<GqlOperation$1, "query" | "variables" | "authInvoker"> & {
|
|
393
|
-
query: UrqlOperationArgs[0];
|
|
394
|
-
variables?: (args: Args) => UrqlOperationArgs[1];
|
|
395
|
-
authInvoker?: AuthInvoker<string> | MachineUserName;
|
|
396
|
-
};
|
|
397
|
-
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 & {});
|
|
398
|
-
/** Outbound webhook executor operation. Sends HTTP requests to external URLs. */
|
|
399
|
-
type WebhookOperation<Args> = Omit<WebhookOperation$1, "url" | "requestBody" | "headers"> & {
|
|
400
|
-
url: (args: Args) => string;
|
|
401
|
-
requestBody?: (args: Args) => Record<string, unknown>;
|
|
402
|
-
headers?: { [key in RequestHeader]?: string | {
|
|
403
|
-
vault: string;
|
|
404
|
-
key: string;
|
|
405
|
-
} };
|
|
406
|
-
};
|
|
407
|
-
/**
|
|
408
|
-
* Extract mainJob's Input type from Workflow.
|
|
409
|
-
* Workflow<Job> -> Job is WorkflowJob<Name, Input, Output> -> Input
|
|
410
|
-
*/
|
|
411
|
-
type WorkflowInput$1<W extends Workflow> = Parameters<W["trigger"]>[0];
|
|
412
|
-
/** Workflow-triggering executor operation. Triggers a workflow in response to an event. */
|
|
413
|
-
type WorkflowOperation<Args, W extends Workflow = Workflow> = Omit<WorkflowOperation$1, "workflowName" | "args" | "authInvoker"> & {
|
|
414
|
-
workflow: W;
|
|
415
|
-
args?: WorkflowInput$1<W> | ((args: Args) => WorkflowInput$1<W>);
|
|
416
|
-
authInvoker?: AuthInvoker<string> | MachineUserName;
|
|
417
|
-
};
|
|
418
|
-
type Operation<Args> = FunctionOperation<Args> | GqlOperation<Args> | WebhookOperation<Args> | WorkflowOperation<Args>;
|
|
419
|
-
//#endregion
|
|
420
|
-
//#region src/configure/services/executor/trigger/event.d.ts
|
|
421
|
-
interface EventArgs {
|
|
422
|
-
workspaceId: string;
|
|
423
|
-
appNamespace: string;
|
|
424
|
-
env: TailorEnv;
|
|
425
|
-
actor: TailorActor | null;
|
|
426
|
-
}
|
|
427
|
-
interface RecordArgs extends EventArgs {
|
|
428
|
-
typeName: string;
|
|
429
|
-
}
|
|
430
|
-
interface RecordCreatedArgs<T extends TailorDBType> extends RecordArgs {
|
|
431
|
-
event: "created";
|
|
432
|
-
rawEvent: "tailordb.type_record.created";
|
|
433
|
-
newRecord: output$1<T>;
|
|
434
|
-
}
|
|
435
|
-
interface RecordUpdatedArgs<T extends TailorDBType> extends RecordArgs {
|
|
436
|
-
event: "updated";
|
|
437
|
-
rawEvent: "tailordb.type_record.updated";
|
|
438
|
-
newRecord: output$1<T>;
|
|
439
|
-
oldRecord: output$1<T>;
|
|
440
|
-
}
|
|
441
|
-
interface RecordDeletedArgs<T extends TailorDBType> extends RecordArgs {
|
|
442
|
-
event: "deleted";
|
|
443
|
-
rawEvent: "tailordb.type_record.deleted";
|
|
444
|
-
oldRecord: output$1<T>;
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Args for resolverExecutedTrigger. This is a discriminated union on `success`.
|
|
448
|
-
*
|
|
449
|
-
* When `success` is true, `result` contains the resolver output and `error` is never.
|
|
450
|
-
* When `success` is false, `error` contains the error message and `result` is never.
|
|
451
|
-
*
|
|
452
|
-
* Narrow on `success` to safely access either `result` or `error`.
|
|
453
|
-
* @example
|
|
454
|
-
* body: async (args) => {
|
|
455
|
-
* if (args.success) {
|
|
456
|
-
* console.log(args.result);
|
|
457
|
-
* } else {
|
|
458
|
-
* console.error(args.error);
|
|
459
|
-
* }
|
|
460
|
-
* }
|
|
461
|
-
*/
|
|
462
|
-
type ResolverExecutedArgs<R extends ResolverConfig> = EventArgs & {
|
|
463
|
-
resolverName: string;
|
|
464
|
-
} & ({
|
|
465
|
-
success: true;
|
|
466
|
-
result: output$1<R["output"]>;
|
|
467
|
-
error?: never;
|
|
468
|
-
} | {
|
|
469
|
-
success: false;
|
|
470
|
-
result?: never;
|
|
471
|
-
error: string;
|
|
472
|
-
});
|
|
473
|
-
interface IdpUserCreatedArgs extends EventArgs {
|
|
474
|
-
event: "created";
|
|
475
|
-
rawEvent: "idp.user.created";
|
|
476
|
-
namespaceName: string;
|
|
477
|
-
userId: string;
|
|
478
|
-
}
|
|
479
|
-
interface IdpUserUpdatedArgs extends EventArgs {
|
|
480
|
-
event: "updated";
|
|
481
|
-
rawEvent: "idp.user.updated";
|
|
482
|
-
namespaceName: string;
|
|
483
|
-
userId: string;
|
|
484
|
-
}
|
|
485
|
-
interface IdpUserDeletedArgs extends EventArgs {
|
|
486
|
-
event: "deleted";
|
|
487
|
-
rawEvent: "idp.user.deleted";
|
|
488
|
-
namespaceName: string;
|
|
489
|
-
userId: string;
|
|
490
|
-
}
|
|
491
|
-
type IdpUserArgs = IdpUserCreatedArgs | IdpUserUpdatedArgs | IdpUserDeletedArgs;
|
|
492
|
-
interface AuthAccessTokenIssuedArgs extends EventArgs {
|
|
493
|
-
event: "issued";
|
|
494
|
-
rawEvent: "auth.access_token.issued";
|
|
495
|
-
namespaceName: string;
|
|
496
|
-
userId: string;
|
|
497
|
-
}
|
|
498
|
-
interface AuthAccessTokenRefreshedArgs extends EventArgs {
|
|
499
|
-
event: "refreshed";
|
|
500
|
-
rawEvent: "auth.access_token.refreshed";
|
|
501
|
-
namespaceName: string;
|
|
502
|
-
userId: string;
|
|
503
|
-
}
|
|
504
|
-
interface AuthAccessTokenRevokedArgs extends EventArgs {
|
|
505
|
-
event: "revoked";
|
|
506
|
-
rawEvent: "auth.access_token.revoked";
|
|
507
|
-
namespaceName: string;
|
|
508
|
-
userId: string;
|
|
509
|
-
}
|
|
510
|
-
type AuthAccessTokenArgs = AuthAccessTokenIssuedArgs | AuthAccessTokenRefreshedArgs | AuthAccessTokenRevokedArgs;
|
|
511
|
-
declare const recordEventMap: {
|
|
512
|
-
readonly created: "tailordb.type_record.created";
|
|
513
|
-
readonly updated: "tailordb.type_record.updated";
|
|
514
|
-
readonly deleted: "tailordb.type_record.deleted";
|
|
515
|
-
};
|
|
516
|
-
type RecordEventMap = typeof recordEventMap;
|
|
517
|
-
type RecordEventKind = keyof RecordEventMap;
|
|
518
|
-
type RecordArgsMap<T extends TailorDBType> = {
|
|
519
|
-
created: RecordCreatedArgs<T>;
|
|
520
|
-
updated: RecordUpdatedArgs<T>;
|
|
521
|
-
deleted: RecordDeletedArgs<T>;
|
|
522
|
-
};
|
|
523
|
-
type RecordMultiArgs<T extends TailorDBType, K extends RecordEventKind[]> = RecordArgsMap<T>[K[number]];
|
|
524
|
-
type TailorDBTrigger<Args> = TailorDBTrigger$1 & {
|
|
525
|
-
__args: Args;
|
|
526
|
-
};
|
|
527
|
-
type RecordTriggerOptions<T extends TailorDBType, Args> = {
|
|
528
|
-
type: T;
|
|
529
|
-
condition?: (args: Args) => boolean;
|
|
530
|
-
};
|
|
531
|
-
/**
|
|
532
|
-
* Create a trigger that fires when a TailorDB record is created.
|
|
533
|
-
* @template T
|
|
534
|
-
* @param options - Trigger options
|
|
535
|
-
* @returns Record created trigger
|
|
536
|
-
*/
|
|
537
|
-
declare function recordCreatedTrigger<T extends TailorDBType>(options: RecordTriggerOptions<T, RecordCreatedArgs<T>>): TailorDBTrigger<RecordCreatedArgs<T>>;
|
|
538
|
-
/**
|
|
539
|
-
* Create a trigger that fires when a TailorDB record is updated.
|
|
540
|
-
* @template T
|
|
541
|
-
* @param options - Trigger options
|
|
542
|
-
* @returns Record updated trigger
|
|
543
|
-
*/
|
|
544
|
-
declare function recordUpdatedTrigger<T extends TailorDBType>(options: RecordTriggerOptions<T, RecordUpdatedArgs<T>>): TailorDBTrigger<RecordUpdatedArgs<T>>;
|
|
545
|
-
/**
|
|
546
|
-
* Create a trigger that fires when a TailorDB record is deleted.
|
|
547
|
-
* @template T
|
|
548
|
-
* @param options - Trigger options
|
|
549
|
-
* @returns Record deleted trigger
|
|
550
|
-
*/
|
|
551
|
-
declare function recordDeletedTrigger<T extends TailorDBType>(options: RecordTriggerOptions<T, RecordDeletedArgs<T>>): TailorDBTrigger<RecordDeletedArgs<T>>;
|
|
552
|
-
type RecordTriggerMultiOptions<T extends TailorDBType, K extends RecordEventKind[]> = {
|
|
553
|
-
type: T;
|
|
554
|
-
events: K;
|
|
555
|
-
condition?: (args: RecordMultiArgs<T, K>) => boolean;
|
|
556
|
-
};
|
|
557
|
-
/**
|
|
558
|
-
* Create a trigger that fires on multiple TailorDB record event types.
|
|
559
|
-
* @template T
|
|
560
|
-
* @template K
|
|
561
|
-
* @param options - Trigger options with events array
|
|
562
|
-
* @returns TailorDB record trigger
|
|
563
|
-
*/
|
|
564
|
-
declare function recordTrigger<T extends TailorDBType, const K extends [RecordEventKind, ...RecordEventKind[]]>(options: RecordTriggerMultiOptions<T, K>): TailorDBTrigger<RecordMultiArgs<T, K>>;
|
|
565
|
-
type ResolverExecutedTrigger<Args> = ResolverExecutedTrigger$1 & {
|
|
566
|
-
__args: Args;
|
|
567
|
-
};
|
|
568
|
-
type ResolverExecutedTriggerOptions<R extends ResolverConfig> = {
|
|
569
|
-
resolver: R;
|
|
570
|
-
condition?: (args: ResolverExecutedArgs<R>) => boolean;
|
|
571
|
-
};
|
|
572
|
-
/**
|
|
573
|
-
* Create a trigger that fires when a resolver is executed.
|
|
574
|
-
* @template R
|
|
575
|
-
* @param options - Trigger options
|
|
576
|
-
* @returns Resolver executed trigger
|
|
577
|
-
*/
|
|
578
|
-
declare function resolverExecutedTrigger<R extends ResolverConfig>(options: ResolverExecutedTriggerOptions<R>): ResolverExecutedTrigger<ResolverExecutedArgs<R>>;
|
|
579
|
-
declare const idpUserEventMap: {
|
|
580
|
-
readonly created: "idp.user.created";
|
|
581
|
-
readonly updated: "idp.user.updated";
|
|
582
|
-
readonly deleted: "idp.user.deleted";
|
|
583
|
-
};
|
|
584
|
-
type IdpUserEventMap = typeof idpUserEventMap;
|
|
585
|
-
type IdpUserEventKind = keyof IdpUserEventMap;
|
|
586
|
-
type IdpUserArgsMap = {
|
|
587
|
-
created: IdpUserCreatedArgs;
|
|
588
|
-
updated: IdpUserUpdatedArgs;
|
|
589
|
-
deleted: IdpUserDeletedArgs;
|
|
590
|
-
};
|
|
591
|
-
type IdpUserMultiArgs<K extends IdpUserEventKind[]> = IdpUserArgsMap[K[number]];
|
|
592
|
-
type IdpUserTrigger<Args> = IdpUserTrigger$1 & {
|
|
593
|
-
__args: Args;
|
|
594
|
-
};
|
|
595
|
-
type IdpUserSingleTriggerOptions = {
|
|
596
|
-
/**
|
|
597
|
-
* IdP namespace name to subscribe to. Required when the project defines
|
|
598
|
-
* multiple IdPs; optional when a single IdP exists. Must match an IdP name
|
|
599
|
-
* declared in `defineConfig({ idp: [...] })`.
|
|
600
|
-
*/
|
|
601
|
-
idp?: IdpName;
|
|
602
|
-
};
|
|
603
|
-
/**
|
|
604
|
-
* Create a trigger that fires when an IdP user is created.
|
|
605
|
-
* @param options - Trigger options
|
|
606
|
-
* @param options.idp - IdP namespace name to subscribe to
|
|
607
|
-
* @returns IdP user created trigger
|
|
608
|
-
*/
|
|
609
|
-
declare function idpUserCreatedTrigger(options?: IdpUserSingleTriggerOptions): IdpUserTrigger<IdpUserCreatedArgs>;
|
|
610
|
-
/**
|
|
611
|
-
* Create a trigger that fires when an IdP user is updated.
|
|
612
|
-
* @param options - Trigger options
|
|
613
|
-
* @param options.idp - IdP namespace name to subscribe to
|
|
614
|
-
* @returns IdP user updated trigger
|
|
615
|
-
*/
|
|
616
|
-
declare function idpUserUpdatedTrigger(options?: IdpUserSingleTriggerOptions): IdpUserTrigger<IdpUserUpdatedArgs>;
|
|
617
|
-
/**
|
|
618
|
-
* Create a trigger that fires when an IdP user is deleted.
|
|
619
|
-
* @param options - Trigger options
|
|
620
|
-
* @param options.idp - IdP namespace name to subscribe to
|
|
621
|
-
* @returns IdP user deleted trigger
|
|
622
|
-
*/
|
|
623
|
-
declare function idpUserDeletedTrigger(options?: IdpUserSingleTriggerOptions): IdpUserTrigger<IdpUserDeletedArgs>;
|
|
624
|
-
type IdpUserTriggerOptions<K extends IdpUserEventKind[]> = {
|
|
625
|
-
events: K;
|
|
626
|
-
/**
|
|
627
|
-
* IdP namespace name to subscribe to. Required when the project defines
|
|
628
|
-
* multiple IdPs; optional when a single IdP exists. Must match an IdP name
|
|
629
|
-
* declared in `defineConfig({ idp: [...] })`.
|
|
630
|
-
*/
|
|
631
|
-
idp?: IdpName;
|
|
632
|
-
};
|
|
633
|
-
/**
|
|
634
|
-
* Create a trigger that fires on multiple IdP user event types.
|
|
635
|
-
* @template K
|
|
636
|
-
* @param options - Trigger options with events array
|
|
637
|
-
* @param options.events - IdP user event kinds to subscribe to
|
|
638
|
-
* @param options.idp - IdP namespace name to subscribe to
|
|
639
|
-
* @returns IdP user trigger
|
|
640
|
-
*/
|
|
641
|
-
declare function idpUserTrigger<const K extends [IdpUserEventKind, ...IdpUserEventKind[]]>(options: IdpUserTriggerOptions<K>): IdpUserTrigger<IdpUserMultiArgs<K>>;
|
|
642
|
-
declare const authAccessTokenEventMap: {
|
|
643
|
-
readonly issued: "auth.access_token.issued";
|
|
644
|
-
readonly refreshed: "auth.access_token.refreshed";
|
|
645
|
-
readonly revoked: "auth.access_token.revoked";
|
|
646
|
-
};
|
|
647
|
-
type AuthAccessTokenEventMap = typeof authAccessTokenEventMap;
|
|
648
|
-
type AuthAccessTokenEventKind = keyof AuthAccessTokenEventMap;
|
|
649
|
-
type AuthAccessTokenArgsMap = {
|
|
650
|
-
issued: AuthAccessTokenIssuedArgs;
|
|
651
|
-
refreshed: AuthAccessTokenRefreshedArgs;
|
|
652
|
-
revoked: AuthAccessTokenRevokedArgs;
|
|
653
|
-
};
|
|
654
|
-
type AuthAccessTokenMultiArgs<K extends AuthAccessTokenEventKind[]> = AuthAccessTokenArgsMap[K[number]];
|
|
655
|
-
type AuthAccessTokenTrigger<Args> = AuthAccessTokenTrigger$1 & {
|
|
656
|
-
__args: Args;
|
|
657
|
-
};
|
|
658
|
-
/**
|
|
659
|
-
* Create a trigger that fires when an access token is issued.
|
|
660
|
-
* @returns Auth access token issued trigger
|
|
661
|
-
*/
|
|
662
|
-
declare function authAccessTokenIssuedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenIssuedArgs>;
|
|
663
|
-
/**
|
|
664
|
-
* Create a trigger that fires when an access token is refreshed.
|
|
665
|
-
* @returns Auth access token refreshed trigger
|
|
666
|
-
*/
|
|
667
|
-
declare function authAccessTokenRefreshedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenRefreshedArgs>;
|
|
668
|
-
/**
|
|
669
|
-
* Create a trigger that fires when an access token is revoked.
|
|
670
|
-
* @returns Auth access token revoked trigger
|
|
671
|
-
*/
|
|
672
|
-
declare function authAccessTokenRevokedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenRevokedArgs>;
|
|
673
|
-
type AuthAccessTokenTriggerOptions<K extends AuthAccessTokenEventKind[]> = {
|
|
674
|
-
events: K;
|
|
675
|
-
};
|
|
676
|
-
/**
|
|
677
|
-
* Create a trigger that fires on multiple auth access token event types.
|
|
678
|
-
* @template K
|
|
679
|
-
* @param options - Trigger options with events array
|
|
680
|
-
* @returns Auth access token trigger
|
|
681
|
-
*/
|
|
682
|
-
declare function authAccessTokenTrigger<const K extends [AuthAccessTokenEventKind, ...AuthAccessTokenEventKind[]]>(options: AuthAccessTokenTriggerOptions<K>): AuthAccessTokenTrigger<AuthAccessTokenMultiArgs<K>>;
|
|
683
|
-
//#endregion
|
|
684
|
-
//#region src/configure/services/executor/trigger/schedule.d.ts
|
|
685
|
-
type Timezone = "UTC" | "Pacific/Midway" | "Pacific/Niue" | "Pacific/Pago_Pago" | "America/Adak" | "Pacific/Honolulu" | "Pacific/Rarotonga" | "Pacific/Tahiti" | "Pacific/Marquesas" | "America/Anchorage" | "America/Juneau" | "America/Metlakatla" | "America/Nome" | "America/Sitka" | "America/Yakutat" | "Pacific/Gambier" | "America/Los_Angeles" | "America/Tijuana" | "America/Vancouver" | "Pacific/Pitcairn" | "America/Boise" | "America/Cambridge_Bay" | "America/Chihuahua" | "America/Creston" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Edmonton" | "America/Fort_Nelson" | "America/Hermosillo" | "America/Inuvik" | "America/Mazatlan" | "America/Ojinaga" | "America/Phoenix" | "America/Whitehorse" | "America/Yellowknife" | "America/Bahia_Banderas" | "America/Belize" | "America/Chicago" | "America/Costa_Rica" | "America/El_Salvador" | "America/Guatemala" | "America/Indiana/Knox" | "America/Indiana/Tell_City" | "America/Managua" | "America/Matamoros" | "America/Menominee" | "America/Merida" | "America/Mexico_City" | "America/Monterrey" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Regina" | "America/Resolute" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Winnipeg" | "Pacific/Easter" | "Pacific/Galapagos" | "America/Atikokan" | "America/Bogota" | "America/Cancun" | "America/Cayman" | "America/Detroit" | "America/Eirunepe" | "America/Grand_Turk" | "America/Guayaquil" | "America/Havana" | "America/Indiana/Indianapolis" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Iqaluit" | "America/Jamaica" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/Lima" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Panama" | "America/Pangnirtung" | "America/Port-au-Prince" | "America/Rio_Branco" | "America/Thunder_Bay" | "America/Toronto" | "America/Anguilla" | "America/Antigua" | "America/Aruba" | "America/Asuncion" | "America/Barbados" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Campo_Grande" | "America/Caracas" | "America/Cuiaba" | "America/Curacao" | "America/Dominica" | "America/Glace_Bay" | "America/Goose_Bay" | "America/Grenada" | "America/Guadeloupe" | "America/Guyana" | "America/Halifax" | "America/Kralendijk" | "America/La_Paz" | "America/Lower_Princes" | "America/Manaus" | "America/Marigot" | "America/Martinique" | "America/Moncton" | "America/Montserrat" | "America/Porto_Velho" | "America/Port_of_Spain" | "America/Puerto_Rico" | "America/Santiago" | "America/Santo_Domingo" | "America/St_Barthelemy" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Thule" | "America/Tortola" | "Atlantic/Bermuda" | "America/St_Johns" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Bahia" | "America/Belem" | "America/Cayenne" | "America/Fortaleza" | "America/Godthab" | "America/Maceio" | "America/Miquelon" | "America/Montevideo" | "America/Paramaribo" | "America/Punta_Arenas" | "America/Recife" | "America/Santarem" | "America/Sao_Paulo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Atlantic/Stanley" | "America/Noronha" | "Atlantic/South_Georgia" | "America/Scoresbysund" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Africa/Abidjan" | "Africa/Accra" | "Africa/Bamako" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Casablanca" | "Africa/Conakry" | "Africa/Dakar" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Lome" | "Africa/Monrovia" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Sao_Tome" | "America/Danmarkshavn" | "Antarctica/Troll" | "Atlantic/Canary" | "Atlantic/Faroe" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/St_Helena" | "Europe/Dublin" | "Europe/Guernsey" | "Europe/Isle_of_Man" | "Europe/Jersey" | "Europe/Lisbon" | "Europe/London" | "Africa/Algiers" | "Africa/Bangui" | "Africa/Brazzaville" | "Africa/Ceuta" | "Africa/Douala" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Luanda" | "Africa/Malabo" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Porto-Novo" | "Africa/Tunis" | "Africa/Windhoek" | "Arctic/Longyearbyen" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Gibraltar" | "Europe/Ljubljana" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Monaco" | "Europe/Oslo" | "Europe/Paris" | "Europe/Podgorica" | "Europe/Prague" | "Europe/Rome" | "Europe/San_Marino" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Stockholm" | "Europe/Tirane" | "Europe/Vaduz" | "Europe/Vatican" | "Europe/Vienna" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "Africa/Blantyre" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Tripoli" | "Asia/Amman" | "Asia/Beirut" | "Asia/Damascus" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Hebron" | "Asia/Jerusalem" | "Asia/Nicosia" | "Europe/Athens" | "Europe/Bucharest" | "Europe/Chisinau" | "Europe/Helsinki" | "Europe/Kaliningrad" | "Europe/Kyiv" | "Europe/Mariehamn" | "Europe/Riga" | "Europe/Sofia" | "Europe/Tallinn" | "Europe/Uzhgorod" | "Europe/Vilnius" | "Europe/Zaporizhzhia" | "Africa/Addis_Ababa" | "Africa/Asmara" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Kampala" | "Africa/Mogadishu" | "Africa/Nairobi" | "Antarctica/Syowa" | "Asia/Aden" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Kuwait" | "Asia/Qatar" | "Asia/Riyadh" | "Europe/Istanbul" | "Europe/Kirov" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Simferopol" | "Europe/Volgograd" | "Indian/Antananarivo" | "Indian/Comoro" | "Indian/Mayotte" | "Asia/Tehran" | "Asia/Baku" | "Asia/Dubai" | "Asia/Muscat" | "Asia/Tbilisi" | "Asia/Yerevan" | "Europe/Astrakhan" | "Europe/Samara" | "Europe/Saratov" | "Europe/Ulyanovsk" | "Indian/Mahe" | "Indian/Mauritius" | "Indian/Reunion" | "Asia/Kabul" | "Antarctica/Mawson" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Atyrau" | "Asia/Dushanbe" | "Asia/Karachi" | "Asia/Oral" | "Asia/Qyzylorda" | "Asia/Samarkand" | "Asia/Tashkent" | "Asia/Yekaterinburg" | "Indian/Kerguelen" | "Indian/Maldives" | "Asia/Colombo" | "Asia/Kolkata" | "Asia/Kathmandu" | "Antarctica/Vostok" | "Asia/Almaty" | "Asia/Bishkek" | "Asia/Dhaka" | "Asia/Omsk" | "Asia/Qostanay" | "Asia/Thimphu" | "Asia/Urumqi" | "Indian/Chagos" | "Asia/Yangon" | "Indian/Cocos" | "Antarctica/Davis" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Hovd" | "Asia/Ho_Chi_Minh" | "Asia/Jakarta" | "Asia/Krasnoyarsk" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Tomsk" | "Asia/Vientiane" | "Indian/Christmas" | "Asia/Brunei" | "Asia/Choibalsan" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Macau" | "Asia/Makassar" | "Asia/Manila" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Taipei" | "Asia/Ulaanbaatar" | "Australia/Perth" | "Australia/Eucla" | "Asia/Chita" | "Asia/Dili" | "Asia/Jayapura" | "Asia/Khandyga" | "Asia/Pyongyang" | "Asia/Seoul" | "Asia/Tokyo" | "Asia/Yakutsk" | "Pacific/Palau" | "Australia/Adelaide" | "Australia/Broken_Hill" | "Australia/Darwin" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Asia/Ust-Nera" | "Asia/Vladivostok" | "Australia/Brisbane" | "Australia/Currie" | "Australia/Hobart" | "Australia/Lindeman" | "Australia/Melbourne" | "Australia/Sydney" | "Pacific/Chuuk" | "Pacific/Guam" | "Pacific/Port_Moresby" | "Pacific/Saipan" | "Australia/Lord_Howe" | "Antarctica/Casey" | "Asia/Magadan" | "Asia/Sakhalin" | "Asia/Srednekolymsk" | "Pacific/Bougainville" | "Pacific/Efate" | "Pacific/Guadalcanal" | "Pacific/Kosrae" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pohnpei" | "Antarctica/McMurdo" | "Asia/Anadyr" | "Asia/Kamchatka" | "Pacific/Auckland" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Nauru" | "Pacific/Tarawa" | "Pacific/Wake" | "Pacific/Wallis" | "Pacific/Chatham" | "Pacific/Apia" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Tongatapu" | "Pacific/Kiritimati";
|
|
686
|
-
type ScheduleTrigger<Args> = ScheduleTriggerInput & {
|
|
687
|
-
__args: Args;
|
|
688
|
-
};
|
|
689
|
-
interface ScheduleArgs {
|
|
690
|
-
env: TailorEnv;
|
|
691
|
-
}
|
|
692
|
-
interface ScheduleTriggerOptions<T extends string> {
|
|
693
|
-
cron: StandardCRON<T> extends never ? never : T;
|
|
694
|
-
timezone?: Timezone;
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Create a schedule-based trigger using a CRON expression and optional timezone.
|
|
698
|
-
* @template T
|
|
699
|
-
* @param options - Schedule options
|
|
700
|
-
* @returns Schedule trigger
|
|
701
|
-
*/
|
|
702
|
-
declare function scheduleTrigger<T extends string>(options: ScheduleTriggerOptions<T>): ScheduleTrigger<ScheduleArgs>;
|
|
703
|
-
//#endregion
|
|
704
|
-
//#region src/configure/services/executor/trigger/webhook.d.ts
|
|
705
|
-
interface IncomingWebhookArgs<T extends IncomingWebhookRequest> {
|
|
706
|
-
body: T["body"];
|
|
707
|
-
headers: T["headers"];
|
|
708
|
-
method: "POST" | "GET" | "PUT" | "DELETE";
|
|
709
|
-
rawBody: string;
|
|
710
|
-
env: TailorEnv;
|
|
711
|
-
}
|
|
712
|
-
interface IncomingWebhookRequest {
|
|
713
|
-
body: Record<string, unknown>;
|
|
714
|
-
headers: Record<string, string>;
|
|
715
|
-
}
|
|
716
|
-
interface IncomingWebhookResponseConfig<Args> {
|
|
717
|
-
/**
|
|
718
|
-
* Expression that returns the webhook HTTP response body.
|
|
719
|
-
* Receives the same args as the executor operation.
|
|
720
|
-
*/
|
|
721
|
-
body?: (args: Args) => JsonValue;
|
|
722
|
-
/**
|
|
723
|
-
* HTTP status code for the response.
|
|
724
|
-
* If omitted and `body` is set, the platform uses 200.
|
|
725
|
-
*/
|
|
726
|
-
statusCode?: number;
|
|
727
|
-
}
|
|
728
|
-
type IncomingWebhookResponse<Args> = ((args: Args) => JsonValue) | IncomingWebhookResponseConfig<Args>;
|
|
729
|
-
interface IncomingWebhookTriggerOptions<Args> {
|
|
730
|
-
response?: IncomingWebhookResponse<Args>;
|
|
731
|
-
}
|
|
732
|
-
type IncomingWebhookTrigger<Args> = IncomingWebhookTrigger$1 & {
|
|
733
|
-
__args: Args;
|
|
734
|
-
};
|
|
735
|
-
/**
|
|
736
|
-
* Create a trigger for incoming webhook requests.
|
|
737
|
-
* @template T
|
|
738
|
-
* @param options - Optional trigger options including response configuration
|
|
739
|
-
* @returns Incoming webhook trigger
|
|
740
|
-
*/
|
|
741
|
-
declare function incomingWebhookTrigger<T extends IncomingWebhookRequest>(options?: IncomingWebhookTriggerOptions<IncomingWebhookArgs<T>>): IncomingWebhookTrigger<IncomingWebhookArgs<T>>;
|
|
742
|
-
//#endregion
|
|
743
|
-
//#region src/configure/services/executor/trigger/index.d.ts
|
|
744
|
-
type Trigger<Args> = TailorDBTrigger<Args> | ResolverExecutedTrigger<Args> | ScheduleTrigger<Args> | IncomingWebhookTrigger<Args> | IdpUserTrigger<Args> | AuthAccessTokenTrigger<Args>;
|
|
745
|
-
//#endregion
|
|
746
|
-
//#region src/configure/services/executor/executor.d.ts
|
|
747
|
-
/**
|
|
748
|
-
* Extract mainJob's Input type from Workflow.
|
|
749
|
-
*/
|
|
750
|
-
type WorkflowInput<W extends Workflow> = Parameters<W["trigger"]>[0];
|
|
751
|
-
type TriggerArgs<T extends Trigger<unknown>> = T extends {
|
|
752
|
-
__args: infer Args;
|
|
753
|
-
} ? Args : never;
|
|
754
|
-
type ExecutorBase<T extends Trigger<unknown>> = Omit<ExecutorInput, "trigger" | "operation"> & {
|
|
755
|
-
trigger: T;
|
|
756
|
-
};
|
|
757
|
-
/**
|
|
758
|
-
* Executor type with conditional inference for workflow operations.
|
|
759
|
-
* When operation.kind is "workflow", infers W from the workflow property
|
|
760
|
-
* to ensure args type matches the workflow's mainJob input type.
|
|
761
|
-
*/
|
|
762
|
-
type Executor<T extends Trigger<unknown>, O> = O extends {
|
|
763
|
-
kind: "workflow";
|
|
764
|
-
workflow: infer W extends Workflow;
|
|
765
|
-
} ? ExecutorBase<T> & {
|
|
766
|
-
operation: {
|
|
767
|
-
kind: "workflow";
|
|
768
|
-
workflow: W;
|
|
769
|
-
args?: WorkflowInput<W> | ((args: TriggerArgs<T>) => WorkflowInput<W>);
|
|
770
|
-
authInvoker?: AuthInvoker<string> | MachineUserName;
|
|
771
|
-
};
|
|
772
|
-
} : ExecutorBase<T> & {
|
|
773
|
-
operation: O;
|
|
774
|
-
};
|
|
775
|
-
/**
|
|
776
|
-
* Create an executor configuration for the Tailor SDK.
|
|
777
|
-
*
|
|
778
|
-
* Executors are event-driven handlers that respond to record changes,
|
|
779
|
-
* resolver executions, or other events.
|
|
780
|
-
*
|
|
781
|
-
* Operation kinds: "function", "graphql", "webhook", "workflow".
|
|
782
|
-
* @template T
|
|
783
|
-
* @template O
|
|
784
|
-
* @param config - Executor configuration
|
|
785
|
-
* @returns The same executor configuration
|
|
786
|
-
* @example
|
|
787
|
-
* import { createExecutor, recordCreatedTrigger } from "@tailor-platform/sdk";
|
|
788
|
-
* import { order } from "../tailordb/order";
|
|
789
|
-
*
|
|
790
|
-
* export default createExecutor({
|
|
791
|
-
* name: "order-created",
|
|
792
|
-
* description: "Handles new order creation",
|
|
793
|
-
* trigger: recordCreatedTrigger({ type: order }),
|
|
794
|
-
* operation: {
|
|
795
|
-
* kind: "function",
|
|
796
|
-
* body: async ({ newRecord }) => {
|
|
797
|
-
* console.log("New order:", newRecord.id);
|
|
798
|
-
* },
|
|
799
|
-
* },
|
|
800
|
-
* });
|
|
801
|
-
*/
|
|
802
|
-
declare function createExecutor<T extends Trigger<unknown>, O extends Operation<TriggerArgs<T>> | {
|
|
803
|
-
kind: "workflow";
|
|
804
|
-
workflow: Workflow;
|
|
805
|
-
}>(config: Executor<T, O>): Executor<T, O>;
|
|
806
|
-
/**
|
|
807
|
-
* Create an executor configuration for the Tailor SDK.
|
|
808
|
-
* This overload preserves source compatibility for legacy explicit generic calls,
|
|
809
|
-
* where the first generic argument represents trigger args.
|
|
810
|
-
* @template Args
|
|
811
|
-
* @template O
|
|
812
|
-
* @param config - Executor configuration
|
|
813
|
-
* @returns The same executor configuration
|
|
814
|
-
*/
|
|
815
|
-
declare function createExecutor<Args, O extends Operation<Args> | {
|
|
816
|
-
kind: "workflow";
|
|
817
|
-
workflow: Workflow;
|
|
818
|
-
}>(config: Executor<Trigger<Args>, O>): Executor<Trigger<Args>, O>;
|
|
819
|
-
//#endregion
|
|
820
|
-
//#region src/configure/services/workflow/wait-point.d.ts
|
|
821
|
-
/**
|
|
822
|
-
* A single wait point instance with typed `.wait()` and `.resolve()` methods.
|
|
823
|
-
*
|
|
824
|
-
* - `.wait(payload?)` suspends execution until resolved. Returns the result from `.resolve()`.
|
|
825
|
-
* - `.resolve(executionId, callback)` resumes a suspended execution.
|
|
826
|
-
*
|
|
827
|
-
* Both `Payload` and `Result` must be JsonValue-compatible (primitives, plain objects, arrays).
|
|
828
|
-
* Functions and objects with a `toJSON` method are rejected at the type level.
|
|
829
|
-
*/
|
|
830
|
-
interface WaitPointInstance<Payload = undefined, Result = undefined> {
|
|
831
|
-
wait: [Payload] extends [undefined] ? () => Promise<Result> : (payload: Payload) => Promise<Result>;
|
|
832
|
-
resolve: (executionId: string, callback: (payload: [Payload] extends [undefined] ? undefined : Payload) => Result | Promise<Result>) => Promise<void>;
|
|
833
|
-
}
|
|
834
|
-
/**
|
|
835
|
-
* The type produced by `define<Payload, Result>()` / `defineWaitPoint<Payload, Result>(key)`.
|
|
836
|
-
* Resolves to `WaitPointInstance<Payload, Result>` when both types are JsonValue-compatible,
|
|
837
|
-
* or to a template-literal error string that surfaces at the call site.
|
|
838
|
-
*/
|
|
839
|
-
type WaitPointDef<Payload, Result> = [null] extends [Payload] ? "ERROR: Payload cannot be null at the top level" : [undefined] extends [Result] ? "ERROR: Result cannot be (or include) undefined (resolve callback must return a value)" : [Payload] extends [undefined] ? [Result] extends [JsonCompatible<Result>] ? WaitPointInstance<Payload, Result> : "ERROR: Result must be JsonValue-compatible (plain objects/arrays; no class instances or functions)" : [undefined] extends [Payload] ? "ERROR: Payload cannot include undefined at the top level" : [Payload] extends [JsonCompatible<Payload>] ? [Result] extends [JsonCompatible<Result>] ? WaitPointInstance<Payload, Result> : "ERROR: Result must be JsonValue-compatible (plain objects/arrays; no class instances or functions)" : "ERROR: Payload must be JsonValue-compatible (plain objects/arrays; no class instances or functions)";
|
|
840
|
-
/**
|
|
841
|
-
* The `define` function passed to the `defineWaitPoints` builder callback.
|
|
842
|
-
* Returns an actual WaitPointInstance (not a phantom marker) so that the
|
|
843
|
-
* builder's return type can flow through as-is, preserving JSDoc comments
|
|
844
|
-
* on each property for IDE autocompletion.
|
|
845
|
-
*
|
|
846
|
-
* JSON validation is encoded in the return type rather than in type-parameter
|
|
847
|
-
* constraints, because tsgo rejects self-referential constraints like
|
|
848
|
-
* `Payload extends JsonCompatible<Payload>` as circular.
|
|
849
|
-
*/
|
|
850
|
-
type DefineFn = <Payload = undefined, Result = undefined>() => WaitPointDef<Payload, Result>;
|
|
851
|
-
/**
|
|
852
|
-
* Define a single typed wait point with an explicit key.
|
|
853
|
-
*
|
|
854
|
-
* `Payload` and `Result` must be JsonValue-compatible.
|
|
855
|
-
* Functions and objects with a `toJSON` method are rejected at the type level;
|
|
856
|
-
* class instances exposing methods are rejected via the property walk.
|
|
857
|
-
* @param key - The wait point key used to match wait and resolve calls
|
|
858
|
-
* @returns A WaitPointInstance with typed `.wait()` and `.resolve()` methods
|
|
859
|
-
* @example
|
|
860
|
-
* export const approval = defineWaitPoint<{ message: string }, { approved: boolean }>("approval");
|
|
861
|
-
*
|
|
862
|
-
* await approval.wait({ message: "Please approve" });
|
|
863
|
-
*/
|
|
864
|
-
declare function defineWaitPoint<Payload = undefined, Result = undefined>(key: string): WaitPointDef<Payload, Result>;
|
|
865
|
-
/**
|
|
866
|
-
* Define a group of typed wait points for human-in-the-loop workflows.
|
|
867
|
-
* Property names become the wait point keys.
|
|
868
|
-
*
|
|
869
|
-
* The return type is the same as the builder's return type, so JSDoc on each
|
|
870
|
-
* property is preserved and visible in IDE autocompletion.
|
|
871
|
-
*
|
|
872
|
-
* `Payload` and `Result` must be JsonValue-compatible.
|
|
873
|
-
* Functions and objects with a `toJSON` method are rejected at the type level;
|
|
874
|
-
* class instances exposing methods are rejected via the property walk.
|
|
875
|
-
* @param builder - Callback that receives a `define` factory and returns an object of wait points
|
|
876
|
-
* @returns The same object returned by the builder (with correct keys set on each instance)
|
|
877
|
-
* @example
|
|
878
|
-
* export const waitPoints = defineWaitPoints(define => ({
|
|
879
|
-
* // Preceding JSDoc on this property is shown in IDE autocompletion
|
|
880
|
-
* approval: define<{ message: string }, { approved: boolean }>(),
|
|
881
|
-
* }));
|
|
882
|
-
*
|
|
883
|
-
* // IDE shows the JSDoc when typing `waitPoints.`
|
|
884
|
-
* await waitPoints.approval.wait({ message: "Please approve" });
|
|
885
|
-
*
|
|
886
|
-
* // For 2-level access, use destructured export with JSDoc attached to the export itself.
|
|
887
|
-
*/
|
|
888
|
-
declare function defineWaitPoints<T extends Record<string, WaitPointInstance<any, any>>>(builder: (define: DefineFn) => T): T;
|
|
889
|
-
//#endregion
|
|
890
|
-
//#region src/configure/services/staticwebsite/index.d.ts
|
|
891
|
-
/**
|
|
892
|
-
* Define a static website configuration for the Tailor SDK.
|
|
893
|
-
* @param name - Static website name
|
|
894
|
-
* @param config - Static website configuration
|
|
895
|
-
* @returns Defined static website
|
|
896
|
-
*/
|
|
897
|
-
declare function defineStaticWebSite(name: string, config: Omit<StaticWebsiteInput, "name">): {
|
|
898
|
-
readonly name: string;
|
|
899
|
-
readonly url: `${string}:url`;
|
|
900
|
-
readonly description?: string | undefined;
|
|
901
|
-
readonly allowedIpAddresses?: string[] | undefined;
|
|
902
|
-
readonly customDomains?: string[] | undefined;
|
|
903
|
-
} & StaticWebsiteDefinitionBrand;
|
|
904
|
-
//#endregion
|
|
905
|
-
//#region src/configure/services/aigateway/index.d.ts
|
|
906
|
-
/**
|
|
907
|
-
* Define an AI Gateway configuration for the Tailor SDK.
|
|
908
|
-
* @param name - AI Gateway name
|
|
909
|
-
* @param config - AI Gateway configuration
|
|
910
|
-
* @returns Defined AI Gateway
|
|
911
|
-
*/
|
|
912
|
-
declare function defineAIGateway(name: string, config: Omit<AIGatewayInput, "name">): {
|
|
913
|
-
readonly name: string;
|
|
914
|
-
readonly cors?: string[] | undefined;
|
|
915
|
-
readonly authNamespace: string;
|
|
916
|
-
} & AIGatewayDefinitionBrand;
|
|
917
|
-
//#endregion
|
|
918
|
-
//#region src/parser/service/idp/types.d.ts
|
|
919
|
-
type IdPUserField = "id" | "name" | "disabled";
|
|
920
|
-
//#endregion
|
|
921
|
-
//#region src/configure/services/idp/permission.d.ts
|
|
922
|
-
type EqualityOperator = "=" | "!=";
|
|
923
|
-
type ContainsOperator = "in" | "not in";
|
|
924
|
-
type StringFieldKeys<User extends object> = { [K in keyof User]: User[K] extends string ? K : never }[keyof User];
|
|
925
|
-
type StringArrayFieldKeys<User extends object> = { [K in keyof User]: User[K] extends string[] ? K : never }[keyof User];
|
|
926
|
-
type BooleanFieldKeys<User extends object> = { [K in keyof User]: User[K] extends boolean ? K : never }[keyof User];
|
|
927
|
-
type BooleanArrayFieldKeys<User extends object> = { [K in keyof User]: User[K] extends boolean[] ? K : never }[keyof User];
|
|
928
|
-
type UserStringOperand<User extends object = InferredAttributeMap> = {
|
|
929
|
-
user: StringFieldKeys<User> | "id";
|
|
930
|
-
};
|
|
931
|
-
type UserStringArrayOperand<User extends object = InferredAttributeMap> = {
|
|
932
|
-
user: StringArrayFieldKeys<User>;
|
|
933
|
-
};
|
|
934
|
-
type UserBooleanOperand<User extends object = InferredAttributeMap> = {
|
|
935
|
-
user: BooleanFieldKeys<User> | "_loggedIn";
|
|
936
|
-
};
|
|
937
|
-
type UserBooleanArrayOperand<User extends object = InferredAttributeMap> = {
|
|
938
|
-
user: BooleanArrayFieldKeys<User>;
|
|
939
|
-
};
|
|
940
|
-
type IdPUserOperand<Update extends boolean = false> = Update extends true ? {
|
|
941
|
-
oldIdpUser: IdPUserField;
|
|
942
|
-
} | {
|
|
943
|
-
newIdpUser: IdPUserField;
|
|
944
|
-
} : {
|
|
945
|
-
idpUser: IdPUserField;
|
|
946
|
-
};
|
|
947
|
-
type StringEqualityCondition<User extends object, Update extends boolean> = readonly [string, EqualityOperator, string] | readonly [UserStringOperand<User>, EqualityOperator, string] | readonly [string, EqualityOperator, UserStringOperand<User>] | readonly [IdPUserOperand<Update>, EqualityOperator, string | UserStringOperand<User> | IdPUserOperand<Update>] | readonly [string | UserStringOperand<User>, EqualityOperator, IdPUserOperand<Update>];
|
|
948
|
-
type BooleanEqualityCondition<User extends object, Update extends boolean> = readonly [boolean, EqualityOperator, boolean] | readonly [UserBooleanOperand<User>, EqualityOperator, boolean] | readonly [boolean, EqualityOperator, UserBooleanOperand<User>] | readonly [IdPUserOperand<Update>, EqualityOperator, boolean | UserBooleanOperand<User> | IdPUserOperand<Update>] | readonly [boolean | UserBooleanOperand<User>, EqualityOperator, IdPUserOperand<Update>];
|
|
949
|
-
type EqualityCondition<User extends object = InferredAttributeMap, Update extends boolean = boolean> = StringEqualityCondition<User, Update> | BooleanEqualityCondition<User, Update>;
|
|
950
|
-
type StringContainsCondition<User extends object, Update extends boolean> = readonly [string, ContainsOperator, string[]] | readonly [UserStringOperand<User>, ContainsOperator, string[]] | readonly [string, ContainsOperator, UserStringArrayOperand<User>] | readonly [IdPUserOperand<Update>, ContainsOperator, string[] | UserStringArrayOperand<User>];
|
|
951
|
-
type BooleanContainsCondition<User extends object, Update extends boolean> = readonly [boolean, ContainsOperator, boolean[]] | readonly [UserBooleanOperand<User>, ContainsOperator, boolean[]] | readonly [boolean, ContainsOperator, UserBooleanArrayOperand<User>] | readonly [IdPUserOperand<Update>, ContainsOperator, boolean[] | UserBooleanArrayOperand<User>];
|
|
952
|
-
type ContainsCondition<User extends object = InferredAttributeMap, Update extends boolean = boolean> = StringContainsCondition<User, Update> | BooleanContainsCondition<User, Update>;
|
|
953
|
-
type IdPPermissionCondition<User extends object = InferredAttributeMap, Update extends boolean = boolean> = EqualityCondition<User, Update> | ContainsCondition<User, Update>;
|
|
954
|
-
type IdPActionPermission<User extends object = InferredAttributeMap, Update extends boolean = boolean> = {
|
|
955
|
-
conditions: IdPPermissionCondition<User, Update> | readonly IdPPermissionCondition<User, Update>[];
|
|
956
|
-
description?: string | undefined;
|
|
957
|
-
/**
|
|
958
|
-
* Whether matching users are granted (`true`) or denied (`false`).
|
|
959
|
-
* Omitting `permit` in this object form defaults to `deny` and emits a
|
|
960
|
-
* warning; set it explicitly. (The array shorthand defaults to `allow`.)
|
|
961
|
-
*/
|
|
962
|
-
permit?: boolean;
|
|
963
|
-
} | readonly [...IdPPermissionCondition<User, Update>, ...([] | [boolean])] | readonly [...IdPPermissionCondition<User, Update>[], ...([] | [boolean])];
|
|
964
|
-
/**
|
|
965
|
-
* Per-operation permission policies for an IdP service.
|
|
966
|
-
* Defines create, read, update, delete, sendPasswordResetEmail, and
|
|
967
|
-
* unenrollMfa permissions.
|
|
968
|
-
*
|
|
969
|
-
* For update operations, use `newIdpUser`/`oldIdpUser` operands instead of `idpUser`.
|
|
970
|
-
* @example
|
|
971
|
-
* const permission: IdPPermission = {
|
|
972
|
-
* create: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
|
|
973
|
-
* read: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
|
|
974
|
-
* update: [{ conditions: [[{ newIdpUser: "name" }, "=", { user: "id" }]], permit: true }],
|
|
975
|
-
* delete: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
|
|
976
|
-
* sendPasswordResetEmail: [{ conditions: [], permit: true }],
|
|
977
|
-
* unenrollMfa: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
|
|
978
|
-
* };
|
|
979
|
-
*/
|
|
980
|
-
type IdPPermission<User extends object = InferredAttributeMap> = {
|
|
981
|
-
create: readonly IdPActionPermission<User, false>[];
|
|
982
|
-
read: readonly IdPActionPermission<User, false>[];
|
|
983
|
-
update: readonly IdPActionPermission<User, true>[];
|
|
984
|
-
delete: readonly IdPActionPermission<User, false>[];
|
|
985
|
-
sendPasswordResetEmail?: readonly IdPActionPermission<User, false>[];
|
|
986
|
-
unenrollMfa?: readonly IdPActionPermission<User, false>[];
|
|
987
|
-
};
|
|
988
|
-
/**
|
|
989
|
-
* Grants full IdP permission access without any conditions.
|
|
990
|
-
*
|
|
991
|
-
* Unsafe and intended only for local development, prototyping, or tests.
|
|
992
|
-
* Do not use this in production environments, as it effectively disables
|
|
993
|
-
* authorization checks.
|
|
994
|
-
*/
|
|
995
|
-
declare const unsafeAllowAllIdPPermission: IdPPermission;
|
|
996
|
-
//#endregion
|
|
997
|
-
//#region src/configure/services/idp/index.d.ts
|
|
998
|
-
/**
|
|
999
|
-
* Define an IdP service configuration for the Tailor SDK.
|
|
1000
|
-
* @template TClients
|
|
1001
|
-
* @param name - IdP service name
|
|
1002
|
-
* @param config - IdP configuration
|
|
1003
|
-
* @returns Defined IdP service
|
|
1004
|
-
*/
|
|
1005
|
-
declare function defineIdp<const TClients extends string[]>(name: string, config: Omit<IdPInput, "name" | "clients" | "permission"> & {
|
|
1006
|
-
clients: TClients;
|
|
1007
|
-
permission?: IdPPermission;
|
|
1008
|
-
}): {
|
|
1009
|
-
readonly name: string;
|
|
1010
|
-
readonly provider: (providerName: string, clientName: TClients[number]) => {
|
|
1011
|
-
readonly name: string;
|
|
1012
|
-
readonly kind: "BuiltInIdP";
|
|
1013
|
-
readonly namespace: string;
|
|
1014
|
-
readonly clientName: TClients[number];
|
|
1015
|
-
};
|
|
1016
|
-
readonly authorization?: "insecure" | "loggedIn" | {
|
|
1017
|
-
cel: string;
|
|
1018
|
-
} | undefined;
|
|
1019
|
-
readonly lang?: "en" | "ja" | undefined;
|
|
1020
|
-
readonly userAuthPolicy?: {
|
|
1021
|
-
useNonEmailIdentifier?: boolean | undefined;
|
|
1022
|
-
allowSelfPasswordReset?: boolean | undefined;
|
|
1023
|
-
passwordRequireUppercase?: boolean | undefined;
|
|
1024
|
-
passwordRequireLowercase?: boolean | undefined;
|
|
1025
|
-
passwordRequireNonAlphanumeric?: boolean | undefined;
|
|
1026
|
-
passwordRequireNumeric?: boolean | undefined;
|
|
1027
|
-
passwordMinLength?: number | undefined;
|
|
1028
|
-
passwordMaxLength?: number | undefined;
|
|
1029
|
-
allowedEmailDomains?: string[] | undefined;
|
|
1030
|
-
allowGoogleOauth?: boolean | undefined;
|
|
1031
|
-
allowMicrosoftOauth?: boolean | undefined;
|
|
1032
|
-
disablePasswordAuth?: boolean | undefined;
|
|
1033
|
-
enableMfa?: boolean | undefined;
|
|
1034
|
-
requireMfa?: boolean | undefined;
|
|
1035
|
-
allowedReturnOrigins?: string[] | undefined;
|
|
1036
|
-
mfaIssuer?: string | undefined;
|
|
1037
|
-
} | undefined;
|
|
1038
|
-
readonly publishUserEvents?: boolean | undefined;
|
|
1039
|
-
readonly gqlOperations?: "query" | {
|
|
1040
|
-
create?: boolean | undefined;
|
|
1041
|
-
update?: boolean | undefined;
|
|
1042
|
-
delete?: boolean | undefined;
|
|
1043
|
-
read?: boolean | undefined;
|
|
1044
|
-
sendPasswordResetEmail?: boolean | undefined;
|
|
1045
|
-
requestMfaSettingsUrl?: boolean | undefined;
|
|
1046
|
-
unenrollMfa?: boolean | undefined;
|
|
1047
|
-
} | undefined;
|
|
1048
|
-
readonly emailConfig?: {
|
|
1049
|
-
fromName?: string | undefined;
|
|
1050
|
-
passwordResetSubject?: string | undefined;
|
|
1051
|
-
} | undefined;
|
|
1052
|
-
readonly clients: TClients;
|
|
1053
|
-
readonly permission?: IdPPermission;
|
|
1054
|
-
} & IdpDefinitionBrand;
|
|
1055
|
-
//#endregion
|
|
1056
|
-
//#region src/configure/services/secrets/index.d.ts
|
|
1057
|
-
type SecretsVaultInput = Record<string, string>;
|
|
1058
|
-
type SecretsVaultInputNullish = Record<string, string | undefined | null>;
|
|
1059
|
-
type SecretsInput = Record<string, SecretsVaultInput>;
|
|
1060
|
-
type SecretsInputNullish = Record<string, SecretsVaultInputNullish>;
|
|
1061
|
-
type SecretsOptions = {
|
|
1062
|
-
readonly ignoreNullishValues: boolean;
|
|
1063
|
-
};
|
|
1064
|
-
type DefinedSecrets<T extends SecretsInputNullish> = {
|
|
1065
|
-
readonly vaults: T;
|
|
1066
|
-
readonly options: SecretsOptions;
|
|
1067
|
-
get<V extends Extract<keyof T, string>, S extends Extract<keyof T[V], string>>(vault: V, secret: S): Promise<string | undefined>;
|
|
1068
|
-
getAll<V extends Extract<keyof T, string>, S extends Extract<keyof T[V], string>>(vault: V, secrets: readonly S[]): Promise<(string | undefined)[]>;
|
|
1069
|
-
} & SecretsDefinitionBrand;
|
|
1070
|
-
/**
|
|
1071
|
-
* Define secrets configuration for the Tailor SDK.
|
|
1072
|
-
* Each key is a vault name, and its value is a record of secret name to secret value.
|
|
1073
|
-
* @param config - Secrets configuration mapping vault names to their secrets
|
|
1074
|
-
* @returns Defined secrets with typed runtime access methods
|
|
1075
|
-
*/
|
|
1076
|
-
declare function defineSecretManager<const T extends SecretsInput>(config: T): DefinedSecrets<T>;
|
|
1077
|
-
/**
|
|
1078
|
-
* Define secrets configuration for the Tailor SDK with ignoreNullishValues option.
|
|
1079
|
-
* When `ignoreNullishValues` is true, secrets with nullish values are skipped during deploy
|
|
1080
|
-
* instead of causing an error. This is useful for CI environments where not all
|
|
1081
|
-
* secret values are available.
|
|
1082
|
-
* @param config - Secrets configuration mapping vault names to their secrets
|
|
1083
|
-
* @param options - Options for secret management behavior
|
|
1084
|
-
* @param options.ignoreNullishValues - When true, secrets with nullish values are skipped during deploy
|
|
1085
|
-
* @returns Defined secrets with typed runtime access methods
|
|
1086
|
-
*/
|
|
1087
|
-
declare function defineSecretManager<const T extends SecretsInputNullish>(config: T, options: {
|
|
1088
|
-
ignoreNullishValues: true;
|
|
1089
|
-
}): DefinedSecrets<T>;
|
|
1090
|
-
//#endregion
|
|
1091
|
-
//#region src/configure/services/http-adapter/http-adapter.d.ts
|
|
1092
|
-
/**
|
|
1093
|
-
* Lowercase HTTP method keys accepted in `input`, derived from the config
|
|
1094
|
-
* schema via the generated type so they cannot drift.
|
|
1095
|
-
*/
|
|
1096
|
-
type HttpMethodKey = keyof Required<HttpAdapterConfigInput["input"]>;
|
|
1097
|
-
/** Incoming HTTP request passed to an `input` handler. */
|
|
1098
|
-
type HttpAdapterRequest = {
|
|
1099
|
-
method: Uppercase<HttpMethodKey>;
|
|
1100
|
-
path: string;
|
|
1101
|
-
headers: Record<string, string>;
|
|
1102
|
-
query: Record<string, string>;
|
|
1103
|
-
body: string;
|
|
1104
|
-
};
|
|
1105
|
-
/** GraphQL request returned by an `input` handler. */
|
|
1106
|
-
type HttpAdapterGraphQLRequest<Query extends HttpAdapterGraphQLQuery = string> = {
|
|
1107
|
-
query: Query;
|
|
1108
|
-
operationName?: string;
|
|
1109
|
-
} & HttpAdapterGraphQLRequestVariables<Query>;
|
|
1110
|
-
/**
|
|
1111
|
-
* Typed GraphQL document accepted by an HTTP adapter input handler.
|
|
1112
|
-
* Compatible with generated `TypedDocumentNode` values.
|
|
1113
|
-
*/
|
|
1114
|
-
type HttpAdapterTypedDocumentNode<TResult = unknown, TVariables = Record<string, unknown>> = DocumentNode & {
|
|
1115
|
-
__apiType?: (variables: TVariables) => TResult;
|
|
1116
|
-
__ensureTypesOfVariablesAndResultMatching?: (variables: TVariables) => TResult;
|
|
1117
|
-
};
|
|
1118
|
-
/** GraphQL query value accepted by an HTTP adapter input handler. */
|
|
1119
|
-
type HttpAdapterGraphQLQuery = string | DocumentNode;
|
|
1120
|
-
type HttpAdapterGraphQLData<Query> = Query extends HttpAdapterTypedDocumentNode<infer Result, infer _Variables> ? Result : unknown;
|
|
1121
|
-
type HttpAdapterGraphQLVariables<Query> = Query extends HttpAdapterTypedDocumentNode<infer _Result, infer Variables> ? Variables : Record<string, unknown>;
|
|
1122
|
-
type HttpAdapterHasRequiredVariables<T> = [T] extends [never] ? false : T extends object ? Record<never, never> extends T ? false : true : false;
|
|
1123
|
-
type HttpAdapterGraphQLRequestVariables<Query> = true extends HttpAdapterHasRequiredVariables<HttpAdapterGraphQLVariables<Query>> ? {
|
|
1124
|
-
variables: HttpAdapterGraphQLVariables<Query>;
|
|
1125
|
-
} : {
|
|
1126
|
-
variables?: HttpAdapterGraphQLVariables<Query>;
|
|
1127
|
-
};
|
|
1128
|
-
/**
|
|
1129
|
-
* Converts an incoming HTTP request into a GraphQL request.
|
|
1130
|
-
* Pass a typed document type as `Query` when annotating extracted handlers.
|
|
1131
|
-
*/
|
|
1132
|
-
type HttpAdapterInputFn<Query extends HttpAdapterGraphQLQuery = string> = (req: HttpAdapterRequest) => HttpAdapterGraphQLRequest<Query>;
|
|
1133
|
-
/** GraphQL execution result passed to the `output` handler. */
|
|
1134
|
-
type HttpAdapterGraphQLResponse<Data = unknown> = {
|
|
1135
|
-
data?: Data | null;
|
|
1136
|
-
errors?: unknown;
|
|
1137
|
-
extensions?: unknown;
|
|
1138
|
-
};
|
|
1139
|
-
/** HTTP response returned by the `output` handler. */
|
|
1140
|
-
type HttpAdapterResponse = {
|
|
1141
|
-
statusCode?: number;
|
|
1142
|
-
headers?: Record<string, string>;
|
|
1143
|
-
body: string;
|
|
1144
|
-
};
|
|
1145
|
-
/** Converts a GraphQL response into an HTTP response. */
|
|
1146
|
-
type HttpAdapterOutputFn<Data = unknown> = (resp: HttpAdapterGraphQLResponse<Data>) => HttpAdapterResponse;
|
|
1147
|
-
/**
|
|
1148
|
-
* Per-method input handlers. At least one method must be provided.
|
|
1149
|
-
* Each handler transforms an HTTP request into a GraphQL request.
|
|
1150
|
-
*/
|
|
1151
|
-
type HttpAdapterInput = Partial<Record<HttpMethodKey, HttpAdapterInputFn<HttpAdapterGraphQLQuery>>>;
|
|
1152
|
-
type HttpAdapterInputHandlerData<Handler> = Handler extends ((req: HttpAdapterRequest) => infer Request) ? Request extends {
|
|
1153
|
-
query: infer Query;
|
|
1154
|
-
} ? HttpAdapterGraphQLData<Query> : unknown : never;
|
|
1155
|
-
type HttpAdapterInputData<Input extends HttpAdapterInput> = [HttpAdapterInputHandlerData<Input[keyof Input]>] extends [never] ? unknown : HttpAdapterInputHandlerData<Input[keyof Input]>;
|
|
1156
|
-
type HttpAdapterValidatedRequest<Request> = Request extends {
|
|
1157
|
-
query: infer Query extends HttpAdapterGraphQLQuery;
|
|
1158
|
-
} ? Request & HttpAdapterGraphQLRequest<Query> : never;
|
|
1159
|
-
type HttpAdapterValidatedInput<Input extends HttpAdapterInput> = { [Method in keyof Input]: Input[Method] extends ((req: HttpAdapterRequest) => infer Request) ? (req: HttpAdapterRequest) => HttpAdapterValidatedRequest<Request> : Input[Method] };
|
|
1160
|
-
/**
|
|
1161
|
-
* HTTP adapter configuration accepted by `createHttpAdapter` with typed
|
|
1162
|
-
* `input` and `output` signatures.
|
|
1163
|
-
*/
|
|
1164
|
-
type HttpAdapter<Input extends HttpAdapterInput = HttpAdapterInput> = Omit<HttpAdapterConfigInput, "input" | "output"> & {
|
|
1165
|
-
input: Input & HttpAdapterValidatedInput<Input>;
|
|
1166
|
-
output?: HttpAdapterOutputFn<HttpAdapterInputData<Input>>;
|
|
1167
|
-
};
|
|
1168
|
-
/**
|
|
1169
|
-
* Defines an HTTP adapter that translates HTTP requests to GraphQL queries
|
|
1170
|
-
* and shapes the GraphQL response back into an HTTP response.
|
|
1171
|
-
*
|
|
1172
|
-
* The adapter MUST be the default export of its file.
|
|
1173
|
-
* Files are discovered via the `httpAdapter.files` glob in `defineConfig()`.
|
|
1174
|
-
*
|
|
1175
|
-
* `input` is an object keyed by lowercase HTTP method (`get`, `post`, `put`,
|
|
1176
|
-
* `patch`, `delete`). Each handler can return a GraphQL query string or a
|
|
1177
|
-
* typed document node. At least one method must be declared; the methods the
|
|
1178
|
-
* adapter serves are derived from these keys.
|
|
1179
|
-
*
|
|
1180
|
-
* `output` is optional and shared across all methods. If `input` returns typed
|
|
1181
|
-
* document nodes, `output` receives the corresponding result type as
|
|
1182
|
-
* `resp.data`. If you need different response shapes per method, discriminate
|
|
1183
|
-
* inside `output` based on the GraphQL response shape.
|
|
1184
|
-
*
|
|
1185
|
-
* Each handler runs server-side and must be synchronous: Node APIs, `fetch`,
|
|
1186
|
-
* `async`/`await`, Promises, and top-level `await` are not available.
|
|
1187
|
-
*
|
|
1188
|
-
* Optional fields: `enabled` (default `true`; set `false` to deploy the adapter
|
|
1189
|
-
* without serving it) and `priority` (non-negative integer, default `0`; when
|
|
1190
|
-
* multiple adapters match the same request path, the lowest value wins).
|
|
1191
|
-
* @param config - HTTP adapter configuration
|
|
1192
|
-
* @returns Branded HTTP adapter definition
|
|
1193
|
-
* @example
|
|
1194
|
-
* export default createHttpAdapter({
|
|
1195
|
-
* name: "get-user",
|
|
1196
|
-
* pathPattern: "/users/*",
|
|
1197
|
-
* input: {
|
|
1198
|
-
* get: (req) => ({
|
|
1199
|
-
* query: `query($id: ID!) { user(id: $id) { id name } }`,
|
|
1200
|
-
* variables: { id: req.path.split("/")[2] },
|
|
1201
|
-
* }),
|
|
1202
|
-
* },
|
|
1203
|
-
* output: (resp) => ({
|
|
1204
|
-
* statusCode: 200,
|
|
1205
|
-
* headers: { "content-type": "application/json" },
|
|
1206
|
-
* body: JSON.stringify(resp.data),
|
|
1207
|
-
* }),
|
|
1208
|
-
* });
|
|
1209
|
-
*/
|
|
1210
|
-
declare function createHttpAdapter<const Input extends HttpAdapterInput>(config: HttpAdapter<Input>): HttpAdapter<Input>;
|
|
1211
|
-
//#endregion
|
|
1212
|
-
//#region src/configure/config/index.d.ts
|
|
1213
|
-
/**
|
|
1214
|
-
* Define a Tailor SDK application configuration with shallow exactness.
|
|
1215
|
-
* @template Config
|
|
1216
|
-
* @param config - Application configuration
|
|
1217
|
-
* @returns The same configuration object
|
|
1218
|
-
*/
|
|
1219
|
-
declare function defineConfig<const Config extends AppConfig & Record<Exclude<keyof Config, keyof AppConfig>, never>>(config: Config): Config;
|
|
1220
|
-
/**
|
|
1221
|
-
* Define generators to be used with the Tailor SDK.
|
|
1222
|
-
* @deprecated Use definePlugins() with generation hooks (onTypeLoaded, generate, etc.) instead.
|
|
1223
|
-
* @param configs - Generator configurations
|
|
1224
|
-
* @returns Generator configurations as given
|
|
1225
|
-
*/
|
|
1226
|
-
declare function defineGenerators(...configs: GeneratorConfig[]): BaseGeneratorConfig[];
|
|
1227
|
-
/**
|
|
1228
|
-
* Define plugins to be used with the Tailor SDK.
|
|
1229
|
-
* Plugins can generate additional types, resolvers, and executors
|
|
1230
|
-
* based on existing TailorDB types.
|
|
1231
|
-
* @param configs - Plugin configurations
|
|
1232
|
-
* @returns Plugin configurations as given
|
|
1233
|
-
*/
|
|
1234
|
-
declare function definePlugins(...configs: Plugin<any, any>[]): Plugin<any, any>[];
|
|
1235
|
-
//#endregion
|
|
1236
|
-
//#region src/configure/index.d.ts
|
|
1237
|
-
type TailorOutput<T> = output$1<T>;
|
|
1238
|
-
type infer<T> = TailorOutput<T>;
|
|
1239
|
-
type output<T> = TailorOutput<T>;
|
|
1240
|
-
/** TailorDB field type builders. */
|
|
1241
|
-
declare const t: {
|
|
1242
|
-
uuid: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1243
|
-
type: "uuid";
|
|
1244
|
-
array: Opt extends {
|
|
1245
|
-
array: true;
|
|
1246
|
-
} ? true : false;
|
|
1247
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata, TailorFieldType>;
|
|
1248
|
-
string: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1249
|
-
type: "string";
|
|
1250
|
-
array: Opt extends {
|
|
1251
|
-
array: true;
|
|
1252
|
-
} ? true : false;
|
|
1253
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata, TailorFieldType>;
|
|
1254
|
-
bool: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1255
|
-
type: "boolean";
|
|
1256
|
-
array: Opt extends {
|
|
1257
|
-
array: true;
|
|
1258
|
-
} ? true : false;
|
|
1259
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<boolean, Opt> | null : ArrayFieldOutput<boolean, Opt>, FieldMetadata, TailorFieldType>;
|
|
1260
|
-
int: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1261
|
-
type: "integer";
|
|
1262
|
-
array: Opt extends {
|
|
1263
|
-
array: true;
|
|
1264
|
-
} ? true : false;
|
|
1265
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>, FieldMetadata, TailorFieldType>;
|
|
1266
|
-
float: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1267
|
-
type: "float";
|
|
1268
|
-
array: Opt extends {
|
|
1269
|
-
array: true;
|
|
1270
|
-
} ? true : false;
|
|
1271
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>, FieldMetadata, TailorFieldType>;
|
|
1272
|
-
decimal: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1273
|
-
type: "decimal";
|
|
1274
|
-
array: Opt extends {
|
|
1275
|
-
array: true;
|
|
1276
|
-
} ? true : false;
|
|
1277
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata, TailorFieldType>;
|
|
1278
|
-
date: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1279
|
-
type: "date";
|
|
1280
|
-
array: Opt extends {
|
|
1281
|
-
array: true;
|
|
1282
|
-
} ? true : false;
|
|
1283
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata, TailorFieldType>;
|
|
1284
|
-
datetime: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1285
|
-
type: "datetime";
|
|
1286
|
-
array: Opt extends {
|
|
1287
|
-
array: true;
|
|
1288
|
-
} ? true : false;
|
|
1289
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<string | Date, Opt> | null : ArrayFieldOutput<string | Date, Opt>, FieldMetadata, TailorFieldType>;
|
|
1290
|
-
time: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
1291
|
-
type: "time";
|
|
1292
|
-
array: Opt extends {
|
|
1293
|
-
array: true;
|
|
1294
|
-
} ? true : false;
|
|
1295
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata, TailorFieldType>;
|
|
1296
|
-
enum: <const V extends AllowedValues, const Opt extends FieldOptions>(values: V, options?: Opt) => TailorField<{
|
|
1297
|
-
type: "enum";
|
|
1298
|
-
array: Opt extends {
|
|
1299
|
-
array: true;
|
|
1300
|
-
} ? true : false;
|
|
1301
|
-
}, FieldOutput<AllowedValuesOutput<V>, Opt>>;
|
|
1302
|
-
object: <const F extends Record<string, TailorAnyField>, const Opt extends FieldOptions>(fields: F, options?: Opt) => TailorField<{
|
|
1303
|
-
type: "nested";
|
|
1304
|
-
array: Opt extends {
|
|
1305
|
-
array: true;
|
|
1306
|
-
} ? true : false;
|
|
1307
|
-
}, FieldOutput<InferFieldsOutput<F>, Opt>, FieldMetadata, TailorFieldType>;
|
|
1308
|
-
};
|
|
1309
|
-
declare namespace t {
|
|
1310
|
-
type output<T> = TailorOutput<T>;
|
|
1311
|
-
type infer<T> = TailorOutput<T>;
|
|
1312
|
-
}
|
|
1313
|
-
//#endregion
|
|
1314
|
-
export { ResolverExecutedArgs as $, IncomingWebhookArgs as A, defineAuth as At, AuthAccessTokenArgs as B, defineAIGateway as C, WorkflowJob as Ct, defineWaitPoints as D, QueryType as Dt, defineWaitPoint as E, WORKFLOW_TEST_ENV_KEY as Et, IncomingWebhookTriggerOptions as F, unauthenticatedTailorUser as Ft, IdpUserArgs as G, AuthAccessTokenRefreshedArgs as H, incomingWebhookTrigger as I, MachineUserName as It, IdpUserTrigger as J, IdpUserCreatedArgs as K, ScheduleArgs as L, MachineUserNameRegistry as Lt, IncomingWebhookResponse as M, ConnectionNameRegistry as Mt, IncomingWebhookResponseConfig as N, IdpName as Nt, createExecutor as O, createResolver as Ot, IncomingWebhookTrigger as P, IdpNameRegistry as Pt, RecordUpdatedArgs as Q, ScheduleTrigger as R, TailorField as Rt, unsafeAllowAllIdPPermission as S, createWorkflow as St, WaitPointInstance as T, createWorkflowJob as Tt, AuthAccessTokenRevokedArgs as U, AuthAccessTokenIssuedArgs as V, AuthAccessTokenTrigger as W, RecordCreatedArgs as X, IdpUserUpdatedArgs as Y, RecordDeletedArgs as Z, createHttpAdapter as _, Operation as _t, defineGenerators as a, authAccessTokenTrigger as at, IdPPermission as b, Workflow as bt, HttpAdapterGraphQLQuery as c, idpUserTrigger as ct, HttpAdapterInput as d, recordDeletedTrigger as dt, ResolverExecutedTrigger as et, HttpAdapterInputFn as f, recordTrigger as ft, HttpAdapterTypedDocumentNode as g, GqlOperation as gt, HttpAdapterResponse as h, FunctionOperation as ht, defineConfig as i, authAccessTokenRevokedTrigger as it, IncomingWebhookRequest as j, ConnectionName as jt, Trigger as k, AuthInvoker as kt, HttpAdapterGraphQLRequest as l, idpUserUpdatedTrigger as lt, HttpAdapterRequest as m, resolverExecutedTrigger as mt, output as n, authAccessTokenIssuedTrigger as nt, definePlugins as o, idpUserCreatedTrigger as ot, HttpAdapterOutputFn as p, recordUpdatedTrigger as pt, IdpUserDeletedArgs as q, t as r, authAccessTokenRefreshedTrigger as rt, HttpAdapter as s, idpUserDeletedTrigger as st, infer as t, TailorDBTrigger as tt, HttpAdapterGraphQLResponse as u, recordCreatedTrigger as ut, defineSecretManager as v, WebhookOperation as vt, defineStaticWebSite as w, WorkflowJobContext as wt, IdPPermissionCondition as x, WorkflowConfig as xt, defineIdp as y, WorkflowOperation as yt, scheduleTrigger as z };
|
|
1315
|
-
//# sourceMappingURL=index-BzGqTY5x.d.mts.map
|