@gen3/core 0.11.21 → 0.11.23
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/dist/cjs/index.js +1902 -1364
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/features/cohort/cohortManagerSelector.d.ts +193 -0
- package/dist/dts/features/cohort/cohortManagerSelector.d.ts.map +1 -0
- package/dist/dts/features/cohort/cohortManagerSlice.d.ts +112 -0
- package/dist/dts/features/cohort/cohortManagerSlice.d.ts.map +1 -0
- package/dist/dts/features/cohort/index.d.ts +9 -6
- package/dist/dts/features/cohort/index.d.ts.map +1 -1
- package/dist/dts/features/cohort/reducers.d.ts +2 -2
- package/dist/dts/features/cohort/storage/CohortStorage.d.ts +70 -0
- package/dist/dts/features/cohort/storage/CohortStorage.d.ts.map +1 -0
- package/dist/dts/features/cohort/tests/cohortManager.unit.test.d.ts +2 -0
- package/dist/dts/features/cohort/tests/cohortManager.unit.test.d.ts.map +1 -0
- package/dist/dts/features/cohort/types.d.ts +28 -0
- package/dist/dts/features/cohort/types.d.ts.map +1 -1
- package/dist/dts/features/cohort/utils.d.ts +3 -0
- package/dist/dts/features/cohort/utils.d.ts.map +1 -1
- package/dist/dts/features/dataLibrary/index.d.ts +3 -2
- package/dist/dts/features/dataLibrary/index.d.ts.map +1 -1
- package/dist/dts/features/dataLibrary/storage/LocalStorageService.d.ts +1 -1
- package/dist/dts/features/dataLibrary/storage/LocalStorageService.d.ts.map +1 -1
- package/dist/dts/features/dataLibrary/utils.d.ts +1 -2
- package/dist/dts/features/dataLibrary/utils.d.ts.map +1 -1
- package/dist/dts/features/facets/index.d.ts +2 -0
- package/dist/dts/features/facets/index.d.ts.map +1 -0
- package/dist/dts/features/facets/types.d.ts +20 -0
- package/dist/dts/features/facets/types.d.ts.map +1 -0
- package/dist/dts/features/filters/index.d.ts +1 -2
- package/dist/dts/features/filters/index.d.ts.map +1 -1
- package/dist/dts/features/filters/types.d.ts +4 -6
- package/dist/dts/features/filters/types.d.ts.map +1 -1
- package/dist/dts/features/user/userSliceRTK.d.ts +3 -3
- package/dist/dts/hooks.d.ts +4 -4
- package/dist/dts/index.d.ts +2 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/reducers.d.ts +3 -3
- package/dist/dts/store.d.ts +4 -4
- package/dist/dts/utils/index.d.ts +4 -3
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/time.d.ts +1 -0
- package/dist/dts/utils/time.d.ts.map +1 -1
- package/dist/esm/index.js +1885 -1362
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +265 -58
- package/package.json +2 -2
- package/dist/dts/features/cohort/cohortSlice.d.ts +0 -204
- package/dist/dts/features/cohort/cohortSlice.d.ts.map +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { CoreState } from '../../reducers';
|
|
2
|
+
import { Cohort, CohortId } from './types';
|
|
3
|
+
import { FilterSet, IndexedFilterSet, Operation } from '../filters';
|
|
4
|
+
export declare const selectAllCohorts: (state: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
gen3Services: any;
|
|
7
|
+
user: import("../user/userSlice").Gen3UserState;
|
|
8
|
+
gen3Apps: import("../gen3Apps/gen3AppsSlice").Gen3AppsState;
|
|
9
|
+
drsHostnames: Record<string, string>;
|
|
10
|
+
modals: import("../modals/modalsSlice").ModalState;
|
|
11
|
+
cohorts: {
|
|
12
|
+
filtersExpanded: {
|
|
13
|
+
[x: string]: Record<string, boolean>;
|
|
14
|
+
};
|
|
15
|
+
filtersCombineMode: {
|
|
16
|
+
[x: string]: Record<string, import("./types").CombineMode>;
|
|
17
|
+
};
|
|
18
|
+
sharedFilters: import("./sharedFiltersSlice").SharedFiltersState;
|
|
19
|
+
cohortManager: import("@reduxjs/toolkit").EntityState<Cohort, string> & import("./cohortManagerSlice").CurrentCohortState;
|
|
20
|
+
};
|
|
21
|
+
activeWorkspace: import("../workspace/workspaceSlice").WorkspaceState;
|
|
22
|
+
userAuthApi: import("@reduxjs/toolkit/query").CombinedState<{
|
|
23
|
+
fetchUserDetails: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
24
|
+
data: {};
|
|
25
|
+
} | {
|
|
26
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
27
|
+
}>, never, import("../user/userSliceRTK").UserAuthResponse, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
28
|
+
getCSRF: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
29
|
+
data: {};
|
|
30
|
+
} | {
|
|
31
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
32
|
+
}>, never, import("../user").CSRFToken, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
33
|
+
}, never, "userAuthApi">;
|
|
34
|
+
}) => Cohort[], selectTotalCohorts: (state: {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
gen3Services: any;
|
|
37
|
+
user: import("../user/userSlice").Gen3UserState;
|
|
38
|
+
gen3Apps: import("../gen3Apps/gen3AppsSlice").Gen3AppsState;
|
|
39
|
+
drsHostnames: Record<string, string>;
|
|
40
|
+
modals: import("../modals/modalsSlice").ModalState;
|
|
41
|
+
cohorts: {
|
|
42
|
+
filtersExpanded: {
|
|
43
|
+
[x: string]: Record<string, boolean>;
|
|
44
|
+
};
|
|
45
|
+
filtersCombineMode: {
|
|
46
|
+
[x: string]: Record<string, import("./types").CombineMode>;
|
|
47
|
+
};
|
|
48
|
+
sharedFilters: import("./sharedFiltersSlice").SharedFiltersState;
|
|
49
|
+
cohortManager: import("@reduxjs/toolkit").EntityState<Cohort, string> & import("./cohortManagerSlice").CurrentCohortState;
|
|
50
|
+
};
|
|
51
|
+
activeWorkspace: import("../workspace/workspaceSlice").WorkspaceState;
|
|
52
|
+
userAuthApi: import("@reduxjs/toolkit/query").CombinedState<{
|
|
53
|
+
fetchUserDetails: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
54
|
+
data: {};
|
|
55
|
+
} | {
|
|
56
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
57
|
+
}>, never, import("../user/userSliceRTK").UserAuthResponse, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
58
|
+
getCSRF: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
59
|
+
data: {};
|
|
60
|
+
} | {
|
|
61
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
62
|
+
}>, never, import("../user").CSRFToken, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
63
|
+
}, never, "userAuthApi">;
|
|
64
|
+
}) => number, selectCohortById: (state: {
|
|
65
|
+
[x: string]: any;
|
|
66
|
+
gen3Services: any;
|
|
67
|
+
user: import("../user/userSlice").Gen3UserState;
|
|
68
|
+
gen3Apps: import("../gen3Apps/gen3AppsSlice").Gen3AppsState;
|
|
69
|
+
drsHostnames: Record<string, string>;
|
|
70
|
+
modals: import("../modals/modalsSlice").ModalState;
|
|
71
|
+
cohorts: {
|
|
72
|
+
filtersExpanded: {
|
|
73
|
+
[x: string]: Record<string, boolean>;
|
|
74
|
+
};
|
|
75
|
+
filtersCombineMode: {
|
|
76
|
+
[x: string]: Record<string, import("./types").CombineMode>;
|
|
77
|
+
};
|
|
78
|
+
sharedFilters: import("./sharedFiltersSlice").SharedFiltersState;
|
|
79
|
+
cohortManager: import("@reduxjs/toolkit").EntityState<Cohort, string> & import("./cohortManagerSlice").CurrentCohortState;
|
|
80
|
+
};
|
|
81
|
+
activeWorkspace: import("../workspace/workspaceSlice").WorkspaceState;
|
|
82
|
+
userAuthApi: import("@reduxjs/toolkit/query").CombinedState<{
|
|
83
|
+
fetchUserDetails: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
84
|
+
data: {};
|
|
85
|
+
} | {
|
|
86
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
87
|
+
}>, never, import("../user/userSliceRTK").UserAuthResponse, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
88
|
+
getCSRF: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
89
|
+
data: {};
|
|
90
|
+
} | {
|
|
91
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
92
|
+
}>, never, import("../user").CSRFToken, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
93
|
+
}, never, "userAuthApi">;
|
|
94
|
+
}, id: string) => {
|
|
95
|
+
filters: IndexedFilterSet;
|
|
96
|
+
modified?: boolean | undefined;
|
|
97
|
+
createdDatetime: string;
|
|
98
|
+
modifiedDatetime: string;
|
|
99
|
+
saved?: boolean | undefined;
|
|
100
|
+
counts?: import("./types").CountsData | undefined;
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
}, selectCohortIds: (state: {
|
|
104
|
+
[x: string]: any;
|
|
105
|
+
gen3Services: any;
|
|
106
|
+
user: import("../user/userSlice").Gen3UserState;
|
|
107
|
+
gen3Apps: import("../gen3Apps/gen3AppsSlice").Gen3AppsState;
|
|
108
|
+
drsHostnames: Record<string, string>;
|
|
109
|
+
modals: import("../modals/modalsSlice").ModalState;
|
|
110
|
+
cohorts: {
|
|
111
|
+
filtersExpanded: {
|
|
112
|
+
[x: string]: Record<string, boolean>;
|
|
113
|
+
};
|
|
114
|
+
filtersCombineMode: {
|
|
115
|
+
[x: string]: Record<string, import("./types").CombineMode>;
|
|
116
|
+
};
|
|
117
|
+
sharedFilters: import("./sharedFiltersSlice").SharedFiltersState;
|
|
118
|
+
cohortManager: import("@reduxjs/toolkit").EntityState<Cohort, string> & import("./cohortManagerSlice").CurrentCohortState;
|
|
119
|
+
};
|
|
120
|
+
activeWorkspace: import("../workspace/workspaceSlice").WorkspaceState;
|
|
121
|
+
userAuthApi: import("@reduxjs/toolkit/query").CombinedState<{
|
|
122
|
+
fetchUserDetails: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
123
|
+
data: {};
|
|
124
|
+
} | {
|
|
125
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
126
|
+
}>, never, import("../user/userSliceRTK").UserAuthResponse, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
127
|
+
getCSRF: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
128
|
+
data: {};
|
|
129
|
+
} | {
|
|
130
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
131
|
+
}>, never, import("../user").CSRFToken, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
132
|
+
}, never, "userAuthApi">;
|
|
133
|
+
}) => string[];
|
|
134
|
+
export declare const selectCohortFilters: (state: CoreState) => IndexedFilterSet;
|
|
135
|
+
export declare const selectCurrentCohortFilters: (state: CoreState) => IndexedFilterSet;
|
|
136
|
+
export declare const selectCurrentCohortId: (state: CoreState) => CohortId;
|
|
137
|
+
export declare const selectCurrentCohort: (state: CoreState) => Cohort;
|
|
138
|
+
export declare const selectCurrentCohortName: (state: CoreState) => string;
|
|
139
|
+
/**
|
|
140
|
+
* Select a filter by its name from the current cohort. If the filter is not found
|
|
141
|
+
* returns undefined.
|
|
142
|
+
* @param state - Core
|
|
143
|
+
* @param index which cohort index to select from
|
|
144
|
+
* @param name name of the filter to select
|
|
145
|
+
*/
|
|
146
|
+
export declare const selectIndexedFilterByName: (state: CoreState, index: string, name: string) => Operation | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Returns the cohort's name given the id
|
|
149
|
+
* @param state - the CoreState
|
|
150
|
+
* @param cohortId - the cohort id
|
|
151
|
+
* @category Cohort
|
|
152
|
+
* @category Selectors
|
|
153
|
+
*/
|
|
154
|
+
export declare const selectCohortNameById: (state: CoreState, cohortId: string) => string | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Returns all the cohorts in the state
|
|
157
|
+
* @param state - the CoreState
|
|
158
|
+
*
|
|
159
|
+
* @category Cohort
|
|
160
|
+
* @category Selectors
|
|
161
|
+
*/
|
|
162
|
+
export declare const selectAvailableCohorts: (state: CoreState) => Cohort[];
|
|
163
|
+
/**
|
|
164
|
+
* Returns if the current cohort is modified
|
|
165
|
+
* @param state - the CoreState
|
|
166
|
+
* @category Cohort
|
|
167
|
+
* @category Selectors
|
|
168
|
+
* @hidden
|
|
169
|
+
*/
|
|
170
|
+
export declare const selectCurrentCohortModified: (state: CoreState) => boolean | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* Returns if the current cohort has been saved
|
|
173
|
+
* @param state - the CoreState
|
|
174
|
+
* @category Cohort
|
|
175
|
+
* @category Selectors
|
|
176
|
+
* @hidden
|
|
177
|
+
*/
|
|
178
|
+
export declare const selectCurrentCohortSaved: (state: CoreState) => boolean | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Select a filter by its name from the current cohort. If the filter is not found
|
|
181
|
+
* returns undefined.
|
|
182
|
+
* @param state - Core
|
|
183
|
+
* @param name name of the filter to select
|
|
184
|
+
*/
|
|
185
|
+
export declare const selectAvailableCohortByName: (state: CoreState, name: string) => Cohort | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Select a filter from the index.
|
|
188
|
+
* returns undefined.
|
|
189
|
+
* @param state - Core
|
|
190
|
+
* @param index which cohort index to select from
|
|
191
|
+
*/
|
|
192
|
+
export declare const selectIndexFilters: (state: CoreState, index: string) => FilterSet;
|
|
193
|
+
//# sourceMappingURL=cohortManagerSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohortManagerSelector.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/cohortManagerSelector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAEL,SAAS,EACT,gBAAgB,EAChB,SAAS,EACV,MAAM,YAAY,CAAC;AAGpB,eAAO,MACM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBACd,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cACnB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GACjB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAG3B,CAAC;AASF,eAAO,MAAM,mBAAmB,GAAI,OAAO,SAAS,KAAG,gBAGtD,CAAC;AACF,eAAO,MAAM,0BAA0B,GACrC,OAAO,SAAS,KACf,gBAGF,CAAC;AACF,eAAO,MAAM,qBAAqB,GAAI,OAAO,SAAS,KAAG,QAExD,CAAC;AACF,eAAO,MAAM,mBAAmB,GAAI,OAAO,SAAS,KAAG,MACkB,CAAC;AAC1E,eAAO,MAAM,uBAAuB,GAAI,OAAO,SAAS,KAAG,MACmB,CAAC;AAC/E;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,SAAS,EAChB,OAAO,MAAM,EACb,MAAM,MAAM,KACX,SAAS,GAAG,SAGd,CAAC;AACF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,SAAS,EAChB,UAAU,MAAM,KACf,MAAM,GAAG,SAGX,CAAC;AAEF;;;;;;GAMG;AAEH,eAAO,MAAM,sBAAsB,GAAI,OAAO,SAAS,KAAG,MAAM,EAC9B,CAAC;AACnC;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,SAAS,KACf,OAAO,GAAG,SAMZ,CAAC;AACF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,SAAS,KACf,OAAO,GAAG,SAMZ,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,SAAS,EAChB,MAAM,MAAM,KACX,MAAM,GAAG,SAGuC,CAAC;AACpD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,SAAS,EAChB,OAAO,MAAM,KACZ,SASF,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { EntityState, type PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { FilterSet, IndexedFilterSet, Operation } from '../filters';
|
|
3
|
+
import { Cohort } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Cohorts in Gen3 are defined as a set of filters for each index in the data.
|
|
6
|
+
* This means one cohort id defined for all "tabs" in CohortBuilder (explorer)
|
|
7
|
+
* Switching a cohort is means that all the cohorts for the index changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_COHORT_NAME = "Cohort";
|
|
10
|
+
export declare const NULL_COHORT_ID = "null_cohort_id";
|
|
11
|
+
export interface CurrentCohortState {
|
|
12
|
+
currentCohortId: string;
|
|
13
|
+
message?: string[];
|
|
14
|
+
}
|
|
15
|
+
interface UpdateFilterParams {
|
|
16
|
+
index: string;
|
|
17
|
+
field: string;
|
|
18
|
+
filter: Operation;
|
|
19
|
+
}
|
|
20
|
+
interface SetFilterParams {
|
|
21
|
+
index: string;
|
|
22
|
+
filters: FilterSet;
|
|
23
|
+
}
|
|
24
|
+
interface SetAllIndexFiltersParams {
|
|
25
|
+
filters: IndexedFilterSet;
|
|
26
|
+
}
|
|
27
|
+
interface RemoveFilterParams {
|
|
28
|
+
index: string;
|
|
29
|
+
field: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const createCohortName: (postfix: string) => string;
|
|
32
|
+
interface ClearAllFilterParams {
|
|
33
|
+
index: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const newCohort: ({ filters, customName, }: {
|
|
36
|
+
filters?: IndexedFilterSet;
|
|
37
|
+
customName?: string;
|
|
38
|
+
}) => Cohort;
|
|
39
|
+
export declare const createCohortId: () => string;
|
|
40
|
+
export declare const cohortsAdapter: import("@reduxjs/toolkit").EntityAdapter<Cohort, string>;
|
|
41
|
+
interface CreateCohortParams {
|
|
42
|
+
name?: string;
|
|
43
|
+
filters?: IndexedFilterSet;
|
|
44
|
+
}
|
|
45
|
+
interface UpdateCohortNameParams {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Redux slice for cohort filters
|
|
51
|
+
*/
|
|
52
|
+
export declare const cohortManagerSlice: import("@reduxjs/toolkit").Slice<EntityState<Cohort, string> & CurrentCohortState, {
|
|
53
|
+
createNewCohort: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<CreateCohortParams>) => void;
|
|
54
|
+
updateCohortName: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<UpdateCohortNameParams>) => void;
|
|
55
|
+
removeCohort: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<{
|
|
56
|
+
shouldShowMessage?: boolean;
|
|
57
|
+
id: string;
|
|
58
|
+
}>) => void;
|
|
59
|
+
updateCohortFilter: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<UpdateFilterParams>) => void;
|
|
60
|
+
setCohortFilter: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<SetFilterParams>) => void;
|
|
61
|
+
setCohortIndexFilters: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<SetAllIndexFiltersParams>) => void;
|
|
62
|
+
removeCohortFilter: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<RemoveFilterParams>) => void;
|
|
63
|
+
duplicateCohort: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>) => void;
|
|
64
|
+
clearCohortFilters: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<ClearAllFilterParams>) => void;
|
|
65
|
+
setCurrentCohortId: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<string>) => void;
|
|
66
|
+
/** @hidden */
|
|
67
|
+
setCohortList: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<Cohort[]>) => void;
|
|
68
|
+
}, "cohort", "cohort", import("@reduxjs/toolkit").SliceSelectors<EntityState<Cohort, string> & CurrentCohortState>>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the selectors for the cohorts EntityAdapter
|
|
71
|
+
* @param state - the CoreState
|
|
72
|
+
*
|
|
73
|
+
* @hidden
|
|
74
|
+
*/
|
|
75
|
+
export declare const cohortSelectors: import("@reduxjs/toolkit").EntitySelectors<Cohort, {
|
|
76
|
+
[x: string]: any;
|
|
77
|
+
gen3Services: any;
|
|
78
|
+
user: import("../user/userSlice").Gen3UserState;
|
|
79
|
+
gen3Apps: import("../gen3Apps/gen3AppsSlice").Gen3AppsState;
|
|
80
|
+
drsHostnames: Record<string, string>;
|
|
81
|
+
modals: import("../modals/modalsSlice").ModalState;
|
|
82
|
+
cohorts: {
|
|
83
|
+
filtersExpanded: {
|
|
84
|
+
[x: string]: Record<string, boolean>;
|
|
85
|
+
};
|
|
86
|
+
filtersCombineMode: {
|
|
87
|
+
[x: string]: Record<string, import("./types").CombineMode>;
|
|
88
|
+
};
|
|
89
|
+
sharedFilters: import("./sharedFiltersSlice").SharedFiltersState;
|
|
90
|
+
cohortManager: EntityState<Cohort, string> & CurrentCohortState;
|
|
91
|
+
};
|
|
92
|
+
activeWorkspace: import("../workspace/workspaceSlice").WorkspaceState;
|
|
93
|
+
userAuthApi: import("@reduxjs/toolkit/query").CombinedState<{
|
|
94
|
+
fetchUserDetails: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
95
|
+
data: {};
|
|
96
|
+
} | {
|
|
97
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
98
|
+
}>, never, import("../user/userSliceRTK").UserAuthResponse, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
99
|
+
getCSRF: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
|
|
100
|
+
data: {};
|
|
101
|
+
} | {
|
|
102
|
+
data: import("../fence").Gen3FenceResponse<unknown>;
|
|
103
|
+
}>, never, import("../user").CSRFToken, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
|
|
104
|
+
}, never, "userAuthApi">;
|
|
105
|
+
}, string>;
|
|
106
|
+
export declare const createNewCohort: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreateCohortParams, "cohort/createNewCohort">, updateCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateFilterParams, "cohort/updateCohortFilter">, setCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetFilterParams, "cohort/setCohortFilter">, setCohortIndexFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetAllIndexFiltersParams, "cohort/setCohortIndexFilters">, duplicateCohort: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cohort/duplicateCohort">, removeCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<RemoveFilterParams, "cohort/removeCohortFilter">, clearCohortFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<ClearAllFilterParams, "cohort/clearCohortFilters">, removeCohort: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
107
|
+
shouldShowMessage?: boolean;
|
|
108
|
+
id: string;
|
|
109
|
+
}, "cohort/removeCohort">, setCurrentCohortId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "cohort/setCurrentCohortId">, updateCohortName: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateCohortNameParams, "cohort/updateCohortName">, setCohortList: import("@reduxjs/toolkit").ActionCreatorWithPayload<Cohort[], "cohort/setCohortList">;
|
|
110
|
+
export declare const cohortReducer: import("redux").Reducer<EntityState<Cohort, string> & CurrentCohortState>;
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=cohortManagerSlice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohortManagerSlice.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/cohortManagerSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAY,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,wBAAwB;IAChC,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MAElD,CAAC;AAEF,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,SAAS,GAAI,0BAGvB;IACD,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,KAAG,MAcH,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,MAAkB,CAAC;AAErD,eAAO,MAAM,cAAc,0DAMzB,CAAC;AAiBH,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,UAAU,sBAAsB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AAEH,eAAO,MAAM,kBAAkB;sHAIM,aAAa,CAAC,kBAAkB,CAAC;uHAiBxD,aAAa,CAAC,sBAAsB,CAAC;mHAcrC,aAAa,CAAC;QACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;yHAoCgC,aAAa,CAAC,kBAAkB,CAAC;sHA2BpC,aAAa,CAAC,eAAe,CAAC;4HAuBrD,aAAa,CAAC,wBAAwB,CAAC;yHAoBb,aAAa,CAAC,kBAAkB,CAAC;;yHA+C3D,aAAa,CAAC,oBAAoB,CAAC;yHA8BT,aAAa,CAAC,MAAM,CAAC;IAGzD,cAAc;oHACiB,aAAa,CAAC,MAAM,EAAE,CAAC;mHAQxD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAE3B,CAAC;AAGF,eAAO,MACL,eAAe,qGACf,kBAAkB,wGAClB,eAAe,kGACf,qBAAqB,iHACrB,eAAe,oFACf,kBAAkB,wGAClB,kBAAkB,0GAClB,YAAY;wBA1Nc,OAAO;QACvB,MAAM;2BA0NhB,kBAAkB,4FAClB,gBAAgB,0GAChB,aAAa,uFACe,CAAC;AAE/B,eAAO,MAAM,aAAa,2EAA6B,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { type CombineMode } from './types';
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { clearCohortFilters, cohortReducer, createNewCohort, duplicateCohort, removeCohort, removeCohortFilter, setCohortFilter, setCohortIndexFilters, setCohortList, setCurrentCohortId, updateCohortFilter, updateCohortName } from './cohortManagerSlice';
|
|
2
|
+
import { selectAllCohortFiltersCollapsed, selectCohortFilterExpanded, toggleCohortBuilderAllFilters, toggleCohortBuilderCategoryFilter } from './filterExpandSlice';
|
|
3
|
+
import { selectSharedFilters, selectSharedFiltersForFields, selectShouldShareFilters, setSharedFilters, setShouldShareFilters } from './sharedFiltersSlice';
|
|
4
|
+
import { type Cohort, type CohortId, type CombineMode, type StorageEntity } from './types';
|
|
5
|
+
import { selectCohortFilterCombineMode, setCohortFilterCombineMode } from './filterCombineModeSlice';
|
|
6
|
+
import { CohortStorage } from './storage/CohortStorage';
|
|
7
|
+
import { selectAllCohorts, selectAvailableCohorts, selectCohortFilters, selectCurrentCohort, selectCurrentCohortFilters, selectCurrentCohortId, selectCurrentCohortModified, selectCurrentCohortName, selectCurrentCohortSaved, selectIndexedFilterByName, selectIndexFilters } from './cohortManagerSelector';
|
|
8
|
+
export * from './utils';
|
|
9
|
+
export { type Cohort, type CombineMode, type CohortId, type StorageEntity, CohortStorage, selectCohortFilters, selectCurrentCohortFilters, selectIndexFilters, selectIndexedFilterByName, selectCurrentCohortId, selectCurrentCohortName, selectCurrentCohort, selectAvailableCohorts, selectCurrentCohortModified, selectCurrentCohortSaved, cohortReducer, selectCohortFilterExpanded, selectAllCohortFiltersCollapsed, selectCohortFilterCombineMode, selectShouldShareFilters, selectSharedFilters, selectSharedFiltersForFields, selectAllCohorts, updateCohortFilter, setCohortFilter, setCohortIndexFilters, removeCohortFilter, clearCohortFilters, createNewCohort, duplicateCohort, removeCohort, toggleCohortBuilderCategoryFilter, toggleCohortBuilderAllFilters, setCohortFilterCombineMode, setSharedFilters, setShouldShareFilters, setCurrentCohortId, updateCohortName, setCohortList, };
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,6BAA6B,EAC7B,iCAAiC,EAClC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAEjC,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,aAAa,EACb,0BAA0B,EAC1B,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,EACxB,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iCAAiC,EACjC,6BAA6B,EAC7B,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,GACd,CAAC"}
|
|
@@ -6,7 +6,7 @@ export declare const cohortReducers: import("redux").Reducer<{
|
|
|
6
6
|
[x: string]: Record<string, import("./types").CombineMode>;
|
|
7
7
|
};
|
|
8
8
|
sharedFilters: import("./sharedFiltersSlice").SharedFiltersState;
|
|
9
|
-
|
|
9
|
+
cohortManager: import("@reduxjs/toolkit").EntityState<import("./types").Cohort, string> & import("./cohortManagerSlice").CurrentCohortState;
|
|
10
10
|
}, import("redux").UnknownAction, Partial<{
|
|
11
11
|
filtersExpanded: {
|
|
12
12
|
[x: string]: Record<string, boolean>;
|
|
@@ -15,6 +15,6 @@ export declare const cohortReducers: import("redux").Reducer<{
|
|
|
15
15
|
[x: string]: Record<string, import("./types").CombineMode>;
|
|
16
16
|
} | undefined;
|
|
17
17
|
sharedFilters: import("./sharedFiltersSlice").SharedFiltersState | undefined;
|
|
18
|
-
|
|
18
|
+
cohortManager: (import("@reduxjs/toolkit").EntityState<import("./types").Cohort, string> & import("./cohortManagerSlice").CurrentCohortState) | undefined;
|
|
19
19
|
}>>;
|
|
20
20
|
//# sourceMappingURL=reducers.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { StorageOperationResults } from '../../../types';
|
|
2
|
+
import { StorageEntity } from '../types';
|
|
3
|
+
export interface CohortStorageReturnStatus<T> extends StorageOperationResults {
|
|
4
|
+
data?: T;
|
|
5
|
+
}
|
|
6
|
+
export interface CohortStorageConfig {
|
|
7
|
+
databaseName: string;
|
|
8
|
+
storeName: string;
|
|
9
|
+
schemaVersion?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class CohortStorage<T extends StorageEntity<K>, K extends string | number = string> {
|
|
12
|
+
private readonly databaseName;
|
|
13
|
+
private readonly storeName;
|
|
14
|
+
private readonly schemaVersion;
|
|
15
|
+
constructor(config: CohortStorageConfig);
|
|
16
|
+
private getDb;
|
|
17
|
+
/**
|
|
18
|
+
* Save a single cohort to the database
|
|
19
|
+
*/
|
|
20
|
+
saveCohort(cohort: T): Promise<StorageOperationResults>;
|
|
21
|
+
/**
|
|
22
|
+
* Save multiple cohorts in a single transaction (bulk operation)
|
|
23
|
+
*/
|
|
24
|
+
saveCohorts(cohorts: T[]): Promise<StorageOperationResults>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a specific cohort by ID
|
|
27
|
+
*/
|
|
28
|
+
getCohort(id: K): Promise<CohortStorageReturnStatus<T>>;
|
|
29
|
+
/**
|
|
30
|
+
* Get all cohorts from the database
|
|
31
|
+
*/
|
|
32
|
+
getAllCohorts(): Promise<CohortStorageReturnStatus<Record<K, T>>>;
|
|
33
|
+
/**
|
|
34
|
+
* Search cohorts by name (case-insensitive partial match)
|
|
35
|
+
*/
|
|
36
|
+
searchCohortsByName(searchTerm: string): Promise<CohortStorageReturnStatus<Record<K, T>>>;
|
|
37
|
+
/**
|
|
38
|
+
* Count total number of cohorts
|
|
39
|
+
*/
|
|
40
|
+
getCohortCount(): Promise<CohortStorageReturnStatus<number>>;
|
|
41
|
+
/**
|
|
42
|
+
* Update an existing cohort (full replacement)
|
|
43
|
+
*/
|
|
44
|
+
updateCohort(cohort: T): Promise<StorageOperationResults>;
|
|
45
|
+
/**
|
|
46
|
+
* Delete a specific cohort by ID
|
|
47
|
+
*/
|
|
48
|
+
deleteCohort(id: K): Promise<StorageOperationResults>;
|
|
49
|
+
/**
|
|
50
|
+
* Delete all cohorts from the database
|
|
51
|
+
*/
|
|
52
|
+
deleteAllCohorts(): Promise<StorageOperationResults>;
|
|
53
|
+
/**
|
|
54
|
+
* Check if a cohort exists
|
|
55
|
+
*/
|
|
56
|
+
cohortExists(id: K): Promise<CohortStorageReturnStatus<boolean>>;
|
|
57
|
+
/**
|
|
58
|
+
* Export all cohorts as JSON
|
|
59
|
+
*/
|
|
60
|
+
exportCohorts(): Promise<CohortStorageReturnStatus<Record<K, T>>>;
|
|
61
|
+
/**
|
|
62
|
+
* Import cohorts from JSON data
|
|
63
|
+
*/
|
|
64
|
+
importCohorts(cohorts: T[], overwrite?: boolean): Promise<void | CohortStorageReturnStatus<T>>;
|
|
65
|
+
/**
|
|
66
|
+
* Close the database connection
|
|
67
|
+
*/
|
|
68
|
+
close(): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=CohortStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CohortStorage.d.ts","sourceRoot":"","sources":["../../../../../src/features/cohort/storage/CohortStorage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,yBAAyB,CAAC,CAAC,CAAE,SAAQ,uBAAuB;IAC3E,IAAI,CAAC,EAAE,CAAC,CAAC;CACV;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,aAAa,CACxB,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAC1B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM;IAElC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAE3B,MAAM,EAAE,mBAAmB;IAMvC,OAAO,CAAC,KAAK;IAqBb;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAa7D;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC;IA0BjE;;OAEG;IACG,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAqB7D;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAkCvE;;OAEG;IACG,mBAAmB,CACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IA+BnD;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAqBlE;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAwC/D;;OAEG;IACG,YAAY,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;IA6B3D;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAqB1D;;OAEG;IACG,YAAY,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAiBtE;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAIvE;;OAEG;IACG,aAAa,CACjB,OAAO,EAAE,CAAC,EAAE,EACZ,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,IAAI,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAiB/C;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohortManager.unit.test.d.ts","sourceRoot":"","sources":["../../../../../src/features/cohort/tests/cohortManager.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,30 @@
|
|
|
1
|
+
import { IndexedFilterSet } from '../filters';
|
|
1
2
|
export type CombineMode = 'and' | 'or';
|
|
3
|
+
export type CohortId = string;
|
|
4
|
+
export type CountsData = Record<string, number>;
|
|
5
|
+
export interface StorageEntity<T> {
|
|
6
|
+
id: T;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A Cohort is a collection of filters that can be used to query the GDC API.
|
|
11
|
+
* The cohort interface is used to manage the cohort state in the redux-toolkit entity adapter.
|
|
12
|
+
* @see https://redux-toolkit.js.org/api/createEntityAdapter
|
|
13
|
+
*
|
|
14
|
+
* @property id - the id of the cohort
|
|
15
|
+
* @property name - the name of the cohort
|
|
16
|
+
* @property filters - the filters for the cohort
|
|
17
|
+
* @property modified - flag indicating if the cohort has been modified
|
|
18
|
+
* @property modifiedDatetime - the last time the cohort was modified
|
|
19
|
+
* @property saved - flag indicating if the cohort has been saved
|
|
20
|
+
* @category Cohort
|
|
21
|
+
*/
|
|
22
|
+
export interface Cohort extends StorageEntity<CohortId> {
|
|
23
|
+
filters: IndexedFilterSet;
|
|
24
|
+
modified?: boolean;
|
|
25
|
+
createdDatetime: string;
|
|
26
|
+
modifiedDatetime: string;
|
|
27
|
+
saved?: boolean;
|
|
28
|
+
counts?: CountsData;
|
|
29
|
+
}
|
|
2
30
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEhD,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,MAAO,SAAQ,aAAa,CAAC,QAAQ,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { type CohortId, StorageEntity } from './types';
|
|
1
2
|
export declare const defaultCohortNameGenerator: () => string;
|
|
3
|
+
export declare const isNameUnique: <T extends CohortId = CohortId>(entities: Array<StorageEntity<T>>, name: string, excludeId?: T) => boolean;
|
|
4
|
+
export declare const generateUniqueName: <T extends CohortId = CohortId>(entities: Array<StorageEntity<T>>, baseName: string) => string;
|
|
2
5
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,QAAO,MAMvB,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,0BAA0B,QAAO,MAMvB,CAAC;AAExB,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,QAAQ,GAAG,QAAQ,EACxD,UAAU,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EACjC,MAAM,MAAM,EACZ,YAAY,CAAC,KACZ,OAUF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAC9D,UAAU,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EACjC,UAAU,MAAM,KACf,MAkBF,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StorageOperationResults } from '../../types';
|
|
2
|
-
export * from './types';
|
|
3
2
|
import useDataLibrary from './useDataLibrary';
|
|
4
|
-
import {
|
|
3
|
+
import { buildListItemsGroupedByDataset, extractFileDatasetsInRecords, extractIndexFromDataLibraryCohort, getNumberOfItemsInDatalist } from './utils';
|
|
4
|
+
import { getTimestamp } from '../../utils';
|
|
5
|
+
export * from './types';
|
|
5
6
|
export { useDataLibrary, getNumberOfItemsInDatalist, getTimestamp, extractIndexFromDataLibraryCohort, extractFileDatasetsInRecords, buildListItemsGroupedByDataset, type StorageOperationResults, };
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/dataLibrary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/dataLibrary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,iCAAiC,EACjC,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,YAAY,EACZ,iCAAiC,EACjC,4BAA4B,EAC5B,8BAA8B,EAC9B,KAAK,uBAAuB,GAC7B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReturnStatus, StorageService } from './types';
|
|
2
|
-
import {
|
|
2
|
+
import { DataLibraryAPI, DatalistAPI, DatalistAsAPIItems } from '../types';
|
|
3
3
|
export declare class LocalStorageService implements StorageService {
|
|
4
4
|
private getDb;
|
|
5
5
|
setAllLists: (data: Array<DatalistAsAPIItems>) => Promise<ReturnStatus>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStorageService.d.ts","sourceRoot":"","sources":["../../../../../src/features/dataLibrary/storage/LocalStorageService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"LocalStorageService.d.ts","sourceRoot":"","sources":["../../../../../src/features/dataLibrary/storage/LocalStorageService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EACL,cAAc,EACd,WAAW,EACX,kBAAkB,EAGnB,MAAM,UAAU,CAAC;AASlB,qBAAa,mBAAoB,YAAW,cAAc;IACxD,OAAO,CAAC,KAAK;IAWb,WAAW,GACT,MAAM,KAAK,CAAC,kBAAkB,CAAC,KAC9B,OAAO,CAAC,YAAY,CAAC,CAgCtB;IAEI,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAsB1C,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IA0BjC,OAAO,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IA8BxD,UAAU,CACd,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,YAAY,CAAC;IAsClB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAwB7C,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC;IAkBnC,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAwCvD,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAwBtE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataLibrary, DataLibraryAPIResponse, Datalist, DatalistAPI,
|
|
1
|
+
import { DataLibrary, DataLibraryAPI, DataLibraryAPIResponse, Datalist, DatalistAPI, DatasetOrCohort, ExportDatasetFields, LibraryListItemsAPI, LibraryListItemsGroupedByDataset } from './types';
|
|
2
2
|
import { JSONObject } from '../../types/';
|
|
3
3
|
export declare const buildListItemsGroupedByDataset: (listData: LibraryListItemsAPI) => DatasetOrCohort;
|
|
4
4
|
export declare const BuildList: (listId: string, listData: DatalistAPI) => Datalist | undefined;
|
|
@@ -21,7 +21,6 @@ export declare const BuildLists: (data: DataLibraryAPIResponse) => DataLibrary;
|
|
|
21
21
|
* @return {number} The total number of items in the DataList.
|
|
22
22
|
*/
|
|
23
23
|
export declare const getNumberOfItemsInDatalist: (dataList: Datalist) => number;
|
|
24
|
-
export declare const getTimestamp: () => string;
|
|
25
24
|
export declare const flattenDataList: (dataList: LibraryListItemsGroupedByDataset) => {
|
|
26
25
|
name: string;
|
|
27
26
|
items: LibraryListItemsAPI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/features/dataLibrary/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,sBAAsB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/features/dataLibrary/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,cAAc,EACd,sBAAsB,EAEtB,QAAQ,EACR,WAAW,EAEX,eAAe,EACf,mBAAmB,EAKnB,mBAAmB,EACnB,gCAAgC,EACjC,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqB1C,eAAO,MAAM,8BAA8B,GACzC,UAAU,mBAAmB,KAC5B,eAgCF,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,QAAQ,MAAM,EACd,UAAU,WAAW,KACpB,QAAQ,GAAG,SAcb,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,sBAAsB,KAAG,WAMzD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GAAI,UAAU,QAAQ,KAAG,MAkB/D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,gCAAgC;;;CAmBzE,CAAC;AAEF,eAAO,MAAM,2CAA2C,GACtD,MAAM,eAAe,KACpB,mBAgDF,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAC7C,aAAa,WAAW,KACvB,cAaF,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAAI,OAAO,UAAU,kBAkBlE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAChC,kBAAkB,mBAAmB,wBAmFtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/facets/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IndexAndField } from '../guppy/types';
|
|
2
|
+
export type FacetType = 'enum' | 'exact' | 'range' | 'age' | 'year' | 'years' | 'days' | 'percent' | 'datetime' | 'toggle' | 'multiselect' | 'upload';
|
|
3
|
+
export interface AllowableRange {
|
|
4
|
+
readonly minimum: number;
|
|
5
|
+
readonly maximum: number;
|
|
6
|
+
}
|
|
7
|
+
export interface FacetDefinition {
|
|
8
|
+
readonly description?: string;
|
|
9
|
+
readonly field: string;
|
|
10
|
+
readonly dataField?: string;
|
|
11
|
+
readonly index: string;
|
|
12
|
+
readonly type: FacetType;
|
|
13
|
+
readonly range?: AllowableRange;
|
|
14
|
+
readonly hasData?: boolean;
|
|
15
|
+
readonly label?: string;
|
|
16
|
+
readonly sharedWithIndices?: Array<IndexAndField>;
|
|
17
|
+
readonly moveValuesToBottom?: Array<string>;
|
|
18
|
+
readonly excludeValues?: Array<string>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/features/facets/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,OAAO,GACP,OAAO,GACP,KAAK,GACL,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,GACT,UAAU,GACV,QAAQ,GACR,aAAa,GACb,QAAQ,CAAC;AAEb,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAClD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './filters';
|
|
2
2
|
export * from './types';
|
|
3
3
|
export * from './utils';
|
|
4
|
-
export { handleOperation, isFilterEmpty, isOperationWithField, isGQLIntersection, isGQLUnion, isOperatorWithFieldAndArrayOfOperands, filterSetToOperation, convertFilterToGqlFilter, convertFilterSetToGqlFilter, extractFilterValue, extractEnumFilterValue, type OperatorWithFieldAndArrayOfOperands, type GQLFilter, type GQLEqual, type GQLNotEqual, type GQLLessThan, type GQLLessThanOrEquals, type GQLGreaterThan, type GQLGreaterThanOrEquals, type GQLIncludes, type GQLExcludes, type GQLExcludeIfAny, type GQLIntersection, type GQLUnion, type GQLNestedFilter, type GQLRange, type GQLExists, type GQLMissing, };
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/filters/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/filters/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|