@gen3/core 0.11.1 → 0.11.12
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 +31 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/coreCreateApi.d.ts +4 -0
- package/dist/dts/coreCreateApi.d.ts.map +1 -0
- package/dist/dts/features/cohort/cohortSlice.d.ts +2 -1
- package/dist/dts/features/cohort/cohortSlice.d.ts.map +1 -1
- package/dist/dts/features/cohort/index.d.ts +2 -2
- package/dist/dts/features/cohort/index.d.ts.map +1 -1
- package/dist/dts/features/filters/filters.d.ts +25 -0
- package/dist/dts/features/filters/filters.d.ts.map +1 -1
- package/dist/dts/features/filters/index.d.ts +2 -2
- package/dist/dts/features/filters/index.d.ts.map +1 -1
- package/dist/dts/features/filters/types.d.ts +1 -13
- package/dist/dts/features/filters/types.d.ts.map +1 -1
- package/dist/dts/hooks.d.ts +67 -0
- package/dist/dts/hooks.d.ts.map +1 -1
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/store.d.ts +1 -0
- package/dist/dts/store.d.ts.map +1 -1
- package/dist/esm/index.js +29 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +88 -15
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -395,6 +395,7 @@ const { useGetJWKKeysQuery } = jwtApi;
|
|
|
395
395
|
* correct opinionated type.
|
|
396
396
|
*/ const useCoreSelector = reactRedux.useSelector.withTypes();
|
|
397
397
|
const useCoreDispatch = reactRedux.useDispatch.withTypes();
|
|
398
|
+
const useCoreStore = reactRedux.useStore.withTypes();
|
|
398
399
|
|
|
399
400
|
/**
|
|
400
401
|
* Creates an async thunk for fetching user permissions details from fence
|
|
@@ -820,7 +821,7 @@ const guppyApiReducer = guppyApi.reducer;
|
|
|
820
821
|
* Cohorts in Gen3 are defined as a set of filters for each index in the data.
|
|
821
822
|
* This means one cohort id defined for all "tabs" in CohortBuilder (explorer)
|
|
822
823
|
* Switching a cohort is means that all the cohorts for the index changes.
|
|
823
|
-
*/ const UNSAVED_COHORT_NAME = '
|
|
824
|
+
*/ const UNSAVED_COHORT_NAME = 'Cohort';
|
|
824
825
|
const NULL_COHORT_ID = 'null_cohort_id';
|
|
825
826
|
const newCohort = ({ filters = {}, customName })=>{
|
|
826
827
|
const ts = new Date();
|
|
@@ -1066,6 +1067,10 @@ const selectCohortFilters = (state)=>{
|
|
|
1066
1067
|
const currentCohortId = getCurrentCohortFromCoreState(state);
|
|
1067
1068
|
return state.cohorts.cohort.entities[currentCohortId]?.filters;
|
|
1068
1069
|
};
|
|
1070
|
+
const selectCurrentCohortFilters = (state)=>{
|
|
1071
|
+
const currentCohortId = getCurrentCohortFromCoreState(state);
|
|
1072
|
+
return state.cohorts.cohort.entities[currentCohortId]?.filters;
|
|
1073
|
+
};
|
|
1069
1074
|
const selectCurrentCohortId = (state)=>{
|
|
1070
1075
|
return getCurrentCohort(state.cohorts.cohort);
|
|
1071
1076
|
};
|
|
@@ -3118,6 +3123,19 @@ const convertFilterSetToGqlFilter = (fs, toplevelOp = 'and')=>{
|
|
|
3118
3123
|
};
|
|
3119
3124
|
}
|
|
3120
3125
|
}
|
|
3126
|
+
const filterSetToOperation = (fs)=>{
|
|
3127
|
+
if (!fs) return undefined;
|
|
3128
|
+
switch(fs.mode){
|
|
3129
|
+
case 'and':
|
|
3130
|
+
return Object.keys(fs.root).length == 0 ? undefined : {
|
|
3131
|
+
operator: fs.mode,
|
|
3132
|
+
operands: Object.keys(fs.root).map((k)=>{
|
|
3133
|
+
return fs.root[k];
|
|
3134
|
+
})
|
|
3135
|
+
};
|
|
3136
|
+
}
|
|
3137
|
+
return undefined;
|
|
3138
|
+
};
|
|
3121
3139
|
|
|
3122
3140
|
const isFilterSet = (input)=>{
|
|
3123
3141
|
if (typeof input !== 'object' || input === null) {
|
|
@@ -4863,6 +4881,14 @@ const selectPaymodelStatus = toolkit.createSelector(paymodelStatusSelector, (sta
|
|
|
4863
4881
|
const isWorkspaceActive = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Launching || status === WorkspaceStatus.Terminating;
|
|
4864
4882
|
const isWorkspaceRunningOrStopping = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Terminating;
|
|
4865
4883
|
|
|
4884
|
+
const coreCreateApi = react.buildCreateApi(react.coreModule(), react.reactHooksModule({
|
|
4885
|
+
hooks: {
|
|
4886
|
+
useSelector: useCoreSelector,
|
|
4887
|
+
useStore: useCoreStore,
|
|
4888
|
+
useDispatch: useCoreDispatch
|
|
4889
|
+
}
|
|
4890
|
+
}));
|
|
4891
|
+
|
|
4866
4892
|
exports.Accessibility = Accessibility;
|
|
4867
4893
|
exports.CoreProvider = CoreProvider;
|
|
4868
4894
|
exports.DataLibraryStoreMode = DataLibraryStoreMode;
|
|
@@ -4902,6 +4928,7 @@ exports.convertFilterSetToGqlFilter = convertFilterSetToGqlFilter;
|
|
|
4902
4928
|
exports.convertFilterToGqlFilter = convertFilterToGqlFilter;
|
|
4903
4929
|
exports.convertToHistogramDataAsStringKey = convertToHistogramDataAsStringKey;
|
|
4904
4930
|
exports.convertToQueryString = convertToQueryString;
|
|
4931
|
+
exports.coreCreateApi = coreCreateApi;
|
|
4905
4932
|
exports.coreStore = coreStore;
|
|
4906
4933
|
exports.createAppApiForRTKQ = createAppApiForRTKQ;
|
|
4907
4934
|
exports.createAppStore = createAppStore;
|
|
@@ -4924,6 +4951,7 @@ exports.fetchJSONDataFromURL = fetchJSONDataFromURL;
|
|
|
4924
4951
|
exports.fetchJson = fetchJson;
|
|
4925
4952
|
exports.fetchUserState = fetchUserState;
|
|
4926
4953
|
exports.fieldNameToTitle = fieldNameToTitle;
|
|
4954
|
+
exports.filterSetToOperation = filterSetToOperation;
|
|
4927
4955
|
exports.gen3Api = gen3Api;
|
|
4928
4956
|
exports.getCurrentTimestamp = getCurrentTimestamp;
|
|
4929
4957
|
exports.getFederatedLoginStatus = getFederatedLoginStatus;
|
|
@@ -5010,6 +5038,7 @@ exports.selectCohortFilterCombineMode = selectCohortFilterCombineMode;
|
|
|
5010
5038
|
exports.selectCohortFilterExpanded = selectCohortFilterExpanded;
|
|
5011
5039
|
exports.selectCohortFilters = selectCohortFilters;
|
|
5012
5040
|
exports.selectCurrentCohort = selectCurrentCohort;
|
|
5041
|
+
exports.selectCurrentCohortFilters = selectCurrentCohortFilters;
|
|
5013
5042
|
exports.selectCurrentCohortId = selectCurrentCohortId;
|
|
5014
5043
|
exports.selectCurrentCohortModified = selectCurrentCohortModified;
|
|
5015
5044
|
exports.selectCurrentCohortName = selectCurrentCohortName;
|
|
@@ -5061,6 +5090,7 @@ exports.useAskQuestionMutation = useAskQuestionMutation;
|
|
|
5061
5090
|
exports.useAuthorizeFromCredentialsMutation = useAuthorizeFromCredentialsMutation;
|
|
5062
5091
|
exports.useCoreDispatch = useCoreDispatch;
|
|
5063
5092
|
exports.useCoreSelector = useCoreSelector;
|
|
5093
|
+
exports.useCoreStore = useCoreStore;
|
|
5064
5094
|
exports.useCreateAuthzResourceMutation = useCreateAuthzResourceMutation;
|
|
5065
5095
|
exports.useCreateRequestMutation = useCreateRequestMutation;
|
|
5066
5096
|
exports.useDataLibrary = useDataLibrary;
|