@osdk/client 2.26.0 → 2.27.0

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/build/browser/Client.js +1 -1
  3. package/build/browser/Client.js.map +1 -1
  4. package/build/browser/scenarios/ScenarioClient.js +10 -4
  5. package/build/browser/scenarios/ScenarioClient.js.map +1 -1
  6. package/build/browser/scenarios/createScenario.js +3 -1
  7. package/build/browser/scenarios/createScenario.js.map +1 -1
  8. package/build/browser/util/UserAgent.js +2 -2
  9. package/build/cjs/MediaReferenceProperty-SYUA2YYQ.cjs +22 -0
  10. package/build/cjs/{MediaReferenceProperty-CBPMMD73.cjs.map → MediaReferenceProperty-SYUA2YYQ.cjs.map} +1 -1
  11. package/build/cjs/{applyStreamingQuery-US6OU3WN.cjs → applyStreamingQuery-ZUGQCOWE.cjs} +13 -13
  12. package/build/cjs/{applyStreamingQuery-US6OU3WN.cjs.map → applyStreamingQuery-ZUGQCOWE.cjs.map} +1 -1
  13. package/build/cjs/{chunk-GVKJAORH.cjs → chunk-5QXHJGSL.cjs} +75 -75
  14. package/build/cjs/{chunk-GVKJAORH.cjs.map → chunk-5QXHJGSL.cjs.map} +1 -1
  15. package/build/cjs/{chunk-YP43NHIA.cjs → chunk-AN2R7X5W.cjs} +7 -7
  16. package/build/cjs/{chunk-YP43NHIA.cjs.map → chunk-AN2R7X5W.cjs.map} +1 -1
  17. package/build/cjs/{chunk-D26YLHTV.cjs → chunk-H6PXPU6F.cjs} +2 -2
  18. package/build/cjs/{chunk-D26YLHTV.cjs.map → chunk-H6PXPU6F.cjs.map} +1 -1
  19. package/build/cjs/{chunk-ZFNHWPQA.cjs → chunk-HRWHTCP3.cjs} +23 -23
  20. package/build/cjs/{chunk-ZFNHWPQA.cjs.map → chunk-HRWHTCP3.cjs.map} +1 -1
  21. package/build/cjs/{chunk-W2AWD4AH.cjs → chunk-SVB5K454.cjs} +93 -87
  22. package/build/cjs/chunk-SVB5K454.cjs.map +1 -0
  23. package/build/cjs/{chunk-CAUXOFUO.cjs → chunk-YLVUONG3.cjs} +16 -16
  24. package/build/cjs/chunk-YLVUONG3.cjs.map +1 -0
  25. package/build/cjs/{chunk-42JVCEPG.cjs → chunk-YRGYLMU5.cjs} +18 -18
  26. package/build/cjs/{chunk-42JVCEPG.cjs.map → chunk-YRGYLMU5.cjs.map} +1 -1
  27. package/build/cjs/index.cjs +14 -14
  28. package/build/cjs/public/experimental.cjs +9 -9
  29. package/build/cjs/public/internal.cjs +9 -9
  30. package/build/cjs/public/observable.cjs +8 -8
  31. package/build/cjs/public/unstable-do-not-use.cjs +20 -18
  32. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  33. package/build/cjs/{transformAndWaitInternal-2GORZXPK.cjs → transformAndWaitInternal-JGUDGNDJ.cjs} +7 -7
  34. package/build/cjs/{transformAndWaitInternal-2GORZXPK.cjs.map → transformAndWaitInternal-JGUDGNDJ.cjs.map} +1 -1
  35. package/build/esm/Client.js +1 -1
  36. package/build/esm/Client.js.map +1 -1
  37. package/build/esm/scenarios/ScenarioClient.js +10 -4
  38. package/build/esm/scenarios/ScenarioClient.js.map +1 -1
  39. package/build/esm/scenarios/createScenario.js +3 -1
  40. package/build/esm/scenarios/createScenario.js.map +1 -1
  41. package/build/esm/util/UserAgent.js +2 -2
  42. package/build/types/Client.d.ts +1 -1
  43. package/package.json +12 -12
  44. package/build/cjs/MediaReferenceProperty-CBPMMD73.cjs +0 -22
  45. package/build/cjs/chunk-CAUXOFUO.cjs.map +0 -1
  46. package/build/cjs/chunk-W2AWD4AH.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkZFNHWPQA_cjs = require('./chunk-ZFNHWPQA.cjs');
4
- var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
3
+ var chunkHRWHTCP3_cjs = require('./chunk-HRWHTCP3.cjs');
4
+ var chunkH6PXPU6F_cjs = require('./chunk-H6PXPU6F.cjs');
5
5
  var shared_client_impl = require('@osdk/shared.client.impl');
6
6
  var shared_net_fetch = require('@osdk/shared.net.fetch');
7
7
  var invariant5 = require('tiny-invariant');
@@ -32,26 +32,26 @@ var augmentRequestContext = (client, augment2) => ({
32
32
  }
33
33
  });
34
34
 
35
- // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
35
+ // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
36
36
  var _createTemporary = [1, "/v2/ontologies/{0}/objectSets/createTemporary", 7];
37
37
  function createTemporary($ctx, ...args) {
38
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _createTemporary, ...args);
38
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _createTemporary, ...args);
39
39
  }
40
40
  var _load = [1, "/v2/ontologies/{0}/objectSets/loadObjects", 7];
41
41
  function load($ctx, ...args) {
42
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _load, ...args);
42
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _load, ...args);
43
43
  }
44
44
  var _loadMultipleObjectTypes = [1, "/v2/ontologies/{0}/objectSets/loadObjectsMultipleObjectTypes", 7];
45
45
  function loadMultipleObjectTypes($ctx, ...args) {
46
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _loadMultipleObjectTypes, ...args);
46
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _loadMultipleObjectTypes, ...args);
47
47
  }
48
48
  var _aggregate = [1, "/v2/ontologies/{0}/objectSets/aggregate", 7];
49
49
  function aggregate($ctx, ...args) {
50
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _aggregate, ...args);
50
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _aggregate, ...args);
51
51
  }
52
52
  var _loadLinks = [1, "/v2/ontologies/{0}/objectSets/loadLinks", 7];
53
53
  function loadLinks($ctx, ...args) {
54
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _loadLinks, ...args);
54
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _loadLinks, ...args);
55
55
  }
56
56
 
57
57
  // src/internal/conversions/extractNamespace.ts
@@ -1485,7 +1485,7 @@ function isTextQuery(query) {
1485
1485
  return typeof query === "string";
1486
1486
  }
1487
1487
 
1488
- // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
1488
+ // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
1489
1489
  var _upload = [1, "/v2/ontologies/attachments/upload", 7, "*/*"];
1490
1490
  function upload($ctx, ...args) {
1491
1491
  const headerParams = {
@@ -1493,15 +1493,15 @@ function upload($ctx, ...args) {
1493
1493
  "Content-Type": args[2]?.["Content-Type"] ?? args[0].type,
1494
1494
  "Content-Length": args[0].size.toString()
1495
1495
  };
1496
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _upload, args[0], args[1], headerParams);
1496
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _upload, args[0], args[1], headerParams);
1497
1497
  }
1498
1498
  var _read = [0, "/v2/ontologies/attachments/{0}/content", , , "*/*"];
1499
1499
  function read($ctx, ...args) {
1500
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _read, ...args);
1500
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _read, ...args);
1501
1501
  }
1502
1502
  var _get = [0, "/v2/ontologies/attachments/{0}"];
1503
1503
  function get($ctx, ...args) {
1504
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _get, ...args);
1504
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _get, ...args);
1505
1505
  }
1506
1506
 
1507
1507
  // src/Client.ts
@@ -1537,14 +1537,14 @@ function createMediaFromReferenceInternal(client, mediaReference) {
1537
1537
  const token = mediaReference.reference.mediaSetViewItem.token;
1538
1538
  return {
1539
1539
  async fetchContents() {
1540
- return chunkZFNHWPQA_cjs.MediaSet_exports.read(client, mediaSetRid, mediaItemRid, {
1540
+ return chunkHRWHTCP3_cjs.MediaSet_exports.read(client, mediaSetRid, mediaItemRid, {
1541
1541
  preview: true
1542
1542
  }, token ? {
1543
1543
  ReadToken: token
1544
1544
  } : void 0);
1545
1545
  },
1546
1546
  async fetchMetadata() {
1547
- const info = await chunkZFNHWPQA_cjs.MediaSet_exports.info(client, mediaSetRid, mediaItemRid, {
1547
+ const info = await chunkHRWHTCP3_cjs.MediaSet_exports.info(client, mediaSetRid, mediaItemRid, {
1548
1548
  preview: true
1549
1549
  }, token ? {
1550
1550
  ReadToken: token
@@ -1585,5 +1585,5 @@ exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
1585
1585
  exports.isObjectSet = isObjectSet;
1586
1586
  exports.isWireObjectSet = isWireObjectSet;
1587
1587
  exports.upload = upload;
1588
- //# sourceMappingURL=chunk-CAUXOFUO.cjs.map
1589
- //# sourceMappingURL=chunk-CAUXOFUO.cjs.map
1588
+ //# sourceMappingURL=chunk-YLVUONG3.cjs.map
1589
+ //# sourceMappingURL=chunk-YLVUONG3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/util/addUserAgentAndRequestContextHeaders.ts","../../src/util/augmentRequestContext.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js","../../src/internal/conversions/extractNamespace.ts","../../src/util/extractObjectOrInterfaceType.ts","../../src/util/extractRdpDefinition.ts","../../src/util/objectSetUtils.ts","../../src/object/fetchPage.ts","../../src/internal/conversions/fullyQualifyPropName.ts","../../src/internal/conversions/makeGeoFilterBbox.ts","../../src/internal/conversions/makeGeoFilterPolygon.ts","../../src/internal/conversions/makeGeoFilterIntersects.ts","../../src/internal/conversions/makeGeoFilterWithin.ts","../../src/internal/conversions/toIntervalQuery.ts","../../src/internal/conversions/modernToLegacyWhereClause.ts","../../src/derivedProperties/derivedPropertyDefinitionFactory.ts","../../src/derivedProperties/createWithPropertiesObjectSet.ts","../../src/internal/conversions/modernToLegacyAggregationClause.ts","../../src/internal/conversions/legacyToModernSingleAggregationResult.ts","../../src/internal/conversions/modernToLegacyGroupByClause.ts","../../src/object/aggregate.ts","../../src/object/fetchSingle.ts","../../src/util/WireObjectSet.ts","../../src/objectSet/fetchLinksPage.ts","../../src/objectSet/createObjectSet.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js","../../src/Client.ts","../../src/public-utils/hydrateAttachmentFromRid.ts","../../src/createMediaFromReference.ts"],"names":["createFetchHeaderMutator","USER_AGENT_HEADER","augment","foundryPlatformFetch","def","objOrInterfaceDef","linkDef","invariant","objectSets","objectSetTypes","filteredObjectTypes","definitions","DistanceUnitMapping","wrappedObjectSet","selectorResult","DurationMapping","aggregate","PalantirApiError","MediaSet_exports"],"mappings":";;;;;;;;;;;;;;AAkBO,IAAM,oCAAA,GAAuC,CAAC,MAAA,EAAQ,YAAA,MAAkB;AAAA,EAC7E,GAAG,MAAA;AAAA,EACH,KAAA,EAAOA,yCAAA,CAAyB,MAAA,CAAO,KAAA,EAAO,CAAA,OAAA,KAAW;AACvD,IAAA,OAAA,CAAQ,IAAI,wBAAA,EAA0B,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,cAAc,CAAC,CAAA;AAC3E,IAAA,IAAI,aAAa,YAAA,EAAc;AAC7B,MAAA,OAAA,CAAQ,GAAA,CAAIC,sCAAmB,CAAC,OAAA,CAAQ,IAAIA,oCAAiB,CAAA,EAAG,aAAa,YAAA,CAAa,cAAc,EAAE,MAAA,CAAO,CAAA,CAAA,KAAK,KAAK,CAAA,EA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AAC9I,MAAA,EAAE,IAAA,CAAK,QAAA,IAAY,IAAA,CAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,GAAeA,2BAAAA,CAAU,KAAA,EAAO,iCAAiC,CAAA,GAAIA,2BAAAA,CAAU,KAAK,CAAA,GAAI,MAAA;AAC5I,MAAA,OAAO;AAAA,QACL,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,WAAW,IAAA,CAAK,SAAA;AAAA,QAChB,WAAW,IAAA,CAAK;AAAA,OAClB;AAAA,IACF,CAAA;AAAA,IACA,iBAAA,GAAoB;AAClB,MAAA,OAAO,cAAA;AAAA,IACT;AAAA,GACF;AACF","file":"chunk-YLVUONG3.cjs","sourcesContent":["/*\n * Copyright 2024 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 { USER_AGENT_HEADER } from \"@osdk/shared.client.impl\";\nimport { createFetchHeaderMutator } from \"@osdk/shared.net.fetch\";\nexport const addUserAgentAndRequestContextHeaders = (client, withMetadata) => ({\n ...client,\n fetch: createFetchHeaderMutator(client.fetch, headers => {\n headers.set(\"X-OSDK-Request-Context\", JSON.stringify(client.requestContext));\n if (withMetadata.osdkMetadata) {\n headers.set(USER_AGENT_HEADER, [headers.get(USER_AGENT_HEADER), withMetadata.osdkMetadata.extraUserAgent].filter(x => x && x?.length > 0).join(\" \"));\n }\n return headers;\n })\n});","/*\n * Copyright 2024 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\n/**\nReturns a client with its `requestContext` merged with the result of applying\n`augment` to its `requestContext`.\n\nThe second argument is an `Partial<RequestContext>`-returning `augment` function\ninstead of a `RequestContext` object to make referencing the current request\ncontext easier. For example, modifying the `fetchPage` function to add its name\nto the object set's called method chain could look like:\n```\naugmentRequestContext(\n clientContext,\n ctx => ({ methodChain: [...ctx.methodChain, \"fetchPage\"] })\n)\n```\nor\n```\naugmentRequestContext(\n clientContext,\n ({ methodChain }) => ({ methodChain: [...methodChain, \"fetchPage\"] })\n)\n```\ninstead of\n```\naugmentRequestContext(\n clientContext,\n { methodChain: [...clientContext.requestContext.methodChain, \"fetchPage\"] }\n)\n```\n*/\nexport const augmentRequestContext = (client, augment) => ({\n ...client,\n requestContext: {\n ...client.requestContext,\n ...augment(client.requestContext)\n }\n});","/*\n * Copyright 2024 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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _createTemporary = [1, \"/v2/ontologies/{0}/objectSets/createTemporary\", 7];\n/**\n * Creates a temporary `ObjectSet` from the given definition. This `ObjectSet` expires after one hour.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/objectSets/createTemporary\n */\nexport function createTemporary($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _createTemporary, ...args);\n}\nconst _get = [0, \"/v2/ontologies/{0}/objectSets/{1}\", 2];\n/**\n * Gets the definition of the `ObjectSet` with the given RID.\n *\n * @alpha\n *\n * Required Scopes: []\n * URL: /v2/ontologies/{ontology}/objectSets/{objectSetRid}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _load = [1, \"/v2/ontologies/{0}/objectSets/loadObjects\", 7];\n/**\n * Load the ontology objects present in the `ObjectSet` from the provided object set definition.\n *\n * For Object Storage V1 backed objects, this endpoint returns a maximum of 10,000 objects. After 10,000 objects have been returned and if more objects\n * are available, attempting to load another page will result in an `ObjectsExceededLimit` error being returned. There is no limit on Object Storage V2 backed objects.\n *\n * Note that null value properties will not be returned.\n *\n * Vector properties will not be returned unless included in the `select` parameter.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectSets/loadObjects\n */\nexport function load($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _load, ...args);\n}\nconst _loadMultipleObjectTypes = [1, \"/v2/ontologies/{0}/objectSets/loadObjectsMultipleObjectTypes\", 7];\n/**\n * Load the ontology objects present in the `ObjectSet` from the provided object set definition. The resulting\n * objects may be scoped to an object type, in which all the selected properties on the object type are returned, or scoped\n * to an interface, in which only the object type properties that implement the properties of any interfaces in its\n * scope are returned. For objects that are scoped to an interface in the result, a mapping from interface to\n * object implementation is returned in order to interpret the objects as the interfaces that they implement.\n *\n * For Object Storage V1 backed objects, this endpoint returns a maximum of 10,000 objects. After 10,000 objects have been returned and if more objects\n * are available, attempting to load another page will result in an `ObjectsExceededLimit` error being returned. There is no limit on Object Storage V2 backed objects.\n *\n * Note that null value properties will not be returned. In addition, property metadata (rid, apiName, and primaryKey)\n * will be prefixed with '$' instead of '\\_\\_' as is the case in `loadObjects`.\n *\n * Vector properties will not be returned unless included in the `select` parameter.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectSets/loadObjectsMultipleObjectTypes\n */\nexport function loadMultipleObjectTypes($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _loadMultipleObjectTypes, ...args);\n}\nconst _loadObjectsOrInterfaces = [1, \"/v2/ontologies/{0}/objectSets/loadObjectsOrInterfaces\", 7];\n/**\n * Load the ontology objects present in the `ObjectSet` from the provided object set definition. If the requested\n * object set contains interfaces and the object can be viewed as an interface, it will contain the properties\n * defined by the interface. If not, it will contain the properties defined by its object type. This allows directly\n * loading all objects of an interface where all objects are viewed as the interface, for example.\n *\n * Note that the result object set cannot contain a mix of objects with \"interface\" properties and \"object type\"\n * properties. Attempting to load an object set like this will result in an error.\n *\n * For Object Storage V1 backed objects, this endpoint returns a maximum of 10,000 objects. After 10,000 objects have been returned and if more objects\n * are available, attempting to load another page will result in an `ObjectsExceededLimit` error being returned. There is no limit on Object Storage V2 backed objects.\n *\n * Note that null value properties will not be returned. In addition, property metadata (rid, apiName, and primaryKey)\n * will be prefixed with '$' instead of '\\_\\_' as is the case in `/loadObjects`.\n *\n * Vector properties will not be returned unless included in the `select` parameter.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectSets/loadObjectsOrInterfaces\n */\nexport function loadObjectsOrInterfaces($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _loadObjectsOrInterfaces, ...args);\n}\nconst _aggregate = [1, \"/v2/ontologies/{0}/objectSets/aggregate\", 7];\n/**\n * Aggregates the ontology objects present in the `ObjectSet` from the provided object set definition.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectSets/aggregate\n */\nexport function aggregate($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _aggregate, ...args);\n}\nconst _loadLinks = [1, \"/v2/ontologies/{0}/objectSets/loadLinks\", 7];\n/**\n * Loads the specified links from the defined object set.\n *\n * Links are defined as a link type API name and object locators for the source and target objects\n * where only the `__primaryKey` and `__apiName` properties are loaded.\n *\n * Links are grouped by source object locator; however, the links for a given source object may be\n * split over multiple entries with the same source object locator.\n *\n * Please keep these limitations in mind:\n *\n * * Links returned may be stale. For example, primary keys returned by this endpoint may not exist anymore.\n * * This endpoint requests links for 1,000 objects at a time. If, for any page of 1,000 objects, there are more\n * than 100,000 links present, results are limited to 100,000 links and should be considered partial.\n * * This endpoint does not support OSv1 links and will return an error if links provided are backed by OSv1.\n * * This endpoint currently does not support interface object sets or interface links, but support will be added in the near future.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectSets/loadLinks\n */\nexport function loadLinks($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _loadLinks, ...args);\n}","/*\n * Copyright 2025 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\nexport function extractNamespace(fqApiName) {\n const last = fqApiName.lastIndexOf(\".\");\n if (last === -1) return [undefined, fqApiName];\n return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];\n}","/*\n * Copyright 2025 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 invariant from \"tiny-invariant\";\n/* @internal\n* Returns the resultant interface or object type of the object set\n*/\nexport async function extractObjectOrInterfaceType(clientCtx, objectSet) {\n switch (objectSet.type) {\n case \"searchAround\":\n {\n const def = await extractObjectOrInterfaceType(clientCtx, objectSet.objectSet);\n if (def === undefined) {\n return undefined;\n }\n const objOrInterfaceDef = def.type === \"object\" ? await clientCtx.ontologyProvider.getObjectDefinition(def.apiName) : await clientCtx.ontologyProvider.getInterfaceDefinition(def.apiName);\n const linkDef = objOrInterfaceDef.links[objectSet.link];\n !linkDef ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing link definition for '${objectSet.link}'`) : invariant(false) : void 0;\n return objOrInterfaceDef.type === \"object\" ? {\n apiName: objOrInterfaceDef.links[objectSet.link].targetType,\n type: \"object\"\n } : {\n apiName: objOrInterfaceDef.links[objectSet.link].targetTypeApiName,\n type: objOrInterfaceDef.links[objectSet.link].targetType\n };\n }\n case \"withProperties\":\n {\n return extractObjectOrInterfaceType(clientCtx, objectSet.objectSet);\n }\n case \"methodInput\":\n return undefined;\n case \"base\":\n return {\n type: \"object\",\n apiName: objectSet.objectType\n };\n case \"interfaceBase\":\n return {\n type: \"interface\",\n apiName: objectSet.interfaceType\n };\n case \"filter\":\n case \"asBaseObjectTypes\":\n case \"nearestNeighbors\":\n return extractObjectOrInterfaceType(clientCtx, objectSet.objectSet);\n case \"asType\":\n return {\n type: clientCtx.narrowTypeInterfaceOrObjectMapping[objectSet.entityType],\n apiName: objectSet.entityType\n };\n case \"intersect\":\n {\n const objectSets = objectSet.objectSets;\n const objectSetTypes = await Promise.all(objectSets.map(os => extractObjectOrInterfaceType(clientCtx, os)));\n const filteredObjectTypes = objectSetTypes.filter(Boolean);\n const firstInterfaceType = filteredObjectTypes.find(val => val?.type === \"interface\");\n !firstInterfaceType ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing interface type in intersect objectset scope'`) : invariant(false) : void 0;\n return firstInterfaceType;\n }\n case \"subtract\":\n case \"union\":\n const objectSets = objectSet.objectSets;\n const objectSetTypes = await Promise.all(objectSets.map(os => extractObjectOrInterfaceType(clientCtx, os)));\n const filteredObjectTypes = objectSetTypes.filter(Boolean);\n const firstObjectType = filteredObjectTypes[0];\n !filteredObjectTypes.every(val => {\n return val?.apiName === firstObjectType?.apiName && val?.type === firstObjectType?.type;\n }) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Can only have one object type when doing subtract, union\") : invariant(false) : void 0;\n return filteredObjectTypes[0];\n case \"static\":\n case \"reference\":\n // Static and reference object sets are always intersected with a base object set, so we can just return undefined.\n return undefined;\n case \"interfaceLinkSearchAround\":\n const def = await extractObjectOrInterfaceType(clientCtx, objectSet.objectSet);\n if (def === undefined) {\n return undefined;\n }\n const objOrInterfaceDef = def.type === \"object\" ? await clientCtx.ontologyProvider.getObjectDefinition(def.apiName) : await clientCtx.ontologyProvider.getInterfaceDefinition(def.apiName);\n const linkDef = objOrInterfaceDef.links[objectSet.interfaceLink];\n !linkDef ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing link definition for '${objectSet.interfaceLink}'`) : invariant(false) : void 0;\n return objOrInterfaceDef.type === \"object\" ? {\n apiName: objOrInterfaceDef.links[objectSet.interfaceLink].targetType,\n type: \"object\"\n } : {\n apiName: objOrInterfaceDef.links[objectSet.interfaceLink].targetTypeApiName,\n type: objOrInterfaceDef.links[objectSet.interfaceLink].targetType\n };\n // We don't have to worry about new object sets being added and doing a runtime break and breaking people since the OSDK is always constructing these.\n default:\n const _ = objectSet;\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Unsupported object set type for deriving object or interface type,`) : invariant(false) : void 0;\n }\n}","/*\n * Copyright 2025 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 invariant from \"tiny-invariant\";\nexport async function extractRdpDefinition(clientCtx, objectSet) {\n if (!hasWithProperties(objectSet)) {\n return {};\n }\n return (await extractRdpDefinitionInternal(clientCtx, objectSet, undefined)).definitions;\n}\nexport function hasWithProperties(objectSet) {\n if (objectSet.type === \"withProperties\") {\n return true;\n }\n if (\"objectSet\" in objectSet && objectSet.objectSet != null) {\n return hasWithProperties(objectSet.objectSet);\n }\n if (\"objectSets\" in objectSet && objectSet.objectSets != null) {\n return objectSet.objectSets.some(hasWithProperties);\n }\n return false;\n}\n\n/* @internal\n* Returns a tuple of the derived property definitions and the object type that the derived property is defined on.\n*/\nasync function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObjectType) {\n switch (objectSet.type) {\n case \"searchAround\":\n {\n const {\n definitions,\n childObjectType\n } = await extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);\n if (childObjectType === undefined || childObjectType === \"\") {\n return {\n definitions: {}\n };\n }\n const objDef = await clientCtx.ontologyProvider.getObjectDefinition(childObjectType);\n const linkDef = objDef.links[objectSet.link];\n !linkDef ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing link definition for '${objectSet.link}'`) : invariant(false) : void 0;\n return {\n definitions,\n childObjectType: objDef.links[objectSet.link].targetType\n };\n }\n case \"withProperties\":\n {\n // These are the definitions and current object type for all object set operations prior to the definition (e.g. filter, pivotTo, etc.)\n const {\n definitions,\n childObjectType\n } = await extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);\n if (childObjectType === undefined || childObjectType === \"\") {\n return {\n definitions: {}\n };\n }\n for (const [name, definition] of Object.entries(objectSet.derivedProperties)) {\n if (definition.type !== \"selection\") {\n definitions[name] = {\n selectedOrCollectedPropertyType: undefined,\n definition\n };\n continue;\n }\n switch (definition.operation.type) {\n case \"collectList\":\n case \"collectSet\":\n case \"get\":\n // This is the object set construction for the derived property definition construction. We pass in childObjectType so that when we reach MethodInputObjectSet, we know where to start looking.\n const {\n childObjectType: operationLevelObjectType\n } = await extractRdpDefinitionInternal(clientCtx, definition.objectSet, childObjectType);\n if (operationLevelObjectType === undefined || operationLevelObjectType === \"\") {\n return {\n definitions: {}\n };\n }\n const objDef = await clientCtx.ontologyProvider.getObjectDefinition(operationLevelObjectType);\n definitions[name] = {\n selectedOrCollectedPropertyType: objDef.properties[definition.operation.selectedPropertyApiName],\n definition\n };\n break;\n default:\n definitions[name] = {\n selectedOrCollectedPropertyType: undefined,\n definition\n };\n }\n }\n return {\n definitions,\n childObjectType\n };\n }\n case \"methodInput\":\n return {\n definitions: {},\n childObjectType: methodInputObjectType\n };\n case \"base\":\n return {\n definitions: {},\n childObjectType: objectSet.objectType\n };\n case \"interfaceBase\":\n return {\n definitions: {},\n childObjectType: objectSet.interfaceType\n };\n case \"filter\":\n case \"asBaseObjectTypes\":\n case \"asType\":\n case \"nearestNeighbors\":\n return extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);\n // These will throw in OSS so we should throw here so no request is made\n case \"intersect\":\n case \"subtract\":\n case \"union\":\n const objectSets = objectSet.objectSets;\n const objectSetTypes = await Promise.all(objectSets.map(os => extractRdpDefinitionInternal(clientCtx, os, methodInputObjectType)));\n const definitions = objectSetTypes.reduce((acc, {\n definitions\n }) => ({\n ...acc,\n ...definitions\n }), {});\n !(Object.keys(definitions).length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Object sets combined using intersect, subtract, or union must not contain any derived property definitions\") : invariant(false) : void 0;\n const firstValidChildObjectType = objectSetTypes.find(({\n childObjectType\n }) => childObjectType != null)?.childObjectType;\n !objectSetTypes.every(({\n childObjectType\n }) => childObjectType === firstValidChildObjectType || childObjectType == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"All object sets in an intersect, subtract, or union must have the same child object type\") : invariant(false) : void 0;\n return {\n definitions: {},\n childObjectType: firstValidChildObjectType\n };\n case \"static\":\n case \"reference\":\n // Static and reference object sets are always intersected with a base object set, so we can just return no child object type.\n return {\n definitions: {}\n };\n // We don't have to worry about new object sets being added and doing a runtime break and breaking people since the OSDK is always constructing these.\n case \"interfaceLinkSearchAround\":\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Unsupported object set type for Runtime Derived Properties`) : invariant(false) : void 0;\n default:\n const _ = objectSet;\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Unsupported object set type for Runtime Derived Properties`) : invariant(false) : void 0;\n }\n}","/*\n * Copyright 2024 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\nexport function resolveBaseObjectSetType(objectType) {\n return objectType.type === \"interface\" ? {\n type: \"interfaceBase\",\n interfaceType: objectType[\"apiName\"]\n } : {\n type: \"base\",\n objectType: objectType[\"apiName\"]\n };\n}","/*\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 * as OntologyObjectSets from \"@osdk/foundry.ontologies/OntologyObjectSet\";\nimport invariant from \"tiny-invariant\";\nimport { extractNamespace } from \"../internal/conversions/extractNamespace.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { extractObjectOrInterfaceType } from \"../util/extractObjectOrInterfaceType.js\";\nimport { extractRdpDefinition } from \"../util/extractRdpDefinition.js\";\nimport { resolveBaseObjectSetType } from \"../util/objectSetUtils.js\";\n\n/**\n * Converts a PropertyModifierValue to the corresponding wire format loadLevel type.\n */\nfunction modifierToLoadLevelType(modifier) {\n switch (modifier) {\n case \"applyMainValue\":\n return \"extractMainValue\";\n case \"applyReducers\":\n return \"applyReducers\";\n case \"applyReducersAndExtractMainValue\":\n return \"applyReducersAndExtractMainValue\";\n default:\n {\n const _exhaustiveCheck = modifier;\n throw new Error(`Unknown modifier: ${_exhaustiveCheck}`);\n }\n }\n}\nexport function buildSelectV2(select, modifiers, allProperties) {\n const modifiersMap = modifiers ?? {};\n const modifierProps = new Set(Object.keys(modifiersMap));\n const hasModifiers = modifierProps.size > 0;\n const entries = [];\n if (select && select.length > 0) {\n for (const [prop, _] of Object.entries(modifiersMap)) {\n !select.includes(prop) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Modified properties must be included in $select when manually specifying properties\") : invariant(false) : void 0;\n }\n for (const prop of select) {\n if (modifierProps.has(prop)) {\n entries.push({\n type: \"propertyWithLoadLevel\",\n propertyIdentifier: {\n type: \"property\",\n apiName: prop\n },\n loadLevel: {\n type: modifierToLoadLevelType(modifiersMap[prop])\n }\n });\n } else {\n entries.push({\n type: \"property\",\n apiName: prop\n });\n }\n }\n } else if (hasModifiers && allProperties && allProperties.length > 0) {\n for (const prop of allProperties) {\n if (modifierProps.has(prop)) {\n entries.push({\n type: \"propertyWithLoadLevel\",\n propertyIdentifier: {\n type: \"property\",\n apiName: prop\n },\n loadLevel: {\n type: modifierToLoadLevelType(modifiersMap[prop])\n }\n });\n } else {\n entries.push({\n type: \"property\",\n apiName: prop\n });\n }\n }\n }\n return entries;\n}\nexport function augment(type, ...properties) {\n return {\n [type.apiName]: properties\n };\n}\n\n/** @internal */\nexport function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = undefined) {\n if (objectSet.type === \"base\" || objectSet.type === \"interfaceBase\") {\n if (objectSet.type === \"base\" && objectSet.objectType !== expectedApiName) {\n throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.objectType}`);\n }\n if (objectSet.type === \"interfaceBase\" && objectSet.interfaceType !== expectedApiName) {\n throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.interfaceType}`);\n }\n return existingWhere;\n }\n if (objectSet.type === \"filter\") {\n return objectSetToSearchJsonV2(objectSet.objectSet, expectedApiName, existingWhere == null ? objectSet.where : {\n type: \"and\",\n value: [existingWhere, objectSet.where]\n });\n }\n throw new Error(`Unsupported objectSet type: ${objectSet.type}`);\n}\n\n/** @internal */\nexport function resolveInterfaceObjectSet(objectSet, interfaceTypeApiName, args) {\n return args?.$includeAllBaseObjectProperties ? {\n type: \"intersect\",\n objectSets: [objectSet, {\n type: \"interfaceBase\",\n interfaceType: interfaceTypeApiName,\n includeAllBaseObjectProperties: true\n }]\n } : objectSet;\n}\n\n/** @internal */\nexport async function fetchStaticRidPage(client, rids, args, useSnapshot = false) {\n const shouldLoadPropertySecurities = args.$loadPropertySecurityMetadata ?? false;\n const requestBody = await applyFetchArgs(args, {\n objectSet: {\n type: \"static\",\n objects: rids\n },\n select: args?.$select ?? [],\n excludeRid: !args?.$includeRid,\n snapshot: useSnapshot,\n loadPropertySecurities: shouldLoadPropertySecurities\n }, client, {\n type: \"object\",\n apiName: \"\"\n });\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const result = await OntologyObjectSets.loadMultipleObjectTypes(addUserAgentAndRequestContextHeaders(client, {\n osdkMetadata: undefined\n }), await client.ontologyRid, requestBody, {\n preview: true,\n transactionId: client.transactionId,\n scenarioRid: client.scenarioRid\n });\n return Promise.resolve({\n data: await client.objectFactory(client, result.data, undefined, {}, shouldLoadPropertySecurities ? result.propertySecurities : undefined, !args.$includeRid, args.$select, false, result.interfaceToObjectTypeMappings, result.interfaceToObjectTypeMappingsV2),\n nextPageToken: result.nextPageToken,\n totalCount: result.totalCount\n });\n}\nasync function fetchInterfacePage(client, interfaceType, args, objectSet, useSnapshot = false) {\n const extractedInterfaceTypeApiName = (await extractObjectOrInterfaceType(client, objectSet))?.apiName ?? interfaceType.apiName;\n const resolvedInterfaceObjectSet = resolveInterfaceObjectSet(objectSet, extractedInterfaceTypeApiName, args);\n const shouldLoadPropertySecurities = args.$loadPropertySecurityMetadata ?? false;\n const modifiers = args.$applyModifiers;\n const hasModifiers = modifiers && Object.keys(modifiers).length > 0;\n const hasSelect = args?.$select && args.$select.length > 0;\n let allProperties;\n if (!hasSelect && hasModifiers) {\n const ifaceDef = await client.ontologyProvider.getInterfaceDefinition(interfaceType.apiName);\n allProperties = ifaceDef ? Object.keys(ifaceDef.properties) : undefined;\n }\n const selectV2 = buildSelectV2(args?.$select ? [...args.$select] : undefined, modifiers, allProperties);\n const requestBody = await buildAndRemapRequestBody(args, {\n objectSet: resolvedInterfaceObjectSet,\n select: [],\n selectV2,\n loadPropertySecurities: shouldLoadPropertySecurities,\n excludeRid: !args?.$includeRid,\n snapshot: useSnapshot\n }, client, interfaceType);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const result = await OntologyObjectSets.loadMultipleObjectTypes(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, requestBody, {\n preview: true,\n branch: client.branch,\n transactionId: client.transactionId,\n scenarioRid: client.scenarioRid\n });\n return Promise.resolve({\n data: await client.objectFactory(client, result.data, extractedInterfaceTypeApiName, {}, shouldLoadPropertySecurities ? result.propertySecurities : undefined, !args.$includeRid, args.$select, false, result.interfaceToObjectTypeMappings, result.interfaceToObjectTypeMappingsV2),\n nextPageToken: result.nextPageToken,\n totalCount: result.totalCount\n });\n}\n\n/** @internal */\nexport async function fetchPageInternal(client, objectType, objectSet, args = {}, useSnapshot = false) {\n if (objectType.type === \"interface\") {\n return await fetchInterfacePage(client, objectType, args, objectSet, useSnapshot); // fixme\n } else {\n return await fetchObjectPage(client, objectType, args, objectSet, useSnapshot); // fixme\n }\n}\n\n/** @internal */\nexport async function fetchPageWithErrorsInternal(client, objectType, objectSet, args = {}) {\n try {\n const result = await fetchPageInternal(client, objectType, objectSet, args);\n return {\n value: result\n };\n } catch (e) {\n if (e instanceof Error) {\n return {\n error: e\n };\n }\n return {\n error: e\n };\n }\n}\n\n/**\n * @param client\n * @param objectType\n * @param args\n * @param objectSet\n * @returns\n * @internal\n */\nexport async function fetchPage(client, objectType, args, objectSet = resolveBaseObjectSetType(objectType)) {\n return fetchPageInternal(client, objectType, objectSet, args);\n}\n\n/** @internal */\nexport async function fetchPageWithErrors(client, objectType, args, objectSet = resolveBaseObjectSetType(objectType)) {\n return fetchPageWithErrorsInternal(client, objectType, objectSet, args);\n}\nasync function buildAndRemapRequestBody(args, baseBody, client, objectType) {\n const requestBody = await applyFetchArgs(args, baseBody, client, objectType);\n if (requestBody.selectV2 != null && requestBody.selectV2.length > 0) {\n const remapped = remapSelectV2(objectType, requestBody.selectV2);\n return {\n ...requestBody,\n selectV2: remapped\n };\n }\n return requestBody;\n}\nfunction remapSelectV2(objectOrInterface, selectV2) {\n if (objectOrInterface == null) {\n return selectV2;\n }\n if (objectOrInterface.type !== \"interface\") {\n return selectV2;\n }\n const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);\n if (objApiNamespace == null) {\n return selectV2;\n }\n return selectV2.map(entry => {\n if (entry.type === \"property\") {\n const [fieldApiNamespace, fieldShortName] = extractNamespace(entry.apiName);\n if (fieldApiNamespace == null) {\n return {\n type: \"property\",\n apiName: `${objApiNamespace}.${fieldShortName}`\n };\n }\n return entry;\n } else {\n const [fieldApiNamespace, fieldShortName] = extractNamespace(entry.propertyIdentifier.apiName);\n if (fieldApiNamespace == null) {\n return {\n ...entry,\n propertyIdentifier: {\n type: \"property\",\n apiName: `${objApiNamespace}.${fieldShortName}`\n }\n };\n }\n return entry;\n }\n });\n}\n\n/** @internal */\nexport function remapPropertyNames(objectOrInterface, propertyNames) {\n if (objectOrInterface == null) {\n return propertyNames;\n }\n if (objectOrInterface.type === \"interface\") {\n const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);\n return propertyNames.map(name => {\n const [fieldApiNamespace, fieldShortName] = extractNamespace(name);\n return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : name;\n });\n }\n return propertyNames;\n}\nasync function applyFetchArgs(args, body, _client, objectType) {\n if (args?.$nextPageToken) {\n body.pageToken = args.$nextPageToken;\n }\n if (args?.$pageSize != null) {\n body.pageSize = args.$pageSize;\n }\n if (args?.$loadPropertySecurityMetadata) {\n body.loadPropertySecurities = true;\n }\n const orderBy = args?.$orderBy;\n if (orderBy) {\n if (orderBy === \"relevance\") {\n body.orderBy = {\n orderType: \"relevance\",\n fields: []\n };\n } else {\n const orderByEntries = Object.entries(orderBy);\n const fieldNames = orderByEntries.map(([field]) => field);\n const remappedFields = remapPropertyNames(objectType, fieldNames);\n body.orderBy = {\n fields: orderByEntries.map(([, direction], index) => ({\n field: remappedFields[index],\n direction\n }))\n };\n }\n }\n return body;\n}\n\n/** @internal */\nexport async function fetchObjectPage(client, objectType, args, objectSet, useSnapshot = false) {\n // For simple object fetches, since we know the object type up front\n // we can parallelize network requests for loading metadata and loading the actual objects\n // In our object factory we await and block on loading the metadata, which if this call finishes, should already be cached on the client\n const modifiers = args.$applyModifiers;\n const hasModifiers = modifiers && Object.keys(modifiers).length > 0;\n const hasSelect = args?.$select && args.$select.length > 0;\n let allProperties;\n if (!hasSelect && hasModifiers) {\n const objDef = await client.ontologyProvider.getObjectDefinition(objectType.apiName);\n allProperties = objDef ? Object.keys(objDef.properties) : undefined;\n } else {\n // We have an empty catch here so that if this call errors before we await later, we won't have an unhandled promise rejection that would crash the process\n // Swallowing the error is ok because we await the metadata load in the objectFactory later anyways which eventually bubbles up the error to the user\n void client.ontologyProvider.getObjectDefinition(objectType.apiName).catch(() => {});\n }\n const shouldLoadPropertySecurities = args.$loadPropertySecurityMetadata ?? false;\n const selectV2 = buildSelectV2(args?.$select ? [...args.$select] : undefined, modifiers, allProperties);\n const requestBody = await buildAndRemapRequestBody(args, {\n objectSet,\n select: [],\n selectV2,\n loadPropertySecurities: shouldLoadPropertySecurities,\n excludeRid: !args?.$includeRid,\n snapshot: useSnapshot\n }, client, objectType);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const r = await OntologyObjectSets.load(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, requestBody, {\n branch: client.branch,\n transactionId: client.transactionId,\n scenarioRid: client.scenarioRid\n });\n return Promise.resolve({\n data: await client.objectFactory(client, r.data, undefined, await extractRdpDefinition(client, objectSet), shouldLoadPropertySecurities ? r.propertySecurities : undefined, !args.$includeRid, args.$select, false),\n nextPageToken: r.nextPageToken,\n totalCount: r.totalCount\n });\n}","/*\n * Copyright 2025 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 { extractNamespace } from \"./extractNamespace.js\";\nexport function fullyQualifyPropName(fieldName, objectOrInterface) {\n if (objectOrInterface.type === \"interface\") {\n const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);\n const [fieldApiNamespace, fieldShortName] = extractNamespace(fieldName);\n return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : fieldName;\n }\n return fieldName;\n}","/*\n * Copyright 2025 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\nexport function makeGeoFilterBbox(bbox, filterType, propertyIdentifier, field) {\n return {\n type: filterType === \"$within\" ? \"withinBoundingBox\" : \"intersectsBoundingBox\",\n /**\n * This is a bit ugly, but did this so that propertyIdentifier only shows up in the return object if its defined,\n * this makes it so we don't need to go update our entire test bed either to include a field which may change in near future.\n * Once we solidify that this is the way forward, I can remove field and clean this up\n */\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: {\n topLeft: {\n type: \"Point\",\n coordinates: [bbox[0], bbox[3]]\n },\n bottomRight: {\n type: \"Point\",\n coordinates: [bbox[2], bbox[1]]\n }\n }\n };\n}","/*\n * Copyright 2025 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\nexport function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field) {\n return {\n type: filterType,\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: {\n type: \"Polygon\",\n coordinates\n }\n };\n}","/*\n * Copyright 2025 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 { makeGeoFilterBbox } from \"./makeGeoFilterBbox.js\";\nimport { makeGeoFilterPolygon } from \"./makeGeoFilterPolygon.js\";\nexport function makeGeoFilterIntersects(intersectsBody, propertyIdentifier, field) {\n if (Array.isArray(intersectsBody)) {\n return makeGeoFilterBbox(intersectsBody, \"$intersects\", propertyIdentifier, field);\n } else if (\"$bbox\" in intersectsBody && intersectsBody.$bbox != null) {\n return makeGeoFilterBbox(intersectsBody.$bbox, \"$intersects\", propertyIdentifier, field);\n } else {\n const coordinates = \"$polygon\" in intersectsBody ? intersectsBody.$polygon : intersectsBody.coordinates;\n return makeGeoFilterPolygon(coordinates, \"intersectsPolygon\", propertyIdentifier, field);\n }\n}","/*\n * Copyright 2025 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 { DistanceUnitMapping } from \"@osdk/api\";\nimport { makeGeoFilterBbox } from \"./makeGeoFilterBbox.js\";\nimport { makeGeoFilterPolygon } from \"./makeGeoFilterPolygon.js\";\nexport function makeGeoFilterWithin(withinBody, propertyIdentifier, field) {\n if (Array.isArray(withinBody)) {\n return makeGeoFilterBbox(withinBody, \"$within\", propertyIdentifier, field);\n } else if (\"$bbox\" in withinBody && withinBody.$bbox != null) {\n return makeGeoFilterBbox(withinBody.$bbox, \"$within\", propertyIdentifier, field);\n } else if (\"$distance\" in withinBody && \"$of\" in withinBody && withinBody.$distance != null && withinBody.$of != null) {\n return {\n type: \"withinDistanceOf\",\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: {\n center: Array.isArray(withinBody.$of) ? {\n type: \"Point\",\n coordinates: withinBody.$of\n } : withinBody.$of,\n distance: {\n value: withinBody.$distance[0],\n unit: DistanceUnitMapping[withinBody.$distance[1]]\n }\n }\n };\n } else {\n const coordinates = \"$polygon\" in withinBody ? withinBody.$polygon : withinBody.coordinates;\n return makeGeoFilterPolygon(coordinates, \"withinPolygon\", propertyIdentifier, field);\n }\n}","/*\n * Copyright 2026 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 invariant from \"tiny-invariant\";\nexport function toIntervalQueryRule(rule) {\n if (rule.$match != null) {\n if (rule.$prefixOnLastTerm) {\n return {\n type: \"prefixOnLastToken\",\n query: rule.$match\n };\n }\n return {\n type: \"match\",\n query: rule.$match,\n ordered: rule.$ordered,\n maxGaps: rule.$maxGaps\n };\n }\n if (rule.$and != null) {\n return {\n type: \"allOf\",\n rules: rule.$and.map(toIntervalQueryRule),\n ordered: rule.$ordered,\n maxGaps: rule.$maxGaps\n };\n }\n if (rule.$or != null) {\n return {\n type: \"anyOf\",\n rules: rule.$or.map(toIntervalQueryRule)\n };\n }\n if (rule.$fuzzy != null) {\n return {\n type: \"fuzzy\",\n term: rule.$fuzzy,\n fuzziness: rule.$fuzziness\n };\n }\n const _ = rule;\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Unknown interval rule type\") : invariant(false) : void 0;\n}","/*\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 invariant from \"tiny-invariant\";\nimport { fullyQualifyPropName } from \"./fullyQualifyPropName.js\";\nimport { makeGeoFilterIntersects } from \"./makeGeoFilterIntersects.js\";\nimport { makeGeoFilterWithin } from \"./makeGeoFilterWithin.js\";\nimport { toIntervalQueryRule } from \"./toIntervalQuery.js\";\nfunction isAndClause(whereClause) {\n return \"$and\" in whereClause && whereClause.$and !== undefined;\n}\nfunction isOrClause(whereClause) {\n return \"$or\" in whereClause && whereClause.$or !== undefined;\n}\nfunction isNotClause(whereClause) {\n return \"$not\" in whereClause && whereClause.$not !== undefined;\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause(whereClause, objectOrInterface, rdpNames) {\n const parts = Object.entries(whereClause).map(([key, value]) => ({\n [key]: value\n }));\n !(parts.length > 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Cannot convert an empty where clause to a filter. \" + \"Skip the .where() call entirely when no conditions are provided.\") : invariant(false) : void 0;\n if (parts.length === 1) {\n return modernToLegacyWhereClauseInner(whereClause, objectOrInterface, rdpNames);\n }\n return {\n type: \"and\",\n value: parts.map(v => modernToLegacyWhereClauseInner(v, objectOrInterface, rdpNames))\n };\n}\n\n/** @internal */\nexport function modernToLegacyWhereClauseInner(whereClause, objectOrInterface, rdpNames) {\n const parts = Object.entries(whereClause);\n !(parts.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Invalid where clause provided.\") : invariant(false) : void 0;\n if (isAndClause(whereClause)) {\n return {\n type: \"and\",\n value: whereClause.$and.map(clause => modernToLegacyWhereClause(clause, objectOrInterface, rdpNames))\n };\n } else if (isOrClause(whereClause)) {\n return {\n type: \"or\",\n value: whereClause.$or.map(clause => modernToLegacyWhereClause(clause, objectOrInterface, rdpNames))\n };\n } else if (isNotClause(whereClause)) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(whereClause.$not, objectOrInterface, rdpNames)\n };\n }\n return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);\n}\nfunction resolvePropertyIdentifier(fieldName, objectOrInterface, isTitleProperty, isPrimaryKeyProperty, isRdp, structFieldSelector) {\n if (isTitleProperty) {\n return {\n type: \"titleProperty\"\n };\n } else if (isPrimaryKeyProperty) {\n return {\n type: \"primaryKeyProperty\"\n };\n } else if (isRdp) {\n return {\n type: \"property\",\n apiName: fieldName\n };\n } else if (structFieldSelector != null) {\n return {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(structFieldSelector.propertyApiName, objectOrInterface)\n };\n }\n return undefined;\n}\nfunction handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector, rdpNames) {\n !(filter != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot filter on property \"${fieldName}\" with an undefined or null value. ` + `If the value might be undefined, check it before adding to the where clause.`) : invariant(false) : void 0;\n const isTitleProperty = fieldName === \"$title\";\n const isPrimaryKeyProperty = fieldName === \"$primaryKey\";\n const isSpecialProperty = isTitleProperty || isPrimaryKeyProperty;\n const isRdp = !structFieldSelector && !isSpecialProperty && rdpNames?.has(fieldName);\n const propertyIdentifier = resolvePropertyIdentifier(fieldName, objectOrInterface, isTitleProperty, isPrimaryKeyProperty, isRdp, structFieldSelector);\n const field = !isRdp && !isSpecialProperty && structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : undefined;\n !(field == null || propertyIdentifier == null && (field != null || isRdp != null)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Encountered error constructing where clause: field and propertyIdentifier cannot both be defined\") : invariant(false) : void 0;\n if (typeof filter === \"string\" || typeof filter === \"number\" || typeof filter === \"boolean\") {\n return {\n type: \"eq\",\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: filter\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 !(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\") : invariant(false) : void 0;\n\n // Struct\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n !(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;\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(Object.entries(filter)[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName\n }, rdpNames);\n }\n const firstKey = keysOfFilter[0];\n !(filter[firstKey] != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n if (firstKey === \"$contains\" && filter[firstKey] instanceof Object) {\n const containsValue = filter[firstKey];\n const containsKeys = Object.keys(containsValue);\n const isFilterObject = containsKeys.some(key => key.startsWith(\"$\"));\n if (isFilterObject) {\n return handleWherePair([fieldName, containsValue], objectOrInterface, structFieldSelector, rdpNames);\n } else {\n const structFilter = Object.entries(containsValue);\n !(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;\n const structFieldApiName = structFilter[0][0];\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 && {\n propertyIdentifier\n }),\n field,\n value: filter[firstKey]\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 if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n return {\n type: firstKey.substring(1),\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: typeof filter[firstKey] === \"string\" ? filter[firstKey] : filter[firstKey].term,\n fuzzy: typeof filter[firstKey] === \"string\" ? false : filter[firstKey].fuzzySearch ?? false\n };\n }\n if (firstKey === \"$matchesRegex\") {\n return {\n type: \"regex\",\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: filter[firstKey]\n };\n }\n if (firstKey === \"$interval\") {\n return {\n type: \"interval\",\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n rule: toIntervalQueryRule(filter[firstKey])\n };\n }\n return {\n type: firstKey.substring(1),\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: filter[firstKey]\n };\n}","/*\n * Copyright 2025 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 invariant from \"tiny-invariant\";\n\n/** @internal */\nexport function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {\n const definition = {\n abs() {\n return derivedPropertyDefinitionFactory({\n type: \"absoluteValue\",\n property: wireDefinition\n }, definitionMap);\n },\n negate() {\n return derivedPropertyDefinitionFactory({\n type: \"negate\",\n property: wireDefinition\n }, definitionMap);\n },\n max(value) {\n return derivedPropertyDefinitionFactory({\n type: \"greatest\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n min(value) {\n return derivedPropertyDefinitionFactory({\n type: \"least\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n add(value) {\n return derivedPropertyDefinitionFactory({\n type: \"add\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n subtract(value) {\n return derivedPropertyDefinitionFactory({\n \"type\": \"subtract\",\n \"left\": wireDefinition,\n \"right\": getDefinitionFromMap(value, definitionMap)\n }, definitionMap);\n },\n multiply(value) {\n return derivedPropertyDefinitionFactory({\n type: \"multiply\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n divide(value) {\n return derivedPropertyDefinitionFactory({\n \"type\": \"divide\",\n \"left\": wireDefinition,\n \"right\": getDefinitionFromMap(value, definitionMap)\n }, definitionMap);\n },\n extractPart: part => {\n return derivedPropertyDefinitionFactory({\n type: \"extract\",\n part,\n property: wireDefinition\n }, definitionMap);\n }\n };\n definitionMap.set(definition, wireDefinition);\n return definition;\n}\nconst getDefinitionFromMap = (arg, definitionMap) => {\n if (typeof arg === \"object\") {\n const definition = definitionMap.get(arg);\n !definition ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Derived Property is not defined\") : invariant(false) : void 0;\n return definition;\n } else if (typeof arg === \"number\") {\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Literals for derived properties are not yet supported\") : invariant(false) : void 0;\n }\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Invalid argument type for a derived property\") : invariant(false) : void 0;\n};","/*\n * Copyright 2024 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 invariant from \"tiny-invariant\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { derivedPropertyDefinitionFactory } from \"./derivedPropertyDefinitionFactory.js\";\n\n/** @internal */\nexport function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fromBaseObjectSet = false) {\n return {\n pivotTo: link => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"searchAround\",\n objectSet,\n link\n }, definitionMap);\n },\n where: clause => {\n if (clause == null || Object.keys(clause).length === 0) {\n return createWithPropertiesObjectSet(objectType, objectSet, definitionMap);\n }\n const rdpNames = new Set(definitionMap.keys());\n return createWithPropertiesObjectSet(objectType, {\n type: \"filter\",\n objectSet,\n where: modernToLegacyWhereClause(clause, objectType, rdpNames)\n }, definitionMap);\n },\n aggregate: (aggregation, opt) => {\n const splitAggregation = aggregation.split(\":\");\n !(splitAggregation.length === 2 || splitAggregation[0] === \"$count\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Invalid aggregation format\") : invariant(false) : void 0;\n const [aggregationPropertyName, aggregationOperation] = splitAggregation;\n let aggregationOperationDefinition;\n switch (aggregationOperation) {\n case \"sum\":\n case \"avg\":\n case \"min\":\n case \"max\":\n case \"exactDistinct\":\n case \"approximateDistinct\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName\n };\n break;\n case \"approximatePercentile\":\n aggregationOperationDefinition = {\n type: \"approximatePercentile\",\n selectedPropertyApiName: aggregationPropertyName,\n approximatePercentile: opt?.percentile ?? .5\n };\n break;\n case \"collectSet\":\n case \"collectList\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n limit: opt?.limit ?? 100\n };\n break;\n case undefined:\n if (aggregationPropertyName === \"$count\") {\n aggregationOperationDefinition = {\n type: \"count\"\n };\n break;\n }\n default:\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Invalid aggregation operation \" + aggregationOperation) : invariant(false) : void 0;\n }\n const wrappedObjectSet = {\n type: \"selection\",\n objectSet,\n operation: aggregationOperationDefinition\n };\n const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult;\n },\n selectProperty: name => {\n if (fromBaseObjectSet) {\n const wrappedObjectSet = {\n type: \"property\",\n apiName: name\n };\n const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult;\n }\n const wrappedObjectSet = {\n type: \"selection\",\n objectSet,\n operation: {\n type: \"get\",\n selectedPropertyApiName: name\n }\n };\n const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult;\n }\n };\n}","/*\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\nconst directionFieldMap = dir => dir === \"asc\" ? \"ASC\" : dir === \"desc\" ? \"DESC\" : undefined;\n\n/** @internal */\nexport function splitAggregationKey(key) {\n const colonPos = key.lastIndexOf(\":\");\n return {\n property: key.slice(0, colonPos),\n metric: key.slice(colonPos + 1)\n };\n}\n\n/** @internal */\nexport function modernToLegacyAggregationClause(select) {\n return Object.entries(select).flatMap(([propAndMetric, aggregationType]) => {\n if (propAndMetric === \"$count\") {\n return {\n type: \"count\",\n name: \"count\",\n direction: directionFieldMap(aggregationType)\n };\n }\n const {\n property,\n metric\n } = splitAggregationKey(propAndMetric);\n return [{\n type: metric,\n name: `${property}.${metric}`,\n direction: directionFieldMap(aggregationType),\n field: property\n }];\n });\n}","/*\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 { splitAggregationKey } from \"./modernToLegacyAggregationClause.js\";\n\n/** @internal */\nexport function legacyToModernSingleAggregationResult(entry, select) {\n const result = {};\n\n // Seed the result with undefined for every selected metric so that\n // properties are always present, even when the server returns no metrics\n // (e.g. aggregating over 0 objects).\n for (const selectKey of Object.keys(select)) {\n if (selectKey === \"$count\") {\n continue;\n }\n const {\n property,\n metric\n } = splitAggregationKey(selectKey);\n (result[property] ??= {})[metric] = undefined;\n }\n for (const {\n name,\n value\n } of entry.metrics) {\n if (name === \"count\") {\n continue;\n }\n const [property, metricType] = name.split(\".\");\n if (result[property]) {\n // guard against an unknown metric name\n result[property][metricType] = value;\n }\n }\n return result;\n}","/*\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 { DurationMapping } from \"@osdk/api\";\n/** @internal */\nexport function modernToLegacyGroupByClause(groupByClause) {\n if (!groupByClause) return [];\n return Object.entries(groupByClause).flatMap(([field, type]) => {\n if (type === \"exact\") {\n return [{\n type,\n field\n }];\n } else if (\"$exactWithLimit\" in type) {\n {\n return [{\n type: \"exact\",\n field,\n maxGroupCount: type.$exactWithLimit\n }];\n }\n } else if (\"$exact\" in type) {\n return [{\n type: \"exact\",\n field,\n maxGroupCount: type.$exact?.$limit ?? undefined,\n defaultValue: type.$exact.$defaultValue ?? undefined,\n includeNullValues: type.$exact.$includeNullValue === true ? true : undefined\n }];\n } else if (\"$fixedWidth\" in type) {\n return [{\n type: \"fixedWidth\",\n field,\n fixedWidth: type.$fixedWidth\n }];\n } else if (\"$ranges\" in type) {\n return [{\n type: \"ranges\",\n field,\n ranges: type.$ranges.map(range => convertRange(range))\n }];\n } else if (\"$duration\" in type) {\n return [{\n type: \"duration\",\n field,\n value: type.$duration[0],\n unit: DurationMapping[type.$duration[1]]\n }];\n } else return [];\n });\n}\nfunction convertRange(range) {\n return {\n startValue: range[0],\n endValue: range[1]\n };\n}","/*\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 * as OntologyObjectSets from \"@osdk/foundry.ontologies/OntologyObjectSet\";\nimport invariant from \"tiny-invariant\";\nimport { legacyToModernSingleAggregationResult } from \"../internal/conversions/legacyToModernSingleAggregationResult.js\";\nimport { modernToLegacyAggregationClause } from \"../internal/conversions/modernToLegacyAggregationClause.js\";\nimport { modernToLegacyGroupByClause } from \"../internal/conversions/modernToLegacyGroupByClause.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { resolveBaseObjectSetType } from \"../util/objectSetUtils.js\";\n\n/** @internal */\nexport async function aggregate(clientCtx, objectType, objectSet = resolveBaseObjectSetType(objectType), req) {\n const resolvedObjectSet = resolveBaseObjectSetType(objectType);\n const body = {\n aggregation: modernToLegacyAggregationClause(req.$select),\n groupBy: [],\n where: undefined\n };\n if (req.$groupBy) {\n body.groupBy = modernToLegacyGroupByClause(req.$groupBy);\n }\n if (clientCtx.flushEdits != null) {\n await clientCtx.flushEdits();\n }\n const result = await OntologyObjectSets.aggregate(addUserAgentAndRequestContextHeaders(clientCtx, objectType), await clientCtx.ontologyRid, {\n objectSet,\n groupBy: body.groupBy,\n aggregation: body.aggregation\n }, {\n branch: clientCtx.branch,\n transactionId: clientCtx.transactionId,\n scenarioRid: clientCtx.scenarioRid\n });\n if (!result.data || !Array.isArray(result.data)) {\n throw new Error(`Aggregation request failed: ${JSON.stringify(result)}`);\n }\n if (!req.$groupBy) {\n !(result.data.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"no group by clause should mean only one data result\") : invariant(false) : void 0;\n return {\n ...aggregationToCountResult(result.data[0]),\n ...legacyToModernSingleAggregationResult(result.data[0], req.$select)\n };\n }\n const ret = result.data.map(entry => {\n return {\n $group: entry.group,\n ...aggregationToCountResult(entry),\n ...legacyToModernSingleAggregationResult(entry, req.$select)\n };\n }); // fixme\n\n return ret; // FIXME\n}\nfunction aggregationToCountResult(entry) {\n for (const aggregateResult of entry.metrics) {\n if (aggregateResult.name === \"count\") {\n return {\n $count: aggregateResult.value\n };\n }\n }\n}","/*\n * Copyright 2024 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 { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { fetchPage } from \"./fetchPage.js\";\n\n/** @internal */\nexport async function fetchSingle(client, objectType, args, objectSet) {\n const result = await fetchPage(client, objectType, {\n ...args,\n $pageSize: 1\n }, objectSet);\n if (result.data.length !== 1 || result.nextPageToken != null) {\n throw new PalantirApiError(`Expected a single result but got ${result.data.length} instead${result.nextPageToken != null ? \" with nextPageToken set\" : \"\"}`);\n }\n return result.data[0];\n}\n\n/** @internal */\nexport async function fetchSingleWithErrors(client, objectType, args, objectSet) {\n try {\n const result = await fetchSingle(client, objectType, args, objectSet);\n return {\n value: result\n };\n } catch (e) {\n if (e instanceof Error) {\n return {\n error: e\n };\n }\n return {\n error: e\n };\n }\n}","/*\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\nconst WIRE_OBJECT_SET_TYPES = new Set([\"base\", \"filter\", \"intersect\", \"reference\", \"searchAround\", \"static\", \"subtract\", \"union\", \"interfaceBase\"]);\n\n/** @internal */\nexport function isWireObjectSet(o) {\n return o != null && typeof o === \"object\" && WIRE_OBJECT_SET_TYPES.has(o.type);\n}","/*\n * Copyright 2025 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 * as OntologyObjectSets from \"@osdk/foundry.ontologies/OntologyObjectSet\";\n/** @internal */\nexport const fetchLinksPage = async (client, objectType, objectSet, links) => {\n if (objectType.type === \"interface\") {\n throw new Error(\"Interface object sets are not supported yet.\");\n }\n void client.ontologyProvider.getObjectDefinition(objectType.apiName).catch(() => {});\n const result = await OntologyObjectSets.loadLinks(client, await client.ontologyRid, {\n objectSet,\n links\n }, {\n branch: client.branch,\n preview: true\n });\n return remapLinksPage(result);\n};\n\n/** @internal */\nexport const remapLinksPage = wireLinksPage => {\n return {\n ...wireLinksPage,\n data: wireLinksPage.data.flatMap(({\n sourceObject,\n linkedObjects\n }) => linkedObjects.map(({\n targetObject,\n linkType\n }) => ({\n source: remapObjectLocator(sourceObject),\n target: remapObjectLocator(targetObject),\n linkType: linkType\n })))\n };\n};\n\n/** @internal */\nexport const remapObjectLocator = wireObjectLocator => ({\n $apiName: wireObjectLocator.__apiName,\n $primaryKey: wireObjectLocator.__primaryKey\n});","/*\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 invariant from \"tiny-invariant\";\nimport { createWithPropertiesObjectSet } from \"../derivedProperties/createWithPropertiesObjectSet.js\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { aggregate } from \"../object/aggregate.js\";\nimport { fetchPageInternal, fetchPageWithErrorsInternal } from \"../object/fetchPage.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../object/fetchSingle.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { resolveBaseObjectSetType } from \"../util/objectSetUtils.js\";\nimport { isWireObjectSet } from \"../util/WireObjectSet.js\";\nimport { fetchLinksPage } from \"./fetchLinksPage.js\";\nconst a = {\n \"type\": \"interfaceLinkSearchAround\",\n \"interfaceLink\": \"lead\",\n \"objectSet\": {\n \"type\": \"asType\",\n \"entityType\": \"Person\",\n \"objectSet\": {\n \"type\": \"filter\",\n \"objectSet\": {\n \"type\": \"base\",\n \"objectType\": \"Employee\"\n },\n \"where\": {\n \"type\": \"eq\",\n \"field\": \"employeeNumber\",\n \"value\": \"657495107\"\n }\n }\n }\n};\nfunction isObjectTypeDefinition(def) {\n return def.type === \"object\";\n}\nexport function isObjectSet(o) {\n return o != null && typeof o === \"object\" && isWireObjectSet(objectSetDefinitions.get(o));\n}\nexport function getWireObjectSet(objectSet) {\n return objectSetDefinitions.get(objectSet);\n}\n\n/** @internal exported for internal use only */\nexport const objectSetDefinitions = new WeakMap();\n\n/** @internal */\nexport function createObjectSet(objectType, clientCtx, objectSet = resolveBaseObjectSetType(objectType)) {\n const base = {\n aggregate: aggregate.bind(globalThis, augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"aggregate\"\n })), objectType, objectSet),\n fetchPage: fetchPageInternal.bind(globalThis, augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchPage\"\n })), objectType, objectSet),\n fetchPageWithErrors: fetchPageWithErrorsInternal.bind(globalThis, augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchPageWithErrors\"\n })), objectType, objectSet),\n where: clause => {\n if (clause == null || Object.keys(clause).length === 0) {\n return clientCtx.objectSetFactory(objectType, clientCtx, objectSet);\n }\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"filter\",\n objectSet,\n where: modernToLegacyWhereClause(clause, objectType)\n });\n },\n pivotTo(type) {\n return createSearchAround(type)();\n },\n union: (...objectSets) => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"union\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n intersect: (...objectSets) => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"intersect\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n subtract: (...objectSets) => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"subtract\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n nearestNeighbors: (query, numNeighbors, property) => {\n const nearestNeighborsQuery = isTextQuery(query) ? {\n \"type\": \"text\",\n \"value\": query\n } : {\n \"type\": \"vector\",\n \"value\": query\n };\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"nearestNeighbors\",\n objectSet,\n propertyIdentifier: {\n type: \"property\",\n apiName: property\n },\n numNeighbors,\n query: nearestNeighborsQuery\n });\n },\n async *asyncIter(args) {\n let $nextPageToken;\n do {\n const result = await fetchPageInternal(augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"asyncIter\"\n })), objectType, objectSet, {\n ...args,\n $pageSize: 10000,\n $nextPageToken\n }, true);\n $nextPageToken = result.nextPageToken;\n for (const obj of result.data) {\n yield obj;\n }\n } while ($nextPageToken != null);\n },\n fetchOne: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {\n return await fetchSingle(augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchOne\"\n })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));\n } : undefined,\n fetchOneWithErrors: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {\n return await fetchSingleWithErrors(augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchOneWithErrors\"\n })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));\n } : undefined,\n subscribe: (listener, opts) => {\n const pendingSubscribe = import(\"./ObjectSetListenerWebsocket.js\").then(({\n ObjectSetListenerWebsocket\n }) => ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(objectType, objectSet, listener, opts?.properties, opts?.includeRid));\n return {\n unsubscribe: async () => (await pendingSubscribe)()\n };\n },\n withProperties: clause => {\n const definitionMap = new Map();\n const derivedProperties = {};\n for (const key of Object.keys(clause)) {\n const derivedPropertyDefinition = clause[key](createWithPropertiesObjectSet(objectType, {\n type: \"methodInput\"\n }, definitionMap, true));\n derivedProperties[key] = definitionMap.get(derivedPropertyDefinition);\n }\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"withProperties\",\n derivedProperties,\n objectSet\n });\n },\n narrowToType: objectTypeDef => {\n const existingMapping = clientCtx.narrowTypeInterfaceOrObjectMapping[objectTypeDef.apiName];\n !(!existingMapping || existingMapping === objectTypeDef.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${objectTypeDef.apiName} was previously used as an ${existingMapping}, but now used as a ${objectTypeDef.type}.`) : invariant(false) : void 0;\n clientCtx.narrowTypeInterfaceOrObjectMapping[objectTypeDef.apiName] = objectTypeDef.type;\n return clientCtx.objectSetFactory(objectTypeDef, clientCtx, {\n type: \"asType\",\n objectSet,\n entityType: objectTypeDef.apiName\n });\n },\n async *experimental_asyncIterLinks(links) {\n let $nextPageToken;\n do {\n const result = await fetchLinksPage(augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"asyncIterLinks\"\n })), objectType, objectSet, links);\n $nextPageToken = result.nextPageToken;\n for (const obj of result.data) {\n yield obj;\n }\n } while ($nextPageToken != null);\n },\n $objectSetInternals: {\n def: objectType\n }\n };\n function createSearchAround(link) {\n return () => {\n return clientCtx.objectSetFactory(objectType, clientCtx, objectType.type === \"object\" ? {\n type: \"searchAround\",\n objectSet,\n link\n } : {\n type: \"interfaceLinkSearchAround\",\n objectSet,\n interfaceLink: link\n });\n };\n }\n objectSetDefinitions.set(base, objectSet);\n\n // we are using a type assertion because the marker symbol defined in BaseObjectSet isn't actually used\n // at runtime.\n return base;\n}\nasync function createWithPk(clientCtx, objectType, objectSet, primaryKey) {\n const objDef = await clientCtx.ontologyProvider.getObjectDefinition(objectType.apiName);\n const withPk = {\n type: \"filter\",\n objectSet,\n where: {\n type: \"eq\",\n field: objDef.primaryKeyApiName,\n value: primaryKey\n }\n };\n return withPk;\n}\nfunction isTextQuery(query) {\n return typeof query === \"string\";\n}","/*\n * Copyright 2024 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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _upload = [1, \"/v2/ontologies/attachments/upload\", 7, \"*/*\"];\n/**\n * Upload an attachment to use in an action. Any attachment which has not been linked to an object via\n * an action within one hour after upload will be removed.\n * Previously mapped attachments which are not connected to any object anymore are also removed on\n * a biweekly basis.\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-write]\n * URL: /v2/ontologies/attachments/upload\n */\nexport function upload($ctx, ...args) {\n const headerParams = {\n ...args[2],\n \"Content-Type\": args[2]?.[\"Content-Type\"] ?? args[0].type,\n \"Content-Length\": args[0].size.toString()\n };\n return $foundryPlatformFetch($ctx, _upload, args[0], args[1], headerParams);\n}\nconst _uploadWithRid = [1, \"/v2/ontologies/attachments/upload/{0}\", 7, \"*/*\"];\n/**\n * This endpoint is identical to `/v2/ontologies/attachments/upload` but additionally accepts a previously\n * generated `AttachmentRid`.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-write]\n * URL: /v2/ontologies/attachments/upload/{attachmentRid}\n */\nexport function uploadWithRid($ctx, ...args) {\n const headerParams = {\n ...args[3],\n \"Content-Type\": args[3]?.[\"Content-Type\"] ?? args[1].type,\n \"Content-Length\": args[1].size.toString()\n };\n return $foundryPlatformFetch($ctx, _uploadWithRid, args[0], args[1], args[2], headerParams);\n}\nconst _read = [0, \"/v2/ontologies/attachments/{0}/content\",,, \"*/*\"];\n/**\n * Get the content of an attachment.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/attachments/{attachmentRid}/content\n */\nexport function read($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _read, ...args);\n}\nconst _get = [0, \"/v2/ontologies/attachments/{0}\"];\n/**\n * Get the metadata of an attachment.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/attachments/{attachmentRid}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}","/*\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\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.27.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\n\nconst ErrorMessage = Symbol(\"ErrorMessage\");","/*\n * Copyright 2024 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 * as Attachments from \"@osdk/foundry.ontologies/Attachment\";\nimport { additionalContext } from \"../Client.js\";\n/**\n * Helper function to create an attachment type from a rid\n * @param client - An OSDK client.\n * @param rid - The rid of attachment in Foundry.\n * @returns An OSDK attachment object\n */\nexport function hydrateAttachmentFromRid(client, rid) {\n return hydrateAttachmentFromRidInternal(client[additionalContext], rid);\n}\n\n/** @internal */\nexport function hydrateAttachmentFromRidInternal(client, rid) {\n return {\n rid,\n async fetchContents() {\n return Attachments.read(client, rid);\n },\n async fetchMetadata() {\n const r = await Attachments.get(client, rid);\n return {\n ...r,\n sizeBytes: Number(r.sizeBytes)\n };\n }\n };\n}","/*\n * Copyright 2024 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 { MediaSets } from \"@osdk/foundry.mediasets\";\nimport invariant from \"tiny-invariant\";\nimport { additionalContext } from \"./Client.js\";\nexport function createMediaFromReference(client, mediaReference) {\n return createMediaFromReferenceInternal(client[additionalContext], mediaReference);\n}\nexport function createMediaFromReferenceInternal(client, mediaReference) {\n const {\n mediaSetRid,\n mediaItemRid\n } = mediaReference.reference.mediaSetViewItem;\n const token = mediaReference.reference.mediaSetViewItem.token;\n return {\n async fetchContents() {\n return MediaSets.read(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n },\n async fetchMetadata() {\n const info = await MediaSets.info(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n !(info.sizeBytes != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected sizeBytes in media info\") : invariant(false) : void 0;\n !(info.mimeType != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected mimeType in media info\") : invariant(false) : void 0;\n return {\n path: info.path,\n sizeBytes: info.sizeBytes,\n mediaType: info.mimeType\n };\n },\n getMediaReference() {\n return mediaReference;\n }\n };\n}"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkCAUXOFUO_cjs = require('./chunk-CAUXOFUO.cjs');
4
- var chunkZFNHWPQA_cjs = require('./chunk-ZFNHWPQA.cjs');
5
- var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
3
+ var chunkYLVUONG3_cjs = require('./chunk-YLVUONG3.cjs');
4
+ var chunkHRWHTCP3_cjs = require('./chunk-HRWHTCP3.cjs');
5
+ var chunkH6PXPU6F_cjs = require('./chunk-H6PXPU6F.cjs');
6
6
  var invariant = require('tiny-invariant');
7
7
 
8
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -128,10 +128,10 @@ function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {
128
128
  return ObjectSpecifier.split(":")[1];
129
129
  }
130
130
 
131
- // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
131
+ // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
132
132
  var _execute = [1, "/v2/ontologies/{0}/queries/{1}/execute", 7];
133
133
  function execute($ctx, ...args) {
134
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _execute, ...args);
134
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _execute, ...args);
135
135
  }
136
136
 
137
137
  // src/object/mediaUpload.ts
@@ -184,13 +184,13 @@ async function toDataValueQueries(value, client, desiredType) {
184
184
  switch (desiredType.type) {
185
185
  case "attachment": {
186
186
  if (isAttachmentUpload(value)) {
187
- const attachment = await chunkCAUXOFUO_cjs.upload(client, value.data, {
187
+ const attachment = await chunkYLVUONG3_cjs.upload(client, value.data, {
188
188
  filename: value.name
189
189
  });
190
190
  return attachment.rid;
191
191
  }
192
192
  if (isAttachmentFile(value)) {
193
- const attachment = await chunkCAUXOFUO_cjs.upload(client, value, {
193
+ const attachment = await chunkYLVUONG3_cjs.upload(client, value, {
194
194
  filename: value.name
195
195
  });
196
196
  return attachment.rid;
@@ -209,7 +209,7 @@ async function toDataValueQueries(value, client, desiredType) {
209
209
  }
210
210
  case "mediaReference": {
211
211
  if (isMediaUpload(value)) {
212
- const mediaRef = await chunkZFNHWPQA_cjs.MediaSet_exports.uploadMedia(client, value.data, {
212
+ const mediaRef = await chunkHRWHTCP3_cjs.MediaSet_exports.uploadMedia(client, value.data, {
213
213
  filename: value.fileName,
214
214
  preview: true
215
215
  });
@@ -246,11 +246,11 @@ async function toDataValueQueries(value, client, desiredType) {
246
246
  }
247
247
  case "objectSet":
248
248
  case "interfaceObjectSet": {
249
- if (chunkCAUXOFUO_cjs.isWireObjectSet(value)) {
249
+ if (chunkYLVUONG3_cjs.isWireObjectSet(value)) {
250
250
  return value;
251
251
  }
252
- if (chunkCAUXOFUO_cjs.isObjectSet(value)) {
253
- return chunkCAUXOFUO_cjs.getWireObjectSet(value);
252
+ if (chunkYLVUONG3_cjs.isObjectSet(value)) {
253
+ return chunkYLVUONG3_cjs.getWireObjectSet(value);
254
254
  }
255
255
  break;
256
256
  }
@@ -295,7 +295,7 @@ async function applyQuery(client, query, params) {
295
295
  if (client.flushEdits != null) {
296
296
  await client.flushEdits();
297
297
  }
298
- const response = await execute(chunkCAUXOFUO_cjs.addUserAgentAndRequestContextHeaders(chunkCAUXOFUO_cjs.augmentRequestContext(client, (_) => ({
298
+ const response = await execute(chunkYLVUONG3_cjs.addUserAgentAndRequestContextHeaders(chunkYLVUONG3_cjs.augmentRequestContext(client, (_) => ({
299
299
  finalMethodCall: "applyQuery"
300
300
  })), query), await client.ontologyRid, query.apiName, {
301
301
  parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}
@@ -341,10 +341,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
341
341
  return responseValue;
342
342
  }
343
343
  case "attachment": {
344
- return chunkCAUXOFUO_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
344
+ return chunkYLVUONG3_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
345
345
  }
346
346
  case "mediaReference": {
347
- return chunkCAUXOFUO_cjs.createMediaFromReferenceInternal(client, responseValue);
347
+ return chunkYLVUONG3_cjs.createMediaFromReferenceInternal(client, responseValue);
348
348
  }
349
349
  case "object": {
350
350
  const def = definitions.get(responseDataType.object);
@@ -366,7 +366,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
366
366
  throw new Error(`Missing definition for ${responseDataType.objectSet}`);
367
367
  }
368
368
  if (typeof responseValue === "string") {
369
- return chunkCAUXOFUO_cjs.createObjectSet(def, client, {
369
+ return chunkYLVUONG3_cjs.createObjectSet(def, client, {
370
370
  type: "intersect",
371
371
  objectSets: [{
372
372
  type: "base",
@@ -377,7 +377,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
377
377
  }]
378
378
  });
379
379
  }
380
- return chunkCAUXOFUO_cjs.createObjectSet(def, client, responseValue);
380
+ return chunkYLVUONG3_cjs.createObjectSet(def, client, responseValue);
381
381
  }
382
382
  case "struct": {
383
383
  for (const [key, subtype] of Object.entries(responseDataType.struct)) {
@@ -562,5 +562,5 @@ exports.parseNdjsonStream = parseNdjsonStream;
562
562
  exports.parseStreamedResponse = parseStreamedResponse;
563
563
  exports.remapQueryParams = remapQueryParams;
564
564
  exports.remapQueryResponse = remapQueryResponse;
565
- //# sourceMappingURL=chunk-42JVCEPG.cjs.map
566
- //# sourceMappingURL=chunk-42JVCEPG.cjs.map
565
+ //# sourceMappingURL=chunk-YRGYLMU5.cjs.map
566
+ //# sourceMappingURL=chunk-YRGYLMU5.cjs.map