@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.
Files changed (90) hide show
  1. package/README.md +51 -11
  2. package/data/api/dto/ReadSelectedDefinitionDto.d.ts +18 -0
  3. package/data/api/dto/{ReadSelectedFilteringDefinition.d.ts → ReadSelectedFilteringDefinitionDto.d.ts} +4 -4
  4. package/data/api/dto/ReadSelectedFilteringPropertyDefinitionDto.d.ts +107 -0
  5. package/data/api/dto/ReadSelectedOrderingDefinitionDto.d.ts +7 -0
  6. package/data/api/dto/{ReadSelectedOrderingPropertyDefinition.d.ts → ReadSelectedOrderingPropertyDefinitionDto.d.ts} +2 -2
  7. package/data/api/dto/ReadSelectedOrderingPropertyDefinitionDto.js +1 -0
  8. package/data/api/dto/{ReadSelectedPaginationDefinition.js → ReadSelectedPaginationDefinitionDto.d.ts} +4 -4
  9. package/data/api/dto/ReadSelectedPaginationDefinitionDto.js +1 -0
  10. package/data/api/dto/index.d.ts +6 -6
  11. package/data/api/dto/index.js +6 -6
  12. package/data/api/enum/ReadSelectedComparisonOperator.d.ts +29 -1
  13. package/data/api/enum/ReadSelectedComparisonOperator.js +28 -2
  14. package/data/api/enum/ReadSelectedPropertyType.d.ts +38 -2
  15. package/data/api/enum/ReadSelectedPropertyType.js +37 -2
  16. package/data/api/interface/IIdentifiable.d.ts +3 -3
  17. package/data/api/interface/IIdentifiableByGuid.d.ts +3 -3
  18. package/data/api/interface/IOptionallyIdentifiable.d.ts +3 -3
  19. package/data/auth/{Claim/index.d.ts → dto/ClaimDto.d.ts} +2 -2
  20. package/data/auth/dto/ClaimDto.js +1 -0
  21. package/data/auth/dto/RegisterRequestDto.d.ts +4 -0
  22. package/data/auth/dto/RegisterRequestDto.js +1 -0
  23. package/data/auth/dto/RoleDto.d.ts +5 -0
  24. package/data/auth/dto/RoleDto.js +1 -0
  25. package/data/auth/dto/SignInRequestDto.d.ts +4 -0
  26. package/data/auth/dto/SignInRequestDto.js +1 -0
  27. package/data/auth/dto/TokensDto.d.ts +4 -0
  28. package/data/auth/dto/TokensDto.js +1 -0
  29. package/data/auth/{User/index.d.ts → dto/UserDto.d.ts} +4 -4
  30. package/data/auth/dto/UserDto.js +1 -0
  31. package/data/auth/{UserInfo/index.d.ts → dto/UserInfoDto.d.ts} +3 -3
  32. package/data/auth/dto/UserInfoDto.js +1 -0
  33. package/data/auth/dto/index.d.ts +4 -0
  34. package/data/auth/dto/index.js +4 -0
  35. package/data/auth/index.d.ts +1 -4
  36. package/data/auth/index.js +1 -4
  37. package/data/index.d.ts +0 -1
  38. package/data/index.js +0 -1
  39. package/package.json +13 -7
  40. package/services/api/ApiCrudControllerClient/index.d.ts +9 -2
  41. package/services/api/ApiCrudControllerClient/index.js +15 -5
  42. package/services/api/ApiInitializationService/index.d.ts +11 -1
  43. package/services/api/ApiInitializationService/index.js +19 -4
  44. package/services/api/ApiReadControllerClient/index.d.ts +10 -3
  45. package/services/api/ApiReadControllerClient/index.js +18 -5
  46. package/services/api/HttpService/AngularHttpService.d.ts +9 -0
  47. package/services/api/HttpService/AngularHttpService.js +86 -0
  48. package/services/api/HttpService/AxiosHttpService.d.ts +10 -0
  49. package/services/api/HttpService/AxiosHttpService.js +53 -0
  50. package/services/api/HttpService/FetchHttpService.d.ts +7 -0
  51. package/services/api/HttpService/FetchHttpService.js +28 -0
  52. package/services/api/HttpService/HttpRequestConfig.d.ts +9 -0
  53. package/services/api/HttpService/HttpRequestConfig.js +1 -0
  54. package/services/api/HttpService/HttpResponse.d.ts +11 -0
  55. package/services/api/HttpService/HttpResponse.js +3 -0
  56. package/services/api/HttpService/IHttpService.d.ts +13 -0
  57. package/services/api/HttpService/IHttpService.js +3 -0
  58. package/services/api/HttpService/index.d.ts +11 -0
  59. package/services/api/HttpService/index.js +12 -0
  60. package/services/api/UserManagementControllerClient/index.d.ts +10 -3
  61. package/services/api/UserManagementControllerClient/index.js +18 -5
  62. package/services/api/index.d.ts +1 -0
  63. package/services/api/index.js +1 -0
  64. package/services/auth/client/AuthService/index.d.ts +3 -3
  65. package/services/auth/client/AuthorizationManagementControllerClient/index.d.ts +4 -4
  66. package/services/auth/client/AuthorizationManagementControllerClient/index.js +1 -1
  67. package/data/_generated/Cornerstone/Auth/API/DTOs/RegisterRequestDto.d.ts +0 -12
  68. package/data/_generated/Cornerstone/Auth/API/DTOs/RegisterRequestDto.js +0 -2
  69. package/data/_generated/Cornerstone/Auth/API/DTOs/SignInRequestDto.d.ts +0 -12
  70. package/data/_generated/Cornerstone/Auth/API/DTOs/SignInRequestDto.js +0 -2
  71. package/data/_generated/Cornerstone/Auth/API/DTOs/TokensDto.d.ts +0 -12
  72. package/data/_generated/Cornerstone/Auth/API/DTOs/TokensDto.js +0 -2
  73. package/data/_generated/cache.d.ts +0 -3
  74. package/data/_generated/cache.js +0 -2
  75. package/data/_generated/index.d.ts +0 -3
  76. package/data/_generated/index.js +0 -3
  77. package/data/api/dto/ReadSelectedDefinition.d.ts +0 -18
  78. package/data/api/dto/ReadSelectedDefinition.js +0 -17
  79. package/data/api/dto/ReadSelectedFilteringDefinition.js +0 -13
  80. package/data/api/dto/ReadSelectedFilteringPropertyDefinition.d.ts +0 -22
  81. package/data/api/dto/ReadSelectedFilteringPropertyDefinition.js +0 -21
  82. package/data/api/dto/ReadSelectedOrderingDefinition.d.ts +0 -7
  83. package/data/api/dto/ReadSelectedOrderingDefinition.js +0 -6
  84. package/data/api/dto/ReadSelectedOrderingPropertyDefinition.js +0 -14
  85. package/data/api/dto/ReadSelectedPaginationDefinition.d.ts +0 -13
  86. package/data/auth/Role/index.d.ts +0 -5
  87. /package/data/{auth/Claim/index.js → api/dto/ReadSelectedDefinitionDto.js} +0 -0
  88. /package/data/{auth/Role/index.js → api/dto/ReadSelectedFilteringDefinitionDto.js} +0 -0
  89. /package/data/{auth/User/index.js → api/dto/ReadSelectedFilteringPropertyDefinitionDto.js} +0 -0
  90. /package/data/{auth/UserInfo/index.js → api/dto/ReadSelectedOrderingDefinitionDto.js} +0 -0
@@ -1,4 +1,6 @@
1
- import { ApiCrudControllerClient, apiInitializationService } from '../..';
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 fetch(url, {
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 fetch(url, {
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 fetch(url, {
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 fetch(url, {
89
+ const response = await this.httpService.request(url, {
77
90
  method: 'POST',
78
91
  headers: {
79
92
  'Content-Type': 'application/json',
@@ -1,3 +1,4 @@
1
+ export * from './HttpService';
1
2
  export * from './ApiInitializationService';
2
3
  export * from './ApiReadControllerClient';
3
4
  export * from './ApiCrudControllerClient';
@@ -1,3 +1,4 @@
1
+ export * from './HttpService';
1
2
  export * from './ApiInitializationService';
2
3
  export * from './ApiReadControllerClient';
3
4
  export * from './ApiCrudControllerClient';
@@ -1,5 +1,5 @@
1
- import { User, UserInfo } from '../../../../data';
2
- export { User, UserInfo };
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 User<TKey> = User<TKey>> {
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 { Role } from '../../../../data';
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<Role[]>;
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: Role): Promise<Role>;
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<Role>;
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,2 +0,0 @@
1
- import { z } from "zod";
2
- export const RegisterRequestDto = z.object({ "username": z.string(), "password": z.string() });
@@ -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,2 +0,0 @@
1
- import { z } from "zod";
2
- export const SignInRequestDto = z.object({ "username": z.string(), "password": z.string() });
@@ -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>;
@@ -1,2 +0,0 @@
1
- import { z } from "zod";
2
- export const TokensDto = z.object({ "accessToken": z.union([z.string(), z.null()]).optional(), "refreshToken": z.union([z.string(), z.null()]).optional() });
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
- export declare const cache: z.ZodAny;
3
- export type Cache = z.infer<typeof cache>;
@@ -1,2 +0,0 @@
1
- import { z } from "zod";
2
- export const cache = z.any();
@@ -1,3 +0,0 @@
1
- export * from './Cornerstone/Auth/API/DTOs/RegisterRequestDto';
2
- export * from './Cornerstone/Auth/API/DTOs/SignInRequestDto';
3
- export * from './Cornerstone/Auth/API/DTOs/TokensDto';
@@ -1,3 +0,0 @@
1
- export * from './Cornerstone/Auth/API/DTOs/RegisterRequestDto'; // .NET RegisterRequestDto class
2
- export * from './Cornerstone/Auth/API/DTOs/SignInRequestDto'; // .NET SignInRequestDto class
3
- export * from './Cornerstone/Auth/API/DTOs/TokensDto'; // .NET TokensDto class
@@ -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,7 +0,0 @@
1
- import { ReadSelectedOrderingPropertyDefinition } from '../..';
2
- /**
3
- * Represents the ordering definition for a controller.
4
- */
5
- export declare class ReadSelectedOrderingDefinition {
6
- order: ReadSelectedOrderingPropertyDefinition[];
7
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Represents the ordering definition for a controller.
3
- */
4
- export class ReadSelectedOrderingDefinition {
5
- order = [];
6
- }
@@ -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
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Defines the pagination parameters for a controller.
3
- */
4
- export declare class ReadSelectedPaginationDefinition {
5
- /**
6
- * Pagination offset
7
- */
8
- skip?: number;
9
- /**
10
- * Pagination limit
11
- */
12
- limit?: number;
13
- }
@@ -1,5 +0,0 @@
1
- import { Claim } from '../..';
2
- export interface Role {
3
- name: string;
4
- claims: Claim[];
5
- }