@aifabrix/miso-client 3.8.1 → 3.9.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.md +67 -0
- package/dist/index.d.ts +31 -158
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -164
- package/dist/index.js.map +1 -1
- package/dist/services/application-context.service.d.ts +1 -1
- package/dist/services/application-context.service.d.ts.map +1 -1
- package/dist/services/application-context.service.js +9 -1
- package/dist/services/application-context.service.js.map +1 -1
- package/dist/services/auth-error-handler.d.ts +21 -0
- package/dist/services/auth-error-handler.d.ts.map +1 -0
- package/dist/services/auth-error-handler.js +68 -0
- package/dist/services/auth-error-handler.js.map +1 -0
- package/dist/services/auth.service.d.ts +0 -1
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +31 -298
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/browser-permission.service.d.ts +1 -5
- package/dist/services/browser-permission.service.d.ts.map +1 -1
- package/dist/services/browser-permission.service.js +8 -37
- package/dist/services/browser-permission.service.js.map +1 -1
- package/dist/services/browser-role.service.d.ts +1 -5
- package/dist/services/browser-role.service.d.ts.map +1 -1
- package/dist/services/browser-role.service.js +8 -43
- package/dist/services/browser-role.service.js.map +1 -1
- package/dist/services/logger/logger.service.d.ts +8 -80
- package/dist/services/logger/logger.service.d.ts.map +1 -1
- package/dist/services/logger/logger.service.js +8 -80
- package/dist/services/logger/logger.service.js.map +1 -1
- package/dist/services/token-validation.service.d.ts.map +1 -1
- package/dist/services/token-validation.service.js +11 -3
- package/dist/services/token-validation.service.js.map +1 -1
- package/dist/types/config.types.d.ts +2 -0
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/types/config.types.js.map +1 -1
- package/dist/types/filter-schema.types.d.ts +104 -0
- package/dist/types/filter-schema.types.d.ts.map +1 -0
- package/dist/types/filter-schema.types.js +40 -0
- package/dist/types/filter-schema.types.js.map +1 -0
- package/dist/types/filter.types.d.ts +1 -1
- package/dist/types/filter.types.d.ts.map +1 -1
- package/dist/types/filter.types.js.map +1 -1
- package/dist/types/token-validation.types.d.ts +5 -1
- package/dist/types/token-validation.types.d.ts.map +1 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +11 -0
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/controller-url-resolver.d.ts +33 -0
- package/dist/utils/controller-url-resolver.d.ts.map +1 -1
- package/dist/utils/controller-url-resolver.js +62 -0
- package/dist/utils/controller-url-resolver.js.map +1 -1
- package/dist/utils/data-client-auth.d.ts +5 -37
- package/dist/utils/data-client-auth.d.ts.map +1 -1
- package/dist/utils/data-client-auth.js +98 -377
- package/dist/utils/data-client-auth.js.map +1 -1
- package/dist/utils/data-client-init.d.ts +46 -0
- package/dist/utils/data-client-init.d.ts.map +1 -0
- package/dist/utils/data-client-init.js +128 -0
- package/dist/utils/data-client-init.js.map +1 -0
- package/dist/utils/data-client-oauth.d.ts +20 -0
- package/dist/utils/data-client-oauth.d.ts.map +1 -0
- package/dist/utils/data-client-oauth.js +138 -0
- package/dist/utils/data-client-oauth.js.map +1 -0
- package/dist/utils/data-client-permissions.d.ts +63 -0
- package/dist/utils/data-client-permissions.d.ts.map +1 -0
- package/dist/utils/data-client-permissions.js +123 -0
- package/dist/utils/data-client-permissions.js.map +1 -0
- package/dist/utils/data-client-request.d.ts +1 -1
- package/dist/utils/data-client-request.d.ts.map +1 -1
- package/dist/utils/data-client-request.js +27 -235
- package/dist/utils/data-client-request.js.map +1 -1
- package/dist/utils/data-client-response.d.ts +40 -0
- package/dist/utils/data-client-response.d.ts.map +1 -0
- package/dist/utils/data-client-response.js +144 -0
- package/dist/utils/data-client-response.js.map +1 -0
- package/dist/utils/data-client-roles.d.ts +63 -0
- package/dist/utils/data-client-roles.d.ts.map +1 -0
- package/dist/utils/data-client-roles.js +123 -0
- package/dist/utils/data-client-roles.js.map +1 -0
- package/dist/utils/data-client.d.ts +0 -185
- package/dist/utils/data-client.d.ts.map +1 -1
- package/dist/utils/data-client.js +66 -505
- package/dist/utils/data-client.js.map +1 -1
- package/dist/utils/filter-colon.utils.d.ts +26 -0
- package/dist/utils/filter-colon.utils.d.ts.map +1 -0
- package/dist/utils/filter-colon.utils.js +112 -0
- package/dist/utils/filter-colon.utils.js.map +1 -0
- package/dist/utils/filter-schema.utils.d.ts +84 -0
- package/dist/utils/filter-schema.utils.d.ts.map +1 -0
- package/dist/utils/filter-schema.utils.js +381 -0
- package/dist/utils/filter-schema.utils.js.map +1 -0
- package/dist/utils/filter.utils.d.ts +9 -85
- package/dist/utils/filter.utils.d.ts.map +1 -1
- package/dist/utils/filter.utils.js +79 -138
- package/dist/utils/filter.utils.js.map +1 -1
- package/dist/utils/http-error-handler.d.ts +22 -0
- package/dist/utils/http-error-handler.d.ts.map +1 -0
- package/dist/utils/http-error-handler.js +84 -0
- package/dist/utils/http-error-handler.js.map +1 -0
- package/dist/utils/http-response-validator.d.ts +15 -0
- package/dist/utils/http-response-validator.d.ts.map +1 -0
- package/dist/utils/http-response-validator.js +42 -0
- package/dist/utils/http-response-validator.js.map +1 -0
- package/dist/utils/internal-http-client.d.ts +4 -22
- package/dist/utils/internal-http-client.d.ts.map +1 -1
- package/dist/utils/internal-http-client.js +53 -337
- package/dist/utils/internal-http-client.js.map +1 -1
- package/dist/utils/token-utils.d.ts.map +1 -1
- package/dist/utils/token-utils.js +1 -29
- package/dist/utils/token-utils.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,73 @@ 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.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.9.0] - 2026-01-14
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Enhanced Filter System** - Comprehensive filter parsing, validation, and SQL compilation
|
|
13
|
+
- **Dual format parsing**: Support for both colon format (`status:eq:active`) and JSON format (`{"status":{"eq":"active"}}`)
|
|
14
|
+
- **Schema-based validation**: Define filterable fields, allowed operators, and value types per resource
|
|
15
|
+
- **Type coercion**: Automatic value validation and conversion for string, number, boolean, uuid, timestamp, and enum types
|
|
16
|
+
- **SQL compilation**: Generate PostgreSQL-safe parameterized WHERE clauses with `compileFilter()`
|
|
17
|
+
- **Human-readable errors**: RFC 7807 compliant structured error responses with error codes (UNKNOWN_FIELD, INVALID_OPERATOR, INVALID_TYPE, etc.)
|
|
18
|
+
- New `ilike` operator for case-insensitive pattern matching
|
|
19
|
+
- New types: `FilterSchema`, `FilterFieldDefinition`, `FilterError`, `CompiledFilter`
|
|
20
|
+
- New utilities: `validateFilter()`, `coerceValue()`, `compileFilter()`, `createFilterSchema()`
|
|
21
|
+
- Filter meta-schema for validating custom filter schemas (`src/schemas/filter.schema.json`)
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Code Size Compliance** - Refactored large files to comply with 500-line guideline
|
|
26
|
+
- `data-client.ts`: 995 → 416 lines (extracted to helper modules)
|
|
27
|
+
- `data-client-request.ts`: 683 → 280 lines
|
|
28
|
+
- `data-client-auth.ts`: 654 → 290 lines
|
|
29
|
+
- `internal-http-client.ts`: 741 → 496 lines
|
|
30
|
+
- `auth.service.ts`: 825 → 462 lines
|
|
31
|
+
- `index.ts`: 681 → 472 lines
|
|
32
|
+
- `logger.service.ts`: 597 → 480 lines
|
|
33
|
+
|
|
34
|
+
- **Console Logging Audit** - Cleaned up debug logging
|
|
35
|
+
- Removed 10 debug `console.log` statements from `token-utils.ts` that could expose sensitive token data
|
|
36
|
+
- All remaining console calls are appropriate error/warning logs or guarded by debug checks
|
|
37
|
+
|
|
38
|
+
### Technical
|
|
39
|
+
|
|
40
|
+
- **New filter utilities**: `src/utils/filter-schema.utils.ts` (497 lines), `src/utils/filter-colon.utils.ts` (119 lines)
|
|
41
|
+
- **New filter types**: `src/types/filter-schema.types.ts` (148 lines)
|
|
42
|
+
- **New helper modules** for DataClient refactoring:
|
|
43
|
+
- `data-client-init.ts` - Initialization logic
|
|
44
|
+
- `data-client-permissions.ts` - Permission helpers
|
|
45
|
+
- `data-client-roles.ts` - Role helpers
|
|
46
|
+
- `data-client-response.ts` - Response processing
|
|
47
|
+
- `data-client-oauth.ts` - OAuth callback handling
|
|
48
|
+
- **New HTTP helpers**: `http-error-handler.ts`, `http-response-validator.ts`
|
|
49
|
+
- **New auth helper**: `auth-error-handler.ts` - Centralized auth error formatting
|
|
50
|
+
- **New tests**: `filter-colon-format.test.ts` (178 lines), `filter-schema.utils.test.ts` (545 lines)
|
|
51
|
+
- **Documentation**: Updated `docs/reference-utilities.md` with filter system examples
|
|
52
|
+
|
|
53
|
+
## [3.8.2] - 2026-01-12
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- **Keycloak Separate Private/Public URL Support** - Separate URLs for JWKS fetching and issuer validation
|
|
58
|
+
- New `authServerPrivateUrl` configuration option for server-side JWKS fetching (internal network)
|
|
59
|
+
- New `authServerPublicUrl` configuration option for browser-side and issuer validation (public network)
|
|
60
|
+
- New `resolveKeycloakUrl()` utility function that automatically detects environment and selects appropriate URL
|
|
61
|
+
- `validateTokenLocal()` now uses private URL for JWKS fetching on server, public URL for issuer validation
|
|
62
|
+
- Environment variable support: `KEYCLOAK_SERVER_URL` (maps to `authServerPrivateUrl`), `KEYCLOAK_PUBLIC_SERVER_URL` (maps to `authServerPublicUrl`)
|
|
63
|
+
- Maintains backward compatibility with existing `authServerUrl` configuration
|
|
64
|
+
|
|
65
|
+
### Technical
|
|
66
|
+
|
|
67
|
+
- **TokenValidationService** - Now uses `resolveKeycloakUrl()` for automatic URL resolution
|
|
68
|
+
- JWKS URI construction uses resolved URL (private on server, public on browser)
|
|
69
|
+
- Issuer validation always uses public URL (matches token's `iss` claim)
|
|
70
|
+
- `determineTokenType()` updated to use public URL for issuer matching
|
|
71
|
+
- **controller-url-resolver.ts** - Added `resolveKeycloakUrl()` function (mirrors `resolveControllerUrl()` pattern)
|
|
72
|
+
- **config-loader.ts** - Added Keycloak environment variable support
|
|
73
|
+
- **Tests**: Comprehensive tests for `resolveKeycloakUrl()` and updated TokenValidationService tests
|
|
74
|
+
|
|
8
75
|
## [3.8.1] - 2026-01-10
|
|
9
76
|
|
|
10
77
|
### Changed
|
package/dist/index.d.ts
CHANGED
|
@@ -50,165 +50,58 @@ export declare class MisoClient {
|
|
|
50
50
|
* @returns Validation result with valid flag and optional error message
|
|
51
51
|
*/
|
|
52
52
|
validateOrigin(req: Request, allowedOrigins?: string[]): OriginValidationResult;
|
|
53
|
-
/**
|
|
54
|
-
* Get environment token using client credentials
|
|
55
|
-
* This is called automatically by HttpClient but can be called manually
|
|
56
|
-
*/
|
|
53
|
+
/** Get environment token using client credentials */
|
|
57
54
|
getEnvironmentToken(): Promise<string>;
|
|
58
|
-
/**
|
|
59
|
-
* Initiate login flow by calling controller
|
|
60
|
-
* Returns the login URL and state for browser redirect or manual navigation
|
|
61
|
-
*
|
|
62
|
-
* Important: Your application only needs to know about your own app URLs and the miso-controller.
|
|
63
|
-
* The miso-controller manages all authentication flows internally, including OAuth callbacks with Keycloak.
|
|
64
|
-
* You don't need to handle OAuth callbacks in your application.
|
|
65
|
-
*
|
|
66
|
-
* @param params - Login parameters
|
|
67
|
-
* @param params.redirect - Required final destination URL in your application where the user should be redirected after successful authentication. This is a URL in your app (e.g., 'https://myapp.com/dashboard'). The miso-controller handles the OAuth callback internally and then redirects the user to this URL.
|
|
68
|
-
* @param params.state - Optional CSRF protection token (auto-generated by controller if omitted)
|
|
69
|
-
* @returns Login response with loginUrl (the Keycloak authentication URL) and state
|
|
70
|
-
*/
|
|
55
|
+
/** Initiate login flow - returns login URL for browser redirect */
|
|
71
56
|
login(params: {
|
|
72
57
|
redirect: string;
|
|
73
58
|
state?: string;
|
|
74
59
|
}): Promise<import("./types/config.types").LoginResponse>;
|
|
75
|
-
/**
|
|
76
|
-
* Validate token with controller
|
|
77
|
-
* @param token - User authentication token
|
|
78
|
-
* @param authStrategy - Optional authentication strategy override
|
|
79
|
-
*/
|
|
60
|
+
/** Validate token with controller */
|
|
80
61
|
validateToken(token: string, authStrategy?: AuthStrategy): Promise<boolean>;
|
|
81
|
-
/**
|
|
82
|
-
* Get user information from token
|
|
83
|
-
* @param token - User authentication token
|
|
84
|
-
* @param authStrategy - Optional authentication strategy override
|
|
85
|
-
*/
|
|
62
|
+
/** Get user information from token */
|
|
86
63
|
getUser(token: string, authStrategy?: AuthStrategy): Promise<UserInfo | null>;
|
|
87
|
-
/**
|
|
88
|
-
* Get user information from GET /api/v1/auth/user endpoint
|
|
89
|
-
* @param token - User authentication token
|
|
90
|
-
* @param authStrategy - Optional authentication strategy override
|
|
91
|
-
*/
|
|
64
|
+
/** Get user information from GET /api/v1/auth/user endpoint */
|
|
92
65
|
getUserInfo(token: string, authStrategy?: AuthStrategy): Promise<UserInfo | null>;
|
|
93
|
-
/**
|
|
94
|
-
* Check if user is authenticated
|
|
95
|
-
* @param token - User authentication token
|
|
96
|
-
* @param authStrategy - Optional authentication strategy override
|
|
97
|
-
*/
|
|
66
|
+
/** Check if user is authenticated */
|
|
98
67
|
isAuthenticated(token: string, authStrategy?: AuthStrategy): Promise<boolean>;
|
|
99
|
-
/**
|
|
100
|
-
* Logout user
|
|
101
|
-
* @param params - Logout parameters
|
|
102
|
-
* @param params.token - Access token to invalidate
|
|
103
|
-
* @returns Logout response with success message
|
|
104
|
-
*/
|
|
68
|
+
/** Logout user */
|
|
105
69
|
logout(params: {
|
|
106
70
|
token: string;
|
|
107
71
|
}): Promise<import("./types/config.types").LogoutResponse>;
|
|
108
|
-
/**
|
|
109
|
-
* Refresh user access token using refresh token
|
|
110
|
-
* @param refreshToken - Refresh token to exchange for new access token
|
|
111
|
-
* @param authStrategy - Optional authentication strategy override
|
|
112
|
-
* @returns New access token, refresh token, and expiration info, or null on error
|
|
113
|
-
*/
|
|
72
|
+
/** Refresh user access token using refresh token */
|
|
114
73
|
refreshToken(refreshToken: string, authStrategy?: AuthStrategy): Promise<import("./types/config.types").RefreshTokenResponse | null>;
|
|
115
|
-
/**
|
|
116
|
-
* Validate token locally using JWKS (no API call to controller)
|
|
117
|
-
* Results are cached for 1 minute, JWKS keys cached for 1 hour
|
|
118
|
-
* @param token - JWT token to validate
|
|
119
|
-
* @param options - Validation options (skipResultCache for high-security)
|
|
120
|
-
* @returns Validation result with payload or error
|
|
121
|
-
*/
|
|
74
|
+
/** Validate token locally using JWKS (no API call) */
|
|
122
75
|
validateTokenLocal(token: string, options?: TokenValidationOptions): Promise<TokenValidationResult>;
|
|
123
|
-
/**
|
|
124
|
-
* Set or update Keycloak configuration for local validation
|
|
125
|
-
* @param config - Keycloak configuration
|
|
126
|
-
*/
|
|
76
|
+
/** Set or update Keycloak configuration for local validation */
|
|
127
77
|
setKeycloakConfig(config: KeycloakConfig): void;
|
|
128
|
-
/**
|
|
129
|
-
* Clear JWKS cache (useful for key rotation scenarios)
|
|
130
|
-
* @param jwksUri - Specific URI to clear, or all if not provided
|
|
131
|
-
*/
|
|
78
|
+
/** Clear JWKS cache */
|
|
132
79
|
clearJwksCache(jwksUri?: string): void;
|
|
133
|
-
/**
|
|
134
|
-
* Clear validation result cache
|
|
135
|
-
*/
|
|
80
|
+
/** Clear validation result cache */
|
|
136
81
|
clearValidationCache(): void;
|
|
137
|
-
/**
|
|
138
|
-
* Clear all token validation caches (JWKS + results)
|
|
139
|
-
*/
|
|
82
|
+
/** Clear all token validation caches (JWKS + results) */
|
|
140
83
|
clearAllTokenCaches(): void;
|
|
141
|
-
/**
|
|
142
|
-
* Get user roles (cached in Redis if available)
|
|
143
|
-
* @param token - User authentication token
|
|
144
|
-
* @param authStrategy - Optional authentication strategy override
|
|
145
|
-
*/
|
|
84
|
+
/** Get user roles (cached if Redis available) */
|
|
146
85
|
getRoles(token: string, authStrategy?: AuthStrategy): Promise<string[]>;
|
|
147
|
-
/**
|
|
148
|
-
* Check if user has specific role
|
|
149
|
-
* @param token - User authentication token
|
|
150
|
-
* @param role - Role to check
|
|
151
|
-
* @param authStrategy - Optional authentication strategy override
|
|
152
|
-
*/
|
|
86
|
+
/** Check if user has specific role */
|
|
153
87
|
hasRole(token: string, role: string, authStrategy?: AuthStrategy): Promise<boolean>;
|
|
154
|
-
/**
|
|
155
|
-
* Check if user has any of the specified roles
|
|
156
|
-
* @param token - User authentication token
|
|
157
|
-
* @param roles - Roles to check
|
|
158
|
-
* @param authStrategy - Optional authentication strategy override
|
|
159
|
-
*/
|
|
88
|
+
/** Check if user has any of the specified roles */
|
|
160
89
|
hasAnyRole(token: string, roles: string[], authStrategy?: AuthStrategy): Promise<boolean>;
|
|
161
|
-
/**
|
|
162
|
-
* Check if user has all of the specified roles
|
|
163
|
-
* @param token - User authentication token
|
|
164
|
-
* @param roles - Roles to check
|
|
165
|
-
* @param authStrategy - Optional authentication strategy override
|
|
166
|
-
*/
|
|
90
|
+
/** Check if user has all of the specified roles */
|
|
167
91
|
hasAllRoles(token: string, roles: string[], authStrategy?: AuthStrategy): Promise<boolean>;
|
|
168
|
-
/**
|
|
169
|
-
* Force refresh roles from controller (bypass cache)
|
|
170
|
-
* @param token - User authentication token
|
|
171
|
-
* @param authStrategy - Optional authentication strategy override
|
|
172
|
-
*/
|
|
92
|
+
/** Force refresh roles from controller (bypass cache) */
|
|
173
93
|
refreshRoles(token: string, authStrategy?: AuthStrategy): Promise<string[]>;
|
|
174
|
-
/**
|
|
175
|
-
* Get user permissions (cached in Redis if available)
|
|
176
|
-
* @param token - User authentication token
|
|
177
|
-
* @param authStrategy - Optional authentication strategy override
|
|
178
|
-
*/
|
|
94
|
+
/** Get user permissions (cached if Redis available) */
|
|
179
95
|
getPermissions(token: string, authStrategy?: AuthStrategy): Promise<string[]>;
|
|
180
|
-
/**
|
|
181
|
-
* Check if user has specific permission
|
|
182
|
-
* @param token - User authentication token
|
|
183
|
-
* @param permission - Permission to check
|
|
184
|
-
* @param authStrategy - Optional authentication strategy override
|
|
185
|
-
*/
|
|
96
|
+
/** Check if user has specific permission */
|
|
186
97
|
hasPermission(token: string, permission: string, authStrategy?: AuthStrategy): Promise<boolean>;
|
|
187
|
-
/**
|
|
188
|
-
* Check if user has any of the specified permissions
|
|
189
|
-
* @param token - User authentication token
|
|
190
|
-
* @param permissions - Permissions to check
|
|
191
|
-
* @param authStrategy - Optional authentication strategy override
|
|
192
|
-
*/
|
|
98
|
+
/** Check if user has any of the specified permissions */
|
|
193
99
|
hasAnyPermission(token: string, permissions: string[], authStrategy?: AuthStrategy): Promise<boolean>;
|
|
194
|
-
/**
|
|
195
|
-
* Check if user has all of the specified permissions
|
|
196
|
-
* @param token - User authentication token
|
|
197
|
-
* @param permissions - Permissions to check
|
|
198
|
-
* @param authStrategy - Optional authentication strategy override
|
|
199
|
-
*/
|
|
100
|
+
/** Check if user has all of the specified permissions */
|
|
200
101
|
hasAllPermissions(token: string, permissions: string[], authStrategy?: AuthStrategy): Promise<boolean>;
|
|
201
|
-
/**
|
|
202
|
-
* Force refresh permissions from controller (bypass cache)
|
|
203
|
-
* @param token - User authentication token
|
|
204
|
-
* @param authStrategy - Optional authentication strategy override
|
|
205
|
-
*/
|
|
102
|
+
/** Force refresh permissions from controller (bypass cache) */
|
|
206
103
|
refreshPermissions(token: string, authStrategy?: AuthStrategy): Promise<string[]>;
|
|
207
|
-
/**
|
|
208
|
-
* Clear cached permissions for a user
|
|
209
|
-
* @param token - User authentication token
|
|
210
|
-
* @param authStrategy - Optional authentication strategy override
|
|
211
|
-
*/
|
|
104
|
+
/** Clear cached permissions for a user */
|
|
212
105
|
clearPermissionsCache(token: string, authStrategy?: AuthStrategy): Promise<void>;
|
|
213
106
|
/**
|
|
214
107
|
* Get logger service for application logging
|
|
@@ -222,40 +115,19 @@ export declare class MisoClient {
|
|
|
222
115
|
* Get current configuration
|
|
223
116
|
*/
|
|
224
117
|
getConfig(): MisoClientConfig;
|
|
225
|
-
/**
|
|
226
|
-
* Check if Redis is connected
|
|
227
|
-
*/
|
|
118
|
+
/** Check if Redis is connected */
|
|
228
119
|
isRedisConnected(): boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Make request with authentication strategy
|
|
231
|
-
* Tries authentication methods in priority order based on strategy
|
|
232
|
-
* @param method - HTTP method
|
|
233
|
-
* @param url - Request URL
|
|
234
|
-
* @param authStrategy - Authentication strategy configuration
|
|
235
|
-
* @param data - Optional request data
|
|
236
|
-
* @param config - Optional Axios request config
|
|
237
|
-
* @returns Response data
|
|
238
|
-
*/
|
|
120
|
+
/** Make request with authentication strategy */
|
|
239
121
|
requestWithAuthStrategy<T>(method: "GET" | "POST" | "PUT" | "DELETE", url: string, authStrategy: AuthStrategy, data?: unknown, config?: import("axios").AxiosRequestConfig): Promise<T>;
|
|
240
|
-
/**
|
|
241
|
-
* Create authentication strategy helper
|
|
242
|
-
* @param methods - Array of authentication methods in priority order
|
|
243
|
-
* @param bearerToken - Optional bearer token
|
|
244
|
-
* @param apiKey - Optional API key
|
|
245
|
-
* @returns Authentication strategy
|
|
246
|
-
*/
|
|
122
|
+
/** Create authentication strategy helper */
|
|
247
123
|
createAuthStrategy(methods: ("bearer" | "client-token" | "client-credentials" | "api-key")[], bearerToken?: string, apiKey?: string): AuthStrategy;
|
|
248
|
-
/**
|
|
249
|
-
* Get default authentication strategy
|
|
250
|
-
* Uses bearer token and client token in that order
|
|
251
|
-
* @param bearerToken - Optional bearer token
|
|
252
|
-
* @returns Default authentication strategy
|
|
253
|
-
*/
|
|
124
|
+
/** Get default authentication strategy */
|
|
254
125
|
getDefaultAuthStrategy(bearerToken?: string): AuthStrategy;
|
|
255
126
|
}
|
|
256
127
|
export * from "./types/config.types";
|
|
257
128
|
export * from "./types/pagination.types";
|
|
258
129
|
export * from "./types/filter.types";
|
|
130
|
+
export * from "./types/filter-schema.types";
|
|
259
131
|
export * from "./types/sort.types";
|
|
260
132
|
export type { ErrorResponse as ErrorResponseFromErrors, ErrorEnvelope, } from "./types/errors.types";
|
|
261
133
|
export { AuthService } from "./services/auth.service";
|
|
@@ -276,13 +148,14 @@ export { getEnvironmentToken } from "./utils/environment-token";
|
|
|
276
148
|
export { extractClientTokenInfo } from "./utils/token-utils";
|
|
277
149
|
export type { ClientTokenInfo } from "./utils/token-utils";
|
|
278
150
|
export type { OriginValidationResult } from "./utils/origin-validator";
|
|
279
|
-
export { resolveControllerUrl, isBrowser, validateUrl } from "./utils/controller-url-resolver";
|
|
151
|
+
export { resolveControllerUrl, resolveKeycloakUrl, isBrowser, validateUrl } from "./utils/controller-url-resolver";
|
|
280
152
|
export { extractLoggingContext } from "./utils/logging-helpers";
|
|
281
153
|
export type { IndexedLoggingContext, HasKey, HasExternalSystem } from "./utils/logging-helpers";
|
|
282
154
|
export { extractRequestContext } from "./utils/request-context";
|
|
283
155
|
export type { RequestContext } from "./utils/request-context";
|
|
284
156
|
export * from "./utils/pagination.utils";
|
|
285
157
|
export * from "./utils/filter.utils";
|
|
158
|
+
export * from "./utils/filter-schema.utils";
|
|
286
159
|
export * from "./utils/sort.utils";
|
|
287
160
|
export { MisoClientError, ApiErrorException, transformError, handleApiError, } from "./utils/errors";
|
|
288
161
|
export { ResponseHelper, PaginationMeta, injectResponseHelpers, asyncHandler, asyncHandlerNamed, ValidationHelper, AppError, ApiError, ValidationError, ApiResponse, createSuccessResponse, createErrorResponse, ErrorLogger, setErrorLogger, handleRouteError, RBACErrorExtensions, getErrorTypeUri, getErrorTitle, sendErrorResponse, EncryptionUtil, createClientTokenEndpoint, hasConfig, loggerContextMiddleware, } from "./express";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0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