UNPKG

node-zugferd

Version:

A Node.js library for creating ZUGFeRD/Factur-X compliant documents. Generating XML and embedding it into PDF/A files, enabling seamless e-invoicing and digital document compliance.

118 lines (114 loc) 3.58 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/codelists/incoterms.gen.ts var incoterms_gen_exports = {}; __export(incoterms_gen_exports, { INCOTERMS: () => INCOTERMS, Incoterms: () => Incoterms, PUBLISHED: () => PUBLISHED, incotermsCode: () => incotermsCode }); module.exports = __toCommonJS(incoterms_gen_exports); // src/codelists/index.ts var getByPath = (obj, path) => path.split(".").reduce((acc, key) => acc?.[key], obj); var createEnum = (data, options) => { return Object.fromEntries( data.map((item) => [ getByPath(item, options.keyProp), getByPath(item, options.valueProp) ]) ); }; // src/codelists/incoterms.gen.ts var PUBLISHED = "Factur-X"; var INCOTERMS = [ { key: "DELIVERY_ARRANGED_BY_SUPPLIER", name: "Delivery arranged by supplier", value: "1" }, { key: "DELIVERY_ARRANGED_BY_LOGISTIC_SERVICE_PROVIDER", name: "Delivery arranged by logistic service provider", value: "2" }, { key: "COST_AND_FREIGHT", name: "Cost and Freight", value: "CFR" }, { key: "COST_INSURANCE_AND_FREIGHT", name: "Cost, Insurance and Freight", value: "CIF" }, { key: "CARRIAGE_AND_INSURANCE_PAID_TO_INSERT_NAMED_PLACE_OF_DESTINATION", name: "Carriage and Insurance Paid to (insert named place of destination)", value: "CIP" }, { key: "CARRIAGE_PAID_TO_INSERT_NAMED_PLACE_OF_DESTINATION", name: "Carriage Paid To (insert named place of destination)", value: "CPT" }, { key: "DELIVERED_AT_PLACE_INSERT_NAMED_PLACE_OF_DESTINATION", name: "Delivered At Place (insert named place of destination)", value: "DAP" }, { key: "DELIVERED_DUTY_PAID_INSERT_NAMED_PLACE_OF_DESTINATION", name: "Delivered Duty Paid (insert named place of destination)", value: "DDP" }, { key: "DELIVERED_AT_PLACE_UNLOADED_INSERT_NAMED_PLACE_OF_UNLOADING", name: "Delivered At Place Unloaded (insert named place of unloading)", value: "DPU" }, { key: "EX_WORKS_INSERT_NAMED_PLACE_OF_DELIVERY", name: "Ex Works (insert named place of delivery)", value: "EXW" }, { key: "FREE_ALONGSIDE_SHIP_INSERT_NAMED_PORT_OF_SHIPMENT", name: "Free Alongside Ship (insert named port of shipment)", value: "FAS" }, { key: "FREE_CARRIER_INSERT_NAMED_PLACE_OF_DELIVERY", name: "Free Carrier (insert named place of delivery)", value: "FCA" }, { key: "FREE_ON_BOARD_INSERT_NAMED_PORT_OF_SHIPMENT", name: "Free On Board (insert named port of shipment)", value: "FOB" } ]; var incotermsCode = INCOTERMS.map(({ value }) => value); var Incoterms = createEnum(INCOTERMS, { keyProp: "key", valueProp: "value" }); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { INCOTERMS, Incoterms, PUBLISHED, incotermsCode });