@schorts/shared-kernel 1.1.5 → 1.2.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/CHANGELOG +13 -0
- package/README.md +5 -0
- package/dist/cjs/auth/exceptions/index.js +3 -1
- package/dist/cjs/auth/exceptions/index.js.map +1 -1
- package/dist/cjs/auth/exceptions/not-authenticated.js +6 -0
- package/dist/cjs/auth/exceptions/not-authenticated.js.map +1 -1
- package/dist/cjs/auth/exceptions/require-auth-not-implemented-correctly.js +13 -0
- package/dist/cjs/auth/exceptions/require-auth-not-implemented-correctly.js.map +1 -0
- package/dist/cjs/auth/index.js +16 -3
- package/dist/cjs/auth/index.js.map +1 -1
- package/dist/cjs/auth/require-auth.decorator.js +2 -2
- package/dist/cjs/auth/require-auth.decorator.js.map +1 -1
- package/dist/cjs/criteria/criteria.js +2 -2
- package/dist/cjs/criteria/criteria.js.map +1 -1
- package/dist/cjs/criteria/exceptions/limit-not-valid.js +6 -0
- package/dist/cjs/criteria/exceptions/limit-not-valid.js.map +1 -1
- package/dist/cjs/criteria/exceptions/offset-not-valid.js +6 -0
- package/dist/cjs/criteria/exceptions/offset-not-valid.js.map +1 -1
- package/dist/cjs/criteria/index.js +16 -4
- package/dist/cjs/criteria/index.js.map +1 -1
- package/dist/cjs/entities/entity-registry.js +7 -7
- package/dist/cjs/entities/entity-registry.js.map +1 -1
- package/dist/cjs/entities/exceptions/entity-not-registered.js +6 -0
- package/dist/cjs/entities/exceptions/entity-not-registered.js.map +1 -1
- package/dist/cjs/entities/index.js +16 -3
- package/dist/cjs/entities/index.js.map +1 -1
- package/dist/cjs/i18n/index.js +6 -0
- package/dist/cjs/i18n/index.js.map +1 -0
- package/dist/cjs/i18n/shared-kernel-translation-keys.js +23 -0
- package/dist/cjs/i18n/shared-kernel-translation-keys.js.map +1 -0
- package/dist/cjs/i18n/translation-resolver.js +3 -0
- package/dist/cjs/i18n/translation-resolver.js.map +1 -0
- package/dist/esm/auth/exceptions/index.js +3 -1
- package/dist/esm/auth/exceptions/index.js.map +1 -1
- package/dist/esm/auth/exceptions/not-authenticated.js +6 -0
- package/dist/esm/auth/exceptions/not-authenticated.js.map +1 -1
- package/dist/esm/auth/exceptions/require-auth-not-implemented-correctly.js +13 -0
- package/dist/esm/auth/exceptions/require-auth-not-implemented-correctly.js.map +1 -0
- package/dist/esm/auth/index.js +16 -3
- package/dist/esm/auth/index.js.map +1 -1
- package/dist/esm/auth/require-auth.decorator.js +2 -2
- package/dist/esm/auth/require-auth.decorator.js.map +1 -1
- package/dist/esm/criteria/criteria.js +2 -2
- package/dist/esm/criteria/criteria.js.map +1 -1
- package/dist/esm/criteria/exceptions/limit-not-valid.js +6 -0
- package/dist/esm/criteria/exceptions/limit-not-valid.js.map +1 -1
- package/dist/esm/criteria/exceptions/offset-not-valid.js +6 -0
- package/dist/esm/criteria/exceptions/offset-not-valid.js.map +1 -1
- package/dist/esm/criteria/index.js +16 -4
- package/dist/esm/criteria/index.js.map +1 -1
- package/dist/esm/entities/entity-registry.js +7 -7
- package/dist/esm/entities/entity-registry.js.map +1 -1
- package/dist/esm/entities/exceptions/entity-not-registered.js +6 -0
- package/dist/esm/entities/exceptions/entity-not-registered.js.map +1 -1
- package/dist/esm/entities/index.js +16 -3
- package/dist/esm/entities/index.js.map +1 -1
- package/dist/esm/i18n/index.js +6 -0
- package/dist/esm/i18n/index.js.map +1 -0
- package/dist/esm/i18n/shared-kernel-translation-keys.js +23 -0
- package/dist/esm/i18n/shared-kernel-translation-keys.js.map +1 -0
- package/dist/esm/i18n/translation-resolver.js +3 -0
- package/dist/esm/i18n/translation-resolver.js.map +1 -0
- package/dist/types/auth/exceptions/index.d.ts +1 -0
- package/dist/types/auth/exceptions/index.d.ts.map +1 -1
- package/dist/types/auth/exceptions/not-authenticated.d.ts +2 -0
- package/dist/types/auth/exceptions/not-authenticated.d.ts.map +1 -1
- package/dist/types/auth/exceptions/require-auth-not-implemented-correctly.d.ts +5 -0
- package/dist/types/auth/exceptions/require-auth-not-implemented-correctly.d.ts.map +1 -0
- package/dist/types/auth/index.d.ts +1 -1
- package/dist/types/auth/index.d.ts.map +1 -1
- package/dist/types/auth/require-auth.decorator.d.ts +2 -0
- package/dist/types/auth/require-auth.decorator.d.ts.map +1 -1
- package/dist/types/criteria/exceptions/limit-not-valid.d.ts +2 -0
- package/dist/types/criteria/exceptions/limit-not-valid.d.ts.map +1 -1
- package/dist/types/criteria/exceptions/offset-not-valid.d.ts +2 -0
- package/dist/types/criteria/exceptions/offset-not-valid.d.ts.map +1 -1
- package/dist/types/criteria/index.d.ts +1 -1
- package/dist/types/criteria/index.d.ts.map +1 -1
- package/dist/types/entities/entity-registry.d.ts +3 -3
- package/dist/types/entities/entity-registry.d.ts.map +1 -1
- package/dist/types/entities/exceptions/entity-not-registered.d.ts +2 -0
- package/dist/types/entities/exceptions/entity-not-registered.d.ts.map +1 -1
- package/dist/types/entities/index.d.ts +1 -1
- package/dist/types/entities/index.d.ts.map +1 -1
- package/dist/types/i18n/index.d.ts +3 -0
- package/dist/types/i18n/index.d.ts.map +1 -0
- package/dist/types/i18n/shared-kernel-translation-keys.d.ts +20 -0
- package/dist/types/i18n/shared-kernel-translation-keys.d.ts.map +1 -0
- package/dist/types/i18n/translation-resolver.d.ts +4 -0
- package/dist/types/i18n/translation-resolver.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/auth/exceptions/index.ts +1 -0
- package/src/auth/exceptions/not-authenticated.ts +11 -1
- package/src/auth/exceptions/require-auth-not-implemented-correctly.ts +11 -0
- package/src/auth/index.ts +1 -1
- package/src/auth/require-auth.decorator.ts +5 -4
- package/src/criteria/criteria.ts +2 -2
- package/src/criteria/exceptions/limit-not-valid.ts +11 -1
- package/src/criteria/exceptions/offset-not-valid.ts +11 -1
- package/src/criteria/index.ts +1 -2
- package/src/entities/entity-registry.ts +7 -7
- package/src/entities/exceptions/entity-not-registered.ts +11 -1
- package/src/entities/index.ts +1 -1
- package/src/http/fetch-http-provider.ts +6 -1
- package/src/i18n/index.ts +2 -0
- package/src/i18n/shared-kernel-translation-keys.ts +19 -0
- package/src/i18n/translation-resolver.ts +3 -0
package/CHANGELOG
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.1] - 2025-10-03
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `FetchHTTPProvider` now supports the `credentials` options.
|
|
13
|
+
|
|
14
|
+
## [1.2.0] - 2025-10-02
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Added `i18n` support via `TranslationResolver`.
|
|
19
|
+
|
|
8
20
|
## [1.1.5] - 2025-10-01
|
|
9
21
|
|
|
10
22
|
### Changed
|
|
@@ -68,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
68
80
|
|
|
69
81
|
- Removed indirect dependencies from the `package.json`.
|
|
70
82
|
|
|
83
|
+
[1.2.0]: https://github.com/schorts99/shared-kernel/compare/v1.2.4...v1.2.0
|
|
71
84
|
[1.1.4]: https://github.com/schorts99/shared-kernel/compare/v1.1.3...v1.1.4
|
|
72
85
|
[1.1.3]: https://github.com/schorts99/shared-kernel/compare/v1.1.2...v1.1.3
|
|
73
86
|
[1.1.2]: https://github.com/schorts99/shared-kernel/compare/v1.1.1...v1.1.2
|
package/README.md
CHANGED
|
@@ -37,6 +37,11 @@ npm install @schorts/shared-kernel --save
|
|
|
37
37
|
- **HTTPProvider:** Abstract interface for HTTP transport.
|
|
38
38
|
- **FetchHTTPProvider:** Concrete implementation using fetch.
|
|
39
39
|
|
|
40
|
+
### 🌐 Internationalization (i18n)
|
|
41
|
+
|
|
42
|
+
- **TranslationResolver:** Infrastructure-agnostic interface for resolving localized strings within the domain. Enables domain errors, validations, and events to be presented in different languages without coupling to any specific i18n implementation. Supports injection into domain exceptions, decorators, and services.
|
|
43
|
+
Translation keys are centralized in registries for discoverability and tooling, with patterns to extend keys per bounded context.
|
|
44
|
+
|
|
40
45
|
### 🔗 JSON:API
|
|
41
46
|
|
|
42
47
|
- **JSONAPIConnector:** Connector for interacting with JSON:API-compliant endpoints.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotAuthenticated = void 0;
|
|
3
|
+
exports.RequireAuthNotImplementedCorrectly = exports.NotAuthenticated = void 0;
|
|
4
4
|
var not_authenticated_1 = require("./not-authenticated");
|
|
5
5
|
Object.defineProperty(exports, "NotAuthenticated", { enumerable: true, get: function () { return not_authenticated_1.NotAuthenticated; } });
|
|
6
|
+
var require_auth_not_implemented_correctly_1 = require("./require-auth-not-implemented-correctly");
|
|
7
|
+
Object.defineProperty(exports, "RequireAuthNotImplementedCorrectly", { enumerable: true, get: function () { return require_auth_not_implemented_correctly_1.RequireAuthNotImplementedCorrectly; } });
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,mGAA8F;AAArF,4JAAA,kCAAkC,OAAA"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotAuthenticated = void 0;
|
|
4
4
|
class NotAuthenticated extends Error {
|
|
5
|
+
constructor(translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("auth.errors.not_authenticated")
|
|
8
|
+
: "Not Authenticated";
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
exports.NotAuthenticated = NotAuthenticated;
|
|
7
13
|
//# sourceMappingURL=not-authenticated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-authenticated.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/not-authenticated.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"not-authenticated.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/not-authenticated.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,mBAAyC;QACnD,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,+BAA+B,CAAC;YAC9D,CAAC,CAAC,mBAAmB,CAAC;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,4CAQC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequireAuthNotImplementedCorrectly = void 0;
|
|
4
|
+
class RequireAuthNotImplementedCorrectly extends Error {
|
|
5
|
+
constructor(translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("auth.errors.require_auth_not_implemented_correctly")
|
|
8
|
+
: "RequireAuth decorator not implemented correctly";
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.RequireAuthNotImplementedCorrectly = RequireAuthNotImplementedCorrectly;
|
|
13
|
+
//# sourceMappingURL=require-auth-not-implemented-correctly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-auth-not-implemented-correctly.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/require-auth-not-implemented-correctly.ts"],"names":[],"mappings":";;;AAEA,MAAa,kCAAmC,SAAQ,KAAK;IAC3D,YAAY,mBAAyC;QACnD,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,oDAAoD,CAAC;YACnF,CAAC,CAAC,iDAAiD,CAAC;QAEtD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,gFAQC"}
|
package/dist/cjs/auth/index.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
17
|
+
exports.RequireAuth = void 0;
|
|
4
18
|
var require_auth_decorator_1 = require("./require-auth.decorator");
|
|
5
19
|
Object.defineProperty(exports, "RequireAuth", { enumerable: true, get: function () { return require_auth_decorator_1.RequireAuth; } });
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "NotAuthenticated", { enumerable: true, get: function () { return exceptions_1.NotAuthenticated; } });
|
|
20
|
+
__exportStar(require("./exceptions"), exports);
|
|
8
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,mEAAuD;AAA9C,qHAAA,WAAW,OAAA;AACpB,+CAA6B"}
|
|
@@ -14,7 +14,7 @@ function RequireAuth(onFail) {
|
|
|
14
14
|
return onFail();
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
throw new exceptions_1.NotAuthenticated();
|
|
17
|
+
throw new exceptions_1.NotAuthenticated(this.translationResolver);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
return await originalMethod.apply(this, args);
|
|
@@ -30,7 +30,7 @@ function RequireAuth(onFail) {
|
|
|
30
30
|
const [originalMethod] = args;
|
|
31
31
|
return wrapper(originalMethod);
|
|
32
32
|
}
|
|
33
|
-
throw new
|
|
33
|
+
throw new exceptions_1.RequireAuthNotImplementedCorrectly();
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=require-auth.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-auth.decorator.js","sourceRoot":"","sources":["../../../src/auth/require-auth.decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"require-auth.decorator.js","sourceRoot":"","sources":["../../../src/auth/require-auth.decorator.ts"],"names":[],"mappings":";;AAIA,kCAqCC;AAxCD,6CAAoF;AAGpF,SAAgB,WAAW,CAAC,MAAkB;IAC5C,SAAS,OAAO,CACd,cAAmD;QAEnD,OAAO,KAAK,WAAoB,GAAG,IAAO;YACxC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;YAC7E,CAAC;YAED,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;YAElE,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,MAAM,EAAE,CAAC;gBAClB,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,6BAAgB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC;YAED,OAAO,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,GAAG,IAAW;QAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YACrD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAuB,CAAC;YACjD,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC7C,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1E,MAAM,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;YAC9B,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,+CAAkC,EAAE,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -17,14 +17,14 @@ class Criteria {
|
|
|
17
17
|
}
|
|
18
18
|
limitResults(limit) {
|
|
19
19
|
if (limit < 1) {
|
|
20
|
-
throw new exceptions_1.LimitNotValid();
|
|
20
|
+
throw new exceptions_1.LimitNotValid(limit);
|
|
21
21
|
}
|
|
22
22
|
this.limit = limit;
|
|
23
23
|
return this;
|
|
24
24
|
}
|
|
25
25
|
offsetResults(offset) {
|
|
26
26
|
if (offset < 1) {
|
|
27
|
-
throw new exceptions_1.OffsetNotValid();
|
|
27
|
+
throw new exceptions_1.OffsetNotValid(offset);
|
|
28
28
|
}
|
|
29
29
|
this.offset = offset;
|
|
30
30
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../../src/criteria/criteria.ts"],"names":[],"mappings":";;;AAIA,6CAA6D;AAE7D,MAAa,QAAQ;IACV,OAAO,GAAoC,EAAE,CAAC;IAC9C,MAAM,GAAiB,EAAE,CAAC;IACnC,KAAK,CAAU;IACf,MAAM,CAAU;IAEhB,KAAK,CACH,KAAa,EACb,QAAkB,EAClB,KAAU;QAEV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAE1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAa,EACb,YAAuB,KAAK;QAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAa;QACxB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,0BAAa,
|
|
1
|
+
{"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../../src/criteria/criteria.ts"],"names":[],"mappings":";;;AAIA,6CAA6D;AAE7D,MAAa,QAAQ;IACV,OAAO,GAAoC,EAAE,CAAC;IAC9C,MAAM,GAAiB,EAAE,CAAC;IACnC,KAAK,CAAU;IACf,MAAM,CAAU;IAEhB,KAAK,CACH,KAAa,EACb,QAAkB,EAClB,KAAU;QAEV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAE1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAa,EACb,YAAuB,KAAK;QAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAa;QACxB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,0BAAa,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,MAAc;QAC1B,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACf,MAAM,IAAI,2BAAc,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5CD,4BA4CC"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LimitNotValid = void 0;
|
|
4
4
|
class LimitNotValid extends Error {
|
|
5
|
+
constructor(limit, translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("criteria.errors.limit_not_valid", { limit })
|
|
8
|
+
: `Limit Not Valid: ${limit}`;
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
exports.LimitNotValid = LimitNotValid;
|
|
7
13
|
//# sourceMappingURL=limit-not-valid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limit-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/limit-not-valid.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"limit-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/limit-not-valid.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAc,SAAQ,KAAK;IACtC,YAAY,KAAa,EAAE,mBAAyC;QAClE,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,CAAC;YAC3E,CAAC,CAAC,oBAAoB,KAAK,EAAE,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,sCAQC"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OffsetNotValid = void 0;
|
|
4
4
|
class OffsetNotValid extends Error {
|
|
5
|
+
constructor(offset, translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("criteria.errors.offset_not_valid", { offset })
|
|
8
|
+
: `Offset Not Valid: ${offset}`;
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
exports.OffsetNotValid = OffsetNotValid;
|
|
7
13
|
//# sourceMappingURL=offset-not-valid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offset-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/offset-not-valid.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"offset-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/offset-not-valid.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,MAAc,EAAE,mBAAyC;QACnE,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,MAAM,EAAE,CAAC;YAC7E,CAAC,CAAC,qBAAqB,MAAM,EAAE,CAAC;QAElC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,wCAQC"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
17
|
+
exports.Criteria = void 0;
|
|
4
18
|
var criteria_1 = require("./criteria");
|
|
5
19
|
Object.defineProperty(exports, "Criteria", { enumerable: true, get: function () { return criteria_1.Criteria; } });
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "OffsetNotValid", { enumerable: true, get: function () { return exceptions_1.OffsetNotValid; } });
|
|
8
|
-
Object.defineProperty(exports, "LimitNotValid", { enumerable: true, get: function () { return exceptions_1.LimitNotValid; } });
|
|
20
|
+
__exportStar(require("./exceptions"), exports);
|
|
9
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/criteria/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/criteria/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA6B"}
|
|
@@ -4,16 +4,16 @@ exports.EntityRegistry = void 0;
|
|
|
4
4
|
const exceptions_1 = require("./exceptions");
|
|
5
5
|
class EntityRegistry {
|
|
6
6
|
static registry = new Map();
|
|
7
|
-
static register(
|
|
8
|
-
this.registry.set(
|
|
7
|
+
static register(tableOrCollectionName, entity) {
|
|
8
|
+
this.registry.set(tableOrCollectionName, entity);
|
|
9
9
|
}
|
|
10
|
-
static resolve(
|
|
11
|
-
return (this.registry.get(
|
|
10
|
+
static resolve(tableOrCollectionName) {
|
|
11
|
+
return (this.registry.get(tableOrCollectionName) || null);
|
|
12
12
|
}
|
|
13
|
-
static create(
|
|
14
|
-
const entity = this.resolve(
|
|
13
|
+
static create(tableOrCollectionName, model) {
|
|
14
|
+
const entity = this.resolve(tableOrCollectionName);
|
|
15
15
|
if (!entity) {
|
|
16
|
-
throw new exceptions_1.EntityNotRegistered(
|
|
16
|
+
throw new exceptions_1.EntityNotRegistered(tableOrCollectionName);
|
|
17
17
|
}
|
|
18
18
|
return entity.fromPrimitives(model);
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-registry.js","sourceRoot":"","sources":["../../../src/entities/entity-registry.ts"],"names":[],"mappings":";;;AAEA,6CAAmD;AAOnD,MAAa,cAAc;IACjB,MAAM,CAAC,QAAQ,GAAG,IAAI,GAAG,EAA6B,CAAC;IAE/D,MAAM,CAAC,QAAQ,CAA0B,
|
|
1
|
+
{"version":3,"file":"entity-registry.js","sourceRoot":"","sources":["../../../src/entities/entity-registry.ts"],"names":[],"mappings":";;;AAEA,6CAAmD;AAOnD,MAAa,cAAc;IACjB,MAAM,CAAC,QAAQ,GAAG,IAAI,GAAG,EAA6B,CAAC;IAE/D,MAAM,CAAC,QAAQ,CAA0B,qBAA6B,EAAE,MAAgC;QACtG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,OAAO,CAA0B,qBAA6B;QACnE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,IAAI,CAAoC,CAAC;IAC/F,CAAC;IAED,MAAM,CAAC,MAAM,CAA0B,qBAA6B,EAAE,KAAY;QAChF,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAQ,qBAAqB,CAAC,CAAC;QAE1D,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,gCAAmB,CAAC,qBAAqB,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;;AAnBH,wCAoBC"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EntityNotRegistered = void 0;
|
|
4
4
|
class EntityNotRegistered extends Error {
|
|
5
|
+
constructor(tableOrCollectionName, translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("entities.errors.entity_not_registered")
|
|
8
|
+
: `Entity Not Registered: ${tableOrCollectionName}`;
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
exports.EntityNotRegistered = EntityNotRegistered;
|
|
7
13
|
//# sourceMappingURL=entity-not-registered.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-not-registered.js","sourceRoot":"","sources":["../../../../src/entities/exceptions/entity-not-registered.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"entity-not-registered.js","sourceRoot":"","sources":["../../../../src/entities/exceptions/entity-not-registered.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,qBAA6B,EAAE,mBAAyC;QAClF,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,uCAAuC,CAAC;YACtE,CAAC,CAAC,0BAA0B,qBAAqB,EAAE,CAAC;QAEtD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,kDAQC"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RegisterEntity = exports.
|
|
17
|
+
exports.RegisterEntity = exports.EntityRegistry = exports.Entity = void 0;
|
|
4
18
|
var entity_1 = require("./entity");
|
|
5
19
|
Object.defineProperty(exports, "Entity", { enumerable: true, get: function () { return entity_1.Entity; } });
|
|
6
20
|
var entity_registry_1 = require("./entity-registry");
|
|
7
21
|
Object.defineProperty(exports, "EntityRegistry", { enumerable: true, get: function () { return entity_registry_1.EntityRegistry; } });
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "EntityNotRegistered", { enumerable: true, get: function () { return exceptions_1.EntityNotRegistered; } });
|
|
22
|
+
__exportStar(require("./exceptions"), exports);
|
|
10
23
|
var register_entity_decorator_1 = require("./register-entity.decorator");
|
|
11
24
|
Object.defineProperty(exports, "RegisterEntity", { enumerable: true, get: function () { return register_entity_decorator_1.RegisterEntity; } });
|
|
12
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,+CAA6B;AAC7B,yEAA6D;AAApD,2HAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedKernelTranslationKeys = void 0;
|
|
4
|
+
var shared_kernel_translation_keys_1 = require("./shared-kernel-translation-keys");
|
|
5
|
+
Object.defineProperty(exports, "SharedKernelTranslationKeys", { enumerable: true, get: function () { return shared_kernel_translation_keys_1.SharedKernelTranslationKeys; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":";;;AACA,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedKernelTranslationKeys = void 0;
|
|
4
|
+
exports.SharedKernelTranslationKeys = {
|
|
5
|
+
auth: {
|
|
6
|
+
errors: {
|
|
7
|
+
NotAuthenticated: "auth.errors.not_authenticated",
|
|
8
|
+
RequireAuthNotImplementedCorrectly: "auth.errors.require_auth_not_implemented_correctly",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
criteria: {
|
|
12
|
+
errors: {
|
|
13
|
+
LimitNotValid: "criteria.errors.limit_not_valid",
|
|
14
|
+
OffsetNotValid: "criteria.errors.offset_not_valid",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
entities: {
|
|
18
|
+
errors: {
|
|
19
|
+
EntityNotRegistered: "entities.errors.entity_not_registered",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=shared-kernel-translation-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-kernel-translation-keys.js","sourceRoot":"","sources":["../../../src/i18n/shared-kernel-translation-keys.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;IACzC,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,gBAAgB,EAAE,+BAA+B;YACjD,kCAAkC,EAAE,oDAAoD;SACzF;KACF;IACD,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,aAAa,EAAE,iCAAiC;YAChD,cAAc,EAAE,kCAAkC;SACnD;KACF;IACD,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,mBAAmB,EAAE,uCAAuC;SAC7D;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-resolver.js","sourceRoot":"","sources":["../../../src/i18n/translation-resolver.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotAuthenticated = void 0;
|
|
3
|
+
exports.RequireAuthNotImplementedCorrectly = exports.NotAuthenticated = void 0;
|
|
4
4
|
var not_authenticated_1 = require("./not-authenticated");
|
|
5
5
|
Object.defineProperty(exports, "NotAuthenticated", { enumerable: true, get: function () { return not_authenticated_1.NotAuthenticated; } });
|
|
6
|
+
var require_auth_not_implemented_correctly_1 = require("./require-auth-not-implemented-correctly");
|
|
7
|
+
Object.defineProperty(exports, "RequireAuthNotImplementedCorrectly", { enumerable: true, get: function () { return require_auth_not_implemented_correctly_1.RequireAuthNotImplementedCorrectly; } });
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,mGAA8F;AAArF,4JAAA,kCAAkC,OAAA"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotAuthenticated = void 0;
|
|
4
4
|
class NotAuthenticated extends Error {
|
|
5
|
+
constructor(translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("auth.errors.not_authenticated")
|
|
8
|
+
: "Not Authenticated";
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
exports.NotAuthenticated = NotAuthenticated;
|
|
7
13
|
//# sourceMappingURL=not-authenticated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-authenticated.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/not-authenticated.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"not-authenticated.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/not-authenticated.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,mBAAyC;QACnD,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,+BAA+B,CAAC;YAC9D,CAAC,CAAC,mBAAmB,CAAC;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,4CAQC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequireAuthNotImplementedCorrectly = void 0;
|
|
4
|
+
class RequireAuthNotImplementedCorrectly extends Error {
|
|
5
|
+
constructor(translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("auth.errors.require_auth_not_implemented_correctly")
|
|
8
|
+
: "RequireAuth decorator not implemented correctly";
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.RequireAuthNotImplementedCorrectly = RequireAuthNotImplementedCorrectly;
|
|
13
|
+
//# sourceMappingURL=require-auth-not-implemented-correctly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-auth-not-implemented-correctly.js","sourceRoot":"","sources":["../../../../src/auth/exceptions/require-auth-not-implemented-correctly.ts"],"names":[],"mappings":";;;AAEA,MAAa,kCAAmC,SAAQ,KAAK;IAC3D,YAAY,mBAAyC;QACnD,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,oDAAoD,CAAC;YACnF,CAAC,CAAC,iDAAiD,CAAC;QAEtD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,gFAQC"}
|
package/dist/esm/auth/index.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
17
|
+
exports.RequireAuth = void 0;
|
|
4
18
|
var require_auth_decorator_1 = require("./require-auth.decorator");
|
|
5
19
|
Object.defineProperty(exports, "RequireAuth", { enumerable: true, get: function () { return require_auth_decorator_1.RequireAuth; } });
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "NotAuthenticated", { enumerable: true, get: function () { return exceptions_1.NotAuthenticated; } });
|
|
20
|
+
__exportStar(require("./exceptions"), exports);
|
|
8
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,mEAAuD;AAA9C,qHAAA,WAAW,OAAA;AACpB,+CAA6B"}
|
|
@@ -14,7 +14,7 @@ function RequireAuth(onFail) {
|
|
|
14
14
|
return onFail();
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
throw new exceptions_1.NotAuthenticated();
|
|
17
|
+
throw new exceptions_1.NotAuthenticated(this.translationResolver);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
return await originalMethod.apply(this, args);
|
|
@@ -30,7 +30,7 @@ function RequireAuth(onFail) {
|
|
|
30
30
|
const [originalMethod] = args;
|
|
31
31
|
return wrapper(originalMethod);
|
|
32
32
|
}
|
|
33
|
-
throw new
|
|
33
|
+
throw new exceptions_1.RequireAuthNotImplementedCorrectly();
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=require-auth.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-auth.decorator.js","sourceRoot":"","sources":["../../../src/auth/require-auth.decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"require-auth.decorator.js","sourceRoot":"","sources":["../../../src/auth/require-auth.decorator.ts"],"names":[],"mappings":";;AAIA,kCAqCC;AAxCD,6CAAoF;AAGpF,SAAgB,WAAW,CAAC,MAAkB;IAC5C,SAAS,OAAO,CACd,cAAmD;QAEnD,OAAO,KAAK,WAAoB,GAAG,IAAO;YACxC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;YAC7E,CAAC;YAED,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;YAElE,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,MAAM,EAAE,CAAC;gBAClB,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,6BAAgB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC;YAED,OAAO,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,GAAG,IAAW;QAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YACrD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAuB,CAAC;YACjD,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC7C,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1E,MAAM,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;YAC9B,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,+CAAkC,EAAE,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -17,14 +17,14 @@ class Criteria {
|
|
|
17
17
|
}
|
|
18
18
|
limitResults(limit) {
|
|
19
19
|
if (limit < 1) {
|
|
20
|
-
throw new exceptions_1.LimitNotValid();
|
|
20
|
+
throw new exceptions_1.LimitNotValid(limit);
|
|
21
21
|
}
|
|
22
22
|
this.limit = limit;
|
|
23
23
|
return this;
|
|
24
24
|
}
|
|
25
25
|
offsetResults(offset) {
|
|
26
26
|
if (offset < 1) {
|
|
27
|
-
throw new exceptions_1.OffsetNotValid();
|
|
27
|
+
throw new exceptions_1.OffsetNotValid(offset);
|
|
28
28
|
}
|
|
29
29
|
this.offset = offset;
|
|
30
30
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../../src/criteria/criteria.ts"],"names":[],"mappings":";;;AAIA,6CAA6D;AAE7D,MAAa,QAAQ;IACV,OAAO,GAAoC,EAAE,CAAC;IAC9C,MAAM,GAAiB,EAAE,CAAC;IACnC,KAAK,CAAU;IACf,MAAM,CAAU;IAEhB,KAAK,CACH,KAAa,EACb,QAAkB,EAClB,KAAU;QAEV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAE1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAa,EACb,YAAuB,KAAK;QAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAa;QACxB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,0BAAa,
|
|
1
|
+
{"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../../src/criteria/criteria.ts"],"names":[],"mappings":";;;AAIA,6CAA6D;AAE7D,MAAa,QAAQ;IACV,OAAO,GAAoC,EAAE,CAAC;IAC9C,MAAM,GAAiB,EAAE,CAAC;IACnC,KAAK,CAAU;IACf,MAAM,CAAU;IAEhB,KAAK,CACH,KAAa,EACb,QAAkB,EAClB,KAAU;QAEV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAE1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAa,EACb,YAAuB,KAAK;QAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAa;QACxB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,0BAAa,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,MAAc;QAC1B,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACf,MAAM,IAAI,2BAAc,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5CD,4BA4CC"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LimitNotValid = void 0;
|
|
4
4
|
class LimitNotValid extends Error {
|
|
5
|
+
constructor(limit, translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("criteria.errors.limit_not_valid", { limit })
|
|
8
|
+
: `Limit Not Valid: ${limit}`;
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
exports.LimitNotValid = LimitNotValid;
|
|
7
13
|
//# sourceMappingURL=limit-not-valid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limit-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/limit-not-valid.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"limit-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/limit-not-valid.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAc,SAAQ,KAAK;IACtC,YAAY,KAAa,EAAE,mBAAyC;QAClE,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,CAAC;YAC3E,CAAC,CAAC,oBAAoB,KAAK,EAAE,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,sCAQC"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OffsetNotValid = void 0;
|
|
4
4
|
class OffsetNotValid extends Error {
|
|
5
|
+
constructor(offset, translationResolver) {
|
|
6
|
+
const message = translationResolver
|
|
7
|
+
? translationResolver.resolve("criteria.errors.offset_not_valid", { offset })
|
|
8
|
+
: `Offset Not Valid: ${offset}`;
|
|
9
|
+
super(message);
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
exports.OffsetNotValid = OffsetNotValid;
|
|
7
13
|
//# sourceMappingURL=offset-not-valid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offset-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/offset-not-valid.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"offset-not-valid.js","sourceRoot":"","sources":["../../../../src/criteria/exceptions/offset-not-valid.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,MAAc,EAAE,mBAAyC;QACnE,MAAM,OAAO,GAAG,mBAAmB;YACjC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,MAAM,EAAE,CAAC;YAC7E,CAAC,CAAC,qBAAqB,MAAM,EAAE,CAAC;QAElC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,wCAQC"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
17
|
+
exports.Criteria = void 0;
|
|
4
18
|
var criteria_1 = require("./criteria");
|
|
5
19
|
Object.defineProperty(exports, "Criteria", { enumerable: true, get: function () { return criteria_1.Criteria; } });
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "OffsetNotValid", { enumerable: true, get: function () { return exceptions_1.OffsetNotValid; } });
|
|
8
|
-
Object.defineProperty(exports, "LimitNotValid", { enumerable: true, get: function () { return exceptions_1.LimitNotValid; } });
|
|
20
|
+
__exportStar(require("./exceptions"), exports);
|
|
9
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/criteria/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/criteria/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA6B"}
|