clutchit 0.0.5 → 0.0.6
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/circuit/{circuit-breaker.d.ts → circuit.breaker.d.ts} +1 -1
- package/dist/circuit/{circuit-breaker.js → circuit.breaker.js} +1 -1
- package/dist/circuit/index.d.ts +7 -4
- package/dist/circuit/index.js +3 -3
- package/dist/concurrency/index.d.ts +10 -3
- package/dist/queue/index.d.ts +11 -7
- package/dist/queue/index.js +6 -6
- package/dist/retry/index.d.ts +5 -3
- package/dist/retry/index.js +2 -2
- package/dist/schedule/index.d.ts +17 -14
- package/dist/schedule/index.js +11 -11
- package/dist/timeout/index.d.ts +1 -2
- package/dist/timeout/index.js +1 -2
- package/dist/unthrow/index.d.ts +12 -10
- package/dist/unthrow/index.js +7 -13
- package/package.json +4 -4
package/dist/circuit/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { CircuitBreaker
|
|
2
|
-
|
|
3
|
-
export { CircuitOpenFault } from './circuit
|
|
1
|
+
import { CircuitBreaker } from './circuit.breaker.js';
|
|
2
|
+
import type { CircuitState, CircuitBreakerOptions } from './circuit.breaker.js';
|
|
3
|
+
export { CircuitOpenFault } from './circuit.breaker.js';
|
|
4
4
|
export declare namespace Circuit {
|
|
5
|
-
const Breaker: typeof
|
|
5
|
+
const Breaker: typeof CircuitBreaker;
|
|
6
|
+
type Breaker = CircuitBreaker;
|
|
7
|
+
type BreakerOptions = CircuitBreakerOptions;
|
|
8
|
+
type State = CircuitState;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/circuit/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CircuitBreaker
|
|
2
|
-
export { CircuitOpenFault } from './circuit
|
|
1
|
+
import { CircuitBreaker } from './circuit.breaker.js';
|
|
2
|
+
export { CircuitOpenFault } from './circuit.breaker.js';
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
4
4
|
export var Circuit;
|
|
5
5
|
(function (Circuit) {
|
|
6
|
-
Circuit.Breaker =
|
|
6
|
+
Circuit.Breaker = CircuitBreaker;
|
|
7
7
|
})(Circuit || (Circuit = {}));
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { Semaphore as _Semaphore } from './semaphore.js';
|
|
2
|
+
import type { SemaphoreOptions as _SemaphoreOptions } from './semaphore.js';
|
|
2
3
|
import { RateLimiter as _RateLimiter } from './rate-limiter.js';
|
|
4
|
+
import type { RateLimiterOptions as _RateLimiterOptions } from './rate-limiter.js';
|
|
3
5
|
import { Bulkhead as _Bulkhead } from './bulkhead.js';
|
|
6
|
+
import type { BulkheadOptions as _BulkheadOptions } from './bulkhead.js';
|
|
4
7
|
import { Ref as _Ref } from './ref.js';
|
|
5
|
-
export type { SemaphoreOptions } from './semaphore.js';
|
|
6
|
-
export type { RateLimiterOptions } from './rate-limiter.js';
|
|
7
8
|
export { RateLimitFault } from './rate-limiter.js';
|
|
8
|
-
export type { BulkheadOptions } from './bulkhead.js';
|
|
9
9
|
export { BulkheadRejectedFault } from './bulkhead.js';
|
|
10
10
|
export declare namespace Concurrency {
|
|
11
11
|
const Semaphore: typeof _Semaphore;
|
|
12
|
+
type Semaphore = _Semaphore;
|
|
13
|
+
type SemaphoreOptions = _SemaphoreOptions;
|
|
12
14
|
const RateLimiter: typeof _RateLimiter;
|
|
15
|
+
type RateLimiter = _RateLimiter;
|
|
16
|
+
type RateLimiterOptions = _RateLimiterOptions;
|
|
13
17
|
const Bulkhead: typeof _Bulkhead;
|
|
18
|
+
type Bulkhead = _Bulkhead;
|
|
19
|
+
type BulkheadOptions = _BulkheadOptions;
|
|
14
20
|
const Ref: typeof _Ref;
|
|
21
|
+
type Ref<T> = _Ref<T>;
|
|
15
22
|
}
|
|
16
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/queue/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import type { QueueOptions } from './base.queue.js';
|
|
2
|
+
import { BoundedQueue } from './bounded.queue.js';
|
|
3
|
+
import { DroppingQueue } from './dropping.queue.js';
|
|
4
|
+
import { SlidingQueue } from './sliding.queue.js';
|
|
5
5
|
export { QueueFullFault, QueueEmptyFault } from './faults.js';
|
|
6
6
|
export declare namespace Queue {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
type Options = QueueOptions;
|
|
8
|
+
const Bounded: typeof BoundedQueue;
|
|
9
|
+
type Bounded<T> = BoundedQueue<T>;
|
|
10
|
+
const Dropping: typeof DroppingQueue;
|
|
11
|
+
type Dropping<T> = DroppingQueue<T>;
|
|
12
|
+
const Sliding: typeof SlidingQueue;
|
|
13
|
+
type Sliding<T> = SlidingQueue<T>;
|
|
10
14
|
}
|
|
11
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/queue/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { BoundedQueue
|
|
2
|
-
import { DroppingQueue
|
|
3
|
-
import { SlidingQueue
|
|
1
|
+
import { BoundedQueue } from './bounded.queue.js';
|
|
2
|
+
import { DroppingQueue } from './dropping.queue.js';
|
|
3
|
+
import { SlidingQueue } from './sliding.queue.js';
|
|
4
4
|
export { QueueFullFault, QueueEmptyFault } from './faults.js';
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
6
6
|
export var Queue;
|
|
7
7
|
(function (Queue) {
|
|
8
|
-
Queue.Bounded =
|
|
9
|
-
Queue.Dropping =
|
|
10
|
-
Queue.Sliding =
|
|
8
|
+
Queue.Bounded = BoundedQueue;
|
|
9
|
+
Queue.Dropping = DroppingQueue;
|
|
10
|
+
Queue.Sliding = SlidingQueue;
|
|
11
11
|
})(Queue || (Queue = {}));
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/dist/retry/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { RetryPolicy
|
|
2
|
-
|
|
1
|
+
import { RetryPolicy } from './retry.js';
|
|
2
|
+
import type { RetryOptions } from './retry.js';
|
|
3
3
|
export declare namespace Retry {
|
|
4
|
-
|
|
4
|
+
type Options = RetryOptions;
|
|
5
|
+
const Policy: typeof RetryPolicy;
|
|
6
|
+
type Policy = RetryPolicy;
|
|
5
7
|
}
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/retry/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RetryPolicy
|
|
1
|
+
import { RetryPolicy } from './retry.js';
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
3
3
|
export var Retry;
|
|
4
4
|
(function (Retry) {
|
|
5
|
-
Retry.Policy =
|
|
5
|
+
Retry.Policy = RetryPolicy;
|
|
6
6
|
})(Retry || (Retry = {}));
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/schedule/index.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { Schedule as
|
|
1
|
+
import { Schedule as _Schedule } from './schedule.js';
|
|
2
|
+
import type { ScheduleStep, ScheduleOperator } from './schedule.js';
|
|
2
3
|
import { recurs as _recurs, cappedDelay as _cappedDelay, jittered as _jittered, upTo as _upTo, andThen as _andThen, union as _union, intersect as _intersect, whileInput as _whileInput, whileOutput as _whileOutput, map as _map } from './operators.js';
|
|
3
4
|
import { repeat as _repeat } from './runner.js';
|
|
4
|
-
|
|
5
|
+
import type { RepeatOptions as _RepeatOptions } from './runner.js';
|
|
5
6
|
export { ScheduleInterruptedFault } from './runner.js';
|
|
6
|
-
export type
|
|
7
|
-
export type Schedule<In = unknown, Out = number> = ScheduleClass<In, Out>;
|
|
7
|
+
export type Schedule<In = unknown, Out = number> = _Schedule<In, Out>;
|
|
8
8
|
export declare namespace Schedule {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
9
|
+
type Step = ScheduleStep;
|
|
10
|
+
type Operator = ScheduleOperator;
|
|
11
|
+
const spaced: (ms: number) => _Schedule;
|
|
12
|
+
const exponential: (initialDelay: number, multiplier?: number) => _Schedule;
|
|
13
|
+
const linear: (initialDelay: number) => _Schedule;
|
|
14
|
+
const constant: (delay: number) => _Schedule;
|
|
15
|
+
const fixed: (interval: number) => _Schedule;
|
|
16
|
+
const windowed: (interval: number) => _Schedule;
|
|
17
|
+
const forever: _Schedule<unknown, number>;
|
|
18
|
+
const once: _Schedule<unknown, number>;
|
|
19
|
+
const fibonacci: (one: number) => _Schedule;
|
|
18
20
|
const cron: (expression: string, options?: {
|
|
19
21
|
timezone?: string;
|
|
20
|
-
}) =>
|
|
22
|
+
}) => _Schedule;
|
|
21
23
|
const recurs: typeof _recurs;
|
|
22
24
|
const cappedDelay: typeof _cappedDelay;
|
|
23
25
|
const jittered: typeof _jittered;
|
|
@@ -29,5 +31,6 @@ export declare namespace Schedule {
|
|
|
29
31
|
const whileOutput: typeof _whileOutput;
|
|
30
32
|
const map: typeof _map;
|
|
31
33
|
const repeat: typeof _repeat;
|
|
34
|
+
type RepeatOptions = _RepeatOptions;
|
|
32
35
|
}
|
|
33
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/schedule/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Schedule as
|
|
1
|
+
import { Schedule as _Schedule } from './schedule.js';
|
|
2
2
|
import { recurs as _recurs, cappedDelay as _cappedDelay, jittered as _jittered, upTo as _upTo, andThen as _andThen, union as _union, intersect as _intersect, whileInput as _whileInput, whileOutput as _whileOutput, map as _map, } from './operators.js';
|
|
3
3
|
import { repeat as _repeat } from './runner.js';
|
|
4
4
|
export { ScheduleInterruptedFault } from './runner.js';
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
6
6
|
export var Schedule;
|
|
7
7
|
(function (Schedule) {
|
|
8
|
-
Schedule.spaced =
|
|
9
|
-
Schedule.exponential =
|
|
10
|
-
Schedule.linear =
|
|
11
|
-
Schedule.constant =
|
|
12
|
-
Schedule.fixed =
|
|
13
|
-
Schedule.windowed =
|
|
14
|
-
Schedule.forever =
|
|
15
|
-
Schedule.once =
|
|
16
|
-
Schedule.fibonacci =
|
|
17
|
-
Schedule.cron =
|
|
8
|
+
Schedule.spaced = _Schedule.spaced;
|
|
9
|
+
Schedule.exponential = _Schedule.exponential;
|
|
10
|
+
Schedule.linear = _Schedule.linear;
|
|
11
|
+
Schedule.constant = _Schedule.constant;
|
|
12
|
+
Schedule.fixed = _Schedule.fixed;
|
|
13
|
+
Schedule.windowed = _Schedule.windowed;
|
|
14
|
+
Schedule.forever = _Schedule.forever;
|
|
15
|
+
Schedule.once = _Schedule.once;
|
|
16
|
+
Schedule.fibonacci = _Schedule.fibonacci;
|
|
17
|
+
Schedule.cron = _Schedule.cron;
|
|
18
18
|
Schedule.recurs = _recurs;
|
|
19
19
|
Schedule.cappedDelay = _cappedDelay;
|
|
20
20
|
Schedule.jittered = _jittered;
|
package/dist/timeout/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withTimeout as _withTimeout, createTimeout as _createTimeout } from './timeout.js';
|
|
2
2
|
export { TimeoutFault } from './timeout.js';
|
|
3
3
|
export declare namespace Timeout {
|
|
4
4
|
const wrap: typeof _withTimeout;
|
|
5
5
|
const create: typeof _createTimeout;
|
|
6
|
-
const Fault: typeof _TimeoutFault;
|
|
7
6
|
}
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/timeout/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withTimeout as _withTimeout, createTimeout as _createTimeout, } from './timeout.js';
|
|
2
2
|
export { TimeoutFault } from './timeout.js';
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
4
4
|
export var Timeout;
|
|
5
5
|
(function (Timeout) {
|
|
6
6
|
Timeout.wrap = _withTimeout;
|
|
7
7
|
Timeout.create = _createTimeout;
|
|
8
|
-
Timeout.Fault = _TimeoutFault;
|
|
9
8
|
})(Timeout || (Timeout = {}));
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
package/dist/unthrow/index.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ok as _ok, err as _err } from './result.js';
|
|
2
|
+
import { ResultAsync as _ResultAsync, okAsync, errAsync } from './result.async.js';
|
|
3
|
+
import { fromPromise as _fromPromise, fromThrowable as _fromThrowable } from './helpers.js';
|
|
4
|
+
import { Do as _Do, DoAsync } from './do.js';
|
|
3
5
|
import { Fault as _Fault, isDomainFault as _isDomainFault, isInfrastructureFault as _isInfrastructureFault, isTransientFault as _isTransientFault } from './fault.js';
|
|
4
6
|
export { Ok, Err } from './result.js';
|
|
5
7
|
export type Result<T, E> = import('./result.js').Ok<T, E> | import('./result.js').Err<T, E>;
|
|
6
8
|
type _Result<T, E> = Result<T, E>;
|
|
7
9
|
export declare namespace Result {
|
|
8
|
-
const ok: typeof
|
|
9
|
-
const err: typeof
|
|
10
|
-
const fromThrowable: typeof
|
|
10
|
+
const ok: typeof _ok;
|
|
11
|
+
const err: typeof _err;
|
|
12
|
+
const fromThrowable: typeof _fromThrowable;
|
|
11
13
|
function combine<T, E>(results: _Result<T, E>[]): _Result<T[], E>;
|
|
12
14
|
function combineWithAllErrors<T, E>(results: _Result<T, E>[]): _Result<T[], E[]>;
|
|
13
|
-
const Do: typeof
|
|
15
|
+
const Do: typeof _Do;
|
|
14
16
|
}
|
|
15
|
-
export type ResultAsync<T, E> =
|
|
17
|
+
export type ResultAsync<T, E> = _ResultAsync<T, E>;
|
|
16
18
|
export declare namespace ResultAsync {
|
|
17
19
|
const ok: typeof okAsync;
|
|
18
20
|
const err: typeof errAsync;
|
|
19
|
-
const fromPromise: typeof
|
|
20
|
-
function combine<T, E>(results:
|
|
21
|
-
function combineWithAllErrors<T, E>(results:
|
|
21
|
+
const fromPromise: typeof _fromPromise;
|
|
22
|
+
function combine<T, E>(results: _ResultAsync<T, E>[]): _ResultAsync<T[], E>;
|
|
23
|
+
function combineWithAllErrors<T, E>(results: _ResultAsync<T, E>[]): _ResultAsync<T[], E[]>;
|
|
22
24
|
const Do: typeof DoAsync;
|
|
23
25
|
}
|
|
24
26
|
export type Fault = import('./fault.js').Fault;
|
package/dist/unthrow/index.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { ok, err } from './result.js';
|
|
1
|
+
import { ok as _ok, err as _err } from './result.js';
|
|
2
2
|
import { okAsync, errAsync, } from './result.async.js';
|
|
3
|
-
import { fromPromise, fromThrowable, combine as
|
|
4
|
-
import { Do, DoAsync } from './do.js';
|
|
3
|
+
import { fromPromise as _fromPromise, fromThrowable as _fromThrowable, combine as _combine, combineWithAllErrors as _combineWithAllErrors, } from './helpers.js';
|
|
4
|
+
import { Do as _Do, DoAsync } from './do.js';
|
|
5
5
|
import { Fault as _Fault, isDomainFault as _isDomainFault, isInfrastructureFault as _isInfrastructureFault, isTransientFault as _isTransientFault, } from './fault.js';
|
|
6
6
|
// Re-export instance types (needed in user signatures)
|
|
7
7
|
export { Ok, Err } from './result.js';
|
|
8
|
-
// Internal aliases (must precede namespaces that reference them)
|
|
9
|
-
const _ok = ok;
|
|
10
|
-
const _err = err;
|
|
11
|
-
const _fromThrowable = fromThrowable;
|
|
12
|
-
const _fromPromise = fromPromise;
|
|
13
|
-
const _Do = Do;
|
|
14
8
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
15
9
|
export var Result;
|
|
16
10
|
(function (Result) {
|
|
@@ -18,11 +12,11 @@ export var Result;
|
|
|
18
12
|
Result.err = _err;
|
|
19
13
|
Result.fromThrowable = _fromThrowable;
|
|
20
14
|
function combine(results) {
|
|
21
|
-
return
|
|
15
|
+
return _combine(results);
|
|
22
16
|
}
|
|
23
17
|
Result.combine = combine;
|
|
24
18
|
function combineWithAllErrors(results) {
|
|
25
|
-
return
|
|
19
|
+
return _combineWithAllErrors(results);
|
|
26
20
|
}
|
|
27
21
|
Result.combineWithAllErrors = combineWithAllErrors;
|
|
28
22
|
Result.Do = _Do;
|
|
@@ -34,11 +28,11 @@ export var ResultAsync;
|
|
|
34
28
|
ResultAsync.err = errAsync;
|
|
35
29
|
ResultAsync.fromPromise = _fromPromise;
|
|
36
30
|
function combine(results) {
|
|
37
|
-
return
|
|
31
|
+
return _combine(results);
|
|
38
32
|
}
|
|
39
33
|
ResultAsync.combine = combine;
|
|
40
34
|
function combineWithAllErrors(results) {
|
|
41
|
-
return
|
|
35
|
+
return _combineWithAllErrors(results);
|
|
42
36
|
}
|
|
43
37
|
ResultAsync.combineWithAllErrors = combineWithAllErrors;
|
|
44
38
|
ResultAsync.Do = DoAsync;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clutchit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "hexac",
|
|
@@ -69,6 +69,9 @@
|
|
|
69
69
|
"prettier --check"
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"croner": "^10.0.1"
|
|
74
|
+
},
|
|
72
75
|
"devDependencies": {
|
|
73
76
|
"@eslint/js": "^10.0.1",
|
|
74
77
|
"@types/bun": "^1.3.9",
|
|
@@ -94,9 +97,6 @@
|
|
|
94
97
|
"node": ">=20",
|
|
95
98
|
"bun": ">=1"
|
|
96
99
|
},
|
|
97
|
-
"dependencies": {
|
|
98
|
-
"croner": "^10.0.1"
|
|
99
|
-
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
102
102
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|