@tailor-platform/sdk 1.2.0 → 1.2.2
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 +46 -3
- package/dist/cli/index.mjs +2 -2
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +1 -2
- package/dist/cli/lib.mjs +2 -2
- package/dist/{config-Bc_PBkyF.mjs → config-CnvbSTIP.mjs} +13 -10
- package/dist/config-CnvbSTIP.mjs.map +1 -0
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +1 -1
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{index-Dz4RseTN.d.mts → index-aNF917Ib.d.mts} +10 -10
- package/dist/{list-9sLkfPfn.mjs → list-CinLZzZW.mjs} +655 -32
- package/dist/list-CinLZzZW.mjs.map +1 -0
- package/dist/{types-QjDcgdOy.d.mts → types-C0n7Syhv.d.mts} +43 -35
- package/dist/user-defined.d.ts +1 -0
- package/dist/utils/test/index.d.mts +7 -9
- package/dist/utils/test/index.mjs +5 -7
- package/dist/utils/test/index.mjs.map +1 -1
- package/package.json +10 -7
- package/postinstall.mjs +1 -0
- package/dist/config-Bc_PBkyF.mjs.map +0 -1
- package/dist/list-9sLkfPfn.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 1.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#369](https://github.com/tailor-platform/sdk/pull/369) [`202e5a7`](https://github.com/tailor-platform/sdk/commit/202e5a7f5c170de18d98255ca798d19552d2905d) Thanks [@toiroakr](https://github.com/toiroakr)! - Prevent index/unique settings on array fields with type-level constraints and runtime validation
|
|
8
|
+
|
|
9
|
+
- [#371](https://github.com/tailor-platform/sdk/pull/371) [`1c5f2a8`](https://github.com/tailor-platform/sdk/commit/1c5f2a897ef0b346a8de9cb71c7359e09724ac00) Thanks [@riku99](https://github.com/riku99)! - Enable selected JSDoc-related lint rules
|
|
10
|
+
|
|
11
|
+
- [#370](https://github.com/tailor-platform/sdk/pull/370) [`78d4667`](https://github.com/tailor-platform/sdk/commit/78d4667b7f8fc649dd1d1fe8e0aa70bf8c456be9) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency bufbuild/buf to v1.63.0
|
|
12
|
+
|
|
13
|
+
- [#374](https://github.com/tailor-platform/sdk/pull/374) [`8c4bff8`](https://github.com/tailor-platform/sdk/commit/8c4bff8db7dedba16ab6572473d7b93cf9ac2211) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): pin dependency oxlint-tsgolint to 0.10.1
|
|
14
|
+
|
|
15
|
+
- [#375](https://github.com/tailor-platform/sdk/pull/375) [`f42a755`](https://github.com/tailor-platform/sdk/commit/f42a7556785bf97f6aedb3dc03d398f0d38c492d) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @typescript/native-preview to v7.0.0-dev.20260103.1
|
|
16
|
+
|
|
17
|
+
- [#367](https://github.com/tailor-platform/sdk/pull/367) [`2edef96`](https://github.com/tailor-platform/sdk/commit/2edef96db3b1a6ed88e5fb1f64dab4e2d0dd7867) Thanks [@riku99](https://github.com/riku99)! - Use tsgo and tsgolint in packages/sdk and example
|
|
18
|
+
|
|
19
|
+
## 1.2.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#353](https://github.com/tailor-platform/sdk/pull/353) [`2f5e2bf`](https://github.com/tailor-platform/sdk/commit/2f5e2bf80174e48c6e7ffd4e057d740a88b178e7) Thanks [@riku99](https://github.com/riku99)! - Use oxlint and oxfmt in example and create-sdk/templates
|
|
24
|
+
|
|
25
|
+
- [#363](https://github.com/tailor-platform/sdk/pull/363) [`71fdaa9`](https://github.com/tailor-platform/sdk/commit/71fdaa97ae80db62e1bd4778721baee849f0412f) Thanks [@toiroakr](https://github.com/toiroakr)! - chore: remove rolldown override (upstream issues resolved)
|
|
26
|
+
|
|
27
|
+
- [#358](https://github.com/tailor-platform/sdk/pull/358) [`90618d1`](https://github.com/tailor-platform/sdk/commit/90618d10bd543ddbe57ace65b80c007247865737) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency zod to v4.3.4
|
|
28
|
+
|
|
3
29
|
## 1.2.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
@@ -11,12 +37,14 @@
|
|
|
11
37
|
### Patch Changes
|
|
12
38
|
|
|
13
39
|
- [#342](https://github.com/tailor-platform/sdk/pull/342) [`ec710be`](https://github.com/tailor-platform/sdk/commit/ec710be1aa2ff6f9b8f5d6816010340a95b6835e) Thanks [@toiroakr](https://github.com/toiroakr)! - fix(cli): unify table border style to single-line across all CLI commands
|
|
40
|
+
|
|
14
41
|
- Add `formatTable`, `formatKeyValueTable`, `formatTableWithHeaders` utility functions
|
|
15
42
|
- Add `formatValue` function for proper object/array formatting in tables
|
|
16
43
|
- Add ESLint rule to restrict direct `table` import
|
|
17
44
|
- Add tests for format utilities
|
|
18
45
|
|
|
19
46
|
- [#346](https://github.com/tailor-platform/sdk/pull/346) [`a8355bb`](https://github.com/tailor-platform/sdk/commit/a8355bb9aafbf6ea1da5167939cc429b4010462a) Thanks [@toiroakr](https://github.com/toiroakr)! - refactor(cli): improve stdout/stderr separation following clig.dev guidelines
|
|
47
|
+
|
|
20
48
|
- Add custom reporters (`IconReporter`, `PlainReporter`) to prevent extra newlines in piped environments
|
|
21
49
|
- All log methods (`info`, `success`, `warn`, `error`, `log`, `debug`) now output to stderr
|
|
22
50
|
- Rename `logger.data()` to `logger.out()` for primary program output to stdout
|
|
@@ -27,6 +55,7 @@
|
|
|
27
55
|
- [#345](https://github.com/tailor-platform/sdk/pull/345) [`f92d582`](https://github.com/tailor-platform/sdk/commit/f92d582c6b4c23163ba6d750251f7ed4fad4677b) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: e2e tests incorrectly counting resources when multiple apps exist in workspace
|
|
28
56
|
|
|
29
57
|
Fixed an issue where e2e tests counted resources from other applications in the same workspace.
|
|
58
|
+
|
|
30
59
|
- Add metadata filtering by `sdk-name` label in e2e tests
|
|
31
60
|
- Set metadata on JobFunctions during apply and remove when no longer used
|
|
32
61
|
|
|
@@ -125,7 +154,7 @@
|
|
|
125
154
|
|
|
126
155
|
```ts
|
|
127
156
|
export function getDB<const N extends keyof Namespace>(
|
|
128
|
-
namespace: N
|
|
157
|
+
namespace: N
|
|
129
158
|
): Kysely<Namespace[N]> {
|
|
130
159
|
const client = new tailordb.Client({ namespace });
|
|
131
160
|
return new Kysely<Namespace[N]>({ dialect: new TailordbDialect(client) });
|
|
@@ -139,7 +168,7 @@
|
|
|
139
168
|
```ts
|
|
140
169
|
export function getDB<const N extends keyof Namespace>(
|
|
141
170
|
namespace: N,
|
|
142
|
-
kyselyConfig?: Omit<KyselyConfig, "dialect"
|
|
171
|
+
kyselyConfig?: Omit<KyselyConfig, "dialect">
|
|
143
172
|
): Kysely<Namespace[N]> {
|
|
144
173
|
const client = new tailordb.Client({ namespace });
|
|
145
174
|
return new Kysely<Namespace[N]>({
|
|
@@ -182,6 +211,7 @@
|
|
|
182
211
|
When deleting subgraph services (TailorDB, Pipeline, Auth, IdP), the deletion would fail with an error like "Failed to delete AuthService: auth xxx is used by gateway(s)" because the Application was still referencing them.
|
|
183
212
|
|
|
184
213
|
This fix separates the deletion phases:
|
|
214
|
+
|
|
185
215
|
- `delete-resources`: Deletes resources (types, resolvers, clients, etc.) before Application update
|
|
186
216
|
- `delete-services`: Deletes services after Application is deleted
|
|
187
217
|
|
|
@@ -202,6 +232,7 @@
|
|
|
202
232
|
- [#286](https://github.com/tailor-platform/sdk/pull/286) [`3409d66`](https://github.com/tailor-platform/sdk/commit/3409d66e6c6944292a3933e055d80c178efa7786) Thanks [@toiroakr](https://github.com/toiroakr)! - Unify CLI option short flags for consistency
|
|
203
233
|
|
|
204
234
|
**Breaking Changes:**
|
|
235
|
+
|
|
205
236
|
- `apply --dry-run`: Changed short flag from `-n` to `-d`
|
|
206
237
|
- `workspace create --name`: Changed short flag from `-N` to `-n`
|
|
207
238
|
- `workspace create --delete-protection`: Changed short flag from `-D` to `-d`
|
|
@@ -210,10 +241,12 @@
|
|
|
210
241
|
- `secret delete --name`: Changed short flag from `-N` to `-n`
|
|
211
242
|
|
|
212
243
|
**Documentation:**
|
|
244
|
+
|
|
213
245
|
- Updated CLI documentation to reflect the new short flags
|
|
214
246
|
- Added missing `staticwebsite` CLI documentation
|
|
215
247
|
|
|
216
248
|
**New Unified Rules:**
|
|
249
|
+
|
|
217
250
|
- `--name`: Always uses `-n`
|
|
218
251
|
- `--namespace`: Always uses `-n` (no conflict as it's in different commands)
|
|
219
252
|
- `--dry-run`: Uses `-d` (apply command)
|
|
@@ -282,6 +315,7 @@
|
|
|
282
315
|
When a TailorDB type is created (e.g., `User`), the system auto-generates resolvers like `deleteUser`, `createUser`, etc. If a user created a custom resolver with the same name, it could not be deleted because the Application update (SDL composition) failed before the deletion phase.
|
|
283
316
|
|
|
284
317
|
This fix reorders the apply phases to delete subgraph services before updating the Application:
|
|
318
|
+
|
|
285
319
|
1. Create/Update services that Application depends on (subgraphs + StaticWebsite)
|
|
286
320
|
2. Delete subgraph services (before Application update to avoid SDL conflicts)
|
|
287
321
|
3. Create/Update Application
|
|
@@ -293,6 +327,7 @@
|
|
|
293
327
|
### Patch Changes
|
|
294
328
|
|
|
295
329
|
- [#238](https://github.com/tailor-platform/sdk/pull/238) [`36639c6`](https://github.com/tailor-platform/sdk/commit/36639c6e1efee873eff89e61c59c60b8b22531a8) Thanks [@toiroakr](https://github.com/toiroakr)! - Improve Connect error messages in CLI
|
|
330
|
+
|
|
296
331
|
- Add `errorHandlingInterceptor` to enhance error messages from Connect protocol
|
|
297
332
|
- Error messages now include operation type, resource type, and request parameters
|
|
298
333
|
- Makes it easier to identify which resource caused validation errors
|
|
@@ -384,6 +419,7 @@
|
|
|
384
419
|
### Minor Changes
|
|
385
420
|
|
|
386
421
|
- [#158](https://github.com/tailor-platform/sdk/pull/158) [`cde0a0a`](https://github.com/tailor-platform/sdk/commit/cde0a0a3e1d517e8036f799ce2a0b8958f7e18c4) Thanks [@riku99](https://github.com/riku99)! - CLI changes:
|
|
422
|
+
|
|
387
423
|
- Replace `--format` with `--json` for all list/detail commands. `--format` is no longer supported.
|
|
388
424
|
- Change default table layout for list output and humanize `createdAt` / `updatedAt` in table format (JSON remains ISO strings).
|
|
389
425
|
- `workspace list`: hide `updatedAt` in table output and add `--limit=<number>` to cap the number of workspaces shown.
|
|
@@ -441,6 +477,7 @@
|
|
|
441
477
|
Previously, the SDK used `hasExistingWorkflows` (based on workflow updates) to decide whether to use `createWorkflowJobFunction` or `updateWorkflowJobFunction`. This caused errors when renaming job functions, as renamed jobs were incorrectly sent to the update API which requires the job to already exist.
|
|
442
478
|
|
|
443
479
|
Now the SDK fetches the actual list of existing job function names via `listWorkflowJobFunctions` API and correctly uses:
|
|
480
|
+
|
|
444
481
|
- `createWorkflowJobFunction` for new job names (including renamed jobs)
|
|
445
482
|
- `updateWorkflowJobFunction` for existing job names
|
|
446
483
|
|
|
@@ -498,10 +535,12 @@
|
|
|
498
535
|
### Minor Changes
|
|
499
536
|
|
|
500
537
|
- [#124](https://github.com/tailor-platform/sdk/pull/124) [`6d96fdb`](https://github.com/tailor-platform/sdk/commit/6d96fdbbecc225e9906b9c0b2225a733dd8fc4d8) Thanks [@toiroakr](https://github.com/toiroakr)! - Add workflow trigger functionality
|
|
538
|
+
|
|
501
539
|
- Add `trigger` method to `Workflow` type that allows triggering workflows from resolvers and executors
|
|
502
540
|
- Support `authInvoker` option for authentication when triggering workflows
|
|
503
541
|
|
|
504
542
|
**Breaking Changes**
|
|
543
|
+
|
|
505
544
|
- AuthInvoker field names changed:
|
|
506
545
|
- `authName` → `namespace`
|
|
507
546
|
- `machineUser` → `machineUserName`
|
|
@@ -519,6 +558,7 @@
|
|
|
519
558
|
- [#121](https://github.com/tailor-platform/sdk/pull/121) [`bc7a3e9`](https://github.com/tailor-platform/sdk/commit/bc7a3e96b4805e75fcb153220d286abaced26368) Thanks [@toiroakr](https://github.com/toiroakr)! - Streamline workflow job function registration and trigger handling
|
|
520
559
|
|
|
521
560
|
**Breaking Changes:**
|
|
561
|
+
|
|
522
562
|
- Removed `deps` property from `createWorkflowJob()` - jobs no longer declare dependencies explicitly
|
|
523
563
|
- Removed `jobs` object from `WorkflowJobContext` - use `.trigger()` method instead
|
|
524
564
|
- Changed the way workflow jobs call other jobs: from `jobs.job_name()` to `otherJob.trigger()`
|
|
@@ -569,6 +609,7 @@
|
|
|
569
609
|
```
|
|
570
610
|
|
|
571
611
|
**Key Changes:**
|
|
612
|
+
|
|
572
613
|
- Dependencies are now automatically detected via AST analysis of `.trigger()` calls at bundle time
|
|
573
614
|
- The `.trigger()` method is transformed to `tailor.workflow.triggerJobFunction()` during bundling
|
|
574
615
|
- Job function registration is optimized - all job functions are registered once and shared across workflows
|
|
@@ -659,6 +700,7 @@
|
|
|
659
700
|
```
|
|
660
701
|
|
|
661
702
|
**Options:**
|
|
703
|
+
|
|
662
704
|
- `-w, --workspace-id` - ID of the workspace to remove resources from
|
|
663
705
|
- `-p, --profile` - Workspace profile to use
|
|
664
706
|
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
@@ -972,7 +1014,7 @@
|
|
|
972
1014
|
```typescript
|
|
973
1015
|
defineGenerators(
|
|
974
1016
|
["@tailor/kysely-type", { distPath: "./generated/kysely.ts" }],
|
|
975
|
-
["@tailor/db-type", { distPath: "./generated/db.ts" }]
|
|
1017
|
+
["@tailor/db-type", { distPath: "./generated/db.ts" }]
|
|
976
1018
|
);
|
|
977
1019
|
```
|
|
978
1020
|
|
|
@@ -992,6 +1034,7 @@
|
|
|
992
1034
|
- [#691](https://github.com/tailor-platform/sdk/pull/691) [`4e949b6`](https://github.com/tailor-platform/sdk/commit/4e949b67291ce8775c189a793a99f768ab8904db) Thanks [@toiroakr](https://github.com/toiroakr)! - feat: add seed generator
|
|
993
1035
|
|
|
994
1036
|
Added `@tailor-platform/seed` generator that automatically generates seed data files from TailorDB type definitions. This generator creates:
|
|
1037
|
+
|
|
995
1038
|
- GraphQL Ingest mapping files (`mappings/*.json`) and GraphQL files for bulk data loading via [gql-ingest](https://github.com/jackchuka/gql-ingest)
|
|
996
1039
|
- lines-db schema files (`data/*.schema.ts`) for validation via [lines-db](https://github.com/toiroakr/lines-db)
|
|
997
1040
|
- Configuration file (`config.yaml`) defining entity dependencies
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "../chunk-CIV_ash9.mjs";
|
|
3
|
-
import "../config-
|
|
4
|
-
import { $ as withCommonArgs, B as loadWorkspaceId, D as tokenCommand, F as loadConfig, G as initOAuth2Client, H as writePlatformConfig, J as PATScope, K as initOperatorClient, L as apiCommand, N as applyCommand, O as listCommand$5, Q as jsonArgs, R as fetchLatestToken, S as listCommand$6, U as fetchAll, V as readPlatformConfig, W as fetchUserInfo, X as confirmationArgs, Y as commonArgs, Z as deploymentArgs, a as createCommand$3, d as listCommand$7, et as workspaceArgs, h as executionsCommand, j as generateCommand, l as startCommand, p as getCommand$2, q as readPackageJson, r as deleteCommand$3, s as resumeCommand, t as listCommand$8, tt as logger, w as getCommand$1, x as removeCommand, y as showCommand, z as loadAccessToken } from "../list-
|
|
3
|
+
import "../config-CnvbSTIP.mjs";
|
|
4
|
+
import { $ as withCommonArgs, B as loadWorkspaceId, D as tokenCommand, F as loadConfig, G as initOAuth2Client, H as writePlatformConfig, J as PATScope, K as initOperatorClient, L as apiCommand, N as applyCommand, O as listCommand$5, Q as jsonArgs, R as fetchLatestToken, S as listCommand$6, U as fetchAll, V as readPlatformConfig, W as fetchUserInfo, X as confirmationArgs, Y as commonArgs, Z as deploymentArgs, a as createCommand$3, d as listCommand$7, et as workspaceArgs, h as executionsCommand, j as generateCommand, l as startCommand, p as getCommand$2, q as readPackageJson, r as deleteCommand$3, s as resumeCommand, t as listCommand$8, tt as logger, w as getCommand$1, x as removeCommand, y as showCommand, z as loadAccessToken } from "../list-CinLZzZW.mjs";
|
|
5
5
|
import { register } from "node:module";
|
|
6
6
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
7
7
|
import { generateCodeVerifier } from "@badgateway/oauth2-client";
|