@zola_do/document-manipulator 0.3.6 → 0.3.7
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/README.md +35 -3
- package/dist/document-convert-endpoint.helper.d.ts +3 -0
- package/dist/document-convert-endpoint.helper.js +42 -0
- package/dist/document-convert-endpoint.helper.js.map +1 -0
- package/dist/document-manipulator.module.d.ts +2 -0
- package/dist/document-manipulator.module.js +13 -0
- package/dist/document-manipulator.module.js.map +1 -1
- package/dist/document-manipulator.service.d.ts +6 -3
- package/dist/document-manipulator.service.js +40 -28
- package/dist/document-manipulator.service.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ npm install libreoffice-convert
|
|
|
41
41
|
|
|
42
42
|
- **LibreOffice / soffice:** Runs as a subprocess during conversion. In production, enforce **timeouts** on conversion calls in your app, bound **temporary directories**, and avoid running converters as root. On Linux, consider `systemd` `MemoryMax` / `CPUQuota` for the worker process or dedicated job containers.
|
|
43
43
|
- **Cloud conversion:** For serverless or locked-down containers without LibreOffice, route conversions through an external API by implementing a thin wrapper in your app (keep secrets and quotas in your infrastructure, not in this library).
|
|
44
|
+
- **Remote convert SSRF:** When using `convertDocxToPdf`, set `DOCUMENT_CONVERT_ENDPOINT` to an `https://` URL and restrict hosts with `DOCUMENT_CONVERT_ALLOWED_HOSTS` (comma-separated). Requests use `maxRedirects: 0`.
|
|
45
|
+
- **Template trust:** Same as `@zola_do/docx` — trusted templates only; `populateTemplate` rejects `EXEC` by default via `secureCreateReport`.
|
|
44
46
|
|
|
45
47
|
## Quick Start
|
|
46
48
|
|
|
@@ -171,10 +173,40 @@ async convertToHtml(docxBuffer: Buffer): Promise<Buffer> {
|
|
|
171
173
|
|
|
172
174
|
### Convert DOCX to PDF
|
|
173
175
|
|
|
176
|
+
**Local (LibreOffice — preferred for dev):**
|
|
177
|
+
|
|
174
178
|
```typescript
|
|
175
|
-
async
|
|
176
|
-
|
|
177
|
-
|
|
179
|
+
async convertDocxToPdfWithLibreOffice(docxBuffer: Buffer): Promise<Buffer> {
|
|
180
|
+
return this.docService.convertDocxToPdfWithLibreOffice(docxBuffer);
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Remote HTTP converter (production / serverless):**
|
|
185
|
+
|
|
186
|
+
Set `DOCUMENT_CONVERT_ENDPOINT` (https in production; `http://localhost` allowed for local dev). Optional `DOCUMENT_CONVERT_ALLOWED_HOSTS` pins permitted hostnames.
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
async convertDocxToPdfRemote(docxBuffer: Buffer): Promise<Buffer> {
|
|
190
|
+
return this.docService.convertDocxToPdf(docxBuffer);
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Conversion-only module (no MinIO):**
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
import { DocumentManipulatorModule } from '@zola_do/document-manipulator';
|
|
198
|
+
|
|
199
|
+
@Module({
|
|
200
|
+
imports: [DocumentManipulatorModule.forConversion()],
|
|
201
|
+
})
|
|
202
|
+
export class ReportsModule {}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Generic LibreOffice convert** (`.pdf`, `.html`, …):
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
async convertDocument(inputBuffer: Buffer, fileType: string): Promise<Buffer> {
|
|
209
|
+
return this.docService.convertDocument(inputBuffer, fileType);
|
|
178
210
|
}
|
|
179
211
|
```
|
|
180
212
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseDocumentConvertAllowedHosts = parseDocumentConvertAllowedHosts;
|
|
4
|
+
exports.validateDocumentConvertEndpoint = validateDocumentConvertEndpoint;
|
|
5
|
+
exports.resolveDocumentConvertEndpoint = resolveDocumentConvertEndpoint;
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
function parseDocumentConvertAllowedHosts(raw = process.env.DOCUMENT_CONVERT_ALLOWED_HOSTS) {
|
|
8
|
+
if (!(raw === null || raw === void 0 ? void 0 : raw.trim())) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
const hosts = raw
|
|
12
|
+
.split(',')
|
|
13
|
+
.map((host) => host.trim().toLowerCase())
|
|
14
|
+
.filter(Boolean);
|
|
15
|
+
return hosts.length > 0 ? hosts : undefined;
|
|
16
|
+
}
|
|
17
|
+
function validateDocumentConvertEndpoint(endpoint, allowedHosts = parseDocumentConvertAllowedHosts()) {
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = new URL(endpoint);
|
|
21
|
+
}
|
|
22
|
+
catch (_a) {
|
|
23
|
+
throw new common_1.InternalServerErrorException('DOCUMENT_CONVERT_ENDPOINT must be a valid absolute URL');
|
|
24
|
+
}
|
|
25
|
+
if (parsed.protocol !== 'https:' &&
|
|
26
|
+
!(parsed.protocol === 'http:' &&
|
|
27
|
+
['localhost', '127.0.0.1', '[::1]'].includes(parsed.hostname.toLowerCase()))) {
|
|
28
|
+
throw new common_1.InternalServerErrorException('DOCUMENT_CONVERT_ENDPOINT must use https (http is allowed only for localhost)');
|
|
29
|
+
}
|
|
30
|
+
if (allowedHosts && !allowedHosts.includes(parsed.hostname.toLowerCase())) {
|
|
31
|
+
throw new common_1.InternalServerErrorException('DOCUMENT_CONVERT_ENDPOINT host is not in DOCUMENT_CONVERT_ALLOWED_HOSTS');
|
|
32
|
+
}
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
function resolveDocumentConvertEndpoint() {
|
|
36
|
+
const endpoint = process.env.DOCUMENT_CONVERT_ENDPOINT;
|
|
37
|
+
if (!endpoint) {
|
|
38
|
+
throw new common_1.InternalServerErrorException('DOCUMENT_CONVERT_ENDPOINT is not configured');
|
|
39
|
+
}
|
|
40
|
+
return validateDocumentConvertEndpoint(endpoint).toString();
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=document-convert-endpoint.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-convert-endpoint.helper.js","sourceRoot":"","sources":["../src/document-convert-endpoint.helper.ts"],"names":[],"mappings":";;;;;AAAA,2CAA8D;AAE9D,0CACE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B;IAEhD,IAAI,EAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,EAAE,CAAA,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAG,GAAG;SACd,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SACxC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC;AAED,yCACE,QAAgB,EAChB,YAAY,GAAG,gCAAgC,EAAE;IAEjD,IAAI,MAAW,CAAC;IAEhB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;eAAO,CAAC;QACP,MAAM,IAAI,qCAA4B,CACpC,wDAAwD,CACzD,CAAC;IACJ,CAAC;IAED,IACE,MAAM,CAAC,QAAQ,KAAK,QAAQ;QAC5B,CAAC,CACC,MAAM,CAAC,QAAQ,KAAK,OAAO;YAC3B,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,QAAQ,CAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAC9B,CACF,EACD,CAAC;QACD,MAAM,IAAI,qCAA4B,CACpC,+EAA+E,CAChF,CAAC;IACJ,CAAC;IAED,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAC1E,MAAM,IAAI,qCAA4B,CACpC,yEAAyE,CAC1E,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;IACE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;IACvD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,qCAA4B,CACpC,6CAA6C,CAC9C,CAAC;IACJ,CAAC;IAED,OAAO,+BAA+B,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -11,7 +11,20 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const document_manipulator_service_1 = require("./document-manipulator.service");
|
|
12
12
|
const minio_1 = require("@zola_do/minio");
|
|
13
13
|
const file_helper_service_1 = require("./file-helper.service");
|
|
14
|
+
let DocumentManipulatorConversionModule = class DocumentManipulatorConversionModule {
|
|
15
|
+
};
|
|
16
|
+
DocumentManipulatorConversionModule = __decorate([
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
providers: [document_manipulator_service_1.DocumentManipulatorService],
|
|
19
|
+
exports: [document_manipulator_service_1.DocumentManipulatorService],
|
|
20
|
+
})
|
|
21
|
+
], DocumentManipulatorConversionModule);
|
|
14
22
|
let DocumentManipulatorModule = class DocumentManipulatorModule {
|
|
23
|
+
static forConversion() {
|
|
24
|
+
return {
|
|
25
|
+
module: DocumentManipulatorConversionModule,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
15
28
|
};
|
|
16
29
|
exports.DocumentManipulatorModule = DocumentManipulatorModule;
|
|
17
30
|
exports.DocumentManipulatorModule = DocumentManipulatorModule = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-manipulator.module.js","sourceRoot":"","sources":["../src/document-manipulator.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"document-manipulator.module.js","sourceRoot":"","sources":["../src/document-manipulator.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuD;AACvD,iFAA4E;AAC5E,0CAA6C;AAC7C,+DAA0D;AAM1D,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;CAAG,CAAA;AAAtC,mCAAmC;IAJxC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,yDAA0B,CAAC;QACvC,OAAO,EAAE,CAAC,yDAA0B,CAAC;KACtC,CAAC;GACI,mCAAmC,CAAG;AAQrC,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAEpC,MAAM,CAAC,aAAa;QAClB,OAAO;YACL,MAAM,EAAE,mCAAmC;SAC5C,CAAC;IACJ,CAAC;CACF,CAAA;;oCAPY,yBAAyB;IANrC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,mBAAW,CAAC;QACtB,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,yDAA0B,EAAE,uCAAiB,CAAC;QAC1D,OAAO,EAAE,CAAC,yDAA0B,EAAE,uCAAiB,CAAC;KACzD,CAAC;GACW,yBAAyB,CAOrC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { MinIOService } from '@zola_do/minio';
|
|
2
2
|
export declare class DocumentManipulatorService {
|
|
3
|
-
private readonly minIOService
|
|
4
|
-
|
|
3
|
+
private readonly minIOService?;
|
|
4
|
+
private readonly libreConvert;
|
|
5
|
+
constructor(minIOService?: MinIOService);
|
|
6
|
+
private requireMinIO;
|
|
5
7
|
mergePdf(pdfBuffers: Buffer[]): Promise<void>;
|
|
6
8
|
mergeDocx(docxBuffers: Buffer[]): Promise<void>;
|
|
7
9
|
merge(): Promise<void>;
|
|
8
|
-
convertDocument(inputBuffer: Buffer, fileType: string): Promise<Buffer
|
|
10
|
+
convertDocument(inputBuffer: Buffer, fileType: string): Promise<Buffer>;
|
|
11
|
+
convertDocxToPdfWithLibreOffice(docxBuffer: Buffer): Promise<Buffer>;
|
|
9
12
|
streamToBuffer(readableStream: any): Promise<Buffer>;
|
|
10
13
|
populateTemplate(template: Buffer, data: any): Promise<Buffer<ArrayBuffer>>;
|
|
11
14
|
convertDocxToPdf(file: Buffer): Promise<Buffer>;
|
|
@@ -41,6 +41,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
41
41
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
42
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
43
|
};
|
|
44
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
+
};
|
|
44
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
49
|
};
|
|
@@ -49,18 +52,27 @@ exports.DocumentManipulatorService = void 0;
|
|
|
49
52
|
const common_1 = require("@nestjs/common");
|
|
50
53
|
const pdf_lib_1 = require("pdf-lib");
|
|
51
54
|
const minio_1 = require("@zola_do/minio");
|
|
55
|
+
const docx_1 = require("@zola_do/docx");
|
|
52
56
|
const DocxMerger = __importStar(require("@scholarcy/docx-merger"));
|
|
53
|
-
const docx_templates_1 = require("docx-templates");
|
|
54
57
|
const libre = __importStar(require("libreoffice-convert"));
|
|
55
58
|
const util_1 = require("util");
|
|
56
59
|
const form_data_1 = __importDefault(require("form-data"));
|
|
57
60
|
const axios_1 = __importDefault(require("axios"));
|
|
61
|
+
const document_convert_endpoint_helper_1 = require("./document-convert-endpoint.helper");
|
|
58
62
|
let DocumentManipulatorService = class DocumentManipulatorService {
|
|
59
63
|
constructor(minIOService) {
|
|
60
64
|
this.minIOService = minIOService;
|
|
65
|
+
this.libreConvert = (0, util_1.promisify)(libre.convert);
|
|
66
|
+
}
|
|
67
|
+
requireMinIO() {
|
|
68
|
+
if (!this.minIOService) {
|
|
69
|
+
throw new common_1.InternalServerErrorException('MinIO is not configured for DocumentManipulatorService');
|
|
70
|
+
}
|
|
71
|
+
return this.minIOService;
|
|
61
72
|
}
|
|
62
73
|
async mergePdf(pdfBuffers) {
|
|
63
74
|
try {
|
|
75
|
+
const minIOService = this.requireMinIO();
|
|
64
76
|
const mergedPdf = await pdf_lib_1.PDFDocument.create();
|
|
65
77
|
for (const pdfBuffer of pdfBuffers) {
|
|
66
78
|
const pdf = await pdf_lib_1.PDFDocument.load(pdfBuffer);
|
|
@@ -70,7 +82,7 @@ let DocumentManipulatorService = class DocumentManipulatorService {
|
|
|
70
82
|
});
|
|
71
83
|
}
|
|
72
84
|
const result = await mergedPdf.save();
|
|
73
|
-
await
|
|
85
|
+
await minIOService.uploadBuffer(Buffer.from(result), 'preBudgetPlanReport.pdf', 'application/pdf', minio_1.BucketNameEnum.SPD_TEMPLATE);
|
|
74
86
|
}
|
|
75
87
|
catch (error) {
|
|
76
88
|
throw error;
|
|
@@ -78,17 +90,19 @@ let DocumentManipulatorService = class DocumentManipulatorService {
|
|
|
78
90
|
}
|
|
79
91
|
async mergeDocx(docxBuffers) {
|
|
80
92
|
try {
|
|
93
|
+
const minIOService = this.requireMinIO();
|
|
81
94
|
const docx = new DocxMerger();
|
|
82
95
|
await docx.initialize({}, [docxBuffers]);
|
|
83
96
|
const buffer = await docx.save('nodebuffer');
|
|
84
|
-
await
|
|
97
|
+
await minIOService.uploadBuffer(buffer, 'preBudgetPlanReport.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', minio_1.BucketNameEnum.SPD_TEMPLATE);
|
|
85
98
|
}
|
|
86
99
|
catch (error) {
|
|
87
100
|
throw error;
|
|
88
101
|
}
|
|
89
102
|
}
|
|
90
103
|
async merge() {
|
|
91
|
-
const
|
|
104
|
+
const minIOService = this.requireMinIO();
|
|
105
|
+
const bdsTemplateRead = await minIOService.downloadBuffer({
|
|
92
106
|
filepath: 'bds-template.docx',
|
|
93
107
|
bucketName: minio_1.BucketNameEnum.SPD_TEMPLATE,
|
|
94
108
|
});
|
|
@@ -98,7 +112,7 @@ let DocumentManipulatorService = class DocumentManipulatorService {
|
|
|
98
112
|
});
|
|
99
113
|
const bdsTemplatePopulatedHtmlBuffer = await this.convertDocument(bdsTemplatePopulatedBuffer, '.html');
|
|
100
114
|
const bds = bdsTemplatePopulatedHtmlBuffer.toString();
|
|
101
|
-
const testRead = await
|
|
115
|
+
const testRead = await minIOService.downloadBuffer({
|
|
102
116
|
filepath: 'test.docx',
|
|
103
117
|
bucketName: minio_1.BucketNameEnum.SPD_TEMPLATE,
|
|
104
118
|
});
|
|
@@ -111,14 +125,18 @@ let DocumentManipulatorService = class DocumentManipulatorService {
|
|
|
111
125
|
date_of_issue_of_bidding: new Date(),
|
|
112
126
|
bds: `${bds}`,
|
|
113
127
|
});
|
|
114
|
-
const pdfBuffer =
|
|
115
|
-
|
|
116
|
-
|
|
128
|
+
const pdfBuffer = process.env.DOCUMENT_CONVERT_ENDPOINT
|
|
129
|
+
? await this.convertDocxToPdf(testPopulatedBuffer)
|
|
130
|
+
: await this.convertDocxToPdfWithLibreOffice(testPopulatedBuffer);
|
|
131
|
+
await minIOService.uploadBuffer(pdfBuffer, 'report.pdf', 'application/pdf', minio_1.BucketNameEnum.SPD_TEMPLATE);
|
|
132
|
+
await minIOService.uploadBuffer(testPopulatedBuffer, 'report.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', minio_1.BucketNameEnum.SPD_TEMPLATE);
|
|
117
133
|
}
|
|
118
134
|
async convertDocument(inputBuffer, fileType) {
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
135
|
+
const convertedBuffer = await this.libreConvert(inputBuffer, fileType, undefined);
|
|
136
|
+
return Buffer.from(convertedBuffer);
|
|
137
|
+
}
|
|
138
|
+
async convertDocxToPdfWithLibreOffice(docxBuffer) {
|
|
139
|
+
return this.convertDocument(docxBuffer, '.pdf');
|
|
122
140
|
}
|
|
123
141
|
async streamToBuffer(readableStream) {
|
|
124
142
|
return new Promise((resolve, reject) => {
|
|
@@ -129,34 +147,28 @@ let DocumentManipulatorService = class DocumentManipulatorService {
|
|
|
129
147
|
});
|
|
130
148
|
}
|
|
131
149
|
async populateTemplate(template, data) {
|
|
132
|
-
const buffer = await (0,
|
|
150
|
+
const buffer = await (0, docx_1.secureCreateReport)({
|
|
133
151
|
template,
|
|
134
152
|
data,
|
|
135
153
|
});
|
|
136
154
|
return Buffer.from(buffer);
|
|
137
155
|
}
|
|
138
156
|
async convertDocxToPdf(file) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
form.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
});
|
|
149
|
-
const outputBuffer = request.data;
|
|
150
|
-
return outputBuffer;
|
|
151
|
-
}
|
|
152
|
-
catch (error) {
|
|
153
|
-
throw error;
|
|
154
|
-
}
|
|
157
|
+
const endpoint = (0, document_convert_endpoint_helper_1.resolveDocumentConvertEndpoint)();
|
|
158
|
+
const form = new form_data_1.default();
|
|
159
|
+
form.append('file', file, 'inputFile.docx');
|
|
160
|
+
const { data } = await axios_1.default.post(endpoint, form, {
|
|
161
|
+
responseType: 'arraybuffer',
|
|
162
|
+
maxRedirects: 0,
|
|
163
|
+
headers: form.getHeaders(),
|
|
164
|
+
});
|
|
165
|
+
return Buffer.from(data);
|
|
155
166
|
}
|
|
156
167
|
};
|
|
157
168
|
exports.DocumentManipulatorService = DocumentManipulatorService;
|
|
158
169
|
exports.DocumentManipulatorService = DocumentManipulatorService = __decorate([
|
|
159
170
|
(0, common_1.Injectable)(),
|
|
171
|
+
__param(0, (0, common_1.Optional)()),
|
|
160
172
|
__metadata("design:paramtypes", [minio_1.MinIOService])
|
|
161
173
|
], DocumentManipulatorService);
|
|
162
174
|
//# sourceMappingURL=document-manipulator.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-manipulator.service.js","sourceRoot":"","sources":["../src/document-manipulator.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"document-manipulator.service.js","sourceRoot":"","sources":["../src/document-manipulator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoF;AACpF,qCAAsC;AACtC,0CAA8D;AAC9D,wCAAmD;AACnD,MAAY,UAAU,mDAA+B;AACrD,MAAY,KAAK,gDAA4B;AAC7C,+BAAiC;AACjC,0DAAiC;AACjC,kDAA0B;AAC1B,yFAAoF;AAG7E,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAGrC,YAAyC,YAA2B;QAA3B,iBAAY,GAAZ,YAAY,CAAe;QAFnD,iBAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEc,CAAC;IAEhE,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,qCAA4B,CACpC,wDAAwD,CACzD,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,UAAoB;QACjC,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACzC,MAAM,SAAS,GAAG,MAAM,qBAAW,CAAC,MAAM,EAAE,CAAC;YAC7C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;gBACnC,MAAM,GAAG,GAAG,MAAM,qBAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAE9C,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,SAAS,CAC3C,GAAG,EACH,GAAG,CAAC,cAAc,EAAE,CACrB,CAAC;gBACF,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAA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AC3B,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;SAC3B,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF,CAAA;;qCArKY,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAIE,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAAiC,oBAAY;GAHzD,0BAA0B,CAqKtC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./document-manipulator.module"), exports);
|
|
18
18
|
__exportStar(require("./document-manipulator.service"), exports);
|
|
19
|
+
__exportStar(require("./document-convert-endpoint.helper"), exports);
|
|
19
20
|
__exportStar(require("./file-helper.service"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,iEAA+C;AAC/C,wDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,iEAA+C;AAC/C,qEAAmD;AACnD,wDAAsC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zola_do/document-manipulator",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "PDF/DOCX merge, conversion, template population for NestJS",
|
|
5
5
|
"author": "zolaDO",
|
|
6
6
|
"license": "ISC",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"rxjs": "^7.0.0 || ^8.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@zola_do/docx": "^0.3.6",
|
|
39
40
|
"@zola_do/minio": "^0.2.17",
|
|
40
41
|
"@scholarcy/docx-merger": "^0.3.0",
|
|
41
42
|
"axios": "^1.16.0",
|