@ptkl/sdk 0.9.8 → 0.9.10

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/dist/monaco.d.ts CHANGED
@@ -1,3 +1,31 @@
1
+ declare module "@ptkl/sdk" {
2
+ import Platform from './api/platform';
3
+ export { default as Component } from './api/component';
4
+ export { default as Integration } from './api/integrations';
5
+ export { default as Ratchet } from './api/ratchet';
6
+ export { default as Sandbox } from './api/sandbox';
7
+ export { default as System } from './api/system';
8
+ export { default as User } from './api/users';
9
+ export { default as Functions } from './api/functions';
10
+ export { default as APIUser } from './api/apiUser';
11
+ export { default as Roles } from './api/roles';
12
+ export { default as Apps } from './api/apps';
13
+ export { default as Workflow } from './api/workflow';
14
+ export { default as ComponentUtils } from './api/componentUtils';
15
+ export { default as Thunder } from './api/thunder';
16
+ export { default as Forge } from './api/forge';
17
+ export { default as Integrations } from './api/integrations';
18
+ export { default as Payments } from './api/integrations/payments';
19
+ export { default as Invoicing } from './api/integrations/invoicing';
20
+ export { default as DMS } from './api/integrations/dms';
21
+ export { default as SerbiaUtil } from './api/integrations/serbiaUtil';
22
+ export { default as VPFR } from './api/integrations/vpfr';
23
+ export type * from './types/component';
24
+ export type * from './types/integrations';
25
+ export type * from './types/users';
26
+ export default Platform;
27
+
28
+ }
1
29
 
2
30
  // Type definitions
3
31
  declare type FindParams = {
@@ -111,17 +139,106 @@ declare type PDFFormStructure = {
111
139
  declare type PDFOutputType = 'pdf' | 'base64' | 'file';
112
140
 
113
141
  declare type PDFFillOptions = {
114
- input_html?: string;
115
142
  input_path?: string;
116
143
  output_path?: string;
117
144
  output_pdf?: boolean;
118
145
  output_type?: PDFOutputType;
119
146
  output_file_name?: string;
120
- data?: Record<string, any>;
121
147
  form_data?: Record<string, any>;
122
148
  forms?: PDFFormStructure[] | any;
123
149
  };
124
150
 
151
+ declare type HTML2PDFOptions = {
152
+ input_html?: string;
153
+ input_path?: string;
154
+ output_path?: string;
155
+ output_pdf?: boolean;
156
+ output_type?: PDFOutputType;
157
+ output_file_name?: string;
158
+ data?: Record<string, any>;
159
+ };
160
+
161
+ /**
162
+ * Supported data formats for conversion operations
163
+ */
164
+ declare type DataFormat = 'json' | 'csv' | 'excel' | 'xlsx';
165
+
166
+ /**
167
+ * Parameters for data conversion between formats
168
+ */
169
+ declare type DataConversionParams = {
170
+ /** Source format */
171
+ from: DataFormat;
172
+ /** Target format */
173
+ to: DataFormat;
174
+ /** Optional Excel sheet name (defaults to "Sheet1") */
175
+ sheet_name?: string;
176
+ /** Include header section in output (default: true) */
177
+ include_header?: boolean;
178
+ /** Include footer section in output (default: true) */
179
+ include_footer?: boolean;
180
+ /** Render header as comments in CSV (default: false) */
181
+ header_as_comment?: boolean;
182
+ /** Render footer as comments in CSV (default: false) */
183
+ footer_as_comment?: boolean;
184
+ /** Empty rows between sections (default: 1) */
185
+ separator_rows?: number;
186
+ };
187
+
188
+ /**
189
+ * Parameters for data format validation
190
+ */
191
+ declare type DataValidationParams = {
192
+ /** Format to validate against */
193
+ format: DataFormat;
194
+ };
195
+
196
+ /**
197
+ * Parameters for data analysis and information extraction
198
+ */
199
+ declare type DataInfoParams = {
200
+ /** Format of the data to analyze */
201
+ format: DataFormat;
202
+ };
203
+
204
+ /**
205
+ * Information about analyzed data structure and content
206
+ */
207
+ declare type DataInfo = {
208
+ /** Detected or specified format */
209
+ format: string;
210
+ /** Size of data in bytes */
211
+ size_bytes: number;
212
+ /** Number of records/rows */
213
+ record_count: number;
214
+ /** Number of fields/columns */
215
+ field_count: number;
216
+ /** Array of field/column names */
217
+ fields: string[];
218
+ /** Library reference UUID */
219
+ library_ref: string;
220
+ };
221
+
222
+ /**
223
+ * Result of data format validation
224
+ */
225
+ declare type DataValidationResult = {
226
+ /** Whether the data is valid for the specified format */
227
+ valid: boolean;
228
+ /** Validation message (success or error details) */
229
+ message: string;
230
+ /** Library reference UUID */
231
+ library_ref: string;
232
+ };
233
+
234
+ /**
235
+ * Optional parameters for data conversion operations
236
+ */
237
+ declare type ConversionOptions = {
238
+ /** Excel sheet name for read/write operations (defaults to "Sheet1") */
239
+ sheet_name?: string;
240
+ };
241
+
125
242
  declare interface UserModel {
126
243
  uuid: string;
127
244
  name: string;
@@ -215,11 +332,20 @@ declare class DMSConstructor extends IntegrationsBaseClientConstructor {
215
332
  getMedia(lib: string, key: string, encoding: string): Promise<any>;
216
333
  download(lib: string, key: string): Promise<any>;
217
334
  getExifData(lib: string, key: string): Promise<any>;
218
- html2pdf(lib: string, data: any): Promise<any>;
335
+ html2pdf(lib: string, data: HTML2PDFOptions): Promise<any>;
219
336
  createDir(lib: string, path: string): Promise<any>;
220
337
  deleteDir(lib: string, path: string): Promise<any>;
221
338
  dirs(lib: string, data: string): Promise<any>;
222
339
  fillPdf(lib: string, data: PDFFillOptions): Promise<any>;
340
+ convertData(lib: string, data: any, params: DataConversionParams): Promise<any>;
341
+ getDataInfo(lib: string, data: any, params: DataInfoParams): Promise<any>;
342
+ validateData(lib: string, data: any, params: DataValidationParams): Promise<any>;
343
+ jsonToCsv(lib: string, jsonData: any): Promise<any>;
344
+ jsonToExcel(lib: string, jsonData: any, options?: ConversionOptions): Promise<any>;
345
+ csvToJson(lib: string, csvData: string): Promise<any>;
346
+ csvToExcel(lib: string, csvData: string, options?: ConversionOptions): Promise<any>;
347
+ excelToJson(lib: string, excelData: Blob | ArrayBuffer, options?: ConversionOptions): Promise<any>;
348
+ excelToCsv(lib: string, excelData: Blob | ArrayBuffer, options?: ConversionOptions): Promise<any>;
223
349
  request(method: string, endpoint: string, params?: any): Promise<any>;
224
350
  requestv1(method: string, endpoint: string, params?: any): Promise<any>;
225
351
  }
@@ -393,6 +519,7 @@ declare class VPFRConstructor extends IntegrationsBaseClientConstructor {
393
519
  declare class WorkflowConstructor extends PlatformBaseClientConstructor {
394
520
  constructor();
395
521
  trigger(id: string, event: string, data: any): Promise<any>;
522
+ publish(event: string, data: any): Promise<any>;
396
523
  }
397
524
 
398
525
  interface ProtokolSDK {
@@ -411,7 +538,7 @@ interface ProtokolSDK {
411
538
  Integrations: typeof IntegrationsConstructor;
412
539
  Payments: typeof PaymentsConstructor;
413
540
  Invoicing: typeof InvoicingConstructor;
414
- Media: typeof MediaConstructor;
541
+ DMS: typeof DMSConstructor;
415
542
  SerbiaUtil: typeof SerbiaUtilConstructor;
416
543
  VPFR: typeof VPFRConstructor;
417
544
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.9.8",
3
+ "version": "0.9.10",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",
@@ -1,19 +1,419 @@
1
1
  import IntegrationsBaseClient from "../integrationsBaseClient";
2
- import { PDFFillOptions } from "../../types/integrations";
2
+ import { AxiosResponse } from "axios";
3
+ import { PDFFillOptions, DataConversionParams, DataValidationParams, DataInfoParams, DataInfo, DataValidationResult, ConversionOptions, HTML2PDFOptions } from "../../types/integrations";
4
+ /**
5
+ * Document Management System (DMS) API client
6
+ *
7
+ * Provides comprehensive document and media management capabilities including:
8
+ * - File upload, download, and management
9
+ * - PDF generation and form filling
10
+ * - Data conversion between JSON, CSV, and Excel formats
11
+ * - Media processing and EXIF data extraction
12
+ *
13
+ * ## Data Conversion Features
14
+ *
15
+ * The DMS class includes powerful data conversion capabilities that allow you to:
16
+ * - Convert between JSON, CSV, and Excel (.xlsx) formats
17
+ * - Handle structured data with header, items, and footer sections
18
+ * - Auto-detect structured patterns in JSON arrays
19
+ * - Validate data format integrity
20
+ * - Analyze data structure and metadata
21
+ * - Handle large datasets with memory-efficient processing
22
+ *
23
+ * ### Supported Formats
24
+ * - **JSON**: Array of objects (recommended for tabular data) or structured objects
25
+ * - **CSV**: Comma-separated values with headers and optional comments
26
+ * - **Excel**: .xlsx format with optional sheet specification
27
+ *
28
+ * ### Structured Data Support
29
+ * When converting from JSON, the API supports:
30
+ *
31
+ * **Explicit Structure**: JSON with dedicated sections
32
+ * ```json
33
+ * {
34
+ * "header": { "content": { "title": "Report" } },
35
+ * "items": [{ "name": "Data" }],
36
+ * "footer": { "content": { "total": 100 } }
37
+ * }
38
+ * ```
39
+ *
40
+ * **Auto-Detection**: Mixed arrays with metadata and summary objects
41
+ * ```json
42
+ * [
43
+ * { "metadata": "Header info" },
44
+ * { "name": "John", "age": 30 },
45
+ * { "summary": "Footer info" }
46
+ * ]
47
+ * ```
48
+ *
49
+ * ### Error Handling
50
+ * All conversion methods may throw errors with code 3003 for conversion failures.
51
+ * Always wrap calls in try-catch blocks for production use.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * import { DMS } from 'protokol-sdk';
56
+ *
57
+ * const dms = new DMS({
58
+ * token: 'your-bearer-token',
59
+ * host: 'http://localhost:8086'
60
+ * });
61
+ *
62
+ * const libraryRef = 'your-library-uuid';
63
+ *
64
+ * // Convert structured JSON to CSV with comments
65
+ * const structuredData = {
66
+ * header: { content: { title: "Sales Report" } },
67
+ * items: [{ product: "Widget", sales: 100 }],
68
+ * footer: { content: { total: 100 } }
69
+ * };
70
+ *
71
+ * try {
72
+ * const csvResult = await dms.convertData(libraryRef, structuredData, {
73
+ * from: 'json',
74
+ * to: 'csv',
75
+ * header_as_comment: true
76
+ * });
77
+ * console.log(csvResult.data); // CSV with header as comments
78
+ * } catch (error) {
79
+ * console.error('Conversion failed:', error.message);
80
+ * }
81
+ * ```
82
+ */
3
83
  export default class DMS extends IntegrationsBaseClient {
4
- list(data: any): Promise<import("axios").AxiosResponse<any, any>>;
5
- libraries(): Promise<import("axios").AxiosResponse<any, any>>;
6
- upload(payload: any): Promise<import("axios").AxiosResponse<any, any> | undefined>;
7
- delete(data: any): Promise<import("axios").AxiosResponse<any, any>>;
8
- uploadBase64(data: any): Promise<import("axios").AxiosResponse<any, any>>;
9
- getMedia(lib: string, key: string, encoding: string): Promise<import("axios").AxiosResponse<any, any>>;
10
- download(lib: string, key: string): Promise<import("axios").AxiosResponse<any, any>>;
11
- getExifData(lib: string, key: string): Promise<import("axios").AxiosResponse<any, any>>;
12
- html2pdf(lib: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
13
- createDir(lib: string, path: string): Promise<import("axios").AxiosResponse<any, any>>;
14
- deleteDir(lib: string, path: string): Promise<import("axios").AxiosResponse<any, any>>;
15
- dirs(lib: string, data: string): Promise<import("axios").AxiosResponse<any, any>>;
16
- fillPdf(lib: string, data: PDFFillOptions): Promise<import("axios").AxiosResponse<any, any>>;
17
- request(method: string, endpoint: string, params?: any): Promise<import("axios").AxiosResponse<any, any>>;
18
- requestv1(method: string, endpoint: string, params?: any): Promise<import("axios").AxiosResponse<any, any>>;
84
+ list(data: any): Promise<AxiosResponse<any, any>>;
85
+ libraries(): Promise<AxiosResponse<any, any>>;
86
+ upload(payload: any): Promise<AxiosResponse<any, any> | undefined>;
87
+ delete(data: any): Promise<AxiosResponse<any, any>>;
88
+ uploadBase64(data: any): Promise<AxiosResponse<any, any>>;
89
+ getMedia(lib: string, key: string, encoding: string): Promise<AxiosResponse<any, any>>;
90
+ download(lib: string, key: string): Promise<AxiosResponse<any, any>>;
91
+ getExifData(lib: string, key: string): Promise<AxiosResponse<any, any>>;
92
+ html2pdf(lib: string, data: HTML2PDFOptions): Promise<AxiosResponse<any, any>>;
93
+ createDir(lib: string, path: string): Promise<AxiosResponse<any, any>>;
94
+ deleteDir(lib: string, path: string): Promise<AxiosResponse<any, any>>;
95
+ dirs(lib: string, data: string): Promise<AxiosResponse<any, any>>;
96
+ fillPdf(lib: string, data: PDFFillOptions): Promise<AxiosResponse<any, any>>;
97
+ /**
98
+ * Convert data between different formats (JSON, CSV, Excel)
99
+ *
100
+ * Supports structured data when converting from JSON format with:
101
+ * - Explicit structure: JSON with `header`, `items`, and `footer` properties
102
+ * - Auto-detection: Mixed JSON arrays with metadata objects and summary rows
103
+ *
104
+ * @param lib - Library reference UUID
105
+ * @param data - Raw data to convert
106
+ * @param params - Conversion parameters including structured data options
107
+ * @returns Promise resolving to converted data
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * // Convert JSON to CSV
112
+ * const jsonData = [
113
+ * { name: "John Doe", age: 30, email: "john@example.com" },
114
+ * { name: "Jane Smith", age: 25, email: "jane@example.com" }
115
+ * ];
116
+ *
117
+ * const csvResult = await dms.convertData(libraryRef, jsonData, {
118
+ * from: 'json',
119
+ * to: 'csv'
120
+ * });
121
+ * console.log(csvResult.data); // CSV string
122
+ *
123
+ * // Convert structured JSON with header as comments
124
+ * const structuredData = {
125
+ * header: {
126
+ * content: {
127
+ * report_title: "Monthly Sales Report",
128
+ * generated_by: "Sales System"
129
+ * }
130
+ * },
131
+ * items: [
132
+ * { product: "Widget A", sales: 100 },
133
+ * { product: "Widget B", sales: 150 }
134
+ * ],
135
+ * footer: {
136
+ * content: {
137
+ * total_sales: 250
138
+ * }
139
+ * }
140
+ * };
141
+ *
142
+ * const csvWithComments = await dms.convertData(libraryRef, structuredData, {
143
+ * from: 'json',
144
+ * to: 'csv',
145
+ * header_as_comment: true,
146
+ * separator_rows: 2
147
+ * });
148
+ *
149
+ * // Convert JSON to Excel with custom sheet name
150
+ * const excelResult = await dms.convertData(libraryRef, jsonData, {
151
+ * from: 'json',
152
+ * to: 'excel',
153
+ * sheet_name: 'Customer Data'
154
+ * });
155
+ * // excelResult.data is a Blob
156
+ * ```
157
+ */
158
+ convertData(lib: string, data: any, params: DataConversionParams): Promise<AxiosResponse<any>>;
159
+ /**
160
+ * Get information about data format and structure
161
+ *
162
+ * @param lib - Library reference UUID
163
+ * @param data - Raw data to analyze
164
+ * @param params - Analysis parameters
165
+ * @returns Promise resolving to data information
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * const jsonData = [
170
+ * { name: "John", age: 30, email: "john@example.com" },
171
+ * { name: "Jane", age: 25, email: "jane@example.com" }
172
+ * ];
173
+ *
174
+ * const dataInfo = await dms.getDataInfo(libraryRef, jsonData, {
175
+ * format: 'json'
176
+ * });
177
+ *
178
+ * console.log(dataInfo.data);
179
+ * // Output:
180
+ * // {
181
+ * // format: "json",
182
+ * // size_bytes: 245,
183
+ * // record_count: 2,
184
+ * // field_count: 3,
185
+ * // fields: ["name", "age", "email"],
186
+ * // library_ref: "98bee1cb-0f21-4582-a832-7c32b4b61831"
187
+ * // }
188
+ * ```
189
+ */
190
+ getDataInfo(lib: string, data: any, params: DataInfoParams): Promise<AxiosResponse<DataInfo>>;
191
+ /**
192
+ * Validate data format without performing conversion
193
+ *
194
+ * @param lib - Library reference UUID
195
+ * @param data - Raw data to validate
196
+ * @param params - Validation parameters
197
+ * @returns Promise resolving to validation result
198
+ *
199
+ * @example
200
+ * ```typescript
201
+ * const jsonData = [{ name: "John", age: 30 }];
202
+ *
203
+ * const validation = await dms.validateData(libraryRef, jsonData, {
204
+ * format: 'json'
205
+ * });
206
+ *
207
+ * console.log(validation.data);
208
+ * // Output:
209
+ * // {
210
+ * // valid: true,
211
+ * // message: "Data is valid JSON format",
212
+ * // library_ref: "98bee1cb-0f21-4582-a832-7c32b4b61831"
213
+ * // }
214
+ *
215
+ * // Handle invalid data
216
+ * try {
217
+ * const invalidValidation = await dms.validateData(libraryRef, "invalid json", {
218
+ * format: 'json'
219
+ * });
220
+ * } catch (error) {
221
+ * console.error('Validation failed:', error.response?.data?.message);
222
+ * }
223
+ * ```
224
+ */
225
+ validateData(lib: string, data: any, params: DataValidationParams): Promise<AxiosResponse<DataValidationResult>>;
226
+ /**
227
+ * Convert JSON data to CSV format
228
+ *
229
+ * This method supports both regular JSON arrays and structured data with auto-detection:
230
+ * - Regular arrays are converted directly to CSV
231
+ * - Structured data (with metadata objects) is automatically detected and formatted
232
+ *
233
+ * @param lib - Library reference UUID
234
+ * @param jsonData - JSON data (array of objects or structured data)
235
+ * @returns Promise resolving to CSV string
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * // Regular JSON to CSV
240
+ * const jsonData = [
241
+ * { name: "John Doe", age: 30, email: "john@example.com" },
242
+ * { name: "Jane Smith", age: 25, email: "jane@example.com" }
243
+ * ];
244
+ *
245
+ * const csvResponse = await dms.jsonToCsv(libraryRef, jsonData);
246
+ * console.log(csvResponse.data);
247
+ * // Output:
248
+ * // name,age,email
249
+ * // John Doe,30,john@example.com
250
+ * // Jane Smith,25,jane@example.com
251
+ *
252
+ * // Structured JSON with auto-detection
253
+ * const structuredData = [
254
+ * { metadata: "EMPLOYEE REPORT\nGenerated: 2025-10-08" },
255
+ * { name: "John Doe", age: 30, position: "Developer" },
256
+ * { name: "Jane Smith", age: 25, position: "Designer" },
257
+ * { name: "Total Employees:", age: null, position: "2 people" }
258
+ * ];
259
+ *
260
+ * const structuredCsv = await dms.jsonToCsv(libraryRef, structuredData);
261
+ * // Auto-detects header, items, and footer sections
262
+ * ```
263
+ */
264
+ jsonToCsv(lib: string, jsonData: any): Promise<AxiosResponse<string>>;
265
+ /**
266
+ * Convert JSON data to Excel (.xlsx) format
267
+ *
268
+ * Supports both regular JSON arrays and structured data patterns.
269
+ * Excel files are always generated with .xlsx extension.
270
+ *
271
+ * @param lib - Library reference UUID
272
+ * @param jsonData - JSON data (array of objects or structured data)
273
+ * @param options - Optional conversion options
274
+ * @returns Promise resolving to Excel file as Blob
275
+ *
276
+ * @example
277
+ * ```typescript
278
+ * // Regular JSON to Excel
279
+ * const jsonData = [
280
+ * { name: "John Doe", age: 30, email: "john@example.com" },
281
+ * { name: "Jane Smith", age: 25, email: "jane@example.com" }
282
+ * ];
283
+ *
284
+ * // Basic conversion
285
+ * const excelResponse = await dms.jsonToExcel(libraryRef, jsonData);
286
+ * const blob = excelResponse.data; // Blob for download
287
+ *
288
+ * // With custom sheet name
289
+ * const excelWithOptions = await dms.jsonToExcel(libraryRef, jsonData, {
290
+ * sheet_name: 'Customer Data'
291
+ * });
292
+ *
293
+ * // Structured data with explicit sections
294
+ * const structuredData = {
295
+ * header: { content: { title: "Monthly Report" } },
296
+ * items: [{ product: "Widget A", sales: 100 }],
297
+ * footer: { content: { total_sales: 100 } }
298
+ * };
299
+ *
300
+ * const structuredExcel = await dms.jsonToExcel(libraryRef, structuredData);
301
+ *
302
+ * // Create download link
303
+ * const url = URL.createObjectURL(structuredExcel.data);
304
+ * const link = document.createElement('a');
305
+ * link.href = url;
306
+ * link.download = 'report.xlsx'; // Always .xlsx extension
307
+ * link.click();
308
+ * ```
309
+ */
310
+ jsonToExcel(lib: string, jsonData: any, options?: ConversionOptions): Promise<AxiosResponse<Blob>>;
311
+ /**
312
+ * Convert CSV data to JSON format
313
+ *
314
+ * @param lib - Library reference UUID
315
+ * @param csvData - CSV data string (with headers in first row)
316
+ * @returns Promise resolving to JSON array
317
+ *
318
+ * @example
319
+ * ```typescript
320
+ * const csvString = `name,age,email
321
+ * John Doe,30,john@example.com
322
+ * Jane Smith,25,jane@example.com`;
323
+ *
324
+ * const jsonResponse = await dms.csvToJson(libraryRef, csvString);
325
+ * console.log(jsonResponse.data);
326
+ * // Output:
327
+ * // [
328
+ * // { name: "John Doe", age: "30", email: "john@example.com" },
329
+ * // { name: "Jane Smith", age: "25", email: "jane@example.com" }
330
+ * // ]
331
+ * ```
332
+ */
333
+ csvToJson(lib: string, csvData: string): Promise<AxiosResponse<any[]>>;
334
+ /**
335
+ * Convert CSV data to Excel (.xlsx) format
336
+ *
337
+ * @param lib - Library reference UUID
338
+ * @param csvData - CSV data string (with headers in first row)
339
+ * @param options - Optional conversion options
340
+ * @returns Promise resolving to Excel file as Blob
341
+ *
342
+ * @example
343
+ * ```typescript
344
+ * const csvString = `name,age,email
345
+ * John Doe,30,john@example.com
346
+ * Jane Smith,25,jane@example.com`;
347
+ *
348
+ * const excelResponse = await dms.csvToExcel(libraryRef, csvString, {
349
+ * sheet_name: 'Imported Data'
350
+ * });
351
+ *
352
+ * // Handle the Excel blob
353
+ * const blob = excelResponse.data;
354
+ * const url = URL.createObjectURL(blob);
355
+ * // Use url for download or further processing
356
+ * ```
357
+ */
358
+ csvToExcel(lib: string, csvData: string, options?: ConversionOptions): Promise<AxiosResponse<Blob>>;
359
+ /**
360
+ * Convert Excel (.xlsx) data to JSON format
361
+ *
362
+ * @param lib - Library reference UUID
363
+ * @param excelData - Excel file data as Blob or ArrayBuffer
364
+ * @param options - Optional conversion options
365
+ * @returns Promise resolving to JSON array
366
+ *
367
+ * @example
368
+ * ```typescript
369
+ * // From file input
370
+ * const fileInput = document.querySelector('input[type="file"]');
371
+ * const file = fileInput.files[0]; // Excel file
372
+ *
373
+ * const jsonResponse = await dms.excelToJson(libraryRef, file, {
374
+ * sheet_name: 'Sheet1' // optional, defaults to first sheet
375
+ * });
376
+ *
377
+ * console.log(jsonResponse.data);
378
+ * // Output: JSON array with data from Excel sheet
379
+ *
380
+ * // From ArrayBuffer
381
+ * const arrayBuffer = await file.arrayBuffer();
382
+ * const jsonFromBuffer = await dms.excelToJson(libraryRef, arrayBuffer);
383
+ * ```
384
+ */
385
+ excelToJson(lib: string, excelData: Blob | ArrayBuffer, options?: ConversionOptions): Promise<AxiosResponse<any[]>>;
386
+ /**
387
+ * Convert Excel (.xlsx) data to CSV format
388
+ *
389
+ * @param lib - Library reference UUID
390
+ * @param excelData - Excel file data as Blob or ArrayBuffer
391
+ * @param options - Optional conversion options
392
+ * @returns Promise resolving to CSV string
393
+ *
394
+ * @example
395
+ * ```typescript
396
+ * // From file input
397
+ * const fileInput = document.querySelector('input[type="file"]');
398
+ * const file = fileInput.files[0]; // Excel file
399
+ *
400
+ * const csvResponse = await dms.excelToCsv(libraryRef, file, {
401
+ * sheet_name: 'Data' // optional, defaults to first sheet
402
+ * });
403
+ *
404
+ * console.log(csvResponse.data);
405
+ * // Output: CSV string with data from Excel sheet
406
+ *
407
+ * // Save as CSV file
408
+ * const csvBlob = new Blob([csvResponse.data], { type: 'text/csv' });
409
+ * const url = URL.createObjectURL(csvBlob);
410
+ * const link = document.createElement('a');
411
+ * link.href = url;
412
+ * link.download = 'converted.csv';
413
+ * link.click();
414
+ * ```
415
+ */
416
+ excelToCsv(lib: string, excelData: Blob | ArrayBuffer, options?: ConversionOptions): Promise<AxiosResponse<string>>;
417
+ request(method: string, endpoint: string, params?: any): Promise<AxiosResponse<any, any>>;
418
+ requestv1(method: string, endpoint: string, params?: any): Promise<AxiosResponse<any, any>>;
19
419
  }
@@ -1,4 +1,5 @@
1
1
  import PlatformBaseClient from "./platformBaseClient";
2
2
  export default class Workflow extends PlatformBaseClient {
3
3
  trigger(id: string, event: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
4
+ publish(event: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
4
5
  }
@@ -16,7 +16,7 @@ export { default as Forge } from './api/forge';
16
16
  export { default as Integrations } from './api/integrations';
17
17
  export { default as Payments } from './api/integrations/payments';
18
18
  export { default as Invoicing } from './api/integrations/invoicing';
19
- export { default as Media } from './api/integrations/dms';
19
+ export { default as DMS } from './api/integrations/dms';
20
20
  export { default as SerbiaUtil } from './api/integrations/serbiaUtil';
21
21
  export { default as VPFR } from './api/integrations/vpfr';
22
22
  export type * from './types/component';