@tailor-platform/sdk 2.0.1 → 2.2.0
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 +117 -0
- package/{dist/cli/index.mjs → bin/tailor.mjs} +1 -1
- package/dist/{application-CM6hKnSK.mjs → application-BpLeawBg.mjs} +126 -28
- package/dist/application-BpLeawBg.mjs.map +1 -0
- package/dist/application-BxLLiLsr.mjs +3 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +2 -1
- package/dist/cli/commands/deploy/types.d.mts +2 -1
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -4
- package/dist/cli/commands/tailordb/migrate/file-state.d.mts +1 -0
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +2 -2
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +8 -1
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +5 -3
- package/dist/cli/lib.d.mts +4 -4
- package/dist/cli/lib.mjs +3 -482
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +997 -202
- package/dist/cli/main.mjs.map +1 -1
- package/dist/completion/zsh-worker.zsh +145 -2
- package/dist/configure/config/types.d.mts +12 -1
- package/dist/configure/index.d.mts +3 -3
- package/dist/configure/services/index.d.mts +3 -2
- package/dist/configure/services/resolver/index.d.mts +1 -1
- package/dist/configure/services/resolver/resolver.d.mts +1 -1
- package/dist/configure/services/tailordb/index.d.mts +2 -1
- package/dist/configure/services/tailordb/schema.d.mts +46 -46
- package/dist/configure/services/tailordb/types.d.mts +30 -4
- package/dist/{crashreport-B5LqCTfF.mjs → crashreport-CIIfLnoO.mjs} +2 -2
- package/dist/{crashreport-B5LqCTfF.mjs.map → crashreport-CIIfLnoO.mjs.map} +1 -1
- package/dist/{crashreport-eI7ty7ok.mjs → crashreport-CINZ5dVN.mjs} +1 -1
- package/dist/errors-CWj21238.mjs +75 -0
- package/dist/errors-CWj21238.mjs.map +1 -0
- package/dist/{globals-TfAVItuK.mjs → globals-B2nlxBrz.mjs} +2 -10
- package/dist/globals-B2nlxBrz.mjs.map +1 -0
- package/dist/kysely/index.d.mts +52 -5
- package/dist/kysely/index.mjs +7 -2
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/{logger-CXQq9YIp.mjs → logger-DSdExfor.mjs} +83 -42
- package/dist/logger-DSdExfor.mjs.map +1 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/{register-ts-hook-LYV7zH-e.mjs → register-ts-hook-CTth1eqj.mjs} +1587 -272
- package/dist/register-ts-hook-CTth1eqj.mjs.map +1 -0
- package/dist/runtime/globals.d.mts +0 -7
- package/dist/runtime/workflow.d.mts +2 -7
- package/dist/schema--xYWRGfe.mjs.map +1 -1
- package/dist/seed/index.d.mts +52 -3
- package/dist/seed/index.mjs +200 -44
- package/dist/seed/index.mjs.map +1 -1
- package/dist/{seed-B-yckgQY.mjs → seed-xqM9WIHP.mjs} +8 -8
- package/dist/seed-xqM9WIHP.mjs.map +1 -0
- package/dist/{service-B5WynBHQ.mjs → service-CCwl3Avt.mjs} +3 -3
- package/dist/{service-B5WynBHQ.mjs.map → service-CCwl3Avt.mjs.map} +1 -1
- package/dist/service-_XmjSEGr.mjs +3 -0
- package/dist/{service-k1xy_A5G.mjs → service-goqlJJgA.mjs} +2 -2
- package/dist/{service-k1xy_A5G.mjs.map → service-goqlJJgA.mjs.map} +1 -1
- package/dist/{service_pb-D5--My_M.mjs → service_pb-BEWj1pOV.mjs} +2 -2
- package/dist/{service_pb-D5--My_M.mjs.map → service_pb-BEWj1pOV.mjs.map} +1 -1
- package/dist/{service_pb-i8CmnQP4.mjs → service_pb-BjlhvK9E.mjs} +1 -1
- package/dist/utils/test/index.d.mts +9 -3
- package/dist/utils/test/index.mjs +49 -25
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +2 -1
- package/dist/vitest/index.mjs +84 -2
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/file.d.mts +1 -1
- package/dist/vitest/pglite-kysely.d.mts +43 -0
- package/dist/vitest/setup.mjs +1 -1
- package/dist/workflow-Bamae_Yc.mjs.map +1 -1
- package/dist/{workspace_resource_pb-DXnO2AT-.mjs → workspace_resource_pb-HNIL_Vfj.mjs} +10 -2
- package/dist/{workspace_resource_pb-DXnO2AT-.mjs.map → workspace_resource_pb-HNIL_Vfj.mjs.map} +1 -1
- package/docs/cli/tailordb.md +87 -22
- package/docs/cli-reference.md +13 -11
- package/docs/configuration.md +4 -1
- package/docs/migration/v2.md +1 -1
- package/docs/plugin/custom.md +48 -48
- package/docs/plugin/index.md +24 -24
- package/docs/services/auth.md +10 -10
- package/docs/services/executor.md +1 -1
- package/docs/services/resolver.md +34 -2
- package/docs/services/tailordb-migration.md +375 -76
- package/docs/services/tailordb.md +28 -28
- package/docs/testing.md +3 -1
- package/package.json +13 -8
- package/dist/application-CM6hKnSK.mjs.map +0 -1
- package/dist/application-CXNaUNhv.mjs +0 -3
- package/dist/errors-D7583Zz7.mjs +0 -58
- package/dist/errors-D7583Zz7.mjs.map +0 -1
- package/dist/globals-TfAVItuK.mjs.map +0 -1
- package/dist/logger-CXQq9YIp.mjs.map +0 -1
- package/dist/register-ts-hook-LYV7zH-e.mjs.map +0 -1
- package/dist/seed-B-yckgQY.mjs.map +0 -1
- package/dist/service-M7OYziQP.mjs +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# politty-completion-version: 1
|
|
2
|
-
# politty-bin-sig:
|
|
2
|
+
# politty-bin-sig: 1786155894
|
|
3
3
|
# politty-bin-path: /home/runner/work/sdk/sdk/node_modules/.bin/tailor
|
|
4
4
|
# program: tailor
|
|
5
5
|
# shell: zsh
|
|
@@ -739,6 +739,10 @@ __tailor_worker_opt_takes_value() {
|
|
|
739
739
|
tailordb:truncate:--namespace|tailordb:truncate:-n|tailordb:truncate:--n) return 0 ;;
|
|
740
740
|
tailordb:migration:generate:--config|tailordb:migration:generate:-c|tailordb:migration:generate:--c) return 0 ;;
|
|
741
741
|
tailordb:migration:generate:--name|tailordb:migration:generate:-n|tailordb:migration:generate:--n) return 0 ;;
|
|
742
|
+
tailordb:migration:rebaseline:--workspace-id|tailordb:migration:rebaseline:--workspaceId|tailordb:migration:rebaseline:-w|tailordb:migration:rebaseline:--w) return 0 ;;
|
|
743
|
+
tailordb:migration:rebaseline:--profile|tailordb:migration:rebaseline:-p|tailordb:migration:rebaseline:--p) return 0 ;;
|
|
744
|
+
tailordb:migration:rebaseline:--config|tailordb:migration:rebaseline:-c|tailordb:migration:rebaseline:--c) return 0 ;;
|
|
745
|
+
tailordb:migration:rebaseline:--namespace|tailordb:migration:rebaseline:-n|tailordb:migration:rebaseline:--n) return 0 ;;
|
|
742
746
|
tailordb:migration:script:--config|tailordb:migration:script:-c|tailordb:migration:script:--c) return 0 ;;
|
|
743
747
|
tailordb:migration:script:--namespace|tailordb:migration:script:-n|tailordb:migration:script:--n) return 0 ;;
|
|
744
748
|
tailordb:migration:script:--reason) return 0 ;;
|
|
@@ -754,6 +758,14 @@ __tailor_worker_opt_takes_value() {
|
|
|
754
758
|
tailordb:migration:sync:--profile|tailordb:migration:sync:-p|tailordb:migration:sync:--p) return 0 ;;
|
|
755
759
|
tailordb:migration:sync:--config|tailordb:migration:sync:-c|tailordb:migration:sync:--c) return 0 ;;
|
|
756
760
|
tailordb:migration:sync:--namespace|tailordb:migration:sync:-n|tailordb:migration:sync:--n) return 0 ;;
|
|
761
|
+
tailordb:migration:test:--workspace-id|tailordb:migration:test:--workspaceId|tailordb:migration:test:-w|tailordb:migration:test:--w) return 0 ;;
|
|
762
|
+
tailordb:migration:test:--profile|tailordb:migration:test:-p|tailordb:migration:test:--p) return 0 ;;
|
|
763
|
+
tailordb:migration:test:--config|tailordb:migration:test:-c|tailordb:migration:test:--c) return 0 ;;
|
|
764
|
+
tailordb:migration:test:--data) return 0 ;;
|
|
765
|
+
tailordb:migration:test:--target-workspace-id|tailordb:migration:test:--targetWorkspaceId) return 0 ;;
|
|
766
|
+
tailordb:migration:test:--assert) return 0 ;;
|
|
767
|
+
tailordb:migration:test:--assert-namespace|tailordb:migration:test:--assertNamespace) return 0 ;;
|
|
768
|
+
tailordb:migration:test:--machine-user|tailordb:migration:test:--machineUser) return 0 ;;
|
|
757
769
|
tailordb:migration:validate:--workspace-id|tailordb:migration:validate:--workspaceId|tailordb:migration:validate:-w|tailordb:migration:validate:--w) return 0 ;;
|
|
758
770
|
tailordb:migration:validate:--profile|tailordb:migration:validate:-p|tailordb:migration:validate:--p) return 0 ;;
|
|
759
771
|
tailordb:migration:validate:--config|tailordb:migration:validate:-c|tailordb:migration:validate:--c) return 0 ;;
|
|
@@ -946,10 +958,12 @@ __tailor_worker_is_subcmd() {
|
|
|
946
958
|
:staticwebsite) return 0 ;;
|
|
947
959
|
tailordb:truncate) return 0 ;;
|
|
948
960
|
tailordb:migration:generate) return 0 ;;
|
|
961
|
+
tailordb:migration:rebaseline) return 0 ;;
|
|
949
962
|
tailordb:migration:script) return 0 ;;
|
|
950
963
|
tailordb:migration:set) return 0 ;;
|
|
951
964
|
tailordb:migration:status) return 0 ;;
|
|
952
965
|
tailordb:migration:sync) return 0 ;;
|
|
966
|
+
tailordb:migration:test) return 0 ;;
|
|
953
967
|
tailordb:migration:validate) return 0 ;;
|
|
954
968
|
tailordb:migration) return 0 ;;
|
|
955
969
|
:tailordb) return 0 ;;
|
|
@@ -3027,6 +3041,51 @@ __tailor_worker_complete_tailordb_migration_generate() {
|
|
|
3027
3041
|
fi
|
|
3028
3042
|
}
|
|
3029
3043
|
|
|
3044
|
+
__tailor_worker_complete_tailordb_migration_rebaseline() {
|
|
3045
|
+
local -a _vals=()
|
|
3046
|
+
case "${words[CURRENT-1]}" in
|
|
3047
|
+
--config|-c|--c)
|
|
3048
|
+
setopt local_options null_glob
|
|
3049
|
+
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3050
|
+
local -a _exts=("ts")
|
|
3051
|
+
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3052
|
+
_dir="."
|
|
3053
|
+
_prefix="$_cur"
|
|
3054
|
+
elif [[ "$_cur" == */ ]]; then
|
|
3055
|
+
_dir="${_cur%/}"
|
|
3056
|
+
_prefix=""
|
|
3057
|
+
else
|
|
3058
|
+
_dir="${_cur%/*}"
|
|
3059
|
+
_prefix="${_cur##*/}"
|
|
3060
|
+
fi
|
|
3061
|
+
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3062
|
+
_out="${_f#./}"
|
|
3063
|
+
__tailor_worker_add_path_candidate "$_out"
|
|
3064
|
+
done
|
|
3065
|
+
local _ext
|
|
3066
|
+
for _f in "$_dir"/"$_prefix"*(N.); do
|
|
3067
|
+
_out="${_f#./}"
|
|
3068
|
+
for _ext in "${_exts[@]}"; do
|
|
3069
|
+
[[ -n "$_ext" && "$_out" == *."$_ext" ]] && { __tailor_worker_add_path_candidate "$_out"; break; }
|
|
3070
|
+
done
|
|
3071
|
+
done
|
|
3072
|
+
return 0 ;;
|
|
3073
|
+
esac
|
|
3074
|
+
if __tailor_worker_opt_takes_value "tailordb:migration:rebaseline" "${words[CURRENT-1]}"; then return 0; fi
|
|
3075
|
+
if (( _after_dd )); then return 0; fi
|
|
3076
|
+
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
3077
|
+
local -a _opts=()
|
|
3078
|
+
__tailor_worker_not_used "--workspace-id" "--workspaceId" "-w" "--w" && _opts+=("--workspace-id:Workspace ID")
|
|
3079
|
+
__tailor_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
|
|
3080
|
+
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to Tailor config file")
|
|
3081
|
+
__tailor_worker_not_used "--yes" "-y" "--y" && _opts+=("--yes:Skip confirmation prompts")
|
|
3082
|
+
__tailor_worker_not_used "--namespace" "-n" "--n" && _opts+=("--namespace:Target TailorDB namespace (required if multiple namespaces exist)")
|
|
3083
|
+
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3084
|
+
__tailor_worker_cdescribe 'options' _opts
|
|
3085
|
+
return 0
|
|
3086
|
+
fi
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3030
3089
|
__tailor_worker_complete_tailordb_migration_script() {
|
|
3031
3090
|
local -a _vals=()
|
|
3032
3091
|
case "${words[CURRENT-1]}" in
|
|
@@ -3071,6 +3130,7 @@ __tailor_worker_complete_tailordb_migration_script() {
|
|
|
3071
3130
|
__tailor_worker_not_used "--namespace" "-n" "--n" && _opts+=("--namespace:Target TailorDB namespace (required if multiple namespaces exist)")
|
|
3072
3131
|
__tailor_worker_not_used "--no-script" "--noScript" && _opts+=("--no-script:Record that this migration intentionally runs without a migration script (requires --reason)")
|
|
3073
3132
|
__tailor_worker_not_used "--reason" && _opts+=("--reason:Reason why no migration script is needed (used with --no-script)")
|
|
3133
|
+
__tailor_worker_not_used "--with-test" "--withTest" && _opts+=("--with-test:Also add a migrate.test.ts unit-test scaffold; when migrate.ts already exists, only the test is added")
|
|
3074
3134
|
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3075
3135
|
__tailor_worker_cdescribe 'options' _opts
|
|
3076
3136
|
return 0
|
|
@@ -3235,6 +3295,86 @@ __tailor_worker_complete_tailordb_migration_sync() {
|
|
|
3235
3295
|
esac
|
|
3236
3296
|
}
|
|
3237
3297
|
|
|
3298
|
+
__tailor_worker_complete_tailordb_migration_test() {
|
|
3299
|
+
local -a _vals=()
|
|
3300
|
+
case "${words[CURRENT-1]}" in
|
|
3301
|
+
--config|-c|--c)
|
|
3302
|
+
setopt local_options null_glob
|
|
3303
|
+
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3304
|
+
local -a _exts=("ts")
|
|
3305
|
+
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3306
|
+
_dir="."
|
|
3307
|
+
_prefix="$_cur"
|
|
3308
|
+
elif [[ "$_cur" == */ ]]; then
|
|
3309
|
+
_dir="${_cur%/}"
|
|
3310
|
+
_prefix=""
|
|
3311
|
+
else
|
|
3312
|
+
_dir="${_cur%/*}"
|
|
3313
|
+
_prefix="${_cur##*/}"
|
|
3314
|
+
fi
|
|
3315
|
+
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3316
|
+
_out="${_f#./}"
|
|
3317
|
+
__tailor_worker_add_path_candidate "$_out"
|
|
3318
|
+
done
|
|
3319
|
+
local _ext
|
|
3320
|
+
for _f in "$_dir"/"$_prefix"*(N.); do
|
|
3321
|
+
_out="${_f#./}"
|
|
3322
|
+
for _ext in "${_exts[@]}"; do
|
|
3323
|
+
[[ -n "$_ext" && "$_out" == *."$_ext" ]] && { __tailor_worker_add_path_candidate "$_out"; break; }
|
|
3324
|
+
done
|
|
3325
|
+
done
|
|
3326
|
+
return 0 ;;
|
|
3327
|
+
--data)
|
|
3328
|
+
_vals=("seed" "clone")
|
|
3329
|
+
__tailor_worker_cdescribe 'completions' _vals
|
|
3330
|
+
return 0 ;;
|
|
3331
|
+
--assert)
|
|
3332
|
+
setopt local_options null_glob
|
|
3333
|
+
local _cur="${words[CURRENT]:-}" _dir _prefix _f _out
|
|
3334
|
+
local -a _exts=("ts")
|
|
3335
|
+
if [[ -z "$_cur" || "$_cur" != */* ]]; then
|
|
3336
|
+
_dir="."
|
|
3337
|
+
_prefix="$_cur"
|
|
3338
|
+
elif [[ "$_cur" == */ ]]; then
|
|
3339
|
+
_dir="${_cur%/}"
|
|
3340
|
+
_prefix=""
|
|
3341
|
+
else
|
|
3342
|
+
_dir="${_cur%/*}"
|
|
3343
|
+
_prefix="${_cur##*/}"
|
|
3344
|
+
fi
|
|
3345
|
+
for _f in "$_dir"/"$_prefix"*(N/); do
|
|
3346
|
+
_out="${_f#./}"
|
|
3347
|
+
__tailor_worker_add_path_candidate "$_out"
|
|
3348
|
+
done
|
|
3349
|
+
local _ext
|
|
3350
|
+
for _f in "$_dir"/"$_prefix"*(N.); do
|
|
3351
|
+
_out="${_f#./}"
|
|
3352
|
+
for _ext in "${_exts[@]}"; do
|
|
3353
|
+
[[ -n "$_ext" && "$_out" == *."$_ext" ]] && { __tailor_worker_add_path_candidate "$_out"; break; }
|
|
3354
|
+
done
|
|
3355
|
+
done
|
|
3356
|
+
return 0 ;;
|
|
3357
|
+
esac
|
|
3358
|
+
if __tailor_worker_opt_takes_value "tailordb:migration:test" "${words[CURRENT-1]}"; then return 0; fi
|
|
3359
|
+
if (( _after_dd )); then return 0; fi
|
|
3360
|
+
if [[ "${words[CURRENT]}" == -* ]]; then
|
|
3361
|
+
local -a _opts=()
|
|
3362
|
+
__tailor_worker_not_used "--workspace-id" "--workspaceId" "-w" "--w" && _opts+=("--workspace-id:Workspace ID")
|
|
3363
|
+
__tailor_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
|
|
3364
|
+
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to Tailor config file")
|
|
3365
|
+
__tailor_worker_not_used "--yes" "-y" "--y" && _opts+=("--yes:Acknowledge that a designated target workspace may be overwritten")
|
|
3366
|
+
__tailor_worker_not_used "--data" && _opts+=("--data:Data source for the migration test (seed or clone)")
|
|
3367
|
+
__tailor_worker_not_used "--target-workspace-id" "--targetWorkspaceId" && _opts+=("--target-workspace-id:Existing throwaway workspace to retain after the test (requires --yes)")
|
|
3368
|
+
__tailor_worker_not_used "--keep" && _opts+=("--keep:Keep the automatically created workspace after the test")
|
|
3369
|
+
__tailor_worker_not_used "--assert" && _opts+=("--assert:Path to a TypeScript assertion script to run after migrations")
|
|
3370
|
+
__tailor_worker_not_used "--assert-namespace" "--assertNamespace" && _opts+=("--assert-namespace:TailorDB namespace exposed to the assertion script")
|
|
3371
|
+
__tailor_worker_not_used "--machine-user" "--machineUser" && _opts+=("--machine-user:Machine user for seed and assertion script execution")
|
|
3372
|
+
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3373
|
+
__tailor_worker_cdescribe 'options' _opts
|
|
3374
|
+
return 0
|
|
3375
|
+
fi
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3238
3378
|
__tailor_worker_complete_tailordb_migration_validate() {
|
|
3239
3379
|
local -a _vals=()
|
|
3240
3380
|
case "${words[CURRENT-1]}" in
|
|
@@ -3273,6 +3413,7 @@ __tailor_worker_complete_tailordb_migration_validate() {
|
|
|
3273
3413
|
__tailor_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
|
|
3274
3414
|
__tailor_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to Tailor config file")
|
|
3275
3415
|
__tailor_worker_not_used "--namespace" "-n" "--n" && _opts+=("--namespace:Target TailorDB namespace (validates all namespaces if not specified)")
|
|
3416
|
+
__tailor_worker_not_used "--strict" && _opts+=("--strict:Also fail when a pending migration can drop data without an acknowledgment")
|
|
3276
3417
|
__tailor_worker_not_used "--help" && _opts+=("--help:Show help")
|
|
3277
3418
|
__tailor_worker_cdescribe 'options' _opts
|
|
3278
3419
|
return 0
|
|
@@ -3289,7 +3430,7 @@ __tailor_worker_complete_tailordb_migration() {
|
|
|
3289
3430
|
__tailor_worker_cdescribe 'options' _opts
|
|
3290
3431
|
return 0
|
|
3291
3432
|
fi
|
|
3292
|
-
local -a _subs=("generate:Generate migration files by detecting schema differences between current local types and the previous migration snapshot." "script:Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none." "set:Set migration checkpoint to a specific number." "status:Show the current migration status for TailorDB namespaces, including applied and pending migrations." "sync:Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift)." "validate:Validate the full migration history and
|
|
3433
|
+
local -a _subs=("generate:Generate migration files by detecting schema differences between current local types and the previous migration snapshot." "rebaseline:Collapse the full migration history into a new 0000 baseline." "script:Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none." "set:Set migration checkpoint to a specific number." "status:Show the current migration status for TailorDB namespaces, including applied and pending migrations." "sync:Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift)." "test:Test pending migrations with seed fixtures or cloned data in a temporary workspace." "validate:Validate the full migration history, unreviewed generated migration scripts, and schema drift (local types vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found.")
|
|
3293
3434
|
__tailor_worker_cdescribe 'subcommands' _subs
|
|
3294
3435
|
}
|
|
3295
3436
|
|
|
@@ -4232,10 +4373,12 @@ _tailor_worker_completions() {
|
|
|
4232
4373
|
staticwebsite) __tailor_worker_complete_staticwebsite ;;
|
|
4233
4374
|
tailordb:truncate) __tailor_worker_complete_tailordb_truncate ;;
|
|
4234
4375
|
tailordb:migration:generate) __tailor_worker_complete_tailordb_migration_generate ;;
|
|
4376
|
+
tailordb:migration:rebaseline) __tailor_worker_complete_tailordb_migration_rebaseline ;;
|
|
4235
4377
|
tailordb:migration:script) __tailor_worker_complete_tailordb_migration_script ;;
|
|
4236
4378
|
tailordb:migration:set) __tailor_worker_complete_tailordb_migration_set ;;
|
|
4237
4379
|
tailordb:migration:status) __tailor_worker_complete_tailordb_migration_status ;;
|
|
4238
4380
|
tailordb:migration:sync) __tailor_worker_complete_tailordb_migration_sync ;;
|
|
4381
|
+
tailordb:migration:test) __tailor_worker_complete_tailordb_migration_test ;;
|
|
4239
4382
|
tailordb:migration:validate) __tailor_worker_complete_tailordb_migration_validate ;;
|
|
4240
4383
|
tailordb:migration) __tailor_worker_complete_tailordb_migration ;;
|
|
4241
4384
|
tailordb) __tailor_worker_complete_tailordb ;;
|
|
@@ -2,6 +2,7 @@ import { TailorDBServiceInput } from "../services/tailordb/types.mjs";
|
|
|
2
2
|
import { AuthConfig } from "../services/auth/types.mjs";
|
|
3
3
|
import { AIGatewayConfig } from "../services/aigateway/types.mjs";
|
|
4
4
|
import { IdPConfig } from "../services/idp/types.mjs";
|
|
5
|
+
import { ResolverPermission } from "../services/resolver/permission.mjs";
|
|
5
6
|
import { SecretsConfig } from "../services/secrets/types.mjs";
|
|
6
7
|
import { StaticWebsiteConfig } from "../services/staticwebsite/types.mjs";
|
|
7
8
|
import { ExecutionPolicyInstance } from "../services/workflow/execution-policy.types.mjs";
|
|
@@ -36,10 +37,20 @@ type HttpAdapterServiceInput = {
|
|
|
36
37
|
files: string[];
|
|
37
38
|
ignores?: string[];
|
|
38
39
|
};
|
|
39
|
-
/** `files`/`ignores` patterns are resolved relative to this config's own directory, not the invocation directory. */
|
|
40
40
|
type ResolverServiceConfig = {
|
|
41
|
+
/** `files`/`ignores` patterns are resolved relative to this config's own directory, not the invocation directory. */
|
|
41
42
|
files: string[];
|
|
42
43
|
ignores?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Access requirement applied to every resolver in this namespace that
|
|
46
|
+
* declares no `permission` of its own. Takes the same values as a
|
|
47
|
+
* resolver's `permission`, including `"allowAnonymous"` to record that the
|
|
48
|
+
* namespace is public by design.
|
|
49
|
+
*
|
|
50
|
+
* A resolver's own `permission` replaces this default rather than merging
|
|
51
|
+
* with it, so a single resolver opts out with `permission: "allowAnonymous"`.
|
|
52
|
+
*/
|
|
53
|
+
defaultPermission?: ResolverPermission;
|
|
43
54
|
};
|
|
44
55
|
type ResolverExternalConfig = {
|
|
45
56
|
external: true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ArrayFieldOutput, FieldMetadata, FieldOptions, FieldOutput, TailorFieldType } from "./types/field.types.mjs";
|
|
2
2
|
import { AttributeList, Attributes, Env, TailorPrincipal } from "../runtime/types.mjs";
|
|
3
3
|
import { DeepWritable, NullableToOptional, output as output$1 } from "../types/helpers.mjs";
|
|
4
|
-
import { PluginAttachment } from "./services/tailordb/types.mjs";
|
|
4
|
+
import { IsAutoFilledDBField, IsReadOnlyDBField, PluginAttachment } from "./services/tailordb/types.mjs";
|
|
5
5
|
import { AuthConnectionConfig, AuthConnectionOAuth2Config } from "../types/auth-connection.generated.mjs";
|
|
6
6
|
import { BuiltinIdP, IDToken, IdProvider, OAuth2ClientInput, OIDC, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAuthorization, SCIMConfig, SCIMResource, TenantProvider } from "../types/auth.generated.mjs";
|
|
7
7
|
import { AuthConfig, AuthConnectionTokenResult, AuthExternalConfig, AuthOwnConfig, AuthServiceInput, BeforeLoginClaims, BeforeLoginHookArgs, DefinedAuth, FederatedIdentity, FederatedIdentityClaims, FederatedIdentityProvider, MachineUserName, MachineUserNameRegistry, OAuth2ClientGrantType, SCIMAttributeType, UserAttributeKey, UserAttributeListKey, UserAttributes, UsernameFieldKey, ValueOperand } from "./services/auth/types.mjs";
|
|
@@ -14,6 +14,7 @@ import { AIGatewayConfig } from "./services/aigateway/types.mjs";
|
|
|
14
14
|
import { IdPPermission, IdPPermissionCondition, unsafeAllowAllIdPPermission } from "./services/idp/permission.mjs";
|
|
15
15
|
import { IdPEmailConfig, IdPGqlOperations, IdPGqlOperationsInput } from "../types/idp.generated.mjs";
|
|
16
16
|
import { IdPConfig, IdPExternalConfig } from "./services/idp/types.mjs";
|
|
17
|
+
import { ResolverPermission, ResolverPermissionCondition, ResolverPermissionPolicy } from "./services/resolver/permission.mjs";
|
|
17
18
|
import { SecretsConfig } from "./services/secrets/types.mjs";
|
|
18
19
|
import { StaticWebsiteConfig } from "./services/staticwebsite/types.mjs";
|
|
19
20
|
import { ExecutionPolicyConcurrency, ExecutionPolicyDefInput, ExecutionPolicyExactInstance, ExecutionPolicyGroupOptions, ExecutionPolicyInstance, ExecutionPolicyWildcardInstance, ResolvedExecutionPolicyInstance } from "./services/workflow/execution-policy.types.mjs";
|
|
@@ -26,7 +27,6 @@ import { IdpName, IdpNameRegistry } from "./types/idp-name.mjs";
|
|
|
26
27
|
import { ConnectionName, ConnectionNameRegistry } from "./types/connection-name.mjs";
|
|
27
28
|
import { AIGatewayName, AIGatewayNameRegistry } from "./types/aigateway-name.mjs";
|
|
28
29
|
import { defineAuth } from "./services/auth/index.mjs";
|
|
29
|
-
import { ResolverPermission, ResolverPermissionCondition, ResolverPermissionPolicy } from "./services/resolver/permission.mjs";
|
|
30
30
|
import { createResolver } from "./services/resolver/resolver.mjs";
|
|
31
31
|
import { QueryType } from "./services/resolver/types.mjs";
|
|
32
32
|
import { WorkflowJob, WorkflowJobContext, createWorkflowJob } from "./services/workflow/job.mjs";
|
|
@@ -132,4 +132,4 @@ declare namespace t {
|
|
|
132
132
|
type infer<T> = TailorOutput<T>;
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
|
-
export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type Attributes, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type ConnectionName, type ConnectionNameRegistry, type DefinedAuth, type Env, type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ExecutorReadyContext, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, type GeneratorResult, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, type IdpName, type IdpNameRegistry, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedType, type PluginNamespaceProcessContext, type PluginOutput, type PluginProcessContext, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type ResolvedExecutionPolicyInstance, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverNamespaceData, type ResolverPermission, type ResolverPermissionCondition, type ResolverPermissionPolicy, type ResolverReadyContext, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, TailorDBTrigger, type TailorDBType, type TailorDBTypeForPlugin, type TailorField, type TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJob, WorkflowJobContext, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
135
|
+
export { type AIGatewayConfig, type AIGatewayName, type AIGatewayNameRegistry, type AttributeList, type Attributes, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type ConnectionName, type ConnectionNameRegistry, type DefinedAuth, type Env, type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ExecutorReadyContext, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, type GeneratorResult, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, type IdpName, type IdpNameRegistry, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type IsAutoFilledDBField, type IsReadOnlyDBField, type MachineUserName, type MachineUserNameRegistry, type NamespacePluginOutput, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type Plugin, type PluginAttachment, type PluginConfigs, type PluginExecutorContext, type PluginExecutorContextBase, type PluginGeneratedExecutor, type PluginGeneratedExecutorWithFile, type PluginGeneratedResolver, type PluginGeneratedType, type PluginNamespaceProcessContext, type PluginOutput, type PluginProcessContext, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type ResolvedExecutionPolicyInstance, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverNamespaceData, type ResolverPermission, type ResolverPermissionCondition, type ResolverPermissionPolicy, type ResolverReadyContext, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBNamespaceData, type TailorDBReadyContext, TailorDBTrigger, type TailorDBType, type TailorDBTypeForPlugin, type TailorField, type TailorPrincipal, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type TypePluginOutput, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJob, WorkflowJobContext, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineConfig, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IsAutoFilledDBField, IsReadOnlyDBField } from "./tailordb/types.mjs";
|
|
1
2
|
import { AuthConnectionConfig, AuthConnectionOAuth2Config } from "../../types/auth-connection.generated.mjs";
|
|
2
3
|
import { BuiltinIdP, IDToken, IdProvider, OAuth2ClientInput, OIDC, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAuthorization, SCIMConfig, SCIMResource, TenantProvider } from "../../types/auth.generated.mjs";
|
|
3
4
|
import { AuthConfig, AuthConnectionTokenResult, AuthExternalConfig, AuthOwnConfig, AuthServiceInput, BeforeLoginClaims, BeforeLoginHookArgs, DefinedAuth, FederatedIdentity, FederatedIdentityClaims, FederatedIdentityProvider, OAuth2ClientGrantType, SCIMAttributeType, UserAttributeKey, UserAttributeListKey, UserAttributes, UsernameFieldKey, ValueOperand } from "./auth/types.mjs";
|
|
@@ -9,13 +10,13 @@ import { AIGatewayConfig } from "./aigateway/types.mjs";
|
|
|
9
10
|
import { IdPPermission, IdPPermissionCondition, unsafeAllowAllIdPPermission } from "./idp/permission.mjs";
|
|
10
11
|
import { IdPEmailConfig, IdPGqlOperations, IdPGqlOperationsInput } from "../../types/idp.generated.mjs";
|
|
11
12
|
import { IdPConfig, IdPExternalConfig } from "./idp/types.mjs";
|
|
13
|
+
import { ResolverPermission, ResolverPermissionCondition, ResolverPermissionPolicy } from "./resolver/permission.mjs";
|
|
12
14
|
import { SecretsConfig } from "./secrets/types.mjs";
|
|
13
15
|
import { StaticWebsiteConfig } from "./staticwebsite/types.mjs";
|
|
14
16
|
import { ExecutionPolicyConcurrency, ExecutionPolicyDefInput, ExecutionPolicyExactInstance, ExecutionPolicyGroupOptions, ExecutionPolicyInstance, ExecutionPolicyWildcardInstance, ResolvedExecutionPolicyInstance } from "./workflow/execution-policy.types.mjs";
|
|
15
17
|
import { ExecutorServiceConfig, ExecutorServiceInput, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, WorkflowServiceConfig, WorkflowServiceInput } from "../config/types.mjs";
|
|
16
18
|
import { ConcurrencyPolicy, RetryPolicy } from "../../types/workflow.generated.mjs";
|
|
17
19
|
import { defineAuth } from "./auth/index.mjs";
|
|
18
|
-
import { ResolverPermission, ResolverPermissionCondition, ResolverPermissionPolicy } from "./resolver/permission.mjs";
|
|
19
20
|
import { createResolver } from "./resolver/resolver.mjs";
|
|
20
21
|
import { QueryType } from "./resolver/types.mjs";
|
|
21
22
|
import "./resolver/index.mjs";
|
|
@@ -37,4 +38,4 @@ import { defineIdp } from "./idp/index.mjs";
|
|
|
37
38
|
import { defineSecretManager } from "./secrets/index.mjs";
|
|
38
39
|
import { HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, createHttpAdapter } from "./http-adapter/http-adapter.mjs";
|
|
39
40
|
import "./http-adapter/index.mjs";
|
|
40
|
-
export { type AIGatewayConfig, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type DefinedAuth, type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type ResolvedExecutionPolicyInstance, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverPermission, type ResolverPermissionCondition, type ResolverPermissionPolicy, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, TailorDBTrigger, type TailorDBType, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJob, WorkflowJobContext, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineIdp, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
41
|
+
export { type AIGatewayConfig, AuthAccessTokenArgs, AuthAccessTokenIssuedArgs, AuthAccessTokenRefreshedArgs, AuthAccessTokenRevokedArgs, AuthAccessTokenTrigger, type AuthConfig, type AuthConnectionConfig, type AuthConnectionOAuth2Config, type AuthConnectionTokenResult, type AuthExternalConfig, type AuthOwnConfig, type AuthServiceInput, type BeforeLoginClaims, type BeforeLoginHookArgs, type BuiltinIdP, type ConcurrencyPolicy, type DefinedAuth, type ExecutionPolicyConcurrency, type ExecutionPolicyDefInput, type ExecutionPolicyExactInstance, type ExecutionPolicyGroupOptions, type ExecutionPolicyInstance, type ExecutionPolicyWildcardInstance, type ExecutorServiceConfig, type ExecutorServiceInput, type FederatedIdentity, type FederatedIdentityClaims, type FederatedIdentityProvider, FunctionOperation, GqlOperation, HttpAdapter, HttpAdapterGraphQLQuery, HttpAdapterGraphQLRequest, HttpAdapterGraphQLResponse, HttpAdapterInput, HttpAdapterInputFn, HttpAdapterOutputFn, HttpAdapterRequest, HttpAdapterResponse, HttpAdapterTypedDocumentNode, type IDToken, type IdPConfig, type IdPEmailConfig, type IdPExternalConfig, type IdPGqlOperations, type IdPGqlOperationsInput as IdPGqlOperationsConfig, type IdPPermission, type IdPPermissionCondition, type IdProvider as IdProviderConfig, IdpUserArgs, IdpUserCreatedArgs, IdpUserDeletedArgs, IdpUserTrigger, IdpUserUpdatedArgs, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookResponse, IncomingWebhookResponseConfig, IncomingWebhookTrigger, IncomingWebhookTriggerOptions, type IsAutoFilledDBField, type IsReadOnlyDBField, type OAuth2ClientInput as OAuth2Client, type OAuth2ClientGrantType, type OIDC, Operation, type PermissionCondition, type QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordUpdatedArgs, type ResolvedExecutionPolicyInstance, type Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, type ResolverExternalConfig, type ResolverPermission, type ResolverPermissionCondition, type ResolverPermissionPolicy, type ResolverServiceConfig, type ResolverServiceInput, type RetryPolicy, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleArgs, ScheduleTrigger, type SecretsConfig, type StaticWebsiteConfig, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, TailorDBTrigger, type TailorDBType, type TailorTypeGqlPermission, type TailorTypePermission, type TenantProvider as TenantProviderConfig, Trigger, type UserAttributeKey, type UserAttributeListKey, type UserAttributes, type UsernameFieldKey, type ValueOperand, WaitPointInstance, WebhookOperation, Workflow, WorkflowConfig, WorkflowExecutionArgs, WorkflowExecutionCompletedArgs, WorkflowExecutionResumedArgs, WorkflowExecutionRetriedArgs, WorkflowExecutionStartedArgs, WorkflowExecutionTrigger, WorkflowExecutionWaitResolvedArgs, WorkflowExecutionWaitStartedArgs, WorkflowJob, WorkflowJobContext, WorkflowJobExecutionArgs, WorkflowJobExecutionCompletedArgs, WorkflowJobExecutionStartedArgs, WorkflowJobExecutionTrigger, WorkflowJobExecutionWaitResolvedArgs, WorkflowJobExecutionWaitStartedArgs, WorkflowOperation, type WorkflowServiceConfig, type WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, authAccessTokenTrigger, createExecutor, createHttpAdapter, createResolver, createWaitPoint, createWaitPoints, createWorkflow, createWorkflowJob, db, defineAIGateway, defineAuth, defineIdp, defineSecretManager, defineStaticWebSite, defineWorkflowExecutionPolicies, defineWorkflowExecutionPolicy, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, unsafeAllowAllGqlPermission, unsafeAllowAllIdPPermission, unsafeAllowAllTypePermission, workflowExecutionCompletedTrigger, workflowExecutionResumedTrigger, workflowExecutionRetriedTrigger, workflowExecutionStartedTrigger, workflowExecutionTrigger, workflowExecutionWaitResolvedTrigger, workflowExecutionWaitStartedTrigger, workflowJobExecutionCompletedTrigger, workflowJobExecutionStartedTrigger, workflowJobExecutionTrigger, workflowJobExecutionWaitResolvedTrigger, workflowJobExecutionWaitStartedTrigger };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Resolver } from "../../../types/resolver.generated.mjs";
|
|
2
|
-
import { ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput } from "../../config/types.mjs";
|
|
3
2
|
import { ResolverPermission, ResolverPermissionCondition, ResolverPermissionPolicy } from "./permission.mjs";
|
|
3
|
+
import { ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput } from "../../config/types.mjs";
|
|
4
4
|
import { createResolver } from "./resolver.mjs";
|
|
5
5
|
import { QueryType } from "./types.mjs";
|
|
6
6
|
export { type QueryType, type Resolver, type ResolverExternalConfig, type ResolverPermission, type ResolverPermissionCondition, type ResolverPermissionPolicy, type ResolverServiceConfig, type ResolverServiceInput, createResolver };
|
|
@@ -2,9 +2,9 @@ import { TailorEnv, TailorPrincipal } from "../../../runtime/types.mjs";
|
|
|
2
2
|
import { InferFieldsOutput, output } from "../../../types/helpers.mjs";
|
|
3
3
|
import { MachineUserName } from "../auth/types.mjs";
|
|
4
4
|
import { ResolverInput } from "../../../types/resolver.generated.mjs";
|
|
5
|
+
import { ResolverPermission } from "./permission.mjs";
|
|
5
6
|
import { TailorAnyField, TailorField } from "../../types/type.mjs";
|
|
6
7
|
import "../../types/machine-user.mjs";
|
|
7
|
-
import { ResolverPermission } from "./permission.mjs";
|
|
8
8
|
//#region src/configure/services/resolver/resolver.d.ts
|
|
9
9
|
type Context<Input extends Record<string, TailorAnyField> | undefined> = {
|
|
10
10
|
input: Input extends Record<string, TailorAnyField> ? InferFieldsOutput<Input> : never;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IsAutoFilledDBField, IsReadOnlyDBField } from "./types.mjs";
|
|
1
2
|
import { PermissionCondition, TailorTypeGqlPermission, TailorTypePermission, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission } from "./permission.mjs";
|
|
2
3
|
import { TailorAnyDBField, TailorAnyDBType, TailorDBField, TailorDBInstance, TailorDBType, db } from "./schema.mjs";
|
|
3
|
-
export { type PermissionCondition, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBType, type TailorTypeGqlPermission, type TailorTypePermission, db, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
|
4
|
+
export { type IsAutoFilledDBField, type IsReadOnlyDBField, type PermissionCondition, type TailorAnyDBField, type TailorAnyDBType, type TailorDBField, type TailorDBInstance, type TailorDBType, type TailorTypeGqlPermission, type TailorTypePermission, db, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
|
@@ -123,39 +123,39 @@ type WithDBTypeMetadata<Defined extends DefinedDBTypeMetadata, Key extends keyof
|
|
|
123
123
|
type DBTypeDuplicateInputGuard<Defined extends DefinedDBTypeMetadata, Key extends keyof DefinedDBTypeMetadata, Input, Message extends string> = IsAny<Defined> extends true ? Input : Defined extends Record<Key, unknown> ? TypeLevelError<Message> : Input;
|
|
124
124
|
type DBTypeDuplicateRestGuard<Defined extends DefinedDBTypeMetadata, Key extends keyof DefinedDBTypeMetadata, Input extends unknown[], Message extends string> = IsAny<Defined> extends true ? Input : Defined extends Record<Key, unknown> ? [TypeLevelError<Message>, ...TypeLevelError<Message>[]] : Input;
|
|
125
125
|
type FileKeyConflictError<Fields extends Record<string, TailorAnyDBField>, User extends object> = Partial<Record<keyof output<TailorDBType<Fields, User>> & string, TypeLevelError<"file keys cannot use existing field names">>>;
|
|
126
|
-
type DBFieldDescriptionFn<Defined extends DefinedDBFieldMetadata, Output
|
|
127
|
-
type DBFieldRelationFn<Defined extends DefinedDBFieldMetadata, Output
|
|
128
|
-
<S extends RelationType, T extends TailorAnyDBType>(config: RelationConfig<S, T>): TailorDBField<WithDBFieldRelation<Defined, S>, Output>;
|
|
129
|
-
<S extends RelationSelfConfig>(config: S): TailorDBField<WithDBFieldRelation<Defined, S>, Output>;
|
|
126
|
+
type DBFieldDescriptionFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = (description: string) => TailorDBField<WithDBFieldDescription<Defined>, Output, Nested>;
|
|
127
|
+
type DBFieldRelationFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = {
|
|
128
|
+
<S extends RelationType, T extends TailorAnyDBType>(config: RelationConfig<S, T>): TailorDBField<WithDBFieldRelation<Defined, S>, Output, Nested>;
|
|
129
|
+
<S extends RelationSelfConfig>(config: S): TailorDBField<WithDBFieldRelation<Defined, S>, Output, Nested>;
|
|
130
130
|
};
|
|
131
|
-
type DBFieldIndexFn<Defined extends DefinedDBFieldMetadata, Output
|
|
132
|
-
type DBFieldUniqueFn<Defined extends DefinedDBFieldMetadata, Output
|
|
133
|
-
type DBFieldVectorFn<Defined extends DefinedDBFieldMetadata, Output
|
|
134
|
-
type DBFieldHooksFn<Defined extends DefinedDBFieldMetadata, Output
|
|
131
|
+
type DBFieldIndexFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = () => TailorDBField<WithDBFieldIndex<Defined>, Output, Nested>;
|
|
132
|
+
type DBFieldUniqueFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = () => TailorDBField<WithDBFieldUnique<Defined>, Output, Nested>;
|
|
133
|
+
type DBFieldVectorFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = () => TailorDBField<WithDBFieldVector<Defined>, Output, Nested>;
|
|
134
|
+
type DBFieldHooksFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = <const H extends Hook<Output, Defined extends {
|
|
135
135
|
default: true;
|
|
136
|
-
} ? Output | null | undefined : Output>>(hooks: H) => TailorDBField<WithDBFieldHooks<Defined, H>, Output>;
|
|
137
|
-
type DBFieldValidateFn<Defined extends DefinedDBFieldMetadata, Output
|
|
138
|
-
type DBFieldSerialFn<Defined extends DefinedDBFieldMetadata, Output
|
|
139
|
-
type DBFieldDescriptionMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
136
|
+
} ? Output | null | undefined : Output>>(hooks: H) => TailorDBField<WithDBFieldHooks<Defined, H>, Output, Nested>;
|
|
137
|
+
type DBFieldValidateFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = (...validate: FieldValidateInput<Output>[]) => TailorDBField<WithDBFieldValidate<Defined>, Output, Nested>;
|
|
138
|
+
type DBFieldSerialFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = (config: SerialConfig<Defined["type"] & ("integer" | "string")>) => TailorDBField<WithDBFieldSerial<Defined>, Output, Nested>;
|
|
139
|
+
type DBFieldDescriptionMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldDescriptionFn<Defined, Output, Nested> : Defined extends {
|
|
140
140
|
description: unknown;
|
|
141
|
-
} ? TypeLevelError<".description() has already been set"> : DBFieldDescriptionFn<Defined, Output>;
|
|
142
|
-
type DBFieldRelationMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
141
|
+
} ? TypeLevelError<".description() has already been set"> : DBFieldDescriptionFn<Defined, Output, Nested>;
|
|
142
|
+
type DBFieldRelationMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldRelationFn<Defined, Output, Nested> : Defined extends {
|
|
143
143
|
relation: unknown;
|
|
144
|
-
} ? TypeLevelError<".relation() has already been set"> : DBFieldRelationFn<Defined, Output>;
|
|
144
|
+
} ? TypeLevelError<".relation() has already been set"> : DBFieldRelationFn<Defined, Output, Nested>;
|
|
145
145
|
type DBFieldArrayCheck<A extends boolean, Ok, Msg extends string> = A extends true ? TypeLevelError<Msg> : Ok;
|
|
146
|
-
type DBFieldIndexMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
146
|
+
type DBFieldIndexMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldIndexFn<Defined, Output, Nested> : Defined extends {
|
|
147
147
|
index: unknown;
|
|
148
|
-
} ? TypeLevelError<".index() has already been set"> : DBFieldArrayCheck<Defined["array"], DBFieldIndexFn<Defined, Output>, "index cannot be set on array fields">;
|
|
149
|
-
type DBFieldUniqueMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
148
|
+
} ? TypeLevelError<".index() has already been set"> : DBFieldArrayCheck<Defined["array"], DBFieldIndexFn<Defined, Output, Nested>, "index cannot be set on array fields">;
|
|
149
|
+
type DBFieldUniqueMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldUniqueFn<Defined, Output, Nested> : Defined extends {
|
|
150
150
|
unique: unknown;
|
|
151
|
-
} ? TypeLevelError<".unique() has already been set"> : DBFieldArrayCheck<Defined["array"], DBFieldUniqueFn<Defined, Output>, "unique cannot be set on array fields">;
|
|
152
|
-
type DBFieldVectorMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
151
|
+
} ? TypeLevelError<".unique() has already been set"> : DBFieldArrayCheck<Defined["array"], DBFieldUniqueFn<Defined, Output, Nested>, "unique cannot be set on array fields">;
|
|
152
|
+
type DBFieldVectorMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldVectorFn<Defined, Output, Nested> : Defined extends {
|
|
153
153
|
vector: unknown;
|
|
154
154
|
} ? TypeLevelError<".vector() has already been set"> : Defined extends {
|
|
155
155
|
type: "string";
|
|
156
156
|
array: false;
|
|
157
|
-
} ? DBFieldVectorFn<Defined, Output> : TypeLevelError<"vector can only be set on non-array string fields">;
|
|
158
|
-
type DBFieldHooksMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
157
|
+
} ? DBFieldVectorFn<Defined, Output, Nested> : TypeLevelError<"vector can only be set on non-array string fields">;
|
|
158
|
+
type DBFieldHooksMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldHooksFn<Defined, Output, Nested> : Defined extends {
|
|
159
159
|
serial: true;
|
|
160
160
|
hooks: {
|
|
161
161
|
create: false;
|
|
@@ -165,35 +165,35 @@ type DBFieldHooksMethod<Defined extends DefinedDBFieldMetadata, Output> = IsAny<
|
|
|
165
165
|
hooks: unknown;
|
|
166
166
|
} ? TypeLevelError<".hooks() has already been set"> : Defined extends {
|
|
167
167
|
type: "nested";
|
|
168
|
-
} ? TypeLevelError<"hooks cannot be set on nested type fields"> : DBFieldHooksFn<Defined, Output>;
|
|
169
|
-
type DBFieldValidateMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
168
|
+
} ? TypeLevelError<"hooks cannot be set on nested type fields"> : DBFieldHooksFn<Defined, Output, Nested>;
|
|
169
|
+
type DBFieldValidateMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldValidateFn<Defined, Output, Nested> : Defined extends {
|
|
170
170
|
validate: unknown;
|
|
171
|
-
} ? TypeLevelError<".validate() has already been set"> : DBFieldValidateFn<Defined, Output>;
|
|
172
|
-
type DBFieldSerialMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
171
|
+
} ? TypeLevelError<".validate() has already been set"> : DBFieldValidateFn<Defined, Output, Nested>;
|
|
172
|
+
type DBFieldSerialMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldSerialFn<Defined, Output, Nested> : Defined extends {
|
|
173
173
|
serial: true;
|
|
174
174
|
} ? TypeLevelError<".serial() has already been set"> : Defined extends {
|
|
175
175
|
serial: false;
|
|
176
176
|
} ? TypeLevelError<"serial cannot be set after hooks"> : IsAny<Output> extends true ? Defined extends {
|
|
177
177
|
type: "integer" | "string";
|
|
178
178
|
array: false;
|
|
179
|
-
} ? DBFieldSerialFn<Defined, Output> : TypeLevelError<"serial can only be set on non-array integer or string fields"> : null extends Output ? TypeLevelError<"serial can only be set on non-array integer or string fields"> : Defined extends {
|
|
179
|
+
} ? DBFieldSerialFn<Defined, Output, Nested> : TypeLevelError<"serial can only be set on non-array integer or string fields"> : null extends Output ? TypeLevelError<"serial can only be set on non-array integer or string fields"> : Defined extends {
|
|
180
180
|
type: "integer" | "string";
|
|
181
181
|
array: false;
|
|
182
|
-
} ? DBFieldSerialFn<Defined, Output> : TypeLevelError<"serial can only be set on non-array integer or string fields">;
|
|
183
|
-
type DBFieldDefaultFn<Defined extends DefinedDBFieldMetadata, Output
|
|
184
|
-
type DBFieldDefaultMethod<Defined extends DefinedDBFieldMetadata, Output
|
|
182
|
+
} ? DBFieldSerialFn<Defined, Output, Nested> : TypeLevelError<"serial can only be set on non-array integer or string fields">;
|
|
183
|
+
type DBFieldDefaultFn<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = (value: Output extends null ? NonNullable<Output> : Output) => TailorDBField<WithDBFieldDefault<Defined>, Output, Nested>;
|
|
184
|
+
type DBFieldDefaultMethod<Defined extends DefinedDBFieldMetadata, Output, Nested extends Record<string, TailorAnyDBField>> = IsAny<Defined> extends true ? DBFieldDefaultFn<Defined, Output, Nested> : Defined extends {
|
|
185
185
|
default: unknown;
|
|
186
186
|
} ? TypeLevelError<".default() has already been set"> : Defined extends {
|
|
187
187
|
type: "nested";
|
|
188
188
|
} ? TypeLevelError<"default cannot be set on nested type fields"> : Defined extends {
|
|
189
189
|
serial: true;
|
|
190
|
-
} ? TypeLevelError<"default cannot be set on serial fields"> : null extends Output ? TypeLevelError<"default cannot be set on optional fields"> : DBFieldDefaultFn<Defined, Output>;
|
|
190
|
+
} ? TypeLevelError<"default cannot be set on serial fields"> : null extends Output ? TypeLevelError<"default cannot be set on optional fields"> : DBFieldDefaultFn<Defined, Output, Nested>;
|
|
191
191
|
/**
|
|
192
192
|
* Full TailorDBField interface with builder methods.
|
|
193
193
|
* Extends the minimal structural interface from types/ with fluent API methods.
|
|
194
194
|
*/
|
|
195
|
-
interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldMetadata, Output = any> extends Omit<TailorDBField$1<Defined, Output>, "fields"> {
|
|
196
|
-
readonly fields:
|
|
195
|
+
interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldMetadata, Output = any, Nested extends Record<string, TailorAnyDBField> = Record<string, TailorAnyDBField>> extends Omit<TailorDBField$1<Defined, Output, Nested>, "fields"> {
|
|
196
|
+
readonly fields: Nested;
|
|
197
197
|
_metadata: DBFieldMetadata;
|
|
198
198
|
/**
|
|
199
199
|
* Parse and validate a value against this field's validation rules
|
|
@@ -207,23 +207,23 @@ interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldM
|
|
|
207
207
|
/**
|
|
208
208
|
* Set a description for the field
|
|
209
209
|
*/
|
|
210
|
-
description: DBFieldDescriptionMethod<Defined, Output>;
|
|
210
|
+
description: DBFieldDescriptionMethod<Defined, Output, Nested>;
|
|
211
211
|
/**
|
|
212
212
|
* Define a relation to another type.
|
|
213
213
|
*/
|
|
214
|
-
relation: DBFieldRelationMethod<Defined, Output>;
|
|
214
|
+
relation: DBFieldRelationMethod<Defined, Output, Nested>;
|
|
215
215
|
/**
|
|
216
216
|
* Add an index to the field
|
|
217
217
|
*/
|
|
218
|
-
index: DBFieldIndexMethod<Defined, Output>;
|
|
218
|
+
index: DBFieldIndexMethod<Defined, Output, Nested>;
|
|
219
219
|
/**
|
|
220
220
|
* Make the field unique (also adds an index)
|
|
221
221
|
*/
|
|
222
|
-
unique: DBFieldUniqueMethod<Defined, Output>;
|
|
222
|
+
unique: DBFieldUniqueMethod<Defined, Output, Nested>;
|
|
223
223
|
/**
|
|
224
224
|
* Enable vector search on the field (string type only)
|
|
225
225
|
*/
|
|
226
|
-
vector: DBFieldVectorMethod<Defined, Output>;
|
|
226
|
+
vector: DBFieldVectorMethod<Defined, Output, Nested>;
|
|
227
227
|
/**
|
|
228
228
|
* Set a default value for the field on create. When the field is required,
|
|
229
229
|
* this makes it optional in the Create input — the default fills in when
|
|
@@ -231,11 +231,11 @@ interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldM
|
|
|
231
231
|
*
|
|
232
232
|
* For datetime/date/time fields, pass `"now"` to use the operation timestamp.
|
|
233
233
|
*/
|
|
234
|
-
default: DBFieldDefaultMethod<Defined, Output>;
|
|
234
|
+
default: DBFieldDefaultMethod<Defined, Output, Nested>;
|
|
235
235
|
/**
|
|
236
236
|
* Add hooks for create/update operations on this field.
|
|
237
237
|
*/
|
|
238
|
-
hooks: DBFieldHooksMethod<Defined, Output>;
|
|
238
|
+
hooks: DBFieldHooksMethod<Defined, Output, Nested>;
|
|
239
239
|
/**
|
|
240
240
|
* Add validation functions to the field.
|
|
241
241
|
*
|
|
@@ -243,16 +243,16 @@ interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldM
|
|
|
243
243
|
* built-in type validation; they are skipped when built-in validation
|
|
244
244
|
* fails. For array fields, `value` is the complete array.
|
|
245
245
|
*/
|
|
246
|
-
validate: DBFieldValidateMethod<Defined, Output>;
|
|
246
|
+
validate: DBFieldValidateMethod<Defined, Output, Nested>;
|
|
247
247
|
/**
|
|
248
248
|
* Configure serial/auto-increment behavior
|
|
249
249
|
*/
|
|
250
|
-
serial: DBFieldSerialMethod<Defined, Output>;
|
|
250
|
+
serial: DBFieldSerialMethod<Defined, Output, Nested>;
|
|
251
251
|
/**
|
|
252
252
|
* Clone the field with optional overrides for field options.
|
|
253
253
|
* The `array` option cannot change on fields with custom validation.
|
|
254
254
|
*/
|
|
255
|
-
clone<const NewOpt extends DBFieldCloneOptions<Defined>>(options?: NewOpt): TailorDBField<WithDBFieldCloneOptions<Defined, NewOpt>, DBFieldCloneOutput<Output, NewOpt
|
|
255
|
+
clone<const NewOpt extends DBFieldCloneOptions<Defined>>(options?: NewOpt): TailorDBField<WithDBFieldCloneOptions<Defined, NewOpt>, DBFieldCloneOutput<Output, NewOpt>, Nested>;
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* Full TailorDBType interface with builder methods.
|
|
@@ -404,7 +404,7 @@ declare function object<const F extends Record<string, TailorAnyDBField> & Exclu
|
|
|
404
404
|
array: Opt extends {
|
|
405
405
|
array: true;
|
|
406
406
|
} ? true : false;
|
|
407
|
-
}, FieldOutput<InferFieldsOutput<F>, Opt
|
|
407
|
+
}, FieldOutput<InferFieldsOutput<F>, Opt>, F>;
|
|
408
408
|
declare const idField: TailorDBFieldInstance<"uuid", FieldOptions, string>;
|
|
409
409
|
type idField = typeof idField;
|
|
410
410
|
type DBTable<F extends {
|
|
@@ -470,7 +470,7 @@ declare const db: {
|
|
|
470
470
|
* });
|
|
471
471
|
*/
|
|
472
472
|
timestamps: () => {
|
|
473
|
-
createdAt: TailorDBField<WithDBFieldDescription<WithDBFieldDefault<DBFieldDefined<"datetime", FieldOptions>>>, string | Date
|
|
473
|
+
createdAt: TailorDBField<WithDBFieldDescription<WithDBFieldDefault<DBFieldDefined<"datetime", FieldOptions>>>, string | Date, Record<string, TailorAnyDBField>>;
|
|
474
474
|
updatedAt: TailorDBField<WithDBFieldDescription<WithDBFieldHooks<WithDBFieldDefault<DBFieldDefined<"datetime", FieldOptions>>, {
|
|
475
475
|
readonly update: ({ input, now }: {
|
|
476
476
|
input: string | Date | null;
|
|
@@ -478,7 +478,7 @@ declare const db: {
|
|
|
478
478
|
invoker: TailorPrincipal | null;
|
|
479
479
|
now: Date;
|
|
480
480
|
}) => string | Date;
|
|
481
|
-
}>>, string | Date
|
|
481
|
+
}>>, string | Date, Record<string, TailorAnyDBField>>;
|
|
482
482
|
};
|
|
483
483
|
};
|
|
484
484
|
};
|