@tailor-platform/sdk 1.2.0 → 1.2.1

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ - [#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)
10
+
11
+ - [#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
12
+
3
13
  ## 1.2.0
4
14
 
5
15
  ### Minor Changes
@@ -11,12 +21,14 @@
11
21
  ### Patch Changes
12
22
 
13
23
  - [#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
24
+
14
25
  - Add `formatTable`, `formatKeyValueTable`, `formatTableWithHeaders` utility functions
15
26
  - Add `formatValue` function for proper object/array formatting in tables
16
27
  - Add ESLint rule to restrict direct `table` import
17
28
  - Add tests for format utilities
18
29
 
19
30
  - [#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
31
+
20
32
  - Add custom reporters (`IconReporter`, `PlainReporter`) to prevent extra newlines in piped environments
21
33
  - All log methods (`info`, `success`, `warn`, `error`, `log`, `debug`) now output to stderr
22
34
  - Rename `logger.data()` to `logger.out()` for primary program output to stdout
@@ -27,6 +39,7 @@
27
39
  - [#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
40
 
29
41
  Fixed an issue where e2e tests counted resources from other applications in the same workspace.
42
+
30
43
  - Add metadata filtering by `sdk-name` label in e2e tests
31
44
  - Set metadata on JobFunctions during apply and remove when no longer used
32
45
 
@@ -125,7 +138,7 @@
125
138
 
126
139
  ```ts
127
140
  export function getDB<const N extends keyof Namespace>(
128
- namespace: N,
141
+ namespace: N
129
142
  ): Kysely<Namespace[N]> {
130
143
  const client = new tailordb.Client({ namespace });
131
144
  return new Kysely<Namespace[N]>({ dialect: new TailordbDialect(client) });
@@ -139,7 +152,7 @@
139
152
  ```ts
140
153
  export function getDB<const N extends keyof Namespace>(
141
154
  namespace: N,
142
- kyselyConfig?: Omit<KyselyConfig, "dialect">,
155
+ kyselyConfig?: Omit<KyselyConfig, "dialect">
143
156
  ): Kysely<Namespace[N]> {
144
157
  const client = new tailordb.Client({ namespace });
145
158
  return new Kysely<Namespace[N]>({
@@ -182,6 +195,7 @@
182
195
  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
196
 
184
197
  This fix separates the deletion phases:
198
+
185
199
  - `delete-resources`: Deletes resources (types, resolvers, clients, etc.) before Application update
186
200
  - `delete-services`: Deletes services after Application is deleted
187
201
 
@@ -202,6 +216,7 @@
202
216
  - [#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
217
 
204
218
  **Breaking Changes:**
219
+
205
220
  - `apply --dry-run`: Changed short flag from `-n` to `-d`
206
221
  - `workspace create --name`: Changed short flag from `-N` to `-n`
207
222
  - `workspace create --delete-protection`: Changed short flag from `-D` to `-d`
@@ -210,10 +225,12 @@
210
225
  - `secret delete --name`: Changed short flag from `-N` to `-n`
211
226
 
212
227
  **Documentation:**
228
+
213
229
  - Updated CLI documentation to reflect the new short flags
214
230
  - Added missing `staticwebsite` CLI documentation
215
231
 
216
232
  **New Unified Rules:**
233
+
217
234
  - `--name`: Always uses `-n`
218
235
  - `--namespace`: Always uses `-n` (no conflict as it's in different commands)
219
236
  - `--dry-run`: Uses `-d` (apply command)
@@ -282,6 +299,7 @@
282
299
  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
300
 
284
301
  This fix reorders the apply phases to delete subgraph services before updating the Application:
302
+
285
303
  1. Create/Update services that Application depends on (subgraphs + StaticWebsite)
286
304
  2. Delete subgraph services (before Application update to avoid SDL conflicts)
287
305
  3. Create/Update Application
@@ -293,6 +311,7 @@
293
311
  ### Patch Changes
294
312
 
295
313
  - [#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
314
+
296
315
  - Add `errorHandlingInterceptor` to enhance error messages from Connect protocol
297
316
  - Error messages now include operation type, resource type, and request parameters
298
317
  - Makes it easier to identify which resource caused validation errors
@@ -384,6 +403,7 @@
384
403
  ### Minor Changes
385
404
 
386
405
  - [#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:
406
+
387
407
  - Replace `--format` with `--json` for all list/detail commands. `--format` is no longer supported.
388
408
  - Change default table layout for list output and humanize `createdAt` / `updatedAt` in table format (JSON remains ISO strings).
389
409
  - `workspace list`: hide `updatedAt` in table output and add `--limit=<number>` to cap the number of workspaces shown.
@@ -441,6 +461,7 @@
441
461
  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
462
 
443
463
  Now the SDK fetches the actual list of existing job function names via `listWorkflowJobFunctions` API and correctly uses:
464
+
444
465
  - `createWorkflowJobFunction` for new job names (including renamed jobs)
445
466
  - `updateWorkflowJobFunction` for existing job names
446
467
 
@@ -498,10 +519,12 @@
498
519
  ### Minor Changes
499
520
 
500
521
  - [#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
522
+
501
523
  - Add `trigger` method to `Workflow` type that allows triggering workflows from resolvers and executors
502
524
  - Support `authInvoker` option for authentication when triggering workflows
503
525
 
504
526
  **Breaking Changes**
527
+
505
528
  - AuthInvoker field names changed:
506
529
  - `authName` → `namespace`
507
530
  - `machineUser` → `machineUserName`
@@ -519,6 +542,7 @@
519
542
  - [#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
543
 
521
544
  **Breaking Changes:**
545
+
522
546
  - Removed `deps` property from `createWorkflowJob()` - jobs no longer declare dependencies explicitly
523
547
  - Removed `jobs` object from `WorkflowJobContext` - use `.trigger()` method instead
524
548
  - Changed the way workflow jobs call other jobs: from `jobs.job_name()` to `otherJob.trigger()`
@@ -569,6 +593,7 @@
569
593
  ```
570
594
 
571
595
  **Key Changes:**
596
+
572
597
  - Dependencies are now automatically detected via AST analysis of `.trigger()` calls at bundle time
573
598
  - The `.trigger()` method is transformed to `tailor.workflow.triggerJobFunction()` during bundling
574
599
  - Job function registration is optimized - all job functions are registered once and shared across workflows
@@ -659,6 +684,7 @@
659
684
  ```
660
685
 
661
686
  **Options:**
687
+
662
688
  - `-w, --workspace-id` - ID of the workspace to remove resources from
663
689
  - `-p, --profile` - Workspace profile to use
664
690
  - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
@@ -972,7 +998,7 @@
972
998
  ```typescript
973
999
  defineGenerators(
974
1000
  ["@tailor/kysely-type", { distPath: "./generated/kysely.ts" }],
975
- ["@tailor/db-type", { distPath: "./generated/db.ts" }],
1001
+ ["@tailor/db-type", { distPath: "./generated/db.ts" }]
976
1002
  );
977
1003
  ```
978
1004
 
@@ -992,6 +1018,7 @@
992
1018
  - [#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
1019
 
994
1020
  Added `@tailor-platform/seed` generator that automatically generates seed data files from TailorDB type definitions. This generator creates:
1021
+
995
1022
  - GraphQL Ingest mapping files (`mappings/*.json`) and GraphQL files for bulk data loading via [gql-ingest](https://github.com/jackchuka/gql-ingest)
996
1023
  - lines-db schema files (`data/*.schema.ts`) for validation via [lines-db](https://github.com/toiroakr/lines-db)
997
1024
  - Configuration file (`config.yaml`) defining entity dependencies