@tailor-platform/sdk 2.0.0-next.5 → 2.0.0-next.7
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 +85 -0
- package/dist/{application-Bf8wxOi6.mjs → application-GzW98_Xr.mjs} +377 -1418
- package/dist/application-GzW98_Xr.mjs.map +1 -0
- package/dist/application-OM0taSPn.mjs +3 -0
- package/dist/cli/commands/deploy/deploy.d.mts +8 -3
- package/dist/cli/commands/generate/options.d.mts +0 -1
- package/dist/cli/commands/generate/service.d.mts +1 -1
- package/dist/cli/commands/staticwebsite/deploy.d.mts +19 -0
- package/dist/cli/commands/workspace/create.d.mts +3 -0
- package/dist/cli/commands/workspace/list.d.mts +1 -0
- package/dist/cli/commands/workspace/transform.d.mts +2 -0
- package/dist/cli/index.mjs +781 -1553
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +7 -3
- package/dist/cli/lib.mjs +49 -3
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/shared/config-loader.d.mts +1 -1
- package/dist/cli/shared/readonly-guard.d.mts +25 -0
- package/dist/cli/shared/tailordb-namespaces.d.mts +37 -0
- package/dist/cli/shared/workspace-name.d.mts +1 -0
- package/dist/completion/zsh-worker.zsh +15 -303
- package/dist/configure/config/types.d.mts +5 -1
- package/dist/configure/index.mjs +20 -19
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/auth/types.d.mts +18 -23
- package/dist/configure/services/executor/executor.d.mts +2 -13
- package/dist/configure/services/executor/operation.d.mts +8 -3
- package/dist/configure/services/tailordb/schema.d.mts +1 -7
- package/dist/configure/services/tailordb/types.d.mts +1 -1
- package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
- package/dist/configure/services/workflow/job.d.mts +10 -10
- package/dist/configure/services/workflow/workflow.d.mts +6 -4
- package/dist/configure/types/type.d.mts +1 -9
- package/dist/{crashreport-D3RjuSYb.mjs → crashreport-0ioNRZ4K.mjs} +1 -1
- package/dist/{crashreport-Cg-pqRJV.mjs → crashreport-CxHne11E.mjs} +4 -3
- package/dist/{crashreport-Cg-pqRJV.mjs.map → crashreport-CxHne11E.mjs.map} +1 -1
- package/dist/errors-DfnF4ibq.mjs +100 -0
- package/dist/errors-DfnF4ibq.mjs.map +1 -0
- package/dist/{globals-BjhJJ2dN.mjs → globals-CBZ0egXT.mjs} +13 -10
- package/dist/globals-CBZ0egXT.mjs.map +1 -0
- package/dist/{logger-BEiZZ3qT.mjs → logger-BwS4ppwO.mjs} +3 -3
- package/dist/logger-BwS4ppwO.mjs.map +1 -0
- package/dist/parser/service/tailordb/type-source.d.mts +10 -0
- package/dist/{register-ts-hook-BhzVkej0.mjs → register-ts-hook-DvEs6YsL.mjs} +2571 -1636
- package/dist/register-ts-hook-DvEs6YsL.mjs.map +1 -0
- package/dist/{registry-BSbq6SPo.mjs → registry-i7EdJ-D5.mjs} +10 -10
- package/dist/registry-i7EdJ-D5.mjs.map +1 -0
- package/dist/runtime/field-parse.d.mts +10 -0
- package/dist/runtime/globals.d.mts +3 -3
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/workflow.d.mts +18 -33
- package/dist/runtime/workflow.mjs +1 -1
- package/dist/{schema-iCd1ugGp.mjs → schema--xYWRGfe.mjs} +42 -24
- package/dist/schema--xYWRGfe.mjs.map +1 -0
- package/dist/{secret-file-aoNXJmKa.mjs → secret-file-C3J4Gy8r.mjs} +2 -27
- package/dist/secret-file-C3J4Gy8r.mjs.map +1 -0
- package/dist/{secretmanager-Bd45j7an.mjs → secretmanager-IY4UvinW.mjs} +42 -9
- package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
- package/dist/service-BJAQ70e5.mjs +3 -0
- package/dist/{service-DeZeYa06.mjs → service-DaeJlBoH.mjs} +3 -3
- package/dist/{service-DeZeYa06.mjs.map → service-DaeJlBoH.mjs.map} +1 -1
- package/dist/{service-CzZEVrp9.mjs → service-Dmxa2I4i.mjs} +64 -28
- package/dist/service-Dmxa2I4i.mjs.map +1 -0
- package/dist/service_pb-BoLM0X4K.mjs +167 -0
- package/dist/service_pb-BoLM0X4K.mjs.map +1 -0
- package/dist/{service_pb-DZkfjB_6.mjs → service_pb-r1T7kpJc.mjs} +1 -1
- package/dist/types/executor.generated.d.mts +60 -42
- package/dist/user-agent-Bgsszb5I.mjs +28 -0
- package/dist/user-agent-Bgsszb5I.mjs.map +1 -0
- package/dist/utils/test/index.mjs +11 -11
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/utils/test/mock.d.mts +6 -6
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +8 -8
- package/dist/vitest/index.mjs +613 -227
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock.d.mts +8 -8
- package/dist/vitest/mocks/aigateway.d.mts +14 -4
- package/dist/vitest/mocks/authconnection.d.mts +14 -4
- package/dist/vitest/mocks/file.d.mts +23 -6
- package/dist/vitest/mocks/iconv.d.mts +28 -4
- package/dist/vitest/mocks/idp.d.mts +25 -9
- package/dist/vitest/mocks/secretmanager.d.mts +13 -4
- package/dist/vitest/mocks/tailordb.d.mts +48 -7
- package/dist/vitest/mocks/workflow.d.mts +59 -33
- package/dist/vitest/setup.mjs +2 -2
- package/dist/vitest/workflow-local.d.mts +2 -2
- package/dist/workflow-CsBvRE3g.mjs +34 -0
- package/dist/workflow-CsBvRE3g.mjs.map +1 -0
- package/dist/{service_pb-Bk7dL-yT.mjs → workspace_resource_pb-Db3fv68L.mjs} +47 -165
- package/dist/workspace_resource_pb-Db3fv68L.mjs.map +1 -0
- package/docs/cli/application.md +63 -15
- package/docs/cli/function.md +2 -2
- package/docs/cli/tailordb.md +8 -140
- package/docs/cli/workspace.md +6 -4
- package/docs/cli-reference.md +11 -8
- package/docs/configuration.md +2 -0
- package/docs/github-actions.md +8 -0
- package/docs/migration/v2.md +169 -11
- package/docs/runtime.md +5 -6
- package/docs/services/auth.md +7 -7
- package/docs/services/executor.md +5 -0
- package/docs/services/tailordb.md +44 -0
- package/docs/services/workflow.md +43 -43
- package/docs/testing.md +112 -96
- package/package.json +2 -5
- package/dist/application-Bf8wxOi6.mjs.map +0 -1
- package/dist/application-CUkjzfij.mjs +0 -3
- package/dist/cli/erd-viewer-assets/app.js +0 -1424
- package/dist/cli/erd-viewer-assets/index.html +0 -77
- package/dist/cli/erd-viewer-assets/serve.json +0 -13
- package/dist/cli/erd-viewer-assets/styles.css +0 -1036
- package/dist/configure/types/field-runtime.d.mts +0 -16
- package/dist/errors-118wUDRr.mjs +0 -42
- package/dist/errors-118wUDRr.mjs.map +0 -1
- package/dist/globals-BjhJJ2dN.mjs.map +0 -1
- package/dist/logger-BEiZZ3qT.mjs.map +0 -1
- package/dist/register-ts-hook-BhzVkej0.mjs.map +0 -1
- package/dist/registry-BSbq6SPo.mjs.map +0 -1
- package/dist/resource_pb-BRv7AMXK.mjs +0 -49
- package/dist/resource_pb-BRv7AMXK.mjs.map +0 -1
- package/dist/schema-iCd1ugGp.mjs.map +0 -1
- package/dist/secret-file-aoNXJmKa.mjs.map +0 -1
- package/dist/secretmanager-Bd45j7an.mjs.map +0 -1
- package/dist/service-BT0GPd01.mjs +0 -3
- package/dist/service-CzZEVrp9.mjs.map +0 -1
- package/dist/service_pb-Bk7dL-yT.mjs.map +0 -1
- package/dist/workflow-GNuSnsTx.mjs +0 -22
- package/dist/workflow-GNuSnsTx.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# politty-completion-version: 1
|
|
2
|
-
# politty-bin-sig:
|
|
2
|
+
# politty-bin-sig: 1784433664
|
|
3
3
|
# politty-bin-path: /home/runner/work/sdk/sdk/node_modules/.bin/tailor
|
|
4
4
|
# program: tailor
|
|
5
5
|
# shell: zsh
|
|
@@ -542,6 +542,10 @@ __tailor_worker_opt_takes_value() {
|
|
|
542
542
|
deploy:--workspace-id|deploy:--workspaceId|deploy:-w|deploy:--w) return 0 ;;
|
|
543
543
|
deploy:--profile|deploy:-p|deploy:--p) return 0 ;;
|
|
544
544
|
deploy:--config|deploy:-c|deploy:--c) return 0 ;;
|
|
545
|
+
deploy:--workspace-name|deploy:--workspaceName) return 0 ;;
|
|
546
|
+
deploy:--workspace-region|deploy:--workspaceRegion) return 0 ;;
|
|
547
|
+
deploy:--organization-id|deploy:--organizationId) return 0 ;;
|
|
548
|
+
deploy:--folder-id|deploy:--folderId) return 0 ;;
|
|
545
549
|
executor:trigger:--workspace-id|executor:trigger:--workspaceId|executor:trigger:-w|executor:trigger:--w) return 0 ;;
|
|
546
550
|
executor:trigger:--profile|executor:trigger:-p|executor:trigger:--p) return 0 ;;
|
|
547
551
|
executor:trigger:--data|executor:trigger:-d|executor:trigger:--d) return 0 ;;
|
|
@@ -739,21 +743,6 @@ __tailor_worker_opt_takes_value() {
|
|
|
739
743
|
tailordb:migration:sync:--profile|tailordb:migration:sync:-p|tailordb:migration:sync:--p) return 0 ;;
|
|
740
744
|
tailordb:migration:sync:--config|tailordb:migration:sync:-c|tailordb:migration:sync:--c) return 0 ;;
|
|
741
745
|
tailordb:migration:sync:--namespace|tailordb:migration:sync:-n|tailordb:migration:sync:--n) return 0 ;;
|
|
742
|
-
tailordb:erd:export:--config|tailordb:erd:export:-c|tailordb:erd:export:--c) return 0 ;;
|
|
743
|
-
tailordb:erd:export:--namespace|tailordb:erd:export:-n|tailordb:erd:export:--n) return 0 ;;
|
|
744
|
-
tailordb:erd:export:--output|tailordb:erd:export:-o|tailordb:erd:export:--o) return 0 ;;
|
|
745
|
-
tailordb:erd:diff:--base-html|tailordb:erd:diff:--baseHtml) return 0 ;;
|
|
746
|
-
tailordb:erd:diff:--head-html|tailordb:erd:diff:--headHtml) return 0 ;;
|
|
747
|
-
tailordb:erd:diff:--namespace|tailordb:erd:diff:-n|tailordb:erd:diff:--n) return 0 ;;
|
|
748
|
-
tailordb:erd:diff:--output|tailordb:erd:diff:-o|tailordb:erd:diff:--o) return 0 ;;
|
|
749
|
-
tailordb:erd:diff:--output-json|tailordb:erd:diff:--outputJson) return 0 ;;
|
|
750
|
-
tailordb:erd:serve:--config|tailordb:erd:serve:-c|tailordb:erd:serve:--c) return 0 ;;
|
|
751
|
-
tailordb:erd:serve:--namespace|tailordb:erd:serve:-n|tailordb:erd:serve:--n) return 0 ;;
|
|
752
|
-
tailordb:erd:serve:--port) return 0 ;;
|
|
753
|
-
tailordb:erd:deploy:--workspace-id|tailordb:erd:deploy:--workspaceId|tailordb:erd:deploy:-w|tailordb:erd:deploy:--w) return 0 ;;
|
|
754
|
-
tailordb:erd:deploy:--profile|tailordb:erd:deploy:-p|tailordb:erd:deploy:--p) return 0 ;;
|
|
755
|
-
tailordb:erd:deploy:--config|tailordb:erd:deploy:-c|tailordb:erd:deploy:--c) return 0 ;;
|
|
756
|
-
tailordb:erd:deploy:--namespace|tailordb:erd:deploy:-n|tailordb:erd:deploy:--n) return 0 ;;
|
|
757
746
|
upgrade:--from) return 0 ;;
|
|
758
747
|
upgrade:--path) return 0 ;;
|
|
759
748
|
user:pat:list:--order) return 0 ;;
|
|
@@ -803,6 +792,7 @@ __tailor_worker_opt_takes_value() {
|
|
|
803
792
|
workspace:create:--organization-id|workspace:create:--organizationId|workspace:create:-o|workspace:create:--o) return 0 ;;
|
|
804
793
|
workspace:create:--folder-id|workspace:create:--folderId|workspace:create:-f|workspace:create:--f) return 0 ;;
|
|
805
794
|
workspace:create:--profile-name|workspace:create:--profileName|workspace:create:-p|workspace:create:--p) return 0 ;;
|
|
795
|
+
workspace:create:--profile) return 0 ;;
|
|
806
796
|
workspace:create:--profile-user|workspace:create:--profileUser) return 0 ;;
|
|
807
797
|
workspace:create:--permission) return 0 ;;
|
|
808
798
|
workspace:delete:--workspace-id|workspace:delete:--workspaceId|workspace:delete:-w|workspace:delete:--w) return 0 ;;
|
|
@@ -810,6 +800,7 @@ __tailor_worker_opt_takes_value() {
|
|
|
810
800
|
workspace:get:--profile|workspace:get:-p|workspace:get:--p) return 0 ;;
|
|
811
801
|
workspace:list:--order) return 0 ;;
|
|
812
802
|
workspace:list:--limit|workspace:list:-l|workspace:list:--l) return 0 ;;
|
|
803
|
+
workspace:list:--profile) return 0 ;;
|
|
813
804
|
workspace:restore:--workspace-id|workspace:restore:--workspaceId|workspace:restore:-w|workspace:restore:--w) return 0 ;;
|
|
814
805
|
workspace:user:invite:--workspace-id|workspace:user:invite:--workspaceId|workspace:user:invite:-w|workspace:user:invite:--w) return 0 ;;
|
|
815
806
|
workspace:user:invite:--profile|workspace:user:invite:-p|workspace:user:invite:--p) return 0 ;;
|
|
@@ -945,11 +936,6 @@ __tailor_worker_is_subcmd() {
|
|
|
945
936
|
tailordb:migration:status) return 0 ;;
|
|
946
937
|
tailordb:migration:sync) return 0 ;;
|
|
947
938
|
tailordb:migration) return 0 ;;
|
|
948
|
-
tailordb:erd:export) return 0 ;;
|
|
949
|
-
tailordb:erd:diff) return 0 ;;
|
|
950
|
-
tailordb:erd:serve) return 0 ;;
|
|
951
|
-
tailordb:erd:deploy) return 0 ;;
|
|
952
|
-
tailordb:erd) return 0 ;;
|
|
953
939
|
:tailordb) return 0 ;;
|
|
954
940
|
:upgrade) return 0 ;;
|
|
955
941
|
user:current) return 0 ;;
|
|
@@ -1376,6 +1362,11 @@ __tailor_worker_complete_deploy() {
|
|
|
1376
1362
|
__tailor_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
|
|
1377
1363
|
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to SDK config file. Use comma-separated paths to deploy multiple apps together.")
|
|
1378
1364
|
__tailor_worker_not_used "--yes" "-y" "--y" && _opts+=("--yes:Skip confirmation prompts")
|
|
1365
|
+
__tailor_worker_not_used "--create-workspace" "--createWorkspace" && _opts+=("--create-workspace:Create a workspace when the account has none")
|
|
1366
|
+
__tailor_worker_not_used "--workspace-name" "--workspaceName" && _opts+=("--workspace-name:Name for a workspace created during deploy")
|
|
1367
|
+
__tailor_worker_not_used "--workspace-region" "--workspaceRegion" && _opts+=("--workspace-region:Region for a workspace created during deploy")
|
|
1368
|
+
__tailor_worker_not_used "--organization-id" "--organizationId" && _opts+=("--organization-id:Organization ID for a workspace created during deploy")
|
|
1369
|
+
__tailor_worker_not_used "--folder-id" "--folderId" && _opts+=("--folder-id:Folder ID for a workspace created during deploy")
|
|
1379
1370
|
__tailor_worker_not_used "--dry-run" "--dryRun" "-d" "--d" && _opts+=("--dry-run:Run the command without making any changes")
|
|
1380
1371
|
__tailor_worker_not_used "--no-schema-check" "--noSchemaCheck" && _opts+=("--no-schema-check:Skip schema diff check against migration snapshots")
|
|
1381
1372
|
__tailor_worker_not_used "--no-validate" "--noValidate" && _opts+=("--no-validate:Skip client-side validation against platform resource constraints")
|
|
@@ -1673,7 +1664,6 @@ __tailor_worker_complete_generate() {
|
|
|
1673
1664
|
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
1674
1665
|
local -a _opts=()
|
|
1675
1666
|
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to SDK config file")
|
|
1676
|
-
__tailor_worker_not_used "--watch" "-W" "--W" && _opts+=("--watch:Watch for type/resolver changes and regenerate")
|
|
1677
1667
|
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
1678
1668
|
__tailor_worker_cdescribe 'options' _opts
|
|
1679
1669
|
return 0
|
|
@@ -3241,281 +3231,6 @@ __tailor_worker_complete_tailordb_migration() {
|
|
|
3241
3231
|
__tailor_worker_cdescribe 'subcommands' _subs
|
|
3242
3232
|
}
|
|
3243
3233
|
|
|
3244
|
-
__tailor_worker_complete_tailordb_erd_export() {
|
|
3245
|
-
local -a _vals=()
|
|
3246
|
-
case "${words[CURRENT-1]}" in
|
|
3247
|
-
--config|-c|--c)
|
|
3248
|
-
setopt local_options null_glob
|
|
3249
|
-
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3250
|
-
local -a _exts=("ts")
|
|
3251
|
-
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3252
|
-
_dir="."
|
|
3253
|
-
_prefix="$_cur"
|
|
3254
|
-
elif [[ "$_cur" == */ ]]; then
|
|
3255
|
-
_dir="${_cur%/}"
|
|
3256
|
-
_prefix=""
|
|
3257
|
-
else
|
|
3258
|
-
_dir="${_cur%/*}"
|
|
3259
|
-
_prefix="${_cur##*/}"
|
|
3260
|
-
fi
|
|
3261
|
-
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3262
|
-
_out="${_f#./}"
|
|
3263
|
-
__tailor_worker_add_path_candidate "$_out"
|
|
3264
|
-
done
|
|
3265
|
-
local _ext
|
|
3266
|
-
for _f in "$_dir"/"$_prefix"*(N.); do
|
|
3267
|
-
_out="${_f#./}"
|
|
3268
|
-
for _ext in "${_exts[@]}"; do
|
|
3269
|
-
[[ -n "$_ext" && "$_out" == *."$_ext" ]] && { __tailor_worker_add_path_candidate "$_out"; break; }
|
|
3270
|
-
done
|
|
3271
|
-
done
|
|
3272
|
-
return 0 ;;
|
|
3273
|
-
--output|-o|--o)
|
|
3274
|
-
_files -/
|
|
3275
|
-
return 0 ;;
|
|
3276
|
-
esac
|
|
3277
|
-
if __tailor_worker_opt_takes_value "tailordb:erd:export" "${words[CURRENT-1]}"; then return 0; fi
|
|
3278
|
-
if (( _after_dd )); then return 0; fi
|
|
3279
|
-
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
3280
|
-
local -a _opts=()
|
|
3281
|
-
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to Tailor config file")
|
|
3282
|
-
__tailor_worker_not_used "--namespace" "-n" "--n" && _opts+=("--namespace:TailorDB namespace name (optional if only one namespace is defined in config)")
|
|
3283
|
-
__tailor_worker_not_used "--output" "-o" "--o" && _opts+=("--output:Output directory path for TailorDB ERD viewer files (writes to \`<outputDir>/<namespace>/dist\`)")
|
|
3284
|
-
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3285
|
-
__tailor_worker_cdescribe 'options' _opts
|
|
3286
|
-
return 0
|
|
3287
|
-
fi
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
__tailor_worker_complete_tailordb_erd_diff() {
|
|
3291
|
-
local -a _vals=()
|
|
3292
|
-
case "${words[CURRENT-1]}" in
|
|
3293
|
-
--base-html|--baseHtml)
|
|
3294
|
-
setopt local_options null_glob
|
|
3295
|
-
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3296
|
-
local -a _matchers=(".html")
|
|
3297
|
-
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3298
|
-
_dir="."
|
|
3299
|
-
_prefix="$_cur"
|
|
3300
|
-
elif [[ "$_cur" == */ ]]; then
|
|
3301
|
-
_dir="${_cur%/}"
|
|
3302
|
-
_prefix=""
|
|
3303
|
-
else
|
|
3304
|
-
_dir="${_cur%/*}"
|
|
3305
|
-
_prefix="${_cur##*/}"
|
|
3306
|
-
fi
|
|
3307
|
-
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3308
|
-
_out="${_f#./}"
|
|
3309
|
-
__tailor_worker_add_path_candidate "$_out"
|
|
3310
|
-
done
|
|
3311
|
-
local _pat
|
|
3312
|
-
for _pat in "${_matchers[@]}"; do
|
|
3313
|
-
[[ -n "$_pat" ]] || continue
|
|
3314
|
-
for _f in "$_dir"/${~_pat}(N.); do
|
|
3315
|
-
_out="${_f#./}"
|
|
3316
|
-
[[ "$_out" == "$_cur"* ]] && __tailor_worker_add_path_candidate "$_out"
|
|
3317
|
-
done
|
|
3318
|
-
done
|
|
3319
|
-
return 0 ;;
|
|
3320
|
-
--head-html|--headHtml)
|
|
3321
|
-
setopt local_options null_glob
|
|
3322
|
-
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3323
|
-
local -a _matchers=(".html")
|
|
3324
|
-
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3325
|
-
_dir="."
|
|
3326
|
-
_prefix="$_cur"
|
|
3327
|
-
elif [[ "$_cur" == */ ]]; then
|
|
3328
|
-
_dir="${_cur%/}"
|
|
3329
|
-
_prefix=""
|
|
3330
|
-
else
|
|
3331
|
-
_dir="${_cur%/*}"
|
|
3332
|
-
_prefix="${_cur##*/}"
|
|
3333
|
-
fi
|
|
3334
|
-
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3335
|
-
_out="${_f#./}"
|
|
3336
|
-
__tailor_worker_add_path_candidate "$_out"
|
|
3337
|
-
done
|
|
3338
|
-
local _pat
|
|
3339
|
-
for _pat in "${_matchers[@]}"; do
|
|
3340
|
-
[[ -n "$_pat" ]] || continue
|
|
3341
|
-
for _f in "$_dir"/${~_pat}(N.); do
|
|
3342
|
-
_out="${_f#./}"
|
|
3343
|
-
[[ "$_out" == "$_cur"* ]] && __tailor_worker_add_path_candidate "$_out"
|
|
3344
|
-
done
|
|
3345
|
-
done
|
|
3346
|
-
return 0 ;;
|
|
3347
|
-
--output|-o|--o)
|
|
3348
|
-
setopt local_options null_glob
|
|
3349
|
-
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3350
|
-
local -a _matchers=(".html")
|
|
3351
|
-
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3352
|
-
_dir="."
|
|
3353
|
-
_prefix="$_cur"
|
|
3354
|
-
elif [[ "$_cur" == */ ]]; then
|
|
3355
|
-
_dir="${_cur%/}"
|
|
3356
|
-
_prefix=""
|
|
3357
|
-
else
|
|
3358
|
-
_dir="${_cur%/*}"
|
|
3359
|
-
_prefix="${_cur##*/}"
|
|
3360
|
-
fi
|
|
3361
|
-
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3362
|
-
_out="${_f#./}"
|
|
3363
|
-
__tailor_worker_add_path_candidate "$_out"
|
|
3364
|
-
done
|
|
3365
|
-
local _pat
|
|
3366
|
-
for _pat in "${_matchers[@]}"; do
|
|
3367
|
-
[[ -n "$_pat" ]] || continue
|
|
3368
|
-
for _f in "$_dir"/${~_pat}(N.); do
|
|
3369
|
-
_out="${_f#./}"
|
|
3370
|
-
[[ "$_out" == "$_cur"* ]] && __tailor_worker_add_path_candidate "$_out"
|
|
3371
|
-
done
|
|
3372
|
-
done
|
|
3373
|
-
return 0 ;;
|
|
3374
|
-
--output-json|--outputJson)
|
|
3375
|
-
setopt local_options null_glob
|
|
3376
|
-
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3377
|
-
local -a _matchers=(".json")
|
|
3378
|
-
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3379
|
-
_dir="."
|
|
3380
|
-
_prefix="$_cur"
|
|
3381
|
-
elif [[ "$_cur" == */ ]]; then
|
|
3382
|
-
_dir="${_cur%/}"
|
|
3383
|
-
_prefix=""
|
|
3384
|
-
else
|
|
3385
|
-
_dir="${_cur%/*}"
|
|
3386
|
-
_prefix="${_cur##*/}"
|
|
3387
|
-
fi
|
|
3388
|
-
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3389
|
-
_out="${_f#./}"
|
|
3390
|
-
__tailor_worker_add_path_candidate "$_out"
|
|
3391
|
-
done
|
|
3392
|
-
local _pat
|
|
3393
|
-
for _pat in "${_matchers[@]}"; do
|
|
3394
|
-
[[ -n "$_pat" ]] || continue
|
|
3395
|
-
for _f in "$_dir"/${~_pat}(N.); do
|
|
3396
|
-
_out="${_f#./}"
|
|
3397
|
-
[[ "$_out" == "$_cur"* ]] && __tailor_worker_add_path_candidate "$_out"
|
|
3398
|
-
done
|
|
3399
|
-
done
|
|
3400
|
-
return 0 ;;
|
|
3401
|
-
esac
|
|
3402
|
-
if __tailor_worker_opt_takes_value "tailordb:erd:diff" "${words[CURRENT-1]}"; then return 0; fi
|
|
3403
|
-
if (( _after_dd )); then return 0; fi
|
|
3404
|
-
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
3405
|
-
local -a _opts=()
|
|
3406
|
-
__tailor_worker_not_used "--base-html" "--baseHtml" && _opts+=("--base-html:Base ERD viewer HTML file")
|
|
3407
|
-
__tailor_worker_not_used "--head-html" "--headHtml" && _opts+=("--head-html:Head ERD viewer HTML file")
|
|
3408
|
-
__tailor_worker_not_used "--namespace" "-n" "--n" && _opts+=("--namespace:TailorDB namespace name (defaults to the provided ERD schema namespace)")
|
|
3409
|
-
__tailor_worker_not_used "--output" "-o" "--o" && _opts+=("--output:Output ERD diff HTML file")
|
|
3410
|
-
__tailor_worker_not_used "--output-json" "--outputJson" && _opts+=("--output-json:Optional output JSON file for the computed diff")
|
|
3411
|
-
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3412
|
-
__tailor_worker_cdescribe 'options' _opts
|
|
3413
|
-
return 0
|
|
3414
|
-
fi
|
|
3415
|
-
}
|
|
3416
|
-
|
|
3417
|
-
__tailor_worker_complete_tailordb_erd_serve() {
|
|
3418
|
-
local -a _vals=()
|
|
3419
|
-
case "${words[CURRENT-1]}" in
|
|
3420
|
-
--config|-c|--c)
|
|
3421
|
-
setopt local_options null_glob
|
|
3422
|
-
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3423
|
-
local -a _exts=("ts")
|
|
3424
|
-
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3425
|
-
_dir="."
|
|
3426
|
-
_prefix="$_cur"
|
|
3427
|
-
elif [[ "$_cur" == */ ]]; then
|
|
3428
|
-
_dir="${_cur%/}"
|
|
3429
|
-
_prefix=""
|
|
3430
|
-
else
|
|
3431
|
-
_dir="${_cur%/*}"
|
|
3432
|
-
_prefix="${_cur##*/}"
|
|
3433
|
-
fi
|
|
3434
|
-
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3435
|
-
_out="${_f#./}"
|
|
3436
|
-
__tailor_worker_add_path_candidate "$_out"
|
|
3437
|
-
done
|
|
3438
|
-
local _ext
|
|
3439
|
-
for _f in "$_dir"/"$_prefix"*(N.); do
|
|
3440
|
-
_out="${_f#./}"
|
|
3441
|
-
for _ext in "${_exts[@]}"; do
|
|
3442
|
-
[[ -n "$_ext" && "$_out" == *."$_ext" ]] && { __tailor_worker_add_path_candidate "$_out"; break; }
|
|
3443
|
-
done
|
|
3444
|
-
done
|
|
3445
|
-
return 0 ;;
|
|
3446
|
-
esac
|
|
3447
|
-
if __tailor_worker_opt_takes_value "tailordb:erd:serve" "${words[CURRENT-1]}"; then return 0; fi
|
|
3448
|
-
if (( _after_dd )); then return 0; fi
|
|
3449
|
-
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
3450
|
-
local -a _opts=()
|
|
3451
|
-
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to Tailor config file")
|
|
3452
|
-
__tailor_worker_not_used "--namespace" "-n" "--n" && _opts+=("--namespace:TailorDB namespace name (uses first namespace in config if not specified)")
|
|
3453
|
-
__tailor_worker_not_used "--port" && _opts+=("--port:Local server port (0 selects a free port)")
|
|
3454
|
-
__tailor_worker_not_used "--open" && _opts+=("--open:Open the ERD viewer in the default browser")
|
|
3455
|
-
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3456
|
-
__tailor_worker_cdescribe 'options' _opts
|
|
3457
|
-
return 0
|
|
3458
|
-
fi
|
|
3459
|
-
}
|
|
3460
|
-
|
|
3461
|
-
__tailor_worker_complete_tailordb_erd_deploy() {
|
|
3462
|
-
local -a _vals=()
|
|
3463
|
-
case "${words[CURRENT-1]}" in
|
|
3464
|
-
--config|-c|--c)
|
|
3465
|
-
setopt local_options null_glob
|
|
3466
|
-
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3467
|
-
local -a _exts=("ts")
|
|
3468
|
-
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3469
|
-
_dir="."
|
|
3470
|
-
_prefix="$_cur"
|
|
3471
|
-
elif [[ "$_cur" == */ ]]; then
|
|
3472
|
-
_dir="${_cur%/}"
|
|
3473
|
-
_prefix=""
|
|
3474
|
-
else
|
|
3475
|
-
_dir="${_cur%/*}"
|
|
3476
|
-
_prefix="${_cur##*/}"
|
|
3477
|
-
fi
|
|
3478
|
-
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3479
|
-
_out="${_f#./}"
|
|
3480
|
-
__tailor_worker_add_path_candidate "$_out"
|
|
3481
|
-
done
|
|
3482
|
-
local _ext
|
|
3483
|
-
for _f in "$_dir"/"$_prefix"*(N.); do
|
|
3484
|
-
_out="${_f#./}"
|
|
3485
|
-
for _ext in "${_exts[@]}"; do
|
|
3486
|
-
[[ -n "$_ext" && "$_out" == *."$_ext" ]] && { __tailor_worker_add_path_candidate "$_out"; break; }
|
|
3487
|
-
done
|
|
3488
|
-
done
|
|
3489
|
-
return 0 ;;
|
|
3490
|
-
esac
|
|
3491
|
-
if __tailor_worker_opt_takes_value "tailordb:erd:deploy" "${words[CURRENT-1]}"; then return 0; fi
|
|
3492
|
-
if (( _after_dd )); then return 0; fi
|
|
3493
|
-
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
3494
|
-
local -a _opts=()
|
|
3495
|
-
__tailor_worker_not_used "--workspace-id" "--workspaceId" "-w" "--w" && _opts+=("--workspace-id:Workspace ID")
|
|
3496
|
-
__tailor_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
|
|
3497
|
-
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to Tailor config file")
|
|
3498
|
-
__tailor_worker_not_used "--namespace" "-n" "--n" && _opts+=("--namespace:TailorDB namespace name (optional - deploys all namespaces with erdSite if omitted)")
|
|
3499
|
-
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3500
|
-
__tailor_worker_cdescribe 'options' _opts
|
|
3501
|
-
return 0
|
|
3502
|
-
fi
|
|
3503
|
-
}
|
|
3504
|
-
|
|
3505
|
-
__tailor_worker_complete_tailordb_erd() {
|
|
3506
|
-
local -a _vals=()
|
|
3507
|
-
if __tailor_worker_opt_takes_value "tailordb:erd" "${words[CURRENT-1]}"; then return 0; fi
|
|
3508
|
-
if (( _after_dd )); then return 0; fi
|
|
3509
|
-
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
3510
|
-
local -a _opts=()
|
|
3511
|
-
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3512
|
-
__tailor_worker_cdescribe 'options' _opts
|
|
3513
|
-
return 0
|
|
3514
|
-
fi
|
|
3515
|
-
local -a _subs=("export:Export TailorDB ERD static viewer from local TailorDB schema." "diff:Render TailorDB ERD schema diff HTML from exported ERD viewers." "serve:Generate and serve TailorDB ERD locally with watch reload. (beta)" "deploy:Deploy ERD static website for TailorDB namespace(s).")
|
|
3516
|
-
__tailor_worker_cdescribe 'subcommands' _subs
|
|
3517
|
-
}
|
|
3518
|
-
|
|
3519
3234
|
__tailor_worker_complete_tailordb() {
|
|
3520
3235
|
local -a _vals=()
|
|
3521
3236
|
if __tailor_worker_opt_takes_value "tailordb" "${words[CURRENT-1]}"; then return 0; fi
|
|
@@ -3526,7 +3241,7 @@ __tailor_worker_complete_tailordb() {
|
|
|
3526
3241
|
__tailor_worker_cdescribe 'options' _opts
|
|
3527
3242
|
return 0
|
|
3528
3243
|
fi
|
|
3529
|
-
local -a _subs=("truncate:Truncate (delete all records from) TailorDB tables." "migration:Manage TailorDB schema migrations."
|
|
3244
|
+
local -a _subs=("truncate:Truncate (delete all records from) TailorDB tables." "migration:Manage TailorDB schema migrations.")
|
|
3530
3245
|
__tailor_worker_cdescribe 'subcommands' _subs
|
|
3531
3246
|
}
|
|
3532
3247
|
|
|
@@ -4017,6 +3732,7 @@ __tailor_worker_complete_workspace_create() {
|
|
|
4017
3732
|
__tailor_worker_not_used "--organization-id" "--organizationId" "-o" "--o" && _opts+=("--organization-id:Organization ID to workspace associate with")
|
|
4018
3733
|
__tailor_worker_not_used "--folder-id" "--folderId" "-f" "--f" && _opts+=("--folder-id:Folder ID to workspace associate with")
|
|
4019
3734
|
__tailor_worker_not_used "--profile-name" "--profileName" "-p" "--p" && _opts+=("--profile-name:Profile name to create")
|
|
3735
|
+
__tailor_worker_not_used "--profile" && _opts+=("--profile:Workspace profile used for authentication and Platform selection")
|
|
4020
3736
|
__tailor_worker_not_used "--profile-user" "--profileUser" && _opts+=("--profile-user:User email address or machine user client ID for the profile (defaults to current user)")
|
|
4021
3737
|
__tailor_worker_not_used "--permission" && _opts+=("--permission:Profile permission (requires --profile-name). 'read' blocks all write commands while the profile is active.")
|
|
4022
3738
|
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
@@ -4067,6 +3783,7 @@ __tailor_worker_complete_workspace_list() {
|
|
|
4067
3783
|
local -a _opts=()
|
|
4068
3784
|
__tailor_worker_not_used "--order" && _opts+=("--order:Sort order (asc or desc)")
|
|
4069
3785
|
__tailor_worker_not_used "--limit" "-l" "--l" && _opts+=("--limit:Maximum number of items to return (0 or omit\: unlimited)")
|
|
3786
|
+
__tailor_worker_not_used "--profile" && _opts+=("--profile:Workspace profile used for authentication and Platform selection")
|
|
4070
3787
|
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
4071
3788
|
__tailor_worker_cdescribe 'options' _opts
|
|
4072
3789
|
return 0
|
|
@@ -4458,11 +4175,6 @@ _tailor_worker_completions() {
|
|
|
4458
4175
|
tailordb:migration:status) __tailor_worker_complete_tailordb_migration_status ;;
|
|
4459
4176
|
tailordb:migration:sync) __tailor_worker_complete_tailordb_migration_sync ;;
|
|
4460
4177
|
tailordb:migration) __tailor_worker_complete_tailordb_migration ;;
|
|
4461
|
-
tailordb:erd:export) __tailor_worker_complete_tailordb_erd_export ;;
|
|
4462
|
-
tailordb:erd:diff) __tailor_worker_complete_tailordb_erd_diff ;;
|
|
4463
|
-
tailordb:erd:serve) __tailor_worker_complete_tailordb_erd_serve ;;
|
|
4464
|
-
tailordb:erd:deploy) __tailor_worker_complete_tailordb_erd_deploy ;;
|
|
4465
|
-
tailordb:erd) __tailor_worker_complete_tailordb_erd ;;
|
|
4466
4178
|
tailordb) __tailor_worker_complete_tailordb ;;
|
|
4467
4179
|
upgrade) __tailor_worker_complete_upgrade ;;
|
|
4468
4180
|
user:current) __tailor_worker_complete_user_current ;;
|
|
@@ -9,15 +9,18 @@ import { LogLevelEnum } from "../../types/app-config.generated.mjs";
|
|
|
9
9
|
//#region src/configure/config/types.d.ts
|
|
10
10
|
type LogLevel = LogLevelEnum;
|
|
11
11
|
type LogLevelInput = LogLevel | (string & {});
|
|
12
|
+
/** `files`/`ignores` patterns are resolved relative to this config's own directory, not the invocation directory. */
|
|
12
13
|
type ExecutorServiceConfig = {
|
|
13
14
|
files: string[];
|
|
14
15
|
ignores?: string[];
|
|
15
16
|
};
|
|
16
17
|
type ExecutorServiceInput = ExecutorServiceConfig;
|
|
18
|
+
/** `files`/`ignores` patterns are resolved relative to this config's own directory, not the invocation directory. */
|
|
17
19
|
type HttpAdapterServiceInput = {
|
|
18
20
|
files: string[];
|
|
19
21
|
ignores?: string[];
|
|
20
22
|
};
|
|
23
|
+
/** `files`/`ignores` patterns are resolved relative to this config's own directory, not the invocation directory. */
|
|
21
24
|
type ResolverServiceConfig = {
|
|
22
25
|
files: string[];
|
|
23
26
|
ignores?: string[];
|
|
@@ -29,6 +32,7 @@ type ResolverServiceInput = {
|
|
|
29
32
|
[namespace: string]: ResolverServiceConfig | ResolverExternalConfig;
|
|
30
33
|
};
|
|
31
34
|
type WorkflowServiceConfig = {
|
|
35
|
+
/** Resolved relative to this config's own directory, not the invocation directory. */
|
|
32
36
|
files: string[];
|
|
33
37
|
job_files?: string[];
|
|
34
38
|
ignores?: string[];
|
|
@@ -47,7 +51,7 @@ type WorkflowServiceInput = WorkflowServiceConfig;
|
|
|
47
51
|
* - `idp`: Array of IdP configs, e.g. `[myIdp]`
|
|
48
52
|
* - `staticWebsites`: Array of static website configs, e.g. `[website]`
|
|
49
53
|
* - `aiGateways`: Array of AI Gateway configs, e.g. `[gateway]`
|
|
50
|
-
* - `db`, `resolver`, `executor`, `workflow`: Service configs with file globs
|
|
54
|
+
* - `db`, `resolver`, `executor`, `workflow`, `httpAdapter`: Service configs with file globs (resolved relative to this config file's own directory, not the invocation directory)
|
|
51
55
|
*/
|
|
52
56
|
interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[], AIGateways extends AIGatewayConfig[] = AIGatewayConfig[], Env extends Record<string, string | number | boolean> = Record<string, string | number | boolean>> {
|
|
53
57
|
/** Application name (required). */
|
package/dist/configure/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as parseInternal, n as mapAllowedValues, t as db } from "../schema--xYWRGfe.mjs";
|
|
2
2
|
import { t as brandValue } from "../brand-Eo4pLXPJ.mjs";
|
|
3
|
-
import { a as registerJob, n as
|
|
3
|
+
import { a as registerJob, n as dispatchStartJob, r as dispatchStartWorkflow } from "../registry-i7EdJ-D5.mjs";
|
|
4
4
|
import { i as withWorkflowTestInvoker } from "../test-env-key-D7UkZp99.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/configure/types/type.ts
|
|
@@ -61,7 +61,6 @@ function createTailorField(type, options, fields, values, metadata) {
|
|
|
61
61
|
pathArray: []
|
|
62
62
|
});
|
|
63
63
|
},
|
|
64
|
-
_parseInternal: parseInternal$1,
|
|
65
64
|
clone() {
|
|
66
65
|
let clonedFields = fields;
|
|
67
66
|
if (fields) {
|
|
@@ -622,10 +621,10 @@ function defineWorkflowExecutionPolicy(name, def) {
|
|
|
622
621
|
* }));
|
|
623
622
|
*
|
|
624
623
|
* // In a workflow job function:
|
|
625
|
-
* await tailor.workflow.
|
|
624
|
+
* await tailor.workflow.startJobFunction("worker", args, {
|
|
626
625
|
* executionPolicyKey: executionPolicies.premium.key,
|
|
627
626
|
* });
|
|
628
|
-
* await tailor.workflow.
|
|
627
|
+
* await tailor.workflow.startJobFunction("worker", args, {
|
|
629
628
|
* executionPolicyKey: executionPolicies["tenant-api"].keyFor(input.tenantId),
|
|
630
629
|
* });
|
|
631
630
|
*/
|
|
@@ -665,7 +664,7 @@ function defineWorkflowExecutionPolicies(builder, options) {
|
|
|
665
664
|
* @param config - Job configuration with name and body function.
|
|
666
665
|
* @param config.name - Unique job name across the project.
|
|
667
666
|
* @param config.body - Function that processes the job input.
|
|
668
|
-
* @returns A WorkflowJob that can be
|
|
667
|
+
* @returns A WorkflowJob that can be started from other jobs.
|
|
669
668
|
* @example
|
|
670
669
|
* // Simple job with async body:
|
|
671
670
|
* export const fetchData = createWorkflowJob({
|
|
@@ -680,8 +679,8 @@ function defineWorkflowExecutionPolicies(builder, options) {
|
|
|
680
679
|
* export const orchestrate = createWorkflowJob({
|
|
681
680
|
* name: "orchestrate",
|
|
682
681
|
* body: (input: { orderId: string }) => {
|
|
683
|
-
* const inventory = checkInventory.
|
|
684
|
-
* const payment = processPayment.
|
|
682
|
+
* const inventory = checkInventory.start({ orderId: input.orderId });
|
|
683
|
+
* const payment = processPayment.start({ orderId: input.orderId });
|
|
685
684
|
* return { inventory, payment };
|
|
686
685
|
* },
|
|
687
686
|
* });
|
|
@@ -690,14 +689,14 @@ function createWorkflowJob(config) {
|
|
|
690
689
|
const userBody = config.body;
|
|
691
690
|
const body = process.env.__TAILOR_PLATFORM_BUNDLE ? userBody : (input, context) => withWorkflowTestInvoker(context.invoker, () => userBody(input, context));
|
|
692
691
|
if (!process.env.__TAILOR_PLATFORM_BUNDLE) registerJob(config.name, body);
|
|
693
|
-
const
|
|
694
|
-
throw new Error("This workflow job's .
|
|
695
|
-
} : function
|
|
696
|
-
return arguments.length >= 2 ?
|
|
692
|
+
const start = process.env.__TAILOR_PLATFORM_BUNDLE ? () => {
|
|
693
|
+
throw new Error("This workflow job's .start() is rewritten at build time and is unavailable in the bundle");
|
|
694
|
+
} : function start(args, options) {
|
|
695
|
+
return arguments.length >= 2 ? dispatchStartJob(config.name, args, options) : dispatchStartJob(config.name, args);
|
|
697
696
|
};
|
|
698
697
|
return brandValue({
|
|
699
698
|
name: config.name,
|
|
700
|
-
|
|
699
|
+
start,
|
|
701
700
|
body
|
|
702
701
|
}, "workflow-job");
|
|
703
702
|
}
|
|
@@ -788,8 +787,8 @@ function createWaitPoints(builder) {
|
|
|
788
787
|
//#endregion
|
|
789
788
|
//#region src/configure/services/workflow/workflow.ts
|
|
790
789
|
/**
|
|
791
|
-
* Create a workflow definition that can be
|
|
792
|
-
* In production, bundler
|
|
790
|
+
* Create a workflow definition that can be started via the Tailor SDK.
|
|
791
|
+
* In production, the bundler rewrites `.start()` calls into direct platform workflow calls.
|
|
793
792
|
*
|
|
794
793
|
* The workflow MUST be the default export of the file.
|
|
795
794
|
* All jobs referenced by the workflow MUST be named exports.
|
|
@@ -801,7 +800,7 @@ function createWaitPoints(builder) {
|
|
|
801
800
|
* export const processData = createWorkflowJob({
|
|
802
801
|
* name: "process-data",
|
|
803
802
|
* body: (input: { id: string }) => {
|
|
804
|
-
* const data = fetchData.
|
|
803
|
+
* const data = fetchData.start({ id: input.id });
|
|
805
804
|
* return { data };
|
|
806
805
|
* },
|
|
807
806
|
* });
|
|
@@ -815,9 +814,11 @@ function createWaitPoints(builder) {
|
|
|
815
814
|
function createWorkflow(config) {
|
|
816
815
|
return brandValue({
|
|
817
816
|
...config,
|
|
818
|
-
|
|
819
|
-
throw new Error("workflow.
|
|
820
|
-
} : async (args, options)
|
|
817
|
+
start: process.env.__TAILOR_PLATFORM_BUNDLE ? async () => {
|
|
818
|
+
throw new Error("workflow.start() is rewritten at build time and unavailable in the bundle");
|
|
819
|
+
} : async function start(args, options) {
|
|
820
|
+
return arguments.length >= 2 ? await dispatchStartWorkflow(config.name, args, options) : await dispatchStartWorkflow(config.name, args);
|
|
821
|
+
}
|
|
821
822
|
}, "workflow");
|
|
822
823
|
}
|
|
823
824
|
|