mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 23:45:02 +00:00
fix: use fork of joi with full features on browser
This commit is contained in:
parent
829127c3f8
commit
e7b4c93481
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ dist/
|
||||
android/
|
||||
ios/
|
||||
releases/
|
||||
.vscode/
|
||||
|
@ -17,9 +17,9 @@ function Dynamic() {
|
||||
const LoadingModule = import(`@stirling-pdf/shared-operations/src/functions/${selectedValue}`) as Promise<{ [key: string]: typeof Operator }>;
|
||||
LoadingModule.then((Module) => {
|
||||
const Operator = Module[capitalizeFirstLetter(selectedValue)];
|
||||
const description = Operator.schema.describe(); // TODO: The browser build of joi does not include describe.
|
||||
const description = Operator.schema.describe();
|
||||
|
||||
console.log(description);
|
||||
console.log("abc", description);
|
||||
// TODO: use description to generate fields
|
||||
});
|
||||
});
|
||||
|
29
package-lock.json
generated
29
package-lock.json
generated
@ -10,6 +10,9 @@
|
||||
"server-node",
|
||||
"shared-operations"
|
||||
],
|
||||
"dependencies": {
|
||||
"@stirling-tools/joi": "github:Stirling-Tools/joi"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
||||
"@typescript-eslint/parser": "^6.17.0",
|
||||
@ -1924,6 +1927,32 @@
|
||||
"resolved": "shared-operations",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@stirling-tools/joi": {
|
||||
"version": "17.12.0",
|
||||
"resolved": "git+ssh://git@github.com/Stirling-Tools/joi.git#f2994904b4716082ac74449cfa1f1574616c5883",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@hapi/address": "^5.1.1",
|
||||
"@hapi/formula": "^3.0.2",
|
||||
"@hapi/hoek": "^11.0.2",
|
||||
"@hapi/pinpoint": "^2.0.1",
|
||||
"@hapi/tlds": "^1.0.2",
|
||||
"@hapi/topo": "^6.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@stirling-tools/joi/node_modules/@hapi/hoek": {
|
||||
"version": "11.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-11.0.4.tgz",
|
||||
"integrity": "sha512-PnsP5d4q7289pS2T2EgGz147BFJ2Jpb4yrEdkpz2IhgEUzos1S7HTl7ezWh1yfYzYlj89KzLdCRkqsP6SIryeQ=="
|
||||
},
|
||||
"node_modules/@stirling-tools/joi/node_modules/@hapi/topo": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-6.0.2.tgz",
|
||||
"integrity": "sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==",
|
||||
"dependencies": {
|
||||
"@hapi/hoek": "^11.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@swc/core": {
|
||||
"version": "1.3.102",
|
||||
"resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.102.tgz",
|
||||
|
@ -21,5 +21,8 @@
|
||||
"engines": {
|
||||
"npm": ">=7.24.2"
|
||||
},
|
||||
"engineStrict": true
|
||||
"engineStrict": true,
|
||||
"dependencies": {
|
||||
"@stirling-tools/joi": "github:Stirling-Tools/joi"
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import { Operator, Progress, oneToOne } from ".";
|
||||
|
||||
import * as pdfcpuWrapper from "#pdfcpu"; // This is updated by tsconfig.json/paths for the context (browser, node, etc.) this module is used in.
|
||||
|
||||
import Joi from "joi";
|
||||
import Joi from "@stirling-tools/joi";
|
||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||
|
||||
import i18next from "i18next";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Action } from "../../declarations/Action";
|
||||
import Joi from "joi";
|
||||
import Joi from "@stirling-tools/joi";
|
||||
|
||||
export interface ValidationResult {
|
||||
valid: boolean,
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import Joi from "joi";
|
||||
import Joi from "@stirling-tools/joi";
|
||||
import { PDFPage } from "pdf-lib";
|
||||
import { PdfFile, RepresentationType, JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as PDFJS from "pdfjs-dist";
|
||||
import type { PDFDocumentProxy as PDFJSDocument } from "pdfjs-dist/types/src/display/api";
|
||||
import { PDFDocument as PDFLibDocument } from "pdf-lib";
|
||||
import Joi from "joi";
|
||||
import Joi from "@stirling-tools/joi";
|
||||
|
||||
export enum RepresentationType {
|
||||
Uint8Array,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Joi from "joi";
|
||||
import Joi from "@stirling-tools/joi";
|
||||
import { PdfFile } from "./PdfFile";
|
||||
|
||||
export const JoiPDFFileSchema = Joi.custom((value: Express.Multer.File[] /* <- also handles single files */ | PdfFile[] | PdfFile, helpers) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user