zudello-chat-sdk 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +325 -0
- package/dist/cjs/client.js +124 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants.js +578 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/errors.js +195 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/http/client.js +218 -0
- package/dist/cjs/http/client.js.map +1 -0
- package/dist/cjs/index.js +80 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/modules/approvals.js +90 -0
- package/dist/cjs/modules/approvals.js.map +1 -0
- package/dist/cjs/modules/automation.js +110 -0
- package/dist/cjs/modules/automation.js.map +1 -0
- package/dist/cjs/modules/config.js +264 -0
- package/dist/cjs/modules/config.js.map +1 -0
- package/dist/cjs/modules/datasets.js +103 -0
- package/dist/cjs/modules/datasets.js.map +1 -0
- package/dist/cjs/modules/exports.js +126 -0
- package/dist/cjs/modules/exports.js.map +1 -0
- package/dist/cjs/modules/inboxes.js +99 -0
- package/dist/cjs/modules/inboxes.js.map +1 -0
- package/dist/cjs/modules/models.js +105 -0
- package/dist/cjs/modules/models.js.map +1 -0
- package/dist/cjs/modules/org.js +335 -0
- package/dist/cjs/modules/org.js.map +1 -0
- package/dist/cjs/modules/quick-actions.js +71 -0
- package/dist/cjs/modules/quick-actions.js.map +1 -0
- package/dist/cjs/modules/resources.js +236 -0
- package/dist/cjs/modules/resources.js.map +1 -0
- package/dist/cjs/modules/search.js +188 -0
- package/dist/cjs/modules/search.js.map +1 -0
- package/dist/cjs/modules/sentences.js +155 -0
- package/dist/cjs/modules/sentences.js.map +1 -0
- package/dist/cjs/modules/users.js +120 -0
- package/dist/cjs/modules/users.js.map +1 -0
- package/dist/cjs/types.js +8 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/client.js +120 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants.js +565 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/errors.js +183 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/http/client.js +214 -0
- package/dist/esm/http/client.js.map +1 -0
- package/dist/esm/index.js +49 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/modules/approvals.js +86 -0
- package/dist/esm/modules/approvals.js.map +1 -0
- package/dist/esm/modules/automation.js +106 -0
- package/dist/esm/modules/automation.js.map +1 -0
- package/dist/esm/modules/config.js +260 -0
- package/dist/esm/modules/config.js.map +1 -0
- package/dist/esm/modules/datasets.js +99 -0
- package/dist/esm/modules/datasets.js.map +1 -0
- package/dist/esm/modules/exports.js +122 -0
- package/dist/esm/modules/exports.js.map +1 -0
- package/dist/esm/modules/inboxes.js +95 -0
- package/dist/esm/modules/inboxes.js.map +1 -0
- package/dist/esm/modules/models.js +101 -0
- package/dist/esm/modules/models.js.map +1 -0
- package/dist/esm/modules/org.js +331 -0
- package/dist/esm/modules/org.js.map +1 -0
- package/dist/esm/modules/quick-actions.js +67 -0
- package/dist/esm/modules/quick-actions.js.map +1 -0
- package/dist/esm/modules/resources.js +232 -0
- package/dist/esm/modules/resources.js.map +1 -0
- package/dist/esm/modules/search.js +184 -0
- package/dist/esm/modules/search.js.map +1 -0
- package/dist/esm/modules/sentences.js +151 -0
- package/dist/esm/modules/sentences.js.map +1 -0
- package/dist/esm/modules/users.js +116 -0
- package/dist/esm/modules/users.js.map +1 -0
- package/dist/esm/types.js +7 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/types/client.d.ts +105 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/constants.d.ts +505 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/errors.d.ts +143 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/http/client.d.ts +42 -0
- package/dist/types/http/client.d.ts.map +1 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/modules/approvals.d.ts +62 -0
- package/dist/types/modules/approvals.d.ts.map +1 -0
- package/dist/types/modules/automation.d.ts +79 -0
- package/dist/types/modules/automation.d.ts.map +1 -0
- package/dist/types/modules/config.d.ts +173 -0
- package/dist/types/modules/config.d.ts.map +1 -0
- package/dist/types/modules/datasets.d.ts +55 -0
- package/dist/types/modules/datasets.d.ts.map +1 -0
- package/dist/types/modules/exports.d.ts +76 -0
- package/dist/types/modules/exports.d.ts.map +1 -0
- package/dist/types/modules/inboxes.d.ts +91 -0
- package/dist/types/modules/inboxes.d.ts.map +1 -0
- package/dist/types/modules/models.d.ts +91 -0
- package/dist/types/modules/models.d.ts.map +1 -0
- package/dist/types/modules/org.d.ts +122 -0
- package/dist/types/modules/org.d.ts.map +1 -0
- package/dist/types/modules/quick-actions.d.ts +58 -0
- package/dist/types/modules/quick-actions.d.ts.map +1 -0
- package/dist/types/modules/resources.d.ts +111 -0
- package/dist/types/modules/resources.d.ts.map +1 -0
- package/dist/types/modules/search.d.ts +72 -0
- package/dist/types/modules/search.d.ts.map +1 -0
- package/dist/types/modules/sentences.d.ts +105 -0
- package/dist/types/modules/sentences.d.ts.map +1 -0
- package/dist/types/modules/users.d.ts +65 -0
- package/dist/types/modules/users.d.ts.map +1 -0
- package/dist/types/types.d.ts +2056 -0
- package/dist/types/types.d.ts.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,2056 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zudello SDK Types
|
|
3
|
+
*
|
|
4
|
+
* TypeScript interfaces for all SDK operations.
|
|
5
|
+
*/
|
|
6
|
+
import type { ZudelloModel, ZudelloModule, ZudelloSubmodule } from './constants';
|
|
7
|
+
/**
|
|
8
|
+
* Configuration options for ZudelloClient.
|
|
9
|
+
*
|
|
10
|
+
* If not provided, values are read from environment variables:
|
|
11
|
+
* - ZUDELLO_TOKEN
|
|
12
|
+
* - ZUDELLO_ORG_ID
|
|
13
|
+
* - ZUDELLO_TEAM_ID
|
|
14
|
+
* - ZUDELLO_CLUSTER_URL
|
|
15
|
+
* - ZUDELLO_AUTH_API_BASE
|
|
16
|
+
* - ZUDELLO_USER_ID (optional)
|
|
17
|
+
* - ZUDELLO_USER_EMAIL (optional)
|
|
18
|
+
*/
|
|
19
|
+
export interface ZudelloClientConfig {
|
|
20
|
+
/** Opaque authentication token */
|
|
21
|
+
token?: string;
|
|
22
|
+
/** Organization UUID */
|
|
23
|
+
organizationId?: string;
|
|
24
|
+
/** Team UUID */
|
|
25
|
+
teamId?: string;
|
|
26
|
+
/** Team's cluster URL (e.g., 'api.1.global.zudello.io') */
|
|
27
|
+
clusterUrl?: string;
|
|
28
|
+
/** Authentication API base URL */
|
|
29
|
+
authApiBase?: string;
|
|
30
|
+
/** User UUID (optional, for user-specific operations) */
|
|
31
|
+
userId?: string;
|
|
32
|
+
/** User email (optional) */
|
|
33
|
+
userEmail?: string;
|
|
34
|
+
/** Maximum number of retry attempts for failed requests (default: 3) */
|
|
35
|
+
maxRetries?: number;
|
|
36
|
+
/** Base delay in ms for exponential backoff (default: 1000) */
|
|
37
|
+
retryDelay?: number;
|
|
38
|
+
/** Request timeout in ms (default: 30000) */
|
|
39
|
+
timeout?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Filter operators supported by Zudello search.
|
|
43
|
+
*
|
|
44
|
+
* Append these suffixes to field names in filter objects:
|
|
45
|
+
* - `__in`: Value is in list (e.g., `status__in: ['REVIEW', 'APPROVAL']`)
|
|
46
|
+
* - `__gt`, `__gte`: Greater than (or equal)
|
|
47
|
+
* - `__lt`, `__lte`: Less than (or equal)
|
|
48
|
+
* - `__range`: Value is in range (e.g., `total__range: [1000, 5000]`)
|
|
49
|
+
* - `__icontains`: Case-insensitive contains
|
|
50
|
+
* - `__startswith`: Starts with string
|
|
51
|
+
* - `__isnull`: Is null/not null
|
|
52
|
+
* - `__or`: OR condition
|
|
53
|
+
*/
|
|
54
|
+
export type FilterOperator = '__in' | '__gt' | '__gte' | '__lt' | '__lte' | '__range' | '__icontains' | '__contains' | '__startswith' | '__endswith' | '__isnull' | '__or';
|
|
55
|
+
/**
|
|
56
|
+
* Search options for querying Zudello resources.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Search for invoices over $1000 awaiting approval
|
|
60
|
+
* const options: SearchOptions = {
|
|
61
|
+
* model: 'Transaction',
|
|
62
|
+
* module: 'PURCHASING',
|
|
63
|
+
* submodule: 'INVOICE',
|
|
64
|
+
* filter: {
|
|
65
|
+
* status__in: ['REVIEW', 'APPROVAL'],
|
|
66
|
+
* total__gt: 1000
|
|
67
|
+
* },
|
|
68
|
+
* select: ['uuid', 'document_number', 'total', 'supplier'],
|
|
69
|
+
* order_by: ['-total']
|
|
70
|
+
* };
|
|
71
|
+
*/
|
|
72
|
+
export interface SearchOptions {
|
|
73
|
+
/**
|
|
74
|
+
* The Zudello model to search.
|
|
75
|
+
* @example 'Transaction', 'Supplier', 'Item'
|
|
76
|
+
*/
|
|
77
|
+
model: ZudelloModel | string;
|
|
78
|
+
/**
|
|
79
|
+
* Module filter (functional area).
|
|
80
|
+
* @example 'PURCHASING', 'SALES', 'EXPENSES'
|
|
81
|
+
*/
|
|
82
|
+
module?: ZudelloModule | string;
|
|
83
|
+
/**
|
|
84
|
+
* Submodule filter (specific document type).
|
|
85
|
+
* @example 'INVOICE', 'ORDER', 'CLAIM'
|
|
86
|
+
*/
|
|
87
|
+
submodule?: ZudelloSubmodule | string;
|
|
88
|
+
/**
|
|
89
|
+
* Filter criteria. Use operators like `__in`, `__gt`, `__lt`, `__range`.
|
|
90
|
+
* @example { status: 'REVIEW', total__gt: 1000, supplier__trading_name__icontains: 'acme' }
|
|
91
|
+
*/
|
|
92
|
+
filter?: Record<string, unknown>;
|
|
93
|
+
/**
|
|
94
|
+
* Exclusion criteria (inverse of filter).
|
|
95
|
+
* @example { status: 'DELETED' }
|
|
96
|
+
*/
|
|
97
|
+
exclude?: Record<string, unknown>;
|
|
98
|
+
/**
|
|
99
|
+
* Fields to include in response. Use dot notation for related fields.
|
|
100
|
+
* @example ['uuid', 'document_number', 'supplier__trading_name', 'total']
|
|
101
|
+
*/
|
|
102
|
+
select?: string[];
|
|
103
|
+
/**
|
|
104
|
+
* Sort order. Prefix with `-` for descending.
|
|
105
|
+
* @example ['-created_at', 'document_number']
|
|
106
|
+
*/
|
|
107
|
+
order_by?: string[];
|
|
108
|
+
/**
|
|
109
|
+
* Full-text search configuration.
|
|
110
|
+
*/
|
|
111
|
+
search?: {
|
|
112
|
+
/** Fields to search in */
|
|
113
|
+
fields?: Array<{
|
|
114
|
+
name: string;
|
|
115
|
+
} | string>;
|
|
116
|
+
/** Search keywords */
|
|
117
|
+
keywords?: string[];
|
|
118
|
+
/** Search mode */
|
|
119
|
+
mode?: string;
|
|
120
|
+
/** Minimum search rank */
|
|
121
|
+
min_rank?: number;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Distinct field(s) for deduplication.
|
|
125
|
+
*/
|
|
126
|
+
distinct?: string[];
|
|
127
|
+
/**
|
|
128
|
+
* Annotation expressions for computed fields.
|
|
129
|
+
*/
|
|
130
|
+
annotate?: Record<string, unknown>;
|
|
131
|
+
/**
|
|
132
|
+
* Aggregation expressions (sum, count, avg, etc.).
|
|
133
|
+
*/
|
|
134
|
+
aggregate?: Record<string, unknown>;
|
|
135
|
+
/**
|
|
136
|
+
* Number of results to skip (for pagination).
|
|
137
|
+
* @default 0
|
|
138
|
+
*/
|
|
139
|
+
offset?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Maximum number of results to return.
|
|
142
|
+
* @default 100
|
|
143
|
+
*/
|
|
144
|
+
limit?: number;
|
|
145
|
+
/**
|
|
146
|
+
* Only return active (non-deleted) records.
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
activeOnly?: boolean;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* List options - same as search but specifically for iteration.
|
|
153
|
+
*/
|
|
154
|
+
export interface ListOptions extends SearchOptions {
|
|
155
|
+
/** Page size for iteration (default: 100) */
|
|
156
|
+
pageSize?: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Search result metadata.
|
|
160
|
+
*/
|
|
161
|
+
export interface SearchMetadata {
|
|
162
|
+
/** Total count of matching records (if available) */
|
|
163
|
+
count?: number;
|
|
164
|
+
/** Current offset */
|
|
165
|
+
offset?: number;
|
|
166
|
+
/** Current limit */
|
|
167
|
+
limit?: number;
|
|
168
|
+
/** Whether more results are available */
|
|
169
|
+
has_more?: boolean;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Search result from the API.
|
|
173
|
+
*/
|
|
174
|
+
export interface SearchResult<T = Record<string, unknown>> {
|
|
175
|
+
/** Whether the request was successful */
|
|
176
|
+
success: boolean;
|
|
177
|
+
/** The model that was searched */
|
|
178
|
+
model?: string;
|
|
179
|
+
/** Array of matching records */
|
|
180
|
+
data?: T[];
|
|
181
|
+
/** Pagination and count metadata */
|
|
182
|
+
metadata?: SearchMetadata;
|
|
183
|
+
/** Error message if success is false */
|
|
184
|
+
error?: string;
|
|
185
|
+
/** Warning message if applicable */
|
|
186
|
+
warning?: string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Options for fetching a single resource.
|
|
190
|
+
*/
|
|
191
|
+
export interface FetchOptions {
|
|
192
|
+
/**
|
|
193
|
+
* Related models to include in the response.
|
|
194
|
+
* @example 'supplier,lines,attachments'
|
|
195
|
+
*/
|
|
196
|
+
includeModels?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Related models to exclude from the response.
|
|
199
|
+
*/
|
|
200
|
+
excludeModels?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Specific paths to include.
|
|
203
|
+
*/
|
|
204
|
+
includePaths?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Specific paths to exclude.
|
|
207
|
+
*/
|
|
208
|
+
excludePaths?: string;
|
|
209
|
+
/**
|
|
210
|
+
* Whether to fetch full details.
|
|
211
|
+
* @default true
|
|
212
|
+
*/
|
|
213
|
+
fetchDetails?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Only include active (non-deleted) related records.
|
|
216
|
+
* @default true
|
|
217
|
+
*/
|
|
218
|
+
activeOnly?: boolean;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Result from fetching a single resource.
|
|
222
|
+
*/
|
|
223
|
+
export interface FetchResult<T = Record<string, unknown>> {
|
|
224
|
+
success: boolean;
|
|
225
|
+
model?: string;
|
|
226
|
+
data?: T;
|
|
227
|
+
error?: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Options for creating a resource.
|
|
231
|
+
*/
|
|
232
|
+
export interface CreateOptions {
|
|
233
|
+
/** Module context for the new resource */
|
|
234
|
+
module?: ZudelloModule | string;
|
|
235
|
+
/** Submodule context for the new resource */
|
|
236
|
+
submodule?: ZudelloSubmodule | string;
|
|
237
|
+
/** The data for the new resource */
|
|
238
|
+
data: Record<string, unknown>;
|
|
239
|
+
/** Whether to return the created resource */
|
|
240
|
+
fetch?: boolean;
|
|
241
|
+
/** Whether to submit for processing after creation */
|
|
242
|
+
submit?: boolean;
|
|
243
|
+
/** Whether to enrich with default values */
|
|
244
|
+
enrich?: boolean;
|
|
245
|
+
/** Dry run (validate without creating) */
|
|
246
|
+
dryRun?: boolean;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Options for updating a resource.
|
|
250
|
+
*/
|
|
251
|
+
export interface UpdateOptions {
|
|
252
|
+
/** The data to update */
|
|
253
|
+
data: Record<string, unknown>;
|
|
254
|
+
/** Whether to return the updated resource */
|
|
255
|
+
fetch?: boolean;
|
|
256
|
+
/** Replace entire resource (vs partial update) */
|
|
257
|
+
replace?: boolean;
|
|
258
|
+
/** Whether to submit for processing after update */
|
|
259
|
+
submit?: boolean;
|
|
260
|
+
/** Update the status field */
|
|
261
|
+
updateStatus?: boolean;
|
|
262
|
+
/** Dry run (validate without updating) */
|
|
263
|
+
dryRun?: boolean;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Result from create/update operations.
|
|
267
|
+
*/
|
|
268
|
+
export interface MutationResult<T = Record<string, unknown>> {
|
|
269
|
+
success: boolean;
|
|
270
|
+
model?: string;
|
|
271
|
+
data?: T;
|
|
272
|
+
error?: string;
|
|
273
|
+
warnings?: string[];
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Options for listing configurations.
|
|
277
|
+
*/
|
|
278
|
+
export interface ConfigListOptions {
|
|
279
|
+
/** Config type (e.g., 'document_status', 'field_settings') */
|
|
280
|
+
configType: string;
|
|
281
|
+
/** Filter by module */
|
|
282
|
+
module?: ZudelloModule | string;
|
|
283
|
+
/** Filter by submodule */
|
|
284
|
+
submodule?: ZudelloSubmodule | string;
|
|
285
|
+
/** Include global configs */
|
|
286
|
+
includeGlobal?: boolean;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Zudello config object.
|
|
290
|
+
*/
|
|
291
|
+
export interface ZudelloConfig {
|
|
292
|
+
uuid: string;
|
|
293
|
+
config_type: string;
|
|
294
|
+
resource_type?: string;
|
|
295
|
+
version?: string;
|
|
296
|
+
global_config: boolean;
|
|
297
|
+
global_resource?: boolean;
|
|
298
|
+
team_uuid?: string;
|
|
299
|
+
context: Record<string, string[]> | null;
|
|
300
|
+
payload: Record<string, unknown>;
|
|
301
|
+
error?: string | null;
|
|
302
|
+
created_at: string;
|
|
303
|
+
updated_at?: string;
|
|
304
|
+
deleted_at?: string | null;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Model schema information.
|
|
308
|
+
*/
|
|
309
|
+
export interface ModelSchema {
|
|
310
|
+
/** Field definitions */
|
|
311
|
+
fields: Record<string, {
|
|
312
|
+
type: string;
|
|
313
|
+
required?: boolean;
|
|
314
|
+
readonly?: boolean;
|
|
315
|
+
description?: string;
|
|
316
|
+
choices?: Array<{
|
|
317
|
+
value: string;
|
|
318
|
+
label: string;
|
|
319
|
+
}>;
|
|
320
|
+
}>;
|
|
321
|
+
/** Model relationships */
|
|
322
|
+
relations?: Record<string, {
|
|
323
|
+
model: string;
|
|
324
|
+
type: 'foreign_key' | 'many_to_many' | 'one_to_many';
|
|
325
|
+
}>;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Model metadata information.
|
|
329
|
+
*/
|
|
330
|
+
export interface ModelMetadata {
|
|
331
|
+
/** Display name */
|
|
332
|
+
display_name?: string;
|
|
333
|
+
/** Icon identifier */
|
|
334
|
+
icon?: string;
|
|
335
|
+
/** Description */
|
|
336
|
+
description?: string;
|
|
337
|
+
/** Valid modules for this model */
|
|
338
|
+
modules?: string[];
|
|
339
|
+
/** Valid submodules for this model */
|
|
340
|
+
submodules?: string[];
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Request to fetch a single resource in a batch operation.
|
|
344
|
+
*/
|
|
345
|
+
export interface ResourceFetchRequest {
|
|
346
|
+
/** The model to fetch (e.g., 'Transaction', 'Supplier') */
|
|
347
|
+
model: ZudelloModel | string;
|
|
348
|
+
/** UUID of the resource (either uuid or external_id required) */
|
|
349
|
+
uuid?: string;
|
|
350
|
+
/** External ID of the resource (either uuid or external_id required) */
|
|
351
|
+
external_id?: string;
|
|
352
|
+
/** Whether to fetch detail records */
|
|
353
|
+
fetch_details?: boolean;
|
|
354
|
+
/** Related models to include when fetch_details is true */
|
|
355
|
+
include_models?: string[];
|
|
356
|
+
/** Related models to exclude */
|
|
357
|
+
exclude_models?: string[];
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Options for batch fetch operations.
|
|
361
|
+
*/
|
|
362
|
+
export interface BatchFetchOptions {
|
|
363
|
+
/** Only return active (non-deleted) instances (default: true) */
|
|
364
|
+
activeOnly?: boolean;
|
|
365
|
+
/** Include null/empty values in response (default: true) */
|
|
366
|
+
includeNulls?: boolean;
|
|
367
|
+
/** Return simplified flat response format (default: false) */
|
|
368
|
+
simplified?: boolean;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Individual result from a batch fetch operation.
|
|
372
|
+
*/
|
|
373
|
+
export interface BatchFetchResult {
|
|
374
|
+
/** Whether this individual fetch succeeded */
|
|
375
|
+
success: boolean;
|
|
376
|
+
/** The model that was fetched */
|
|
377
|
+
model?: string;
|
|
378
|
+
/** The fetched data */
|
|
379
|
+
data?: Record<string, unknown>;
|
|
380
|
+
/** Error message if this fetch failed */
|
|
381
|
+
message?: string;
|
|
382
|
+
/** Detailed errors if applicable */
|
|
383
|
+
errors?: unknown[];
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Request to update or create a single resource.
|
|
387
|
+
*/
|
|
388
|
+
export interface UpdateOrCreateRequest {
|
|
389
|
+
/** The data model (e.g., 'Transaction', 'Supplier') */
|
|
390
|
+
model: ZudelloModel | string;
|
|
391
|
+
/**
|
|
392
|
+
* The resource data. Include 'uuid', 'external_id', or 'code' for updates.
|
|
393
|
+
* Include 'module' and 'submodule' for Transaction model.
|
|
394
|
+
*/
|
|
395
|
+
data: Record<string, unknown>;
|
|
396
|
+
/** Fetch the resource in response (cannot be true with update=true) */
|
|
397
|
+
fetch?: boolean;
|
|
398
|
+
/** Allow creating if not found (default: true) */
|
|
399
|
+
create?: boolean;
|
|
400
|
+
/** Allow updating if found (cannot be true with fetch=true, default: true) */
|
|
401
|
+
update?: boolean;
|
|
402
|
+
/** Replace entire resource (true) or merge (false, default: false) */
|
|
403
|
+
replace?: boolean;
|
|
404
|
+
/** Submit for processing/workflow (default: false) */
|
|
405
|
+
submit?: boolean;
|
|
406
|
+
/** Enrich with additional data (default: false) */
|
|
407
|
+
enrich?: boolean;
|
|
408
|
+
/** Test without actual changes (default: false) */
|
|
409
|
+
dry_run?: boolean;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Options for batch update or create operations.
|
|
413
|
+
*/
|
|
414
|
+
export interface BatchUpdateOrCreateOptions {
|
|
415
|
+
/** Queue for batch processing (returns task_id, default: false) */
|
|
416
|
+
batch?: boolean;
|
|
417
|
+
/** Return simplified response format (default: false) */
|
|
418
|
+
simplified?: boolean;
|
|
419
|
+
/** Test without actual changes (default: false) */
|
|
420
|
+
dryRun?: boolean;
|
|
421
|
+
/** Include null values in response (default: true) */
|
|
422
|
+
includeNulls?: boolean;
|
|
423
|
+
/** Clear null values from existing record (default: false) */
|
|
424
|
+
clearNulls?: boolean;
|
|
425
|
+
/** Migration mode - skips some validations (default: false) */
|
|
426
|
+
migration?: boolean;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Individual result from an update or create operation.
|
|
430
|
+
*/
|
|
431
|
+
export interface UpdateOrCreateResult {
|
|
432
|
+
/** Whether this individual operation succeeded */
|
|
433
|
+
success: boolean;
|
|
434
|
+
/** The model that was affected */
|
|
435
|
+
model?: string;
|
|
436
|
+
/** The created/updated data */
|
|
437
|
+
data?: Record<string, unknown>;
|
|
438
|
+
/** Status message */
|
|
439
|
+
message?: string;
|
|
440
|
+
/** Detailed errors if applicable */
|
|
441
|
+
errors?: unknown[];
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Audit event from resource history.
|
|
445
|
+
*/
|
|
446
|
+
export interface AuditEvent {
|
|
447
|
+
/** Event UUID */
|
|
448
|
+
uuid: string;
|
|
449
|
+
/** Event type (e.g., 'CREATE', 'UPDATE', 'STATUS_CHANGE') */
|
|
450
|
+
event_type: string;
|
|
451
|
+
/** Timestamp of the event */
|
|
452
|
+
timestamp: string;
|
|
453
|
+
/** User who performed the action */
|
|
454
|
+
user?: {
|
|
455
|
+
uuid: string;
|
|
456
|
+
name?: string;
|
|
457
|
+
email?: string;
|
|
458
|
+
};
|
|
459
|
+
/** Changes made in this event */
|
|
460
|
+
changes?: Record<string, {
|
|
461
|
+
old?: unknown;
|
|
462
|
+
new?: unknown;
|
|
463
|
+
}>;
|
|
464
|
+
/** Additional event metadata */
|
|
465
|
+
metadata?: Record<string, unknown>;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* A Zudello sentence (automation/business rule).
|
|
469
|
+
*
|
|
470
|
+
* Sentences define automated workflows triggered by document events.
|
|
471
|
+
* They consist of conditions and actions that execute when conditions are met.
|
|
472
|
+
*/
|
|
473
|
+
export interface ZudelloSentence {
|
|
474
|
+
/** Sentence UUID */
|
|
475
|
+
uuid: string;
|
|
476
|
+
/** Version string (e.g., '1.0.0') */
|
|
477
|
+
version?: string;
|
|
478
|
+
/** Categories/tags for the sentence */
|
|
479
|
+
categories: string[];
|
|
480
|
+
/** Execution order (lower runs first). Must be integer. */
|
|
481
|
+
evalOrder: number;
|
|
482
|
+
/** Whether the sentence is active */
|
|
483
|
+
enabled: boolean;
|
|
484
|
+
/** Whether this is a template */
|
|
485
|
+
isTemplate: boolean;
|
|
486
|
+
/** Module this sentence applies to (e.g., 'PURCHASING') */
|
|
487
|
+
module?: string;
|
|
488
|
+
/** Submodule filter (e.g., 'INVOICE'). If not set, runs for all submodules. */
|
|
489
|
+
submodule?: string;
|
|
490
|
+
/** The recipe defining conditions and actions */
|
|
491
|
+
recipe: SentenceRecipe;
|
|
492
|
+
/** Creation timestamp */
|
|
493
|
+
created_at?: string;
|
|
494
|
+
/** Last update timestamp */
|
|
495
|
+
updated_at?: string;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Recipe structure defining sentence conditions and actions.
|
|
499
|
+
*/
|
|
500
|
+
export interface SentenceRecipe {
|
|
501
|
+
/** Display name for the sentence */
|
|
502
|
+
name?: string;
|
|
503
|
+
/** Event types that trigger this sentence */
|
|
504
|
+
event_type?: string[];
|
|
505
|
+
/** Blocks of conditions and actions */
|
|
506
|
+
blocks?: SentenceBlock[];
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* A block within a sentence recipe containing conditions and actions.
|
|
510
|
+
*/
|
|
511
|
+
export interface SentenceBlock {
|
|
512
|
+
/** Conditions that must be met for actions to execute */
|
|
513
|
+
conditions?: SentenceCondition[];
|
|
514
|
+
/** Actions to execute when conditions are met */
|
|
515
|
+
actions?: SentenceAction[];
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* A condition in a sentence.
|
|
519
|
+
*/
|
|
520
|
+
export interface SentenceCondition {
|
|
521
|
+
/** Condition type (e.g., 'CUSTOM_CONDITION') */
|
|
522
|
+
type: string;
|
|
523
|
+
/** The field to evaluate */
|
|
524
|
+
field?: {
|
|
525
|
+
value: string;
|
|
526
|
+
meta?: {
|
|
527
|
+
path?: string;
|
|
528
|
+
sentence_path?: string;
|
|
529
|
+
type?: string;
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
/** The comparison operator */
|
|
533
|
+
operator?: {
|
|
534
|
+
value: string;
|
|
535
|
+
use?: string | null;
|
|
536
|
+
meta?: Record<string, unknown>;
|
|
537
|
+
};
|
|
538
|
+
/** The value to compare against */
|
|
539
|
+
value?: unknown;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* An action in a sentence.
|
|
543
|
+
*/
|
|
544
|
+
export interface SentenceAction {
|
|
545
|
+
/** Action type (e.g., 'SET_STATUS', 'GET_APPROVAL', 'CANCEL_PROCESSING') */
|
|
546
|
+
type: string;
|
|
547
|
+
/** Action parameters (varies by type) */
|
|
548
|
+
params?: Record<string, unknown>;
|
|
549
|
+
/** Whether this is a fallback/otherwise action */
|
|
550
|
+
otherwise?: boolean;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Options for listing sentences.
|
|
554
|
+
*/
|
|
555
|
+
export interface ListSentencesOptions {
|
|
556
|
+
/** Filter by submodule */
|
|
557
|
+
submodule?: string;
|
|
558
|
+
/** Filter to templates only */
|
|
559
|
+
isTemplate?: boolean;
|
|
560
|
+
/** Filter by enabled status */
|
|
561
|
+
enabled?: boolean;
|
|
562
|
+
/** Filter by trigger event types */
|
|
563
|
+
triggers?: string[];
|
|
564
|
+
/** Filter by fields used */
|
|
565
|
+
fields?: string[];
|
|
566
|
+
/** Filter by action types */
|
|
567
|
+
actions?: string[];
|
|
568
|
+
/** Page number for pagination */
|
|
569
|
+
page?: number;
|
|
570
|
+
/** Results per page */
|
|
571
|
+
perPage?: number;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Sentence resource (action or condition template).
|
|
575
|
+
*/
|
|
576
|
+
export interface SentenceResource {
|
|
577
|
+
/** Resource UUID */
|
|
578
|
+
uuid: string;
|
|
579
|
+
/** Resource type */
|
|
580
|
+
resource_type: string;
|
|
581
|
+
/** Resource payload */
|
|
582
|
+
payload: {
|
|
583
|
+
code: string;
|
|
584
|
+
name: string;
|
|
585
|
+
template: string;
|
|
586
|
+
field?: Record<string, unknown>;
|
|
587
|
+
values?: unknown[];
|
|
588
|
+
operator?: Record<string, unknown>;
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Payload for creating a sentence.
|
|
593
|
+
*/
|
|
594
|
+
export interface CreateSentencePayload {
|
|
595
|
+
/** Optional version (defaults to 1.0.0) */
|
|
596
|
+
version?: string;
|
|
597
|
+
/** Optional UUID (auto-generated if not provided) */
|
|
598
|
+
uuid?: string;
|
|
599
|
+
/** Categories/tags */
|
|
600
|
+
categories: string[];
|
|
601
|
+
/** Execution order (must be integer) */
|
|
602
|
+
evalOrder: number;
|
|
603
|
+
/** Whether enabled */
|
|
604
|
+
enabled: boolean;
|
|
605
|
+
/** Whether this is a template */
|
|
606
|
+
isTemplate: boolean;
|
|
607
|
+
/** The recipe with conditions and actions */
|
|
608
|
+
recipe: SentenceRecipe;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* An integration script.
|
|
612
|
+
*/
|
|
613
|
+
export interface ZudelloScript {
|
|
614
|
+
/** Script UUID */
|
|
615
|
+
uuid: string;
|
|
616
|
+
/** Script name */
|
|
617
|
+
name: string;
|
|
618
|
+
/** File path in the integration repo */
|
|
619
|
+
file_path: string;
|
|
620
|
+
/** Script content (when fetched individually) */
|
|
621
|
+
file_content?: string;
|
|
622
|
+
/** Whether this is a global script */
|
|
623
|
+
global: boolean;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* A trigger definition.
|
|
627
|
+
*/
|
|
628
|
+
export interface ZudelloTrigger {
|
|
629
|
+
/** Trigger UUID */
|
|
630
|
+
uuid: string;
|
|
631
|
+
/** Trigger name */
|
|
632
|
+
name: string;
|
|
633
|
+
/** Whether enabled */
|
|
634
|
+
enabled: boolean;
|
|
635
|
+
/** Trigger type (e.g., 'SCHEDULE', 'WEBHOOK', 'EVENT') */
|
|
636
|
+
type: string;
|
|
637
|
+
/** Associated script UUID */
|
|
638
|
+
script_uuid?: string;
|
|
639
|
+
/** Schedule configuration (for SCHEDULE type) */
|
|
640
|
+
schedule?: {
|
|
641
|
+
cron?: string;
|
|
642
|
+
interval?: number;
|
|
643
|
+
timezone?: string;
|
|
644
|
+
};
|
|
645
|
+
/** Event configuration (for EVENT type) */
|
|
646
|
+
event?: {
|
|
647
|
+
module?: string;
|
|
648
|
+
submodule?: string;
|
|
649
|
+
event_type?: string;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Options for listing triggers.
|
|
654
|
+
*/
|
|
655
|
+
export interface ListTriggersOptions {
|
|
656
|
+
/** Filter by enabled status */
|
|
657
|
+
enabled?: boolean;
|
|
658
|
+
/** Filter by trigger type */
|
|
659
|
+
type?: string;
|
|
660
|
+
/** Filter by module */
|
|
661
|
+
module?: string;
|
|
662
|
+
/** Page number */
|
|
663
|
+
page?: number;
|
|
664
|
+
/** Results per page */
|
|
665
|
+
perPage?: number;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Automation log entry.
|
|
669
|
+
*/
|
|
670
|
+
export interface AutomationLog {
|
|
671
|
+
/** Log UUID */
|
|
672
|
+
uuid: string;
|
|
673
|
+
/** Associated trigger UUID */
|
|
674
|
+
trigger_uuid: string;
|
|
675
|
+
/** Run status */
|
|
676
|
+
status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED';
|
|
677
|
+
/** Start timestamp */
|
|
678
|
+
started_at?: string;
|
|
679
|
+
/** End timestamp */
|
|
680
|
+
completed_at?: string;
|
|
681
|
+
/** Error message if failed */
|
|
682
|
+
error?: string;
|
|
683
|
+
/** Additional run metadata */
|
|
684
|
+
metadata?: Record<string, unknown>;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Options for fetching automation logs.
|
|
688
|
+
*/
|
|
689
|
+
export interface GetAutomationLogsOptions {
|
|
690
|
+
/** Filter by trigger UUID */
|
|
691
|
+
triggerUuid?: string;
|
|
692
|
+
/** Filter by status */
|
|
693
|
+
status?: string;
|
|
694
|
+
/** Filter by date range start */
|
|
695
|
+
startDate?: string;
|
|
696
|
+
/** Filter by date range end */
|
|
697
|
+
endDate?: string;
|
|
698
|
+
/** Page number */
|
|
699
|
+
page?: number;
|
|
700
|
+
/** Results per page */
|
|
701
|
+
perPage?: number;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Run log entry.
|
|
705
|
+
*/
|
|
706
|
+
export interface RunLog {
|
|
707
|
+
/** Log UUID */
|
|
708
|
+
uuid: string;
|
|
709
|
+
/** Log timestamp */
|
|
710
|
+
timestamp: string;
|
|
711
|
+
/** Log level */
|
|
712
|
+
level: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
|
713
|
+
/** Log message */
|
|
714
|
+
message: string;
|
|
715
|
+
/** Additional context */
|
|
716
|
+
context?: Record<string, unknown>;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Options for searching runs.
|
|
720
|
+
*/
|
|
721
|
+
export interface SearchRunsOptions {
|
|
722
|
+
/** Filter by trigger UUID */
|
|
723
|
+
triggerUuid?: string;
|
|
724
|
+
/** Filter by status */
|
|
725
|
+
status?: string;
|
|
726
|
+
/** Filter by date range start */
|
|
727
|
+
startDate?: string;
|
|
728
|
+
/** Filter by date range end */
|
|
729
|
+
endDate?: string;
|
|
730
|
+
/** Search in error messages */
|
|
731
|
+
errorContains?: string;
|
|
732
|
+
/** Page number */
|
|
733
|
+
page?: number;
|
|
734
|
+
/** Results per page */
|
|
735
|
+
perPage?: number;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Approval action for bulk milestone operations.
|
|
739
|
+
*/
|
|
740
|
+
export interface ApprovalItem {
|
|
741
|
+
/** Milestone UUID */
|
|
742
|
+
milestone_uuid: string;
|
|
743
|
+
/** Action to take */
|
|
744
|
+
action: 'APPROVE' | 'REJECT';
|
|
745
|
+
/** Optional comment */
|
|
746
|
+
comment?: string;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Result of a bulk approval operation.
|
|
750
|
+
*/
|
|
751
|
+
export interface BulkApprovalResult {
|
|
752
|
+
/** Whether the operation succeeded */
|
|
753
|
+
success: boolean;
|
|
754
|
+
/** Results for each approval */
|
|
755
|
+
data: Array<{
|
|
756
|
+
success: boolean;
|
|
757
|
+
message: string;
|
|
758
|
+
}>;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* A user group in Zudello.
|
|
762
|
+
*/
|
|
763
|
+
export interface UserGroup {
|
|
764
|
+
/** Group UUID */
|
|
765
|
+
uuid: string;
|
|
766
|
+
/** Group name */
|
|
767
|
+
name: string;
|
|
768
|
+
/** Group description */
|
|
769
|
+
description: string;
|
|
770
|
+
/** Group status */
|
|
771
|
+
status: string;
|
|
772
|
+
/** Group type */
|
|
773
|
+
user_group_type: string;
|
|
774
|
+
/** Team user IDs in this group */
|
|
775
|
+
team_user_ids: string[];
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* A team user in Zudello.
|
|
779
|
+
*/
|
|
780
|
+
export interface TeamUser {
|
|
781
|
+
/** User UUID */
|
|
782
|
+
uuid: string;
|
|
783
|
+
/** First name */
|
|
784
|
+
first_name: string;
|
|
785
|
+
/** Last name */
|
|
786
|
+
last_name: string;
|
|
787
|
+
/** Email address */
|
|
788
|
+
email: string;
|
|
789
|
+
/** User status */
|
|
790
|
+
status: string;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Options for listing user groups.
|
|
794
|
+
*/
|
|
795
|
+
export interface GetUserGroupsOptions {
|
|
796
|
+
/** Filter by status */
|
|
797
|
+
status?: string;
|
|
798
|
+
/** Filter by group type */
|
|
799
|
+
userGroupType?: string;
|
|
800
|
+
/** Search term */
|
|
801
|
+
search?: string;
|
|
802
|
+
/** Name pattern filter */
|
|
803
|
+
namePattern?: string;
|
|
804
|
+
/** Include member IDs (default: false for performance) */
|
|
805
|
+
includeMemberIds?: boolean;
|
|
806
|
+
/** Results limit */
|
|
807
|
+
limit?: number;
|
|
808
|
+
/** Results offset */
|
|
809
|
+
offset?: number;
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Options for listing users.
|
|
813
|
+
*/
|
|
814
|
+
export interface GetUsersOptions {
|
|
815
|
+
/** Filter by status */
|
|
816
|
+
status?: string;
|
|
817
|
+
/** Search term */
|
|
818
|
+
search?: string;
|
|
819
|
+
/** Name pattern filter */
|
|
820
|
+
namePattern?: string;
|
|
821
|
+
/** Email domain filter */
|
|
822
|
+
emailDomain?: string;
|
|
823
|
+
/** Results limit */
|
|
824
|
+
limit?: number;
|
|
825
|
+
/** Results offset */
|
|
826
|
+
offset?: number;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Editor type for dataset columns.
|
|
830
|
+
*/
|
|
831
|
+
export type DatasetEditorType = 'TEXT' | 'NUMERIC' | 'DD_SINGLE' | 'DD_MULTIPLE' | 'DATE';
|
|
832
|
+
/**
|
|
833
|
+
* Column definition for a dataset.
|
|
834
|
+
*/
|
|
835
|
+
export interface DatasetColumnDef {
|
|
836
|
+
/** Column ID (auto-generated if not provided) */
|
|
837
|
+
colId?: string;
|
|
838
|
+
/** Field name */
|
|
839
|
+
field: string;
|
|
840
|
+
/** Column header display name */
|
|
841
|
+
headerName: string;
|
|
842
|
+
/** Editor configuration */
|
|
843
|
+
editor: {
|
|
844
|
+
type: DatasetEditorType;
|
|
845
|
+
select?: {
|
|
846
|
+
label: string;
|
|
847
|
+
source: 'STORAGE';
|
|
848
|
+
storage: {
|
|
849
|
+
getter: string;
|
|
850
|
+
};
|
|
851
|
+
trackBy: string;
|
|
852
|
+
};
|
|
853
|
+
placeholder?: string;
|
|
854
|
+
};
|
|
855
|
+
/** Root path for dimension matching (e.g., 'lines', 'supplier', '') */
|
|
856
|
+
rootPath?: string;
|
|
857
|
+
/** Approval field type */
|
|
858
|
+
approvalField?: 'step_name' | 'user' | 'user_group' | 'limit' | 'manager' | 'dimension' | '';
|
|
859
|
+
/** Whether the column is read-only */
|
|
860
|
+
readonly?: boolean;
|
|
861
|
+
/** Whether this column has checkbox selection */
|
|
862
|
+
checkboxSelection?: boolean;
|
|
863
|
+
/** Whether this is the default label column */
|
|
864
|
+
isDefaultLabel?: boolean;
|
|
865
|
+
/** Whether this is the default track-by column */
|
|
866
|
+
isDefaultTrackBy?: boolean;
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Dataset settings structure.
|
|
870
|
+
*/
|
|
871
|
+
export interface DatasetSettings {
|
|
872
|
+
/** Column definitions */
|
|
873
|
+
columnDefs: DatasetColumnDef[];
|
|
874
|
+
/**
|
|
875
|
+
* Dataset type for approval workflows.
|
|
876
|
+
* - '' (empty): Generic lookup/mapping tables
|
|
877
|
+
* - 'approval_doa': Delegation of Authority
|
|
878
|
+
* - 'approval_doa_group': DOA using user groups
|
|
879
|
+
* - 'approval_management_tree': Manager hierarchy
|
|
880
|
+
* - 'approval_user_limit': User-specific approval limits
|
|
881
|
+
*/
|
|
882
|
+
datasetType: string;
|
|
883
|
+
/**
|
|
884
|
+
* How to handle dimension mismatches:
|
|
885
|
+
* - 'fail_sentence': Stop sentence if no match
|
|
886
|
+
* - 'skip_sentence': Skip to next sentence
|
|
887
|
+
* - 'skip_line': Skip non-matching lines
|
|
888
|
+
*/
|
|
889
|
+
on_dimension_mismatch?: 'fail_sentence' | 'skip_sentence' | 'skip_line';
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Full dataset resource.
|
|
893
|
+
*/
|
|
894
|
+
export interface ZudelloDataset {
|
|
895
|
+
/** Version string */
|
|
896
|
+
version: string;
|
|
897
|
+
/** Creation timestamp */
|
|
898
|
+
created_at: string;
|
|
899
|
+
/** Last update timestamp */
|
|
900
|
+
updated_at: string;
|
|
901
|
+
/** Deletion timestamp (null if active) */
|
|
902
|
+
deleted_at: string | null;
|
|
903
|
+
/** Dataset UUID */
|
|
904
|
+
uuid: string;
|
|
905
|
+
/** Team UUID */
|
|
906
|
+
team_uuid: string;
|
|
907
|
+
/** Whether this is a global resource */
|
|
908
|
+
global_resource: boolean;
|
|
909
|
+
/** Resource type (always 'dataset') */
|
|
910
|
+
resource_type: 'dataset';
|
|
911
|
+
/** Context configuration */
|
|
912
|
+
context: Record<string, unknown> | null;
|
|
913
|
+
/** Dataset payload */
|
|
914
|
+
payload: {
|
|
915
|
+
uuid?: string;
|
|
916
|
+
name: string;
|
|
917
|
+
settings: DatasetSettings;
|
|
918
|
+
};
|
|
919
|
+
/** Error message if any */
|
|
920
|
+
error: string | null;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Simplified dataset summary for listing.
|
|
924
|
+
*/
|
|
925
|
+
export interface DatasetSummary {
|
|
926
|
+
/** Dataset UUID */
|
|
927
|
+
uuid: string;
|
|
928
|
+
/** Dataset name */
|
|
929
|
+
name: string;
|
|
930
|
+
/** Dataset type */
|
|
931
|
+
datasetType: string;
|
|
932
|
+
/** Column definitions (included if requested) */
|
|
933
|
+
columnDefs?: DatasetColumnDef[];
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Notification type definition.
|
|
937
|
+
*/
|
|
938
|
+
export interface NotificationType {
|
|
939
|
+
/** Type key */
|
|
940
|
+
key: string;
|
|
941
|
+
/** Display name */
|
|
942
|
+
name: string;
|
|
943
|
+
/** Description */
|
|
944
|
+
description?: string;
|
|
945
|
+
/** Category */
|
|
946
|
+
category?: string;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* User notification preference.
|
|
950
|
+
*/
|
|
951
|
+
export interface NotificationPreference {
|
|
952
|
+
/** Notification type key */
|
|
953
|
+
notification_type: string;
|
|
954
|
+
/** Whether email notifications are enabled */
|
|
955
|
+
email_enabled: boolean;
|
|
956
|
+
/** Whether in-app notifications are enabled */
|
|
957
|
+
inapp_enabled: boolean;
|
|
958
|
+
/** User UUID */
|
|
959
|
+
user_uuid?: string;
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Language placeholder entry for entity naming.
|
|
963
|
+
*/
|
|
964
|
+
export interface LanguagePlaceholderEntry {
|
|
965
|
+
/** Singular form (e.g., 'Invoice') */
|
|
966
|
+
singular: string;
|
|
967
|
+
/** Plural form (e.g., 'Invoices') */
|
|
968
|
+
plural: string;
|
|
969
|
+
/** Linked model name */
|
|
970
|
+
linkedModel: string;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Language placeholders resource.
|
|
974
|
+
*/
|
|
975
|
+
export interface LanguagePlaceholdersResource {
|
|
976
|
+
/** Resource UUID */
|
|
977
|
+
uuid: string;
|
|
978
|
+
/** Version */
|
|
979
|
+
version: string;
|
|
980
|
+
/** Creation timestamp */
|
|
981
|
+
created_at: string;
|
|
982
|
+
/** Update timestamp */
|
|
983
|
+
updated_at: string;
|
|
984
|
+
/** Deletion timestamp */
|
|
985
|
+
deleted_at: string | null;
|
|
986
|
+
/** Team UUID */
|
|
987
|
+
team_uuid: string;
|
|
988
|
+
/** Whether global */
|
|
989
|
+
global_resource: boolean;
|
|
990
|
+
/** Resource type */
|
|
991
|
+
resource_type: string;
|
|
992
|
+
/** Context */
|
|
993
|
+
context: unknown | null;
|
|
994
|
+
/** Language entries by key */
|
|
995
|
+
payload: {
|
|
996
|
+
lang: Record<string, LanguagePlaceholderEntry>;
|
|
997
|
+
};
|
|
998
|
+
/** Error if any */
|
|
999
|
+
error: string | null;
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Full inbox resource.
|
|
1003
|
+
*/
|
|
1004
|
+
export interface ZudelloInbox {
|
|
1005
|
+
/** Inbox UUID */
|
|
1006
|
+
uuid: string;
|
|
1007
|
+
/** Inbox name */
|
|
1008
|
+
name: string;
|
|
1009
|
+
/** Mailbox address (local part) */
|
|
1010
|
+
mailbox: string;
|
|
1011
|
+
/** Reply-to address */
|
|
1012
|
+
reply_to_address: string | null;
|
|
1013
|
+
/** Custom send domain */
|
|
1014
|
+
custom_send_domain: string | null;
|
|
1015
|
+
/** Custom send mailbox */
|
|
1016
|
+
custom_send_mailbox: string | null;
|
|
1017
|
+
/** Default BCC list */
|
|
1018
|
+
default_bcc_list: string | null;
|
|
1019
|
+
/** Default CC list */
|
|
1020
|
+
default_cc_list: string | null;
|
|
1021
|
+
/** Resource module */
|
|
1022
|
+
resource_module: string;
|
|
1023
|
+
/** Subsidiary UUID */
|
|
1024
|
+
subsidiary: string | null;
|
|
1025
|
+
/** Location UUID */
|
|
1026
|
+
location: string | null;
|
|
1027
|
+
/** Inbox type */
|
|
1028
|
+
inbox_type: string;
|
|
1029
|
+
/** Module */
|
|
1030
|
+
module: string;
|
|
1031
|
+
/** Submodule */
|
|
1032
|
+
submodule: string;
|
|
1033
|
+
/** Whether to extract email body */
|
|
1034
|
+
extract_email_body: boolean;
|
|
1035
|
+
/** Status */
|
|
1036
|
+
status: string;
|
|
1037
|
+
/** Creation timestamp */
|
|
1038
|
+
created_at: string;
|
|
1039
|
+
/** Update timestamp */
|
|
1040
|
+
updated_at: string;
|
|
1041
|
+
/** Deletion timestamp */
|
|
1042
|
+
deleted_at: string | null;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Inbox summary for listing.
|
|
1046
|
+
*/
|
|
1047
|
+
export interface InboxSummary {
|
|
1048
|
+
/** Inbox UUID */
|
|
1049
|
+
uuid: string;
|
|
1050
|
+
/** Inbox name */
|
|
1051
|
+
name: string;
|
|
1052
|
+
/** Mailbox address */
|
|
1053
|
+
mailbox: string;
|
|
1054
|
+
/** Reply-to address */
|
|
1055
|
+
reply_to_address: string | null;
|
|
1056
|
+
/** Full email address (computed) */
|
|
1057
|
+
fullEmailAddress?: string;
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Request to create an inbox.
|
|
1061
|
+
*/
|
|
1062
|
+
export interface CreateInboxRequest {
|
|
1063
|
+
/** Inbox name */
|
|
1064
|
+
name: string;
|
|
1065
|
+
/** Mailbox address (local part before @) */
|
|
1066
|
+
mailbox: string;
|
|
1067
|
+
/** Resource module */
|
|
1068
|
+
resource_module: string;
|
|
1069
|
+
/** Subsidiary UUID (optional) */
|
|
1070
|
+
subsidiary_uuid?: string;
|
|
1071
|
+
/** Location UUID (optional) */
|
|
1072
|
+
location_uuid?: string;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Request to update an inbox.
|
|
1076
|
+
*/
|
|
1077
|
+
export interface UpdateInboxRequest {
|
|
1078
|
+
/** Inbox UUID */
|
|
1079
|
+
uuid: string;
|
|
1080
|
+
/** Inbox name */
|
|
1081
|
+
name?: string;
|
|
1082
|
+
/** Mailbox address */
|
|
1083
|
+
mailbox?: string;
|
|
1084
|
+
/** Resource module */
|
|
1085
|
+
resource_module?: string;
|
|
1086
|
+
/** Reply-to address */
|
|
1087
|
+
reply_to_address?: string | null;
|
|
1088
|
+
/** Default BCC list */
|
|
1089
|
+
default_bcc_list?: string | null;
|
|
1090
|
+
/** Default CC list */
|
|
1091
|
+
default_cc_list?: string | null;
|
|
1092
|
+
/** Subsidiary UUID */
|
|
1093
|
+
subsidiary_uuid?: string | null;
|
|
1094
|
+
/** Location UUID */
|
|
1095
|
+
location_uuid?: string | null;
|
|
1096
|
+
/** Whether to extract email body */
|
|
1097
|
+
extract_email_body?: boolean;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Line item for budget check.
|
|
1101
|
+
*/
|
|
1102
|
+
export interface BudgetCheckLineItem {
|
|
1103
|
+
/** Account UUID */
|
|
1104
|
+
account_id: string;
|
|
1105
|
+
/** Amount */
|
|
1106
|
+
amount: number;
|
|
1107
|
+
/** Currency UUID */
|
|
1108
|
+
currency_id: string;
|
|
1109
|
+
/** Department UUID (optional) */
|
|
1110
|
+
department_id?: string;
|
|
1111
|
+
/** Location UUID (optional) */
|
|
1112
|
+
location_id?: string;
|
|
1113
|
+
/** Project UUID (optional) */
|
|
1114
|
+
project_id?: string;
|
|
1115
|
+
/** Subsidiary UUID (optional) */
|
|
1116
|
+
subsidiary_id?: string;
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* Request to check document budgets.
|
|
1120
|
+
*/
|
|
1121
|
+
export interface BudgetCheckRequest {
|
|
1122
|
+
/** Module (e.g., 'PURCHASING') */
|
|
1123
|
+
module: string;
|
|
1124
|
+
/** Submodule (e.g., 'INVOICE') */
|
|
1125
|
+
submodule: string;
|
|
1126
|
+
/** Transaction UUID (optional for new documents) */
|
|
1127
|
+
transaction_uuid?: string;
|
|
1128
|
+
/** Date to check budgets against */
|
|
1129
|
+
date_issued: string;
|
|
1130
|
+
/** Line items to check */
|
|
1131
|
+
lines: BudgetCheckLineItem[];
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* Result of a budget check for a line.
|
|
1135
|
+
*/
|
|
1136
|
+
export interface BudgetCheckResult {
|
|
1137
|
+
/** Budget line UUID */
|
|
1138
|
+
budget_line_uuid: string;
|
|
1139
|
+
/** Budget UUID */
|
|
1140
|
+
budget_uuid: string;
|
|
1141
|
+
/** Budget name */
|
|
1142
|
+
budget_name: string;
|
|
1143
|
+
/** Budget line name */
|
|
1144
|
+
budget_line_name: string;
|
|
1145
|
+
/** Whether the line passed budget check */
|
|
1146
|
+
passed: boolean;
|
|
1147
|
+
/** Budget amount in local currency */
|
|
1148
|
+
budget_local: number;
|
|
1149
|
+
/** Remaining budget */
|
|
1150
|
+
remaining_local: number;
|
|
1151
|
+
/** Budget owner UUIDs */
|
|
1152
|
+
budget_owner_uuids: string[];
|
|
1153
|
+
/** Budget line owner UUIDs */
|
|
1154
|
+
budget_line_owner_uuids: string[];
|
|
1155
|
+
/** Transaction line UUIDs */
|
|
1156
|
+
transaction_line_uuids: string[];
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Line item for contract pricing check.
|
|
1160
|
+
*/
|
|
1161
|
+
export interface ContractPricingLineItem {
|
|
1162
|
+
/** Item UUID */
|
|
1163
|
+
item_id?: string;
|
|
1164
|
+
/** Purchase price */
|
|
1165
|
+
purchase_price?: number;
|
|
1166
|
+
/** Unit price */
|
|
1167
|
+
unit_price?: number;
|
|
1168
|
+
/** Unit price exclusive of tax */
|
|
1169
|
+
unit_price_exclusive?: number;
|
|
1170
|
+
/** Currency UUID */
|
|
1171
|
+
currency_id?: string;
|
|
1172
|
+
/** Project UUID */
|
|
1173
|
+
project_id?: string;
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Request to check contract pricings.
|
|
1177
|
+
*/
|
|
1178
|
+
export interface ContractPricingRequest {
|
|
1179
|
+
/** Module (e.g., 'PURCHASING') */
|
|
1180
|
+
module: string;
|
|
1181
|
+
/** Submodule (e.g., 'INVOICE') */
|
|
1182
|
+
submodule: string;
|
|
1183
|
+
/** Date to check contracts against */
|
|
1184
|
+
date_issued: string;
|
|
1185
|
+
/** Supplier UUID (for purchasing) */
|
|
1186
|
+
supplier_id?: string;
|
|
1187
|
+
/** Customer UUID (for sales) */
|
|
1188
|
+
customer_id?: string;
|
|
1189
|
+
/** Line items to check */
|
|
1190
|
+
lines: ContractPricingLineItem[];
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Result of contract pricing check.
|
|
1194
|
+
*/
|
|
1195
|
+
export interface ContractPricingResult {
|
|
1196
|
+
/** Contract UUID */
|
|
1197
|
+
contract_uuid: string;
|
|
1198
|
+
/** Contract name */
|
|
1199
|
+
contract_name: string;
|
|
1200
|
+
/** Contract owner UUIDs */
|
|
1201
|
+
owner_uuids: string[];
|
|
1202
|
+
/** Contract effective date */
|
|
1203
|
+
effective_at: string;
|
|
1204
|
+
/** Contract expiry date */
|
|
1205
|
+
expiry_at: string;
|
|
1206
|
+
/** Pricing results for each line */
|
|
1207
|
+
contract_pricings: Array<{
|
|
1208
|
+
/** Exception type */
|
|
1209
|
+
exception: 'NONE' | 'PRICE_VARIANCE' | 'NOT_ON_CONTRACT' | 'EXPIRED';
|
|
1210
|
+
/** Contract price (null if not on contract) */
|
|
1211
|
+
price: number | null;
|
|
1212
|
+
}>;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Organisation team structure.
|
|
1216
|
+
*
|
|
1217
|
+
* Represents a team within an organisation in Zudello.
|
|
1218
|
+
* Teams are workspaces that contain users, data, and configurations.
|
|
1219
|
+
*/
|
|
1220
|
+
export interface OrgTeam {
|
|
1221
|
+
/** Team UUID */
|
|
1222
|
+
uuid: string;
|
|
1223
|
+
/** Team name */
|
|
1224
|
+
name: string;
|
|
1225
|
+
/** Trading name (optional) */
|
|
1226
|
+
trading_name: string | null;
|
|
1227
|
+
/** Tax identification number */
|
|
1228
|
+
tax_number: string | null;
|
|
1229
|
+
/** Contact email */
|
|
1230
|
+
email: string | null;
|
|
1231
|
+
/** Contact phone */
|
|
1232
|
+
phone: string | null;
|
|
1233
|
+
/** Website URL */
|
|
1234
|
+
website: string | null;
|
|
1235
|
+
/** Logo URL */
|
|
1236
|
+
logo: string | null;
|
|
1237
|
+
/** Team type */
|
|
1238
|
+
team_type: 'PRODUCTION' | 'SANDBOX' | 'DEMO';
|
|
1239
|
+
/** Whether notifications are disabled */
|
|
1240
|
+
disable_notifications: boolean;
|
|
1241
|
+
/** Team status */
|
|
1242
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
1243
|
+
/** Country information */
|
|
1244
|
+
country: {
|
|
1245
|
+
uuid: string;
|
|
1246
|
+
name: string;
|
|
1247
|
+
code?: string;
|
|
1248
|
+
} | null;
|
|
1249
|
+
/** Timezone information */
|
|
1250
|
+
timezone: {
|
|
1251
|
+
uuid: string;
|
|
1252
|
+
code: string;
|
|
1253
|
+
} | null;
|
|
1254
|
+
/** Currency information */
|
|
1255
|
+
currency: {
|
|
1256
|
+
uuid: string;
|
|
1257
|
+
code: string;
|
|
1258
|
+
name?: string;
|
|
1259
|
+
symbol?: string;
|
|
1260
|
+
} | null;
|
|
1261
|
+
/** Cluster information */
|
|
1262
|
+
cluster: {
|
|
1263
|
+
uuid: string;
|
|
1264
|
+
name: string;
|
|
1265
|
+
url: string;
|
|
1266
|
+
} | null;
|
|
1267
|
+
/** Creation timestamp */
|
|
1268
|
+
created_at: string;
|
|
1269
|
+
/** Update timestamp */
|
|
1270
|
+
updated_at: string;
|
|
1271
|
+
/** Deletion timestamp */
|
|
1272
|
+
deleted_at: string | null;
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Options for listing organisation teams.
|
|
1276
|
+
*/
|
|
1277
|
+
export interface ListOrgTeamsOptions {
|
|
1278
|
+
/** Maximum number of results */
|
|
1279
|
+
limit?: number;
|
|
1280
|
+
/** Offset for pagination */
|
|
1281
|
+
offset?: number;
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Request to update an organisation team.
|
|
1285
|
+
*/
|
|
1286
|
+
export interface UpdateOrgTeamRequest {
|
|
1287
|
+
/** Team name */
|
|
1288
|
+
name?: string;
|
|
1289
|
+
/** Trading name */
|
|
1290
|
+
trading_name?: string;
|
|
1291
|
+
/** Tax identification number */
|
|
1292
|
+
tax_number?: string;
|
|
1293
|
+
/** Contact email */
|
|
1294
|
+
email?: string;
|
|
1295
|
+
/** Contact phone */
|
|
1296
|
+
phone?: string;
|
|
1297
|
+
/** Website URL */
|
|
1298
|
+
website?: string;
|
|
1299
|
+
/** Team type */
|
|
1300
|
+
team_type?: 'PRODUCTION' | 'SANDBOX' | 'DEMO';
|
|
1301
|
+
/** Disable notifications */
|
|
1302
|
+
disable_notifications?: boolean;
|
|
1303
|
+
/** Country UUID */
|
|
1304
|
+
country_id?: string;
|
|
1305
|
+
/** Currency UUID */
|
|
1306
|
+
currency_id?: string;
|
|
1307
|
+
/** Timezone UUID */
|
|
1308
|
+
timezone_id?: string;
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Organisation user structure.
|
|
1312
|
+
*
|
|
1313
|
+
* Represents a user within an organisation, including their team assignments
|
|
1314
|
+
* and organisation-level permissions.
|
|
1315
|
+
*/
|
|
1316
|
+
export interface OrgUser {
|
|
1317
|
+
/** User UUID */
|
|
1318
|
+
uuid: string;
|
|
1319
|
+
/** First name */
|
|
1320
|
+
first_name: string;
|
|
1321
|
+
/** Last name */
|
|
1322
|
+
last_name: string;
|
|
1323
|
+
/** Email address */
|
|
1324
|
+
email: string;
|
|
1325
|
+
/** Avatar URL */
|
|
1326
|
+
avatar: string | null;
|
|
1327
|
+
/** User status */
|
|
1328
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
1329
|
+
/** Whether this is a machine/service account */
|
|
1330
|
+
is_machine: boolean;
|
|
1331
|
+
/** Zitadel identity provider ID */
|
|
1332
|
+
zitadel_id: number | null;
|
|
1333
|
+
/** Creation timestamp */
|
|
1334
|
+
created_at: string;
|
|
1335
|
+
/** Update timestamp */
|
|
1336
|
+
updated_at: string;
|
|
1337
|
+
/** Deletion timestamp */
|
|
1338
|
+
deleted_at: string | null;
|
|
1339
|
+
/** Organisation memberships */
|
|
1340
|
+
organizations?: Array<{
|
|
1341
|
+
uuid: string;
|
|
1342
|
+
name: string;
|
|
1343
|
+
through__is_admin: boolean;
|
|
1344
|
+
through__status: string;
|
|
1345
|
+
}>;
|
|
1346
|
+
/** Team memberships */
|
|
1347
|
+
teams?: Array<{
|
|
1348
|
+
uuid: string;
|
|
1349
|
+
name: string;
|
|
1350
|
+
through__uuid: string;
|
|
1351
|
+
through__status: string;
|
|
1352
|
+
through__groups: string[];
|
|
1353
|
+
}>;
|
|
1354
|
+
/** TeamUser assignments (detailed) */
|
|
1355
|
+
teamuser_set?: TeamUserAssignment[];
|
|
1356
|
+
/** OrganizationUser assignments */
|
|
1357
|
+
organizationuser_set?: Array<{
|
|
1358
|
+
uuid: string;
|
|
1359
|
+
is_admin: boolean;
|
|
1360
|
+
is_owner: boolean;
|
|
1361
|
+
status: string;
|
|
1362
|
+
}>;
|
|
1363
|
+
}
|
|
1364
|
+
/**
|
|
1365
|
+
* Team-user assignment structure.
|
|
1366
|
+
*
|
|
1367
|
+
* Represents the relationship between a user and a team,
|
|
1368
|
+
* including their groups, delegation settings, and defaults.
|
|
1369
|
+
*/
|
|
1370
|
+
export interface TeamUserAssignment {
|
|
1371
|
+
/** Assignment UUID */
|
|
1372
|
+
uuid: string;
|
|
1373
|
+
/** Team UUID */
|
|
1374
|
+
team: string;
|
|
1375
|
+
/** User UUID */
|
|
1376
|
+
user: string;
|
|
1377
|
+
/** Assignment status */
|
|
1378
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
1379
|
+
/** Whether this is the user's default team */
|
|
1380
|
+
is_default: boolean;
|
|
1381
|
+
/** Manager user UUID */
|
|
1382
|
+
manager: string | null;
|
|
1383
|
+
/** Whether to delegate all duties */
|
|
1384
|
+
delegate_all: boolean;
|
|
1385
|
+
/** Whether delegation is enabled */
|
|
1386
|
+
delegate_duties: boolean;
|
|
1387
|
+
/** User UUID to delegate to */
|
|
1388
|
+
delegate_to_user: string | null;
|
|
1389
|
+
/** Delegation start date (ISO string) */
|
|
1390
|
+
delegate_start: string | null;
|
|
1391
|
+
/** Delegation end date (ISO string) */
|
|
1392
|
+
delegate_end: string | null;
|
|
1393
|
+
/** Default subsidiary UUID */
|
|
1394
|
+
default_subsidiary: string | null;
|
|
1395
|
+
/** Default location UUID */
|
|
1396
|
+
default_location: string | null;
|
|
1397
|
+
/** User groups for this team */
|
|
1398
|
+
groups: Array<{
|
|
1399
|
+
uuid: string;
|
|
1400
|
+
}> | string[];
|
|
1401
|
+
/** Creation timestamp */
|
|
1402
|
+
created_at?: string;
|
|
1403
|
+
/** Update timestamp */
|
|
1404
|
+
updated_at?: string;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* Options for listing organisation users.
|
|
1408
|
+
*/
|
|
1409
|
+
export interface ListOrgUsersOptions {
|
|
1410
|
+
/** Filter by status */
|
|
1411
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
1412
|
+
/** Search term (searches name and email) */
|
|
1413
|
+
search?: string;
|
|
1414
|
+
/** Maximum number of results */
|
|
1415
|
+
limit?: number;
|
|
1416
|
+
/** Offset for pagination */
|
|
1417
|
+
offset?: number;
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Request to create a new organisation user.
|
|
1421
|
+
*/
|
|
1422
|
+
export interface CreateOrgUserRequest {
|
|
1423
|
+
/** First name */
|
|
1424
|
+
first_name: string;
|
|
1425
|
+
/** Last name */
|
|
1426
|
+
last_name: string;
|
|
1427
|
+
/** Email address */
|
|
1428
|
+
email: string;
|
|
1429
|
+
/** Initial password (optional) */
|
|
1430
|
+
password?: string;
|
|
1431
|
+
/** Whether email is pre-verified (default: true) */
|
|
1432
|
+
is_email_verified?: boolean;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Request to update an organisation user.
|
|
1436
|
+
*/
|
|
1437
|
+
export interface UpdateOrgUserRequest {
|
|
1438
|
+
/** First name */
|
|
1439
|
+
first_name?: string;
|
|
1440
|
+
/** Last name */
|
|
1441
|
+
last_name?: string;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Request to assign a user to a team.
|
|
1445
|
+
*/
|
|
1446
|
+
export interface AssignUserToTeamRequest {
|
|
1447
|
+
/** Existing TeamUser UUID (for updates) */
|
|
1448
|
+
teamUserUuid?: string;
|
|
1449
|
+
/** Team UUID */
|
|
1450
|
+
teamId: string;
|
|
1451
|
+
/** User UUID */
|
|
1452
|
+
userId: string;
|
|
1453
|
+
/** Organisation UUID */
|
|
1454
|
+
orgId: string;
|
|
1455
|
+
/** User group UUIDs to assign */
|
|
1456
|
+
groups?: string[];
|
|
1457
|
+
/** Manager user UUID */
|
|
1458
|
+
managerId?: string;
|
|
1459
|
+
/** Whether this is the user's default team */
|
|
1460
|
+
isDefault?: boolean;
|
|
1461
|
+
/** Assignment status */
|
|
1462
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
1463
|
+
/** Default subsidiary UUID */
|
|
1464
|
+
defaultSubsidiary?: string;
|
|
1465
|
+
/** Default location UUID */
|
|
1466
|
+
defaultLocation?: string;
|
|
1467
|
+
/** Whether to delegate all duties */
|
|
1468
|
+
delegateAll?: boolean;
|
|
1469
|
+
/** Whether delegation is enabled */
|
|
1470
|
+
delegateDuties?: boolean;
|
|
1471
|
+
/** User UUID to delegate to */
|
|
1472
|
+
delegateToUserId?: string;
|
|
1473
|
+
/** Delegation start date (ISO string) */
|
|
1474
|
+
delegateStart?: string;
|
|
1475
|
+
/** Delegation end date (ISO string) */
|
|
1476
|
+
delegateEnd?: string;
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Organisation user group structure.
|
|
1480
|
+
*
|
|
1481
|
+
* User groups define access control and approval workflow participation.
|
|
1482
|
+
*/
|
|
1483
|
+
export interface OrgUserGroup {
|
|
1484
|
+
/** Group UUID */
|
|
1485
|
+
uuid: string;
|
|
1486
|
+
/** Group name */
|
|
1487
|
+
name: string;
|
|
1488
|
+
/** Group description */
|
|
1489
|
+
description: string;
|
|
1490
|
+
/** Whether users in this group can delegate */
|
|
1491
|
+
can_delegate: boolean;
|
|
1492
|
+
/** Group status */
|
|
1493
|
+
status: 'ACTIVE' | 'INACTIVE';
|
|
1494
|
+
/**
|
|
1495
|
+
* Group type:
|
|
1496
|
+
* - ACCESS: Controls feature/module access
|
|
1497
|
+
* - APPROVAL: Used in approval workflows
|
|
1498
|
+
* - LEGACY: Deprecated group type
|
|
1499
|
+
*/
|
|
1500
|
+
user_group_type: 'ACCESS' | 'APPROVAL' | 'LEGACY';
|
|
1501
|
+
/** Count of permissions assigned */
|
|
1502
|
+
permissions_count?: number;
|
|
1503
|
+
/** Team users in this group */
|
|
1504
|
+
team_users?: Array<{
|
|
1505
|
+
uuid: string;
|
|
1506
|
+
}> | null;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Options for listing organisation user groups.
|
|
1510
|
+
*/
|
|
1511
|
+
export interface ListOrgUserGroupsOptions {
|
|
1512
|
+
/** Filter by status */
|
|
1513
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
1514
|
+
/** Filter by group type */
|
|
1515
|
+
userGroupType?: 'ACCESS' | 'APPROVAL' | 'LEGACY';
|
|
1516
|
+
/** Search term (searches name and description) */
|
|
1517
|
+
search?: string;
|
|
1518
|
+
/** Include team user IDs in response */
|
|
1519
|
+
includeTeamUsers?: boolean;
|
|
1520
|
+
/** Maximum number of results */
|
|
1521
|
+
limit?: number;
|
|
1522
|
+
/** Offset for pagination */
|
|
1523
|
+
offset?: number;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Filter for dropdown select options.
|
|
1527
|
+
*/
|
|
1528
|
+
export interface FieldSettingsSelectFilter {
|
|
1529
|
+
/** Field to filter on */
|
|
1530
|
+
field: string;
|
|
1531
|
+
/** Value(s) to match */
|
|
1532
|
+
value: string | string[];
|
|
1533
|
+
/** Comparison operator */
|
|
1534
|
+
operator: 'EQUAL' | 'NOT_EQUAL' | 'CONTAINS' | 'NOT_CONTAINS' | null;
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Editor select configuration for dropdowns.
|
|
1538
|
+
*/
|
|
1539
|
+
export interface FieldSettingsSelectConfig {
|
|
1540
|
+
/** Display format string (e.g., '{code} - {name}', 'name') */
|
|
1541
|
+
label: string;
|
|
1542
|
+
/** Data source type */
|
|
1543
|
+
source: 'STORAGE' | 'DATASET';
|
|
1544
|
+
/** Storage configuration (when source=STORAGE) */
|
|
1545
|
+
storage?: {
|
|
1546
|
+
getter: string;
|
|
1547
|
+
};
|
|
1548
|
+
/** Dataset configuration (when source=DATASET) */
|
|
1549
|
+
dataset?: {
|
|
1550
|
+
uuid: string | null;
|
|
1551
|
+
};
|
|
1552
|
+
/** Field to track by (usually 'uuid' or 'value') */
|
|
1553
|
+
trackBy: string;
|
|
1554
|
+
/** Include ERP value in response */
|
|
1555
|
+
withErpValue?: boolean;
|
|
1556
|
+
/** Filtering options */
|
|
1557
|
+
filters?: FieldSettingsSelectFilter[];
|
|
1558
|
+
}
|
|
1559
|
+
/**
|
|
1560
|
+
* Editor configuration for a field.
|
|
1561
|
+
*/
|
|
1562
|
+
export interface FieldSettingsEditor {
|
|
1563
|
+
/** Editor type */
|
|
1564
|
+
type: 'TEXT' | 'NUMERIC' | 'BOOLEAN' | 'DATE' | 'DD_SINGLE' | 'DD_MULTIPLE';
|
|
1565
|
+
/** Placeholder text */
|
|
1566
|
+
placeholder?: string;
|
|
1567
|
+
/** Input mask (for TEXT, e.g., 'XXX-XX-XXXX', '######') */
|
|
1568
|
+
mask?: string;
|
|
1569
|
+
/** Numeric configuration (for NUMERIC) */
|
|
1570
|
+
numeric?: {
|
|
1571
|
+
precision: number;
|
|
1572
|
+
};
|
|
1573
|
+
/** Default value */
|
|
1574
|
+
default?: boolean | string | number | unknown[];
|
|
1575
|
+
/** Select configuration (for DD_SINGLE/DD_MULTIPLE) */
|
|
1576
|
+
select?: FieldSettingsSelectConfig;
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Validation rule parameters.
|
|
1580
|
+
*/
|
|
1581
|
+
export interface FieldSettingsValidationParams {
|
|
1582
|
+
/** Value for maxLength/minLength */
|
|
1583
|
+
value?: number;
|
|
1584
|
+
/** Path for requiredIf */
|
|
1585
|
+
path?: string;
|
|
1586
|
+
/** Condition operator (e.g., '==') */
|
|
1587
|
+
condition?: string;
|
|
1588
|
+
/** Category for requiredIf */
|
|
1589
|
+
category?: string;
|
|
1590
|
+
/** Subcategory for requiredIf */
|
|
1591
|
+
subcategory?: string;
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Validation rule for a field.
|
|
1595
|
+
*/
|
|
1596
|
+
export interface FieldSettingsValidation {
|
|
1597
|
+
/** Validation type */
|
|
1598
|
+
key: 'required' | 'requiredIf' | 'number' | 'maxLength' | 'minLength';
|
|
1599
|
+
/** Validation severity */
|
|
1600
|
+
level: 'error' | 'warning' | 'info';
|
|
1601
|
+
/** Validation parameters */
|
|
1602
|
+
params: FieldSettingsValidationParams;
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Display/behavior rule parameters.
|
|
1606
|
+
*/
|
|
1607
|
+
export interface FieldSettingsRuleParams {
|
|
1608
|
+
/** Path for visibleIf */
|
|
1609
|
+
path?: string;
|
|
1610
|
+
/** Value for visibleIf */
|
|
1611
|
+
value?: string;
|
|
1612
|
+
/** Condition for visibleIf */
|
|
1613
|
+
condition?: string;
|
|
1614
|
+
/** Category for visibleIf */
|
|
1615
|
+
category?: string;
|
|
1616
|
+
/** Subcategory for visibleIf */
|
|
1617
|
+
subcategory?: string;
|
|
1618
|
+
/** Template for computeField */
|
|
1619
|
+
template?: string;
|
|
1620
|
+
/** Counter key for computeField */
|
|
1621
|
+
counterKey?: string;
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Display/behavior rule.
|
|
1625
|
+
*/
|
|
1626
|
+
export interface FieldSettingsRule {
|
|
1627
|
+
/** Rule type */
|
|
1628
|
+
name: 'visibleIf' | 'computeField';
|
|
1629
|
+
/** Rule parameters */
|
|
1630
|
+
params: FieldSettingsRuleParams;
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Form data structure for field settings.
|
|
1634
|
+
*/
|
|
1635
|
+
export interface FieldSettingsFormData {
|
|
1636
|
+
/** Editor configuration */
|
|
1637
|
+
editor: FieldSettingsEditor;
|
|
1638
|
+
/** Tooltip text */
|
|
1639
|
+
tooltip: string;
|
|
1640
|
+
/** Validation rules */
|
|
1641
|
+
validations: FieldSettingsValidation[];
|
|
1642
|
+
/** Display/behavior rules */
|
|
1643
|
+
rules: FieldSettingsRule[];
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Payload for field settings resource.
|
|
1647
|
+
*/
|
|
1648
|
+
export interface FieldSettingsPayload {
|
|
1649
|
+
/** Field path (e.g., 'supplier.trading_name') */
|
|
1650
|
+
path: string;
|
|
1651
|
+
/** UUID (set after creation) */
|
|
1652
|
+
uuid?: string;
|
|
1653
|
+
/** Display label */
|
|
1654
|
+
label: string;
|
|
1655
|
+
/** Model name this field belongs to */
|
|
1656
|
+
model_name: string;
|
|
1657
|
+
/** Form data with editor and validation config */
|
|
1658
|
+
form_data: FieldSettingsFormData;
|
|
1659
|
+
}
|
|
1660
|
+
/**
|
|
1661
|
+
* Full field settings resource.
|
|
1662
|
+
*/
|
|
1663
|
+
export interface ZudelloFieldSettings {
|
|
1664
|
+
/** Resource version */
|
|
1665
|
+
version: number;
|
|
1666
|
+
/** Resource UUID */
|
|
1667
|
+
uuid: string;
|
|
1668
|
+
/** Team UUID */
|
|
1669
|
+
team_uuid: string;
|
|
1670
|
+
/** Context (module -> submodule[] mapping) */
|
|
1671
|
+
context: Record<string, string[]>;
|
|
1672
|
+
/** Field settings payload */
|
|
1673
|
+
payload: FieldSettingsPayload;
|
|
1674
|
+
/** Creation timestamp */
|
|
1675
|
+
created_at: string;
|
|
1676
|
+
/** Update timestamp */
|
|
1677
|
+
updated_at: string;
|
|
1678
|
+
/** Deletion timestamp */
|
|
1679
|
+
deleted_at: string | null;
|
|
1680
|
+
/** Whether this is a global resource */
|
|
1681
|
+
global_resource: boolean;
|
|
1682
|
+
/** Resource type */
|
|
1683
|
+
resource_type: 'field_settings';
|
|
1684
|
+
/** Error message if any */
|
|
1685
|
+
error: string | null;
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* Simplified field settings for listing.
|
|
1689
|
+
*/
|
|
1690
|
+
export interface FieldSettingsSummary {
|
|
1691
|
+
/** Resource UUID */
|
|
1692
|
+
uuid: string;
|
|
1693
|
+
/** Field path */
|
|
1694
|
+
path: string;
|
|
1695
|
+
/** Display label */
|
|
1696
|
+
label: string;
|
|
1697
|
+
/** Model name */
|
|
1698
|
+
model_name: string;
|
|
1699
|
+
/** Context mapping */
|
|
1700
|
+
context: Record<string, string[]>;
|
|
1701
|
+
}
|
|
1702
|
+
/**
|
|
1703
|
+
* Payload for document status resource.
|
|
1704
|
+
*/
|
|
1705
|
+
export interface DocumentStatusPayload {
|
|
1706
|
+
/** Status key (e.g., 'REVIEW', 'APPROVED') */
|
|
1707
|
+
key: string;
|
|
1708
|
+
/** Display name */
|
|
1709
|
+
name: string;
|
|
1710
|
+
/** Status type */
|
|
1711
|
+
type: string;
|
|
1712
|
+
/** Color code (hex or name) */
|
|
1713
|
+
color: string;
|
|
1714
|
+
/** Whether the status is enabled */
|
|
1715
|
+
isEnabled: boolean;
|
|
1716
|
+
/** Whether the status is selected by default */
|
|
1717
|
+
isSelected: boolean;
|
|
1718
|
+
/** Whether users can manually set this status */
|
|
1719
|
+
canSetManually: boolean;
|
|
1720
|
+
/** Display order */
|
|
1721
|
+
order: number;
|
|
1722
|
+
/** UUID (set after creation) */
|
|
1723
|
+
uuid?: string;
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* Full document status resource.
|
|
1727
|
+
*/
|
|
1728
|
+
export interface ZudelloDocumentStatus {
|
|
1729
|
+
/** Resource version */
|
|
1730
|
+
version: string;
|
|
1731
|
+
/** Resource UUID */
|
|
1732
|
+
uuid: string;
|
|
1733
|
+
/** Team UUID */
|
|
1734
|
+
team_uuid: string;
|
|
1735
|
+
/** Context (module -> submodule[] mapping) */
|
|
1736
|
+
context: Record<string, string[]>;
|
|
1737
|
+
/** Status payload */
|
|
1738
|
+
payload: DocumentStatusPayload;
|
|
1739
|
+
/** Creation timestamp */
|
|
1740
|
+
created_at: string;
|
|
1741
|
+
/** Update timestamp */
|
|
1742
|
+
updated_at: string;
|
|
1743
|
+
/** Deletion timestamp */
|
|
1744
|
+
deleted_at: string | null;
|
|
1745
|
+
/** Whether this is a global resource */
|
|
1746
|
+
global_resource: boolean;
|
|
1747
|
+
/** Resource type */
|
|
1748
|
+
resource_type: 'document_status';
|
|
1749
|
+
/** Error message if any */
|
|
1750
|
+
error: string | null;
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Options for listing document statuses.
|
|
1754
|
+
*/
|
|
1755
|
+
export interface ListStatusesOptions {
|
|
1756
|
+
/** Filter by module */
|
|
1757
|
+
module?: string;
|
|
1758
|
+
/** Filter by submodule */
|
|
1759
|
+
submodule?: string;
|
|
1760
|
+
/** Paths to include */
|
|
1761
|
+
includePaths?: string[];
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Payload for quick action resource.
|
|
1765
|
+
*/
|
|
1766
|
+
export interface QuickActionPayload {
|
|
1767
|
+
/** Action key (unique identifier) */
|
|
1768
|
+
key: string;
|
|
1769
|
+
/** Display name */
|
|
1770
|
+
name: string;
|
|
1771
|
+
/** Keyboard shortcut */
|
|
1772
|
+
hotkey?: string;
|
|
1773
|
+
/** Status filter */
|
|
1774
|
+
status?: string;
|
|
1775
|
+
/** Context (module/submodule scope) */
|
|
1776
|
+
context?: Record<string, string[]>;
|
|
1777
|
+
/** Whether this is an internal action */
|
|
1778
|
+
isInternal?: boolean;
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Full quick action resource.
|
|
1782
|
+
*/
|
|
1783
|
+
export interface ZudelloQuickAction {
|
|
1784
|
+
/** Resource version */
|
|
1785
|
+
version: string;
|
|
1786
|
+
/** Resource UUID */
|
|
1787
|
+
uuid: string;
|
|
1788
|
+
/** Team UUID */
|
|
1789
|
+
team_uuid: string;
|
|
1790
|
+
/** Context (quick actions have context inside payload) */
|
|
1791
|
+
context: null;
|
|
1792
|
+
/** Quick action payload */
|
|
1793
|
+
payload: QuickActionPayload;
|
|
1794
|
+
/** Creation timestamp */
|
|
1795
|
+
created_at: string;
|
|
1796
|
+
/** Update timestamp */
|
|
1797
|
+
updated_at: string;
|
|
1798
|
+
/** Deletion timestamp */
|
|
1799
|
+
deleted_at: string | null;
|
|
1800
|
+
/** Whether this is a global resource */
|
|
1801
|
+
global_resource: boolean;
|
|
1802
|
+
/** Resource type */
|
|
1803
|
+
resource_type: 'quick_actions';
|
|
1804
|
+
/** Error message if any */
|
|
1805
|
+
error: string | null;
|
|
1806
|
+
}
|
|
1807
|
+
/**
|
|
1808
|
+
* Response from triggering a quick action.
|
|
1809
|
+
*/
|
|
1810
|
+
export interface QuickActionTriggerResponse {
|
|
1811
|
+
/** Whether the trigger succeeded */
|
|
1812
|
+
success: boolean;
|
|
1813
|
+
/** Status message */
|
|
1814
|
+
status: string;
|
|
1815
|
+
/** UUIDs of successfully processed documents */
|
|
1816
|
+
succeeded: string[];
|
|
1817
|
+
/** UUIDs of failed documents */
|
|
1818
|
+
failed: string[];
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Export filter structure.
|
|
1822
|
+
*/
|
|
1823
|
+
export interface ExportFilter {
|
|
1824
|
+
/** Field to filter on */
|
|
1825
|
+
field: string;
|
|
1826
|
+
/** Field data type */
|
|
1827
|
+
fieldType: 'String' | 'Number' | 'Date' | 'DateTime' | 'Relation';
|
|
1828
|
+
/** Filter operator */
|
|
1829
|
+
operator: string;
|
|
1830
|
+
/** Filter value */
|
|
1831
|
+
value: unknown;
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Payload for export template resource.
|
|
1835
|
+
*/
|
|
1836
|
+
export interface ExportTemplatePayload {
|
|
1837
|
+
/** Template UUID (empty for new templates) */
|
|
1838
|
+
uuid?: string;
|
|
1839
|
+
/** Template name */
|
|
1840
|
+
name: string;
|
|
1841
|
+
/** Export type */
|
|
1842
|
+
export_type: 'csv' | 'originals';
|
|
1843
|
+
/** Model to export */
|
|
1844
|
+
model_name: string;
|
|
1845
|
+
/** Module filter */
|
|
1846
|
+
module: string;
|
|
1847
|
+
/** Submodule filter */
|
|
1848
|
+
submodule: string;
|
|
1849
|
+
/** Raw filter conditions */
|
|
1850
|
+
raw_filter: ExportFilter[];
|
|
1851
|
+
/** Fields to include in export */
|
|
1852
|
+
selected_fields: string[];
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Full export template resource.
|
|
1856
|
+
*/
|
|
1857
|
+
export interface ZudelloExportTemplate {
|
|
1858
|
+
/** Resource version */
|
|
1859
|
+
version: string;
|
|
1860
|
+
/** Resource UUID */
|
|
1861
|
+
uuid: string;
|
|
1862
|
+
/** Team UUID */
|
|
1863
|
+
team_uuid: string;
|
|
1864
|
+
/** Context (export templates have null context) */
|
|
1865
|
+
context: null;
|
|
1866
|
+
/** Export template payload */
|
|
1867
|
+
payload: ExportTemplatePayload;
|
|
1868
|
+
/** Creation timestamp */
|
|
1869
|
+
created_at: string;
|
|
1870
|
+
/** Update timestamp */
|
|
1871
|
+
updated_at: string;
|
|
1872
|
+
/** Deletion timestamp */
|
|
1873
|
+
deleted_at: string | null;
|
|
1874
|
+
/** Whether this is a global resource */
|
|
1875
|
+
global_resource: boolean;
|
|
1876
|
+
/** Resource type */
|
|
1877
|
+
resource_type: 'export_template';
|
|
1878
|
+
/** Error message if any */
|
|
1879
|
+
error: string | null;
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Data export record (from search results).
|
|
1883
|
+
*/
|
|
1884
|
+
export interface ZudelloDataExport {
|
|
1885
|
+
/** Export UUID */
|
|
1886
|
+
uuid: string;
|
|
1887
|
+
/** User who created the export */
|
|
1888
|
+
created_by: {
|
|
1889
|
+
uuid: string;
|
|
1890
|
+
};
|
|
1891
|
+
/** Creation timestamp */
|
|
1892
|
+
created_at: string;
|
|
1893
|
+
/** Export status */
|
|
1894
|
+
status: string;
|
|
1895
|
+
/** S3 location */
|
|
1896
|
+
s3_location: string;
|
|
1897
|
+
/** Number of times downloaded */
|
|
1898
|
+
download_count: number;
|
|
1899
|
+
/** Template name used */
|
|
1900
|
+
template_name: string;
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
1903
|
+
* Request to run an export.
|
|
1904
|
+
*/
|
|
1905
|
+
export interface ExportRunRequest {
|
|
1906
|
+
/** Model to export */
|
|
1907
|
+
model: string;
|
|
1908
|
+
/** Fields to select */
|
|
1909
|
+
select: string[];
|
|
1910
|
+
/** Filter criteria */
|
|
1911
|
+
filter: Record<string, unknown>;
|
|
1912
|
+
/** Exclusion criteria */
|
|
1913
|
+
exclude?: Record<string, unknown>;
|
|
1914
|
+
/** Offset for pagination */
|
|
1915
|
+
offset?: number;
|
|
1916
|
+
/** Limit for pagination */
|
|
1917
|
+
limit?: number;
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Document type field definition.
|
|
1921
|
+
*/
|
|
1922
|
+
export interface DocumentTypeField {
|
|
1923
|
+
/** Field path */
|
|
1924
|
+
path: string;
|
|
1925
|
+
/** Display label */
|
|
1926
|
+
label: string;
|
|
1927
|
+
/** Validation rules */
|
|
1928
|
+
rules: unknown[] | null;
|
|
1929
|
+
/** Editor configuration */
|
|
1930
|
+
editor: {
|
|
1931
|
+
type: string;
|
|
1932
|
+
select?: {
|
|
1933
|
+
label: string;
|
|
1934
|
+
source: string;
|
|
1935
|
+
storage?: {
|
|
1936
|
+
getter: string;
|
|
1937
|
+
};
|
|
1938
|
+
trackBy: string;
|
|
1939
|
+
params?: Record<string, unknown>;
|
|
1940
|
+
filters?: unknown[];
|
|
1941
|
+
};
|
|
1942
|
+
subtype?: string;
|
|
1943
|
+
placeholder?: string;
|
|
1944
|
+
default?: unknown;
|
|
1945
|
+
numeric?: {
|
|
1946
|
+
precision: number;
|
|
1947
|
+
};
|
|
1948
|
+
};
|
|
1949
|
+
/** Section configuration */
|
|
1950
|
+
section: {
|
|
1951
|
+
key: string;
|
|
1952
|
+
cols: number;
|
|
1953
|
+
order: number;
|
|
1954
|
+
};
|
|
1955
|
+
/** Tooltip text */
|
|
1956
|
+
tooltip: string | null;
|
|
1957
|
+
/** Whether field is visible */
|
|
1958
|
+
visible: boolean;
|
|
1959
|
+
/** Whether field is editable */
|
|
1960
|
+
editable: boolean;
|
|
1961
|
+
/** Renderer configuration */
|
|
1962
|
+
renderer: {
|
|
1963
|
+
width?: number;
|
|
1964
|
+
align?: string;
|
|
1965
|
+
horizontal?: boolean;
|
|
1966
|
+
break?: {
|
|
1967
|
+
after?: boolean;
|
|
1968
|
+
before?: boolean;
|
|
1969
|
+
};
|
|
1970
|
+
};
|
|
1971
|
+
/** Validation definitions */
|
|
1972
|
+
validations: Array<{
|
|
1973
|
+
key: string;
|
|
1974
|
+
level: string;
|
|
1975
|
+
params: Record<string, unknown>;
|
|
1976
|
+
}> | null;
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Document type section definition.
|
|
1980
|
+
*/
|
|
1981
|
+
export interface DocumentTypeSection {
|
|
1982
|
+
/** Section key */
|
|
1983
|
+
key: string;
|
|
1984
|
+
/** Display label */
|
|
1985
|
+
label: string;
|
|
1986
|
+
/** Display order */
|
|
1987
|
+
order: number;
|
|
1988
|
+
/** Whether this is a system section */
|
|
1989
|
+
system: boolean;
|
|
1990
|
+
/** Whether section is visible */
|
|
1991
|
+
visible: boolean;
|
|
1992
|
+
/** Whether section is collapsed by default */
|
|
1993
|
+
collapse: boolean;
|
|
1994
|
+
/** Whether section is editable */
|
|
1995
|
+
editable: boolean;
|
|
1996
|
+
/** Whether section is expandable */
|
|
1997
|
+
expandable: boolean;
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Payload for document type resource.
|
|
2001
|
+
*/
|
|
2002
|
+
export interface DocumentTypePayload {
|
|
2003
|
+
/** Display name */
|
|
2004
|
+
display: string;
|
|
2005
|
+
/** Type identifier */
|
|
2006
|
+
type: string;
|
|
2007
|
+
/** Module */
|
|
2008
|
+
module: string;
|
|
2009
|
+
/** Submodule */
|
|
2010
|
+
submodule: string;
|
|
2011
|
+
/** Field definitions */
|
|
2012
|
+
fields: DocumentTypeField[];
|
|
2013
|
+
/** Section definitions */
|
|
2014
|
+
sections: DocumentTypeSection[];
|
|
2015
|
+
}
|
|
2016
|
+
/**
|
|
2017
|
+
* Full document type resource.
|
|
2018
|
+
*/
|
|
2019
|
+
export interface ZudelloDocumentType {
|
|
2020
|
+
/** Resource version */
|
|
2021
|
+
version: string;
|
|
2022
|
+
/** Resource UUID */
|
|
2023
|
+
uuid: string;
|
|
2024
|
+
/** Team UUID */
|
|
2025
|
+
team_uuid: string;
|
|
2026
|
+
/** Context (module -> submodule[] mapping) */
|
|
2027
|
+
context: Record<string, string[]> | null;
|
|
2028
|
+
/** Document type payload */
|
|
2029
|
+
payload: DocumentTypePayload;
|
|
2030
|
+
/** Creation timestamp */
|
|
2031
|
+
created_at: string;
|
|
2032
|
+
/** Update timestamp */
|
|
2033
|
+
updated_at: string;
|
|
2034
|
+
/** Deletion timestamp */
|
|
2035
|
+
deleted_at: string | null;
|
|
2036
|
+
/** Whether this is a global resource */
|
|
2037
|
+
global_resource: boolean;
|
|
2038
|
+
/** Resource type */
|
|
2039
|
+
resource_type: 'document_type';
|
|
2040
|
+
/** Error message if any */
|
|
2041
|
+
error: string | null;
|
|
2042
|
+
}
|
|
2043
|
+
/**
|
|
2044
|
+
* Options for listing document types.
|
|
2045
|
+
*/
|
|
2046
|
+
export interface ListDocumentTypesOptions {
|
|
2047
|
+
/** Filter by module */
|
|
2048
|
+
module?: string;
|
|
2049
|
+
/** Filter by submodule */
|
|
2050
|
+
submodule?: string;
|
|
2051
|
+
/** Paths to include */
|
|
2052
|
+
includePaths?: string[];
|
|
2053
|
+
/** Whether to include global resources (default: false) */
|
|
2054
|
+
globalResource?: boolean;
|
|
2055
|
+
}
|
|
2056
|
+
//# sourceMappingURL=types.d.ts.map
|