@gen3/core 0.11.31 → 0.11.33
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 +243 -98
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/features/filters/filters.d.ts +14 -0
- package/dist/dts/features/filters/filters.d.ts.map +1 -1
- package/dist/dts/features/guppy/guppyApi.d.ts.map +1 -1
- package/dist/dts/features/guppy/guppySlice.d.ts +0 -4
- package/dist/dts/features/guppy/guppySlice.d.ts.map +1 -1
- package/dist/dts/features/guppy/index.d.ts +6 -0
- package/dist/dts/features/guppy/index.d.ts.map +1 -1
- package/dist/dts/features/guppy/queryGenerators.d.ts +6 -0
- package/dist/dts/features/guppy/queryGenerators.d.ts.map +1 -0
- package/dist/dts/features/guppy/tests/queryGenerators.unit.test.d.ts +2 -0
- package/dist/dts/features/guppy/tests/queryGenerators.unit.test.d.ts.map +1 -0
- package/dist/dts/features/guppy/utils.d.ts +1 -1
- package/dist/dts/features/guppy/utils.d.ts.map +1 -1
- package/dist/dts/utils/conversions.d.ts +7 -0
- package/dist/dts/utils/conversions.d.ts.map +1 -1
- package/dist/dts/utils/extractvalues.d.ts +1 -0
- package/dist/dts/utils/extractvalues.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +3 -2
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/esm/index.js +236 -99
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +49 -5
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -5,18 +5,18 @@ import { QueryStatus, setupListeners } from '@reduxjs/toolkit/query';
|
|
|
5
5
|
import { useSelector, useDispatch, Provider, createSelectorHook, createDispatchHook, createStoreHook } from 'react-redux';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import React__default, { useEffect, useState, useRef, useCallback } from 'react';
|
|
8
|
+
import { GraphQLError, parse } from 'graphql';
|
|
9
|
+
import { JSONPath } from 'jsonpath-plus';
|
|
8
10
|
import { customAlphabet } from 'nanoid';
|
|
9
11
|
import useSWR from 'swr';
|
|
10
12
|
import { isEqual } from 'lodash';
|
|
11
13
|
import { flatten } from 'flat';
|
|
12
14
|
import Papa from 'papaparse';
|
|
13
|
-
import { JSONPath } from 'jsonpath-plus';
|
|
14
15
|
import { persistReducer, FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER, persistStore } from 'redux-persist';
|
|
15
16
|
import createWebStorage from 'redux-persist/lib/storage/createWebStorage';
|
|
16
17
|
import { PersistGate } from 'redux-persist/integration/react';
|
|
17
18
|
import { openDB } from 'idb';
|
|
18
19
|
import { useDeepCompareMemo } from 'use-deep-compare';
|
|
19
|
-
import { parse } from 'graphql';
|
|
20
20
|
import { v5 } from 'uuid';
|
|
21
21
|
import { CookiesProvider } from 'react-cookie';
|
|
22
22
|
import Queue from 'queue';
|
|
@@ -786,6 +786,15 @@ const selectRequestedWorkspaceStatusTimestamp = (state)=>state.activeWorkspace.r
|
|
|
786
786
|
data: await response.json()
|
|
787
787
|
};
|
|
788
788
|
} catch (e) {
|
|
789
|
+
if (e instanceof GraphQLError) {
|
|
790
|
+
return {
|
|
791
|
+
error: {
|
|
792
|
+
message: e.message,
|
|
793
|
+
locations: e.locations,
|
|
794
|
+
path: e.path
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
}
|
|
789
798
|
if (e instanceof Error) return {
|
|
790
799
|
error: e.message
|
|
791
800
|
};
|
|
@@ -1595,6 +1604,36 @@ const filterSetToOperation = (fs)=>{
|
|
|
1595
1604
|
}
|
|
1596
1605
|
return undefined;
|
|
1597
1606
|
};
|
|
1607
|
+
/**
|
|
1608
|
+
* Constructs a nested operation object based on the provided field and leaf operand.
|
|
1609
|
+
* If the field does not contain a dot '.', it either assigns the field to the leaf operand (if applicable)
|
|
1610
|
+
* or returns the leaf operand as is. When the field contains dots, it splits the field into parts,
|
|
1611
|
+
* creates a "nested" operation for the root field, and recursively constructs the nested structure
|
|
1612
|
+
* for the remaining portion of the field.
|
|
1613
|
+
*
|
|
1614
|
+
* @param {string} field - The hierarchical field path, with segments separated by dots (e.g., "root.child").
|
|
1615
|
+
* @param {Operation} leafOperand - The operation to be nested within the specified path.
|
|
1616
|
+
* @param parentPath - The parent path of the current field. Guppy nested filters require a parent path.
|
|
1617
|
+
* @param depth
|
|
1618
|
+
* @returns {Operation} A nested operation object that represents the structured path and operand.
|
|
1619
|
+
*/ const buildNestedGQLFilter = (field, leafOperand, parentPath = undefined)=>{
|
|
1620
|
+
if (!field.includes('.')) {
|
|
1621
|
+
return leafOperand;
|
|
1622
|
+
}
|
|
1623
|
+
const splitFieldArray = field.split('.');
|
|
1624
|
+
const nextField = splitFieldArray.shift();
|
|
1625
|
+
if (!nextField) {
|
|
1626
|
+
console.warn('Invalid field path:', field);
|
|
1627
|
+
return leafOperand;
|
|
1628
|
+
}
|
|
1629
|
+
const currentPath = parentPath ? `${parentPath}.${nextField}` : nextField;
|
|
1630
|
+
return {
|
|
1631
|
+
nested: {
|
|
1632
|
+
path: currentPath,
|
|
1633
|
+
...buildNestedGQLFilter(splitFieldArray.join('.'), leafOperand, currentPath)
|
|
1634
|
+
}
|
|
1635
|
+
};
|
|
1636
|
+
};
|
|
1598
1637
|
|
|
1599
1638
|
const isFilterSet = (input)=>{
|
|
1600
1639
|
if (typeof input !== 'object' || input === null) {
|
|
@@ -1649,7 +1688,7 @@ const COMMON_PREPOSITIONS = [
|
|
|
1649
1688
|
'up',
|
|
1650
1689
|
'yet'
|
|
1651
1690
|
];
|
|
1652
|
-
const capitalize = (s)=>s.length > 0 ? s[0].toUpperCase() + s.slice(1) : '';
|
|
1691
|
+
const capitalize$1 = (s)=>s.length > 0 ? s[0].toUpperCase() + s.slice(1) : '';
|
|
1653
1692
|
const trimFirstFieldNameToTitle = (fieldName, trim = false)=>{
|
|
1654
1693
|
if (trim) {
|
|
1655
1694
|
const source = fieldName.slice(fieldName.indexOf('.') + 1);
|
|
@@ -1668,7 +1707,7 @@ const trimFirstFieldNameToTitle = (fieldName, trim = false)=>{
|
|
|
1668
1707
|
return FieldNameOverrides[fieldName];
|
|
1669
1708
|
}
|
|
1670
1709
|
if (fieldName === undefined) return 'No Title';
|
|
1671
|
-
return fieldName.split('.').slice(-sections).map((s)=>s.split('_')).flat().map((word)=>COMMON_PREPOSITIONS.includes(word) ? word : capitalize(word)).join(' ');
|
|
1710
|
+
return fieldName.split('.').slice(-sections).map((s)=>s.split('_')).flat().map((word)=>COMMON_PREPOSITIONS.includes(word) ? word : capitalize$1(word)).join(' ');
|
|
1672
1711
|
};
|
|
1673
1712
|
/**
|
|
1674
1713
|
* Extracts the index name from the field name
|
|
@@ -1850,14 +1889,22 @@ function isHttpStatusError(error) {
|
|
|
1850
1889
|
* @param {string} csrfToken - The CSRF token to include in the request headers.
|
|
1851
1890
|
* @returns {FetchConfig} - The prepared fetch configuration object.
|
|
1852
1891
|
*/ const prepareFetchConfig = (parameters, csrfToken)=>{
|
|
1892
|
+
const headers = new Headers({
|
|
1893
|
+
Accept: 'application/json',
|
|
1894
|
+
'Content-Type': 'application/json',
|
|
1895
|
+
...csrfToken !== undefined && {
|
|
1896
|
+
'X-CSRF-Token': csrfToken
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1900
|
+
// NOTE: This cookie can only be accessed from the client side
|
|
1901
|
+
// in development mode. Otherwise, the cookie is set as httpOnly
|
|
1902
|
+
const accessToken = getCookie('credentials_token');
|
|
1903
|
+
if (accessToken) headers.set('Authorization', `Bearer ${accessToken}`);
|
|
1904
|
+
}
|
|
1853
1905
|
return {
|
|
1854
1906
|
method: 'POST',
|
|
1855
|
-
headers:
|
|
1856
|
-
'Content-Type': 'application/json',
|
|
1857
|
-
...csrfToken !== undefined && {
|
|
1858
|
-
'X-CSRF-Token': csrfToken
|
|
1859
|
-
}
|
|
1860
|
-
},
|
|
1907
|
+
headers: headers,
|
|
1861
1908
|
body: JSON.stringify({
|
|
1862
1909
|
type: parameters.type,
|
|
1863
1910
|
filter: convertFilterSetToGqlFilter(parameters.filter),
|
|
@@ -2042,6 +2089,88 @@ const groupSharedFields = (data)=>{
|
|
|
2042
2089
|
return data;
|
|
2043
2090
|
};
|
|
2044
2091
|
|
|
2092
|
+
const customQueryStrForField = (field, query, depth = 0)=>{
|
|
2093
|
+
const indent = ' '.repeat(depth);
|
|
2094
|
+
const splittedFieldArray = field.split('.');
|
|
2095
|
+
const splittedField = splittedFieldArray.shift();
|
|
2096
|
+
if (splittedFieldArray.length === 0) {
|
|
2097
|
+
return `${indent}${splittedField} ${query}`;
|
|
2098
|
+
}
|
|
2099
|
+
return `${indent}${splittedField} {
|
|
2100
|
+
${customQueryStrForField(splittedFieldArray.join('.'), query, depth + 1)}
|
|
2101
|
+
${indent}}`;
|
|
2102
|
+
};
|
|
2103
|
+
// TODO: refactor the function below using customQueryStrForEachField and a wrapper function that passes the query
|
|
2104
|
+
const histogramQueryStrForEachField = (field)=>{
|
|
2105
|
+
const splittedFieldArray = field.split('.');
|
|
2106
|
+
const splittedField = splittedFieldArray.shift();
|
|
2107
|
+
if (splittedFieldArray.length === 0) {
|
|
2108
|
+
return `
|
|
2109
|
+
${splittedField} {
|
|
2110
|
+
histogram {
|
|
2111
|
+
key
|
|
2112
|
+
count
|
|
2113
|
+
}
|
|
2114
|
+
}`;
|
|
2115
|
+
}
|
|
2116
|
+
return `
|
|
2117
|
+
${splittedField} {
|
|
2118
|
+
${histogramQueryStrForEachField(splittedFieldArray.join('.'))}
|
|
2119
|
+
}`;
|
|
2120
|
+
};
|
|
2121
|
+
const statsQueryStrForEachField = (field)=>{
|
|
2122
|
+
const splittedFieldArray = field.split('.');
|
|
2123
|
+
const splittedField = splittedFieldArray.shift();
|
|
2124
|
+
if (splittedFieldArray.length === 0) {
|
|
2125
|
+
return `
|
|
2126
|
+
${splittedField} {
|
|
2127
|
+
histogram {
|
|
2128
|
+
count
|
|
2129
|
+
min
|
|
2130
|
+
max
|
|
2131
|
+
avg
|
|
2132
|
+
sum
|
|
2133
|
+
}
|
|
2134
|
+
}`;
|
|
2135
|
+
}
|
|
2136
|
+
return `
|
|
2137
|
+
${splittedField} {
|
|
2138
|
+
${statsQueryStrForEachField(splittedFieldArray.join('.'))}
|
|
2139
|
+
}`;
|
|
2140
|
+
};
|
|
2141
|
+
const nestedHistogramQueryStrForEachField = (mainField, numericAggAsText)=>`
|
|
2142
|
+
${mainField} {
|
|
2143
|
+
${numericAggAsText ? 'asTextHistogram' : 'histogram'} {
|
|
2144
|
+
key
|
|
2145
|
+
count
|
|
2146
|
+
missingFields {
|
|
2147
|
+
field
|
|
2148
|
+
count
|
|
2149
|
+
}
|
|
2150
|
+
termsFields {
|
|
2151
|
+
field
|
|
2152
|
+
count
|
|
2153
|
+
terms {
|
|
2154
|
+
key
|
|
2155
|
+
count
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
}`;
|
|
2160
|
+
const rawDataQueryStrForEachField = (field)=>{
|
|
2161
|
+
const splitFieldArray = field.split('.');
|
|
2162
|
+
const splitField = splitFieldArray.shift();
|
|
2163
|
+
if (splitFieldArray.length === 0) {
|
|
2164
|
+
return `
|
|
2165
|
+
${splitField}
|
|
2166
|
+
`;
|
|
2167
|
+
}
|
|
2168
|
+
return `
|
|
2169
|
+
${splitField} {
|
|
2170
|
+
${rawDataQueryStrForEachField(splitFieldArray.join('.'))}
|
|
2171
|
+
}`;
|
|
2172
|
+
};
|
|
2173
|
+
|
|
2045
2174
|
const statusEndpoint = '/_status';
|
|
2046
2175
|
const fetchJson = async (url)=>{
|
|
2047
2176
|
const res = await fetch(url, {
|
|
@@ -2322,75 +2451,6 @@ const explorerTags = guppyApi.enhanceEndpoints({
|
|
|
2322
2451
|
})
|
|
2323
2452
|
})
|
|
2324
2453
|
});
|
|
2325
|
-
const histogramQueryStrForEachField = (field)=>{
|
|
2326
|
-
const splittedFieldArray = field.split('.');
|
|
2327
|
-
const splittedField = splittedFieldArray.shift();
|
|
2328
|
-
if (splittedFieldArray.length === 0) {
|
|
2329
|
-
return `
|
|
2330
|
-
${splittedField} {
|
|
2331
|
-
histogram {
|
|
2332
|
-
key
|
|
2333
|
-
count
|
|
2334
|
-
}
|
|
2335
|
-
}`;
|
|
2336
|
-
}
|
|
2337
|
-
return `
|
|
2338
|
-
${splittedField} {
|
|
2339
|
-
${histogramQueryStrForEachField(splittedFieldArray.join('.'))}
|
|
2340
|
-
}`;
|
|
2341
|
-
};
|
|
2342
|
-
const statsQueryStrForEachField = (field)=>{
|
|
2343
|
-
const splittedFieldArray = field.split('.');
|
|
2344
|
-
const splittedField = splittedFieldArray.shift();
|
|
2345
|
-
if (splittedFieldArray.length === 0) {
|
|
2346
|
-
return `
|
|
2347
|
-
${splittedField} {
|
|
2348
|
-
histogram {
|
|
2349
|
-
count
|
|
2350
|
-
min
|
|
2351
|
-
max
|
|
2352
|
-
avg
|
|
2353
|
-
sum
|
|
2354
|
-
}
|
|
2355
|
-
}`;
|
|
2356
|
-
}
|
|
2357
|
-
return `
|
|
2358
|
-
${splittedField} {
|
|
2359
|
-
${statsQueryStrForEachField(splittedFieldArray.join('.'))}
|
|
2360
|
-
}`;
|
|
2361
|
-
};
|
|
2362
|
-
const nestedHistogramQueryStrForEachField = (mainField, numericAggAsText)=>`
|
|
2363
|
-
${mainField} {
|
|
2364
|
-
${numericAggAsText ? 'asTextHistogram' : 'histogram'} {
|
|
2365
|
-
key
|
|
2366
|
-
count
|
|
2367
|
-
missingFields {
|
|
2368
|
-
field
|
|
2369
|
-
count
|
|
2370
|
-
}
|
|
2371
|
-
termsFields {
|
|
2372
|
-
field
|
|
2373
|
-
count
|
|
2374
|
-
terms {
|
|
2375
|
-
key
|
|
2376
|
-
count
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
}
|
|
2380
|
-
}`;
|
|
2381
|
-
const rawDataQueryStrForEachField = (field)=>{
|
|
2382
|
-
const splitFieldArray = field.split('.');
|
|
2383
|
-
const splitField = splitFieldArray.shift();
|
|
2384
|
-
if (splitFieldArray.length === 0) {
|
|
2385
|
-
return `
|
|
2386
|
-
${splitField}
|
|
2387
|
-
`;
|
|
2388
|
-
}
|
|
2389
|
-
return `
|
|
2390
|
-
${splitField} {
|
|
2391
|
-
${rawDataQueryStrForEachField(splitFieldArray.join('.'))}
|
|
2392
|
-
}`;
|
|
2393
|
-
};
|
|
2394
2454
|
const useGetArrayTypes = ()=>{
|
|
2395
2455
|
{
|
|
2396
2456
|
const { data, error } = useGetStatus();
|
|
@@ -2742,6 +2802,28 @@ const fetchFencePresignedURL = async ({ guid, method = 'GET', onAbort = ()=>null
|
|
|
2742
2802
|
return await response.json();
|
|
2743
2803
|
};
|
|
2744
2804
|
|
|
2805
|
+
const extractValuesFromObject = (jsonPathMappings, obj)=>{
|
|
2806
|
+
const result = {};
|
|
2807
|
+
const extractObjectValue = (jsonPath, obj)=>{
|
|
2808
|
+
const extractedValues = JSONPath({
|
|
2809
|
+
path: jsonPath,
|
|
2810
|
+
json: obj
|
|
2811
|
+
});
|
|
2812
|
+
return extractedValues.length > 0 ? extractedValues[0] : undefined;
|
|
2813
|
+
};
|
|
2814
|
+
for(const key in jsonPathMappings){
|
|
2815
|
+
if (key in Object.keys(jsonPathMappings)) {
|
|
2816
|
+
// Extract value from an object and store it in the result.
|
|
2817
|
+
result[key] = extractObjectValue(jsonPathMappings[key], obj);
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
return result;
|
|
2821
|
+
};
|
|
2822
|
+
const ExtractValueFromObject = (obj, key, valueIfNotFound)=>{
|
|
2823
|
+
return obj?.[key] ?? valueIfNotFound;
|
|
2824
|
+
};
|
|
2825
|
+
|
|
2826
|
+
const DAYS_IN_YEAR = 365.25;
|
|
2745
2827
|
/**
|
|
2746
2828
|
* Converts HistogramData to HistogramDataAsStringKey by ensuring the key is a string.
|
|
2747
2829
|
* If the key is already a string, it's used as is.
|
|
@@ -2757,6 +2839,79 @@ const fetchFencePresignedURL = async ({ guid, method = 'GET', onAbort = ()=>null
|
|
|
2757
2839
|
};
|
|
2758
2840
|
const calculatePercentageAsNumber = (count, total)=>count ? count / total * 100 : 0;
|
|
2759
2841
|
const calculatePercentageAsString = (count, total)=>`${(count / total * 100).toFixed(2)}%`;
|
|
2842
|
+
const capitalize = (original)=>{
|
|
2843
|
+
const customCapitalizations = {
|
|
2844
|
+
id: 'ID',
|
|
2845
|
+
uuid: 'UUID',
|
|
2846
|
+
dna: 'DNA',
|
|
2847
|
+
dbsnp: 'dbSNP',
|
|
2848
|
+
cosmic: 'COSMIC',
|
|
2849
|
+
civic: 'CIViC',
|
|
2850
|
+
dbgap: 'dbGaP',
|
|
2851
|
+
ecog: 'ECOG',
|
|
2852
|
+
bmi: 'BMI',
|
|
2853
|
+
gdc: 'GDC',
|
|
2854
|
+
cnv: 'CNV',
|
|
2855
|
+
ssm: 'SSM',
|
|
2856
|
+
aa: 'AA'
|
|
2857
|
+
};
|
|
2858
|
+
return original.split(' ').map((word)=>customCapitalizations[word.toLowerCase()] || `${word.charAt(0).toUpperCase()}${word.slice(1)}`).join(' ');
|
|
2859
|
+
};
|
|
2860
|
+
const humanify = ({ term = '', capitalize: cap = true, facetTerm = false })=>{
|
|
2861
|
+
let original;
|
|
2862
|
+
let humanified;
|
|
2863
|
+
if (facetTerm) {
|
|
2864
|
+
// Splits on capital letters followed by lowercase letters to find
|
|
2865
|
+
// words squished together in a string.
|
|
2866
|
+
original = term?.split(/(?=[A-Z][a-z])/).join(' ');
|
|
2867
|
+
humanified = term?.replace(/\./g, ' ').replace(/_/g, ' ').trim();
|
|
2868
|
+
} else {
|
|
2869
|
+
const split = (original || term)?.split('.');
|
|
2870
|
+
humanified = split[split.length - 1]?.replace(/_/g, ' ').trim();
|
|
2871
|
+
// Special case 'name' to include any parent nested for sake of
|
|
2872
|
+
// specificity in the UI
|
|
2873
|
+
if (humanified === 'name' && split?.length > 1) {
|
|
2874
|
+
humanified = `${split[split?.length - 2]} ${humanified}`;
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
return cap ? capitalize(humanified) : humanified;
|
|
2878
|
+
};
|
|
2879
|
+
/*https://github.com/NCI-GDC/portal-ui/blob/develop/src/packages/%40ncigdc/utils/ageDisplay.js*/ /**
|
|
2880
|
+
* Converts age in days into a human-readable format.
|
|
2881
|
+
*
|
|
2882
|
+
* @param ageInDays - The age in days.
|
|
2883
|
+
* @param yearsOnly - If true, only display years.
|
|
2884
|
+
* @defaultValue false
|
|
2885
|
+
* @param defaultValue - The default value to return if ageInDays is falsy.
|
|
2886
|
+
* @defaultValue "--"
|
|
2887
|
+
* @returns The formatted age string.
|
|
2888
|
+
*/ const ageDisplay = (ageInDays, yearsOnly = false, defaultValue = '--')=>{
|
|
2889
|
+
if (ageInDays !== 0 && !ageInDays) {
|
|
2890
|
+
return defaultValue;
|
|
2891
|
+
}
|
|
2892
|
+
const calculateYearsAndDays = (years, days)=>days === 365 ? [
|
|
2893
|
+
years + 1,
|
|
2894
|
+
0
|
|
2895
|
+
] : [
|
|
2896
|
+
years,
|
|
2897
|
+
days
|
|
2898
|
+
];
|
|
2899
|
+
const ABS_AGE_DAYS = Math.abs(ageInDays);
|
|
2900
|
+
const [years, remainingDays] = calculateYearsAndDays(Math.floor(ABS_AGE_DAYS / DAYS_IN_YEAR), Math.ceil(ABS_AGE_DAYS % DAYS_IN_YEAR));
|
|
2901
|
+
const formattedYears = years === 0 ? '' : `${years} ${years === 1 ? 'year' : 'years'}`;
|
|
2902
|
+
const formattedDays = !yearsOnly && remainingDays > 0 ? `${remainingDays} ${remainingDays === 1 ? 'day' : 'days'}` : years === 0 && remainingDays === 0 ? '0 days' : '';
|
|
2903
|
+
const ageString = [
|
|
2904
|
+
formattedYears,
|
|
2905
|
+
formattedDays
|
|
2906
|
+
].filter(Boolean).join(' ');
|
|
2907
|
+
return ageInDays >= 0 ? ageString : `-${ageString}`;
|
|
2908
|
+
};
|
|
2909
|
+
/**
|
|
2910
|
+
* Given an object of JSON, stringify it into a string.
|
|
2911
|
+
* @param obj - the object to stringify
|
|
2912
|
+
* @param defaults - the default value to return if the object is undefined
|
|
2913
|
+
* @category Utility
|
|
2914
|
+
*/ const stringifyJSONParam = (obj, defaults = '{}')=>obj ? JSON.stringify(obj) : defaults;
|
|
2760
2915
|
|
|
2761
2916
|
const queryWTSFederatedLoginStatus = async (signal)=>{
|
|
2762
2917
|
try {
|
|
@@ -4748,7 +4903,7 @@ const { useGraphQLQuery } = graphQLAPI;
|
|
|
4748
4903
|
return {
|
|
4749
4904
|
url: `${GEN3_GUPPY_API}/download`,
|
|
4750
4905
|
method: 'POST',
|
|
4751
|
-
body:
|
|
4906
|
+
body: queryBody,
|
|
4752
4907
|
cache: 'no-cache'
|
|
4753
4908
|
};
|
|
4754
4909
|
},
|
|
@@ -5301,24 +5456,6 @@ const userHasMethodOnAnyProject = (method, userAuthMapping = {})=>{
|
|
|
5301
5456
|
};
|
|
5302
5457
|
const userHasCreateOrUpdateOnAnyProject = (userAuthMapping = {})=>userHasMethodOnAnyProject('create', userAuthMapping) || userHasMethodOnAnyProject('update', userAuthMapping);
|
|
5303
5458
|
|
|
5304
|
-
const extractValuesFromObject = (jsonPathMappings, obj)=>{
|
|
5305
|
-
const result = {};
|
|
5306
|
-
const extractObjectValue = (jsonPath, obj)=>{
|
|
5307
|
-
const extractedValues = JSONPath({
|
|
5308
|
-
path: jsonPath,
|
|
5309
|
-
json: obj
|
|
5310
|
-
});
|
|
5311
|
-
return extractedValues.length > 0 ? extractedValues[0] : undefined;
|
|
5312
|
-
};
|
|
5313
|
-
for(const key in jsonPathMappings){
|
|
5314
|
-
if (key in Object.keys(jsonPathMappings)) {
|
|
5315
|
-
// Extract value from an object and store it in the result.
|
|
5316
|
-
result[key] = extractObjectValue(jsonPathMappings[key], obj);
|
|
5317
|
-
}
|
|
5318
|
-
}
|
|
5319
|
-
return result;
|
|
5320
|
-
};
|
|
5321
|
-
|
|
5322
5459
|
const SubmissionGraphqlQuery = `query transactionList {
|
|
5323
5460
|
transactionList: transaction_log(last: 20) {
|
|
5324
5461
|
id
|
|
@@ -5601,5 +5738,5 @@ const selectPaymodelStatus = createSelector(paymodelStatusSelector, (status)=>st
|
|
|
5601
5738
|
const isWorkspaceActive = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Launching || status === WorkspaceStatus.Terminating;
|
|
5602
5739
|
const isWorkspaceRunningOrStopping = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Terminating;
|
|
5603
5740
|
|
|
5604
|
-
export { Accessibility, CohortStorage, CoreProvider, DataLibraryStoreMode, EmptyFilterSet, EmptyWorkspaceStatusResponse, EnumValueExtractorHandler, GEN3_API, GEN3_AUTHZ_API, GEN3_COMMONS_NAME, GEN3_CROSSWALK_API, GEN3_DOMAIN, GEN3_DOWNLOADS_ENDPOINT, GEN3_FENCE_API, GEN3_GUPPY_API, GEN3_MANIFEST_API, GEN3_MDS_API, GEN3_REDIRECT_URL, GEN3_SOWER_API, GEN3_SUBMISSION_API, GEN3_WORKSPACE_API, HTTPError, HTTPErrorMessages, HttpMethod, MissingServiceConfigurationError, Modals, PodConditionType, PodStatus, RequestedWorkspaceStatus, ToGqlHandler, ValueExtractorHandler, WorkspaceStatus, appendFilterToOperation, buildGetAggregationQuery, buildGetStatsAggregationQuery, buildListItemsGroupedByDataset, calculatePercentageAsNumber, calculatePercentageAsString, clearActiveWorkspaceId, clearCohortFilters, cohortReducer, convertFilterSetToGqlFilter, convertFilterToGqlFilter, convertGqlFilterToFilter, convertToHistogramDataAsStringKey, convertToQueryString, coreStore, createAppApiForRTKQ, createAppStore, createGen3App, createGen3AppWithOwnStore, createNewCohort, createUseCoreDataHook, defaultCohortNameGenerator, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, drsHostnamesReducer, duplicateCohort, explorerApi, explorerTags, extractEnumFilterValue, extractFieldNameFromFullFieldName, extractFileDatasetsInRecords, extractFilterValue, extractIndexAndFieldNameFromFullFieldName, extractIndexFromDataLibraryCohort, extractIndexFromFullFieldName, fetchFence, fetchFencePresignedURL, fetchJSONDataFromURL, fetchJson, fetchUserState, fieldNameToTitle, filterSetToOperation, gen3Api, generateUniqueName, getCurrentTimestamp, getFederatedLoginStatus, getGen3AppId, getNumberOfItemsInDatalist, getRemoteSupportServiceRegistry, getTimestamp, graphQLAPI, graphQLWithTags, groupSharedFields, guppyAPISliceMiddleware, guppyApi, guppyApiReducer, guppyApiSliceReducerPath, handleGqlOperation, handleOperation, hideModal, histogramQueryStrForEachField, isAdditionalDataItem, isArray, isAuthenticated, isCohortItem, isDataLibraryAPIResponse, isDatalistAPI, isErrorWithMessage, isFetchBaseQueryError, isFetchError, isFetchParseError, isFileItem, isFilterEmpty, isFilterSet, isGQLIntersection, isGQLUnion, isGuppyAggregationData, isHistogramData, isHistogramDataAArray, isHistogramDataAnEnum, isHistogramDataArray, isHistogramDataArrayARange, isHistogramDataArrayAnEnum, isHistogramDataCollection, isHistogramRangeData, isHttpStatusError, isIndexedFilterSetEmpty, isIntersection, isJSONObject, isJSONValue, isJSONValueArray, isNameUnique, isNotDefined, isObject, isOperandsType, isOperationWithField, isOperatorWithFieldAndArrayOfOperands, isPending, isProgramUrl, isRootUrl, isStatsValue, isStatsValuesArray, isString, isTimeGreaterThan, isUnion, isWorkspaceActive, isWorkspaceRunningOrStopping, listifyMethodsFromMapping, logoutFence, manifestApi, manifestTags, nestedHistogramQueryStrForEachField, prepareUrl, prependIndexToFieldName, processHistogramResponse, projectCodeFromResourcePath, queryMultipleMDSRecords, rawDataQueryStrForEachField, registerDefaultRemoteSupport, removeCohort, removeCohortFilter, requestorApi, resetUserState, resourcePathFromProjectID, roundHistogramResponse, selectActiveWorkspaceId, selectActiveWorkspaceStatus, selectAllCohortFiltersCollapsed, selectAllCohorts, selectAuthzMappingData, selectAvailableCohortByName, selectAvailableCohorts, selectCSRFToken, selectCSRFTokenData, selectCohortById, selectCohortFilterCombineMode, selectCohortFilterExpanded, selectCohortFilters, selectCohortIds, selectCurrentCohort, selectCurrentCohortFilters, selectCurrentCohortId, selectCurrentCohortModified, selectCurrentCohortName, selectCurrentCohortSaved, selectCurrentMessage, selectCurrentModal, selectGen3AppByName, selectGen3AppMetadataByName, selectHeadersWithCSRFToken, selectIndexFilters, selectIndexedFilterByName, selectPaymodelStatus, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, selectSharedFilters, selectSharedFiltersForFields, selectShouldShareFilters, selectTotalCohorts, selectUser, selectUserAuthStatus, selectUserData, selectUserDetails, selectUserLoginStatus, selectWorkspaceStatus, selectWorkspaceStatusFromService, setActiveWorkspace, setActiveWorkspaceId, setActiveWorkspaceStatus, setCohortFilter, setCohortFilterCombineMode, setCohortIndexFilters, setCohortList, setCurrentCohortId, setDRSHostnames, setRequestedWorkspaceStatus, setSharedFilters, setShouldShareFilters, setupCoreStore, showModal, statsQueryStrForEachField, submissionApi, toggleCohortBuilderAllFilters, toggleCohortBuilderCategoryFilter, trimFirstFieldNameToTitle, updateCohortFilter, updateCohortName, useAddCohortManifestMutation, useAddFileManifestMutation, useAddMetadataManifestMutation, useAddNewCredentialMutation, useAskQuestionMutation, useAuthorizeFromCredentialsMutation, useCoreDispatch, useCoreSelector, useCreateAuthzResourceMutation, useCreateRequestMutation, useDataLibrary, useDownloadFromGuppyMutation, useFetchUserDetailsQuery, useGeneralGQLQuery, useGetAISearchStatusQuery, useGetAISearchVersionQuery, useGetAccessibleDataQuery, useGetActivePayModelQuery, useGetAggMDSQuery, useGetAggsQuery, useGetAllFieldsForTypeQuery, useGetArrayTypes, useGetAuthzMappingsQuery, useGetAuthzResourcesQuery, useGetCSRFQuery, useGetCohortManifestQuery, useGetCountsQuery, useGetCredentialsQuery, useGetCrosswalkDataQuery, useGetDataQuery, useGetDictionaryQuery, useGetDownloadQuery, useGetExternalLoginsQuery, useGetFederatedLoginStatus, useGetFieldCountSummaryQuery, useGetFieldsForIndexQuery, useGetFileFromManifestQuery, useGetFileManifestQuery, useGetIndexAggMDSQuery, useGetIndexFields, useGetJWKKeysQuery, useGetLoginProvidersQuery, useGetMDSQuery, useGetManifestServiceStatusQuery, useGetMetadataByIdQuery, useGetMetadataFromManifestQuery, useGetMetadataManifestQuery, useGetProjectsDetailsQuery, useGetProjectsQuery, useGetRawDataAndTotalCountsQuery, useGetSharedFieldsForIndexQuery, useGetSowerJobListQuery, useGetSowerJobStatusQuery, useGetSowerOutputQuery, useGetSowerServiceStatusQuery, useGetStatsAggregationsQuery, useGetStatus, useGetSubAggsQuery, useGetSubmissionGraphQLQuery, useGetSubmissionsQuery, useGetTagsQuery, useGetWorkspaceOptionsQuery, useGetWorkspacePayModelsQuery, useGetWorkspaceStatusQuery, useGraphQLQuery, useIsExternalConnectedQuery, useIsUserLoggedIn, useLaunchWorkspaceMutation, useLazyFetchUserDetailsQuery, useLazyGeneralGQLQuery, useLazyGetAggsQuery, useLazyGetAuthzMappingsQuery, useLazyGetAuthzResourcesQuery, useLazyGetCSRFQuery, useLazyGetCountsQuery, useLazyGetCrosswalkDataQuery, useLazyGetDownloadQuery, useLazyGetExternalLoginsQuery, useLazyGetManifestServiceStatusQuery, useLazyGetProjectsQuery, useLazyGetSowerJobListQuery, useLazyGetStatsAggregationsQuery, useLazyGetSubmissionGraphQLQuery, useLazyIsExternalConnectedQuery, useLazyRequestQuery, usePrevious, useRemoveCredentialMutation, useRequestByIdQuery, useRequestQuery, useRequestorStatusQuery, useSetCurrentPayModelMutation, useSubmitSowerJobMutation, useTerminateWorkspaceMutation, useUserAuth, useUserRequestQuery, userHasCreateOrUpdateOnAnyProject, userHasDataUpload, userHasMethodForServiceOnProject, userHasMethodForServiceOnResource, userHasMethodOnAnyProject, userHasSheepdogProgramAdmin, userHasSheepdogProjectAdmin };
|
|
5741
|
+
export { Accessibility, CohortStorage, CoreProvider, DAYS_IN_YEAR, DataLibraryStoreMode, EmptyFilterSet, EmptyWorkspaceStatusResponse, EnumValueExtractorHandler, ExtractValueFromObject, GEN3_API, GEN3_AUTHZ_API, GEN3_COMMONS_NAME, GEN3_CROSSWALK_API, GEN3_DOMAIN, GEN3_DOWNLOADS_ENDPOINT, GEN3_FENCE_API, GEN3_GUPPY_API, GEN3_MANIFEST_API, GEN3_MDS_API, GEN3_REDIRECT_URL, GEN3_SOWER_API, GEN3_SUBMISSION_API, GEN3_WORKSPACE_API, HTTPError, HTTPErrorMessages, HttpMethod, MissingServiceConfigurationError, Modals, PodConditionType, PodStatus, RequestedWorkspaceStatus, ToGqlHandler, ValueExtractorHandler, WorkspaceStatus, ageDisplay, appendFilterToOperation, buildGetAggregationQuery, buildGetStatsAggregationQuery, buildListItemsGroupedByDataset, buildNestedGQLFilter, calculatePercentageAsNumber, calculatePercentageAsString, capitalize, clearActiveWorkspaceId, clearCohortFilters, cohortReducer, convertFilterSetToGqlFilter, convertFilterToGqlFilter, convertGqlFilterToFilter, convertToHistogramDataAsStringKey, convertToQueryString, coreStore, createAppApiForRTKQ, createAppStore, createGen3App, createGen3AppWithOwnStore, createNewCohort, createUseCoreDataHook, customQueryStrForField, defaultCohortNameGenerator, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, drsHostnamesReducer, duplicateCohort, explorerApi, explorerTags, extractEnumFilterValue, extractFieldNameFromFullFieldName, extractFileDatasetsInRecords, extractFilterValue, extractIndexAndFieldNameFromFullFieldName, extractIndexFromDataLibraryCohort, extractIndexFromFullFieldName, fetchFence, fetchFencePresignedURL, fetchJSONDataFromURL, fetchJson, fetchUserState, fieldNameToTitle, filterSetToOperation, gen3Api, generateUniqueName, getCurrentTimestamp, getFederatedLoginStatus, getGen3AppId, getNumberOfItemsInDatalist, getRemoteSupportServiceRegistry, getTimestamp, graphQLAPI, graphQLWithTags, groupSharedFields, guppyAPISliceMiddleware, guppyApi, guppyApiReducer, guppyApiSliceReducerPath, handleGqlOperation, handleOperation, hideModal, histogramQueryStrForEachField, humanify, isAdditionalDataItem, isArray, isAuthenticated, isCohortItem, isDataLibraryAPIResponse, isDatalistAPI, isErrorWithMessage, isFetchBaseQueryError, isFetchError, isFetchParseError, isFileItem, isFilterEmpty, isFilterSet, isGQLIntersection, isGQLUnion, isGuppyAggregationData, isHistogramData, isHistogramDataAArray, isHistogramDataAnEnum, isHistogramDataArray, isHistogramDataArrayARange, isHistogramDataArrayAnEnum, isHistogramDataCollection, isHistogramRangeData, isHttpStatusError, isIndexedFilterSetEmpty, isIntersection, isJSONObject, isJSONValue, isJSONValueArray, isNameUnique, isNotDefined, isObject, isOperandsType, isOperationWithField, isOperatorWithFieldAndArrayOfOperands, isPending, isProgramUrl, isRootUrl, isStatsValue, isStatsValuesArray, isString, isTimeGreaterThan, isUnion, isWorkspaceActive, isWorkspaceRunningOrStopping, listifyMethodsFromMapping, logoutFence, manifestApi, manifestTags, nestedHistogramQueryStrForEachField, prepareUrl, prependIndexToFieldName, processHistogramResponse, projectCodeFromResourcePath, queryMultipleMDSRecords, rawDataQueryStrForEachField, registerDefaultRemoteSupport, removeCohort, removeCohortFilter, requestorApi, resetUserState, resourcePathFromProjectID, roundHistogramResponse, selectActiveWorkspaceId, selectActiveWorkspaceStatus, selectAllCohortFiltersCollapsed, selectAllCohorts, selectAuthzMappingData, selectAvailableCohortByName, selectAvailableCohorts, selectCSRFToken, selectCSRFTokenData, selectCohortById, selectCohortFilterCombineMode, selectCohortFilterExpanded, selectCohortFilters, selectCohortIds, selectCurrentCohort, selectCurrentCohortFilters, selectCurrentCohortId, selectCurrentCohortModified, selectCurrentCohortName, selectCurrentCohortSaved, selectCurrentMessage, selectCurrentModal, selectGen3AppByName, selectGen3AppMetadataByName, selectHeadersWithCSRFToken, selectIndexFilters, selectIndexedFilterByName, selectPaymodelStatus, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, selectSharedFilters, selectSharedFiltersForFields, selectShouldShareFilters, selectTotalCohorts, selectUser, selectUserAuthStatus, selectUserData, selectUserDetails, selectUserLoginStatus, selectWorkspaceStatus, selectWorkspaceStatusFromService, setActiveWorkspace, setActiveWorkspaceId, setActiveWorkspaceStatus, setCohortFilter, setCohortFilterCombineMode, setCohortIndexFilters, setCohortList, setCurrentCohortId, setDRSHostnames, setRequestedWorkspaceStatus, setSharedFilters, setShouldShareFilters, setupCoreStore, showModal, statsQueryStrForEachField, stringifyJSONParam, submissionApi, toggleCohortBuilderAllFilters, toggleCohortBuilderCategoryFilter, trimFirstFieldNameToTitle, updateCohortFilter, updateCohortName, useAddCohortManifestMutation, useAddFileManifestMutation, useAddMetadataManifestMutation, useAddNewCredentialMutation, useAskQuestionMutation, useAuthorizeFromCredentialsMutation, useCoreDispatch, useCoreSelector, useCreateAuthzResourceMutation, useCreateRequestMutation, useDataLibrary, useDownloadFromGuppyMutation, useFetchUserDetailsQuery, useGeneralGQLQuery, useGetAISearchStatusQuery, useGetAISearchVersionQuery, useGetAccessibleDataQuery, useGetActivePayModelQuery, useGetAggMDSQuery, useGetAggsQuery, useGetAllFieldsForTypeQuery, useGetArrayTypes, useGetAuthzMappingsQuery, useGetAuthzResourcesQuery, useGetCSRFQuery, useGetCohortManifestQuery, useGetCountsQuery, useGetCredentialsQuery, useGetCrosswalkDataQuery, useGetDataQuery, useGetDictionaryQuery, useGetDownloadQuery, useGetExternalLoginsQuery, useGetFederatedLoginStatus, useGetFieldCountSummaryQuery, useGetFieldsForIndexQuery, useGetFileFromManifestQuery, useGetFileManifestQuery, useGetIndexAggMDSQuery, useGetIndexFields, useGetJWKKeysQuery, useGetLoginProvidersQuery, useGetMDSQuery, useGetManifestServiceStatusQuery, useGetMetadataByIdQuery, useGetMetadataFromManifestQuery, useGetMetadataManifestQuery, useGetProjectsDetailsQuery, useGetProjectsQuery, useGetRawDataAndTotalCountsQuery, useGetSharedFieldsForIndexQuery, useGetSowerJobListQuery, useGetSowerJobStatusQuery, useGetSowerOutputQuery, useGetSowerServiceStatusQuery, useGetStatsAggregationsQuery, useGetStatus, useGetSubAggsQuery, useGetSubmissionGraphQLQuery, useGetSubmissionsQuery, useGetTagsQuery, useGetWorkspaceOptionsQuery, useGetWorkspacePayModelsQuery, useGetWorkspaceStatusQuery, useGraphQLQuery, useIsExternalConnectedQuery, useIsUserLoggedIn, useLaunchWorkspaceMutation, useLazyFetchUserDetailsQuery, useLazyGeneralGQLQuery, useLazyGetAggsQuery, useLazyGetAuthzMappingsQuery, useLazyGetAuthzResourcesQuery, useLazyGetCSRFQuery, useLazyGetCountsQuery, useLazyGetCrosswalkDataQuery, useLazyGetDownloadQuery, useLazyGetExternalLoginsQuery, useLazyGetManifestServiceStatusQuery, useLazyGetProjectsQuery, useLazyGetSowerJobListQuery, useLazyGetStatsAggregationsQuery, useLazyGetSubmissionGraphQLQuery, useLazyIsExternalConnectedQuery, useLazyRequestQuery, usePrevious, useRemoveCredentialMutation, useRequestByIdQuery, useRequestQuery, useRequestorStatusQuery, useSetCurrentPayModelMutation, useSubmitSowerJobMutation, useTerminateWorkspaceMutation, useUserAuth, useUserRequestQuery, userHasCreateOrUpdateOnAnyProject, userHasDataUpload, userHasMethodForServiceOnProject, userHasMethodForServiceOnResource, userHasMethodOnAnyProject, userHasSheepdogProgramAdmin, userHasSheepdogProjectAdmin };
|
|
5605
5742
|
//# sourceMappingURL=index.js.map
|