@tailor-platform/sdk 2.25.0 → 2.26.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 (33) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +4 -1
  3. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +6 -0
  4. package/dist/cli/lib.mjs +1 -1
  5. package/dist/cli/lib.mjs.map +1 -1
  6. package/dist/cli/main.mjs +46 -46
  7. package/dist/cli/main.mjs.map +1 -1
  8. package/dist/completion/zsh-worker.zsh +1 -1
  9. package/dist/kysely/index.d.mts +47 -15
  10. package/dist/kysely/index.mjs +1 -1
  11. package/dist/kysely/index.mjs.map +1 -1
  12. package/dist/kysely-type-RDX59E1j.mjs +48 -0
  13. package/dist/kysely-type-RDX59E1j.mjs.map +1 -0
  14. package/dist/plugin/builtin/kysely-type/index.d.mts +11 -0
  15. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  16. package/dist/{register-ts-hook-DPAW0Z4M.mjs → register-ts-hook-BuwkLuxC.mjs} +87 -86
  17. package/dist/register-ts-hook-BuwkLuxC.mjs.map +1 -0
  18. package/dist/runtime/index.d.mts +8 -0
  19. package/dist/vitest/index.d.mts +3 -2
  20. package/dist/vitest/index.mjs +1 -1
  21. package/dist/vitest/index.mjs.map +1 -1
  22. package/dist/vitest/mocks/tailordb-pglite.d.mts +1 -0
  23. package/dist/vitest/pglite-kysely.d.mts +14 -1
  24. package/dist/vitest/pglite-temporal.d.mts +9 -0
  25. package/docs/services/resolver.md +1 -1
  26. package/docs/services/tailordb-migration.md +4 -2
  27. package/docs/testing.md +2 -1
  28. package/package.json +1 -1
  29. package/dist/kysely-type-C-iyFFH7.mjs +0 -43
  30. package/dist/kysely-type-C-iyFFH7.mjs.map +0 -1
  31. package/dist/register-ts-hook-DPAW0Z4M.mjs.map +0 -1
  32. package/dist/tailordb-ddl-DqInYupv.mjs +0 -7
  33. package/dist/tailordb-ddl-DqInYupv.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 2.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2525](https://github.com/tailor-platform/sdk/pull/2525) [`d21806e`](https://github.com/tailor-platform/sdk/commit/d21806ed60bfd1c48eaf6be35102818206c59fbb) Thanks [@dqn](https://github.com/dqn)! - These state-changing commands now print a JSON result on stdout under `--json` instead of leaving it empty: `authconnection delete`, `authconnection revoke`, `organization folder delete`, `secret create`, `secret update`, `secret delete`, `secret vault delete`, `workspace delete`, `workspace restore`, `workspace user remove`, `tailordb truncate`, `tailordb migration set`, `tailordb migration rebaseline`, `tailordb migration sync`, and `tailordb migration generate`. Each result carries the same `changed` boolean as the other commands: for example, `tailordb migration set` to the checkpoint and migration history ID already in place, and `tailordb migration generate` with no migration to write, report `false`. Under `--json`, `tailordb migration generate` and `tailordb migration script` no longer open the file they create in the editor set by `VISUAL` or `EDITOR`, which would otherwise write to the same stdout. Output without `--json` is unchanged.
8
+
9
+ - [#2470](https://github.com/tailor-platform/sdk/pull/2470) [`090297d`](https://github.com/tailor-platform/sdk/commit/090297d2b1c2ba6c5615d0dfd4e1651ec598ec21) Thanks [@toiroakr](https://github.com/toiroakr)! - Add a `temporal` option to `kyselyTypePlugin`. When enabled, `date`/`datetime` fields and top-level `time` fields resolve to `Temporal.PlainDate`/`Temporal.Instant`/`Temporal.PlainTime` (instead of `Date`/`string`) in generated Kysely types, migration `db.ts` files, and `tailor function script` types, and the generated `getDB()` reads them back as those values. Nested `time` fields remain strings. The mode is fixed by the plugin setting; `getDB()` takes no `temporal` option.
10
+
11
+ Each migration records whether its `db.ts` was generated with Temporal types, and deploy runs that migration's script in the same mode, so migrations generated before `temporal` was enabled keep receiving `Date` values. Migration files are now written as format version 7, which older SDK versions refuse to read. `mockTailordbWithPGlite` and `createKyselyPGlite` (with `{ temporal: true }`) return Temporal values from PGlite to match, and accept Temporal values as query parameters.
12
+
3
13
  ## 2.25.0
4
14
 
5
15
  ### Minor Changes
@@ -22,7 +22,10 @@ export interface MigrationBundleResult {
22
22
  * @param {number} migrationNumber - Migration number
23
23
  * @param {Record<string, string | number | boolean>} env - Environment variables to inject into the migration context
24
24
  * @param {string} [baseDir] - Directory to resolve the bundler's tsconfig against; defaults to the migration script's directory
25
+ * @param {boolean} [temporal] - Whether `kyselyTypePlugin` was configured with `{ temporal: true }`; matches
26
+ * the `tailordb.Client` this script runs against to the Temporal column types its `db.ts` was generated with.
27
+ * Defaults to `false`.
25
28
  * @returns {Promise<MigrationBundleResult>} Bundled migration result
26
29
  */
27
- export declare function bundleMigrationScript(sourceFile: string, namespace: string, migrationNumber: number, env?: Record<string, string | number | boolean>, baseDir?: string): Promise<MigrationBundleResult>;
30
+ export declare function bundleMigrationScript(sourceFile: string, namespace: string, migrationNumber: number, env?: Record<string, string | number | boolean>, baseDir?: string, temporal?: boolean): Promise<MigrationBundleResult>;
28
31
  //#endregion
@@ -234,6 +234,12 @@ export interface MigrationDiff {
234
234
  requiresMigrationScript: boolean;
235
235
  /** Explicit acknowledgment that this migration needs no script despite breaking changes or data-loss warnings */
236
236
  scriptSkipped?: ScriptSkippedInfo;
237
+ /**
238
+ * Whether this migration's `db.ts` was generated with Temporal column types, so its
239
+ * script runs against a `tailordb.Client` created with `{ temporal: true }`. Absent
240
+ * means `false`.
241
+ */
242
+ temporal?: boolean;
237
243
  }
238
244
  /**
239
245
  * Acknowledgment that a migration requiring or recommending a script intentionally has none.
package/dist/cli/lib.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{at as ee}from"../application-DS0XKBtK.mjs";import{i as te,o as ne}from"../logger-Db-YRTwK.mjs";import{A as e,Ai as t,An as n,Ar as r,At as i,Bi as a,Bt as o,C as s,Cn as c,Cr as l,Dn as u,Dr as d,Dt as f,E as p,En as m,Et as h,F as g,Fi as _,Fn as v,G as y,Gt as b,H as x,Hr as S,Ht as C,I as w,Ii as T,It as E,J as D,Jr as O,L as k,Li as A,Ln as j,Lr as M,Mn as N,Mr as P,Mt as F,N as I,Nn as L,Nr as R,Nt as z,O as B,On as V,Ot as H,P as U,Pi as W,Pn as G,Q as K,Rt as q,Sr as J,U as Y,Ut as X,Vr as Z,Xt as re,Y as ie,Yi as ae,Yr as oe,Yt as se,_ as Q,_r as ce,br as le,bt as ue,ci as de,ct as fe,d as pe,en as me,et as he,ft as ge,h as _e,ht as ve,i as ye,ii as be,it as xe,j as Se,jn as Ce,jr as we,kn as Te,kr as Ee,l as De,li as Oe,ln as ke,mi as Ae,mr as je,mt as Me,n as Ne,nt as Pe,on as Fe,ot as Ie,p as Le,qr as Re,qt as ze,r as Be,s as Ve,si as He,sr as Ue,t as We,tn as $,tr as Ge,ut as Ke,vr as qe,vt as Je,wr as Ye,wt as Xe,x as Ze,xi as Qe,xr as $e,xt as et,y as tt,yr as nt,yt as rt,zt as it}from"../register-ts-hook-DPAW0Z4M.mjs";import{t as at}from"../type-source--ZNcV8RJ.mjs";import{arg as ot,defineCommand as st,runCommand as ct,runMain as lt}from"@politty/zod";await We(new URL(`./ts-hook.mjs`,import.meta.url));export{qe as DB_PGLITE_SCHEMA_FILE_NAME,nt as DB_TYPES_FILE_NAME,le as DIFF_FILE_NAME,$e as INITIAL_SCHEMA_NUMBER,J as MIGRATE_FILE_NAME,l as MIGRATE_PGLITE_TEST_FILE_NAME,Ye as MIGRATE_TEST_FILE_NAME,M as MIGRATION_LABEL_KEY,d as SCHEMA_FILE_NAME,m as TAILOR_LOCK_FILENAME,u as TAILOR_LOCK_VERSION,Ne as annotateTerminalError,He as apiCall,V as appIdLockKey,$ as apply,$ as deploy,ot as arg,de as assertWritable,Ge as bundleMigrationScript,g as bundleSeedDumpScript,w as bundleSeedScript,U as chunkSeedData,Z as compareLocalTypesWithSnapshot,S as compareSnapshots,W as configArg,_ as confirmationArgs,T as createCommonArgs,Ke as createFolder,je as createSnapshotFromLocalTypes,ke as createWorkspace,t as defineAppCommand,st as defineCommand,fe as deleteFolder,tt as deleteWorkspace,j as deployStaticWebsite,A as deploymentArgs,G as ensureConfigId,ue as errorToJson,f as executeScript,h as extractOwnedNamespaces,Te as findAppIdLock,Re as formatDiffSummary,O as formatMigrationDiff,rt as generate,v as generateUserTypes,s as getAppHealth,me as getExecutor,it as getExecutorJob,o as getExecutorWaitFailureMessage,Ie as getFolder,F as getFunctionRegistry,Ee as getLatestMigrationNumber,ve as getMachineUserToken,r as getMigrationDirPath,we as getMigrationFilePath,P as getMigrationFiles,Ue as getNamespacesWithMigrations,R as getNextMigrationNumber,Me as getOAuth2Client,he as getOrganization,ze as getWorkflow,se as getWorkflowExecution,Q as getWorkspace,oe as hasChanges,ee as initOperatorClient,Le as inviteUser,at as isPluginGeneratedTable,Ze as listApps,C as listExecutorJobs,q as listExecutors,xe as listFolders,i as listFunctionRegistries,Je as listMachineUsers,ge as listOAuth2Clients,K as listOrganizations,pe as listUsers,z as listWebhookExecutors,re as listWorkflowExecutions,e as listWorkflows,Fe as listWorkspaces,Ae as loadAccessToken,Oe as loadConfig,a as loadEnvFiles,I as loadSeedContext,Xe as loadTailorDBNamespaces,Qe as loadWorkspaceId,x as logBetaWarning,te as logger,k as migrateGenerate,ie as organizationTree,n as parseAppIds,Ce as planAppIds,be as prompt,ye as query,ce as reconstructSnapshotFromMigrations,y as remove,N as removeAdoptedConfigIds,De as removeUser,L as resolveAppId,_e as restoreWorkspace,B as resumeWorkflow,ct as runCommand,lt as runMain,et as serializeError,Y as show,b as startWorkflow,ne as styles,E as triggerExecutor,Se as truncate,Pe as updateFolder,D as updateOrganization,Ve as updateUser,H as waitForExecution,p as waitWorkflowExecution,X as watchExecutorJob,Be as withSourceLocation,ae as workspaceArgs,c as workspaceNameSchema};
1
+ import{at as ee}from"../application-DS0XKBtK.mjs";import{i as te,o as ne}from"../logger-Db-YRTwK.mjs";import{A as e,An as t,Ar as n,At as r,Br as i,Bt as a,C as o,Cn as s,Cr as c,Dn as l,Dr as u,Dt as d,E as f,En as p,Et as m,F as h,Fi as g,Fn as _,G as v,Gr as y,Gt as b,H as x,Ht as S,I as C,Ir as w,It as T,J as E,Kr as D,L as O,Ln as k,Mi as A,Mn as j,Mr as M,Mt as N,N as P,Ni as F,Nn as I,Nr as L,Nt as R,O as z,Oi as B,On as V,Ot as H,P as U,Pi as W,Pn as G,Q as K,Ri as q,Rt as J,Sr as Y,U as X,Ut as Z,Xt as re,Y as ie,Yt as ae,_ as oe,_r as se,ai as Q,br as ce,bt as le,ct as ue,d as de,en as fe,et as pe,fi as me,ft as he,h as ge,ht as _e,i as ve,it as ye,j as be,jn as xe,jr as Se,kn as Ce,kr as we,l as Te,ln as Ee,mr as De,mt as Oe,n as ke,ni as Ae,nt as je,oi as Me,on as Ne,ot as Pe,p as Fe,qi as Ie,qr as Le,qt as Re,r as ze,s as Be,si as Ve,sr as He,t as Ue,tn as $,tr as We,ut as Ge,vr as Ke,vt as qe,wr as Je,wt as Ye,x as Xe,xr as Ze,xt as Qe,y as $e,yi as et,yr as tt,yt as nt,zr as rt,zt as it}from"../register-ts-hook-BuwkLuxC.mjs";import{t as at}from"../type-source--ZNcV8RJ.mjs";import{arg as ot,defineCommand as st,runCommand as ct,runMain as lt}from"@politty/zod";await Ue(new URL(`./ts-hook.mjs`,import.meta.url));export{Ke as DB_PGLITE_SCHEMA_FILE_NAME,tt as DB_TYPES_FILE_NAME,ce as DIFF_FILE_NAME,Ze as INITIAL_SCHEMA_NUMBER,Y as MIGRATE_FILE_NAME,c as MIGRATE_PGLITE_TEST_FILE_NAME,Je as MIGRATE_TEST_FILE_NAME,w as MIGRATION_LABEL_KEY,u as SCHEMA_FILE_NAME,p as TAILOR_LOCK_FILENAME,l as TAILOR_LOCK_VERSION,ke as annotateTerminalError,Q as apiCall,V as appIdLockKey,$ as apply,$ as deploy,ot as arg,Me as assertWritable,We as bundleMigrationScript,h as bundleSeedDumpScript,C as bundleSeedScript,U as chunkSeedData,rt as compareLocalTypesWithSnapshot,i as compareSnapshots,A as configArg,F as confirmationArgs,W as createCommonArgs,Ge as createFolder,De as createSnapshotFromLocalTypes,Ee as createWorkspace,B as defineAppCommand,st as defineCommand,ue as deleteFolder,$e as deleteWorkspace,k as deployStaticWebsite,g as deploymentArgs,G as ensureConfigId,le as errorToJson,d as executeScript,m as extractOwnedNamespaces,Ce as findAppIdLock,y as formatDiffSummary,D as formatMigrationDiff,nt as generate,_ as generateUserTypes,o as getAppHealth,fe as getExecutor,it as getExecutorJob,a as getExecutorWaitFailureMessage,Pe as getFolder,N as getFunctionRegistry,we as getLatestMigrationNumber,_e as getMachineUserToken,n as getMigrationDirPath,Se as getMigrationFilePath,M as getMigrationFiles,He as getNamespacesWithMigrations,L as getNextMigrationNumber,Oe as getOAuth2Client,pe as getOrganization,Re as getWorkflow,ae as getWorkflowExecution,oe as getWorkspace,Le as hasChanges,ee as initOperatorClient,Fe as inviteUser,at as isPluginGeneratedTable,Xe as listApps,S as listExecutorJobs,J as listExecutors,ye as listFolders,r as listFunctionRegistries,qe as listMachineUsers,he as listOAuth2Clients,K as listOrganizations,de as listUsers,R as listWebhookExecutors,re as listWorkflowExecutions,e as listWorkflows,Ne as listWorkspaces,me as loadAccessToken,Ve as loadConfig,q as loadEnvFiles,P as loadSeedContext,Ye as loadTailorDBNamespaces,et as loadWorkspaceId,x as logBetaWarning,te as logger,O as migrateGenerate,ie as organizationTree,t as parseAppIds,xe as planAppIds,Ae as prompt,ve as query,se as reconstructSnapshotFromMigrations,v as remove,j as removeAdoptedConfigIds,Te as removeUser,I as resolveAppId,ge as restoreWorkspace,z as resumeWorkflow,ct as runCommand,lt as runMain,Qe as serializeError,X as show,b as startWorkflow,ne as styles,T as triggerExecutor,be as truncate,je as updateFolder,E as updateOrganization,Be as updateUser,H as waitForExecution,f as waitWorkflowExecution,Z as watchExecutorJob,ze as withSourceLocation,Ie as workspaceArgs,s as workspaceNameSchema};
2
2
  //# sourceMappingURL=lib.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"lib.mjs","names":["initOperatorClient","logger","styles","listWorkflows","defineAppCommand","parseAppIds","getMigrationDirPath","listFunctionRegistries","loadEnvFiles","getExecutorWaitFailureMessage","getAppHealth","workspaceNameSchema","MIGRATE_PGLITE_TEST_FILE_NAME","TAILOR_LOCK_VERSION","SCHEMA_FILE_NAME","executeScript","waitWorkflowExecution","TAILOR_LOCK_FILENAME","extractOwnedNamespaces","bundleSeedDumpScript","confirmationArgs","generateUserTypes","remove","startWorkflow","logBetaWarning","compareSnapshots","listExecutorJobs","bundleSeedScript","createCommonArgs","triggerExecutor","updateOrganization","formatMigrationDiff","generate$1","deploymentArgs","deployStaticWebsite","MIGRATION_LABEL_KEY","removeAdoptedConfigIds","getMigrationFiles","getFunctionRegistry","loadSeedContext","resolveAppId","getNextMigrationNumber","listWebhookExecutors","resumeWorkflow","appIdLockKey","waitForExecution","chunkSeedData","configArg","ensureConfigId","listOrganizations","listExecutors","MIGRATE_FILE_NAME","show","watchExecutorJob","compareLocalTypesWithSnapshot","listWorkflowExecutions","organizationTree","workspaceArgs","hasChanges","getWorkflowExecution","getWorkspace","reconstructSnapshotFromMigrations","DIFF_FILE_NAME","errorToJson","assertWritable","deleteFolder","listUsers","getExecutor","getOrganization","listOAuth2Clients","restoreWorkspace","getMachineUserToken","query","prompt","listFolders","truncate","planAppIds","getMigrationFilePath","findAppIdLock","getLatestMigrationNumber","removeUser","loadConfig","createWorkspace","loadAccessToken","createSnapshotFromLocalTypes","getOAuth2Client","annotateTerminalError","updateFolder","listWorkspaces","getFolder","inviteUser","formatDiffSummary","getWorkflow","withSourceLocation","updateUser","apiCall","getNamespacesWithMigrations","registerTsHook","deploy","bundleMigrationScript","createFolder","DB_PGLITE_SCHEMA_FILE_NAME","listMachineUsers","MIGRATE_TEST_FILE_NAME","loadTailorDBNamespaces","listApps","loadWorkspaceId","INITIAL_SCHEMA_NUMBER","serializeError","deleteWorkspace","DB_TYPES_FILE_NAME","generate","getExecutorJob","isPluginGeneratedTable","arg","defineCommand","runCommand","runMain"],"sources":["../../src/cli/lib.ts"],"sourcesContent":["// CLI API exports for programmatic usage\nimport { registerTsHook } from \"./shared/register-ts-hook\";\n\nawait registerTsHook(new URL(\"./ts-hook.mjs\", import.meta.url));\n\n// CLI foundation shared with plugins. Plugins resolve this package at runtime,\n// so logger state (--json / --verbose) set through these args reaches the SDK\n// code paths they call into. The @politty/zod surface is re-exported for the\n// same reason: arg metadata (aliases, env bindings, effects) lives in a\n// @politty/zod module-level registry, so registration and parsing must use\n// one @politty/zod copy.\nexport { arg, defineCommand, runCommand, runMain } from \"@politty/zod\";\nexport { logger, styles, type LogMode, type LogOptions, type OutOptions } from \"./shared/logger\";\nexport { defineAppCommand } from \"./shared/command\";\nexport { logBetaWarning } from \"./shared/beta\";\nexport { prompt } from \"./shared/prompt\";\nexport { workspaceNameSchema } from \"./shared/workspace-name\";\nexport {\n createCommonArgs,\n workspaceArgs,\n configArg,\n confirmationArgs,\n deploymentArgs,\n loadEnvFiles,\n type CommonArgsType,\n} from \"./shared/args\";\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 { ensureConfigId } from \"./commands/deploy/config-id-injector\";\nexport {\n TAILOR_LOCK_FILENAME,\n TAILOR_LOCK_VERSION,\n appIdLockKey,\n findAppIdLock,\n parseAppIds,\n planAppIds,\n removeAdoptedConfigIds,\n resolveAppId,\n type AppIdEntry,\n type AppIdEntryInput,\n type AppIdLock,\n type AppIdPlan,\n type AppIdPlanMode,\n type AppIds,\n type PlanAppIdsParams,\n type RemoveAdoptedConfigIdsResult,\n type ResolveAppIdParams,\n} from \"./commands/deploy/app-id-lock\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { extractOwnedNamespaces } from \"./shared/config\";\nexport { errorToJson, serializeError, type ErrorToJsonOptions } from \"./shared/error-json\";\nexport { annotateTerminalError, withSourceLocation } from \"./shared/github-actions\";\nexport type { ErrorSourceLocation } from \"./shared/error-diagnostics\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport {\n loadTailorDBNamespaces,\n type TailorDBNamespaceSelector,\n type LoadTailorDBNamespacesOptions,\n type LoadedTailorDBNamespaces,\n} from \"./shared/tailordb-namespaces\";\nexport {\n deployStaticWebsite,\n type DeployResult as StaticWebsiteDeployResult,\n} from \"./commands/staticwebsite/deploy\";\nexport { assertWritable } from \"./shared/readonly-guard\";\nexport { isPluginGeneratedTable } from \"#/parser/service/tailordb/type-source\";\nexport type {\n GeneratorResult,\n Plugin,\n PluginAttachment,\n TailorDBNamespaceData,\n} from \"#/plugin/types\";\nexport type {\n TailorDBType,\n TypeSourceInfoEntry,\n ParsedField,\n OperatorFieldConfig,\n PluginGeneratedTableSource,\n} from \"#/parser/service/tailordb/types\";\nexport type { Resolver } from \"#/types/resolver.generated\";\nexport type { Executor } from \"#/types/executor.generated\";\n\nexport {\n show,\n type ShowOptions,\n type ApplicationInfo,\n type ShowInfo,\n type AIGatewayInfo,\n type ShowStaticWebsiteInfo,\n type ShowOAuth2ClientInfo,\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 { getWorkflow, type GetWorkflowTypedOptions } from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n startWorkflow,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\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 type { FunctionLogEntryInfo } from \"./shared/function-execution\";\nexport {\n triggerExecutor,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n getExecutorWaitFailureMessage,\n watchExecutorJob,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport { getExecutor, type GetExecutorTypedOptions } 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 MIGRATE_TEST_FILE_NAME,\n MIGRATE_PGLITE_TEST_FILE_NAME,\n DB_TYPES_FILE_NAME,\n DB_PGLITE_SCHEMA_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 {\n loadSeedContext,\n type LoadSeedContextOptions,\n type SeedContext,\n type SeedIdpUserContext,\n type SeedNamespaceConfig,\n} from \"./shared/seed-context\";\nexport {\n chunkSeedData,\n type SeedChunk,\n type ChunkSeedDataOptions,\n type SeedData,\n} from \"./shared/seed-chunker\";\nexport {\n bundleSeedScript,\n bundleSeedDumpScript,\n type SeedBundleResult,\n type SeedDumpBundleResult,\n} 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 ScriptInvoker,\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":"wqCAGA,MAAMiG,GAAe,IAAI,IAAI,gBAAiB,YAAY,GAAG,CAAC"}
1
+ {"version":3,"file":"lib.mjs","names":["initOperatorClient","logger","styles","listWorkflows","parseAppIds","getMigrationDirPath","listFunctionRegistries","compareSnapshots","getExecutorWaitFailureMessage","getAppHealth","workspaceNameSchema","MIGRATE_PGLITE_TEST_FILE_NAME","TAILOR_LOCK_VERSION","SCHEMA_FILE_NAME","executeScript","waitWorkflowExecution","TAILOR_LOCK_FILENAME","extractOwnedNamespaces","bundleSeedDumpScript","deploymentArgs","generateUserTypes","remove","formatDiffSummary","startWorkflow","logBetaWarning","listExecutorJobs","bundleSeedScript","MIGRATION_LABEL_KEY","triggerExecutor","updateOrganization","formatMigrationDiff","generate$1","deployStaticWebsite","configArg","removeAdoptedConfigIds","getMigrationFiles","getFunctionRegistry","loadSeedContext","confirmationArgs","resolveAppId","getNextMigrationNumber","listWebhookExecutors","resumeWorkflow","defineAppCommand","appIdLockKey","waitForExecution","chunkSeedData","createCommonArgs","ensureConfigId","listOrganizations","loadEnvFiles","listExecutors","MIGRATE_FILE_NAME","show","watchExecutorJob","listWorkflowExecutions","organizationTree","getWorkflowExecution","getWorkspace","reconstructSnapshotFromMigrations","apiCall","DIFF_FILE_NAME","errorToJson","deleteFolder","listUsers","getExecutor","getOrganization","loadAccessToken","listOAuth2Clients","restoreWorkspace","getMachineUserToken","query","listFolders","truncate","planAppIds","getMigrationFilePath","findAppIdLock","getLatestMigrationNumber","removeUser","createWorkspace","createSnapshotFromLocalTypes","getOAuth2Client","annotateTerminalError","prompt","updateFolder","assertWritable","listWorkspaces","getFolder","inviteUser","workspaceArgs","hasChanges","getWorkflow","withSourceLocation","updateUser","loadConfig","getNamespacesWithMigrations","registerTsHook","deploy","bundleMigrationScript","createFolder","DB_PGLITE_SCHEMA_FILE_NAME","listMachineUsers","MIGRATE_TEST_FILE_NAME","loadTailorDBNamespaces","listApps","INITIAL_SCHEMA_NUMBER","serializeError","deleteWorkspace","loadWorkspaceId","DB_TYPES_FILE_NAME","generate","compareLocalTypesWithSnapshot","getExecutorJob","isPluginGeneratedTable","arg","defineCommand","runCommand","runMain"],"sources":["../../src/cli/lib.ts"],"sourcesContent":["// CLI API exports for programmatic usage\nimport { registerTsHook } from \"./shared/register-ts-hook\";\n\nawait registerTsHook(new URL(\"./ts-hook.mjs\", import.meta.url));\n\n// CLI foundation shared with plugins. Plugins resolve this package at runtime,\n// so logger state (--json / --verbose) set through these args reaches the SDK\n// code paths they call into. The @politty/zod surface is re-exported for the\n// same reason: arg metadata (aliases, env bindings, effects) lives in a\n// @politty/zod module-level registry, so registration and parsing must use\n// one @politty/zod copy.\nexport { arg, defineCommand, runCommand, runMain } from \"@politty/zod\";\nexport { logger, styles, type LogMode, type LogOptions, type OutOptions } from \"./shared/logger\";\nexport { defineAppCommand } from \"./shared/command\";\nexport { logBetaWarning } from \"./shared/beta\";\nexport { prompt } from \"./shared/prompt\";\nexport { workspaceNameSchema } from \"./shared/workspace-name\";\nexport {\n createCommonArgs,\n workspaceArgs,\n configArg,\n confirmationArgs,\n deploymentArgs,\n loadEnvFiles,\n type CommonArgsType,\n} from \"./shared/args\";\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 { ensureConfigId } from \"./commands/deploy/config-id-injector\";\nexport {\n TAILOR_LOCK_FILENAME,\n TAILOR_LOCK_VERSION,\n appIdLockKey,\n findAppIdLock,\n parseAppIds,\n planAppIds,\n removeAdoptedConfigIds,\n resolveAppId,\n type AppIdEntry,\n type AppIdEntryInput,\n type AppIdLock,\n type AppIdPlan,\n type AppIdPlanMode,\n type AppIds,\n type PlanAppIdsParams,\n type RemoveAdoptedConfigIdsResult,\n type ResolveAppIdParams,\n} from \"./commands/deploy/app-id-lock\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { extractOwnedNamespaces } from \"./shared/config\";\nexport { errorToJson, serializeError, type ErrorToJsonOptions } from \"./shared/error-json\";\nexport { annotateTerminalError, withSourceLocation } from \"./shared/github-actions\";\nexport type { ErrorSourceLocation } from \"./shared/error-diagnostics\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport {\n loadTailorDBNamespaces,\n type TailorDBNamespaceSelector,\n type LoadTailorDBNamespacesOptions,\n type LoadedTailorDBNamespaces,\n} from \"./shared/tailordb-namespaces\";\nexport {\n deployStaticWebsite,\n type DeployResult as StaticWebsiteDeployResult,\n} from \"./commands/staticwebsite/deploy\";\nexport { assertWritable } from \"./shared/readonly-guard\";\nexport { isPluginGeneratedTable } from \"#/parser/service/tailordb/type-source\";\nexport type {\n GeneratorResult,\n Plugin,\n PluginAttachment,\n TailorDBNamespaceData,\n} from \"#/plugin/types\";\nexport type {\n TailorDBType,\n TypeSourceInfoEntry,\n ParsedField,\n OperatorFieldConfig,\n PluginGeneratedTableSource,\n} from \"#/parser/service/tailordb/types\";\nexport type { Resolver } from \"#/types/resolver.generated\";\nexport type { Executor } from \"#/types/executor.generated\";\n\nexport {\n show,\n type ShowOptions,\n type ApplicationInfo,\n type ShowInfo,\n type AIGatewayInfo,\n type ShowStaticWebsiteInfo,\n type ShowOAuth2ClientInfo,\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 { getWorkflow, type GetWorkflowTypedOptions } from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n startWorkflow,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\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 type { FunctionLogEntryInfo } from \"./shared/function-execution\";\nexport {\n triggerExecutor,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n getExecutorWaitFailureMessage,\n watchExecutorJob,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport { getExecutor, type GetExecutorTypedOptions } 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 MIGRATE_TEST_FILE_NAME,\n MIGRATE_PGLITE_TEST_FILE_NAME,\n DB_TYPES_FILE_NAME,\n DB_PGLITE_SCHEMA_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 {\n loadSeedContext,\n type LoadSeedContextOptions,\n type SeedContext,\n type SeedIdpUserContext,\n type SeedNamespaceConfig,\n} from \"./shared/seed-context\";\nexport {\n chunkSeedData,\n type SeedChunk,\n type ChunkSeedDataOptions,\n type SeedData,\n} from \"./shared/seed-chunker\";\nexport {\n bundleSeedScript,\n bundleSeedDumpScript,\n type SeedBundleResult,\n type SeedDumpBundleResult,\n} 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 ScriptInvoker,\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":"wqCAGA,MAAMgG,GAAe,IAAI,IAAI,gBAAiB,YAAY,GAAG,CAAC"}