@formfeed/sdk 0.3.21 → 0.3.23

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.21",
3
+ "version": "0.3.23",
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;
@@ -266,6 +268,36 @@ export interface Accessibility {
266
268
  warnings: AccessibilityWarning[];
267
269
  truncated?: boolean;
268
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, and its
285
+ * problem (422 `pdfa_validation_failed`) carries it.
286
+ */
287
+ export interface Pdfa {
288
+ standard: 'PDF/A-2b' | 'PDF/A-3b' | (string & {});
289
+ conformant: boolean;
290
+ /** The validator and its version, `veraPDF 1.30.2`. */
291
+ validator: string;
292
+ /** The validator's own id for this report. */
293
+ id: string;
294
+ versions: Record<string, string>;
295
+ /** SHA-256 of the file that was judged: the delivered file of a render that succeeded. */
296
+ pdf_sha256: string | null;
297
+ /** At most 50; empty for a file that passed. */
298
+ messages: PdfaMessage[];
299
+ truncated?: boolean;
300
+ }
269
301
  /** Where the result of a PDF tool is stored, as for a render. */
270
302
  export interface PdfOutputOptions {
271
303
  filename?: string;
@@ -331,6 +363,12 @@ export interface Render {
331
363
  * renders made before the feature.
332
364
  */
333
365
  accessibility?: Accessibility | null;
366
+ /**
367
+ * The validator's verdict on the file as PDF/A; null unless the render set `settings.pdf.pdfa`.
368
+ * A render whose file failed keeps it too, which is where it names the rules. Absent from renders
369
+ * made before the feature.
370
+ */
371
+ pdfa?: Pdfa | null;
334
372
  timings: Record<string, number> | null;
335
373
  error: {
336
374
  code?: string;
@@ -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;
@@ -266,6 +268,36 @@ export interface Accessibility {
266
268
  warnings: AccessibilityWarning[];
267
269
  truncated?: boolean;
268
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, and its
285
+ * problem (422 `pdfa_validation_failed`) carries it.
286
+ */
287
+ export interface Pdfa {
288
+ standard: 'PDF/A-2b' | 'PDF/A-3b' | (string & {});
289
+ conformant: boolean;
290
+ /** The validator and its version, `veraPDF 1.30.2`. */
291
+ validator: string;
292
+ /** The validator's own id for this report. */
293
+ id: string;
294
+ versions: Record<string, string>;
295
+ /** SHA-256 of the file that was judged: the delivered file of a render that succeeded. */
296
+ pdf_sha256: string | null;
297
+ /** At most 50; empty for a file that passed. */
298
+ messages: PdfaMessage[];
299
+ truncated?: boolean;
300
+ }
269
301
  /** Where the result of a PDF tool is stored, as for a render. */
270
302
  export interface PdfOutputOptions {
271
303
  filename?: string;
@@ -331,6 +363,12 @@ export interface Render {
331
363
  * renders made before the feature.
332
364
  */
333
365
  accessibility?: Accessibility | null;
366
+ /**
367
+ * The validator's verdict on the file as PDF/A; null unless the render set `settings.pdf.pdfa`.
368
+ * A render whose file failed keeps it too, which is where it names the rules. Absent from renders
369
+ * made before the feature.
370
+ */
371
+ pdfa?: Pdfa | null;
334
372
  timings: Record<string, number> | null;
335
373
  error: {
336
374
  code?: string;