@osdk/client 2.7.0-beta.12 → 2.7.0-beta.13

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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk62RUUOW2_cjs = require('./chunk-62RUUOW2.cjs');
4
- require('./chunk-4HXJEKQT.cjs');
3
+ var chunkZFL7RPT6_cjs = require('./chunk-ZFL7RPT6.cjs');
4
+ require('./chunk-VVKEXIIO.cjs');
5
5
  var chunkLDTMSHUZ_cjs = require('./chunk-LDTMSHUZ.cjs');
6
6
  var api = require('@osdk/api');
7
7
  var shared_net_errors = require('@osdk/shared.net.errors');
@@ -18,7 +18,7 @@ chunkLDTMSHUZ_cjs.init_cjs_shims();
18
18
  // src/createPlatformClient.ts
19
19
  chunkLDTMSHUZ_cjs.init_cjs_shims();
20
20
  function createPlatformClient(baseUrl, tokenProvider, options = void 0, fetchFn = fetch) {
21
- return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, chunk62RUUOW2_cjs.USER_AGENT, fetchFn);
21
+ return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, chunkZFL7RPT6_cjs.USER_AGENT, fetchFn);
22
22
  }
23
23
 
24
24
  // src/util/datetimeConverters.ts
@@ -45,23 +45,23 @@ var extractDateFromIsoString = (dateTime) => {
45
45
 
46
46
  Object.defineProperty(exports, "ActionValidationError", {
47
47
  enumerable: true,
48
- get: function () { return chunk62RUUOW2_cjs.ActionValidationError; }
48
+ get: function () { return chunkZFL7RPT6_cjs.ActionValidationError; }
49
49
  });
50
50
  Object.defineProperty(exports, "createAttachmentUpload", {
51
51
  enumerable: true,
52
- get: function () { return chunk62RUUOW2_cjs.createAttachmentUpload; }
52
+ get: function () { return chunkZFL7RPT6_cjs.createAttachmentUpload; }
53
53
  });
54
54
  Object.defineProperty(exports, "createClient", {
55
55
  enumerable: true,
56
- get: function () { return chunk62RUUOW2_cjs.createClient; }
56
+ get: function () { return chunkZFL7RPT6_cjs.createClient; }
57
57
  });
58
58
  Object.defineProperty(exports, "createObjectSpecifierFromPrimaryKey", {
59
59
  enumerable: true,
60
- get: function () { return chunk62RUUOW2_cjs.createObjectSpecifierFromPrimaryKey; }
60
+ get: function () { return chunkZFL7RPT6_cjs.createObjectSpecifierFromPrimaryKey; }
61
61
  });
62
62
  Object.defineProperty(exports, "extractPrimaryKeyFromObjectSpecifier", {
63
63
  enumerable: true,
64
- get: function () { return chunk62RUUOW2_cjs.extractPrimaryKeyFromObjectSpecifier; }
64
+ get: function () { return chunkZFL7RPT6_cjs.extractPrimaryKeyFromObjectSpecifier; }
65
65
  });
66
66
  Object.defineProperty(exports, "isOk", {
67
67
  enumerable: true,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk4HXJEKQT_cjs = require('../chunk-4HXJEKQT.cjs');
3
+ var chunkVVKEXIIO_cjs = require('../chunk-VVKEXIIO.cjs');
4
4
  var chunkLDTMSHUZ_cjs = require('../chunk-LDTMSHUZ.cjs');
5
5
 
6
6
  // src/public/internal.ts
@@ -9,8 +9,8 @@ chunkLDTMSHUZ_cjs.init_cjs_shims();
9
9
  // src/public-utils/createAndFetchTempObjectSetRid.ts
10
10
  chunkLDTMSHUZ_cjs.init_cjs_shims();
11
11
  async function createAndFetchTempObjectSetRid(client, objectSet) {
12
- const response = await chunk4HXJEKQT_cjs.OntologyObjectSet_exports.createTemporary(client, await client[chunk4HXJEKQT_cjs.additionalContext].ontologyRid, {
13
- objectSet: chunk4HXJEKQT_cjs.getWireObjectSet(objectSet)
12
+ const response = await chunkVVKEXIIO_cjs.OntologyObjectSet_exports.createTemporary(client, await client[chunkVVKEXIIO_cjs.additionalContext].ontologyRid, {
13
+ objectSet: chunkVVKEXIIO_cjs.getWireObjectSet(objectSet)
14
14
  });
15
15
  return response.objectSetRid;
16
16
  }
@@ -18,7 +18,7 @@ async function createAndFetchTempObjectSetRid(client, objectSet) {
18
18
  // src/public-utils/hydrateObjectSetFromObjectRids.ts
19
19
  chunkLDTMSHUZ_cjs.init_cjs_shims();
20
20
  function hydrateObjectSetFromObjectRids(client, definition, rids) {
21
- return chunk4HXJEKQT_cjs.createObjectSet(definition, client[chunk4HXJEKQT_cjs.additionalContext], {
21
+ return chunkVVKEXIIO_cjs.createObjectSet(definition, client[chunkVVKEXIIO_cjs.additionalContext], {
22
22
  type: "intersect",
23
23
  objectSets: [definition.type === "interface" ? {
24
24
  type: "interfaceBase",
@@ -39,7 +39,7 @@ function asMutableArray(array) {
39
39
  // src/public-utils/hydrateObjectSetFromRid.ts
40
40
  chunkLDTMSHUZ_cjs.init_cjs_shims();
41
41
  function hydrateObjectSetFromRid(client, definition, rid) {
42
- return chunk4HXJEKQT_cjs.createObjectSet(definition, client[chunk4HXJEKQT_cjs.additionalContext], {
42
+ return chunkVVKEXIIO_cjs.createObjectSet(definition, client[chunkVVKEXIIO_cjs.additionalContext], {
43
43
  type: "intersect",
44
44
  objectSets: [definition.type === "interface" ? {
45
45
  type: "interfaceBase",
@@ -81,7 +81,7 @@ var levelStyles = {
81
81
  color: "orange"
82
82
  })
83
83
  };
84
- var BrowserLogger = class _BrowserLogger extends chunk4HXJEKQT_cjs.BaseLogger {
84
+ var BrowserLogger = class _BrowserLogger extends chunkVVKEXIIO_cjs.BaseLogger {
85
85
  constructor(bindings = {}, options = {}) {
86
86
  super(bindings, {
87
87
  ...options,
@@ -107,11 +107,11 @@ var BrowserLogger = class _BrowserLogger extends chunk4HXJEKQT_cjs.BaseLogger {
107
107
 
108
108
  Object.defineProperty(exports, "MinimalLogger", {
109
109
  enumerable: true,
110
- get: function () { return chunk4HXJEKQT_cjs.MinimalLogger; }
110
+ get: function () { return chunkVVKEXIIO_cjs.MinimalLogger; }
111
111
  });
112
112
  Object.defineProperty(exports, "hydrateAttachmentFromRid", {
113
113
  enumerable: true,
114
- get: function () { return chunk4HXJEKQT_cjs.hydrateAttachmentFromRid; }
114
+ get: function () { return chunkVVKEXIIO_cjs.hydrateAttachmentFromRid; }
115
115
  });
116
116
  exports.BrowserLogger = BrowserLogger;
117
117
  exports.createAndFetchTempObjectSetRid = createAndFetchTempObjectSetRid;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk62RUUOW2_cjs = require('../chunk-62RUUOW2.cjs');
4
- var chunk4HXJEKQT_cjs = require('../chunk-4HXJEKQT.cjs');
3
+ var chunkZFL7RPT6_cjs = require('../chunk-ZFL7RPT6.cjs');
4
+ var chunkVVKEXIIO_cjs = require('../chunk-VVKEXIIO.cjs');
5
5
  var chunkLDTMSHUZ_cjs = require('../chunk-LDTMSHUZ.cjs');
6
6
  var trie = require('@wry/trie');
7
7
  var deepEqual = require('fast-deep-equal');
@@ -153,7 +153,7 @@ var WhereClauseCanonicalizer = class {
153
153
  var whereCanonicalizer = new WhereClauseCanonicalizer();
154
154
  var orderByCanonicalizer = new OrderByCanonicalizer();
155
155
  function computeObjectSetCacheKey(objectSet, options) {
156
- const keyParts = ["objectSet", chunk4HXJEKQT_cjs.getWireObjectSet(objectSet)];
156
+ const keyParts = ["objectSet", chunkVVKEXIIO_cjs.getWireObjectSet(objectSet)];
157
157
  if (!options) {
158
158
  return JSON.stringify(keyParts);
159
159
  }
@@ -165,13 +165,13 @@ function computeObjectSetCacheKey(objectSet, options) {
165
165
  keyParts.push("props", propKeys);
166
166
  }
167
167
  if (options.union && options.union.length > 0) {
168
- keyParts.push("union", options.union.map((os) => chunk4HXJEKQT_cjs.getWireObjectSet(os)));
168
+ keyParts.push("union", options.union.map((os) => chunkVVKEXIIO_cjs.getWireObjectSet(os)));
169
169
  }
170
170
  if (options.intersect && options.intersect.length > 0) {
171
- keyParts.push("intersect", options.intersect.map((os) => chunk4HXJEKQT_cjs.getWireObjectSet(os)));
171
+ keyParts.push("intersect", options.intersect.map((os) => chunkVVKEXIIO_cjs.getWireObjectSet(os)));
172
172
  }
173
173
  if (options.subtract && options.subtract.length > 0) {
174
- keyParts.push("subtract", options.subtract.map((os) => chunk4HXJEKQT_cjs.getWireObjectSet(os)));
174
+ keyParts.push("subtract", options.subtract.map((os) => chunkVVKEXIIO_cjs.getWireObjectSet(os)));
175
175
  }
176
176
  if (options.pivotTo) {
177
177
  keyParts.push("pivotTo", options.pivotTo);
@@ -371,7 +371,7 @@ var OptimisticJob = class {
371
371
  return this;
372
372
  },
373
373
  createObject(type, pk, properties) {
374
- const create = store.client[chunk4HXJEKQT_cjs.additionalContext].objectFactory2(store.client[chunk4HXJEKQT_cjs.additionalContext], [{
374
+ const create = store.client[chunkVVKEXIIO_cjs.additionalContext].objectFactory2(store.client[chunkVVKEXIIO_cjs.additionalContext], [{
375
375
  $primaryKey: pk,
376
376
  $apiName: type.apiName,
377
377
  $objectType: type.apiName,
@@ -593,7 +593,7 @@ var Query = class {
593
593
  this.store = store;
594
594
  this.cacheKeys = store.cacheKeys;
595
595
  this.#subject = observable;
596
- this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunk4HXJEKQT_cjs.additionalContext].logger : store.client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
596
+ this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger : store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
597
597
  msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
598
598
  }));
599
599
  }
@@ -751,7 +751,7 @@ var Query = class {
751
751
  // src/observable/internal/aggregation/AggregationQuery.ts
752
752
  var AggregationQuery = class extends Query {
753
753
  constructor(store, subject, cacheKey, opts) {
754
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
754
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
755
755
  msgPrefix: `AggregationQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
756
756
  }) : void 0);
757
757
  this.apiName = cacheKey.otherKeys[API_NAME_IDX];
@@ -1122,7 +1122,7 @@ var FunctionParamsCanonicalizer = class {
1122
1122
  path.push("$:map_end");
1123
1123
  return arr;
1124
1124
  }
1125
- if (chunk62RUUOW2_cjs.isObjectSpecifiersObject(value)) {
1125
+ if (chunkZFL7RPT6_cjs.isObjectSpecifiersObject(value)) {
1126
1126
  const objectType = value.$objectType ?? value.$apiName;
1127
1127
  path.push("$:osdk", objectType, value.$primaryKey);
1128
1128
  return {
@@ -1130,8 +1130,8 @@ var FunctionParamsCanonicalizer = class {
1130
1130
  $primaryKey: value.$primaryKey
1131
1131
  };
1132
1132
  }
1133
- if (chunk4HXJEKQT_cjs.isObjectSet(value)) {
1134
- const wire = chunk4HXJEKQT_cjs.getWireObjectSet(value);
1133
+ if (chunkVVKEXIIO_cjs.isObjectSet(value)) {
1134
+ const wire = chunkVVKEXIIO_cjs.getWireObjectSet(value);
1135
1135
  path.push("$:objectset", wire);
1136
1136
  return wire;
1137
1137
  }
@@ -1194,7 +1194,7 @@ var FunctionQuery = class extends Query {
1194
1194
  #dependsOnObjects;
1195
1195
  #queryDef;
1196
1196
  constructor(store, subject, queryDef, params, cacheKey, opts) {
1197
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
1197
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
1198
1198
  msgPrefix: `FunctionQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
1199
1199
  }) : void 0);
1200
1200
  this.#apiName = queryDef.apiName;
@@ -1228,7 +1228,7 @@ var FunctionQuery = class extends Query {
1228
1228
  }).debug("calling _fetchAndStore");
1229
1229
  }
1230
1230
  try {
1231
- const result = await chunk62RUUOW2_cjs.applyQuery(this.store.client[chunk4HXJEKQT_cjs.additionalContext], this.#queryDef, this.#params);
1231
+ const result = await chunkZFL7RPT6_cjs.applyQuery(this.store.client[chunkVVKEXIIO_cjs.additionalContext], this.#queryDef, this.#params);
1232
1232
  const executedAt = Date.now();
1233
1233
  this.store.batch({}, (batch) => {
1234
1234
  this.writeToStore({
@@ -2324,7 +2324,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
2324
2324
  batch.changes.modified.add(this.cacheKey);
2325
2325
  }
2326
2326
  constructor(store, subject, cacheKey, opts) {
2327
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
2327
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
2328
2328
  msgPrefix: `SpecificLinkQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
2329
2329
  }) : void 0);
2330
2330
  [this.#sourceApiName, this.#sourcePk, this.#linkName, this.#whereClause, this.#orderBy] = cacheKey.otherKeys;
@@ -2340,7 +2340,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
2340
2340
  type: "object",
2341
2341
  apiName: this.#sourceApiName
2342
2342
  };
2343
- const sourceMetadata = await client[chunk4HXJEKQT_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
2343
+ const sourceMetadata = await client[chunkVVKEXIIO_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
2344
2344
  if (this.#orderBy && Object.keys(this.#orderBy).length > 0) {
2345
2345
  const linkDef = sourceMetadata.links?.[this.#linkName];
2346
2346
  if (!linkDef?.targetType) {
@@ -2411,7 +2411,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
2411
2411
  return this.revalidate(true);
2412
2412
  } else {
2413
2413
  return (async () => {
2414
- const sourceMetadata = await this.store.client[chunk4HXJEKQT_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
2414
+ const sourceMetadata = await this.store.client[chunkVVKEXIIO_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
2415
2415
  const linkDef = sourceMetadata.links?.[this.#linkName];
2416
2416
  if (!linkDef || linkDef.targetType !== objectType) return;
2417
2417
  const promise = this.revalidate(true);
@@ -2719,7 +2719,7 @@ var ListQuery = class extends BaseListQuery {
2719
2719
  batch.changes.registerList(this.cacheKey);
2720
2720
  }
2721
2721
  constructor(store, subject, apiName, cacheKey, opts) {
2722
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
2722
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
2723
2723
  msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
2724
2724
  }) : void 0);
2725
2725
  this.apiName = apiName;
@@ -2757,10 +2757,10 @@ var ListQuery = class extends BaseListQuery {
2757
2757
  */
2758
2758
  async fetchPageData(signal) {
2759
2759
  if (Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
2760
- const wireObjectSet = chunk4HXJEKQT_cjs.getWireObjectSet(this.#objectSet);
2760
+ const wireObjectSet = chunkVVKEXIIO_cjs.getWireObjectSet(this.#objectSet);
2761
2761
  const {
2762
2762
  resultType
2763
- } = await getObjectTypesThatInvalidate(this.store.client[chunk4HXJEKQT_cjs.additionalContext], wireObjectSet);
2763
+ } = await getObjectTypesThatInvalidate(this.store.client[chunkVVKEXIIO_cjs.additionalContext], wireObjectSet);
2764
2764
  this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#orderBy);
2765
2765
  }
2766
2766
  const resp = await this.#objectSet.fetchPage({
@@ -3019,7 +3019,7 @@ var InterfaceListQuery = class extends ListQuery {
3019
3019
  }
3020
3020
  extractRelevantObjects(changes) {
3021
3021
  const matchesApiName = ([, object]) => {
3022
- return this.apiName in object[chunk62RUUOW2_cjs.ObjectDefRef].interfaceMap;
3022
+ return this.apiName in object[chunkZFL7RPT6_cjs.ObjectDefRef].interfaceMap;
3023
3023
  };
3024
3024
  const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
3025
3025
  const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
@@ -3207,8 +3207,8 @@ function stripRdpFields(value, rdpFields) {
3207
3207
  if (rdpFields.size === 0) {
3208
3208
  return value;
3209
3209
  }
3210
- const underlying = value[chunk62RUUOW2_cjs.UnderlyingOsdkObject];
3211
- const objectDef = value[chunk62RUUOW2_cjs.ObjectDefRef];
3210
+ const underlying = value[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
3211
+ const objectDef = value[chunkZFL7RPT6_cjs.ObjectDefRef];
3212
3212
  const newProps = {
3213
3213
  $apiName: underlying.$apiName,
3214
3214
  $objectType: underlying.$objectType,
@@ -3220,7 +3220,7 @@ function stripRdpFields(value, rdpFields) {
3220
3220
  newProps[key] = underlying[key];
3221
3221
  }
3222
3222
  }
3223
- return chunk62RUUOW2_cjs.createOsdkObject(value[chunk62RUUOW2_cjs.ClientRef], objectDef, newProps);
3223
+ return chunkZFL7RPT6_cjs.createOsdkObject(value[chunkZFL7RPT6_cjs.ClientRef], objectDef, newProps);
3224
3224
  }
3225
3225
  function isSuperset(superset, subset) {
3226
3226
  for (const field of subset) {
@@ -3231,8 +3231,8 @@ function isSuperset(superset, subset) {
3231
3231
  return true;
3232
3232
  }
3233
3233
  function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
3234
- const underlying = value[chunk62RUUOW2_cjs.UnderlyingOsdkObject];
3235
- const objectDef = value[chunk62RUUOW2_cjs.ObjectDefRef];
3234
+ const underlying = value[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
3235
+ const objectDef = value[chunkZFL7RPT6_cjs.ObjectDefRef];
3236
3236
  const newProps = {
3237
3237
  $apiName: underlying.$apiName,
3238
3238
  $objectType: underlying.$objectType,
@@ -3247,7 +3247,7 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
3247
3247
  }
3248
3248
  }
3249
3249
  }
3250
- return chunk62RUUOW2_cjs.createOsdkObject(value[chunk62RUUOW2_cjs.ClientRef], objectDef, newProps);
3250
+ return chunkZFL7RPT6_cjs.createOsdkObject(value[chunkZFL7RPT6_cjs.ClientRef], objectDef, newProps);
3251
3251
  }
3252
3252
  function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
3253
3253
  if (targetRdpFields.size === 0) {
@@ -3259,8 +3259,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
3259
3259
  }
3260
3260
  return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
3261
3261
  }
3262
- const sourceUnderlying = sourceValue[chunk62RUUOW2_cjs.UnderlyingOsdkObject];
3263
- const objectDef = sourceValue[chunk62RUUOW2_cjs.ObjectDefRef];
3262
+ const sourceUnderlying = sourceValue[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
3263
+ const objectDef = sourceValue[chunkZFL7RPT6_cjs.ObjectDefRef];
3264
3264
  const newProps = {
3265
3265
  $apiName: sourceUnderlying.$apiName,
3266
3266
  $objectType: sourceUnderlying.$objectType,
@@ -3273,14 +3273,14 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
3273
3273
  }
3274
3274
  }
3275
3275
  if (targetCurrentValue) {
3276
- const targetUnderlying = targetCurrentValue[chunk62RUUOW2_cjs.UnderlyingOsdkObject];
3276
+ const targetUnderlying = targetCurrentValue[chunkZFL7RPT6_cjs.UnderlyingOsdkObject];
3277
3277
  for (const field of targetRdpFields) {
3278
3278
  if (!sourceRdpFields.has(field) && field in targetUnderlying) {
3279
3279
  newProps[field] = targetUnderlying[field];
3280
3280
  }
3281
3281
  }
3282
3282
  }
3283
- return chunk62RUUOW2_cjs.createOsdkObject(sourceValue[chunk62RUUOW2_cjs.ClientRef], objectDef, newProps);
3283
+ return chunkZFL7RPT6_cjs.createOsdkObject(sourceValue[chunkZFL7RPT6_cjs.ClientRef], objectDef, newProps);
3284
3284
  }
3285
3285
 
3286
3286
  // src/observable/internal/object/ObjectCacheKeyRegistry.ts
@@ -3415,7 +3415,7 @@ var BulkObjectLoader = class {
3415
3415
  #maxEntries;
3416
3416
  constructor(client, maxWait = 25, maxEntries = 100) {
3417
3417
  this.#client = client;
3418
- this.#logger = client[chunk4HXJEKQT_cjs.additionalContext].logger;
3418
+ this.#logger = client[chunkVVKEXIIO_cjs.additionalContext].logger;
3419
3419
  this.#maxWait = maxWait;
3420
3420
  this.#maxEntries = maxEntries;
3421
3421
  }
@@ -3483,7 +3483,7 @@ var ObjectQuery = class extends Query {
3483
3483
  #apiName;
3484
3484
  #pk;
3485
3485
  constructor(store, subject, type, pk, cacheKey, opts) {
3486
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
3486
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
3487
3487
  msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
3488
3488
  }) : void 0);
3489
3489
  this.#apiName = type;
@@ -3631,7 +3631,7 @@ var ObjectSetQuery = class extends BaseListQuery {
3631
3631
  #composedObjectSet;
3632
3632
  #objectTypes;
3633
3633
  constructor(store, subject, baseObjectSetWire, operations, cacheKey, opts) {
3634
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
3634
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
3635
3635
  msgPrefix: `ObjectSetQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
3636
3636
  }) : void 0);
3637
3637
  this.#baseObjectSetWire = baseObjectSetWire;
@@ -3676,7 +3676,7 @@ var ObjectSetQuery = class extends BaseListQuery {
3676
3676
  }
3677
3677
  if (opts.union) {
3678
3678
  for (const os of opts.union) {
3679
- const wire = chunk4HXJEKQT_cjs.getWireObjectSet(os);
3679
+ const wire = chunkVVKEXIIO_cjs.getWireObjectSet(os);
3680
3680
  if (wire.type) {
3681
3681
  types.add(wire.type);
3682
3682
  }
@@ -3684,7 +3684,7 @@ var ObjectSetQuery = class extends BaseListQuery {
3684
3684
  }
3685
3685
  if (opts.intersect) {
3686
3686
  for (const os of opts.intersect) {
3687
- const wire = chunk4HXJEKQT_cjs.getWireObjectSet(os);
3687
+ const wire = chunkVVKEXIIO_cjs.getWireObjectSet(os);
3688
3688
  if (wire.type) {
3689
3689
  types.add(wire.type);
3690
3690
  }
@@ -3692,7 +3692,7 @@ var ObjectSetQuery = class extends BaseListQuery {
3692
3692
  }
3693
3693
  if (opts.subtract) {
3694
3694
  for (const os of opts.subtract) {
3695
- const wire = chunk4HXJEKQT_cjs.getWireObjectSet(os);
3695
+ const wire = chunkVVKEXIIO_cjs.getWireObjectSet(os);
3696
3696
  if (wire.type) {
3697
3697
  types.add(wire.type);
3698
3698
  }
@@ -3712,10 +3712,10 @@ var ObjectSetQuery = class extends BaseListQuery {
3712
3712
  */
3713
3713
  async fetchPageData(signal) {
3714
3714
  if (this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
3715
- const wireObjectSet = chunk4HXJEKQT_cjs.getWireObjectSet(this.#composedObjectSet);
3715
+ const wireObjectSet = chunkVVKEXIIO_cjs.getWireObjectSet(this.#composedObjectSet);
3716
3716
  const {
3717
3717
  resultType
3718
- } = await getObjectTypesThatInvalidate(this.store.client[chunk4HXJEKQT_cjs.additionalContext], wireObjectSet);
3718
+ } = await getObjectTypesThatInvalidate(this.store.client[chunkVVKEXIIO_cjs.additionalContext], wireObjectSet);
3719
3719
  this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#operations.orderBy);
3720
3720
  }
3721
3721
  const resp = await this.#composedObjectSet.fetchPage({
@@ -3780,7 +3780,7 @@ var ObjectSetHelper = class extends AbstractHelper {
3780
3780
  const {
3781
3781
  baseObjectSet
3782
3782
  } = options;
3783
- const baseObjectSetWire = JSON.stringify(chunk4HXJEKQT_cjs.getWireObjectSet(baseObjectSet));
3783
+ const baseObjectSetWire = JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(baseObjectSet));
3784
3784
  const operations = this.buildCanonicalizedOperations(options);
3785
3785
  const objectSetCacheKey = this.cacheKeys.get("objectSet", baseObjectSetWire, operations);
3786
3786
  return this.store.queries.get(objectSetCacheKey, () => {
@@ -3796,13 +3796,13 @@ var ObjectSetHelper = class extends AbstractHelper {
3796
3796
  operations.withProperties = Object.keys(options.withProperties).sort();
3797
3797
  }
3798
3798
  if (options.union && options.union.length > 0) {
3799
- operations.union = options.union.map((os) => JSON.stringify(chunk4HXJEKQT_cjs.getWireObjectSet(os)));
3799
+ operations.union = options.union.map((os) => JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(os)));
3800
3800
  }
3801
3801
  if (options.intersect && options.intersect.length > 0) {
3802
- operations.intersect = options.intersect.map((os) => JSON.stringify(chunk4HXJEKQT_cjs.getWireObjectSet(os)));
3802
+ operations.intersect = options.intersect.map((os) => JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(os)));
3803
3803
  }
3804
3804
  if (options.subtract && options.subtract.length > 0) {
3805
- operations.subtract = options.subtract.map((os) => JSON.stringify(chunk4HXJEKQT_cjs.getWireObjectSet(os)));
3805
+ operations.subtract = options.subtract.map((os) => JSON.stringify(chunkVVKEXIIO_cjs.getWireObjectSet(os)));
3806
3806
  }
3807
3807
  if (options.pivotTo) {
3808
3808
  operations.pivotTo = options.pivotTo;
@@ -3874,7 +3874,7 @@ var RdpCanonicalizer = class extends CachingCanonicalizer {
3874
3874
  apiName: "__rdp_canonicalizer_holder__"
3875
3875
  };
3876
3876
  for (const [key, rdpFunction] of Object.entries(rdp)) {
3877
- const builder = chunk4HXJEKQT_cjs.createWithPropertiesObjectSet(
3877
+ const builder = chunkVVKEXIIO_cjs.createWithPropertiesObjectSet(
3878
3878
  objectTypeHolder,
3879
3879
  {
3880
3880
  type: "methodInput"
@@ -3925,7 +3925,7 @@ var Store = class {
3925
3925
  subjects = this.layers.subjects;
3926
3926
  // these are hopefully temporary
3927
3927
  constructor(client) {
3928
- this.logger = client[chunk4HXJEKQT_cjs.additionalContext].logger?.child({}, {
3928
+ this.logger = client[chunkVVKEXIIO_cjs.additionalContext].logger?.child({}, {
3929
3929
  msgPrefix: "Store"
3930
3930
  });
3931
3931
  this.client = client;
@@ -4198,10 +4198,10 @@ var Store = class {
4198
4198
 
4199
4199
  // src/observable/ObservableClient.ts
4200
4200
  function createObservableClient(client) {
4201
- const tweakedClient = chunk62RUUOW2_cjs.createClientFromContext({
4202
- ...client[chunk4HXJEKQT_cjs.additionalContext],
4203
- fetch: shared_net_fetch.createFetchHeaderMutator(client[chunk4HXJEKQT_cjs.additionalContext].fetch, (headers) => {
4204
- headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunk62RUUOW2_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
4201
+ const tweakedClient = chunkZFL7RPT6_cjs.createClientFromContext({
4202
+ ...client[chunkVVKEXIIO_cjs.additionalContext],
4203
+ fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkVVKEXIIO_cjs.additionalContext].fetch, (headers) => {
4204
+ headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkZFL7RPT6_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
4205
4205
  return headers;
4206
4206
  })
4207
4207
  });
@@ -4245,11 +4245,11 @@ function getOsdkConfig(ontologyRid) {
4245
4245
 
4246
4246
  Object.defineProperty(exports, "createClientWithTransaction", {
4247
4247
  enumerable: true,
4248
- get: function () { return chunk62RUUOW2_cjs.createClientWithTransaction; }
4248
+ get: function () { return chunkZFL7RPT6_cjs.createClientWithTransaction; }
4249
4249
  });
4250
4250
  Object.defineProperty(exports, "augment", {
4251
4251
  enumerable: true,
4252
- get: function () { return chunk4HXJEKQT_cjs.augment; }
4252
+ get: function () { return chunkVVKEXIIO_cjs.augment; }
4253
4253
  });
4254
4254
  exports.computeObjectSetCacheKey = computeObjectSetCacheKey;
4255
4255
  exports.createObservableClient = createObservableClient;
@@ -106,16 +106,21 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
106
106
  }
107
107
  const firstKey = keysOfFilter[0];
108
108
  !(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
109
-
110
- // Struct array
111
109
  if (firstKey === "$contains" && filter[firstKey] instanceof Object) {
112
- const structFilter = Object.entries(filter[firstKey]);
113
- !(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant(false) : void 0;
114
- const structFieldApiName = structFilter[0][0];
115
- return handleWherePair(structFilter[0], objectOrInterface, {
116
- propertyApiName: fieldName,
117
- structFieldApiName
118
- });
110
+ const containsValue = filter[firstKey];
111
+ const containsKeys = Object.keys(containsValue);
112
+ const isFilterObject = containsKeys.some(key => key.startsWith("$"));
113
+ if (isFilterObject) {
114
+ return handleWherePair([fieldName, containsValue], objectOrInterface, structFieldSelector, rdpNames);
115
+ } else {
116
+ const structFilter = Object.entries(containsValue);
117
+ !(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant(false) : void 0;
118
+ const structFieldApiName = structFilter[0][0];
119
+ return handleWherePair(structFilter[0], objectOrInterface, {
120
+ propertyApiName: fieldName,
121
+ structFieldApiName
122
+ });
123
+ }
119
124
  }
120
125
  if (firstKey === "$ne") {
121
126
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"modernToLegacyWhereClause.js","names":["invariant","fullyQualifyPropName","makeGeoFilterIntersects","makeGeoFilterWithin","isAndClause","whereClause","$and","undefined","isOrClause","$or","isNotClause","$not","modernToLegacyWhereClause","objectOrInterface","rdpNames","parts","Object","entries","map","key","value","length","modernToLegacyWhereClauseInner","type","v","process","env","NODE_ENV","clause","handleWherePair","fieldName","filter","structFieldSelector","isRdp","has","propertyIdentifier","apiName","propertyApiName","field","keysOfFilter","keys","hasDollarSign","some","startsWith","structFilter","structFieldApiName","firstKey","substring","fuzzy"],"sources":["modernToLegacyWhereClause.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AndWhereClause,\n NotWhereClause,\n ObjectOrInterfaceDefinition,\n OrWhereClause,\n PossibleWhereClauseFilters,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\n\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { fullyQualifyPropName } from \"./fullyQualifyPropName.js\";\nimport { makeGeoFilterIntersects } from \"./makeGeoFilterIntersects.js\";\nimport { makeGeoFilterWithin } from \"./makeGeoFilterWithin.js\";\n\ntype DropDollarSign<T extends `$${string}`> = T extends `$${infer U}` ? U\n : never;\n\nfunction isAndClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is AndWhereClause<T, RDPs> {\n return \"$and\" in whereClause && whereClause.$and !== undefined;\n}\n\nfunction isOrClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is OrWhereClause<T, RDPs> {\n return \"$or\" in whereClause && whereClause.$or !== undefined;\n}\n\nfunction isNotClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is NotWhereClause<T, RDPs> {\n return \"$not\" in whereClause && whereClause.$not !== undefined;\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause).map(([key, value]) => ({\n [key]: value,\n })) as WhereClause<T, RDPs>[];\n if (parts.length === 1) {\n return modernToLegacyWhereClauseInner(\n whereClause,\n objectOrInterface,\n rdpNames,\n );\n }\n return {\n type: \"and\",\n value: parts.map<SearchJsonQueryV2>(\n v => modernToLegacyWhereClauseInner(v, objectOrInterface, rdpNames),\n ),\n };\n}\n\n/** @internal */\nexport function modernToLegacyWhereClauseInner<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause);\n\n invariant(parts.length === 1, \"Invalid where clause provided.\");\n\n if (isAndClause(whereClause)) {\n return {\n type: \"and\",\n value: (whereClause.$and as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isOrClause(whereClause)) {\n return {\n type: \"or\",\n value: (whereClause.$or as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isNotClause(whereClause)) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(\n whereClause.$not as WhereClause<T, RDPs>,\n objectOrInterface,\n rdpNames,\n ),\n };\n }\n\n return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);\n}\n\nfunction handleWherePair(\n [fieldName, filter]: [string, any],\n objectOrInterface: ObjectOrInterfaceDefinition,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n invariant(\n filter != null,\n \"Defined key values are only allowed when they are not undefined.\",\n );\n\n const isRdp = !structFieldSelector && rdpNames?.has(fieldName);\n\n const propertyIdentifier: PropertyIdentifier | undefined = isRdp\n ? {\n type: \"property\",\n apiName: fieldName,\n }\n : structFieldSelector != null\n ? {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(\n structFieldSelector.propertyApiName,\n objectOrInterface,\n ),\n }\n : undefined;\n\n const field = !isRdp && structFieldSelector == null\n ? fullyQualifyPropName(fieldName, objectOrInterface)\n : undefined;\n\n invariant(\n field == null\n || propertyIdentifier == null && (field != null || isRdp != null),\n \"Encountered error constructing where clause: field and propertyIdentifier cannot both be defined\",\n );\n\n if (\n typeof filter === \"string\" || typeof filter === \"number\"\n || typeof filter === \"boolean\"\n ) {\n return {\n type: \"eq\",\n ...(propertyIdentifier != null\n && { propertyIdentifier }),\n field,\n value: filter,\n };\n }\n\n const keysOfFilter = Object.keys(filter);\n\n // If any of the keys start with `$` then they must be the only one.\n // e.g. `where({ name: { $eq: \"foo\", $ne: \"bar\" } })` is invalid currently\n const hasDollarSign = keysOfFilter.some((key) => key.startsWith(\"$\"));\n invariant(\n !hasDollarSign\n || keysOfFilter.length === 1,\n \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\",\n );\n\n // Struct\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(Object.entries(filter)[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n }, rdpNames);\n }\n\n const firstKey = keysOfFilter[0] as PossibleWhereClauseFilters;\n invariant(filter[firstKey] != null);\n\n // Struct array\n if (firstKey === \"$contains\" && filter[firstKey] instanceof Object) {\n const structFilter: [string, any][] = Object.entries(filter[firstKey]);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = structFilter[0][0];\n\n return handleWherePair(structFilter[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n });\n }\n\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n },\n };\n }\n\n if (firstKey === \"$within\") {\n return makeGeoFilterWithin(filter[firstKey], propertyIdentifier, field);\n }\n if (firstKey === \"$intersects\") {\n return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);\n }\n\n if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: typeof filter[firstKey] === \"string\"\n ? filter[firstKey]\n : filter[firstKey][\"term\"],\n fuzzy: typeof filter[firstKey] === \"string\"\n ? false\n : filter[firstKey][\"fuzzySearch\"] ?? false,\n };\n }\n\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey] as any,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;A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,IAAI,IAAI;UAAEA;QAAmB,CAAC,CAAC;QACzDG,KAAK;QACLlB,KAAK,EAAEW,MAAM,CAACe,QAAQ;MACxB;IACF,CAAC;EACH;EAEA,IAAIA,QAAQ,KAAK,SAAS,EAAE;IAC1B,OAAO3C,mBAAmB,CAAC4B,MAAM,CAACe,QAAQ,CAAC,EAAEX,kBAAkB,EAAEG,KAAK,CAAC;EACzE;EACA,IAAIQ,QAAQ,KAAK,aAAa,EAAE;IAC9B,OAAO5C,uBAAuB,CAAC6B,MAAM,CAACe,QAAQ,CAAC,EAAEX,kBAAkB,EAAEG,KAAK,CAAC;EAC7E;EAEA,IAAIQ,QAAQ,KAAK,mBAAmB,IAAIA,QAAQ,KAAK,kBAAkB,EAAE;IACvE,OAAO;MACLvB,IAAI,EAAEuB,QAAQ,CAACC,SAAS,CAAC,CAAC,CAAoC;MAC9D,IAAIZ,kBAAkB,IAAI,IAAI,IAAI;QAAEA;MAAmB,CAAC,CAAC;MACzDG,KAAK;MACLlB,KAAK,EAAE,OAAOW,MAAM,CAACe,QAAQ,CAAC,KAAK,QAAQ,GACvCf,MAAM,CAACe,QAAQ,CAAC,GAChBf,MAAM,CAACe,QAAQ,CAAC,CAAC,MAAM,CAAC;MAC5BE,KAAK,EAAE,OAAOjB,MAAM,CAACe,QAAQ,CAAC,KAAK,QAAQ,GACvC,KAAK,GACLf,MAAM,CAACe,QAAQ,CAAC,CAAC,aAAa,CAAC,IAAI;IACzC,CAAC;EACH;EAEA,OAAO;IACLvB,IAAI,EAAEuB,QAAQ,CAACC,SAAS,CAAC,CAAC,CAAoC;IAC9D,IAAIZ,kBAAkB,IAAI,IAAI,IAAI;MAAEA;IAAmB,CAAC,CAAC;IACzDG,KAAK;IACLlB,KAAK,EAAEW,MAAM,CAACe,QAAQ;EACxB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"modernToLegacyWhereClause.js","names":["invariant","fullyQualifyPropName","makeGeoFilterIntersects","makeGeoFilterWithin","isAndClause","whereClause","$and","undefined","isOrClause","$or","isNotClause","$not","modernToLegacyWhereClause","objectOrInterface","rdpNames","parts","Object","entries","map","key","value","length","modernToLegacyWhereClauseInner","type","v","process","env","NODE_ENV","clause","handleWherePair","fieldName","filter","structFieldSelector","isRdp","has","propertyIdentifier","apiName","propertyApiName","field","keysOfFilter","keys","hasDollarSign","some","startsWith","structFilter","structFieldApiName","firstKey","containsValue","containsKeys","isFilterObject","substring","fuzzy"],"sources":["modernToLegacyWhereClause.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AndWhereClause,\n NotWhereClause,\n ObjectOrInterfaceDefinition,\n OrWhereClause,\n PossibleWhereClauseFilters,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\n\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { fullyQualifyPropName } from \"./fullyQualifyPropName.js\";\nimport { makeGeoFilterIntersects } from \"./makeGeoFilterIntersects.js\";\nimport { makeGeoFilterWithin } from \"./makeGeoFilterWithin.js\";\n\ntype DropDollarSign<T extends `$${string}`> = T extends `$${infer U}` ? U\n : never;\n\nfunction isAndClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is AndWhereClause<T, RDPs> {\n return \"$and\" in whereClause && whereClause.$and !== undefined;\n}\n\nfunction isOrClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is OrWhereClause<T, RDPs> {\n return \"$or\" in whereClause && whereClause.$or !== undefined;\n}\n\nfunction isNotClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n): whereClause is NotWhereClause<T, RDPs> {\n return \"$not\" in whereClause && whereClause.$not !== undefined;\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause).map(([key, value]) => ({\n [key]: value,\n })) as WhereClause<T, RDPs>[];\n if (parts.length === 1) {\n return modernToLegacyWhereClauseInner(\n whereClause,\n objectOrInterface,\n rdpNames,\n );\n }\n return {\n type: \"and\",\n value: parts.map<SearchJsonQueryV2>(\n v => modernToLegacyWhereClauseInner(v, objectOrInterface, rdpNames),\n ),\n };\n}\n\n/** @internal */\nexport function modernToLegacyWhereClauseInner<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause);\n\n invariant(parts.length === 1, \"Invalid where clause provided.\");\n\n if (isAndClause(whereClause)) {\n return {\n type: \"and\",\n value: (whereClause.$and as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isOrClause(whereClause)) {\n return {\n type: \"or\",\n value: (whereClause.$or as WhereClause<T, RDPs>[]).map(\n (clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isNotClause(whereClause)) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(\n whereClause.$not as WhereClause<T, RDPs>,\n objectOrInterface,\n rdpNames,\n ),\n };\n }\n\n return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);\n}\n\nfunction handleWherePair(\n [fieldName, filter]: [string, any],\n objectOrInterface: ObjectOrInterfaceDefinition,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n invariant(\n filter != null,\n \"Defined key values are only allowed when they are not undefined.\",\n );\n\n const isRdp = !structFieldSelector && rdpNames?.has(fieldName);\n\n const propertyIdentifier: PropertyIdentifier | undefined = isRdp\n ? {\n type: \"property\",\n apiName: fieldName,\n }\n : structFieldSelector != null\n ? {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(\n structFieldSelector.propertyApiName,\n objectOrInterface,\n ),\n }\n : undefined;\n\n const field = !isRdp && structFieldSelector == null\n ? fullyQualifyPropName(fieldName, objectOrInterface)\n : undefined;\n\n invariant(\n field == null\n || propertyIdentifier == null && (field != null || isRdp != null),\n \"Encountered error constructing where clause: field and propertyIdentifier cannot both be defined\",\n );\n\n if (\n typeof filter === \"string\" || typeof filter === \"number\"\n || typeof filter === \"boolean\"\n ) {\n return {\n type: \"eq\",\n ...(propertyIdentifier != null\n && { propertyIdentifier }),\n field,\n value: filter,\n };\n }\n\n const keysOfFilter = Object.keys(filter);\n\n // If any of the keys start with `$` then they must be the only one.\n // e.g. `where({ name: { $eq: \"foo\", $ne: \"bar\" } })` is invalid currently\n const hasDollarSign = keysOfFilter.some((key) => key.startsWith(\"$\"));\n invariant(\n !hasDollarSign\n || keysOfFilter.length === 1,\n \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\",\n );\n\n // Struct\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(Object.entries(filter)[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n }, rdpNames);\n }\n\n const firstKey = keysOfFilter[0] as PossibleWhereClauseFilters;\n invariant(filter[firstKey] != null);\n\n if (firstKey === \"$contains\" && filter[firstKey] instanceof Object) {\n const containsValue = filter[firstKey];\n const containsKeys = Object.keys(containsValue);\n\n const isFilterObject = containsKeys.some(key => key.startsWith(\"$\"));\n\n if (isFilterObject) {\n return handleWherePair(\n [fieldName, containsValue],\n objectOrInterface,\n structFieldSelector,\n rdpNames,\n );\n } else {\n const structFilter: [string, any][] = Object.entries(containsValue);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = structFilter[0][0];\n\n return handleWherePair(structFilter[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n });\n }\n }\n\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n },\n };\n }\n\n if (firstKey === \"$within\") {\n return makeGeoFilterWithin(filter[firstKey], propertyIdentifier, field);\n }\n if (firstKey === \"$intersects\") {\n return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);\n }\n\n if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: typeof filter[firstKey] === \"string\"\n ? filter[firstKey]\n : filter[firstKey][\"term\"],\n fuzzy: typeof filter[firstKey] === \"string\"\n ? false\n : filter[firstKey][\"fuzzySearch\"] ?? false,\n };\n }\n\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey] as any,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;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