mongodash 0.10.7 → 1.1.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/CHANGELOG.md +30 -0
- package/dist/lib/OnError.js +1 -1
- package/dist/lib/createContinuousLock.js +2 -2
- package/dist/lib/createContinuousLock.js.map +1 -1
- package/dist/lib/cronTasks.js +8 -5
- package/dist/lib/cronTasks.js.map +1 -1
- package/dist/lib/getCollection.js +2 -2
- package/dist/lib/getCollection.js.map +1 -1
- package/dist/lib/getMongoClient.js +1 -1
- package/dist/lib/index.js +10 -6
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/initPromise.js +17 -0
- package/dist/lib/initPromise.js.map +1 -0
- package/dist/lib/withLock.js +22 -7
- package/dist/lib/withLock.js.map +1 -1
- package/dist/lib/withTransaction.js +2 -2
- package/dist/lib/withTransaction.js.map +1 -1
- package/dist/types/getMongoClient.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/initPromise.d.ts +4 -0
- package/dist/types/withLock.d.ts +7 -2
- package/package.json +37 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
# [1.1.0](https://github.com/VaclavObornik/mongodash/compare/v1.0.2...v1.1.0) (2021-12-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* cron task registration can be called before monogdash.init ([181747d](https://github.com/VaclavObornik/mongodash/commit/181747ddd7a1dbba7671561bc3e49ae0eddb3ee0))
|
|
7
|
+
* isLockAlreadyAcquiredError function introduced ([2741bff](https://github.com/VaclavObornik/mongodash/commit/2741bffbfcc7858175fbff8ea62ffb0f42af4a86))
|
|
8
|
+
* WithLockOptions exported ([7a6443a](https://github.com/VaclavObornik/mongodash/commit/7a6443a568bffa60fff852bf1c072938bdf20481))
|
|
9
|
+
|
|
10
|
+
## [1.0.2](https://github.com/VaclavObornik/mongodash/compare/v1.0.1...v1.0.2) (2021-12-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* type update update ([c56f973](https://github.com/VaclavObornik/mongodash/commit/c56f97325131b011aa7d0e7f1b95bf5ce3dbf527))
|
|
16
|
+
|
|
17
|
+
## [1.0.1](https://github.com/VaclavObornik/mongodash/compare/v1.0.0...v1.0.1) (2021-08-27)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* added ES Module Entrypoint ([9899de6](https://github.com/VaclavObornik/mongodash/commit/9899de6d3a93b2de915a33f9fc05ec1c2f68b1a6))
|
|
23
|
+
|
|
24
|
+
## [0.10.8](https://github.com/VaclavObornik/mongodash/compare/v0.10.7...v0.10.8) (2021-08-27)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* typescript problems after tsc upgrade ([21262b2](https://github.com/VaclavObornik/mongodash/commit/21262b2ec1160914e8796d595c461beea828b58e))
|
|
30
|
+
|
|
1
31
|
## [0.10.7](https://github.com/VaclavObornik/mongodash/compare/v0.10.6...v0.10.7) (2021-07-31)
|
|
2
32
|
|
|
3
33
|
|
package/dist/lib/OnError.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* mongodash
|
|
2
|
+
* mongodash v1.1.0
|
|
3
3
|
* https://github.com/VaclavObornik/mongodash.git
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021 Václav Oborník
|
|
@@ -11,7 +11,7 @@ exports.createContinuousLock = void 0;
|
|
|
11
11
|
function createContinuousLock(collection, documentId, lockProperty, lockTime, onError) {
|
|
12
12
|
let taskInProgress = true;
|
|
13
13
|
let prolongLockTimeoutId = null;
|
|
14
|
-
let lastProlongPromise = Promise.resolve(); // all errors
|
|
14
|
+
let lastProlongPromise = Promise.resolve(); // all errors have to be suppressed
|
|
15
15
|
function scheduleLockProlong() {
|
|
16
16
|
prolongLockTimeoutId = setTimeout(() => {
|
|
17
17
|
prolongLockTimeoutId = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createContinuousLock.js","sourceRoot":"","sources":["../../src/createContinuousLock.ts"],"names":[],"mappings":";;;AAOA,SAAgB,oBAAoB,CAChC,UAAoC,EACpC,UAAkB,EAClB,YAAoB,EACpB,QAAgB,EAChB,OAAgB;IAEhB,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,IAAI,oBAAoB,GAAyC,IAAI,CAAC;IACtE,IAAI,kBAAkB,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"createContinuousLock.js","sourceRoot":"","sources":["../../src/createContinuousLock.ts"],"names":[],"mappings":";;;AAOA,SAAgB,oBAAoB,CAChC,UAAoC,EACpC,UAAkB,EAClB,YAAoB,EACpB,QAAgB,EAChB,OAAgB;IAEhB,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,IAAI,oBAAoB,GAAyC,IAAI,CAAC;IACtE,IAAI,kBAAkB,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,mCAAmC;IAEjG,SAAS,mBAAmB;QACxB,oBAAoB,GAAG,UAAU,CAAC,GAAG,EAAE;YACnC,oBAAoB,GAAG,IAAI,CAAC;YAC5B,kBAAkB,GAAG,CAAC,KAAK,IAAI,EAAE;gBAC7B,IAAI;oBACA,oCAAoC;oBACpC,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;iBAC9G;gBAAC,OAAO,GAAG,EAAE;oBACV,2CAA2C;oBAC3C,OAAO,CAAC,GAAY,CAAC,CAAC;iBACzB;wBAAS;oBACN,IAAI,cAAc,EAAE;wBAChB,yCAAyC;wBACzC,mBAAmB,EAAE,CAAC;qBACzB;iBACJ;YACL,CAAC,CAAC,EAAE,CAAC;QACT,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,mBAAmB,EAAE,CAAC;IAEtB,0BAA0B;IAC1B,OAAO,KAAK,IAAI,EAAE;QACd,cAAc,GAAG,KAAK,CAAC,CAAC,0BAA0B;QAClD,IAAI,oBAAoB,EAAE;YACtB,YAAY,CAAC,oBAAoB,CAAC,CAAC;SACtC;QACD,MAAM,kBAAkB,CAAC;IAC7B,CAAC,CAAC;AACN,CAAC;AAzCD,oDAyCC"}
|
package/dist/lib/cronTasks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* mongodash
|
|
2
|
+
* mongodash v1.1.0
|
|
3
3
|
* https://github.com/VaclavObornik/mongodash.git
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021 Václav Oborník
|
|
@@ -13,6 +13,7 @@ const cron_parser_1 = require("cron-parser");
|
|
|
13
13
|
const parse_duration_1 = require("parse-duration");
|
|
14
14
|
const createContinuousLock_1 = require("./createContinuousLock");
|
|
15
15
|
const getCollection_1 = require("./getCollection");
|
|
16
|
+
const initPromise_1 = require("./initPromise");
|
|
16
17
|
class TaskDocument {
|
|
17
18
|
constructor(_id, runSince) {
|
|
18
19
|
this._id = _id;
|
|
@@ -30,7 +31,7 @@ const state = {
|
|
|
30
31
|
_collection: null,
|
|
31
32
|
get collection() {
|
|
32
33
|
if (!this._collection) {
|
|
33
|
-
this._collection = getCollection_1.getCollection('cronTasks');
|
|
34
|
+
this._collection = (0, getCollection_1.getCollection)('cronTasks');
|
|
34
35
|
}
|
|
35
36
|
return this._collection;
|
|
36
37
|
},
|
|
@@ -57,14 +58,14 @@ function createIntervalFunctionFromScalar(interval) {
|
|
|
57
58
|
if (/^CRON /i.test(interval)) {
|
|
58
59
|
try {
|
|
59
60
|
const expression = interval.slice(5);
|
|
60
|
-
const parsedExpression = cron_parser_1.parseExpression(expression, state.cronExpressionParserOptions);
|
|
61
|
+
const parsedExpression = (0, cron_parser_1.parseExpression)(expression, state.cronExpressionParserOptions);
|
|
61
62
|
return () => parsedExpression.next().toDate();
|
|
62
63
|
}
|
|
63
64
|
catch (err) {
|
|
64
65
|
throw new Error(`${invalidIntervalMessage} ${err.message}.`);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
const duration = parse_duration_1.default(interval);
|
|
68
|
+
const duration = (0, parse_duration_1.default)(interval);
|
|
68
69
|
// debug('parsed duration: ', duration);
|
|
69
70
|
if (typeof duration !== 'number') {
|
|
70
71
|
throw new Error(invalidIntervalMessage);
|
|
@@ -168,7 +169,7 @@ async function processTask(task, enforcedTask) {
|
|
|
168
169
|
// debug(`processing task ${task.taskId}`);
|
|
169
170
|
let taskError = null;
|
|
170
171
|
// todo solve the "any"
|
|
171
|
-
const stopContinuousLock = createContinuousLock_1.createContinuousLock(state.collection, task.taskId, 'lockedTill', lockTime, _onError);
|
|
172
|
+
const stopContinuousLock = (0, createContinuousLock_1.createContinuousLock)(state.collection, task.taskId, 'lockedTill', lockTime, _onError);
|
|
172
173
|
try {
|
|
173
174
|
await (function mongoDashRunTaskNotCyclic() {
|
|
174
175
|
return task.task();
|
|
@@ -226,6 +227,7 @@ function runATask() {
|
|
|
226
227
|
// debug('runATask called');
|
|
227
228
|
state.working = true;
|
|
228
229
|
(async () => {
|
|
230
|
+
await initPromise_1.initPromise;
|
|
229
231
|
const enforcedTask = state.enforcedTasks.shift() || null; // there can be no enforced task
|
|
230
232
|
let task = null;
|
|
231
233
|
const countOfTasks = state.tasks.size;
|
|
@@ -322,6 +324,7 @@ async function scheduleCronTaskImmediately(taskId) {
|
|
|
322
324
|
}
|
|
323
325
|
exports.scheduleCronTaskImmediately = scheduleCronTaskImmediately;
|
|
324
326
|
async function cronTask(taskId, interval, task) {
|
|
327
|
+
await initPromise_1.initPromise;
|
|
325
328
|
if (state.tasks.has(taskId)) {
|
|
326
329
|
throw new Error(`The taskId '${taskId}' is already used.`);
|
|
327
330
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cronTasks.js","sourceRoot":"","sources":["../../src/cronTasks.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,6CAAmH;AAEnH,mDAA2C;AAC3C,iEAA8D;AAC9D,mDAAgD;
|
|
1
|
+
{"version":3,"file":"cronTasks.js","sourceRoot":"","sources":["../../src/cronTasks.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,6CAAmH;AAEnH,mDAA2C;AAC3C,iEAA8D;AAC9D,mDAAgD;AAEhD,+CAA4C;AAmB5C,MAAM,YAAY;IAOd,YAAmB,GAAW,EAAS,QAAc;QAAlC,QAAG,GAAH,GAAG,CAAQ;QAAS,aAAQ,GAAR,QAAQ,CAAM;QAN9C,mBAAc,GAAG,KAAK,CAAC;QAEvB,WAAM,GAAkB,EAAE,CAAC;QAE3B,eAAU,GAAgB,IAAI,CAAC;IAEkB,CAAC;CAC5D;AAQD,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC;AAEhC,MAAM,KAAK,GAAG;IACV,KAAK,EAAE,IAAI,GAAG,EAAgB;IAE9B,iBAAiB,EAAwC,IAAI;IAE7D,OAAO,EAAE,KAAK;IAEd,WAAW,EAAmC,IAAI;IAElD,IAAI,UAAU;QACV,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,IAAA,6BAAa,EAAe,WAAW,CAAC,CAAC;SAC/D;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,aAAa,EAAuB,EAAE;IAEtC,SAAS,EAAE,IAAI;IAEf,kBAAkB,EAA2B,IAAI;IAEjD,2BAA2B,EAA+B,EAAE;CAC/D,CAAC;AAEF,IAAI,QAAiB,CAAC;AAEtB,SAAS,YAAY,CAAC,YAAoB;IACtC,OAAO,IAAI,IAAI,CAAC,IAA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,UAAU,QAAQ,CAAC,MAAc,EAAE,QAAkB,EAAE,IAAkB;IACjF,MAAM,yBAAW,CAAC;IAElB,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,eAAe,MAAM,oBAAoB,CAAC,CAAC;KAC9D;IAED,MAAM,gBAAgB,GAAG,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,gCAAgC,CAAC,QAAQ,CAAC,CAAC;IAChH,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAEvD,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,MAAM,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAEtG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;QACpB,MAAM;QACN,IAAI;QACJ,QAAQ,EAAE,gBAAgB;KAC7B,CAAC,CAAC;IACH,+CAA+C;IAE/C,MAAM,WAAW,EAAE,CAAC;IAEpB,IAAI,KAAK,CAAC,SAAS,EAAE;QACjB,aAAa,EAAE,CAAC;KACnB;AACL,CAAC;AAzBD,4BAyBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* mongodash
|
|
2
|
+
* mongodash v1.1.0
|
|
3
3
|
* https://github.com/VaclavObornik/mongodash.git
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021 Václav Oborník
|
|
@@ -24,7 +24,7 @@ function getCollection(name) {
|
|
|
24
24
|
return collection;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
return getMongoClient_1.getMongoClient().db().collection(name);
|
|
27
|
+
return (0, getMongoClient_1.getMongoClient)().db().collection(name);
|
|
28
28
|
}
|
|
29
29
|
finally {
|
|
30
30
|
depthCallCounter--;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCollection.js","sourceRoot":"","sources":["../../src/getCollection.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAGb,qDAAkD;AAIlD,IAAI,iBAA2C,CAAC;AAahD,SAAgB,IAAI,CAAC,OAAoB;IACrC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD,CAAC;AAFD,oBAEC;AAED,IAAI,gBAAgB,GAAG,CAAC,CAAC;AAEzB,SAAgB,aAAa,CAAI,IAAY;IACzC,IAAI;QACA,gBAAgB,EAAE,CAAC;QACnB,IAAI,iBAAiB,IAAI,gBAAgB,KAAK,CAAC,EAAE;YAC7C,MAAM,UAAU,GAAyB,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACjE,IAAI,UAAU,EAAE;gBACZ,OAAO,UAAU,CAAC;aACrB;SACJ;QACD,OAAO,+BAAc,
|
|
1
|
+
{"version":3,"file":"getCollection.js","sourceRoot":"","sources":["../../src/getCollection.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAGb,qDAAkD;AAIlD,IAAI,iBAA2C,CAAC;AAahD,SAAgB,IAAI,CAAC,OAAoB;IACrC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAClD,CAAC;AAFD,oBAEC;AAED,IAAI,gBAAgB,GAAG,CAAC,CAAC;AAEzB,SAAgB,aAAa,CAAI,IAAY;IACzC,IAAI;QACA,gBAAgB,EAAE,CAAC;QACnB,IAAI,iBAAiB,IAAI,gBAAgB,KAAK,CAAC,EAAE;YAC7C,MAAM,UAAU,GAAyB,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACjE,IAAI,UAAU,EAAE;gBACZ,OAAO,UAAU,CAAC;aACrB;SACJ;QACD,OAAO,IAAA,+BAAc,GAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KACjD;YAAS;QACN,gBAAgB,EAAE,CAAC;KACtB;AACL,CAAC;AAbD,sCAaC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* mongodash
|
|
2
|
+
* mongodash v1.1.0
|
|
3
3
|
* https://github.com/VaclavObornik/mongodash.git
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021 Václav Oborník
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use strict";
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.init = exports.withTransaction = exports.withLock = exports.getMongoClient = exports.getCollection = exports.stopCronTasks = exports.startCronTasks = exports.scheduleCronTaskImmediately = exports.runCronTask = exports.cronTask = void 0;
|
|
10
|
+
exports.init = exports.withTransaction = exports.LockAlreadyAcquiredError = exports.isLockAlreadyAcquiredError = exports.withLock = exports.getMongoClient = exports.getCollection = exports.stopCronTasks = exports.startCronTasks = exports.scheduleCronTaskImmediately = exports.runCronTask = exports.cronTask = void 0;
|
|
11
11
|
const cronTasks_1 = require("./cronTasks");
|
|
12
12
|
const getCollection_1 = require("./getCollection");
|
|
13
13
|
const getMongoClient_1 = require("./getMongoClient");
|
|
14
14
|
const withLock_1 = require("./withLock");
|
|
15
|
+
const initPromise_1 = require("./initPromise");
|
|
15
16
|
var cronTasks_2 = require("./cronTasks");
|
|
16
17
|
Object.defineProperty(exports, "cronTask", { enumerable: true, get: function () { return cronTasks_2.cronTask; } });
|
|
17
18
|
Object.defineProperty(exports, "runCronTask", { enumerable: true, get: function () { return cronTasks_2.runCronTask; } });
|
|
@@ -24,6 +25,8 @@ var getMongoClient_2 = require("./getMongoClient");
|
|
|
24
25
|
Object.defineProperty(exports, "getMongoClient", { enumerable: true, get: function () { return getMongoClient_2.getMongoClient; } });
|
|
25
26
|
var withLock_2 = require("./withLock");
|
|
26
27
|
Object.defineProperty(exports, "withLock", { enumerable: true, get: function () { return withLock_2.withLock; } });
|
|
28
|
+
Object.defineProperty(exports, "isLockAlreadyAcquiredError", { enumerable: true, get: function () { return withLock_2.isLockAlreadyAcquiredError; } });
|
|
29
|
+
Object.defineProperty(exports, "LockAlreadyAcquiredError", { enumerable: true, get: function () { return withLock_2.LockAlreadyAcquiredError; } });
|
|
27
30
|
var withTransaction_1 = require("./withTransaction");
|
|
28
31
|
Object.defineProperty(exports, "withTransaction", { enumerable: true, get: function () { return withTransaction_1.withTransaction; } });
|
|
29
32
|
let initCalled = false;
|
|
@@ -45,14 +48,15 @@ async function init(options) {
|
|
|
45
48
|
// intentionally suppress
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
|
-
getCollection_1.init({ collectionFactory: (_b = options.collectionFactory) !== null && _b !== void 0 ? _b : null });
|
|
49
|
-
withLock_1.init({ onError });
|
|
50
|
-
cronTasks_1.init({
|
|
51
|
+
(0, getCollection_1.init)({ collectionFactory: (_b = options.collectionFactory) !== null && _b !== void 0 ? _b : null });
|
|
52
|
+
(0, withLock_1.init)({ onError });
|
|
53
|
+
(0, cronTasks_1.init)({
|
|
51
54
|
runCronTasks: (_c = options.runCronTasks) !== null && _c !== void 0 ? _c : true,
|
|
52
55
|
cronExpressionParserOptions: (_d = options.cronExpressionParserOptions) !== null && _d !== void 0 ? _d : {},
|
|
53
56
|
onError,
|
|
54
57
|
});
|
|
55
|
-
await getMongoClient_1.init(Object.assign(Object.assign({}, options), { autoConnect: (_e = options.autoConnect) !== null && _e !== void 0 ? _e : true }));
|
|
58
|
+
await (0, getMongoClient_1.init)(Object.assign(Object.assign({}, options), { autoConnect: (_e = options.autoConnect) !== null && _e !== void 0 ? _e : true }));
|
|
59
|
+
initPromise_1.resolver.resolve();
|
|
56
60
|
}
|
|
57
61
|
exports.init = init;
|
|
58
62
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyF;AACzF,mDAAqG;AACrG,qDAAqG;AAErG,yCAAkD;AAClD,yCAAgJ;AAAvI,qGAAA,QAAQ,OAAA;AAAY,wGAAA,WAAW,OAAA;AAAE,wHAAA,2BAA2B,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,0GAAA,aAAa,OAAA;AACpG,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AAEvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyF;AACzF,mDAAqG;AACrG,qDAAqG;AAErG,yCAAkD;AAClD,+CAAyC;AACzC,yCAAgJ;AAAvI,qGAAA,QAAQ,OAAA;AAAY,wGAAA,WAAW,OAAA;AAAE,wHAAA,2BAA2B,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,0GAAA,aAAa,OAAA;AACpG,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AAEvB,uCAA6G;AAApG,oGAAA,QAAQ,OAAA;AAAE,sHAAA,0BAA0B,OAAA;AAAmB,oHAAA,wBAAwB,OAAA;AACxF,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AAExB,IAAI,UAAU,GAAG,KAAK,CAAC;AAIvB,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,EAAE;IACpC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC;AAEK,KAAK,UAAU,IAAI,CAAC,OAAoB;;IAC3C,IAAI,UAAU,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KAC3D;IACD,UAAU,GAAG,IAAI,CAAC;IAElB,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,cAAc,CAAC;IACnD,MAAM,OAAO,GAAY,CAAC,KAAK,EAAE,EAAE;QAC/B,IAAI;YACA,QAAQ,CAAC,KAAK,CAAC,CAAC;SACnB;QAAC,OAAO,cAAc,EAAE;YACrB,yBAAyB;SAC5B;IACL,CAAC,CAAC;IAEF,IAAA,oBAAiB,EAAC,EAAE,iBAAiB,EAAE,MAAA,OAAO,CAAC,iBAAiB,mCAAI,IAAI,EAAE,CAAC,CAAC;IAE5E,IAAA,eAAY,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAE1B,IAAA,gBAAa,EAAC;QACV,YAAY,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,IAAI;QAC1C,2BAA2B,EAAE,MAAA,OAAO,CAAC,2BAA2B,mCAAI,EAAE;QACtE,OAAO;KACV,CAAC,CAAC;IAEH,MAAM,IAAA,qBAAe,kCACd,OAAO,KACV,WAAW,EAAE,MAAA,OAAO,CAAC,WAAW,mCAAI,IAAI,IAC1C,CAAC;IAEH,sBAAQ,CAAC,OAAO,EAAE,CAAC;AACvB,CAAC;AA/BD,oBA+BC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* mongodash v1.1.0
|
|
3
|
+
* https://github.com/VaclavObornik/mongodash.git
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2021 Václav Oborník
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
*/
|
|
8
|
+
"use strict";
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.initPromise = exports.resolver = void 0;
|
|
11
|
+
exports.resolver = {
|
|
12
|
+
resolve: null,
|
|
13
|
+
};
|
|
14
|
+
exports.initPromise = new Promise((resolve) => {
|
|
15
|
+
exports.resolver.resolve = resolve;
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=initPromise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initPromise.js","sourceRoot":"","sources":["../../src/initPromise.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACpB,OAAO,EAAE,IAA6B;CACzC,CAAC;AAEW,QAAA,WAAW,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;IACrD,gBAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B,CAAC,CAAC,CAAC"}
|
package/dist/lib/withLock.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* mongodash
|
|
2
|
+
* mongodash v1.1.0
|
|
3
3
|
* https://github.com/VaclavObornik/mongodash.git
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021 Václav Oborník
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
'use strict';
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.withLock = exports.init = void 0;
|
|
10
|
+
exports.withLock = exports.isLockAlreadyAcquiredError = exports.LockAlreadyAcquiredError = exports.init = void 0;
|
|
11
11
|
// import * as _debug from 'debug';
|
|
12
12
|
const mongodb_1 = require("mongodb");
|
|
13
13
|
const createContinuousLock_1 = require("./createContinuousLock");
|
|
@@ -25,13 +25,28 @@ let collectionPromise;
|
|
|
25
25
|
async function getLockerCollection() {
|
|
26
26
|
if (!collectionPromise) {
|
|
27
27
|
collectionPromise = (async () => {
|
|
28
|
-
const collection = getCollection_1.getCollection('locks');
|
|
28
|
+
const collection = (0, getCollection_1.getCollection)('locks');
|
|
29
29
|
await collection.createIndex({ [expirationKey]: 1 }, { name: 'expiresAtIndex', expireAfterSeconds: 0 });
|
|
30
30
|
return collection;
|
|
31
31
|
})();
|
|
32
32
|
}
|
|
33
33
|
return collectionPromise;
|
|
34
34
|
}
|
|
35
|
+
class LockAlreadyAcquiredError extends Error {
|
|
36
|
+
constructor(key) {
|
|
37
|
+
super(lockAcquiredMessage);
|
|
38
|
+
this.key = key;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.LockAlreadyAcquiredError = LockAlreadyAcquiredError;
|
|
42
|
+
function isLockAlreadyAcquiredError(err, key) {
|
|
43
|
+
const rightError = err instanceof LockAlreadyAcquiredError;
|
|
44
|
+
if (!rightError) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return key ? err.key === key : true;
|
|
48
|
+
}
|
|
49
|
+
exports.isLockAlreadyAcquiredError = isLockAlreadyAcquiredError;
|
|
35
50
|
async function withLock(key, callback, { maxWaitForLock = 3 * 1000, startingDelay = 50, expireIn = 15 * 1000 } = {}) {
|
|
36
51
|
const lockId = new mongodb_1.ObjectId();
|
|
37
52
|
const stringKey = `${key}`;
|
|
@@ -50,7 +65,7 @@ async function withLock(key, callback, { maxWaitForLock = 3 * 1000, startingDela
|
|
|
50
65
|
}
|
|
51
66
|
catch (err) {
|
|
52
67
|
if ([11000, 11001].includes(err.code)) {
|
|
53
|
-
throw new
|
|
68
|
+
throw new LockAlreadyAcquiredError(key);
|
|
54
69
|
}
|
|
55
70
|
await releaseLock(); // the lock could be possible acquired
|
|
56
71
|
throw err;
|
|
@@ -67,7 +82,7 @@ async function withLock(key, callback, { maxWaitForLock = 3 * 1000, startingDela
|
|
|
67
82
|
break;
|
|
68
83
|
}
|
|
69
84
|
catch (err) {
|
|
70
|
-
const randomMultiplier = lodash_1.random(1, 1.2, true);
|
|
85
|
+
const randomMultiplier = (0, lodash_1.random)(1, 1.2, true);
|
|
71
86
|
let waitTime = Math.min(2 ** n * randomMultiplier * startingDelay, maxDelay);
|
|
72
87
|
let nextTime = new Date(Date.now() + waitTime);
|
|
73
88
|
const ultimateAttemptStart = new Date(maxDate.getTime() - lastAcquireDuration);
|
|
@@ -78,7 +93,7 @@ async function withLock(key, callback, { maxWaitForLock = 3 * 1000, startingDela
|
|
|
78
93
|
nextTime = ultimateAttemptStart;
|
|
79
94
|
}
|
|
80
95
|
// debug(`wait time ${waitTime} for ${n}`);
|
|
81
|
-
if (err
|
|
96
|
+
if (isLockAlreadyAcquiredError(err, key) && nextTime <= ultimateAttemptStart) {
|
|
82
97
|
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
|
83
98
|
}
|
|
84
99
|
else {
|
|
@@ -87,7 +102,7 @@ async function withLock(key, callback, { maxWaitForLock = 3 * 1000, startingDela
|
|
|
87
102
|
}
|
|
88
103
|
}
|
|
89
104
|
// todo solve the "any"
|
|
90
|
-
const stopContinuousLock = createContinuousLock_1.createContinuousLock(collection, stringKey, expirationKey, expireIn, onError);
|
|
105
|
+
const stopContinuousLock = (0, createContinuousLock_1.createContinuousLock)(collection, stringKey, expirationKey, expireIn, onError);
|
|
91
106
|
const cleanUp = () => Promise.all([stopContinuousLock(), releaseLock()]);
|
|
92
107
|
let value;
|
|
93
108
|
let err;
|
package/dist/lib/withLock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLock.js","sourceRoot":"","sources":["../../src/withLock.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,mCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"withLock.js","sourceRoot":"","sources":["../../src/withLock.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,mCAAmC;AACnC,qCAAqE;AACrE,iEAA8D;AAC9D,mDAAgD;AAEhD,mCAAgC;AAEhC,8CAA8C;AAE9C,IAAI,OAAgB,CAAC;AAErB,SAAgB,IAAI,CAAC,OAA6B;IAC9C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAC9B,CAAC;AAFD,oBAEC;AAYD,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;AAC5D,MAAM,aAAa,GAAG,WAAW,CAAC;AAElC,IAAI,iBAAgD,CAAC;AACrD,KAAK,UAAU,mBAAmB;IAC9B,IAAI,CAAC,iBAAiB,EAAE;QACpB,iBAAiB,GAAG,CAAC,KAAK,IAAI,EAAE;YAC5B,MAAM,UAAU,GAAG,IAAA,6BAAa,EAAW,OAAO,CAAC,CAAC;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;QACZ,GAAG,GAAG,KAAc,CAAC;KACxB;IAED,MAAM,OAAO,EAAE,CAAC;IAChB,IAAI,GAAI,EAAE;QACN,MAAM,GAAG,CAAC;KACb;IAED,OAAO,KAAM,CAAC;AAClB,CAAC;AAlFD,4BAkFC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* mongodash
|
|
2
|
+
* mongodash v1.1.0
|
|
3
3
|
* https://github.com/VaclavObornik/mongodash.git
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021 Václav Oborník
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.withTransaction = void 0;
|
|
11
11
|
const getMongoClient_1 = require("./getMongoClient");
|
|
12
12
|
async function withTransaction(callback, options) {
|
|
13
|
-
const clientSession = getMongoClient_1.getMongoClient().startSession();
|
|
13
|
+
const clientSession = (0, getMongoClient_1.getMongoClient)().startSession();
|
|
14
14
|
try {
|
|
15
15
|
let returnValue;
|
|
16
16
|
await clientSession.withTransaction(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTransaction.js","sourceRoot":"","sources":["../../src/withTransaction.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAGb,qDAAkD;AAE3C,KAAK,UAAU,eAAe,CAAI,QAAgD,EAAE,OAA4B;IACnH,MAAM,aAAa,GAAG,+BAAc,
|
|
1
|
+
{"version":3,"file":"withTransaction.js","sourceRoot":"","sources":["../../src/withTransaction.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAGb,qDAAkD;AAE3C,KAAK,UAAU,eAAe,CAAI,QAAgD,EAAE,OAA4B;IACnH,MAAM,aAAa,GAAG,IAAA,+BAAc,GAAE,CAAC,YAAY,EAAE,CAAC;IAEtD,IAAI;QACA,IAAI,WAAc,CAAC;QAEnB,MAAM,aAAa,CAAC,eAAe,CAAC,KAAK,IAAI,EAAE;YAC3C,WAAW,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,CAAC;QAChD,CAAC,EAAE,OAAO,CAAC,CAAC;QAEZ,OAAO,WAAY,CAAC,CAAC,+DAA+D;KACvF;YAAS;QACN,MAAM,aAAa,CAAC,UAAU,EAAE,CAAC;KACpC;AACL,CAAC;AAdD,0CAcC"}
|
|
@@ -8,7 +8,7 @@ declare type ReadyClientOptions = CommonOptions & {
|
|
|
8
8
|
};
|
|
9
9
|
declare type UriOptions = CommonOptions & {
|
|
10
10
|
uri: string;
|
|
11
|
-
clientOptions
|
|
11
|
+
clientOptions?: MongoClientOptions;
|
|
12
12
|
};
|
|
13
13
|
export declare type InitOptions = ReadyClientOptions | UriOptions;
|
|
14
14
|
export declare function init(options: InitOptions): Promise<void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { cronTask, Interval, runCronTask, scheduleCronTaskImmediately, startCron
|
|
|
5
5
|
export { getCollection } from './getCollection';
|
|
6
6
|
export { getMongoClient } from './getMongoClient';
|
|
7
7
|
export { OnError } from './OnError';
|
|
8
|
-
export { withLock } from './withLock';
|
|
8
|
+
export { withLock, isLockAlreadyAcquiredError, WithLockOptions, LockAlreadyAcquiredError } from './withLock';
|
|
9
9
|
export { withTransaction } from './withTransaction';
|
|
10
10
|
export declare type InitOptions = GetMongoClientInitOptions & Partial<CronTasksInitOptions> & Partial<GetCollectionInitOptions>;
|
|
11
11
|
export declare function init(options: InitOptions): Promise<void>;
|
package/dist/types/withLock.d.ts
CHANGED
|
@@ -5,9 +5,14 @@ export declare function init(options: {
|
|
|
5
5
|
}): void;
|
|
6
6
|
export declare type LockKey = string | number | ObjectId;
|
|
7
7
|
export declare type LockCallback<T> = () => Promise<T>;
|
|
8
|
-
export declare type
|
|
8
|
+
export declare type WithLockOptions = {
|
|
9
9
|
maxWaitForLock?: number;
|
|
10
10
|
startingDelay?: number;
|
|
11
11
|
expireIn?: number;
|
|
12
12
|
};
|
|
13
|
-
export declare
|
|
13
|
+
export declare class LockAlreadyAcquiredError extends Error {
|
|
14
|
+
readonly key: LockKey;
|
|
15
|
+
constructor(key: LockKey);
|
|
16
|
+
}
|
|
17
|
+
export declare function isLockAlreadyAcquiredError(err: unknown, key?: LockKey): boolean;
|
|
18
|
+
export declare function withLock<T>(key: LockKey, callback: LockCallback<T>, { maxWaitForLock, startingDelay, expireIn }?: WithLockOptions): Promise<T>;
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodash",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "An utility library delivering super-useful and super-simple tools using MongoDB",
|
|
5
|
-
"main": "dist/lib/index.js",
|
|
5
|
+
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
"import": "./dist/lib/index.js",
|
|
9
|
+
"default": "./dist/lib/index.js"
|
|
10
|
+
},
|
|
7
11
|
"files": [
|
|
8
12
|
"dist"
|
|
9
13
|
],
|
|
@@ -11,8 +15,11 @@
|
|
|
11
15
|
"build": "tsc",
|
|
12
16
|
"dev": "tsc --watch",
|
|
13
17
|
"test": "run-p test:lint test:coverage --aggregate-output",
|
|
18
|
+
"test:ts": "run-p test:ts:*",
|
|
19
|
+
"test:ts:src": "tsc --noEmit",
|
|
20
|
+
"test:ts:test": "cd test && tsc --noEmit",
|
|
14
21
|
"test:lint": "eslint ./src/**/*.ts ./test/**/*.ts",
|
|
15
|
-
"test:simple": "jest",
|
|
22
|
+
"test:simple": "jest --runInBand --forceExit",
|
|
16
23
|
"test:coverage": "jest --coverage --runInBand --forceExit",
|
|
17
24
|
"test:coverage:noCache": "npm run test:coverage -- --no-cache",
|
|
18
25
|
"test:watch": "jest --coverage --watch",
|
|
@@ -27,7 +34,7 @@
|
|
|
27
34
|
},
|
|
28
35
|
"dependencies": {
|
|
29
36
|
"cron-parser": "^3.5.0",
|
|
30
|
-
"debug": "^4.3.
|
|
37
|
+
"debug": "^4.3.2",
|
|
31
38
|
"parse-duration": "^1.0.0"
|
|
32
39
|
},
|
|
33
40
|
"peerDependencies": {
|
|
@@ -37,37 +44,38 @@
|
|
|
37
44
|
"@commitlint/cli": "^13.1.0",
|
|
38
45
|
"@semantic-release/changelog": "^5.0.1",
|
|
39
46
|
"@semantic-release/git": "^9.0.0",
|
|
40
|
-
"@
|
|
41
|
-
"@stryker-mutator/
|
|
42
|
-
"@
|
|
43
|
-
"@types/
|
|
44
|
-
"@types/
|
|
45
|
-
"@types/
|
|
46
|
-
"@types/
|
|
47
|
-
"@
|
|
48
|
-
"@typescript-eslint/
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
47
|
+
"@skypack/package-check": "^0.2.2",
|
|
48
|
+
"@stryker-mutator/core": "^5.3.0",
|
|
49
|
+
"@stryker-mutator/jest-runner": "^5.3.0",
|
|
50
|
+
"@types/debug": "^4.1.7",
|
|
51
|
+
"@types/jest": "^27.0.1",
|
|
52
|
+
"@types/lodash": "^4.14.172",
|
|
53
|
+
"@types/node": "^16.7.4",
|
|
54
|
+
"@types/sinon": "^10.0.2",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
|
56
|
+
"@typescript-eslint/parser": "^4.29.3",
|
|
57
|
+
"coveralls": "^3.1.1",
|
|
58
|
+
"deepdash": "^5.3.9",
|
|
59
|
+
"eslint": "^7.32.0",
|
|
52
60
|
"eslint-config-prettier": "^8.3.0",
|
|
53
|
-
"eslint-plugin-no-only-tests": "^2.
|
|
54
|
-
"eslint-plugin-prettier": "^
|
|
55
|
-
"husky": "^7.0.
|
|
56
|
-
"jest": "^27.0
|
|
57
|
-
"jest-config": "^27.0
|
|
61
|
+
"eslint-plugin-no-only-tests": "^2.6.0",
|
|
62
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
63
|
+
"husky": "^7.0.2",
|
|
64
|
+
"jest": "^27.1.0",
|
|
65
|
+
"jest-config": "^27.1.0",
|
|
58
66
|
"jest-transform-stub": "^2.0.0",
|
|
59
|
-
"lint-staged": "^11.
|
|
67
|
+
"lint-staged": "^11.1.2",
|
|
60
68
|
"lodash": "^4.17.21",
|
|
61
|
-
"mongodb": "^4.
|
|
69
|
+
"mongodb": "^4.1.1",
|
|
62
70
|
"npm-run-all": "^4.1.5",
|
|
63
71
|
"organize-imports-cli": "^0.8.0",
|
|
64
|
-
"prettier": "^2.2
|
|
72
|
+
"prettier": "^2.3.2",
|
|
65
73
|
"rimraf": "^3.0.2",
|
|
66
|
-
"semantic-release": "^17.4.
|
|
67
|
-
"sinon": "^11.1.
|
|
68
|
-
"ts-jest": "^27.0.
|
|
69
|
-
"ts-node": "^10.1
|
|
70
|
-
"typescript": "^4.2
|
|
74
|
+
"semantic-release": "^17.4.7",
|
|
75
|
+
"sinon": "^11.1.2",
|
|
76
|
+
"ts-jest": "^27.0.5",
|
|
77
|
+
"ts-node": "^10.2.1",
|
|
78
|
+
"typescript": "^4.4.2"
|
|
71
79
|
},
|
|
72
80
|
"keywords": [
|
|
73
81
|
"mongodb",
|