@tailor-platform/sdk 1.66.1 → 2.0.0-next.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.
Files changed (198) hide show
  1. package/CHANGELOG.md +89 -2
  2. package/dist/application-DB2r36Et.mjs +3 -0
  3. package/dist/{application-DGDmL8i_.mjs → application-DqS1yBg3.mjs} +188 -128
  4. package/dist/application-DqS1yBg3.mjs.map +1 -0
  5. package/dist/{assert-CKfwrmCV.mjs → assert-DBxo8jPo.mjs} +1 -2
  6. package/dist/{assert-CKfwrmCV.mjs.map → assert-DBxo8jPo.mjs.map} +1 -1
  7. package/dist/{authconnection-D8SJGMpj.mjs → authconnection-D2MhtTN5.mjs} +2 -3
  8. package/dist/{authconnection-D8SJGMpj.mjs.map → authconnection-D2MhtTN5.mjs.map} +1 -1
  9. package/dist/{authconnection-BIYzEh2p.d.mts → authconnection-DvUQAjQS.d.mts} +1 -1
  10. package/dist/{brand-DlnJ375c.mjs → brand-Eo4pLXPJ.mjs} +1 -2
  11. package/dist/{brand-DlnJ375c.mjs.map → brand-Eo4pLXPJ.mjs.map} +1 -1
  12. package/dist/cli/index.mjs +78 -131
  13. package/dist/cli/index.mjs.map +1 -1
  14. package/dist/cli/lib.d.mts +15 -154
  15. package/dist/cli/lib.mjs +9 -10
  16. package/dist/cli/lib.mjs.map +1 -1
  17. package/dist/{client-boxXYevx.mjs → client-Dbohmtkv.mjs} +1 -2
  18. package/dist/{client-F0a4cWUM.mjs → client-z_oHGVNy.mjs} +8 -6
  19. package/dist/client-z_oHGVNy.mjs.map +1 -0
  20. package/dist/completion/zsh-worker.zsh +5 -19
  21. package/dist/configure/index.d.mts +8 -7
  22. package/dist/configure/index.mjs +11 -28
  23. package/dist/configure/index.mjs.map +1 -1
  24. package/dist/{context-s0lxhu8_.mjs → context-Bd266-ru.mjs} +2 -3
  25. package/dist/{context-s0lxhu8_.mjs.map → context-Bd266-ru.mjs.map} +1 -1
  26. package/dist/{context-CUBwSBq4.d.mts → context-BuuIb8CC.d.mts} +1 -1
  27. package/dist/{crashreport-0EHy-ayY.mjs → crashreport-BsjAkFWw.mjs} +19 -10
  28. package/dist/{crashreport-0EHy-ayY.mjs.map → crashreport-BsjAkFWw.mjs.map} +1 -1
  29. package/dist/{crashreport-Bf6uT6mf.mjs → crashreport-pr6Rhvza.mjs} +1 -2
  30. package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
  31. package/dist/enum-constants-j9QBF0cB.mjs.map +1 -0
  32. package/dist/{errors-EsY4XO6O.mjs → errors-Dtf2WPaW.mjs} +1 -2
  33. package/dist/{errors-EsY4XO6O.mjs.map → errors-Dtf2WPaW.mjs.map} +1 -1
  34. package/dist/{field-C4zdJLW5.mjs → field-DOsJCPFa.mjs} +1 -2
  35. package/dist/field-DOsJCPFa.mjs.map +1 -0
  36. package/dist/{file-BzK8z3X-.d.mts → file-BB8Vs9O_.d.mts} +1 -1
  37. package/dist/{file-B58Dm-2P.mjs → file-_oUZo76X.mjs} +2 -3
  38. package/dist/{file-B58Dm-2P.mjs.map → file-_oUZo76X.mjs.map} +1 -1
  39. package/dist/{file-utils-BHPxPXmn.mjs → file-utils-DcyIPFQh.mjs} +2 -3
  40. package/dist/{file-utils-BHPxPXmn.mjs.map → file-utils-DcyIPFQh.mjs.map} +1 -1
  41. package/dist/{globals-ByrCoDip.mjs → globals-Crz8o65k.mjs} +53 -5
  42. package/dist/globals-Crz8o65k.mjs.map +1 -0
  43. package/dist/http-adapter.generated-WgMnb7Sb.d.mts +580 -0
  44. package/dist/{iconv-kwrmd1U_.d.mts → iconv-Co-TOPuH.d.mts} +1 -1
  45. package/dist/{iconv-DreIffeM.mjs → iconv-D2vi8G36.mjs} +2 -3
  46. package/dist/{iconv-DreIffeM.mjs.map → iconv-D2vi8G36.mjs.map} +1 -1
  47. package/dist/{idp-Ch95ag8h.mjs → idp-BDbK5gjm.mjs} +2 -3
  48. package/dist/{idp-Ch95ag8h.mjs.map → idp-BDbK5gjm.mjs.map} +1 -1
  49. package/dist/{idp-BlBPtXJ-.d.mts → idp-DrhVrLmV.d.mts} +1 -1
  50. package/dist/{index-QpC0TNbH.d.mts → index-5vPyRu1y.d.mts} +2 -2
  51. package/dist/{index-Bhjep8cS.d.mts → index-B7AKc18V.d.mts} +2 -2
  52. package/dist/{index-BdLqzJDu.d.mts → index-BlpzXncY.d.mts} +25 -247
  53. package/dist/{index-DRhMpdnA.d.mts → index-CK7u9isy.d.mts} +8 -8
  54. package/dist/{index-CZ2r3qiO.d.mts → index-CNYe5lnW.d.mts} +2 -2
  55. package/dist/{index-Db2RvnEH.d.mts → index-DjUdWlzf.d.mts} +2 -2
  56. package/dist/index-ZePLwxw7.d.mts +208 -0
  57. package/dist/{interceptor-DOqRkCya.mjs → interceptor-D-q1rvRl.mjs} +1 -2
  58. package/dist/{interceptor-DOqRkCya.mjs.map → interceptor-D-q1rvRl.mjs.map} +1 -1
  59. package/dist/{job-BpsFXPbi.mjs → job-fuc3j1Ma.mjs} +9 -10
  60. package/dist/job-fuc3j1Ma.mjs.map +1 -0
  61. package/dist/kysely/index.mjs +0 -1
  62. package/dist/kysely/index.mjs.map +1 -1
  63. package/dist/{kysely-type-D1e0Vwkd.mjs → kysely-type-DR8uzZTA.mjs} +2 -3
  64. package/dist/kysely-type-DR8uzZTA.mjs.map +1 -0
  65. package/dist/{logger-DpJyJvNz.mjs → logger-CxF-Ex5d.mjs} +1 -2
  66. package/dist/{logger-DpJyJvNz.mjs.map → logger-CxF-Ex5d.mjs.map} +1 -1
  67. package/dist/{mock-DMgIygjE.mjs → mock-BjFj5o1I.mjs} +9 -11
  68. package/dist/mock-BjFj5o1I.mjs.map +1 -0
  69. package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
  70. package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
  71. package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
  72. package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
  73. package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
  74. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  75. package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
  76. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  77. package/dist/plugin/builtin/file-utils/index.mjs +1 -2
  78. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  79. package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
  80. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  81. package/dist/plugin/builtin/seed/index.mjs +1 -2
  82. package/dist/plugin/index.d.mts +1 -3
  83. package/dist/plugin/index.mjs +0 -1
  84. package/dist/plugin/index.mjs.map +1 -1
  85. package/dist/registry-DdsYlL_P.mjs +51 -0
  86. package/dist/registry-DdsYlL_P.mjs.map +1 -0
  87. package/dist/{repl-editor-CJG3sz7A.mjs → repl-editor-DmGr9zMw.mjs} +2 -3
  88. package/dist/{repl-editor-CJG3sz7A.mjs.map → repl-editor-DmGr9zMw.mjs.map} +1 -1
  89. package/dist/{chunk-BkoGK1jX.mjs → rolldown-runtime-DXywRVcq.mjs} +0 -1
  90. package/dist/runtime/authconnection.d.mts +1 -1
  91. package/dist/runtime/authconnection.mjs +1 -2
  92. package/dist/runtime/context.d.mts +1 -1
  93. package/dist/runtime/context.mjs +1 -2
  94. package/dist/runtime/file.d.mts +1 -1
  95. package/dist/runtime/file.mjs +1 -2
  96. package/dist/runtime/globals.d.mts +6 -39
  97. package/dist/runtime/globals.mjs +0 -1
  98. package/dist/runtime/iconv.d.mts +1 -1
  99. package/dist/runtime/iconv.mjs +1 -2
  100. package/dist/runtime/idp.d.mts +1 -1
  101. package/dist/runtime/idp.mjs +1 -2
  102. package/dist/runtime/index.d.mts +8 -8
  103. package/dist/runtime/index.mjs +7 -8
  104. package/dist/runtime/secretmanager.d.mts +1 -1
  105. package/dist/runtime/secretmanager.mjs +1 -2
  106. package/dist/runtime/workflow.d.mts +1 -1
  107. package/dist/runtime/workflow.mjs +1 -2
  108. package/dist/{runtime-2nzOZCUb.mjs → runtime-n9NCkjee.mjs} +65 -232
  109. package/dist/runtime-n9NCkjee.mjs.map +1 -0
  110. package/dist/{schema-1msIhXwA.mjs → schema-BhkpP5Hw.mjs} +3 -4
  111. package/dist/schema-BhkpP5Hw.mjs.map +1 -0
  112. package/dist/{secret-file-CWzF8rry.mjs → secret-file-DBqZhjFQ.mjs} +1 -2
  113. package/dist/{secret-file-CWzF8rry.mjs.map → secret-file-DBqZhjFQ.mjs.map} +1 -1
  114. package/dist/{secretmanager-CKLB3wAQ.d.mts → secretmanager-B3n4KHfm.d.mts} +1 -1
  115. package/dist/{secretmanager-B9h-U_8U.mjs → secretmanager-BVxw3ih_.mjs} +2 -3
  116. package/dist/{secretmanager-B9h-U_8U.mjs.map → secretmanager-BVxw3ih_.mjs.map} +1 -1
  117. package/dist/seed/index.mjs +0 -1
  118. package/dist/seed/index.mjs.map +1 -1
  119. package/dist/{seed-BH2FbrPV.mjs → seed-jf3008-h.mjs} +5 -16
  120. package/dist/seed-jf3008-h.mjs.map +1 -0
  121. package/dist/{service-wI3Hvrgx.mjs → service-CCL8ruDf.mjs} +3 -4
  122. package/dist/service-CCL8ruDf.mjs.map +1 -0
  123. package/dist/service-D6yonf2I.mjs +3 -0
  124. package/dist/{service-DMohAx8a2.mjs → service-DU1mVzri.mjs} +3 -4
  125. package/dist/service-DU1mVzri.mjs.map +1 -0
  126. package/dist/{telemetry-BQbbVo2t.mjs → telemetry-CdqJEzkj.mjs} +2 -3
  127. package/dist/{telemetry-BQbbVo2t.mjs.map → telemetry-CdqJEzkj.mjs.map} +1 -1
  128. package/dist/telemetry-ClwW5ohF.mjs +3 -0
  129. package/dist/test-env-key-D9kM6ETE.mjs +49 -0
  130. package/dist/test-env-key-D9kM6ETE.mjs.map +1 -0
  131. package/dist/type-source-DH_LH20p.mjs +13 -0
  132. package/dist/type-source-DH_LH20p.mjs.map +1 -0
  133. package/dist/{types-CmzfQP_m.mjs → types-B2RpYyA_.mjs} +2 -3
  134. package/dist/types-B2RpYyA_.mjs.map +1 -0
  135. package/dist/types-ClhIrW_C.mjs +4 -0
  136. package/dist/{tailordb-C-ar4XCX.d.mts → types-DCUhgpyI.d.mts} +142 -221
  137. package/dist/{plugin-DylAsA4Z.d.mts → types-DhO_VEZd.d.mts} +119 -179
  138. package/dist/types-DwDgacni.d.mts +338 -0
  139. package/dist/utils/test/index.d.mts +4 -3
  140. package/dist/utils/test/index.mjs +1 -2
  141. package/dist/utils/test/index.mjs.map +1 -1
  142. package/dist/vitest/environment.mjs +1 -2
  143. package/dist/vitest/environment.mjs.map +1 -1
  144. package/dist/vitest/index.d.mts +42 -5
  145. package/dist/vitest/index.mjs +133 -4
  146. package/dist/vitest/index.mjs.map +1 -1
  147. package/dist/vitest/setup.mjs +2 -3
  148. package/dist/vitest/setup.mjs.map +1 -1
  149. package/dist/{workflow-CMamswkK.d.mts → workflow-BbKvGLQg.d.mts} +1 -1
  150. package/dist/{workflow--aPbA8Uq.mjs → workflow-DgemCAz3.mjs} +2 -3
  151. package/dist/{workflow--aPbA8Uq.mjs.map → workflow-DgemCAz3.mjs.map} +1 -1
  152. package/dist/workflow.generated-DtQwEo-x.d.mts +671 -0
  153. package/docs/cli/application.md +0 -2
  154. package/docs/cli/crashreport.md +0 -2
  155. package/docs/cli/function.md +1 -1
  156. package/docs/cli/user.md +3 -3
  157. package/docs/cli/workspace.md +3 -3
  158. package/docs/configuration.md +0 -2
  159. package/docs/plugin/custom.md +2 -2
  160. package/docs/plugin/index.md +1 -1
  161. package/docs/runtime.md +3 -3
  162. package/docs/services/auth.md +0 -2
  163. package/docs/services/executor.md +0 -2
  164. package/docs/services/resolver.md +2 -4
  165. package/docs/services/tailordb.md +1 -1
  166. package/docs/services/workflow.md +13 -15
  167. package/docs/testing.md +18 -11
  168. package/package.json +9 -8
  169. package/dist/actor-D_2aJjYO.d.mts +0 -24
  170. package/dist/application-DGDmL8i_.mjs.map +0 -1
  171. package/dist/application-nTydHJm8.mjs +0 -4
  172. package/dist/cli/skills.d.mts +0 -1
  173. package/dist/cli/skills.mjs +0 -22
  174. package/dist/cli/skills.mjs.map +0 -1
  175. package/dist/client-F0a4cWUM.mjs.map +0 -1
  176. package/dist/enum-constants-C7DaWeQo.mjs.map +0 -1
  177. package/dist/env-B-g-qgE4.d.mts +0 -7
  178. package/dist/field-C4zdJLW5.mjs.map +0 -1
  179. package/dist/globals-ByrCoDip.mjs.map +0 -1
  180. package/dist/job-BpsFXPbi.mjs.map +0 -1
  181. package/dist/kysely-type-D1e0Vwkd.mjs.map +0 -1
  182. package/dist/mock-DMgIygjE.mjs.map +0 -1
  183. package/dist/package-json-wzO6nV9O.mjs +0 -4
  184. package/dist/registry-D0uB0OrK.mjs +0 -178
  185. package/dist/registry-D0uB0OrK.mjs.map +0 -1
  186. package/dist/runtime-2nzOZCUb.mjs.map +0 -1
  187. package/dist/schema-1msIhXwA.mjs.map +0 -1
  188. package/dist/seed-BH2FbrPV.mjs.map +0 -1
  189. package/dist/service-BHQIerYh.mjs +0 -4
  190. package/dist/service-DMohAx8a2.mjs.map +0 -1
  191. package/dist/service-wI3Hvrgx.mjs.map +0 -1
  192. package/dist/telemetry-w92bvGdC.mjs +0 -4
  193. package/dist/types-2Be3wSMc.mjs +0 -5
  194. package/dist/types-CmzfQP_m.mjs.map +0 -1
  195. package/dist/workflow.generated--1Qc15Et.d.mts +0 -1471
  196. package/docs/generator/builtin.md +0 -257
  197. package/docs/generator/custom.md +0 -147
  198. package/docs/generator/index.md +0 -66
@@ -1,10 +1,10 @@
1
- import { _ as PluginAttachment, a as TypeSourceInfoEntry, i as TailorDBType } from "../tailordb-C-ar4XCX.mjs";
2
- import { i as AppConfig } from "../workflow.generated--1Qc15Et.mjs";
3
- import { B as IdProvider, E as Executor, N as ScheduleTriggerInput, V as OAuth2Client$1, j as IncomingWebhookTrigger, n as Plugin, x as Resolver } from "../plugin-DylAsA4Z.mjs";
4
- import { n as kyselyTypePlugin } from "../index-QpC0TNbH.mjs";
5
- import { n as enumConstantsPlugin } from "../index-Db2RvnEH.mjs";
6
- import { n as fileUtilsPlugin } from "../index-CZ2r3qiO.mjs";
7
- import { n as seedPlugin } from "../index-Bhjep8cS.mjs";
1
+ import { s as PluginAttachment } from "../types-DCUhgpyI.mjs";
2
+ import { F as TailorDBType, I as TypeSourceInfoEntry, i as Plugin, j as ScheduleTriggerInput, k as IncomingWebhookTrigger, n as GeneratorResult, w as Executor, x as Resolver } from "../types-DhO_VEZd.mjs";
3
+ import { r as AppConfig } from "../workflow.generated-DtQwEo-x.mjs";
4
+ import { n as kyselyTypePlugin } from "../index-5vPyRu1y.mjs";
5
+ import { n as enumConstantsPlugin } from "../index-DjUdWlzf.mjs";
6
+ import { n as fileUtilsPlugin } from "../index-CNYe5lnW.mjs";
7
+ import { n as seedPlugin } from "../index-B7AKc18V.mjs";
8
8
  import { z } from "zod";
9
9
  import { JsonObject, Message } from "@bufbuild/protobuf";
10
10
  import { GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
@@ -12,6 +12,7 @@ import { Duration, FieldMask, Timestamp, Value } from "@bufbuild/protobuf/wkt";
12
12
  import { OAuth2Client } from "@badgateway/oauth2-client";
13
13
  import { Client } from "@connectrpc/connect";
14
14
  import { Jsonifiable } from "type-fest";
15
+ import { MachineUserName, MachineUserName as MachineUserName$1 } from "@tailor-platform/sdk";
15
16
 
16
17
  //#region src/cli/commands/deploy/function-registry-types.d.ts
17
18
  /**
@@ -19188,31 +19189,14 @@ interface LoadConfigOptions {
19188
19189
  /** Import cache-busting value for watch-mode reloads. */
19189
19190
  importNonce?: string;
19190
19191
  }
19191
- declare const GeneratorConfigSchema: z.core.$ZodBranded<z.ZodObject<{
19192
- id: z.ZodString;
19193
- description: z.ZodString;
19194
- dependencies: z.ZodArray<z.ZodEnum<{
19195
- executor: "executor";
19196
- tailordb: "tailordb";
19197
- resolver: "resolver";
19198
- }>>;
19199
- processType: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
19200
- processResolver: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
19201
- processExecutor: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
19202
- processTailorDBNamespace: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
19203
- processResolverNamespace: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
19204
- aggregate: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodAny>;
19205
- }, z.core.$strip>, "CodeGenerator", "out">;
19206
- type Generator = z.output<typeof GeneratorConfigSchema>;
19207
- /**
19208
- * Load Tailor configuration file and associated generators and plugins.
19192
+ /**
19193
+ * Load Tailor configuration file and associated plugins.
19209
19194
  * @param configPath - Optional explicit config path
19210
19195
  * @param options - Optional module import behavior.
19211
- * @returns Loaded config, generators, plugins, and config path
19196
+ * @returns Loaded config, plugins, and config path
19212
19197
  */
19213
19198
  declare function loadConfig(configPath?: string, options?: LoadConfigOptions): Promise<{
19214
19199
  config: LoadedConfig;
19215
- generators: Generator[];
19216
19200
  plugins: Plugin[];
19217
19201
  }>;
19218
19202
  //#endregion
@@ -19751,126 +19735,6 @@ declare function deploy(options?: DeployOptions): Promise<{
19751
19735
  bundledScripts: BundledScripts;
19752
19736
  } | undefined>;
19753
19737
  //#endregion
19754
- //#region src/cli/commands/generate/types.d.ts
19755
- interface GeneratedFile {
19756
- path: string;
19757
- content: string;
19758
- skipIfExists?: boolean;
19759
- executable?: boolean;
19760
- }
19761
- interface GeneratorResult {
19762
- files: GeneratedFile[];
19763
- errors?: string[];
19764
- }
19765
- interface TailorDBNamespaceResult<T> {
19766
- namespace: string;
19767
- types: T;
19768
- }
19769
- interface ResolverNamespaceResult<R> {
19770
- namespace: string;
19771
- resolvers: R;
19772
- }
19773
- interface GeneratorAuthInput {
19774
- name: string;
19775
- userProfile?: {
19776
- typeName: string;
19777
- namespace: string;
19778
- usernameField: string;
19779
- };
19780
- machineUsers?: Record<string, {
19781
- attributes?: Record<string, unknown>;
19782
- }>;
19783
- oauth2Clients?: Record<string, OAuth2Client$1>;
19784
- idProvider?: IdProvider;
19785
- }
19786
- type DependencyKind = "tailordb" | "resolver" | "executor";
19787
- type ArrayIncludes<T extends readonly unknown[], U> = T extends readonly [infer First, ...infer Rest] ? First extends U ? true : ArrayIncludes<Rest, U> : false;
19788
- type HasDependency<Deps extends readonly DependencyKind[], D extends DependencyKind> = ArrayIncludes<Deps, D>;
19789
- interface TailorDBProcessMethods<T, Ts> {
19790
- processType(args: {
19791
- type: TailorDBType;
19792
- namespace: string;
19793
- source: TypeSourceInfoEntry; /** Plugin attachments configured on this type via .plugin() method */
19794
- plugins: readonly PluginAttachment[];
19795
- }): T | Promise<T>;
19796
- processTailorDBNamespace?(args: {
19797
- namespace: string;
19798
- types: Record<string, T>;
19799
- }): Ts | Promise<Ts>;
19800
- }
19801
- interface ResolverProcessMethods<R, Rs> {
19802
- processResolver(args: {
19803
- resolver: Resolver;
19804
- namespace: string;
19805
- }): R | Promise<R>;
19806
- processResolverNamespace?(args: {
19807
- namespace: string;
19808
- resolvers: Record<string, R>;
19809
- }): Rs | Promise<Rs>;
19810
- }
19811
- interface ExecutorProcessMethods<E> {
19812
- processExecutor(executor: Executor): E | Promise<E>;
19813
- }
19814
- type SelectMethods<Deps extends readonly DependencyKind[], T, R, E, Ts, Rs> = (HasDependency<Deps, "tailordb"> extends true ? TailorDBProcessMethods<T, Ts> : object) & (HasDependency<Deps, "resolver"> extends true ? ResolverProcessMethods<R, Rs> : object) & (HasDependency<Deps, "executor"> extends true ? ExecutorProcessMethods<E> : object);
19815
- interface TailorDBInputPart<Ts> {
19816
- tailordb: TailorDBNamespaceResult<Ts>[];
19817
- }
19818
- interface ResolverInputPart<Rs> {
19819
- resolver: ResolverNamespaceResult<Rs>[];
19820
- }
19821
- interface ExecutorInputPart<E> {
19822
- executor: E[];
19823
- }
19824
- interface AuthPart {
19825
- auth?: GeneratorAuthInput;
19826
- }
19827
- type SelectInput<Deps extends readonly DependencyKind[], Ts, Rs, E> = (HasDependency<Deps, "tailordb"> extends true ? TailorDBInputPart<Ts> : object) & (HasDependency<Deps, "resolver"> extends true ? ResolverInputPart<Rs> : object) & (HasDependency<Deps, "executor"> extends true ? ExecutorInputPart<E> : object) & AuthPart;
19828
- /** Input type for TailorDB-only generators */
19829
- type TailorDBInput<Ts> = TailorDBInputPart<Ts> & AuthPart;
19830
- /** Input type for Resolver-only generators */
19831
- type ResolverInput<Rs> = ResolverInputPart<Rs> & AuthPart;
19832
- /** Input type for Executor-only generators */
19833
- type ExecutorInput<E> = ExecutorInputPart<E> & AuthPart;
19834
- /** Input type for full generators (TailorDB + Resolver + Executor) */
19835
- type FullInput<Ts, Rs, E> = TailorDBInputPart<Ts> & ResolverInputPart<Rs> & ExecutorInputPart<E> & AuthPart;
19836
- /** Arguments type for aggregate method */
19837
- interface AggregateArgs<Input> {
19838
- input: Input;
19839
- baseDir: string;
19840
- configPath: string;
19841
- }
19842
- interface CodeGeneratorCore {
19843
- readonly id: string;
19844
- readonly description: string;
19845
- }
19846
- /**
19847
- * Generator interface with dependencies-based conditional methods.
19848
- * @template Deps - Dependencies array (e.g., ['tailordb'], ['tailordb', 'resolver'])
19849
- * @template T - Return type of processType
19850
- * @template R - Return type of processResolver
19851
- * @template E - Return type of processExecutor
19852
- * @template Ts - Return type of processTailorDBNamespace (default: Record<string, T>)
19853
- * @template Rs - Return type of processResolverNamespace (default: Record<string, R>)
19854
- */
19855
- type CodeGenerator<Deps extends readonly DependencyKind[], T = unknown, R = unknown, E = unknown, Ts = Record<string, T>, Rs = Record<string, R>> = CodeGeneratorCore & SelectMethods<Deps, T, R, E, Ts, Rs> & {
19856
- readonly dependencies: Deps;
19857
- aggregate(args: {
19858
- input: SelectInput<Deps, Ts, Rs, E>;
19859
- baseDir: string;
19860
- configPath: string;
19861
- }): GeneratorResult | Promise<GeneratorResult>;
19862
- };
19863
- /** TailorDB-only generator */
19864
- type TailorDBGenerator<T = unknown, Ts = Record<string, T>> = CodeGenerator<readonly ["tailordb"], T, never, never, Ts, never>;
19865
- /** Resolver-only generator */
19866
- type ResolverGenerator<R = unknown, Rs = Record<string, R>> = CodeGenerator<readonly ["resolver"], never, R, never, never, Rs>;
19867
- /** Executor-only generator */
19868
- type ExecutorGenerator<E = unknown> = CodeGenerator<readonly ["executor"], never, never, E, never, never>;
19869
- /** TailorDB + Resolver generator */
19870
- type TailorDBResolverGenerator<T = unknown, R = unknown, Ts = Record<string, T>, Rs = Record<string, R>> = CodeGenerator<readonly ["tailordb", "resolver"], T, R, never, Ts, Rs>;
19871
- /** Full generator (all dependencies) */
19872
- type FullCodeGenerator<T = unknown, R = unknown, E = unknown, Ts = Record<string, T>, Rs = Record<string, R>> = CodeGenerator<readonly ["tailordb", "resolver", "executor"], T, R, E, Ts, Rs>;
19873
- //#endregion
19874
19738
  //#region src/cli/commands/generate/options.d.ts
19875
19739
  type GenerateOptions = {
19876
19740
  configPath?: string;
@@ -19879,7 +19743,7 @@ type GenerateOptions = {
19879
19743
  //#endregion
19880
19744
  //#region src/cli/commands/generate/service.d.ts
19881
19745
  /**
19882
- * Run code generation using the Tailor configuration and generators.
19746
+ * Run code generation using the Tailor configuration.
19883
19747
  * @param options - Generation options
19884
19748
  * @returns Promise that resolves when generation (and watch, if enabled) completes
19885
19749
  */
@@ -20377,10 +20241,6 @@ type WorkflowLike$1 = {
20377
20241
  body: unknown;
20378
20242
  };
20379
20243
  };
20380
- type AuthInvoker$1<M extends string = string> = {
20381
- namespace: string;
20382
- machineUserName: M;
20383
- };
20384
20244
  type WorkflowInput<W extends WorkflowLike$1> = W extends WorkflowLike$1 ? W["mainJob"]["body"] extends ((...args: infer Args) => unknown) ? Args[0] : never : never;
20385
20245
  type StartWorkflowArgOptionForSingleWorkflow<W extends WorkflowLike$1> = WorkflowLike$1 extends W ? {
20386
20246
  arg?: Jsonifiable;
@@ -20404,9 +20264,10 @@ interface StartWorkflowOptions {
20404
20264
  }
20405
20265
  type StartWorkflowTypedBaseOptions<W extends WorkflowLike$1> = {
20406
20266
  workflow: W;
20407
- authInvoker: AuthInvoker$1<string>;
20267
+ authInvoker: MachineUserName$1;
20408
20268
  workspaceId?: string;
20409
20269
  profile?: string;
20270
+ configPath?: string;
20410
20271
  interval?: number;
20411
20272
  };
20412
20273
  type StartWorkflowTypedOptions<W extends WorkflowLike$1 = WorkflowLike$1> = W extends WorkflowLike$1 ? StartWorkflowTypedBaseOptions<W> & StartWorkflowArgOption<W> : never;
@@ -21183,5 +21044,5 @@ declare function waitForExecution(client: OperatorClient, workspaceId: string, e
21183
21044
  */
21184
21045
  declare function executeScript(options: ScriptExecutionOptions): Promise<ScriptExecutionResult>;
21185
21046
  //#endregion
21186
- export { type AggregateArgs, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, type DeployOptions, type AuthInvoker, type BreakingChangeInfo, type BundledScripts, type ChunkSeedDataOptions, type CodeGenerator, type CreateFolderOptions, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteFolderOptions, type DeleteWorkspaceOptions, type DependencyKind, type ExecutionWaitResult, type Executor, type ExecutorGenerator, type ExecutorInfo, type ExecutorInput, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type ExecutorListInfo, type FolderInfo, type FolderListInfo, type FullCodeGenerator, type FullInput, type FunctionRegistryInfo, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobOptions, type GetExecutorJobTypedOptions, type GetExecutorOptions, type GetExecutorTypedOptions, type GetFolderOptions, type GetFunctionRegistryOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetOrganizationOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type GetWorkflowTypedOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsOptions, type ListExecutorJobsTypedOptions, type ListExecutorsOptions, type ListFoldersOptions, type ListFunctionRegistriesOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListOrganizationsOptions, type ListUsersOptions, type ListWebhookExecutorsOptions, type ListWorkflowExecutionsOptions, type ListWorkflowExecutionsTypedOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadedConfig, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationBundleResult, type MigrationDiff, type MigrationInfo, type NamespaceWithMigrations, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type OrganizationInfo, type OrganizationTreeOptions, type PluginAttachment, type RemoveOptions, type RemoveUserOptions, type Resolver, type ResolverGenerator, type ResolverInput, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type SeedBundleResult, type SeedChunk, type ShowOptions, type SnapshotFieldConfig, type StartWorkflowOptions, type StartWorkflowResultWithWait, type StartWorkflowTypedOptions, type TailorDBGenerator, type TailorDBInput, type TailorDBResolverGenerator, type TailorDBSnapshotType, type TailorDBType, type TriggerExecutorOptions, type TriggerExecutorResult, type TriggerExecutorTypedOptions, type TruncateOptions, type TypeSourceInfoEntry, type UpdateFolderOptions, type UpdateOrganizationOptions, type UpdateUserOptions, type UserInfo, type UserOrganizationInfo, type WaitOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, deploy, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, kyselyTypePlugin, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, seedPlugin, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, watchExecutorJob };
21047
+ export { type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, type DeployOptions, type AuthInvoker, type BreakingChangeInfo, type BundledScripts, type ChunkSeedDataOptions, type CreateFolderOptions, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteFolderOptions, type DeleteWorkspaceOptions, type ExecutionWaitResult, type Executor, type ExecutorInfo, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type ExecutorListInfo, type FolderInfo, type FolderListInfo, type FunctionRegistryInfo, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobOptions, type GetExecutorJobTypedOptions, type GetExecutorOptions, type GetExecutorTypedOptions, type GetFolderOptions, type GetFunctionRegistryOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetOrganizationOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type GetWorkflowTypedOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsOptions, type ListExecutorJobsTypedOptions, type ListExecutorsOptions, type ListFoldersOptions, type ListFunctionRegistriesOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListOrganizationsOptions, type ListUsersOptions, type ListWebhookExecutorsOptions, type ListWorkflowExecutionsOptions, type ListWorkflowExecutionsTypedOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadedConfig, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserName, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationBundleResult, type MigrationDiff, type MigrationInfo, type NamespaceWithMigrations, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type OrganizationInfo, type OrganizationTreeOptions, type PluginAttachment, type RemoveOptions, type RemoveUserOptions, type Resolver, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type SeedBundleResult, type SeedChunk, type ShowOptions, type SnapshotFieldConfig, type StartWorkflowOptions, type StartWorkflowResultWithWait, type StartWorkflowTypedOptions, type TailorDBSnapshotType, type TailorDBType, type TriggerExecutorOptions, type TriggerExecutorResult, type TriggerExecutorTypedOptions, type TruncateOptions, type TypeSourceInfoEntry, type UpdateFolderOptions, type UpdateOrganizationOptions, type UpdateUserOptions, type UserInfo, type UserOrganizationInfo, type WaitOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, deploy, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, kyselyTypePlugin, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, seedPlugin, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, watchExecutorJob };
21187
21048
  //# sourceMappingURL=lib.d.mts.map
package/dist/cli/lib.mjs CHANGED
@@ -1,13 +1,12 @@
1
-
2
- import { f as initOperatorClient } from "../client-F0a4cWUM.mjs";
3
- import { t as assertDefined } from "../assert-CKfwrmCV.mjs";
4
- import { $t as INITIAL_SCHEMA_NUMBER, A as truncate, Bt as getExecutor, Ct as triggerExecutor, D as resumeWorkflow, Dn as apiCall, Et as getExecutorJob, Ft as getWorkflowExecution, G as organizationTree, Gt as MIGRATION_LABEL_KEY, Ht as executeScript, It as listWorkflowExecutions, J as listOrganizations, M as generate$1, Nt as getWorkflow, Ot as listExecutorJobs, Q as updateFolder, Qt as DIFF_FILE_NAME, R as show, S as listApps, Tt as listExecutors, Ut as waitForExecution, V as remove, Vt as deploy, W as updateOrganization, Wt as bundleMigrationScript, X as getOrganization, Zt as DB_TYPES_FILE_NAME, _ as getWorkspace, _n as formatMigrationDiff, _t as listFunctionRegistries, a as updateUser, an as createSnapshotFromLocalTypes, bt as listWebhookExecutors, cn as getMigrationFilePath, ct as listOAuth2Clients, d as inviteUser, dt as getMachineUserToken, en as MIGRATE_FILE_NAME, et as listFolders, gn as formatDiffSummary, h as listWorkspaces, ht as generate, in as compareSnapshots, it as deleteFolder, jt as startWorkflow, k as listWorkflows, kt as watchExecutorJob, l as listUsers, ln as getMigrationFiles, mt as listMachineUsers, n as query, nt as getFolder, on as getLatestMigrationNumber, ot as createFolder, p as restoreWorkspace, pn as reconstructSnapshotFromMigrations, rn as compareLocalTypesWithSnapshot, s as removeUser, sn as getMigrationDirPath, t as isNativeTypeScriptRuntime, tn as SCHEMA_FILE_NAME, un as getNextMigrationNumber, ut as getOAuth2Client, vn as hasChanges, w as getAppHealth, wn as generateUserTypes, x as createWorkspace, y as deleteWorkspace, yn as getNamespacesWithMigrations, yt as getFunctionRegistry } from "../runtime-2nzOZCUb.mjs";
5
- import { C as loadConfig, E as loadAccessToken, b as getDistDir, h as platformBundleDefinePlugin, k as loadWorkspaceId } from "../application-DGDmL8i_.mjs";
6
- import { n as enumConstantsPlugin } from "../enum-constants-C7DaWeQo.mjs";
7
- import { t as multiline } from "../multiline-Cf9ODpr1.mjs";
8
- import { n as fileUtilsPlugin } from "../file-utils-BHPxPXmn.mjs";
9
- import { n as kyselyTypePlugin } from "../kysely-type-D1e0Vwkd.mjs";
10
- import { n as seedPlugin } from "../seed-BH2FbrPV.mjs";
1
+ import { f as initOperatorClient } from "../client-z_oHGVNy.mjs";
2
+ import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
3
+ import { $t as INITIAL_SCHEMA_NUMBER, A as truncate, Bt as getExecutor, Ct as triggerExecutor, D as resumeWorkflow, Dn as apiCall, Et as getExecutorJob, Ft as getWorkflowExecution, G as organizationTree, Gt as MIGRATION_LABEL_KEY, Ht as executeScript, It as listWorkflowExecutions, J as listOrganizations, M as generate$1, Nt as getWorkflow, Ot as listExecutorJobs, Q as updateFolder, Qt as DIFF_FILE_NAME, R as show, S as listApps, Tt as listExecutors, Ut as waitForExecution, V as remove, Vt as deploy, W as updateOrganization, Wt as bundleMigrationScript, X as getOrganization, Zt as DB_TYPES_FILE_NAME, _ as getWorkspace, _n as formatMigrationDiff, _t as listFunctionRegistries, a as updateUser, an as createSnapshotFromLocalTypes, bt as listWebhookExecutors, cn as getMigrationFilePath, ct as listOAuth2Clients, d as inviteUser, dt as getMachineUserToken, en as MIGRATE_FILE_NAME, et as listFolders, gn as formatDiffSummary, h as listWorkspaces, ht as generate, in as compareSnapshots, it as deleteFolder, jt as startWorkflow, k as listWorkflows, kt as watchExecutorJob, l as listUsers, ln as getMigrationFiles, mt as listMachineUsers, n as query, nt as getFolder, on as getLatestMigrationNumber, ot as createFolder, p as restoreWorkspace, pn as reconstructSnapshotFromMigrations, rn as compareLocalTypesWithSnapshot, s as removeUser, sn as getMigrationDirPath, t as isNativeTypeScriptRuntime, tn as SCHEMA_FILE_NAME, un as getNextMigrationNumber, ut as getOAuth2Client, vn as hasChanges, w as getAppHealth, wn as generateUserTypes, x as createWorkspace, y as deleteWorkspace, yn as getNamespacesWithMigrations, yt as getFunctionRegistry } from "../runtime-n9NCkjee.mjs";
4
+ import { A as loadAccessToken, C as getDistDir, E as loadConfig, N as loadWorkspaceId, g as platformBundleDefinePlugin } from "../application-DqS1yBg3.mjs";
5
+ import { t as multiline } from "../multiline-sfHpTZZK.mjs";
6
+ import { n as kyselyTypePlugin } from "../kysely-type-DR8uzZTA.mjs";
7
+ import { n as enumConstantsPlugin } from "../enum-constants-j9QBF0cB.mjs";
8
+ import { n as fileUtilsPlugin } from "../file-utils-DcyIPFQh.mjs";
9
+ import { n as seedPlugin } from "../seed-jf3008-h.mjs";
11
10
  import * as fs from "node:fs";
12
11
  import * as path from "pathe";
13
12
  import { resolveTSConfig } from "pkg-types";
@@ -1 +1 @@
1
- {"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/shared/seed-chunker.ts","../../src/cli/commands/generate/seed/bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["/**\n * Seed data chunker for splitting large seed data into manageable message sizes.\n *\n * When seed data exceeds the gRPC message size limit, this module splits the data\n * into multiple chunks at type boundaries (or record boundaries for large types).\n */\n\nimport { assertDefined } from \"@/utils/assert\";\n\n/**\n * Seed data keyed by type name, with an array of records per type.\n */\nexport type SeedData = Record<string, Record<string, unknown>[]>;\n\n/**\n * A single chunk of seed data with metadata for ordered execution.\n */\nexport type SeedChunk = {\n data: SeedData;\n order: string[];\n index: number;\n total: number;\n};\n\n/**\n * Options for chunking seed data.\n */\nexport type ChunkSeedDataOptions = {\n /** Seed data keyed by type name */\n data: SeedData;\n /** Ordered list of type names (dependency order) */\n order: string[];\n /** Byte size of the bundled seed script code */\n codeByteSize: number;\n /** Maximum gRPC message size in bytes (default: 3.5MB) */\n maxMessageSize?: number;\n};\n\n/** Default maximum message size: 3.5MB (conservative limit for gRPC) */\nexport const DEFAULT_MAX_MESSAGE_SIZE = 3.5 * 1024 * 1024;\n\n/** Reserved bytes for message metadata overhead */\nconst METADATA_OVERHEAD = 1024;\n\n/**\n * Split seed data into chunks that fit within the gRPC message size limit.\n *\n * Algorithm:\n * 1. Calculate the available budget for the arg field (maxMessageSize - codeByteSize - overhead)\n * 2. If all data fits in one message, return a single chunk\n * 3. Otherwise, iterate through types in dependency order:\n * - If a type fits in the current chunk, add it\n * - If adding a type would exceed the budget, finalize the current chunk and start a new one\n * - If a single type exceeds the budget, split its records across multiple chunks\n * - If a single record exceeds the budget, throw an error\n * @param options - Chunking options\n * @returns Array of seed chunks\n */\nexport function chunkSeedData(options: ChunkSeedDataOptions): SeedChunk[] {\n const { data, order, codeByteSize, maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE } = options;\n\n const argBudget = maxMessageSize - codeByteSize - METADATA_OVERHEAD;\n if (argBudget <= 0) {\n throw new Error(\n `Code size (${codeByteSize} bytes) exceeds the message size limit (${maxMessageSize} bytes). ` +\n `No space left for seed data.`,\n );\n }\n\n // Filter to types that have data\n const typesWithData = order.filter((type) => (data[type]?.length ?? 0) > 0);\n\n if (typesWithData.length === 0) {\n return [];\n }\n\n // Check if all data fits in a single message\n const fullArg = JSON.stringify({ data, order });\n if (byteSize(fullArg) <= argBudget) {\n return [{ data, order, index: 0, total: 1 }];\n }\n\n // Split into multiple chunks\n const chunks: Omit<SeedChunk, \"total\">[] = [];\n let currentData: SeedData = {};\n let currentOrder: string[] = [];\n\n for (const type of typesWithData) {\n const typeRecords = assertDefined(data[type], `seed data missing for type: ${type}`);\n\n // Check if the type fits in the current chunk\n if (currentOrder.length > 0) {\n const testData = { ...currentData, [type]: typeRecords };\n const testOrder = [...currentOrder, type];\n if (byteSize(JSON.stringify({ data: testData, order: testOrder })) > argBudget) {\n // Finalize the current chunk\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n }\n\n // Check if the entire type fits in an empty chunk\n if (byteSize(JSON.stringify({ data: { [type]: typeRecords }, order: [type] })) <= argBudget) {\n currentData[type] = typeRecords;\n currentOrder.push(type);\n continue;\n }\n\n // Type is too large — split by records\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n\n let recordBatch: Record<string, unknown>[] = [];\n for (const record of typeRecords) {\n if (byteSize(JSON.stringify({ data: { [type]: [record] }, order: [type] })) > argBudget) {\n const singleRecordSize = byteSize(JSON.stringify(record));\n throw new Error(\n `A single record in type \"${type}\" (${singleRecordSize} bytes) exceeds the message size budget ` +\n `(${argBudget} bytes). Consider increasing maxMessageSize or reducing the record size.`,\n );\n }\n\n const testBatch = [...recordBatch, record];\n const testData = { ...currentData, [type]: testBatch };\n const testOrder = currentOrder.includes(type) ? currentOrder : [...currentOrder, type];\n const testSize = byteSize(JSON.stringify({ data: testData, order: testOrder }));\n\n if (testSize > argBudget && recordBatch.length > 0) {\n // Finalize current chunk with accumulated records\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n recordBatch = [record];\n } else {\n recordBatch = testBatch;\n }\n }\n\n // Add remaining records\n if (recordBatch.length > 0) {\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n }\n }\n\n // Finalize the last chunk\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n }\n\n const total = chunks.length;\n return chunks.map((chunk) => ({ ...chunk, total }));\n}\n\nfunction byteSize(str: string): number {\n return new TextEncoder().encode(str).length;\n}\n","/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"@/cli/shared/dist-dir\";\nimport { platformBundleDefinePlugin } from \"@/cli/shared/platform-bundle-plugin\";\nimport ml from \"@/utils/multiline\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely, TailordbDialect } from \"@tailor-platform/sdk/kysely\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n selfRefTypes: string[];\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, number>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<string, number> = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = 0;\n const hasSelfRef = (input.selfRefTypes || []).includes(typeName);\n\n try {\n if (hasSelfRef) {\n // Insert one-by-one to respect self-referencing foreign key order\n for (const record of records) {\n await db.insertInto(typeName).values(record).execute();\n processed[typeName] += 1;\n }\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length} (one-by-one)\\`);\n } else {\n for (let i = 0; i < records.length; i += BATCH_SIZE) {\n const batch = records.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName] += batch.length;\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length}\\`);\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n): Promise<SeedBundleResult> {\n // Output directory in .tailor-sdk (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig();\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking (write: false to avoid unnecessary disk I/O)\n const result = await rolldown.build({\n plugins: [platformBundleDefinePlugin],\n input: entryPath,\n write: false,\n output: {\n format: \"esm\",\n sourcemap: false,\n minify: false,\n codeSplitting: false,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n logLevel: \"silent\",\n } as rolldown.BuildOptions);\n\n const bundledCode = result.output[0].code;\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { isNativeTypeScriptRuntime } from \"./shared/runtime\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically.\n// Bun and Deno handle TypeScript natively, so registration is skipped.\n// tsx's own register() picks `module.registerHooks` on Node ≥ 24.11.1 / 25.1 / 26\n// (avoiding the DEP0205 deprecation) and falls back to `module.register` on older runtimes.\nif (!isNativeTypeScriptRuntime()) {\n const { register } = await import(\"tsx/esm/api\");\n register();\n}\n\nexport { deploy, deploy as apply } from \"./commands/deploy/deploy\";\nexport type { DeployOptions, DeployOptions as ApplyOptions } from \"./commands/deploy/deploy\";\nexport type { BundledScripts } from \"./commands/deploy/function-registry\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport type {\n CodeGenerator,\n TailorDBGenerator,\n ResolverGenerator,\n ExecutorGenerator,\n TailorDBResolverGenerator,\n FullCodeGenerator,\n TailorDBInput,\n ResolverInput,\n ExecutorInput,\n FullInput,\n AggregateArgs,\n GeneratorResult,\n DependencyKind,\n PluginAttachment,\n TypeSourceInfoEntry,\n} from \"./commands/generate/types\";\nexport type { TailorDBType } from \"@/types/tailordb\";\nexport type { Resolver } from \"@/types/resolver.generated\";\nexport type { Executor } from \"@/types/executor.generated\";\n\n/** @deprecated Import from '@tailor-platform/sdk/plugin/kysely-type' instead */\nexport { kyselyTypePlugin } from \"@/plugin/builtin/kysely-type\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/enum-constants' instead */\nexport { enumConstantsPlugin } from \"@/plugin/builtin/enum-constants\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/file-utils' instead */\nexport { fileUtilsPlugin } from \"@/plugin/builtin/file-utils\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/seed' instead */\nexport { seedPlugin } from \"@/plugin/builtin/seed\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./commands/show\";\nexport { remove, type RemoveOptions } from \"./commands/remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./commands/workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./commands/workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./commands/workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./commands/workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./commands/workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./commands/workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./commands/workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./commands/workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./commands/workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./commands/workspace/user/remove\";\nexport type { UserInfo } from \"./commands/workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./commands/workspace/app/list\";\nexport {\n getAppHealth,\n type HealthOptions as GetAppHealthOptions,\n} from \"./commands/workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./commands/workspace/app/transform\";\nexport { getFunctionRegistry, type GetFunctionRegistryOptions } from \"./commands/function/get\";\nexport {\n listFunctionRegistries,\n type ListFunctionRegistriesOptions,\n} from \"./commands/function/list\";\nexport type { FunctionRegistryInfo } from \"./commands/function/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./commands/machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./commands/machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./commands/oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./commands/oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./commands/oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./commands/workflow/list\";\nexport {\n getWorkflow,\n type GetWorkflowOptions,\n type GetWorkflowTypedOptions,\n} from \"./commands/workflow/get\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type ListWorkflowExecutionsTypedOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n} from \"./commands/workflow/executions\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./commands/workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./commands/workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorOptions,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n watchExecutorJob,\n type ListExecutorJobsOptions,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport {\n getExecutor,\n type GetExecutorOptions,\n type GetExecutorTypedOptions,\n} from \"./commands/executor/get\";\nexport {\n listWebhookExecutors,\n type ListWebhookExecutorsOptions,\n type WebhookExecutorInfo,\n} from \"./commands/executor/webhook\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n ExecutorListInfo,\n ExecutorInfo,\n} from \"./commands/executor/transform\";\nexport { listOrganizations, type ListOrganizationsOptions } from \"./commands/organization/list\";\nexport { getOrganization, type GetOrganizationOptions } from \"./commands/organization/get\";\nexport { updateOrganization, type UpdateOrganizationOptions } from \"./commands/organization/update\";\nexport { organizationTree, type OrganizationTreeOptions } from \"./commands/organization/tree\";\nexport type {\n UserOrganizationInfo,\n OrganizationInfo,\n FolderListInfo,\n FolderInfo,\n} from \"./commands/organization/transform\";\nexport { listFolders, type ListFoldersOptions } from \"./commands/organization/folder/list\";\nexport { getFolder, type GetFolderOptions } from \"./commands/organization/folder/get\";\nexport { createFolder, type CreateFolderOptions } from \"./commands/organization/folder/create\";\nexport { updateFolder, type UpdateFolderOptions } from \"./commands/organization/folder/update\";\nexport { deleteFolder, type DeleteFolderOptions } from \"./commands/organization/folder/delete\";\nexport { loadAccessToken, loadWorkspaceId } from \"./shared/context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./commands/api\";\nexport { query } from \"./query\";\nexport { truncate, type TruncateOptions } from \"./commands/tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./commands/tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./commands/tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./commands/tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\n type MigrationInfo,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./commands/tailordb/migrate/types\";\n\n// Seed exports\nexport { chunkSeedData, type SeedChunk, type ChunkSeedDataOptions } from \"./shared/seed-chunker\";\nexport { bundleSeedScript, type SeedBundleResult } from \"./commands/generate/seed/bundler\";\nexport {\n bundleMigrationScript,\n type MigrationBundleResult,\n} from \"./commands/tailordb/migrate/bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ExecutionWaitResult,\n} from \"./shared/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./shared/client\";\nexport type { AuthInvoker } from \"@tailor-proto/tailor/v1/auth_resource_pb\";\n"],"mappings":"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"}
1
+ {"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/shared/seed-chunker.ts","../../src/cli/commands/generate/seed/bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["/**\n * Seed data chunker for splitting large seed data into manageable message sizes.\n *\n * When seed data exceeds the gRPC message size limit, this module splits the data\n * into multiple chunks at type boundaries (or record boundaries for large types).\n */\n\nimport { assertDefined } from \"@/utils/assert\";\n\n/**\n * Seed data keyed by type name, with an array of records per type.\n */\nexport type SeedData = Record<string, Record<string, unknown>[]>;\n\n/**\n * A single chunk of seed data with metadata for ordered execution.\n */\nexport type SeedChunk = {\n data: SeedData;\n order: string[];\n index: number;\n total: number;\n};\n\n/**\n * Options for chunking seed data.\n */\nexport type ChunkSeedDataOptions = {\n /** Seed data keyed by type name */\n data: SeedData;\n /** Ordered list of type names (dependency order) */\n order: string[];\n /** Byte size of the bundled seed script code */\n codeByteSize: number;\n /** Maximum gRPC message size in bytes (default: 3.5MB) */\n maxMessageSize?: number;\n};\n\n/** Default maximum message size: 3.5MB (conservative limit for gRPC) */\nexport const DEFAULT_MAX_MESSAGE_SIZE = 3.5 * 1024 * 1024;\n\n/** Reserved bytes for message metadata overhead */\nconst METADATA_OVERHEAD = 1024;\n\n/**\n * Split seed data into chunks that fit within the gRPC message size limit.\n *\n * Algorithm:\n * 1. Calculate the available budget for the arg field (maxMessageSize - codeByteSize - overhead)\n * 2. If all data fits in one message, return a single chunk\n * 3. Otherwise, iterate through types in dependency order:\n * - If a type fits in the current chunk, add it\n * - If adding a type would exceed the budget, finalize the current chunk and start a new one\n * - If a single type exceeds the budget, split its records across multiple chunks\n * - If a single record exceeds the budget, throw an error\n * @param options - Chunking options\n * @returns Array of seed chunks\n */\nexport function chunkSeedData(options: ChunkSeedDataOptions): SeedChunk[] {\n const { data, order, codeByteSize, maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE } = options;\n\n const argBudget = maxMessageSize - codeByteSize - METADATA_OVERHEAD;\n if (argBudget <= 0) {\n throw new Error(\n `Code size (${codeByteSize} bytes) exceeds the message size limit (${maxMessageSize} bytes). ` +\n `No space left for seed data.`,\n );\n }\n\n // Filter to types that have data\n const typesWithData = order.filter((type) => (data[type]?.length ?? 0) > 0);\n\n if (typesWithData.length === 0) {\n return [];\n }\n\n // Check if all data fits in a single message\n const fullArg = JSON.stringify({ data, order });\n if (byteSize(fullArg) <= argBudget) {\n return [{ data, order, index: 0, total: 1 }];\n }\n\n // Split into multiple chunks\n const chunks: Omit<SeedChunk, \"total\">[] = [];\n let currentData: SeedData = {};\n let currentOrder: string[] = [];\n\n for (const type of typesWithData) {\n const typeRecords = assertDefined(data[type], `seed data missing for type: ${type}`);\n\n // Check if the type fits in the current chunk\n if (currentOrder.length > 0) {\n const testData = { ...currentData, [type]: typeRecords };\n const testOrder = [...currentOrder, type];\n if (byteSize(JSON.stringify({ data: testData, order: testOrder })) > argBudget) {\n // Finalize the current chunk\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n }\n\n // Check if the entire type fits in an empty chunk\n if (byteSize(JSON.stringify({ data: { [type]: typeRecords }, order: [type] })) <= argBudget) {\n currentData[type] = typeRecords;\n currentOrder.push(type);\n continue;\n }\n\n // Type is too large — split by records\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n\n let recordBatch: Record<string, unknown>[] = [];\n for (const record of typeRecords) {\n if (byteSize(JSON.stringify({ data: { [type]: [record] }, order: [type] })) > argBudget) {\n const singleRecordSize = byteSize(JSON.stringify(record));\n throw new Error(\n `A single record in type \"${type}\" (${singleRecordSize} bytes) exceeds the message size budget ` +\n `(${argBudget} bytes). Consider increasing maxMessageSize or reducing the record size.`,\n );\n }\n\n const testBatch = [...recordBatch, record];\n const testData = { ...currentData, [type]: testBatch };\n const testOrder = currentOrder.includes(type) ? currentOrder : [...currentOrder, type];\n const testSize = byteSize(JSON.stringify({ data: testData, order: testOrder }));\n\n if (testSize > argBudget && recordBatch.length > 0) {\n // Finalize current chunk with accumulated records\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n recordBatch = [record];\n } else {\n recordBatch = testBatch;\n }\n }\n\n // Add remaining records\n if (recordBatch.length > 0) {\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n }\n }\n\n // Finalize the last chunk\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n }\n\n const total = chunks.length;\n return chunks.map((chunk) => ({ ...chunk, total }));\n}\n\nfunction byteSize(str: string): number {\n return new TextEncoder().encode(str).length;\n}\n","/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"@/cli/shared/dist-dir\";\nimport { platformBundleDefinePlugin } from \"@/cli/shared/platform-bundle-plugin\";\nimport ml from \"@/utils/multiline\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely, TailordbDialect } from \"@tailor-platform/sdk/kysely\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n selfRefTypes: string[];\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, number>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<string, number> = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = 0;\n const hasSelfRef = (input.selfRefTypes || []).includes(typeName);\n\n try {\n if (hasSelfRef) {\n // Insert one-by-one to respect self-referencing foreign key order\n for (const record of records) {\n await db.insertInto(typeName).values(record).execute();\n processed[typeName] += 1;\n }\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length} (one-by-one)\\`);\n } else {\n for (let i = 0; i < records.length; i += BATCH_SIZE) {\n const batch = records.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName] += batch.length;\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length}\\`);\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n): Promise<SeedBundleResult> {\n // Output directory in .tailor-sdk (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig();\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking (write: false to avoid unnecessary disk I/O)\n const result = await rolldown.build({\n plugins: [platformBundleDefinePlugin],\n input: entryPath,\n write: false,\n output: {\n format: \"esm\",\n sourcemap: false,\n minify: false,\n codeSplitting: false,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n logLevel: \"silent\",\n } as rolldown.BuildOptions);\n\n const bundledCode = result.output[0].code;\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { isNativeTypeScriptRuntime } from \"./shared/runtime\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically.\n// Bun and Deno handle TypeScript natively, so registration is skipped.\n// tsx's own register() picks `module.registerHooks` on Node ≥ 24.11.1 / 25.1 / 26\n// (avoiding the DEP0205 deprecation) and falls back to `module.register` on older runtimes.\nif (!isNativeTypeScriptRuntime()) {\n const { register } = await import(\"tsx/esm/api\");\n register();\n}\n\nexport { deploy, deploy as apply } from \"./commands/deploy/deploy\";\nexport type { DeployOptions, DeployOptions as ApplyOptions } from \"./commands/deploy/deploy\";\nexport type { BundledScripts } from \"./commands/deploy/function-registry\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport type { GeneratorResult, PluginAttachment } from \"@/plugin/types\";\nexport type { TailorDBType, TypeSourceInfoEntry } from \"@/parser/service/tailordb/types\";\nexport type { Resolver } from \"@/types/resolver.generated\";\nexport type { Executor } from \"@/types/executor.generated\";\n\n/** @deprecated Import from '@tailor-platform/sdk/plugin/kysely-type' instead */\nexport { kyselyTypePlugin } from \"@/plugin/builtin/kysely-type\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/enum-constants' instead */\nexport { enumConstantsPlugin } from \"@/plugin/builtin/enum-constants\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/file-utils' instead */\nexport { fileUtilsPlugin } from \"@/plugin/builtin/file-utils\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/seed' instead */\nexport { seedPlugin } from \"@/plugin/builtin/seed\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./commands/show\";\nexport { remove, type RemoveOptions } from \"./commands/remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./commands/workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./commands/workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./commands/workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./commands/workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./commands/workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./commands/workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./commands/workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./commands/workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./commands/workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./commands/workspace/user/remove\";\nexport type { UserInfo } from \"./commands/workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./commands/workspace/app/list\";\nexport {\n getAppHealth,\n type HealthOptions as GetAppHealthOptions,\n} from \"./commands/workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./commands/workspace/app/transform\";\nexport { getFunctionRegistry, type GetFunctionRegistryOptions } from \"./commands/function/get\";\nexport {\n listFunctionRegistries,\n type ListFunctionRegistriesOptions,\n} from \"./commands/function/list\";\nexport type { FunctionRegistryInfo } from \"./commands/function/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./commands/machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./commands/machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./commands/oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./commands/oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./commands/oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./commands/workflow/list\";\nexport {\n getWorkflow,\n type GetWorkflowOptions,\n type GetWorkflowTypedOptions,\n} from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type ListWorkflowExecutionsTypedOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n} from \"./commands/workflow/executions\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./commands/workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./commands/workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorOptions,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n watchExecutorJob,\n type ListExecutorJobsOptions,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport {\n getExecutor,\n type GetExecutorOptions,\n type GetExecutorTypedOptions,\n} from \"./commands/executor/get\";\nexport {\n listWebhookExecutors,\n type ListWebhookExecutorsOptions,\n type WebhookExecutorInfo,\n} from \"./commands/executor/webhook\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n ExecutorListInfo,\n ExecutorInfo,\n} from \"./commands/executor/transform\";\nexport { listOrganizations, type ListOrganizationsOptions } from \"./commands/organization/list\";\nexport { getOrganization, type GetOrganizationOptions } from \"./commands/organization/get\";\nexport { updateOrganization, type UpdateOrganizationOptions } from \"./commands/organization/update\";\nexport { organizationTree, type OrganizationTreeOptions } from \"./commands/organization/tree\";\nexport type {\n UserOrganizationInfo,\n OrganizationInfo,\n FolderListInfo,\n FolderInfo,\n} from \"./commands/organization/transform\";\nexport { listFolders, type ListFoldersOptions } from \"./commands/organization/folder/list\";\nexport { getFolder, type GetFolderOptions } from \"./commands/organization/folder/get\";\nexport { createFolder, type CreateFolderOptions } from \"./commands/organization/folder/create\";\nexport { updateFolder, type UpdateFolderOptions } from \"./commands/organization/folder/update\";\nexport { deleteFolder, type DeleteFolderOptions } from \"./commands/organization/folder/delete\";\nexport { loadAccessToken, loadWorkspaceId } from \"./shared/context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./commands/api\";\nexport { query } from \"./query\";\nexport { truncate, type TruncateOptions } from \"./commands/tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./commands/tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./commands/tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./commands/tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\n type MigrationInfo,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./commands/tailordb/migrate/types\";\n\n// Seed exports\nexport { chunkSeedData, type SeedChunk, type ChunkSeedDataOptions } from \"./shared/seed-chunker\";\nexport { bundleSeedScript, type SeedBundleResult } from \"./commands/generate/seed/bundler\";\nexport {\n bundleMigrationScript,\n type MigrationBundleResult,\n} from \"./commands/tailordb/migrate/bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ExecutionWaitResult,\n} from \"./shared/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./shared/client\";\nexport type { AuthInvoker } from \"@tailor-proto/tailor/v1/auth_resource_pb\";\n"],"mappings":"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"}
@@ -1,4 +1,3 @@
1
-
2
- import { _ as userAgent, a as fetchAll, c as fetchPlatformMachineUserToken, d as initOAuth2Client, f as initOperatorClient, g as retryInterceptor, h as resolveStaticWebsiteUrls, i as createTransport, l as fetchUserInfo, m as platformBaseUrl, n as RETRY_SAFE_CREATE_METHODS, o as fetchMachineUserToken, p as parseMethodName, r as closeConnectionPool, s as fetchPaged, t as MAX_PAGE_SIZE, u as formatRequestParams } from "./client-F0a4cWUM.mjs";
1
+ import { _ as userAgent, a as fetchAll, c as fetchPlatformMachineUserToken, d as initOAuth2Client, f as initOperatorClient, g as retryInterceptor, h as resolveStaticWebsiteUrls, i as createTransport, l as fetchUserInfo, m as platformBaseUrl, n as RETRY_SAFE_CREATE_METHODS, o as fetchMachineUserToken, p as parseMethodName, r as closeConnectionPool, s as fetchPaged, t as MAX_PAGE_SIZE, u as formatRequestParams } from "./client-z_oHGVNy.mjs";
3
2
 
4
3
  export { userAgent };
@@ -1,6 +1,5 @@
1
-
2
- import { n as logger } from "./logger-DpJyJvNz.mjs";
3
- import { t as readPackageJson } from "./package-json-DcQApfPQ.mjs";
1
+ import { n as logger } from "./logger-CxF-Ex5d.mjs";
2
+ import { t as readPackageJson } from "./package-json-8b0O9TlX.mjs";
4
3
  import { z } from "zod";
5
4
  import { create } from "@bufbuild/protobuf";
6
5
  import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv2";
@@ -988,7 +987,7 @@ function initOAuth2Client() {
988
987
  * @returns Configured Operator client
989
988
  */
990
989
  async function initOperatorClient(accessToken) {
991
- const { createTracingInterceptor } = await import("./interceptor-DOqRkCya.mjs");
990
+ const { createTracingInterceptor } = await import("./interceptor-D-q1rvRl.mjs");
992
991
  return createClient(OperatorService, await createTransport(platformBaseUrl, [
993
992
  await userAgentInterceptor(),
994
993
  await bearerTokenInterceptor(accessToken),
@@ -1320,7 +1319,10 @@ async function fetchUserInfo(accessToken) {
1320
1319
  } });
1321
1320
  if (!resp.ok) throw new Error(`Failed to fetch user info: ${resp.statusText}`);
1322
1321
  const rawJson = await resp.json();
1323
- return z.object({ email: z.string() }).parse(rawJson);
1322
+ return z.object({
1323
+ sub: z.string(),
1324
+ email: z.string()
1325
+ }).parse(rawJson);
1324
1326
  }
1325
1327
  /**
1326
1328
  * Resolve "name:url" patterns to actual Static Website URLs.
@@ -1411,4 +1413,4 @@ async function closeConnectionPool() {
1411
1413
 
1412
1414
  //#endregion
1413
1415
  export { CreateExecutorExecutorRequestSchema as $, TailorDBGQLPermission_Permit as A, AuthSCIMAttribute_Type as At, UpdateSecretManagerSecretRequestSchema as B, Subgraph_ServiceType as Bt, WorkflowExecution_Status as C, AuthConnection_Type as Ct, UpdateTailorDBTypeRequestSchema as D, AuthOAuth2Client_ClientType as Dt, CreateTailorDBTypeRequestSchema as E, AuthInvokerSchema as Et, CreateStaticWebsiteRequestSchema as F, UserProfileProviderConfig_UserProfileProviderType as Ft, PipelineResolver_OperationType as G, CreatePipelineServiceRequestSchema as H, Condition_Operator as Ht, UpdateStaticWebsiteRequestSchema as I, CreateApplicationRequestSchema as It, IdPLang as J, CreateIdPServiceRequestSchema as K, CustomDomainStatus as L, GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus as Lt, TailorDBType_Permission_Permit as M, AuthSCIMConfig_AuthorizationType as Mt, TailorDBType_PermitAction as N, PATScope as Nt, TailorDBGQLPermission_Action as O, AuthOAuth2Client_GrantType as Ot, AddCustomDomainRequestSchema as P, TenantProviderConfig_TenantProviderType as Pt, FunctionExecution_Type as Q, CreateSecretManagerSecretRequestSchema as R, UpdateApplicationRequestSchema as Rt, UpdateWorkflowRequestSchema as S, UpdateUserProfileConfigRequestSchema as St, CreateTailorDBServiceRequestSchema as T, AuthIDPConfig_AuthType as Tt, UpdatePipelineResolverRequestSchema as U, FilterSchema as Ut, CreatePipelineResolverRequestSchema as V, ConditionSchema as Vt, UpdatePipelineServiceRequestSchema as W, PageDirection as Wt, IdPPermissionPermit as X, IdPPermissionOperator as Y, FunctionExecution_Status as Z, userAgent as _, UpdateAuthOAuth2ClientRequestSchema as _t, fetchAll as a, CreateAuthHookRequestSchema as at, CreateWorkflowJobFunctionRequestSchema as b, UpdateAuthServiceRequestSchema as bt, fetchPlatformMachineUserToken as c, CreateAuthOAuth2ClientRequestSchema as ct, initOAuth2Client as d, CreateAuthServiceRequestSchema as dt, UpdateExecutorExecutorRequestSchema as et, initOperatorClient as f, CreateTenantConfigRequestSchema as ft, retryInterceptor as g, UpdateAuthMachineUserRequestSchema as gt, resolveStaticWebsiteUrls as h, UpdateAuthIDPConfigRequestSchema as ht, createTransport as i, CreateAuthConnectionRequestSchema as it, TailorDBType_Permission_Operator as j, AuthSCIMAttribute_Uniqueness as jt, TailorDBGQLPermission_Operator as k, AuthSCIMAttribute_Mutability as kt, fetchUserInfo as l, CreateAuthSCIMConfigRequestSchema as lt, platformBaseUrl as m, UpdateAuthHookRequestSchema as mt, RETRY_SAFE_CREATE_METHODS as n, ExecutorTargetType as nt, fetchMachineUserToken as o, CreateAuthIDPConfigRequestSchema as ot, parseMethodName as p, CreateUserProfileConfigRequestSchema as pt, UpdateIdPServiceRequestSchema as q, closeConnectionPool as r, ExecutorTriggerType as rt, fetchPaged as s, CreateAuthMachineUserRequestSchema as st, MAX_PAGE_SIZE as t, ExecutorJobStatus as tt, formatRequestParams as u, CreateAuthSCIMResourceRequestSchema as ut, OperatorService as v, UpdateAuthSCIMConfigRequestSchema as vt, WorkflowJobExecution_Status as w, AuthHookPoint as wt, CreateWorkflowRequestSchema as x, UpdateTenantConfigRequestSchema as xt, WorkspacePlatformUserRole as y, UpdateAuthSCIMResourceRequestSchema as yt, CreateSecretManagerVaultRequestSchema as z, ApplicationSchemaUpdateAttemptStatus as zt };
1414
- //# sourceMappingURL=client-F0a4cWUM.mjs.map
1416
+ //# sourceMappingURL=client-z_oHGVNy.mjs.map