ocr-space-api-wrapper 2.1.3 → 2.3.0
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/.github/workflows/ci.yml
CHANGED
|
@@ -6,11 +6,12 @@ jobs:
|
|
|
6
6
|
build:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
steps:
|
|
9
|
-
- uses: actions/checkout@
|
|
9
|
+
- uses: actions/checkout@v3
|
|
10
10
|
# Setup .npmrc file to publish to npm
|
|
11
|
-
- uses: actions/setup-node@
|
|
11
|
+
- uses: actions/setup-node@v3
|
|
12
12
|
with:
|
|
13
|
-
node-version: '
|
|
13
|
+
node-version: '18'
|
|
14
|
+
cache: 'npm'
|
|
14
15
|
registry-url: 'https://registry.npmjs.org'
|
|
15
16
|
- run: npm ci
|
|
16
17
|
- run: npm publish
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
1
|
declare module "ocr-space-api-wrapper" {
|
|
2
|
-
|
|
2
|
+
type OcrSpaceLanguages = 'ara' | 'bul' | 'chs' | 'cht' | 'hrv' | 'cze' | 'dan' | 'dut' |
|
|
3
|
+
'eng' | 'fin' | 'fre' | 'ger' | 'gre' | 'hun' | 'kor' | 'ita' | 'jpn' | 'pol' |
|
|
4
|
+
'por' | 'rus' | 'slv' | 'spa' | 'swe' | 'tur' |
|
|
5
|
+
// The following are only supported by OCREngine = '3'
|
|
6
|
+
'hin' | 'kan' | 'per' | 'tel' | 'tam' | 'tai' | 'vie';
|
|
7
|
+
type OcrSpaceFileTypes = string | 'PDF' | 'GIF' | 'PNG' | 'JPG' | 'TIF' | 'BMP';
|
|
8
|
+
|
|
9
|
+
export type OcrSpaceOptions = {
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
ocrUrl?: string;
|
|
12
|
+
language?: OcrSpaceLanguages;
|
|
13
|
+
isOverlayRequired?: boolean;
|
|
14
|
+
filetype?: OcrSpaceFileTypes;
|
|
15
|
+
detectOrientation?: boolean;
|
|
16
|
+
isCreateSearchablePdf?: boolean;
|
|
17
|
+
isSearchablePdfHideTextLayer?: boolean;
|
|
18
|
+
scale?: boolean;
|
|
19
|
+
isTable?: boolean;
|
|
20
|
+
OCREngine?: '1' | '2' | '3';
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type OcrSpaceResponse = {
|
|
24
|
+
ErrorMessage: string;
|
|
25
|
+
ErrorDetails: string;
|
|
26
|
+
IsErroredOnProcessing: boolean;
|
|
27
|
+
OCRExitCode: number;
|
|
28
|
+
ParsedResults: {
|
|
29
|
+
ErrorMessage: string;
|
|
30
|
+
ErrorDetails: string;
|
|
31
|
+
FileParseExitCode: 0 | 1 | -10 | -20 | -30 | -99;
|
|
32
|
+
HasOverlay: boolean,
|
|
33
|
+
Message: string;
|
|
34
|
+
ParsedText: string;
|
|
35
|
+
TextOverlay: any;
|
|
36
|
+
}[];
|
|
37
|
+
ProcessingTimeInMilliseconds: number
|
|
38
|
+
SearchablePDFURL: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function ocrSpace(input: string, options?: OcrSpaceOptions): OcrSpaceResponse;
|
|
3
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ocr-space-api-wrapper",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Node.js wrapper for ocr.space APIs.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/DavideViolante/ocr-space-api-wrapper#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"axios": "
|
|
34
|
+
"axios": "0.27.2",
|
|
35
35
|
"form-data": "^4.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"eslint": "^8.
|
|
38
|
+
"eslint": "^8.42.0",
|
|
39
39
|
"eslint-config-google": "^0.14.0",
|
|
40
|
-
"mocha": "^10.
|
|
40
|
+
"mocha": "^10.2.0",
|
|
41
41
|
"nyc": "^15.1.0"
|
|
42
42
|
}
|
|
43
43
|
}
|