@tailor-platform/sdk 2.0.0-next.2 → 2.0.0-next.4
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 +511 -10
- package/README.md +9 -9
- package/agent-skills/{tailor-sdk → tailor}/SKILL.md +3 -1
- package/dist/aigateway-DR4Kwuik.mjs +9 -0
- package/dist/aigateway-DR4Kwuik.mjs.map +1 -0
- package/dist/application-BO4ZF8wP.mjs +3 -0
- package/dist/application-BX13RArL.mjs +6669 -0
- package/dist/application-BX13RArL.mjs.map +1 -0
- package/dist/authconnection-CZvi9ANm.mjs +9 -0
- package/dist/authconnection-CZvi9ANm.mjs.map +1 -0
- package/dist/brand-Eo4pLXPJ.mjs.map +1 -1
- package/dist/cli/cache/bundle-cache.d.mts +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/apply-phases.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-execution-policy.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 +11 -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 +98 -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 +61 -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/erd-viewer-assets/app.js +279 -36
- package/dist/cli/erd-viewer-assets/index.html +4 -0
- package/dist/cli/erd-viewer-assets/styles.css +252 -5
- package/dist/cli/index.d.mts +18 -3
- package/dist/cli/index.mjs +2237 -520
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +81 -21107
- package/dist/cli/lib.mjs +7 -10
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/query/index.d.mts +39 -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 +26 -0
- package/dist/cli/shared/context.d.mts +28 -0
- package/dist/cli/shared/script-executor.d.mts +75 -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/ts-hook.d.mts +4 -0
- package/dist/cli/ts-hook.mjs +333 -0
- package/dist/completion/zsh-worker.zsh +1531 -1131
- package/dist/configure/config/index.d.mts +21 -0
- package/dist/configure/config/types.d.mts +105 -0
- package/dist/configure/index.d.mts +124 -9
- package/dist/configure/index.mjs +136 -23
- 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 +34 -0
- package/dist/configure/services/auth/types.d.mts +172 -0
- package/dist/configure/services/executor/executor.d.mts +81 -0
- package/dist/configure/services/executor/index.d.mts +8 -0
- package/dist/configure/services/executor/operation.d.mts +45 -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 +34 -0
- package/dist/configure/services/resolver/index.d.mts +5 -0
- package/dist/configure/services/resolver/resolver.d.mts +75 -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 +456 -0
- package/dist/configure/services/tailordb/types.d.mts +149 -0
- package/dist/configure/services/workflow/execution-policy.d.mts +71 -0
- package/dist/configure/services/workflow/execution-policy.types.d.mts +104 -0
- package/dist/configure/services/workflow/index.d.mts +8 -0
- package/dist/configure/services/workflow/job.d.mts +84 -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 +54 -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-runtime.d.mts +17 -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 +2 -0
- package/dist/configure/types/type.d.mts +82 -0
- package/dist/{context-Bd266-ru.mjs → context-DYQVYWqZ.mjs} +4 -5
- package/dist/context-DYQVYWqZ.mjs.map +1 -0
- package/dist/{crashreport-DFq-vsU0.mjs → crashreport-Cg-pqRJV.mjs} +6 -6
- package/dist/{crashreport-DFq-vsU0.mjs.map → crashreport-Cg-pqRJV.mjs.map} +1 -1
- package/dist/{crashreport-BMWcxeSE.mjs → crashreport-D3RjuSYb.mjs} +1 -1
- package/dist/enum-constants-j9QBF0cB.mjs.map +1 -1
- package/dist/{errors-Dtf2WPaW.mjs → errors-118wUDRr.mjs} +2 -2
- package/dist/errors-118wUDRr.mjs.map +1 -0
- package/dist/field-runtime-CAnh_oow.mjs +183 -0
- package/dist/field-runtime-CAnh_oow.mjs.map +1 -0
- package/dist/{file-BbdFGdMV.mjs → file-BUcmVIH2.mjs} +12 -14
- package/dist/file-BUcmVIH2.mjs.map +1 -0
- package/dist/{file-utils-CYZnO1pX.mjs → file-utils-yEiIS4nJ.mjs} +2 -2
- package/dist/file-utils-yEiIS4nJ.mjs.map +1 -0
- package/dist/{globals-Cf0sxIt8.mjs → globals-BjhJJ2dN.mjs} +5 -47
- package/dist/globals-BjhJJ2dN.mjs.map +1 -0
- package/dist/iconv-QWaZh0TT.mjs +38 -0
- package/dist/iconv-QWaZh0TT.mjs.map +1 -0
- package/dist/{idp-BDbK5gjm.mjs → idp-RA_swu-h.mjs} +12 -5
- package/dist/idp-RA_swu-h.mjs.map +1 -0
- package/dist/{interceptor-D-q1rvRl.mjs → interceptor-e33JtsC-.mjs} +2 -2
- package/dist/interceptor-e33JtsC-.mjs.map +1 -0
- package/dist/kysely/index.d.mts +2 -3
- package/dist/{kysely-type-DR8uzZTA.mjs → kysely-type-D-zflMGf.mjs} +2 -2
- package/dist/{kysely-type-DR8uzZTA.mjs.map → kysely-type-D-zflMGf.mjs.map} +1 -1
- package/dist/{logger-CxF-Ex5d.mjs → logger-BEiZZ3qT.mjs} +3 -3
- package/dist/{logger-CxF-Ex5d.mjs.map → logger-BEiZZ3qT.mjs.map} +1 -1
- 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/platform-serialize-RoRtBS0v.mjs +46 -0
- package/dist/platform-serialize-RoRtBS0v.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +16 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +16 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +16 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +45 -1
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/get-generated-type.d.mts +17 -0
- package/dist/plugin/index.d.mts +3 -118
- package/dist/plugin/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/manager.d.mts +1 -0
- package/dist/plugin/types.d.mts +243 -0
- package/dist/plugin/with-context.d.mts +102 -0
- package/dist/{runtime-CY4JvrDj.mjs → register-ts-hook-BM1caLT0.mjs} +4128 -2744
- package/dist/register-ts-hook-BM1caLT0.mjs.map +1 -0
- package/dist/{registry-DH4m7eYo.mjs → registry-BSbq6SPo.mjs} +4 -3
- package/dist/registry-BSbq6SPo.mjs.map +1 -0
- package/dist/{repl-editor-DmGr9zMw.mjs → repl-editor-BCozyiNq.mjs} +6 -5
- package/dist/{repl-editor-DmGr9zMw.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
- package/dist/resource_pb-BRv7AMXK.mjs +49 -0
- package/dist/resource_pb-BRv7AMXK.mjs.map +1 -0
- package/dist/runtime/aigateway.d.mts +26 -0
- package/dist/runtime/aigateway.mjs +3 -0
- package/dist/runtime/authconnection.d.mts +22 -2
- package/dist/runtime/authconnection.mjs +2 -2
- package/dist/runtime/context.d.mts +55 -2
- package/dist/runtime/context.mjs +2 -2
- package/dist/runtime/file.d.mts +170 -2
- package/dist/runtime/file.mjs +2 -2
- package/dist/runtime/globals.d.mts +31 -19
- package/dist/runtime/iconv.d.mts +73 -2
- package/dist/runtime/iconv.mjs +2 -2
- package/dist/runtime/idp.d.mts +129 -2
- package/dist/runtime/idp.mjs +2 -2
- package/dist/runtime/index.d.mts +47 -9
- package/dist/runtime/index.mjs +9 -8
- package/dist/runtime/secretmanager.d.mts +41 -2
- package/dist/runtime/secretmanager.mjs +2 -2
- package/dist/{types-BZ7QKVE8.d.mts → runtime/types.d.mts} +4 -5
- package/dist/runtime/workflow.d.mts +113 -2
- package/dist/runtime/workflow.mjs +2 -2
- package/dist/{schema-Dtw9Orye.mjs → schema-C4LYbXVG.mjs} +21 -186
- package/dist/schema-C4LYbXVG.mjs.map +1 -0
- package/dist/{secret-file-VSVGy1V0.mjs → secret-file-aoNXJmKa.mjs} +3 -3
- package/dist/secret-file-aoNXJmKa.mjs.map +1 -0
- package/dist/secretmanager-Bd45j7an.mjs +98 -0
- package/dist/secretmanager-Bd45j7an.mjs.map +1 -0
- package/dist/secretmanager-CYlpffsz.mjs +13 -0
- package/dist/secretmanager-CYlpffsz.mjs.map +1 -0
- package/dist/seed/index.d.mts +1 -2
- package/dist/{seed-izIEyP3z.mjs → seed-CRSQJI_z.mjs} +14 -3
- package/dist/seed-CRSQJI_z.mjs.map +1 -0
- package/dist/service-CkIwEctX.mjs +3 -0
- package/dist/{service-DU1mVzri2.mjs → service-DeZeYa06.mjs} +3 -3
- package/dist/service-DeZeYa06.mjs.map +1 -0
- package/dist/{service-DjyqbCaJ.mjs → service-ufH7sS8o.mjs} +396 -58
- package/dist/service-ufH7sS8o.mjs.map +1 -0
- package/dist/service_pb-B2FF59sP.mjs +3 -0
- package/dist/service_pb-B5w9rjPY.mjs +955 -0
- package/dist/service_pb-B5w9rjPY.mjs.map +1 -0
- 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 +862 -0
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +310 -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-CdqJEzkj.mjs → telemetry-BRVdwh14.mjs} +3 -3
- package/dist/telemetry-BRVdwh14.mjs.map +1 -0
- package/dist/telemetry-CkbkeJxl.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 +145 -0
- package/dist/types/executor.generated.d.mts +177 -0
- package/dist/types/helpers.d.mts +39 -0
- package/dist/types/http-adapter.generated.d.mts +17 -0
- package/dist/{workflow.generated-ClEjBYhm.d.mts → types/idp.generated.d.mts} +98 -185
- package/dist/types/resolver.generated.d.mts +39 -0
- package/dist/types/secrets.generated.d.mts +14 -0
- package/dist/types/staticwebsite.generated.d.mts +10 -0
- package/dist/{types-CdcQh4Z2.d.mts → types/tailordb.generated.d.mts} +2 -287
- package/dist/types/workflow.generated.d.mts +12 -0
- package/dist/types-C-lQ4se3.mjs +4 -0
- package/dist/types-CXF2OYdR.mjs +199 -0
- package/dist/types-CXF2OYdR.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +5 -89
- 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 +2 -2
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.d.mts +12 -428
- package/dist/vitest/index.mjs +740 -9
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock-kysely.d.mts +62 -0
- package/dist/vitest/mock.d.mts +9 -0
- package/dist/vitest/mocks/aigateway.d.mts +30 -0
- package/dist/vitest/mocks/authconnection.d.mts +28 -0
- package/dist/vitest/mocks/file.d.mts +41 -0
- package/dist/vitest/mocks/iconv.d.mts +27 -0
- package/dist/vitest/mocks/idp.d.mts +44 -0
- package/dist/vitest/mocks/secretmanager.d.mts +33 -0
- package/dist/vitest/mocks/tailordb.d.mts +71 -0
- package/dist/vitest/mocks/workflow.d.mts +117 -0
- package/dist/vitest/setup.d.mts +1 -2
- package/dist/vitest/setup.mjs +2 -2
- package/dist/vitest/workflow-local.d.mts +40 -0
- package/dist/workflow-GNuSnsTx.mjs +22 -0
- package/dist/workflow-GNuSnsTx.mjs.map +1 -0
- package/docs/cli/application.md +98 -250
- package/docs/cli/auth.md +51 -295
- package/docs/cli/completion.md +1 -25
- package/docs/cli/crashreport.md +3 -61
- package/docs/cli/executor.md +23 -187
- package/docs/cli/function.md +14 -130
- package/docs/cli/organization.md +11 -221
- package/docs/cli/plugin.md +29 -0
- package/docs/cli/query.md +2 -22
- package/docs/cli/secret.md +71 -251
- package/docs/cli/setup.md +137 -41
- package/docs/cli/skills.md +50 -39
- package/docs/cli/staticwebsite.md +32 -180
- package/docs/cli/tailordb.md +97 -323
- package/docs/cli/upgrade.md +2 -22
- package/docs/cli/user.md +78 -247
- package/docs/cli/workflow.md +44 -203
- package/docs/cli/workspace.md +165 -538
- package/docs/cli-reference.md +167 -67
- package/docs/configuration.md +34 -4
- package/docs/github-actions.md +46 -19
- package/docs/migration/v2.md +397 -26
- package/docs/multi-environment.md +29 -7
- package/docs/plugin/custom.md +4 -4
- package/docs/plugin/index.md +8 -8
- package/docs/quickstart.md +8 -7
- package/docs/runtime.md +9 -3
- package/docs/services/aigateway.md +18 -2
- package/docs/services/auth.md +34 -42
- package/docs/services/http-adapter.md +16 -1
- package/docs/services/idp.md +55 -2
- package/docs/services/resolver.md +2 -2
- package/docs/services/secret.md +11 -11
- package/docs/services/staticwebsite.md +8 -2
- package/docs/services/tailordb-migration.md +25 -23
- package/docs/services/tailordb.md +55 -32
- package/docs/services/workflow.md +92 -14
- package/docs/testing.md +49 -3
- package/package.json +42 -31
- package/postinstall.mjs +4 -6
- package/dist/application-Dtqap5jM.mjs +0 -3
- package/dist/application-XuMWK4eq.mjs +0 -7257
- package/dist/application-XuMWK4eq.mjs.map +0 -1
- package/dist/authconnection-D2MhtTN5.mjs +0 -15
- package/dist/authconnection-D2MhtTN5.mjs.map +0 -1
- package/dist/authconnection-DvUQAjQS.d.mts +0 -39
- package/dist/context-Bd266-ru.mjs.map +0 -1
- package/dist/context-C2lEi9uw.d.mts +0 -47
- package/dist/errors-Dtf2WPaW.mjs.map +0 -1
- package/dist/field-DOsJCPFa.mjs +0 -22
- package/dist/field-DOsJCPFa.mjs.map +0 -1
- package/dist/file-BbdFGdMV.mjs.map +0 -1
- package/dist/file-Dq3NIt_F.d.mts +0 -211
- package/dist/file-utils-CYZnO1pX.mjs.map +0 -1
- package/dist/globals-Cf0sxIt8.mjs.map +0 -1
- package/dist/http-adapter.generated-DFsXDdm5.d.mts +0 -581
- package/dist/iconv-Co-TOPuH.d.mts +0 -122
- package/dist/iconv-D2vi8G36.mjs +0 -63
- package/dist/iconv-D2vi8G36.mjs.map +0 -1
- package/dist/idp-BDbK5gjm.mjs.map +0 -1
- package/dist/idp-DrhVrLmV.d.mts +0 -160
- package/dist/index-BI-_j9Z3.d.mts +0 -1013
- package/dist/index-C4JirJH8.d.mts +0 -18
- package/dist/index-CZfWhr0a.d.mts +0 -18
- package/dist/index-Cg8VKAdN.d.mts +0 -46
- package/dist/index-DYRjoLXD.d.mts +0 -47
- package/dist/index-lFpcjHPU.d.mts +0 -201
- package/dist/index-nW7hE6oE.d.mts +0 -18
- package/dist/interceptor-D-q1rvRl.mjs.map +0 -1
- package/dist/mock-FPxmnt-y.mjs +0 -759
- package/dist/mock-FPxmnt-y.mjs.map +0 -1
- package/dist/registry-DH4m7eYo.mjs.map +0 -1
- package/dist/rolldown-runtime-DXywRVcq.mjs +0 -20
- package/dist/runtime-CY4JvrDj.mjs.map +0 -1
- package/dist/schema-Dtw9Orye.mjs.map +0 -1
- package/dist/secret-file-VSVGy1V0.mjs.map +0 -1
- package/dist/secretmanager-B3n4KHfm.d.mts +0 -55
- package/dist/secretmanager-BVxw3ih_.mjs +0 -24
- package/dist/secretmanager-BVxw3ih_.mjs.map +0 -1
- package/dist/seed-izIEyP3z.mjs.map +0 -1
- package/dist/service-DCqIWibD.mjs +0 -3
- package/dist/service-DU1mVzri2.mjs.map +0 -1
- package/dist/service-DjyqbCaJ.mjs.map +0 -1
- package/dist/telemetry-CdqJEzkj.mjs.map +0 -1
- package/dist/telemetry-ClwW5ohF.mjs +0 -3
- package/dist/types-74etvaxy.mjs +0 -4
- package/dist/types-BDRml5C3.d.mts +0 -574
- package/dist/types-BQijbo4m.mjs +0 -371
- package/dist/types-BQijbo4m.mjs.map +0 -1
- package/dist/types-BX4q6Mo6.d.mts +0 -339
- package/dist/workflow-BOmaZwwG.mjs +0 -43
- package/dist/workflow-BOmaZwwG.mjs.map +0 -1
- package/dist/workflow-BVy4XWjS.d.mts +0 -101
package/dist/vitest/index.d.mts
CHANGED
|
@@ -1,430 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { mockAigateway } from "./mocks/aigateway.mjs";
|
|
2
|
+
import { mockAuthconnection } from "./mocks/authconnection.mjs";
|
|
3
|
+
import { mockFile } from "./mocks/file.mjs";
|
|
4
|
+
import { mockIconv } from "./mocks/iconv.mjs";
|
|
5
|
+
import { mockIdp } from "./mocks/idp.mjs";
|
|
6
|
+
import { mockSecretmanager } from "./mocks/secretmanager.mjs";
|
|
7
|
+
import { mockTailordb } from "./mocks/tailordb.mjs";
|
|
8
|
+
import { mockWorkflow } from "./mocks/workflow.mjs";
|
|
9
|
+
import { RunWorkflowLocallyOptions, runWorkflowLocally } from "./workflow-local.mjs";
|
|
10
|
+
import { ExecutedQuery, KyselyMock, createKyselyMock } from "./mock-kysely.mjs";
|
|
5
11
|
import { Plugin } from "vitest/config";
|
|
6
12
|
|
|
7
|
-
//#region src/vitest/mock.d.ts
|
|
8
|
-
type QueryResolver$1 = (query: string, params: unknown[]) => unknown[];
|
|
9
|
-
type JobHandler = (jobName: string, args: unknown) => unknown;
|
|
10
|
-
type IdpResolver = (method: string, args: unknown[], namespace: string) => unknown;
|
|
11
|
-
type FileResolver = (method: string, call: FileCall) => unknown;
|
|
12
|
-
type IconvResolver = (method: string, args: unknown[]) => unknown;
|
|
13
|
-
type TriggerWorkflowOptions = {
|
|
14
|
-
authInvoker?: {
|
|
15
|
-
namespace: string;
|
|
16
|
-
machineUserName: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
type TriggerHandlerFn = (workflowName: string, args: unknown, options?: TriggerWorkflowOptions) => string;
|
|
20
|
-
type WaitHandlerFn = (key: string, payload: unknown) => unknown;
|
|
21
|
-
type ResolveHandler = (executionId: string, key: string, callback: (payload: unknown) => unknown) => unknown | Promise<unknown>;
|
|
22
|
-
type SetWaitHandler = {
|
|
23
|
-
(handler: WaitHandlerFn): void;
|
|
24
|
-
(handler: unknown): void;
|
|
25
|
-
};
|
|
26
|
-
interface ExecutedQuery$1 {
|
|
27
|
-
query: string;
|
|
28
|
-
params: unknown[];
|
|
29
|
-
}
|
|
30
|
-
interface CreatedClient {
|
|
31
|
-
namespace: string | undefined;
|
|
32
|
-
ended: boolean;
|
|
33
|
-
}
|
|
34
|
-
interface TriggeredJob {
|
|
35
|
-
jobName: string;
|
|
36
|
-
args: unknown;
|
|
37
|
-
}
|
|
38
|
-
interface SecretCall {
|
|
39
|
-
method: "getSecret" | "getSecrets";
|
|
40
|
-
vault: string;
|
|
41
|
-
name?: string;
|
|
42
|
-
names?: readonly string[];
|
|
43
|
-
}
|
|
44
|
-
interface AuthConnectionCall {
|
|
45
|
-
connectionName: string;
|
|
46
|
-
}
|
|
47
|
-
interface IdpCall {
|
|
48
|
-
method: string;
|
|
49
|
-
args: unknown[];
|
|
50
|
-
namespace: string;
|
|
51
|
-
}
|
|
52
|
-
interface FileCall {
|
|
53
|
-
method: string;
|
|
54
|
-
namespace: string;
|
|
55
|
-
typeName: string;
|
|
56
|
-
fieldName: string;
|
|
57
|
-
recordId: string;
|
|
58
|
-
}
|
|
59
|
-
interface IconvCall {
|
|
60
|
-
method: string;
|
|
61
|
-
args: unknown[];
|
|
62
|
-
}
|
|
63
|
-
declare class MockQueryResult {
|
|
64
|
-
command: string;
|
|
65
|
-
rowCount: number;
|
|
66
|
-
rows: unknown[];
|
|
67
|
-
constructor(rows: unknown[]);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Acquire a disposable mock for TailorDB operations. Installs a mock
|
|
71
|
-
* `tailordb.Client` whose `queryObject` is a shared `vi.fn()` (so query
|
|
72
|
-
* responses can be staged before the client is constructed). Restored on
|
|
73
|
-
* dispose.
|
|
74
|
-
* @returns Disposable TailorDB mock control object
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* import { mockTailordb } from "@tailor-platform/sdk/vitest";
|
|
78
|
-
*
|
|
79
|
-
* test("order-based", async () => {
|
|
80
|
-
* using db = mockTailordb();
|
|
81
|
-
* db.enqueueResults([], [{ age: 30 }], []); // BEGIN / SELECT / COMMIT
|
|
82
|
-
* // …
|
|
83
|
-
* expect(db.queryObject).toHaveBeenCalledTimes(3);
|
|
84
|
-
* expect(db.Client).toHaveBeenCalledWith({ namespace: "tailordb" });
|
|
85
|
-
* });
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
declare function mockTailordb(): {
|
|
89
|
-
/** The mock `tailordb.Client` constructor (`vi.fn`). */Client: Mock<(this: any, config?: {
|
|
90
|
-
namespace?: string;
|
|
91
|
-
}) => void>; /** The shared `queryObject` `vi.fn` used by every client and transaction. */
|
|
92
|
-
queryObject: Mock<(_query: string, _params?: unknown[]) => Promise<MockQueryResult>>;
|
|
93
|
-
/**
|
|
94
|
-
* Set a fallback query resolver. Called when the enqueue queue is empty.
|
|
95
|
-
* @param resolver - Function that returns rows for a given query and params
|
|
96
|
-
*/
|
|
97
|
-
setQueryResolver(resolver: QueryResolver$1): void;
|
|
98
|
-
/**
|
|
99
|
-
* Enqueue rows for the next `queryObject` call (FIFO; takes priority over
|
|
100
|
-
* `setQueryResolver`). Call with no arguments for an empty result.
|
|
101
|
-
* @param rows - Row objects to return from the next `queryObject` call
|
|
102
|
-
*/
|
|
103
|
-
enqueueResult(...rows: unknown[]): void;
|
|
104
|
-
/**
|
|
105
|
-
* Enqueue rows for multiple subsequent `queryObject` calls (FIFO).
|
|
106
|
-
* @param rowsList - Rows arrays, one per upcoming query
|
|
107
|
-
*/
|
|
108
|
-
enqueueResults(...rowsList: unknown[][]): void;
|
|
109
|
-
/**
|
|
110
|
-
* All queries executed via `queryObject`, in order, derived from the vi.fn
|
|
111
|
-
* call records.
|
|
112
|
-
* @returns Executed queries array
|
|
113
|
-
*/
|
|
114
|
-
readonly executedQueries: ExecutedQuery$1[];
|
|
115
|
-
/**
|
|
116
|
-
* All TailorDB clients created, with their namespace and end state.
|
|
117
|
-
* @returns Created clients array
|
|
118
|
-
*/
|
|
119
|
-
readonly createdClients: CreatedClient[]; /** Reset query responses and recorded calls (keeps the mock installed). */
|
|
120
|
-
reset(): void;
|
|
121
|
-
} & Disposable;
|
|
122
|
-
/**
|
|
123
|
-
* Acquire a disposable mock for workflow operations (`tailor.workflow`).
|
|
124
|
-
* Restored on dispose.
|
|
125
|
-
* @returns Disposable workflow mock control object
|
|
126
|
-
* @example
|
|
127
|
-
* ```typescript
|
|
128
|
-
* import { mockWorkflow } from "@tailor-platform/sdk/vitest";
|
|
129
|
-
*
|
|
130
|
-
* test("job handler", async () => {
|
|
131
|
-
* using wf = mockWorkflow();
|
|
132
|
-
* wf.setJobHandler((name) => (name === "validate" ? { valid: true } : null));
|
|
133
|
-
* await runWorkflowUnderTest(); // calls tailor.workflow.triggerJobFunction("validate", {})
|
|
134
|
-
* expect(wf.triggerJobFunction).toHaveBeenCalledWith("validate", {});
|
|
135
|
-
* });
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
declare function mockWorkflow(): {
|
|
139
|
-
/** The `triggerJobFunction` `vi.fn`. */triggerJobFunction: Mock<(jobName: string, _args?: unknown) => unknown>; /** The `triggerWorkflow` `vi.fn`. */
|
|
140
|
-
triggerWorkflow: Mock<(_workflowName: string, _args?: unknown, _options?: TriggerWorkflowOptions) => Promise<string>>; /** The `wait` `vi.fn`. */
|
|
141
|
-
wait: Mock<(_key: string, _payload?: unknown) => unknown>; /** The `resolve` `vi.fn`. */
|
|
142
|
-
resolve: Mock<(_executionId: string, _key: string, _callback: (payload: unknown) => unknown) => Promise<void>>;
|
|
143
|
-
/**
|
|
144
|
-
* Set a fallback job handler. Called when the enqueue queue is empty.
|
|
145
|
-
* @param handler - Function returning a result for a job name and args
|
|
146
|
-
*/
|
|
147
|
-
setJobHandler(handler: JobHandler): void;
|
|
148
|
-
/**
|
|
149
|
-
* Enqueue a single result for the next `triggerJobFunction` call (FIFO;
|
|
150
|
-
* takes priority over `setJobHandler`).
|
|
151
|
-
* @param result - Result to return from the next call
|
|
152
|
-
*/
|
|
153
|
-
enqueueResult(result: unknown): void;
|
|
154
|
-
/**
|
|
155
|
-
* Enqueue results for multiple subsequent `triggerJobFunction` calls (FIFO).
|
|
156
|
-
* @param results - Results to enqueue, one per upcoming call
|
|
157
|
-
*/
|
|
158
|
-
enqueueResults(...results: unknown[]): void;
|
|
159
|
-
/**
|
|
160
|
-
* All jobs triggered via `triggerJobFunction`, in order.
|
|
161
|
-
* @returns Triggered jobs array
|
|
162
|
-
*/
|
|
163
|
-
readonly triggeredJobs: TriggeredJob[];
|
|
164
|
-
/**
|
|
165
|
-
* Configure what `triggerWorkflow` returns. Pass a string (same id every
|
|
166
|
-
* call) or `(name, args, options) => string`. Default: a placeholder UUID.
|
|
167
|
-
* @param handler - Static execution ID or a function returning one
|
|
168
|
-
*/
|
|
169
|
-
setTriggerHandler(handler: string | TriggerHandlerFn): void;
|
|
170
|
-
/**
|
|
171
|
-
* Configure what `wait` returns. Pass `(key, payload) => unknown` or any
|
|
172
|
-
* other value to return it for every call. Default: `null`.
|
|
173
|
-
* @param handler - Static value or a function returning one
|
|
174
|
-
*/
|
|
175
|
-
setWaitHandler: SetWaitHandler;
|
|
176
|
-
/**
|
|
177
|
-
* Set the `env` passed to job bodies invoked via `runWorkflowLocally()`.
|
|
178
|
-
* Cleared on dispose / reset.
|
|
179
|
-
* @param env - Env passed to job bodies.
|
|
180
|
-
*/
|
|
181
|
-
setEnv(env: TailorEnv): void;
|
|
182
|
-
/**
|
|
183
|
-
* Configure how `resolve` runs the user-supplied callback. Default: callback
|
|
184
|
-
* is not invoked (records the call only).
|
|
185
|
-
* @param handler - Function invoked per `resolve` call
|
|
186
|
-
*/
|
|
187
|
-
setResolveHandler(handler: ResolveHandler): void;
|
|
188
|
-
/**
|
|
189
|
-
* `wait` calls reshaped as `{ key, payload }` for assertions.
|
|
190
|
-
* @returns Wait call records
|
|
191
|
-
*/
|
|
192
|
-
readonly waitCalls: {
|
|
193
|
-
key: string;
|
|
194
|
-
payload: unknown;
|
|
195
|
-
}[];
|
|
196
|
-
/**
|
|
197
|
-
* `resolve` calls reshaped as `{ executionId, key }` for assertions.
|
|
198
|
-
* @returns Resolve call records
|
|
199
|
-
*/
|
|
200
|
-
readonly resolveCalls: {
|
|
201
|
-
executionId: string;
|
|
202
|
-
key: string;
|
|
203
|
-
}[]; /** Reset all workflow responses and recorded calls (keeps the mock installed). */
|
|
204
|
-
reset(): void;
|
|
205
|
-
} & Disposable;
|
|
206
|
-
/**
|
|
207
|
-
* Acquire a disposable mock for `tailor.secretmanager`. The secret store is
|
|
208
|
-
* inherited (cloned) from the currently-installed mock on acquisition and
|
|
209
|
-
* restored on dispose, so secrets seeded outside the test survive across
|
|
210
|
-
* `using` scopes while per-test `setSecrets()` overrides stay isolated.
|
|
211
|
-
* @returns Disposable SecretManager mock control object
|
|
212
|
-
* @example
|
|
213
|
-
* ```typescript
|
|
214
|
-
* import { mockSecretmanager } from "@tailor-platform/sdk/vitest";
|
|
215
|
-
*
|
|
216
|
-
* test("reads secrets from vault", async () => {
|
|
217
|
-
* using sm = mockSecretmanager();
|
|
218
|
-
* sm.setSecrets({ "my-vault": { API_KEY: "sk-123" } });
|
|
219
|
-
* // …
|
|
220
|
-
* });
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
declare function mockSecretmanager(): {
|
|
224
|
-
/** The `getSecret` `vi.fn`. */getSecret: Mock<(vault: string, name: string) => Promise<string | undefined>>; /** The `getSecrets` `vi.fn`. */
|
|
225
|
-
getSecrets: Mock<(<const T extends readonly string[]>(vault: string, names: T) => Promise<Partial<Record<T[number], string>>>)>;
|
|
226
|
-
setSecrets(secrets: Record<string, Record<string, string>>): void;
|
|
227
|
-
readonly calls: SecretCall[];
|
|
228
|
-
reset(): void;
|
|
229
|
-
} & Disposable;
|
|
230
|
-
/**
|
|
231
|
-
* Acquire a disposable mock for `tailor.authconnection`. Restored on dispose.
|
|
232
|
-
* @returns Disposable AuthConnection mock control object
|
|
233
|
-
* @example
|
|
234
|
-
* ```typescript
|
|
235
|
-
* import { mockAuthconnection } from "@tailor-platform/sdk/vitest";
|
|
236
|
-
*
|
|
237
|
-
* test("returns configured token", async () => {
|
|
238
|
-
* using ac = mockAuthconnection();
|
|
239
|
-
* ac.setTokens({ google: { access_token: "ya29.xxx" } });
|
|
240
|
-
* // …
|
|
241
|
-
* });
|
|
242
|
-
* ```
|
|
243
|
-
*/
|
|
244
|
-
declare function mockAuthconnection(): {
|
|
245
|
-
/** The `getConnectionToken` `vi.fn`. */getConnectionToken: Mock<(connectionName: string) => Promise<any>>;
|
|
246
|
-
setTokens(value: Record<string, unknown>): void;
|
|
247
|
-
readonly calls: AuthConnectionCall[];
|
|
248
|
-
reset(): void;
|
|
249
|
-
} & Disposable;
|
|
250
|
-
/**
|
|
251
|
-
* Acquire a disposable mock for `tailor.idp`. Restored on dispose.
|
|
252
|
-
* @returns Disposable IDP mock control object
|
|
253
|
-
* @example
|
|
254
|
-
* ```typescript
|
|
255
|
-
* import { mockIdp } from "@tailor-platform/sdk/vitest";
|
|
256
|
-
*
|
|
257
|
-
* test("resolver-based", async () => {
|
|
258
|
-
* using idp = mockIdp();
|
|
259
|
-
* idp.setResolver((method) =>
|
|
260
|
-
* method === "user" ? { id: "u-1", name: "alice", disabled: false } : null,
|
|
261
|
-
* );
|
|
262
|
-
* // …
|
|
263
|
-
* });
|
|
264
|
-
* ```
|
|
265
|
-
*/
|
|
266
|
-
declare function mockIdp(): {
|
|
267
|
-
/** The mock IDP `Client` constructor (`vi.fn`). */Client: Mock;
|
|
268
|
-
setResolver(value: IdpResolver): void;
|
|
269
|
-
/**
|
|
270
|
-
* Enqueue a single result for the next IDP call (FIFO; falls back to
|
|
271
|
-
* `setResolver` when exhausted).
|
|
272
|
-
* @param result - Result to return from the next IDP call
|
|
273
|
-
*/
|
|
274
|
-
enqueueResult(result: unknown): void;
|
|
275
|
-
/**
|
|
276
|
-
* Enqueue results for multiple subsequent IDP calls.
|
|
277
|
-
* @param results - Results to enqueue, one per upcoming call
|
|
278
|
-
*/
|
|
279
|
-
enqueueResults(...results: unknown[]): void;
|
|
280
|
-
readonly calls: IdpCall[];
|
|
281
|
-
reset(): void;
|
|
282
|
-
} & Disposable;
|
|
283
|
-
/**
|
|
284
|
-
* Acquire a disposable mock for `tailor.iconv`. Restored on dispose.
|
|
285
|
-
* @returns Disposable Iconv mock control object
|
|
286
|
-
* @example
|
|
287
|
-
* ```typescript
|
|
288
|
-
* import { mockIconv } from "@tailor-platform/sdk/vitest";
|
|
289
|
-
*
|
|
290
|
-
* test("mock encoding conversion", () => {
|
|
291
|
-
* using iconv = mockIconv();
|
|
292
|
-
* iconv.setResolver((method) => (method === "decode" ? "decoded-text" : null));
|
|
293
|
-
* // …
|
|
294
|
-
* });
|
|
295
|
-
* ```
|
|
296
|
-
*/
|
|
297
|
-
declare function mockIconv(): {
|
|
298
|
-
setResolver(value: IconvResolver): void;
|
|
299
|
-
readonly calls: IconvCall[];
|
|
300
|
-
reset(): void;
|
|
301
|
-
} & Disposable;
|
|
302
|
-
/**
|
|
303
|
-
* Acquire a disposable mock for `tailordb.file`. Restored on dispose.
|
|
304
|
-
* @returns Disposable File mock control object
|
|
305
|
-
* @example
|
|
306
|
-
* ```typescript
|
|
307
|
-
* import { mockFile } from "@tailor-platform/sdk/vitest";
|
|
308
|
-
*
|
|
309
|
-
* test("mock file download", async () => {
|
|
310
|
-
* using file = mockFile();
|
|
311
|
-
* file.enqueueResult({ data: new Uint8Array([1, 2, 3]), metadata: { ... } });
|
|
312
|
-
* // …
|
|
313
|
-
* });
|
|
314
|
-
* ```
|
|
315
|
-
*/
|
|
316
|
-
declare function mockFile(): {
|
|
317
|
-
setResolver(value: FileResolver): void;
|
|
318
|
-
/**
|
|
319
|
-
* Enqueue a single result for the next `tailordb.file` call (FIFO; falls
|
|
320
|
-
* back to `setResolver` when exhausted).
|
|
321
|
-
* @param result - Result to return from the next file call
|
|
322
|
-
*/
|
|
323
|
-
enqueueResult(result: unknown): void;
|
|
324
|
-
/**
|
|
325
|
-
* Enqueue results for multiple subsequent `tailordb.file` calls.
|
|
326
|
-
* @param results - Results to enqueue, one per upcoming call
|
|
327
|
-
*/
|
|
328
|
-
enqueueResults(...results: unknown[]): void;
|
|
329
|
-
readonly calls: FileCall[];
|
|
330
|
-
reset(): void;
|
|
331
|
-
} & Disposable;
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region src/vitest/workflow-local.d.ts
|
|
334
|
-
type AnyWorkflowJob = WorkflowJob<string, any, any>;
|
|
335
|
-
type AnyWorkflow = Workflow<AnyWorkflowJob>;
|
|
336
|
-
type WorkflowInput<W extends AnyWorkflow> = W["mainJob"] extends WorkflowJob<string, infer I, any> ? I : never;
|
|
337
|
-
type WorkflowOutput<W extends AnyWorkflow> = W["mainJob"] extends WorkflowJob<string, any, infer O> ? Awaited<O> : never;
|
|
338
|
-
interface RunWorkflowLocallyOptions {
|
|
339
|
-
/** Env passed to workflow job bodies during this local run. */
|
|
340
|
-
env?: TailorEnv;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Run a workflow's main job and dependent job triggers locally with real job bodies.
|
|
344
|
-
*
|
|
345
|
-
* Use this for local full-chain workflow tests. Regular `.trigger()` calls
|
|
346
|
-
* delegate to the platform workflow runtime and should be mocked with
|
|
347
|
-
* `mockWorkflow()` when you are not intentionally running the local chain.
|
|
348
|
-
* @param workflow - Workflow definition to run
|
|
349
|
-
* @returns The main job output
|
|
350
|
-
*/
|
|
351
|
-
declare function runWorkflowLocally<W extends Workflow<WorkflowJob<string, undefined, any>>>(workflow: W): Promise<WorkflowOutput<W>>;
|
|
352
|
-
/**
|
|
353
|
-
* Run a no-input workflow locally with optional runner settings.
|
|
354
|
-
* @param workflow - Workflow definition to run
|
|
355
|
-
* @param args - Must be `undefined` for no-input workflows
|
|
356
|
-
* @param options - Local runner options
|
|
357
|
-
* @returns The main job output
|
|
358
|
-
*/
|
|
359
|
-
declare function runWorkflowLocally<W extends Workflow<WorkflowJob<string, undefined, any>>>(workflow: W, args: undefined, options?: RunWorkflowLocallyOptions): Promise<WorkflowOutput<W>>;
|
|
360
|
-
/**
|
|
361
|
-
* Run a workflow locally with real job bodies.
|
|
362
|
-
* @param workflow - Workflow definition to run
|
|
363
|
-
* @param args - Arguments passed to the workflow's main job
|
|
364
|
-
* @param options - Local runner options
|
|
365
|
-
* @returns The main job output
|
|
366
|
-
*/
|
|
367
|
-
declare function runWorkflowLocally<W extends AnyWorkflow>(workflow: W, args: WorkflowInput<W>, options?: RunWorkflowLocallyOptions): Promise<WorkflowOutput<W>>;
|
|
368
|
-
//#endregion
|
|
369
|
-
//#region src/vitest/mock-kysely.d.ts
|
|
370
|
-
/** A single statement executed against the mock, captured in order. */
|
|
371
|
-
interface ExecutedQuery {
|
|
372
|
-
/** The Kysely operation node kind, e.g. `"SelectQueryNode"`. */
|
|
373
|
-
kind: OperationNodeKind;
|
|
374
|
-
/** The compiled SQL string. */
|
|
375
|
-
sql: string;
|
|
376
|
-
/** The bound parameter values, in positional order. */
|
|
377
|
-
parameters: readonly unknown[];
|
|
378
|
-
/** The compiled Kysely operation node. */
|
|
379
|
-
node: OperationNode;
|
|
380
|
-
/** One `{ column: value }` map per row written by an insert. */
|
|
381
|
-
insertRows: () => Record<string, unknown>[];
|
|
382
|
-
/** The `{ column: value }` map written by a single-row insert. */
|
|
383
|
-
insertValues: () => Record<string, unknown>;
|
|
384
|
-
/** The `{ column: value }` map written by an update's SET clause. */
|
|
385
|
-
updateValues: () => Record<string, unknown>;
|
|
386
|
-
}
|
|
387
|
-
type MockRow = Record<string, unknown>;
|
|
388
|
-
type MockResult = MockRow[] | {
|
|
389
|
-
rows?: MockRow[];
|
|
390
|
-
numAffectedRows?: number | bigint;
|
|
391
|
-
};
|
|
392
|
-
type QueryResolver = (query: ExecutedQuery) => MockResult | undefined;
|
|
393
|
-
/** Controls and assertions for a {@link createKyselyMock} instance. */
|
|
394
|
-
interface KyselyMock<DB> {
|
|
395
|
-
/** The mock Kysely instance to run queries against. */
|
|
396
|
-
db: Kysely<DB>;
|
|
397
|
-
/** Every recorded query, in execution order. */
|
|
398
|
-
executedQueries: ExecutedQuery[];
|
|
399
|
-
/** Recorded SELECT queries. */
|
|
400
|
-
selects: ExecutedQuery[];
|
|
401
|
-
/** Recorded INSERT queries. */
|
|
402
|
-
inserts: ExecutedQuery[];
|
|
403
|
-
/** Recorded UPDATE queries. */
|
|
404
|
-
updates: ExecutedQuery[];
|
|
405
|
-
/** Recorded DELETE queries. */
|
|
406
|
-
deletes: ExecutedQuery[];
|
|
407
|
-
/** Stage the rows the next query returns. */
|
|
408
|
-
enqueueResult: (result: MockResult) => void;
|
|
409
|
-
/** Stage the rows for several upcoming queries, consumed in order. */
|
|
410
|
-
enqueueResults: (...results: MockResult[]) => void;
|
|
411
|
-
/** Set a resolver that returns rows by inspecting each query. */
|
|
412
|
-
setQueryResolver: (resolver: QueryResolver) => void;
|
|
413
|
-
/** Run `fn` inside a real transaction and return its result. */
|
|
414
|
-
withTx: <R>(fn: (trx: Transaction<DB>) => Promise<R>) => Promise<R>;
|
|
415
|
-
/** Clear recorded queries and staged results. */
|
|
416
|
-
reset: () => void;
|
|
417
|
-
/** Same as {@link KyselyMock.reset}; enables `using` disposal. */
|
|
418
|
-
[Symbol.dispose]: () => void;
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Create a mock Kysely instance for unit-testing code that runs Kysely queries.
|
|
422
|
-
* Pass the namespace schema as the type argument, e.g.
|
|
423
|
-
* `createKyselyMock<Namespace["main-db"]>()`.
|
|
424
|
-
* @returns A {@link KyselyMock} with the mock `db`, recorded queries, and result staging.
|
|
425
|
-
*/
|
|
426
|
-
declare function createKyselyMock<DB = Record<string, never>>(): KyselyMock<DB>;
|
|
427
|
-
//#endregion
|
|
428
13
|
//#region src/vitest/index.d.ts
|
|
429
14
|
/**
|
|
430
15
|
* Creates Vitest plugins that emulate the Tailor Platform function runtime environment.
|
|
@@ -447,7 +32,7 @@ declare function createKyselyMock<DB = Record<string, never>>(): KyselyMock<DB>;
|
|
|
447
32
|
*
|
|
448
33
|
* 3. **Platform API mocks** (environment) — All platform APIs are auto-injected with
|
|
449
34
|
* control objects: `mockTailordb`, `mockWorkflow`, `mockSecretmanager`,
|
|
450
|
-
* `mockAuthconnection`, `mockIdp`, `mockFile`, `mockIconv`. Each
|
|
35
|
+
* `mockAuthconnection`, `mockIdp`, `mockFile`, `mockIconv`, `mockAigateway`. Each
|
|
451
36
|
* provides response configuration, call recording, and reset.
|
|
452
37
|
*
|
|
453
38
|
* 4. **Environment resolution** — Rewrites `environment: "tailor-runtime"` to the
|
|
@@ -484,5 +69,4 @@ declare function tailorRuntime(options?: {
|
|
|
484
69
|
config?: string;
|
|
485
70
|
}): Plugin[];
|
|
486
71
|
//#endregion
|
|
487
|
-
export { type ExecutedQuery, type KyselyMock, type RunWorkflowLocallyOptions, createKyselyMock, mockAuthconnection, mockFile, mockIconv, mockIdp, mockSecretmanager, mockTailordb, mockWorkflow, runWorkflowLocally, tailorRuntime };
|
|
488
|
-
//# sourceMappingURL=index.d.mts.map
|
|
72
|
+
export { type ExecutedQuery, type KyselyMock, type RunWorkflowLocallyOptions, createKyselyMock, mockAigateway, mockAuthconnection, mockFile, mockIconv, mockIdp, mockSecretmanager, mockTailordb, mockWorkflow, runWorkflowLocally, tailorRuntime };
|