@gen3/core 0.11.13 → 0.11.16

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
@@ -1458,7 +1458,7 @@ const fetchFencePresignedURL = async ({ guid, method = 'GET', onAbort = ()=>null
1458
1458
  if (!response.ok) {
1459
1459
  throw new HTTPError(response.status, response.statusText);
1460
1460
  }
1461
- const { csrf_token: csrfToken } = await response.json();
1461
+ const { csrf: csrfToken } = await response.json();
1462
1462
  return csrfToken || null;
1463
1463
  };
1464
1464
  /**
@@ -1506,7 +1506,7 @@ const fetchFencePresignedURL = async ({ guid, method = 'GET', onAbort = ()=>null
1506
1506
  throw new HTTPError(response.status, response.statusText, response.text());
1507
1507
  }
1508
1508
  if (response.status === 204) {
1509
- // no content so return null
1509
+ // no content so returns null
1510
1510
  return null;
1511
1511
  }
1512
1512
  return await response.json();
@@ -2997,6 +2997,10 @@ const handleOperation = (handler, op)=>{
2997
2997
  return handler.handleExcludeIfAny(op);
2998
2998
  case 'excludes':
2999
2999
  return handler.handleExcludes(op);
3000
+ case 'exists':
3001
+ return handler.handleExists(op);
3002
+ case 'missing':
3003
+ return handler.handleMissing(op);
3000
3004
  default:
3001
3005
  return assertNever(op);
3002
3006
  }
@@ -3005,6 +3009,20 @@ const handleOperation = (handler, op)=>{
3005
3009
  * Return true if a FilterSet's root value is an empty object
3006
3010
  * @param fs - FilterSet to test
3007
3011
  */ const isFilterEmpty = (fs)=>lodash.isEqual({}, fs);
3012
+ /**
3013
+ * Type guard to check if an object is a GQLIntersection
3014
+ * @param value - The value to check
3015
+ * @returns True if the value is a GQLIntersection
3016
+ */ const isGQLIntersection = (value)=>{
3017
+ return typeof value === 'object' && value !== null && 'and' in value && Array.isArray(value.and);
3018
+ };
3019
+ /**
3020
+ * Type guard to check if an object is a GQLIntersection
3021
+ * @param value - The value to check
3022
+ * @returns True if the value is a GQLIntersection
3023
+ */ const isGQLUnion = (value)=>{
3024
+ return typeof value === 'object' && value !== null && 'or' in value && Array.isArray(value.or);
3025
+ };
3008
3026
  class ToGqlHandler {
3009
3027
  constructor(){
3010
3028
  this.handleEquals = (op)=>({
@@ -3058,6 +3076,16 @@ class ToGqlHandler {
3058
3076
  this.handleUnion = (op)=>({
3059
3077
  or: op.operands.map((x)=>convertFilterToGqlFilter(x))
3060
3078
  });
3079
+ this.handleMissing = (op)=>({
3080
+ is: {
3081
+ [op.field]: 'MISSING'
3082
+ }
3083
+ });
3084
+ this.handleExists = (op)=>({
3085
+ not: {
3086
+ [op.field]: op?.operand ?? null
3087
+ }
3088
+ });
3061
3089
  this.handleNestedFilter = (op)=>{
3062
3090
  const child = convertFilterToGqlFilter(op.operand);
3063
3091
  return {
@@ -3086,7 +3114,7 @@ const convertFilterSetToGqlFilter = (fs, toplevelOp = 'and')=>{
3086
3114
  };
3087
3115
  };
3088
3116
  /**
3089
- * Extract the operand values, if operands themselves have values, otherwise undefined.
3117
+ * Extract the operand values, if operands themselves have values, otherwise undefined.
3090
3118
  */ class ValueExtractorHandler {
3091
3119
  constructor(){
3092
3120
  this.handleEquals = (op)=>op.operand;
@@ -3101,10 +3129,12 @@ const convertFilterSetToGqlFilter = (fs, toplevelOp = 'and')=>{
3101
3129
  this.handleIntersection = (_arg)=>undefined;
3102
3130
  this.handleUnion = (_)=>undefined;
3103
3131
  this.handleNestedFilter = (_)=>undefined;
3132
+ this.handleExists = (_)=>undefined;
3133
+ this.handleMissing = (_)=>undefined;
3104
3134
  }
3105
3135
  }
3106
3136
  /**
3107
- * Extract the operand values, if operands themselves have values, otherwise undefined.
3137
+ * Extract the operand values, if operands themselves have values, otherwise undefined.
3108
3138
  */ class EnumValueExtractorHandler {
3109
3139
  constructor(){
3110
3140
  this.handleEquals = (_)=>undefined;
@@ -3121,6 +3151,8 @@ const convertFilterSetToGqlFilter = (fs, toplevelOp = 'and')=>{
3121
3151
  this.handleNestedFilter = (op)=>{
3122
3152
  return extractEnumFilterValue(op.operand);
3123
3153
  };
3154
+ this.handleExists = (_)=>undefined;
3155
+ this.handleMissing = (_)=>undefined;
3124
3156
  }
3125
3157
  }
3126
3158
  const filterSetToOperation = (fs)=>{
@@ -4982,6 +5014,8 @@ exports.isFetchParseError = isFetchParseError;
4982
5014
  exports.isFileItem = isFileItem;
4983
5015
  exports.isFilterEmpty = isFilterEmpty;
4984
5016
  exports.isFilterSet = isFilterSet;
5017
+ exports.isGQLIntersection = isGQLIntersection;
5018
+ exports.isGQLUnion = isGQLUnion;
4985
5019
  exports.isGuppyAggregationData = isGuppyAggregationData;
4986
5020
  exports.isHistogramData = isHistogramData;
4987
5021
  exports.isHistogramDataAArray = isHistogramDataAArray;