@gen3/core 0.12.4 → 0.12.6
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/constants.js +62 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/index.js +2999 -3009
- package/dist/cjs/index.js.map +1 -1
- package/dist/constants.d.ts +41 -0
- package/dist/dts/exports/constants.d.ts +3 -0
- package/dist/dts/exports/constants.d.ts.map +1 -0
- package/dist/dts/features/dataLibrary/useDataLibrary.d.ts +0 -1
- package/dist/dts/features/dataLibrary/useDataLibrary.d.ts.map +1 -1
- package/dist/dts/features/gen3Apps/index.d.ts +2 -2
- package/dist/dts/features/gen3Apps/index.d.ts.map +1 -1
- package/dist/dts/features/guppy/guppyApi.d.ts.map +1 -1
- package/dist/dts/features/guppy/guppyDownloadSlice.d.ts.map +1 -1
- package/dist/dts/features/guppy/guppySlice.d.ts.map +1 -1
- package/dist/dts/features/guppy/utils.d.ts.map +1 -1
- package/dist/dts/features/user/userSlice.d.ts +1 -1
- package/dist/dts/features/user/userSlice.d.ts.map +1 -1
- package/dist/dts/hooks.d.ts +8 -8
- package/dist/dts/index.d.ts +2 -2
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/reducers.d.ts +8 -8
- package/dist/dts/store.d.ts +16 -16
- package/dist/dts/store.d.ts.map +1 -1
- package/dist/dts/types/types.d.ts +1 -1
- package/dist/dts/types/types.d.ts.map +1 -1
- package/dist/esm/constants.js +41 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/index.js +3091 -3101
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +139 -140
- package/package.json +8 -3
package/dist/index.d.ts
CHANGED
|
@@ -1333,7 +1333,7 @@ interface GuppyAggregationsResponse {
|
|
|
1333
1333
|
* @interface ManifestItem
|
|
1334
1334
|
*/
|
|
1335
1335
|
interface ManifestItem {
|
|
1336
|
-
[k: string]: string | number | undefined;
|
|
1336
|
+
[k: string]: string | number | boolean | string[] | undefined;
|
|
1337
1337
|
object_id: string;
|
|
1338
1338
|
file_size?: number;
|
|
1339
1339
|
file_name?: string;
|
|
@@ -1385,6 +1385,142 @@ interface FetchRequest {
|
|
|
1385
1385
|
readonly isJSON?: boolean;
|
|
1386
1386
|
}
|
|
1387
1387
|
|
|
1388
|
+
/**
|
|
1389
|
+
* Performs an asynchronous HTTP request to the Gen3 Fence API and processes the response.
|
|
1390
|
+
*
|
|
1391
|
+
* @template T The expected type of the response data.
|
|
1392
|
+
* @param {FetchRequest} options The options for the fetch request.
|
|
1393
|
+
* @param {string} options.endpoint The API endpoint to which the request will be sent.
|
|
1394
|
+
* @param {Record<string, string>} options.headers An object representing the HTTP headers to include in the request.
|
|
1395
|
+
* @param {Record<string, any>} [options.body={}] The request body to send with the fetch, used if the HTTP method is POST.
|
|
1396
|
+
* @param {string} [options.method='GET'] The HTTP method for the request (e.g., 'GET', 'POST').
|
|
1397
|
+
* @param {boolean} [options.isJSON=true] Determines if the response should be parsed as JSON or returned as plain text.
|
|
1398
|
+
* @param useService { boolean } Uses fence_service instead of public fence API
|
|
1399
|
+
* @returns {Promise<Gen3FenceResponse<T>>} A promise that resolves to the parsed data and response status
|
|
1400
|
+
* or rejects with an error if the request fails.
|
|
1401
|
+
* @throws {Error} Throws an error if the fetch request fails or the response is not successful.
|
|
1402
|
+
*/
|
|
1403
|
+
declare const fetchFence: <T>({ endpoint, headers, body, method, isJSON }: FetchRequest, useService?: boolean) => Promise<Gen3FenceResponse<T>>;
|
|
1404
|
+
|
|
1405
|
+
declare const isFetchError: <T>(obj: unknown) => obj is FetchError<T>;
|
|
1406
|
+
|
|
1407
|
+
interface PayModel {
|
|
1408
|
+
bmh_workspace_id: string;
|
|
1409
|
+
workspace_type: string;
|
|
1410
|
+
user_id: string;
|
|
1411
|
+
account_id: string;
|
|
1412
|
+
request_status: string;
|
|
1413
|
+
local: boolean;
|
|
1414
|
+
region: string;
|
|
1415
|
+
ecs: boolean;
|
|
1416
|
+
subnet: number;
|
|
1417
|
+
'hard-limit': number;
|
|
1418
|
+
'soft-limit': number;
|
|
1419
|
+
'total-usage': number;
|
|
1420
|
+
current_pay_model: boolean;
|
|
1421
|
+
}
|
|
1422
|
+
interface WorkspaceId {
|
|
1423
|
+
id: string;
|
|
1424
|
+
}
|
|
1425
|
+
interface WorkspaceInfo extends WorkspaceId {
|
|
1426
|
+
name: string;
|
|
1427
|
+
idleTimeLimit: number;
|
|
1428
|
+
memoryLimit: string;
|
|
1429
|
+
cpuLimit: string;
|
|
1430
|
+
}
|
|
1431
|
+
interface WorkspaceInfoResponse {
|
|
1432
|
+
id: string;
|
|
1433
|
+
name: string;
|
|
1434
|
+
'idle-time-limit': number;
|
|
1435
|
+
'memory-limit': string;
|
|
1436
|
+
'cpu-limit': string;
|
|
1437
|
+
}
|
|
1438
|
+
type WorkspaceOptionsResponse = Array<WorkspaceInfoResponse>;
|
|
1439
|
+
type WorkspaceOptions = Array<WorkspaceInfo>;
|
|
1440
|
+
interface WorkspacePayModelResponse {
|
|
1441
|
+
currentPayModel: PayModel;
|
|
1442
|
+
allPayModels: PayModel[];
|
|
1443
|
+
noPayModel: boolean;
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* Workspace Pod status
|
|
1447
|
+
*/
|
|
1448
|
+
declare enum WorkspaceStatus {
|
|
1449
|
+
Launching = "Launching",
|
|
1450
|
+
Running = "Running",
|
|
1451
|
+
Terminating = "Terminating",
|
|
1452
|
+
Stopped = "Stopped",
|
|
1453
|
+
NotFound = "Not Found",
|
|
1454
|
+
Errored = "Errored",
|
|
1455
|
+
StatusError = "Status Error"
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* requested state of pod, either by user or workspace monitor
|
|
1459
|
+
*/
|
|
1460
|
+
declare enum RequestedWorkspaceStatus {
|
|
1461
|
+
Launch = "Launch",
|
|
1462
|
+
Terminate = "Terminate",
|
|
1463
|
+
Unset = "Unset"
|
|
1464
|
+
}
|
|
1465
|
+
declare enum PodConditionType {
|
|
1466
|
+
PodScheduled = "PodScheduled",
|
|
1467
|
+
Initialized = "Initialized",
|
|
1468
|
+
ContainersReady = "ContainersReady",
|
|
1469
|
+
PodReadyToStartContainers = "PodReadyToStartContainers",
|
|
1470
|
+
ProxyConnected = "ProxyConnected",
|
|
1471
|
+
Ready = "Ready"
|
|
1472
|
+
}
|
|
1473
|
+
declare enum PodStatus {
|
|
1474
|
+
True = "True",
|
|
1475
|
+
False = "False",
|
|
1476
|
+
Unknown = "Unknown"
|
|
1477
|
+
}
|
|
1478
|
+
interface WorkspaceContainerState {
|
|
1479
|
+
name: string;
|
|
1480
|
+
ready: boolean;
|
|
1481
|
+
state: {
|
|
1482
|
+
running: {
|
|
1483
|
+
startedAt: string;
|
|
1484
|
+
};
|
|
1485
|
+
} | {
|
|
1486
|
+
waiting: {
|
|
1487
|
+
reason: string;
|
|
1488
|
+
};
|
|
1489
|
+
} | {
|
|
1490
|
+
terminated: {
|
|
1491
|
+
reason: string;
|
|
1492
|
+
};
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
interface WorkspacePodCondition {
|
|
1496
|
+
type: PodConditionType;
|
|
1497
|
+
status: PodStatus;
|
|
1498
|
+
}
|
|
1499
|
+
interface WorkspaceStatusResponse {
|
|
1500
|
+
status: WorkspaceStatus;
|
|
1501
|
+
conditions?: Array<WorkspacePodCondition>;
|
|
1502
|
+
containerStates?: Array<WorkspaceContainerState>;
|
|
1503
|
+
idleTimeLimit?: number;
|
|
1504
|
+
lastActivityTime: number;
|
|
1505
|
+
workspaceType?: string;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
interface WorkspaceState {
|
|
1509
|
+
id: string;
|
|
1510
|
+
status: WorkspaceStatus;
|
|
1511
|
+
requestedStatus: RequestedWorkspaceStatus;
|
|
1512
|
+
requestedStatusTimestamp: number;
|
|
1513
|
+
}
|
|
1514
|
+
declare const setActiveWorkspaceId: _reduxjs_toolkit.ActionCreatorWithPayload<WorkspaceId, "ActiveWorkspace/setActiveWorkspaceId">;
|
|
1515
|
+
declare const clearActiveWorkspaceId: _reduxjs_toolkit.ActionCreatorWithoutPayload<"ActiveWorkspace/clearActiveWorkspaceId">;
|
|
1516
|
+
declare const setActiveWorkspaceStatus: _reduxjs_toolkit.ActionCreatorWithPayload<WorkspaceStatus, "ActiveWorkspace/setActiveWorkspaceStatus">;
|
|
1517
|
+
declare const setRequestedWorkspaceStatus: _reduxjs_toolkit.ActionCreatorWithPayload<RequestedWorkspaceStatus, "ActiveWorkspace/setRequestedWorkspaceStatus">;
|
|
1518
|
+
declare const setActiveWorkspace: _reduxjs_toolkit.ActionCreatorWithPayload<WorkspaceState, "ActiveWorkspace/setActiveWorkspace">;
|
|
1519
|
+
declare const selectActiveWorkspaceId: (state: CoreState) => string;
|
|
1520
|
+
declare const selectActiveWorkspaceStatus: (state: CoreState) => WorkspaceStatus;
|
|
1521
|
+
declare const selectRequestedWorkspaceStatus: (state: CoreState) => RequestedWorkspaceStatus;
|
|
1522
|
+
declare const selectRequestedWorkspaceStatusTimestamp: (state: CoreState) => number;
|
|
1523
|
+
|
|
1388
1524
|
interface NameUrl {
|
|
1389
1525
|
readonly name: string;
|
|
1390
1526
|
readonly url: string;
|
|
@@ -2837,142 +2973,6 @@ declare const useGetJWKKeysQuery: <R extends Record<string, any> = _reduxjs_tool
|
|
|
2837
2973
|
refetch: () => _reduxjs_toolkit_query.QueryActionCreatorResult<_reduxjs_toolkit_query.QueryDefinition<void, _reduxjs_toolkit_query.BaseQueryFn<string | _reduxjs_toolkit_query.FetchArgs, unknown, _reduxjs_toolkit_query.FetchBaseQueryError, {}, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "fenceJWT", readonly JWTKeys[], "gen3Services", unknown>>;
|
|
2838
2974
|
};
|
|
2839
2975
|
|
|
2840
|
-
declare const isFetchError: <T>(obj: unknown) => obj is FetchError<T>;
|
|
2841
|
-
|
|
2842
|
-
/**
|
|
2843
|
-
* Performs an asynchronous HTTP request to the Gen3 Fence API and processes the response.
|
|
2844
|
-
*
|
|
2845
|
-
* @template T The expected type of the response data.
|
|
2846
|
-
* @param {FetchRequest} options The options for the fetch request.
|
|
2847
|
-
* @param {string} options.endpoint The API endpoint to which the request will be sent.
|
|
2848
|
-
* @param {Record<string, string>} options.headers An object representing the HTTP headers to include in the request.
|
|
2849
|
-
* @param {Record<string, any>} [options.body={}] The request body to send with the fetch, used if the HTTP method is POST.
|
|
2850
|
-
* @param {string} [options.method='GET'] The HTTP method for the request (e.g., 'GET', 'POST').
|
|
2851
|
-
* @param {boolean} [options.isJSON=true] Determines if the response should be parsed as JSON or returned as plain text.
|
|
2852
|
-
* @param useService { boolean } Uses fence_service instead of public fence API
|
|
2853
|
-
* @returns {Promise<Gen3FenceResponse<T>>} A promise that resolves to the parsed data and response status
|
|
2854
|
-
* or rejects with an error if the request fails.
|
|
2855
|
-
* @throws {Error} Throws an error if the fetch request fails or the response is not successful.
|
|
2856
|
-
*/
|
|
2857
|
-
declare const fetchFence: <T>({ endpoint, headers, body, method, isJSON }: FetchRequest, useService?: boolean) => Promise<Gen3FenceResponse<T>>;
|
|
2858
|
-
|
|
2859
|
-
interface PayModel {
|
|
2860
|
-
bmh_workspace_id: string;
|
|
2861
|
-
workspace_type: string;
|
|
2862
|
-
user_id: string;
|
|
2863
|
-
account_id: string;
|
|
2864
|
-
request_status: string;
|
|
2865
|
-
local: boolean;
|
|
2866
|
-
region: string;
|
|
2867
|
-
ecs: boolean;
|
|
2868
|
-
subnet: number;
|
|
2869
|
-
'hard-limit': number;
|
|
2870
|
-
'soft-limit': number;
|
|
2871
|
-
'total-usage': number;
|
|
2872
|
-
current_pay_model: boolean;
|
|
2873
|
-
}
|
|
2874
|
-
interface WorkspaceId {
|
|
2875
|
-
id: string;
|
|
2876
|
-
}
|
|
2877
|
-
interface WorkspaceInfo extends WorkspaceId {
|
|
2878
|
-
name: string;
|
|
2879
|
-
idleTimeLimit: number;
|
|
2880
|
-
memoryLimit: string;
|
|
2881
|
-
cpuLimit: string;
|
|
2882
|
-
}
|
|
2883
|
-
interface WorkspaceInfoResponse {
|
|
2884
|
-
id: string;
|
|
2885
|
-
name: string;
|
|
2886
|
-
'idle-time-limit': number;
|
|
2887
|
-
'memory-limit': string;
|
|
2888
|
-
'cpu-limit': string;
|
|
2889
|
-
}
|
|
2890
|
-
type WorkspaceOptionsResponse = Array<WorkspaceInfoResponse>;
|
|
2891
|
-
type WorkspaceOptions = Array<WorkspaceInfo>;
|
|
2892
|
-
interface WorkspacePayModelResponse {
|
|
2893
|
-
currentPayModel: PayModel;
|
|
2894
|
-
allPayModels: PayModel[];
|
|
2895
|
-
noPayModel: boolean;
|
|
2896
|
-
}
|
|
2897
|
-
/**
|
|
2898
|
-
* Workspace Pod status
|
|
2899
|
-
*/
|
|
2900
|
-
declare enum WorkspaceStatus {
|
|
2901
|
-
Launching = "Launching",
|
|
2902
|
-
Running = "Running",
|
|
2903
|
-
Terminating = "Terminating",
|
|
2904
|
-
Stopped = "Stopped",
|
|
2905
|
-
NotFound = "Not Found",
|
|
2906
|
-
Errored = "Errored",
|
|
2907
|
-
StatusError = "Status Error"
|
|
2908
|
-
}
|
|
2909
|
-
/**
|
|
2910
|
-
* requested state of pod, either by user or workspace monitor
|
|
2911
|
-
*/
|
|
2912
|
-
declare enum RequestedWorkspaceStatus {
|
|
2913
|
-
Launch = "Launch",
|
|
2914
|
-
Terminate = "Terminate",
|
|
2915
|
-
Unset = "Unset"
|
|
2916
|
-
}
|
|
2917
|
-
declare enum PodConditionType {
|
|
2918
|
-
PodScheduled = "PodScheduled",
|
|
2919
|
-
Initialized = "Initialized",
|
|
2920
|
-
ContainersReady = "ContainersReady",
|
|
2921
|
-
PodReadyToStartContainers = "PodReadyToStartContainers",
|
|
2922
|
-
ProxyConnected = "ProxyConnected",
|
|
2923
|
-
Ready = "Ready"
|
|
2924
|
-
}
|
|
2925
|
-
declare enum PodStatus {
|
|
2926
|
-
True = "True",
|
|
2927
|
-
False = "False",
|
|
2928
|
-
Unknown = "Unknown"
|
|
2929
|
-
}
|
|
2930
|
-
interface WorkspaceContainerState {
|
|
2931
|
-
name: string;
|
|
2932
|
-
ready: boolean;
|
|
2933
|
-
state: {
|
|
2934
|
-
running: {
|
|
2935
|
-
startedAt: string;
|
|
2936
|
-
};
|
|
2937
|
-
} | {
|
|
2938
|
-
waiting: {
|
|
2939
|
-
reason: string;
|
|
2940
|
-
};
|
|
2941
|
-
} | {
|
|
2942
|
-
terminated: {
|
|
2943
|
-
reason: string;
|
|
2944
|
-
};
|
|
2945
|
-
};
|
|
2946
|
-
}
|
|
2947
|
-
interface WorkspacePodCondition {
|
|
2948
|
-
type: PodConditionType;
|
|
2949
|
-
status: PodStatus;
|
|
2950
|
-
}
|
|
2951
|
-
interface WorkspaceStatusResponse {
|
|
2952
|
-
status: WorkspaceStatus;
|
|
2953
|
-
conditions?: Array<WorkspacePodCondition>;
|
|
2954
|
-
containerStates?: Array<WorkspaceContainerState>;
|
|
2955
|
-
idleTimeLimit?: number;
|
|
2956
|
-
lastActivityTime: number;
|
|
2957
|
-
workspaceType?: string;
|
|
2958
|
-
}
|
|
2959
|
-
|
|
2960
|
-
interface WorkspaceState {
|
|
2961
|
-
id: string;
|
|
2962
|
-
status: WorkspaceStatus;
|
|
2963
|
-
requestedStatus: RequestedWorkspaceStatus;
|
|
2964
|
-
requestedStatusTimestamp: number;
|
|
2965
|
-
}
|
|
2966
|
-
declare const setActiveWorkspaceId: _reduxjs_toolkit.ActionCreatorWithPayload<WorkspaceId, "ActiveWorkspace/setActiveWorkspaceId">;
|
|
2967
|
-
declare const clearActiveWorkspaceId: _reduxjs_toolkit.ActionCreatorWithoutPayload<"ActiveWorkspace/clearActiveWorkspaceId">;
|
|
2968
|
-
declare const setActiveWorkspaceStatus: _reduxjs_toolkit.ActionCreatorWithPayload<WorkspaceStatus, "ActiveWorkspace/setActiveWorkspaceStatus">;
|
|
2969
|
-
declare const setRequestedWorkspaceStatus: _reduxjs_toolkit.ActionCreatorWithPayload<RequestedWorkspaceStatus, "ActiveWorkspace/setRequestedWorkspaceStatus">;
|
|
2970
|
-
declare const setActiveWorkspace: _reduxjs_toolkit.ActionCreatorWithPayload<WorkspaceState, "ActiveWorkspace/setActiveWorkspace">;
|
|
2971
|
-
declare const selectActiveWorkspaceId: (state: CoreState) => string;
|
|
2972
|
-
declare const selectActiveWorkspaceStatus: (state: CoreState) => WorkspaceStatus;
|
|
2973
|
-
declare const selectRequestedWorkspaceStatus: (state: CoreState) => RequestedWorkspaceStatus;
|
|
2974
|
-
declare const selectRequestedWorkspaceStatusTimestamp: (state: CoreState) => number;
|
|
2975
|
-
|
|
2976
2976
|
interface guppyFetchError {
|
|
2977
2977
|
readonly url: string;
|
|
2978
2978
|
readonly status: number;
|
|
@@ -12611,6 +12611,8 @@ declare const rootReducer: redux.Reducer<{
|
|
|
12611
12611
|
}>>;
|
|
12612
12612
|
type CoreState = ReturnType<typeof rootReducer>;
|
|
12613
12613
|
|
|
12614
|
+
declare const CoreProvider: React__default.FC<Record<string, unknown>>;
|
|
12615
|
+
|
|
12614
12616
|
/**
|
|
12615
12617
|
* The initial context is never used in practice. A little casting voodoo to satisfy TS.
|
|
12616
12618
|
*
|
|
@@ -12785,8 +12787,6 @@ declare const ageDisplay: (ageInDays: number, yearsOnly?: boolean, defaultValue?
|
|
|
12785
12787
|
*/
|
|
12786
12788
|
declare const stringifyJSONParam: (obj?: Record<string, any>, defaults?: string) => string;
|
|
12787
12789
|
|
|
12788
|
-
declare const CoreProvider: React__default.FC<Record<string, unknown>>;
|
|
12789
|
-
|
|
12790
12790
|
interface AiSearchParams {
|
|
12791
12791
|
readonly query: string;
|
|
12792
12792
|
}
|
|
@@ -13465,7 +13465,6 @@ interface UseDataLibraryResult {
|
|
|
13465
13465
|
deleteListFromDataLibrary: (id: string) => Promise<StorageOperationResults>;
|
|
13466
13466
|
clearLibrary: () => Promise<StorageOperationResults>;
|
|
13467
13467
|
setAllListsInDataLibrary: (data: Array<LibraryListItemsGroupedByDataset>) => Promise<StorageOperationResults>;
|
|
13468
|
-
setLoginState: (loggedIn: boolean) => void;
|
|
13469
13468
|
getDatalist: (id: string) => Datalist;
|
|
13470
13469
|
}
|
|
13471
13470
|
declare const useDataLibrary: (options?: UseDataLibraryOptions) => UseDataLibraryResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gen3/core",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.6",
|
|
4
4
|
"author": "CTDS",
|
|
5
5
|
"description": "Core module for Gen3.2. Packages provides an interface for interacting with the gen3 API, various types, and a redux store for managing state.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"types": "./dist/server.d.ts",
|
|
27
27
|
"import": "./dist/esm/server.js",
|
|
28
28
|
"require": "./dist/cjs/server.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./exports/constants": {
|
|
31
|
+
"types": "./dist/constant.d.ts",
|
|
32
|
+
"import": "./dist/esm/constants.js",
|
|
33
|
+
"require": "./dist/cjs/constants.js"
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
"scripts": {
|
|
@@ -40,7 +45,7 @@
|
|
|
40
45
|
"test:watch": "jest unit --watch",
|
|
41
46
|
"test:int": "jest int",
|
|
42
47
|
"test:all": "jest",
|
|
43
|
-
"dev": "
|
|
48
|
+
"dev": "echo no dev tasks"
|
|
44
49
|
},
|
|
45
50
|
"peerDependencies": {
|
|
46
51
|
"react": "^18.3.1",
|
|
@@ -75,5 +80,5 @@
|
|
|
75
80
|
"files": [
|
|
76
81
|
"dist"
|
|
77
82
|
],
|
|
78
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "64ca0a35153af5724f5c03a68cbab09cf234fea4"
|
|
79
84
|
}
|