@gen3/core 0.11.44 → 0.11.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 CHANGED
@@ -827,16 +827,26 @@ const cartReducerPath = 'cart';
827
827
  method: 'POST',
828
828
  body: JSON.stringify(query)
829
829
  });
830
+ const data = await response.json();
831
+ // Check the response for GraphQL errors
832
+ if (data && 'errors' in data) {
833
+ // Return an object with an 'error' property if GraphQL errors are present
834
+ return {
835
+ error: {
836
+ message: data.errors[0].message,
837
+ locations: data.errors[0].locations
838
+ }
839
+ };
840
+ }
830
841
  return {
831
- data: await response.json()
842
+ data
832
843
  };
833
844
  } catch (e) {
834
845
  if (e instanceof graphql.GraphQLError) {
835
846
  return {
836
847
  error: {
837
848
  message: e.message,
838
- locations: e.locations,
839
- path: e.path
849
+ locations: e.locations
840
850
  }
841
851
  };
842
852
  }
@@ -2419,7 +2429,7 @@ const explorerTags = guppyApi.enhanceEndpoints({
2419
2429
  const containsDotsUniqueBase = containsDots.reduce((acc, field)=>{
2420
2430
  const partsArr = field.split('.');
2421
2431
  if (partsArr.length < 2) {
2422
- throw new Error('Explorer does not support field with more than one \'.\' separator\'t');
2432
+ throw new Error("Explorer does not support field with more than one '.' separator");
2423
2433
  }
2424
2434
  const basePart = partsArr[0];
2425
2435
  if (!acc.includes(basePart)) {
@@ -2433,7 +2443,7 @@ const explorerTags = guppyApi.enhanceEndpoints({
2433
2443
  // this is to make it easier to work with in the table component
2434
2444
  // currently only supports one level of nesting
2435
2445
  // also puts original into subRows for dropdown viewing
2436
- const tempResponse = response.data[args.type].map((item)=>{
2446
+ const tempResponse = response.data[`${args.indexPrefix}${args.type}`].map((item)=>{
2437
2447
  const tempItem = item;
2438
2448
  for(let i = 0; i < containsDotsUniqueBase.length; i++){
2439
2449
  const basePart = containsDotsUniqueBase[i];
@@ -2458,7 +2468,7 @@ const explorerTags = guppyApi.enhanceEndpoints({
2458
2468
  return {
2459
2469
  data: {
2460
2470
  _aggregation: response.data._aggregation,
2461
- [args.type]: tempResponse
2471
+ [`${args.indexPrefix}${args.type}`]: tempResponse
2462
2472
  }
2463
2473
  };
2464
2474
  }
@@ -5914,6 +5924,34 @@ const selectPaymodelStatus = toolkit.createSelector(paymodelStatusSelector, (sta
5914
5924
  const isWorkspaceActive = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Launching || status === WorkspaceStatus.Terminating;
5915
5925
  const isWorkspaceRunningOrStopping = (status)=>status === WorkspaceStatus.Running || status === WorkspaceStatus.Terminating;
5916
5926
 
5927
+ class ConfigRegistry {
5928
+ init(config) {
5929
+ if (this.config !== null) {
5930
+ console.warn('Gen3ConfigRegistry already initialized');
5931
+ return;
5932
+ }
5933
+ this.config = Object.freeze({
5934
+ ...config
5935
+ });
5936
+ }
5937
+ get(key) {
5938
+ if (!this.config) {
5939
+ throw new Error('ConfigRegistry not initialized');
5940
+ }
5941
+ return this.config[key];
5942
+ }
5943
+ getAll() {
5944
+ if (!this.config) {
5945
+ throw new Error('ConfigRegistry not initialized');
5946
+ }
5947
+ return this.config;
5948
+ }
5949
+ constructor(){
5950
+ this.config = null;
5951
+ }
5952
+ }
5953
+ const configRegistry = new ConfigRegistry();
5954
+
5917
5955
  exports.Accessibility = Accessibility;
5918
5956
  exports.CART_LIMIT = CART_LIMIT;
5919
5957
  exports.CohortStorage = CohortStorage;
@@ -5967,6 +6005,7 @@ exports.cartReducerPath = cartReducerPath;
5967
6005
  exports.clearActiveWorkspaceId = clearActiveWorkspaceId;
5968
6006
  exports.clearCohortFilters = clearCohortFilters;
5969
6007
  exports.cohortReducer = cohortReducer;
6008
+ exports.configRegistry = configRegistry;
5970
6009
  exports.conversion = conversion;
5971
6010
  exports.convertFilterSetToGqlFilter = convertFilterSetToGqlFilter;
5972
6011
  exports.convertFilterToGqlFilter = convertFilterToGqlFilter;