@tailor-platform/sdk 2.36.0 → 2.37.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 +72 -0
- package/dist/{application-DaJbleMi.mjs → application-83WVdH85.mjs} +1 -1
- package/dist/{application-BbORWCj-.mjs → application-Cida-j1g.mjs} +36 -36
- package/dist/application-Cida-j1g.mjs.map +1 -0
- package/dist/cli/commands/deploy/deploy.d.mts +6 -1
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +1 -0
- package/dist/cli/commands/executor/jobs.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/config.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +10 -0
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +28 -2
- package/dist/cli/commands/tailordb/migrate/hints.d.mts +1 -0
- package/dist/cli/commands/tailordb/migrate/remote-state.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +3 -1
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +44 -6
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +2 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +2 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +8 -0
- package/dist/cli/commands/tailordb/migrate/types.d.mts +2 -0
- package/dist/cli/commands/workspace/create.d.mts +1 -1
- package/dist/cli/lib.d.mts +2 -2
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +52 -51
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/client.d.mts +26 -0
- package/dist/cli/shared/function-execution.d.mts +2 -0
- package/dist/cli/shared/prompt.d.mts +9 -4
- package/dist/completion/zsh-worker.zsh +21 -13
- package/dist/configure/config/index.d.mts +2 -0
- package/dist/configure/config/types.d.mts +2 -0
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +1 -0
- package/dist/configure/services/tailordb/types.d.mts +3 -0
- package/dist/crashreport-C2AcQNTe.mjs +1 -0
- package/dist/{crashreport-DGU6lwiX.mjs → crashreport-D_wf4GZh.mjs} +4 -4
- package/dist/{crashreport-DGU6lwiX.mjs.map → crashreport-D_wf4GZh.mjs.map} +1 -1
- package/dist/date-representation-Cr7W7Pn2.mjs.map +1 -1
- package/dist/{errors-BXmGBX-7.mjs → errors-Dmdnq0zi.mjs} +2 -2
- package/dist/errors-Dmdnq0zi.mjs.map +1 -0
- package/dist/{kysely-type-B0ri1-Xs.mjs → kysely-type-DVL90_oX.mjs} +6 -6
- package/dist/kysely-type-DVL90_oX.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +4 -3
- package/dist/plugin/get-generated-table.d.mts +4 -0
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +55 -3
- package/dist/plugin/with-context.d.mts +16 -0
- package/dist/register-ts-hook-Ht4zCseV.mjs +1115 -0
- package/dist/register-ts-hook-Ht4zCseV.mjs.map +1 -0
- package/dist/schema-BU1aIQ63.mjs.map +1 -1
- package/dist/{secret-file-BxZ-J_Nz.mjs → secret-file-DiuEcLFP.mjs} +2 -2
- package/dist/{secret-file-BxZ-J_Nz.mjs.map → secret-file-DiuEcLFP.mjs.map} +1 -1
- package/dist/service-CZ0EdD2-.mjs +10 -0
- package/dist/service-CZ0EdD2-.mjs.map +1 -0
- package/dist/service-DDrbdyd-.mjs +2 -0
- package/dist/{service-CaGmqg0r.mjs.map → service-DDrbdyd-.mjs.map} +1 -1
- package/dist/service-WhSyhaho.mjs +1 -0
- package/dist/service_pb-BMHhVot2.mjs +1 -0
- package/dist/service_pb-BxMSK0gg.mjs +2 -0
- package/dist/service_pb-BxMSK0gg.mjs.map +1 -0
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +3 -3
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +92 -0
- package/dist/tailor-proto/src/tailor/v1/notification_pb.d.mts +176 -0
- package/dist/tailor-proto/src/tailor/v1/notification_resource_pb.d.mts +172 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +78 -0
- package/dist/types/app-config.generated.d.mts +1 -1
- package/dist/types/auth-connection.generated.d.mts +2 -2
- package/dist/types/auth.generated.d.mts +13 -13
- package/dist/types/executor.generated.d.mts +25 -25
- package/dist/types/field.generated.d.mts +2 -2
- package/dist/types/http-adapter.generated.d.mts +4 -4
- package/dist/types/idp.generated.d.mts +272 -272
- package/dist/types/resolver.generated.d.mts +10 -10
- package/dist/types/tailordb.generated.d.mts +84 -80
- package/dist/types/workflow.generated.d.mts +2 -2
- package/dist/vitest/date-representation.d.mts +2 -0
- package/dist/vitest/environment.d.mts +1 -0
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/migration-steps.d.mts +13 -2
- package/dist/vitest/mock-kysely.d.mts +12 -2
- package/dist/vitest/mocks/aigateway.d.mts +7 -1
- package/dist/vitest/mocks/authconnection.d.mts +7 -1
- package/dist/vitest/mocks/file.d.mts +8 -2
- package/dist/vitest/mocks/iconv.d.mts +7 -1
- package/dist/vitest/mocks/idp.d.mts +7 -1
- package/dist/vitest/mocks/logger.d.mts +7 -1
- package/dist/vitest/mocks/secretmanager.d.mts +7 -1
- package/dist/vitest/mocks/tailordb-pglite.d.mts +12 -2
- package/dist/vitest/mocks/tailordb.d.mts +22 -4
- package/dist/vitest/mocks/workflow.d.mts +2 -1
- package/dist/vitest/pglite-kysely.d.mts +18 -2
- package/dist/vitest/pglite-temporal.d.mts +5 -1
- package/dist/vitest/workflow-local.d.mts +7 -0
- package/dist/{workspace_resource_pb-C4CkoYww.mjs → workspace_resource_pb-7smKERdZ.mjs} +2 -2
- package/dist/workspace_resource_pb-7smKERdZ.mjs.map +1 -0
- package/docs/cli/application.md +51 -21
- package/docs/cli/executor.md +2 -0
- package/docs/cli/function.md +3 -1
- package/docs/cli/tailordb.md +30 -22
- package/docs/cli/workflow.md +2 -0
- package/docs/cli/workspace.md +19 -17
- package/docs/cli-reference.md +5 -4
- package/docs/configuration.md +2 -2
- package/docs/data-clone.md +1 -1
- package/docs/github-actions.md +104 -15
- package/docs/plugin/custom.md +4 -4
- package/docs/runtime.md +1 -1
- package/docs/services/auth.md +2 -0
- package/docs/services/idp.md +2 -0
- package/docs/services/tailordb/index.md +7 -2
- package/docs/services/tailordb/migration.md +71 -30
- package/docs/services/workflow.md +1 -1
- package/docs/testing.md +9 -9
- package/package.json +13 -13
- package/dist/application-BbORWCj-.mjs.map +0 -1
- package/dist/crashreport-WsYAWARW.mjs +0 -1
- package/dist/errors-BXmGBX-7.mjs.map +0 -1
- package/dist/kysely-type-B0ri1-Xs.mjs.map +0 -1
- package/dist/register-ts-hook-iAcG1dfz.mjs +0 -1057
- package/dist/register-ts-hook-iAcG1dfz.mjs.map +0 -1
- package/dist/service-CaGmqg0r.mjs +0 -2
- package/dist/service-DTrVVaDJ.mjs +0 -1
- package/dist/service-hIarp2Gl.mjs +0 -8
- package/dist/service-hIarp2Gl.mjs.map +0 -1
- package/dist/service_pb-6EkMfdOb.mjs +0 -2
- package/dist/service_pb-6EkMfdOb.mjs.map +0 -1
- package/dist/service_pb-CsJKokDl.mjs +0 -1
- package/dist/workspace_resource_pb-C4CkoYww.mjs.map +0 -1
package/docs/github-actions.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Generate GitHub Actions deploy workflows and Renovate configuration for your app with tailor setup, including approval gates, secrets, monorepos, and rollback."
|
|
2
|
+
description: "Generate GitHub Actions deploy workflows, a workflow that commits generated files to pull requests, and Renovate configuration for your app with tailor setup, including approval gates, secrets, monorepos, and rollback."
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# GitHub Actions Integration
|
|
5
|
+
# GitHub Actions Integration (Beta)
|
|
6
6
|
|
|
7
7
|
`tailor setup` generates GitHub repository automation for your Tailor Platform
|
|
8
|
-
application, including deploy workflows
|
|
8
|
+
application, including deploy workflows, a workflow that commits generated
|
|
9
|
+
files to pull requests, and Renovate configuration.
|
|
9
10
|
|
|
10
11
|
> **Beta:** This command is under active development. CLI flags, the generated
|
|
11
12
|
> workflow, and the `.github/tailor.lock` schema may change before general
|
|
@@ -272,6 +273,73 @@ When `tailor setup update` regenerates a preview target generated before
|
|
|
272
273
|
second now also deploys a labeled draft. To deploy drafts as well, run
|
|
273
274
|
`tailor setup ci preview` again without `--require`.
|
|
274
275
|
|
|
276
|
+
## Committing generated files to pull requests
|
|
277
|
+
|
|
278
|
+
Each deploy workflow checks that the files `tailor generate` writes, such as
|
|
279
|
+
seed data and enum constants, are committed, and fails when they are out of
|
|
280
|
+
date. To have CI commit them instead, generate the autofix workflow:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
tailor setup ci autofix # commit with the workflow token
|
|
284
|
+
tailor setup ci autofix --provider github-app # commit with your GitHub App
|
|
285
|
+
tailor setup ci autofix --dir apps/erp --dir apps/users # run tailor generate in each app
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
It writes `.github/workflows/tailor-autofix.yml`, which runs `tailor generate`
|
|
289
|
+
on every pull request and, when that changes files, commits them to the pull
|
|
290
|
+
request branch as `chore: run tailor generate`. Only the changes
|
|
291
|
+
`tailor generate` makes are committed: files that earlier steps leave in the
|
|
292
|
+
checkout, such as an `.npmrc`, are not. The deploy workflows keep their check,
|
|
293
|
+
which fails on the commit that needed the fix and passes on the fix commit.
|
|
294
|
+
|
|
295
|
+
`--provider` chooses what makes the commit:
|
|
296
|
+
|
|
297
|
+
| Provider | Commits as | Checks on the fix commit | Setup |
|
|
298
|
+
| ------------------------ | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
299
|
+
| `github-token` (default) | `github-actions[bot]`, with the workflow token | Wait until someone with write access selects **Approve workflows to run** on the pull request | None |
|
|
300
|
+
| `github-app` | Your GitHub App | Run automatically | Create a GitHub App with the Contents read and write permission, install it on the repository, and set `TAILOR_AUTOFIX_APP_CLIENT_ID` and `TAILOR_AUTOFIX_APP_PRIVATE_KEY` (see [Setting secrets and variables](#setting-secrets-and-variables)) |
|
|
301
|
+
| `autofix-ci` | The [autofix.ci](https://autofix.ci) GitHub App | Run automatically | Install the autofix.ci App on the repository |
|
|
302
|
+
| `securefix` | Your [securefix](https://github.com/csm-actions/securefix-action) server workflow | Run automatically | Set up the securefix server repository and its GitHub Apps, pass the server repository's name with `--securefix-server-repository`, and set the client App's `TAILOR_AUTOFIX_APP_CLIENT_ID` and `TAILOR_AUTOFIX_APP_PRIVATE_KEY` |
|
|
303
|
+
|
|
304
|
+
GitHub does not start workflows on its own for a commit pushed with the workflow
|
|
305
|
+
token, so with `github-token` the pull request shows that its workflows are
|
|
306
|
+
awaiting approval after each fix commit. Use another provider to have them run
|
|
307
|
+
right away.
|
|
308
|
+
|
|
309
|
+
- **Fork and Dependabot pull requests** get no write token or secrets, so the
|
|
310
|
+
autofix workflow skips them, except with `autofix-ci`, whose App commits to
|
|
311
|
+
fork pull requests. Their authors run `tailor generate` and commit the result
|
|
312
|
+
as before.
|
|
313
|
+
- **A branch that moved on:** if someone pushes to the branch while the
|
|
314
|
+
workflow runs, it does not commit; the run for the new commit regenerates the
|
|
315
|
+
files.
|
|
316
|
+
- **Output that keeps changing:** if `tailor generate` changes files again
|
|
317
|
+
right after the fix commit, the workflow fails instead of committing again.
|
|
318
|
+
Check that running it twice in a row changes nothing.
|
|
319
|
+
- **Approval rules:** the fix commit becomes the most recent push to the pull
|
|
320
|
+
request, and a bot pushed it. A branch protection rule that requires the most
|
|
321
|
+
recent push to be approved by someone other than its pusher is then satisfied
|
|
322
|
+
by an approval from anyone else, including whoever pushed the commit before
|
|
323
|
+
it.
|
|
324
|
+
- **Renovate** stops updating a pull request that has commits from someone
|
|
325
|
+
else. Add the fix commits' author email to `gitIgnoredAuthors` in your
|
|
326
|
+
Renovate configuration, such as
|
|
327
|
+
`41898282+github-actions[bot]@users.noreply.github.com` for `github-token`.
|
|
328
|
+
- **Secrets:** with `github-app`, every workflow in the repository can read the
|
|
329
|
+
App's private key, which can write to the repository. Give the App only the
|
|
330
|
+
Contents permission and install it only where it commits. `securefix` keeps
|
|
331
|
+
the key that writes in the server repository instead.
|
|
332
|
+
- **Dependabot** stops rebasing a pull request that has commits from someone
|
|
333
|
+
else, which happens when `autofix-ci` commits to one of its pull requests.
|
|
334
|
+
- With `autofix-ci` and `securefix`, the workflow is named `autofix.ci` and
|
|
335
|
+
`securefix`, the names those services accept requests from by default. With
|
|
336
|
+
`autofix-ci`, it also gives git its read-only token after `tailor generate`
|
|
337
|
+
finishes, because autofix.ci fetches the pull request head itself.
|
|
338
|
+
- GitHub Enterprise Server is not supported.
|
|
339
|
+
|
|
340
|
+
To stop committing, delete the workflow with
|
|
341
|
+
`tailor setup delete .github/workflows/tailor-autofix.yml`.
|
|
342
|
+
|
|
275
343
|
## Targeting a workspace
|
|
276
344
|
|
|
277
345
|
The generated `plan` and `deploy` jobs target a workspace by **id**, read from
|
|
@@ -349,6 +417,12 @@ that require authentication, configure the credentials in your own step.
|
|
|
349
417
|
See [Customizing the generated workflow](#customizing-the-generated-workflow)
|
|
350
418
|
for what you can edit.
|
|
351
419
|
|
|
420
|
+
### `.github/workflows/tailor-autofix.yml`
|
|
421
|
+
|
|
422
|
+
The workflow `setup ci autofix` generates (see
|
|
423
|
+
[Committing generated files to pull requests](#committing-generated-files-to-pull-requests)).
|
|
424
|
+
You can customize it the same way.
|
|
425
|
+
|
|
352
426
|
### Customizing the generated workflow
|
|
353
427
|
|
|
354
428
|
The SDK owns the jobs and steps whose `id` starts with `tailor-`, and the
|
|
@@ -593,7 +667,8 @@ protection rules no longer guard your deploys.
|
|
|
593
667
|
`tailor setup ci env` reads `.github/tailor.lock` and prints, for every GitHub
|
|
594
668
|
Environment the generated workflows use, the commands that create the
|
|
595
669
|
environment (only when it does not exist yet) and set its secrets and
|
|
596
|
-
variables
|
|
670
|
+
variables, followed by the repository secrets and variables the autofix
|
|
671
|
+
workflow needs. It is read-only, so re-run it whenever you add a target. When the
|
|
597
672
|
`origin` remote points at github.com, the output names that repository;
|
|
598
673
|
otherwise it names the repository `gh repo view` reports for the current
|
|
599
674
|
directory, with its host on GitHub Enterprise Server. Either way the commands
|
|
@@ -622,6 +697,12 @@ The list follows what each generated workflow actually reads:
|
|
|
622
697
|
| `TAILOR_SLACK_BOT_TOKEN` | secret | branch, tag | no | Bot User OAuth Token (`xoxb-...`) of a Slack app with the `chat:write` scope |
|
|
623
698
|
| `TAILOR_SLACK_CHANNEL_ID` | variable | branch, tag | no | Channel ID (`C...`) from the channel details in Slack; invite the bot to the channel |
|
|
624
699
|
| `TAILOR_SLACK_USER_MAPPING` | variable | branch, tag | no | JSON object mapping GitHub usernames to Slack member IDs (for example `{"alice":"U0123456"}`) so notifications mention the actor; read only after you uncomment the `user-mapping` input of the `tailor-notify` step |
|
|
700
|
+
| `TAILOR_AUTOFIX_APP_CLIENT_ID` | variable | autofix (`github-app`, `securefix`) | yes | Client ID of the GitHub App that commits for the autofix workflow (with `securefix`, the securefix client App), from the App's settings page |
|
|
701
|
+
| `TAILOR_AUTOFIX_APP_PRIVATE_KEY` | secret | autofix (`github-app`, `securefix`) | yes | Private key of the same App, generated on its settings page; pass the `.pem` file on standard input (`gh secret set TAILOR_AUTOFIX_APP_PRIVATE_KEY < key.pem`) |
|
|
702
|
+
|
|
703
|
+
The autofix workflow uses no GitHub Environment, so its two entries are set on
|
|
704
|
+
the repository; the output lists them under the repository instead of an
|
|
705
|
+
environment.
|
|
625
706
|
|
|
626
707
|
See [Account management](https://docs.tailor.tech/administration/account-management)
|
|
627
708
|
for how organizations, folders, workspaces, and machine users relate.
|
|
@@ -651,7 +732,8 @@ to manage those settings in Terraform instead.
|
|
|
651
732
|
### Checking what is registered
|
|
652
733
|
|
|
653
734
|
`tailor setup ci env --check` reads GitHub with `gh` and reports, for each
|
|
654
|
-
environment
|
|
735
|
+
environment and for the repository entries of the autofix workflow, which of
|
|
736
|
+
these entries are registered. It fails when a required
|
|
655
737
|
entry is missing, reports missing optional entries without failing, and prints
|
|
656
738
|
the `gh` commands that set only the missing entries, with where each value comes
|
|
657
739
|
from. It changes nothing, and it checks names only, since GitHub never returns
|
|
@@ -669,8 +751,8 @@ secret values.
|
|
|
669
751
|
answers 404 for a private repository the account cannot see, so the check
|
|
670
752
|
reports that as an access problem, not as missing entries.
|
|
671
753
|
|
|
672
|
-
`--environment` narrows the check the same way
|
|
673
|
-
`--format terraform`.
|
|
754
|
+
`--environment` narrows the check the same way, leaving out the repository
|
|
755
|
+
entries. `--check` cannot be combined with `--format terraform`.
|
|
674
756
|
|
|
675
757
|
## GitHub Environments (approval gate)
|
|
676
758
|
|
|
@@ -965,6 +1047,7 @@ server and its runners first:
|
|
|
965
1047
|
the pinned versions: update them with `actions-sync`, or, with GitHub
|
|
966
1048
|
Connect, delete them from the server's `actions` organization (see GitHub's
|
|
967
1049
|
[Using the latest version of the official bundled actions](https://docs.github.com/en/enterprise-server@latest/admin/managing-github-actions-for-your-enterprise/managing-access-to-actions-from-githubcom/using-the-latest-version-of-the-official-bundled-actions)).
|
|
1050
|
+
- **Autofix workflow:** `tailor setup ci autofix` is not supported.
|
|
968
1051
|
- **Environment settings:** sign `gh` in to the server
|
|
969
1052
|
(`gh auth login --hostname <host>`) before you run `tailor setup ci env` in a
|
|
970
1053
|
clone of the repository, so that the `gh` commands it prints and its Terraform
|
|
@@ -1031,24 +1114,30 @@ writing anything. It reports when a workflow file is missing or its SDK-managed
|
|
|
1031
1114
|
parts were edited by hand, a job or step of yours uses the reserved `tailor-`
|
|
1032
1115
|
prefix, a newer template is available, `tailor.config.ts` is no longer under the recorded
|
|
1033
1116
|
`--dir`, or the repository default branch no longer matches a branch target's
|
|
1034
|
-
trigger. It
|
|
1117
|
+
trigger. It audits the autofix workflow the same way, along with each app
|
|
1118
|
+
directory it runs `tailor generate` in. It also reports a `.github/tailor-sdk.lock` left by an older setup,
|
|
1119
|
+
with the files it generated that `.github/tailor.lock` does not track, since
|
|
1120
|
+
the workflows among them still run, and prints the `git rm` command that
|
|
1121
|
+
removes them.
|
|
1122
|
+
It exits non-zero when it finds drift, so you can run it in CI. Each
|
|
1035
1123
|
finding names a stable rule key for future suppression. Run
|
|
1036
1124
|
[`tailor setup update`](#updating-the-generated-workflow) to regenerate the
|
|
1037
|
-
|
|
1125
|
+
workflows it reports.
|
|
1038
1126
|
|
|
1039
1127
|
Workflows generated by `setup ci branch`, `setup ci tag`, and `setup ci preview`
|
|
1040
1128
|
self-audit: each contains a `tailor-drift-check` step that
|
|
1041
1129
|
runs the check in CI. Preview workflows run it alongside each preview deploy,
|
|
1042
1130
|
so pull requests that deploy no preview (drafts with `--require ready`, fork
|
|
1043
|
-
PRs, and unlabeled PRs with `--require label`) skip the check. A single run audits every
|
|
1131
|
+
PRs, and unlabeled PRs with `--require label`) skip the check. A single run audits every workflow
|
|
1044
1132
|
recorded in `.github/tailor.lock`.
|
|
1045
1133
|
|
|
1046
1134
|
Drift findings are advisory by default. Set the repository variable
|
|
1047
1135
|
`TAILOR_PLATFORM_FAIL_ON_DRIFT` to `true` to make unsuppressed findings fail
|
|
1048
1136
|
the job. Execution and configuration errors fail regardless of this variable.
|
|
1049
1137
|
|
|
1050
|
-
`check` compares only the generated files, `.github/tailor.lock
|
|
1051
|
-
config; it does not read the
|
|
1138
|
+
`check` compares only the generated files, `.github/tailor.lock` (and a
|
|
1139
|
+
leftover `.github/tailor-sdk.lock`), and the config; it does not read the
|
|
1140
|
+
GitHub Environment secrets and variables, so it
|
|
1052
1141
|
runs the same on your own machine and in CI. Run `tailor setup ci env` to list
|
|
1053
1142
|
what each environment needs.
|
|
1054
1143
|
|
|
@@ -1072,10 +1161,10 @@ are detected again, and the parts that follow your config — the migration drif
|
|
|
1072
1161
|
check, seed validation, and ERD preview namespaces — are derived from the
|
|
1073
1162
|
current `tailor.config.ts`.
|
|
1074
1163
|
|
|
1075
|
-
A
|
|
1164
|
+
A workflow that cannot be regenerated, for example because you edited a managed
|
|
1076
1165
|
part, does not stop the others: `update` regenerates the rest, then lists the
|
|
1077
|
-
|
|
1078
|
-
`tailor setup update --force` to reset the managed parts of every
|
|
1166
|
+
workflows it could not update and exits non-zero. Revert the edit, or run
|
|
1167
|
+
`tailor setup update --force` to reset the managed parts of every workflow.
|
|
1079
1168
|
|
|
1080
1169
|
To change a flag for one target, re-run its `setup ci` subcommand with the new
|
|
1081
1170
|
flags. `.github/tailor.lock` records them, and later updates reuse them.
|
package/docs/plugin/custom.md
CHANGED
|
@@ -204,10 +204,10 @@ onNamespaceLoaded(context) {
|
|
|
204
204
|
|
|
205
205
|
**Returns** (`GeneratorResult`):
|
|
206
206
|
|
|
207
|
-
| Field | Type
|
|
208
|
-
| -------- |
|
|
209
|
-
| `files` | `Array<{ path, content, skipIfExists
|
|
210
|
-
| `errors` | `string[]?`
|
|
207
|
+
| Field | Type | Description |
|
|
208
|
+
| -------- | ----------------------------------------- | ------------------------ |
|
|
209
|
+
| `files` | `Array<{ path, content, skipIfExists? }>` | Files to write to disk |
|
|
210
|
+
| `errors` | `string[]?` | Error messages to report |
|
|
211
211
|
|
|
212
212
|
**Use cases**:
|
|
213
213
|
|
package/docs/runtime.md
CHANGED
|
@@ -133,7 +133,7 @@ The runtime entry re-exports the following namespaces. Detailed signatures, para
|
|
|
133
133
|
- `aigateway` — AI Gateway URL resolution (`get`)
|
|
134
134
|
- `logger` — structured logging with severity and attributes; the message is written to standard output, the full entry with its attributes is exported over OpenTelemetry where the attributes are queryable (`debug`, `info`, `warn`, `error`, `setAttributes`)
|
|
135
135
|
|
|
136
|
-
## Testing
|
|
136
|
+
## Testing (Beta)
|
|
137
137
|
|
|
138
138
|
`@tailor-platform/sdk/vitest` ships mock controllers for every runtime namespace. Pair them with the `tailor-runtime` Vitest environment so your unit tests run against the same wrappers your production code does. Each controller is a factory — acquire it with a `using` declaration and its state is reset automatically when the test scope exits (no `beforeEach(() => mock.reset())` needed). Requires TypeScript ≥ 5.2 and a runtime with `Symbol.dispose` (Node ≥ 20.4; the SDK targets Node ≥ 22).
|
|
139
139
|
|
package/docs/services/auth.md
CHANGED
|
@@ -334,6 +334,8 @@ oauth2Clients: {
|
|
|
334
334
|
},
|
|
335
335
|
```
|
|
336
336
|
|
|
337
|
+
Client names must be 3 to 63 lowercase letters, digits, or hyphens, starting and ending with a letter or digit.
|
|
338
|
+
|
|
337
339
|
**redirectURIs**: Allowed redirect URIs after authentication.
|
|
338
340
|
|
|
339
341
|
**description**: Optional description of the client.
|
package/docs/services/idp.md
CHANGED
|
@@ -133,6 +133,8 @@ defineIdp("my-idp", {
|
|
|
133
133
|
});
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
Client names must be 3 to 63 lowercase letters, digits, or hyphens, starting and ending with a letter or digit.
|
|
137
|
+
|
|
136
138
|
### userAuthPolicy
|
|
137
139
|
|
|
138
140
|
User authentication policy. Controls password requirements, the identifier used for login, allowed email domains, and social login providers. Every field is optional. The boolean options default to disabled, and the password length fields default to a minimum of 6 and a maximum of 4096.
|
|
@@ -243,7 +243,7 @@ const order = db.table("Order", {
|
|
|
243
243
|
});
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
-
A relation inside `db.object()`
|
|
246
|
+
A relation inside `db.object()` can point at its own table, for example `links.parentID` on `Node`. `tailor seed apply` inserts a row before the rows that point at it, in whatever order the seed data lists them, and follows every element of an array. This needs a unique `id` on every row, and a reference must match the referenced value exactly, including letter case. Otherwise the rows can be inserted in the order the file lists them. The data copy that a table rename generates inserts such references as null and restores them once every row exists.
|
|
247
247
|
|
|
248
248
|
Create relations against different fields using `toward.key`:
|
|
249
249
|
|
|
@@ -263,6 +263,11 @@ const userProfile = db.table("UserProfile", {
|
|
|
263
263
|
`userEmail` does not end in `ID`, `Id`, or `id`, so this example specifies the forward relation
|
|
264
264
|
name with `toward.as`.
|
|
265
265
|
|
|
266
|
+
A relation field must have the same type as the field it points at: `db.uuid()` for the default
|
|
267
|
+
`id`, and the type of the `toward.key` field otherwise. The SDK rejects a relation whose types
|
|
268
|
+
differ, such as a `db.string()` field related to `id`. A custom `toward.key` must be unique,
|
|
269
|
+
through `.unique()` or a one-to-one relation.
|
|
270
|
+
|
|
266
271
|
Customize relation names using `toward.as` / `backward` options:
|
|
267
272
|
|
|
268
273
|
```typescript
|
|
@@ -773,7 +778,7 @@ db.table("User", {
|
|
|
773
778
|
|
|
774
779
|
**Warning**: Do not use `unsafeAllowAllTypePermission` or `unsafeAllowAllGqlPermission` in production environments as they effectively disable authorization checks.
|
|
775
780
|
|
|
776
|
-
## Migrations
|
|
781
|
+
## Migrations (Beta)
|
|
777
782
|
|
|
778
783
|
When you change a TailorDB table definition, the SDK can generate a migration that captures the diff and, for breaking changes, runs a data transformation script during `tailor deploy`. See the [TailorDB Migrations guide](./migration.md) for the full workflow, configuration, supported change types, team coordination, and troubleshooting.
|
|
779
784
|
|