@intellegens/cornerstone-client 0.0.26 → 0.0.28
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/README.md +51 -11
- package/data/api/dto/ReadSelectedDefinitionDto.d.ts +18 -0
- package/data/api/dto/{ReadSelectedFilteringDefinition.d.ts → ReadSelectedFilteringDefinitionDto.d.ts} +3 -3
- package/data/api/dto/{ReadSelectedFilteringPropertyDefinition.d.ts → ReadSelectedFilteringPropertyDefinitionDto.d.ts} +1 -1
- package/data/api/dto/ReadSelectedOrderingDefinitionDto.d.ts +7 -0
- package/data/api/dto/{ReadSelectedOrderingPropertyDefinition.d.ts → ReadSelectedOrderingPropertyDefinitionDto.d.ts} +1 -1
- package/data/api/dto/{ReadSelectedPaginationDefinition.d.ts → ReadSelectedPaginationDefinitionDto.d.ts} +1 -1
- package/data/api/dto/index.d.ts +6 -6
- package/data/api/dto/index.js +6 -6
- package/data/auth/{Claim/index.d.ts → dto/ClaimDto.d.ts} +1 -1
- package/data/auth/dto/RegisterRequestDto.d.ts +4 -0
- package/data/auth/dto/RoleDto.d.ts +5 -0
- package/data/auth/dto/SignInRequestDto.d.ts +4 -0
- package/data/auth/dto/TokensDto.d.ts +4 -0
- package/data/auth/dto/TokensDto.js +1 -0
- package/data/auth/{User/index.d.ts → dto/UserDto.d.ts} +4 -4
- package/data/auth/dto/UserDto.js +1 -0
- package/data/auth/{UserInfo/index.d.ts → dto/UserInfoDto.d.ts} +3 -3
- package/data/auth/dto/UserInfoDto.js +1 -0
- package/data/auth/dto/index.d.ts +4 -0
- package/data/auth/dto/index.js +4 -0
- package/data/auth/index.d.ts +1 -4
- package/data/auth/index.js +1 -4
- package/data/index.d.ts +0 -1
- package/data/index.js +0 -1
- package/package.json +13 -7
- package/services/api/ApiCrudControllerClient/index.d.ts +9 -2
- package/services/api/ApiCrudControllerClient/index.js +15 -5
- package/services/api/ApiInitializationService/index.d.ts +11 -1
- package/services/api/ApiInitializationService/index.js +19 -4
- package/services/api/ApiReadControllerClient/index.d.ts +10 -3
- package/services/api/ApiReadControllerClient/index.js +18 -5
- package/services/api/HttpService/AngularHttpService.d.ts +9 -0
- package/services/api/HttpService/AngularHttpService.js +86 -0
- package/services/api/HttpService/AxiosHttpService.d.ts +10 -0
- package/services/api/HttpService/AxiosHttpService.js +53 -0
- package/services/api/HttpService/FetchHttpService.d.ts +7 -0
- package/services/api/HttpService/FetchHttpService.js +28 -0
- package/services/api/HttpService/HttpRequestConfig.d.ts +9 -0
- package/services/api/HttpService/HttpRequestConfig.js +1 -0
- package/services/api/HttpService/HttpResponse.d.ts +11 -0
- package/services/api/HttpService/HttpResponse.js +3 -0
- package/services/api/HttpService/IHttpService.d.ts +13 -0
- package/services/api/HttpService/IHttpService.js +3 -0
- package/services/api/HttpService/index.d.ts +11 -0
- package/services/api/HttpService/index.js +12 -0
- package/services/api/UserManagementControllerClient/index.d.ts +10 -3
- package/services/api/UserManagementControllerClient/index.js +18 -5
- package/services/api/index.d.ts +1 -0
- package/services/api/index.js +1 -0
- package/services/auth/client/AuthService/index.d.ts +3 -3
- package/services/auth/client/AuthorizationManagementControllerClient/index.d.ts +4 -4
- package/services/auth/client/AuthorizationManagementControllerClient/index.js +1 -1
- package/data/_generated/Cornerstone/Auth/API/DTOs/RegisterRequestDto.d.ts +0 -12
- package/data/_generated/Cornerstone/Auth/API/DTOs/RegisterRequestDto.js +0 -2
- package/data/_generated/Cornerstone/Auth/API/DTOs/SignInRequestDto.d.ts +0 -12
- package/data/_generated/Cornerstone/Auth/API/DTOs/SignInRequestDto.js +0 -2
- package/data/_generated/Cornerstone/Auth/API/DTOs/TokensDto.d.ts +0 -12
- package/data/_generated/Cornerstone/Auth/API/DTOs/TokensDto.js +0 -2
- package/data/_generated/cache.d.ts +0 -3
- package/data/_generated/cache.js +0 -2
- package/data/_generated/index.d.ts +0 -3
- package/data/_generated/index.js +0 -3
- package/data/api/dto/ReadSelectedDefinition.d.ts +0 -18
- package/data/api/dto/ReadSelectedOrderingDefinition.d.ts +0 -7
- package/data/auth/Role/index.d.ts +0 -5
- /package/data/api/dto/{ReadSelectedDefinition.js → ReadSelectedDefinitionDto.js} +0 -0
- /package/data/api/dto/{ReadSelectedFilteringDefinition.js → ReadSelectedFilteringDefinitionDto.js} +0 -0
- /package/data/api/dto/{ReadSelectedFilteringPropertyDefinition.js → ReadSelectedFilteringPropertyDefinitionDto.js} +0 -0
- /package/data/api/dto/{ReadSelectedOrderingDefinition.js → ReadSelectedOrderingDefinitionDto.js} +0 -0
- /package/data/api/dto/{ReadSelectedOrderingPropertyDefinition.js → ReadSelectedOrderingPropertyDefinitionDto.js} +0 -0
- /package/data/api/dto/{ReadSelectedPaginationDefinition.js → ReadSelectedPaginationDefinitionDto.js} +0 -0
- /package/data/auth/{Claim/index.js → dto/ClaimDto.js} +0 -0
- /package/data/auth/{Role/index.js → dto/RegisterRequestDto.js} +0 -0
- /package/data/auth/{User/index.js → dto/RoleDto.js} +0 -0
- /package/data/auth/{UserInfo/index.js → dto/SignInRequestDto.js} +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Ignore eslint any error in this file
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
/**
|
|
4
|
+
* Angular HttpClient-based HTTP service implementation
|
|
5
|
+
*/
|
|
6
|
+
export class AngularHttpService {
|
|
7
|
+
httpClient;
|
|
8
|
+
constructor(httpClient) {
|
|
9
|
+
if (!httpClient) {
|
|
10
|
+
throw new Error('Angular HttpClient instance is required');
|
|
11
|
+
}
|
|
12
|
+
this.httpClient = httpClient;
|
|
13
|
+
}
|
|
14
|
+
async request(url, config) {
|
|
15
|
+
try {
|
|
16
|
+
const method = config?.method || 'GET';
|
|
17
|
+
const headers = config?.headers || {};
|
|
18
|
+
const body = config?.body;
|
|
19
|
+
const withCredentials = config?.credentials === 'include';
|
|
20
|
+
const options = {
|
|
21
|
+
headers,
|
|
22
|
+
withCredentials,
|
|
23
|
+
observe: 'response',
|
|
24
|
+
responseType: 'json',
|
|
25
|
+
};
|
|
26
|
+
let response;
|
|
27
|
+
switch (method.toUpperCase()) {
|
|
28
|
+
case 'GET':
|
|
29
|
+
response = await this.httpClient.get(url, options).toPromise();
|
|
30
|
+
break;
|
|
31
|
+
case 'POST':
|
|
32
|
+
response = await this.httpClient.post(url, body ? JSON.parse(body) : null, options).toPromise();
|
|
33
|
+
break;
|
|
34
|
+
case 'PUT':
|
|
35
|
+
response = await this.httpClient.put(url, body ? JSON.parse(body) : null, options).toPromise();
|
|
36
|
+
break;
|
|
37
|
+
case 'DELETE':
|
|
38
|
+
response = await this.httpClient.delete(url, options).toPromise();
|
|
39
|
+
break;
|
|
40
|
+
case 'PATCH':
|
|
41
|
+
response = await this.httpClient.patch(url, body ? JSON.parse(body) : null, options).toPromise();
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(`Unsupported HTTP method: ${method}`);
|
|
45
|
+
}
|
|
46
|
+
// Convert Angular HttpResponse headers to plain object
|
|
47
|
+
const responseHeaders = {};
|
|
48
|
+
if (response.headers) {
|
|
49
|
+
response.headers.keys().forEach((key) => {
|
|
50
|
+
responseHeaders[key] = response.headers.get(key);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
ok: response.status >= 200 && response.status < 300,
|
|
55
|
+
status: response.status,
|
|
56
|
+
statusText: response.statusText || 'OK',
|
|
57
|
+
headers: responseHeaders,
|
|
58
|
+
json: async () => response.body,
|
|
59
|
+
text: async () => (typeof response.body === 'string' ? response.body : JSON.stringify(response.body)),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error.status !== undefined) {
|
|
64
|
+
// Angular HttpErrorResponse
|
|
65
|
+
const errorHeaders = {};
|
|
66
|
+
if (error.headers) {
|
|
67
|
+
error.headers.keys().forEach((key) => {
|
|
68
|
+
errorHeaders[key] = error.headers.get(key);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
ok: false,
|
|
73
|
+
status: error.status,
|
|
74
|
+
statusText: error.statusText || 'Error',
|
|
75
|
+
headers: errorHeaders,
|
|
76
|
+
json: async () => error.error,
|
|
77
|
+
text: async () => (typeof error.error === 'string' ? error.error : JSON.stringify(error.error)),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Other errors
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IHttpService, HttpRequestConfig, HttpResponse } from './index';
|
|
2
|
+
/**
|
|
3
|
+
* Axios-based HTTP service implementation
|
|
4
|
+
* Note: This requires axios to be installed as a dependency
|
|
5
|
+
*/
|
|
6
|
+
export declare class AxiosHttpService implements IHttpService {
|
|
7
|
+
private readonly axios;
|
|
8
|
+
constructor(axiosInstance?: any);
|
|
9
|
+
request<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Ignore eslint any error in this file
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
/**
|
|
4
|
+
* Axios-based HTTP service implementation
|
|
5
|
+
* Note: This requires axios to be installed as a dependency
|
|
6
|
+
*/
|
|
7
|
+
export class AxiosHttpService {
|
|
8
|
+
axios;
|
|
9
|
+
constructor(axiosInstance) {
|
|
10
|
+
if (!axiosInstance) {
|
|
11
|
+
throw new Error('Axios instance is required');
|
|
12
|
+
}
|
|
13
|
+
this.axios = axiosInstance;
|
|
14
|
+
}
|
|
15
|
+
async request(url, config) {
|
|
16
|
+
try {
|
|
17
|
+
const axiosConfig = {
|
|
18
|
+
url,
|
|
19
|
+
method: config?.method || 'GET',
|
|
20
|
+
headers: config?.headers,
|
|
21
|
+
data: config?.body,
|
|
22
|
+
withCredentials: config?.credentials === 'include',
|
|
23
|
+
};
|
|
24
|
+
const response = await this.axios(axiosConfig);
|
|
25
|
+
return {
|
|
26
|
+
ok: response.status >= 200 && response.status < 300,
|
|
27
|
+
status: response.status,
|
|
28
|
+
statusText: response.statusText,
|
|
29
|
+
headers: response.headers,
|
|
30
|
+
json: async () => response.data,
|
|
31
|
+
text: async () => (typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error.response) {
|
|
36
|
+
// The request was made and the server responded with a status code
|
|
37
|
+
// that falls out of the range of 2xx
|
|
38
|
+
return {
|
|
39
|
+
ok: false,
|
|
40
|
+
status: error.response.status,
|
|
41
|
+
statusText: error.response.statusText,
|
|
42
|
+
headers: error.response.headers,
|
|
43
|
+
json: async () => error.response.data,
|
|
44
|
+
text: async () => (typeof error.response.data === 'string' ? error.response.data : JSON.stringify(error.response.data)),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// Something happened in setting up the request that triggered an Error
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpRequestConfig, HttpResponse, IHttpService } from '../../../services';
|
|
2
|
+
/**
|
|
3
|
+
* Default HTTP service implementation using the Fetch API
|
|
4
|
+
*/
|
|
5
|
+
export declare class FetchHttpService implements IHttpService {
|
|
6
|
+
request<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Ignore eslint any error in this file
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
/**
|
|
4
|
+
* Default HTTP service implementation using the Fetch API
|
|
5
|
+
*/
|
|
6
|
+
export class FetchHttpService {
|
|
7
|
+
async request(url, config) {
|
|
8
|
+
const response = await fetch(url, {
|
|
9
|
+
method: config?.method || 'GET',
|
|
10
|
+
headers: config?.headers,
|
|
11
|
+
body: config?.body,
|
|
12
|
+
credentials: config?.credentials || 'include',
|
|
13
|
+
});
|
|
14
|
+
// Convert Headers to a plain object
|
|
15
|
+
const headers = {};
|
|
16
|
+
response.headers.forEach((value, key) => {
|
|
17
|
+
headers[key] = value;
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
ok: response.ok,
|
|
21
|
+
status: response.status,
|
|
22
|
+
statusText: response.statusText,
|
|
23
|
+
headers,
|
|
24
|
+
json: () => response.json(),
|
|
25
|
+
text: () => response.text(),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpRequestConfig, HttpResponse } from '../../../services';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract HTTP service interface that can be implemented by different HTTP clients
|
|
4
|
+
*/
|
|
5
|
+
export interface IHttpService {
|
|
6
|
+
/**
|
|
7
|
+
* Performs an HTTP request
|
|
8
|
+
* @param url - The URL to make the request to
|
|
9
|
+
* @param config - Request configuration
|
|
10
|
+
* @returns Promise that resolves to the HTTP response
|
|
11
|
+
*/
|
|
12
|
+
request<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FetchHttpService } from './FetchHttpService';
|
|
2
|
+
/**
|
|
3
|
+
* Default HTTP service instance
|
|
4
|
+
*/
|
|
5
|
+
export declare const defaultHttpService: FetchHttpService;
|
|
6
|
+
export * from './AxiosHttpService';
|
|
7
|
+
export * from './AngularHttpService';
|
|
8
|
+
export * from './FetchHttpService';
|
|
9
|
+
export * from './HttpRequestConfig';
|
|
10
|
+
export * from './HttpResponse';
|
|
11
|
+
export * from './IHttpService';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FetchHttpService } from './FetchHttpService';
|
|
2
|
+
/**
|
|
3
|
+
* Default HTTP service instance
|
|
4
|
+
*/
|
|
5
|
+
export const defaultHttpService = new FetchHttpService();
|
|
6
|
+
// Export additional HTTP service implementations
|
|
7
|
+
export * from './AxiosHttpService';
|
|
8
|
+
export * from './AngularHttpService';
|
|
9
|
+
export * from './FetchHttpService';
|
|
10
|
+
export * from './HttpRequestConfig';
|
|
11
|
+
export * from './HttpResponse';
|
|
12
|
+
export * from './IHttpService';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ApiCrudControllerClient } from '
|
|
2
|
-
import {
|
|
1
|
+
import { ApiCrudControllerClient } from '../ApiCrudControllerClient';
|
|
2
|
+
import { IHttpService } from '../HttpService';
|
|
3
|
+
import { UserDto } from '../../../data';
|
|
3
4
|
/**
|
|
4
5
|
* Client for user management operations
|
|
5
6
|
*
|
|
@@ -8,7 +9,13 @@ import { User } from '../../../data';
|
|
|
8
9
|
* @template TKey - Type of the entity key (e.g., number, string, GUID, etc.)
|
|
9
10
|
* @template TUser - Data Transfer Object representing the user entity
|
|
10
11
|
*/
|
|
11
|
-
export declare class UserManagementControllerClient<TKey, TUser extends
|
|
12
|
+
export declare class UserManagementControllerClient<TKey, TUser extends UserDto<TKey>> extends ApiCrudControllerClient<TKey, TUser> {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param baseControllerPath Base path to API controller
|
|
16
|
+
* @param httpService HTTP service implementation to use for requests
|
|
17
|
+
*/
|
|
18
|
+
constructor(baseControllerPath: string, httpService?: IHttpService);
|
|
12
19
|
/**
|
|
13
20
|
* Gets the roles assigned to a user
|
|
14
21
|
* @param id - The ID of the user
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ApiCrudControllerClient
|
|
1
|
+
import { ApiCrudControllerClient } from '../ApiCrudControllerClient';
|
|
2
|
+
import { apiInitializationService } from '../ApiInitializationService';
|
|
3
|
+
import { defaultHttpService } from '../HttpService';
|
|
2
4
|
/**
|
|
3
5
|
* Client for user management operations
|
|
4
6
|
*
|
|
@@ -8,6 +10,14 @@ import { ApiCrudControllerClient, apiInitializationService } from '../..';
|
|
|
8
10
|
* @template TUser - Data Transfer Object representing the user entity
|
|
9
11
|
*/
|
|
10
12
|
export class UserManagementControllerClient extends ApiCrudControllerClient {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param baseControllerPath Base path to API controller
|
|
16
|
+
* @param httpService HTTP service implementation to use for requests
|
|
17
|
+
*/
|
|
18
|
+
constructor(baseControllerPath, httpService = defaultHttpService) {
|
|
19
|
+
super(baseControllerPath, httpService);
|
|
20
|
+
}
|
|
11
21
|
/**
|
|
12
22
|
* Gets the roles assigned to a user
|
|
13
23
|
* @param id - The ID of the user
|
|
@@ -16,7 +26,8 @@ export class UserManagementControllerClient extends ApiCrudControllerClient {
|
|
|
16
26
|
async getUserRoles(id) {
|
|
17
27
|
try {
|
|
18
28
|
const url = await apiInitializationService.getApiUrl(this.baseControllerPath, `/GetUserRoles${encodeURIComponent(String(id))}`);
|
|
19
|
-
const response = await
|
|
29
|
+
const response = await this.httpService.request(url, {
|
|
30
|
+
method: 'GET',
|
|
20
31
|
credentials: 'include',
|
|
21
32
|
});
|
|
22
33
|
if (!response.ok)
|
|
@@ -35,7 +46,8 @@ export class UserManagementControllerClient extends ApiCrudControllerClient {
|
|
|
35
46
|
async getUserClaims(id) {
|
|
36
47
|
try {
|
|
37
48
|
const url = await apiInitializationService.getApiUrl(this.baseControllerPath, `/GetUserClaims/${encodeURIComponent(String(id))}`);
|
|
38
|
-
const response = await
|
|
49
|
+
const response = await this.httpService.request(url, {
|
|
50
|
+
method: 'GET',
|
|
39
51
|
credentials: 'include',
|
|
40
52
|
});
|
|
41
53
|
if (!response.ok)
|
|
@@ -53,7 +65,8 @@ export class UserManagementControllerClient extends ApiCrudControllerClient {
|
|
|
53
65
|
async getAllRoles() {
|
|
54
66
|
try {
|
|
55
67
|
const url = await apiInitializationService.getApiUrl(this.baseControllerPath, `/GetAllRoles`);
|
|
56
|
-
const response = await
|
|
68
|
+
const response = await this.httpService.request(url, {
|
|
69
|
+
method: 'GET',
|
|
57
70
|
credentials: 'include',
|
|
58
71
|
});
|
|
59
72
|
if (!response.ok)
|
|
@@ -73,7 +86,7 @@ export class UserManagementControllerClient extends ApiCrudControllerClient {
|
|
|
73
86
|
async changePassword(id, newPassword) {
|
|
74
87
|
try {
|
|
75
88
|
const url = await apiInitializationService.getApiUrl(this.baseControllerPath, `/ChangePassword/${encodeURIComponent(String(id))}`);
|
|
76
|
-
const response = await
|
|
89
|
+
const response = await this.httpService.request(url, {
|
|
77
90
|
method: 'POST',
|
|
78
91
|
headers: {
|
|
79
92
|
'Content-Type': 'application/json',
|
package/services/api/index.d.ts
CHANGED
package/services/api/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { UserDto, UserInfoDto } from '../../../../data';
|
|
2
|
+
export { UserDto, UserInfoDto };
|
|
3
3
|
/**
|
|
4
4
|
* AuthService class is responsible for managing user authentication operations.
|
|
5
5
|
* It supports login, logout, and checking the current user's details.
|
|
@@ -7,7 +7,7 @@ export { User, UserInfo };
|
|
|
7
7
|
* @export
|
|
8
8
|
* @class AuthService
|
|
9
9
|
*/
|
|
10
|
-
export declare class AuthService<TKey, TUser extends
|
|
10
|
+
export declare class AuthService<TKey, TUser extends UserDto<TKey> = UserDto<TKey>> {
|
|
11
11
|
/**
|
|
12
12
|
* Holds currently authenticated user's details
|
|
13
13
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RoleDto } from '../../../../data';
|
|
2
2
|
/**
|
|
3
3
|
* Client for authorization management operations
|
|
4
4
|
*
|
|
@@ -17,19 +17,19 @@ export declare class AuthorizationManagementControllerClient {
|
|
|
17
17
|
* @param includeClaims - Whether to include claims in the response
|
|
18
18
|
* @returns List of all roles
|
|
19
19
|
*/
|
|
20
|
-
getAllRoles(includeClaims: boolean): Promise<
|
|
20
|
+
getAllRoles(includeClaims: boolean): Promise<RoleDto[]>;
|
|
21
21
|
/**
|
|
22
22
|
* Creates or updates a role
|
|
23
23
|
* @param roleDto - The role to create or update
|
|
24
24
|
* @returns The created or updated role
|
|
25
25
|
*/
|
|
26
|
-
upsertRole(roleDto:
|
|
26
|
+
upsertRole(roleDto: RoleDto): Promise<RoleDto>;
|
|
27
27
|
/**
|
|
28
28
|
* Gets a role with its claims
|
|
29
29
|
* @param roleName - The name of the role
|
|
30
30
|
* @returns The role with its claims
|
|
31
31
|
*/
|
|
32
|
-
getRoleWithClaims(roleName: string): Promise<
|
|
32
|
+
getRoleWithClaims(roleName: string): Promise<RoleDto>;
|
|
33
33
|
/**
|
|
34
34
|
* Deletes a role
|
|
35
35
|
* @param roleName - The name of the role to delete
|
|
@@ -44,7 +44,7 @@ export class AuthorizationManagementControllerClient {
|
|
|
44
44
|
const response = await fetch(url, {
|
|
45
45
|
method: 'PUT',
|
|
46
46
|
headers: {
|
|
47
|
-
'Content-Type': 'application/json'
|
|
47
|
+
'Content-Type': 'application/json',
|
|
48
48
|
},
|
|
49
49
|
body: JSON.stringify(roleDto),
|
|
50
50
|
credentials: 'include',
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const RegisterRequestDto: z.ZodObject<{
|
|
3
|
-
username: z.ZodString;
|
|
4
|
-
password: z.ZodString;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
username: string;
|
|
7
|
-
password: string;
|
|
8
|
-
}, {
|
|
9
|
-
username: string;
|
|
10
|
-
password: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type RegisterRequestDto = z.infer<typeof RegisterRequestDto>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const SignInRequestDto: z.ZodObject<{
|
|
3
|
-
username: z.ZodString;
|
|
4
|
-
password: z.ZodString;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
username: string;
|
|
7
|
-
password: string;
|
|
8
|
-
}, {
|
|
9
|
-
username: string;
|
|
10
|
-
password: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type SignInRequestDto = z.infer<typeof SignInRequestDto>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const TokensDto: z.ZodObject<{
|
|
3
|
-
accessToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
4
|
-
refreshToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
accessToken?: string | null | undefined;
|
|
7
|
-
refreshToken?: string | null | undefined;
|
|
8
|
-
}, {
|
|
9
|
-
accessToken?: string | null | undefined;
|
|
10
|
-
refreshToken?: string | null | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
export type TokensDto = z.infer<typeof TokensDto>;
|
package/data/_generated/cache.js
DELETED
package/data/_generated/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReadSelectedPaginationDefinition, ReadSelectedOrderingDefinition, ReadSelectedFilteringDefinition } from '../..';
|
|
2
|
-
/**
|
|
3
|
-
* Defines the selection criteria for a controller to fetch multiple records
|
|
4
|
-
*/
|
|
5
|
-
export type ReadSelectedDefinition = {
|
|
6
|
-
/**
|
|
7
|
-
* Pagination definition
|
|
8
|
-
*/
|
|
9
|
-
paginationDefinition?: ReadSelectedPaginationDefinition;
|
|
10
|
-
/**
|
|
11
|
-
* Ordering definition
|
|
12
|
-
*/
|
|
13
|
-
orderingDefinition?: ReadSelectedOrderingDefinition;
|
|
14
|
-
/**
|
|
15
|
-
* Filtering definition
|
|
16
|
-
*/
|
|
17
|
-
filteringDefinition?: ReadSelectedFilteringDefinition;
|
|
18
|
-
};
|
|
File without changes
|
/package/data/api/dto/{ReadSelectedFilteringDefinition.js → ReadSelectedFilteringDefinitionDto.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/data/api/dto/{ReadSelectedOrderingDefinition.js → ReadSelectedOrderingDefinitionDto.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/data/api/dto/{ReadSelectedPaginationDefinition.js → ReadSelectedPaginationDefinitionDto.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|