@gen3/core 0.12.44 → 0.12.46
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 +500 -158
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server.js +26 -14
- package/dist/cjs/server.js.map +1 -1
- package/dist/dts/features/cart/cartSelectors.d.ts +12 -0
- package/dist/dts/features/cart/cartSelectors.d.ts.map +1 -1
- package/dist/dts/features/cohort/cohortManagerSelector.d.ts +12 -0
- package/dist/dts/features/cohort/cohortManagerSelector.d.ts.map +1 -1
- package/dist/dts/features/cohort/cohortManagerSlice.d.ts +3 -0
- package/dist/dts/features/cohort/cohortManagerSlice.d.ts.map +1 -1
- package/dist/dts/features/fence/fetchFence.d.ts +1 -1
- package/dist/dts/features/fence/fetchFence.d.ts.map +1 -1
- package/dist/dts/features/fence/index.d.ts +2 -2
- package/dist/dts/features/fence/index.d.ts.map +1 -1
- package/dist/dts/features/fence/jwtApi.d.ts +184 -1
- package/dist/dts/features/fence/jwtApi.d.ts.map +1 -1
- package/dist/dts/features/fence/utils.d.ts.map +1 -1
- package/dist/dts/features/gen3/gen3Api.d.ts.map +1 -1
- package/dist/dts/features/notifications/index.d.ts +2 -0
- package/dist/dts/features/notifications/index.d.ts.map +1 -0
- package/dist/dts/features/notifications/notificationService.d.ts +42 -0
- package/dist/dts/features/notifications/notificationService.d.ts.map +1 -0
- package/dist/dts/features/submission/submissionApi.d.ts +186 -1
- package/dist/dts/features/submission/submissionApi.d.ts.map +1 -1
- package/dist/dts/features/user/userSliceRTK.d.ts +9 -0
- package/dist/dts/features/user/userSliceRTK.d.ts.map +1 -1
- package/dist/dts/features/workspace/index.d.ts +7 -3
- package/dist/dts/features/workspace/index.d.ts.map +1 -1
- package/dist/dts/features/workspace/jegKernelSelector.d.ts +162 -0
- package/dist/dts/features/workspace/jegKernelSelector.d.ts.map +1 -0
- package/dist/dts/features/workspace/jegKernelSlice.d.ts +482 -0
- package/dist/dts/features/workspace/jegKernelSlice.d.ts.map +1 -0
- package/dist/dts/features/workspace/jegWorkspaceSlice.d.ts +16 -0
- package/dist/dts/features/workspace/jegWorkspaceSlice.d.ts.map +1 -0
- package/dist/dts/features/workspace/tieredWorkspaceSlice.d.ts +14 -0
- package/dist/dts/features/workspace/tieredWorkspaceSlice.d.ts.map +1 -0
- package/dist/dts/features/workspace/types.d.ts +11 -1
- package/dist/dts/features/workspace/types.d.ts.map +1 -1
- package/dist/dts/features/workspace/workspaceSlice.d.ts +1 -1
- package/dist/dts/features/workspace/workspaceSlice.d.ts.map +1 -1
- package/dist/dts/hooks.d.ts +6 -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/reducers.d.ts +37 -31
- package/dist/dts/reducers.d.ts.map +1 -1
- package/dist/dts/store.d.ts +12 -0
- package/dist/dts/store.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/dts/utils/normalizeRtkError.d.ts +14 -0
- package/dist/dts/utils/normalizeRtkError.d.ts.map +1 -0
- package/dist/dts/utils/time.d.ts +14 -0
- package/dist/dts/utils/time.d.ts.map +1 -1
- package/dist/esm/index.js +473 -159
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server.js +26 -14
- package/dist/esm/server.js.map +1 -1
- package/dist/index.d.ts +11159 -10453
- package/dist/server.d.ts +1 -1
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -74,12 +74,22 @@ const isFetchError = (obj)=>{
|
|
|
74
74
|
* Template for fence error response dict
|
|
75
75
|
* @returns: An error dict response from a RESTFUL API request
|
|
76
76
|
*/ const buildFetchError = async (res, request)=>{
|
|
77
|
+
let text = '';
|
|
78
|
+
if (!res.bodyUsed) {
|
|
79
|
+
try {
|
|
80
|
+
text = await res.text();
|
|
81
|
+
} catch (err) {
|
|
82
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
83
|
+
console.warn('[buildFetchError] Failed to read response body:', err);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
77
87
|
return {
|
|
78
|
-
url: res.url,
|
|
88
|
+
url: res.url || '(unknown)',
|
|
79
89
|
status: res.status,
|
|
80
90
|
statusText: res.statusText,
|
|
81
|
-
text
|
|
82
|
-
request
|
|
91
|
+
text,
|
|
92
|
+
request
|
|
83
93
|
};
|
|
84
94
|
};
|
|
85
95
|
|
|
@@ -97,13 +107,11 @@ const isFetchError = (obj)=>{
|
|
|
97
107
|
* @returns {Promise<Gen3FenceResponse<T>>} A promise that resolves to the parsed data and response status
|
|
98
108
|
* or rejects with an error if the request fails.
|
|
99
109
|
* @throws {Error} Throws an error if the fetch request fails or the response is not successful.
|
|
100
|
-
*/ const fetchFence = async ({ endpoint, headers, body =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
url = `${GEN3_FENCE_SERVICE}/${endpoint}`;
|
|
104
|
-
}
|
|
110
|
+
*/ const fetchFence = async ({ endpoint, headers, body = undefined, method = 'GET', isJSON = true }, useService = false)=>{
|
|
111
|
+
const base = useService ? GEN3_FENCE_SERVICE : GEN3_FENCE_API;
|
|
112
|
+
const url = `${base.replace(/\/$/, '')}/${endpoint.replace(/^\//, '')}`;
|
|
105
113
|
const res = await fetch(url, {
|
|
106
|
-
method
|
|
114
|
+
method,
|
|
107
115
|
credentials: 'include',
|
|
108
116
|
headers: {
|
|
109
117
|
// Ensure Content-Type is set for JSON POSTs, but allow overrides via 'headers'
|
|
@@ -112,12 +120,16 @@ const isFetchError = (obj)=>{
|
|
|
112
120
|
} : {},
|
|
113
121
|
...headers
|
|
114
122
|
},
|
|
115
|
-
|
|
123
|
+
...method === 'POST' && body ? {
|
|
124
|
+
body: JSON.stringify(body)
|
|
125
|
+
} : {}
|
|
116
126
|
});
|
|
117
|
-
if (res.ok)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
127
|
+
if (res.ok) {
|
|
128
|
+
return {
|
|
129
|
+
data: isJSON ? await res.json() : await res.text(),
|
|
130
|
+
status: res.status
|
|
131
|
+
};
|
|
132
|
+
}
|
|
121
133
|
throw await buildFetchError(res, {
|
|
122
134
|
endpoint,
|
|
123
135
|
method,
|
|
@@ -243,6 +255,13 @@ const selectHeadersWithCSRFToken = createSelector([
|
|
|
243
255
|
}
|
|
244
256
|
}));
|
|
245
257
|
|
|
258
|
+
// function readCookie(name: string): string | undefined {
|
|
259
|
+
// const raw = document.cookie
|
|
260
|
+
// .split('; ')
|
|
261
|
+
// .find((c) => c.startsWith(`${name}=`))
|
|
262
|
+
// ?.split('=')[1];
|
|
263
|
+
// return raw ? decodeURIComponent(raw) : undefined;
|
|
264
|
+
// }
|
|
246
265
|
/**
|
|
247
266
|
* Creates a base class core API for building other API endpoints on top of.
|
|
248
267
|
* @param reducerPath - The root key name that the other slices will be derived from
|
|
@@ -259,8 +278,8 @@ const selectHeadersWithCSRFToken = createSelector([
|
|
|
259
278
|
if (process.env.NODE_ENV === 'development') {
|
|
260
279
|
// NOTE: This cookie can only be accessed from the client side
|
|
261
280
|
// in development mode. Otherwise, the cookie is set as httpOnly
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
281
|
+
const credentialsToken = getCookie('credentials_token');
|
|
282
|
+
if (credentialsToken) headers.set('Authorization', `Bearer ${credentialsToken}`);
|
|
264
283
|
}
|
|
265
284
|
if (csrfToken) headers.set('X-CSRF-Token', csrfToken);
|
|
266
285
|
return headers;
|
|
@@ -315,7 +334,7 @@ const useCoreDispatch = useDispatch.withTypes();
|
|
|
315
334
|
});
|
|
316
335
|
const isAuthenticated = (loginStatus)=>loginStatus === 'authenticated';
|
|
317
336
|
const isPending = (loginStatus)=>loginStatus === 'pending';
|
|
318
|
-
const initialState$
|
|
337
|
+
const initialState$d = {
|
|
319
338
|
status: 'uninitialized',
|
|
320
339
|
loginStatus: 'unauthenticated',
|
|
321
340
|
error: undefined
|
|
@@ -324,11 +343,11 @@ const initialState$a = {
|
|
|
324
343
|
* Wraps a slice on top of fetchUserState async thunk to keep track of
|
|
325
344
|
* query state. authenticated/not-authenticated vs. ejected/fulfilled/pending
|
|
326
345
|
* @returns: status messages wrapped around fetchUserState response dict
|
|
327
|
-
*/ const slice$
|
|
346
|
+
*/ const slice$6 = createSlice({
|
|
328
347
|
name: 'fence/user',
|
|
329
|
-
initialState: initialState$
|
|
348
|
+
initialState: initialState$d,
|
|
330
349
|
reducers: {
|
|
331
|
-
resetUserState: ()=>initialState$
|
|
350
|
+
resetUserState: ()=>initialState$d
|
|
332
351
|
},
|
|
333
352
|
extraReducers: (builder)=>{
|
|
334
353
|
builder.addCase(fetchUserState.fulfilled, (_, action)=>{
|
|
@@ -359,8 +378,8 @@ const initialState$a = {
|
|
|
359
378
|
});
|
|
360
379
|
}
|
|
361
380
|
});
|
|
362
|
-
const userReducer = slice$
|
|
363
|
-
const { resetUserState } = slice$
|
|
381
|
+
const userReducer = slice$6.reducer;
|
|
382
|
+
const { resetUserState } = slice$6.actions;
|
|
364
383
|
const selectUserData = (state)=>{
|
|
365
384
|
return state.user;
|
|
366
385
|
};
|
|
@@ -411,12 +430,12 @@ const printRegistry = ()=>{
|
|
|
411
430
|
console.log(REGISTRY);
|
|
412
431
|
};
|
|
413
432
|
|
|
414
|
-
const initialState$
|
|
433
|
+
const initialState$c = {
|
|
415
434
|
gen3Apps: {}
|
|
416
435
|
};
|
|
417
|
-
const slice$
|
|
436
|
+
const slice$5 = createSlice({
|
|
418
437
|
name: 'gen3Apps',
|
|
419
|
-
initialState: initialState$
|
|
438
|
+
initialState: initialState$c,
|
|
420
439
|
reducers: {
|
|
421
440
|
addGen3AppMetadata: (state, action)=>{
|
|
422
441
|
const { name, requiredEntityTypes } = action.payload;
|
|
@@ -430,24 +449,24 @@ const slice$3 = createSlice({
|
|
|
430
449
|
}
|
|
431
450
|
}
|
|
432
451
|
});
|
|
433
|
-
const gen3AppReducer = slice$
|
|
434
|
-
const { addGen3AppMetadata } = slice$
|
|
452
|
+
const gen3AppReducer = slice$5.reducer;
|
|
453
|
+
const { addGen3AppMetadata } = slice$5.actions;
|
|
435
454
|
const selectGen3AppMetadataByName = (state, appName)=>state.gen3Apps.gen3Apps[appName];
|
|
436
455
|
const selectGen3AppByName = (appName)=>lookupGen3App(appName); // TODO: memoize this selector
|
|
437
456
|
|
|
438
|
-
const initialState$
|
|
457
|
+
const initialState$b = {};
|
|
439
458
|
// TODO: document what this does
|
|
440
|
-
const slice$
|
|
459
|
+
const slice$4 = createSlice({
|
|
441
460
|
name: 'drsResolver',
|
|
442
|
-
initialState: initialState$
|
|
461
|
+
initialState: initialState$b,
|
|
443
462
|
reducers: {
|
|
444
463
|
setDRSHostnames: (_state, action)=>{
|
|
445
464
|
return action.payload;
|
|
446
465
|
}
|
|
447
466
|
}
|
|
448
467
|
});
|
|
449
|
-
const drsHostnamesReducer = slice$
|
|
450
|
-
const { setDRSHostnames } = slice$
|
|
468
|
+
const drsHostnamesReducer = slice$4.reducer;
|
|
469
|
+
const { setDRSHostnames } = slice$4.actions;
|
|
451
470
|
const drsHostnamesSelector = (id, state)=>state.drsHostnames?.[id];
|
|
452
471
|
|
|
453
472
|
/**
|
|
@@ -462,13 +481,13 @@ const drsHostnamesSelector = (id, state)=>state.drsHostnames?.[id];
|
|
|
462
481
|
Modals["GeneralErrorModal"] = "GeneralErrorModal";
|
|
463
482
|
return Modals;
|
|
464
483
|
}({});
|
|
465
|
-
const initialState$
|
|
484
|
+
const initialState$a = {
|
|
466
485
|
currentModal: null
|
|
467
486
|
};
|
|
468
487
|
//Creates a modal slice for tracking showModal and hideModal state.
|
|
469
|
-
const slice$
|
|
488
|
+
const slice$3 = createSlice({
|
|
470
489
|
name: 'modals',
|
|
471
|
-
initialState: initialState$
|
|
490
|
+
initialState: initialState$a,
|
|
472
491
|
reducers: {
|
|
473
492
|
showModal: (state, action)=>{
|
|
474
493
|
state.currentModal = action.payload.modal;
|
|
@@ -481,8 +500,8 @@ const slice$1 = createSlice({
|
|
|
481
500
|
}
|
|
482
501
|
}
|
|
483
502
|
});
|
|
484
|
-
const modalReducer = slice$
|
|
485
|
-
const { showModal, hideModal } = slice$
|
|
503
|
+
const modalReducer = slice$3.reducer;
|
|
504
|
+
const { showModal, hideModal } = slice$3.actions;
|
|
486
505
|
const selectCurrentModal = (state)=>state.modals.currentModal;
|
|
487
506
|
const selectCurrentMessage = (state)=>state.modals.message;
|
|
488
507
|
|
|
@@ -496,6 +515,8 @@ const selectCurrentMessage = (state)=>state.modals.message;
|
|
|
496
515
|
WorkspaceStatus["NotFound"] = "Not Found";
|
|
497
516
|
WorkspaceStatus["Errored"] = "Errored";
|
|
498
517
|
WorkspaceStatus["StatusError"] = "Status Error";
|
|
518
|
+
WorkspaceStatus["LaunchError"] = "Launching Error";
|
|
519
|
+
WorkspaceStatus["TerminateError"] = "Terminating Error";
|
|
499
520
|
return WorkspaceStatus;
|
|
500
521
|
}({});
|
|
501
522
|
/**
|
|
@@ -539,17 +560,36 @@ const isTimeGreaterThan = (startTime, minutes)=>{
|
|
|
539
560
|
const getTimestamp = ()=>{
|
|
540
561
|
return new Date(Date.now()).toLocaleString();
|
|
541
562
|
};
|
|
563
|
+
/**
|
|
564
|
+
* Formats a given number of minutes into a human-readable uptime string.
|
|
565
|
+
*
|
|
566
|
+
* @param {number | null | undefined} minutes - The total number of minutes to format.
|
|
567
|
+
* - If `null` or `undefined`, a placeholder string ('—') is returned.
|
|
568
|
+
* - If less than 60, the output is formatted as `{m}m` (e.g., "45m").
|
|
569
|
+
* - If greater than or equal to 60, the output is formatted as:
|
|
570
|
+
* - `{h}h` when there are no remaining minutes (e.g., "2h").
|
|
571
|
+
* - `{h}h {m}m` when there are remaining minutes (e.g., "2h 30m").
|
|
572
|
+
*
|
|
573
|
+
* @returns {string} A formatted string representing the uptime in hours and minutes
|
|
574
|
+
* or a placeholder if the input is null or undefined.
|
|
575
|
+
*/ const formatUptimeInMinutes = (minutes)=>{
|
|
576
|
+
if (minutes == null) return '—';
|
|
577
|
+
const h = Math.floor(minutes / 60);
|
|
578
|
+
const m = minutes % 60;
|
|
579
|
+
if (h === 0) return `${m}m`;
|
|
580
|
+
return m > 0 ? `${h}h ${m}m` : `${h}h`;
|
|
581
|
+
};
|
|
542
582
|
|
|
543
|
-
const NO_WORKSPACE_ID = 'none';
|
|
544
|
-
const initialState$
|
|
545
|
-
id: NO_WORKSPACE_ID,
|
|
583
|
+
const NO_WORKSPACE_ID$2 = 'none';
|
|
584
|
+
const initialState$9 = {
|
|
585
|
+
id: NO_WORKSPACE_ID$2,
|
|
546
586
|
status: WorkspaceStatus.NotFound,
|
|
547
587
|
requestedStatus: RequestedWorkspaceStatus.Unset,
|
|
548
588
|
requestedStatusTimestamp: getCurrentTimestamp()
|
|
549
589
|
};
|
|
550
|
-
const slice = createSlice({
|
|
551
|
-
name: '
|
|
552
|
-
initialState: initialState$
|
|
590
|
+
const slice$2 = createSlice({
|
|
591
|
+
name: 'activeWorkspace',
|
|
592
|
+
initialState: initialState$9,
|
|
553
593
|
reducers: {
|
|
554
594
|
setActiveWorkspaceId: (state, action)=>{
|
|
555
595
|
state = {
|
|
@@ -561,7 +601,8 @@ const slice = createSlice({
|
|
|
561
601
|
clearActiveWorkspaceId: (state)=>{
|
|
562
602
|
return {
|
|
563
603
|
...state,
|
|
564
|
-
id: NO_WORKSPACE_ID
|
|
604
|
+
id: NO_WORKSPACE_ID$2,
|
|
605
|
+
status: WorkspaceStatus.NotFound
|
|
565
606
|
};
|
|
566
607
|
},
|
|
567
608
|
setActiveWorkspaceStatus: (state, action)=>{
|
|
@@ -584,8 +625,8 @@ const slice = createSlice({
|
|
|
584
625
|
}
|
|
585
626
|
}
|
|
586
627
|
});
|
|
587
|
-
const activeWorkspaceReducer = slice.reducer;
|
|
588
|
-
const { setActiveWorkspaceId, clearActiveWorkspaceId, setActiveWorkspaceStatus, setRequestedWorkspaceStatus, setActiveWorkspace } = slice.actions;
|
|
628
|
+
const activeWorkspaceReducer = slice$2.reducer;
|
|
629
|
+
const { setActiveWorkspaceId, clearActiveWorkspaceId, setActiveWorkspaceStatus, setRequestedWorkspaceStatus, setActiveWorkspace } = slice$2.actions;
|
|
589
630
|
const selectActiveWorkspaceId = (state)=>state.activeWorkspace.id;
|
|
590
631
|
const selectActiveWorkspaceStatus = (state)=>state.activeWorkspace.status;
|
|
591
632
|
const selectRequestedWorkspaceStatus = (state)=>state.activeWorkspace.requestedStatus;
|
|
@@ -594,10 +635,10 @@ const selectRequestedWorkspaceStatusTimestamp = (state)=>state.activeWorkspace.r
|
|
|
594
635
|
const cartAdapter = createEntityAdapter({
|
|
595
636
|
selectId: (item)=>item.id
|
|
596
637
|
});
|
|
597
|
-
const initialState$
|
|
638
|
+
const initialState$8 = cartAdapter.getInitialState({});
|
|
598
639
|
const cartSlice = createSlice({
|
|
599
640
|
name: 'cart',
|
|
600
|
-
initialState: initialState$
|
|
641
|
+
initialState: initialState$8,
|
|
601
642
|
reducers: {
|
|
602
643
|
addItemsToCart: cartAdapter.addMany,
|
|
603
644
|
removeItemsFromCart: cartAdapter.removeMany
|
|
@@ -1020,6 +1061,175 @@ const humanify = ({ term = '', capitalize: cap = true, facetTerm = false })=>{
|
|
|
1020
1061
|
* @category Utility
|
|
1021
1062
|
*/ const stringifyJSONParam = (obj, defaults = '{}')=>obj ? JSON.stringify(obj) : defaults;
|
|
1022
1063
|
|
|
1064
|
+
// type guard functions
|
|
1065
|
+
const isHistogramRangeData = (key)=>{
|
|
1066
|
+
return Array.isArray(key) && key.length === 2 && key.every((item)=>typeof item === 'number');
|
|
1067
|
+
};
|
|
1068
|
+
const isJSONObject = (data)=>{
|
|
1069
|
+
return typeof data === 'object' && data !== null && !Array.isArray(data);
|
|
1070
|
+
};
|
|
1071
|
+
const isJSONValue = (data)=>{
|
|
1072
|
+
return typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean' || Array.isArray(data) && data.every(isJSONValue) || isJSONObject(data);
|
|
1073
|
+
};
|
|
1074
|
+
const isJSONValueArray = (data)=>{
|
|
1075
|
+
return Array.isArray(data) && data.every(isJSONValue);
|
|
1076
|
+
};
|
|
1077
|
+
const isValidObject = (input)=>typeof input === 'object' && input !== null;
|
|
1078
|
+
const isHistogramData = (data)=>{
|
|
1079
|
+
return isValidObject(data) && 'key' in data && 'count' in data;
|
|
1080
|
+
};
|
|
1081
|
+
const isHistogramDataArray = (input)=>{
|
|
1082
|
+
if (!isValidObject(input) || !Array.isArray(input.histogram)) {
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
1085
|
+
return input.histogram.every(isHistogramData);
|
|
1086
|
+
};
|
|
1087
|
+
const isHistogramDataCollection = (obj)=>{
|
|
1088
|
+
return isValidObject(obj) && 'histogram' in obj && isHistogramData(obj.histogram);
|
|
1089
|
+
};
|
|
1090
|
+
// Type guard function for GuppyAggregationData interface
|
|
1091
|
+
const isGuppyAggregationData = (obj)=>{
|
|
1092
|
+
if (!isValidObject(obj)) return false;
|
|
1093
|
+
for(const key in obj){
|
|
1094
|
+
if (!isHistogramDataCollection(obj[key])) {
|
|
1095
|
+
return false;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return true;
|
|
1099
|
+
};
|
|
1100
|
+
const isHistogramDataAnEnum = (data)=>{
|
|
1101
|
+
return typeof data === 'object' && data !== null && 'key' in data && 'count' in data && typeof data.key === 'string' && typeof data.count === 'number';
|
|
1102
|
+
};
|
|
1103
|
+
const isStatsValue = (item)=>{
|
|
1104
|
+
if (typeof item !== 'object' || item === null) {
|
|
1105
|
+
return false;
|
|
1106
|
+
}
|
|
1107
|
+
const obj = item;
|
|
1108
|
+
// Check that all present properties have correct types
|
|
1109
|
+
const numericFields = [
|
|
1110
|
+
'count',
|
|
1111
|
+
'min',
|
|
1112
|
+
'max',
|
|
1113
|
+
'avg',
|
|
1114
|
+
'sum',
|
|
1115
|
+
'stddev',
|
|
1116
|
+
'median'
|
|
1117
|
+
];
|
|
1118
|
+
if (!numericFields.some((field)=>field in obj && typeof obj[field] !== 'number')) {
|
|
1119
|
+
return false;
|
|
1120
|
+
}
|
|
1121
|
+
// Check percentiles structure if present
|
|
1122
|
+
if ('percentiles' in obj) {
|
|
1123
|
+
const percentiles = obj.percentiles;
|
|
1124
|
+
if (typeof percentiles !== 'object' || percentiles === null) {
|
|
1125
|
+
return false;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
return true;
|
|
1129
|
+
};
|
|
1130
|
+
const isStatsValuesArray = (data)=>{
|
|
1131
|
+
return Array.isArray(data) && data.every(isStatsValue);
|
|
1132
|
+
};
|
|
1133
|
+
const isHistogramDataAArray = (data)=>{
|
|
1134
|
+
return Array.isArray(data) && data.every(isHistogramData);
|
|
1135
|
+
};
|
|
1136
|
+
const isHistogramDataArrayAnEnum = (data)=>{
|
|
1137
|
+
return Array.isArray(data) && data.every(isHistogramDataAnEnum);
|
|
1138
|
+
};
|
|
1139
|
+
const isHistogramDataArrayARange = (data)=>{
|
|
1140
|
+
return Array.isArray(data) && data.every((item)=>isHistogramRangeData(item.key));
|
|
1141
|
+
};
|
|
1142
|
+
/**
|
|
1143
|
+
* Type predicate to narrow an unknown error to `FetchBaseQueryError`
|
|
1144
|
+
*/ function isFetchBaseQueryError(error) {
|
|
1145
|
+
return typeof error === 'object' && error != null && 'status' in error;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Type predicate to narrow an unknown error to an object with a string 'message' property
|
|
1149
|
+
*/ function isErrorWithMessage(error) {
|
|
1150
|
+
return typeof error === 'object' && error != null && 'message' in error && typeof error.message === 'string';
|
|
1151
|
+
}
|
|
1152
|
+
function isHttpStatusError(error) {
|
|
1153
|
+
return typeof error === 'object' && error != null && 'status' in error && typeof error.status === 'number';
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Type predicate to narrow an unknown error to an object with a string 'message' property
|
|
1157
|
+
*/ function isFetchParseError(error) {
|
|
1158
|
+
return typeof error === 'object' && error != null && 'originalStatus' in error && 'status' in error && error['status'] === 'PARSING_ERROR';
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/** Best-effort message extraction from an HTTP error body */ function extractMessage(data) {
|
|
1162
|
+
if (typeof data === 'string') return data;
|
|
1163
|
+
if (typeof data === 'object' && data != null) {
|
|
1164
|
+
const obj = data;
|
|
1165
|
+
// common API error shapes: { message }, { error }, { detail } (FastAPI)
|
|
1166
|
+
for (const key of [
|
|
1167
|
+
'message',
|
|
1168
|
+
'error',
|
|
1169
|
+
'detail'
|
|
1170
|
+
]){
|
|
1171
|
+
const val = obj[key];
|
|
1172
|
+
if (typeof val === 'string') return val;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
return undefined;
|
|
1176
|
+
}
|
|
1177
|
+
function normalizeRtkError(error) {
|
|
1178
|
+
if (!error) {
|
|
1179
|
+
return {
|
|
1180
|
+
type: 'UNKNOWN_ERROR',
|
|
1181
|
+
message: 'Unknown error'
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
if (isFetchBaseQueryError(error)) {
|
|
1185
|
+
// status is number for HTTP errors, string literal for the others
|
|
1186
|
+
if (typeof error.status === 'number') {
|
|
1187
|
+
return {
|
|
1188
|
+
type: 'HTTP_ERROR',
|
|
1189
|
+
status: error.status,
|
|
1190
|
+
message: extractMessage(error.data) ?? `Request failed with status ${error.status}`,
|
|
1191
|
+
data: error.data
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
switch(error.status){
|
|
1195
|
+
case 'FETCH_ERROR':
|
|
1196
|
+
return {
|
|
1197
|
+
type: 'FETCH_ERROR',
|
|
1198
|
+
message: error.error
|
|
1199
|
+
};
|
|
1200
|
+
case 'PARSING_ERROR':
|
|
1201
|
+
return {
|
|
1202
|
+
type: 'PARSING_ERROR',
|
|
1203
|
+
status: error.originalStatus,
|
|
1204
|
+
message: error.error,
|
|
1205
|
+
data: error.data
|
|
1206
|
+
};
|
|
1207
|
+
case 'TIMEOUT_ERROR':
|
|
1208
|
+
return {
|
|
1209
|
+
type: 'TIMEOUT_ERROR',
|
|
1210
|
+
message: error.error
|
|
1211
|
+
};
|
|
1212
|
+
case 'CUSTOM_ERROR':
|
|
1213
|
+
return {
|
|
1214
|
+
type: 'CUSTOM_ERROR',
|
|
1215
|
+
message: error.error,
|
|
1216
|
+
data: error.data
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
// SerializedError — a JS error thrown somewhere in the pipeline
|
|
1221
|
+
if ('message' in error || 'name' in error) {
|
|
1222
|
+
return {
|
|
1223
|
+
type: 'SERIALIZED_ERROR',
|
|
1224
|
+
message: error.message ?? 'An error occurred'
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
return {
|
|
1228
|
+
type: 'UNKNOWN_ERROR',
|
|
1229
|
+
message: 'Unknown error'
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1023
1233
|
const queryWTSFederatedLoginStatus = async (signal)=>{
|
|
1024
1234
|
try {
|
|
1025
1235
|
const results = await fetchJSONDataFromURL(`${GEN3_WTS_API}/external_oidc/`, false, HttpMethod.GET, undefined, signal);
|
|
@@ -2209,13 +2419,13 @@ const emptyInitialState = cohortsAdapter.getInitialState({
|
|
|
2209
2419
|
message: undefined
|
|
2210
2420
|
});
|
|
2211
2421
|
// Set the initial cohort in the adapter state
|
|
2212
|
-
const initialState$
|
|
2422
|
+
const initialState$7 = cohortsAdapter.setOne(emptyInitialState, initialCohort);
|
|
2213
2423
|
const getCurrentCohortId = (state)=>state.currentCohortId;
|
|
2214
2424
|
/**
|
|
2215
2425
|
* Redux slice for cohort filters
|
|
2216
2426
|
*/ const cohortManagerSlice = createSlice({
|
|
2217
2427
|
name: 'cohort',
|
|
2218
|
-
initialState: initialState$
|
|
2428
|
+
initialState: initialState$7,
|
|
2219
2429
|
reducers: {
|
|
2220
2430
|
createNewCohort: (state, action)=>{
|
|
2221
2431
|
const baseName = action.payload.name || `Cohort`;
|
|
@@ -2456,10 +2666,10 @@ const getCurrentCohortId = (state)=>state.currentCohortId;
|
|
|
2456
2666
|
const { createNewCohort, updateCohortFilter, setCohortFilter, setCohortIndexFilters, duplicateCohort, removeCohortFilter, clearCohortFilters, removeCohort, setCurrentCohortId, updateCohortName, updateCohortCounts, updateCohortIndexCountById, setCohortList } = cohortManagerSlice.actions;
|
|
2457
2667
|
const cohortReducer = cohortManagerSlice.reducer;
|
|
2458
2668
|
|
|
2459
|
-
const initialState$
|
|
2669
|
+
const initialState$6 = {};
|
|
2460
2670
|
const expandSlice$1 = createSlice({
|
|
2461
2671
|
name: 'CohortBuilder/filterExpand',
|
|
2462
|
-
initialState: initialState$
|
|
2672
|
+
initialState: initialState$6,
|
|
2463
2673
|
reducers: {
|
|
2464
2674
|
toggleCohortBuilderCategoryFilter: (state, action)=>{
|
|
2465
2675
|
return {
|
|
@@ -2486,10 +2696,10 @@ const { toggleCohortBuilderCategoryFilter, toggleCohortBuilderAllFilters } = exp
|
|
|
2486
2696
|
const selectCohortFilterExpanded = (state, index, field)=>state.cohorts.filtersExpanded?.[index]?.[field];
|
|
2487
2697
|
const selectAllCohortFiltersCollapsed = (state, index)=>index in state.cohorts.filtersExpanded ? Object.values(state.cohorts.filtersExpanded?.[index]).every((e)=>!e) : false;
|
|
2488
2698
|
|
|
2489
|
-
const initialState$
|
|
2699
|
+
const initialState$5 = {};
|
|
2490
2700
|
const expandSlice = createSlice({
|
|
2491
2701
|
name: 'CohortBuilder/filterCombineMode',
|
|
2492
|
-
initialState: initialState$
|
|
2702
|
+
initialState: initialState$5,
|
|
2493
2703
|
reducers: {
|
|
2494
2704
|
setCohortFilterCombineMode: (state, action)=>{
|
|
2495
2705
|
return {
|
|
@@ -2506,13 +2716,13 @@ const cohortBuilderFiltersCombineModeReducer = expandSlice.reducer;
|
|
|
2506
2716
|
const { setCohortFilterCombineMode } = expandSlice.actions;
|
|
2507
2717
|
const selectCohortFilterCombineMode = (state, index, field)=>state.cohorts.filtersCombineMode?.[index]?.[field] ?? 'or';
|
|
2508
2718
|
|
|
2509
|
-
const initialState$
|
|
2719
|
+
const initialState$4 = {
|
|
2510
2720
|
shouldShareFilters: false,
|
|
2511
2721
|
sharedFiltersMap: {}
|
|
2512
2722
|
};
|
|
2513
2723
|
const cohortSharedFiltersSlice = createSlice({
|
|
2514
2724
|
name: 'cohortSharedFilters',
|
|
2515
|
-
initialState: initialState$
|
|
2725
|
+
initialState: initialState$4,
|
|
2516
2726
|
reducers: {
|
|
2517
2727
|
setShouldShareFilters: (state, action)=>{
|
|
2518
2728
|
state.shouldShareFilters = action.payload;
|
|
@@ -2555,12 +2765,12 @@ const createNoopStorage = ()=>{
|
|
|
2555
2765
|
const storage = typeof window !== 'undefined' ? createWebStorage('local') : createNoopStorage();
|
|
2556
2766
|
typeof window !== 'undefined' ? createWebStorage('session') : createNoopStorage();
|
|
2557
2767
|
|
|
2558
|
-
const initialState = {
|
|
2768
|
+
const initialState$3 = {
|
|
2559
2769
|
datatimeCache: {}
|
|
2560
2770
|
};
|
|
2561
2771
|
const sowerJobDatetimeSlice = createSlice({
|
|
2562
2772
|
name: 'sowerJobDatetime',
|
|
2563
|
-
initialState,
|
|
2773
|
+
initialState: initialState$3,
|
|
2564
2774
|
reducers: {
|
|
2565
2775
|
setSowerJobDatetime: (state, action)=>{
|
|
2566
2776
|
return {
|
|
@@ -2640,6 +2850,143 @@ const sowerReducer = combineReducers({
|
|
|
2640
2850
|
sowerJobDatetime: persistReducer(sowerJobDatetimePersistConfig, sowerJobDatetimeReducer)
|
|
2641
2851
|
});
|
|
2642
2852
|
|
|
2853
|
+
const workspaceKernelsAdapter = createEntityAdapter({
|
|
2854
|
+
selectId: (kernel)=>kernel.id
|
|
2855
|
+
});
|
|
2856
|
+
const initialState$2 = workspaceKernelsAdapter.getInitialState([]);
|
|
2857
|
+
/**
|
|
2858
|
+
* Handles the state of the active kernels in the workspace.
|
|
2859
|
+
*/ const workspaceKernelsSlice = createSlice({
|
|
2860
|
+
name: 'workspaceKernels',
|
|
2861
|
+
initialState: initialState$2,
|
|
2862
|
+
reducers: {
|
|
2863
|
+
addJEGActiveKernel: (state, action)=>{
|
|
2864
|
+
workspaceKernelsAdapter.upsertOne(state, {
|
|
2865
|
+
...action.payload,
|
|
2866
|
+
lastUpdate: Date.now()
|
|
2867
|
+
});
|
|
2868
|
+
},
|
|
2869
|
+
upsertManyJEGActiveKernels: (state, action)=>{
|
|
2870
|
+
const now = Date.now();
|
|
2871
|
+
for (const kernel of action.payload){
|
|
2872
|
+
workspaceKernelsAdapter.upsertOne(state, {
|
|
2873
|
+
...kernel,
|
|
2874
|
+
lastUpdate: now
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
},
|
|
2878
|
+
removeJEGActiveKernel: workspaceKernelsAdapter.removeOne,
|
|
2879
|
+
removeManyJEGActiveKernels: workspaceKernelsAdapter.removeMany,
|
|
2880
|
+
clearJEGActiveKernels: workspaceKernelsAdapter.removeAll,
|
|
2881
|
+
updateJEGActionKernelStatus: (state, action)=>{
|
|
2882
|
+
const { id, status } = action.payload;
|
|
2883
|
+
workspaceKernelsAdapter.updateOne(state, {
|
|
2884
|
+
id: id,
|
|
2885
|
+
changes: {
|
|
2886
|
+
lastUpdate: Date.now(),
|
|
2887
|
+
executionState: status
|
|
2888
|
+
}
|
|
2889
|
+
});
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
});
|
|
2893
|
+
const workspaceKernelReducer = workspaceKernelsSlice.reducer;
|
|
2894
|
+
const { addJEGActiveKernel, upsertManyJEGActiveKernels, removeJEGActiveKernel, removeManyJEGActiveKernels, clearJEGActiveKernels, updateJEGActionKernelStatus } = workspaceKernelsSlice.actions;
|
|
2895
|
+
|
|
2896
|
+
const NO_WORKSPACE_ID$1 = 'none';
|
|
2897
|
+
const initialState$1 = {
|
|
2898
|
+
id: NO_WORKSPACE_ID$1,
|
|
2899
|
+
tier: null,
|
|
2900
|
+
isFullscreen: false
|
|
2901
|
+
};
|
|
2902
|
+
const slice$1 = createSlice({
|
|
2903
|
+
name: 'tieredWorkspace',
|
|
2904
|
+
initialState: initialState$1,
|
|
2905
|
+
reducers: {
|
|
2906
|
+
setTieredWorkspaceId: (state, action)=>{
|
|
2907
|
+
state = {
|
|
2908
|
+
...state,
|
|
2909
|
+
id: action.payload.id
|
|
2910
|
+
};
|
|
2911
|
+
return state;
|
|
2912
|
+
},
|
|
2913
|
+
clearTieredWorkspaceId: (state)=>{
|
|
2914
|
+
return {
|
|
2915
|
+
...state,
|
|
2916
|
+
id: NO_WORKSPACE_ID$1
|
|
2917
|
+
};
|
|
2918
|
+
},
|
|
2919
|
+
setWorkspaceTier: (state, action)=>{
|
|
2920
|
+
return {
|
|
2921
|
+
...state,
|
|
2922
|
+
tier: action.payload
|
|
2923
|
+
};
|
|
2924
|
+
},
|
|
2925
|
+
setWorkspaceFullscreen: (state, action)=>{
|
|
2926
|
+
return {
|
|
2927
|
+
...state,
|
|
2928
|
+
isFullscreen: action.payload
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
});
|
|
2933
|
+
const tieredWorkspaceReducer = slice$1.reducer;
|
|
2934
|
+
const { setTieredWorkspaceId, clearTieredWorkspaceId, setWorkspaceTier, setWorkspaceFullscreen } = slice$1.actions;
|
|
2935
|
+
const selectWorkspaceTier = (state)=>state.tieredWorkspace.tier;
|
|
2936
|
+
const selectWorkspaceFullscreen = (state)=>state.tieredWorkspace.isFullscreen;
|
|
2937
|
+
|
|
2938
|
+
const NO_WORKSPACE_ID = 'none';
|
|
2939
|
+
const initialState = {
|
|
2940
|
+
id: NO_WORKSPACE_ID,
|
|
2941
|
+
status: WorkspaceStatus.NotFound,
|
|
2942
|
+
requestedStatus: RequestedWorkspaceStatus.Unset,
|
|
2943
|
+
requestedStatusTimestamp: getCurrentTimestamp()
|
|
2944
|
+
};
|
|
2945
|
+
const slice = createSlice({
|
|
2946
|
+
name: 'JEGActiveWorkspace',
|
|
2947
|
+
initialState,
|
|
2948
|
+
reducers: {
|
|
2949
|
+
setJEGActiveWorkspaceId: (state, action)=>{
|
|
2950
|
+
state = {
|
|
2951
|
+
...state,
|
|
2952
|
+
id: action.payload.id
|
|
2953
|
+
};
|
|
2954
|
+
return state;
|
|
2955
|
+
},
|
|
2956
|
+
clearJEGActiveWorkspaceId: (state)=>{
|
|
2957
|
+
return {
|
|
2958
|
+
...state,
|
|
2959
|
+
id: NO_WORKSPACE_ID,
|
|
2960
|
+
status: WorkspaceStatus.NotFound
|
|
2961
|
+
};
|
|
2962
|
+
},
|
|
2963
|
+
setJEGActiveWorkspaceStatus: (state, action)=>{
|
|
2964
|
+
return {
|
|
2965
|
+
...state,
|
|
2966
|
+
status: action.payload
|
|
2967
|
+
};
|
|
2968
|
+
},
|
|
2969
|
+
setJEGRequestedWorkspaceStatus: (state, action)=>{
|
|
2970
|
+
return {
|
|
2971
|
+
...state,
|
|
2972
|
+
requestedStatus: action.payload,
|
|
2973
|
+
requestedStatusTimestamp: getCurrentTimestamp()
|
|
2974
|
+
};
|
|
2975
|
+
},
|
|
2976
|
+
setJEGActiveWorkspace: (_state, action)=>{
|
|
2977
|
+
return {
|
|
2978
|
+
...action.payload
|
|
2979
|
+
};
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
});
|
|
2983
|
+
const jegActiveWorkspaceReducer = slice.reducer;
|
|
2984
|
+
const { setJEGActiveWorkspaceId, clearJEGActiveWorkspaceId, setJEGActiveWorkspaceStatus, setJEGRequestedWorkspaceStatus, setJEGActiveWorkspace } = slice.actions;
|
|
2985
|
+
const selectJEGActiveWorkspaceId = (state)=>state.jegActiveWorkspace.id;
|
|
2986
|
+
const selectJEGActiveWorkspaceStatus = (state)=>state.jegActiveWorkspace.status;
|
|
2987
|
+
const selectJEGRequestedWorkspaceStatus = (state)=>state.jegActiveWorkspace.requestedStatus;
|
|
2988
|
+
const selectJEGRequestedWorkspaceStatusTimestamp = (state)=>state.jegActiveWorkspace.requestedStatusTimestamp;
|
|
2989
|
+
|
|
2643
2990
|
const rootReducer = combineReducers({
|
|
2644
2991
|
gen3Services: gen3ServicesReducer,
|
|
2645
2992
|
user: userReducer,
|
|
@@ -2648,6 +2995,9 @@ const rootReducer = combineReducers({
|
|
|
2648
2995
|
modals: modalReducer,
|
|
2649
2996
|
cohorts: cohortReducers,
|
|
2650
2997
|
activeWorkspace: activeWorkspaceReducer,
|
|
2998
|
+
tieredWorkspace: tieredWorkspaceReducer,
|
|
2999
|
+
workspaceKernels: workspaceKernelReducer,
|
|
3000
|
+
jegActiveWorkspace: jegActiveWorkspaceReducer,
|
|
2651
3001
|
[guppyApiSliceReducerPath]: guppyApiReducer,
|
|
2652
3002
|
[userAuthApiReducerPath]: userAuthApiReducer,
|
|
2653
3003
|
[cartReducerPath]: cartReducer,
|
|
@@ -2691,103 +3041,6 @@ const rootReducer = combineReducers({
|
|
|
2691
3041
|
return json;
|
|
2692
3042
|
}
|
|
2693
3043
|
|
|
2694
|
-
// type guard functions
|
|
2695
|
-
const isHistogramRangeData = (key)=>{
|
|
2696
|
-
return Array.isArray(key) && key.length === 2 && key.every((item)=>typeof item === 'number');
|
|
2697
|
-
};
|
|
2698
|
-
const isJSONObject = (data)=>{
|
|
2699
|
-
return typeof data === 'object' && data !== null && !Array.isArray(data);
|
|
2700
|
-
};
|
|
2701
|
-
const isJSONValue = (data)=>{
|
|
2702
|
-
return typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean' || Array.isArray(data) && data.every(isJSONValue) || isJSONObject(data);
|
|
2703
|
-
};
|
|
2704
|
-
const isJSONValueArray = (data)=>{
|
|
2705
|
-
return Array.isArray(data) && data.every(isJSONValue);
|
|
2706
|
-
};
|
|
2707
|
-
const isValidObject = (input)=>typeof input === 'object' && input !== null;
|
|
2708
|
-
const isHistogramData = (data)=>{
|
|
2709
|
-
return isValidObject(data) && 'key' in data && 'count' in data;
|
|
2710
|
-
};
|
|
2711
|
-
const isHistogramDataArray = (input)=>{
|
|
2712
|
-
if (!isValidObject(input) || !Array.isArray(input.histogram)) {
|
|
2713
|
-
return false;
|
|
2714
|
-
}
|
|
2715
|
-
return input.histogram.every(isHistogramData);
|
|
2716
|
-
};
|
|
2717
|
-
const isHistogramDataCollection = (obj)=>{
|
|
2718
|
-
return isValidObject(obj) && 'histogram' in obj && isHistogramData(obj.histogram);
|
|
2719
|
-
};
|
|
2720
|
-
// Type guard function for GuppyAggregationData interface
|
|
2721
|
-
const isGuppyAggregationData = (obj)=>{
|
|
2722
|
-
if (!isValidObject(obj)) return false;
|
|
2723
|
-
for(const key in obj){
|
|
2724
|
-
if (!isHistogramDataCollection(obj[key])) {
|
|
2725
|
-
return false;
|
|
2726
|
-
}
|
|
2727
|
-
}
|
|
2728
|
-
return true;
|
|
2729
|
-
};
|
|
2730
|
-
const isHistogramDataAnEnum = (data)=>{
|
|
2731
|
-
return typeof data === 'object' && data !== null && 'key' in data && 'count' in data && typeof data.key === 'string' && typeof data.count === 'number';
|
|
2732
|
-
};
|
|
2733
|
-
const isStatsValue = (item)=>{
|
|
2734
|
-
if (typeof item !== 'object' || item === null) {
|
|
2735
|
-
return false;
|
|
2736
|
-
}
|
|
2737
|
-
const obj = item;
|
|
2738
|
-
// Check that all present properties have correct types
|
|
2739
|
-
const numericFields = [
|
|
2740
|
-
'count',
|
|
2741
|
-
'min',
|
|
2742
|
-
'max',
|
|
2743
|
-
'avg',
|
|
2744
|
-
'sum',
|
|
2745
|
-
'stddev',
|
|
2746
|
-
'median'
|
|
2747
|
-
];
|
|
2748
|
-
if (!numericFields.some((field)=>field in obj && typeof obj[field] !== 'number')) {
|
|
2749
|
-
return false;
|
|
2750
|
-
}
|
|
2751
|
-
// Check percentiles structure if present
|
|
2752
|
-
if ('percentiles' in obj) {
|
|
2753
|
-
const percentiles = obj.percentiles;
|
|
2754
|
-
if (typeof percentiles !== 'object' || percentiles === null) {
|
|
2755
|
-
return false;
|
|
2756
|
-
}
|
|
2757
|
-
}
|
|
2758
|
-
return true;
|
|
2759
|
-
};
|
|
2760
|
-
const isStatsValuesArray = (data)=>{
|
|
2761
|
-
return Array.isArray(data) && data.every(isStatsValue);
|
|
2762
|
-
};
|
|
2763
|
-
const isHistogramDataAArray = (data)=>{
|
|
2764
|
-
return Array.isArray(data) && data.every(isHistogramData);
|
|
2765
|
-
};
|
|
2766
|
-
const isHistogramDataArrayAnEnum = (data)=>{
|
|
2767
|
-
return Array.isArray(data) && data.every(isHistogramDataAnEnum);
|
|
2768
|
-
};
|
|
2769
|
-
const isHistogramDataArrayARange = (data)=>{
|
|
2770
|
-
return Array.isArray(data) && data.every((item)=>isHistogramRangeData(item.key));
|
|
2771
|
-
};
|
|
2772
|
-
/**
|
|
2773
|
-
* Type predicate to narrow an unknown error to `FetchBaseQueryError`
|
|
2774
|
-
*/ function isFetchBaseQueryError(error) {
|
|
2775
|
-
return typeof error === 'object' && error != null && 'status' in error;
|
|
2776
|
-
}
|
|
2777
|
-
/**
|
|
2778
|
-
* Type predicate to narrow an unknown error to an object with a string 'message' property
|
|
2779
|
-
*/ function isErrorWithMessage(error) {
|
|
2780
|
-
return typeof error === 'object' && error != null && 'message' in error && typeof error.message === 'string';
|
|
2781
|
-
}
|
|
2782
|
-
function isHttpStatusError(error) {
|
|
2783
|
-
return typeof error === 'object' && error != null && 'status' in error && typeof error.status === 'number';
|
|
2784
|
-
}
|
|
2785
|
-
/**
|
|
2786
|
-
* Type predicate to narrow an unknown error to an object with a string 'message' property
|
|
2787
|
-
*/ function isFetchParseError(error) {
|
|
2788
|
-
return typeof error === 'object' && error != null && 'originalStatus' in error && 'status' in error && error['status'] === 'PARSING_ERROR';
|
|
2789
|
-
}
|
|
2790
|
-
|
|
2791
3044
|
/**
|
|
2792
3045
|
* Prepares a URL for downloading by appending '/download' to the provided apiUrl.
|
|
2793
3046
|
*
|
|
@@ -3661,7 +3914,9 @@ const persistConfig = {
|
|
|
3661
3914
|
whitelist: [
|
|
3662
3915
|
'cohorts',
|
|
3663
3916
|
'activeWorkspace',
|
|
3664
|
-
'cart'
|
|
3917
|
+
'cart',
|
|
3918
|
+
'workspaceKernels',
|
|
3919
|
+
'tieredWorkspace'
|
|
3665
3920
|
]
|
|
3666
3921
|
};
|
|
3667
3922
|
const persistedReducer = persistReducer(persistConfig, rootReducer);
|
|
@@ -5404,7 +5659,7 @@ const credentialsWithTags = gen3Api.enhanceEndpoints({
|
|
|
5404
5659
|
})
|
|
5405
5660
|
})
|
|
5406
5661
|
});
|
|
5407
|
-
const { useGetJWKKeysQuery } = jwtApi;
|
|
5662
|
+
const { useGetJWKKeysQuery, useLazyGetJWKKeysQuery } = jwtApi;
|
|
5408
5663
|
|
|
5409
5664
|
// using a random uuid v4 as the namespace
|
|
5410
5665
|
const GEN3_APP_NAMESPACE = '7bfaa818-c69c-457e-8d87-413cf60c25f0';
|
|
@@ -6294,10 +6549,23 @@ const SubmissionGraphqlQuery = `query transactionList {
|
|
|
6294
6549
|
query: ()=>({
|
|
6295
6550
|
url: `${GEN3_SUBMISSION_API}/_dictionary/_all/`
|
|
6296
6551
|
})
|
|
6552
|
+
}),
|
|
6553
|
+
getDictionaryFromUrl: builder.query({
|
|
6554
|
+
query: (url)=>{
|
|
6555
|
+
if (URL.canParse(url)) {
|
|
6556
|
+
return {
|
|
6557
|
+
url: url
|
|
6558
|
+
};
|
|
6559
|
+
} else {
|
|
6560
|
+
return {
|
|
6561
|
+
url: `${GEN3_SUBMISSION_API}/${url}`
|
|
6562
|
+
};
|
|
6563
|
+
}
|
|
6564
|
+
}
|
|
6297
6565
|
})
|
|
6298
6566
|
})
|
|
6299
6567
|
});
|
|
6300
|
-
const { useGetProjectsQuery, useGetSubmissionGraphQLQuery, useGetProjectsDetailsQuery, useLazyGetProjectsQuery, useLazyGetSubmissionGraphQLQuery, useGetSubmissionsQuery, useGetDictionaryQuery } = submissionApi;
|
|
6568
|
+
const { useGetProjectsQuery, useGetSubmissionGraphQLQuery, useGetProjectsDetailsQuery, useLazyGetProjectsQuery, useLazyGetSubmissionGraphQLQuery, useGetSubmissionsQuery, useGetDictionaryQuery, useGetDictionaryFromUrlQuery } = submissionApi;
|
|
6301
6569
|
|
|
6302
6570
|
const WorkspaceWithTags = gen3Api.enhanceEndpoints({
|
|
6303
6571
|
addTagTypes: [
|
|
@@ -6435,6 +6703,8 @@ const selectWorkspaceStatus = createSelector(workspaceStatusSelector, (status)=>
|
|
|
6435
6703
|
const paymodelStatusSelector = workspacesApi.endpoints.getWorkspacePayModels.select();
|
|
6436
6704
|
const selectPaymodelStatus = createSelector(paymodelStatusSelector, (status)=>status);
|
|
6437
6705
|
|
|
6706
|
+
const { selectAll: selectAllJEGKernels, selectById: selectJEGKernelById, selectIds: selectJEGKernelIds } = workspaceKernelsAdapter.getSelectors((state)=>state.workspaceKernels);
|
|
6707
|
+
|
|
6438
6708
|
const isWorkspaceActive = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Launching || status === WorkspaceStatus.Terminating;
|
|
6439
6709
|
const isWorkspaceRunningOrStopping = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Terminating;
|
|
6440
6710
|
|
|
@@ -6584,5 +6854,49 @@ const indexdApi = gen3Api.injectEndpoints({
|
|
|
6584
6854
|
});
|
|
6585
6855
|
const { useGetIndexdMetdataQuery, useLazyGetIndexdMetdataQuery, useGetIndexObjectQuery, useLazyGetIndexObjectQuery } = indexdApi;
|
|
6586
6856
|
|
|
6587
|
-
|
|
6857
|
+
/**
|
|
6858
|
+
* Types for the notification service
|
|
6859
|
+
*/ /**
|
|
6860
|
+
* Notification service singleton
|
|
6861
|
+
*/ class NotificationService {
|
|
6862
|
+
constructor(){
|
|
6863
|
+
this.handler = null;
|
|
6864
|
+
}
|
|
6865
|
+
/**
|
|
6866
|
+
* Get the singleton instance
|
|
6867
|
+
*/ static getInstance() {
|
|
6868
|
+
if (!NotificationService.instance) {
|
|
6869
|
+
NotificationService.instance = new NotificationService();
|
|
6870
|
+
}
|
|
6871
|
+
return NotificationService.instance;
|
|
6872
|
+
}
|
|
6873
|
+
/**
|
|
6874
|
+
* Register a notification handler
|
|
6875
|
+
*/ registerHandler(handler) {
|
|
6876
|
+
this.handler = handler;
|
|
6877
|
+
}
|
|
6878
|
+
/**
|
|
6879
|
+
* Unregister the notification handler
|
|
6880
|
+
*/ unregisterHandler() {
|
|
6881
|
+
this.handler = null;
|
|
6882
|
+
}
|
|
6883
|
+
/**
|
|
6884
|
+
* Show a notification using the registered handler
|
|
6885
|
+
*/ showNotification(id, title, message, type, options) {
|
|
6886
|
+
if (this.handler) {
|
|
6887
|
+
this.handler(id, title, message, type, options);
|
|
6888
|
+
} else {
|
|
6889
|
+
// Fallback for when no handler is registered (e.g., log to console)
|
|
6890
|
+
console.log(`Notification [${type}]: ${title} - ${message}`);
|
|
6891
|
+
}
|
|
6892
|
+
}
|
|
6893
|
+
}
|
|
6894
|
+
// Export the singleton instance
|
|
6895
|
+
const notificationService = NotificationService.getInstance();
|
|
6896
|
+
// Export convenience methods
|
|
6897
|
+
const showNotification = (id, title, message, type, options)=>{
|
|
6898
|
+
notificationService.showNotification(id, title, message, type, options);
|
|
6899
|
+
};
|
|
6900
|
+
|
|
6901
|
+
export { Accessibility, CART_LIMIT, CohortStorage, CoreProvider, DAYS_IN_YEAR, DataLibraryStoreMode, EmptyFilterSet, EmptyWorkspaceStatusResponse, EnumValueExtractorHandler, ExtractValueFromObject, FILE_DELIMITERS, FILE_FORMATS, GEN3_ANALYSIS_API, GEN3_API, GEN3_AUTHZ_API, GEN3_AUTHZ_SERVICE, GEN3_COMMONS_NAME, GEN3_CROSSWALK_API, GEN3_DOMAIN, GEN3_DOWNLOADS_ENDPOINT, GEN3_FENCE_API, GEN3_FENCE_SERVICE, GEN3_GUPPY_API, GEN3_INDEXD_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, ToGqlAllNested, ToGqlHandler, ValueExtractorHandler, WorkspaceStatus, addItemsToCart, addJEGActiveKernel, ageDisplay, appendFilterToOperation, buildCohortGqlOperator, buildGetAggregationQuery, buildGetStatsAggregationQuery, buildListItemsGroupedByDataset, buildNestedFilterForOperation, buildNestedGQLFilter, buildNestedWithParentPathGQLFilter, buildRangeQuery, calculatePercentageAsNumber, calculatePercentageAsString, capitalize$1 as capitalize, cartReducer, cartReducerPath, clearActiveWorkspaceId, clearCohortFilters, clearJEGActiveKernels, clearJEGActiveWorkspaceId, cohortReducer, configRegistry, conversion, convertFilterSetToGqlFilter, convertFilterSetToNestedGqlFilter, convertFilterSetToOperation, convertFilterToGqlFilter, convertFilterToNestedGqlFilter, convertGqlFilterToFilter, convertToHistogramDataAsStringKey, convertToQueryString, coreStore, createAppApiForRTKQ, createAppStore, createGen3App, createGen3AppWithOwnStore, createNewCohort, createUseCoreDataHook, customQueryStrForField, defaultCohortNameGenerator, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, drsHostnamesReducer, duplicateCohort, explorerApi, explorerTags, extractContents, extractEnumFilterValue, extractFieldNameFromFullFieldName, extractFileDatasetsInRecords, extractFilterValue, extractFiltersWithPrefixFromFilterSet, extractIndexAndFieldNameFromFullFieldName, extractIndexFromDataLibraryCohort, extractIndexFromFullFieldName, fetchArboristResources, fetchFence, fetchFencePresignedURL, fetchJSONDataFromURL, fetchJson, fetchUserState, fieldNameToLabel, filterSetToOperation, formatUptimeInMinutes, gen3Api, generateUniqueName, getCurrentTimestamp, getFederatedLoginStatus, getGen3AppId, getNumberOfItemsInDatalist, getRemoteSupportServiceRegistry, getTimestamp, graphQLAPI, graphQLWithTags, groupSharedFields, guppyAPISliceMiddleware, guppyApi, guppyApiReducer, guppyApiSliceReducerPath, guppyDownloadApi, handleGqlOperation, handleOperation, hideModal, histogramQueryStrForEachField, humanify, ifOperationWithField, 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, isIncludes, isIndexedFilterSetEmpty, isIntersection, isIntersectionOrUnion, isJSONObject, isJSONValue, isJSONValueArray, isNameUnique, isNestedFilter, isNotDefined, isObject, isOperandsType, isOperationWithField, isOperatorWithFieldAndArrayOfOperands, isPending, isProgramUrl, isRootUrl, isStatsValue, isStatsValuesArray, isString, isTimeGreaterThan, isUnion, isWorkspaceActive, isWorkspaceRunningOrStopping, joinFilters, jsonToFormat, listifyMethodsFromMapping, logoutFence, manifestApi, manifestTags, nestedHistogramQueryStrForEachField, normalizeRtkError, notificationService, prepareUrl$1 as prepareUrl, prependIndexToFieldName, printRegistry, processHistogramResponse, projectCodeFromResourcePath, queryMultipleMDSRecords, rawDataQueryStrForEachField$1 as rawDataQueryStrForEachField, registerDefaultRemoteSupport, removeCohort, removeCohortFilter, removeItemsFromCart, removeJEGActiveKernel, removeManyJEGActiveKernels, requestorApi, resetUserState, resourcePathFromProjectID, roundHistogramResponse, selectActiveWorkspaceId, selectActiveWorkspaceStatus, selectAllCohortFiltersCollapsed, selectAllCohorts, selectAllJEGKernels, selectAuthzMappingData, selectAvailableCohortByName, selectAvailableCohorts, selectCSRFToken, selectCSRFTokenData, selectCart, selectCartCount, selectCartItem, selectCartItems, selectCohortById, selectCohortFilterCombineMode, selectCohortFilterExpanded, selectCohortFilters, selectCohortIds, selectCurrentCohort, selectCurrentCohortFilters, selectCurrentCohortId, selectCurrentCohortModified, selectCurrentCohortName, selectCurrentCohortSaved, selectCurrentMessage, selectCurrentModal, selectGen3AppByName, selectGen3AppMetadataByName, selectHeadersWithCSRFToken, selectIndexFilters, selectIndexedFilterByName, selectJEGActiveWorkspaceId, selectJEGActiveWorkspaceStatus, selectJEGKernelById, selectJEGKernelIds, selectJEGRequestedWorkspaceStatus, selectJEGRequestedWorkspaceStatusTimestamp, selectPaymodelStatus, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, selectSharedFilters, selectSharedFiltersForFields, selectShouldShareFilters, selectSowerJobDatetimeCache, selectTotalCohorts, selectUser, selectUserAuthStatus, selectUserData, selectUserDetails, selectUserLoginStatus, selectWorkspaceFullscreen, selectWorkspaceStatus, selectWorkspaceStatusFromService, selectWorkspaceTier, setActiveWorkspace, setActiveWorkspaceId, setActiveWorkspaceStatus, setCohortFilter, setCohortFilterCombineMode, setCohortIndexFilters, setCohortList, setCurrentCohortId, setDRSHostnames, setJEGActiveWorkspace, setJEGActiveWorkspaceId, setJEGActiveWorkspaceStatus, setJEGRequestedWorkspaceStatus, setRequestedWorkspaceStatus, setSharedFilters, setShouldShareFilters, setWorkspaceFullscreen, setWorkspaceTier, setupCoreStore, showModal, showNotification, statsQueryStrForEachField, stringifyJSONParam, submissionApi, toggleCohortBuilderAllFilters, toggleCohortBuilderCategoryFilter, trimFirstfieldNameToLabel, updateCohortFilter, updateCohortName, updateJEGActionKernelStatus, upsertManyJEGActiveKernels, useAddCohortManifestMutation, useAddFileManifestMutation, useAddMetadataManifestMutation, useAddNewCredentialMutation, useAskQuestionMutation, useAuthorizeFromCredentialsMutation, useCohortFacetsQuery, useCoreDispatch, useCoreSelector, useCreateAuthzResourceMutation, useCreateRequestMutation, useCustomRangeQuery, useDataLibrary, useDownloadFromGuppyQuery, useFetchUserDetailsQuery, useGeneralGQLQuery, useGetAISearchStatusQuery, useGetAISearchVersionQuery, useGetAccessibleDataQuery, useGetActivePayModelQuery, useGetAggMDSQuery, useGetAggsQuery, useGetAllFieldsForTypeQuery, useGetArrayTypes, useGetAuthzMappingsQuery, useGetAuthzResourcesQuery, useGetCSRFQuery, useGetCohortManifestQuery, useGetCountsQuery, useGetCredentialsQuery, useGetCrosswalkDataQuery, useGetDataQuery, useGetDictionaryFromUrlQuery, useGetDictionaryQuery, useGetDownloadQuery, useGetExternalLoginsQuery, useGetFederatedLoginStatus, useGetFieldCountSummaryQuery, useGetFieldsForIndexQuery, useGetFileFromManifestQuery, useGetFileManifestQuery, useGetIndexAggMDSQuery, useGetIndexFields, useGetIndexObjectQuery, useGetIndexdMetdataQuery, useGetJWKKeysQuery, useGetLoginProvidersQuery, useGetMDSQuery, useGetManifestServiceStatusQuery, useGetMetadataByIdQuery, useGetMetadataFromManifestQuery, useGetMetadataManifestQuery, useGetObjectIdsQuery, useGetPresignedUrlQuery, useGetProjectsDetailsQuery, useGetProjectsQuery, useGetRawDataAndTotalCountsQuery, useGetSharedFieldsForIndexQuery, useGetSowerJobListQuery, useGetSowerJobStatusQuery, useGetSowerOutputQuery, useGetSowerServiceStatusQuery, useGetStatsAggregationsQuery, useGetStatus, useGetSubAggsQuery, useGetSubmissionGraphQLQuery, useGetSubmissionsQuery, useGetTagsQuery, useGetWorkspaceOptionsQuery, useGetWorkspacePayModelsQuery, useGetWorkspaceStatusQuery, useGraphQLQuery, useIsExternalConnectedQuery, useIsUserLoggedIn, useLaunchWorkspaceMutation, useLazyCustomRangeQuery, useLazyDownloadFromGuppyQuery, useLazyFetchUserDetailsQuery, useLazyGeneralGQLQuery, useLazyGetAggsQuery, useLazyGetAuthzMappingsQuery, useLazyGetAuthzResourcesQuery, useLazyGetCSRFQuery, useLazyGetCountsQuery, useLazyGetCrosswalkDataQuery, useLazyGetDownloadQuery, useLazyGetExternalLoginsQuery, useLazyGetIndexObjectQuery, useLazyGetIndexdMetdataQuery, useLazyGetJWKKeysQuery, useLazyGetManifestServiceStatusQuery, useLazyGetMultipleSowerJobStatusQuery, useLazyGetObjectIdsQuery, useLazyGetPresignedUrlQuery, useLazyGetProjectsQuery, useLazyGetSowerJobListQuery, useLazyGetSowerJobStatusQuery, useLazyGetSowerOutputQuery, useLazyGetStatsAggregationsQuery, useLazyGetSubmissionGraphQLQuery, useLazyIsExternalConnectedQuery, useLazyRequestQuery, usePValueQuery, usePrevious, useRemoveCredentialMutation, useRequestByIdQuery, useRequestQuery, useRequestorStatusQuery, useSetCurrentPayModelMutation, useSubmitSowerJobMutation, useTerminateWorkspaceMutation, useUserAuth, useUserRequestQuery, useVennDiagramQuery, userHasCreateOrUpdateOnAnyProject, userHasDataUpload, userHasMethodForServiceOnProject, userHasMethodForServiceOnResource, userHasMethodOnAnyProject, userHasSheepdogProgramAdmin, userHasSheepdogProjectAdmin };
|
|
6588
6902
|
//# sourceMappingURL=index.js.map
|