@schorts/shared-kernel 1.3.0 → 1.3.2

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 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.3.2]
9
+
10
+ ### Changed
11
+
12
+ - Now the `.authenticate` method from `AuthProvider` should return the token to remove responsabilities from it. A `AuthManager` should be implemented instead in case of future needs.
13
+
14
+ ## [1.3.1] - 2025-10-04
15
+
16
+ ### Added
17
+
18
+ - Added `ValuesNotValid` exception to have a central error for value objects.
19
+
8
20
  ## [1.3.0] - 2025-10-04
9
21
 
10
22
  ### Added
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValuesNotValid = void 0;
4
+ var values_not_valid_1 = require("./values-not-valid");
5
+ Object.defineProperty(exports, "ValuesNotValid", { enumerable: true, get: function () { return values_not_valid_1.ValuesNotValid; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/value-objects/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAA3C,kHAAA,cAAc,OAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValuesNotValid = void 0;
4
+ class ValuesNotValid extends Error {
5
+ errors;
6
+ constructor(errors) {
7
+ super();
8
+ this.errors = errors;
9
+ }
10
+ }
11
+ exports.ValuesNotValid = ValuesNotValid;
12
+ //# sourceMappingURL=values-not-valid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values-not-valid.js","sourceRoot":"","sources":["../../../../src/value-objects/exceptions/values-not-valid.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAe,SAAQ,KAAK;IAC9B,MAAM,CAAe;IAE9B,YAAY,MAAoB;QAC9B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AARD,wCAQC"}
@@ -1,4 +1,18 @@
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
17
  exports.CoordinatesValue = exports.IntegerValue = exports.SlugValue = exports.PhoneValue = exports.EmailValue = exports.EnumValue = exports.StringValue = exports.UUIDValue = void 0;
4
18
  var uuid_value_1 = require("./uuid-value");
@@ -17,4 +31,5 @@ var integer_value_1 = require("./integer-value");
17
31
  Object.defineProperty(exports, "IntegerValue", { enumerable: true, get: function () { return integer_value_1.IntegerValue; } });
18
32
  var coordinates_value_1 = require("./coordinates-value");
19
33
  Object.defineProperty(exports, "CoordinatesValue", { enumerable: true, get: function () { return coordinates_value_1.CoordinatesValue; } });
34
+ __exportStar(require("./exceptions"), exports);
20
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/value-objects/index.ts"],"names":[],"mappings":";;;AAEA,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/value-objects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,+CAA6B"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValuesNotValid = void 0;
4
+ var values_not_valid_1 = require("./values-not-valid");
5
+ Object.defineProperty(exports, "ValuesNotValid", { enumerable: true, get: function () { return values_not_valid_1.ValuesNotValid; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/value-objects/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAA3C,kHAAA,cAAc,OAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValuesNotValid = void 0;
4
+ class ValuesNotValid extends Error {
5
+ errors;
6
+ constructor(errors) {
7
+ super();
8
+ this.errors = errors;
9
+ }
10
+ }
11
+ exports.ValuesNotValid = ValuesNotValid;
12
+ //# sourceMappingURL=values-not-valid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values-not-valid.js","sourceRoot":"","sources":["../../../../src/value-objects/exceptions/values-not-valid.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAe,SAAQ,KAAK;IAC9B,MAAM,CAAe;IAE9B,YAAY,MAAoB;QAC9B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AARD,wCAQC"}
@@ -1,4 +1,18 @@
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
17
  exports.CoordinatesValue = exports.IntegerValue = exports.SlugValue = exports.PhoneValue = exports.EmailValue = exports.EnumValue = exports.StringValue = exports.UUIDValue = void 0;
4
18
  var uuid_value_1 = require("./uuid-value");
@@ -17,4 +31,5 @@ var integer_value_1 = require("./integer-value");
17
31
  Object.defineProperty(exports, "IntegerValue", { enumerable: true, get: function () { return integer_value_1.IntegerValue; } });
18
32
  var coordinates_value_1 = require("./coordinates-value");
19
33
  Object.defineProperty(exports, "CoordinatesValue", { enumerable: true, get: function () { return coordinates_value_1.CoordinatesValue; } });
34
+ __exportStar(require("./exceptions"), exports);
20
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/value-objects/index.ts"],"names":[],"mappings":";;;AAEA,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/value-objects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,+CAA6B"}
@@ -2,7 +2,7 @@ import { Entity } from "../entities";
2
2
  import { BaseModel } from "../models";
3
3
  import { ValueObject } from "../value-objects";
4
4
  export interface AuthProvider<UserEntity extends Entity<ValueObject, BaseModel>> {
5
- authenticate(...args: any[]): Promise<void>;
5
+ authenticate(...args: any[]): Promise<string>;
6
6
  logout(): Promise<void>;
7
7
  isAuthenticated(): Promise<boolean>;
8
8
  currentUser(): Promise<UserEntity | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO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}
@@ -0,0 +1,2 @@
1
+ export { ValuesNotValid } from "./values-not-valid";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/value-objects/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare class ValuesNotValid extends Error {
2
+ readonly errors: Array<Error>;
3
+ constructor(errors: Array<Error>);
4
+ }
5
+ //# sourceMappingURL=values-not-valid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values-not-valid.d.ts","sourceRoot":"","sources":["../../../../src/value-objects/exceptions/values-not-valid.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;gBAElB,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC;CAKjC"}
@@ -7,4 +7,5 @@ export { PhoneValue } from "./phone-value";
7
7
  export { SlugValue } from "./slug-value";
8
8
  export { IntegerValue } from "./integer-value";
9
9
  export { CoordinatesValue } from "./coordinates-value";
10
+ export * from "./exceptions";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/value-objects/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/value-objects/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,cAAc,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schorts/shared-kernel",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "A modular, type-safe foundation for building expressive, maintainable applications. This package provides core abstractions for domain modeling, HTTP integration, authentication, state management, and more — designed to be framework-agnostic and highly extensible.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -3,7 +3,7 @@ import { BaseModel } from "../models";
3
3
  import { ValueObject } from "../value-objects";
4
4
 
5
5
  export interface AuthProvider<UserEntity extends Entity<ValueObject, BaseModel>> {
6
- authenticate(...args: any[]): Promise<void>;
6
+ authenticate(...args: any[]): Promise<string>;
7
7
  logout(): Promise<void>;
8
8
  isAuthenticated(): Promise<boolean>;
9
9
  currentUser(): Promise<UserEntity | null>;
@@ -0,0 +1 @@
1
+ export { ValuesNotValid } from "./values-not-valid";
@@ -0,0 +1,9 @@
1
+ export class ValuesNotValid extends Error {
2
+ readonly errors: Array<Error>;
3
+
4
+ constructor(errors: Array<Error>) {
5
+ super();
6
+
7
+ this.errors = errors;
8
+ }
9
+ }
@@ -8,3 +8,4 @@ export { PhoneValue } from "./phone-value";
8
8
  export { SlugValue } from "./slug-value";
9
9
  export { IntegerValue } from "./integer-value";
10
10
  export { CoordinatesValue } from "./coordinates-value";
11
+ export * from "./exceptions";