@tailor-platform/sdk 1.32.0 → 1.33.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/{application-B8vok3w2.mjs → application-CfAom-vi.mjs} +38 -29
  3. package/dist/application-CfAom-vi.mjs.map +1 -0
  4. package/dist/application-ChVyhwe-.mjs +12 -0
  5. package/dist/{brand-GZnI4eYb.mjs → brand-0SscafcY.mjs} +2 -1
  6. package/dist/{brand-GZnI4eYb.mjs.map → brand-0SscafcY.mjs.map} +1 -1
  7. package/dist/{chunk-DEt8GZDa.mjs → chunk-COzJYswC.mjs} +1 -0
  8. package/dist/cli/index.d.mts +1 -0
  9. package/dist/cli/index.mjs +30 -29
  10. package/dist/cli/index.mjs.map +1 -1
  11. package/dist/cli/lib.d.mts +10 -6
  12. package/dist/cli/lib.mjs +14 -13
  13. package/dist/cli/lib.mjs.map +1 -1
  14. package/dist/cli/skills.d.mts +1 -0
  15. package/dist/cli/skills.mjs +2 -1
  16. package/dist/cli/skills.mjs.map +1 -1
  17. package/dist/{client-DfdgRZlQ.mjs → client-D5P1myz0.mjs} +6 -5
  18. package/dist/{client-DfdgRZlQ.mjs.map → client-D5P1myz0.mjs.map} +1 -1
  19. package/dist/{client-B0wrLUVK.mjs → client-gpRgZl1b.mjs} +5 -4
  20. package/dist/configure/index.d.mts +6 -5
  21. package/dist/configure/index.mjs +85 -14
  22. package/dist/configure/index.mjs.map +1 -1
  23. package/dist/crash-report-Cm9vFmTN.mjs +7 -0
  24. package/dist/{crash-report-wNxS0IUJ.mjs → crash-report-DnwITWeV.mjs} +5 -4
  25. package/dist/{crash-report-wNxS0IUJ.mjs.map → crash-report-DnwITWeV.mjs.map} +1 -1
  26. package/dist/{enum-constants-D1nfn0qD.mjs → enum-constants-Piv_E-2M.mjs} +3 -1
  27. package/dist/{enum-constants-D1nfn0qD.mjs.map → enum-constants-Piv_E-2M.mjs.map} +1 -1
  28. package/dist/{env-BgdHfWDn.d.mts → env-CSZ9CKg7.d.mts} +3 -2
  29. package/dist/{file-utils-Bctuzn3x.mjs → file-utils-B7xME5IK.mjs} +3 -1
  30. package/dist/{file-utils-Bctuzn3x.mjs.map → file-utils-B7xME5IK.mjs.map} +1 -1
  31. package/dist/{index-BAud4CE7.d.mts → index-BdlrrjvD.d.mts} +145 -35
  32. package/dist/{index-D4Y81vh1.d.mts → index-Dlpe_4Nd.d.mts} +4 -2
  33. package/dist/{index-FZMBoUWm.d.mts → index-IHl7P_9I.d.mts} +4 -2
  34. package/dist/{index-CxgBnxKM.d.mts → index-dg3Sf-No.d.mts} +4 -2
  35. package/dist/{index-CdDzh-T2.d.mts → index-uNv9YJgx.d.mts} +4 -2
  36. package/dist/{interceptor-DgQNmwWJ.mjs → interceptor-1LL1gBsF.mjs} +3 -2
  37. package/dist/{interceptor-DgQNmwWJ.mjs.map → interceptor-1LL1gBsF.mjs.map} +1 -1
  38. package/dist/{job-DdfW7vH3.mjs → job-CPKYCk_e.mjs} +3 -2
  39. package/dist/{job-DdfW7vH3.mjs.map → job-CPKYCk_e.mjs.map} +1 -1
  40. package/dist/kysely/index.d.mts +1 -0
  41. package/dist/kysely/index.mjs +2 -1
  42. package/dist/kysely/index.mjs.map +1 -1
  43. package/dist/{kysely-type-B_IecdK9.mjs → kysely-type-t5MbP7iJ.mjs} +3 -1
  44. package/dist/{kysely-type-B_IecdK9.mjs.map → kysely-type-t5MbP7iJ.mjs.map} +1 -1
  45. package/dist/{logger-CqezTedh.mjs → logger-qz-Y4sBV.mjs} +2 -1
  46. package/dist/{logger-CqezTedh.mjs.map → logger-qz-Y4sBV.mjs.map} +1 -1
  47. package/dist/package-json-88x7bPKC.mjs +5 -0
  48. package/dist/{package-json-D3x2nBPB.mjs → package-json-VqyFvGiP.mjs} +2 -1
  49. package/dist/{package-json-D3x2nBPB.mjs.map → package-json-VqyFvGiP.mjs.map} +1 -1
  50. package/dist/plugin/builtin/enum-constants/index.d.mts +2 -1
  51. package/dist/plugin/builtin/enum-constants/index.mjs +3 -2
  52. package/dist/plugin/builtin/file-utils/index.d.mts +2 -1
  53. package/dist/plugin/builtin/file-utils/index.mjs +3 -2
  54. package/dist/plugin/builtin/kysely-type/index.d.mts +2 -1
  55. package/dist/plugin/builtin/kysely-type/index.mjs +3 -2
  56. package/dist/plugin/builtin/seed/index.d.mts +2 -1
  57. package/dist/plugin/builtin/seed/index.mjs +3 -2
  58. package/dist/plugin/index.d.mts +3 -2
  59. package/dist/plugin/index.mjs +2 -1
  60. package/dist/plugin/index.mjs.map +1 -1
  61. package/dist/{plugin-DyVYXZWz.d.mts → plugin-BC7WQrjm.d.mts} +25 -13
  62. package/dist/{runtime-DbX_UxlC.mjs → runtime-3P9JFpe9.mjs} +1036 -321
  63. package/dist/runtime-3P9JFpe9.mjs.map +1 -0
  64. package/dist/{schema-CNWt2FKQ.mjs → schema-D27cW0Ca.mjs} +4 -2
  65. package/dist/{schema-CNWt2FKQ.mjs.map → schema-D27cW0Ca.mjs.map} +1 -1
  66. package/dist/seed/index.d.mts +1 -0
  67. package/dist/seed/index.mjs +2 -1
  68. package/dist/seed/index.mjs.map +1 -1
  69. package/dist/{seed-CWkIDWMb.mjs → seed-DtYgudLq.mjs} +12 -3
  70. package/dist/seed-DtYgudLq.mjs.map +1 -0
  71. package/dist/{telemetry-BSUlYTs-.mjs → telemetry-B4sp-dD2.mjs} +3 -2
  72. package/dist/{telemetry-BSUlYTs-.mjs.map → telemetry-B4sp-dD2.mjs.map} +1 -1
  73. package/dist/telemetry-DXIGGa6A.mjs +5 -0
  74. package/dist/utils/test/index.d.mts +3 -2
  75. package/dist/utils/test/index.mjs +4 -3
  76. package/dist/utils/test/index.mjs.map +1 -1
  77. package/dist/{workflow.generated-DMQ-cjyT.d.mts → workflow.generated-Cd5dsFnf.d.mts} +3 -2
  78. package/docs/cli/application.md +17 -0
  79. package/docs/generator/builtin.md +0 -8
  80. package/docs/services/executor.md +54 -0
  81. package/package.json +18 -17
  82. package/dist/application-B8vok3w2.mjs.map +0 -1
  83. package/dist/application-DHifc-oA.mjs +0 -11
  84. package/dist/crash-report-BMEhRxeg.mjs +0 -6
  85. package/dist/package-json-DiZWrkIA.mjs +0 -4
  86. package/dist/runtime-DbX_UxlC.mjs.map +0 -1
  87. package/dist/seed-CWkIDWMb.mjs.map +0 -1
  88. package/dist/telemetry-BtN2l0f1.mjs +0 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.33.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#814](https://github.com/tailor-platform/sdk/pull/814) [`d5b2702`](https://github.com/tailor-platform/sdk/commit/d5b2702162a7344f1c53d373219d8482acac142d) Thanks [@toiroakr](https://github.com/toiroakr)! - Add multi-event executor trigger support with `recordTrigger`, `idpUserTrigger`, and `authAccessTokenTrigger` factory functions that accept an `events` array to handle multiple event types in a single executor. Args include `event` (short name) and `rawEvent` (full event type string) for runtime type narrowing.
8
+
9
+ - [#769](https://github.com/tailor-platform/sdk/pull/769) [`85e3053`](https://github.com/tailor-platform/sdk/commit/85e30538c981bd666680ce52cb2f986d94780593) Thanks [@r253hmdryou](https://github.com/r253hmdryou)! - Improve apply planning by adding stable no-op detection and plan summaries.
10
+
11
+ - Mark resources as `unchanged` when requested configuration already matches remote state, and keep update/create/delete behavior unchanged for drift, ownership mismatch, or missing resources.
12
+ - Add a consolidated plan summary line (create/update/delete/replace/unchanged) to `apply` output and include unchanged counts in plan reporting.
13
+
14
+ ### Patch Changes
15
+
16
+ - [#844](https://github.com/tailor-platform/sdk/pull/844) [`4f62742`](https://github.com/tailor-platform/sdk/commit/4f62742bea1d9de3e181af80a2fc14b78ac6ea21) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: add bidirectional foreign key between IDP user and userProfile type in seed schema
17
+
18
+ When auth.userProfile is configured, the seed plugin now generates a foreign key from the userProfile type back to `_User`, ensuring seed data validation catches mismatches in both directions. Also bumps @toiroakr/lines-db to 0.9.1 which supports circular FK validation.
19
+
20
+ - [#857](https://github.com/tailor-platform/sdk/pull/857) [`8ed7e2a`](https://github.com/tailor-platform/sdk/commit/8ed7e2a2b23112c35f844f915f0f6eca6bef2c72) Thanks [@dqn](https://github.com/dqn)! - Add JSDoc documentation to previously undocumented public API exports for improved IDE intellisense.
21
+
22
+ - [#822](https://github.com/tailor-platform/sdk/pull/822) [`52f72bb`](https://github.com/tailor-platform/sdk/commit/52f72bb8a82f6e32889505d934ad0918391cd52e) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency oxlint-tsgolint to v0.17.2
23
+
24
+ - [#833](https://github.com/tailor-platform/sdk/pull/833) [`dfc7216`](https://github.com/tailor-platform/sdk/commit/dfc7216a7e6d639610d9e68ae422b08f15857bb7) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @typescript/native-preview to v7.0.0-dev.20260325.1
25
+
26
+ - [#834](https://github.com/tailor-platform/sdk/pull/834) [`fecd40b`](https://github.com/tailor-platform/sdk/commit/fecd40bed724c39d5e4b12a219a3733693b06cd4) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency knip to v6.0.3
27
+
28
+ - [#840](https://github.com/tailor-platform/sdk/pull/840) [`3dfb55f`](https://github.com/tailor-platform/sdk/commit/3dfb55f96aab68e355f10ccd993cc21141441724) Thanks [@renovate](https://github.com/apps/renovate)! - Update @clack/prompts to v1, adjusting validate callback signatures for the new API
29
+
30
+ - [#845](https://github.com/tailor-platform/sdk/pull/845) [`7976c0a`](https://github.com/tailor-platform/sdk/commit/7976c0a516cc09b3a4f1f183ab98360eefd449b2) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update anthropics/claude-code-action action to v1.0.81
31
+
32
+ - [#846](https://github.com/tailor-platform/sdk/pull/846) [`ab16815`](https://github.com/tailor-platform/sdk/commit/ab16815674196d50b1f14b37935e1c7ade255d14) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency knip to v6.0.6
33
+
34
+ - [#847](https://github.com/tailor-platform/sdk/pull/847) [`9b60ae2`](https://github.com/tailor-platform/sdk/commit/9b60ae2a3b3ccc10839867ba7a49ef59e649287e) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency typescript-eslint to v8.57.2
35
+
36
+ - [#848](https://github.com/tailor-platform/sdk/pull/848) [`0c8aeac`](https://github.com/tailor-platform/sdk/commit/0c8aeac85680352e9e9f0c560e37c2e22b1ee1cc) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update vitest monorepo to v4.1.1
37
+
38
+ - [#849](https://github.com/tailor-platform/sdk/pull/849) [`b1c9814`](https://github.com/tailor-platform/sdk/commit/b1c981432a4753d3868d482123931921a0e9bf74) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency rolldown to v1.0.0-rc.12
39
+
40
+ ## 1.32.1
41
+
42
+ ### Patch Changes
43
+
44
+ - [#826](https://github.com/tailor-platform/sdk/pull/826) [`72c2842`](https://github.com/tailor-platform/sdk/commit/72c2842046b2841571e095e10187339fdf66acd5) Thanks [@toiroakr](https://github.com/toiroakr)! - Bundle `@tailor-platform/function-types` as a dependency of `@tailor-platform/sdk`. Users no longer need to install `@tailor-platform/function-types` separately or add it to their `tsconfig.json` types array. The ambient types are automatically available when importing from `@tailor-platform/sdk`.
45
+
46
+ - [#824](https://github.com/tailor-platform/sdk/pull/824) [`f4794c4`](https://github.com/tailor-platform/sdk/commit/f4794c4fed2cf1bec9e472d1ff29ca7748b78881) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency type-fest to v5.5.0
47
+
48
+ - [#825](https://github.com/tailor-platform/sdk/pull/825) [`9e0dc71`](https://github.com/tailor-platform/sdk/commit/9e0dc71bf094ea123f6484a31fb7929579896294) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update oxlint monorepo
49
+
50
+ - [#827](https://github.com/tailor-platform/sdk/pull/827) [`b13e31c`](https://github.com/tailor-platform/sdk/commit/b13e31c981fe368d1bec664c320a02c20e4eb083) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update actions/create-github-app-token action to v3
51
+
52
+ - [#829](https://github.com/tailor-platform/sdk/pull/829) [`e0f68c0`](https://github.com/tailor-platform/sdk/commit/e0f68c054b248086060dd2e22ef8e6af10ef5e95) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dorny/paths-filter action to v4
53
+
54
+ - [#830](https://github.com/tailor-platform/sdk/pull/830) [`cb0c357`](https://github.com/tailor-platform/sdk/commit/cb0c357432bd121c7bb9ebbfc8f711a18b6a4f25) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update eslint monorepo to v10 (major)
55
+
56
+ - [#831](https://github.com/tailor-platform/sdk/pull/831) [`a567c70`](https://github.com/tailor-platform/sdk/commit/a567c70dc22661536e3a2314c6839899cb72a391) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update anthropics/claude-code-action action to v1.0.79
57
+
58
+ - [#836](https://github.com/tailor-platform/sdk/pull/836) [`77cdf5e`](https://github.com/tailor-platform/sdk/commit/77cdf5ed8de3cef96df7587c689c83a6b627381e) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update github artifact actions (major)
59
+
60
+ - [#837](https://github.com/tailor-platform/sdk/pull/837) [`47b3e56`](https://github.com/tailor-platform/sdk/commit/47b3e56300c6df2c1eccbaafa4e320f13d176194) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update pnpm/action-setup action to v5
61
+
62
+ - [#841](https://github.com/tailor-platform/sdk/pull/841) [`c8a9ed6`](https://github.com/tailor-platform/sdk/commit/c8a9ed67bd102caacf155b8a107e468d007c81ab) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency std-env to v4
63
+
3
64
  ## 1.32.0
4
65
 
5
66
  ### Minor Changes
@@ -1,11 +1,12 @@
1
- import { n as isSdkBranded } from "./brand-GZnI4eYb.mjs";
2
- import { n as logger, r as styles } from "./logger-CqezTedh.mjs";
3
- import { l as initOAuth2Client } from "./client-DfdgRZlQ.mjs";
4
- import { t as readPackageJson } from "./package-json-D3x2nBPB.mjs";
5
- import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-CWkIDWMb.mjs";
6
- import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-D1nfn0qD.mjs";
7
- import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-Bctuzn3x.mjs";
8
- import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-B_IecdK9.mjs";
1
+
2
+ import { n as isSdkBranded } from "./brand-0SscafcY.mjs";
3
+ import { n as logger, r as styles } from "./logger-qz-Y4sBV.mjs";
4
+ import { l as initOAuth2Client } from "./client-D5P1myz0.mjs";
5
+ import { t as readPackageJson } from "./package-json-VqyFvGiP.mjs";
6
+ import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-DtYgudLq.mjs";
7
+ import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-Piv_E-2M.mjs";
8
+ import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-B7xME5IK.mjs";
9
+ import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-t5MbP7iJ.mjs";
9
10
  import { createRequire } from "node:module";
10
11
  import { z } from "zod";
11
12
  import * as fs$1 from "node:fs";
@@ -835,10 +836,9 @@ function generateInjectDeclarations(inject) {
835
836
  */
836
837
  function generateTriggerCode(trigger) {
837
838
  switch (trigger.kind) {
838
- case "recordCreated":
839
- case "recordUpdated":
840
- case "recordDeleted": return `{
839
+ case "tailordb": return `{
841
840
  kind: ${JSON.stringify(trigger.kind)},
841
+ events: ${JSON.stringify(trigger.events)},
842
842
  typeName: ${JSON.stringify(trigger.typeName)},
843
843
  }`;
844
844
  case "schedule": return `{
@@ -3425,12 +3425,13 @@ function createAuthService(config, tailorDBServices, externalTailorDBNamespaces)
3425
3425
 
3426
3426
  //#endregion
3427
3427
  //#region src/parser/service/executor/schema.ts
3428
- const RecordTriggerSchema = z.object({
3429
- kind: z.enum([
3430
- "recordCreated",
3431
- "recordUpdated",
3432
- "recordDeleted"
3433
- ]).describe("Record event type"),
3428
+ const TailorDBTriggerSchema = z.object({
3429
+ kind: z.literal("tailordb").describe("TailorDB record event trigger"),
3430
+ events: z.array(z.enum([
3431
+ "tailordb.type_record.created",
3432
+ "tailordb.type_record.updated",
3433
+ "tailordb.type_record.deleted"
3434
+ ])).min(1).transform((arr) => [...new Set(arr)]).describe("TailorDB event types to trigger on"),
3434
3435
  typeName: z.string().describe("TailorDB type name to watch for events"),
3435
3436
  condition: functionSchema.optional().describe("Condition function to filter events")
3436
3437
  });
@@ -3445,18 +3446,24 @@ const ScheduleTriggerSchema = z.object({
3445
3446
  timezone: z.string().optional().default("UTC").describe("Timezone for the CRON schedule (default: UTC)")
3446
3447
  });
3447
3448
  const IncomingWebhookTriggerSchema = z.object({ kind: z.literal("incomingWebhook") });
3448
- const IdpUserTriggerSchema = z.object({ kind: z.enum([
3449
- "idpUserCreated",
3450
- "idpUserUpdated",
3451
- "idpUserDeleted"
3452
- ]).describe("IdP user event type") });
3453
- const AuthAccessTokenTriggerSchema = z.object({ kind: z.enum([
3454
- "authAccessTokenIssued",
3455
- "authAccessTokenRefreshed",
3456
- "authAccessTokenRevoked"
3457
- ]).describe("Auth access token event type") });
3449
+ const IdpUserTriggerSchema = z.object({
3450
+ kind: z.literal("idpUser").describe("IdP user event trigger"),
3451
+ events: z.array(z.enum([
3452
+ "idp.user.created",
3453
+ "idp.user.updated",
3454
+ "idp.user.deleted"
3455
+ ])).min(1).transform((arr) => [...new Set(arr)]).describe("IdP user event types to trigger on")
3456
+ });
3457
+ const AuthAccessTokenTriggerSchema = z.object({
3458
+ kind: z.literal("authAccessToken").describe("Auth access token event trigger"),
3459
+ events: z.array(z.enum([
3460
+ "auth.access_token.issued",
3461
+ "auth.access_token.refreshed",
3462
+ "auth.access_token.revoked"
3463
+ ])).min(1).transform((arr) => [...new Set(arr)]).describe("Auth access token event types to trigger on")
3464
+ });
3458
3465
  const TriggerSchema = z.discriminatedUnion("kind", [
3459
- RecordTriggerSchema,
3466
+ TailorDBTriggerSchema,
3460
3467
  ResolverExecutedTriggerSchema,
3461
3468
  ScheduleTriggerSchema,
3462
3469
  IncomingWebhookTriggerSchema,
@@ -4048,6 +4055,7 @@ async function bundleWorkflowJobs(allJobs, mainJobNames, env = {}, triggerContex
4048
4055
  logger.warn("No workflow jobs to bundle");
4049
4056
  return {
4050
4057
  mainJobDeps: {},
4058
+ usedJobNames: [],
4051
4059
  bundledCode: /* @__PURE__ */ new Map()
4052
4060
  };
4053
4061
  }
@@ -4072,6 +4080,7 @@ async function bundleWorkflowJobs(allJobs, mainJobNames, env = {}, triggerContex
4072
4080
  logger.log(`${styles.success("Bundled")} ${styles.info("\"workflow-job\"")}`);
4073
4081
  return {
4074
4082
  mainJobDeps,
4083
+ usedJobNames: usedJobs.map((job) => job.name),
4075
4084
  bundledCode
4076
4085
  };
4077
4086
  }
@@ -4933,4 +4942,4 @@ async function loadApplication(params) {
4933
4942
 
4934
4943
  //#endregion
4935
4944
  export { resolveTokens as C, readPlatformConfig as S, writePlatformConfig as T, hashFile as _, loadConfig as a, loadAccessToken as b, ExecutorSchema as c, TailorDBTypeSchema as d, stringifyFunction as f, getDistDir as g, createBundleCache as h, resolveInlineSourcemap as i, OAuth2ClientSchema as l, loadFilesWithIgnores as m, generatePluginFilesIfNeeded as n, WorkflowJobSchema as o, tailorUserMap as p, loadApplication as r, createExecutorService as s, defineApplication as t, ResolverSchema as u, deleteUserTokens as v, saveUserTokens as w, loadWorkspaceId as x, fetchLatestToken as y };
4936
- //# sourceMappingURL=application-B8vok3w2.mjs.map
4945
+ //# sourceMappingURL=application-CfAom-vi.mjs.map