@schorts/shared-kernel 1.3.1 → 2.0.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/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
+ ## [2.0.0]
9
+
10
+ ### Changed
11
+
12
+ - Rename method `currentUser` to `getCurrentUser` on the `AuthProvider` interface.
13
+
14
+ ## [1.3.2]
15
+
16
+ ### Changed
17
+
18
+ - 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.
19
+
8
20
  ## [1.3.1] - 2025-10-04
9
21
 
10
22
  ### Added
@@ -2,10 +2,10 @@ 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
- currentUser(): Promise<UserEntity | null>;
8
+ getCurrentUser(): Promise<UserEntity | null>;
9
9
  onAuthChange(callback: (user: UserEntity | null) => void): () => void;
10
10
  }
11
11
  //# sourceMappingURL=auth-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,WAAW,YAAY,CAAC,UAAU,SAAS,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC;IAC7E,YAAY,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,WAAW,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC1C,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACvE"}
1
+ {"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,WAAW,YAAY,CAAC,UAAU,SAAS,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC;IAC7E,YAAY,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,cAAc,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC7C,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schorts/shared-kernel",
3
- "version": "1.3.1",
3
+ "version": "2.0.0",
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,9 +3,9 @@ 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
- currentUser(): Promise<UserEntity | null>;
9
+ getCurrentUser(): Promise<UserEntity | null>;
10
10
  onAuthChange(callback: (user: UserEntity | null) => void): () => void;
11
11
  }