@tailor-platform/sdk 1.76.2 → 1.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/application-BB6BlUfk.mjs +3 -0
  3. package/dist/{application-CqjCcZ2n.mjs → application-fjqb-Gh8.mjs} +57 -10
  4. package/dist/application-fjqb-Gh8.mjs.map +1 -0
  5. package/dist/cli/commands/deploy/deploy.d.mts +8 -3
  6. package/dist/cli/commands/show.d.mts +9 -3
  7. package/dist/cli/commands/workspace/create.d.mts +3 -0
  8. package/dist/cli/commands/workspace/list.d.mts +1 -0
  9. package/dist/cli/commands/workspace/transform.d.mts +2 -0
  10. package/dist/cli/index.mjs +47 -22
  11. package/dist/cli/index.mjs.map +1 -1
  12. package/dist/cli/lib.d.mts +2 -2
  13. package/dist/cli/lib.mjs +2 -2
  14. package/dist/cli/lib.mjs.map +1 -1
  15. package/dist/cli/shared/workspace-name.d.mts +1 -0
  16. package/dist/cli/skills.mjs +1 -1
  17. package/dist/completion/zsh-worker.zsh +18 -1
  18. package/dist/configure/index.mjs +202 -7
  19. package/dist/configure/index.mjs.map +1 -1
  20. package/dist/configure/services/idp/index.d.mts +1 -4
  21. package/dist/configure/services/tailordb/schema.d.mts +1 -7
  22. package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
  23. package/dist/configure/types/type.d.mts +1 -9
  24. package/dist/{crashreport-DZDr-TvH.mjs → crashreport-BNWUM6Kf.mjs} +2 -2
  25. package/dist/{crashreport-DZDr-TvH.mjs.map → crashreport-BNWUM6Kf.mjs.map} +1 -1
  26. package/dist/{crashreport-np4-_DX2.mjs → crashreport-BafWvjjX.mjs} +1 -1
  27. package/dist/errors-DVFS0AZk.mjs +100 -0
  28. package/dist/errors-DVFS0AZk.mjs.map +1 -0
  29. package/dist/{globals-z6zYMjlr.mjs → globals-B-n_3uYu.mjs} +11 -5
  30. package/dist/globals-B-n_3uYu.mjs.map +1 -0
  31. package/dist/{logger-BEiZZ3qT.mjs → logger-BwS4ppwO.mjs} +3 -3
  32. package/dist/logger-BwS4ppwO.mjs.map +1 -0
  33. package/dist/{registry-CTgoVWc_.mjs → registry-CXi7rJq7.mjs} +4 -3
  34. package/dist/registry-CXi7rJq7.mjs.map +1 -0
  35. package/dist/runtime/field-parse.d.mts +11 -0
  36. package/dist/runtime/globals.d.mts +4 -1
  37. package/dist/runtime/index.mjs +1 -1
  38. package/dist/runtime/workflow.d.mts +79 -15
  39. package/dist/runtime/workflow.mjs +2 -2
  40. package/dist/{runtime-DlklyuHN.mjs → runtime-CjMeYuPA.mjs} +1169 -539
  41. package/dist/runtime-CjMeYuPA.mjs.map +1 -0
  42. package/dist/{schema-DbTR1c6M.mjs → schema-CYrle8JZ.mjs} +222 -4
  43. package/dist/schema-CYrle8JZ.mjs.map +1 -0
  44. package/dist/{secretmanager-Bd45j7an.mjs → secretmanager-IY4UvinW.mjs} +42 -9
  45. package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
  46. package/dist/service-CghpdV-9.mjs +3 -0
  47. package/dist/{service-DBFZQloR.mjs → service-Cp0I7ZFe.mjs} +3 -3
  48. package/dist/{service-DBFZQloR.mjs.map → service-Cp0I7ZFe.mjs.map} +1 -1
  49. package/dist/{service-BCRJ-3NV.mjs → service-D12iQGcS.mjs} +2 -2
  50. package/dist/{service-BCRJ-3NV.mjs.map → service-D12iQGcS.mjs.map} +1 -1
  51. package/dist/{test-env-key-IPapa1KJ.mjs → test-env-key-DuZycyWM.mjs} +2 -2
  52. package/dist/{test-env-key-IPapa1KJ.mjs.map → test-env-key-DuZycyWM.mjs.map} +1 -1
  53. package/dist/types/auth.generated.d.mts +9 -36
  54. package/dist/types/executor.generated.d.mts +19 -59
  55. package/dist/types/idp.generated.d.mts +518 -517
  56. package/dist/types/resolver.generated.d.mts +6 -2
  57. package/dist/types/tailordb.generated.d.mts +8 -7
  58. package/dist/utils/test/index.mjs +1 -1
  59. package/dist/vitest/environment.mjs +1 -1
  60. package/dist/vitest/index.d.mts +8 -8
  61. package/dist/vitest/index.mjs +635 -195
  62. package/dist/vitest/index.mjs.map +1 -1
  63. package/dist/vitest/mock.d.mts +8 -8
  64. package/dist/vitest/mocks/aigateway.d.mts +14 -4
  65. package/dist/vitest/mocks/authconnection.d.mts +14 -4
  66. package/dist/vitest/mocks/file.d.mts +24 -6
  67. package/dist/vitest/mocks/iconv.d.mts +28 -4
  68. package/dist/vitest/mocks/idp.d.mts +25 -9
  69. package/dist/vitest/mocks/secretmanager.d.mts +13 -4
  70. package/dist/vitest/mocks/tailordb.d.mts +48 -7
  71. package/dist/vitest/mocks/workflow.d.mts +68 -22
  72. package/dist/vitest/setup.mjs +2 -2
  73. package/dist/workflow-CkIDJpdg.mjs +69 -0
  74. package/dist/workflow-CkIDJpdg.mjs.map +1 -0
  75. package/docs/cli/application.md +58 -11
  76. package/docs/cli/setup.md +1 -1
  77. package/docs/cli/workspace.md +6 -4
  78. package/docs/cli-reference.md +12 -8
  79. package/docs/runtime.md +5 -6
  80. package/docs/services/aigateway.md +2 -0
  81. package/docs/services/tailordb.md +44 -0
  82. package/docs/services/workflow.md +3 -3
  83. package/docs/testing.md +105 -91
  84. package/package.json +7 -7
  85. package/dist/application-6zsDLGKv.mjs +0 -3
  86. package/dist/application-CqjCcZ2n.mjs.map +0 -1
  87. package/dist/configure/types/field-runtime.d.mts +0 -17
  88. package/dist/errors-Dtf2WPaW.mjs +0 -42
  89. package/dist/errors-Dtf2WPaW.mjs.map +0 -1
  90. package/dist/field-runtime-D4QWRiB1.mjs +0 -203
  91. package/dist/field-runtime-D4QWRiB1.mjs.map +0 -1
  92. package/dist/globals-z6zYMjlr.mjs.map +0 -1
  93. package/dist/logger-BEiZZ3qT.mjs.map +0 -1
  94. package/dist/registry-CTgoVWc_.mjs.map +0 -1
  95. package/dist/runtime-DlklyuHN.mjs.map +0 -1
  96. package/dist/schema-DbTR1c6M.mjs.map +0 -1
  97. package/dist/secretmanager-Bd45j7an.mjs.map +0 -1
  98. package/dist/service-CPMlIg3X.mjs +0 -3
  99. package/dist/types-BzJ7A_fn.mjs +0 -199
  100. package/dist/types-BzJ7A_fn.mjs.map +0 -1
  101. package/dist/types-CG9H7HuE.mjs +0 -4
  102. package/dist/workflow-DSwnYPPP.mjs +0 -45
  103. package/dist/workflow-DSwnYPPP.mjs.map +0 -1
@@ -20,7 +20,7 @@ import { kyselyTypePlugin } from "../plugin/builtin/kysely-type/index.mjs";
20
20
  import { enumConstantsPlugin } from "../plugin/builtin/enum-constants/index.mjs";
21
21
  import { fileUtilsPlugin } from "../plugin/builtin/file-utils/index.mjs";
22
22
  import { seedPlugin } from "../plugin/builtin/seed/index.mjs";
23
- import { ApplicationInfo, ShowOptions, show } from "./commands/show.mjs";
23
+ import { AIGatewayInfo, ApplicationInfo, ShowInfo, ShowOptions, show } from "./commands/show.mjs";
24
24
  import { RemoveOptions, remove } from "./commands/remove.mjs";
25
25
  import { WorkspaceDetails, WorkspaceInfo } from "./commands/workspace/transform.mjs";
26
26
  import { CreateWorkspaceOptions, createWorkspace } from "./commands/workspace/create.mjs";
@@ -79,4 +79,4 @@ import { ChunkSeedDataOptions, SeedChunk, chunkSeedData } from "./shared/seed-ch
79
79
  import { SeedBundleResult, bundleSeedScript } from "./commands/generate/seed/bundler.mjs";
80
80
  import { MigrationBundleResult, bundleMigrationScript } from "./commands/tailordb/migrate/bundler.mjs";
81
81
  import { ExecutionWaitResult, ScriptExecutionOptions, ScriptExecutionResult, executeScript, waitForExecution } from "./shared/script-executor.mjs";
82
- export { type AggregateArgs, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, 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 DeployOptions, 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 NamespaceWithMigrations, type NormalizedSchemaSnapshot, 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 WaitWorkflowExecutionOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowExecutionWaitInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkflowWaitOutput, type WorkflowWaitResult, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deploy, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, 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, waitWorkflowExecution, watchExecutorJob };
82
+ export { type AIGatewayInfo, type AggregateArgs, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, 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 DeployOptions, 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 NamespaceWithMigrations, type NormalizedSchemaSnapshot, 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 ShowInfo, 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 WaitWorkflowExecutionOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowExecutionWaitInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkflowWaitOutput, type WorkflowWaitResult, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deploy, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, 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, waitWorkflowExecution, watchExecutorJob };
package/dist/cli/lib.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
2
- import { $ as getOrganization, An as apiCall, At as getExecutorWaitFailureMessage, B as show, Bt as listWorkflowExecutions, Cn as hasChanges, Ct as listWebhookExecutors, D as waitWorkflowExecution, Et as triggerExecutor, Ft as startWorkflow, Gt as deploy, J as organizationTree, Jt as waitForExecution, Ln as loadAccessToken, Lt as getWorkflow, M as truncate, Mn as loadConfig, Mt as listExecutorJobs, Nt as watchExecutorJob, On as generateUserTypes, Ot as listExecutors, P as generate$1, S as listApps, Sn as formatMigrationDiff, St as getFunctionRegistry, Vn as loadWorkspaceId, W as remove, Wt as getExecutor, Xt as MIGRATION_LABEL_KEY, Yt as bundleMigrationScript, Z as listOrganizations, _ as getWorkspace, _t as listMachineUsers, a as updateUser, an as MIGRATE_FILE_NAME, at as getFolder, bt as listFunctionRegistries, cn as compareLocalTypesWithSnapshot, d as inviteUser, dn as getLatestMigrationNumber, dt as listOAuth2Clients, fn as getMigrationDirPath, h as listWorkspaces, hn as getNextMigrationNumber, in as INITIAL_SCHEMA_NUMBER, j as listWorkflows, k as resumeWorkflow, kt as getExecutorJob, l as listUsers, ln as compareSnapshots, lt as createFolder, mn as getMigrationFiles, mt as getMachineUserToken, n as query, nn as DB_TYPES_FILE_NAME, on as SCHEMA_FILE_NAME, p as restoreWorkspace, pn as getMigrationFilePath, pt as getOAuth2Client, q as updateOrganization, qt as executeScript, rn as DIFF_FILE_NAME, rt as listFolders, s as removeUser, st as deleteFolder, t as isNativeTypeScriptRuntime, tt as updateFolder, un as createSnapshotFromLocalTypes, vn as reconstructSnapshotFromMigrations, vt as generate, w as getAppHealth, wn as getNamespacesWithMigrations, x as createWorkspace, xn as formatDiffSummary, y as deleteWorkspace, zt as getWorkflowExecution } from "../runtime-DlklyuHN.mjs";
3
- import { B as initOperatorClient, _ as platformBundleDefinePlugin, w as getDistDir } from "../application-CqjCcZ2n.mjs";
2
+ import { $ as listFolders, A as generate$1, An as generateUserTypes, B as remove, Bt as deploy, C as waitWorkflowExecution, Cn as formatDiffSummary, D as listWorkflows, En as getNamespacesWithMigrations, Et as getExecutorWaitFailureMessage, Ft as getWorkflowExecution, Gt as createWorkspace, I as show, It as listWorkflowExecutions, Mn as apiCall, Nt as getWorkflow, O as truncate, Ot as listExecutorJobs, Pn as loadConfig, Qt as MIGRATION_LABEL_KEY, St as triggerExecutor, T as resumeWorkflow, Tn as hasChanges, Tt as getExecutorJob, U as updateOrganization, Un as loadWorkspaceId, Ut as listWorkspaces, W as organizationTree, Xt as waitForExecution, Y as getOrganization, Yt as executeScript, Z as updateFolder, Zt as bundleMigrationScript, _ as deleteWorkspace, _n as getNextMigrationNumber, a as updateUser, an as DIFF_FILE_NAME, at as createFolder, b as getAppHealth, bn as reconstructSnapshotFromMigrations, cn as SCHEMA_FILE_NAME, d as inviteUser, dn as compareSnapshots, fn as createSnapshotFromLocalTypes, gn as getMigrationFiles, gt as listFunctionRegistries, h as getWorkspace, hn as getMigrationFilePath, in as DB_TYPES_FILE_NAME, jt as startWorkflow, kt as watchExecutorJob, l as listUsers, lt as getOAuth2Client, mn as getMigrationDirPath, mt as generate, n as query, on as INITIAL_SCHEMA_NUMBER, p as restoreWorkspace, pn as getLatestMigrationNumber, pt as listMachineUsers, q as listOrganizations, rt as deleteFolder, s as removeUser, sn as MIGRATE_FILE_NAME, st as listOAuth2Clients, t as isNativeTypeScriptRuntime, tt as getFolder, un as compareLocalTypesWithSnapshot, ut as getMachineUserToken, v as listApps, vt as getFunctionRegistry, wn as formatMigrationDiff, wt as listExecutors, yt as listWebhookExecutors, zn as loadAccessToken, zt as getExecutor } from "../runtime-CjMeYuPA.mjs";
3
+ import { B as initOperatorClient, _ as platformBundleDefinePlugin, w as getDistDir } from "../application-fjqb-Gh8.mjs";
4
4
  import { n as enumConstantsPlugin } from "../enum-constants-j9QBF0cB.mjs";
5
5
  import { t as multiline } from "../multiline-sfHpTZZK.mjs";
6
6
  import { n as fileUtilsPlugin } from "../file-utils-DcyIPFQh.mjs";
@@ -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 \"#/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/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/enum-constants' instead */\nexport { enumConstantsPlugin } from \"#/plugin/builtin/enum-constants/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/file-utils' instead */\nexport { fileUtilsPlugin } from \"#/plugin/builtin/file-utils/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/seed' instead */\nexport { seedPlugin } from \"#/plugin/builtin/seed/index\";\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 type WorkflowExecutionWaitInfo,\n} from \"./commands/workflow/executions\";\nexport { waitWorkflowExecution, type WorkflowWaitOutput } from \"./commands/workflow/wait\";\nexport type { WaitWorkflowExecutionOptions, WorkflowWaitResult } from \"./commands/workflow/waiter\";\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 getExecutorWaitFailureMessage,\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 NormalizedSchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\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-platform/tailor-proto/auth_resource_pb\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,2BAA2B,MAAM,OAAO;;AAGrD,MAAM,oBAAoB;;;;;;;;;;;;;;;AAgB1B,SAAgB,cAAc,SAA4C;CACxE,MAAM,EAAE,MAAM,OAAO,cAAc,iBAAiB,6BAA6B;CAEjF,MAAM,YAAY,iBAAiB,eAAe;CAClD,IAAI,aAAa,GACf,MAAM,IAAI,MACR,cAAc,aAAa,0CAA0C,eAAe,sCAEtF;CAIF,MAAM,gBAAgB,MAAM,QAAQ,UAAU,KAAK,KAAK,EAAE,UAAU,KAAK,CAAC;CAE1E,IAAI,cAAc,WAAW,GAC3B,OAAO,CAAC;CAKV,IAAI,SADY,KAAK,UAAU;EAAE;EAAM;CAAM,CAC1B,CAAC,KAAK,WACvB,OAAO,CAAC;EAAE;EAAM;EAAO,OAAO;EAAG,OAAO;CAAE,CAAC;CAI7C,MAAM,SAAqC,CAAC;CAC5C,IAAI,cAAwB,CAAC;CAC7B,IAAI,eAAyB,CAAC;CAE9B,KAAK,MAAM,QAAQ,eAAe;EAChC,MAAM,cAAc,cAAc,KAAK,OAAO,+BAA+B,MAAM;EAGnF,IAAI,aAAa,SAAS,GAAG;GAC3B,MAAM,WAAW;IAAE,GAAG;KAAc,OAAO;GAAY;GACvD,MAAM,YAAY,CAAC,GAAG,cAAc,IAAI;GACxC,IAAI,SAAS,KAAK,UAAU;IAAE,MAAM;IAAU,OAAO;GAAU,CAAC,CAAC,IAAI,WAAW;IAE9E,OAAO,KAAK;KAAE,MAAM;KAAa,OAAO;KAAc,OAAO,OAAO;IAAO,CAAC;IAC5E,cAAc,CAAC;IACf,eAAe,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A0B;GAC5B;GACA,UAAU;EACZ,CAA0B,EAEA,CAAC,OAAO,EAAE,CAAC;EAKnC,eAAe;CACjB;AACF;;;;AC/JA,IAAI,CAAC,0BAA0B,GAAG;CAChC,MAAM,EAAE,aAAa,MAAM,OAAO;CAClC,SAAS;AACX"}
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 \"#/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/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/enum-constants' instead */\nexport { enumConstantsPlugin } from \"#/plugin/builtin/enum-constants/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/file-utils' instead */\nexport { fileUtilsPlugin } from \"#/plugin/builtin/file-utils/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/seed' instead */\nexport { seedPlugin } from \"#/plugin/builtin/seed/index\";\n\nexport {\n show,\n type ShowOptions,\n type ApplicationInfo,\n type ShowInfo,\n type AIGatewayInfo,\n} 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 type WorkflowExecutionWaitInfo,\n} from \"./commands/workflow/executions\";\nexport { waitWorkflowExecution, type WorkflowWaitOutput } from \"./commands/workflow/wait\";\nexport type { WaitWorkflowExecutionOptions, WorkflowWaitResult } from \"./commands/workflow/waiter\";\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 getExecutorWaitFailureMessage,\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 NormalizedSchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\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\";\n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AAO;CAClC,SAAS;AACX"}
@@ -0,0 +1 @@
1
+ import { z } from "zod";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as logger } from "../logger-BEiZZ3qT.mjs";
2
+ import { n as logger } from "../logger-BwS4ppwO.mjs";
3
3
  import { dirname, resolve } from "pathe";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { spawn } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  # politty-completion-version: 1
2
- # politty-bin-sig: 1783991997
2
+ # politty-bin-sig: 1784179615
3
3
  # politty-bin-path: /home/runner/work/sdk/sdk/node_modules/.bin/tailor-sdk
4
4
  # program: tailor-sdk
5
5
  # shell: zsh
@@ -544,9 +544,17 @@ __tailor_sdk_worker_opt_takes_value() {
544
544
  deploy:--workspace-id|deploy:--workspaceId|deploy:-w|deploy:--w) return 0 ;;
545
545
  deploy:--profile|deploy:-p|deploy:--p) return 0 ;;
546
546
  deploy:--config|deploy:-c|deploy:--c) return 0 ;;
547
+ deploy:--workspace-name|deploy:--workspaceName) return 0 ;;
548
+ deploy:--workspace-region|deploy:--workspaceRegion) return 0 ;;
549
+ deploy:--organization-id|deploy:--organizationId) return 0 ;;
550
+ deploy:--folder-id|deploy:--folderId) return 0 ;;
547
551
  apply:--workspace-id|apply:--workspaceId|apply:-w|apply:--w) return 0 ;;
548
552
  apply:--profile|apply:-p|apply:--p) return 0 ;;
549
553
  apply:--config|apply:-c|apply:--c) return 0 ;;
554
+ apply:--workspace-name|apply:--workspaceName) return 0 ;;
555
+ apply:--workspace-region|apply:--workspaceRegion) return 0 ;;
556
+ apply:--organization-id|apply:--organizationId) return 0 ;;
557
+ apply:--folder-id|apply:--folderId) return 0 ;;
550
558
  executor:trigger:--workspace-id|executor:trigger:--workspaceId|executor:trigger:-w|executor:trigger:--w) return 0 ;;
551
559
  executor:trigger:--profile|executor:trigger:-p|executor:trigger:--p) return 0 ;;
552
560
  executor:trigger:--data|executor:trigger:-d|executor:trigger:--d) return 0 ;;
@@ -809,6 +817,7 @@ __tailor_sdk_worker_opt_takes_value() {
809
817
  workspace:create:--organization-id|workspace:create:--organizationId|workspace:create:-o|workspace:create:--o) return 0 ;;
810
818
  workspace:create:--folder-id|workspace:create:--folderId|workspace:create:-f|workspace:create:--f) return 0 ;;
811
819
  workspace:create:--profile-name|workspace:create:--profileName|workspace:create:-p|workspace:create:--p) return 0 ;;
820
+ workspace:create:--profile) return 0 ;;
812
821
  workspace:create:--profile-user|workspace:create:--profileUser) return 0 ;;
813
822
  workspace:create:--permission) return 0 ;;
814
823
  workspace:delete:--workspace-id|workspace:delete:--workspaceId|workspace:delete:-w|workspace:delete:--w) return 0 ;;
@@ -816,6 +825,7 @@ __tailor_sdk_worker_opt_takes_value() {
816
825
  workspace:get:--profile|workspace:get:-p|workspace:get:--p) return 0 ;;
817
826
  workspace:list:--order) return 0 ;;
818
827
  workspace:list:--limit|workspace:list:-l|workspace:list:--l) return 0 ;;
828
+ workspace:list:--profile) return 0 ;;
819
829
  workspace:restore:--workspace-id|workspace:restore:--workspaceId|workspace:restore:-w|workspace:restore:--w) return 0 ;;
820
830
  workspace:user:invite:--workspace-id|workspace:user:invite:--workspaceId|workspace:user:invite:-w|workspace:user:invite:--w) return 0 ;;
821
831
  workspace:user:invite:--profile|workspace:user:invite:-p|workspace:user:invite:--p) return 0 ;;
@@ -1351,6 +1361,11 @@ __tailor_sdk_worker_complete_deploy() {
1351
1361
  __tailor_sdk_worker_not_used "--profile" "-p" "--p" && _opts+=("--profile:Workspace profile")
1352
1362
  __tailor_sdk_worker_not_used "--config" "-c" "--c" && _opts+=("--config:Path to SDK config file. Use comma-separated paths to deploy multiple apps together.")
1353
1363
  __tailor_sdk_worker_not_used "--yes" "-y" "--y" && _opts+=("--yes:Skip confirmation prompts")
1364
+ __tailor_sdk_worker_not_used "--create-workspace" "--createWorkspace" && _opts+=("--create-workspace:Create a workspace when the account has none")
1365
+ __tailor_sdk_worker_not_used "--workspace-name" "--workspaceName" && _opts+=("--workspace-name:Name for a workspace created during deploy")
1366
+ __tailor_sdk_worker_not_used "--workspace-region" "--workspaceRegion" && _opts+=("--workspace-region:Region for a workspace created during deploy")
1367
+ __tailor_sdk_worker_not_used "--organization-id" "--organizationId" && _opts+=("--organization-id:Organization ID for a workspace created during deploy")
1368
+ __tailor_sdk_worker_not_used "--folder-id" "--folderId" && _opts+=("--folder-id:Folder ID for a workspace created during deploy")
1354
1369
  __tailor_sdk_worker_not_used "--dry-run" "--dryRun" "-d" "--d" && _opts+=("--dry-run:Run the command without making any changes")
1355
1370
  __tailor_sdk_worker_not_used "--no-schema-check" "--noSchemaCheck" && _opts+=("--no-schema-check:Skip schema diff check against migration snapshots")
1356
1371
  __tailor_sdk_worker_not_used "--no-validate" "--noValidate" && _opts+=("--no-validate:Skip client-side validation against platform resource constraints")
@@ -3994,6 +4009,7 @@ __tailor_sdk_worker_complete_workspace_create() {
3994
4009
  __tailor_sdk_worker_not_used "--organization-id" "--organizationId" "-o" "--o" && _opts+=("--organization-id:Organization ID to workspace associate with")
3995
4010
  __tailor_sdk_worker_not_used "--folder-id" "--folderId" "-f" "--f" && _opts+=("--folder-id:Folder ID to workspace associate with")
3996
4011
  __tailor_sdk_worker_not_used "--profile-name" "--profileName" "-p" "--p" && _opts+=("--profile-name:Profile name to create")
4012
+ __tailor_sdk_worker_not_used "--profile" && _opts+=("--profile:Workspace profile used for authentication and Platform selection")
3997
4013
  __tailor_sdk_worker_not_used "--profile-user" "--profileUser" && _opts+=("--profile-user:User email for the profile (defaults to current user)")
3998
4014
  __tailor_sdk_worker_not_used "--permission" && _opts+=("--permission:Profile permission (requires --profile-name). 'read' blocks all write commands while the profile is active.")
3999
4015
  __tailor_sdk_worker_not_used "--help" && _opts+=("--help:Show help")
@@ -4044,6 +4060,7 @@ __tailor_sdk_worker_complete_workspace_list() {
4044
4060
  local -a _opts=()
4045
4061
  __tailor_sdk_worker_not_used "--order" && _opts+=("--order:Sort order (asc or desc)")
4046
4062
  __tailor_sdk_worker_not_used "--limit" "-l" "--l" && _opts+=("--limit:Maximum number of items to return (0 or omit\: unlimited)")
4063
+ __tailor_sdk_worker_not_used "--profile" && _opts+=("--profile:Workspace profile used for authentication and Platform selection")
4047
4064
  __tailor_sdk_worker_not_used "--help" && _opts+=("--help:Show help")
4048
4065
  __tailor_sdk_worker_cdescribe 'options' _opts
4049
4066
  return 0
@@ -1,9 +1,202 @@
1
- import { t as t$1 } from "../types-BzJ7A_fn.mjs";
1
+ import { i as parseInternal, n as mapAllowedValues, t as db } from "../schema-CYrle8JZ.mjs";
2
2
  import { t as brandValue } from "../brand-Eo4pLXPJ.mjs";
3
- import { t as db } from "../schema-DbTR1c6M.mjs";
4
- import { n as dispatchTriggerJob, o as registerJob, r as dispatchTriggerWorkflow, s as registerWorkflow } from "../registry-CTgoVWc_.mjs";
5
- import { t as WORKFLOW_TEST_ENV_KEY } from "../test-env-key-IPapa1KJ.mjs";
3
+ import { n as dispatchTriggerJob, o as registerJob, r as dispatchTriggerWorkflow, s as registerWorkflow } from "../registry-CXi7rJq7.mjs";
4
+ import { t as WORKFLOW_TEST_ENV_KEY } from "../test-env-key-DuZycyWM.mjs";
6
5
 
6
+ //#region src/configure/types/type.ts
7
+ function createTailorField(type, options, fields, values, metadata) {
8
+ const _metadata = metadata ? {
9
+ ...metadata,
10
+ ...metadata.allowedValues && { allowedValues: metadata.allowedValues.map((v) => ({ ...v })) },
11
+ ...metadata.validate && { validate: metadata.validate.map((v) => Array.isArray(v) ? [...v] : v) }
12
+ } : { required: true };
13
+ if (!metadata) {
14
+ if (options) {
15
+ if (options.optional === true) _metadata.required = false;
16
+ if (options.array === true) _metadata.array = true;
17
+ }
18
+ if (values) _metadata.allowedValues = mapAllowedValues(values);
19
+ }
20
+ function parseInternal$1(args) {
21
+ return parseInternal({
22
+ ...args,
23
+ field
24
+ });
25
+ }
26
+ /**
27
+ * Clone the field and apply metadata updates to the clone.
28
+ * The original instance is never mutated, so a field shared across places
29
+ * cannot leak metadata between them.
30
+ * @param metadataUpdates - Metadata properties to overwrite on the clone
31
+ * @returns A new field with the updated metadata
32
+ */
33
+ function cloneWith(metadataUpdates) {
34
+ const cloned = field.clone();
35
+ Object.assign(cloned._metadata, metadataUpdates);
36
+ return cloned;
37
+ }
38
+ const field = {
39
+ type,
40
+ fields: fields ?? {},
41
+ _defined: void 0,
42
+ _output: void 0,
43
+ _metadata,
44
+ get metadata() {
45
+ return { ...this._metadata };
46
+ },
47
+ description(description) {
48
+ return cloneWith({ description });
49
+ },
50
+ typeName(typeName) {
51
+ return cloneWith({ typeName });
52
+ },
53
+ validate(...validateInputs) {
54
+ return cloneWith({ validate: validateInputs });
55
+ },
56
+ parse(args) {
57
+ return parseInternal$1({
58
+ value: args.value,
59
+ data: args.data,
60
+ user: args.user,
61
+ pathArray: []
62
+ });
63
+ },
64
+ clone() {
65
+ let clonedFields = fields;
66
+ if (fields) {
67
+ const cloned = {};
68
+ for (const [key, nestedField] of Object.entries(fields)) cloned[key] = nestedField.clone();
69
+ clonedFields = cloned;
70
+ }
71
+ return createTailorField(type, options, clonedFields, values, this._metadata);
72
+ }
73
+ };
74
+ return field;
75
+ }
76
+ /**
77
+ * Create a UUID field for resolver input/output.
78
+ * @param options - Field configuration options
79
+ * @returns A UUID field
80
+ * @example t.uuid()
81
+ */
82
+ function uuid(options) {
83
+ return createTailorField("uuid", options);
84
+ }
85
+ /**
86
+ * Create a string field for resolver input/output.
87
+ * @param options - Field configuration options
88
+ * @returns A string field
89
+ * @example t.string()
90
+ * @example t.string({ optional: true })
91
+ * @example t.string({ array: true })
92
+ */
93
+ function string(options) {
94
+ return createTailorField("string", options);
95
+ }
96
+ /**
97
+ * Create a boolean field for resolver input/output.
98
+ * @param options - Field configuration options
99
+ * @returns A boolean field
100
+ * @example t.bool()
101
+ */
102
+ function bool(options) {
103
+ return createTailorField("boolean", options);
104
+ }
105
+ /**
106
+ * Create an integer field for resolver input/output.
107
+ * @param options - Field configuration options
108
+ * @returns An integer field
109
+ * @example t.int()
110
+ */
111
+ function int(options) {
112
+ return createTailorField("integer", options);
113
+ }
114
+ /**
115
+ * Create a float field for resolver input/output.
116
+ * @param options - Field configuration options
117
+ * @returns A float field
118
+ * @example t.float()
119
+ */
120
+ function float(options) {
121
+ return createTailorField("float", options);
122
+ }
123
+ /**
124
+ * Create a decimal field for resolver input/output (stored as string for precision).
125
+ * @param options - Field configuration options
126
+ * @returns A decimal field
127
+ * @example t.decimal()
128
+ * @example t.decimal({ optional: true })
129
+ */
130
+ function decimal(options) {
131
+ return createTailorField("decimal", options);
132
+ }
133
+ /**
134
+ * Create a date field for resolver input/output.
135
+ * @param options - Field configuration options
136
+ * @returns A date field
137
+ * @example t.date()
138
+ */
139
+ function date(options) {
140
+ return createTailorField("date", options);
141
+ }
142
+ /**
143
+ * Create a datetime field for resolver input/output.
144
+ * @param options - Field configuration options
145
+ * @returns A datetime field
146
+ * @example t.datetime()
147
+ */
148
+ function datetime(options) {
149
+ return createTailorField("datetime", options);
150
+ }
151
+ /**
152
+ * Create a time field for resolver input/output.
153
+ * @param options - Field configuration options
154
+ * @returns A time field
155
+ * @example t.time()
156
+ */
157
+ function time(options) {
158
+ return createTailorField("time", options);
159
+ }
160
+ /**
161
+ * Create an enum field for resolver input/output.
162
+ * @param values - Array of allowed string values
163
+ * @param options - Field configuration options
164
+ * @returns An enum field
165
+ * @example t.enum(["active", "inactive"])
166
+ */
167
+ function _enum(values, options) {
168
+ return createTailorField("enum", options, void 0, values);
169
+ }
170
+ /**
171
+ * Create a nested object field for resolver input/output.
172
+ * @param fields - Record of field definitions
173
+ * @param options - Field options (optional, array)
174
+ * @returns A nested object field
175
+ * @example
176
+ * // Single object:
177
+ * output: t.object({ name: t.string(), email: t.string() })
178
+ * @example
179
+ * // Array of objects:
180
+ * items: t.object({ name: t.string() }, { array: true })
181
+ */
182
+ function object(fields, options) {
183
+ return createTailorField("nested", options, fields);
184
+ }
185
+ const t$1 = {
186
+ uuid,
187
+ string,
188
+ bool,
189
+ int,
190
+ float,
191
+ decimal,
192
+ date,
193
+ datetime,
194
+ time,
195
+ enum: _enum,
196
+ object
197
+ };
198
+
199
+ //#endregion
7
200
  //#region src/configure/user.ts
8
201
  /** Represents an unauthenticated user in the Tailor platform. */
9
202
  const unauthenticatedTailorUser = {
@@ -448,10 +641,10 @@ function defineWorkflowExecutionPolicy(name, def) {
448
641
  * }));
449
642
  *
450
643
  * // In a workflow job function:
451
- * await tailor.workflow.triggerJobFunction("worker", args, {
644
+ * await tailor.workflow.startJobFunction("worker", args, {
452
645
  * executionPolicyKey: executionPolicies.premium.key,
453
646
  * });
454
- * await tailor.workflow.triggerJobFunction("worker", args, {
647
+ * await tailor.workflow.startJobFunction("worker", args, {
455
648
  * executionPolicyKey: executionPolicies["tenant-api"].keyFor(input.tenantId),
456
649
  * });
457
650
  */
@@ -643,7 +836,9 @@ function createWorkflow(config) {
643
836
  ...config,
644
837
  trigger: process.env.TAILOR_PLATFORM_BUNDLE ? async () => {
645
838
  throw new Error("workflow.trigger() is rewritten at build time and unavailable in the bundle");
646
- } : async (args, options) => await dispatchTriggerWorkflow(config.name, args, options)
839
+ } : async function trigger(args, options) {
840
+ return arguments.length >= 2 ? await dispatchTriggerWorkflow(config.name, args, options) : await dispatchTriggerWorkflow(config.name, args);
841
+ }
647
842
  }, "workflow");
648
843
  }
649
844