@creatio/base 0.1000.0 → 0.1000.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/CHANGELOG.md +5 -1
- package/LICENSE.md +5 -6
- package/THIRD_PARTY_LICENSES.txt +147 -0
- package/fesm2022/creatio-base.mjs +216 -3
- package/fesm2022/creatio-base.mjs.map +1 -1
- package/index.d.ts +289 -1
- package/package.json +1 -13
- package/types/creatio-base.d.ts +311 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 0.1000.1
|
|
2
|
+
- feature - Added class `SegmentFilter` for segment-membership filtering. A `SegmentFilter` tests whether a row's primary key is present in (or absent from) the per-segment data table identified by `SegmentFilterOptions.segmentId`. Serialises to `filterType: 7` in the `SelectQuery` wire format. Comparison type defaults to `ComparisonType.Exists` ("row is in segment"); pass `ComparisonType.Not_exists` for exclusion.
|
|
3
|
+
- feature - Added interface `SegmentFilterOptions` (runtime options for a segment filter), interface `SegmentFilterOptionsDto` (wire-level serialisation of options), interface `SegmentFilterDto` (wire-level shape of a full segment filter), and type `SegmentFilterComparisonType` (union of `ComparisonType.Exists` and `ComparisonType.Not_exists`).
|
|
4
|
+
- feature - Added `FilterType.Segment` (value `7`) to the `FilterType` enum to identify segment-membership filters in discriminated dispatch.
|
|
5
|
+
- feature - Made `SingleFilter` and `CompareFilter` generic over `LeftExpression extends BaseExpression` (defaults to `BaseExpression`), allowing callers to narrow the left-expression type without casting.
|
|
2
6
|
|
|
3
7
|
# 0.834.0
|
|
4
8
|
- feature - Added method `remove(filterKey)` to `FilterGroup` to remove a filter from the group by key.
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Creatio EMEA LTD. Proprietary. All rights reserved.
|
|
2
|
+
Internal Creatio component; not licensed for external use or distribution.
|
|
3
|
+
|
|
4
|
+
This package includes third-party open-source components. See
|
|
5
|
+
THIRD_PARTY_LICENSES.txt for the list of components and their license terms.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Third-Party Software Notices and Information for @creatio/base
|
|
2
|
+
==============================================================
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
This package declares the following third-party open-source components as
|
|
6
|
+
dependencies and peerDependencies. Each component is redistributed under its
|
|
7
|
+
own license. Creatio EMEA LTD makes no additional claim of copyright over
|
|
8
|
+
these components.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
----------------------------------------------------------------
|
|
12
|
+
Component: tslib
|
|
13
|
+
Version: ^2.3.0
|
|
14
|
+
Installed: 2.8.1
|
|
15
|
+
Declared: dependency
|
|
16
|
+
License: 0BSD
|
|
17
|
+
Source: https://github.com/Microsoft/tslib
|
|
18
|
+
----------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
Copyright (c) Microsoft Corporation.
|
|
21
|
+
|
|
22
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
23
|
+
purpose with or without fee is hereby granted.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
26
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
27
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
28
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
29
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
30
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
----------------------------------------------------------------
|
|
35
|
+
Component: fs-extra
|
|
36
|
+
Version: ^9.1.0
|
|
37
|
+
Installed: 9.1.0
|
|
38
|
+
Declared: peerDependency
|
|
39
|
+
License: MIT
|
|
40
|
+
Source: https://github.com/jprichardson/node-fs-extra
|
|
41
|
+
----------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
(The MIT License)
|
|
44
|
+
|
|
45
|
+
Copyright (c) 2011-2017 JP Richardson
|
|
46
|
+
|
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
48
|
+
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
|
49
|
+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
50
|
+
furnished to do so, subject to the following conditions:
|
|
51
|
+
|
|
52
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
53
|
+
|
|
54
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
55
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
56
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
57
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
----------------------------------------------------------------
|
|
61
|
+
Component: class-transformer
|
|
62
|
+
Version: ^0.5.1
|
|
63
|
+
Installed: 0.5.1
|
|
64
|
+
Declared: peerDependency
|
|
65
|
+
License: MIT
|
|
66
|
+
Source: https://github.com/typestack/class-transformer
|
|
67
|
+
----------------------------------------------------------------
|
|
68
|
+
|
|
69
|
+
The MIT License
|
|
70
|
+
|
|
71
|
+
Copyright (c) 2015-2020 TypeStack
|
|
72
|
+
|
|
73
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
74
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
75
|
+
in the Software without restriction, including without limitation the rights
|
|
76
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
77
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
78
|
+
furnished to do so, subject to the following conditions:
|
|
79
|
+
|
|
80
|
+
The above copyright notice and this permission notice shall be included in
|
|
81
|
+
all copies or substantial portions of the Software.
|
|
82
|
+
|
|
83
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
84
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
85
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
86
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
87
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
88
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
89
|
+
THE SOFTWARE.
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
----------------------------------------------------------------
|
|
93
|
+
Component: lodash
|
|
94
|
+
Version: ^4.17.21
|
|
95
|
+
Installed: 4.18.1
|
|
96
|
+
Declared: peerDependency
|
|
97
|
+
License: MIT
|
|
98
|
+
Source: lodash/lodash
|
|
99
|
+
----------------------------------------------------------------
|
|
100
|
+
|
|
101
|
+
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
102
|
+
|
|
103
|
+
Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
104
|
+
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
105
|
+
|
|
106
|
+
This software consists of voluntary contributions made by many
|
|
107
|
+
individuals. For exact contribution history, see the revision history
|
|
108
|
+
available at https://github.com/lodash/lodash
|
|
109
|
+
|
|
110
|
+
The following license applies to all parts of this software except as
|
|
111
|
+
documented below:
|
|
112
|
+
|
|
113
|
+
====
|
|
114
|
+
|
|
115
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
116
|
+
a copy of this software and associated documentation files (the
|
|
117
|
+
"Software"), to deal in the Software without restriction, including
|
|
118
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
119
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
120
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
121
|
+
the following conditions:
|
|
122
|
+
|
|
123
|
+
The above copyright notice and this permission notice shall be
|
|
124
|
+
included in all copies or substantial portions of the Software.
|
|
125
|
+
|
|
126
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
127
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
128
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
129
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
130
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
131
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
132
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
133
|
+
|
|
134
|
+
====
|
|
135
|
+
|
|
136
|
+
Copyright and related rights for sample code are waived via CC0. Sample
|
|
137
|
+
code is defined as all source code displayed within the prose of the
|
|
138
|
+
documentation.
|
|
139
|
+
|
|
140
|
+
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
|
141
|
+
|
|
142
|
+
====
|
|
143
|
+
|
|
144
|
+
Files located in the node_modules and vendor directories are externally
|
|
145
|
+
maintained libraries used by this software which have their own
|
|
146
|
+
licenses; we recommend you read them, as their terms may differ from the
|
|
147
|
+
terms above.
|
|
@@ -780,6 +780,19 @@ var ɵExpressionType;
|
|
|
780
780
|
ɵExpressionType[ɵExpressionType["ArithmeticOperation"] = 4] = "ArithmeticOperation";
|
|
781
781
|
})(ɵExpressionType || (ɵExpressionType = {}));
|
|
782
782
|
|
|
783
|
+
/**
|
|
784
|
+
* @public
|
|
785
|
+
* @description The origin kind of a filter group — where the group was created from.
|
|
786
|
+
*/
|
|
787
|
+
var ɵFilterGroupOriginType;
|
|
788
|
+
(function (ɵFilterGroupOriginType) {
|
|
789
|
+
/**
|
|
790
|
+
* @public
|
|
791
|
+
* @description The group was created from a predefined filter (preset).
|
|
792
|
+
*/
|
|
793
|
+
ɵFilterGroupOriginType["Predefined"] = "Predefined";
|
|
794
|
+
})(ɵFilterGroupOriginType || (ɵFilterGroupOriginType = {}));
|
|
795
|
+
|
|
783
796
|
/**
|
|
784
797
|
* @public
|
|
785
798
|
* @description The type of filter.
|
|
@@ -789,6 +802,9 @@ var ɵExpressionType;
|
|
|
789
802
|
* - 4 In, Checks if a value is in a specified set of values.
|
|
790
803
|
* - 5 Exists, Checks if a value exists.
|
|
791
804
|
* - 6 FilterGroup, A group of filters combined with logical operators (AND, OR).
|
|
805
|
+
* - 7 Segment, Segment-membership filter — EXISTS / NOT EXISTS against the per-segment
|
|
806
|
+
* data table addressed by SegmentFilterOptions.segmentId. Documented in
|
|
807
|
+
* `crt-data-segmentation-engine/architecture/artifacts/insegment-filter-api.md`.
|
|
792
808
|
*/
|
|
793
809
|
var ɵFilterType;
|
|
794
810
|
(function (ɵFilterType) {
|
|
@@ -829,6 +845,14 @@ var ɵFilterType;
|
|
|
829
845
|
* @description A group of filters combined with logical operators (AND, OR).
|
|
830
846
|
*/
|
|
831
847
|
ɵFilterType[ɵFilterType["FilterGroup"] = 6] = "FilterGroup";
|
|
848
|
+
/**
|
|
849
|
+
* @public
|
|
850
|
+
* @description Segment-membership filter. Carries a nested SegmentFilterOptions payload;
|
|
851
|
+
* the backend resolves segmentId via the SysDataSegment lookup and emits an EXISTS / NOT
|
|
852
|
+
* EXISTS subquery against the segment's per-segment data table. Use comparisonType
|
|
853
|
+
* Exists (15) for "in segment" and Not_exists (16) for "not in segment".
|
|
854
|
+
*/
|
|
855
|
+
ɵFilterType[ɵFilterType["Segment"] = 7] = "Segment";
|
|
832
856
|
})(ɵFilterType || (ɵFilterType = {}));
|
|
833
857
|
|
|
834
858
|
/**
|
|
@@ -2367,6 +2391,9 @@ class ɵFilterGroup extends ɵBaseFilter {
|
|
|
2367
2391
|
const logicalOperation = dto['logicalOperation'];
|
|
2368
2392
|
const group = new ɵFilterGroup(logicalOperation || ɵLogicalOperatorType.And, dto['rootSchemaName']);
|
|
2369
2393
|
group.uId = dto['uId'];
|
|
2394
|
+
if (dto['filterGroupOrigin']) {
|
|
2395
|
+
group.filterGroupOrigin = dto['filterGroupOrigin'];
|
|
2396
|
+
}
|
|
2370
2397
|
Object.entries(dto['items']).forEach(([key, filterDTO]) => {
|
|
2371
2398
|
group.add(filterParser.fromJson(filterDTO), key);
|
|
2372
2399
|
});
|
|
@@ -2383,6 +2410,9 @@ class ɵFilterGroup extends ɵBaseFilter {
|
|
|
2383
2410
|
if (this.rootSchemaName) {
|
|
2384
2411
|
result['rootSchemaName'] = this.rootSchemaName;
|
|
2385
2412
|
}
|
|
2413
|
+
if (this.filterGroupOrigin) {
|
|
2414
|
+
result['filterGroupOrigin'] = this.filterGroupOrigin;
|
|
2415
|
+
}
|
|
2386
2416
|
return result;
|
|
2387
2417
|
}
|
|
2388
2418
|
_createParameterValueExpressions(values) {
|
|
@@ -2535,6 +2565,9 @@ class ɵFilterGroup extends ɵBaseFilter {
|
|
|
2535
2565
|
filterGroup.uId = this.uId;
|
|
2536
2566
|
filterGroup.isEnabled = this.isEnabled;
|
|
2537
2567
|
filterGroup.trimDateTimeParameterToDate = this.trimDateTimeParameterToDate;
|
|
2568
|
+
if (this.filterGroupOrigin) {
|
|
2569
|
+
filterGroup.filterGroupOrigin = this.filterGroupOrigin;
|
|
2570
|
+
}
|
|
2538
2571
|
return filterGroup;
|
|
2539
2572
|
}
|
|
2540
2573
|
/**
|
|
@@ -2763,7 +2796,6 @@ class ɵExpressionMock extends ɵBaseExpression {
|
|
|
2763
2796
|
super(config || {});
|
|
2764
2797
|
this.expressionType = ɵEXPRESSION_TYPE_MOCK;
|
|
2765
2798
|
}
|
|
2766
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2767
2799
|
get plainObject() {
|
|
2768
2800
|
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
2769
2801
|
}
|
|
@@ -2794,7 +2826,6 @@ class ɵFilterMock extends ɵBaseFilter {
|
|
|
2794
2826
|
constructor(filterType = ɵFilterType.None) {
|
|
2795
2827
|
super(filterType);
|
|
2796
2828
|
}
|
|
2797
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2798
2829
|
get plainObject() {
|
|
2799
2830
|
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
2800
2831
|
}
|
|
@@ -2820,6 +2851,187 @@ const ɵparserMock = {
|
|
|
2820
2851
|
clone: () => this,
|
|
2821
2852
|
};
|
|
2822
2853
|
|
|
2854
|
+
/**
|
|
2855
|
+
* @public
|
|
2856
|
+
* @description Segment-membership filter. Tests whether the outer row's primary key is
|
|
2857
|
+
* present in (or absent from, with `Not_exists`) the per-segment data table named by
|
|
2858
|
+
* `SegmentFilterOptions.segmentId`.
|
|
2859
|
+
*
|
|
2860
|
+
* Wire form (DataService `SelectQuery` filters):
|
|
2861
|
+
* ```jsonc
|
|
2862
|
+
* {
|
|
2863
|
+
* "filterType": 7, // FilterType.Segment
|
|
2864
|
+
* "comparisonType": 15, // 15 = Exists (IN), 16 = Not_exists (NOT IN)
|
|
2865
|
+
* "isEnabled": true,
|
|
2866
|
+
* "segmentFilterOptions": {
|
|
2867
|
+
* "segmentId": "<SysDataSegment.Id>"
|
|
2868
|
+
* }
|
|
2869
|
+
* }
|
|
2870
|
+
* ```
|
|
2871
|
+
*
|
|
2872
|
+
* Extends `BaseFilter` directly — segment filters have no `leftExpression`, so they don't
|
|
2873
|
+
* share `SingleFilter`'s contract. Structurally a sibling of `FilterGroup` in that respect.
|
|
2874
|
+
*
|
|
2875
|
+
* @extends {BaseFilter}
|
|
2876
|
+
*/
|
|
2877
|
+
class ɵSegmentFilter extends ɵBaseFilter {
|
|
2878
|
+
/**
|
|
2879
|
+
* @internal
|
|
2880
|
+
* @dontChange
|
|
2881
|
+
*/
|
|
2882
|
+
static { this._instanceOfKey = 'devkit_SegmentFilter'; }
|
|
2883
|
+
/**
|
|
2884
|
+
* @internal
|
|
2885
|
+
* @dontChange
|
|
2886
|
+
*/
|
|
2887
|
+
static get _instanceOfKeys() {
|
|
2888
|
+
return [...ɵBaseFilter._instanceOfKeys, ɵSegmentFilter._instanceOfKey];
|
|
2889
|
+
}
|
|
2890
|
+
constructor(segmentFilterOptions, comparisonType = ɵComparisonType.Exists) {
|
|
2891
|
+
super(ɵFilterType.Segment);
|
|
2892
|
+
/**
|
|
2893
|
+
* @description Type of filter.
|
|
2894
|
+
* @default 7
|
|
2895
|
+
*/
|
|
2896
|
+
this.filterType = ɵFilterType.Segment;
|
|
2897
|
+
this._segmentFilterOptions = { ...segmentFilterOptions };
|
|
2898
|
+
this._comparisonType = comparisonType;
|
|
2899
|
+
}
|
|
2900
|
+
/**
|
|
2901
|
+
* @public
|
|
2902
|
+
* @description Segment selection + membership-mode + temporal bounds. The nested
|
|
2903
|
+
* object is the wire-level payload — backend reads it as
|
|
2904
|
+
* `Terrasoft.Core.Entities.SegmentFilterOptions`. Read-only from outside; mutate
|
|
2905
|
+
* via {@link ɵSegmentFilter.patchOptions}.
|
|
2906
|
+
*/
|
|
2907
|
+
get segmentFilterOptions() {
|
|
2908
|
+
return this._segmentFilterOptions;
|
|
2909
|
+
}
|
|
2910
|
+
/**
|
|
2911
|
+
* @public
|
|
2912
|
+
* @description Comparison semantics. `Exists` = "row is in segment", `Not_exists` =
|
|
2913
|
+
* "row is not in segment". Any other value would be rejected by the backend with
|
|
2914
|
+
* `NotSupportedException`. Defaults to `ComparisonType.Exists` so the common
|
|
2915
|
+
* "is in segment" case requires no explicit argument. Read-only from outside; mutate
|
|
2916
|
+
* via {@link ɵSegmentFilter.updateComparisonType}.
|
|
2917
|
+
*/
|
|
2918
|
+
get comparisonType() {
|
|
2919
|
+
return this._comparisonType;
|
|
2920
|
+
}
|
|
2921
|
+
_serializeOptions() {
|
|
2922
|
+
const { segmentId, includeRemovedMembers, ignoreUserStatus, addedOnFrom, addedOnTo, removedOnFrom, removedOnTo, } = this._segmentFilterOptions;
|
|
2923
|
+
return {
|
|
2924
|
+
...(segmentId ? { segmentId } : {}),
|
|
2925
|
+
includeRemovedMembers,
|
|
2926
|
+
ignoreUserStatus,
|
|
2927
|
+
addedOnFrom,
|
|
2928
|
+
addedOnTo,
|
|
2929
|
+
removedOnFrom,
|
|
2930
|
+
removedOnTo,
|
|
2931
|
+
};
|
|
2932
|
+
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Parses a segment filter from its wire-level DTO. The parameter is the typed
|
|
2935
|
+
* `SegmentFilterDto` directly — the resolver dispatch passes the raw `JsonObject`
|
|
2936
|
+
* at runtime, but TypeScript sees the base-class signature (`dto: JsonObject`) for
|
|
2937
|
+
* the call site, so this narrower parameter is structurally compatible without a
|
|
2938
|
+
* cast at either end.
|
|
2939
|
+
*
|
|
2940
|
+
* @public
|
|
2941
|
+
*/
|
|
2942
|
+
static fromJson({ comparisonType, uId, segmentFilterOptions }) {
|
|
2943
|
+
const { segmentId, includeRemovedMembers, ignoreUserStatus, addedOnFrom, addedOnTo, removedOnFrom, removedOnTo, } = segmentFilterOptions ?? {};
|
|
2944
|
+
const options = {
|
|
2945
|
+
segmentId: segmentId ?? '',
|
|
2946
|
+
includeRemovedMembers,
|
|
2947
|
+
ignoreUserStatus,
|
|
2948
|
+
addedOnFrom,
|
|
2949
|
+
addedOnTo,
|
|
2950
|
+
removedOnFrom,
|
|
2951
|
+
removedOnTo,
|
|
2952
|
+
};
|
|
2953
|
+
const filter = new ɵSegmentFilter(options, comparisonType ?? ɵComparisonType.Exists);
|
|
2954
|
+
filter.updateId(uId);
|
|
2955
|
+
return filter;
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* @public
|
|
2959
|
+
* @description Patches the nested segment options with the provided partial. Existing
|
|
2960
|
+
* fields not present in the patch are kept; new fields override the old ones. Use this
|
|
2961
|
+
* from the UI when picking a segment, switching membership mode, or shifting temporal
|
|
2962
|
+
* bounds — direct assignment to `segmentFilterOptions` is intentionally funneled
|
|
2963
|
+
* through this method so all mutations live on the filter's public API.
|
|
2964
|
+
* @param options - Partial set of fields to merge over the current options.
|
|
2965
|
+
*/
|
|
2966
|
+
patchOptions(options) {
|
|
2967
|
+
this._segmentFilterOptions = { ...this._segmentFilterOptions, ...options };
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* @public
|
|
2971
|
+
* @description Switches whether the filter participates in the query. Mirrors the
|
|
2972
|
+
* `isEnabled` property carried by every `BaseFilter`, exposed as a method so
|
|
2973
|
+
* all-value writes on a `SegmentFilter` go through its public surface.
|
|
2974
|
+
* @param enabled - `true` to include the filter in the resulting query, `false`
|
|
2975
|
+
* to keep it on the rendered list but exclude it from execution.
|
|
2976
|
+
*/
|
|
2977
|
+
toggle(enabled) {
|
|
2978
|
+
this.isEnabled = enabled;
|
|
2979
|
+
}
|
|
2980
|
+
/**
|
|
2981
|
+
* @public
|
|
2982
|
+
* @description Replaces the comparison semantics — `Exists` ("row is in segment") or
|
|
2983
|
+
* `Not_exists` ("row is not in segment"). Use this from the UI when the user flips
|
|
2984
|
+
* the "in / not in" selector; direct assignment to `comparisonType` is intentionally
|
|
2985
|
+
* funneled through this method so all mutations live on the filter's public API.
|
|
2986
|
+
* @param comparisonType - The new comparison semantics to apply.
|
|
2987
|
+
*/
|
|
2988
|
+
updateComparisonType(comparisonType) {
|
|
2989
|
+
this._comparisonType = comparisonType;
|
|
2990
|
+
}
|
|
2991
|
+
/**
|
|
2992
|
+
* @public
|
|
2993
|
+
* @description Assigns the filter's unique identifier. Mirrors `BaseFilter.uId`,
|
|
2994
|
+
* exposed as a method so all writes on a `SegmentFilter` go through its public
|
|
2995
|
+
* surface — used at parse time by `fromJson` to attach the wire-level `uId` to a
|
|
2996
|
+
* freshly constructed instance.
|
|
2997
|
+
* @param uId - The identifier to set, or `undefined` to clear it.
|
|
2998
|
+
*/
|
|
2999
|
+
updateId(uId) {
|
|
3000
|
+
this.uId = uId;
|
|
3001
|
+
}
|
|
3002
|
+
/**
|
|
3003
|
+
* @public
|
|
3004
|
+
* @description Clones the filter. The constructor defensively copies the options object, so
|
|
3005
|
+
* the clone owns an independent copy and the two instances never share mutable state. The
|
|
3006
|
+
* remaining own state is copied field by field, matching the explicit clone style of the
|
|
3007
|
+
* sibling filters.
|
|
3008
|
+
*/
|
|
3009
|
+
clone() {
|
|
3010
|
+
const filter = new ɵSegmentFilter(this._segmentFilterOptions, this._comparisonType);
|
|
3011
|
+
filter.isEnabled = this.isEnabled;
|
|
3012
|
+
filter.trimDateTimeParameterToDate = this.trimDateTimeParameterToDate;
|
|
3013
|
+
filter.uId = this.uId;
|
|
3014
|
+
return filter;
|
|
3015
|
+
}
|
|
3016
|
+
/** {@inheritDoc ɵSerializable.toJson} */
|
|
3017
|
+
toJson() {
|
|
3018
|
+
return {
|
|
3019
|
+
...super.toJson(),
|
|
3020
|
+
comparisonType: this._comparisonType,
|
|
3021
|
+
segmentFilterOptions: this._serializeOptions(),
|
|
3022
|
+
};
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* @internal
|
|
3026
|
+
* @description Segment filters have no column references — the backend infers the outer
|
|
3027
|
+
* primary key from the root schema. Returning an empty list keeps callers that walk used
|
|
3028
|
+
* columns (validation, suggestion helpers) safe.
|
|
3029
|
+
*/
|
|
3030
|
+
_getUsedColumns() {
|
|
3031
|
+
return [];
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
|
|
2823
3035
|
/**
|
|
2824
3036
|
* @public
|
|
2825
3037
|
* @description Filter parser interface.
|
|
@@ -2854,6 +3066,7 @@ class ɵFilterResolver {
|
|
|
2854
3066
|
[ɵFilterType.IsNull]: ɵIsNullFilter,
|
|
2855
3067
|
[ɵFilterType.Exists]: ɵExistsFilter,
|
|
2856
3068
|
[ɵFilterType.Between]: ɵBetweenFilter,
|
|
3069
|
+
[ɵFilterType.Segment]: ɵSegmentFilter,
|
|
2857
3070
|
};
|
|
2858
3071
|
return filterClass[filterType];
|
|
2859
3072
|
}
|
|
@@ -3732,5 +3945,5 @@ class ɵSchemaViewMaskRequest extends ɵBaseRequest {
|
|
|
3732
3945
|
* Generated bundle index. Do not edit.
|
|
3733
3946
|
*/
|
|
3734
3947
|
|
|
3735
|
-
export { LookupMode, eAdminUnitRoleSources, ɵAggregationEvalType, ɵAggregationFunction, ɵAggregationFunctionColumn, ɵAggregationFunctionExpression, ɵAggregationSubQueryColumn, ɵAggregationSubQueryExpression, ɵAggregationType, ɵArgumentEmptyException, ɵArgumentFunctionExpression, ɵArgumentOutOfRangeException, ɵArithmeticExpression, ɵArithmeticOperation, ɵArithmeticQueryColumn, ɵBaseExpression, ɵBaseExpressionParser, ɵBaseFilter, ɵBaseFilterParser, ɵBaseFilterableQuery, ɵBaseQuery, ɵBaseQueryColumn, ɵBaseRequest, ɵBetweenFilter, ɵColumnExpression, ɵCompareFilter, ɵComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType, ɵDataSchemaAttributeUsageType, ɵDataSchemaType, ɵDataSourceScope, ɵDataValueType, ɵDatePartFunctionColumn, ɵDatePartFunctionExpression, ɵDatePartType, ɵDefaultValueSource, ɵDeleteQuery, ɵEMPTY_GUID, ɵEXPRESSION_TYPE_MOCK, ɵEntityQueryColumn, ɵEntitySchemaQuery, ɵExistsFilter, ɵExpressionMock, ɵExpressionParser, ɵExpressionResolver, ɵExpressionType, ɵFilterGroup, ɵFilterMock, ɵFilterParser, ɵFilterResolver, ɵFilterType, ɵFunctionExpression, ɵFunctionType, ɵInFilter, ɵInsertQuery, ɵIsNullFilter, ɵItemNotFoundException, ɵLengthFunctionColumn, ɵLengthFunctionExpression, ɵLogicalOperatorType, ɵMacrosFunctionColumn, ɵMacrosFunctionExpression, ɵMessageChannelType, ɵModelInPageAction, ɵModelParameterType, ɵNextHandlerAlreadySpecifiedException, ɵOrderDirection, ɵParameterExpression, ɵParameterQueryColumn, ɵPlatformAPIs, ɵQueryMacrosType, ɵQueryOperationType, ɵSchemaViewMaskRequest, ɵSchemaViewMaskRequestAction, ɵSelectLocalizationQuery, ɵSingleFilter, ɵSubQueryColumn, ɵSubQueryExpression, ɵSubscription, ɵUpdateQuery, ɵValidationUtilities, ɵWindowFunctionColumn, ɵWindowFunctionExpression, ɵencodeDate, ɵgenerateGuid, ɵgetColumnPlainObj, ɵgetFilterPlainObj, ɵisEmptyGuid, ɵisGuid, ɵparserMock, ɵtoLocalISOString };
|
|
3948
|
+
export { LookupMode, eAdminUnitRoleSources, ɵAggregationEvalType, ɵAggregationFunction, ɵAggregationFunctionColumn, ɵAggregationFunctionExpression, ɵAggregationSubQueryColumn, ɵAggregationSubQueryExpression, ɵAggregationType, ɵArgumentEmptyException, ɵArgumentFunctionExpression, ɵArgumentOutOfRangeException, ɵArithmeticExpression, ɵArithmeticOperation, ɵArithmeticQueryColumn, ɵBaseExpression, ɵBaseExpressionParser, ɵBaseFilter, ɵBaseFilterParser, ɵBaseFilterableQuery, ɵBaseQuery, ɵBaseQueryColumn, ɵBaseRequest, ɵBetweenFilter, ɵColumnExpression, ɵCompareFilter, ɵComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType, ɵDataSchemaAttributeUsageType, ɵDataSchemaType, ɵDataSourceScope, ɵDataValueType, ɵDatePartFunctionColumn, ɵDatePartFunctionExpression, ɵDatePartType, ɵDefaultValueSource, ɵDeleteQuery, ɵEMPTY_GUID, ɵEXPRESSION_TYPE_MOCK, ɵEntityQueryColumn, ɵEntitySchemaQuery, ɵExistsFilter, ɵExpressionMock, ɵExpressionParser, ɵExpressionResolver, ɵExpressionType, ɵFilterGroup, ɵFilterGroupOriginType, ɵFilterMock, ɵFilterParser, ɵFilterResolver, ɵFilterType, ɵFunctionExpression, ɵFunctionType, ɵInFilter, ɵInsertQuery, ɵIsNullFilter, ɵItemNotFoundException, ɵLengthFunctionColumn, ɵLengthFunctionExpression, ɵLogicalOperatorType, ɵMacrosFunctionColumn, ɵMacrosFunctionExpression, ɵMessageChannelType, ɵModelInPageAction, ɵModelParameterType, ɵNextHandlerAlreadySpecifiedException, ɵOrderDirection, ɵParameterExpression, ɵParameterQueryColumn, ɵPlatformAPIs, ɵQueryMacrosType, ɵQueryOperationType, ɵSchemaViewMaskRequest, ɵSchemaViewMaskRequestAction, ɵSegmentFilter, ɵSelectLocalizationQuery, ɵSingleFilter, ɵSubQueryColumn, ɵSubQueryExpression, ɵSubscription, ɵUpdateQuery, ɵValidationUtilities, ɵWindowFunctionColumn, ɵWindowFunctionExpression, ɵencodeDate, ɵgenerateGuid, ɵgetColumnPlainObj, ɵgetFilterPlainObj, ɵisEmptyGuid, ɵisGuid, ɵparserMock, ɵtoLocalISOString };
|
|
3736
3949
|
//# sourceMappingURL=creatio-base.mjs.map
|