diff --git a/examples/dataloader.ts b/examples/dataloader.ts new file mode 100644 index 0000000..a6184f3 --- /dev/null +++ b/examples/dataloader.ts @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; +import { generate, PdfLoader } from "../lib"; + +(async () => { + const result = await generate("What is the secret ?", { + data: PdfLoader(readFileSync("/home/lancelot/test.pdf")), + }).infos(); + + console.log(result); +})(); diff --git a/examples/dataloader/AudioLoader.mp3 b/examples/dataloader/AudioLoader.mp3 deleted file mode 100644 index 1c317d3..0000000 Binary files a/examples/dataloader/AudioLoader.mp3 and /dev/null differ diff --git a/examples/dataloader/PdfLoader.pdf b/examples/dataloader/PdfLoader.pdf deleted file mode 100644 index d912ef7..0000000 Binary files a/examples/dataloader/PdfLoader.pdf and /dev/null differ diff --git a/examples/dataloader/StringLoader.ts b/examples/dataloader/StringLoader.ts deleted file mode 100644 index 19649c6..0000000 --- a/examples/dataloader/StringLoader.ts +++ /dev/null @@ -1,34 +0,0 @@ -export default ` -The Meaty Code of Sir Loin -In the bustling town of Byteville, there was a developer unlike any other. -Sir Loin, as he was fondly called, had a peculiar method of coding. -While others used keyboards and mice, Sir Loin used meats. Yes, you read that right. Meats! -Sir Loin believed that every piece of meat had a unique texture and essence that could be translated into code. -He had a special butcher's table instead of a regular desk. -On it, instead of the usual computer setup, there were slabs of meat of various kinds: -beef, chicken, pork, and even some exotic ones like kangaroo and ostrich. -Each meat type represented a different programming language. Beef was for Java, given its robustness. -Chicken, being versatile, was for Python. Pork, with its layers, was for HTML/CSS, and the exotic meats were for the lesser-known languages. -Sir Loin's coding process was a sight to behold. To start a new project, he'd tenderize a piece of meat, marinating it with special herbs representing libraries and frameworks. For debugging, he'd sniff the meat. Freshness indicated bug-free code, while any off-odors meant there were errors. -His IDE? A massive grill. To compile the code, he'd cook the meat. -The cooking time varied depending on the complexity of the project. -Once done, he'd feed the meat to his pet, Byte, a mini pig with a keen sense for code quality. -If Byte ate the meat without hesitation, the code was perfect. -If Byte hesitated or refused, it was back to the butcher's table for Sir Loin. -People from all over came to witness this bizarre coding method. -Many were skeptical, but when they saw the efficiency and tasted the delicious results, they were believers. -Sir Loin's applications were not only functional but also had this unique 'flavor' to them, making them popular across Byteville. -One day, a challenge arose. -The town's main server, which held crucial data, crashed. -The best developers tried to revive it but to no avail. -The mayor, in desperation, turned to Sir Loin. With a massive slab of wagyu beef (reserved for the most complex of codes), Sir Loin got to work. -He marinated, grilled, debugged, and re-grilled for hours. -Byte, after tasting the wagyu, gave a satisfied oink. -And just like that, the server whirred back to life. -Sir Loin's meaty method became legendary. -He started a school, "The Butcher's Code", teaching others the art of meat coding. -It was a rigorous program, combining culinary skills with coding, but it produced some of the finest developers Byteville had ever seen. -Years later, people would speak of the legend of Sir Loin, the meat-coding maestro. -They'd talk about how he changed the face of development in Byteville, all while serving up some of the most delicious barbecues the town had ever tasted. -And so, in the heart of Byteville, amidst all the tech and modern coding methods, there remained a place where meats and codes blended in a symphony, all thanks to the genius of Sir Loin. -`; diff --git a/examples/dataloader/TextFileLoader.csv b/examples/dataloader/TextFileLoader.csv deleted file mode 100644 index 208725f..0000000 --- a/examples/dataloader/TextFileLoader.csv +++ /dev/null @@ -1,41 +0,0 @@ -ID,Name,Email,Age,City,Product -1,John Doe,johndoe@example.com,34,New York,TV -2,Jane Smith,janesmith@example.com,28,Los Angeles,Laptop -3,Robert Brown,rbrown@example.com,45,Chicago,Refrigerator -4,Emily Davis,emilyd@example.com,22,Houston,Smartphone -5,Chris Wilson,cwilson@example.com,31,Phoenix,Tablet -6,Lucy Johnson,ljohnson@example.com,40,Philadelphia,Watch -7,Michael White,mwhite@example.com,50,San Antonio,Microwave -8,Emma Jones,ejones@example.com,29,San Diego,Camera -9,Brian Anderson,banderson@example.com,37,Dallas,Headphones -10,Sophia Martinez,smartinez@example.com,25,San Jose,Bicycle -11,James Taylor,jtaylor@example.com,32,Austin,Bookshelf -12,Nicole Lee,nlee@example.com,27,Jacksonville,Blender -13,William Harris,wharris@example.com,44,San Francisco,Oven -14,Lily Clark,lclark@example.com,24,Indianapolis,Coffee Maker -15,Kevin Lewis,klewis@example.com,42,Columbus,Vacuum Cleaner -16,Olivia Young,oyoung@example.com,35,Charlotte,Radio -17,Richard Hall,rhall@example.com,49,Seattle,Printer -18,Grace Allen,gallen@example.com,23,Denver,Washing Machine -19,Joseph Turner,jturner@example.com,52,Boston,Smartphone -20,Anna Walker,awalker@example.com,26,El Paso,Toaster -21,David King,dking@example.com,38,Nashville,Recliner -22,Mia Wright,mwright@example.com,30,Portland,Dishwasher -23,Charles Rodriguez,crodriguez@example.com,41,Memphis,Rice Cooker -24,Chloe Green,cgreen@example.com,33,Las Vegas,Gaming Console -25,Stephen Parker,sparker@example.com,47,Louisville,Fan -26,Zoe Thompson,zthompson@example.com,21,Milwaukee,Grill -27,Benjamin Adams,badams@example.com,39,Albuquerque,Air Purifier -28,Ella Nelson,enelson@example.com,36,Tucson,Router -29,Andrew Mitchell,amitchell@example.com,53,Fresno,Smart Watch -30,Madison Scott,mscott@example.com,20,Sacramento,Smartphone -31,Daniel Rivera,drivera@example.com,55,Kansas City,Smartphone -32,Isabella Morris,imorris@example.com,42,Long Beach,Juicer -33,Raymond Carter,rcarter@example.com,48,Mesa,Sunglasses -34,Abigail Price,aprice@example.com,43,Atlanta,Notebook -35,Edward Perez,eperez@example.com,46,Omaha,Kettle -36,Victoria Hughes,vhughes@example.com,29,Cleveland,DVD Player -37,Anthony Collins,acollins@example.com,40,Minneapolis,Smartphone -38,Jessica Rogers,jrogers@example.com,51,Tampa,Hat -39,Mark Flores,mflores@example.com,37,Orlando,Watch -40,Laura Torres,ltorres@example.com,45,New Orleans,Backpack \ No newline at end of file diff --git a/examples/dataloader/dataloader.ts b/examples/dataloader/dataloader.ts deleted file mode 100644 index bbd7b52..0000000 --- a/examples/dataloader/dataloader.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { generate } from "../../lib/index"; -import { AudioLoader, StringLoader, TextFileLoader } from "../../lib/dataloader"; -import { generate } from "../../lib/generate"; -import weirdStory from "./StringLoader"; -import fs from "fs"; - -const clientOptions = { - endpoint: "https://api.polyfact.com", - token: "", // You can get one at https://app.polyfact.com/ -}; -(async () => { - // Generate and ask question from an audio file - fs.readFile(`${__dirname}/AudioLoader.mp3`, async (_err, data) => { - const response = await generate( - "The man ask a question. Find and Answer at this one.", - { - data: AudioLoader(data), - model: "gpt-4", - }, - clientOptions, - ); - console.log(response); - }); - - // Generate and ask question from a text file with token usage - - fs.readFile(`${__dirname}/TextFileLoader.csv`, async (_err, data) => { - const res2 = await generate( - "Give me back the only rows for people who bought a Smartphone (Product column)\n", - { - data: TextFileLoader(data), - model: "gpt-4", - infos: true, - }, - clientOptions, - ); - - console.log(res2); - }); - - // Generate and ask question from a big string with token usage - const res3 = await generate( - "What are strange or unreal in this story ?", - { - data: StringLoader(weirdStory), - model: "gpt-4", - infos: true, - }, - clientOptions, - ); - - console.log(res3); - - // Generate a stream and ask question from an audio file - fs.readFile(`${__dirname}/AudioLoader.mp3`, async (_err, data) => { - const stream = generate( - "What does this audio talk about? ", - { - data: AudioLoader(data), - model: "gpt-3.5-turbo-16k", - stream: true, - }, - clientOptions, - ); - stream.pipe(process.stdout); - await new Promise((res) => stream.on("end", res)); - process.stdout.write("\n"); - }); -})(); diff --git a/lib/dataloader/index.ts b/lib/dataloader/index.ts index c7e728b..d04b64c 100644 --- a/lib/dataloader/index.ts +++ b/lib/dataloader/index.ts @@ -1,3 +1,4 @@ +import { getDocument, GlobalWorkerOptions, version } from "pdfjs-dist"; import { Memory } from "../memory"; import { transcribe } from "../transcribe"; import { splitString } from "../split"; @@ -20,24 +21,8 @@ async function batchify>( export type LoaderFunction = (memory: Memory, clientOptions: InputClientOptions) => Promise; -export function TextFileLoader(file: FileInput, maxTokenPerChunk = 100): LoaderFunction { - return async function loadPdfIntoMemory( - memory: Memory, - _clientOptions: InputClientOptions = {}, - ) { - const fileBuffer = await fileInputToBuffer(file); - const splittedFile = splitString(fileBuffer.toString("utf8"), maxTokenPerChunk); - - async function addBatchIntoMemory(batches: string[]) { - await Promise.all(batches.map(async (batch) => memory.add(batch))); - } - - await batchify(splittedFile, 10, addBatchIntoMemory); - }; -} - export function StringLoader(str: string, maxTokenPerChunk = 100): LoaderFunction { - return async function loadPdfIntoMemory( + return async function loadStringIntoMemory( memory: Memory, _clientOptions: InputClientOptions = {}, ) { @@ -51,6 +36,13 @@ export function StringLoader(str: string, maxTokenPerChunk = 100): LoaderFunctio }; } +export function TextFileLoader(file: FileInput, maxTokenPerChunk = 100): LoaderFunction { + return async function loadTextIntoMemory(...args) { + const fileBuffer = await fileInputToBuffer(file); + return StringLoader(fileBuffer.toString("utf8"), maxTokenPerChunk)(...args); + }; +} + export function AudioLoader(file: FileInput, maxTokenPerChunk = 100): LoaderFunction { return async function loadAudioIntoMemory( memory: Memory, @@ -58,13 +50,44 @@ export function AudioLoader(file: FileInput, maxTokenPerChunk = 100): LoaderFunc ) { const fileBuffer = await fileInputToBuffer(file); const transcription = await transcribe(fileBuffer, clientOptions); - const transcriptions = splitString(transcription, maxTokenPerChunk); + return StringLoader(transcription, maxTokenPerChunk)(memory, clientOptions); + }; +} - async function addBatchIntoMemory(batches: string[]) { - await Promise.all(batches.map(async (batch) => memory.add(batch))); - } +export async function pdfToString(pdf: Uint8Array): Promise { + if (typeof window === "undefined") { + GlobalWorkerOptions.workerSrc = `pdfjs-dist/build/pdf.worker.js`; + } else { + GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${version}/pdf.worker.js`; + } + const pdfDocument = await getDocument(pdf).promise; + const pagesPromises = []; - await batchify(transcriptions, 10, addBatchIntoMemory); + for (let i = 1; i <= pdfDocument.numPages; i++) { + pagesPromises.push(pdfDocument.getPage(i)); + } + + const pages = await Promise.all(pagesPromises); + + const textEntries = await Promise.all( + pages.map(async (page) => { + const pageObject = await page.getTextContent(); + + return pageObject.items + .map((e) => ("str" in e ? e.str : "")) + .filter((e) => e !== "") + .join("\n"); + }), + ); + + return textEntries.join("\n"); +} + +export function PdfLoader(file: FileInput, maxTokenPerChunk = 100): LoaderFunction { + return async function loadPdfIntoMemory(...args) { + const fileBuffer = await fileInputToBuffer(file); + const pdfText = await pdfToString(new Uint8Array(fileBuffer)); + return StringLoader(pdfText, maxTokenPerChunk)(...args); }; } diff --git a/lib/index.ts b/lib/index.ts index 97385cb..5c5948e 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -10,7 +10,7 @@ import { usage } from "./user"; import { get as KVGet, set as KVSet } from "./kv"; import PolyfactClientBuilder from "./client"; import { generateImage } from "./image"; -import { TextFileLoader, StringLoader, AudioLoader } from "./dataloader"; +import { TextFileLoader, StringLoader, AudioLoader, PdfLoader } from "./dataloader"; import { getAllPrompts, @@ -73,6 +73,7 @@ export { TextFileLoader, StringLoader, AudioLoader, + PdfLoader, }; export default PolyfactClientBuilder; diff --git a/lib/prompt.ts b/lib/prompt.ts index 1317445..0c8f8a9 100644 --- a/lib/prompt.ts +++ b/lib/prompt.ts @@ -34,15 +34,17 @@ export type Prompt = { like?: number; use?: number; tags?: string[]; + user_id?: string; // eslint-disable-line camelcase + public: boolean; }; -export type PromptInsert = Pick; +export type PromptInsert = Pick; export type PromptUpdate = Partial; async function axiosWrapper( method: "get" | "post" | "put" | "delete", url: string, - data?: Record | undefined, + data?: Record | undefined, clientOptions: InputClientOptions = {}, ): Promise { const { token, endpoint } = await defaultOptions(clientOptions); diff --git a/package.json b/package.json index 7f47059..2d5e1fb 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "isomorphic-ws": "^5.0.0", "js-tiktoken": "^1.0.7", "pdf-parse": "^1.1.1", + "pdfjs-dist": "^3.10.111", "polyfact-io-ts": "^2.2.20", "process": "^0.11.10", "react": "^18.2.0", @@ -67,8 +68,8 @@ "start": "ts-node cmd/index.ts", "lint": "prettier --check lib/ cmd/ ; eslint lib/ cmd/", "lint:fix": "prettier --write lib/ cmd/ ; eslint --fix lib/ cmd/", - "build:cmd": "esbuild cmd/index.ts --bundle --outfile=build/polyfact.tmp --platform=node && echo '#!/usr/bin/env node\n' | cat - build/polyfact.tmp > build/polyfact && rm build/polyfact.tmp", - "build:vanilla-js": "esbuild target/vanilla-js.ts --bundle --minify --target=chrome67,firefox68,edge79,safari15 --outfile=build/vanilla-js.js", + "build:cmd": "esbuild cmd/index.ts --bundle --external:canvas --outfile=build/polyfact.tmp --platform=node && echo '#!/usr/bin/env node\n' | cat - build/polyfact.tmp > build/polyfact && rm build/polyfact.tmp", + "build:vanilla-js": "esbuild target/vanilla-js.ts --bundle --external:canvas --minify --target=chrome67,firefox68,edge79,safari15 --outfile=build/vanilla-js.js", "build": "tsc --target es2021 --lib es2021,DOM --moduleResolution node --strict --esModuleInterop --declaration --jsx react --skipLibCheck --outDir dist --rootDir lib lib/*.ts lib/**/*.ts && npm run build:cmd && cp build/polyfact package.json README.md dist/", "npm-publish": "npm run build && cd dist && npm publish && cd .." } diff --git a/yarn.lock b/yarn.lock index 2b5be53..12d5b36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -97,6 +97,21 @@ resolved "https://registry.yarnpkg.com/@ljharb/through/-/through-2.3.9.tgz#85f221eb82f9d555e180e87d6e50fb154af85408" integrity sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ== +"@mapbox/node-pre-gyp@^1.0.0": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa" + integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ== + dependencies: + detect-libc "^2.0.0" + https-proxy-agent "^5.0.0" + make-dir "^3.1.0" + node-fetch "^2.6.7" + nopt "^5.0.0" + npmlog "^5.0.1" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.11" + "@microsoft/tsdoc-config@0.16.2": version "0.16.2" resolved "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.16.2.tgz" @@ -363,6 +378,11 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" @@ -390,6 +410,13 @@ acorn@^8.4.1: resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + ajv@^6.10.0, ajv@^6.12.4, ajv@~6.12.6: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" @@ -441,6 +468,19 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +"aproba@^1.0.3 || ^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + +are-we-there-yet@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" + integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== + dependencies: + delegates "^1.0.0" + readable-stream "^3.6.0" + arg@^4.1.0: version "4.1.3" resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" @@ -597,6 +637,15 @@ callsites@^3.0.0: resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== +canvas@^2.11.2: + version "2.11.2" + resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.11.2.tgz#553d87b1e0228c7ac0fc72887c3adbac4abbd860" + integrity sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw== + dependencies: + "@mapbox/node-pre-gyp" "^1.0.0" + nan "^2.17.0" + simple-get "^3.0.3" + chalk@^2.0.0: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" @@ -624,6 +673,11 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== + cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -677,6 +731,11 @@ color-name@~1.1.4: resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-support@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== + combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" @@ -699,6 +758,11 @@ confusing-browser-globals@^1.0.10: resolved "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz" integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== +console-control-strings@^1.0.0, console-control-strings@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== + create-require@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" @@ -733,6 +797,13 @@ d@1, d@^1.0.1: es5-ext "^0.10.50" type "^1.0.1" +debug@4, debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: + version "4.3.4" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + debug@^2.2.0: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" @@ -747,12 +818,12 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== +decompress-response@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986" + integrity sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw== dependencies: - ms "2.1.2" + mimic-response "^2.0.0" deep-is@^0.1.3: version "0.1.4" @@ -779,6 +850,16 @@ delayed-stream@~1.0.0: resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== + +detect-libc@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d" + integrity sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw== + diff@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" @@ -1369,6 +1450,13 @@ fp-ts@^2.16.0: resolved "https://registry.npmjs.org/fp-ts/-/fp-ts-2.16.0.tgz" integrity sha512-bLq+KgbiXdTEoT1zcARrWEpa5z6A/8b7PcDW7Gef3NSisQ+VS7ll2Xbf1E+xsgik0rWub/8u0qP/iTTjj+PhxQ== +fs-minipass@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== + dependencies: + minipass "^3.0.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" @@ -1399,6 +1487,21 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3: resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +gauge@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" + integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== + dependencies: + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.2" + console-control-strings "^1.0.0" + has-unicode "^2.0.1" + object-assign "^4.1.1" + signal-exit "^3.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.2" + get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: version "1.2.1" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz" @@ -1508,6 +1611,11 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" +has-unicode@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== + has@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" @@ -1515,6 +1623,14 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + husky@8.0.1: version "8.0.1" resolved "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz" @@ -1852,6 +1968,13 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +make-dir@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + make-error@^1.1.1: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" @@ -1887,6 +2010,11 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-response@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43" + integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA== + minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" @@ -1899,6 +2027,31 @@ minimist@^1.2.0, minimist@^1.2.6: resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +minipass@^3.0.0: + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== + dependencies: + yallist "^4.0.0" + +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + +minizlib@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== + dependencies: + minipass "^3.0.0" + yallist "^4.0.0" + +mkdirp@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" @@ -1914,6 +2067,11 @@ mute-stream@1.0.0: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== +nan@^2.17.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" + integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" @@ -1936,11 +2094,40 @@ node-fetch@^2.6.1, node-fetch@^2.6.12: dependencies: whatwg-url "^5.0.0" +node-fetch@^2.6.7: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + node-gyp-build@^4.3.0: version "4.6.0" resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz" integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== +nopt@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" + integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== + dependencies: + abbrev "1" + +npmlog@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" + integrity sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw== + dependencies: + are-we-there-yet "^2.0.0" + console-control-strings "^1.1.0" + gauge "^3.0.0" + set-blocking "^2.0.0" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + object-inspect@^1.12.3, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz" @@ -1979,7 +2166,7 @@ object.values@^1.1.6: define-properties "^1.1.4" es-abstract "^1.20.4" -once@^1.3.0: +once@^1.3.0, once@^1.3.1: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== @@ -2052,6 +2239,11 @@ path-type@^4.0.0: resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +path2d-polyfill@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz#24c554a738f42700d6961992bf5f1049672f2391" + integrity sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA== + pdf-parse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pdf-parse/-/pdf-parse-1.1.1.tgz#745e07408679548b3995ff896fd38e96e19d14a7" @@ -2060,6 +2252,14 @@ pdf-parse@^1.1.1: debug "^3.1.0" node-ensure "^0.0.0" +pdfjs-dist@^3.10.111: + version "3.10.111" + resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-3.10.111.tgz#abcb9725d459e121f2092580187ce01d4fcbed2c" + integrity sha512-+SXXGN/3YTNQSK5Ae7EyqQuR+4IAsNunJq/Us5ByOkRJ45qBXXOwkiWi3RIDU+CyF+ak5eSWXl2FQW2PKBrsRA== + optionalDependencies: + canvas "^2.11.2" + path2d-polyfill "^2.0.1" + picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" @@ -2107,7 +2307,7 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" -readable-stream@^3.4.0: +readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== @@ -2231,7 +2431,7 @@ safe-regex-test@^1.0.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^6.3.0: +semver@^6.0.0, semver@^6.3.0: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -2243,6 +2443,11 @@ semver@^7.2.1, semver@^7.3.5: dependencies: lru-cache "^6.0.0" +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" @@ -2264,11 +2469,25 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.2: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + +simple-get@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.1.tgz#cc7ba77cfbe761036fbfce3d021af25fc5584d55" + integrity sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA== + dependencies: + decompress-response "^4.2.0" + once "^1.3.1" + simple-concat "^1.0.0" + slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" @@ -2288,7 +2507,7 @@ sprintf-js@~1.0.2: resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -string-width@^4.1.0, string-width@^4.2.3: +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -2378,6 +2597,18 @@ table@^6.0.9: string-width "^4.2.3" strip-ansi "^6.0.1" +tar@^6.1.11: + version "6.2.0" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73" + integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^5.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + text-table@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" @@ -2612,6 +2843,13 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wide-align@^1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" + integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== + dependencies: + string-width "^1.0.2 || 2 || 3 || 4" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53"