@intellegens/cornerstone-client 0.0.0-experimental-upgrade-20260302-1
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 +256 -0
- package/demo/index.ts +29 -0
- package/demo/public_html/favicon.ico +0 -0
- package/demo/public_html/index.html +106 -0
- package/demo/public_html/websettings.json +3 -0
- package/dist/adapters/CollectionViewAdapter/index.d.ts +198 -0
- package/dist/adapters/CollectionViewAdapter/index.integration.test.d.ts +1 -0
- package/dist/adapters/CollectionViewAdapter/index.integration.test.js +163 -0
- package/dist/adapters/CollectionViewAdapter/index.js +381 -0
- package/dist/adapters/SearchAdapter/index.d.ts +55 -0
- package/dist/adapters/SearchAdapter/index.js +233 -0
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.js +2 -0
- package/dist/data/api/dto/PropertyPathDto.d.ts +4 -0
- package/dist/data/api/dto/PropertyPathDto.js +1 -0
- package/dist/data/api/dto/ReadOptionsDto.d.ts +8 -0
- package/dist/data/api/dto/ReadOptionsDto.js +1 -0
- package/dist/data/api/dto/ReadResultDto.d.ts +12 -0
- package/dist/data/api/dto/ReadResultDto.js +1 -0
- package/dist/data/api/dto/ReadResultMetadataDto.d.ts +8 -0
- package/dist/data/api/dto/ReadResultMetadataDto.js +1 -0
- package/dist/data/api/dto/crud/CrudMetadataDto.d.ts +4 -0
- package/dist/data/api/dto/crud/CrudMetadataDto.js +1 -0
- package/dist/data/api/dto/crud/index.d.ts +1 -0
- package/dist/data/api/dto/crud/index.js +1 -0
- package/dist/data/api/dto/index.d.ts +4 -0
- package/dist/data/api/dto/index.js +4 -0
- package/dist/data/api/dto/read/ReadMetadataDto.d.ts +8 -0
- package/dist/data/api/dto/read/ReadMetadataDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedDefinitionDto.d.ts +18 -0
- package/dist/data/api/dto/read/ReadSelectedDefinitionDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedNestedCollectionCriteriaDto.d.ts +22 -0
- package/dist/data/api/dto/read/ReadSelectedNestedCollectionCriteriaDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedNestedCriteriaDto.d.ts +18 -0
- package/dist/data/api/dto/read/ReadSelectedNestedCriteriaDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedOrderingDefinitionDto.d.ts +7 -0
- package/dist/data/api/dto/read/ReadSelectedOrderingDefinitionDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedOrderingPropertyDefinitionDto.d.ts +14 -0
- package/dist/data/api/dto/read/ReadSelectedOrderingPropertyDefinitionDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedPaginationDefinitionDto.d.ts +13 -0
- package/dist/data/api/dto/read/ReadSelectedPaginationDefinitionDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedSearchDefinitionBuilder.d.ts +167 -0
- package/dist/data/api/dto/read/ReadSelectedSearchDefinitionBuilder.js +267 -0
- package/dist/data/api/dto/read/ReadSelectedSearchDefinitionDto.d.ts +33 -0
- package/dist/data/api/dto/read/ReadSelectedSearchDefinitionDto.js +1 -0
- package/dist/data/api/dto/read/ReadSelectedSearchPropertyDefinitionDto.d.ts +114 -0
- package/dist/data/api/dto/read/ReadSelectedSearchPropertyDefinitionDto.js +1 -0
- package/dist/data/api/dto/read/index.d.ts +10 -0
- package/dist/data/api/dto/read/index.js +10 -0
- package/dist/data/api/dto/response/ApiErrorDto.d.ts +17 -0
- package/dist/data/api/dto/response/ApiErrorDto.js +1 -0
- package/dist/data/api/dto/response/ApiErrorResponseDto.d.ts +11 -0
- package/dist/data/api/dto/response/ApiErrorResponseDto.js +1 -0
- package/dist/data/api/dto/response/ApiResponseDto.d.ts +3 -0
- package/dist/data/api/dto/response/ApiResponseDto.js +1 -0
- package/dist/data/api/dto/response/ApiSuccessResponseDto.d.ts +13 -0
- package/dist/data/api/dto/response/ApiSuccessResponseDto.js +1 -0
- package/dist/data/api/dto/response/EmptyMetadataDto.d.ts +4 -0
- package/dist/data/api/dto/response/EmptyMetadataDto.js +1 -0
- package/dist/data/api/dto/response/MetadataDto.d.ts +25 -0
- package/dist/data/api/dto/response/MetadataDto.js +1 -0
- package/dist/data/api/dto/response/index.d.ts +5 -0
- package/dist/data/api/dto/response/index.js +5 -0
- package/dist/data/api/enum/index.d.ts +2 -0
- package/dist/data/api/enum/index.js +2 -0
- package/dist/data/api/enum/read/ReadSelectedCollectionOperator.d.ts +16 -0
- package/dist/data/api/enum/read/ReadSelectedCollectionOperator.js +17 -0
- package/dist/data/api/enum/read/ReadSelectedComparisonOperator.d.ts +69 -0
- package/dist/data/api/enum/read/ReadSelectedComparisonOperator.js +76 -0
- package/dist/data/api/enum/read/ReadSelectedLogicalOperator.d.ts +15 -0
- package/dist/data/api/enum/read/ReadSelectedLogicalOperator.js +16 -0
- package/dist/data/api/enum/read/ReadSelectedOrderingDirection.d.ts +13 -0
- package/dist/data/api/enum/read/ReadSelectedOrderingDirection.js +14 -0
- package/dist/data/api/enum/read/ReadSelectedPropertyType.d.ts +66 -0
- package/dist/data/api/enum/read/ReadSelectedPropertyType.js +75 -0
- package/dist/data/api/enum/read/index.d.ts +5 -0
- package/dist/data/api/enum/read/index.js +5 -0
- package/dist/data/api/enum/response/ApiErrorCodes.d.ts +7 -0
- package/dist/data/api/enum/response/ApiErrorCodes.js +8 -0
- package/dist/data/api/enum/response/ErrorCode.d.ts +13 -0
- package/dist/data/api/enum/response/ErrorCode.js +14 -0
- package/dist/data/api/enum/response/index.d.ts +1 -0
- package/dist/data/api/enum/response/index.js +1 -0
- package/dist/data/api/index.d.ts +3 -0
- package/dist/data/api/index.js +3 -0
- package/dist/data/api/interface/ICommonIdentifiable.d.ts +7 -0
- package/dist/data/api/interface/ICommonIdentifiable.js +1 -0
- package/dist/data/api/interface/IConcurrencySafe.d.ts +9 -0
- package/dist/data/api/interface/IConcurrencySafe.js +2 -0
- package/dist/data/api/interface/IIdentifiable.d.ts +11 -0
- package/dist/data/api/interface/IIdentifiable.js +1 -0
- package/dist/data/api/interface/IIdentifiableSecondary.d.ts +9 -0
- package/dist/data/api/interface/IIdentifiableSecondary.js +1 -0
- package/dist/data/api/interface/index.d.ts +3 -0
- package/dist/data/api/interface/index.js +3 -0
- package/dist/data/auth/dto/ClaimDto.d.ts +4 -0
- package/dist/data/auth/dto/ClaimDto.js +1 -0
- package/dist/data/auth/dto/RegisterRequestDto.d.ts +4 -0
- package/dist/data/auth/dto/RegisterRequestDto.js +1 -0
- package/dist/data/auth/dto/RoleDto.d.ts +5 -0
- package/dist/data/auth/dto/RoleDto.js +1 -0
- package/dist/data/auth/dto/SignInRequestDto.d.ts +4 -0
- package/dist/data/auth/dto/SignInRequestDto.js +1 -0
- package/dist/data/auth/dto/TokensDto.d.ts +4 -0
- package/dist/data/auth/dto/TokensDto.js +1 -0
- package/dist/data/auth/dto/UserDto.d.ts +17 -0
- package/dist/data/auth/dto/UserDto.js +1 -0
- package/dist/data/auth/dto/UserInfoDto.d.ts +14 -0
- package/dist/data/auth/dto/UserInfoDto.js +1 -0
- package/dist/data/auth/dto/index.d.ts +5 -0
- package/dist/data/auth/dto/index.js +5 -0
- package/dist/data/auth/index.d.ts +2 -0
- package/dist/data/auth/index.js +2 -0
- package/dist/data/auth/policy.d.ts +52 -0
- package/dist/data/auth/policy.js +44 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/services/api/ApiCrudControllerClient/index.d.ts +41 -0
- package/dist/services/api/ApiCrudControllerClient/index.integration.test.d.ts +1 -0
- package/dist/services/api/ApiCrudControllerClient/index.integration.test.js +34 -0
- package/dist/services/api/ApiCrudControllerClient/index.js +116 -0
- package/dist/services/api/ApiInitializationService/index.d.ts +106 -0
- package/dist/services/api/ApiInitializationService/index.js +208 -0
- package/dist/services/api/ApiReadControllerClient/index.d.ts +40 -0
- package/dist/services/api/ApiReadControllerClient/index.integration.test.d.ts +1 -0
- package/dist/services/api/ApiReadControllerClient/index.integration.test.js +59 -0
- package/dist/services/api/ApiReadControllerClient/index.js +111 -0
- package/dist/services/api/HttpService/FetchHttpService.d.ts +7 -0
- package/dist/services/api/HttpService/FetchHttpService.integration.test.d.ts +1 -0
- package/dist/services/api/HttpService/FetchHttpService.integration.test.js +52 -0
- package/dist/services/api/HttpService/FetchHttpService.js +29 -0
- package/dist/services/api/HttpService/HttpRequestConfig.d.ts +10 -0
- package/dist/services/api/HttpService/HttpRequestConfig.js +1 -0
- package/dist/services/api/HttpService/HttpResponse.d.ts +11 -0
- package/dist/services/api/HttpService/HttpResponse.js +3 -0
- package/dist/services/api/HttpService/IHttpService.d.ts +13 -0
- package/dist/services/api/HttpService/IHttpService.js +3 -0
- package/dist/services/api/HttpService/index.d.ts +9 -0
- package/dist/services/api/HttpService/index.js +10 -0
- package/dist/services/api/UserManagementControllerClient/index.d.ts +41 -0
- package/dist/services/api/UserManagementControllerClient/index.integration.test.d.ts +1 -0
- package/dist/services/api/UserManagementControllerClient/index.integration.test.js +60 -0
- package/dist/services/api/UserManagementControllerClient/index.js +117 -0
- package/dist/services/api/index.d.ts +5 -0
- package/dist/services/api/index.js +5 -0
- package/dist/services/auth/client/AuthService/index.d.ts +75 -0
- package/dist/services/auth/client/AuthService/index.js +200 -0
- package/dist/services/auth/client/AuthorizationManagementControllerClient/index.d.ts +48 -0
- package/dist/services/auth/client/AuthorizationManagementControllerClient/index.integration.test.d.ts +1 -0
- package/dist/services/auth/client/AuthorizationManagementControllerClient/index.integration.test.js +89 -0
- package/dist/services/auth/client/AuthorizationManagementControllerClient/index.js +148 -0
- package/dist/services/auth/client/index.d.ts +2 -0
- package/dist/services/auth/client/index.js +2 -0
- package/dist/services/auth/index.d.ts +1 -0
- package/dist/services/auth/index.js +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +2 -0
- package/dist/utils/authorization/index.d.ts +17 -0
- package/dist/utils/authorization/index.js +45 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/result/index.d.ts +21 -0
- package/dist/utils/result/index.js +16 -0
- package/dist/utils/search/index.d.ts +34 -0
- package/dist/utils/search/index.js +106 -0
- package/package.json +45 -0
- package/src/adapters/CollectionViewAdapter/index.integration.test.ts +197 -0
- package/src/adapters/CollectionViewAdapter/index.ts +477 -0
- package/src/adapters/SearchAdapter/index.ts +302 -0
- package/src/adapters/index.ts +2 -0
- package/src/data/api/dto/PropertyPathDto.ts +4 -0
- package/src/data/api/dto/ReadOptionsDto.ts +8 -0
- package/src/data/api/dto/ReadResultDto.ts +13 -0
- package/src/data/api/dto/ReadResultMetadataDto.ts +8 -0
- package/src/data/api/dto/crud/CrudMetadataDto.ts +4 -0
- package/src/data/api/dto/crud/index.ts +1 -0
- package/src/data/api/dto/index.ts +4 -0
- package/src/data/api/dto/read/ReadMetadataDto.ts +8 -0
- package/src/data/api/dto/read/ReadSelectedDefinitionDto.ts +21 -0
- package/src/data/api/dto/read/ReadSelectedNestedCollectionCriteriaDto.ts +25 -0
- package/src/data/api/dto/read/ReadSelectedNestedCriteriaDto.ts +20 -0
- package/src/data/api/dto/read/ReadSelectedOrderingDefinitionDto.ts +8 -0
- package/src/data/api/dto/read/ReadSelectedOrderingPropertyDefinitionDto.ts +16 -0
- package/src/data/api/dto/read/ReadSelectedPaginationDefinitionDto.ts +13 -0
- package/src/data/api/dto/read/ReadSelectedSearchDefinitionBuilder.ts +348 -0
- package/src/data/api/dto/read/ReadSelectedSearchDefinitionDto.ts +43 -0
- package/src/data/api/dto/read/ReadSelectedSearchPropertyDefinitionDto.ts +186 -0
- package/src/data/api/dto/read/index.ts +10 -0
- package/src/data/api/dto/response/ApiErrorDto.ts +21 -0
- package/src/data/api/dto/response/ApiErrorResponseDto.ts +13 -0
- package/src/data/api/dto/response/ApiResponseDto.ts +7 -0
- package/src/data/api/dto/response/ApiSuccessResponseDto.ts +13 -0
- package/src/data/api/dto/response/MetadataDto.ts +24 -0
- package/src/data/api/dto/response/index.ts +5 -0
- package/src/data/api/enum/index.ts +2 -0
- package/src/data/api/enum/read/ReadSelectedCollectionOperator.ts +17 -0
- package/src/data/api/enum/read/ReadSelectedComparisonOperator.ts +96 -0
- package/src/data/api/enum/read/ReadSelectedLogicalOperator.ts +16 -0
- package/src/data/api/enum/read/ReadSelectedOrderingDirection.ts +13 -0
- package/src/data/api/enum/read/ReadSelectedPropertyType.ts +96 -0
- package/src/data/api/enum/read/index.ts +5 -0
- package/src/data/api/enum/response/ErrorCode.ts +13 -0
- package/src/data/api/enum/response/index.ts +1 -0
- package/src/data/api/index.ts +3 -0
- package/src/data/api/interface/ICommonIdentifiable.ts +9 -0
- package/src/data/api/interface/IConcurrencySafe.ts +9 -0
- package/src/data/api/interface/IIdentifiable.ts +12 -0
- package/src/data/api/interface/IIdentifiableSecondary.ts +9 -0
- package/src/data/api/interface/index.ts +3 -0
- package/src/data/auth/dto/ClaimDto.ts +4 -0
- package/src/data/auth/dto/RegisterRequestDto.ts +4 -0
- package/src/data/auth/dto/RoleDto.ts +6 -0
- package/src/data/auth/dto/SignInRequestDto.ts +4 -0
- package/src/data/auth/dto/TokensDto.ts +4 -0
- package/src/data/auth/dto/UserDto.ts +18 -0
- package/src/data/auth/dto/UserInfoDto.ts +15 -0
- package/src/data/auth/dto/index.ts +5 -0
- package/src/data/auth/index.ts +2 -0
- package/src/data/auth/policy.ts +63 -0
- package/src/data/index.ts +2 -0
- package/src/index.ts +4 -0
- package/src/services/api/ApiCrudControllerClient/index.integration.test.ts +46 -0
- package/src/services/api/ApiCrudControllerClient/index.ts +135 -0
- package/src/services/api/ApiInitializationService/index.ts +254 -0
- package/src/services/api/ApiReadControllerClient/index.integration.test.ts +71 -0
- package/src/services/api/ApiReadControllerClient/index.ts +137 -0
- package/src/services/api/HttpService/FetchHttpService.integration.test.ts +65 -0
- package/src/services/api/HttpService/FetchHttpService.ts +34 -0
- package/src/services/api/HttpService/HttpRequestConfig.ts +10 -0
- package/src/services/api/HttpService/HttpResponse.ts +14 -0
- package/src/services/api/HttpService/IHttpService.ts +17 -0
- package/src/services/api/HttpService/README.md +106 -0
- package/src/services/api/HttpService/index.ts +12 -0
- package/src/services/api/UserManagementControllerClient/index.integration.test.ts +69 -0
- package/src/services/api/UserManagementControllerClient/index.ts +134 -0
- package/src/services/api/index.ts +5 -0
- package/src/services/auth/client/AuthService/index.ts +233 -0
- package/src/services/auth/client/AuthorizationManagementControllerClient/index.integration.test.ts +110 -0
- package/src/services/auth/client/AuthorizationManagementControllerClient/index.ts +165 -0
- package/src/services/auth/client/index.ts +2 -0
- package/src/services/auth/index.ts +1 -0
- package/src/services/index.ts +2 -0
- package/src/utils/authorization/index.ts +47 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/result/index.ts +25 -0
- package/src/utils/search/index.ts +150 -0
- package/tsconfig.json +19 -0
- package/vitest-setup.ts +43 -0
- package/vitest.config.ts +59 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the basic comparison operators that can be used in a controller.
|
|
3
|
+
*/
|
|
4
|
+
export var ReadSelectedComparisonOperator;
|
|
5
|
+
(function (ReadSelectedComparisonOperator) {
|
|
6
|
+
//#region Any type
|
|
7
|
+
/**
|
|
8
|
+
* Represents the equal comparison operator.
|
|
9
|
+
*/
|
|
10
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["Equal"] = 0] = "Equal";
|
|
11
|
+
/**
|
|
12
|
+
* Represents the not equal comparison operator.
|
|
13
|
+
*/
|
|
14
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["NotEqual"] = 1] = "NotEqual";
|
|
15
|
+
/**
|
|
16
|
+
* Represents the is null comparison operator.
|
|
17
|
+
*/
|
|
18
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["IsNull"] = 2] = "IsNull";
|
|
19
|
+
/**
|
|
20
|
+
* Represents the is not null comparison operator.
|
|
21
|
+
*/
|
|
22
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["IsNotNull"] = 3] = "IsNotNull";
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region Number
|
|
25
|
+
/**
|
|
26
|
+
* Represents the less than comparison operator.
|
|
27
|
+
*/
|
|
28
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["LessThan"] = 100] = "LessThan";
|
|
29
|
+
/**
|
|
30
|
+
* Represents the less than or equal comparison operator.
|
|
31
|
+
*/
|
|
32
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["LessOrEqual"] = 101] = "LessOrEqual";
|
|
33
|
+
/**
|
|
34
|
+
* Represents the greater than comparison operator.
|
|
35
|
+
*/
|
|
36
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["GreaterThan"] = 102] = "GreaterThan";
|
|
37
|
+
/**
|
|
38
|
+
* Represents the greater than or equal comparison operator.
|
|
39
|
+
*/
|
|
40
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["GreaterOrEqual"] = 103] = "GreaterOrEqual";
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region String
|
|
43
|
+
/**
|
|
44
|
+
* Represents the contains comparison operator.
|
|
45
|
+
*/
|
|
46
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["Contains"] = 200] = "Contains";
|
|
47
|
+
/**
|
|
48
|
+
* Represents the starts with comparison operator.
|
|
49
|
+
*/
|
|
50
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["StartsWith"] = 201] = "StartsWith";
|
|
51
|
+
/**
|
|
52
|
+
* Represents the ends with comparison operator.
|
|
53
|
+
*/
|
|
54
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["EndsWith"] = 202] = "EndsWith";
|
|
55
|
+
/**
|
|
56
|
+
* Represents the contains comparison operator (case-insensitive).
|
|
57
|
+
*/
|
|
58
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["IContains"] = 203] = "IContains";
|
|
59
|
+
/**
|
|
60
|
+
* Represents the starts with comparison operator (case-insensitive).
|
|
61
|
+
*/
|
|
62
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["IStartsWith"] = 204] = "IStartsWith";
|
|
63
|
+
/**
|
|
64
|
+
* Represents the ends with comparison operator (case-insensitive).
|
|
65
|
+
*/
|
|
66
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["IEndsWith"] = 205] = "IEndsWith";
|
|
67
|
+
/**
|
|
68
|
+
* Represents the equal comparison operator (case-insensitive).
|
|
69
|
+
*/
|
|
70
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["IEqual"] = 206] = "IEqual";
|
|
71
|
+
/**
|
|
72
|
+
* Represents the not equal comparison operator (case-insensitive).
|
|
73
|
+
*/
|
|
74
|
+
ReadSelectedComparisonOperator[ReadSelectedComparisonOperator["INotEqual"] = 207] = "INotEqual";
|
|
75
|
+
//#endregion
|
|
76
|
+
})(ReadSelectedComparisonOperator || (ReadSelectedComparisonOperator = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the logical operators that can be used in a controller.
|
|
3
|
+
* - The `And` operator combines multiple conditions, requiring all of them to be true.
|
|
4
|
+
* - The `Or` operator combines multiple conditions, requiring at least one of them to be true.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ReadSelectedLogicalOperator {
|
|
7
|
+
/**
|
|
8
|
+
* Represents the logical AND operator.
|
|
9
|
+
*/
|
|
10
|
+
And = 0,
|
|
11
|
+
/**
|
|
12
|
+
* Represents the logical OR operator.
|
|
13
|
+
*/
|
|
14
|
+
Or = 1
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the logical operators that can be used in a controller.
|
|
3
|
+
* - The `And` operator combines multiple conditions, requiring all of them to be true.
|
|
4
|
+
* - The `Or` operator combines multiple conditions, requiring at least one of them to be true.
|
|
5
|
+
*/
|
|
6
|
+
export var ReadSelectedLogicalOperator;
|
|
7
|
+
(function (ReadSelectedLogicalOperator) {
|
|
8
|
+
/**
|
|
9
|
+
* Represents the logical AND operator.
|
|
10
|
+
*/
|
|
11
|
+
ReadSelectedLogicalOperator[ReadSelectedLogicalOperator["And"] = 0] = "And";
|
|
12
|
+
/**
|
|
13
|
+
* Represents the logical OR operator.
|
|
14
|
+
*/
|
|
15
|
+
ReadSelectedLogicalOperator[ReadSelectedLogicalOperator["Or"] = 1] = "Or";
|
|
16
|
+
})(ReadSelectedLogicalOperator || (ReadSelectedLogicalOperator = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents options for ordering directions
|
|
3
|
+
*/
|
|
4
|
+
export var ReadSelectedOrderingDirection;
|
|
5
|
+
(function (ReadSelectedOrderingDirection) {
|
|
6
|
+
/**
|
|
7
|
+
* Ascending ordering
|
|
8
|
+
*/
|
|
9
|
+
ReadSelectedOrderingDirection[ReadSelectedOrderingDirection["Ascending"] = 0] = "Ascending";
|
|
10
|
+
/**
|
|
11
|
+
* Descending ordering
|
|
12
|
+
*/
|
|
13
|
+
ReadSelectedOrderingDirection[ReadSelectedOrderingDirection["Descending"] = 1] = "Descending";
|
|
14
|
+
})(ReadSelectedOrderingDirection || (ReadSelectedOrderingDirection = {}));
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the basic property types that can be used in a controller.
|
|
3
|
+
* - The ReadSelectedPropertyType enum defines the basic property types that can be used in a fetch controller. These types include boolean, integer, long, and string.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ReadSelectedPropertyType {
|
|
6
|
+
/**
|
|
7
|
+
* Represents a boolean property type.
|
|
8
|
+
*/
|
|
9
|
+
Bool = 0,
|
|
10
|
+
/**
|
|
11
|
+
* Represents an integer property type.
|
|
12
|
+
*/
|
|
13
|
+
Int = 100,
|
|
14
|
+
/**
|
|
15
|
+
* Represents a short property type.
|
|
16
|
+
*/
|
|
17
|
+
Short = 101,
|
|
18
|
+
/**
|
|
19
|
+
* Represents a long property type.
|
|
20
|
+
*/
|
|
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,
|
|
34
|
+
/**
|
|
35
|
+
* Represents a string property type.
|
|
36
|
+
*/
|
|
37
|
+
String = 200,
|
|
38
|
+
/**
|
|
39
|
+
* Represents a Guid property type.
|
|
40
|
+
*/
|
|
41
|
+
Guid = 201,
|
|
42
|
+
/**
|
|
43
|
+
* Represents a DateTime property type.
|
|
44
|
+
*/
|
|
45
|
+
DateTime = 300,
|
|
46
|
+
/**
|
|
47
|
+
* Represents a DateTimeOffset property type.
|
|
48
|
+
*/
|
|
49
|
+
DateTimeOffset = 301,
|
|
50
|
+
/**
|
|
51
|
+
* Represents a TimeSpan property type.
|
|
52
|
+
*/
|
|
53
|
+
TimeSpan = 302,
|
|
54
|
+
/**
|
|
55
|
+
* Represents a DateOnly property type.
|
|
56
|
+
*/
|
|
57
|
+
DateOnly = 303,
|
|
58
|
+
/**
|
|
59
|
+
* Represents a TimeOnly property type.
|
|
60
|
+
*/
|
|
61
|
+
TimeOnly = 304,
|
|
62
|
+
/**
|
|
63
|
+
* Represents an Enum property type.
|
|
64
|
+
*/
|
|
65
|
+
Enum = 400
|
|
66
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the basic property types that can be used in a controller.
|
|
3
|
+
* - The ReadSelectedPropertyType enum defines the basic property types that can be used in a fetch controller. These types include boolean, integer, long, and string.
|
|
4
|
+
*/
|
|
5
|
+
export var ReadSelectedPropertyType;
|
|
6
|
+
(function (ReadSelectedPropertyType) {
|
|
7
|
+
//#region Boolean
|
|
8
|
+
/**
|
|
9
|
+
* Represents a boolean property type.
|
|
10
|
+
*/
|
|
11
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Bool"] = 0] = "Bool";
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region Number
|
|
14
|
+
/**
|
|
15
|
+
* Represents an integer property type.
|
|
16
|
+
*/
|
|
17
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Int"] = 100] = "Int";
|
|
18
|
+
/**
|
|
19
|
+
* Represents a short property type.
|
|
20
|
+
*/
|
|
21
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Short"] = 101] = "Short";
|
|
22
|
+
/**
|
|
23
|
+
* Represents a long property type.
|
|
24
|
+
*/
|
|
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";
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region string
|
|
40
|
+
/**
|
|
41
|
+
* Represents a string property type.
|
|
42
|
+
*/
|
|
43
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["String"] = 200] = "String";
|
|
44
|
+
/**
|
|
45
|
+
* Represents a Guid property type.
|
|
46
|
+
*/
|
|
47
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Guid"] = 201] = "Guid";
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region Time
|
|
50
|
+
/**
|
|
51
|
+
* Represents a DateTime property type.
|
|
52
|
+
*/
|
|
53
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["DateTime"] = 300] = "DateTime";
|
|
54
|
+
/**
|
|
55
|
+
* Represents a DateTimeOffset property type.
|
|
56
|
+
*/
|
|
57
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["DateTimeOffset"] = 301] = "DateTimeOffset";
|
|
58
|
+
/**
|
|
59
|
+
* Represents a TimeSpan property type.
|
|
60
|
+
*/
|
|
61
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["TimeSpan"] = 302] = "TimeSpan";
|
|
62
|
+
/**
|
|
63
|
+
* Represents a DateOnly property type.
|
|
64
|
+
*/
|
|
65
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["DateOnly"] = 303] = "DateOnly";
|
|
66
|
+
/**
|
|
67
|
+
* Represents a TimeOnly property type.
|
|
68
|
+
*/
|
|
69
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["TimeOnly"] = 304] = "TimeOnly";
|
|
70
|
+
//#endregion
|
|
71
|
+
/**
|
|
72
|
+
* Represents an Enum property type.
|
|
73
|
+
*/
|
|
74
|
+
ReadSelectedPropertyType[ReadSelectedPropertyType["Enum"] = 400] = "Enum";
|
|
75
|
+
})(ReadSelectedPropertyType || (ReadSelectedPropertyType = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents available error codes to be returned as part of the ApiResponse object
|
|
3
|
+
*/
|
|
4
|
+
export var ApiErrorCodes;
|
|
5
|
+
(function (ApiErrorCodes) {
|
|
6
|
+
ApiErrorCodes[ApiErrorCodes["NotFound"] = 404] = "NotFound";
|
|
7
|
+
ApiErrorCodes[ApiErrorCodes["BadRequest"] = 400] = "BadRequest";
|
|
8
|
+
})(ApiErrorCodes || (ApiErrorCodes = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents available error codes to be returned as part of the ApiResponse object
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ErrorCode {
|
|
5
|
+
InternalServerError = 500,
|
|
6
|
+
NotFound = 404,
|
|
7
|
+
BadRequest = 400,
|
|
8
|
+
NotImplemented = 501,
|
|
9
|
+
Unauthorized = 401,
|
|
10
|
+
GatewayTimeout = 504,
|
|
11
|
+
ValidationFailed = 422,
|
|
12
|
+
UnknownError = 599
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents available error codes to be returned as part of the ApiResponse object
|
|
3
|
+
*/
|
|
4
|
+
export var ErrorCode;
|
|
5
|
+
(function (ErrorCode) {
|
|
6
|
+
ErrorCode[ErrorCode["InternalServerError"] = 500] = "InternalServerError";
|
|
7
|
+
ErrorCode[ErrorCode["NotFound"] = 404] = "NotFound";
|
|
8
|
+
ErrorCode[ErrorCode["BadRequest"] = 400] = "BadRequest";
|
|
9
|
+
ErrorCode[ErrorCode["NotImplemented"] = 501] = "NotImplemented";
|
|
10
|
+
ErrorCode[ErrorCode["Unauthorized"] = 401] = "Unauthorized";
|
|
11
|
+
ErrorCode[ErrorCode["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
12
|
+
ErrorCode[ErrorCode["ValidationFailed"] = 422] = "ValidationFailed";
|
|
13
|
+
ErrorCode[ErrorCode["UnknownError"] = 599] = "UnknownError";
|
|
14
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ErrorCode';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ErrorCode';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IConcurrencySafe } from './IConcurrencySafe';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for entities that have a Id property.
|
|
4
|
+
* Will be used as a primary key in the database.
|
|
5
|
+
*/
|
|
6
|
+
export interface IIdentifiable<TKey> extends IConcurrencySafe {
|
|
7
|
+
/**
|
|
8
|
+
* Gets or sets the Id of the entity.
|
|
9
|
+
*/
|
|
10
|
+
id: TKey;
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ClaimDto } from '../..';
|
|
2
|
+
import { IIdentifiable } from '../..';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a user with an identifier and email address.
|
|
5
|
+
*
|
|
6
|
+
* @template TKey The type of the user identifier.
|
|
7
|
+
*
|
|
8
|
+
* @param {TKey} id The unique identifier for the user.
|
|
9
|
+
* @param {string} email The email address associated with the user.
|
|
10
|
+
* @param {string[]} roles The roles associated with the user.
|
|
11
|
+
* @param {ClaimDto[]} claims The claims associated with the user.
|
|
12
|
+
*/
|
|
13
|
+
export type UserDto<TKey> = IIdentifiable<TKey> & {
|
|
14
|
+
email: string;
|
|
15
|
+
roles: string[];
|
|
16
|
+
claims: ClaimDto[];
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UserDto } from '../..';
|
|
2
|
+
/**
|
|
3
|
+
* Represents user information along with access token expiry.
|
|
4
|
+
*
|
|
5
|
+
* @template TKey The type of the user identifier.
|
|
6
|
+
* @template TUser The type of the user object, defaulting to `UserDto<TKey>`.
|
|
7
|
+
*
|
|
8
|
+
* @param {TUser} user The user object containing user details.
|
|
9
|
+
* @param {Date} accessTokenExpiry The date and time when the access token will expire.
|
|
10
|
+
*/
|
|
11
|
+
export type UserInfoDto<TKey, TUser = UserDto<TKey>> = {
|
|
12
|
+
user: TUser;
|
|
13
|
+
accessTokenExpiry: Date;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for policies that can be checked.
|
|
3
|
+
*
|
|
4
|
+
* @interface IPolicy<TParams extends unknown[]>
|
|
5
|
+
* @template TParams - The type of the parameters that will be passed to the policy check function.
|
|
6
|
+
*/
|
|
7
|
+
export interface IPolicy<TParams extends unknown[]> {
|
|
8
|
+
/**
|
|
9
|
+
* Checks if the policy is valid for the given parameters.
|
|
10
|
+
*
|
|
11
|
+
* @param params - Parameters to pass to the policy check function.
|
|
12
|
+
* @return A promise that resolves if the policy is valid, rejects otherwise.
|
|
13
|
+
*/
|
|
14
|
+
check(...params: TParams): Promise<boolean>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Base class for policies. It implements the IPolicy interface.
|
|
18
|
+
*
|
|
19
|
+
* @class PolicyBase
|
|
20
|
+
* @template TParams - The type of the parameters that will be passed to the policy check function.
|
|
21
|
+
*/
|
|
22
|
+
export declare class PolicyBase<TParams extends unknown[]> implements IPolicy<TParams> {
|
|
23
|
+
/**
|
|
24
|
+
* Checks if the policy is valid for the given parameters.
|
|
25
|
+
*
|
|
26
|
+
* @return A promise that resolves if the policy is valid, rejects otherwise.
|
|
27
|
+
* @throws {Error} Error if not implemented.
|
|
28
|
+
*/
|
|
29
|
+
check(): Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Class for policies that can be checked.
|
|
33
|
+
*
|
|
34
|
+
* @class Policy
|
|
35
|
+
* @template TParams - The type of the parameters that will be passed to the policy check function.
|
|
36
|
+
*/
|
|
37
|
+
export declare class Policy<TParams extends unknown[]> extends PolicyBase<TParams> {
|
|
38
|
+
private readonly _verificationFn;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new policy.
|
|
41
|
+
*
|
|
42
|
+
* @param verificationFn - The function that will be used to verify the policy.
|
|
43
|
+
*/
|
|
44
|
+
constructor(verificationFn: (...params: TParams) => Promise<boolean>);
|
|
45
|
+
/**
|
|
46
|
+
* Checks if the policy is valid for the given parameters.
|
|
47
|
+
*
|
|
48
|
+
* @param params - Parameters to pass to the policy check function.
|
|
49
|
+
* @return A promise that resolves if the policy is valid, rejects otherwise.
|
|
50
|
+
*/
|
|
51
|
+
check(...params: TParams): Promise<boolean>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for policies. It implements the IPolicy interface.
|
|
3
|
+
*
|
|
4
|
+
* @class PolicyBase
|
|
5
|
+
* @template TParams - The type of the parameters that will be passed to the policy check function.
|
|
6
|
+
*/
|
|
7
|
+
export class PolicyBase {
|
|
8
|
+
/**
|
|
9
|
+
* Checks if the policy is valid for the given parameters.
|
|
10
|
+
*
|
|
11
|
+
* @return A promise that resolves if the policy is valid, rejects otherwise.
|
|
12
|
+
* @throws {Error} Error if not implemented.
|
|
13
|
+
*/
|
|
14
|
+
async check() {
|
|
15
|
+
throw new Error('Not implemented');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Class for policies that can be checked.
|
|
20
|
+
*
|
|
21
|
+
* @class Policy
|
|
22
|
+
* @template TParams - The type of the parameters that will be passed to the policy check function.
|
|
23
|
+
*/
|
|
24
|
+
export class Policy extends PolicyBase {
|
|
25
|
+
_verificationFn;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new policy.
|
|
28
|
+
*
|
|
29
|
+
* @param verificationFn - The function that will be used to verify the policy.
|
|
30
|
+
*/
|
|
31
|
+
constructor(verificationFn) {
|
|
32
|
+
super();
|
|
33
|
+
this._verificationFn = verificationFn;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the policy is valid for the given parameters.
|
|
37
|
+
*
|
|
38
|
+
* @param params - Parameters to pass to the policy check function.
|
|
39
|
+
* @return A promise that resolves if the policy is valid, rejects otherwise.
|
|
40
|
+
*/
|
|
41
|
+
async check(...params) {
|
|
42
|
+
return this._verificationFn(...params);
|
|
43
|
+
}
|
|
44
|
+
}
|
package/dist/index.d.ts
ADDED