@osdk/client 0.19.0-main-20240514165152 → 0.19.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 (50) hide show
  1. package/CHANGELOG.md +8 -7
  2. package/build/js/{chunk-RT4GKC7U.cjs → chunk-OLO4AGDC.cjs} +65 -14
  3. package/build/js/chunk-OLO4AGDC.cjs.map +1 -0
  4. package/build/js/{chunk-AHHOQAZP.browser.mjs → chunk-RRZAWVXI.browser.mjs} +65 -15
  5. package/build/js/chunk-RRZAWVXI.browser.mjs.map +1 -0
  6. package/build/js/{chunk-6KXV66OI.mjs → chunk-UFAOLLVO.mjs} +65 -15
  7. package/build/js/chunk-UFAOLLVO.mjs.map +1 -0
  8. package/build/js/index.browser.mjs +1 -1
  9. package/build/js/index.cjs +3 -3
  10. package/build/js/index.mjs +1 -1
  11. package/build/js/public/unstable-do-not-use.browser.mjs +296 -66
  12. package/build/js/public/unstable-do-not-use.browser.mjs.map +1 -1
  13. package/build/js/public/unstable-do-not-use.cjs +300 -70
  14. package/build/js/public/unstable-do-not-use.cjs.map +1 -1
  15. package/build/js/public/unstable-do-not-use.mjs +296 -66
  16. package/build/js/public/unstable-do-not-use.mjs.map +1 -1
  17. package/build/types/__unstable/ConjureSupport.d.ts +55 -0
  18. package/build/types/__unstable/ConjureSupport.d.ts.map +1 -0
  19. package/build/types/{UNSTABLE_createClient.d.ts → __unstable/UNSTABLE_createClient.d.ts} +1 -1
  20. package/build/types/__unstable/UNSTABLE_createClient.d.ts.map +1 -0
  21. package/build/types/__unstable/UnstableClient.d.ts +13 -0
  22. package/build/types/__unstable/UnstableClient.d.ts.map +1 -0
  23. package/build/types/__unstable/createBulkLinksAsyncIterFactory.d.ts +10 -0
  24. package/build/types/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -0
  25. package/build/types/createClient.d.ts.map +1 -1
  26. package/build/types/object/Cache.d.ts +42 -5
  27. package/build/types/object/Cache.d.ts.map +1 -1
  28. package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
  29. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +1 -7
  30. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -1
  31. package/build/types/objectSet/toConjureObjectSet.d.ts +1 -1
  32. package/build/types/objectSet/toConjureObjectSet.d.ts.map +1 -1
  33. package/build/types/ontology/OntologyProvider.d.ts +3 -1
  34. package/build/types/ontology/OntologyProvider.d.ts.map +1 -1
  35. package/build/types/ontology/StandardOntologyProvider.d.ts.map +1 -1
  36. package/build/types/ontology/loadFullObjectMetadata.d.ts +3 -1
  37. package/build/types/ontology/loadFullObjectMetadata.d.ts.map +1 -1
  38. package/build/types/ontology/makeConjureContext.d.ts +4 -0
  39. package/build/types/ontology/makeConjureContext.d.ts.map +1 -0
  40. package/build/types/pageRequestAsAsyncIter.d.ts +10 -0
  41. package/build/types/pageRequestAsAsyncIter.d.ts.map +1 -0
  42. package/build/types/public/unstable-do-not-use.d.ts +2 -2
  43. package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
  44. package/package.json +7 -7
  45. package/build/js/chunk-6KXV66OI.mjs.map +0 -1
  46. package/build/js/chunk-AHHOQAZP.browser.mjs.map +0 -1
  47. package/build/js/chunk-RT4GKC7U.cjs.map +0 -1
  48. package/build/types/UNSTABLE_createClient.d.ts.map +0 -1
  49. package/build/types/UnstableClient.d.ts +0 -10
  50. package/build/types/UnstableClient.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,20 +1,21 @@
1
1
  # @osdk/client
2
2
 
3
- ## 0.19.0-main-20240514165152
3
+ ## 0.19.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
+ - 0a64def: Adds experimental batch link support
8
+ - f9b3c72: Support importing the unstable-do-not-use from moduleResolution: node
9
+ - 978ecd5: Rexport PalantirApiError
10
+ - 978ecd5: Client is now usable for calling Platform SDK
7
11
  - c9f3214: Interfaces are now mapped as views
8
12
 
9
13
  ### Patch Changes
10
14
 
11
- - f9b3c72: Support importing the unstable-do-not-use from moduleResolution: node
12
- - 978ecd5: Rexport PalantirApiError
13
- - 978ecd5: Client is now usable for calling Platform SDK
14
15
  - Updated dependencies [c9f3214]
15
- - @osdk/api@1.8.0-main-20240514165152
16
- - @osdk/generator-converters@0.5.1-main-20240514165152
17
- - @osdk/shared.net@1.10.1-main-20240514165152
16
+ - @osdk/api@1.8.0
17
+ - @osdk/generator-converters@0.6.0
18
+ - @osdk/shared.net@1.11.0
18
19
 
19
20
  ## 0.18.0
20
21
 
@@ -506,7 +506,7 @@ function isAttachment(o) {
506
506
  }
507
507
 
508
508
  // src/object/Cache.ts
509
- function createCache(fn) {
509
+ function createClientCache(fn) {
510
510
  const cache = /* @__PURE__ */ new WeakMap();
511
511
  function get(client, key) {
512
512
  if (cache.get(client) == null) {
@@ -537,7 +537,7 @@ function createCache(fn) {
537
537
  remove
538
538
  };
539
539
  }
540
- function createAsyncCache(fn, createCacheLocal = createCache) {
540
+ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
541
541
  const cache = createCacheLocal();
542
542
  const inProgress = createCacheLocal();
543
543
  const ret = {
@@ -561,6 +561,52 @@ function createAsyncCache(fn, createCacheLocal = createCache) {
561
561
  };
562
562
  return ret;
563
563
  }
564
+ function createSimpleCache(map = /* @__PURE__ */ new Map(), fn) {
565
+ function get(key) {
566
+ let r = map.get(key);
567
+ if (r === void 0 && fn !== void 0) {
568
+ return set(key, fn(key));
569
+ } else {
570
+ return r;
571
+ }
572
+ }
573
+ function set(key, value) {
574
+ map.set(key, value);
575
+ return value;
576
+ }
577
+ function remove(key) {
578
+ return map.delete(key);
579
+ }
580
+ return {
581
+ get,
582
+ set,
583
+ remove
584
+ };
585
+ }
586
+ function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache) {
587
+ const cache = createCacheLocal(type === "weak" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
588
+ const inProgress = createCacheLocal(type === "weak" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
589
+ const ret = {
590
+ getOrUndefined: function getOrUndefined(key) {
591
+ return cache.get(key);
592
+ },
593
+ get: async function get(key) {
594
+ return cache.get(key) ?? inProgress.get(key) ?? ret.set(key, fn(key));
595
+ },
596
+ set: async function set(k, v) {
597
+ try {
598
+ const r = await inProgress.set(k, v);
599
+ cache.set(k, r);
600
+ inProgress.remove(k);
601
+ return r;
602
+ } catch (e) {
603
+ inProgress.remove(k);
604
+ throw e;
605
+ }
606
+ }
607
+ };
608
+ return ret;
609
+ }
564
610
 
565
611
  // src/object/convertWireToOsdkObjects.ts
566
612
  var OriginClient = Symbol();
@@ -694,12 +740,13 @@ function createConverter(objDef) {
694
740
  }
695
741
  } : void 0;
696
742
  }
697
- var protoConverterCache = createCache((client, objectDef) => {
743
+ var protoConverterCache = createClientCache((client, objectDef) => {
698
744
  const proto = createPrototype(objectDef, client);
699
745
  const converter = createConverter(objectDef);
700
746
  return [proto, converter];
701
747
  });
702
748
  async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false) {
749
+ client.logger?.debug(`START convertWireToOsdkObjects()`);
703
750
  if (forceRemoveRid) {
704
751
  for (const obj of objects) {
705
752
  delete obj.__rid;
@@ -734,15 +781,13 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
734
781
  }
735
782
  internalConvertObjectInPlace(objectDef, client, obj);
736
783
  }
737
- if (interfaceApiName) {
738
- return objects.map((o) => o.$as(interfaceApiName));
739
- } else {
740
- return objects;
741
- }
784
+ const ret = interfaceApiName ? objects.map((o) => o.$as(interfaceApiName)) : objects;
785
+ client.logger?.debug(`END convertWireToOsdkObjects()`);
786
+ return ret;
742
787
  }
743
788
  function createLocalObjectCacheAndInitiatePreseed(objects, client) {
744
- const localInterfaceCache = createAsyncCache((client2, apiName) => client2.ontologyProvider.getInterfaceDefinition(apiName));
745
- const localObjectCache = createAsyncCache(async (client2, apiName) => {
789
+ const localInterfaceCache = createAsyncClientCache((client2, apiName) => client2.ontologyProvider.getInterfaceDefinition(apiName));
790
+ const localObjectCache = createAsyncClientCache(async (client2, apiName) => {
746
791
  const objectDef = await client2.ontologyProvider.getObjectDefinition(apiName);
747
792
  const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map((i) => localInterfaceCache.get(client2, i)) ?? [])).map((i) => [i.apiName, i]));
748
793
  if (objectDef[InterfaceDefinitions] == null) {
@@ -990,7 +1035,12 @@ async function loadFullObjectMetadata(client, objtype) {
990
1035
  const full = await getObjectTypeFullMetadata(client, client.ontologyRid, objtype, {
991
1036
  preview: true
992
1037
  });
993
- return generatorConverters.wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
1038
+ const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
1039
+ client.logger?.debug(`END loadFullObjectMetadata(${objtype})`);
1040
+ return {
1041
+ ...ret,
1042
+ rid: full.objectType.rid
1043
+ };
994
1044
  }
995
1045
  async function loadInterfaceDefinition(client, objtype) {
996
1046
  const r = await getInterfaceType(client, client.ontologyRid, objtype, {
@@ -1015,7 +1065,7 @@ var createStandardOntologyProviderFactory = (client) => {
1015
1065
  }
1016
1066
  }
1017
1067
  function makeGetter(fn) {
1018
- const cache = createAsyncCache((client3, key) => fn(client3, key, false));
1068
+ const cache = createAsyncClientCache((client3, key) => fn(client3, key, false));
1019
1069
  return async (apiName) => {
1020
1070
  const n = alwaysRevalidate ? await fn(client2, apiName, true) : await cache.get(client2, apiName);
1021
1071
  if (alwaysRevalidate) {
@@ -1039,7 +1089,7 @@ var createStandardOntologyProviderFactory = (client) => {
1039
1089
  };
1040
1090
 
1041
1091
  // src/util/UserAgent.ts
1042
- var USER_AGENT = `osdk-client/${"0.19.0-main-20240514165152"}`;
1092
+ var USER_AGENT = `osdk-client/${"0.19.0"}`;
1043
1093
 
1044
1094
  // src/createMinimalClient.ts
1045
1095
  function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {
@@ -1093,5 +1143,6 @@ exports.convertWireToOsdkObjects = convertWireToOsdkObjects;
1093
1143
  exports.createClient = createClient;
1094
1144
  exports.createClientInternal = createClientInternal;
1095
1145
  exports.createObjectSet = createObjectSet;
1146
+ exports.createSimpleAsyncCache = createSimpleAsyncCache;
1096
1147
  //# sourceMappingURL=out.js.map
1097
- //# sourceMappingURL=chunk-RT4GKC7U.cjs.map
1148
+ //# sourceMappingURL=chunk-OLO4AGDC.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../internal.foundry/build/js/public/OntologiesV2_OntologyObjectSet.mjs","../../../internal.foundry/build/js/public/OntologiesV2_OntologyObjectV2.mjs","../../src/util/addUserAgent.ts","../../src/object/convertWireToOsdkObjects.ts","../../src/internal/conversions/legacyToModernSingleAggregationResult.ts","../../src/internal/conversions/modernToLegacyAggregationClause.ts","../../src/query/aggregations/GroupByClause.ts","../../src/internal/conversions/modernToLegacyGroupByClause.ts","../../src/internal/conversions/modernToLegacyWhereClause.ts","../../src/query/WhereClause.ts","../../src/object/fetchSingle.ts","../../src/object/aggregate.ts","../../src/util/WireObjectSet.ts","../../src/objectSet/createObjectSet.ts","../../src/object/Attachment.ts","../../src/object/Cache.ts","../../src/object/fetchPage.ts","../../src/actions/ActionValidationError.ts","../../src/createClient.ts","../../../internal.foundry/build/js/public/OntologiesV2_Action.mjs","../../src/util/isOntologyObjectV2.ts","../../src/util/toDataValue.ts","../../src/actions/applyAction.ts","../../src/actions/createActionInvoker.ts","../../src/createMinimalClient.ts","../../src/ontology/StandardOntologyProvider.ts","../../../internal.foundry/build/js/public/OntologiesV2_OntologyV2.mjs","../../src/ontology/loadFullObjectMetadata.ts","../../src/ontology/loadInterfaceDefinition.ts","../../src/util/UserAgent.ts"],"names":["foundryPlatformFetch","invariant","client","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectTypeDefinition"],"mappings":";AAAA,SAAS,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AM,OAAO,CAAC,QAAQ,WAAW,SAAS,KAAK,CAAC,QAAQ,WAAW,UAAU,IAAI,qDAAqD;AACtI,YAAM,IAAI,MAAM,sBAAsB,OAAO,GAAG,IAAI,EAAE;AAAA,IACxD;AAAA,EACF;AACA,QAAM,gBAAgB;AAAA,IACpB,GAAG,0BAA0B,SAAS,eAAe,YAAY,OAAO;AAAA,IACxE;AAAA,IACA,aAAa,SAAS;AAAA,IACtB,QAAQ,QAAQ;AAAA,EAClB;AACA,SAAO,OAAO,OAAO,eAAe;AAAA,IAClC,kBAAkB,sCAAsC,OAAO,EAAE,aAAa;AAAA,EAChF,CAAC;AACH;;;ANlBO,SAAS,qBAAqB,kBAErC,SAAS,aAAa,eAAe,UAAU,QAAW,UAAU,OAAO;AACzE,QAAM,YAAY,oBAAoB;AAAA,IACpC;AAAA,EACF,GAAG,SAAS,eAAe,SAAS,SAAS,gBAAgB;AAC7D,WAAS,SAAS,GAAG;AACnB,QAAI,EAAE,SAAS,YAAY,EAAE,SAAS,aAAa;AACjD,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,iBAAiB,GAAG,SAAS;AAAA,IACtC,WAAW,EAAE,SAAS,UAAU;AAC9B,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,oBAAoB,WAAW,CAAC;AAAA,IACzC,OAAO;AACL,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACnC;AAAA,EACF;AACA,QAAM,SAAS,OAAO,iBAAiB,UAAU;AAAA,IAC/C,CAAC,mBAAmB,GAAG;AAAA,MACrB,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AACD,SAAO;AACT;AACO,IAAM,eAAe,qBAAqB,KAAK,QAAW,eAAe","sourcesContent":["import { foundryPlatformFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_OntologyObjectSet.ts\nvar _createTemporaryObjectSetV2 = [1, \"/v2/ontologies/{0}/objectSets/createTemporary\", 1];\nfunction createTemporaryObjectSetV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _createTemporaryObjectSetV2, ...args);\n}\nvar _getObjectSetV2 = [0, \"/v2/ontologies/{0}/objectSets/{1}\"];\nfunction getObjectSetV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getObjectSetV2, ...args);\n}\nvar _loadObjectSetV2 = [1, \"/v2/ontologies/{0}/objectSets/loadObjects\", 3];\nfunction loadObjectSetV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _loadObjectSetV2, ...args);\n}\nvar _aggregateObjectSetV2 = [1, \"/v2/ontologies/{0}/objectSets/aggregate\", 3];\nfunction aggregateObjectSetV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _aggregateObjectSetV2, ...args);\n}\nexport { aggregateObjectSetV2, createTemporaryObjectSetV2, getObjectSetV2, loadObjectSetV2 };","import { foundryPlatformFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_OntologyObjectV2.ts\nvar _listObjectsV2 = [0, \"/v2/ontologies/{0}/objects/{1}\", 2];\nfunction listObjectsV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _listObjectsV2, ...args);\n}\nvar _getObjectV2 = [0, \"/v2/ontologies/{0}/objects/{1}/{2}\", 2];\nfunction getObjectV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getObjectV2, ...args);\n}\nvar _countObjects = [1, \"/v2/ontologies/{0}/objects/{1}/count\", 2];\nfunction countObjects($ctx, ...args) {\n return foundryPlatformFetch($ctx, _countObjects, ...args);\n}\nvar _searchObjectsV2 = [1, \"/v2/ontologies/{0}/objects/{1}/search\", 3];\nfunction searchObjectsV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _searchObjectsV2, ...args);\n}\nvar _aggregateObjectsV2 = [1, \"/v2/ontologies/{0}/objects/{1}/aggregate\", 3];\nfunction aggregateObjectsV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _aggregateObjectsV2, ...args);\n}\nvar _listInterfaceTypes = [0, \"/v2/ontologies/{0}/interfaceTypes\", 2];\nfunction listInterfaceTypes($ctx, ...args) {\n return foundryPlatformFetch($ctx, _listInterfaceTypes, ...args);\n}\nvar _getInterfaceType = [0, \"/v2/ontologies/{0}/interfaceTypes/{1}\", 2];\nfunction getInterfaceType($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getInterfaceType, ...args);\n}\nvar _searchObjectsForInterface = [1, \"/v2/ontologies/{0}/interfaces/{1}/search\", 3];\nfunction searchObjectsForInterface($ctx, ...args) {\n return foundryPlatformFetch($ctx, _searchObjectsForInterface, ...args);\n}\nvar _aggregateObjectsForInterface = [1, \"/v2/ontologies/{0}/interfaces/{1}/aggregate\", 3];\nfunction aggregateObjectsForInterface($ctx, ...args) {\n return foundryPlatformFetch($ctx, _aggregateObjectsForInterface, ...args);\n}\nvar _listLinkedObjectsV2 = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/links/{3}\", 2];\nfunction listLinkedObjectsV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _listLinkedObjectsV2, ...args);\n}\nvar _getLinkedObjectV2 = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/links/{3}/{4}\", 2];\nfunction getLinkedObjectV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getLinkedObjectV2, ...args);\n}\nvar _getAttachmentsV2 = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}\", 2];\nfunction getAttachmentsV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getAttachmentsV2, ...args);\n}\nvar _getAttachmentByRidV2 = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}/{4}\", 2];\nfunction getAttachmentByRidV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getAttachmentByRidV2, ...args);\n}\nvar _getAttachmentContentV2 = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}/content\", 2,, \"*/*\"];\nfunction getAttachmentContentV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getAttachmentContentV2, ...args);\n}\nvar _getAttachmentContentByRidV2 = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}/{4}/content\", 2,, \"*/*\"];\nfunction getAttachmentContentByRidV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getAttachmentContentByRidV2, ...args);\n}\nvar _getFirstPoint = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint\", 2];\nfunction getFirstPoint($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getFirstPoint, ...args);\n}\nvar _getLastPoint = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint\", 2];\nfunction getLastPoint($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getLastPoint, ...args);\n}\nvar _streamPoints = [1, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamPoints\", 3,, \"*/*\"];\nfunction streamPoints($ctx, ...args) {\n return foundryPlatformFetch($ctx, _streamPoints, ...args);\n}\nvar _getObjectTypeFullMetadata = [0, \"/v2/ontologies/{0}/objectTypes/{1}/fullMetadata\", 2];\nfunction getObjectTypeFullMetadata($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getObjectTypeFullMetadata, ...args);\n}\nexport { aggregateObjectsForInterface, aggregateObjectsV2, countObjects, getAttachmentByRidV2, getAttachmentContentByRidV2, getAttachmentContentV2, getAttachmentsV2, getFirstPoint, getInterfaceType, getLastPoint, getLinkedObjectV2, getObjectTypeFullMetadata, getObjectV2, listInterfaceTypes, listLinkedObjectsV2, listObjectsV2, searchObjectsForInterface, searchObjectsV2, streamPoints };","/*\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 { createFetchHeaderMutator } from \"@osdk/shared.net\";\nexport function addUserAgent(client, withMetadata) {\n if (withMetadata.osdkMetadata) {\n return {\n ...client,\n fetch: createFetchHeaderMutator(client.fetch, headers => {\n headers.set(\"Fetch-User-Agent\", withMetadata.osdkMetadata.extraUserAgent);\n return headers;\n })\n };\n }\n return client;\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 { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport { createAsyncClientCache, createClientCache } from \"./Cache.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"./fetchSingle.js\";\nconst OriginClient = Symbol();\nconst UnderlyingObject = Symbol();\nconst InterfaceDefinitions = Symbol();\nclass LinkFetcherProxyHandler {\n constructor(objDef, primaryKey, client) {\n this.objDef = objDef;\n this.primaryKey = primaryKey;\n this.client = client;\n }\n get(_target, p) {\n const linkDef = this.objDef.links[p];\n if (linkDef == null) {\n return;\n }\n const objectSet = this.client.objectSetFactory(this.objDef, this.client).where({\n [this.objDef.primaryKeyApiName]: this.primaryKey\n }).pivotTo(p);\n if (!linkDef.multiplicity) {\n return {\n /** @deprecated */\n get: options => fetchSingle(this.client, this.objDef, options ?? {}, getWireObjectSet(objectSet)),\n fetchOne: options => fetchSingle(this.client, this.objDef, options ?? {}, getWireObjectSet(objectSet)),\n fetchOneWithErrors: options => fetchSingleWithErrors(this.client, this.objDef, options ?? {}, getWireObjectSet(objectSet))\n };\n } else {\n return objectSet;\n }\n }\n ownKeys() {\n return Object.keys(this.objDef.links);\n }\n getOwnPropertyDescriptor(target, p) {\n return {\n enumerable: true,\n configurable: true,\n get: () => {\n return this.get(target, p);\n }\n };\n }\n}\nfunction createPrototype(objDef, client) {\n if (process.env.NODE_ENV !== \"production\") {\n !(objDef.type === \"object\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected object definition\") : invariant(false) : void 0;\n }\n const sharedPropertyDefs = {\n $as: {\n value: $as\n }\n };\n // we can get away with a single interface proto\n const interfaceProto = Object.defineProperties({}, sharedPropertyDefs);\n const objectProto = Object.defineProperties({}, {\n $link: {\n get: function () {\n return new Proxy({}, new LinkFetcherProxyHandler(objDef, this[\"$primaryKey\"], client));\n }\n },\n ...sharedPropertyDefs\n });\n\n // We use the exact same logic for both the interface rep and the underlying rep\n function $as(newDef) {\n if (typeof newDef === \"string\") {\n if (newDef === objDef.apiName) {\n return this[UnderlyingObject];\n }\n\n // this is sufficient to determine if we implement the interface\n if (objDef.interfaceMap?.[newDef] == null) {\n throw new Error(`Object does not implement interface '${newDef}'.`);\n }\n\n // We dont need this currently but we may need it when we have interface links so\n // we will keep it for now\n const def = objDef[InterfaceDefinitions][newDef];\n if (!def) {\n throw new Error(`Object does not implement interface '${newDef}'.`);\n }\n newDef = def;\n } else if (newDef.apiName === objDef.apiName) {\n return this[UnderlyingObject];\n }\n if (newDef.type !== \"interface\" && newDef.apiName !== this.$apiName) {\n throw new Error(`'${newDef.apiName}' is not an interface of '${this.$objectType}'.`);\n }\n const underlying = this[UnderlyingObject];\n const common = {\n enumerable: true,\n configurable: true\n };\n\n // if we use a proxy here instead we can probably pull off interfaces reflecting the underlying object even if its updated\n\n // we are defining every time because it creates properties in the exact same order\n // keeping the meta classes down to one per interface/objecttype pair\n return Object.create(interfaceProto, {\n $apiName: {\n value: newDef.apiName,\n ...common\n },\n $objectType: {\n value: objDef.apiName,\n ...common\n },\n $primaryKey: {\n value: this[\"$primaryKey\"],\n ...common\n },\n ...Object.fromEntries(Object.keys(newDef.properties).map(p => {\n const value = underlying[objDef.interfaceMap[newDef.apiName][p]];\n return [p, {\n value,\n enumerable: value !== undefined\n }];\n })),\n [UnderlyingObject]: {\n value: underlying\n }\n });\n }\n return objectProto;\n}\n\n// preprocess the ontology definition to more quickly apply object conversions when needed\nfunction createConverter(objDef) {\n const steps = [];\n for (const [key, value] of Object.entries(objDef.properties)) {\n // attachments need a wrapper to provide functionality and to identify them at serialization time\n if (value.type === \"attachment\") {\n steps.push(o => {\n if (o[key] != null) {\n if (Array.isArray(o[key])) {\n o[key] = o[key].map(a => new Attachment(a.rid));\n } else {\n o[key] = new Attachment(o[key].rid);\n }\n }\n });\n }\n }\n return steps.length > 0 ? o => {\n for (const step of steps) {\n step(o);\n }\n } : undefined;\n}\nconst protoConverterCache = createClientCache((client, objectDef) => {\n const proto = createPrototype(objectDef, client);\n const converter = createConverter(objectDef);\n return [proto, converter];\n});\nconst isAfterFeb2024OrNewApis = false;\n\n/**\n * If interfaceApiName is not undefined, converts the instances of the\n * interface into their respective\n * underlying concrete types and then returns the $as() representation\n * for the consumers.\n *\n * Otherwise just does the conversion\n *\n * May mutate in place for performance reasons. If you need a clean copy,\n * keep it first.\n *\n * However, you must use the returned value, which will be whatever is correct.\n *\n * @internal\n * @param interfaceApiName - if undefined\n */\nexport async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false) {\n client.logger?.debug(`START convertWireToOsdkObjects()`);\n if (forceRemoveRid) {\n for (const obj of objects) {\n delete obj.__rid;\n }\n }\n fixObjectPropertiesInline(objects);\n\n /*\n We need to create a local cache for the life of this function.\n Because the user may have their global cache set to \"alwaysRevalidate\",\n we want to be able to avoid making N calls to load object/interface information.\n Our local cache will delegate to the global one but since it also caches,\n we can short circuit the `alwaysRevalidate` logic.\n This tradeoff is slightly less accurate than `alwaysRevalidate` but is close\n enough given we got back objects at T-3 and if the types are inconsistent for\n T-2 and T-1, then they are guarenteed wrong for T-3. No matter what\n the user will get a failure case here. So we avoid the extra work.\n */\n const localObjectCache = createLocalObjectCacheAndInitiatePreseed(objects, client);\n for (const obj of objects) {\n const objectDef = await localObjectCache.get(client, obj.$apiName);\n if (objectDef == null) {\n throw new Error(`Failed to find ontology definition for '${obj.$apiName}'`);\n }\n if (interfaceApiName !== undefined) {\n // API returns interface spt names but we cache by real values\n if (objectDef.interfaceMap?.[interfaceApiName] == null) {\n const warning = \"Interfaces are only supported 'as views' but your metadata object is missing the correct information. This suggests your interfaces have not been migrated to the newer version yet and you cannot use this version of the SDK.\";\n if (client.logger) {\n client.logger.warn(warning);\n } else {\n // eslint-disable-next-line no-console\n console.error(`WARNING! ${warning}`);\n }\n throw new Error(warning);\n }\n for (const [sptProp, regularProp] of Object.entries(objectDef.interfaceMap[interfaceApiName])) {\n if (sptProp in obj) {\n const value = obj[sptProp];\n delete obj[sptProp];\n if (value !== undefined) {\n obj[regularProp] = value;\n }\n }\n }\n }\n internalConvertObjectInPlace(objectDef, client, obj);\n }\n const ret = interfaceApiName ? objects.map(o => o.$as(interfaceApiName))\n // we did the conversion so we can cast\n : objects;\n client.logger?.debug(`END convertWireToOsdkObjects()`);\n return ret;\n}\nfunction createLocalObjectCacheAndInitiatePreseed(objects, client) {\n // local cache delegates to the global one\n const localInterfaceCache = createAsyncClientCache((client, apiName) => client.ontologyProvider.getInterfaceDefinition(apiName));\n const localObjectCache = createAsyncClientCache(async (client, apiName) => {\n // first delegate to the global cache\n const objectDef = await client.ontologyProvider.getObjectDefinition(apiName);\n\n // ensure we have all of the interfaces loaded\n const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map(i => localInterfaceCache.get(client, i)) ?? [])).map(i => [i.apiName, i]));\n\n // save interfaces for later if not the first time\n if (objectDef[InterfaceDefinitions] == null) {\n Object.defineProperty(objectDef, InterfaceDefinitions, {\n value: interfaceDefs,\n enumerable: false,\n configurable: false,\n writable: false\n });\n }\n return objectDef;\n });\n const uniqueApiNames = new Set();\n for (const {\n $apiName\n } of objects) {\n if (uniqueApiNames.has($apiName)) continue;\n uniqueApiNames.add($apiName);\n // preseed the object cache without blocking\n // N.B localObjectCache will preseed the interface cache\n localObjectCache.get(client, $apiName);\n }\n return localObjectCache;\n}\nfunction fixObjectPropertiesInline(objs) {\n for (const obj of objs) {\n if (obj.__rid) {\n obj.$rid = obj.__rid;\n delete obj.__rid;\n }\n\n // Backend returns as __apiName but we want to stick to $ structure\n obj.$apiName = obj.__apiName;\n\n // for now these are the same but when we start doing interface projections the $objectType will always be underlying and\n // the $apiName will be for the current view (in current designs)\n obj.$objectType = obj.__apiName;\n\n // copying over for now as its always returned. In the future, this should just be inferred from underlying\n obj.$primaryKey = obj.__primaryKey;\n\n // After Feb 2024 (unless we have new apis):\n if (isAfterFeb2024OrNewApis) {\n delete obj.__apiName;\n delete obj.__primaryKey;\n } else {\n // Hide these from things like `console.log` so that people\n // don't think to use them.\n Object.defineProperties(obj, {\n \"__apiName\": {\n enumerable: false\n },\n \"__primaryKey\": {\n enumerable: false\n }\n });\n }\n }\n}\nfunction internalConvertObjectInPlace(objectDef, client, obj) {\n const [proto, converter] = protoConverterCache.get(client, objectDef);\n Object.setPrototypeOf(obj, proto);\n Object.defineProperties(obj, {\n [OriginClient]: {\n value: client\n },\n [UnderlyingObject]: {\n value: obj\n }\n });\n if (converter) {\n converter(obj);\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 invariant from \"tiny-invariant\";\nexport function legacyToModernSingleAggregationResult(entry) {\n return entry.metrics.reduce((accumulator, curValue) => {\n const parts = curValue.name.split(\".\");\n if (parts[0] === \"count\") {\n return accumulator;\n }\n !(parts.length === 2) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"assumed we were getting a `${key}.${type}`\") : invariant(false) : void 0;\n if (!(parts[0] in accumulator)) {\n accumulator[parts[0]] = {};\n }\n accumulator[parts[0]][parts[1]] = curValue.value;\n return accumulator;\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\nexport function modernToLegacyAggregationClause(select) {\n return Object.entries(select).flatMap(([k, v]) => {\n if (k === \"$count\") {\n if (v) return {\n type: \"count\",\n name: \"count\"\n };\n return [];\n } else if (Array.isArray(v)) {\n return v.map(v2 => {\n return {\n type: v2,\n name: `${k}.${v2}`,\n field: k\n };\n });\n } else {\n return [{\n type: v,\n // FIXME v has additional possible values\n name: `${k}.${v}`,\n field: k\n }];\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\nexport const DurationMapping = {\n \"sec\": \"SECONDS\",\n \"seconds\": \"SECONDS\",\n \"min\": \"MINUTES\",\n \"minute\": \"MINUTES\",\n \"minutes\": \"MINUTES\",\n \"hr\": \"HOURS\",\n \"hrs\": \"HOURS\",\n \"hour\": \"HOURS\",\n \"hours\": \"HOURS\",\n \"day\": \"DAYS\",\n \"days\": \"DAYS\",\n \"wk\": \"WEEKS\",\n \"week\": \"WEEKS\",\n \"weeks\": \"WEEKS\",\n \"mos\": \"MONTHS\",\n \"month\": \"MONTHS\",\n \"months\": \"MONTHS\",\n \"yr\": \"YEARS\",\n \"year\": \"YEARS\",\n \"years\": \"YEARS\",\n \"quarter\": \"QUARTERS\",\n \"quarters\": \"QUARTERS\"\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 \"../../query/aggregations/GroupByClause.js\";\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 (\"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 invariant from \"tiny-invariant\";\nimport { DistanceUnitMapping } from \"../../query/WhereClause.js\";\nexport function modernToLegacyWhereClause(whereClause) {\n if (\"$and\" in whereClause) {\n return {\n type: \"and\",\n value: whereClause.$and.map(modernToLegacyWhereClause)\n };\n } else if (\"$or\" in whereClause) {\n return {\n type: \"or\",\n value: whereClause.$or.map(modernToLegacyWhereClause)\n };\n } else if (\"$not\" in whereClause) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(whereClause.$not)\n };\n }\n const parts = Object.entries(whereClause);\n if (parts.length === 1) {\n return handleWherePair(parts[0]);\n }\n return {\n type: \"and\",\n value: parts.map(handleWherePair)\n };\n}\nfunction makeGeoFilterBbox(field, bbox, filterType) {\n return {\n type: filterType === \"$within\" ? \"withinBoundingBox\" : \"intersectsBoundingBox\",\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}\nfunction makeGeoFilterPolygon(field, coordinates, filterType) {\n return {\n type: filterType,\n field,\n value: {\n type: \"Polygon\",\n coordinates\n }\n };\n}\nfunction handleWherePair([field, filter]) {\n !(filter != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Defined key values are only allowed when they are not undefined.\") : invariant(false) : void 0;\n if (typeof filter === \"string\" || typeof filter === \"number\" || typeof filter === \"boolean\") {\n return {\n type: \"eq\",\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, \"WhereClause Filter with multiple clauses isn't allowed\") : invariant(false) : void 0;\n if (!hasDollarSign) {\n // Future case for structs\n throw new Error(`Unsupported filter. Did you forget to use a $-prefixed filter? (${JSON.stringify(filter)})`);\n }\n const firstKey = keysOfFilter[0];\n !(filter[firstKey] != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n field,\n value: filter[firstKey]\n }\n };\n }\n if (firstKey === \"$within\") {\n const withinBody = filter[firstKey];\n if (Array.isArray(withinBody)) {\n return makeGeoFilterBbox(field, withinBody, firstKey);\n } else if (\"bbox\" in withinBody && !(\"type\" in withinBody)) {\n return makeGeoFilterBbox(field, withinBody.bbox, firstKey);\n } else if (\"distance\" in withinBody && \"of\" in withinBody) {\n return {\n type: \"withinDistanceOf\",\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(field, coordinates, \"withinPolygon\");\n }\n }\n if (firstKey === \"$intersects\") {\n const intersectsBody = filter[firstKey];\n if (Array.isArray(intersectsBody)) {\n return makeGeoFilterBbox(field, intersectsBody, firstKey);\n } else if (\"bbox\" in intersectsBody && !(\"type\" in intersectsBody)) {\n return makeGeoFilterBbox(field, intersectsBody.bbox, firstKey);\n } else {\n const coordinates = \"polygon\" in intersectsBody ? intersectsBody.polygon : intersectsBody.coordinates;\n return makeGeoFilterPolygon(field, coordinates, \"intersectsPolygon\");\n }\n }\n return {\n type: firstKey.substring(1),\n field,\n value: filter[firstKey]\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\n// We need to conditional here to force the union to be distributed\n\nexport const DistanceUnitMapping = {\n \"centimeter\": \"CENTIMETERS\",\n \"centimeters\": \"CENTIMETERS\",\n \"cm\": \"CENTIMETERS\",\n \"meter\": \"METERS\",\n \"meters\": \"METERS\",\n \"m\": \"METERS\",\n \"kilometer\": \"KILOMETERS\",\n \"kilometers\": \"KILOMETERS\",\n \"km\": \"KILOMETERS\",\n \"inch\": \"INCHES\",\n \"inches\": \"INCHES\",\n \"foot\": \"FEET\",\n \"feet\": \"FEET\",\n \"yard\": \"YARDS\",\n \"yards\": \"YARDS\",\n \"mile\": \"MILES\",\n \"miles\": \"MILES\",\n \"nautical_mile\": \"NAUTICAL_MILES\",\n \"nauticalMile\": \"NAUTICAL_MILES\",\n \"nautical miles\": \"NAUTICAL_MILES\"\n};\n\n// FIXME we need to represent all types","/*\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\";\nimport { fetchPage } from \"./fetchPage.js\";\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}\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\nimport { aggregateObjectSetV2 } from \"@osdk/internal.foundry/OntologiesV2_OntologyObjectSet\";\nimport invariant from \"tiny-invariant\";\nimport { legacyToModernSingleAggregationResult, modernToLegacyAggregationClause, modernToLegacyGroupByClause, modernToLegacyWhereClause } from \"../internal/conversions/index.js\";\nimport { addUserAgent } from \"../util/addUserAgent.js\";\n/** @deprecated use `aggregate` */\nexport async function aggregateOrThrow(clientCtx, objectType, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"]\n}, req) {\n return aggregate(clientCtx, objectType, objectSet, req);\n}\nexport async function aggregate(clientCtx, objectType, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"]\n}, req) {\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 (req.where) {\n body.where = modernToLegacyWhereClause(req.where);\n }\n const result = await aggregateObjectSetV2(addUserAgent(clientCtx, objectType), clientCtx.ontologyRid, {\n objectSet,\n groupBy: body.groupBy,\n aggregation: body.aggregation\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])\n };\n }\n const ret = result.data.map(entry => {\n return {\n $group: entry.group,\n ...aggregationToCountResult(entry),\n ...legacyToModernSingleAggregationResult(entry)\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 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\"]);\nexport function isWireObjectSet(o) {\n return o != null && typeof o === \"object\" && WIRE_OBJECT_SET_TYPES.has(o.type);\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 { modernToLegacyWhereClause } from \"../internal/conversions/index.js\";\nimport { convertWireToOsdkObjects } from \"../object/convertWireToOsdkObjects.js\";\nimport { fetchPageInternal, fetchPageWithErrorsInternal } from \"../object/fetchPage.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../object/fetchSingle.js\";\nimport { aggregate } from \"../object/index.js\";\nimport { isWireObjectSet } from \"../util/WireObjectSet.js\";\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}\n\n/** @internal */\nexport function getWireObjectSet(objectSet) {\n return objectSetDefinitions.get(objectSet);\n}\nconst objectSetDefinitions = new WeakMap();\nexport function createObjectSet(objectType, clientCtx, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"]\n}) {\n const base = {\n aggregate: aggregate.bind(globalThis, clientCtx, objectType, objectSet),\n fetchPage: fetchPageInternal.bind(globalThis, clientCtx, objectType, objectSet),\n fetchPageWithErrors: fetchPageWithErrorsInternal.bind(globalThis, clientCtx, objectType, objectSet),\n where: clause => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause)\n });\n },\n pivotTo: function (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 asyncIter: async function* () {\n let nextPageToken = undefined;\n do {\n const result = await base.fetchPage({\n nextPageToken\n });\n for (const obj of await convertWireToOsdkObjects(clientCtx, result.data, undefined)) {\n yield obj;\n }\n } while (nextPageToken != null);\n },\n get: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {\n const withPk = {\n type: \"filter\",\n objectSet: objectSet,\n where: {\n type: \"eq\",\n field: objectType.primaryKeyApiName,\n value: primaryKey\n }\n };\n return await fetchSingle(clientCtx, objectType, options, withPk);\n } : undefined,\n fetchOne: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {\n const withPk = {\n type: \"filter\",\n objectSet: objectSet,\n where: {\n type: \"eq\",\n field: objectType.primaryKeyApiName,\n value: primaryKey\n }\n };\n return await fetchSingle(clientCtx, objectType, options, withPk);\n } : undefined,\n fetchOneWithErrors: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {\n const withPk = {\n type: \"filter\",\n objectSet: objectSet,\n where: {\n type: \"eq\",\n field: objectType.primaryKeyApiName,\n value: primaryKey\n }\n };\n return await fetchSingleWithErrors(clientCtx, objectType, options, withPk);\n } : undefined\n };\n function createSearchAround(link) {\n return () => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"searchAround\",\n objectSet,\n link\n });\n };\n }\n objectSetDefinitions.set(base, objectSet);\n return base;\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\nexport class Attachment {\n constructor(rid) {\n this.rid = rid;\n }\n}\nexport function isAttachment(o) {\n return o instanceof Attachment;\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/**\n * A simple cache that can be used to store values for a given client.\n */\n\n/**\n * A simple async cache that can be used to store values for a given client.\n */\n\n/**\n * Create a new cache without a factory function.\n */\n\n/**\n * Create a new cache with a factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n */\n\nexport function createClientCache(fn) {\n // Given the way some consumers may use this, we may want to cache by\n // stack + ontologyApiName instead of the client object itself.\n const cache = new WeakMap();\n function get(client, key) {\n if (cache.get(client) == null) {\n cache.set(client, new Map());\n }\n let r = cache.get(client).get(key);\n if (r === undefined && fn !== undefined) {\n return set(client, key, fn(client, key));\n } else {\n return r;\n }\n }\n function set(client, key, value) {\n if (cache.get(client) == null) {\n cache.set(client, new Map());\n }\n cache.get(client).set(key, value);\n return value;\n }\n function remove(client, key) {\n if (cache.get(client) == null) return false;\n return cache.get(client).delete(key);\n }\n return {\n get,\n set,\n remove\n };\n}\n\n/**\n * Create a new cache with an async factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n * @returns\n */\nexport function createAsyncClientCache(fn, createCacheLocal = createClientCache) {\n const cache = createCacheLocal();\n const inProgress = createCacheLocal();\n const ret = {\n getOrUndefined: function getOrUndefined(client, key) {\n return cache.get(client, key);\n },\n get: async function get(client, key) {\n return cache.get(client, key) ?? inProgress.get(client, key) ?? ret.set(client, key, fn(client, key));\n },\n set: async function set(client, k, v) {\n // the `.set` happens first to prevent races.\n try {\n const r = await inProgress.set(client, k, v); // returns v\n\n cache.set(client, k, r);\n inProgress.remove(client, k);\n return r;\n } catch (e) {\n // we don't want to cache failures\n inProgress.remove(client, k);\n throw e;\n }\n }\n };\n return ret;\n}\n\n/**\n * A simple cache that can be used to store values for a given client.\n */\n\n/**\n * Create a new cache without a factory function.\n */\n\n/**\n * Create a new cache with a factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n */\n\nexport function createSimpleCache(map = new Map(), fn) {\n function get(key) {\n let r = map.get(key);\n if (r === undefined && fn !== undefined) {\n return set(key, fn(key));\n } else {\n return r;\n }\n }\n function set(key, value) {\n map.set(key, value);\n return value;\n }\n function remove(key) {\n return map.delete(key);\n }\n return {\n get,\n set,\n remove\n };\n}\n\n/**\n * A simple async cache that can be used to store values for a given client.\n */\n\n/**\n * Create a new cache with an async factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n * @returns\n */\nexport function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache) {\n const cache = createCacheLocal(type === \"weak\" ? new WeakMap() : new Map());\n const inProgress = createCacheLocal(type === \"weak\" ? new WeakMap() : new Map());\n const ret = {\n getOrUndefined: function getOrUndefined(key) {\n return cache.get(key);\n },\n get: async function get(key) {\n return cache.get(key) ?? inProgress.get(key) ?? ret.set(key, fn(key));\n },\n set: async function set(k, v) {\n // the `.set` happens first to prevent races.\n try {\n const r = await inProgress.set(k, v); // returns v\n\n cache.set(k, r);\n inProgress.remove(k);\n return r;\n } catch (e) {\n // we don't want to cache failures\n inProgress.remove(k);\n throw e;\n }\n }\n };\n return ret;\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 { loadObjectSetV2 } from \"@osdk/internal.foundry/OntologiesV2_OntologyObjectSet\";\nimport { searchObjectsForInterface } from \"@osdk/internal.foundry/OntologiesV2_OntologyObjectV2\";\nimport { addUserAgent } from \"../util/addUserAgent.js\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport function augment(type, ...properties) {\n return {\n [type.apiName]: properties\n };\n}\n/** @internal */\nexport function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = undefined) {\n if (objectSet.type === \"base\") {\n if (objectSet.objectType !== expectedApiName) {\n throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.objectType}`);\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}\nasync function fetchInterfacePage(client, interfaceType, args, objectSet) {\n const result = await searchObjectsForInterface(addUserAgent(client, interfaceType), client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {\n augmentedProperties: args.augment ?? {},\n augmentedSharedPropertyTypes: {},\n otherInterfaceTypes: [],\n selectedObjectTypes: [],\n selectedSharedPropertyTypes: args.select ?? [],\n where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName)\n }), {\n preview: true\n });\n result.data = await convertWireToOsdkObjects(client, result.data,\n // drop readonly\n interfaceType.apiName, !args.includeRid);\n return result;\n}\n\n/** @internal */\nexport async function fetchPageInternal(client, objectType, objectSet, args = {}) {\n if (objectType.type === \"interface\") {\n return await fetchInterfacePage(client, objectType, args, objectSet); // fixme\n } else {\n return await fetchObjectPage(client, objectType, args, objectSet); // 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}\nexport async function fetchPage(client, objectType, args, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"]\n}) {\n return fetchPageInternal(client, objectType, objectSet, args);\n}\nexport async function fetchPageWithErrors(client, objectType, args, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"]\n}) {\n return fetchPageWithErrorsInternal(client, objectType, objectSet, args);\n}\nfunction applyFetchArgs(args, body) {\n if (args?.nextPageToken) {\n body.pageToken = args.nextPageToken;\n }\n if (args?.pageSize != null) {\n body.pageSize = args.pageSize;\n }\n if (args?.orderBy != null) {\n body.orderBy = {\n fields: Object.entries(args.orderBy).map(([field, direction]) => ({\n field,\n direction\n }))\n };\n }\n return body;\n}\nexport async function fetchObjectPage(client, objectType, args, objectSet) {\n const r = await loadObjectSetV2(addUserAgent(client, objectType), client.ontologyRid, applyFetchArgs(args, {\n objectSet,\n // We have to do the following case because LoadObjectSetRequestV2 isnt readonly\n select: args?.select ?? [],\n // FIXME?\n excludeRid: !args?.includeRid\n }));\n return Promise.resolve({\n data: await convertWireToOsdkObjects(client, r.data, undefined),\n nextPageToken: r.nextPageToken\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\nexport class ActionValidationError extends Error {\n constructor(validation) {\n super(\"Validation Error\");\n this.validation = validation;\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 { symbolClientContext } from \"@osdk/shared.net\";\nimport { createActionInvoker } from \"./actions/createActionInvoker.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nexport function createClientInternal(objectSetFactory,\n// first so i can bind\nbaseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({\n ontologyRid\n }, baseUrl, tokenProvider, options, fetchFn, objectSetFactory);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return objectSetFactory(o, clientCtx);\n } else if (o.type === \"action\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createActionInvoker(clientCtx, o);\n } else {\n throw new Error(\"not implemented\");\n }\n }\n const client = Object.defineProperties(clientFn, {\n [symbolClientContext]: {\n value: clientCtx\n }\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet);","import { foundryPlatformFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_Action.ts\nvar _applyActionV2 = [1, \"/v2/ontologies/{0}/actions/{1}/apply\", 3];\nfunction applyActionV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _applyActionV2, ...args);\n}\nvar _applyActionBatchV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyBatch\", 3];\nfunction applyActionBatchV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _applyActionBatchV2, ...args);\n}\nvar _applyActionAsyncV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyAsync\", 3];\nfunction applyActionAsyncV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _applyActionAsyncV2, ...args);\n}\nexport { applyActionAsyncV2, applyActionBatchV2, applyActionV2 };","/*\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\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\" && o.__primaryKey != null;\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 { isAttachment } from \"../object/Attachment.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n */\nexport function toDataValue(value) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n return Array.from(value, toDataValue);\n }\n\n // attachments just send the rid directly\n if (isAttachment(value)) {\n return value.rid;\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return toDataValue(value.__primaryKey);\n }\n\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce((acc, [key, structValue]) => {\n acc[key] = toDataValue(structValue);\n return acc;\n }, {});\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\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 { applyActionV2 } from \"@osdk/internal.foundry/OntologiesV2_Action\";\nimport { addUserAgent } from \"../util/addUserAgent.js\";\nimport { toDataValue } from \"../util/toDataValue.js\";\nimport { ActionValidationError } from \"./ActionValidationError.js\";\n\n// cannot specify both validateOnly and returnEdits as true\n\nexport async function applyAction(client, action, parameters, options = {}) {\n const response = await applyActionV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {\n parameters: remapActionParams(parameters),\n options: {\n mode: options?.validateOnly ? \"VALIDATE_ONLY\" : \"VALIDATE_AND_EXECUTE\",\n returnEdits: options?.returnEdits ? \"ALL\" : \"NONE\"\n }\n });\n if (options?.validateOnly) {\n return response.validation;\n }\n if (response.validation?.result === \"INVALID\") {\n throw new ActionValidationError(response.validation);\n }\n return options?.returnEdits ? response.edits : undefined;\n}\nfunction remapActionParams(params) {\n if (params == null) {\n return {};\n }\n const parameterMap = {};\n const remappedParams = Object.entries(params).reduce((acc, [key, value]) => {\n acc[key] = toDataValue(value);\n return acc;\n }, parameterMap);\n return remappedParams;\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 { applyAction } from \"./applyAction.js\";\nexport function createActionInvoker(client, action) {\n return function (...args) {\n return applyAction(client, action, ...args);\n };\n}\nexport function createOldActionInvoker(client, ontology) {\n const proxy = new Proxy({}, {\n get: (_target, p, _receiver) => {\n if (typeof p === \"string\") {\n return createActionInvoker(client, ontology.actions[p]);\n }\n return undefined;\n },\n ownKeys(_target) {\n return Object.keys(ontology.actions);\n },\n getOwnPropertyDescriptor(_target, p) {\n if (typeof p === \"string\") {\n return {\n enumerable: ontology.actions[p] != null,\n configurable: true,\n value: proxy[p]\n };\n }\n }\n });\n return proxy;\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 { createSharedClientContext } from \"@osdk/shared.net\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport { createStandardOntologyProviderFactory } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\nexport function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {\n if (process?.env?.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n } catch (e) {\n const hint = !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\") ? \". Did you forget to add 'http://' or 'https://'?\" : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const minimalClient = {\n ...createSharedClientContext(baseUrl, tokenProvider, USER_AGENT, fetchFn),\n objectSetFactory,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger\n };\n return Object.assign(minimalClient, {\n ontologyProvider: createStandardOntologyProviderFactory(options)(minimalClient)\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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport { listInterfaceTypes } from \"@osdk/internal.foundry/OntologiesV2_OntologyObjectV2\";\nimport { getOntologyFullMetadata } from \"@osdk/internal.foundry/OntologiesV2_OntologyV2\";\nimport deepEqual from \"fast-deep-equal\";\nimport { createAsyncClientCache } from \"../object/Cache.js\";\nimport { loadFullObjectMetadata } from \"./loadFullObjectMetadata.js\";\nimport { loadInterfaceDefinition } from \"./loadInterfaceDefinition.js\";\nconst alwaysRevalidateDefault = false;\n\n// SLLLLLLOOOOOOOWWWW\nasync function fullOntologyLoad(client) {\n return await Promise.all([listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), getOntologyFullMetadata(client, client.ontologyRid)]);\n}\nexport const USE_FULL_ONTOLOGY = false;\nexport const createStandardOntologyProviderFactory = client => {\n const alwaysRevalidate = client.alwaysRevalidate ?? alwaysRevalidateDefault;\n return client => {\n let fullCache;\n async function initLocalCache(client, skipCache) {\n if (skipCache) {\n return await fullOntologyLoad(client);\n }\n if (!fullCache) {\n fullCache = fullOntologyLoad(client);\n }\n return await fullCache;\n }\n async function loadObject(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return {\n ...wireObjectTypeFullMetadataToSdkObjectTypeDefinition(fullCacheLocal[1].objectTypes[key], true),\n implements: fullCacheLocal[0].data.map(i => i.apiName),\n rid: fullCacheLocal[1].objectTypes[key].objectType.rid\n };\n } else {\n return await loadFullObjectMetadata(client, key);\n }\n }\n async function loadInterface(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(fullCacheLocal[1].interfaceTypes[key], true);\n } else {\n return loadInterfaceDefinition(client, key);\n }\n }\n function makeGetter(fn) {\n const cache = createAsyncClientCache((client, key) => fn(client, key, false));\n return async apiName => {\n const n = alwaysRevalidate ? await fn(client, apiName, true) : await cache.get(client, apiName);\n if (alwaysRevalidate) {\n const og = cache.getOrUndefined(client, apiName);\n if (deepEqual(og, n)) {\n return og; // ! because we can be sure `n` would throw if it were undefined\n } else {\n return cache.set(client, apiName, n);\n }\n }\n return n;\n };\n }\n return {\n getObjectDefinition: makeGetter(loadObject),\n getInterfaceDefinition: makeGetter(loadInterface),\n maybeSeed(definition) {\n // not using this for now\n }\n };\n };\n};","import { foundryPlatformFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_OntologyV2.ts\nvar _listOntologiesV2 = [0, \"/v2/ontologies\"];\nfunction listOntologiesV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _listOntologiesV2, ...args);\n}\nvar _getOntologyV2 = [0, \"/v2/ontologies/{0}\"];\nfunction getOntologyV2($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getOntologyV2, ...args);\n}\nvar _getOntologyFullMetadata = [0, \"/v2/ontologies/{0}/fullMetadata\"];\nfunction getOntologyFullMetadata($ctx, ...args) {\n return foundryPlatformFetch($ctx, _getOntologyFullMetadata, ...args);\n}\nexport { getOntologyFullMetadata, getOntologyV2, listOntologiesV2 };","/*\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 { wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport { getObjectTypeFullMetadata } from \"@osdk/internal.foundry/OntologiesV2_OntologyObjectV2\";\nexport async function loadFullObjectMetadata(client, objtype) {\n const full = await getObjectTypeFullMetadata(client, client.ontologyRid, objtype, {\n preview: true\n });\n const ret = wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);\n client.logger?.debug(`END loadFullObjectMetadata(${objtype})`);\n return {\n ...ret,\n rid: full.objectType.rid\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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport { getInterfaceType } from \"@osdk/internal.foundry/OntologiesV2_OntologyObjectV2\";\nexport async function loadInterfaceDefinition(client, objtype) {\n const r = await getInterfaceType(client, client.ontologyRid, objtype, {\n preview: true\n });\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\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\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;"]}
@@ -499,7 +499,7 @@ function isAttachment(o) {
499
499
  }
500
500
 
501
501
  // src/object/Cache.ts
502
- function createCache(fn) {
502
+ function createClientCache(fn) {
503
503
  const cache = /* @__PURE__ */ new WeakMap();
504
504
  function get(client, key) {
505
505
  if (cache.get(client) == null) {
@@ -530,7 +530,7 @@ function createCache(fn) {
530
530
  remove
531
531
  };
532
532
  }
533
- function createAsyncCache(fn, createCacheLocal = createCache) {
533
+ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
534
534
  const cache = createCacheLocal();
535
535
  const inProgress = createCacheLocal();
536
536
  const ret = {
@@ -554,6 +554,52 @@ function createAsyncCache(fn, createCacheLocal = createCache) {
554
554
  };
555
555
  return ret;
556
556
  }
557
+ function createSimpleCache(map = /* @__PURE__ */ new Map(), fn) {
558
+ function get(key) {
559
+ let r = map.get(key);
560
+ if (r === void 0 && fn !== void 0) {
561
+ return set(key, fn(key));
562
+ } else {
563
+ return r;
564
+ }
565
+ }
566
+ function set(key, value) {
567
+ map.set(key, value);
568
+ return value;
569
+ }
570
+ function remove(key) {
571
+ return map.delete(key);
572
+ }
573
+ return {
574
+ get,
575
+ set,
576
+ remove
577
+ };
578
+ }
579
+ function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache) {
580
+ const cache = createCacheLocal(type === "weak" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
581
+ const inProgress = createCacheLocal(type === "weak" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
582
+ const ret = {
583
+ getOrUndefined: function getOrUndefined(key) {
584
+ return cache.get(key);
585
+ },
586
+ get: async function get(key) {
587
+ return cache.get(key) ?? inProgress.get(key) ?? ret.set(key, fn(key));
588
+ },
589
+ set: async function set(k, v) {
590
+ try {
591
+ const r = await inProgress.set(k, v);
592
+ cache.set(k, r);
593
+ inProgress.remove(k);
594
+ return r;
595
+ } catch (e) {
596
+ inProgress.remove(k);
597
+ throw e;
598
+ }
599
+ }
600
+ };
601
+ return ret;
602
+ }
557
603
 
558
604
  // src/object/convertWireToOsdkObjects.ts
559
605
  var OriginClient = Symbol();
@@ -687,12 +733,13 @@ function createConverter(objDef) {
687
733
  }
688
734
  } : void 0;
689
735
  }
690
- var protoConverterCache = createCache((client, objectDef) => {
736
+ var protoConverterCache = createClientCache((client, objectDef) => {
691
737
  const proto = createPrototype(objectDef, client);
692
738
  const converter = createConverter(objectDef);
693
739
  return [proto, converter];
694
740
  });
695
741
  async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false) {
742
+ client.logger?.debug(`START convertWireToOsdkObjects()`);
696
743
  if (forceRemoveRid) {
697
744
  for (const obj of objects) {
698
745
  delete obj.__rid;
@@ -727,15 +774,13 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
727
774
  }
728
775
  internalConvertObjectInPlace(objectDef, client, obj);
729
776
  }
730
- if (interfaceApiName) {
731
- return objects.map((o) => o.$as(interfaceApiName));
732
- } else {
733
- return objects;
734
- }
777
+ const ret = interfaceApiName ? objects.map((o) => o.$as(interfaceApiName)) : objects;
778
+ client.logger?.debug(`END convertWireToOsdkObjects()`);
779
+ return ret;
735
780
  }
736
781
  function createLocalObjectCacheAndInitiatePreseed(objects, client) {
737
- const localInterfaceCache = createAsyncCache((client2, apiName) => client2.ontologyProvider.getInterfaceDefinition(apiName));
738
- const localObjectCache = createAsyncCache(async (client2, apiName) => {
782
+ const localInterfaceCache = createAsyncClientCache((client2, apiName) => client2.ontologyProvider.getInterfaceDefinition(apiName));
783
+ const localObjectCache = createAsyncClientCache(async (client2, apiName) => {
739
784
  const objectDef = await client2.ontologyProvider.getObjectDefinition(apiName);
740
785
  const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map((i) => localInterfaceCache.get(client2, i)) ?? [])).map((i) => [i.apiName, i]));
741
786
  if (objectDef[InterfaceDefinitions] == null) {
@@ -983,7 +1028,12 @@ async function loadFullObjectMetadata(client, objtype) {
983
1028
  const full = await getObjectTypeFullMetadata(client, client.ontologyRid, objtype, {
984
1029
  preview: true
985
1030
  });
986
- return wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
1031
+ const ret = wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
1032
+ client.logger?.debug(`END loadFullObjectMetadata(${objtype})`);
1033
+ return {
1034
+ ...ret,
1035
+ rid: full.objectType.rid
1036
+ };
987
1037
  }
988
1038
  async function loadInterfaceDefinition(client, objtype) {
989
1039
  const r = await getInterfaceType(client, client.ontologyRid, objtype, {
@@ -1008,7 +1058,7 @@ var createStandardOntologyProviderFactory = (client) => {
1008
1058
  }
1009
1059
  }
1010
1060
  function makeGetter(fn) {
1011
- const cache = createAsyncCache((client3, key) => fn(client3, key, false));
1061
+ const cache = createAsyncClientCache((client3, key) => fn(client3, key, false));
1012
1062
  return async (apiName) => {
1013
1063
  const n = alwaysRevalidate ? await fn(client2, apiName, true) : await cache.get(client2, apiName);
1014
1064
  if (alwaysRevalidate) {
@@ -1032,7 +1082,7 @@ var createStandardOntologyProviderFactory = (client) => {
1032
1082
  };
1033
1083
 
1034
1084
  // src/util/UserAgent.ts
1035
- var USER_AGENT = `osdk-client/${"0.19.0-main-20240514165152"}`;
1085
+ var USER_AGENT = `osdk-client/${"0.19.0"}`;
1036
1086
 
1037
1087
  // src/createMinimalClient.ts
1038
1088
  function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {
@@ -1080,6 +1130,6 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1080
1130
  }
1081
1131
  var createClient = createClientInternal.bind(void 0, createObjectSet);
1082
1132
 
1083
- export { ActionValidationError, augment, convertWireToOsdkObjects, createClient, createClientInternal, createObjectSet };
1133
+ export { ActionValidationError, augment, convertWireToOsdkObjects, createClient, createClientInternal, createObjectSet, createSimpleAsyncCache };
1084
1134
  //# sourceMappingURL=out.js.map
1085
- //# sourceMappingURL=chunk-AHHOQAZP.browser.mjs.map
1135
+ //# sourceMappingURL=chunk-RRZAWVXI.browser.mjs.map