@@ -6,18 +6,18 @@ import type { AssemblyStatus, Transloadit } from '../Transloadit.ts'
66import type { IOutputCtl } from './OutputCtl.ts'
77
88// Re-export transloadit types for CLI use
9- export type { AssemblyStatus , BillResponse , ListedTemplate , TemplateResponse }
10- export type { Transloadit }
11- export type { CreateAssemblyOptions } from '../Transloadit.ts'
9+
10+
11+
1212
1313// Zod schemas for runtime validation
14- export const APIErrorSchema = z . object ( {
14+ const APIErrorSchema = z . object ( {
1515 error : z . string ( ) ,
1616 message : z . string ( ) ,
1717} )
1818export type APIError = z . infer < typeof APIErrorSchema >
1919
20- export const TransloaditAPIErrorSchema = z . object ( {
20+ const TransloaditAPIErrorSchema = z . object ( {
2121 error : z . string ( ) . optional ( ) ,
2222 message : z . string ( ) ,
2323 code : z . string ( ) . optional ( ) ,
@@ -55,14 +55,14 @@ export interface TemplateFile {
5555}
5656
5757// Template list item (from API)
58- export interface TemplateListItem {
58+ interface TemplateListItem {
5959 id : string
6060 modified : string
6161 name ?: string
6262}
6363
6464// CLI Invocation types
65- export interface BaseInvocation {
65+ interface BaseInvocation {
6666 error ?: boolean
6767 message ?: string
6868 mode : string
@@ -71,7 +71,7 @@ export interface BaseInvocation {
7171 jsonMode ?: boolean
7272}
7373
74- export interface AssemblyInvocation extends BaseInvocation {
74+ interface AssemblyInvocation extends BaseInvocation {
7575 mode : 'assemblies'
7676 action ?: 'create' | 'get' | 'list' | 'delete' | 'replay'
7777 inputs : string [ ]
@@ -91,7 +91,7 @@ export interface AssemblyInvocation extends BaseInvocation {
9191 reparse ?: boolean
9292}
9393
94- export interface TemplateInvocation extends BaseInvocation {
94+ interface TemplateInvocation extends BaseInvocation {
9595 mode : 'templates'
9696 action ?: 'create' | 'get' | 'list' | 'delete' | 'modify' | 'sync'
9797 templates ?: string [ ]
@@ -107,13 +107,13 @@ export interface TemplateInvocation extends BaseInvocation {
107107 recursive ?: boolean
108108}
109109
110- export interface BillInvocation extends BaseInvocation {
110+ interface BillInvocation extends BaseInvocation {
111111 mode : 'bills'
112112 action ?: 'get'
113113 months : string [ ]
114114}
115115
116- export interface NotificationInvocation extends BaseInvocation {
116+ interface NotificationInvocation extends BaseInvocation {
117117 mode : 'assembly-notifications'
118118 action ?: 'list' | 'replay'
119119 assemblies ?: string [ ]
@@ -123,26 +123,26 @@ export interface NotificationInvocation extends BaseInvocation {
123123 pagesize ?: number
124124}
125125
126- export interface HelpInvocation extends BaseInvocation {
126+ interface HelpInvocation extends BaseInvocation {
127127 mode : 'help' | 'version' | 'register'
128128}
129129
130- export type Invocation =
130+ type Invocation =
131131 | AssemblyInvocation
132132 | TemplateInvocation
133133 | BillInvocation
134134 | NotificationInvocation
135135 | HelpInvocation
136136
137137// Command handler type
138- export type CommandHandler < T extends BaseInvocation = BaseInvocation > = (
138+ type CommandHandler < T extends BaseInvocation = BaseInvocation > = (
139139 output : IOutputCtl ,
140140 client : Transloadit | undefined ,
141141 invocation : T ,
142142) => void | Promise < void >
143143
144144// Type guard for Error
145- export function isError ( value : unknown ) : value is Error {
145+ function isError ( value : unknown ) : value is Error {
146146 return value instanceof Error
147147}
148148
@@ -170,12 +170,12 @@ export function isErrnoException(value: unknown): value is NodeJS.ErrnoException
170170}
171171
172172// Safe array access helper
173- export function safeGet < T > ( arr : T [ ] , index : number ) : T | undefined {
173+ function safeGet < T > ( arr : T [ ] , index : number ) : T | undefined {
174174 return arr [ index ]
175175}
176176
177177// Assert defined helper
178- export function assertDefined < T > ( value : T | undefined | null , message : string ) : T {
178+ function assertDefined < T > ( value : T | undefined | null , message : string ) : T {
179179 if ( value === undefined || value === null ) {
180180 throw new Error ( message )
181181 }
0 commit comments