@daiso-tech/core 0.47.0 → 0.48.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/dist/cache/contracts/cache.contract.d.ts +3 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +3 -32
- package/dist/cache/implementations/derivables/cache/cache.js +2 -41
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +38 -38
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -1
- package/dist/circuit-breaker/contracts/circuit-breaker-provider.contract.d.ts +3 -1
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker-provider.d.ts +3 -9
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker-provider.js +2 -18
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker-provider.js.map +1 -1
- package/dist/lock/contracts/lock-provider.contract.d.ts +3 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +3 -33
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +2 -42
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +58 -58
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/rate-limiter/contracts/rate-limiter-provider.contract.d.ts +3 -1
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter-provider.d.ts +3 -9
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter-provider.js +2 -18
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter-provider.js.map +1 -1
- package/dist/semaphore/contracts/semaphore-provider.contract.d.ts +3 -1
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.d.ts +3 -33
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js +2 -42
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js.map +1 -1
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js +57 -57
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js.map +1 -1
- package/dist/shared-lock/contracts/shared-lock-provider.contract.d.ts +3 -1
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.d.ts +3 -33
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js +2 -42
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js.map +1 -1
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js +117 -117
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js.map +1 -1
- package/package.json +1 -1
|
@@ -46,4 +46,6 @@ export type ISharedLockProviderBase = {
|
|
|
46
46
|
* IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"`
|
|
47
47
|
* @group Contracts
|
|
48
48
|
*/
|
|
49
|
-
export type ISharedLockProvider =
|
|
49
|
+
export type ISharedLockProvider = ISharedLockProviderBase & {
|
|
50
|
+
readonly events: ISharedLockListenable;
|
|
51
|
+
};
|
package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module SharedLock
|
|
3
3
|
*/
|
|
4
|
-
import { type
|
|
4
|
+
import { type IEventBus } from "../../../../event-bus/contracts/_module.js";
|
|
5
5
|
import { type INamespace } from "../../../../namespace/contracts/_module.js";
|
|
6
6
|
import { type ISerderRegister } from "../../../../serde/contracts/_module.js";
|
|
7
|
-
import { type ISharedLock, type
|
|
8
|
-
import { type ITask } from "../../../../task/contracts/_module.js";
|
|
7
|
+
import { type ISharedLock, type SharedLockProviderCreateSettings, type ISharedLockProvider, type SharedLockAdapterVariants, type ISharedLockListenable } from "../../../../shared-lock/contracts/_module.js";
|
|
9
8
|
import { type ITimeSpan } from "../../../../time-span/contracts/_module.js";
|
|
10
9
|
import { type Invokable, type OneOrMore } from "../../../../utilities/_module.js";
|
|
11
10
|
/**
|
|
@@ -157,36 +156,7 @@ export declare class SharedLockProvider implements ISharedLockProvider {
|
|
|
157
156
|
*/
|
|
158
157
|
constructor(settings: SharedLockProviderSettings);
|
|
159
158
|
private registerToSerde;
|
|
160
|
-
|
|
161
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
162
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
163
|
-
*/
|
|
164
|
-
addListener<TEventName extends keyof SharedLockEventMap>(eventName: TEventName, listener: EventListener<SharedLockEventMap[TEventName]>): ITask<void>;
|
|
165
|
-
/**
|
|
166
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
167
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
168
|
-
*/
|
|
169
|
-
removeListener<TEventName extends keyof SharedLockEventMap>(eventName: TEventName, listener: EventListener<SharedLockEventMap[TEventName]>): ITask<void>;
|
|
170
|
-
/**
|
|
171
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
172
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
173
|
-
*/
|
|
174
|
-
listenOnce<TEventName extends keyof SharedLockEventMap>(eventName: TEventName, listener: EventListener<SharedLockEventMap[TEventName]>): ITask<void>;
|
|
175
|
-
/**
|
|
176
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
177
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
178
|
-
*/
|
|
179
|
-
asTask<TEventName extends keyof SharedLockEventMap>(eventName: TEventName): ITask<SharedLockEventMap[TEventName]>;
|
|
180
|
-
/**
|
|
181
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
182
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
183
|
-
*/
|
|
184
|
-
subscribeOnce<TEventName extends keyof SharedLockEventMap>(eventName: TEventName, listener: EventListener<SharedLockEventMap[TEventName]>): ITask<Unsubscribe>;
|
|
185
|
-
/**
|
|
186
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
187
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
188
|
-
*/
|
|
189
|
-
subscribe<TEventName extends keyof SharedLockEventMap>(eventName: TEventName, listener: EventListener<SharedLockEventMap[TEventName]>): ITask<Unsubscribe>;
|
|
159
|
+
get events(): ISharedLockListenable;
|
|
190
160
|
/**
|
|
191
161
|
* @example
|
|
192
162
|
* ```ts
|
package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js
CHANGED
|
@@ -14,7 +14,6 @@ import {} from "../../../../shared-lock/contracts/_module.js";
|
|
|
14
14
|
import { resolveSharedLockAdapter } from "../../../../shared-lock/implementations/derivables/shared-lock-provider/resolve-shared-lock-adapter.js";
|
|
15
15
|
import { SharedLockSerdeTransformer } from "../../../../shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.js";
|
|
16
16
|
import { SharedLock } from "../../../../shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js";
|
|
17
|
-
import {} from "../../../../task/contracts/_module.js";
|
|
18
17
|
import {} from "../../../../time-span/contracts/_module.js";
|
|
19
18
|
import { TimeSpan } from "../../../../time-span/implementations/_module.js";
|
|
20
19
|
import { CORE, resolveOneOrMore, callInvokable, } from "../../../../utilities/_module.js";
|
|
@@ -100,47 +99,8 @@ export class SharedLockProvider {
|
|
|
100
99
|
serde.registerCustom(transformer, CORE);
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
106
|
-
*/
|
|
107
|
-
addListener(eventName, listener) {
|
|
108
|
-
return this.eventBus.addListener(eventName, listener);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
112
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
113
|
-
*/
|
|
114
|
-
removeListener(eventName, listener) {
|
|
115
|
-
return this.eventBus.removeListener(eventName, listener);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
119
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
120
|
-
*/
|
|
121
|
-
listenOnce(eventName, listener) {
|
|
122
|
-
return this.eventBus.listenOnce(eventName, listener);
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
126
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
127
|
-
*/
|
|
128
|
-
asTask(eventName) {
|
|
129
|
-
return this.eventBus.asTask(eventName);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
133
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
134
|
-
*/
|
|
135
|
-
subscribeOnce(eventName, listener) {
|
|
136
|
-
return this.eventBus.subscribeOnce(eventName, listener);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* You can listen to the following {@link SharedLockEventMap | `SharedLockEventMap`} of all {@link ISharedLock | `ISharedLock`} instances created by the {@link ISharedLockProvider | `ISharedLockProvider`}.
|
|
140
|
-
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
141
|
-
*/
|
|
142
|
-
subscribe(eventName, listener) {
|
|
143
|
-
return this.eventBus.subscribe(eventName, listener);
|
|
102
|
+
get events() {
|
|
103
|
+
return this.eventBus;
|
|
144
104
|
}
|
|
145
105
|
/**
|
|
146
106
|
* @example
|
package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-lock-provider.js","sourceRoot":"","sources":["../../../../../src/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"shared-lock-provider.js","sourceRoot":"","sources":["../../../../../src/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B,OAAO,EAAkB,MAAM,kCAAkC,CAAC;AAClE,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