@formfeed/sdk 0.3.10 → 0.3.12

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.
@@ -151,6 +151,54 @@ export interface PostProcessing {
151
151
  owner?: string;
152
152
  permissions?: PdfPermission[];
153
153
  };
154
+ /**
155
+ * Makes the PDF a ZUGFeRD / Factur-X e-invoice, built from the `_invoice` block of `data`. `{}`
156
+ * takes the defaults; `false` switches off what the template's settings declare. Not together
157
+ * with `password`. Starter plan and above; one unit on top of the render.
158
+ */
159
+ einvoice?: EinvoiceOptions | false;
160
+ }
161
+ /** What kind of e-invoice a render makes; every field has a default. */
162
+ export interface EinvoiceOptions {
163
+ /** `en16931` (default) carries the whole European standard, `basic` the smallest full invoice. */
164
+ profile?: 'basic' | 'en16931';
165
+ /** One specification under two names; decides the name and release the render reports. */
166
+ flavour?: 'factur-x' | 'zugferd';
167
+ /** `both` stores the XML as a file of its own beside the PDF (`einvoice.xml_url`). */
168
+ xml?: 'embedded' | 'both';
169
+ /** What a value of the XML that the PDF does not show does: a warning, or a failed render. */
170
+ display_check?: 'warn' | 'strict';
171
+ }
172
+ /** One finding of the validator: a rule of the XML, or a clause of PDF/A. */
173
+ export interface EinvoiceMessage {
174
+ part: 'xml' | 'pdf';
175
+ severity: 'error' | 'warning';
176
+ rule: string | null;
177
+ message: string;
178
+ /** An XPath into the XML, or the object of the PDF. */
179
+ location: string | null;
180
+ }
181
+ /** The e-invoice of a render: what was made, what the validator said, what the PDF shows. */
182
+ export interface Einvoice {
183
+ profile: 'basic' | 'en16931';
184
+ flavour: 'factur-x' | 'zugferd';
185
+ /** The release under the flavour's name: Factur-X `1.09` is ZUGFeRD `2.5`. */
186
+ spec_version: string;
187
+ /** A signed link to the XML when the render asked for `xml: "both"`; null otherwise. */
188
+ xml_url: string | null;
189
+ validation: {
190
+ valid: boolean;
191
+ schematron: string;
192
+ pdfa: string | null;
193
+ /** At most 50, errors first. */
194
+ messages: EinvoiceMessage[];
195
+ truncated?: boolean;
196
+ } | null;
197
+ /** The business terms of the XML looked for in the PDF's text, and those it does not show. */
198
+ display: {
199
+ checked: string[];
200
+ missing: string[];
201
+ } | null;
154
202
  }
155
203
  /** Where the result of a PDF tool is stored, as for a render. */
156
204
  export interface PdfOutputOptions {
@@ -206,6 +254,11 @@ export interface Render {
206
254
  deduplicated: boolean;
207
255
  /** The copy in the workspace's own bucket; null when none applies. */
208
256
  storage: StorageDelivery | null;
257
+ /**
258
+ * The e-invoice the render made, with the validator's report; null when it made none. A failed
259
+ * render keeps it too, which is where it says why. Absent from renders made before the feature.
260
+ */
261
+ einvoice?: Einvoice | null;
209
262
  timings: Record<string, number> | null;
210
263
  error: {
211
264
  code?: string;
@@ -151,6 +151,54 @@ export interface PostProcessing {
151
151
  owner?: string;
152
152
  permissions?: PdfPermission[];
153
153
  };
154
+ /**
155
+ * Makes the PDF a ZUGFeRD / Factur-X e-invoice, built from the `_invoice` block of `data`. `{}`
156
+ * takes the defaults; `false` switches off what the template's settings declare. Not together
157
+ * with `password`. Starter plan and above; one unit on top of the render.
158
+ */
159
+ einvoice?: EinvoiceOptions | false;
160
+ }
161
+ /** What kind of e-invoice a render makes; every field has a default. */
162
+ export interface EinvoiceOptions {
163
+ /** `en16931` (default) carries the whole European standard, `basic` the smallest full invoice. */
164
+ profile?: 'basic' | 'en16931';
165
+ /** One specification under two names; decides the name and release the render reports. */
166
+ flavour?: 'factur-x' | 'zugferd';
167
+ /** `both` stores the XML as a file of its own beside the PDF (`einvoice.xml_url`). */
168
+ xml?: 'embedded' | 'both';
169
+ /** What a value of the XML that the PDF does not show does: a warning, or a failed render. */
170
+ display_check?: 'warn' | 'strict';
171
+ }
172
+ /** One finding of the validator: a rule of the XML, or a clause of PDF/A. */
173
+ export interface EinvoiceMessage {
174
+ part: 'xml' | 'pdf';
175
+ severity: 'error' | 'warning';
176
+ rule: string | null;
177
+ message: string;
178
+ /** An XPath into the XML, or the object of the PDF. */
179
+ location: string | null;
180
+ }
181
+ /** The e-invoice of a render: what was made, what the validator said, what the PDF shows. */
182
+ export interface Einvoice {
183
+ profile: 'basic' | 'en16931';
184
+ flavour: 'factur-x' | 'zugferd';
185
+ /** The release under the flavour's name: Factur-X `1.09` is ZUGFeRD `2.5`. */
186
+ spec_version: string;
187
+ /** A signed link to the XML when the render asked for `xml: "both"`; null otherwise. */
188
+ xml_url: string | null;
189
+ validation: {
190
+ valid: boolean;
191
+ schematron: string;
192
+ pdfa: string | null;
193
+ /** At most 50, errors first. */
194
+ messages: EinvoiceMessage[];
195
+ truncated?: boolean;
196
+ } | null;
197
+ /** The business terms of the XML looked for in the PDF's text, and those it does not show. */
198
+ display: {
199
+ checked: string[];
200
+ missing: string[];
201
+ } | null;
154
202
  }
155
203
  /** Where the result of a PDF tool is stored, as for a render. */
156
204
  export interface PdfOutputOptions {
@@ -206,6 +254,11 @@ export interface Render {
206
254
  deduplicated: boolean;
207
255
  /** The copy in the workspace's own bucket; null when none applies. */
208
256
  storage: StorageDelivery | null;
257
+ /**
258
+ * The e-invoice the render made, with the validator's report; null when it made none. A failed
259
+ * render keeps it too, which is where it says why. Absent from renders made before the feature.
260
+ */
261
+ einvoice?: Einvoice | null;
209
262
  timings: Record<string, number> | null;
210
263
  error: {
211
264
  code?: string;