@tslock/bree 2.1.0 → 2.1.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/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/package.json +6 -6
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
createBreeLock: () => createBreeLock
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/bree-lock.ts
|
|
28
|
+
var import_scheduler_core = require("@tslock/scheduler-core");
|
|
29
|
+
function createBreeLock(input) {
|
|
30
|
+
const lifecycle = (0, import_scheduler_core.createSchedulerLock)(input);
|
|
31
|
+
return {
|
|
32
|
+
config: lifecycle.config,
|
|
33
|
+
executor: lifecycle.executor,
|
|
34
|
+
wrap: lifecycle.wrap.bind(lifecycle),
|
|
35
|
+
run: lifecycle.run.bind(lifecycle)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
createBreeLock
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/bree-lock.ts"],"sourcesContent":["export type { BreeLock } from './bree-lock.js';\nexport { createBreeLock } from './bree-lock.js';\n","import type { LockingTaskExecutor } from '@tslock/core';\nimport {\n createSchedulerLock,\n type JobLockOptions,\n type ResolvedSchedulerLockConfig,\n type SchedulerLockConfig,\n} from '@tslock/scheduler-core';\n\nexport interface BreeLock {\n readonly config: ResolvedSchedulerLockConfig;\n readonly executor: LockingTaskExecutor;\n wrap<TArgs extends unknown[], TResult>(\n task: (...args: TArgs) => TResult | Promise<TResult>,\n job: JobLockOptions,\n ): (...args: TArgs) => Promise<TResult | undefined>;\n run<T>(task: () => Promise<T> | T, job: JobLockOptions): Promise<T | undefined>;\n}\n\nexport function createBreeLock(input: SchedulerLockConfig): BreeLock {\n const lifecycle = createSchedulerLock(input);\n return {\n config: lifecycle.config,\n executor: lifecycle.executor,\n wrap: lifecycle.wrap.bind(lifecycle),\n run: lifecycle.run.bind(lifecycle),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,4BAKO;AAYA,SAAS,eAAe,OAAsC;AACnE,QAAM,gBAAY,2CAAoB,KAAK;AAC3C,SAAO;AAAA,IACL,QAAQ,UAAU;AAAA,IAClB,UAAU,UAAU;AAAA,IACpB,MAAM,UAAU,KAAK,KAAK,SAAS;AAAA,IACnC,KAAK,UAAU,IAAI,KAAK,SAAS;AAAA,EACnC;AACF;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LockingTaskExecutor } from '@tslock/core';
|
|
2
|
+
import { ResolvedSchedulerLockConfig, JobLockOptions, SchedulerLockConfig } from '@tslock/scheduler-core';
|
|
3
|
+
|
|
4
|
+
interface BreeLock {
|
|
5
|
+
readonly config: ResolvedSchedulerLockConfig;
|
|
6
|
+
readonly executor: LockingTaskExecutor;
|
|
7
|
+
wrap<TArgs extends unknown[], TResult>(task: (...args: TArgs) => TResult | Promise<TResult>, job: JobLockOptions): (...args: TArgs) => Promise<TResult | undefined>;
|
|
8
|
+
run<T>(task: () => Promise<T> | T, job: JobLockOptions): Promise<T | undefined>;
|
|
9
|
+
}
|
|
10
|
+
declare function createBreeLock(input: SchedulerLockConfig): BreeLock;
|
|
11
|
+
|
|
12
|
+
export { type BreeLock, createBreeLock };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LockingTaskExecutor } from '@tslock/core';
|
|
2
|
+
import { ResolvedSchedulerLockConfig, JobLockOptions, SchedulerLockConfig } from '@tslock/scheduler-core';
|
|
3
|
+
|
|
4
|
+
interface BreeLock {
|
|
5
|
+
readonly config: ResolvedSchedulerLockConfig;
|
|
6
|
+
readonly executor: LockingTaskExecutor;
|
|
7
|
+
wrap<TArgs extends unknown[], TResult>(task: (...args: TArgs) => TResult | Promise<TResult>, job: JobLockOptions): (...args: TArgs) => Promise<TResult | undefined>;
|
|
8
|
+
run<T>(task: () => Promise<T> | T, job: JobLockOptions): Promise<T | undefined>;
|
|
9
|
+
}
|
|
10
|
+
declare function createBreeLock(input: SchedulerLockConfig): BreeLock;
|
|
11
|
+
|
|
12
|
+
export { type BreeLock, createBreeLock };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/bree-lock.ts
|
|
2
|
+
import {
|
|
3
|
+
createSchedulerLock
|
|
4
|
+
} from "@tslock/scheduler-core";
|
|
5
|
+
function createBreeLock(input) {
|
|
6
|
+
const lifecycle = createSchedulerLock(input);
|
|
7
|
+
return {
|
|
8
|
+
config: lifecycle.config,
|
|
9
|
+
executor: lifecycle.executor,
|
|
10
|
+
wrap: lifecycle.wrap.bind(lifecycle),
|
|
11
|
+
run: lifecycle.run.bind(lifecycle)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
createBreeLock
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/bree-lock.ts"],"sourcesContent":["import type { LockingTaskExecutor } from '@tslock/core';\nimport {\n createSchedulerLock,\n type JobLockOptions,\n type ResolvedSchedulerLockConfig,\n type SchedulerLockConfig,\n} from '@tslock/scheduler-core';\n\nexport interface BreeLock {\n readonly config: ResolvedSchedulerLockConfig;\n readonly executor: LockingTaskExecutor;\n wrap<TArgs extends unknown[], TResult>(\n task: (...args: TArgs) => TResult | Promise<TResult>,\n job: JobLockOptions,\n ): (...args: TArgs) => Promise<TResult | undefined>;\n run<T>(task: () => Promise<T> | T, job: JobLockOptions): Promise<T | undefined>;\n}\n\nexport function createBreeLock(input: SchedulerLockConfig): BreeLock {\n const lifecycle = createSchedulerLock(input);\n return {\n config: lifecycle.config,\n executor: lifecycle.executor,\n wrap: lifecycle.wrap.bind(lifecycle),\n run: lifecycle.run.bind(lifecycle),\n };\n}\n"],"mappings":";AACA;AAAA,EACE;AAAA,OAIK;AAYA,SAAS,eAAe,OAAsC;AACnE,QAAM,YAAY,oBAAoB,KAAK;AAC3C,SAAO;AAAA,IACL,QAAQ,UAAU;AAAA,IAClB,UAAU,UAAU;AAAA,IACpB,MAAM,UAAU,KAAK,KAAK,SAAS;AAAA,IACnC,KAAK,UAAU,IAAI,KAAK,SAAS;AAAA,EACnC;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tslock/bree",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "TSLock adapter for Bree job workers",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tslock/core": "2.1.
|
|
23
|
-
"@tslock/scheduler-core": "2.1.
|
|
22
|
+
"@tslock/core": "2.1.1",
|
|
23
|
+
"@tslock/scheduler-core": "2.1.1"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"bree": "^9.0.0"
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"tsup": "^8.0.0",
|
|
36
36
|
"typescript": "^7.0.2",
|
|
37
37
|
"vitest": "^4.1.11",
|
|
38
|
-
"@tslock/
|
|
39
|
-
"@tslock/in-memory": "2.1.
|
|
40
|
-
"@tslock/core": "2.1.
|
|
38
|
+
"@tslock/core": "2.1.1",
|
|
39
|
+
"@tslock/in-memory": "2.1.1",
|
|
40
|
+
"@tslock/scheduler-core": "2.1.1"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=22"
|