@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,267 @@
|
|
|
1
|
+
import { ReadSelectedCollectionOperator, ReadSelectedComparisonOperator, ReadSelectedLogicalOperator, ReadSelectedPropertyType } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* Builder class for constructing ReadSelectedSearchDefinitionDto with a fluent API.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Simple AND search with property criteria
|
|
7
|
+
* const search = SearchBuilder.and<User>()
|
|
8
|
+
* .whereString('name', ReadSelectedComparisonOperator.IContains, 'John')
|
|
9
|
+
* .whereNumber('age', ReadSelectedComparisonOperator.GreaterThan, 18)
|
|
10
|
+
* .build();
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // OR search with nested criteria (specify nested type for intellisense)
|
|
14
|
+
* const search = SearchBuilder.or<User>()
|
|
15
|
+
* .whereString('status', ReadSelectedComparisonOperator.Equal, 'active')
|
|
16
|
+
* .nested<Address>('address', nested =>
|
|
17
|
+
* nested.whereString('city', ReadSelectedComparisonOperator.Equal, 'NYC')
|
|
18
|
+
* )
|
|
19
|
+
* .build();
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Complex nested search with collection criteria
|
|
23
|
+
* const search = SearchBuilder.and<Order>()
|
|
24
|
+
* .whereString('status', ReadSelectedComparisonOperator.Equal, 'pending')
|
|
25
|
+
* .any<OrderItem>('items', itemSearch =>
|
|
26
|
+
* itemSearch.whereNumber('quantity', ReadSelectedComparisonOperator.GreaterThan, 5)
|
|
27
|
+
* )
|
|
28
|
+
* .group(sub => sub.or()
|
|
29
|
+
* .whereString('priority', ReadSelectedComparisonOperator.Equal, 'high')
|
|
30
|
+
* .whereString('priority', ReadSelectedComparisonOperator.Equal, 'urgent')
|
|
31
|
+
* )
|
|
32
|
+
* .build();
|
|
33
|
+
*/
|
|
34
|
+
export class SearchBuilder {
|
|
35
|
+
_logicalOperator;
|
|
36
|
+
_searches = [];
|
|
37
|
+
_propertyCriteria = [];
|
|
38
|
+
_nestedCriteria = [];
|
|
39
|
+
_nestedCollectionCriteria = [];
|
|
40
|
+
constructor(logicalOperator) {
|
|
41
|
+
this._logicalOperator = logicalOperator;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new builder with AND logical operator.
|
|
45
|
+
* All criteria added to this builder will be combined with AND.
|
|
46
|
+
*/
|
|
47
|
+
static and() {
|
|
48
|
+
return new SearchBuilder(ReadSelectedLogicalOperator.And);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new builder with OR logical operator.
|
|
52
|
+
* All criteria added to this builder will be combined with OR.
|
|
53
|
+
*/
|
|
54
|
+
static or() {
|
|
55
|
+
return new SearchBuilder(ReadSelectedLogicalOperator.Or);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sets the logical operator to AND.
|
|
59
|
+
*/
|
|
60
|
+
and() {
|
|
61
|
+
this._logicalOperator = ReadSelectedLogicalOperator.And;
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Sets the logical operator to OR.
|
|
66
|
+
*/
|
|
67
|
+
or() {
|
|
68
|
+
this._logicalOperator = ReadSelectedLogicalOperator.Or;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Adds a property comparison criterion.
|
|
73
|
+
*
|
|
74
|
+
* @param propertyName - The property to compare
|
|
75
|
+
* @param comparisonOperator - The comparison operator to use
|
|
76
|
+
* @param value - The value to compare against
|
|
77
|
+
* @param valueType - The type of the value
|
|
78
|
+
*/
|
|
79
|
+
where(propertyName, comparisonOperator, value, valueType) {
|
|
80
|
+
this._propertyCriteria.push({
|
|
81
|
+
propertyName: this.toPascalCase(propertyName),
|
|
82
|
+
comparisonOperator,
|
|
83
|
+
value,
|
|
84
|
+
valueType,
|
|
85
|
+
});
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Adds a string property comparison with common string operations.
|
|
90
|
+
*/
|
|
91
|
+
whereString(propertyName, comparisonOperator, value) {
|
|
92
|
+
return this.where(propertyName, comparisonOperator, value, ReadSelectedPropertyType.String);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Adds a number property comparison.
|
|
96
|
+
*/
|
|
97
|
+
whereNumber(propertyName, comparisonOperator, value, valueType = ReadSelectedPropertyType.Int) {
|
|
98
|
+
return this.where(propertyName, comparisonOperator, value, valueType);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Adds a boolean property comparison.
|
|
102
|
+
*/
|
|
103
|
+
whereBool(propertyName, comparisonOperator, value) {
|
|
104
|
+
return this.where(propertyName, comparisonOperator, value, ReadSelectedPropertyType.Bool);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Adds a date/time property comparison.
|
|
108
|
+
*/
|
|
109
|
+
whereDate(propertyName, comparisonOperator, value, valueType = ReadSelectedPropertyType.DateTime) {
|
|
110
|
+
const stringValue = value instanceof Date ? value.toISOString() : value;
|
|
111
|
+
return this.where(propertyName, comparisonOperator, stringValue, valueType);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Adds an isNull check for a property.
|
|
115
|
+
*/
|
|
116
|
+
whereNull(propertyName) {
|
|
117
|
+
this._propertyCriteria.push({
|
|
118
|
+
propertyName: this.toPascalCase(propertyName),
|
|
119
|
+
comparisonOperator: ReadSelectedComparisonOperator.IsNull,
|
|
120
|
+
value: null,
|
|
121
|
+
valueType: ReadSelectedPropertyType.String,
|
|
122
|
+
});
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Adds an isNotNull check for a property.
|
|
127
|
+
*/
|
|
128
|
+
whereNotNull(propertyName) {
|
|
129
|
+
this._propertyCriteria.push({
|
|
130
|
+
propertyName: this.toPascalCase(propertyName),
|
|
131
|
+
comparisonOperator: ReadSelectedComparisonOperator.IsNotNull,
|
|
132
|
+
value: null,
|
|
133
|
+
valueType: ReadSelectedPropertyType.String,
|
|
134
|
+
});
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Adds criteria for a nested object property (navigation property).
|
|
139
|
+
*
|
|
140
|
+
* @param propertyName - The navigation property name
|
|
141
|
+
* @param builderFn - A function that receives a new builder for the nested type
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* // With explicit type for proper intellisense
|
|
145
|
+
* SearchBuilder.and<VehicleDto>()
|
|
146
|
+
* .nested<PersonDto>('driver', nested =>
|
|
147
|
+
* nested.whereString('name', ReadSelectedComparisonOperator.Contains, 'Alice')
|
|
148
|
+
* )
|
|
149
|
+
* .build();
|
|
150
|
+
*/
|
|
151
|
+
nested(propertyName, builderFn) {
|
|
152
|
+
const nestedBuilder = SearchBuilder.and();
|
|
153
|
+
const configuredBuilder = builderFn(nestedBuilder);
|
|
154
|
+
this._nestedCriteria.push({
|
|
155
|
+
propertyName: this.toPascalCase(propertyName),
|
|
156
|
+
criteria: configuredBuilder.build(),
|
|
157
|
+
});
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Adds criteria for a collection property with Any quantifier.
|
|
162
|
+
* Matches if at least one element in the collection satisfies the criteria.
|
|
163
|
+
*
|
|
164
|
+
* @param propertyName - The collection property name
|
|
165
|
+
* @param builderFn - A function that receives a new builder for the collection element type
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* // With explicit type for proper intellisense
|
|
169
|
+
* SearchBuilder.and<VehicleDto>()
|
|
170
|
+
* .any<PersonDto>('passengers', passengers =>
|
|
171
|
+
* passengers.whereString('name', ReadSelectedComparisonOperator.Contains, 'Bob')
|
|
172
|
+
* )
|
|
173
|
+
* .build();
|
|
174
|
+
*/
|
|
175
|
+
any(propertyName, builderFn) {
|
|
176
|
+
const nestedBuilder = SearchBuilder.and();
|
|
177
|
+
const configuredBuilder = builderFn(nestedBuilder);
|
|
178
|
+
this._nestedCollectionCriteria.push({
|
|
179
|
+
propertyName: this.toPascalCase(propertyName),
|
|
180
|
+
collectionOperator: ReadSelectedCollectionOperator.Any,
|
|
181
|
+
criteria: configuredBuilder.build(),
|
|
182
|
+
});
|
|
183
|
+
return this;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Adds criteria for a collection property with All quantifier.
|
|
187
|
+
* Matches if all elements in the collection satisfy the criteria.
|
|
188
|
+
*
|
|
189
|
+
* @param propertyName - The collection property name
|
|
190
|
+
* @param builderFn - A function that receives a new builder for the collection element type
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* // With explicit type for proper intellisense
|
|
194
|
+
* SearchBuilder.and<VehicleDto>()
|
|
195
|
+
* .all<PersonDto>('passengers', passengers =>
|
|
196
|
+
* passengers.whereNumber('age', ReadSelectedComparisonOperator.GreaterThan, 18)
|
|
197
|
+
* )
|
|
198
|
+
* .build();
|
|
199
|
+
*/
|
|
200
|
+
all(propertyName, builderFn) {
|
|
201
|
+
const nestedBuilder = SearchBuilder.and();
|
|
202
|
+
const configuredBuilder = builderFn(nestedBuilder);
|
|
203
|
+
this._nestedCollectionCriteria.push({
|
|
204
|
+
propertyName: this.toPascalCase(propertyName),
|
|
205
|
+
collectionOperator: ReadSelectedCollectionOperator.All,
|
|
206
|
+
criteria: configuredBuilder.build(),
|
|
207
|
+
});
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Adds a nested search group. Use this for complex logical groupings.
|
|
212
|
+
*
|
|
213
|
+
* @param builderFn - A function that receives a new builder for creating the nested search
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* // (name contains 'John') AND ((age > 18) OR (status = 'verified'))
|
|
217
|
+
* SearchBuilder.and<User>()
|
|
218
|
+
* .whereString('name', ReadSelectedComparisonOperator.IContains, 'John')
|
|
219
|
+
* .group(sub => sub.or()
|
|
220
|
+
* .whereNumber('age', ReadSelectedComparisonOperator.GreaterThan, 18)
|
|
221
|
+
* .whereString('status', ReadSelectedComparisonOperator.Equal, 'verified')
|
|
222
|
+
* )
|
|
223
|
+
* .build();
|
|
224
|
+
*/
|
|
225
|
+
group(builderFn) {
|
|
226
|
+
const nestedBuilder = SearchBuilder.and();
|
|
227
|
+
const configuredBuilder = builderFn(nestedBuilder);
|
|
228
|
+
this._searches.push(configuredBuilder.build());
|
|
229
|
+
return this;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Adds an existing search definition as a nested search.
|
|
233
|
+
*
|
|
234
|
+
* @param search - An existing ReadSelectedSearchDefinitionDto
|
|
235
|
+
*/
|
|
236
|
+
addSearch(search) {
|
|
237
|
+
this._searches.push(search);
|
|
238
|
+
return this;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Builds and returns the ReadSelectedSearchDefinitionDto.
|
|
242
|
+
*/
|
|
243
|
+
build() {
|
|
244
|
+
const result = {
|
|
245
|
+
logicalOperator: this._logicalOperator,
|
|
246
|
+
};
|
|
247
|
+
if (this._searches.length > 0) {
|
|
248
|
+
result.searches = this._searches;
|
|
249
|
+
}
|
|
250
|
+
if (this._propertyCriteria.length > 0) {
|
|
251
|
+
result.propertyCriteria = this._propertyCriteria;
|
|
252
|
+
}
|
|
253
|
+
if (this._nestedCriteria.length > 0) {
|
|
254
|
+
result.nestedCriteria = this._nestedCriteria;
|
|
255
|
+
}
|
|
256
|
+
if (this._nestedCollectionCriteria.length > 0) {
|
|
257
|
+
result.nestedCollectionCriteria = this._nestedCollectionCriteria;
|
|
258
|
+
}
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
toPascalCase(str) {
|
|
262
|
+
if (typeof str !== 'string') {
|
|
263
|
+
return str.toString();
|
|
264
|
+
}
|
|
265
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReadSelectedLogicalOperator, ReadSelectedNestedCollectionCriteriaDto, ReadSelectedNestedCriteriaDto, ReadSelectedSearchPropertyDefinitionDto } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the search criteria for a controller using a recursive structure.
|
|
4
|
+
*
|
|
5
|
+
* This DTO supports complex search queries with:
|
|
6
|
+
* - Logical operators (AND/OR) to combine multiple criteria
|
|
7
|
+
* - Direct property value comparisons via `propertyCriteria`
|
|
8
|
+
* - Nested searches via `searches` for recursive query composition
|
|
9
|
+
* - Navigation into nested objects via `nestedCriteria`
|
|
10
|
+
* - Collection quantifier queries (Any/All) via `nestedCollectionCriteria`
|
|
11
|
+
*/
|
|
12
|
+
export type ReadSelectedSearchDefinitionDto<T> = {
|
|
13
|
+
/**
|
|
14
|
+
* The logical operator to combine all criteria at this level.
|
|
15
|
+
*/
|
|
16
|
+
logicalOperator: ReadSelectedLogicalOperator;
|
|
17
|
+
/**
|
|
18
|
+
* Recursive nested search definitions combined with the logical operator.
|
|
19
|
+
*/
|
|
20
|
+
searches?: ReadSelectedSearchDefinitionDto<T>[];
|
|
21
|
+
/**
|
|
22
|
+
* Direct property value comparison criteria.
|
|
23
|
+
*/
|
|
24
|
+
propertyCriteria?: ReadSelectedSearchPropertyDefinitionDto<T, keyof T>[];
|
|
25
|
+
/**
|
|
26
|
+
* Criteria for searching within nested object properties.
|
|
27
|
+
*/
|
|
28
|
+
nestedCriteria?: ReadSelectedNestedCriteriaDto<T, keyof T>[];
|
|
29
|
+
/**
|
|
30
|
+
* Criteria for searching within collection properties using Any/All quantifiers.
|
|
31
|
+
*/
|
|
32
|
+
nestedCollectionCriteria?: ReadSelectedNestedCollectionCriteriaDto<T, keyof T>[];
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ReadSelectedComparisonOperator, ReadSelectedPropertyType } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* Defines a direct property value comparison criteria for searching.
|
|
4
|
+
*
|
|
5
|
+
* This DTO represents a leaf-level search criterion that compares a single property
|
|
6
|
+
* against a value using a comparison operator. For nested property searches, use
|
|
7
|
+
* `ReadSelectedNestedCriteriaDto` or `ReadSelectedNestedCollectionCriteriaDto`.
|
|
8
|
+
*/
|
|
9
|
+
export type ReadSelectedSearchPropertyDefinitionDto<T, TPropertyName extends keyof T> = Partial_ReadSelectedSearchPropertyDefinition_IndependentProperties<T, TPropertyName> & Partial_ReadSelectedSearchPropertyDefinition_TypedValueProperty & Partial_ReadSelectedSearchPropertyDefinition_TypedComparisonOperators;
|
|
10
|
+
/**
|
|
11
|
+
* Defines independent properties
|
|
12
|
+
*/
|
|
13
|
+
type Partial_ReadSelectedSearchPropertyDefinition_IndependentProperties<T, TPropertyName extends keyof T> = {
|
|
14
|
+
/**
|
|
15
|
+
* The name of the property to compare.
|
|
16
|
+
*
|
|
17
|
+
* This must be a direct property on the target type, not a nested property path.
|
|
18
|
+
* Use nested criteria DTOs for navigation.
|
|
19
|
+
*/
|
|
20
|
+
propertyName: TPropertyName;
|
|
21
|
+
/**
|
|
22
|
+
* The comparison operator to use for the search.
|
|
23
|
+
*/
|
|
24
|
+
comparisonOperator: ReadSelectedComparisonOperator;
|
|
25
|
+
/**
|
|
26
|
+
* The type of the property value being searched.
|
|
27
|
+
*/
|
|
28
|
+
valueType: ReadSelectedPropertyType;
|
|
29
|
+
/**
|
|
30
|
+
* The value to compare against.
|
|
31
|
+
*/
|
|
32
|
+
value: unknown;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Defines the dependence between the .valueType and the type of the .value properties
|
|
36
|
+
*/
|
|
37
|
+
type Partial_ReadSelectedSearchPropertyDefinition_TypedValueProperty = {
|
|
38
|
+
/**
|
|
39
|
+
* The type of the property value being searched.
|
|
40
|
+
*/
|
|
41
|
+
valueType: ReadSelectedPropertyType.Bool;
|
|
42
|
+
/**
|
|
43
|
+
* The value to use for the search.
|
|
44
|
+
*/
|
|
45
|
+
value: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
/**
|
|
48
|
+
* The type of the property value being searched.
|
|
49
|
+
*/
|
|
50
|
+
valueType: ReadSelectedPropertyType.Int | ReadSelectedPropertyType.Short | ReadSelectedPropertyType.Long | ReadSelectedPropertyType.Decimal | ReadSelectedPropertyType.Double | ReadSelectedPropertyType.Float;
|
|
51
|
+
/**
|
|
52
|
+
* The value to use for the search.
|
|
53
|
+
*/
|
|
54
|
+
value: number;
|
|
55
|
+
} | {
|
|
56
|
+
/**
|
|
57
|
+
* The type of the property value being searched.
|
|
58
|
+
*/
|
|
59
|
+
valueType: ReadSelectedPropertyType.String;
|
|
60
|
+
/**
|
|
61
|
+
* The value to use for the search.
|
|
62
|
+
*/
|
|
63
|
+
value: string;
|
|
64
|
+
} | {
|
|
65
|
+
/**
|
|
66
|
+
* The type of the property value being searched.
|
|
67
|
+
*/
|
|
68
|
+
valueType: ReadSelectedPropertyType.DateTime | ReadSelectedPropertyType.DateTimeOffset | ReadSelectedPropertyType.TimeSpan | ReadSelectedPropertyType.DateOnly | ReadSelectedPropertyType.TimeOnly;
|
|
69
|
+
/**
|
|
70
|
+
* The value to use for the search.
|
|
71
|
+
*/
|
|
72
|
+
value: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Defines the dependence between the .valueType and the type of the .comparisonOperator properties
|
|
76
|
+
*/
|
|
77
|
+
type Partial_ReadSelectedSearchPropertyDefinition_TypedComparisonOperators = {
|
|
78
|
+
/**
|
|
79
|
+
* The type of the property value being searched.
|
|
80
|
+
*/
|
|
81
|
+
valueType: ReadSelectedPropertyType.Bool;
|
|
82
|
+
/**
|
|
83
|
+
* The comparison operator to use for the search.
|
|
84
|
+
*/
|
|
85
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual;
|
|
86
|
+
} | {
|
|
87
|
+
/**
|
|
88
|
+
* The type of the property value being searched.
|
|
89
|
+
*/
|
|
90
|
+
valueType: ReadSelectedPropertyType.Int | ReadSelectedPropertyType.Short | ReadSelectedPropertyType.Long | ReadSelectedPropertyType.Decimal | ReadSelectedPropertyType.Double | ReadSelectedPropertyType.Float;
|
|
91
|
+
/**
|
|
92
|
+
* The comparison operator to use for the search.
|
|
93
|
+
*/
|
|
94
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual | ReadSelectedComparisonOperator.LessThan | ReadSelectedComparisonOperator.LessOrEqual | ReadSelectedComparisonOperator.GreaterThan | ReadSelectedComparisonOperator.GreaterOrEqual;
|
|
95
|
+
} | {
|
|
96
|
+
/**
|
|
97
|
+
* The type of the property value being searched.
|
|
98
|
+
*/
|
|
99
|
+
valueType: ReadSelectedPropertyType.String;
|
|
100
|
+
/**
|
|
101
|
+
* The comparison operator to use for the search.
|
|
102
|
+
*/
|
|
103
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual | ReadSelectedComparisonOperator.Contains | ReadSelectedComparisonOperator.StartsWith | ReadSelectedComparisonOperator.EndsWith | ReadSelectedComparisonOperator.IContains | ReadSelectedComparisonOperator.IStartsWith | ReadSelectedComparisonOperator.IEndsWith | ReadSelectedComparisonOperator.IEqual | ReadSelectedComparisonOperator.INotEqual;
|
|
104
|
+
} | {
|
|
105
|
+
/**
|
|
106
|
+
* The type of the property value being searched.
|
|
107
|
+
*/
|
|
108
|
+
valueType: ReadSelectedPropertyType.DateTime | ReadSelectedPropertyType.DateTimeOffset | ReadSelectedPropertyType.TimeSpan | ReadSelectedPropertyType.DateOnly | ReadSelectedPropertyType.TimeOnly;
|
|
109
|
+
/**
|
|
110
|
+
* The comparison operator to use for the search.
|
|
111
|
+
*/
|
|
112
|
+
comparisonOperator: ReadSelectedComparisonOperator.Equal | ReadSelectedComparisonOperator.NotEqual | ReadSelectedComparisonOperator.LessThan | ReadSelectedComparisonOperator.LessOrEqual | ReadSelectedComparisonOperator.GreaterThan | ReadSelectedComparisonOperator.GreaterOrEqual;
|
|
113
|
+
};
|
|
114
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ReadMetadataDto';
|
|
2
|
+
export * from './ReadSelectedSearchPropertyDefinitionDto';
|
|
3
|
+
export * from './ReadSelectedNestedCriteriaDto';
|
|
4
|
+
export * from './ReadSelectedNestedCollectionCriteriaDto';
|
|
5
|
+
export * from './ReadSelectedOrderingDefinitionDto';
|
|
6
|
+
export * from './ReadSelectedOrderingPropertyDefinitionDto';
|
|
7
|
+
export * from './ReadSelectedPaginationDefinitionDto';
|
|
8
|
+
export * from './ReadSelectedDefinitionDto';
|
|
9
|
+
export * from './ReadSelectedSearchDefinitionDto';
|
|
10
|
+
export * from './ReadSelectedSearchDefinitionBuilder';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ReadMetadataDto';
|
|
2
|
+
export * from './ReadSelectedSearchPropertyDefinitionDto';
|
|
3
|
+
export * from './ReadSelectedNestedCriteriaDto';
|
|
4
|
+
export * from './ReadSelectedNestedCollectionCriteriaDto';
|
|
5
|
+
export * from './ReadSelectedOrderingDefinitionDto';
|
|
6
|
+
export * from './ReadSelectedOrderingPropertyDefinitionDto';
|
|
7
|
+
export * from './ReadSelectedPaginationDefinitionDto';
|
|
8
|
+
export * from './ReadSelectedDefinitionDto';
|
|
9
|
+
export * from './ReadSelectedSearchDefinitionDto';
|
|
10
|
+
export * from './ReadSelectedSearchDefinitionBuilder';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EmptyMetadataDto, ErrorCode, ValidationFailedMetadataDto } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* Default, empty metadata.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiErrorDto<TMetadata extends ApiErrorMetadataDto = ApiErrorMetadataDto> = {
|
|
6
|
+
message: string;
|
|
7
|
+
details?: string;
|
|
8
|
+
traceId?: string;
|
|
9
|
+
timestamp?: string;
|
|
10
|
+
} & TMetadata;
|
|
11
|
+
export type ApiErrorMetadataDto = {
|
|
12
|
+
code: ErrorCode.ValidationFailed;
|
|
13
|
+
metadata: ValidationFailedMetadataDto;
|
|
14
|
+
} | {
|
|
15
|
+
code: Omit<number, ErrorCode.ValidationFailed>;
|
|
16
|
+
metadata: EmptyMetadataDto;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiErrorDto, ApiErrorMetadataDto } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an API response containing an error and empty metadata.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiErrorResponseDto<TErrorMetadata extends ApiErrorMetadataDto = ApiErrorMetadataDto> = {
|
|
6
|
+
ok: false;
|
|
7
|
+
/**
|
|
8
|
+
* The error object containing information about the error
|
|
9
|
+
*/
|
|
10
|
+
error: ApiErrorDto<TErrorMetadata>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ApiErrorMetadataDto, ApiErrorResponseDto, ApiSuccessResponseDto } from '../../../../data';
|
|
2
|
+
import { Result } from '../../../../utils/result';
|
|
3
|
+
export type ApiResponseDto<T, TMetadata extends object, TErrorMetadata extends ApiErrorMetadataDto = ApiErrorMetadataDto> = Result<ApiSuccessResponseDto<T, TMetadata>, ApiErrorResponseDto<TErrorMetadata>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a successful API response containing a result and metadata.
|
|
3
|
+
*
|
|
4
|
+
* @template T The type of result
|
|
5
|
+
* @template TMetadata The type of metadata
|
|
6
|
+
* @property {T} result - The result returned
|
|
7
|
+
* @property {TMetadata} metadata - Metadata about the result
|
|
8
|
+
*/
|
|
9
|
+
export type ApiSuccessResponseDto<T, TMetadata> = {
|
|
10
|
+
ok: true;
|
|
11
|
+
result: T;
|
|
12
|
+
metadata: TMetadata;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const __brand: unique symbol;
|
|
2
|
+
/**
|
|
3
|
+
* Utility type for creating branded types that are nominally different but structurally identical.
|
|
4
|
+
* This enables compile-time type safety for values that would otherwise have the same runtime structure.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The brand identifier string literal type
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* type UserId = Brand<'userId'>;
|
|
11
|
+
* type OrderId = Brand<'orderId'>;
|
|
12
|
+
*
|
|
13
|
+
* const userId: UserId = { [__brand]: 'userId' } as UserId;
|
|
14
|
+
* const orderId: OrderId = userId; // Type error! Different brands
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type Brand<T extends string> = {
|
|
18
|
+
[__brand]: T;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Default, empty metadata.
|
|
22
|
+
*/
|
|
23
|
+
export type EmptyMetadataDto = Brand<'emptyMetadata'>;
|
|
24
|
+
export type ValidationFailedMetadataDto = Brand<'validationFailedMetadata'>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the collection quantifier operators that can be used when searching collection properties.
|
|
3
|
+
*
|
|
4
|
+
* The `Any` operator matches if at least one element in the collection satisfies the criteria.
|
|
5
|
+
* The `All` operator matches if all elements in the collection satisfy the criteria.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ReadSelectedCollectionOperator {
|
|
8
|
+
/**
|
|
9
|
+
* Matches if at least one element in the collection satisfies the criteria.
|
|
10
|
+
*/
|
|
11
|
+
Any = 0,
|
|
12
|
+
/**
|
|
13
|
+
* Matches if all elements in the collection satisfy the criteria.
|
|
14
|
+
*/
|
|
15
|
+
All = 1
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the collection quantifier operators that can be used when searching collection properties.
|
|
3
|
+
*
|
|
4
|
+
* The `Any` operator matches if at least one element in the collection satisfies the criteria.
|
|
5
|
+
* The `All` operator matches if all elements in the collection satisfy the criteria.
|
|
6
|
+
*/
|
|
7
|
+
export var ReadSelectedCollectionOperator;
|
|
8
|
+
(function (ReadSelectedCollectionOperator) {
|
|
9
|
+
/**
|
|
10
|
+
* Matches if at least one element in the collection satisfies the criteria.
|
|
11
|
+
*/
|
|
12
|
+
ReadSelectedCollectionOperator[ReadSelectedCollectionOperator["Any"] = 0] = "Any";
|
|
13
|
+
/**
|
|
14
|
+
* Matches if all elements in the collection satisfy the criteria.
|
|
15
|
+
*/
|
|
16
|
+
ReadSelectedCollectionOperator[ReadSelectedCollectionOperator["All"] = 1] = "All";
|
|
17
|
+
})(ReadSelectedCollectionOperator || (ReadSelectedCollectionOperator = {}));
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the basic comparison operators that can be used in a controller.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ReadSelectedComparisonOperator {
|
|
5
|
+
/**
|
|
6
|
+
* Represents the equal comparison operator.
|
|
7
|
+
*/
|
|
8
|
+
Equal = 0,
|
|
9
|
+
/**
|
|
10
|
+
* Represents the not equal comparison operator.
|
|
11
|
+
*/
|
|
12
|
+
NotEqual = 1,
|
|
13
|
+
/**
|
|
14
|
+
* Represents the is null comparison operator.
|
|
15
|
+
*/
|
|
16
|
+
IsNull = 2,
|
|
17
|
+
/**
|
|
18
|
+
* Represents the is not null comparison operator.
|
|
19
|
+
*/
|
|
20
|
+
IsNotNull = 3,
|
|
21
|
+
/**
|
|
22
|
+
* Represents the less than comparison operator.
|
|
23
|
+
*/
|
|
24
|
+
LessThan = 100,
|
|
25
|
+
/**
|
|
26
|
+
* Represents the less than or equal comparison operator.
|
|
27
|
+
*/
|
|
28
|
+
LessOrEqual = 101,
|
|
29
|
+
/**
|
|
30
|
+
* Represents the greater than comparison operator.
|
|
31
|
+
*/
|
|
32
|
+
GreaterThan = 102,
|
|
33
|
+
/**
|
|
34
|
+
* Represents the greater than or equal comparison operator.
|
|
35
|
+
*/
|
|
36
|
+
GreaterOrEqual = 103,
|
|
37
|
+
/**
|
|
38
|
+
* Represents the contains comparison operator.
|
|
39
|
+
*/
|
|
40
|
+
Contains = 200,
|
|
41
|
+
/**
|
|
42
|
+
* Represents the starts with comparison operator.
|
|
43
|
+
*/
|
|
44
|
+
StartsWith = 201,
|
|
45
|
+
/**
|
|
46
|
+
* Represents the ends with comparison operator.
|
|
47
|
+
*/
|
|
48
|
+
EndsWith = 202,
|
|
49
|
+
/**
|
|
50
|
+
* Represents the contains comparison operator (case-insensitive).
|
|
51
|
+
*/
|
|
52
|
+
IContains = 203,
|
|
53
|
+
/**
|
|
54
|
+
* Represents the starts with comparison operator (case-insensitive).
|
|
55
|
+
*/
|
|
56
|
+
IStartsWith = 204,
|
|
57
|
+
/**
|
|
58
|
+
* Represents the ends with comparison operator (case-insensitive).
|
|
59
|
+
*/
|
|
60
|
+
IEndsWith = 205,
|
|
61
|
+
/**
|
|
62
|
+
* Represents the equal comparison operator (case-insensitive).
|
|
63
|
+
*/
|
|
64
|
+
IEqual = 206,
|
|
65
|
+
/**
|
|
66
|
+
* Represents the not equal comparison operator (case-insensitive).
|
|
67
|
+
*/
|
|
68
|
+
INotEqual = 207
|
|
69
|
+
}
|