@osdk/client 0.11.0 → 0.13.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.
- package/build/js/{chunk-LK4VDWCG.cjs → chunk-CKYBATFN.cjs} +253 -108
- package/build/js/chunk-CKYBATFN.cjs.map +1 -0
- package/build/js/{chunk-GOBQUVQZ.mjs → chunk-SNGUDELK.mjs} +250 -109
- package/build/js/chunk-SNGUDELK.mjs.map +1 -0
- package/build/js/index.cjs +82 -33
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +78 -30
- package/build/js/index.mjs.map +1 -1
- package/build/js/public/objects.cjs +3 -3
- package/build/js/public/objects.mjs +1 -1
- package/build/types/Client.d.ts +4 -4
- package/build/types/Definitions.d.ts +4 -5
- package/build/types/ObjectSetCreator.d.ts +2 -2
- package/build/types/OsdkObjectFrom.d.ts +17 -4
- package/build/types/actions/Actions.d.ts +5 -8
- package/build/types/createClient.d.ts +1 -1
- package/build/types/createMinimalClient.d.ts +1 -1
- package/build/types/definitions/LinkDefinitions.d.ts +2 -2
- package/build/types/generatedNoCheck/Ontology.d.ts +10 -7
- package/build/types/generatedNoCheck/ontology/actions/actionTakesAttachment.d.ts +2 -2
- package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +2 -2
- package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +12 -12
- package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +17 -17
- package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +12 -12
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +6 -6
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +6 -6
- package/build/types/generatedNoCheck/ontology/interfaces/FooInterface.d.ts +8 -0
- package/build/types/generatedNoCheck/ontology/interfaces.d.ts +1 -1
- package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +11 -4
- package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +4 -1
- package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +7 -4
- package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +4 -1
- package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +24 -21
- package/build/types/index.d.ts +1 -1
- package/build/types/mapping/DataValueMapping.d.ts +39 -0
- package/build/types/mapping/PropertyValueMapping.d.ts +47 -0
- package/build/types/object/Cache.d.ts +9 -2
- package/build/types/object/Cache.test.d.ts +10 -0
- package/build/types/object/aggregate.d.ts +4 -2
- package/build/types/object/convertWireToOsdkObjects.d.ts +17 -2
- package/build/types/object/fetchPage.d.ts +12 -3
- package/build/types/objectSet/ObjectSet.d.ts +13 -11
- package/build/types/objectSet/createObjectSet.d.ts +4 -2
- package/build/types/ontology/OntologyProvider.d.ts +12 -4
- package/build/types/ontology/{providers/StandardOntologyProvider.d.ts → StandardOntologyProvider.d.ts} +2 -1
- package/build/types/ontology/StandardOntologyProvider.test.d.ts +1 -0
- package/build/types/ontology/loadInterfaceDefinition.d.ts +3 -0
- package/build/types/query/WhereClause.d.ts +4 -3
- package/build/types/query/aggregations/AggregationsClause.d.ts +2 -2
- package/build/types/query/aggregations/AggregationsResults.d.ts +1 -1
- package/changelog/0.13.0/pr-101.v2.yml +5 -0
- package/changelog/0.13.0/pr-102.v2.yml +5 -0
- package/changelog/0.13.0/pr-104.v2.yml +5 -0
- package/changelog/0.13.0/pr-106.v2.yml +5 -0
- package/changelog/0.13.0/pr-107.v2.yml +5 -0
- package/changelog/0.13.0/pr-110.v2.yml +5 -0
- package/changelog/0.13.0/pr-111.v2.yml +5 -0
- package/changelog/0.13.0/pr-112.v2.yml +5 -0
- package/changelog/0.13.0/pr-116.v2.yml +5 -0
- package/changelog/0.13.0/pr-117.v2.yml +5 -0
- package/changelog/0.13.0/pr-120.v2.yml +5 -0
- package/changelog/0.13.0/pr-125.v2.yml +5 -0
- package/package.json +10 -7
- package/build/js/chunk-GOBQUVQZ.mjs.map +0 -1
- package/build/js/chunk-LK4VDWCG.cjs.map +0 -1
- /package/build/types/{ontology/providers/StandardOntologyProvider.test.d.ts → OsdkObjectFrom.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/object/fetchPage.ts","../../src/object/convertWireToOsdkObjects.ts","../../src/internal/conversions/legacyToModernSingleAggregationResult.ts","../../src/internal/conversions/modernToLegacyAggregationClause.ts","../../src/internal/conversions/modernToLegacyGroupByClause.ts","../../src/internal/conversions/modernToLegacyWhereClause.ts","../../src/query/WhereClause.ts","../../src/object/fetchSingle.ts","../../src/object/index.ts","../../src/object/aggregate.ts","../../src/util/WireObjectSet.ts","../../src/objectSet/ObjectSetListenerWebsocket.ts","../../src/generated/object-set-service/api/ObjectSetService/createObjectSet.ts","../../src/generated/object-set-service/api/ObjectSetService/createTemporaryObjectSet.ts","../../src/generated/object-set-service/api/ObjectSetService/deleteObjectSet.ts","../../src/generated/object-set-service/api/ObjectSetService/getBulkObjectSet.ts","../../src/generated/object-set-service/api/ObjectSetService/getObjectSet.ts","../../src/generated/object-set-service/api/ObjectSetService/getObjectsPage.ts","../../src/generated/object-set-service/api/ObjectSetService/getObjectTypes.ts","../../src/generated/object-set-service/api/ObjectSetService/getReferencedEntities.ts","../../src/generated/object-set-service/api/ObjectSetService/materializeObjectSet.ts","../../src/generated/object-set-watcher/ObjectSetWatchService/batchEnableWatcher.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/bulkLoadOntologyEntities.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/bulkLoadOntologyEntitiesByDatasources.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getActionTypesForObjectType.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getFeatureConfigurations.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getLinkMetadataForObjectTypes.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getLinkTypesForObjectTypes.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getObjectTypesForInterfaceTypes.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getObjectTypesForSharedPropertyTypes.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getObjectTypesForTypeGroups.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getOntologyRidsForEntities.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getOntologySummary.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getOrganizationRidsForOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/getRelationsForObjectTypes.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllCustomObjectTypeTraitsFromOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllInterfaceTypesFromOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllObjectTypesFromOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllObjectTypesFromOntologyPage.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllOntologies.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllOntologyEntities.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllSharedPropertyTypesFromOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadAllTypeGroupsFromOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadOntology.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadOntologyDatasources.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/loadOntologyEntities.ts","../../src/generated/ontology-metadata/api/OntologyMetadataService/modifyOntology.ts","../../src/objectSet/toConjureObjectSet.ts","../../src/objectSet/createObjectSet.ts","../../src/object/Attachment.ts","../../src/object/Cache.ts"],"names":["createOpenApiRequest","invariant","conjureFetch","_","createObjectSet","client"],"mappings":";;;;;;;AAgBA,SAAS,iBAAiB,iCAAiC;AAC3D,SAAS,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AAkB,QAAQ,YAAY,WAAW,IAAI;AAC9D;AACA,SAAS,eAAe,MAAM,MAAM;AAClC,MAAI,MAAM,eAAe;AACvB,SAAK,YAAY,KAAK;AAAA,EACxB;AACA,MAAI,MAAM,YAAY,MAAM;AAC1B,SAAK,WAAW,KAAK;AAAA,EACvB;AACA,MAAI,MAAM,WAAW,MAAM;AACzB,SAAK,UAAU;AAAA,MACb,QAAQ,OAAO,QAAQ,KAAK,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,SAAS,OAAO;AAAA,QAChE;AAAA,QACA;AAAA,MACF,EAAE;AAAA,IACJ;AAAA,EACF;AACA,SAAO;AACT;AACA,eAAsB,gBAAgB,QAAQ,YAAY,MAAM,WAAW;AACzE,QAAM,IAAI,MAAM,gBAAgBA,sBAAqB,OAAO,OAAO,OAAO,KAAK,GAAG,OAAO,SAAS,SAAS,iBAAiB,eAAe,MAAM;AAAA,IAC/I;AAAA;AAAA,IAEA,QAAQ,MAAM,UAAU,CAAC;AAAA;AAAA,IAEzB,YAAY,CAAC,MAAM;AAAA,EACrB,CAAC,CAAC;AACF,SAAO,QAAQ,QAAQ;AAAA,IACrB,MAAM,MAAM,yBAAyB,QAAQ,EAAE,MAAM,MAAS;AAAA,IAC9D,eAAe,EAAE;AAAA,EACnB,CAAC;AACH","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { loadObjectSetV2, searchObjectsForInterface } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\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(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, interfaceType.apiName, applyFetchArgs(args, {\n augmentedProperties: {},\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);\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}\nexport async function fetchPage(client, objectType, args, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"]\n}) {\n return fetchPageInternal(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(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, 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\nimport invariant from \"tiny-invariant\";\nimport { createObjectSet, getWireObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport { createAsyncCache, createCache } from \"./Cache.js\";\nimport { fetchSingle } from \"./fetchSingle.js\";\nconst OriginClient = Symbol();\nconst UnderlyingObject = Symbol();\nconst InterfaceDefinitions = Symbol();\nfunction createPrototype(objDef, client) {\n // we can get away with a single interface proto\n const interfaceProto = {};\n Object.defineProperties(interfaceProto, {\n $as: {\n value: $as,\n writable: false,\n configurable: false\n }\n });\n const objectProto = {};\n Object.defineProperty(objectProto, \"$link\", {\n get: function () {\n const primaryKey = this[\"$primaryKey\"];\n return new Proxy({}, {\n get(_target, p, _receiver) {\n const linkDef = objDef.links[p];\n if (linkDef == null) {\n return;\n }\n const objectSet = createObjectSet(objDef, client).where({\n [objDef.primaryKeyApiName]: primaryKey\n }).pivotTo(p);\n if (!linkDef.multiplicity) {\n return {\n get: options => fetchSingle(client, objDef, options ?? {}, getWireObjectSet(objectSet))\n };\n } else {\n return objectSet;\n }\n }\n });\n },\n enumerable: false,\n configurable: false\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 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 !(newDef.type === \"interface\") ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n const ret = {\n $apiName: newDef.apiName,\n $objectType: objDef.apiName,\n $primaryKey: this[\"$primaryKey\"]\n };\n for (const p of Object.keys(newDef.properties)) {\n const value = this[objDef.spts[p]];\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 Object.defineProperty(ret, p, {\n value,\n configurable: false,\n enumerable: value !== undefined\n });\n }\n Object.defineProperty(ret, UnderlyingObject, {\n value: this,\n configurable: false,\n enumerable: false\n });\n Object.setPrototypeOf(ret, interfaceProto);\n return ret;\n }\n Object.defineProperty(objectProto, \"$as\", {\n value: $as,\n configurable: false\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 } : false;\n}\nconst protoConverterCache = createCache((client, objectDef) => {\n const proto = createPrototype(objectDef, client);\n const converter = createConverter(objectDef);\n return {\n proto,\n converter\n };\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) {\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 for (const [sptProp, regularProp] of Object.entries(objectDef.spts)) {\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 if (interfaceApiName) {\n return objects.map(o => o.$as(interfaceApiName));\n } else {\n // we did the conversion so we can cast\n return objects;\n }\n}\nfunction createLocalObjectCacheAndInitiatePreseed(objects, client) {\n // local cache delegates to the global one\n const localInterfaceCache = createAsyncCache((client, apiName) => client.ontology.provider.getInterfaceDefinition(apiName));\n const localObjectCache = createAsyncCache(async (client, apiName) => {\n // first delegate to the global cache\n const objectDef = await client.ontology.provider.getObjectDefinition(apiName);\n\n // augment results with interface data if its not already there\n // we need this later for $as\n if (objectDef[InterfaceDefinitions] == null) {\n const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map(i => localInterfaceCache.get(client, i)) ?? [])).map(i => [i.apiName, i]));\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 uniqueApiNames.add($apiName);\n }\n\n // preseed the cache without blocking\n Array.from(uniqueApiNames).map(n => localObjectCache.get(client, n).then(a => a.implements?.map(i => localInterfaceCache.get(client, i))));\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 {\n proto,\n converter\n } = protoConverterCache.get(client, objectDef);\n Object.setPrototypeOf(obj, proto);\n Object.defineProperty(obj, OriginClient, {\n value: client,\n enumerable: false,\n configurable: false,\n writable: false\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 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 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\") {\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?\");\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}","/*\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 { aggregate } from \"./aggregate.js\";\nexport { fetchPage } from \"./fetchPage.js\";","/*\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/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport invariant from \"tiny-invariant\";\nimport { legacyToModernSingleAggregationResult, modernToLegacyAggregationClause, modernToLegacyGroupByClause, modernToLegacyWhereClause } from \"../internal/conversions/index.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(createOpenApiRequest(clientCtx.stack, clientCtx.fetch), clientCtx.ontology.metadata.ontologyApiName, {\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 { getObjectTypeV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport WebSocket from \"isomorphic-ws\";\nimport invariant from \"tiny-invariant\";\nimport { createTemporaryObjectSet } from \"../generated/object-set-service/api/ObjectSetService.js\";\nimport { batchEnableWatcher } from \"../generated/object-set-watcher/ObjectSetWatchService.js\";\nimport { loadAllOntologies, loadOntologyEntities } from \"../generated/ontology-metadata/api/OntologyMetadataService.js\";\nimport { convertWireToOsdkObjects } from \"../object/convertWireToOsdkObjects.js\";\nimport { getObjectSetBaseType, toConjureObjectSet } from \"./toConjureObjectSet.js\";\nconst ONE_DAY_MS = 24 * 60 * 60 * 1000;\nconst MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;\nexport class ObjectSetListenerWebsocket {\n static #instances = new WeakMap();\n\n // FIXME\n static getInstance(client) {\n let instance = ObjectSetListenerWebsocket.#instances.get(client);\n if (instance == null) {\n instance = new ObjectSetListenerWebsocket(client);\n ObjectSetListenerWebsocket.#instances.set(client, instance);\n }\n return instance;\n }\n #ws;\n #lastWsConnect = 0;\n #client;\n\n /** map of listenerId to listener */\n #listeners = new Map();\n\n /** map of subscriptionId to listenerId */\n #subscriptionToRequestId = new Map();\n #conjureContext;\n #metadataContext;\n #ossContext;\n constructor(client) {\n this.#client = client;\n const stackUrl = new URL(client.stack);\n this.#conjureContext = {\n baseUrl: stackUrl.origin,\n servicePath: \"/object-set-watcher/api\",\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider()\n };\n this.#ossContext = {\n baseUrl: stackUrl.origin,\n servicePath: \"/object-set-service/api\",\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider()\n };\n this.#metadataContext = {\n baseUrl: stackUrl.origin,\n servicePath: \"/ontology-metadata/api\",\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider()\n };\n }\n subscribe(objectSet, listener) {\n const requestId = crypto.randomUUID();\n const expiry = setTimeout(() => {\n this.#expire(requestId);\n }, ONE_DAY_MS);\n this.#listeners.set(requestId, {\n listener,\n objectSet,\n expiry\n });\n this.#subscribe(requestId, objectSet);\n return () => {\n this.#unsubscribe(requestId);\n };\n }\n async #subscribe(requestId, objectSet) {\n try {\n const [temporaryObjectSet] = await Promise.all([\n // create a time-bounded object set representation for watching\n this.#createTemporaryObjectSet(objectSet), this.#ensureWebsocket(),\n // look up the object type's rid and ensure that we have enabled object set watcher for that rid\n // TODO ???\n getObjectSetBaseType(objectSet).then(baseType => getObjectTypeV2(createOpenApiRequest(this.#client.stack, this.#client.fetch), this.#client.ontology.metadata.ontologyApiName, baseType)).then(objectType => this.#enableObjectSetsWatcher([objectType.rid]))]);\n\n // the consumer may have already unsubscribed before we are ready to request a subscription\n if (!this.#listeners.has(requestId)) {\n return;\n }\n\n // subscribe to object set\n const subscribe = {\n id: requestId,\n requests: [{\n objectSet: temporaryObjectSet.objectSetRid,\n objectSetContext: {\n objectSetFilterContext: {\n parameterOverrides: {}\n }\n },\n watchAllLinks: false\n }]\n };\n this.#ws?.send(JSON.stringify(subscribe));\n } catch (error) {\n this.#getCallbackByRequestId(requestId, \"onError\")?.(error);\n }\n }\n #expire(requestId) {\n // the temporary ObjectSet has expired, we should re-subscribe which will cause the\n // listener to get an onOutOfDate message when it becomes subscribed again\n const state = this.#listeners.get(requestId);\n if (state) {\n const {\n subscriptionId,\n objectSet\n } = state;\n if (subscriptionId) {\n state.subscriptionId = undefined;\n this.#subscriptionToRequestId.delete(subscriptionId);\n }\n this.#subscribe(requestId, objectSet);\n }\n }\n #unsubscribe(requestId) {\n const data = this.#listeners.get(requestId);\n if (data == null) {\n return;\n }\n this.#listeners.delete(requestId);\n clearTimeout(data.expiry);\n const {\n subscriptionId\n } = data;\n if (subscriptionId != null) {\n this.#subscriptionToRequestId.delete(subscriptionId);\n }\n if (this.#listeners.size === 0) {\n this.#destroyWebsocket();\n } else {\n // TODO backend does not yet have an unsubscribe message payload\n }\n }\n async #ensureWebsocket() {\n if (this.#ws == null) {\n const {\n stack,\n tokenProvider\n } = this.#client;\n const base = new URL(stack);\n // TODO: This should be a different endpoint\n const url = `wss://${base.host}/object-set-watcher/ws/subscriptions`;\n const token = await tokenProvider();\n\n // tokenProvider is async, there could potentially be a race to create the websocket.\n // Only the first call to reach here will find a null this.#ws, the rest will bail out\n if (this.#ws == null) {\n // TODO this can probably be exponential backoff with jitter\n // don't reconnect more quickly than MINIMUM_RECONNECT_DELAY\n const nextConnectTime = (this.#lastWsConnect ?? 0) + MINIMUM_RECONNECT_DELAY_MS;\n if (nextConnectTime > Date.now()) {\n await new Promise(resolve => {\n setTimeout(resolve, nextConnectTime - Date.now());\n });\n }\n this.#lastWsConnect = Date.now();\n\n // we again may have lost the race after our minimum backoff time\n if (this.#ws == null) {\n this.#ws = new WebSocket(url, [`Bearer-${token}`]);\n this.#ws.addEventListener(\"close\", this.#onClose);\n this.#ws.addEventListener(\"message\", this.#onMessage);\n this.#ws.addEventListener(\"open\", this.#onOpen);\n }\n }\n\n // Allow await-ing the websocket open event if it isn't open already.\n // This needs to happen even for callers that didn't just create this.#ws\n if (this.#ws.readyState === WebSocket.CONNECTING) {\n return new Promise((resolve, reject) => {\n this.#ws.addEventListener(\"open\", () => {\n resolve();\n });\n this.#ws.addEventListener(\"error\", event => {\n reject(new Error(event.toString()));\n });\n });\n }\n }\n }\n #onOpen = () => {\n // resubscribe all of the listeners\n for (const [requestId, state] of this.#listeners) {\n this.#subscribe(requestId, state.objectSet);\n }\n };\n #onMessage = async message => {\n const data = JSON.parse(message.data.toString());\n switch (data.type) {\n case \"objectSetChanged\":\n {\n if (data.objectSetChanged.confidenceValue) {\n this.#getCallback(data.objectSetChanged.id, \"onOutOfDate\")?.();\n break;\n }\n const {\n id: subscriptionId,\n objects\n } = data.objectSetChanged;\n const callback = this.#getCallback(subscriptionId, \"onChange\");\n if (callback) {\n callback(await convertFoundryToOsdkObjects(this.#client, this.#metadataContext, objects));\n }\n break;\n }\n case \"refreshObjectSet\":\n {\n const {\n id: subscriptionId\n } = data.refreshObjectSet;\n this.#getCallback(subscriptionId, \"onOutOfDate\")?.();\n break;\n }\n case \"subscribeResponses\":\n {\n const {\n id: requestId,\n responses\n } = data.subscribeResponses;\n const listenerData = this.#listeners.get(requestId);\n if (listenerData == null) {\n // we got a subscription response for a requestId that we no longer have access to\n // this can happen if a consumer subscribes and unsubscribes before the subscription can come through\n return;\n }\n if (responses.length !== 1) {\n // the subscriptions that we create currently only contain a single item\n throw new Error(\"Got more than one response but we only expect a single one\");\n }\n const response = responses[0];\n switch (response.type) {\n case \"error\":\n this.#getCallbackByRequestId(requestId, \"onError\")?.(response.error);\n this.#unsubscribe(requestId);\n return;\n case \"qos\":\n // the server has requested that we tear down our websocket and reconnect to help load balance\n this.#destroyWebsocket();\n this.#ensureWebsocket();\n return;\n case \"success\":\n const {\n id: subscriptionId\n } = response.success;\n listenerData.subscriptionId = subscriptionId;\n this.#subscriptionToRequestId.set(subscriptionId, requestId);\n this.#getCallbackByRequestId(requestId, \"onOutOfDate\")?.();\n break;\n default:\n const _ = response;\n this.#getCallbackByRequestId(requestId, \"onError\")?.(response);\n }\n break;\n }\n default:\n const _ = data;\n }\n };\n #onClose = () => {\n this.#destroyWebsocket();\n };\n async #enableObjectSetsWatcher(objectTypeRids) {\n return batchEnableWatcher(this.#conjureContext, {\n requests: objectTypeRids\n });\n }\n async #createTemporaryObjectSet(objectSet) {\n const objectSetBaseType = await getObjectSetBaseType(objectSet);\n const mapping = await getOntologyPropertyMappingForApiName(this.#client, this.#metadataContext, objectSetBaseType);\n const temporaryObjectSet = await createTemporaryObjectSet(this.#ossContext, {\n objectSet: toConjureObjectSet(objectSet, mapping),\n timeToLive: \"ONE_DAY\",\n objectSetFilterContext: {\n parameterOverrides: {}\n }\n });\n return {\n objectSetRid: temporaryObjectSet.objectSetRid\n };\n }\n #destroyWebsocket = () => {\n if (this.#ws) {\n this.#ws.removeEventListener(\"open\", this.#onOpen);\n this.#ws.removeEventListener(\"message\", this.#onMessage);\n this.#ws.removeEventListener(\"close\", this.#onClose);\n if (this.#ws.readyState !== WebSocket.CLOSING && this.#ws.readyState !== WebSocket.CLOSED) {\n this.#ws.close();\n }\n this.#ws = undefined;\n }\n\n // closing the websocket clears the subscription to requestIds\n this.#subscriptionToRequestId.clear();\n for (const state of this.#listeners.values()) {\n state.subscriptionId = undefined;\n }\n\n // if we have any listeners that are still depending on us, go ahead and reopen the websocket\n if (this.#listeners.size > 0) {\n this.#ensureWebsocket();\n }\n };\n #getCallbackByRequestId(requestId, type) {\n const maybeListener = this.#listeners.get(requestId);\n return maybeListener?.listener?.[type];\n }\n #getCallback(subscriptionId, type) {\n const requestId = this.#subscriptionToRequestId.get(subscriptionId);\n if (requestId) {\n return this.#getCallbackByRequestId(requestId, type);\n }\n return;\n }\n}\nasync function convertFoundryToOsdkObjects(client, ctx, objects) {\n const osdkObjects = await Promise.all(objects.map(async object => {\n const propertyMapping = await getOntologyPropertyMappingForRid(ctx, client.ontology.metadata.ontologyRid, object.type);\n const convertedObject = Object.fromEntries([...Object.entries(object.properties).map(([key, value]) => {\n return [propertyMapping?.propertyIdToApiNameMapping[key], value];\n }), [propertyMapping?.propertyIdToApiNameMapping[Object.entries(object.key)[0][0]], Object.entries(object.key)[0][1]], [\"__apiName\", propertyMapping?.apiName], [\"$apiName\", propertyMapping?.apiName]]);\n return convertedObject;\n }));\n\n // doesnt care about interfaces\n return await convertWireToOsdkObjects(client, osdkObjects, undefined);\n}\n// Mapping of ObjectRid to Properties\nconst objectTypeMapping = new WeakMap();\nconst objectApiNameToRid = new Map();\nasync function getOntologyPropertyMappingForApiName(client, ctx, objectApiName) {\n if (objectApiNameToRid.has(objectApiName)) {\n return objectTypeMapping.get(ctx)?.get(objectApiNameToRid.get(objectApiName));\n }\n const wireObjectType = await getObjectTypeV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, objectApiName);\n return getOntologyPropertyMappingForRid(ctx, client.ontology.metadata.ontologyRid, wireObjectType.rid);\n}\nlet cachedAllOntologies;\nasync function getOntologyVersionForRid(ctx, ontologyRid) {\n cachedAllOntologies ??= await loadAllOntologies(ctx, {});\n !cachedAllOntologies.ontologies[ontologyRid] ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"ontology should be loaded\") : invariant(false) : void 0;\n return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;\n}\nasync function getOntologyPropertyMappingForRid(ctx, ontologyRid, objectRid) {\n if (!objectTypeMapping.has(ctx)) {\n objectTypeMapping.set(ctx, new Map());\n }\n if (!objectTypeMapping.get(ctx).has(objectRid)) {\n const ontologyVersion = await getOntologyVersionForRid(ctx, ontologyRid);\n const body = {\n objectTypeVersions: {\n // TODO: Undefined drops this in the body\n [objectRid]: ontologyVersion\n },\n linkTypeVersions: {},\n loadRedacted: false,\n includeObjectTypesWithoutSearchableDatasources: true\n };\n const entities = await loadOntologyEntities(ctx, body);\n !entities.objectTypes[objectRid] ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"object type should be loaded\") : invariant(false) : void 0;\n const propertyIdToApiNameMapping = Object.fromEntries(Object.values(entities.objectTypes[objectRid].propertyTypes).map(property => {\n return [property.id, property.apiName];\n }));\n const propertyApiNameToIdMapping = Object.fromEntries(Object.values(entities.objectTypes[objectRid].propertyTypes).map(property => {\n return [property.id, property.apiName];\n }));\n objectTypeMapping.get(ctx)?.set(objectRid, {\n apiName: entities.objectTypes[objectRid].apiName,\n id: entities.objectTypes[objectRid].id,\n propertyIdToApiNameMapping,\n propertyApiNameToIdMapping\n });\n objectApiNameToRid.set(entities.objectTypes[objectRid].apiName, objectRid);\n }\n return objectTypeMapping.get(ctx)?.get(objectRid);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Creates an orphaned object set - i.e. not part of any versioned object set. This may be for temporary or internal application use. No gatekeeper resource is created - instead the given security rid is assumed to already exist and will be used to permission the created object set.\n */\nexport async function createObjectSet(ctx, request) {\n return conjureFetch(ctx, `/objectSets`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Creates a temporary object set that will live for at least as long as the provided TTL, and will get deleted\n * at some point after that.\n *\n * Temporary object sets can only be accessed by users who have created them; a gatekeeper resource is registered\n * for every temporary object set. NOTE: The same gatekeeper resource may be reused for the same userId across\n * different createTemporaryObjectSet requests.\n *\n * Whenever an object set (temporary, or otherwise) referencing a temporary object set gets saved or used in\n * versioned object sets, the reference gets replaced with a full definition of the previously saved temporary\n * object. This is to ensure that they do not inherit the TTL of temporary object sets they reference.\n *\n * Please consider using temporary object sets whenever there is a need to save an object set just to be able to\n * pass it to another service without a need to persist it indefinitely.\n */\nexport async function createTemporaryObjectSet(ctx, request) {\n return conjureFetch(ctx, `/objectSets/temporary`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Deletes this object set, causing future operations which access it to fail.\n */\nexport async function deleteObjectSet(ctx, objectSetRid) {\n return conjureFetch(ctx, `/objectSets/${objectSetRid}`, \"DELETE\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Returns the definitions of requested object sets.\n */\nexport async function getBulkObjectSet(ctx, request) {\n return conjureFetch(ctx, `/bulk/objectSets`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Returns the definition of this object set.\n */\nexport async function getObjectSet(ctx, objectSetRid) {\n return conjureFetch(ctx, `/objectSets/${objectSetRid}`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Fetches object rids on requested page of evaluated object set. If more objects are available, the returned pageToken can be used to fetch the subsequent page. Note that page tokens are *not* long-lived and *may* get invalidated (for example following updates to the underlying index or indices, or after a few minutes).\n * Note that the service currently does not provide guarantees around the consistency of returned results. In particular, any state changes to the underlying indices can cause duplicate results to be returned or some results to be skipped between subsequent page requests.\n */\nexport async function getObjectsPage(ctx, request, backend) {\n return conjureFetch(ctx, `/objectSets/objects`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Returns types of objects that can be present in the supplied object set based on its definition at the time\n * of the request.\n *\n * Note that this endpoint does not perform a full evaluation of the supplied object set - the guarantees provided\n * are that only the returned object types can be present in the supplied object set at the time of the request.\n * It is not however guaranteed that there in fact is at least one object of each returned object type - consider\n * using aggregations instead if false-positives are not desired.\n *\n * Note that object types belonging to an object set can change over time - this information should be treated as\n * dynamic and should not be persisted or treated as immutable.\n */\nexport async function getObjectTypes(ctx, request) {\n return conjureFetch(ctx, `/objectSets/objectTypes`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Returns the entities used within an object set. i.e. object type rids and link type rids\n *\n * Note that relations belonging to an object set can change over time - this information should be treated as\n * dynamic and should not be persisted or treated as immutable.\n */\nexport async function getReferencedEntities(ctx, request) {\n return conjureFetch(ctx, `/objectSets/entities`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Materialize an object set.\n */\nexport async function materializeObjectSet(ctx, request) {\n return conjureFetch(ctx, `/objectSets/materialize`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Allows user to enable watching object types. Requires permission to view the requested object types.\n */\nexport async function batchEnableWatcher(ctx, request) {\n return conjureFetch(ctx, `/object-set-watcher/batchEnableWatcher`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load Ontology entities in bulk. The returned OntologyBulkLoadEntitiesResponse will only\n * contain entities that actually exist and are visible to the user. If the user has requested entities at\n * invalid versions or entities that do not exist in the specified versions, those will not be present\n * in the response.\n *\n * There are limits on the number of entities that can be loaded in one request. Please refer to\n * documentation of OntologyBulkLoadEntitiesRequest for the values of these limits.\n */\nexport async function bulkLoadOntologyEntities(ctx, onBehalfOf, request) {\n return conjureFetch(ctx, `/ontology/ontology/bulkLoadEntities`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load Ontology entities by their backing datasources in bulk.\n * The returned OntologyBulkLoadEntitiesByDatasourcesResponse will only\n * contain entities that actually exist and are visible to the user.\n * If the user has requested entities that do not exist in any of the latest Ontology versions,\n * those will not be present in the response.\n *\n * There are limits on the number of entities that can be loaded in one request. Please refer to\n * documentation of OntologyBulkLoadEntitiesByDatasourcesRequest for the values of these limits.\n */\nexport async function bulkLoadOntologyEntitiesByDatasources(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/bulkLoadEntitiesByDatasources`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Gets all the action types that the object types are associated with. E.g. actions that create an object, edit\n * an object, or use the object as a parameter.\n */\nexport async function getActionTypesForObjectType(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/actionTypesForObjectType`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Please contact the OMS team before using this endpoint.\n *\n * Gets the current configuration of some OMS features. Note that these configurations are stack-wide, which\n * means they do not have granularity on org/enrollment/group level.\n */\nexport async function getFeatureConfigurations(ctx) {\n return conjureFetch(ctx, `/ontology/featureConfigurations`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to batch load links associated to given ObjectTypeRid(s). The GetLinkTypesForObjectTypesResponse\n * will only contain links that are visible to the user. If the user has requested to get links at for\n * ObjectTypeRid(s) that do not exist in the specified versions, those entries will include an empty set\n * of link types.\n */\nexport async function getLinkMetadataForObjectTypes(ctx, request) {\n return conjureFetch(ctx, `/ontology/getLinkMetadataForObjectTypes`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to batch load links associated to given ObjectTypeRid(s). The GetLinkTypesForObjectTypesResponse\n * will only contain links that are visible to the user. If the user has requested to get link types at\n * invalid ontology versions or for ObjectTypeRid(s) that do not exist in the specified versions, those entries\n * will include an empty set of link types.\n *\n * The includeObjectTypesWithoutSearchableDatasources flag is respected if present in the request,\n * else we set it to a default (false) unless the user-agent is blocklisted.\n * The flag is set to true for blocklisted user agents. Currently the blocklist\n * includes functions-typescript-gradle-plugin only.\n */\nexport async function getLinkTypesForObjectTypes(ctx, request) {\n return conjureFetch(ctx, `/ontology/linkTypesForObjectTypes`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Gets a map of interfaces to the set of object types that implement the interface. At most 50 interfaces can be\n * requested.\n */\nexport async function getObjectTypesForInterfaceTypes(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/objectTypesForInterfaceTypes`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Gets a map of SharedPropertyTypeRid to the set of ObjectTypeRids that use the SharedPropertyType. At most 50\n * SharedPropertyTypeRids can be requested.\n */\nexport async function getObjectTypesForSharedPropertyTypes(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/objectTypesForSharedPropertyTypes`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Gets a map of TypeGroupRids to the set of ObjectTypeRids that use the TypeGroup. At most 50 TypeGroupRids\n * can be requested.\n */\nexport async function getObjectTypesForTypeGroups(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/objectTypesForTypeGroups`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Gets the ontology rids to which the given ontology entities belong.\n * The returned OntologyRidsForOntologyEntitiesResponse will only\n * contain ontology rids for entities that actually exist and which belong to an Ontology that the user\n * has access to. If the user has requested entities that do not exist in any of the latest Ontology versions,\n * or which belong to an Ontology which the user does not have access to, those will not be present in the\n * response.\n */\nexport async function getOntologyRidsForEntities(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/getOntologyRidsForEntities`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load a summary of an Ontology including the number of entities of each type visible to the user.\n *\n * An entity is considered visible if the user has `view` or `discover` permissions. ObjectTypes and LinkTypes\n * migrated to roles are also considered visible regardless of the users permissions on the backing datasources\n * (i.e. the endpoint runs using `includeObjectTypesWithoutSearchableDatasources` set to true).\n *\n * The results in this endpoint are eventually consistent with the latest OntologyVersion and may lag slightly\n * behind the last Ontology modification.\n */\nexport async function getOntologySummary(ctx, ontologyRid, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/${ontologyRid}/summary`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Gets the organization rids to which the ontology entities in the given ontology rid belong. If the user has\n * requested an ontology they do not have access to, no organization rids will be present in the response.\n */\nexport async function getOrganizationRidsForOntology(ctx, ontologyRid) {\n return conjureFetch(ctx, `/ontology/ontology/${ontologyRid}/organizationRids`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to batch load relations associated to given objectTypeIds. The GetRelationsForObjectTypesResponse\n * will only contain relations that are visible to the user. If the user has requested to get relations at\n * invalid ontology versions or for objectTypeIds that do not exist in the specified versions, those entries\n * will include an empty set of relations.\n */\nexport async function getRelationsForObjectTypes(ctx, request) {\n return conjureFetch(ctx, `/ontology/relationsForObjectTypes`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to get all the CustomObjectTypeTraits a user has access to.\n */\nexport async function loadAllCustomObjectTypeTraitsFromOntology(ctx, ontologyRid, ontologyVersion, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/${ontologyRid}/${ontologyVersion}/loadAllCustomObjectTypeTraitsFromOntology`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load a paged collection of all interfaces visible to the user from the specified ontology and\n * ontology version. The maximum number of interfaces returned in a page is capped at 100.\n */\nexport async function loadAllInterfaceTypesFromOntology(ctx, ontologyRid, ontologyVersion, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/${ontologyRid}/${ontologyVersion}/loadAllInterfaceTypes`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load a paged collection of all ObjectTypes visible to the user from the specified Ontology and\n * OntologyVersion. The maximum number of ObjectTypes returned in a page is capped at 500.\n */\nexport async function loadAllObjectTypesFromOntology(ctx, ontologyRid, ontologyVersion, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/${ontologyRid}/${ontologyVersion}/loadAllObjectTypes`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load a paged collection of all ObjectTypes visible to the user from the specified Ontology and\n * OntologyVersion. The maximum number of ObjectTypes returned in a page is capped at 500.\n */\nexport async function loadAllObjectTypesFromOntologyPage(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/loadAllObjectTypes`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load metadata about the Ontologies a user has access to. The response will contain\n * only Ontologies on which the user has `ontology:view-ontology`. Note that the returned\n * LoadAllOntologiesResponse may be empty if there is no Ontology yet.\n */\nexport async function loadAllOntologies(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/ontologies/load/all`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load the whole Ontology at a given OntologyVersion or at the latest OntologyVersion.\n * The returned OntologyLoadResponse will only contain entities that are visible to the user.\n * If the user has requested to load the Ontology at an invalid OntologyVersion,\n * an empty response will be returned.\n *\n * In the presence of multiple ontologies, this endpoint will implicitly choose which ontology the user\n * expects to load given the organization membership of the user. If the user is not a member of any organization,\n * the default Ontology will be chosen.\n */\nexport async function loadAllOntology(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/all`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load entity rids from the whole Ontology at a given OntologyVersion or at the latest\n * OntologyVersion. The returned OntologyLoadResponse will only contain entity rids that are visible\n * to the user. If the user has requested to load the Ontology at an invalid OntologyVersion,\n * an empty response will be returned.\n *\n * In the presence of multiple ontologies, this endpoint will implicitly choose which ontology the user\n * expects to load given the organization membership of the user. If the user is not a member of any organization,\n * the default Ontology will be chosen.\n *\n * The includeObjectTypesWithoutSearchableDatasources flag is respected if present in the request,\n * else we set it to a default (false) unless the user-agent is blocklisted.\n * The flag is set to true for blocklisted user agents. Currently the blocklist\n * includes functions-typescript-gradle-plugin only.\n */\nexport async function loadAllOntologyEntities(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/allEntities`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load a paged collection of all SharedPropertyTypes visible to the user from the specified Ontology and\n * OntologyVersion. The maximum number of SharedPropertyTypes returned in a page is capped at 100.\n */\nexport async function loadAllSharedPropertyTypesFromOntology(ctx, ontologyRid, ontologyVersion, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/${ontologyRid}/${ontologyVersion}/loadAllSharedPropertyTypes`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load a paged collection of all type groups visible to the user from the specified ontology and\n * ontology version. The maximum number of type groups returned in a page is capped at 100.\n */\nexport async function loadAllTypeGroupsFromOntology(ctx, ontologyRid, ontologyVersion, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/${ontologyRid}/${ontologyVersion}/loadAllTypeGroups`, \"PUT\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to batch load Ontology entities. The returned OntologyLoadResponse will only contain\n * entities that actually exist and are visible to the user. If the user has requested entities at\n * invalid ontology versions or entities that do not exist in the specified versions,\n * those will not be present in the response. If the user tries to load entities across multiple ontologies, the\n * call will fail with an exception.\n */\nexport async function loadOntology(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to load datasources for Ontology entities at a given OntologyVersion or at the latest\n * OntologyVersion. The returned OntologyDatasourcesLoadResponse will only contain datasources that are\n * visible to the user. If the user has requested to get datasources at invalid ontology versions\n * or for objectTypeIds that do not exist in the specified versions, those entries will include an\n * empty set of datasources.\n */\nexport async function loadOntologyDatasources(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/load/datasources`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to batch load Ontology entities. The returned OntologyLoadResponse will only contain\n * entities that actually exist and are visible to the user. If the user has requested entities at\n * invalid ontology versions or entities that do not exist in the specified versions,\n * those will not be present in the response. If the user tries to load entities across multiple ontologies, the\n * call will fail with an exception.\n */\nexport async function loadOntologyEntities(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/loadEntities`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Endpoint to modify Ontology entities.\n */\nexport async function modifyOntology(ctx, request) {\n return conjureFetch(ctx, `/ontology/ontology/modify`, \"POST\", request);\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 toConjureObjectSet(objectSet, objectPropertyMapping) {\n switch (objectSet.type) {\n case \"base\":\n return {\n type: \"base\",\n base: {\n objectTypeId: objectPropertyMapping.id\n }\n };\n case \"static\":\n return {\n type: \"static\",\n static: {\n objectRids: objectSet.objects,\n provenance: undefined\n }\n };\n case \"reference\":\n return {\n type: \"referenced\",\n referenced: {\n objectSetRid: objectSet.reference\n }\n };\n case \"filter\":\n return {\n type: \"filtered\",\n filtered: {\n objectSet: toConjureObjectSet(objectSet.objectSet, objectPropertyMapping),\n runtimeDerivedProperties: undefined,\n filter: mapWhereClauseToObjectSetFilter(objectSet.where, objectPropertyMapping)\n }\n };\n case \"union\":\n return {\n type: \"unioned\",\n unioned: {\n objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))\n }\n };\n case \"intersect\":\n return {\n type: \"intersected\",\n intersected: {\n objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))\n }\n };\n case \"subtract\":\n return {\n type: \"subtracted\",\n subtracted: {\n objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))\n }\n };\n case \"searchAround\":\n throw new Error(\"not implemented\");\n }\n}\nexport async function getObjectSetBaseType(objectSet) {\n switch (objectSet.type) {\n case \"base\":\n return objectSet.objectType;\n case \"static\":\n // TODO: Get the object type from a wire call\n // This is not supported at the moment by the API anyway\n throw new Error(\"not implemented\");\n case \"reference\":\n // TODO: Get the object type from a wire call\n throw new Error(\"not implemented\");\n case \"filter\":\n return getObjectSetBaseType(objectSet.objectSet);\n case \"union\":\n // Technically you can have multiple ObjectTypes but at the moment we only support one\n return getObjectSetBaseType(objectSet.objectSets[0]);\n case \"intersect\":\n return getObjectSetBaseType(objectSet.objectSets[0]);\n case \"subtract\":\n return getObjectSetBaseType(objectSet.objectSets[0]);\n case \"searchAround\":\n // TODO: Get a mapping using the link\n throw new Error(\"not implemented\");\n }\n}\nfunction mapWhereClauseToObjectSetFilter(objectSetFilter, propertyMapping) {\n switch (objectSetFilter.type) {\n case \"lt\":\n return {\n type: \"range\",\n range: {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n lt: objectSetFilter.value,\n lte: undefined,\n gt: undefined,\n gte: undefined\n }\n };\n case \"gt\":\n return {\n type: \"range\",\n range: {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n gt: objectSetFilter.value,\n lte: undefined,\n lt: undefined,\n gte: undefined\n }\n };\n case \"lte\":\n return {\n type: \"range\",\n range: {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n lte: objectSetFilter.value,\n lt: undefined,\n gt: undefined,\n gte: undefined\n }\n };\n case \"gte\":\n return {\n type: \"range\",\n range: {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n gte: objectSetFilter.value,\n lt: undefined,\n lte: undefined,\n gt: undefined\n }\n };\n case \"eq\":\n return {\n type: \"exactMatch\",\n exactMatch: {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n terms: []\n }\n };\n case \"and\":\n return {\n type: \"and\",\n and: {\n filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping))\n }\n };\n case \"or\":\n return {\n type: \"or\",\n or: {\n filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping))\n }\n };\n case \"isNull\":\n return {\n type: \"not\",\n not: {\n filter: {\n type: \"hasProperty\",\n hasProperty: {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field]\n }\n }\n }\n };\n case \"not\":\n return {\n type: \"not\",\n not: {\n filter: mapWhereClauseToObjectSetFilter(objectSetFilter.value, propertyMapping)\n }\n };\n case \"contains\":\n case \"startsWith\":\n case \"containsAllTermsInOrder\":\n case \"containsAnyTerm\":\n case \"containsAllTerms\":\n case \"withinDistanceOf\":\n case \"withinBoundingBox\":\n case \"intersectsBoundingBox\":\n case \"doesNotIntersectBoundingBox\":\n case \"withinPolygon\":\n case \"intersectsPolygon\":\n case \"doesNotIntersectPolygon\":\n case \"containsAllTermsInOrderPrefixLastTerm\":\n throw new Error(\"not implemented\");\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 { modernToLegacyWhereClause } from \"../internal/conversions/index.js\";\nimport { convertWireToOsdkObjects } from \"../object/convertWireToOsdkObjects.js\";\nimport { fetchPageInternal } from \"../object/fetchPage.js\";\nimport { fetchSingle } from \"../object/fetchSingle.js\";\nimport { aggregate } from \"../object/index.js\";\nimport { isWireObjectSet } from \"../util/WireObjectSet.js\";\nimport { ObjectSetListenerWebsocket } from \"./ObjectSetListenerWebsocket.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 aggregateOrThrow: aggregate.bind(globalThis, clientCtx, objectType, objectSet),\n fetchPage: fetchPageInternal.bind(globalThis, clientCtx, objectType, objectSet),\n fetchPageOrThrow: fetchPageInternal.bind(globalThis, clientCtx, objectType, objectSet),\n where: clause => {\n return createObjectSet(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 createObjectSet(objectType, clientCtx, {\n type: \"union\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n intersect: (...objectSets) => {\n return createObjectSet(objectType, clientCtx, {\n type: \"intersect\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n subtract: (...objectSets) => {\n return createObjectSet(objectType, clientCtx, {\n type: \"subtract\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n subscribe(listener) {\n const instance = ObjectSetListenerWebsocket.getInstance(clientCtx);\n return instance.subscribe(objectSet, listener);\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 };\n function createSearchAround(link) {\n return () => {\n return createObjectSet(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 createCache(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 createAsyncCache(fn, createCacheLocal = createCache) {\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}"]}
|