@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.
Files changed (47) hide show
  1. package/dist/cjs/index.js +1902 -1364
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/features/cohort/cohortManagerSelector.d.ts +193 -0
  4. package/dist/dts/features/cohort/cohortManagerSelector.d.ts.map +1 -0
  5. package/dist/dts/features/cohort/cohortManagerSlice.d.ts +112 -0
  6. package/dist/dts/features/cohort/cohortManagerSlice.d.ts.map +1 -0
  7. package/dist/dts/features/cohort/index.d.ts +9 -6
  8. package/dist/dts/features/cohort/index.d.ts.map +1 -1
  9. package/dist/dts/features/cohort/reducers.d.ts +2 -2
  10. package/dist/dts/features/cohort/storage/CohortStorage.d.ts +70 -0
  11. package/dist/dts/features/cohort/storage/CohortStorage.d.ts.map +1 -0
  12. package/dist/dts/features/cohort/tests/cohortManager.unit.test.d.ts +2 -0
  13. package/dist/dts/features/cohort/tests/cohortManager.unit.test.d.ts.map +1 -0
  14. package/dist/dts/features/cohort/types.d.ts +28 -0
  15. package/dist/dts/features/cohort/types.d.ts.map +1 -1
  16. package/dist/dts/features/cohort/utils.d.ts +3 -0
  17. package/dist/dts/features/cohort/utils.d.ts.map +1 -1
  18. package/dist/dts/features/dataLibrary/index.d.ts +3 -2
  19. package/dist/dts/features/dataLibrary/index.d.ts.map +1 -1
  20. package/dist/dts/features/dataLibrary/storage/LocalStorageService.d.ts +1 -1
  21. package/dist/dts/features/dataLibrary/storage/LocalStorageService.d.ts.map +1 -1
  22. package/dist/dts/features/dataLibrary/utils.d.ts +1 -2
  23. package/dist/dts/features/dataLibrary/utils.d.ts.map +1 -1
  24. package/dist/dts/features/facets/index.d.ts +2 -0
  25. package/dist/dts/features/facets/index.d.ts.map +1 -0
  26. package/dist/dts/features/facets/types.d.ts +20 -0
  27. package/dist/dts/features/facets/types.d.ts.map +1 -0
  28. package/dist/dts/features/filters/index.d.ts +1 -2
  29. package/dist/dts/features/filters/index.d.ts.map +1 -1
  30. package/dist/dts/features/filters/types.d.ts +4 -6
  31. package/dist/dts/features/filters/types.d.ts.map +1 -1
  32. package/dist/dts/features/user/userSliceRTK.d.ts +3 -3
  33. package/dist/dts/hooks.d.ts +4 -4
  34. package/dist/dts/index.d.ts +2 -1
  35. package/dist/dts/index.d.ts.map +1 -1
  36. package/dist/dts/reducers.d.ts +3 -3
  37. package/dist/dts/store.d.ts +4 -4
  38. package/dist/dts/utils/index.d.ts +4 -3
  39. package/dist/dts/utils/index.d.ts.map +1 -1
  40. package/dist/dts/utils/time.d.ts +1 -0
  41. package/dist/dts/utils/time.d.ts.map +1 -1
  42. package/dist/esm/index.js +1885 -1362
  43. package/dist/esm/index.js.map +1 -1
  44. package/dist/index.d.ts +265 -58
  45. package/package.json +2 -2
  46. package/dist/dts/features/cohort/cohortSlice.d.ts +0 -204
  47. package/dist/dts/features/cohort/cohortSlice.d.ts.map +0 -1
@@ -1,204 +0,0 @@
1
- import { EntityState, type PayloadAction, ThunkAction, UnknownAction } from '@reduxjs/toolkit';
2
- import { type CoreState } from '../../reducers';
3
- import { Operation, FilterSet, IndexedFilterSet } from '../filters';
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 UNSAVED_COHORT_NAME = "Cohort";
10
- export declare const NULL_COHORT_ID = "null_cohort_id";
11
- type CohortId = string;
12
- type CountsData = Record<string, number>;
13
- /**
14
- * A Cohort is a collection of filters that can be used to query the GDC API.
15
- * The cohort interface is used to manage the cohort state in the redux-toolkit entity adapter.
16
- * @see https://redux-toolkit.js.org/api/createEntityAdapter
17
- *
18
- * @property id - the id of the cohort
19
- * @property name - the name of the cohort
20
- * @property filters - the filters for the cohort
21
- * @property modified - flag indicating if the cohort has been modified
22
- * @property modified_datetime - the last time the cohort was modified
23
- * @property saved - flag indicating if the cohort has been saved
24
- * @category Cohort
25
- */
26
- export interface Cohort {
27
- id: CohortId;
28
- name: string;
29
- filters: IndexedFilterSet;
30
- modified?: boolean;
31
- modified_datetime: string;
32
- saved?: boolean;
33
- counts?: CountsData;
34
- }
35
- export interface CurrentCohortState {
36
- currentCohort?: string;
37
- message?: string[];
38
- }
39
- interface UpdateFilterParams {
40
- index: string;
41
- field: string;
42
- filter: Operation;
43
- }
44
- interface SetFilterParams {
45
- index: string;
46
- filters: FilterSet;
47
- }
48
- interface SetAllIndexFiltersParams {
49
- filters: IndexedFilterSet;
50
- }
51
- interface RemoveFilterParams {
52
- index: string;
53
- field: string;
54
- }
55
- export declare const createCohortName: (postfix: string) => string;
56
- interface ClearAllFilterParams {
57
- index: string;
58
- }
59
- export declare const createCohortId: () => string;
60
- /**
61
- * Redux slice for cohort filters
62
- */
63
- export declare const cohortSlice: import("@reduxjs/toolkit").Slice<EntityState<Cohort, string> & CurrentCohortState, {
64
- addNewDefaultUnsavedCohort: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>) => void;
65
- updateCohortName: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<string>) => void;
66
- removeCohort: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<{
67
- shouldShowMessage?: boolean;
68
- id?: string;
69
- }>) => void;
70
- updateCohortFilter: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<UpdateFilterParams>) => void;
71
- setCohortFilter: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<SetFilterParams>) => void;
72
- setCohortIndexFilters: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<SetAllIndexFiltersParams>) => void;
73
- removeCohortFilter: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<RemoveFilterParams>) => void;
74
- clearCohortFilters: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<ClearAllFilterParams>) => void;
75
- discardCohortChanges: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<{
76
- filters: FilterSet | undefined;
77
- index: string;
78
- id?: string;
79
- }>) => void;
80
- setCurrentCohortId: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<string>) => void;
81
- /** @hidden */
82
- setCohortList: (state: import("immer").WritableDraft<EntityState<Cohort, string> & CurrentCohortState>, action: PayloadAction<Cohort[]>) => void;
83
- }, "cohort", "cohort", import("@reduxjs/toolkit").SliceSelectors<EntityState<Cohort, string> & CurrentCohortState>>;
84
- /**
85
- * Returns the selectors for the cohorts EntityAdapter
86
- * @param state - the CoreState
87
- *
88
- * @hidden
89
- */
90
- export declare const cohortSelectors: import("@reduxjs/toolkit").EntitySelectors<Cohort, {
91
- [x: string]: any;
92
- gen3Services: any;
93
- user: import("../user/userSlice").Gen3UserState;
94
- gen3Apps: import("../gen3Apps/gen3AppsSlice").Gen3AppsState;
95
- drsHostnames: Record<string, string>;
96
- modals: import("../modals/modalsSlice").ModalState;
97
- cohorts: {
98
- filtersExpanded: {
99
- [x: string]: Record<string, boolean>;
100
- };
101
- filtersCombineMode: {
102
- [x: string]: Record<string, import("./types").CombineMode>;
103
- };
104
- sharedFilters: import("./sharedFiltersSlice").SharedFiltersState;
105
- cohort: EntityState<Cohort, string> & CurrentCohortState;
106
- };
107
- activeWorkspace: import("../workspace/workspaceSlice").WorkspaceState;
108
- userAuthApi: import("@reduxjs/toolkit/query").CombinedState<{
109
- fetchUserDetails: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
110
- data: {};
111
- } | {
112
- data: import("../fence").Gen3FenceResponse<unknown>;
113
- }>, never, import("../user/userSliceRTK").UserAuthResponse, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
114
- getCSRF: import("@reduxjs/toolkit/query").QueryDefinition<void, ({ endpoint }: any, { getState }: import("@reduxjs/toolkit/query").BaseQueryApi) => Promise<{
115
- data: {};
116
- } | {
117
- data: import("../fence").Gen3FenceResponse<unknown>;
118
- }>, never, import("../user").CSRFToken, "userAuthApi", import("../fence").Gen3FenceResponse<unknown> | {}>;
119
- }, never, "userAuthApi">;
120
- }, string>;
121
- /**
122
- * Returns an array of all the cohorts
123
- * @param state - the CoreState
124
- * @category Cohort
125
- * @category Selectors
126
- */
127
- export declare const selectAllCohorts: (state: CoreState) => Record<CohortId, Cohort>;
128
- export declare const updateCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateFilterParams, "cohort/updateCohortFilter">, setCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetFilterParams, "cohort/setCohortFilter">, setCohortIndexFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetAllIndexFiltersParams, "cohort/setCohortIndexFilters">, removeCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<RemoveFilterParams, "cohort/removeCohortFilter">, clearCohortFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<ClearAllFilterParams, "cohort/clearCohortFilters">, removeCohort: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
129
- shouldShowMessage?: boolean;
130
- id?: string;
131
- }, "cohort/removeCohort">, discardCohortChanges: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
132
- filters: FilterSet | undefined;
133
- index: string;
134
- id?: string;
135
- }, "cohort/discardCohortChanges">, addNewDefaultUnsavedCohort: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cohort/addNewDefaultUnsavedCohort">, setCurrentCohortId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "cohort/setCurrentCohortId">, setCohortList: import("@reduxjs/toolkit").ActionCreatorWithPayload<Cohort[], "cohort/setCohortList">;
136
- export declare const selectCohortFilters: (state: CoreState) => IndexedFilterSet;
137
- export declare const selectCurrentCohortFilters: (state: CoreState) => IndexedFilterSet;
138
- export declare const selectCurrentCohortId: (state: CoreState) => CohortId;
139
- export declare const selectCurrentCohort: (state: CoreState) => Cohort;
140
- export declare const selectCurrentCohortName: (state: CoreState) => string;
141
- /**
142
- * Select a filter by its name from the current cohort. If the filter is not found
143
- * returns undefined.
144
- * @param state - Core
145
- * @param index which cohort index to select from
146
- * @param name name of the filter to select
147
- */
148
- export declare const selectIndexedFilterByName: (state: CoreState, index: string, name: string) => Operation | undefined;
149
- /**
150
- * Returns the cohort's name given the id
151
- * @param state - the CoreState
152
- * @param cohortId - the cohort id
153
- * @category Cohort
154
- * @category Selectors
155
- */
156
- export declare const selectCohortNameById: (state: CoreState, cohortId: string) => string | undefined;
157
- /**
158
- * a thunk to optionally create a caseSet when switching cohorts.
159
- * Note the assumption if the caseset member has ids then the caseset has previously been created.
160
- */
161
- export declare const setActiveCohort: (cohortId: string) => ThunkAction<void, CoreState, undefined, UnknownAction>;
162
- /**
163
- * Returns all the cohorts in the state
164
- * @param state - the CoreState
165
- *
166
- * @category Cohort
167
- * @category Selectors
168
- */
169
- export declare const selectAvailableCohorts: (state: CoreState) => Cohort[];
170
- /**
171
- * Returns if the current cohort is modified
172
- * @param state - the CoreState
173
- * @category Cohort
174
- * @category Selectors
175
- * @hidden
176
- */
177
- export declare const selectCurrentCohortModified: (state: CoreState) => boolean | undefined;
178
- /**
179
- * Returns if the current cohort has been saved
180
- * @param state - the CoreState
181
- * @category Cohort
182
- * @category Selectors
183
- * @hidden
184
- */
185
- export declare const selectCurrentCohortSaved: (state: CoreState) => boolean | undefined;
186
- /**
187
- * Select a filter by its name from the current cohort. If the filter is not found
188
- * returns undefined.
189
- * @param state - Core
190
- * @param name name of the filter to select
191
- */
192
- export declare const selectAvailableCohortByName: (state: CoreState, name: string) => Cohort | undefined;
193
- /**
194
- * Select a filter from the index.
195
- * returns undefined.
196
- * @param state - Core
197
- * @param index which cohort index to select from
198
- */
199
- export declare const selectIndexFilters: (state: CoreState, index: string) => FilterSet;
200
- export declare const setActiveCohortList: (cohorts?: Cohort[]) => ThunkAction<void, CoreState, undefined, UnknownAction>;
201
- export declare const discardActiveCohortChanges: (index: string, filters: FilterSet) => ThunkAction<void, CoreState, undefined, UnknownAction>;
202
- export declare const cohortReducer: import("redux").Reducer<EntityState<Cohort, string> & CurrentCohortState>;
203
- export {};
204
- //# sourceMappingURL=cohortSlice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cohortSlice.d.ts","sourceRoot":"","sources":["../../../../src/features/cohort/cohortSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,KAAK,aAAa,EAElB,WAAW,EACX,aAAa,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGpE;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,KAAK,QAAQ,GAAG,MAAM,CAAC;AAEvB,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,UAAU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