@sme.up/doc-alchemist 1.1.0-SNAPSHOT-20250623155458 → 1.2.0-SNAPSHOT-20250624074547

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.
@@ -4,4 +4,3 @@ export declare const dataTableToPdfData: (component: {
4
4
  smeupDataTable: SmeupDataTable;
5
5
  props: GenericObject;
6
6
  }, webupManagerData: WebupManagerData) => Promise<Buffer>;
7
- export declare const convertToPdf: (excelData: Buffer | Uint8Array) => Promise<Buffer>;
@@ -1,28 +1,4 @@
1
- import { SupportedExportFormats, } from "../types/index.js";
2
- import { dataTableToExcelData } from "../excel/excel-generator.js";
3
- import * as libre from "libreoffice-convert";
4
- import { promisify } from "util";
5
1
  export const dataTableToPdfData = async (component, webupManagerData) => {
6
- const excelData = await dataTableToExcelData({ smeupDataTable: component.smeupDataTable, props: component.props }, SupportedExportFormats.XLSX, webupManagerData);
7
- return convertToPdf(excelData);
8
- };
9
- export const convertToPdf = async (excelData) => {
10
- const extend = ".pdf";
11
- const convertAsync = promisify(libre.convert);
12
- let buffer;
13
- if (Buffer.isBuffer(excelData)) {
14
- buffer = excelData;
15
- }
16
- else {
17
- buffer = Buffer.from(excelData);
18
- }
19
- try {
20
- const pdfBuf = await convertAsync(buffer, extend, undefined);
21
- return pdfBuf;
22
- }
23
- catch (err) {
24
- console.error("Errore nella conversione in PDF:", err);
25
- throw err;
26
- }
2
+ throw new Error("dataTableToPdfData is not implemented");
27
3
  };
28
4
  //# sourceMappingURL=pdf-generator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-generator.js","sourceRoot":"","sources":["../../../src/pdf/pdf-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,sBAAsB,GAEvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,SAGC,EACD,gBAAkC,EACjB,EAAE;IACnB,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAC1C,EAAE,cAAc,EAAE,SAAS,CAAC,cAAc,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,EACpE,sBAAsB,CAAC,IAAI,EAC3B,gBAAgB,CACjB,CAAC;IAEF,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,SAA8B,EACb,EAAE;IACnB,MAAM,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,MAAc,CAAC;IACnB,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/B,MAAM,GAAG,SAAS,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QAC7D,OAAO,MAAgB,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;QACvD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { SmeupDataTable } from \"@sme.up/kokos-sdk-node\";\nimport {\n GenericObject,\n SupportedExportFormats,\n WebupManagerData,\n} from \"../types/index.js\";\nimport { dataTableToExcelData } from \"../excel/excel-generator.js\";\nimport * as libre from \"libreoffice-convert\";\nimport { promisify } from \"util\";\n\nexport const dataTableToPdfData = async (\n component: {\n smeupDataTable: SmeupDataTable;\n props: GenericObject;\n },\n webupManagerData: WebupManagerData,\n): Promise<Buffer> => {\n const excelData = await dataTableToExcelData(\n { smeupDataTable: component.smeupDataTable, props: component.props },\n SupportedExportFormats.XLSX,\n webupManagerData,\n );\n\n return convertToPdf(excelData);\n};\n\nexport const convertToPdf = async (\n excelData: Buffer | Uint8Array,\n): Promise<Buffer> => {\n const extend = \".pdf\";\n const convertAsync = promisify(libre.convert);\n let buffer: Buffer;\n if (Buffer.isBuffer(excelData)) {\n buffer = excelData;\n } else {\n buffer = Buffer.from(excelData);\n }\n try {\n const pdfBuf = await convertAsync(buffer, extend, undefined);\n return pdfBuf as Buffer;\n } catch (err) {\n console.error(\"Errore nella conversione in PDF:\", err);\n throw err;\n }\n};\n"]}
1
+ {"version":3,"file":"pdf-generator.js","sourceRoot":"","sources":["../../../src/pdf/pdf-generator.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,SAGC,EACD,gBAAkC,EACjB,EAAE;IACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { SmeupDataTable } from \"@sme.up/kokos-sdk-node\";\nimport { GenericObject, WebupManagerData } from \"../types/index.js\";\nimport { promisify } from \"util\";\n\nexport const dataTableToPdfData = async (\n component: {\n smeupDataTable: SmeupDataTable;\n props: GenericObject;\n },\n webupManagerData: WebupManagerData,\n): Promise<Buffer> => {\n throw new Error(\"dataTableToPdfData is not implemented\");\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sme.up/doc-alchemist",
3
- "version": "1.1.0-SNAPSHOT-20250623155458",
3
+ "version": "1.2.0-SNAPSHOT-20250624074547",
4
4
  "description": "Library for generating documents in various formats, including Excel and PDF.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Smeup LAB <info@smeup.com> (https://www.smeup.com/)",
@@ -41,7 +41,6 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@sme.up/kokos-sdk-node": "^3.0.0-SNAPSHOT",
44
- "exceljs": "^4.4.0",
45
- "libreoffice-convert": "^1.6.1"
44
+ "exceljs": "^4.4.0"
46
45
  }
47
46
  }