Compare commits

..

8 Commits

Author SHA1 Message Date
627df17b2b v2.0.0
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-12-10 20:55:28 +00:00
c8b5f78757 BREAKING CHANGE(build): Upgrade dependencies and dev tooling; adjust TypeScript config 2025-12-10 20:55:28 +00:00
5889b327bd Merge pull request 'feat: enhance translation and invoice layout' (#3) from feat/enhance-translation into master
Reviewed-on: #3
2025-08-03 22:21:52 +00:00
cb0e69169e feat: upgrade dependencies 2025-07-28 10:36:00 +00:00
df4c782fbb feat: migrate to new tsclass schema 2025-07-28 09:46:06 +00:00
04e668ff83 feat: enhance translation and invoice layout 2025-03-26 14:58:03 +00:00
1106b9648d 1.6.11
Some checks failed
Default (tags) / security (push) Failing after 2s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-01-01 04:57:29 +01:00
1f06a73422 fix(license): Update copyright notice in license to reflect new ownership 2025-01-01 04:57:29 +01:00
13 changed files with 4772 additions and 3288 deletions

View File

@@ -1,5 +1,18 @@
# Changelog
## 2025-12-10 - 2.0.0 - BREAKING CHANGE(build)
Upgrade dependencies and dev tooling; adjust TypeScript config
- Bumped runtime dependencies: @design.estate/*, @push.rocks/*, @git.zone/tsrun (to ^2.0.0), @tsclass/tsclass, puppeteer, @types/node, qrcode types, and others.
- Updated devDependencies: @git.zone/tsbuild, tsbundle, tstest, tswatch to newer releases.
- Removed experimentalDecorators and useDefineForClassFields from tsconfig.json — this may change decorator handling and affect compilation.
- These dependency and config changes may introduce breaking behavior; recommend a major version bump.
## 2025-01-01 - 1.6.11 - fix(license)
Update copyright notice in license to reflect new ownership
- Updated copyright from Lossless GmbH to Task Venture Capital GmbH.
## 2024-12-08 - 1.6.10 - fix(core)
Improve stability and performance of document generation

View File

@@ -1,4 +1,4 @@
Copyright (c) 2022 Lossless GmbH (hello@lossless.com)
Copyright (c) 2022 Task Venture Capital GmbH (hello@task.vc)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

View File

@@ -1,6 +1,6 @@
{
"name": "@design.estate/dees-document",
"version": "1.6.10",
"version": "2.0.0",
"private": false,
"description": "A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.",
"main": "dist_ts_web/index.js",
@@ -21,29 +21,28 @@
"author": "Lossless GmbH",
"license": "MIT",
"dependencies": {
"@design.estate/dees-catalog": "^1.4.1",
"@design.estate/dees-domtools": "^2.3.2",
"@design.estate/dees-element": "^2.0.39",
"@design.estate/dees-wcctools": "^1.0.90",
"@git.zone/tsrun": "^1.3.3",
"@push.rocks/smartfile": "^11.2.0",
"@push.rocks/smartjson": "^5.0.20",
"@push.rocks/smartpath": "^5.0.18",
"@push.rocks/smartpdf": "^3.2.2",
"@design.estate/dees-catalog": "^3.3.0",
"@design.estate/dees-domtools": "^2.3.6",
"@design.estate/dees-element": "^2.1.3",
"@design.estate/dees-wcctools": "^1.2.1",
"@git.zone/tsrun": "^2.0.0",
"@push.rocks/smartfile": "^13.1.0",
"@push.rocks/smartjson": "^6.0.0",
"@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpdf": "^4.1.1",
"@push.rocks/smarttime": "^4.1.1",
"@tsclass/tsclass": "^8.0.3",
"@types/node": "^22.13.13",
"@types/qrcode": "^1.5.5",
"puppeteer": "^24.4.0",
"@tsclass/tsclass": "^9.3.0",
"@types/node": "^25.0.0",
"@types/qrcode": "^1.5.6",
"puppeteer": "^24.32.1",
"qrcode": "^1.5.4"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.3.2",
"@git.zone/tsbundle": "^2.2.5",
"@git.zone/tstest": "^1.0.96",
"@git.zone/tswatch": "^2.1.0",
"@push.rocks/projectinfo": "^5.0.2",
"@push.rocks/tapbundle": "^5.6.0"
"@git.zone/tsbuild": "^3.1.2",
"@git.zone/tsbundle": "^2.6.3",
"@git.zone/tstest": "^3.1.3",
"@git.zone/tswatch": "^2.3.7",
"@push.rocks/projectinfo": "^5.0.2"
},
"files": [
"ts/**/*",

7885
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
import * as plugins from "./plugins.js";
import * as paths from "./paths.js";
import * as interfaces from "../ts_shared/interfaces/index.js";
import { expect, tap } from "@push.rocks/tapbundle";
import { expect, tap } from "@git.zone/tstest/tapbundle";
import * as deesDocumentServer from "../ts/index.js";
let testPdfServiceInstance: deesDocumentServer.PdfService;
@@ -226,4 +226,4 @@ tap.test("should stop the service", async () => {
await testPdfServiceInstance.stop();
});
tap.start();
export default tap.start();

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-document',
version: '1.6.10',
version: '2.0.0',
description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.'
}

View File

@@ -1,5 +1,5 @@
import * as plugins from './plugins.js';
import * as helpers from './helpers.js';
import * as plugins from "./plugins.js";
import * as helpers from "./helpers.js";
export interface IPdfServiceConstructorOptions {}
@@ -8,7 +8,9 @@ export interface IPdfServiceConstructorOptions {}
*/
export class PdfService {
// STATIC
public static async createAndStart(optionsArg: IPdfServiceConstructorOptions) {
public static async createAndStart(
optionsArg: IPdfServiceConstructorOptions
) {
const pdfService = new PdfService(optionsArg);
await pdfService.start();
return pdfService;
@@ -42,17 +44,23 @@ export class PdfService {
* creates an letter
*/
public async createPdfFromLetterObject(optionsArg: {
letterData: plugins.tsclass.business.ILetter;
letterData: plugins.tsclass.business.TLetter;
documentSettings: plugins.shared.interfaces.IDocumentSettings;
}) {
}): Promise<plugins.smartpdf.IPdf> {
const html = `
<script type="module">
${await helpers.getBundleAsString()}
</script>
<dedocument-dedocument printMode documentSettings="${plugins.smartjson.stringifyBase64(optionsArg.documentSettings)}" letterData="${plugins.smartjson.stringifyBase64(optionsArg.letterData)}"></dedocument-dedocument>
<dedocument-dedocument printMode documentSettings="${plugins.smartjson.stringifyBase64(
optionsArg.documentSettings
)}" letterData="${plugins.smartjson.stringifyBase64(
optionsArg.letterData
)}"></dedocument-dedocument>
`;
// console.log(html);
const pdfResult = await this.smartpdfInstance.getA4PdfResultForHtmlString(html);
const pdfResult = await this.smartpdfInstance.getA4PdfResultForHtmlString(
html
);
return pdfResult;
}
}

View File

@@ -50,7 +50,10 @@ const toContact: plugins.tsclass.business.TContact = {
};
export const demoLetter: plugins.tsclass.finance.TInvoice = {
type: "invoice",
type: "accounting-doc",
accountingDocType: "invoice",
accountingDocId: "LL-INV-48765",
accountingDocStatus: "draft",
id: "LL-INV-48765",
versionInfo: {
version: "1.0.0",
@@ -59,7 +62,6 @@ export const demoLetter: plugins.tsclass.finance.TInvoice = {
language: "de",
date: Date.now(),
incidenceId: "LL-INV-48765",
invoiceId: "LL-INV-48765",
subject: "LL-INV-48765",
reverseCharge: true,
dueInDays: 30,
@@ -74,7 +76,6 @@ export const demoLetter: plugins.tsclass.finance.TInvoice = {
printResult: null,
currency: "EUR",
notes: [],
invoiceType: "debitnote",
items: [
{
name: "Item with 19% VAT",

View File

@@ -148,82 +148,10 @@ export const DE_translations: Dictionary = {
vat: "Umsatzsteuer",
};
// Define Spanish translations
// export const ES_translations: TTranslationImplementation = {
// address: "Dirección",
// bankConnection: "Conexión bancaria",
// contactInfo: "Información de contacto",
// description: "Descripción",
// invoice: "Factura",
// itemPos: "Pos.",
// quantity: "Cantidad",
// registrationInfo: "Información de registro",
// reverseVatNote:
// "El IVA se aplica por inversión del sujeto pasivo y debe ser pagado por el cliente.",
// totalNetPrice: "Precio total neto",
// unitNetPrice: "Precio unitario neto",
// unitType: "Tipo de unidad",
// yourCustomerId: "Su número de cliente:",
// yourVatId: "Su ID de IVA:",
// continuesOnPage: "Continúa en la página",
// finalPageStatement: "Esta es la última página de este documento.",
// page: "Página",
// vatShort: "IVA",
// };
// Define French translations
// export const FR_translations: TTranslationImplementation = {
// address: "Adresse",
// bankConnection: "Coordonnées bancaires",
// contactInfo: "Informations de contact",
// description: "Description",
// invoice: "Facture",
// itemPos: "Position",
// quantity: "Quantité",
// registrationInfo: "Informations d'enregistrement",
// reverseVatNote:
// "La TVA s'applique selon le mécanisme d'autoliquidation et est à payer par le client.",
// totalNetPrice: "Prix net total",
// unitNetPrice: "Prix unitaire net",
// unitType: "Type d'unité",
// yourCustomerId: "Votre numéro de client :",
// yourVatId: "Votre numéro de TVA :",
// continuesOnPage: "Continue sur la page",
// finalPageStatement: "Ceci est la dernière page de ce document.",
// page: "Page",
// vatShort: "TVA",
// };
// Define Italian translations
// export const IT_translations: TTranslationImplementation = {
// address: "Indirizzo",
// bankConnection: "Coordinate bancarie",
// contactInfo: "Informazioni di contatto",
// description: "Descrizione",
// invoice: "Fattura",
// itemPos: "Pos.",
// quantity: "Quantità",
// registrationInfo: "Informazioni di registrazione",
// reverseVatNote:
// "L'IVA è applicata con inversione contabile ed è a carico del cliente.",
// totalNetPrice: "Prezzo netto totale",
// unitNetPrice: "Prezzo netto unitario",
// unitType: "Tipo di unità",
// yourCustomerId: "Il tuo numero cliente:",
// yourVatId: "Il tuo numero di partita IVA:",
// continuesOnPage: "Continua alla pagina",
// finalPageStatement: "Questa è l'ultima pagina di questo documento.",
// page: "Pagina",
// vatShort: "IVA",
// };
// Language Code Map
export const languageCodeMap: Record<string, Dictionary> = {
EN: EN_translations,
DE: DE_translations,
// ES: ES_translations,
// FR: FR_translations,
// IT: IT_translations,
};
// Language Code Type

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-document',
version: '1.6.10',
version: '2.0.0',
description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.'
}

View File

@@ -26,7 +26,6 @@ import { DeContentInvoice } from "./contentinvoice.js";
import { demoFunc } from "./document.demo.js";
import { dedocumentSharedStyle } from "../style.js";
import type { TInvoice } from "@tsclass/tsclass/dist_ts/finance/invoice.js";
declare global {
interface HTMLElementTagNameMap {
@@ -159,7 +158,8 @@ export class DeDocument extends DeesElement {
// lets append the content
const content: DeContentInvoice = new DeContentInvoice();
cleanUpStoreCurrentRender.push(content);
content.letterData = this.letterData as unknown as TInvoice;
content.letterData = this
.letterData as unknown as plugins.tsclass.finance.TInvoice;
content.documentSettings = this.documentSettings;
document.body.appendChild(content);

View File

@@ -101,7 +101,7 @@ export class DeLetterHeader extends DeesElement {
];
private renderDeliveryDate(from: Date, to: Date): TemplateResult {
if (this.letterData.type !== "invoice") return null;
if (this.letterData.accountingDocType !== "invoice") return null;
const dateFormat = new Intl.DateTimeFormat(
this.documentSettings.languageCode,
{ dateStyle: this.documentSettings.dateStyle }
@@ -174,7 +174,7 @@ export class DeLetterHeader extends DeesElement {
${this.letterData.to.registrationDetails.vatId || "not provided"}
<!-- TODO: Make use of components -->
${this.letterData.type === "invoice"
${this.letterData.accountingDocType === "invoice"
? html` <div class="label">
${plugins.shared.translation.translate(
this.documentSettings.languageCode,

View File

@@ -1,7 +1,5 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",