@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
package/README.md
CHANGED
|
@@ -28,9 +28,9 @@ http://localhost:3000
|
|
|
28
28
|
|
|
29
29
|
## API reference
|
|
30
30
|
|
|
31
|
-
### API
|
|
31
|
+
### API Initialization service
|
|
32
32
|
|
|
33
|
-
This service provides way to load API configuration for a Cornerstone client application
|
|
33
|
+
This service provides way to load API configuration for a Cornerstone client application:
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
36
|
import { ApiInitializationService } from '@intellegens/cornerstone-client';
|
|
@@ -45,18 +45,58 @@ import { apiInitializationService } from '@intellegens/cornerstone-client';
|
|
|
45
45
|
await apiInitializationService.initialize();
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
It also provides a way of customizing global defaults for Cornerstone client application:
|
|
49
|
+
|
|
50
|
+
- `httpService` Configures a default HTTP Service to be used across the application, unless specified otherwise (See [HTTP Service Abstraction](#http-service-abstraction))
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { apiInitializationService, FetchHttpService } from '@intellegens/cornerstone-client';
|
|
54
|
+
await apiInitializationService.initialize({
|
|
55
|
+
httpService: new FetchHttpService(),
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
48
59
|
#### API base URL detection
|
|
49
60
|
|
|
50
|
-
|
|
61
|
+
Base API URL is detected by checking the `CORNERSTONE-API-BASEURL` response header and the `./websettings.json` file.
|
|
51
62
|
|
|
52
|
-
- First,
|
|
53
|
-
- If the header is not found,
|
|
54
|
-
- If no API base URL is found,
|
|
63
|
+
- First, Cornerstone client checks the response headers of the current URL for the `CORNERSTONE-API-BASEURL` header.
|
|
64
|
+
- If the header is not found, Cornerstone client attempts to load the `websettings.json` file and looks for an `api` field.
|
|
65
|
+
- If no API base URL is found, Cornerstone client defaults to `undefined`.
|
|
66
|
+
|
|
67
|
+
Before, or after the base API URL has been detected, you can get any API endpoint URL by calling:
|
|
55
68
|
|
|
56
69
|
```ts
|
|
57
70
|
const fetchUrl = `${await apiInitializationService.getApiUrl('/my/endpoint')}`;
|
|
58
71
|
```
|
|
59
72
|
|
|
73
|
+
### HTTP Service Abstraction
|
|
74
|
+
|
|
75
|
+
The Cornerstone client provides a flexible HTTP service abstraction that allows you to use different HTTP libraries (Fetch API, Axios, Angular HttpClient) with the same API clients. This abstraction provides consistent behavior across different HTTP implementations while maintaining framework independence.
|
|
76
|
+
|
|
77
|
+
#### Key Features
|
|
78
|
+
|
|
79
|
+
- **Pluggable HTTP implementations** - Switch between Fetch, Axios, and Angular HttpClient
|
|
80
|
+
- **Consistent interface** - All HTTP services implement the same `IHttpService` interface
|
|
81
|
+
- **Framework agnostic** - Use the same API clients in React, Angular, Vue, or any other framework
|
|
82
|
+
- **Easy testing** - Mock HTTP requests easily for unit testing
|
|
83
|
+
- **Runtime switching** - Change HTTP service implementations at runtime
|
|
84
|
+
|
|
85
|
+
#### Quick Example
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import { ApiReadControllerClient, FetchHttpService, AxiosHttpService } from '@intellegens/cornerstone-client';
|
|
89
|
+
|
|
90
|
+
// Using default Fetch implementation
|
|
91
|
+
const client = new ApiReadControllerClient('/api/users');
|
|
92
|
+
|
|
93
|
+
// Or specify a custom HTTP service
|
|
94
|
+
const axiosService = new AxiosHttpService(axiosInstance);
|
|
95
|
+
const clientWithAxios = new ApiReadControllerClient('/api/users', axiosService);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For detailed documentation, examples, and advanced usage, see: [HTTP Service Documentation](./src/services/api/HttpService/README.md)
|
|
99
|
+
|
|
60
100
|
### Auth Service
|
|
61
101
|
|
|
62
102
|
This service provides authentication methods for managing user sessions in a Cornerstone client application.
|
|
@@ -73,23 +113,23 @@ const user = authService.user;
|
|
|
73
113
|
##### Who Am I
|
|
74
114
|
|
|
75
115
|
```ts
|
|
76
|
-
authService.whoAmI(): Promise<
|
|
116
|
+
authService.whoAmI(): Promise<UserDto | undefined>
|
|
77
117
|
```
|
|
78
118
|
|
|
79
|
-
This method checks the current session and returns the
|
|
119
|
+
This method checks the current session and returns the UserDto object for the logged-in user. If no user is logged in, it returns undefined.
|
|
80
120
|
|
|
81
121
|
##### Sign in
|
|
82
122
|
|
|
83
123
|
```ts
|
|
84
|
-
authService.signin(username: string, password: string): Promise<
|
|
124
|
+
authService.signin(username: string, password: string): Promise<UserDto | undefined>
|
|
85
125
|
```
|
|
86
126
|
|
|
87
|
-
This method logs the user in by sending the provided username and password to the API. If the login is successful, it returns the authenticated
|
|
127
|
+
This method logs the user in by sending the provided username and password to the API. If the login is successful, it returns the authenticated UserDto object.
|
|
88
128
|
|
|
89
129
|
##### Sign out
|
|
90
130
|
|
|
91
131
|
```ts
|
|
92
|
-
authService.logout(): Promise<
|
|
132
|
+
authService.logout(): Promise<UserDto | undefined>
|
|
93
133
|
```
|
|
94
134
|
|
|
95
135
|
This method logs the user out by sending a request to the API to end the session. It returns undefined if the logout is successful
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReadSelectedPaginationDefinitionDto, ReadSelectedOrderingDefinitionDto, ReadSelectedFilteringDefinitionDto } from '../..';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the selection criteria for a controller to fetch multiple records
|
|
4
|
+
*/
|
|
5
|
+
export type ReadSelectedDefinitionDto = {
|
|
6
|
+
/**
|
|
7
|
+
* Pagination definition
|
|
8
|
+
*/
|
|
9
|
+
paginationDefinition?: ReadSelectedPaginationDefinitionDto;
|
|
10
|
+
/**
|
|
11
|
+
* Ordering definition
|
|
12
|
+
*/
|
|
13
|
+
orderingDefinition?: ReadSelectedOrderingDefinitionDto;
|
|
14
|
+
/**
|
|
15
|
+
* Filtering definition
|
|
16
|
+
*/
|
|
17
|
+
filteringDefinition?: ReadSelectedFilteringDefinitionDto;
|
|
18
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReadSelectedFilteringPropertyDefinitionDto, ReadSelectedLogicalOperator } from '../..';
|
|
2
2
|
/**
|
|
3
3
|
* Defines the filtering options for a controller, including the logical operator and an array of property definitions.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type ReadSelectedFilteringDefinitionDto = {
|
|
6
6
|
/**
|
|
7
7
|
* Array of filtering property definitions to be applied.
|
|
8
8
|
*/
|
|
9
|
-
filters:
|
|
9
|
+
filters: ReadSelectedFilteringPropertyDefinitionDto[];
|
|
10
10
|
/**
|
|
11
11
|
* Logical operator to be used when applying the filters.
|
|
12
12
|
*/
|
|
13
13
|
logicalOperator: ReadSelectedLogicalOperator;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ReadSelectedComparisonOperator, ReadSelectedPropertyType } from '../..';
|
|
2
|
+
/**
|
|
3
|
+
* Defines a property used for filtering in a controller.
|
|
4
|
+
*/
|
|
5
|
+
export type ReadSelectedFilteringPropertyDefinitionDto = Partial_ReadSelectedFilteringPropertyDefinition_IndependentProperties & Partial_ReadSelectedFilteringPropertyDefinition_TypedValueProperty & Partial_ReadSelectedFilteringPropertyDefinition_TypedComparisonOperators;
|
|
6
|
+
/**
|
|
7
|
+
* Defines independent properties
|
|
8
|
+
*/
|
|
9
|
+
type Partial_ReadSelectedFilteringPropertyDefinition_IndependentProperties = {
|
|
10
|
+
/**
|
|
11
|
+
* The path to the property being filtered.
|
|
12
|
+
*/
|
|
13
|
+
propertyPath: string;
|
|
14
|
+
/**
|
|
15
|
+
* The comparison operator to use for the filter.
|
|
16
|
+
*/
|
|
17
|
+
comparisonOperator: ReadSelectedComparisonOperator;
|
|
18
|
+
/**
|
|
19
|
+
* The type of the property value being filtered.
|
|
20
|
+
*/
|
|
21
|
+
valueType: ReadSelectedPropertyType;
|
|
22
|
+
/**
|
|
23
|
+
* The value to use for the filter.
|
|
24
|
+
*/
|
|
25
|
+
value: unknown;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Defines the dependence between the .valueType and the type of the .value properties
|
|
29
|
+
*/
|
|
30
|
+
type Partial_ReadSelectedFilteringPropertyDefinition_TypedValueProperty = {
|
|
31
|
+
/**
|
|
32
|
+
* The type of the property value being filtered.
|
|
33
|
+
*/
|
|
34
|
+
valueType: ReadSelectedPropertyType.Bool;
|
|
35
|
+
/**
|
|
36
|
+
* The value to use for the filter.
|
|
37
|
+
*/
|
|
38
|
+
value: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
/**
|
|
41
|
+
* The type of the property value being filtered.
|
|
42
|
+
*/
|
|
43
|
+
valueType: ReadSelectedPropertyType.Int | ReadSelectedPropertyType.Short | ReadSelectedPropertyType.Long | ReadSelectedPropertyType.Decimal | ReadSelectedPropertyType.Double | ReadSelectedPropertyType.Float;
|
|
44
|
+
/**
|
|
45
|
+
* The value to use for the filter.
|
|
46
|
+
*/
|
|
47
|
+
value: number;
|
|
48
|
+
} | {
|
|
49
|
+
/**
|
|
50
|
+
* The type of the property value being filtered.
|
|
51
|
+
*/
|
|
52
|
+
valueType: ReadSelectedPropertyType.String;
|
|
53
|
+
/**
|
|
54
|
+
* The value to use for the filter.
|
|
55
|
+
*/
|
|
56
|
+
value: string;
|
|
57
|
+
} | {
|
|
58
|
+
/**
|
|
59
|
+
* The type of the property value being filtered.
|
|
60
|
+
*/
|
|
61
|
+
valueType: ReadSelectedPropertyType.DateTime | ReadSelectedPropertyType.DateTimeOffset | ReadSelectedPropertyType.TimeSpan | ReadSelectedPropertyType.DateOnly | ReadSelectedPropertyType.TimeOnly;
|
|
62
|
+
/**
|
|
63
|
+
* The value to use for the filter.
|
|
64
|
+
*/
|
|
65
|
+
value: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Defines the dependence between the .valueType and the type of the .comparisonOperator properties
|
|
69
|
+
*/
|
|
70
|
+
type Partial_ReadSelectedFilteringPropertyDefinition_TypedComparisonOperators = {
|
|
71
|
+
/**
|
|
72
|
+
* The type of the property value being filtered.
|
|
73
|
+
*/
|
|
74
|
+
valueType: ReadSelectedPropertyType.Bool;
|
|
75
|
+
/**
|
|
76
|
+
* The comparison operator to use for the filter.
|
|
77
|
+
*/
|
|
78
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual;
|
|
79
|
+
} | {
|
|
80
|
+
/**
|
|
81
|
+
* The type of the property value being filtered.
|
|
82
|
+
*/
|
|
83
|
+
valueType: ReadSelectedPropertyType.Int | ReadSelectedPropertyType.Short | ReadSelectedPropertyType.Long | ReadSelectedPropertyType.Decimal | ReadSelectedPropertyType.Double | ReadSelectedPropertyType.Float;
|
|
84
|
+
/**
|
|
85
|
+
* The comparison operator to use for the filter.
|
|
86
|
+
*/
|
|
87
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual | ReadSelectedComparisonOperator.LessThan | ReadSelectedComparisonOperator.LessOrEqual | ReadSelectedComparisonOperator.GreaterThan | ReadSelectedComparisonOperator.GreaterOrEqual;
|
|
88
|
+
} | {
|
|
89
|
+
/**
|
|
90
|
+
* The type of the property value being filtered.
|
|
91
|
+
*/
|
|
92
|
+
valueType: ReadSelectedPropertyType.String;
|
|
93
|
+
/**
|
|
94
|
+
* The comparison operator to use for the filter.
|
|
95
|
+
*/
|
|
96
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual | ReadSelectedComparisonOperator.Contains | ReadSelectedComparisonOperator.StartsWith | ReadSelectedComparisonOperator.EndsWith;
|
|
97
|
+
} | {
|
|
98
|
+
/**
|
|
99
|
+
* The type of the property value being filtered.
|
|
100
|
+
*/
|
|
101
|
+
valueType: ReadSelectedPropertyType.DateTime | ReadSelectedPropertyType.DateTimeOffset | ReadSelectedPropertyType.TimeSpan | ReadSelectedPropertyType.DateOnly | ReadSelectedPropertyType.TimeOnly;
|
|
102
|
+
/**
|
|
103
|
+
* The comparison operator to use for the filter.
|
|
104
|
+
*/
|
|
105
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual | ReadSelectedComparisonOperator.LessThan | ReadSelectedComparisonOperator.LessOrEqual | ReadSelectedComparisonOperator.GreaterThan | ReadSelectedComparisonOperator.GreaterOrEqual;
|
|
106
|
+
};
|
|
107
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { ReadSelectedOrderingDirection } from '../..';
|
|
|
2
2
|
/**
|
|
3
3
|
* Defines the ordering property for a controller.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type ReadSelectedOrderingPropertyDefinitionDto = {
|
|
6
6
|
/**
|
|
7
7
|
* Gets or sets the property path.
|
|
8
8
|
*/
|
|
@@ -11,4 +11,4 @@ export declare class ReadSelectedOrderingPropertyDefinition {
|
|
|
11
11
|
* Gets or sets the sort direction.
|
|
12
12
|
*/
|
|
13
13
|
direction: ReadSelectedOrderingDirection;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defines the pagination parameters for a controller.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type ReadSelectedPaginationDefinitionDto = {
|
|
5
5
|
/**
|
|
6
6
|
* Pagination offset
|
|
7
7
|
*/
|
|
8
|
-
skip
|
|
8
|
+
skip: number;
|
|
9
9
|
/**
|
|
10
10
|
* Pagination limit
|
|
11
11
|
*/
|
|
12
|
-
limit
|
|
13
|
-
}
|
|
12
|
+
limit: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/data/api/dto/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
1
|
+
export * from './ReadSelectedDefinitionDto';
|
|
2
|
+
export * from './ReadSelectedFilteringDefinitionDto';
|
|
3
|
+
export * from './ReadSelectedFilteringPropertyDefinitionDto';
|
|
4
|
+
export * from './ReadSelectedOrderingDefinitionDto';
|
|
5
|
+
export * from './ReadSelectedOrderingPropertyDefinitionDto';
|
|
6
|
+
export * from './ReadSelectedPaginationDefinitionDto';
|
package/data/api/dto/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
1
|
+
export * from './ReadSelectedDefinitionDto';
|
|
2
|
+
export * from './ReadSelectedFilteringDefinitionDto';
|
|
3
|
+
export * from './ReadSelectedFilteringPropertyDefinitionDto';
|
|
4
|
+
export * from './ReadSelectedOrderingDefinitionDto';
|
|
5
|
+
export * from './ReadSelectedOrderingPropertyDefinitionDto';
|
|
6
|
+
export * from './ReadSelectedPaginationDefinitionDto';
|
|
@@ -9,5 +9,33 @@ export declare enum ReadSelectedComparisonOperator {
|
|
|
9
9
|
/**
|
|
10
10
|
* Represents the not equal comparison operator.
|
|
11
11
|
*/
|
|
12
|
-
NotEqual = 1
|
|
12
|
+
NotEqual = 1,
|
|
13
|
+
/**
|
|
14
|
+
* Represents the less than comparison operator.
|
|
15
|
+
*/
|
|
16
|
+
LessThan = 100,
|
|
17
|
+
/**
|
|
18
|
+
* Represents the less than or equal comparison operator.
|
|
19
|
+
*/
|
|
20
|
+
LessOrEqual = 101,
|
|
21
|
+
/**
|
|
22
|
+
* Represents the greater than comparison operator.
|
|
23
|
+
*/
|
|
24
|
+
GreaterThan = 102,
|
|
25
|
+
/**
|
|
26
|
+
* Represents the greater than or equal comparison operator.
|
|
27
|
+
*/
|
|
28
|
+
GreaterOrEqual = 103,
|
|
29
|
+
/**
|
|
30
|
+
* Represents the contains comparison operator.
|
|
31
|
+
*/
|
|
32
|
+
Contains = 200,
|
|
33
|
+
/**
|
|
34
|
+
* Represents the starts with comparison operator.
|
|
35
|
+
*/
|
|
36
|
+
StartsWith = 201,
|
|
37
|
+
/**
|
|
38
|
+
* Represents the ends with comparison operator.
|
|
39
|
+
*/
|
|
40
|
+
EndsWith = 202
|
|
13
41
|
}
|
|
@@ -14,10 +14,36 @@ export var ReadSelectedComparisonOperator;
|
|
|
14
14
|
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["NotEqual"] = 1] = "NotEqual";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region Number
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Represents the less than comparison operator.
|
|
19
|
+
*/
|
|
20
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["LessThan"] = 100] = "LessThan";
|
|
21
|
+
/**
|
|
22
|
+
* Represents the less than or equal comparison operator.
|
|
23
|
+
*/
|
|
24
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["LessOrEqual"] = 101] = "LessOrEqual";
|
|
25
|
+
/**
|
|
26
|
+
* Represents the greater than comparison operator.
|
|
27
|
+
*/
|
|
28
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["GreaterThan"] = 102] = "GreaterThan";
|
|
29
|
+
/**
|
|
30
|
+
* Represents the greater than or equal comparison operator.
|
|
31
|
+
*/
|
|
32
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["GreaterOrEqual"] = 103] = "GreaterOrEqual";
|
|
18
33
|
//#endregion
|
|
19
34
|
//#region String
|
|
20
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Represents the contains comparison operator.
|
|
37
|
+
*/
|
|
38
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["Contains"] = 200] = "Contains";
|
|
39
|
+
/**
|
|
40
|
+
* Represents the starts with comparison operator.
|
|
41
|
+
*/
|
|
42
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["StartsWith"] = 201] = "StartsWith";
|
|
43
|
+
/**
|
|
44
|
+
* Represents the ends with comparison operator.
|
|
45
|
+
*/
|
|
46
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["EndsWith"] = 202] = "EndsWith";
|
|
21
47
|
//#endregion
|
|
22
48
|
//#region Time
|
|
23
49
|
// ...
|
|
@@ -11,12 +11,48 @@ export declare enum ReadSelectedPropertyType {
|
|
|
11
11
|
* Represents an integer property type.
|
|
12
12
|
*/
|
|
13
13
|
Int = 100,
|
|
14
|
+
/**
|
|
15
|
+
* Represents a short property type.
|
|
16
|
+
*/
|
|
17
|
+
Short = 101,
|
|
14
18
|
/**
|
|
15
19
|
* Represents a long property type.
|
|
16
20
|
*/
|
|
17
|
-
Long =
|
|
21
|
+
Long = 102,
|
|
22
|
+
/**
|
|
23
|
+
* Represents a decimal property type.
|
|
24
|
+
*/
|
|
25
|
+
Decimal = 103,
|
|
26
|
+
/**
|
|
27
|
+
* Represents a double property type.
|
|
28
|
+
*/
|
|
29
|
+
Double = 104,
|
|
30
|
+
/**
|
|
31
|
+
* Represents a float property type.
|
|
32
|
+
*/
|
|
33
|
+
Float = 105,
|
|
18
34
|
/**
|
|
19
35
|
* Represents a string property type.
|
|
20
36
|
*/
|
|
21
|
-
String = 200
|
|
37
|
+
String = 200,
|
|
38
|
+
/**
|
|
39
|
+
* Represents a DateTime property type.
|
|
40
|
+
*/
|
|
41
|
+
DateTime = 300,
|
|
42
|
+
/**
|
|
43
|
+
* Represents a DateTimeOffset property type.
|
|
44
|
+
*/
|
|
45
|
+
DateTimeOffset = 301,
|
|
46
|
+
/**
|
|
47
|
+
* Represents a TimeSpan property type.
|
|
48
|
+
*/
|
|
49
|
+
TimeSpan = 302,
|
|
50
|
+
/**
|
|
51
|
+
* Represents a DateOnly property type.
|
|
52
|
+
*/
|
|
53
|
+
DateOnly = 303,
|
|
54
|
+
/**
|
|
55
|
+
* Represents a TimeOnly property type.
|
|
56
|
+
*/
|
|
57
|
+
TimeOnly = 304
|
|
22
58
|
}
|
|
@@ -15,10 +15,26 @@ export var ReadSelectedPropertyType;
|
|
|
15
15
|
* Represents an integer property type.
|
|
16
16
|
*/
|
|
17
17
|
ReadSelectedPropertyType[ReadSelectedPropertyType["Int"] = 100] = "Int";
|
|
18
|
+
/**
|
|
19
|
+
* Represents a short property type.
|
|
20
|
+
*/
|
|
21
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Short"] = 101] = "Short";
|
|
18
22
|
/**
|
|
19
23
|
* Represents a long property type.
|
|
20
24
|
*/
|
|
21
|
-
ReadSelectedPropertyType[ReadSelectedPropertyType["Long"] =
|
|
25
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Long"] = 102] = "Long";
|
|
26
|
+
/**
|
|
27
|
+
* Represents a decimal property type.
|
|
28
|
+
*/
|
|
29
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Decimal"] = 103] = "Decimal";
|
|
30
|
+
/**
|
|
31
|
+
* Represents a double property type.
|
|
32
|
+
*/
|
|
33
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Double"] = 104] = "Double";
|
|
34
|
+
/**
|
|
35
|
+
* Represents a float property type.
|
|
36
|
+
*/
|
|
37
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Float"] = 105] = "Float";
|
|
22
38
|
//#endregion
|
|
23
39
|
//#region string
|
|
24
40
|
/**
|
|
@@ -27,6 +43,25 @@ export var ReadSelectedPropertyType;
|
|
|
27
43
|
ReadSelectedPropertyType[ReadSelectedPropertyType["String"] = 200] = "String";
|
|
28
44
|
//#endregion
|
|
29
45
|
//#region Time
|
|
30
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Represents a DateTime property type.
|
|
48
|
+
*/
|
|
49
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["DateTime"] = 300] = "DateTime";
|
|
50
|
+
/**
|
|
51
|
+
* Represents a DateTimeOffset property type.
|
|
52
|
+
*/
|
|
53
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["DateTimeOffset"] = 301] = "DateTimeOffset";
|
|
54
|
+
/**
|
|
55
|
+
* Represents a TimeSpan property type.
|
|
56
|
+
*/
|
|
57
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["TimeSpan"] = 302] = "TimeSpan";
|
|
58
|
+
/**
|
|
59
|
+
* Represents a DateOnly property type.
|
|
60
|
+
*/
|
|
61
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["DateOnly"] = 303] = "DateOnly";
|
|
62
|
+
/**
|
|
63
|
+
* Represents a TimeOnly property type.
|
|
64
|
+
*/
|
|
65
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["TimeOnly"] = 304] = "TimeOnly";
|
|
31
66
|
//#endregion
|
|
32
67
|
})(ReadSelectedPropertyType || (ReadSelectedPropertyType = {}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Type for entities that have a Id property.
|
|
3
3
|
* Will be used as a primary key in the database.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type IIdentifiable<TKey> = {
|
|
6
6
|
/**
|
|
7
7
|
* Gets or sets the Id of the entity.
|
|
8
8
|
*/
|
|
9
9
|
id: TKey;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Type for entities that have a Guid property.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type IIdentifiableByGuid = {
|
|
5
5
|
/**
|
|
6
6
|
* Gets or sets the Guid of the entity.
|
|
7
7
|
*/
|
|
8
8
|
guid: string;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Type for entities that can, but don't have to have an Id property.
|
|
3
3
|
* If present, will be used as a primary key in the database, and if not it signifies an entity that was not yet
|
|
4
4
|
* stored.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type IOptionallyIdentifiable<TKey> = {
|
|
7
7
|
/**
|
|
8
8
|
* Gets or sets the Id of the entity.
|
|
9
9
|
*/
|
|
10
10
|
id?: TKey;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClaimDto } from '../..';
|
|
2
2
|
import { IIdentifiable } from '../..';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a user with an identifier and email address.
|
|
@@ -8,10 +8,10 @@ import { IIdentifiable } from '../..';
|
|
|
8
8
|
* @param {TKey} id The unique identifier for the user.
|
|
9
9
|
* @param {string} email The email address associated with the user.
|
|
10
10
|
* @param {string[]} roles The roles associated with the user.
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {ClaimDto[]} claims The claims associated with the user.
|
|
12
12
|
*/
|
|
13
|
-
export type
|
|
13
|
+
export type UserDto<TKey> = IIdentifiable<TKey> & {
|
|
14
14
|
email: string;
|
|
15
15
|
roles: string[];
|
|
16
|
-
claims:
|
|
16
|
+
claims: ClaimDto[];
|
|
17
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserDto } from '../..';
|
|
2
2
|
/**
|
|
3
3
|
* Represents user information along with access token expiry.
|
|
4
4
|
*
|
|
5
5
|
* @template TKey The type of the user identifier.
|
|
6
|
-
* @template TUser The type of the user object, defaulting to `
|
|
6
|
+
* @template TUser The type of the user object, defaulting to `UserDto<TKey>`.
|
|
7
7
|
*
|
|
8
8
|
* @param {TUser} user The user object containing user details.
|
|
9
9
|
* @param {Date} accessTokenExpiry The date and time when the access token will expire.
|
|
10
10
|
*/
|
|
11
|
-
export type
|
|
11
|
+
export type UserInfoDto<TKey, TUser = UserDto<TKey>> = {
|
|
12
12
|
user: TUser;
|
|
13
13
|
accessTokenExpiry: Date;
|
|
14
14
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|