Skip to content

Commit 14e8189

Browse files
committed
fix: Use crypto.randomUUID to fix dependency error
The generate job [here](https://github.com/Unstructured-IO/unstructured-js-client/actions/runs/11182023581) is complaining that we need to install type hints for uuid. Instead, we can switch to crypto.randomUUID and avoid an extra dependency.
1 parent ced2e3c commit 14e8189

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

gen.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ typescript:
1515
dependencies:
1616
async: ^3.2.5
1717
pdf-lib: ^1.17.1
18-
uuid: ^10.0.0
1918
devDependencies:
2019
'@types/async': ^3.2.24
2120
'@types/jest': ^29.5.12

src/hooks/custom/SplitPdfHook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import async from "async";
2-
import { v4 as uuidv4 } from 'uuid';
2+
import 'crypto';
33

44
import {
55
AfterErrorContext,
@@ -99,7 +99,7 @@ export class SplitPdfHook
9999
): Promise<Request> {
100100

101101
// setting the current operationID to be unique
102-
const operationID = "partition-" + uuidv4();
102+
const operationID = "partition-" + crypto.randomUUID();
103103
hookCtx.operationID = operationID;
104104

105105
const requestClone = request.clone();

0 commit comments

Comments
 (0)