iom-sdk 0.1.2

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.
@@ -0,0 +1,97 @@
1
+ import { ApiResponse, UUID } from '@/types';
2
+ /**
3
+ * Get UUIDs owned by the current user/client
4
+ * Uses /api/UUID/own endpoint from swagger-uuid.json
5
+ *
6
+ * @param client - HTTP client instance
7
+ * @param baseURL - Optional base URL for the UUID service (different from main API)
8
+ * @returns UUIDs owned by the current user/client
9
+ */
10
+ export declare const getOwnedUUIDs: (client?: {
11
+ get: <T>(url: string, params?: Record<string, any>) => Promise<ApiResponse<T>>;
12
+ getBinary: <T = ArrayBuffer>(url: string) => Promise<ApiResponse<T>>;
13
+ post: <T>(url: string, data?: any, config?: import("axios").AxiosRequestConfig) => Promise<ApiResponse<T>>;
14
+ postForm: <T>(url: string, formData: any) => Promise<ApiResponse<T>>;
15
+ put: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
16
+ delete: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
17
+ config: import("@/types").ClientConfig;
18
+ }, baseURL?: string) => () => Promise<ApiResponse<any>>;
19
+ /**
20
+ * Create a new UUID
21
+ * Updated to use /api/UUID endpoint from new swagger-uuid.json
22
+ *
23
+ * @param client - HTTP client instance
24
+ * @param baseURL - Optional base URL for the UUID service (different from main API)
25
+ * @returns The newly created UUID data
26
+ */
27
+ export declare const createUUID: (client?: {
28
+ get: <T>(url: string, params?: Record<string, any>) => Promise<ApiResponse<T>>;
29
+ getBinary: <T = ArrayBuffer>(url: string) => Promise<ApiResponse<T>>;
30
+ post: <T>(url: string, data?: any, config?: import("axios").AxiosRequestConfig) => Promise<ApiResponse<T>>;
31
+ postForm: <T>(url: string, formData: any) => Promise<ApiResponse<T>>;
32
+ put: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
33
+ delete: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
34
+ config: import("@/types").ClientConfig;
35
+ }, baseURL?: string) => () => Promise<ApiResponse<{
36
+ uuid: UUID;
37
+ }>>;
38
+ /**
39
+ * Get UUID record by UUID
40
+ * Updated to use /api/UUID/{uuid} endpoint from new swagger-uuid.json
41
+ *
42
+ * @param client - HTTP client instance
43
+ * @param baseURL - Optional base URL for the UUID service (different from main API)
44
+ * @param uuid - UUID to find
45
+ * @returns UUID record data
46
+ */
47
+ export declare const getUUIDRecord: (client?: {
48
+ get: <T>(url: string, params?: Record<string, any>) => Promise<ApiResponse<T>>;
49
+ getBinary: <T = ArrayBuffer>(url: string) => Promise<ApiResponse<T>>;
50
+ post: <T>(url: string, data?: any, config?: import("axios").AxiosRequestConfig) => Promise<ApiResponse<T>>;
51
+ postForm: <T>(url: string, formData: any) => Promise<ApiResponse<T>>;
52
+ put: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
53
+ delete: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
54
+ config: import("@/types").ClientConfig;
55
+ }, baseURL?: string) => (uuid: UUID) => Promise<ApiResponse<any>>;
56
+ /**
57
+ * Update UUID record metadata
58
+ * New endpoint from swagger-uuid.json
59
+ *
60
+ * @param client - HTTP client instance
61
+ * @param baseURL - Optional base URL for the UUID service (different from main API)
62
+ * @param params - UUID record metadata update parameters
63
+ * @returns Updated UUID record data
64
+ */
65
+ export declare const updateUUIDRecordMeta: (client?: {
66
+ get: <T>(url: string, params?: Record<string, any>) => Promise<ApiResponse<T>>;
67
+ getBinary: <T = ArrayBuffer>(url: string) => Promise<ApiResponse<T>>;
68
+ post: <T>(url: string, data?: any, config?: import("axios").AxiosRequestConfig) => Promise<ApiResponse<T>>;
69
+ postForm: <T>(url: string, formData: any) => Promise<ApiResponse<T>>;
70
+ put: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
71
+ delete: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
72
+ config: import("@/types").ClientConfig;
73
+ }, baseURL?: string) => (params: {
74
+ uuid?: UUID;
75
+ nodeType: string;
76
+ }) => Promise<ApiResponse<any>>;
77
+ /**
78
+ * Authorize UUID record access
79
+ * New endpoint from swagger-uuid.json
80
+ *
81
+ * @param client - HTTP client instance
82
+ * @param baseURL - Optional base URL for the UUID service (different from main API)
83
+ * @param params - Authorization parameters
84
+ * @returns Authorization response
85
+ */
86
+ export declare const authorizeUUIDRecord: (client?: {
87
+ get: <T>(url: string, params?: Record<string, any>) => Promise<ApiResponse<T>>;
88
+ getBinary: <T = ArrayBuffer>(url: string) => Promise<ApiResponse<T>>;
89
+ post: <T>(url: string, data?: any, config?: import("axios").AxiosRequestConfig) => Promise<ApiResponse<T>>;
90
+ postForm: <T>(url: string, formData: any) => Promise<ApiResponse<T>>;
91
+ put: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
92
+ delete: <T>(url: string, data?: any) => Promise<ApiResponse<T>>;
93
+ config: import("@/types").ClientConfig;
94
+ }, baseURL?: string) => (params: {
95
+ userUUID: UUID;
96
+ resourceId: UUID;
97
+ }) => Promise<ApiResponse<any>>;
@@ -0,0 +1,457 @@
1
+ export type UUID = string;
2
+ export declare enum Predicate {
3
+ IS_PARENT_OF = "IS_PARENT_OF",
4
+ IS_CHILD_OF = "IS_CHILD_OF",
5
+ IS_INPUT_OF = "IS_INPUT_OF",
6
+ IS_OUTPUT_OF = "IS_OUTPUT_OF",
7
+ IS_SOURCE_TEMPLATE_OF = "IS_SOURCE_TEMPLATE_OF",
8
+ IS_TEMPLATE_INSTANCE_OF = "IS_TEMPLATE_INSTANCE_OF",
9
+ IS_PROPERTY_OF = "IS_PROPERTY_OF",
10
+ HAS_PROPERTY = "HAS_PROPERTY",
11
+ IS_VALUE_OF = "IS_VALUE_OF",
12
+ HAS_VALUE = "HAS_VALUE",
13
+ IS_FILE_OF = "IS_FILE_OF",
14
+ HAS_FILE = "HAS_FILE",
15
+ HAS_ADDRESS = "HAS_ADDRESS",
16
+ IS_ADDRESS_OF = "IS_ADDRESS_OF"
17
+ }
18
+ export interface QueryParams {
19
+ uuid?: UUID;
20
+ softDeleted?: boolean;
21
+ }
22
+ export interface UUStatementFindDTO {
23
+ subject?: UUID;
24
+ predicate?: Predicate;
25
+ object?: UUID;
26
+ softDeleted?: boolean;
27
+ }
28
+ export interface StatementQueryParams extends UUStatementFindDTO {
29
+ }
30
+ export interface UUStatementsPropertyValue {
31
+ value?: string;
32
+ }
33
+ export interface UUStatementsProperty {
34
+ key?: string;
35
+ values?: UUStatementsPropertyValue[];
36
+ }
37
+ export interface UUStatementDTO {
38
+ subject: UUID;
39
+ predicate: Predicate;
40
+ object: UUID;
41
+ properties?: UUStatementsProperty[];
42
+ }
43
+ export interface UUPropertyDTO {
44
+ uuid: UUID;
45
+ key: string;
46
+ version?: string;
47
+ label?: string;
48
+ description?: string;
49
+ type?: string;
50
+ inputType?: string;
51
+ formula?: string;
52
+ inputOrderPosition?: number;
53
+ processingOrderPosition?: number;
54
+ viewOrderPosition?: number;
55
+ }
56
+ export interface UUPropertyValueDTO {
57
+ uuid: UUID;
58
+ value?: string;
59
+ valueTypeCast?: string;
60
+ sourceType?: string;
61
+ }
62
+ export interface UUObjectDTO {
63
+ uuid: UUID;
64
+ version?: string;
65
+ name?: string;
66
+ abbreviation?: string;
67
+ description?: string;
68
+ isTemplate?: boolean;
69
+ }
70
+ export interface UUFileDTO {
71
+ uuid: UUID;
72
+ fileName?: string;
73
+ fileReference?: string;
74
+ label?: string;
75
+ contentType?: string;
76
+ size?: number;
77
+ }
78
+ export interface UUAddressDTO {
79
+ uuid: UUID;
80
+ fullAddress?: string;
81
+ street?: string;
82
+ houseNumber?: string;
83
+ city?: string;
84
+ postalCode?: string;
85
+ country?: string;
86
+ state?: string;
87
+ district?: string;
88
+ }
89
+ export interface ClientConfig {
90
+ baseUrl: string;
91
+ uuidServiceBaseUrl?: string;
92
+ certificate?: {
93
+ cert: string;
94
+ key: string;
95
+ };
96
+ timeout?: number;
97
+ headers?: Record<string, string>;
98
+ debug?: {
99
+ enabled: boolean;
100
+ logLevel?: 'error' | 'info';
101
+ logToConsole?: boolean;
102
+ logCallback?: (message: string, data?: any) => void;
103
+ };
104
+ }
105
+ export interface UUObjectWithProperties {
106
+ object: UUObjectDTO;
107
+ properties: Array<{
108
+ property: UUPropertyDTO;
109
+ value?: UUPropertyValueDTO;
110
+ }>;
111
+ children?: UUObjectDTO[];
112
+ files?: UUFileDTO[];
113
+ }
114
+ export interface ComplexObjectCreationInput {
115
+ object: Omit<UUObjectDTO, 'uuid'>;
116
+ parents?: UUID[];
117
+ files?: Array<{
118
+ file: Omit<UUFileDTO, 'uuid'>;
119
+ }>;
120
+ properties?: Array<{
121
+ property: Omit<UUPropertyDTO, 'uuid'> & {
122
+ key: string;
123
+ };
124
+ values?: Array<{
125
+ value: Omit<UUPropertyValueDTO, 'uuid'>;
126
+ files?: Array<{
127
+ file: Omit<UUFileDTO, 'uuid'>;
128
+ }>;
129
+ }>;
130
+ files?: Array<{
131
+ file: Omit<UUFileDTO, 'uuid'>;
132
+ }>;
133
+ }>;
134
+ address?: Omit<UUAddressDTO, 'uuid'>;
135
+ }
136
+ export interface ComplexObjectOutput {
137
+ object: UUObjectDTO;
138
+ properties: Array<{
139
+ property: UUPropertyDTO;
140
+ values: Array<{
141
+ value: UUPropertyValueDTO;
142
+ files: UUFileDTO[];
143
+ }>;
144
+ files: UUFileDTO[];
145
+ }>;
146
+ files: UUFileDTO[];
147
+ address?: UUAddressDTO;
148
+ parents?: UUObjectDTO[];
149
+ }
150
+ export interface ApiResponse<T> {
151
+ data: T;
152
+ status: number;
153
+ statusText: string;
154
+ headers?: Record<string, string>;
155
+ }
156
+ export interface ApiError {
157
+ status: number;
158
+ statusText: string;
159
+ message: string;
160
+ details?: any;
161
+ }
162
+ /**
163
+ * Auth response from mTLS authentication endpoint
164
+ * Based on actual API response structure with certificate information
165
+ */
166
+ export interface AuthResponse {
167
+ userUUID: string;
168
+ credentials: string;
169
+ createdAt: string;
170
+ certificateInfo: {
171
+ certificateSha256: string;
172
+ subjectFields: {
173
+ CN: string;
174
+ [key: string]: string;
175
+ };
176
+ issuerFields: {
177
+ CN: string;
178
+ [key: string]: string;
179
+ };
180
+ serialNumber: string;
181
+ validFrom: string;
182
+ validTo: string;
183
+ subjectAlternativeNames: string[];
184
+ };
185
+ enabled: boolean;
186
+ accountNonExpired: boolean;
187
+ credentialsNonExpired: boolean;
188
+ accountNonLocked: boolean;
189
+ }
190
+ /**
191
+ * Aggregate search parameters for the /api/Aggregate/search endpoint
192
+ * Updated to support the new POST method with searchBy functionality
193
+ */
194
+ export interface AggregateFindDTO {
195
+ page?: number;
196
+ size?: number;
197
+ hasChildrenFull?: boolean;
198
+ hasHistory?: boolean;
199
+ hasParentUUIDFilter?: boolean;
200
+ parentUUID?: string;
201
+ searchTerm?: string;
202
+ searchBy?: Record<string, any>;
203
+ }
204
+ /**
205
+ * Aggregate file entity with metadata
206
+ */
207
+ export interface AggregateFile {
208
+ createdAt?: string;
209
+ createdBy?: AuditUser;
210
+ lastUpdatedAt?: string;
211
+ lastUpdatedBy?: AuditUser;
212
+ softDeletedAt?: string;
213
+ softDeleteBy?: AuditUser;
214
+ softDeleted?: boolean;
215
+ uuid?: string;
216
+ fileName?: string;
217
+ fileReference?: string;
218
+ label?: string;
219
+ contentType?: string;
220
+ size?: number;
221
+ }
222
+ /**
223
+ * Aggregate property entity with optional values
224
+ */
225
+ export interface AggregateProperty {
226
+ createdAt?: string;
227
+ createdBy?: AuditUser;
228
+ lastUpdatedAt?: string;
229
+ lastUpdatedBy?: AuditUser;
230
+ softDeletedAt?: string;
231
+ softDeleteBy?: AuditUser;
232
+ softDeleted?: boolean;
233
+ uuid?: string;
234
+ key?: string;
235
+ version?: string;
236
+ label?: string;
237
+ description?: string;
238
+ type?: string;
239
+ inputType?: string;
240
+ formula?: string;
241
+ inputOrderPosition?: number;
242
+ processingOrderPosition?: number;
243
+ viewOrderPosition?: number;
244
+ values?: AggregateUUPropertyValue[];
245
+ files?: AggregateUUFile[];
246
+ }
247
+ /**
248
+ * Aggregate address entity with metadata
249
+ */
250
+ export interface AggregateUUAddress {
251
+ createdAt: string;
252
+ createdBy: string;
253
+ lastUpdatedAt: string;
254
+ lastUpdatedBy: string;
255
+ softDeletedAt?: string;
256
+ softDeleteBy?: string;
257
+ softDeleted: boolean;
258
+ uuid: string;
259
+ fullAddress?: string;
260
+ street?: string;
261
+ houseNumber?: string;
262
+ city?: string;
263
+ postalCode?: string;
264
+ country?: string;
265
+ state?: string;
266
+ district?: string;
267
+ }
268
+ /**
269
+ * Rich aggregate entity with all relationships and metadata
270
+ */
271
+ export interface AggregateEntity {
272
+ createdAt?: string;
273
+ createdBy?: AuditUser;
274
+ lastUpdatedAt?: string;
275
+ lastUpdatedBy?: AuditUser;
276
+ softDeletedAt?: string;
277
+ softDeleteBy?: AuditUser;
278
+ softDeleted?: boolean;
279
+ uuid?: string;
280
+ name?: string;
281
+ abbreviation?: string;
282
+ version?: string;
283
+ description?: string;
284
+ isTemplate?: boolean;
285
+ address?: AggregateUUAddress;
286
+ parents?: string[];
287
+ children?: string[];
288
+ inputs?: string[];
289
+ outputs?: string[];
290
+ sourceTemplates?: string[];
291
+ templateInstances?: string[];
292
+ files?: AggregateUUFile[];
293
+ properties?: AggregateUUProperty[];
294
+ history?: AggregateUUObject[];
295
+ }
296
+ /**
297
+ * Paginated response for aggregate entities
298
+ */
299
+ export interface PageAggregateEntity {
300
+ totalPages: number;
301
+ totalElements: number;
302
+ size: number;
303
+ content: AggregateEntity[];
304
+ number: number;
305
+ numberOfElements: number;
306
+ first: boolean;
307
+ last: boolean;
308
+ empty: boolean;
309
+ pageable: {
310
+ paged: boolean;
311
+ pageNumber: number;
312
+ pageSize: number;
313
+ offset: number;
314
+ sort: {
315
+ sorted: boolean;
316
+ empty: boolean;
317
+ unsorted: boolean;
318
+ };
319
+ unpaged: boolean;
320
+ };
321
+ sort: {
322
+ sorted: boolean;
323
+ empty: boolean;
324
+ unsorted: boolean;
325
+ };
326
+ }
327
+ export interface AggregateCreateDTO {
328
+ aggregateEntityList: AggregateEntityCreateDTO[];
329
+ user: UserDetailsCustom;
330
+ }
331
+ export interface AggregateEntityCreateDTO {
332
+ name?: string;
333
+ abbreviation?: string;
334
+ version?: string;
335
+ description?: string;
336
+ isTemplate?: boolean;
337
+ parents?: UUID[];
338
+ address?: AggregateUUAddressCreateDTO;
339
+ files?: AggregateUUFileCreateDTO[];
340
+ properties?: AggregateUUPropertyCreateDTO[];
341
+ }
342
+ export interface AggregateUUAddressCreateDTO {
343
+ fullAddress?: string;
344
+ street?: string;
345
+ houseNumber?: string;
346
+ city?: string;
347
+ postalCode?: string;
348
+ country?: string;
349
+ state?: string;
350
+ district?: string;
351
+ }
352
+ export interface AggregateUUFileCreateDTO {
353
+ fileName?: string;
354
+ fileReference?: string;
355
+ label?: string;
356
+ contentType?: string;
357
+ size?: number;
358
+ }
359
+ export interface AggregateUUPropertyCreateDTO {
360
+ key?: string;
361
+ version?: string;
362
+ label?: string;
363
+ description?: string;
364
+ type?: string;
365
+ inputType?: string;
366
+ formula?: string;
367
+ inputOrderPosition?: number;
368
+ processingOrderPosition?: number;
369
+ viewOrderPosition?: number;
370
+ values?: AggregateUUPropertyValueCreateDTO[];
371
+ files?: AggregateUUFileCreateDTO[];
372
+ }
373
+ export interface AggregateUUPropertyValueCreateDTO {
374
+ value?: string;
375
+ valueTypeCast?: string;
376
+ sourceType?: string;
377
+ files?: AggregateUUFileCreateDTO[];
378
+ }
379
+ export interface UserDetailsCustom {
380
+ userUUID?: string;
381
+ credentials?: any;
382
+ createdAt?: string;
383
+ enabled?: boolean;
384
+ accountNonExpired?: boolean;
385
+ credentialsNonExpired?: boolean;
386
+ accountNonLocked?: boolean;
387
+ }
388
+ export interface AuditUser {
389
+ userUUID?: string;
390
+ credentials?: string;
391
+ }
392
+ export interface AggregateUUFile {
393
+ createdAt?: string;
394
+ createdBy?: AuditUser;
395
+ lastUpdatedAt?: string;
396
+ lastUpdatedBy?: AuditUser;
397
+ softDeletedAt?: string;
398
+ softDeleteBy?: AuditUser;
399
+ softDeleted?: boolean;
400
+ uuid?: string;
401
+ fileName?: string;
402
+ fileReference?: string;
403
+ label?: string;
404
+ contentType?: string;
405
+ size?: number;
406
+ }
407
+ export interface AggregateUUProperty {
408
+ createdAt?: string;
409
+ createdBy?: AuditUser;
410
+ lastUpdatedAt?: string;
411
+ lastUpdatedBy?: AuditUser;
412
+ softDeletedAt?: string;
413
+ softDeleteBy?: AuditUser;
414
+ softDeleted?: boolean;
415
+ uuid?: string;
416
+ key?: string;
417
+ version?: string;
418
+ label?: string;
419
+ description?: string;
420
+ type?: string;
421
+ inputType?: string;
422
+ formula?: string;
423
+ inputOrderPosition?: number;
424
+ processingOrderPosition?: number;
425
+ viewOrderPosition?: number;
426
+ values?: AggregateUUPropertyValue[];
427
+ files?: AggregateUUFile[];
428
+ }
429
+ export interface AggregateUUPropertyValue {
430
+ createdAt?: string;
431
+ createdBy?: AuditUser;
432
+ lastUpdatedAt?: string;
433
+ lastUpdatedBy?: AuditUser;
434
+ softDeletedAt?: string;
435
+ softDeleteBy?: AuditUser;
436
+ softDeleted?: boolean;
437
+ uuid?: string;
438
+ value?: string;
439
+ valueTypeCast?: string;
440
+ sourceType?: string;
441
+ files?: AggregateUUFile[];
442
+ }
443
+ export interface AggregateUUObject {
444
+ createdAt?: string;
445
+ createdBy?: AuditUser;
446
+ lastUpdatedAt?: string;
447
+ lastUpdatedBy?: AuditUser;
448
+ softDeletedAt?: string;
449
+ softDeleteBy?: AuditUser;
450
+ softDeleted?: boolean;
451
+ uuid?: string;
452
+ name?: string;
453
+ abbreviation?: string;
454
+ version?: string;
455
+ description?: string;
456
+ isTemplate?: boolean;
457
+ }
@@ -0,0 +1,3 @@
1
+ export * from './validate';
2
+ export * from './query-params';
3
+ export * from './schemas';
@@ -0,0 +1,32 @@
1
+ import { QueryParams, StatementQueryParams, AggregateFindDTO } from '@/types';
2
+ /**
3
+ * Validates and cleans common query parameters
4
+ * Removes undefined values to avoid sending them in requests
5
+ *
6
+ * @param params - Query parameters to validate
7
+ * @returns Clean validated parameters or undefined if no params
8
+ */
9
+ export declare const validateQueryParams: (params?: QueryParams) => Record<string, any> | undefined;
10
+ /**
11
+ * Validates and cleans statement query parameters
12
+ * Removes undefined values to avoid sending them in requests
13
+ *
14
+ * @param params - Statement query parameters to validate
15
+ * @returns Clean validated parameters or undefined if no params
16
+ */
17
+ export declare const validateStatementQueryParams: (params?: StatementQueryParams) => Record<string, any> | undefined;
18
+ /**
19
+ * Validates and cleans aggregate find parameters
20
+ * Removes undefined values to avoid sending them in requests
21
+ *
22
+ * @param params - Aggregate find parameters to validate
23
+ * @returns Clean validated parameters or undefined if no params
24
+ */
25
+ export declare const validateAggregateParams: (params?: AggregateFindDTO) => Record<string, any> | undefined;
26
+ /**
27
+ * Validates a single UUID parameter
28
+ *
29
+ * @param uuid - UUID to validate
30
+ * @returns Validated UUID
31
+ */
32
+ export declare const validateUuid: (uuid: string) => string;