@uploadista/flow-documents-plugin 0.0.16-beta.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.
@@ -0,0 +1,15 @@
1
+
2
+ 
3
+ > @uploadista/flow-documents-plugin@0.0.16-beta.2 build /Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/documents/plugin
4
+ > tsdown
5
+
6
+ ℹ tsdown v0.16.5 powered by rolldown v1.0.0-beta.50
7
+ ℹ entry: src/index.ts
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/index.mjs 1.05 kB │ gzip: 0.45 kB
11
+ ℹ dist/index.mjs.map 1.79 kB │ gzip: 0.71 kB
12
+ ℹ dist/index.d.mts.map 0.19 kB │ gzip: 0.16 kB
13
+ ℹ dist/index.d.mts 0.56 kB │ gzip: 0.31 kB
14
+ ℹ 4 files, total: 3.60 kB
15
+ ✔ Build complete in 905ms
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 uploadista
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @uploadista/flow-documents-combined
2
+
3
+ Combined DocumentPlugin implementation using both pdf-lib and unpdf.
4
+
5
+ ## Features
6
+
7
+ - **Text Extraction**: Uses unpdf for fast, accurate text extraction from searchable PDFs
8
+ - **PDF Manipulation**: Uses pdf-lib for splitting, merging, and metadata extraction
9
+ - **Complete Solution**: Single plugin that handles all document operations
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pnpm add @uploadista/flow-documents-combined
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```typescript
20
+ import { CombinedDocumentPluginLive } from "@uploadista/flow-documents-combined";
21
+ import { Effect } from "effect";
22
+
23
+ // Provide the combined plugin to your flow execution
24
+ const program = Effect.gen(function* () {
25
+ // Your flow logic here - all DocumentPlugin operations work
26
+ }).pipe(Effect.provide(CombinedDocumentPluginLive));
27
+ ```
28
+
29
+ ## Why Use This?
30
+
31
+ Instead of managing separate plugins for different operations, this combined plugin gives you:
32
+
33
+ - One plugin to provide instead of two
34
+ - Automatic routing to the right implementation
35
+ - Simplified dependency management
36
+
37
+ ## Under the Hood
38
+
39
+ - `extractText()` → unpdf (fast, accurate text extraction)
40
+ - `getMetadata()` → pdf-lib (comprehensive metadata)
41
+ - `splitPdf()` → pdf-lib (page manipulation)
42
+ - `mergePdfs()` → pdf-lib (document merging)
43
+
44
+ ## License
45
+
46
+ MIT
@@ -0,0 +1,17 @@
1
+ import { DocumentPlugin } from "@uploadista/core/flow";
2
+ import { Layer } from "effect";
3
+
4
+ //#region src/document-plugin.d.ts
5
+
6
+ /**
7
+ * Combined DocumentPlugin that uses:
8
+ * - unpdf for text extraction
9
+ * - pdf-lib for metadata, splitting, and merging
10
+ *
11
+ * This provides a complete DocumentPlugin implementation.
12
+ */
13
+ declare const documentPlugin: Layer.Layer<DocumentPlugin, never, never>;
14
+ declare const DocumentPluginLive: Layer.Layer<DocumentPlugin, never, never>;
15
+ //#endregion
16
+ export { DocumentPluginLive, documentPlugin };
17
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/document-plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;AAYA;AA+BA;;;;cA/Ba,gBAAc,KAAA,CAAA,MAAA;cA+Bd,oBAAkB,KAAA,CAAA,MAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,28 @@
1
+ import { DocumentPlugin } from "@uploadista/core/flow";
2
+ import { pdfLibDocumentPlugin } from "@uploadista/flow-documents-pdflib";
3
+ import { unpdfDocumentPlugin } from "@uploadista/flow-documents-unpdf";
4
+ import { Effect, Layer } from "effect";
5
+
6
+ //#region src/document-plugin.ts
7
+ /**
8
+ * Combined DocumentPlugin that uses:
9
+ * - unpdf for text extraction
10
+ * - pdf-lib for metadata, splitting, and merging
11
+ *
12
+ * This provides a complete DocumentPlugin implementation.
13
+ */
14
+ const documentPlugin = Layer.unwrapEffect(Effect.gen(function* () {
15
+ const pdfLibPlugin = yield* Effect.provide(DocumentPlugin, pdfLibDocumentPlugin);
16
+ const unpdfPlugin = yield* Effect.provide(DocumentPlugin, unpdfDocumentPlugin);
17
+ return Layer.succeed(DocumentPlugin, DocumentPlugin.of({
18
+ extractText: unpdfPlugin.extractText,
19
+ getMetadata: pdfLibPlugin.getMetadata,
20
+ splitPdf: pdfLibPlugin.splitPdf,
21
+ mergePdfs: pdfLibPlugin.mergePdfs
22
+ }));
23
+ }));
24
+ const DocumentPluginLive = documentPlugin;
25
+
26
+ //#endregion
27
+ export { DocumentPluginLive, documentPlugin };
28
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/document-plugin.ts"],"sourcesContent":["import { DocumentPlugin } from \"@uploadista/core/flow\";\nimport { pdfLibDocumentPlugin } from \"@uploadista/flow-documents-pdflib\";\nimport { unpdfDocumentPlugin } from \"@uploadista/flow-documents-unpdf\";\nimport { Effect, Layer } from \"effect\";\n\n/**\n * Combined DocumentPlugin that uses:\n * - unpdf for text extraction\n * - pdf-lib for metadata, splitting, and merging\n *\n * This provides a complete DocumentPlugin implementation.\n */\nexport const documentPlugin = Layer.unwrapEffect(\n Effect.gen(function* () {\n // Get the pdf-lib plugin for manipulation operations\n const pdfLibPlugin = yield* Effect.provide(\n DocumentPlugin,\n pdfLibDocumentPlugin,\n );\n\n // Get the unpdf plugin for text extraction\n const unpdfPlugin = yield* Effect.provide(\n DocumentPlugin,\n unpdfDocumentPlugin,\n );\n\n // Create a combined plugin\n return Layer.succeed(\n DocumentPlugin,\n DocumentPlugin.of({\n // Use unpdf for text extraction\n extractText: unpdfPlugin.extractText,\n // Use pdf-lib for metadata\n getMetadata: pdfLibPlugin.getMetadata,\n // Use pdf-lib for splitting\n splitPdf: pdfLibPlugin.splitPdf,\n // Use pdf-lib for merging\n mergePdfs: pdfLibPlugin.mergePdfs,\n }),\n );\n }),\n);\n\nexport const DocumentPluginLive = documentPlugin;\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAa,iBAAiB,MAAM,aAClC,OAAO,IAAI,aAAa;CAEtB,MAAM,eAAe,OAAO,OAAO,QACjC,gBACA,qBACD;CAGD,MAAM,cAAc,OAAO,OAAO,QAChC,gBACA,oBACD;AAGD,QAAO,MAAM,QACX,gBACA,eAAe,GAAG;EAEhB,aAAa,YAAY;EAEzB,aAAa,aAAa;EAE1B,UAAU,aAAa;EAEvB,WAAW,aAAa;EACzB,CAAC,CACH;EACD,CACH;AAED,MAAa,qBAAqB"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@uploadista/flow-documents-plugin",
3
+ "type": "module",
4
+ "version": "0.0.16-beta.3",
5
+ "description": "Combined pdf-lib + unpdf DocumentPlugin for Uploadista Flow",
6
+ "license": "MIT",
7
+ "author": "Uploadista",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.mts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.cjs",
13
+ "default": "./dist/index.mjs"
14
+ }
15
+ },
16
+ "dependencies": {
17
+ "effect": "3.19.4",
18
+ "@uploadista/core": "0.0.16-beta.3",
19
+ "@uploadista/flow-documents-pdflib": "0.0.16-beta.3",
20
+ "@uploadista/flow-documents-unpdf": "0.0.16-beta.3"
21
+ },
22
+ "devDependencies": {
23
+ "@types/node": "24.10.1",
24
+ "tsdown": "0.16.5",
25
+ "@uploadista/typescript-config": "0.0.16-beta.3"
26
+ },
27
+ "scripts": {
28
+ "build": "tsdown",
29
+ "format": "biome format --write ./src",
30
+ "lint": "biome lint --write ./src",
31
+ "check": "biome check --write ./src"
32
+ }
33
+ }
@@ -0,0 +1,44 @@
1
+ import { DocumentPlugin } from "@uploadista/core/flow";
2
+ import { pdfLibDocumentPlugin } from "@uploadista/flow-documents-pdflib";
3
+ import { unpdfDocumentPlugin } from "@uploadista/flow-documents-unpdf";
4
+ import { Effect, Layer } from "effect";
5
+
6
+ /**
7
+ * Combined DocumentPlugin that uses:
8
+ * - unpdf for text extraction
9
+ * - pdf-lib for metadata, splitting, and merging
10
+ *
11
+ * This provides a complete DocumentPlugin implementation.
12
+ */
13
+ export const documentPlugin = Layer.unwrapEffect(
14
+ Effect.gen(function* () {
15
+ // Get the pdf-lib plugin for manipulation operations
16
+ const pdfLibPlugin = yield* Effect.provide(
17
+ DocumentPlugin,
18
+ pdfLibDocumentPlugin,
19
+ );
20
+
21
+ // Get the unpdf plugin for text extraction
22
+ const unpdfPlugin = yield* Effect.provide(
23
+ DocumentPlugin,
24
+ unpdfDocumentPlugin,
25
+ );
26
+
27
+ // Create a combined plugin
28
+ return Layer.succeed(
29
+ DocumentPlugin,
30
+ DocumentPlugin.of({
31
+ // Use unpdf for text extraction
32
+ extractText: unpdfPlugin.extractText,
33
+ // Use pdf-lib for metadata
34
+ getMetadata: pdfLibPlugin.getMetadata,
35
+ // Use pdf-lib for splitting
36
+ splitPdf: pdfLibPlugin.splitPdf,
37
+ // Use pdf-lib for merging
38
+ mergePdfs: pdfLibPlugin.mergePdfs,
39
+ }),
40
+ );
41
+ }),
42
+ );
43
+
44
+ export const DocumentPluginLive = documentPlugin;
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { DocumentPluginLive, documentPlugin } from "./document-plugin";
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "@uploadista/typescript-config/server.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "./",
5
+ "paths": {
6
+ "@/*": ["./src/*"]
7
+ },
8
+ "outDir": "./dist",
9
+ "rootDir": "./src",
10
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
11
+ "types": []
12
+ },
13
+ "include": ["src"]
14
+ }