mindee 4.6.0 → 4.6.1
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/cli.js +6 -6
- package/src/client.js +15 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v4.6.1 - 2023-12-15
|
|
4
|
+
### Changes
|
|
5
|
+
* :recycle: tweak async delays & retry
|
|
6
|
+
* :recycle: tweak default async sample delays & retry
|
|
7
|
+
* :memo: update md doc & fix typos
|
|
8
|
+
|
|
9
|
+
|
|
3
10
|
## v4.6.0 - 2023-12-11
|
|
4
11
|
### Changes
|
|
5
12
|
* :sparkles: add invoice-splitter auto-splitting feature
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -228,9 +228,9 @@ async function callEnqueueAndParse(productClass, command, inputPath, options) {
|
|
|
228
228
|
pageOptions: pageOptions,
|
|
229
229
|
allWords: predictParams.allWords,
|
|
230
230
|
cropper: predictParams.cropper,
|
|
231
|
-
initialDelaySec:
|
|
232
|
-
delaySec:
|
|
233
|
-
maxRetries:
|
|
231
|
+
initialDelaySec: 4,
|
|
232
|
+
delaySec: 2,
|
|
233
|
+
maxRetries: 30,
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
else {
|
|
@@ -238,9 +238,9 @@ async function callEnqueueAndParse(productClass, command, inputPath, options) {
|
|
|
238
238
|
pageOptions: pageOptions,
|
|
239
239
|
allWords: predictParams.allWords,
|
|
240
240
|
cropper: predictParams.cropper,
|
|
241
|
-
initialDelaySec:
|
|
242
|
-
delaySec:
|
|
243
|
-
maxRetries:
|
|
241
|
+
initialDelaySec: 4,
|
|
242
|
+
delaySec: 2,
|
|
243
|
+
maxRetries: 30,
|
|
244
244
|
});
|
|
245
245
|
if (!response.document) {
|
|
246
246
|
throw Error("Document could not be retrieved");
|
package/src/client.js
CHANGED
|
@@ -153,9 +153,9 @@ class Client {
|
|
|
153
153
|
allWords: undefined,
|
|
154
154
|
cropper: undefined,
|
|
155
155
|
pageOptions: undefined,
|
|
156
|
-
initialDelaySec:
|
|
157
|
-
delaySec:
|
|
158
|
-
maxRetries:
|
|
156
|
+
initialDelaySec: 4,
|
|
157
|
+
delaySec: 2,
|
|
158
|
+
maxRetries: 30,
|
|
159
159
|
initialTimerOptions: undefined,
|
|
160
160
|
recurringTimerOptions: undefined,
|
|
161
161
|
}) {
|
|
@@ -283,17 +283,20 @@ Job status: ${pollResults.job.status}.`);
|
|
|
283
283
|
}
|
|
284
284
|
exports.Client = Client;
|
|
285
285
|
_Client_instances = new WeakSet(), _Client_validateAsyncParams = function _Client_validateAsyncParams(asyncParams) {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
286
|
+
const minDelaySec = 1;
|
|
287
|
+
const minInitialDelay = 2;
|
|
288
|
+
const minRetries = 2;
|
|
289
|
+
asyncParams.delaySec ?? (asyncParams.delaySec = 2);
|
|
290
|
+
asyncParams.initialDelaySec ?? (asyncParams.initialDelaySec = 4);
|
|
291
|
+
asyncParams.maxRetries ?? (asyncParams.maxRetries = 30);
|
|
292
|
+
if (asyncParams.delaySec < minDelaySec) {
|
|
293
|
+
throw Error(`Cannot set auto-parsing delay to less than ${minDelaySec} seconds.`);
|
|
291
294
|
}
|
|
292
|
-
if (asyncParams.initialDelaySec <
|
|
293
|
-
throw Error(
|
|
295
|
+
if (asyncParams.initialDelaySec < minInitialDelay) {
|
|
296
|
+
throw Error(`Cannot set initial parsing delay to less than ${minInitialDelay} seconds.`);
|
|
294
297
|
}
|
|
295
|
-
if (
|
|
296
|
-
throw Error(
|
|
298
|
+
if (asyncParams.maxRetries < minRetries) {
|
|
299
|
+
throw Error(`Cannot set retry to less than ${minRetries}.`);
|
|
297
300
|
}
|
|
298
301
|
}, _Client_buildProductEndpoint = function _Client_buildProductEndpoint(endpointName, accountName, endpointVersion) {
|
|
299
302
|
return new http_1.Endpoint(endpointName, accountName, endpointVersion, __classPrivateFieldGet(this, _Client_instances, "m", _Client_buildApiSettings).call(this));
|