@ketrics/sdk-backend 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Excel SDK Error Classes
3
+ *
4
+ * Error types for Excel operations in tenant applications.
5
+ */
6
+ /**
7
+ * Base error for all Excel operations
8
+ *
9
+ * All Excel-related errors inherit from this class, providing
10
+ * consistent context and structure for error handling.
11
+ */
12
+ export declare abstract class ExcelError extends Error {
13
+ /** Operation that caused the error */
14
+ readonly operation: string;
15
+ /** Timestamp when the error occurred */
16
+ readonly timestamp: Date;
17
+ constructor(operation: string, message: string);
18
+ /**
19
+ * Convert error to JSON-serializable object
20
+ */
21
+ toJSON(): Record<string, unknown>;
22
+ }
23
+ /**
24
+ * Error parsing Excel file
25
+ *
26
+ * Thrown when an Excel file cannot be parsed due to invalid format,
27
+ * corrupted data, or unsupported features.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * try {
32
+ * const workbook = await ketrics.Excel.read(buffer);
33
+ * } catch (error) {
34
+ * if (error instanceof ketrics.ExcelParseError) {
35
+ * console.log('Failed to parse Excel file:', error.message);
36
+ * }
37
+ * }
38
+ * ```
39
+ */
40
+ export declare class ExcelParseError extends ExcelError {
41
+ /** The reason for the parse failure */
42
+ readonly reason: string;
43
+ constructor(reason: string);
44
+ toJSON(): Record<string, unknown>;
45
+ }
46
+ /**
47
+ * Error writing Excel file
48
+ *
49
+ * Thrown when an Excel file cannot be written due to invalid data
50
+ * or other write errors.
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * try {
55
+ * const buffer = await workbook.toBuffer();
56
+ * } catch (error) {
57
+ * if (error instanceof ketrics.ExcelWriteError) {
58
+ * console.log('Failed to write Excel file:', error.message);
59
+ * }
60
+ * }
61
+ * ```
62
+ */
63
+ export declare class ExcelWriteError extends ExcelError {
64
+ /** The reason for the write failure */
65
+ readonly reason: string;
66
+ constructor(reason: string);
67
+ toJSON(): Record<string, unknown>;
68
+ }
69
+ /**
70
+ * Type guard to check if an error is an ExcelError
71
+ */
72
+ export declare function isExcelError(error: unknown): error is ExcelError;
73
+ /**
74
+ * Type guard to check if an error is a specific Excel error type
75
+ */
76
+ export declare function isExcelErrorType<T extends ExcelError>(error: unknown, errorClass: new (...args: never[]) => T): error is T;
77
+ //# sourceMappingURL=excel-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excel-errors.d.ts","sourceRoot":"","sources":["../src/excel-errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;GAKG;AACH,8BAAsB,UAAW,SAAQ,KAAK;IAC5C,sCAAsC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;gBAEb,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAc9C;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlC;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,uCAAuC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;IAK1B,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMlC;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,uCAAuC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;IAK1B,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMlC;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EACnD,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,GACtC,KAAK,IAAI,CAAC,CAEZ"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ /**
3
+ * Excel SDK Error Classes
4
+ *
5
+ * Error types for Excel operations in tenant applications.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ExcelWriteError = exports.ExcelParseError = exports.ExcelError = void 0;
9
+ exports.isExcelError = isExcelError;
10
+ exports.isExcelErrorType = isExcelErrorType;
11
+ // ============================================================================
12
+ // Base Excel Error
13
+ // ============================================================================
14
+ /**
15
+ * Base error for all Excel operations
16
+ *
17
+ * All Excel-related errors inherit from this class, providing
18
+ * consistent context and structure for error handling.
19
+ */
20
+ class ExcelError extends Error {
21
+ constructor(operation, message) {
22
+ super(message);
23
+ this.name = this.constructor.name;
24
+ this.operation = operation;
25
+ this.timestamp = new Date();
26
+ // Maintain proper stack trace in V8 environments
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ if (Error.captureStackTrace) {
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ Error.captureStackTrace(this, this.constructor);
31
+ }
32
+ }
33
+ /**
34
+ * Convert error to JSON-serializable object
35
+ */
36
+ toJSON() {
37
+ return {
38
+ name: this.name,
39
+ message: this.message,
40
+ operation: this.operation,
41
+ timestamp: this.timestamp.toISOString(),
42
+ };
43
+ }
44
+ }
45
+ exports.ExcelError = ExcelError;
46
+ // ============================================================================
47
+ // Excel Parse Error
48
+ // ============================================================================
49
+ /**
50
+ * Error parsing Excel file
51
+ *
52
+ * Thrown when an Excel file cannot be parsed due to invalid format,
53
+ * corrupted data, or unsupported features.
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * try {
58
+ * const workbook = await ketrics.Excel.read(buffer);
59
+ * } catch (error) {
60
+ * if (error instanceof ketrics.ExcelParseError) {
61
+ * console.log('Failed to parse Excel file:', error.message);
62
+ * }
63
+ * }
64
+ * ```
65
+ */
66
+ class ExcelParseError extends ExcelError {
67
+ constructor(reason) {
68
+ super('read', `Failed to parse Excel file: ${reason}`);
69
+ this.reason = reason;
70
+ }
71
+ toJSON() {
72
+ return {
73
+ ...super.toJSON(),
74
+ reason: this.reason,
75
+ };
76
+ }
77
+ }
78
+ exports.ExcelParseError = ExcelParseError;
79
+ // ============================================================================
80
+ // Excel Write Error
81
+ // ============================================================================
82
+ /**
83
+ * Error writing Excel file
84
+ *
85
+ * Thrown when an Excel file cannot be written due to invalid data
86
+ * or other write errors.
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * try {
91
+ * const buffer = await workbook.toBuffer();
92
+ * } catch (error) {
93
+ * if (error instanceof ketrics.ExcelWriteError) {
94
+ * console.log('Failed to write Excel file:', error.message);
95
+ * }
96
+ * }
97
+ * ```
98
+ */
99
+ class ExcelWriteError extends ExcelError {
100
+ constructor(reason) {
101
+ super('write', `Failed to write Excel file: ${reason}`);
102
+ this.reason = reason;
103
+ }
104
+ toJSON() {
105
+ return {
106
+ ...super.toJSON(),
107
+ reason: this.reason,
108
+ };
109
+ }
110
+ }
111
+ exports.ExcelWriteError = ExcelWriteError;
112
+ // ============================================================================
113
+ // Type Guards
114
+ // ============================================================================
115
+ /**
116
+ * Type guard to check if an error is an ExcelError
117
+ */
118
+ function isExcelError(error) {
119
+ return error instanceof ExcelError;
120
+ }
121
+ /**
122
+ * Type guard to check if an error is a specific Excel error type
123
+ */
124
+ function isExcelErrorType(error, errorClass) {
125
+ return error instanceof errorClass;
126
+ }
127
+ //# sourceMappingURL=excel-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excel-errors.js","sourceRoot":"","sources":["../src/excel-errors.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAiIH,oCAEC;AAKD,4CAKC;AA3ID,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAsB,UAAW,SAAQ,KAAK;IAO5C,YAAY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AC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,OAAO;YACL,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;IACJ,CAAC;CACF;AAfD,0CAeC;AAED,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,KAAK,YAAY,UAAU,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,KAAc,EACd,UAAuC;IAEvC,OAAO,KAAK,YAAY,UAAU,CAAC;AACrC,CAAC"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Excel SDK Types
3
+ *
4
+ * Type definitions for Excel file reading and writing in tenant applications.
5
+ */
6
+ /**
7
+ * Excel cell value types
8
+ */
9
+ export type ExcelCellValue = null | undefined | number | string | boolean | Date;
10
+ /**
11
+ * Excel row values (array of cell values)
12
+ */
13
+ export type ExcelRowValues = ExcelCellValue[];
14
+ /**
15
+ * Excel column definition
16
+ */
17
+ export interface ExcelColumnDefinition {
18
+ /** Column header text */
19
+ header?: string;
20
+ /** Column key (for object-based rows) */
21
+ key?: string;
22
+ /** Column width */
23
+ width?: number;
24
+ }
25
+ /**
26
+ * Options for adding a worksheet
27
+ */
28
+ export interface AddWorksheetOptions {
29
+ /** Tab color (argb hex) */
30
+ tabColor?: string;
31
+ /** Default row height */
32
+ defaultRowHeight?: number;
33
+ /** Default column width */
34
+ defaultColWidth?: number;
35
+ }
36
+ /**
37
+ * Excel Cell Interface
38
+ *
39
+ * Represents a single cell in a worksheet.
40
+ */
41
+ export interface IExcelCell {
42
+ /** Cell value */
43
+ value: ExcelCellValue;
44
+ /** Cell text representation */
45
+ readonly text: string;
46
+ /** Cell address (e.g., 'A1') */
47
+ readonly address: string;
48
+ /** Row number */
49
+ readonly row: number;
50
+ /** Column number */
51
+ readonly col: number;
52
+ /** Cell formula if any */
53
+ formula?: string;
54
+ /** Cell type */
55
+ readonly type: string;
56
+ }
57
+ /**
58
+ * Excel Row Interface
59
+ *
60
+ * Represents a row in a worksheet.
61
+ */
62
+ export interface IExcelRow {
63
+ /** Row number (1-indexed) */
64
+ readonly number: number;
65
+ /** Number of cells in the row */
66
+ readonly cellCount: number;
67
+ /** Number of cells with values */
68
+ readonly actualCellCount: number;
69
+ /** Row values as array */
70
+ values: ExcelRowValues;
71
+ /** Get a cell by column number or letter */
72
+ getCell(col: number | string): IExcelCell;
73
+ /** Iterate over cells */
74
+ eachCell(callback: (cell: IExcelCell, colNumber: number) => void, options?: {
75
+ includeEmpty?: boolean;
76
+ }): void;
77
+ /** Commit row changes (for streaming) */
78
+ commit(): void;
79
+ }
80
+ /**
81
+ * Excel Worksheet Interface
82
+ *
83
+ * Represents a worksheet in a workbook.
84
+ */
85
+ export interface IExcelWorksheet {
86
+ /** Worksheet name */
87
+ name: string;
88
+ /** Worksheet ID */
89
+ readonly id: number;
90
+ /** Total row count */
91
+ readonly rowCount: number;
92
+ /** Rows with values */
93
+ readonly actualRowCount: number;
94
+ /** Total column count */
95
+ readonly columnCount: number;
96
+ /** Columns with values */
97
+ readonly actualColumnCount: number;
98
+ /** Column definitions */
99
+ columns: ExcelColumnDefinition[];
100
+ /** Get a row by number (1-indexed) */
101
+ getRow(rowNumber: number): IExcelRow;
102
+ /** Get rows with values */
103
+ getRows(startRow?: number, endRow?: number): IExcelRow[];
104
+ /** Get a cell by address or coordinates */
105
+ getCell(address: string): IExcelCell;
106
+ getCell(row: number, col: number): IExcelCell;
107
+ /** Add a row at the end */
108
+ addRow(values: ExcelRowValues): IExcelRow;
109
+ /** Add multiple rows at the end */
110
+ addRows(rows: ExcelRowValues[]): void;
111
+ /** Insert a row at position */
112
+ insertRow(pos: number, values: ExcelRowValues): IExcelRow;
113
+ /** Insert multiple rows at position */
114
+ insertRows(pos: number, rows: ExcelRowValues[]): void;
115
+ /** Splice rows (delete/insert) */
116
+ spliceRows(start: number, count: number, ...rows: ExcelRowValues[]): void;
117
+ /** Iterate over rows */
118
+ eachRow(callback: (row: IExcelRow, rowNumber: number) => void, options?: {
119
+ includeEmpty?: boolean;
120
+ }): void;
121
+ /** Get all sheet values as 2D array */
122
+ getSheetValues(): ExcelRowValues[];
123
+ /** Merge cells */
124
+ mergeCells(start: string, end: string): void;
125
+ mergeCells(startRow: number, startCol: number, endRow: number, endCol: number): void;
126
+ /** Unmerge cells */
127
+ unMergeCells(start: string, end: string): void;
128
+ }
129
+ /**
130
+ * Excel Workbook Interface
131
+ *
132
+ * Main container for worksheets.
133
+ */
134
+ export interface IExcelWorkbook {
135
+ /** All worksheets */
136
+ readonly worksheets: IExcelWorksheet[];
137
+ /** Number of worksheets */
138
+ readonly worksheetCount: number;
139
+ /** Get worksheet by index (1-indexed) or name */
140
+ getWorksheet(indexOrName: number | string): IExcelWorksheet | undefined;
141
+ /** Add a new worksheet */
142
+ addWorksheet(name?: string, options?: AddWorksheetOptions): IExcelWorksheet;
143
+ /** Remove a worksheet */
144
+ removeWorksheet(indexOrName: number | string): void;
145
+ /** Write workbook to buffer */
146
+ toBuffer(): Promise<Buffer>;
147
+ /** Convert to CSV string */
148
+ toCsv(worksheetName?: string): Promise<string>;
149
+ }
150
+ /**
151
+ * Excel Manager Interface
152
+ *
153
+ * Static class interface for reading and creating Excel files.
154
+ */
155
+ export interface ExcelManager {
156
+ /**
157
+ * Read an Excel file from a buffer
158
+ *
159
+ * @param buffer - Buffer containing Excel file data (.xlsx)
160
+ * @returns Parsed workbook
161
+ * @throws ExcelParseError if file cannot be parsed
162
+ */
163
+ read(buffer: Buffer): Promise<IExcelWorkbook>;
164
+ /**
165
+ * Create a new empty workbook
166
+ *
167
+ * @returns New empty workbook
168
+ */
169
+ create(): IExcelWorkbook;
170
+ }
171
+ //# sourceMappingURL=excel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excel.d.ts","sourceRoot":"","sources":["../src/excel.ts"],"names":[],"mappings":"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EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,eAAe,CAAC;IAC5E,yBAAyB;IACzB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpD,+BAA+B;IAC/B,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,4BAA4B;IAC5B,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD;AAMD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE9C;;;;OAIG;IACH,MAAM,IAAI,cAAc,CAAC;CAC1B"}
package/dist/excel.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Excel SDK Types
4
+ *
5
+ * Type definitions for Excel file reading and writing in tenant applications.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=excel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excel.js","sourceRoot":"","sources":["../src/excel.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
package/dist/index.d.ts CHANGED
@@ -61,6 +61,8 @@ export { DatabaseQueryResult, DatabaseExecuteResult, IDatabaseConnection, Databa
61
61
  export { DatabaseError, DatabaseNotFoundError, DatabaseAccessDeniedError, DatabaseConnectionError, DatabaseQueryError, DatabaseTransactionError, isDatabaseError, isDatabaseErrorType, } from './database-errors';
62
62
  export { ISecret } from './secrets';
63
63
  export { SecretError, SecretNotFoundError, SecretAccessDeniedError, SecretDecryptionError, isSecretError, isSecretErrorType, } from './secret-errors';
64
+ export { ExcelCellValue, ExcelRowValues, ExcelColumnDefinition, AddWorksheetOptions, IExcelCell, IExcelRow, IExcelWorksheet, IExcelWorkbook, ExcelManager, } from './excel';
65
+ export { ExcelError, ExcelParseError, ExcelWriteError, isExcelError, isExcelErrorType, } from './excel-errors';
64
66
  export { PutContent, FileContent, FileMetadata, FileInfo, PutOptions, PutResult, DeleteResult, DeleteError, DeleteByPrefixResult, ListOptions, ListResult, CopyOptions, CopyResult, MoveOptions, MoveResult, DownloadUrlOptions, UploadUrlOptions, PresignedUrl, IVolume, } from './volumes';
65
67
  export { VolumePermissionValue, VolumeError, VolumeNotFoundError, VolumeAccessDeniedError, VolumePermissionDeniedError, FileNotFoundError, FileAlreadyExistsError, InvalidPathError, FileSizeLimitError, ContentTypeNotAllowedError, isVolumeError, isVolumeErrorType, } from './errors';
66
68
  import type { TenantContext, ApplicationContext, UserContext, EnvironmentContext } from './context';
@@ -68,9 +70,11 @@ import type { ConsoleLogger } from './console';
68
70
  import type { HttpClient } from './http';
69
71
  import type { IDatabaseConnection } from './databases';
70
72
  import type { IVolume } from './volumes';
73
+ import type { IExcelWorkbook } from './excel';
71
74
  import { VolumeError as VolumeErrorClass, VolumeNotFoundError as VolumeNotFoundErrorClass, VolumeAccessDeniedError as VolumeAccessDeniedErrorClass, VolumePermissionDeniedError as VolumePermissionDeniedErrorClass, FileNotFoundError as FileNotFoundErrorClass, FileAlreadyExistsError as FileAlreadyExistsErrorClass, InvalidPathError as InvalidPathErrorClass, FileSizeLimitError as FileSizeLimitErrorClass, ContentTypeNotAllowedError as ContentTypeNotAllowedErrorClass } from './errors';
72
75
  import { DatabaseError as DatabaseErrorClass, DatabaseNotFoundError as DatabaseNotFoundErrorClass, DatabaseAccessDeniedError as DatabaseAccessDeniedErrorClass, DatabaseConnectionError as DatabaseConnectionErrorClass, DatabaseQueryError as DatabaseQueryErrorClass, DatabaseTransactionError as DatabaseTransactionErrorClass } from './database-errors';
73
76
  import { SecretError as SecretErrorClass, SecretNotFoundError as SecretNotFoundErrorClass, SecretAccessDeniedError as SecretAccessDeniedErrorClass, SecretDecryptionError as SecretDecryptionErrorClass } from './secret-errors';
77
+ import { ExcelError as ExcelErrorClass, ExcelParseError as ExcelParseErrorClass, ExcelWriteError as ExcelWriteErrorClass } from './excel-errors';
74
78
  /**
75
79
  * Ketrics Platform SDK Interface
76
80
  *
@@ -277,6 +281,64 @@ export declare class Secret {
277
281
  */
278
282
  static exists(secretCode: string): Promise<boolean>;
279
283
  }
284
+ /**
285
+ * Excel - Read and write Excel files in tenant applications
286
+ *
287
+ * Access via `ketrics.Excel.read()` or `ketrics.Excel.create()`.
288
+ *
289
+ * @example
290
+ * ```typescript
291
+ * export async function handler() {
292
+ * try {
293
+ * // Read Excel from volume
294
+ * const volume = await ketrics.Volume.connect('uploads');
295
+ * const file = await volume.get('report.xlsx');
296
+ * const workbook = await ketrics.Excel.read(file.content);
297
+ *
298
+ * // Access worksheet
299
+ * const sheet = workbook.getWorksheet('Sheet1');
300
+ * const rows = sheet.getRows();
301
+ *
302
+ * for (const row of rows) {
303
+ * console.log(row.values);
304
+ * }
305
+ *
306
+ * // Create new workbook
307
+ * const newWorkbook = ketrics.Excel.create();
308
+ * const newSheet = newWorkbook.addWorksheet('Data');
309
+ * newSheet.addRow(['Name', 'Value']);
310
+ * newSheet.addRow(['Item 1', 100]);
311
+ *
312
+ * const buffer = await newWorkbook.toBuffer();
313
+ * await volume.put('output.xlsx', buffer);
314
+ *
315
+ * } catch (error) {
316
+ * if (error instanceof ketrics.ExcelParseError) {
317
+ * console.log('Failed to parse Excel file');
318
+ * } else if (error instanceof ketrics.ExcelWriteError) {
319
+ * console.log('Failed to write Excel file');
320
+ * }
321
+ * }
322
+ * }
323
+ * ```
324
+ */
325
+ export declare class Excel {
326
+ private constructor();
327
+ /**
328
+ * Read an Excel file from a buffer
329
+ *
330
+ * @param buffer - Buffer containing Excel file data (.xlsx)
331
+ * @returns Parsed workbook
332
+ * @throws ExcelParseError if file cannot be parsed
333
+ */
334
+ static read(buffer: Buffer): Promise<IExcelWorkbook>;
335
+ /**
336
+ * Create a new empty workbook
337
+ *
338
+ * @returns New empty workbook
339
+ */
340
+ static create(): IExcelWorkbook;
341
+ }
280
342
  /**
281
343
  * Global declaration for the Ketrics VM sandbox.
282
344
  *
@@ -334,6 +396,22 @@ declare global {
334
396
  get(secretCode: string): Promise<string>;
335
397
  exists(secretCode: string): Promise<boolean>;
336
398
  };
399
+ /**
400
+ * Excel class for reading and writing Excel files
401
+ *
402
+ * Use `ketrics.Excel.read()` to parse an Excel file or
403
+ * `ketrics.Excel.create()` to create a new workbook.
404
+ *
405
+ * @example
406
+ * ```typescript
407
+ * const workbook = await ketrics.Excel.read(file.content);
408
+ * const sheet = workbook.getWorksheet('Sheet1');
409
+ * ```
410
+ */
411
+ Excel: {
412
+ read(buffer: Buffer): Promise<IExcelWorkbook>;
413
+ create(): IExcelWorkbook;
414
+ };
337
415
  /** Base class for all volume errors */
338
416
  VolumeError: typeof VolumeErrorClass;
339
417
  /** Thrown when a volume does not exist */
@@ -372,6 +450,12 @@ declare global {
372
450
  SecretAccessDeniedError: typeof SecretAccessDeniedErrorClass;
373
451
  /** Thrown when secret decryption fails */
374
452
  SecretDecryptionError: typeof SecretDecryptionErrorClass;
453
+ /** Base class for all Excel errors */
454
+ ExcelError: typeof ExcelErrorClass;
455
+ /** Thrown when an Excel file cannot be parsed */
456
+ ExcelParseError: typeof ExcelParseErrorClass;
457
+ /** Thrown when an Excel file cannot be written */
458
+ ExcelWriteError: typeof ExcelWriteErrorClass;
375
459
  };
376
460
  }
377
461
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAMH,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,kBAAkB,GACnB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAM1C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAM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, "__esModule", { value: true });
59
- exports.isVolumeErrorType = exports.isVolumeError = exports.ContentTypeNotAllowedError = exports.FileSizeLimitError = exports.InvalidPathError = exports.FileAlreadyExistsError = exports.FileNotFoundError = exports.VolumePermissionDeniedError = exports.VolumeAccessDeniedError = exports.VolumeNotFoundError = exports.VolumeError = exports.isSecretErrorType = exports.isSecretError = exports.SecretDecryptionError = exports.SecretAccessDeniedError = exports.SecretNotFoundError = exports.SecretError = exports.isDatabaseErrorType = exports.isDatabaseError = exports.DatabaseTransactionError = exports.DatabaseQueryError = exports.DatabaseConnectionError = exports.DatabaseAccessDeniedError = exports.DatabaseNotFoundError = exports.DatabaseError = void 0;
59
+ exports.isVolumeErrorType = exports.isVolumeError = exports.ContentTypeNotAllowedError = exports.FileSizeLimitError = exports.InvalidPathError = exports.FileAlreadyExistsError = exports.FileNotFoundError = exports.VolumePermissionDeniedError = exports.VolumeAccessDeniedError = exports.VolumeNotFoundError = exports.VolumeError = exports.isExcelErrorType = exports.isExcelError = exports.ExcelWriteError = exports.ExcelParseError = exports.ExcelError = exports.isSecretErrorType = exports.isSecretError = exports.SecretDecryptionError = exports.SecretAccessDeniedError = exports.SecretNotFoundError = exports.SecretError = exports.isDatabaseErrorType = exports.isDatabaseError = exports.DatabaseTransactionError = exports.DatabaseQueryError = exports.DatabaseConnectionError = exports.DatabaseAccessDeniedError = exports.DatabaseNotFoundError = exports.DatabaseError = void 0;
60
60
  // ============================================================================
61
61
  // Database Error Exports
62
62
  // ============================================================================
@@ -80,6 +80,15 @@ Object.defineProperty(exports, "SecretDecryptionError", { enumerable: true, get:
80
80
  Object.defineProperty(exports, "isSecretError", { enumerable: true, get: function () { return secret_errors_1.isSecretError; } });
81
81
  Object.defineProperty(exports, "isSecretErrorType", { enumerable: true, get: function () { return secret_errors_1.isSecretErrorType; } });
82
82
  // ============================================================================
83
+ // Excel Error Exports
84
+ // ============================================================================
85
+ var excel_errors_1 = require("./excel-errors");
86
+ Object.defineProperty(exports, "ExcelError", { enumerable: true, get: function () { return excel_errors_1.ExcelError; } });
87
+ Object.defineProperty(exports, "ExcelParseError", { enumerable: true, get: function () { return excel_errors_1.ExcelParseError; } });
88
+ Object.defineProperty(exports, "ExcelWriteError", { enumerable: true, get: function () { return excel_errors_1.ExcelWriteError; } });
89
+ Object.defineProperty(exports, "isExcelError", { enumerable: true, get: function () { return excel_errors_1.isExcelError; } });
90
+ Object.defineProperty(exports, "isExcelErrorType", { enumerable: true, get: function () { return excel_errors_1.isExcelErrorType; } });
91
+ // ============================================================================
83
92
  // Volume Error Exports
84
93
  // ============================================================================
85
94
  var errors_1 = require("./errors");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;;;AAoCH,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E,qDAS2B;AARzB,gHAAA,aAAa,OAAA;AACb,wHAAA,qBAAqB,OAAA;AACrB,4HAAA,yBAAyB,OAAA;AACzB,0HAAA,uBAAuB,OAAA;AACvB,qHAAA,kBAAkB,OAAA;AAClB,2HAAA,wBAAwB,OAAA;AACxB,kHAAA,eAAe,OAAA;AACf,sHAAA,mBAAmB,OAAA;AASrB,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E,iDAOyB;AANvB,4GAAA,WAAW,OAAA;AACX,oHAAA,mBAAmB,OAAA;AACnB,wHAAA,uBAAuB,OAAA;AACvB,sHAAA,qBAAqB,OAAA;AACrB,8GAAA,aAAa,OAAA;AACb,kHAAA,iBAAiB,OAAA;AAqCnB,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E,mCAgBkB;AAbhB,gBAAgB;AAChB,qGAAA,WAAW,OAAA;AACX,6GAAA,mBAAmB,OAAA;AACnB,iHAAA,uBAAuB,OAAA;AACvB,qHAAA,2BAA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2GAAA,iBAAiB,OAAA;AACjB,gHAAA,sBAAsB,OAAA;AACtB,0GAAA,gBAAgB,OAAA;AAChB,4GAAA,kBAAkB,OAAA;AAClB,oHAAA,0BAA0B,OAAA;AAC1B,cAAc;AACd,uGAAA,aAAa,OAAA;AACb,2GAAA,iBAAiB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ketrics/sdk-backend",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Ketrics SDK for backend tenant application code (VM sandbox)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",