@smartsoft001/domain-core 2.112.0 → 2.113.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/package.json +1 -1
- package/src/index.js +4 -7
- package/src/index.js.map +1 -1
- package/src/lib/errors.js +4 -9
- package/src/lib/errors.js.map +1 -1
- package/src/lib/interfaces.js +1 -2
- package/src/lib/repositories.js +3 -9
- package/src/lib/repositories.js.map +1 -1
- package/src/lib/specifications.js +9 -12
- package/src/lib/specifications.js.map +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tslib_1.__exportStar(require("./lib/errors"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/repositories"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./lib/specifications"), exports);
|
|
1
|
+
export * from './lib/interfaces';
|
|
2
|
+
export * from './lib/errors';
|
|
3
|
+
export * from './lib/repositories';
|
|
4
|
+
export * from './lib/specifications';
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/shared/domain-core/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/shared/domain-core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
package/src/lib/errors.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DomainForbiddenError = exports.DomainValidationError = void 0;
|
|
4
|
-
class DomainValidationError extends Error {
|
|
1
|
+
export class DomainValidationError extends Error {
|
|
2
|
+
type = DomainValidationError;
|
|
5
3
|
constructor(msg) {
|
|
6
4
|
super(msg);
|
|
7
|
-
this.type = DomainValidationError;
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export class DomainForbiddenError extends Error {
|
|
8
|
+
type = DomainForbiddenError;
|
|
12
9
|
constructor(msg) {
|
|
13
10
|
super(msg);
|
|
14
|
-
this.type = DomainForbiddenError;
|
|
15
11
|
}
|
|
16
12
|
}
|
|
17
|
-
exports.DomainForbiddenError = DomainForbiddenError;
|
|
18
13
|
//# sourceMappingURL=errors.js.map
|
package/src/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../packages/shared/domain-core/src/lib/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../packages/shared/domain-core/src/lib/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,IAAI,GAAG,qBAAqB,CAAC;IAE7B,YAAY,GAAW;QACrB,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,IAAI,GAAG,oBAAoB,CAAC;IAE5B,YAAY,GAAW;QACrB,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF"}
|
package/src/lib/interfaces.js
CHANGED
package/src/lib/repositories.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IAttachmentRepository = exports.IItemRepository = exports.IUnitOfWork = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* IUnitOfWork is an abstract class that defines the contract for managing transactional operations
|
|
6
3
|
* across multiple repositories or services. This pattern ensures that a set of operations either
|
|
@@ -8,9 +5,8 @@ exports.IAttachmentRepository = exports.IItemRepository = exports.IUnitOfWork =
|
|
|
8
5
|
*
|
|
9
6
|
* @interface IUnitOfWork
|
|
10
7
|
*/
|
|
11
|
-
class IUnitOfWork {
|
|
8
|
+
export class IUnitOfWork {
|
|
12
9
|
}
|
|
13
|
-
exports.IUnitOfWork = IUnitOfWork;
|
|
14
10
|
/**
|
|
15
11
|
* IItemRepository is an abstract class that defines the contract for a repository
|
|
16
12
|
* responsible for managing entities of type `T` in a storage system. This repository
|
|
@@ -21,9 +17,8 @@ exports.IUnitOfWork = IUnitOfWork;
|
|
|
21
17
|
*
|
|
22
18
|
* @interface IItemRepository
|
|
23
19
|
*/
|
|
24
|
-
class IItemRepository {
|
|
20
|
+
export class IItemRepository {
|
|
25
21
|
}
|
|
26
|
-
exports.IItemRepository = IItemRepository;
|
|
27
22
|
/**
|
|
28
23
|
* IAttachmentRepository is an abstract class that defines the contract for managing file attachments
|
|
29
24
|
* in a storage system. This interface can be implemented to work with various storage backends, such as
|
|
@@ -33,7 +28,6 @@ exports.IItemRepository = IItemRepository;
|
|
|
33
28
|
*
|
|
34
29
|
* @interface IAttachmentRepository
|
|
35
30
|
*/
|
|
36
|
-
class IAttachmentRepository {
|
|
31
|
+
export class IAttachmentRepository {
|
|
37
32
|
}
|
|
38
|
-
exports.IAttachmentRepository = IAttachmentRepository;
|
|
39
33
|
//# sourceMappingURL=repositories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repositories.js","sourceRoot":"","sources":["../../../../../../packages/shared/domain-core/src/lib/repositories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repositories.js","sourceRoot":"","sources":["../../../../../../packages/shared/domain-core/src/lib/repositories.ts"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,MAAM,OAAgB,WAAW;CAmChC;AAUD;;;;;;;;;GASG;AACH,MAAM,OAAgB,eAAe;CAwLpC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAgB,qBAAqB;CA0F1C"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AndSpecification = exports.OrSpecification = exports.MergeSpecification = exports.BasicSpecification = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* BasicSpecification is a class that implements the `ISpecification` interface and serves as a base
|
|
6
3
|
* class for defining basic query criteria. It holds a single set of criteria that can be used to
|
|
@@ -12,7 +9,8 @@ exports.AndSpecification = exports.OrSpecification = exports.MergeSpecification
|
|
|
12
9
|
* @class BasicSpecification
|
|
13
10
|
* @implements {ISpecification}
|
|
14
11
|
*/
|
|
15
|
-
class BasicSpecification {
|
|
12
|
+
export class BasicSpecification {
|
|
13
|
+
criteria;
|
|
16
14
|
/**
|
|
17
15
|
* Creates an instance of BasicSpecification.
|
|
18
16
|
*
|
|
@@ -22,7 +20,6 @@ class BasicSpecification {
|
|
|
22
20
|
this.criteria = criteria;
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
|
-
exports.BasicSpecification = BasicSpecification;
|
|
26
23
|
/**
|
|
27
24
|
* MergeSpecification is a class that extends `BasicSpecification` and allows for the merging of multiple
|
|
28
25
|
* specifications into a single specification. The resulting specification combines the criteria of all provided
|
|
@@ -33,7 +30,7 @@ exports.BasicSpecification = BasicSpecification;
|
|
|
33
30
|
* @class MergeSpecification
|
|
34
31
|
* @extends {BasicSpecification}
|
|
35
32
|
*/
|
|
36
|
-
class MergeSpecification extends BasicSpecification {
|
|
33
|
+
export class MergeSpecification extends BasicSpecification {
|
|
37
34
|
/**
|
|
38
35
|
* Creates an instance of MergeSpecification.
|
|
39
36
|
*
|
|
@@ -42,12 +39,14 @@ class MergeSpecification extends BasicSpecification {
|
|
|
42
39
|
constructor(...specs) {
|
|
43
40
|
let criteria = {};
|
|
44
41
|
specs.forEach((spec) => {
|
|
45
|
-
criteria =
|
|
42
|
+
criteria = {
|
|
43
|
+
...criteria,
|
|
44
|
+
...spec.criteria,
|
|
45
|
+
};
|
|
46
46
|
});
|
|
47
47
|
super(criteria);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
exports.MergeSpecification = MergeSpecification;
|
|
51
50
|
/**
|
|
52
51
|
* OrSpecification is a class that extends `BasicSpecification` and allows for the combination of
|
|
53
52
|
* multiple specifications using a logical OR operation. The resulting specification matches entities that satisfy
|
|
@@ -59,7 +58,7 @@ exports.MergeSpecification = MergeSpecification;
|
|
|
59
58
|
* @class OrSpecification
|
|
60
59
|
* @extends {BasicSpecification}
|
|
61
60
|
*/
|
|
62
|
-
class OrSpecification extends BasicSpecification {
|
|
61
|
+
export class OrSpecification extends BasicSpecification {
|
|
63
62
|
/**
|
|
64
63
|
* Creates an instance of OrSpecification.
|
|
65
64
|
*
|
|
@@ -71,7 +70,6 @@ class OrSpecification extends BasicSpecification {
|
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
|
-
exports.OrSpecification = OrSpecification;
|
|
75
73
|
/**
|
|
76
74
|
* AndSpecification is a class that extends `BasicSpecification` and allows for the combination of
|
|
77
75
|
* multiple specifications using a logical AND operation. The resulting specification matches entities that satisfy
|
|
@@ -83,7 +81,7 @@ exports.OrSpecification = OrSpecification;
|
|
|
83
81
|
* @class AndSpecification
|
|
84
82
|
* @extends {BasicSpecification}
|
|
85
83
|
*/
|
|
86
|
-
class AndSpecification extends BasicSpecification {
|
|
84
|
+
export class AndSpecification extends BasicSpecification {
|
|
87
85
|
/**
|
|
88
86
|
* Creates an instance of AndSpecification.
|
|
89
87
|
*
|
|
@@ -95,5 +93,4 @@ class AndSpecification extends BasicSpecification {
|
|
|
95
93
|
});
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
|
-
exports.AndSpecification = AndSpecification;
|
|
99
96
|
//# sourceMappingURL=specifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specifications.js","sourceRoot":"","sources":["../../../../../../packages/shared/domain-core/src/lib/specifications.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"specifications.js","sourceRoot":"","sources":["../../../../../../packages/shared/domain-core/src/lib/specifications.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,kBAAkB;IAMD;IAL5B;;;;OAIG;IACH,YAA4B,QAAa;QAAb,aAAQ,GAAR,QAAQ,CAAK;IAAG,CAAC;CAC9C;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD;;;;OAIG;IACH,YAAY,GAAG,KAA4B;QACzC,IAAI,QAAQ,GAAG,EAAE,CAAC;QAElB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,QAAQ,GAAG;gBACT,GAAG,QAAQ;gBACX,GAAG,IAAI,CAAC,QAAQ;aACjB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;IACrD;;;;OAIG;IACH,YAAY,GAAG,IAA2B;QACxC,KAAK,CAAC;YACJ,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gBAAiB,SAAQ,kBAAkB;IACtD;;;;OAIG;IACH,YAAY,GAAG,IAA2B;QACxC,KAAK,CAAC;YACJ,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;SAClC,CAAC,CAAC;IACL,CAAC;CACF"}
|