@cosmicdrift/kumiko-renderer-puppeteer-client 0.365.1 → 0.366.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/feature.js +2 -2
- package/package.json +5 -5
package/dist/feature.js
CHANGED
|
@@ -19,13 +19,13 @@ import { puppeteerStatusQuery } from "./status.query.js";
|
|
|
19
19
|
export function createRendererPuppeteerClientFeature() {
|
|
20
20
|
return defineFeature("renderer-puppeteer-client", (r) => {
|
|
21
21
|
r.describe("A `renderer-foundation` plugin that prints documents to PDF through a separately deployed `puppeteer-service`. A `document-pdf` request names a stored template (`{ slug, locale, variables }`): the plugin resolves the template and its `pdf-layout` (header, signature and footer regions), embeds every image as a data URI, turns repeating table header rows into a real table head and sends the finished HTML to the service, which performs no network fetches itself. The page format, margins, file name pattern and title come from the template meta. A write handler renders with `renderPdfBeforeTransaction(ctx, { slug, locale, variables })` as its `beforeTransaction` phase, so the print service call holds no database connection, and stores the result with `storeRenderedPdf(ctx, event.prepared)` in the handler: a file plus a `rendered-pdf` record that keeps the template and layout version, so a stored document can always be traced to the text it was created from. The `puppeteer-status` query tells a TenantAdmin whether the service answers; while it does not, rendering fails with a `puppeteer_unavailable` error (HTTP 503) and no PDF is created. `image-snapshot` requests still take ready HTML in `payload.content`, which must embed all resources as data: URIs because the service fetches no http(s) resources. Configure the endpoint and token with `PUPPETEER_SERVICE_URL` and `PUPPETEER_AUTH_TOKEN`; the client retries 5xx and network errors with exponential backoff (default 3 retries), 4xx fails at once. The feature adds the `rendered_pdfs` table, so apps that mount it need a schema migration.");
|
|
22
|
-
r.requires("renderer-foundation");
|
|
22
|
+
r.requires({ features: ["renderer-foundation"] });
|
|
23
23
|
r.useExtension("renderer", "puppeteer", {
|
|
24
24
|
kinds: ["document-pdf", "image-snapshot"],
|
|
25
25
|
render: puppeteerRender,
|
|
26
26
|
previewDocument: buildDocumentPreview,
|
|
27
27
|
});
|
|
28
|
-
r.entity(RENDERED_PDF_ENTITY_NAME, renderedPdfEntity);
|
|
28
|
+
r.entity({ name: RENDERED_PDF_ENTITY_NAME, ...renderedPdfEntity });
|
|
29
29
|
r.queryHandler(puppeteerStatusQuery);
|
|
30
30
|
r.queryHandler(previewPdfQuery);
|
|
31
31
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer-puppeteer-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.366.0",
|
|
4
4
|
"description": "Renderer-Foundation plugin: HTTP client for puppeteer-service (PDF + image snapshot via remote browser).",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
23
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
24
|
-
"@cosmicdrift/kumiko-renderer-mail-html": "0.
|
|
25
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
22
|
+
"@cosmicdrift/kumiko-bundled-features": "0.366.0",
|
|
23
|
+
"@cosmicdrift/kumiko-framework": "0.366.0",
|
|
24
|
+
"@cosmicdrift/kumiko-renderer-mail-html": "0.366.0",
|
|
25
|
+
"@cosmicdrift/kumiko-types": "0.366.0"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|