@ketrics/sdk-backend 0.2.0 → 0.4.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.
package/dist/index.d.ts CHANGED
@@ -61,6 +61,12 @@ 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';
66
+ export { PdfPageSize, PdfStandardFont, PdfRgbColor, PdfDrawTextOptions, PdfDrawRectOptions, PdfDrawLineOptions, PdfDrawCircleOptions, PdfDrawImageOptions, PdfEmbeddedImage, PdfEmbeddedFont, IPdfPage, IPdfDocument, PdfManager, } from './pdf';
67
+ export { PdfError, PdfParseError, PdfWriteError, isPdfError, isPdfErrorType, } from './pdf-errors';
68
+ export { JobStatusValue, RunInBackgroundOptions, RunInBackgroundParams, JobErrorDetails, JobStatus, JobListParams, JobListResult, } from './job';
69
+ export { JobError, JobNotFoundError, InvalidFunctionError, CrossAppPermissionError, JobExecutionError, isJobError, isJobErrorType, } from './job-errors';
64
70
  export { PutContent, FileContent, FileMetadata, FileInfo, PutOptions, PutResult, DeleteResult, DeleteError, DeleteByPrefixResult, ListOptions, ListResult, CopyOptions, CopyResult, MoveOptions, MoveResult, DownloadUrlOptions, UploadUrlOptions, PresignedUrl, IVolume, } from './volumes';
65
71
  export { VolumePermissionValue, VolumeError, VolumeNotFoundError, VolumeAccessDeniedError, VolumePermissionDeniedError, FileNotFoundError, FileAlreadyExistsError, InvalidPathError, FileSizeLimitError, ContentTypeNotAllowedError, isVolumeError, isVolumeErrorType, } from './errors';
66
72
  import type { TenantContext, ApplicationContext, UserContext, EnvironmentContext } from './context';
@@ -68,9 +74,15 @@ import type { ConsoleLogger } from './console';
68
74
  import type { HttpClient } from './http';
69
75
  import type { IDatabaseConnection } from './databases';
70
76
  import type { IVolume } from './volumes';
77
+ import type { IExcelWorkbook } from './excel';
78
+ import type { IPdfDocument, PdfRgbColor } from './pdf';
79
+ import type { RunInBackgroundParams, JobStatus, JobListParams, JobListResult } from './job';
71
80
  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
81
  import { DatabaseError as DatabaseErrorClass, DatabaseNotFoundError as DatabaseNotFoundErrorClass, DatabaseAccessDeniedError as DatabaseAccessDeniedErrorClass, DatabaseConnectionError as DatabaseConnectionErrorClass, DatabaseQueryError as DatabaseQueryErrorClass, DatabaseTransactionError as DatabaseTransactionErrorClass } from './database-errors';
73
82
  import { SecretError as SecretErrorClass, SecretNotFoundError as SecretNotFoundErrorClass, SecretAccessDeniedError as SecretAccessDeniedErrorClass, SecretDecryptionError as SecretDecryptionErrorClass } from './secret-errors';
83
+ import { ExcelError as ExcelErrorClass, ExcelParseError as ExcelParseErrorClass, ExcelWriteError as ExcelWriteErrorClass } from './excel-errors';
84
+ import { PdfError as PdfErrorClass, PdfParseError as PdfParseErrorClass, PdfWriteError as PdfWriteErrorClass } from './pdf-errors';
85
+ import { JobError as JobErrorClass, JobNotFoundError as JobNotFoundErrorClass, InvalidFunctionError as InvalidFunctionErrorClass, CrossAppPermissionError as CrossAppPermissionErrorClass, JobExecutionError as JobExecutionErrorClass } from './job-errors';
74
86
  /**
75
87
  * Ketrics Platform SDK Interface
76
88
  *
@@ -277,6 +289,196 @@ export declare class Secret {
277
289
  */
278
290
  static exists(secretCode: string): Promise<boolean>;
279
291
  }
292
+ /**
293
+ * Excel - Read and write Excel files in tenant applications
294
+ *
295
+ * Access via `ketrics.Excel.read()` or `ketrics.Excel.create()`.
296
+ *
297
+ * @example
298
+ * ```typescript
299
+ * export async function handler() {
300
+ * try {
301
+ * // Read Excel from volume
302
+ * const volume = await ketrics.Volume.connect('uploads');
303
+ * const file = await volume.get('report.xlsx');
304
+ * const workbook = await ketrics.Excel.read(file.content);
305
+ *
306
+ * // Access worksheet
307
+ * const sheet = workbook.getWorksheet('Sheet1');
308
+ * const rows = sheet.getRows();
309
+ *
310
+ * for (const row of rows) {
311
+ * console.log(row.values);
312
+ * }
313
+ *
314
+ * // Create new workbook
315
+ * const newWorkbook = ketrics.Excel.create();
316
+ * const newSheet = newWorkbook.addWorksheet('Data');
317
+ * newSheet.addRow(['Name', 'Value']);
318
+ * newSheet.addRow(['Item 1', 100]);
319
+ *
320
+ * const buffer = await newWorkbook.toBuffer();
321
+ * await volume.put('output.xlsx', buffer);
322
+ *
323
+ * } catch (error) {
324
+ * if (error instanceof ketrics.ExcelParseError) {
325
+ * console.log('Failed to parse Excel file');
326
+ * } else if (error instanceof ketrics.ExcelWriteError) {
327
+ * console.log('Failed to write Excel file');
328
+ * }
329
+ * }
330
+ * }
331
+ * ```
332
+ */
333
+ export declare class Excel {
334
+ private constructor();
335
+ /**
336
+ * Read an Excel file from a buffer
337
+ *
338
+ * @param buffer - Buffer containing Excel file data (.xlsx)
339
+ * @returns Parsed workbook
340
+ * @throws ExcelParseError if file cannot be parsed
341
+ */
342
+ static read(buffer: Buffer): Promise<IExcelWorkbook>;
343
+ /**
344
+ * Create a new empty workbook
345
+ *
346
+ * @returns New empty workbook
347
+ */
348
+ static create(): IExcelWorkbook;
349
+ }
350
+ /**
351
+ * Pdf - Read, create, and modify PDF files in tenant applications
352
+ *
353
+ * Access via `ketrics.Pdf.read()` or `ketrics.Pdf.create()`.
354
+ *
355
+ * @example
356
+ * ```typescript
357
+ * export async function handler() {
358
+ * try {
359
+ * // Read PDF from volume
360
+ * const volume = await ketrics.Volume.connect('uploads');
361
+ * const file = await volume.get('document.pdf');
362
+ * const doc = await ketrics.Pdf.read(file.content);
363
+ *
364
+ * // Get page info
365
+ * console.log('Pages:', doc.getPageCount());
366
+ *
367
+ * // Create new PDF
368
+ * const newDoc = await ketrics.Pdf.create();
369
+ * const page = newDoc.addPage('A4');
370
+ * await page.drawText('Hello, World!', {
371
+ * x: 50,
372
+ * y: 700,
373
+ * size: 24,
374
+ * color: ketrics.Pdf.rgb(0, 0, 0),
375
+ * });
376
+ *
377
+ * const buffer = await newDoc.toBuffer();
378
+ * await volume.put('output.pdf', buffer);
379
+ *
380
+ * } catch (error) {
381
+ * if (error instanceof ketrics.PdfParseError) {
382
+ * console.log('Failed to parse PDF file');
383
+ * } else if (error instanceof ketrics.PdfWriteError) {
384
+ * console.log('Failed to write PDF file');
385
+ * }
386
+ * }
387
+ * }
388
+ * ```
389
+ */
390
+ export declare class Pdf {
391
+ private constructor();
392
+ /**
393
+ * Read a PDF file from a buffer
394
+ *
395
+ * @param buffer - Buffer containing PDF file data
396
+ * @returns Parsed PDF document
397
+ * @throws PdfParseError if file cannot be parsed
398
+ */
399
+ static read(buffer: Buffer): Promise<IPdfDocument>;
400
+ /**
401
+ * Create a new empty PDF document
402
+ *
403
+ * @returns New empty PDF document
404
+ */
405
+ static create(): Promise<IPdfDocument>;
406
+ /**
407
+ * Create an RGB color object
408
+ *
409
+ * @param r - Red component (0-1)
410
+ * @param g - Green component (0-1)
411
+ * @param b - Blue component (0-1)
412
+ * @returns RGB color object
413
+ */
414
+ static rgb(r: number, g: number, b: number): PdfRgbColor;
415
+ }
416
+ /**
417
+ * Job - Background job execution for tenant applications
418
+ *
419
+ * Access via `ketrics.Job.runInBackground()` to queue a background job,
420
+ * `ketrics.Job.getStatus()` to check job status, or `ketrics.Job.list()`
421
+ * to list jobs.
422
+ *
423
+ * @example
424
+ * ```typescript
425
+ * export async function handler() {
426
+ * try {
427
+ * // Queue a background job
428
+ * const jobId = await ketrics.Job.runInBackground({
429
+ * function: 'generateReport',
430
+ * payload: { year: 2024, format: 'pdf' },
431
+ * options: { timeout: 600000 }
432
+ * });
433
+ * console.log('Job created:', jobId);
434
+ *
435
+ * // Check job status
436
+ * const status = await ketrics.Job.getStatus(jobId);
437
+ * console.log('Job status:', status.status);
438
+ *
439
+ * // List pending jobs
440
+ * const result = await ketrics.Job.list({ status: 'pending' });
441
+ * console.log('Pending jobs:', result.jobs.length);
442
+ *
443
+ * } catch (error) {
444
+ * if (error instanceof ketrics.JobNotFoundError) {
445
+ * console.log('Job not found');
446
+ * } else if (error instanceof ketrics.InvalidFunctionError) {
447
+ * console.log('Invalid function name');
448
+ * } else if (error instanceof ketrics.CrossAppPermissionError) {
449
+ * console.log('Cross-app permission denied');
450
+ * }
451
+ * }
452
+ * }
453
+ * ```
454
+ */
455
+ export declare class Job {
456
+ private constructor();
457
+ /**
458
+ * Queue a function to run as a background job
459
+ *
460
+ * @param params - Job parameters including function name and optional payload
461
+ * @returns Job ID (UUID) that can be used to check status
462
+ * @throws InvalidFunctionError if function name is invalid
463
+ * @throws CrossAppPermissionError if cross-app job lacks permission
464
+ */
465
+ static runInBackground(params: RunInBackgroundParams): Promise<string>;
466
+ /**
467
+ * Get the current status of a background job
468
+ *
469
+ * @param jobId - Job UUID
470
+ * @returns Job status including current state and timestamps
471
+ * @throws JobNotFoundError if job doesn't exist
472
+ */
473
+ static getStatus(jobId: string): Promise<JobStatus>;
474
+ /**
475
+ * List background jobs for the current application
476
+ *
477
+ * @param params - Optional filter and pagination parameters
478
+ * @returns List of job statuses with optional pagination cursor
479
+ */
480
+ static list(params?: JobListParams): Promise<JobListResult>;
481
+ }
280
482
  /**
281
483
  * Global declaration for the Ketrics VM sandbox.
282
484
  *
@@ -334,6 +536,64 @@ declare global {
334
536
  get(secretCode: string): Promise<string>;
335
537
  exists(secretCode: string): Promise<boolean>;
336
538
  };
539
+ /**
540
+ * Excel class for reading and writing Excel files
541
+ *
542
+ * Use `ketrics.Excel.read()` to parse an Excel file or
543
+ * `ketrics.Excel.create()` to create a new workbook.
544
+ *
545
+ * @example
546
+ * ```typescript
547
+ * const workbook = await ketrics.Excel.read(file.content);
548
+ * const sheet = workbook.getWorksheet('Sheet1');
549
+ * ```
550
+ */
551
+ Excel: {
552
+ read(buffer: Buffer): Promise<IExcelWorkbook>;
553
+ create(): IExcelWorkbook;
554
+ };
555
+ /**
556
+ * Pdf class for reading, creating, and modifying PDF files
557
+ *
558
+ * Use `ketrics.Pdf.read()` to parse a PDF file or
559
+ * `ketrics.Pdf.create()` to create a new document.
560
+ *
561
+ * @example
562
+ * ```typescript
563
+ * const doc = await ketrics.Pdf.read(file.content);
564
+ * console.log('Pages:', doc.getPageCount());
565
+ *
566
+ * const newDoc = await ketrics.Pdf.create();
567
+ * const page = newDoc.addPage('A4');
568
+ * await page.drawText('Hello!', { x: 50, y: 700, size: 24 });
569
+ * ```
570
+ */
571
+ Pdf: {
572
+ read(buffer: Buffer): Promise<IPdfDocument>;
573
+ create(): Promise<IPdfDocument>;
574
+ rgb(r: number, g: number, b: number): PdfRgbColor;
575
+ };
576
+ /**
577
+ * Job class for background job execution
578
+ *
579
+ * Use `ketrics.Job.runInBackground()` to queue a background job,
580
+ * `ketrics.Job.getStatus()` to check job status, or
581
+ * `ketrics.Job.list()` to list jobs.
582
+ *
583
+ * @example
584
+ * ```typescript
585
+ * const jobId = await ketrics.Job.runInBackground({
586
+ * function: 'generateReport',
587
+ * payload: { year: 2024 }
588
+ * });
589
+ * const status = await ketrics.Job.getStatus(jobId);
590
+ * ```
591
+ */
592
+ Job: {
593
+ runInBackground(params: RunInBackgroundParams): Promise<string>;
594
+ getStatus(jobId: string): Promise<JobStatus>;
595
+ list(params?: JobListParams): Promise<JobListResult>;
596
+ };
337
597
  /** Base class for all volume errors */
338
598
  VolumeError: typeof VolumeErrorClass;
339
599
  /** Thrown when a volume does not exist */
@@ -372,6 +632,28 @@ declare global {
372
632
  SecretAccessDeniedError: typeof SecretAccessDeniedErrorClass;
373
633
  /** Thrown when secret decryption fails */
374
634
  SecretDecryptionError: typeof SecretDecryptionErrorClass;
635
+ /** Base class for all Excel errors */
636
+ ExcelError: typeof ExcelErrorClass;
637
+ /** Thrown when an Excel file cannot be parsed */
638
+ ExcelParseError: typeof ExcelParseErrorClass;
639
+ /** Thrown when an Excel file cannot be written */
640
+ ExcelWriteError: typeof ExcelWriteErrorClass;
641
+ /** Base class for all PDF errors */
642
+ PdfError: typeof PdfErrorClass;
643
+ /** Thrown when a PDF file cannot be parsed */
644
+ PdfParseError: typeof PdfParseErrorClass;
645
+ /** Thrown when a PDF file cannot be written */
646
+ PdfWriteError: typeof PdfWriteErrorClass;
647
+ /** Base class for all job errors */
648
+ JobError: typeof JobErrorClass;
649
+ /** Thrown when a job is not found */
650
+ JobNotFoundError: typeof JobNotFoundErrorClass;
651
+ /** Thrown when function name is invalid or missing */
652
+ InvalidFunctionError: typeof InvalidFunctionErrorClass;
653
+ /** Thrown when cross-app job lacks required permission */
654
+ CrossAppPermissionError: typeof CrossAppPermissionErrorClass;
655
+ /** Thrown when job execution fails */
656
+ JobExecutionError: typeof JobExecutionErrorClass;
375
657
  };
376
658
  }
377
659
  //# 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,C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AA8C;QAC9C,aAAa,EAAE,OAAO,kBAAkB,CAAC;QACzC,+CAA+C;QAC/C,aAAa,EAAE,OAAO,kBAAkB,CAAC;QAMzC,oCAAoC;QACpC,QAAQ,EAAE,OAAO,aAAa,CAAC;QAC/B,qCAAqC;QACrC,gBAAgB,EAAE,OAAO,qBAAqB,CAAC;QAC/C,sDAAsD;QACtD,oBAAoB,EAAE,OAAO,yBAAyB,CAAC;QACvD,0DAA0D;QAC1D,uBAAuB,EAAE,OAAO,4BAA4B,CAAC;QAC7D,sCAAsC;QACtC,iBAAiB,EAAE,OAAO,sBAAsB,CAAC;KAClD,CAAC;CACH"}
package/dist/index.js CHANGED
@@ -56,7 +56,7 @@
56
56
  * ```
57
57
  */
58
58
  Object.defineProperty(exports, "__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.isJobErrorType = exports.isJobError = exports.JobExecutionError = exports.CrossAppPermissionError = exports.InvalidFunctionError = exports.JobNotFoundError = exports.JobError = exports.isPdfErrorType = exports.isPdfError = exports.PdfWriteError = exports.PdfParseError = exports.PdfError = 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,35 @@ 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
+ // ============================================================================
92
+ // PDF Error Exports
93
+ // ============================================================================
94
+ var pdf_errors_1 = require("./pdf-errors");
95
+ Object.defineProperty(exports, "PdfError", { enumerable: true, get: function () { return pdf_errors_1.PdfError; } });
96
+ Object.defineProperty(exports, "PdfParseError", { enumerable: true, get: function () { return pdf_errors_1.PdfParseError; } });
97
+ Object.defineProperty(exports, "PdfWriteError", { enumerable: true, get: function () { return pdf_errors_1.PdfWriteError; } });
98
+ Object.defineProperty(exports, "isPdfError", { enumerable: true, get: function () { return pdf_errors_1.isPdfError; } });
99
+ Object.defineProperty(exports, "isPdfErrorType", { enumerable: true, get: function () { return pdf_errors_1.isPdfErrorType; } });
100
+ // ============================================================================
101
+ // Job Error Exports
102
+ // ============================================================================
103
+ var job_errors_1 = require("./job-errors");
104
+ Object.defineProperty(exports, "JobError", { enumerable: true, get: function () { return job_errors_1.JobError; } });
105
+ Object.defineProperty(exports, "JobNotFoundError", { enumerable: true, get: function () { return job_errors_1.JobNotFoundError; } });
106
+ Object.defineProperty(exports, "InvalidFunctionError", { enumerable: true, get: function () { return job_errors_1.InvalidFunctionError; } });
107
+ Object.defineProperty(exports, "CrossAppPermissionError", { enumerable: true, get: function () { return job_errors_1.CrossAppPermissionError; } });
108
+ Object.defineProperty(exports, "JobExecutionError", { enumerable: true, get: function () { return job_errors_1.JobExecutionError; } });
109
+ Object.defineProperty(exports, "isJobError", { enumerable: true, get: function () { return job_errors_1.isJobError; } });
110
+ Object.defineProperty(exports, "isJobErrorType", { enumerable: true, get: function () { return job_errors_1.isJobErrorType; } });
111
+ // ============================================================================
83
112
  // Volume Error Exports
84
113
  // ============================================================================
85
114
  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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C/E,sBAAsB;AACtB,+EAA+E;AAE/E,+CAMwB;AALtB,0GAAA,UAAU,OAAA;AACV,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA;AACf,4GAAA,YAAY,OAAA;AACZ,gHAAA,gBAAgB,OAAA;AA2BlB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E,2CAMsB;AALpB,sGAAA,QAAQ,OAAA;AACR,2GAAA,aAAa,OAAA;AACb,2GAAA,aAAa,OAAA;AACb,wGAAA,UAAU,OAAA;AACV,4GAAA,cAAc,OAAA;AAiBhB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E,2CAQsB;AAPpB,sGAAA,QAAQ,OAAA;AACR,8GAAA,gBAAgB,OAAA;AAChB,kHAAA,oBAAoB,OAAA;AACpB,qHAAA,uBAAuB,OAAA;AACvB,+GAAA,iBAAiB,OAAA;AACjB,wGAAA,UAAU,OAAA;AACV,4GAAA,cAAc,OAAA;AAqChB,+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,2BAA2B,OAAA;AAC3B,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"}
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Ketrics SDK - Job Error Classes
3
+ *
4
+ * Provides typed errors for background job operations in tenant applications.
5
+ *
6
+ * Error Hierarchy:
7
+ * - JobError (base)
8
+ * - JobNotFoundError
9
+ * - InvalidFunctionError
10
+ * - CrossAppPermissionError
11
+ * - JobExecutionError
12
+ */
13
+ /**
14
+ * Base error class for all Job errors
15
+ *
16
+ * All Job errors extend this class and include:
17
+ * - jobId: The job ID that caused the error (if applicable)
18
+ * - operation: The operation that failed
19
+ * - timestamp: When the error occurred
20
+ */
21
+ export declare abstract class JobError extends Error {
22
+ /** Job ID that caused the error (if applicable) */
23
+ readonly jobId?: string;
24
+ /** Operation that failed */
25
+ readonly operation: string;
26
+ /** When the error occurred */
27
+ readonly timestamp: Date;
28
+ constructor(message: string, operation: string, jobId?: string);
29
+ /**
30
+ * Serialize error for logging
31
+ */
32
+ toJSON(): Record<string, unknown>;
33
+ }
34
+ /**
35
+ * Error thrown when a job is not found
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * try {
40
+ * const status = await ketrics.Job.getStatus('invalid-job-id');
41
+ * } catch (error) {
42
+ * if (error instanceof ketrics.JobNotFoundError) {
43
+ * console.log(`Job '${error.jobId}' not found`);
44
+ * }
45
+ * }
46
+ * ```
47
+ */
48
+ export declare class JobNotFoundError extends JobError {
49
+ constructor(jobId: string);
50
+ }
51
+ /**
52
+ * Error thrown when function name is invalid or missing
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * try {
57
+ * await ketrics.Job.runInBackground({ function: '' });
58
+ * } catch (error) {
59
+ * if (error instanceof ketrics.InvalidFunctionError) {
60
+ * console.log(`Invalid function: ${error.functionName}`);
61
+ * }
62
+ * }
63
+ * ```
64
+ */
65
+ export declare class InvalidFunctionError extends JobError {
66
+ /** The invalid function name */
67
+ readonly functionName: string;
68
+ constructor(functionName: string);
69
+ toJSON(): Record<string, unknown>;
70
+ }
71
+ /**
72
+ * Error thrown when cross-app job lacks required permission
73
+ *
74
+ * This error occurs when attempting to create a job in another application
75
+ * without a valid application grant that includes background job permission.
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * try {
80
+ * await ketrics.Job.runInBackground({
81
+ * application: 'other-app',
82
+ * function: 'processData',
83
+ * });
84
+ * } catch (error) {
85
+ * if (error instanceof ketrics.CrossAppPermissionError) {
86
+ * console.log(`Cannot create job from '${error.sourceApp}' to '${error.targetApp}'`);
87
+ * }
88
+ * }
89
+ * ```
90
+ */
91
+ export declare class CrossAppPermissionError extends JobError {
92
+ /** Source application code (where the job was created from) */
93
+ readonly sourceApp: string;
94
+ /** Target application code (where the job would run) */
95
+ readonly targetApp: string;
96
+ constructor(sourceApp: string, targetApp: string);
97
+ toJSON(): Record<string, unknown>;
98
+ }
99
+ /**
100
+ * Error thrown when job execution fails
101
+ *
102
+ * This error wraps runtime errors that occur during job execution.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * const status = await ketrics.Job.getStatus(jobId);
107
+ * if (status.status === 'failed' && status.error) {
108
+ * console.log(`Job failed with code ${status.error.code}: ${status.error.message}`);
109
+ * }
110
+ * ```
111
+ */
112
+ export declare class JobExecutionError extends JobError {
113
+ /** Error code from job execution */
114
+ readonly errorCode: string;
115
+ constructor(jobId: string, errorCode: string, message: string);
116
+ toJSON(): Record<string, unknown>;
117
+ }
118
+ /**
119
+ * Type guard to check if an error is a JobError
120
+ *
121
+ * @param error - The error to check
122
+ * @returns True if the error is a JobError
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * try {
127
+ * await ketrics.Job.runInBackground({ function: 'myFunc' });
128
+ * } catch (error) {
129
+ * if (isJobError(error)) {
130
+ * console.log(`Job error during ${error.operation}: ${error.message}`);
131
+ * }
132
+ * }
133
+ * ```
134
+ */
135
+ export declare function isJobError(error: unknown): error is JobError;
136
+ /**
137
+ * Type guard to check if an error is a specific JobError type
138
+ *
139
+ * @param error - The error to check
140
+ * @param errorClass - The error class to check against
141
+ * @returns True if the error is an instance of the specified class
142
+ *
143
+ * @example
144
+ * ```typescript
145
+ * try {
146
+ * await ketrics.Job.getStatus('invalid-id');
147
+ * } catch (error) {
148
+ * if (isJobErrorType(error, JobNotFoundError)) {
149
+ * console.log('Job not found');
150
+ * } else if (isJobErrorType(error, CrossAppPermissionError)) {
151
+ * console.log('Permission denied');
152
+ * }
153
+ * }
154
+ * ```
155
+ */
156
+ export declare function isJobErrorType<T extends JobError>(error: unknown, errorClass: new (...args: never[]) => T): error is T;
157
+ //# sourceMappingURL=job-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-errors.d.ts","sourceRoot":"","sources":["../src/job-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;;;;;;GAOG;AACH,8BAAsB,QAAS,SAAQ,KAAK;IAC1C,mDAAmD;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,4BAA4B;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAa9D;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CASlC;AAMD;;;;;;;;;;;;;GAaG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ;gBAChC,KAAK,EAAE,MAAM;CAO1B;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,gCAAgC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAElB,YAAY,EAAE,MAAM;IAQhC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMlC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,uBAAwB,SAAQ,QAAQ;IACnD,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,wDAAwD;IACxD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAShD,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAOlC;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAkB,SAAQ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