@intellegens/cornerstone-client 0.0.25 → 0.0.27
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} +4 -4
- package/data/api/dto/ReadSelectedFilteringPropertyDefinitionDto.d.ts +107 -0
- package/data/api/dto/ReadSelectedOrderingDefinitionDto.d.ts +7 -0
- package/data/api/dto/{ReadSelectedOrderingPropertyDefinition.d.ts → ReadSelectedOrderingPropertyDefinitionDto.d.ts} +2 -2
- package/data/api/dto/ReadSelectedOrderingPropertyDefinitionDto.js +1 -0
- package/data/api/dto/{ReadSelectedPaginationDefinition.js → ReadSelectedPaginationDefinitionDto.d.ts} +4 -4
- package/data/api/dto/ReadSelectedPaginationDefinitionDto.js +1 -0
- package/data/api/dto/index.d.ts +6 -6
- package/data/api/dto/index.js +6 -6
- package/data/api/enum/ReadSelectedComparisonOperator.d.ts +29 -1
- package/data/api/enum/ReadSelectedComparisonOperator.js +28 -2
- package/data/api/enum/ReadSelectedPropertyType.d.ts +38 -2
- package/data/api/enum/ReadSelectedPropertyType.js +37 -2
- package/data/api/interface/IIdentifiable.d.ts +3 -3
- package/data/api/interface/IIdentifiableByGuid.d.ts +3 -3
- package/data/api/interface/IOptionallyIdentifiable.d.ts +3 -3
- package/data/auth/{Claim/index.d.ts → dto/ClaimDto.d.ts} +2 -2
- package/data/auth/dto/ClaimDto.js +1 -0
- package/data/auth/dto/RegisterRequestDto.d.ts +4 -0
- package/data/auth/dto/RegisterRequestDto.js +1 -0
- package/data/auth/dto/RoleDto.d.ts +5 -0
- package/data/auth/dto/RoleDto.js +1 -0
- package/data/auth/dto/SignInRequestDto.d.ts +4 -0
- package/data/auth/dto/SignInRequestDto.js +1 -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/ReadSelectedDefinition.js +0 -17
- package/data/api/dto/ReadSelectedFilteringDefinition.js +0 -13
- package/data/api/dto/ReadSelectedFilteringPropertyDefinition.d.ts +0 -22
- package/data/api/dto/ReadSelectedFilteringPropertyDefinition.js +0 -21
- package/data/api/dto/ReadSelectedOrderingDefinition.d.ts +0 -7
- package/data/api/dto/ReadSelectedOrderingDefinition.js +0 -6
- package/data/api/dto/ReadSelectedOrderingPropertyDefinition.js +0 -14
- package/data/api/dto/ReadSelectedPaginationDefinition.d.ts +0 -13
- package/data/auth/Role/index.d.ts +0 -5
- /package/data/{auth/Claim/index.js → api/dto/ReadSelectedDefinitionDto.js} +0 -0
- /package/data/{auth/Role/index.js → api/dto/ReadSelectedFilteringDefinitionDto.js} +0 -0
- /package/data/{auth/User/index.js → api/dto/ReadSelectedFilteringPropertyDefinitionDto.js} +0 -0
- /package/data/{auth/UserInfo/index.js → api/dto/ReadSelectedOrderingDefinitionDto.js} +0 -0
|
@@ -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 declare class 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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines the selection criteria for a controller to fetch multiple records
|
|
3
|
-
*/
|
|
4
|
-
export class ReadSelectedDefinition {
|
|
5
|
-
/**
|
|
6
|
-
* Pagination definition
|
|
7
|
-
*/
|
|
8
|
-
paginationDefinition;
|
|
9
|
-
/**
|
|
10
|
-
* Ordering definition
|
|
11
|
-
*/
|
|
12
|
-
orderingDefinition;
|
|
13
|
-
/**
|
|
14
|
-
* Filtering definition
|
|
15
|
-
*/
|
|
16
|
-
filteringDefinition;
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines the filtering options for a controller, including the logical operator and an array of property definitions.
|
|
3
|
-
*/
|
|
4
|
-
export class ReadSelectedFilteringDefinition {
|
|
5
|
-
/**
|
|
6
|
-
* Array of filtering property definitions to be applied.
|
|
7
|
-
*/
|
|
8
|
-
filters = [];
|
|
9
|
-
/**
|
|
10
|
-
* Logical operator to be used when applying the filters.
|
|
11
|
-
*/
|
|
12
|
-
logicalOperator;
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ReadSelectedComparisonOperator, ReadSelectedPropertyType } from '../..';
|
|
2
|
-
/**
|
|
3
|
-
* Defines a property used for filtering in a controller.
|
|
4
|
-
*/
|
|
5
|
-
export declare class ReadSelectedFilteringPropertyDefinition {
|
|
6
|
-
/**
|
|
7
|
-
* The path to the property being filtered.
|
|
8
|
-
*/
|
|
9
|
-
propertyPath: string;
|
|
10
|
-
/**
|
|
11
|
-
* The comparison operator to use for the filter.
|
|
12
|
-
*/
|
|
13
|
-
comparisonOperator: ReadSelectedComparisonOperator;
|
|
14
|
-
/**
|
|
15
|
-
* The type of the property value being filtered.
|
|
16
|
-
*/
|
|
17
|
-
valueType: ReadSelectedPropertyType;
|
|
18
|
-
/**
|
|
19
|
-
* The value to use for the filter.
|
|
20
|
-
*/
|
|
21
|
-
value: unknown;
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines a property used for filtering in a controller.
|
|
3
|
-
*/
|
|
4
|
-
export class ReadSelectedFilteringPropertyDefinition {
|
|
5
|
-
/**
|
|
6
|
-
* The path to the property being filtered.
|
|
7
|
-
*/
|
|
8
|
-
propertyPath;
|
|
9
|
-
/**
|
|
10
|
-
* The comparison operator to use for the filter.
|
|
11
|
-
*/
|
|
12
|
-
comparisonOperator;
|
|
13
|
-
/**
|
|
14
|
-
* The type of the property value being filtered.
|
|
15
|
-
*/
|
|
16
|
-
valueType;
|
|
17
|
-
/**
|
|
18
|
-
* The value to use for the filter.
|
|
19
|
-
*/
|
|
20
|
-
value = undefined;
|
|
21
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ReadSelectedOrderingDirection } from '../..';
|
|
2
|
-
/**
|
|
3
|
-
* Defines the ordering property for a controller.
|
|
4
|
-
*/
|
|
5
|
-
export class ReadSelectedOrderingPropertyDefinition {
|
|
6
|
-
/**
|
|
7
|
-
* Gets or sets the property path.
|
|
8
|
-
*/
|
|
9
|
-
propertyPath;
|
|
10
|
-
/**
|
|
11
|
-
* Gets or sets the sort direction.
|
|
12
|
-
*/
|
|
13
|
-
direction = ReadSelectedOrderingDirection.Ascending;
|
|
14
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|