medusajs-documents-plugin 1.1.29 → 1.1.30
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/.medusa/server/src/admin/index.js +2 -2
- package/.medusa/server/src/admin/index.mjs +2 -2
- package/.medusa/server/src/api/admin/documents/[id]/document/route.js +25 -2
- package/.medusa/server/src/api/admin/documents/templates/preview/route.js +3 -1
- package/.medusa/server/src/api/api/admin/documents/[id]/document/route.js +3 -1
- package/.medusa/server/src/api/documents/[id]/document/route.js +3 -1
- package/.medusa/server/src/api/documents/templates/preview/route.js +99 -46
- package/.medusa/server/src/api/middlewares.js +35 -0
- package/.medusa/server/src/modules/documents/service.js +45 -20
- package/.medusa/server/src/services/pdfkit-generator.js +176 -111
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [1.1.30] - 2026-11-01
|
|
11
|
+
|
|
12
|
+
### Unauthenticated PDF Document Streaming & Robust Fallback Handling
|
|
13
|
+
- **Unauthenticated PDF Streaming**: Added `export const AUTHENTICATE = false;` to `/admin/documents/:id/document` and template preview routes, and registered matching allowlist middlewares in `src/api/middlewares.ts`. This prevents 401 Unauthorized errors when viewing documents via `window.open` or direct browser links without Bearer authorization headers.
|
|
14
|
+
- **Admin UI Streaming URLs**: Updated `src/admin/routes/documents/page.tsx` to point `window.open` targets to the dedicated public document streaming route `/documents/:id/document` and `/documents/templates/preview`.
|
|
15
|
+
- **Defensive PDFKit Fallback**: Hardened `PDFKitGenerator.generate` and all underlying template renderers (`zoho_exact`, `modern`, `classic`, `minimal`, `job_card`, `service_report`) to gracefully handle zero items (`[]`), missing items (`undefined`), and incomplete item properties (missing title, unit_price, quantity) without throwing unhandled exceptions.
|
|
16
|
+
- **Resilient Currency Formatting**: Enhanced `PDFKitGenerator.formatCurrency` to safely guard against `undefined`, `null`, and `NaN` values, preventing formatting runtime errors.
|
|
17
|
+
- **Service Document Retrieval & Knex String Parsing**: Made `DocumentModuleService.getPdfForRecord` resilient to stringified JSON metadata and template failures with automatic fallback to the modern template.
|
|
18
|
+
- **Repair Module Lookup Fallback**: Extended `/admin/documents/:id/document` to resolve document records via repair ticket tokens or ticket IDs if the primary ID lookup does not immediately match.
|
|
19
|
+
|
|
10
20
|
## [1.1.27] - 2026-11-01
|
|
11
21
|
|
|
12
22
|
### Repair Sync, 3-Column Template Gallery & Preset Previews
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "medusajs-documents-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.30",
|
|
4
4
|
"description": "Comprehensive document generation and management module for Medusa v2 with Zoho Books integration, PDFKit fallback, QR codes, shortlinks, multi-channel notifications and unified admin hub.",
|
|
5
5
|
"author": "Urban Device Care <info@urbandevicecare.co.uk>",
|
|
6
6
|
"license": "MIT",
|