@mudrichenkoevgeny/shared-foundation 0.0.47 → 0.0.49

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.
Files changed (5) hide show
  1. package/README.md +4 -1
  2. package/index.d.ts +1083 -52
  3. package/index.js +1311 -17
  4. package/index.mjs +1311 -17
  5. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mudrichenkoevgeny/shared-foundation
2
2
 
3
- TypeScript & Zod contracts, API routes, error codes, permission models, and branded types generated directly from the [shared-foundation](https://github.com/mudrichenkoevgeny/shared-foundation) Kotlin Multiplatform (KMP) repository.
3
+ TypeScript & Zod contracts, API routes, error codes, permission models, runtime enums, and branded types generated directly from the [shared-foundation](https://github.com/mudrichenkoevgeny/shared-foundation) Kotlin Multiplatform (KMP) repository.
4
4
 
5
5
  Provides a single source of truth (SSOT) between Kotlin Backend/KMP services and TypeScript/React web applications.
6
6
 
@@ -20,9 +20,12 @@ yarn add @mudrichenkoevgeny/shared-foundation zod
20
20
  ## Features
21
21
 
22
22
  - **Zod Schemas**: Auto-generated `z.ZodType` validation schemas for all Request payloads and Response DTOs (`loginByEmailRequestSchema`, `apiErrorResponseSchema`, `userDetailsPayloadSchema`).
23
+ - **Runtime Enums**: TS types & runtime JS objects for all enums and string unions (`UserAuthProvider`, `UserRole`, `UserAccountStatus`, `AccountLockoutType`, `ClientType`, `SortOrder`, `UserSortValues`, etc.).
23
24
  - **Route Constants**: Strongly typed API endpoint routes (`ManagementSecuritySettingsRoutes`, `OpenLoginRoutes`, `SelfManagementUserRoutes`).
24
25
  - **Error & Permission Codes**: Literal string definitions for all application error codes (`SecurityErrorCodes`, `CommonErrorCodes`) and permission strings (`SecurityPermissionCode`, `UserPermissionCode`).
25
26
  - **Branded Types & Helpers**: Type-safe domain identifiers (`UserId`, `PermissionCode`, `UserSessionId`, `UserIdentifierId`, `AuditEventId`, `ClientDeviceId`) with converter helpers (`toUserIdOrThrow`, `toPermissionCodeOrNull`).
27
+ - **Domain Models & Mappers**: Fully typed TS domain models (`UserSession`, `UserDetails`, `ClientDeviceInfo`) and their runtime mappers from/to API payloads (`toUserSession`, `toUserSessionPayload`).
28
+ - **Composite Parsers**: Helper classes for runtime parsing of polymorphic values (`CompositeAuditActionTypeParser`, `CompositeAuditMetadataKeyParser`, `CompositeAuditResourceTypeParser`).
26
29
 
27
30
  ## Quick Usage Example
28
31