@raytio/decrypt-helper 6.3.2 → 6.3.3
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/helpers/jsxPdf.d.ts +6 -0
- package/dist/helpers/jsxPdf.js +3 -0
- package/dist/pdf/components/FieldVerificationBadge.js +1 -1
- package/dist/pdf/components/Images.js +1 -1
- package/dist/pdf/components/InnerTableRows.js +1 -1
- package/dist/pdf/components/POVerificationBadge.js +1 -1
- package/dist/pdf/components/Report.js +1 -1
- package/dist/pdf/components/Subheader.js +1 -1
- package/dist/pdf/components/Table.js +1 -1
- package/dist/pdf/components/TableTitle.js +1 -1
- package/dist/pdf/components/ValidationDisplay.js +1 -1
- package/dist/pdf/components/VerifyBox.js +1 -1
- package/dist/public-methods/generatePDF.js +2 -1
- package/package.json +3 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const JsxPdf: {
|
|
2
|
+
createElement: <P extends Record<string, unknown>>(type: string | ((props: P) => JSX.Element), props: P | null, ...children: (string | number | boolean | JSX.Element | null | undefined)[]) => JSX.Element;
|
|
3
|
+
Fragment: JSX.Ele<Omit<import("pdfmake/interfaces").ContentStack, "stack">>;
|
|
4
|
+
renderPdf: (element: JSX.Element) => import("pdfmake/interfaces").TDocumentDefinitions;
|
|
5
|
+
default: any;
|
|
6
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import JsxPdf from "jsx-pdf";
|
|
2
1
|
import { FieldVerification } from "@raytio/types";
|
|
2
|
+
import { JsxPdf } from "../../helpers/jsxPdf.js";
|
|
3
3
|
import { loadAsset } from "../helpers/general.js";
|
|
4
4
|
export const FieldVerificationBadge = ({ status, width, }) => {
|
|
5
5
|
if (status === FieldVerification.VerifiedFalse) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import JsxPdf from "jsx-pdf";
|
|
2
1
|
import { uniq } from "ramda";
|
|
2
|
+
import { JsxPdf } from "../../helpers/jsxPdf.js";
|
|
3
3
|
import { assertSafeProperty } from "../../helpers/index.js";
|
|
4
4
|
import { IS_ARRAY_OF_OBJECTS, IS_IMAGE, transform, } from "../helpers/transform.js";
|
|
5
5
|
import { Images } from "./Images.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { POVerification } from "@raytio/types";
|
|
2
|
-
import JsxPdf from "
|
|
2
|
+
import { JsxPdf } from "../../helpers/jsxPdf.js";
|
|
3
3
|
import { $$ } from "../../locales/index.js";
|
|
4
4
|
import { loadAsset } from "../helpers/general.js";
|
|
5
5
|
import { PO_VER_TEXT_MAP } from "../../constants.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
|
-
import JsxPdf from "jsx-pdf";
|
|
3
2
|
import { isScoreResultValid } from "@raytio/core";
|
|
3
|
+
import { JsxPdf } from "../../helpers/jsxPdf.js";
|
|
4
4
|
import { $$ } from "../../locales/index.js";
|
|
5
5
|
import { classes } from "../style.js";
|
|
6
6
|
import { asset } from "../helpers/general.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldVerification } from "@raytio/types";
|
|
2
|
-
import JsxPdf from "
|
|
2
|
+
import { JsxPdf } from "../../helpers/jsxPdf.js";
|
|
3
3
|
import { $$ } from "../../locales/index.js";
|
|
4
4
|
import { FieldVerificationBadge } from "./FieldVerificationBadge.js";
|
|
5
5
|
export const Subheader = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JsxPdf from "
|
|
1
|
+
import { JsxPdf } from "../../helpers/jsxPdf.js";
|
|
2
2
|
import { verifyColour } from "../helpers/general.js";
|
|
3
3
|
import { assertSafeProperty, isFieldValueFile, isPOFile, } from "../../helpers/index.js";
|
|
4
4
|
import { FieldVerificationBadge } from "./FieldVerificationBadge.js";
|
|
@@ -10,11 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { promises as fs } from "node:fs";
|
|
11
11
|
import { join } from "node:path";
|
|
12
12
|
import PdfPrinter from "pdfmake";
|
|
13
|
-
import
|
|
13
|
+
import JsxPdfImport from "jsx-pdf";
|
|
14
14
|
import { isValidLocale } from "../locales/index.js";
|
|
15
15
|
import { Report } from "../pdf/components/Report.js";
|
|
16
16
|
import { fonts } from "../pdf/style.js";
|
|
17
17
|
import { getDirname } from "../helpers/pathUtils.js";
|
|
18
|
+
const JsxPdf = (JsxPdfImport.default || JsxPdfImport);
|
|
18
19
|
export function generatePdfJson(data, DATE_FORMAT, TIMEZONE) {
|
|
19
20
|
return JsxPdf.renderPdf(JsxPdf.createElement(Report, { data: data.json, files: data.files, aId: data.a_id, clientUrl: data.client_url, envConfig: data.envConfig, config: { DATE_FORMAT, TIMEZONE } }));
|
|
20
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raytio/decrypt-helper",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.3",
|
|
4
4
|
"author": "Raytio",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A helper to decrypt data shared by Raytio users",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"dev-pdf": "
|
|
13
|
+
"dev-pdf": "tsx src/test/pdf.tsx",
|
|
14
14
|
"build": "tsc && find dist -path \"*/__tests__*\" -delete && rm -rf dist/test && cp -r src/locales/translations dist/locales/",
|
|
15
15
|
"i18n": "react-intl-manager",
|
|
16
16
|
"lint": "eslint --ext .js,.ts,.tsx --color --ignore-path .gitignore .",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"jest-image-snapshot": "^6.3.0",
|
|
52
52
|
"pdf-to-img": "^2.1.2",
|
|
53
53
|
"ts-node": "^10.9.1",
|
|
54
|
+
"tsx": "^4.19.3",
|
|
54
55
|
"typescript": "^5.3.3",
|
|
55
56
|
"vitest": "^1.2.2"
|
|
56
57
|
},
|