@tailor-platform/sdk 1.25.3 → 1.25.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.25.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#775](https://github.com/tailor-platform/sdk/pull/775) [`a7a99da`](https://github.com/tailor-platform/sdk/commit/a7a99da4d7c1dfcb80db4de5d4fe7e5161c23e64) Thanks [@toiroakr](https://github.com/toiroakr)! - Skip postinstall type generation when no tailor.config.ts is found instead of creating an empty tailor.d.ts
8
+
9
+ - [#717](https://github.com/tailor-platform/sdk/pull/717) [`cabb93b`](https://github.com/tailor-platform/sdk/commit/cabb93b0b0837122f958be4fadda0da164c527f2) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @types/node to v24.12.0
10
+
11
+ - [#725](https://github.com/tailor-platform/sdk/pull/725) [`368a2fd`](https://github.com/tailor-platform/sdk/commit/368a2fdd2c1f28d12d5b010a1359322117e0c359) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency knip to v5.86.0
12
+
13
+ - [#732](https://github.com/tailor-platform/sdk/pull/732) [`0cb5d7f`](https://github.com/tailor-platform/sdk/commit/0cb5d7f296d30e14eeb55a60729583594fd138a4) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency aquaproj/aqua-registry to v4.485.0
14
+
15
+ - [#733](https://github.com/tailor-platform/sdk/pull/733) [`9543d3a`](https://github.com/tailor-platform/sdk/commit/9543d3a6c36396d6a29020edf15429fe1795bea3) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency oxlint-tsgolint to v0.16.0
16
+
17
+ - [#734](https://github.com/tailor-platform/sdk/pull/734) [`8460bdc`](https://github.com/tailor-platform/sdk/commit/8460bdc82a2da327a4436856b7a81be1636d1ff5) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency sonda to v0.11.1
18
+
19
+ - [#737](https://github.com/tailor-platform/sdk/pull/737) [`69fe62c`](https://github.com/tailor-platform/sdk/commit/69fe62c308c971256707953a12e972faf4220697) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency rolldown to v1.0.0-rc.9
20
+
21
+ - [#738](https://github.com/tailor-platform/sdk/pull/738) [`7db1d9a`](https://github.com/tailor-platform/sdk/commit/7db1d9a646c6833a82191249f7d0c6cd5c2f066b) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency turbo to v2.8.15
22
+
23
+ - [#740](https://github.com/tailor-platform/sdk/pull/740) [`e9fc3f6`](https://github.com/tailor-platform/sdk/commit/e9fc3f6a2472c230cb8015c3adb45d691b795737) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency typescript-eslint to v8.57.0
24
+
25
+ - [#747](https://github.com/tailor-platform/sdk/pull/747) [`72c14a7`](https://github.com/tailor-platform/sdk/commit/72c14a795dd60f28ebeae159f06908b88e9eed47) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update anthropics/claude-code-action action to v1.0.72
26
+
27
+ - [#754](https://github.com/tailor-platform/sdk/pull/754) [`cad764d`](https://github.com/tailor-platform/sdk/commit/cad764d28499466d4cd65786481eca6e0cebfe87) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update actions/create-github-app-token action to v2.2.2
28
+
29
+ - [#756](https://github.com/tailor-platform/sdk/pull/756) [`1e972a4`](https://github.com/tailor-platform/sdk/commit/1e972a463be48c23ffabf71194f785face7e32f3) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency lefthook to v2.1.4
30
+
31
+ - [#757](https://github.com/tailor-platform/sdk/pull/757) [`1ceb017`](https://github.com/tailor-platform/sdk/commit/1ceb017f86196c66e19572fb43e12a1989e5f432) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency tsdown to v0.21.2
32
+
33
+ - [#758](https://github.com/tailor-platform/sdk/pull/758) [`73a5684`](https://github.com/tailor-platform/sdk/commit/73a5684f04467a3eacdedfeb35dd2a3c17690a31) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dorny/paths-filter action to v3.0.3
34
+
35
+ - [#759](https://github.com/tailor-platform/sdk/pull/759) [`4690057`](https://github.com/tailor-platform/sdk/commit/4690057b4798e728c6dff8851415c62c3c6b0fc7) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update pnpm to v10.32.1
36
+
37
+ - [#770](https://github.com/tailor-platform/sdk/pull/770) [`6b93e7a`](https://github.com/tailor-platform/sdk/commit/6b93e7a5e673d8f2016f29f3fd4a1436d5ce119b) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix seed and query bundlers to use `@tailor-platform/sdk/kysely` re-export instead of importing `kysely` and `@tailor-platform/function-kysely-tailordb` directly, so they work without users installing these as direct dependencies
38
+
3
39
  ## 1.25.3
4
40
 
5
41
  ### Patch Changes
@@ -3,7 +3,7 @@ import "../chunk-Cz-A8uMR.mjs";
3
3
  import "../schema-BePzTFBV.mjs";
4
4
  import "../brand-GZnI4eYb.mjs";
5
5
  import { C as fetchAll, D as initOperatorClient, E as initOAuth2Client, J as AuthInvokerSchema, S as writePlatformConfig, T as fetchUserInfo, U as FunctionExecution_Type, a as loadConfig, b as loadWorkspaceId, c as ExecutorSchema, ft as logger, g as getDistDir, i as resolveInlineSourcemap, o as WorkflowJobSchema, pt as styles, tt as PATScope, u as ResolverSchema, v as fetchLatestToken, x as readPlatformConfig, y as loadAccessToken } from "../application-91Th6tm6.mjs";
6
- import { C as listCommand$9, E as resumeCommand, Ft as isValidMigrationNumber, G as listCommand$6, Ht as prompt, I as showCommand, It as loadDiff, Jt as commonArgs, Kt as apiCommand, Mt as getMigrationFilePath, N as generateCommand$1, Nt as getMigrationFiles, O as listCommand$8, P as logBetaWarning, Q as listCommand$5, Qt as workspaceArgs, R as removeCommand$1, T as healthCommand, Ut as trnPrefix, V as getCommand$2, Vt as getNamespacesWithMigrations, W as tokenCommand, X as triggerCommand, Xt as deploymentArgs, Y as webhookCommand, Yt as confirmationArgs, Zt as isVerbose, b as createCommand$3, c as listCommand$10, ct as executionsCommand, dt as functionExecutionStatusToString, f as restoreCommand, ft as formatKeyValueTable, g as getCommand$4, gt as executeScript, ht as apply, i as updateCommand$2, it as startCommand, j as truncateCommand, kt as formatMigrationNumber, m as listCommand$11, n as queryCommand, o as removeCommand, ot as getCommand$3, pt as getCommand$1, q as generate, qt as defineAppCommand, r as isCLIError, tt as jobsCommand, u as inviteCommand, v as deleteCommand$3, yt as parseMigrationLabelNumber, z as listCommand$7 } from "../query-BpppEOzu.mjs";
6
+ import { C as listCommand$9, E as resumeCommand, Ft as isValidMigrationNumber, G as listCommand$6, Ht as prompt, I as showCommand, It as loadDiff, Jt as commonArgs, Kt as apiCommand, Mt as getMigrationFilePath, N as generateCommand$1, Nt as getMigrationFiles, O as listCommand$8, P as logBetaWarning, Q as listCommand$5, Qt as workspaceArgs, R as removeCommand$1, T as healthCommand, Ut as trnPrefix, V as getCommand$2, Vt as getNamespacesWithMigrations, W as tokenCommand, X as triggerCommand, Xt as deploymentArgs, Y as webhookCommand, Yt as confirmationArgs, Zt as isVerbose, b as createCommand$3, c as listCommand$10, ct as executionsCommand, dt as functionExecutionStatusToString, f as restoreCommand, ft as formatKeyValueTable, g as getCommand$4, gt as executeScript, ht as apply, i as updateCommand$2, it as startCommand, j as truncateCommand, kt as formatMigrationNumber, m as listCommand$11, n as queryCommand, o as removeCommand, ot as getCommand$3, pt as getCommand$1, q as generate, qt as defineAppCommand, r as isCLIError, tt as jobsCommand, u as inviteCommand, v as deleteCommand$3, yt as parseMigrationLabelNumber, z as listCommand$7 } from "../query-kb_4EQp4.mjs";
7
7
  import { t as readPackageJson } from "../package-json-CVUv8Y9T.mjs";
8
8
  import "../seed-CCVRLibh.mjs";
9
9
  import "../file-utils-2T9w20FP.mjs";
package/dist/cli/lib.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  import "../chunk-Cz-A8uMR.mjs";
2
2
  import "../schema-BePzTFBV.mjs";
3
3
  import "../brand-GZnI4eYb.mjs";
4
- import { D as initOperatorClient, a as loadConfig, b as loadWorkspaceId, ft as logger, g as getDistDir, y as loadAccessToken } from "../application-91Th6tm6.mjs";
5
- import { $ as listExecutors, A as truncate, At as getLatestMigrationNumber, B as listOAuth2Clients, Bt as hasChanges, Ct as INITIAL_SCHEMA_NUMBER, D as resumeWorkflow, Dt as compareSnapshots, Et as compareLocalTypesWithSnapshot, F as show, Gt as apiCall, H as getOAuth2Client, J as listWebhookExecutors, K as listMachineUsers, L as remove, Lt as reconstructSnapshotFromMigrations, M as generate$1, Mt as getMigrationFilePath, Nt as getMigrationFiles, Ot as createSnapshotFromLocalTypes, Pt as getNextMigrationNumber, Rt as formatDiffSummary, S as listApps, St as DIFF_FILE_NAME, Tt as SCHEMA_FILE_NAME, U as getMachineUserToken, Vt as getNamespacesWithMigrations, Wt as generateUserTypes, Z as triggerExecutor, _ as getWorkspace, _t as waitForExecution, a as updateUser, at as startWorkflow, bt as bundleMigrationScript, d as inviteUser, et as getExecutorJob, gt as executeScript, h as listWorkspaces, ht as apply, jt as getMigrationDirPath, k as listWorkflows, l as listUsers, lt as getWorkflowExecution, mt as getExecutor, nt as listExecutorJobs, p as restoreWorkspace, q as generate, rt as watchExecutorJob, s as removeUser, st as getWorkflow, t as query, ut as listWorkflowExecutions, vt as MIGRATION_LABEL_KEY, w as getAppHealth, wt as MIGRATE_FILE_NAME, x as createWorkspace, xt as DB_TYPES_FILE_NAME, y as deleteWorkspace, zt as formatMigrationDiff } from "../query-BpppEOzu.mjs";
4
+ import { D as initOperatorClient, a as loadConfig, b as loadWorkspaceId, g as getDistDir, y as loadAccessToken } from "../application-91Th6tm6.mjs";
5
+ import { $ as listExecutors, A as truncate, At as getLatestMigrationNumber, B as listOAuth2Clients, Bt as hasChanges, Ct as INITIAL_SCHEMA_NUMBER, D as resumeWorkflow, Dt as compareSnapshots, Et as compareLocalTypesWithSnapshot, F as show, Gt as apiCall, H as getOAuth2Client, J as listWebhookExecutors, K as listMachineUsers, L as remove, Lt as reconstructSnapshotFromMigrations, M as generate$1, Mt as getMigrationFilePath, Nt as getMigrationFiles, Ot as createSnapshotFromLocalTypes, Pt as getNextMigrationNumber, Rt as formatDiffSummary, S as listApps, St as DIFF_FILE_NAME, Tt as SCHEMA_FILE_NAME, U as getMachineUserToken, Vt as getNamespacesWithMigrations, Wt as generateUserTypes, Z as triggerExecutor, _ as getWorkspace, _t as waitForExecution, a as updateUser, at as startWorkflow, bt as bundleMigrationScript, d as inviteUser, et as getExecutorJob, gt as executeScript, h as listWorkspaces, ht as apply, jt as getMigrationDirPath, k as listWorkflows, l as listUsers, lt as getWorkflowExecution, mt as getExecutor, nt as listExecutorJobs, p as restoreWorkspace, q as generate, rt as watchExecutorJob, s as removeUser, st as getWorkflow, t as query, ut as listWorkflowExecutions, vt as MIGRATION_LABEL_KEY, w as getAppHealth, wt as MIGRATE_FILE_NAME, x as createWorkspace, xt as DB_TYPES_FILE_NAME, y as deleteWorkspace, zt as formatMigrationDiff } from "../query-kb_4EQp4.mjs";
6
6
  import "../package-json-CVUv8Y9T.mjs";
7
7
  import { n as seedPlugin } from "../seed-CCVRLibh.mjs";
8
8
  import { n as enumConstantsPlugin } from "../enum-constants-6uK0VI_s.mjs";
9
9
  import { n as fileUtilsPlugin } from "../file-utils-2T9w20FP.mjs";
10
10
  import { n as kyselyTypePlugin } from "../kysely-type-cMNbsQ6k.mjs";
11
11
  import "../telemetry-0w8OupuQ.mjs";
12
- import { createRequire, register } from "node:module";
12
+ import { register } from "node:module";
13
13
  import * as fs from "node:fs";
14
14
  import * as path from "pathe";
15
15
  import { resolveTSConfig } from "pkg-types";
@@ -149,24 +149,6 @@ function byteSize(str) {
149
149
  *
150
150
  * Bundles seed scripts to be executed via TestExecScript API
151
151
  */
152
- const REQUIRED_PACKAGES = ["kysely", "@tailor-platform/function-kysely-tailordb"];
153
- let dependencyCheckDone = false;
154
- /**
155
- * Check if required packages for seed bundling are installed.
156
- * Logs a warning if any are missing.
157
- */
158
- function checkSeedDependencies() {
159
- if (dependencyCheckDone) return;
160
- dependencyCheckDone = true;
161
- const require = createRequire(path.resolve(process.cwd(), "package.json"));
162
- const missing = [];
163
- for (const pkg of REQUIRED_PACKAGES) try {
164
- require.resolve(pkg);
165
- } catch {
166
- missing.push(pkg);
167
- }
168
- if (missing.length > 0) logger.warn(`Missing optional dependencies for seed bundling: ${missing.join(", ")}. Install them in your project: pnpm add -D ${missing.join(" ")}`);
169
- }
170
152
  const BATCH_SIZE = 100;
171
153
  /**
172
154
  * Generate seed script content for server-side execution
@@ -175,8 +157,7 @@ const BATCH_SIZE = 100;
175
157
  */
176
158
  function generateSeedScriptContent(namespace) {
177
159
  return ml`
178
- import { Kysely } from "kysely";
179
- import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
160
+ import { Kysely, TailordbDialect } from "@tailor-platform/sdk/kysely";
180
161
 
181
162
  type SeedInput = {
182
163
  data: Record<string, Record<string, unknown>[]>;
@@ -257,7 +238,6 @@ function generateSeedScriptContent(namespace) {
257
238
  * @returns Bundled seed script result
258
239
  */
259
240
  async function bundleSeedScript(namespace, typeNames) {
260
- checkSeedDependencies();
261
241
  const outputDir = path.resolve(getDistDir(), "seed");
262
242
  fs.mkdirSync(outputDir, { recursive: true });
263
243
  const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);
@@ -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\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] && data[type].length > 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 = data[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 { createRequire } from \"node:module\";\nimport ml from \"multiline-ts\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"@/cli/shared/dist-dir\";\nimport { logger } from \"@/cli/shared/logger\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst REQUIRED_PACKAGES = [\"kysely\", \"@tailor-platform/function-kysely-tailordb\"] as const;\n\nlet dependencyCheckDone = false;\n\n/**\n * Check if required packages for seed bundling are installed.\n * Logs a warning if any are missing.\n */\nfunction checkSeedDependencies(): void {\n if (dependencyCheckDone) return;\n dependencyCheckDone = true;\n\n const require = createRequire(path.resolve(process.cwd(), \"package.json\"));\n const missing: string[] = [];\n\n for (const pkg of REQUIRED_PACKAGES) {\n try {\n require.resolve(pkg);\n } catch {\n missing.push(pkg);\n }\n }\n\n if (missing.length > 0) {\n logger.warn(\n `Missing optional dependencies for seed bundling: ${missing.join(\", \")}. ` +\n `Install them in your project: pnpm add -D ${missing.join(\" \")}`,\n );\n }\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 } from \"kysely\";\n import { TailordbDialect } from \"@tailor-platform/function-kysely-tailordb\";\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 // Check for required dependencies (only once per session)\n checkSeedDependencies();\n\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 const outputPath = path.join(outputDir, `seed_${namespace}.js`);\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\n await rolldown.build(\n rolldown.defineConfig({\n input: entryPath,\n output: {\n file: outputPath,\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\n // Read bundled output\n const bundledCode = fs.readFileSync(outputPath, \"utf-8\");\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./commands/apply/apply\";\nexport type { ApplyOptions } from \"./commands/apply/apply\";\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 {\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 { 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 SnapshotType,\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":";;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,2BAA2B,MAAM,OAAO;;AAGrD,MAAM,oBAAoB;;;;;;;;;;;;;;;AAgB1B,SAAgB,cAAc,SAA4C;CACxE,MAAM,EAAE,MAAM,OAAO,cAAc,iBAAiB,6BAA6B;CAEjF,MAAM,YAAY,iBAAiB,eAAe;AAClD,KAAI,aAAa,EACf,OAAM,IAAI,MACR,cAAc,aAAa,0CAA0C,eAAe,uCAErF;CAIH,MAAM,gBAAgB,MAAM,QAAQ,SAAS,KAAK,SAAS,KAAK,MAAM,SAAS,EAAE;AAEjF,KAAI,cAAc,WAAW,EAC3B,QAAO,EAAE;AAKX,KAAI,SADY,KAAK,UAAU;EAAE;EAAM;EAAO,CAAC,CAC1B,IAAI,UACvB,QAAO,CAAC;EAAE;EAAM;EAAO,OAAO;EAAG,OAAO;EAAG,CAAC;CAI9C,MAAM,SAAqC,EAAE;CAC7C,IAAI,cAAwB,EAAE;CAC9B,IAAI,eAAyB,EAAE;AAE/B,MAAK,MAAM,QAAQ,eAAe;EAChC,MAAM,cAAc,KAAK;AAGzB,MAAI,aAAa,SAAS,GAAG;GAC3B,MAAM,WAAW;IAAE,GAAG;KAAc,OAAO;IAAa;GACxD,MAAM,YAAY,CAAC,GAAG,cAAc,KAAK;AACzC,OAAI,SAAS,KAAK,UAAU;IAAE,MAAM;IAAU,OAAO;IAAW,CAAC,CAAC,GAAG,WAAW;AAE9E,WAAO,KAAK;KAAE,MAAM;KAAa,OAAO;KAAc,OAAO,OAAO;KAAQ,CAAC;AAC7E,kBAAc,EAAE;AAChB,mBAAe,EAAE;;;AAKrB,MAAI,SAAS,KAAK,UAAU;GAAE,MAAM,GAAG,OAAO,aAAa;GAAE,OAAO,CAAC,KAAK;GAAE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aAAW,MAAM,iBAAiB;SAC5B;AACN,aAAW;;AAIb,OAAM,SAAS,MACb,SAAS,aAAa;EACpB,OAAO;EACP,QAAQ;GACN,MAAM;GACN,QAAQ;GACR,WAAW;GACX,QAAQ;GACR,eAAe;GACf,SAAS,EACP,UAAU,YACX;GACF;EACD,UAAU,CAAC,WAAW;EACtB,SAAS,EACP,gBAAgB,CAAC,QAAQ,SAAS,EACnC;EACD;EACA,WAAW;GACT,mBAAmB;GACnB,aAAa;GACb,0BAA0B;GAC3B;EACD,UAAU;EACX,CAAC,CACH;AAKD,QAAO;EACL;EACA,aAJkB,GAAG,aAAa,YAAY,QAAQ;EAKtD,eAAe;EAChB;;;;;ACxMH,SAAS,OAAO,OAAO,KAAK,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
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\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] && data[type].length > 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 = data[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 ml from \"multiline-ts\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"@/cli/shared/dist-dir\";\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 const outputPath = path.join(outputDir, `seed_${namespace}.js`);\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\n await rolldown.build(\n rolldown.defineConfig({\n input: entryPath,\n output: {\n file: outputPath,\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\n // Read bundled output\n const bundledCode = fs.readFileSync(outputPath, \"utf-8\");\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./commands/apply/apply\";\nexport type { ApplyOptions } from \"./commands/apply/apply\";\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 {\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 { 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 SnapshotType,\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":";;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,2BAA2B,MAAM,OAAO;;AAGrD,MAAM,oBAAoB;;;;;;;;;;;;;;;AAgB1B,SAAgB,cAAc,SAA4C;CACxE,MAAM,EAAE,MAAM,OAAO,cAAc,iBAAiB,6BAA6B;CAEjF,MAAM,YAAY,iBAAiB,eAAe;AAClD,KAAI,aAAa,EACf,OAAM,IAAI,MACR,cAAc,aAAa,0CAA0C,eAAe,uCAErF;CAIH,MAAM,gBAAgB,MAAM,QAAQ,SAAS,KAAK,SAAS,KAAK,MAAM,SAAS,EAAE;AAEjF,KAAI,cAAc,WAAW,EAC3B,QAAO,EAAE;AAKX,KAAI,SADY,KAAK,UAAU;EAAE;EAAM;EAAO,CAAC,CAC1B,IAAI,UACvB,QAAO,CAAC;EAAE;EAAM;EAAO,OAAO;EAAG,OAAO;EAAG,CAAC;CAI9C,MAAM,SAAqC,EAAE;CAC7C,IAAI,cAAwB,EAAE;CAC9B,IAAI,eAAyB,EAAE;AAE/B,MAAK,MAAM,QAAQ,eAAe;EAChC,MAAM,cAAc,KAAK;AAGzB,MAAI,aAAa,SAAS,GAAG;GAC3B,MAAM,WAAW;IAAE,GAAG;KAAc,OAAO;IAAa;GACxD,MAAM,YAAY,CAAC,GAAG,cAAc,KAAK;AACzC,OAAI,SAAS,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,UAAU,YACX;GACF;EACD,UAAU,CAAC,WAAW;EACtB,SAAS,EACP,gBAAgB,CAAC,QAAQ,SAAS,EACnC;EACD;EACA,WAAW;GACT,mBAAmB;GACnB,aAAa;GACb,0BAA0B;GAC3B;EACD,UAAU;EACX,CAAC,CACH;AAKD,QAAO;EACL;EACA,aAJkB,GAAG,aAAa,YAAY,QAAQ;EAKtD,eAAe;EAChB;;;;;ACnKH,SAAS,OAAO,OAAO,KAAK,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
@@ -11535,8 +11535,7 @@ const updateCommand = defineAppCommand({
11535
11535
  //#region src/cli/bundler/query/query-bundler.ts
11536
11536
  function createSqlEntry() {
11537
11537
  return ml`
11538
- import { Kysely, sql } from "@tailor-platform/sdk/kysely";
11539
- import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
11538
+ import { Kysely, sql, TailordbDialect } from "@tailor-platform/sdk/kysely";
11540
11539
 
11541
11540
  type QueryInput = {
11542
11541
  namespace: string;
@@ -12506,4 +12505,4 @@ function printGqlResult(result, options = {}) {
12506
12505
 
12507
12506
  //#endregion
12508
12507
  export { listExecutors as $, truncate as A, getLatestMigrationNumber as At, listOAuth2Clients as B, hasChanges as Bt, listCommand$2 as C, INITIAL_SCHEMA_NUMBER as Ct, resumeWorkflow as D, compareSnapshots as Dt, resumeCommand as E, compareLocalTypesWithSnapshot as Et, show as F, isValidMigrationNumber as Ft, listCommand$5 as G, apiCall as Gt, getOAuth2Client as H, prompt as Ht, showCommand as I, loadDiff as It, listWebhookExecutors as J, commonArgs as Jt, listMachineUsers as K, apiCommand as Kt, remove as L, reconstructSnapshotFromMigrations as Lt, generate as M, getMigrationFilePath as Mt, generateCommand as N, getMigrationFiles as Nt, listCommand$3 as O, createSnapshotFromLocalTypes as Ot, logBetaWarning as P, getNextMigrationNumber as Pt, listCommand$6 as Q, workspaceArgs as Qt, removeCommand$1 as R, formatDiffSummary as Rt, listApps as S, DIFF_FILE_NAME as St, healthCommand as T, SCHEMA_FILE_NAME as Tt, getMachineUserToken as U, trnPrefix as Ut, getCommand$1 as V, getNamespacesWithMigrations as Vt, tokenCommand as W, generateUserTypes as Wt, triggerCommand as X, deploymentArgs as Xt, webhookCommand as Y, confirmationArgs as Yt, triggerExecutor as Z, isVerbose as Zt, getWorkspace as _, waitForExecution$1 as _t, updateUser as a, startWorkflow as at, createCommand as b, bundleMigrationScript as bt, listCommand as c, executionsCommand as ct, inviteUser as d, functionExecutionStatusToString as dt, getExecutorJob as et, restoreCommand as f, formatKeyValueTable as ft, getCommand as g, executeScript as gt, listWorkspaces as h, apply as ht, updateCommand as i, startCommand as it, truncateCommand as j, getMigrationDirPath as jt, listWorkflows as k, formatMigrationNumber as kt, listUsers as l, getWorkflowExecution as lt, listCommand$1 as m, getExecutor as mt, queryCommand as n, listExecutorJobs as nt, removeCommand as o, getCommand$2 as ot, restoreWorkspace as p, getCommand$3 as pt, generate$1 as q, defineAppCommand as qt, isCLIError as r, watchExecutorJob as rt, removeUser as s, getWorkflow as st, query as t, jobsCommand as tt, inviteCommand as u, listWorkflowExecutions as ut, deleteCommand as v, MIGRATION_LABEL_KEY as vt, getAppHealth as w, MIGRATE_FILE_NAME as wt, createWorkspace as x, DB_TYPES_FILE_NAME as xt, deleteWorkspace as y, parseMigrationLabelNumber as yt, listCommand$4 as z, formatMigrationDiff as zt };
12509
- //# sourceMappingURL=query-BpppEOzu.mjs.map
12508
+ //# sourceMappingURL=query-kb_4EQp4.mjs.map