@daiso-tech/core 0.38.0 → 0.39.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/README.md +5 -1
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +1 -1
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +2 -2
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +1 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +2 -2
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.d.ts +2 -2
- package/dist/async/middlewares/hedging/sequential-hedging.middleware.js +2 -2
- package/dist/async/middlewares/hedging/sequential-hedging.middleware.js.map +1 -1
- package/dist/async/middlewares/retry/retry.middleware.js +2 -2
- package/dist/async/middlewares/retry/retry.middleware.js.map +1 -1
- package/dist/async/middlewares/retry/retry.types.d.ts +1 -1
- package/dist/cache/contracts/cache.contract.d.ts +7 -7
- package/dist/cache/contracts/cache.errors.d.ts +3 -26
- package/dist/cache/contracts/cache.errors.js +0 -47
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +6 -5
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +17 -13
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +15 -3
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +25 -9
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js +2 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +2 -2
- package/dist/cache/implementations/derivables/cache/cache.js +1 -1
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/collection/contracts/async-collection.contract.d.ts +0 -1
- package/dist/collection/contracts/async-collection.contract.js +3 -1
- package/dist/collection/contracts/async-collection.contract.js.map +1 -1
- package/dist/collection/contracts/collection.contract.d.ts +0 -1
- package/dist/collection/contracts/collection.contract.js +3 -1
- package/dist/collection/contracts/collection.contract.js.map +1 -1
- package/dist/collection/contracts/collection.errors.d.ts +1 -26
- package/dist/collection/contracts/collection.errors.js +0 -55
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +9 -6
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/split-iterable.js +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/zip-iterable.js +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +9 -6
- package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/collection/implementations/list-collection/list-collection.js +12 -9
- package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/event-bus/contracts/_module-exports.d.ts +0 -1
- package/dist/event-bus/contracts/_module-exports.js +0 -1
- package/dist/event-bus/contracts/_module-exports.js.map +1 -1
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +2 -2
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +3 -2
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +1 -1
- package/dist/lock/contracts/database-lock-adapter.contract.d.ts +7 -5
- package/dist/lock/contracts/lock-adapter.contract.d.ts +5 -3
- package/dist/lock/contracts/lock.contract.d.ts +23 -23
- package/dist/lock/contracts/lock.errors.d.ts +5 -32
- package/dist/lock/contracts/lock.errors.js +1 -77
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/contracts/lock.events.d.ts +3 -3
- package/dist/lock/contracts/lock.events.js +1 -1
- package/dist/lock/contracts/lock.events.js.map +1 -1
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +16 -4
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +11 -8
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +17 -6
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +9 -16
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +1 -1
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +3 -3
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +1 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +3 -2
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +3 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +2 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +4 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +8 -11
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js +9 -26
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +11 -14
- package/dist/lock/implementations/derivables/lock-provider/lock.js +46 -22
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +2 -2
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +28 -28
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/serde/implementations/derivables/serde.d.ts +22 -22
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js +2 -1
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +1 -1
- package/dist/utilities/classes/namespace/namespace.d.ts +3 -3
- package/dist/utilities/classes/namespace/namespace.js +2 -2
- package/dist/utilities/classes/namespace/namespace.js.map +1 -1
- package/dist/utilities/classes/time-span/time-span.d.ts +10 -2
- package/dist/utilities/classes/time-span/time-span.js +10 -2
- package/dist/utilities/classes/time-span/time-span.js.map +1 -1
- package/dist/utilities/errors.d.ts +8 -0
- package/dist/utilities/errors.js +11 -0
- package/dist/utilities/errors.js.map +1 -1
- package/dist/utilities/functions/_module.d.ts +1 -0
- package/dist/utilities/functions/_module.js +1 -0
- package/dist/utilities/functions/_module.js.map +1 -1
- package/dist/utilities/functions/is-class.d.ts +4 -0
- package/dist/utilities/functions/is-class.js +4 -0
- package/dist/utilities/functions/is-class.js.map +1 -1
- package/dist/utilities/functions/is-positive-nbr.d.ts +8 -0
- package/dist/utilities/functions/is-positive-nbr.js +19 -0
- package/dist/utilities/functions/is-positive-nbr.js.map +1 -0
- package/package.json +1 -1
- package/dist/event-bus/contracts/event-bus.errors.d.ts +0 -40
- package/dist/event-bus/contracts/event-bus.errors.js +0 -62
- package/dist/event-bus/contracts/event-bus.errors.js.map +0 -1
package/dist/utilities/errors.js
CHANGED
|
@@ -36,4 +36,15 @@ export class UnregisteredAdapterError extends FactoryError {
|
|
|
36
36
|
this.name = UnregisteredAdapterError.name;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
42
|
+
* @group Errors
|
|
43
|
+
*/
|
|
44
|
+
export class UnexpectedError extends Error {
|
|
45
|
+
constructor(message, cause) {
|
|
46
|
+
super(message, { cause });
|
|
47
|
+
this.name = UnexpectedError.name;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
39
50
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utilities/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACnC,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IAClC,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,OAAO,6BAA8B,SAAQ,YAAY;IAC3D,YAAY,WAAmB;QAC3B,KAAK,CAAC,wCAAwC,WAAW,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC,IAAI,CAAC;IACnD,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,OAAO,wBAAyB,SAAQ,YAAY;IACtD,YAAY,WAAmB;QAC3B,KAAK,CAAC,yBAAyB,WAAW,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC,IAAI,CAAC;IAC9C,CAAC;CACJ"}
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utilities/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACnC,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IAClC,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,OAAO,6BAA8B,SAAQ,YAAY;IAC3D,YAAY,WAAmB;QAC3B,KAAK,CAAC,wCAAwC,WAAW,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC,IAAI,CAAC;IACnD,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,OAAO,wBAAyB,SAAQ,YAAY;IACtD,YAAY,WAAmB;QAC3B,KAAK,CAAC,yBAAyB,WAAW,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC,IAAI,CAAC;IAC9C,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACtC,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IACrC,CAAC;CACJ"}
|
|
@@ -3,6 +3,7 @@ export * from "../../utilities/functions/get-constructor-name.js";
|
|
|
3
3
|
export * from "../../utilities/functions/is-class.js";
|
|
4
4
|
export * from "../../utilities/functions/invokable.js";
|
|
5
5
|
export * from "../../utilities/functions/is-nullable.js";
|
|
6
|
+
export * from "../../utilities/functions/is-positive-nbr.js";
|
|
6
7
|
export * from "../../utilities/functions/is-standard-schema.js";
|
|
7
8
|
export * from "../../utilities/functions/lazy.js";
|
|
8
9
|
export * from "../../utilities/functions/object.js";
|
|
@@ -3,6 +3,7 @@ export * from "../../utilities/functions/get-constructor-name.js";
|
|
|
3
3
|
export * from "../../utilities/functions/is-class.js";
|
|
4
4
|
export * from "../../utilities/functions/invokable.js";
|
|
5
5
|
export * from "../../utilities/functions/is-nullable.js";
|
|
6
|
+
export * from "../../utilities/functions/is-positive-nbr.js";
|
|
6
7
|
export * from "../../utilities/functions/is-standard-schema.js";
|
|
7
8
|
export * from "../../utilities/functions/lazy.js";
|
|
8
9
|
export * from "../../utilities/functions/object.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/functions/_module.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/functions/_module.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-class.js","sourceRoot":"","sources":["../../../src/utilities/functions/is-class.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,sCAAsC;AACtC,sDAAsD;AACtD,wDAAwD;AACxD;;GAEG;AAIH,MAAM,UAAU,OAAO,CAAC,KAAc;IAClC,OAAQ,KAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAClF,CAAC"}
|
|
1
|
+
{"version":3,"file":"is-class.js","sourceRoot":"","sources":["../../../src/utilities/functions/is-class.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,sCAAsC;AACtC,sDAAsD;AACtD,wDAAwD;AACxD;;GAEG;AAIH;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAc;IAClC,OAAQ,KAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export function isPositiveNbr(nbr, fieldName = "Number") {
|
|
9
|
+
if (nbr < 1) {
|
|
10
|
+
throw new TypeError(`${fieldName} must be larger than 0`);
|
|
11
|
+
}
|
|
12
|
+
if (Number.isNaN(nbr)) {
|
|
13
|
+
throw new TypeError(`${fieldName} cannot be NaN`);
|
|
14
|
+
}
|
|
15
|
+
if (!Number.isFinite(nbr)) {
|
|
16
|
+
throw new TypeError(`${fieldName} cannot be infinite`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=is-positive-nbr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-positive-nbr.js","sourceRoot":"","sources":["../../../src/utilities/functions/is-positive-nbr.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,YAAoB,QAAQ;IACnE,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACV,MAAM,IAAI,SAAS,CAAC,GAAG,SAAS,wBAAwB,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,SAAS,CAAC,GAAG,SAAS,gBAAgB,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CAAC,GAAG,SAAS,qBAAqB,CAAC,CAAC;IAC3D,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module EventBus
|
|
3
|
-
*/
|
|
4
|
-
import type { ISerderRegister, ISerializable } from "../../serde/contracts/_module-exports.js";
|
|
5
|
-
import { type ISerializedError, type OneOrMore } from "../../utilities/_module-exports.js";
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
9
|
-
* @group Errors
|
|
10
|
-
*/
|
|
11
|
-
export declare class EventBusError extends Error implements ISerializable<ISerializedError> {
|
|
12
|
-
static deserialize(deserializedValue: ISerializedError): EventBusError;
|
|
13
|
-
constructor(message: string, cause?: unknown);
|
|
14
|
-
serialize(): ISerializedError;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
19
|
-
* @group Errors
|
|
20
|
-
*/
|
|
21
|
-
export declare class UnexpectedEventBusError extends EventBusError {
|
|
22
|
-
static deserialize(deserializedValue: ISerializedError): EventBusError;
|
|
23
|
-
constructor(message: string, cause?: unknown);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
28
|
-
* @group Errors
|
|
29
|
-
*/
|
|
30
|
-
export declare const EVENT_BUS_ERRORS: {
|
|
31
|
-
Base: typeof EventBusError;
|
|
32
|
-
Unexpected: typeof UnexpectedEventBusError;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* The `registerEventBusErrorsToSerde` function registers all {@link IEventBus | `IEventBus`} related errors with `ISerderRegister`, ensuring they will properly be serialized and deserialized.
|
|
36
|
-
*
|
|
37
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
38
|
-
* @group Errors
|
|
39
|
-
*/
|
|
40
|
-
export declare function registerEventBusErrorsToSerde(serde: OneOrMore<ISerderRegister>): void;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module EventBus
|
|
3
|
-
*/
|
|
4
|
-
import { CORE, resolveOneOrMore, } from "../../utilities/_module-exports.js";
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
8
|
-
* @group Errors
|
|
9
|
-
*/
|
|
10
|
-
export class EventBusError extends Error {
|
|
11
|
-
static deserialize(deserializedValue) {
|
|
12
|
-
return new EventBusError(deserializedValue.message, deserializedValue.cause);
|
|
13
|
-
}
|
|
14
|
-
constructor(message, cause) {
|
|
15
|
-
super(message, { cause });
|
|
16
|
-
this.name = EventBusError.name;
|
|
17
|
-
}
|
|
18
|
-
serialize() {
|
|
19
|
-
return {
|
|
20
|
-
name: this.name,
|
|
21
|
-
message: this.message,
|
|
22
|
-
cause: this.cause,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
29
|
-
* @group Errors
|
|
30
|
-
*/
|
|
31
|
-
export class UnexpectedEventBusError extends EventBusError {
|
|
32
|
-
static deserialize(deserializedValue) {
|
|
33
|
-
return new UnexpectedEventBusError(deserializedValue.message, deserializedValue.cause);
|
|
34
|
-
}
|
|
35
|
-
constructor(message, cause) {
|
|
36
|
-
super(message, { cause });
|
|
37
|
-
this.name = UnexpectedEventBusError.name;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
43
|
-
* @group Errors
|
|
44
|
-
*/
|
|
45
|
-
export const EVENT_BUS_ERRORS = {
|
|
46
|
-
Base: EventBusError,
|
|
47
|
-
Unexpected: UnexpectedEventBusError,
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* The `registerEventBusErrorsToSerde` function registers all {@link IEventBus | `IEventBus`} related errors with `ISerderRegister`, ensuring they will properly be serialized and deserialized.
|
|
51
|
-
*
|
|
52
|
-
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
|
|
53
|
-
* @group Errors
|
|
54
|
-
*/
|
|
55
|
-
export function registerEventBusErrorsToSerde(serde) {
|
|
56
|
-
for (const serde_ of resolveOneOrMore(serde)) {
|
|
57
|
-
serde_
|
|
58
|
-
.registerClass(EventBusError, CORE)
|
|
59
|
-
.registerClass(UnexpectedEventBusError, CORE);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=event-bus.errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.errors.js","sourceRoot":"","sources":["../../../src/event-bus/contracts/event-bus.errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,EACH,IAAI,EACJ,gBAAgB,GAGnB,MAAM,gCAAgC,CAAC;AAExC;;;;GAIG;AACH,MAAM,OAAO,aACT,SAAQ,KAAK;IAGb,MAAM,CAAC,WAAW,CAAC,iBAAmC;QAClD,OAAO,IAAI,aAAa,CACpB,iBAAiB,CAAC,OAAO,EACzB,iBAAiB,CAAC,KAAK,CAC1B,CAAC;IACN,CAAC;IAED,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,SAAS;QACL,OAAO;YACH,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC;IACN,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAAa;IACtD,MAAM,CAAU,WAAW,CACvB,iBAAmC;QAEnC,OAAO,IAAI,uBAAuB,CAC9B,iBAAiB,CAAC,OAAO,EACzB,iBAAiB,CAAC,KAAK,CAC1B,CAAC;IACN,CAAC;IAED,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC,IAAI,CAAC;IAC7C,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,uBAAuB;CACtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CACzC,KAAiC;IAEjC,KAAK,MAAM,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3C,MAAM;aACD,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC;aAClC,aAAa,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;AACL,CAAC"}
|