@formfeed/sdk 0.3.20 → 0.3.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formfeed/sdk",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "description": "Formfeed API client: renders, templates, webhooks. No dependencies, Web APIs only.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/types/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Formfeed, FormfeedError } from './lib/client.cjs';
2
- export type { Template, TemplateCreate, TemplateFiles, TemplateKind, TemplateListOptions, TemplateValidation, VersionRef, TemplateVersion, TemplateVersionCreate, TemplateFile, OfficeTemplateKind, OfficeTemplateCreate, OfficeVersionCreate, OfficeFileUpload, ConvertOptions, VersionStatus, BatchRequest, Channel, ChannelList, ChannelMove, Brand, SharedPartial, SharedPartialPut, SharedPartialPutResult, Diagnostic, Engine, FileListOptions, FileUpload, FormfeedOptions, FormfeedTemplates, Job, LibraryFile, OutputFormat, PdfInfo, PdfOutputOptions, PdfPermission, PostProcessing, Einvoice, EinvoiceMessage, EinvoiceOptions, Accessibility, AccessibilityFailure, AccessibilityWarning, PdfUaOptions, Problem, StorageDelivery, StorageDeliveryEvent, StorageError, StorageOption, WebhookEventType, ProtectOptions, Region, Render, RenderListOptions, RenderRequest, RenderStatus, TemplateData, TypedRenderRequest, RequestOptions, SchemaChange, SchemaCheck, SchemaGuardOptions, Usage, WaitOptions, WatermarkOptions, WebhookEndpoint, WebhookEndpointCreate, WebhookEndpointUpdate, WebhookEnvironment, WebhookResend, ListenSession, ListenSessionOptions, RenderInput, } from './lib/client.cjs';
2
+ export type { Template, TemplateCreate, TemplateFiles, TemplateKind, TemplateListOptions, TemplateValidation, VersionRef, TemplateVersion, TemplateVersionCreate, TemplateFile, OfficeTemplateKind, OfficeTemplateCreate, OfficeVersionCreate, OfficeFileUpload, ConvertOptions, VersionStatus, BatchRequest, Channel, ChannelList, ChannelMove, Brand, SharedPartial, SharedPartialPut, SharedPartialPutResult, Diagnostic, Engine, FileListOptions, FileUpload, FormfeedOptions, FormfeedTemplates, Job, LibraryFile, OutputFormat, PdfInfo, PdfOutputOptions, PdfPermission, PostProcessing, Einvoice, EinvoiceMessage, EinvoiceOptions, Accessibility, AccessibilityFailure, AccessibilityWarning, Pdfa, PdfaLevel, PdfaMessage, PdfUaOptions, Problem, StorageDelivery, StorageDeliveryEvent, StorageError, StorageOption, WebhookEventType, ProtectOptions, Region, Render, RenderListOptions, RenderRequest, RenderStatus, TemplateData, TypedRenderRequest, RequestOptions, SchemaChange, SchemaCheck, SchemaGuardOptions, Usage, WaitOptions, WatermarkOptions, WebhookEndpoint, WebhookEndpointCreate, WebhookEndpointUpdate, WebhookEnvironment, WebhookResend, ListenSession, ListenSessionOptions, RenderInput, } from './lib/client.cjs';
3
3
  export { parseWebhookEvent, verifyWebhookSignature } from './lib/webhooks.cjs';
4
4
  export type { VerifyOptions } from './lib/webhooks.cjs';
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Formfeed, FormfeedError } from './lib/client.js';
2
- export type { Template, TemplateCreate, TemplateFiles, TemplateKind, TemplateListOptions, TemplateValidation, VersionRef, TemplateVersion, TemplateVersionCreate, TemplateFile, OfficeTemplateKind, OfficeTemplateCreate, OfficeVersionCreate, OfficeFileUpload, ConvertOptions, VersionStatus, BatchRequest, Channel, ChannelList, ChannelMove, Brand, SharedPartial, SharedPartialPut, SharedPartialPutResult, Diagnostic, Engine, FileListOptions, FileUpload, FormfeedOptions, FormfeedTemplates, Job, LibraryFile, OutputFormat, PdfInfo, PdfOutputOptions, PdfPermission, PostProcessing, Einvoice, EinvoiceMessage, EinvoiceOptions, Accessibility, AccessibilityFailure, AccessibilityWarning, PdfUaOptions, Problem, StorageDelivery, StorageDeliveryEvent, StorageError, StorageOption, WebhookEventType, ProtectOptions, Region, Render, RenderListOptions, RenderRequest, RenderStatus, TemplateData, TypedRenderRequest, RequestOptions, SchemaChange, SchemaCheck, SchemaGuardOptions, Usage, WaitOptions, WatermarkOptions, WebhookEndpoint, WebhookEndpointCreate, WebhookEndpointUpdate, WebhookEnvironment, WebhookResend, ListenSession, ListenSessionOptions, RenderInput, } from './lib/client.js';
2
+ export type { Template, TemplateCreate, TemplateFiles, TemplateKind, TemplateListOptions, TemplateValidation, VersionRef, TemplateVersion, TemplateVersionCreate, TemplateFile, OfficeTemplateKind, OfficeTemplateCreate, OfficeVersionCreate, OfficeFileUpload, ConvertOptions, VersionStatus, BatchRequest, Channel, ChannelList, ChannelMove, Brand, SharedPartial, SharedPartialPut, SharedPartialPutResult, Diagnostic, Engine, FileListOptions, FileUpload, FormfeedOptions, FormfeedTemplates, Job, LibraryFile, OutputFormat, PdfInfo, PdfOutputOptions, PdfPermission, PostProcessing, Einvoice, EinvoiceMessage, EinvoiceOptions, Accessibility, AccessibilityFailure, AccessibilityWarning, Pdfa, PdfaLevel, PdfaMessage, PdfUaOptions, Problem, StorageDelivery, StorageDeliveryEvent, StorageError, StorageOption, WebhookEventType, ProtectOptions, Region, Render, RenderListOptions, RenderRequest, RenderStatus, TemplateData, TypedRenderRequest, RequestOptions, SchemaChange, SchemaCheck, SchemaGuardOptions, Usage, WaitOptions, WatermarkOptions, WebhookEndpoint, WebhookEndpointCreate, WebhookEndpointUpdate, WebhookEnvironment, WebhookResend, ListenSession, ListenSessionOptions, RenderInput, } from './lib/client.js';
3
3
  export { parseWebhookEvent, verifyWebhookSignature } from './lib/webhooks.js';
4
4
  export type { VerifyOptions } from './lib/webhooks.js';
@@ -41,6 +41,8 @@ export interface RenderRequest {
41
41
  /**
42
42
  * Merged over the template's settings. `{ pdf: { ua: true } }` makes the file a PDF/UA-1 document
43
43
  * and the render carry the validator's verdict as `accessibility`; see `PdfUaOptions`.
44
+ * `{ pdf: { pdfa: '2b' } }` (or `'3b'`, or `true` for `'3b'`) makes it a PDF/A file for
45
+ * archiving, checked before it is delivered; the render carries the verdict as `pdfa`.
44
46
  */
45
47
  settings?: Record<string, unknown>;
46
48
  filename?: string;
@@ -173,19 +175,25 @@ export interface EinvoiceOptions {
173
175
  /** What a value of the XML that the PDF does not show does: a warning, or a failed render. */
174
176
  display_check?: 'warn' | 'strict';
175
177
  }
176
- /** One finding of the validator: a rule of the XML, or a clause of PDF/A. */
178
+ /**
179
+ * One finding of the validator: a rule of the XML, or a clause of PDF/A. `part` and `severity` name
180
+ * today's values and take any other text, which a later release of the API may send.
181
+ */
177
182
  export interface EinvoiceMessage {
178
- part: 'xml' | 'pdf';
179
- severity: 'error' | 'warning';
183
+ part: 'xml' | 'pdf' | (string & {});
184
+ severity: 'error' | 'warning' | (string & {});
180
185
  rule: string | null;
181
186
  message: string;
182
187
  /** An XPath into the XML, or the object of the PDF. */
183
188
  location: string | null;
184
189
  }
185
- /** The e-invoice of a render: what was made, what the validator said, what the PDF shows. */
190
+ /**
191
+ * The e-invoice of a render: what was made, what the validator said, what the PDF shows. `profile`
192
+ * and `flavour` name today's values and take any other text, which a later release may send.
193
+ */
186
194
  export interface Einvoice {
187
- profile: 'basic' | 'en16931';
188
- flavour: 'factur-x' | 'zugferd';
195
+ profile: 'basic' | 'en16931' | (string & {});
196
+ flavour: 'factur-x' | 'zugferd' | (string & {});
189
197
  /** The release under the flavour's name: Factur-X `1.09` is ZUGFeRD `2.5`. */
190
198
  spec_version: string;
191
199
  /** A signed link to the XML when the render asked for `xml: "both"`; null otherwise. */
@@ -260,6 +268,35 @@ export interface Accessibility {
260
268
  warnings: AccessibilityWarning[];
261
269
  truncated?: boolean;
262
270
  }
271
+ /** A level of PDF/A a render can ask for in `settings.pdf.pdfa`; `true` stands for `'3b'`. */
272
+ export type PdfaLevel = '2b' | '3b';
273
+ /** One rule of the PDF/A level a file failed. */
274
+ export interface PdfaMessage {
275
+ severity: 'error' | 'warning' | (string & {});
276
+ /** The clause of ISO 19005 and veraPDF's test number, `6.2.11.4.1-1`. */
277
+ rule: string | null;
278
+ message: string;
279
+ /** veraPDF's path to the object of the PDF. */
280
+ location: string | null;
281
+ }
282
+ /**
283
+ * What the validator said about a file as PDF/A: which rules of the format it passed, by which
284
+ * validator. A render delivers a file only when it passed; a failed render keeps the report.
285
+ */
286
+ export interface Pdfa {
287
+ standard: 'PDF/A-2b' | 'PDF/A-3b' | (string & {});
288
+ conformant: boolean;
289
+ /** The validator and its version, `veraPDF 1.30.2`. */
290
+ validator: string;
291
+ /** The validator's own id for this report. */
292
+ id: string;
293
+ versions: Record<string, string>;
294
+ /** SHA-256 of the file that was judged: the delivered file of a render that succeeded. */
295
+ pdf_sha256: string | null;
296
+ /** At most 50; empty for a file that passed. */
297
+ messages: PdfaMessage[];
298
+ truncated?: boolean;
299
+ }
263
300
  /** Where the result of a PDF tool is stored, as for a render. */
264
301
  export interface PdfOutputOptions {
265
302
  filename?: string;
@@ -325,6 +362,12 @@ export interface Render {
325
362
  * renders made before the feature.
326
363
  */
327
364
  accessibility?: Accessibility | null;
365
+ /**
366
+ * The validator's verdict on the file as PDF/A; null unless the render set `settings.pdf.pdfa`.
367
+ * A render whose file failed keeps it too, which is where it names the rules. Absent from renders
368
+ * made before the feature.
369
+ */
370
+ pdfa?: Pdfa | null;
328
371
  timings: Record<string, number> | null;
329
372
  error: {
330
373
  code?: string;
@@ -540,7 +583,8 @@ export interface RenderInput {
540
583
  url?: string;
541
584
  data?: Record<string, unknown>;
542
585
  locale?: string | null;
543
- output?: OutputFormat;
586
+ /** One of today's output formats, or one a later release of the API adds. */
587
+ output?: OutputFormat | (string & {});
544
588
  settings?: Record<string, unknown>;
545
589
  filename?: string;
546
590
  post?: Record<string, unknown>;
@@ -692,6 +736,8 @@ export interface TemplateCreate extends TemplateFiles {
692
736
  kind: TemplateKind;
693
737
  engine: Engine;
694
738
  tags?: string[];
739
+ /** What version 1 is; shown in the version history. */
740
+ change_note?: string;
695
741
  publish?: boolean;
696
742
  }
697
743
  export interface TemplateVersionCreate extends TemplateFiles {
@@ -41,6 +41,8 @@ export interface RenderRequest {
41
41
  /**
42
42
  * Merged over the template's settings. `{ pdf: { ua: true } }` makes the file a PDF/UA-1 document
43
43
  * and the render carry the validator's verdict as `accessibility`; see `PdfUaOptions`.
44
+ * `{ pdf: { pdfa: '2b' } }` (or `'3b'`, or `true` for `'3b'`) makes it a PDF/A file for
45
+ * archiving, checked before it is delivered; the render carries the verdict as `pdfa`.
44
46
  */
45
47
  settings?: Record<string, unknown>;
46
48
  filename?: string;
@@ -173,19 +175,25 @@ export interface EinvoiceOptions {
173
175
  /** What a value of the XML that the PDF does not show does: a warning, or a failed render. */
174
176
  display_check?: 'warn' | 'strict';
175
177
  }
176
- /** One finding of the validator: a rule of the XML, or a clause of PDF/A. */
178
+ /**
179
+ * One finding of the validator: a rule of the XML, or a clause of PDF/A. `part` and `severity` name
180
+ * today's values and take any other text, which a later release of the API may send.
181
+ */
177
182
  export interface EinvoiceMessage {
178
- part: 'xml' | 'pdf';
179
- severity: 'error' | 'warning';
183
+ part: 'xml' | 'pdf' | (string & {});
184
+ severity: 'error' | 'warning' | (string & {});
180
185
  rule: string | null;
181
186
  message: string;
182
187
  /** An XPath into the XML, or the object of the PDF. */
183
188
  location: string | null;
184
189
  }
185
- /** The e-invoice of a render: what was made, what the validator said, what the PDF shows. */
190
+ /**
191
+ * The e-invoice of a render: what was made, what the validator said, what the PDF shows. `profile`
192
+ * and `flavour` name today's values and take any other text, which a later release may send.
193
+ */
186
194
  export interface Einvoice {
187
- profile: 'basic' | 'en16931';
188
- flavour: 'factur-x' | 'zugferd';
195
+ profile: 'basic' | 'en16931' | (string & {});
196
+ flavour: 'factur-x' | 'zugferd' | (string & {});
189
197
  /** The release under the flavour's name: Factur-X `1.09` is ZUGFeRD `2.5`. */
190
198
  spec_version: string;
191
199
  /** A signed link to the XML when the render asked for `xml: "both"`; null otherwise. */
@@ -260,6 +268,35 @@ export interface Accessibility {
260
268
  warnings: AccessibilityWarning[];
261
269
  truncated?: boolean;
262
270
  }
271
+ /** A level of PDF/A a render can ask for in `settings.pdf.pdfa`; `true` stands for `'3b'`. */
272
+ export type PdfaLevel = '2b' | '3b';
273
+ /** One rule of the PDF/A level a file failed. */
274
+ export interface PdfaMessage {
275
+ severity: 'error' | 'warning' | (string & {});
276
+ /** The clause of ISO 19005 and veraPDF's test number, `6.2.11.4.1-1`. */
277
+ rule: string | null;
278
+ message: string;
279
+ /** veraPDF's path to the object of the PDF. */
280
+ location: string | null;
281
+ }
282
+ /**
283
+ * What the validator said about a file as PDF/A: which rules of the format it passed, by which
284
+ * validator. A render delivers a file only when it passed; a failed render keeps the report.
285
+ */
286
+ export interface Pdfa {
287
+ standard: 'PDF/A-2b' | 'PDF/A-3b' | (string & {});
288
+ conformant: boolean;
289
+ /** The validator and its version, `veraPDF 1.30.2`. */
290
+ validator: string;
291
+ /** The validator's own id for this report. */
292
+ id: string;
293
+ versions: Record<string, string>;
294
+ /** SHA-256 of the file that was judged: the delivered file of a render that succeeded. */
295
+ pdf_sha256: string | null;
296
+ /** At most 50; empty for a file that passed. */
297
+ messages: PdfaMessage[];
298
+ truncated?: boolean;
299
+ }
263
300
  /** Where the result of a PDF tool is stored, as for a render. */
264
301
  export interface PdfOutputOptions {
265
302
  filename?: string;
@@ -325,6 +362,12 @@ export interface Render {
325
362
  * renders made before the feature.
326
363
  */
327
364
  accessibility?: Accessibility | null;
365
+ /**
366
+ * The validator's verdict on the file as PDF/A; null unless the render set `settings.pdf.pdfa`.
367
+ * A render whose file failed keeps it too, which is where it names the rules. Absent from renders
368
+ * made before the feature.
369
+ */
370
+ pdfa?: Pdfa | null;
328
371
  timings: Record<string, number> | null;
329
372
  error: {
330
373
  code?: string;
@@ -540,7 +583,8 @@ export interface RenderInput {
540
583
  url?: string;
541
584
  data?: Record<string, unknown>;
542
585
  locale?: string | null;
543
- output?: OutputFormat;
586
+ /** One of today's output formats, or one a later release of the API adds. */
587
+ output?: OutputFormat | (string & {});
544
588
  settings?: Record<string, unknown>;
545
589
  filename?: string;
546
590
  post?: Record<string, unknown>;
@@ -692,6 +736,8 @@ export interface TemplateCreate extends TemplateFiles {
692
736
  kind: TemplateKind;
693
737
  engine: Engine;
694
738
  tags?: string[];
739
+ /** What version 1 is; shown in the version history. */
740
+ change_note?: string;
695
741
  publish?: boolean;
696
742
  }
697
743
  export interface TemplateVersionCreate extends TemplateFiles {