@broadpaper/pdf 0.2.0 → 0.3.0

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/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createPdfServer
4
- } from "./chunk-PFCVDSUU.js";
4
+ } from "./chunk-AAE2MQRQ.js";
5
5
 
6
6
  // src/cli.ts
7
7
  var env = process.env;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Browser } from 'playwright-core';
2
2
  import { ReportTemplate, ReportData, Theme, DataSource, BlockDefinition, defineBlock, h } from '@broadpaper/core';
3
- import { LicenseStatus } from '@broadpaper/license';
3
+ import { WatermarkSpec, LicenseStatus } from '@broadpaper/license';
4
4
  export { BroadPaper, BroadPaperConfig, LicensePayload, LicenseState, LicenseStatus, LicenseType, Plan, configure, parseLicense, resolveLicenseStatus, verifyLicense } from '@broadpaper/license';
5
5
  import { Server } from 'node:http';
6
6
 
@@ -114,6 +114,16 @@ interface RenderPdfOptions {
114
114
  outline?: boolean;
115
115
  /** Attach the runtime from a custom path (testing). */
116
116
  runtimePath?: string;
117
+ /**
118
+ * An extra mark stamped on every page, on top of whatever the licence decides.
119
+ *
120
+ * Additive and never a replacement, exactly as in the browserless backend: the
121
+ * licence mark is `watermarkFor`'s to decide and a caller cannot remove it.
122
+ * Both backends take this so that switching backend cannot quietly drop a
123
+ * host's own mark — which, for a free tier that depends on it, would be the
124
+ * expensive kind of silence.
125
+ */
126
+ watermark?: WatermarkSpec | null;
117
127
  /**
118
128
  * A licence for this render only, overriding whatever `configure` was given.
119
129
  * A service rendering for one organisation should configure once at startup
@@ -154,7 +164,7 @@ declare class PdfRenderer {
154
164
  * `license` is resolved from the configured licence when it is not supplied,
155
165
  * which keeps the guarantee for a caller reaching this function directly.
156
166
  */
157
- declare function applyMetadata(pdf: Buffer, meta: PdfMetadata | undefined, now?: Date, license?: LicenseStatus): Promise<Buffer>;
167
+ declare function applyMetadata(pdf: Buffer, meta: PdfMetadata | undefined, now?: Date, license?: LicenseStatus, extraWatermark?: WatermarkSpec | null): Promise<Buffer>;
158
168
  /**
159
169
  * Convenience: renders one PDF with a temporary browser. For servers use
160
170
  * `PdfRenderer` with a long-lived browser instead.
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  renderPdf,
14
14
  resolveLicenseStatus,
15
15
  verifyLicense
16
- } from "./chunk-PFCVDSUU.js";
16
+ } from "./chunk-AAE2MQRQ.js";
17
17
  export {
18
18
  BroadPaper,
19
19
  PdfRenderError,