@zola_do/document-manipulator 0.2.7 → 0.2.9

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.
Files changed (2) hide show
  1. package/README.md +14 -14
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -47,9 +47,9 @@ npm install libreoffice-convert
47
47
  ### 1. Register Modules
48
48
 
49
49
  ```typescript
50
- import { Module } from "@nestjs/common";
51
- import { DocumentManipulatorModule } from "@zola_do/document-manipulator";
52
- import { MinIoModule } from "@zola_do/minio";
50
+ import { Module } from '@nestjs/common';
51
+ import { DocumentManipulatorModule } from '@zola_do/document-manipulator';
52
+ import { MinIoModule } from '@zola_do/minio';
53
53
 
54
54
  @Module({
55
55
  imports: [MinIoModule, DocumentManipulatorModule],
@@ -60,8 +60,8 @@ export class AppModule {}
60
60
  ### 2. Use Service
61
61
 
62
62
  ```typescript
63
- import { Injectable } from "@nestjs/common";
64
- import { DocumentManipulatorService } from "@zola_do/document-manipulator";
63
+ import { Injectable } from '@nestjs/common';
64
+ import { DocumentManipulatorService } from '@zola_do/document-manipulator';
65
65
 
66
66
  @Injectable()
67
67
  export class ReportService {
@@ -80,8 +80,8 @@ export class ReportService {
80
80
  return await this.minioService.uploadBuffer(
81
81
  mergedBuffer,
82
82
  `merged-invoice-${Date.now()}.pdf`,
83
- "application/pdf",
84
- "invoices",
83
+ 'application/pdf',
84
+ 'invoices',
85
85
  );
86
86
  }
87
87
  }
@@ -256,8 +256,8 @@ async convertViaRemote(docxBuffer: Buffer): Promise<Buffer> {
256
256
  Utility service for file operations:
257
257
 
258
258
  ```typescript
259
- import { Injectable } from "@nestjs/common";
260
- import { FileHelperService } from "@zola_do/document-manipulator";
259
+ import { Injectable } from '@nestjs/common';
260
+ import { FileHelperService } from '@zola_do/document-manipulator';
261
261
 
262
262
  @Injectable()
263
263
  export class DocumentService {
@@ -275,7 +275,7 @@ export class DocumentService {
275
275
 
276
276
  // Validate file type
277
277
  if (!this.fileHelper.isValidDocumentType(ext)) {
278
- throw new BadRequestException("Invalid document type");
278
+ throw new BadRequestException('Invalid document type');
279
279
  }
280
280
 
281
281
  // Get file size
@@ -374,7 +374,7 @@ class DocumentManipulatorService {
374
374
  // Conversion
375
375
  async convertDocument(
376
376
  buffer: Buffer,
377
- outputExtension: ".pdf" | ".html" | ".odt",
377
+ outputExtension: '.pdf' | '.html' | '.odt',
378
378
  ): Promise<Buffer>;
379
379
  }
380
380
  ```
@@ -464,7 +464,7 @@ Check that the input buffer is a valid document:
464
464
 
465
465
  ```typescript
466
466
  if (buffer.length === 0) {
467
- throw new Error("Empty buffer");
467
+ throw new Error('Empty buffer');
468
468
  }
469
469
  ```
470
470
 
@@ -474,8 +474,8 @@ Ensure PDF buffers are valid:
474
474
 
475
475
  ```typescript
476
476
  // Verify PDF header
477
- if (!buffer.slice(0, 4).equals(Buffer.from("%PDF"))) {
478
- throw new Error("Invalid PDF buffer");
477
+ if (!buffer.slice(0, 4).equals(Buffer.from('%PDF'))) {
478
+ throw new Error('Invalid PDF buffer');
479
479
  }
480
480
  ```
481
481
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zola_do/document-manipulator",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "PDF/DOCX merge, conversion, template population for NestJS",
5
5
  "author": "zolaDO",
6
6
  "license": "ISC",
@@ -36,7 +36,7 @@
36
36
  "rxjs": "^7.0.0 || ^8.0.0"
37
37
  },
38
38
  "dependencies": {
39
- "@zola_do/minio": "^0.2.0",
39
+ "@zola_do/minio": "^0.2.7",
40
40
  "@scholarcy/docx-merger": "^0.3.0",
41
41
  "axios": "^1.13.6",
42
42
  "docx-templates": "^4.14.1",