@osdk/client 0.16.0 → 0.17.0-main-20240426184921

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/build/js/{ObjectSetListenerWebsocket-ODRFQQMY.cjs → ObjectSetListenerWebsocket-QQ45K3YV.cjs} +7 -7
  3. package/build/js/{ObjectSetListenerWebsocket-ODRFQQMY.cjs.map → ObjectSetListenerWebsocket-QQ45K3YV.cjs.map} +1 -1
  4. package/build/js/{ObjectSetListenerWebsocket-XV5EGCT6.mjs → ObjectSetListenerWebsocket-TWQJWEX2.mjs} +2 -2
  5. package/build/js/{ObjectSetListenerWebsocket-XV5EGCT6.mjs.map → ObjectSetListenerWebsocket-TWQJWEX2.mjs.map} +1 -1
  6. package/build/js/{chunk-ZE5276TU.mjs → chunk-4MFLNKU3.mjs} +3 -3
  7. package/build/js/{chunk-FM5TB24T.cjs.map → chunk-4MFLNKU3.mjs.map} +1 -1
  8. package/build/js/{chunk-FM5TB24T.cjs → chunk-X5T2JBPJ.cjs} +3 -3
  9. package/build/js/{chunk-ZE5276TU.mjs.map → chunk-X5T2JBPJ.cjs.map} +1 -1
  10. package/build/js/index.cjs +16 -16
  11. package/build/js/index.cjs.map +1 -1
  12. package/build/js/index.mjs +3 -3
  13. package/build/js/index.mjs.map +1 -1
  14. package/build/types/Client.d.ts +1 -1
  15. package/build/types/actions/Actions.d.ts +1 -1
  16. package/build/types/generatedNoCheck/OntologyMetadata.d.ts +1 -1
  17. package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -1
  18. package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -1
  19. package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -1
  20. package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts +1 -1
  21. package/build/types/object/aggregate.d.ts +1 -1
  22. package/build/types/object/convertWireToOsdkObjects.d.ts +1 -1
  23. package/build/types/object/fetchPage.d.ts +1 -1
  24. package/build/types/object/fetchSingle.d.ts +1 -1
  25. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +1 -1
  26. package/build/types/objectSet/createObjectSet.d.ts +1 -1
  27. package/build/types/objectSet/toConjureObjectSet.d.ts +1 -1
  28. package/build/types/util/WireObjectSet.d.ts +1 -1
  29. package/build/types/util/isOntologyObjectV2.d.ts +1 -1
  30. package/build/types/util/toDataValue.d.ts +1 -1
  31. package/package.json +10 -13
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/actions/ActionValidationError.ts","../../../omniapi/build/js/public/OntologiesV2_Action.mjs","../../src/util/isOntologyObjectV2.ts","../../src/util/toDataValue.ts","../../src/actions/applyAction.ts","../../src/actions/createActionInvoker.ts","../../src/createMinimalClient.ts","../../src/ontology/StandardOntologyProvider.ts","../../../omniapi/build/js/public/OntologiesV2_OntologyV2.mjs","../../src/ontology/loadFullObjectMetadata.ts","../../src/ontology/loadInterfaceDefinition.ts","../../src/util/UserAgent.ts","../../src/createClient.ts"],"names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectTypeDefinition","omniFetch","client"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,SAAS,YAAY;;;ACAd,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAC/C,YAAY,YAAY;AACtB,UAAM,kBAAkB;AACxB,SAAK,aAAa;AAAA,EACpB;AACF;;;ACrBA,SAAS,iBAAiB;AAG1B,IAAI,iBAAiB,CAAC,GAAG,wCAAwC,CAAC;AAClE,SAAS,cAAc,SAAS,MAAM;AACpC,SAAO,UAAU,MAAM,gBAAgB,GAAG,IAAI;AAChD;;;ACUO,SAAS,mBAAmB,GAAG;AACpC,SAAO,KAAK,OAAO,MAAM,YAAY,OAAO,EAAE,cAAc,YAAY,EAAE,gBAAgB;AAC5F;;;ACQO,SAAS,YAAY,OAAO;AACjC,MAAI,SAAS,MAAM;A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AAa;AACjD,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,gBAAgB,GAAG,SAAS;AAAA,IACrC,WAAW,EAAE,SAAS,UAAU;AAC9B,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,oBAAoB,WAAW,CAAC;AAAA,IACzC,OAAO;AACL,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACnC;AAAA,EACF;AACA,QAAM,SAAS,OAAO,iBAAiB,UAAU;AAAA,IAC/C,iCAAiC;AAAA,MAC/B,KAAK,MAAM,CAAC,YAAY,QAAQ;AAC9B,eAAO,gBAAgB,YAAY,WAAW;AAAA,UAC5C,MAAM;AAAA,UACN,YAAY,CAAC;AAAA,YACX,MAAM;AAAA,YACN,YAAY,WAAW;AAAA,UACzB,GAAG;AAAA,YACD,MAAM;AAAA,YACN,WAAW;AAAA,UACb,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,KAAK;AAAA,MACH,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AACD,SAAO;AACT","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\nexport { isOk } from \"@osdk/shared.net\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { augment } from \"./object/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\nexport class ActionValidationError extends Error {\n constructor(validation) {\n super(\"Validation Error\");\n this.validation = validation;\n }\n}","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_Action.ts\nvar _applyActionV2 = [1, \"/v2/ontologies/{0}/actions/{1}/apply\", 3];\nfunction applyActionV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionV2, ...args);\n}\nvar _applyActionBatchV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyBatch\", 3];\nfunction applyActionBatchV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionBatchV2, ...args);\n}\nvar _applyActionAsyncV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyAsync\", 3];\nfunction applyActionAsyncV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionAsyncV2, ...args);\n}\nexport { applyActionAsyncV2, applyActionBatchV2, applyActionV2 };","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\" && o.__primaryKey != null;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isAttachment } from \"../object/Attachment.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n */\nexport function toDataValue(value) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n return Array.from(value, toDataValue);\n }\n\n // attachments just send the rid directly\n if (isAttachment(value)) {\n return value.rid;\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return toDataValue(value.__primaryKey);\n }\n\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce((acc, [key, structValue]) => {\n acc[key] = toDataValue(structValue);\n return acc;\n }, {});\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyActionV2 } from \"@osdk/omniapi/OntologiesV2_Action\";\nimport { addUserAgent } from \"../util/addUserAgent.js\";\nimport { toDataValue } from \"../util/toDataValue.js\";\nimport { ActionValidationError } from \"./ActionValidationError.js\";\n\n// cannot specify both validateOnly and returnEdits as true\n\nexport async function applyAction(client, action, parameters, options = {}) {\n const response = await applyActionV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {\n parameters: remapActionParams(parameters),\n options: {\n mode: options?.validateOnly ? \"VALIDATE_ONLY\" : \"VALIDATE_AND_EXECUTE\",\n returnEdits: options?.returnEdits ? \"ALL\" : \"NONE\"\n }\n });\n if (options?.validateOnly) {\n return response.validation;\n }\n if (response.validation?.result === \"INVALID\") {\n throw new ActionValidationError(response.validation);\n }\n return options?.returnEdits ? response.edits : undefined;\n}\nfunction remapActionParams(params) {\n if (params == null) {\n return {};\n }\n const parameterMap = {};\n const remappedParams = Object.entries(params).reduce((acc, [key, value]) => {\n acc[key] = toDataValue(value);\n return acc;\n }, parameterMap);\n return remappedParams;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyAction } from \"./applyAction.js\";\nexport function createActionInvoker(client, action) {\n return function (...args) {\n return applyAction(client, action, ...args);\n };\n}\nexport function createOldActionInvoker(client, ontology) {\n const proxy = new Proxy({}, {\n get: (_target, p, _receiver) => {\n if (typeof p === \"string\") {\n return createActionInvoker(client, ontology.actions[p]);\n }\n return undefined;\n },\n ownKeys(_target) {\n return Object.keys(ontology.actions);\n },\n getOwnPropertyDescriptor(_target, p) {\n if (typeof p === \"string\") {\n return {\n enumerable: ontology.actions[p] != null,\n configurable: true,\n value: proxy[p]\n };\n }\n }\n });\n return proxy;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createClientContext } from \"@osdk/shared.net\";\nimport { createStandardOntologyProviderFactory } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\nexport function createMinimalClient(metadata, stack, tokenProvider, options = {}, fetchFn = global.fetch) {\n if (process?.env?.NODE_ENV !== \"production\") {\n try {\n new URL(stack);\n } catch (e) {\n const hint = !stack.startsWith(\"http://\") || !stack.startsWith(\"https://\") ? \". Did you forget to add 'http://' or 'https://'?\" : \"\";\n throw new Error(`Invalid stack URL: ${stack}${hint}`);\n }\n }\n const clientCtx = {\n ...createClientContext({\n metadata\n }, stack, tokenProvider, USER_AGENT, fetchFn),\n ontologyRid: metadata.ontologyRid,\n ontologyProvider: undefined,\n logger: options.logger\n };\n clientCtx.ontologyProvider = createStandardOntologyProviderFactory(options)(clientCtx);\n return clientCtx;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport { listInterfaceTypes } from \"@osdk/omniapi/OntologiesV2_OntologyObjectV2\";\nimport { getOntologyFullMetadata } from \"@osdk/omniapi/OntologiesV2_OntologyV2\";\nimport deepEqual from \"fast-deep-equal\";\nimport { createAsyncCache } from \"../object/Cache.js\";\nimport { loadFullObjectMetadata } from \"./loadFullObjectMetadata.js\";\nimport { loadInterfaceDefinition } from \"./loadInterfaceDefinition.js\";\nconst alwaysRevalidateDefault = false;\n\n// SLLLLLLOOOOOOOWWWW\nasync function fullOntologyLoad(client) {\n return await Promise.all([listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), getOntologyFullMetadata(client, client.ontologyRid)]);\n}\nexport const USE_FULL_ONTOLOGY = false;\nexport const createStandardOntologyProviderFactory = client => {\n const alwaysRevalidate = client.alwaysRevalidate ?? alwaysRevalidateDefault;\n return client => {\n let fullCache;\n async function initLocalCache(client, skipCache) {\n if (skipCache) {\n return await fullOntologyLoad(client);\n }\n if (!fullCache) {\n fullCache = fullOntologyLoad(client);\n }\n return await fullCache;\n }\n async function loadObject(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return {\n ...wireObjectTypeFullMetadataToSdkObjectTypeDefinition(fullCacheLocal[1].objectTypes[key], true),\n implements: fullCacheLocal[0].data.map(i => i.apiName)\n };\n } else {\n return await loadFullObjectMetadata(client, key);\n }\n }\n async function loadInterface(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(fullCacheLocal[1].interfaceTypes[key], true);\n } else {\n return loadInterfaceDefinition(client, key);\n }\n }\n function makeGetter(fn) {\n const cache = createAsyncCache((client, key) => fn(client, key, false));\n return async apiName => {\n const n = alwaysRevalidate ? await fn(client, apiName, true) : await cache.get(client, apiName);\n if (alwaysRevalidate) {\n const og = cache.getOrUndefined(client, apiName);\n if (deepEqual(og, n)) {\n return og; // ! because we can be sure `n` would throw if it were undefined\n } else {\n return cache.set(client, apiName, n);\n }\n }\n return n;\n };\n }\n return {\n getObjectDefinition: makeGetter(loadObject),\n getInterfaceDefinition: makeGetter(loadInterface),\n maybeSeed(definition) {\n // not using this for now\n }\n };\n };\n};","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_OntologyV2.ts\nvar _listOntologiesV2 = [0, \"/v2/ontologies\"];\nfunction listOntologiesV2($ctx, ...args) {\n return omniFetch($ctx, _listOntologiesV2, ...args);\n}\nvar _getOntologyV2 = [0, \"/v2/ontologies/{0}\"];\nfunction getOntologyV2($ctx, ...args) {\n return omniFetch($ctx, _getOntologyV2, ...args);\n}\nvar _getOntologyFullMetadata = [0, \"/v2/ontologies/{0}/fullMetadata\"];\nfunction getOntologyFullMetadata($ctx, ...args) {\n return omniFetch($ctx, _getOntologyFullMetadata, ...args);\n}\nexport { getOntologyFullMetadata, getOntologyV2, listOntologiesV2 };","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport { getObjectTypeV2, listOutgoingLinkTypesV2 } from \"@osdk/omniapi/OntologiesV2_ObjectTypeV2\";\nimport { listInterfaceTypes } from \"@osdk/omniapi/OntologiesV2_OntologyObjectV2\";\nimport invariant from \"tiny-invariant\";\nimport { loadAllOntologies } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadAllOntologies.js\";\nimport { loadOntologyEntities } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadOntologyEntities.js\";\nasync function loadAllOutgoingLinkTypes(client, objtype) {\n const linkTypes = [];\n let pageToken;\n do {\n const result = await listOutgoingLinkTypesV2(client, client.ontologyRid, objtype, {\n pageToken\n });\n pageToken = result.nextPageToken;\n linkTypes.push(...result.data);\n } while (pageToken != null);\n return linkTypes;\n}\nfunction makeConjureContext(client, servicePath) {\n return {\n baseUrl: client.stack,\n servicePath,\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider()\n };\n}\nexport async function loadFullObjectMetadata(client, objtype) {\n const conjureCtx = makeConjureContext(client, \"/ontology-metadata/api\");\n const [objectType, linkTypes, interfaceTypes, metadata] = await Promise.all([getObjectTypeV2(client, client.ontologyRid, objtype), loadAllOutgoingLinkTypes(client, objtype), listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), await loadAllOntologies(conjureCtx, {})]);\n const sharedPropertyTypeMapping = await loadSptMap(conjureCtx, metadata, client.ontologyRid, objectType.rid);\n const full = {\n implementsInterfaces: interfaceTypes.data.map(i => i.apiName),\n linkTypes,\n objectType,\n sharedPropertyTypeMapping\n };\n\n // TODO: reuse the loaded interface data!\n return wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);\n}\nasync function loadSptMap(ctx, ontologyMetadata, ontologyRid, objectRid) {\n const ontologyVersion = ontologyMetadata.ontologies[ontologyRid].currentOntologyVersion;\n const body = {\n objectTypeVersions: {\n [objectRid]: ontologyVersion\n },\n linkTypeVersions: {},\n loadRedacted: false,\n includeObjectTypesWithoutSearchableDatasources: true\n };\n const entities = await loadOntologyEntities(ctx, body);\n const objectType = entities.objectTypes[objectRid];\n !objectType ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"object type should be loaded\") : invariant(false) : void 0;\n const sptMap = {};\n for (const property of Object.values(objectType.propertyTypes)) {\n if (property.sharedPropertyTypeApiName && property.apiName) {\n sptMap[property.sharedPropertyTypeApiName] = property.apiName;\n }\n }\n return sptMap;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport { getInterfaceType } from \"@osdk/omniapi/OntologiesV2_OntologyObjectV2\";\nexport async function loadInterfaceDefinition(client, objtype) {\n const r = await getInterfaceType(client, client.ontologyRid, objtype, {\n preview: true\n });\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;","/*\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 { createActionInvoker } from \"./actions/createActionInvoker.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nexport function createClient(stack, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({\n ontologyRid,\n userAgent: \"\" // ontology specific user agent injected elsewhere\n }, stack, tokenProvider, options, fetchFn);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createObjectSet(o, clientCtx);\n } else if (o.type === \"action\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createActionInvoker(clientCtx, o);\n } else {\n throw new Error(\"not implemented\");\n }\n }\n const client = Object.defineProperties(clientFn, {\n __UNSTABLE_preexistingObjectSet: {\n get: () => (definition, rid) => {\n return createObjectSet(definition, clientCtx, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: definition.apiName\n }, {\n type: \"reference\",\n reference: rid\n }]\n });\n }\n },\n ctx: {\n value: clientCtx\n }\n });\n return client;\n}"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/actions/ActionValidationError.ts","../../../foundry/build/js/public/OntologiesV2_Action.mjs","../../src/util/isOntologyObjectV2.ts","../../src/util/toDataValue.ts","../../src/actions/applyAction.ts","../../src/actions/createActionInvoker.ts","../../src/createMinimalClient.ts","../../../foundry/build/js/public/OntologiesV2_OntologyV2.mjs","../../src/ontology/StandardOntologyProvider.ts","../../src/ontology/loadFullObjectMetadata.ts","../../src/ontology/loadInterfaceDefinition.ts","../../src/util/UserAgent.ts","../../src/createClient.ts"],"names":["omniFetch","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectTypeDefinition","client"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,SAAS,YAAY;;;ACAd,IAAM,wBAAN,cAAoC,MAAM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,YAAY,OAAO;AAAA,IAC5C,aAAa,SAAS;AAAA,IACtB,kBAAkB;AAAA,IAClB,QAAQ,QAAQ;AAAA,EAClB;AACA,YAAU,mBAAmB,sCAAsC,OAAO,EAAE,SAAS;AACrF,SAAO;AACT;;;AMnBO,SAAS,aAAa,OAAO,aAAa,eAAe,UAAU,QAAW,UAAU,OAAO;AACpG,QAAM,YAAY,oBAAoB;AAAA,IACpC;AAAA,IACA,WAAW;AAAA;AAAA,EACb,GAAG,OAAO,eAAe,SAAS,OAAO;AACzC,WAAS,SAAS,GAAG;AACnB,QAAI,EAAE,SAAS,YAAY,EAAE,SAAS,aAAa;AACjD,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,gBAAgB,GAAG,SAAS;AAAA,IACrC,WAAW,EAAE,SAAS,UAAU;AAC9B,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,oBAAoB,WAAW,CAAC;AAAA,IACzC,OAAO;AACL,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACnC;AAAA,EACF;AACA,QAAM,SAAS,OAAO,iBAAiB,UAAU;AAAA,IAC/C,iCAAiC;AAAA,MAC/B,KAAK,MAAM,CAAC,YAAY,QAAQ;AAC9B,eAAO,gBAAgB,YAAY,WAAW;AAAA,UAC5C,MAAM;AAAA,UACN,YAAY,CAAC;AAAA,YACX,MAAM;AAAA,YACN,YAAY,WAAW;AAAA,UACzB,GAAG;AAAA,YACD,MAAM;AAAA,YACN,WAAW;AAAA,UACb,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,KAAK;AAAA,MACH,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AACD,SAAO;AACT","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\nexport { isOk } from \"@osdk/shared.net\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { augment } from \"./object/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\nexport class ActionValidationError extends Error {\n constructor(validation) {\n super(\"Validation Error\");\n this.validation = validation;\n }\n}","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_Action.ts\nvar _applyActionV2 = [1, \"/v2/ontologies/{0}/actions/{1}/apply\", 3];\nfunction applyActionV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionV2, ...args);\n}\nvar _applyActionBatchV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyBatch\", 3];\nfunction applyActionBatchV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionBatchV2, ...args);\n}\nvar _applyActionAsyncV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyAsync\", 3];\nfunction applyActionAsyncV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionAsyncV2, ...args);\n}\nexport { applyActionAsyncV2, applyActionBatchV2, applyActionV2 };","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\" && o.__primaryKey != null;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isAttachment } from \"../object/Attachment.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n */\nexport function toDataValue(value) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n return Array.from(value, toDataValue);\n }\n\n // attachments just send the rid directly\n if (isAttachment(value)) {\n return value.rid;\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return toDataValue(value.__primaryKey);\n }\n\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce((acc, [key, structValue]) => {\n acc[key] = toDataValue(structValue);\n return acc;\n }, {});\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyActionV2 } from \"@osdk/foundry/OntologiesV2_Action\";\nimport { addUserAgent } from \"../util/addUserAgent.js\";\nimport { toDataValue } from \"../util/toDataValue.js\";\nimport { ActionValidationError } from \"./ActionValidationError.js\";\n\n// cannot specify both validateOnly and returnEdits as true\n\nexport async function applyAction(client, action, parameters, options = {}) {\n const response = await applyActionV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {\n parameters: remapActionParams(parameters),\n options: {\n mode: options?.validateOnly ? \"VALIDATE_ONLY\" : \"VALIDATE_AND_EXECUTE\",\n returnEdits: options?.returnEdits ? \"ALL\" : \"NONE\"\n }\n });\n if (options?.validateOnly) {\n return response.validation;\n }\n if (response.validation?.result === \"INVALID\") {\n throw new ActionValidationError(response.validation);\n }\n return options?.returnEdits ? response.edits : undefined;\n}\nfunction remapActionParams(params) {\n if (params == null) {\n return {};\n }\n const parameterMap = {};\n const remappedParams = Object.entries(params).reduce((acc, [key, value]) => {\n acc[key] = toDataValue(value);\n return acc;\n }, parameterMap);\n return remappedParams;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyAction } from \"./applyAction.js\";\nexport function createActionInvoker(client, action) {\n return function (...args) {\n return applyAction(client, action, ...args);\n };\n}\nexport function createOldActionInvoker(client, ontology) {\n const proxy = new Proxy({}, {\n get: (_target, p, _receiver) => {\n if (typeof p === \"string\") {\n return createActionInvoker(client, ontology.actions[p]);\n }\n return undefined;\n },\n ownKeys(_target) {\n return Object.keys(ontology.actions);\n },\n getOwnPropertyDescriptor(_target, p) {\n if (typeof p === \"string\") {\n return {\n enumerable: ontology.actions[p] != null,\n configurable: true,\n value: proxy[p]\n };\n }\n }\n });\n return proxy;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createClientContext } from \"@osdk/shared.net\";\nimport { createStandardOntologyProviderFactory } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\nexport function createMinimalClient(metadata, stack, tokenProvider, options = {}, fetchFn = global.fetch) {\n if (process?.env?.NODE_ENV !== \"production\") {\n try {\n new URL(stack);\n } catch (e) {\n const hint = !stack.startsWith(\"http://\") || !stack.startsWith(\"https://\") ? \". Did you forget to add 'http://' or 'https://'?\" : \"\";\n throw new Error(`Invalid stack URL: ${stack}${hint}`);\n }\n }\n const clientCtx = {\n ...createClientContext({\n metadata\n }, stack, tokenProvider, USER_AGENT, fetchFn),\n ontologyRid: metadata.ontologyRid,\n ontologyProvider: undefined,\n logger: options.logger\n };\n clientCtx.ontologyProvider = createStandardOntologyProviderFactory(options)(clientCtx);\n return clientCtx;\n}","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_OntologyV2.ts\nvar _listOntologiesV2 = [0, \"/v2/ontologies\"];\nfunction listOntologiesV2($ctx, ...args) {\n return omniFetch($ctx, _listOntologiesV2, ...args);\n}\nvar _getOntologyV2 = [0, \"/v2/ontologies/{0}\"];\nfunction getOntologyV2($ctx, ...args) {\n return omniFetch($ctx, _getOntologyV2, ...args);\n}\nvar _getOntologyFullMetadata = [0, \"/v2/ontologies/{0}/fullMetadata\"];\nfunction getOntologyFullMetadata($ctx, ...args) {\n return omniFetch($ctx, _getOntologyFullMetadata, ...args);\n}\nexport { getOntologyFullMetadata, getOntologyV2, listOntologiesV2 };","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { listInterfaceTypes } from \"@osdk/foundry/OntologiesV2_OntologyObjectV2\";\nimport { getOntologyFullMetadata } from \"@osdk/foundry/OntologiesV2_OntologyV2\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport deepEqual from \"fast-deep-equal\";\nimport { createAsyncCache } from \"../object/Cache.js\";\nimport { loadFullObjectMetadata } from \"./loadFullObjectMetadata.js\";\nimport { loadInterfaceDefinition } from \"./loadInterfaceDefinition.js\";\nconst alwaysRevalidateDefault = false;\n\n// SLLLLLLOOOOOOOWWWW\nasync function fullOntologyLoad(client) {\n return await Promise.all([listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), getOntologyFullMetadata(client, client.ontologyRid)]);\n}\nexport const USE_FULL_ONTOLOGY = false;\nexport const createStandardOntologyProviderFactory = client => {\n const alwaysRevalidate = client.alwaysRevalidate ?? alwaysRevalidateDefault;\n return client => {\n let fullCache;\n async function initLocalCache(client, skipCache) {\n if (skipCache) {\n return await fullOntologyLoad(client);\n }\n if (!fullCache) {\n fullCache = fullOntologyLoad(client);\n }\n return await fullCache;\n }\n async function loadObject(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return {\n ...wireObjectTypeFullMetadataToSdkObjectTypeDefinition(fullCacheLocal[1].objectTypes[key], true),\n implements: fullCacheLocal[0].data.map(i => i.apiName)\n };\n } else {\n return await loadFullObjectMetadata(client, key);\n }\n }\n async function loadInterface(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(fullCacheLocal[1].interfaceTypes[key], true);\n } else {\n return loadInterfaceDefinition(client, key);\n }\n }\n function makeGetter(fn) {\n const cache = createAsyncCache((client, key) => fn(client, key, false));\n return async apiName => {\n const n = alwaysRevalidate ? await fn(client, apiName, true) : await cache.get(client, apiName);\n if (alwaysRevalidate) {\n const og = cache.getOrUndefined(client, apiName);\n if (deepEqual(og, n)) {\n return og; // ! because we can be sure `n` would throw if it were undefined\n } else {\n return cache.set(client, apiName, n);\n }\n }\n return n;\n };\n }\n return {\n getObjectDefinition: makeGetter(loadObject),\n getInterfaceDefinition: makeGetter(loadInterface),\n maybeSeed(definition) {\n // not using this for now\n }\n };\n };\n};","/*\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 { getObjectTypeV2, listOutgoingLinkTypesV2 } from \"@osdk/foundry/OntologiesV2_ObjectTypeV2\";\nimport { listInterfaceTypes } from \"@osdk/foundry/OntologiesV2_OntologyObjectV2\";\nimport { wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport invariant from \"tiny-invariant\";\nimport { loadAllOntologies } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadAllOntologies.js\";\nimport { loadOntologyEntities } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadOntologyEntities.js\";\nasync function loadAllOutgoingLinkTypes(client, objtype) {\n const linkTypes = [];\n let pageToken;\n do {\n const result = await listOutgoingLinkTypesV2(client, client.ontologyRid, objtype, {\n pageToken\n });\n pageToken = result.nextPageToken;\n linkTypes.push(...result.data);\n } while (pageToken != null);\n return linkTypes;\n}\nfunction makeConjureContext(client, servicePath) {\n return {\n baseUrl: client.stack,\n servicePath,\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider()\n };\n}\nexport async function loadFullObjectMetadata(client, objtype) {\n const conjureCtx = makeConjureContext(client, \"/ontology-metadata/api\");\n const [objectType, linkTypes, interfaceTypes, metadata] = await Promise.all([getObjectTypeV2(client, client.ontologyRid, objtype), loadAllOutgoingLinkTypes(client, objtype), listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), await loadAllOntologies(conjureCtx, {})]);\n const sharedPropertyTypeMapping = await loadSptMap(conjureCtx, metadata, client.ontologyRid, objectType.rid);\n const full = {\n implementsInterfaces: interfaceTypes.data.map(i => i.apiName),\n linkTypes,\n objectType,\n sharedPropertyTypeMapping\n };\n\n // TODO: reuse the loaded interface data!\n return wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);\n}\nasync function loadSptMap(ctx, ontologyMetadata, ontologyRid, objectRid) {\n const ontologyVersion = ontologyMetadata.ontologies[ontologyRid].currentOntologyVersion;\n const body = {\n objectTypeVersions: {\n [objectRid]: ontologyVersion\n },\n linkTypeVersions: {},\n loadRedacted: false,\n includeObjectTypesWithoutSearchableDatasources: true\n };\n const entities = await loadOntologyEntities(ctx, body);\n const objectType = entities.objectTypes[objectRid];\n !objectType ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"object type should be loaded\") : invariant(false) : void 0;\n const sptMap = {};\n for (const property of Object.values(objectType.propertyTypes)) {\n if (property.sharedPropertyTypeApiName && property.apiName) {\n sptMap[property.sharedPropertyTypeApiName] = property.apiName;\n }\n }\n return sptMap;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInterfaceType } from \"@osdk/foundry/OntologiesV2_OntologyObjectV2\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nexport async function loadInterfaceDefinition(client, objtype) {\n const r = await getInterfaceType(client, client.ontologyRid, objtype, {\n preview: true\n });\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;","/*\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 { createActionInvoker } from \"./actions/createActionInvoker.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nexport function createClient(stack, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({\n ontologyRid,\n userAgent: \"\" // ontology specific user agent injected elsewhere\n }, stack, tokenProvider, options, fetchFn);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createObjectSet(o, clientCtx);\n } else if (o.type === \"action\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createActionInvoker(clientCtx, o);\n } else {\n throw new Error(\"not implemented\");\n }\n }\n const client = Object.defineProperties(clientFn, {\n __UNSTABLE_preexistingObjectSet: {\n get: () => (definition, rid) => {\n return createObjectSet(definition, clientCtx, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: definition.apiName\n }, {\n type: \"reference\",\n reference: rid\n }]\n });\n }\n },\n ctx: {\n value: clientCtx\n }\n });\n return client;\n}"]}
@@ -1,5 +1,5 @@
1
- import { createObjectSet, createAsyncCache, addUserAgent, isAttachment, isWireObjectSet, isObjectSet, getWireObjectSet, getObjectTypeV2, listInterfaceTypes, loadAllOntologies, loadOntologyEntities, getInterfaceType, listOutgoingLinkTypesV2 } from './chunk-ZE5276TU.mjs';
2
- export { augment } from './chunk-ZE5276TU.mjs';
1
+ import { createObjectSet, createAsyncCache, addUserAgent, isAttachment, isWireObjectSet, isObjectSet, getWireObjectSet, getObjectTypeV2, listInterfaceTypes, loadAllOntologies, loadOntologyEntities, getInterfaceType, listOutgoingLinkTypesV2 } from './chunk-4MFLNKU3.mjs';
2
+ export { augment } from './chunk-4MFLNKU3.mjs';
3
3
  import { createClientContext, omniFetch } from '@osdk/shared.net';
4
4
  export { isOk } from '@osdk/shared.net';
5
5
  import { wireObjectTypeFullMetadataToSdkObjectTypeDefinition, __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from '@osdk/generator-converters';
@@ -190,7 +190,7 @@ var createStandardOntologyProviderFactory = (client) => {
190
190
  };
191
191
 
192
192
  // src/util/UserAgent.ts
193
- var USER_AGENT = `osdk-client/${"0.16.0"}`;
193
+ var USER_AGENT = `osdk-client/${"0.17.0-main-20240426184921"}`;
194
194
 
195
195
  // src/createMinimalClient.ts
196
196
  function createMinimalClient(metadata, stack, tokenProvider, options = {}, fetchFn = global.fetch) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/actions/ActionValidationError.ts","../../../omniapi/build/js/public/OntologiesV2_Action.mjs","../../src/util/isOntologyObjectV2.ts","../../src/util/toDataValue.ts","../../src/actions/applyAction.ts","../../src/actions/createActionInvoker.ts","../../src/createMinimalClient.ts","../../src/ontology/StandardOntologyProvider.ts","../../../omniapi/build/js/public/OntologiesV2_OntologyV2.mjs","../../src/ontology/loadFullObjectMetadata.ts","../../src/ontology/loadInterfaceDefinition.ts","../../src/util/UserAgent.ts","../../src/createClient.ts"],"names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectTypeDefinition","omniFetch","client"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,SAAS,YAAY;;;ACAd,IAAM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A,IACF,GAAG,OAAO,eAAe,YAAY,OAAO;AAAA,IAC5C,aAAa,SAAS;AAAA,IACtB,kBAAkB;AAAA,IAClB,QAAQ,QAAQ;AAAA,EAClB;AACA,YAAU,mBAAmB,sCAAsC,OAAO,EAAE,SAAS;AACrF,SAAO;AACT;;;AMnBO,SAAS,aAAa,OAAO,aAAa,eAAe,UAAU,QAAW,UAAU,OAAO;AACpG,QAAM,YAAY,oBAAoB;AAAA,IACpC;AAAA,IACA,WAAW;AAAA;AAAA,EACb,GAAG,OAAO,eAAe,SAAS,OAAO;AACzC,WAAS,SAAS,GAAG;AACnB,QAAI,EAAE,SAAS,YAAY,EAAE,SAAS,aAAa;AACjD,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,gBAAgB,GAAG,SAAS;AAAA,IACrC,WAAW,EAAE,SAAS,UAAU;AAC9B,gBAAU,iBAAiB,UAAU,CAAC;AACtC,aAAO,oBAAoB,WAAW,CAAC;AAAA,IACzC,OAAO;AACL,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACnC;AAAA,EACF;AACA,QAAM,SAAS,OAAO,iBAAiB,UAAU;AAAA,IAC/C,iCAAiC;AAAA,MAC/B,KAAK,MAAM,CAAC,YAAY,QAAQ;AAC9B,eAAO,gBAAgB,YAAY,WAAW;AAAA,UAC5C,MAAM;AAAA,UACN,YAAY,CAAC;AAAA,YACX,MAAM;AAAA,YACN,YAAY,WAAW;AAAA,UACzB,GAAG;AAAA,YACD,MAAM;AAAA,YACN,WAAW;AAAA,UACb,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,KAAK;AAAA,MACH,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AACD,SAAO;AACT","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\nexport { isOk } from \"@osdk/shared.net\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { augment } from \"./object/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\nexport class ActionValidationError extends Error {\n constructor(validation) {\n super(\"Validation Error\");\n this.validation = validation;\n }\n}","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_Action.ts\nvar _applyActionV2 = [1, \"/v2/ontologies/{0}/actions/{1}/apply\", 3];\nfunction applyActionV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionV2, ...args);\n}\nvar _applyActionBatchV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyBatch\", 3];\nfunction applyActionBatchV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionBatchV2, ...args);\n}\nvar _applyActionAsyncV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyAsync\", 3];\nfunction applyActionAsyncV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionAsyncV2, ...args);\n}\nexport { applyActionAsyncV2, applyActionBatchV2, applyActionV2 };","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\" && o.__primaryKey != null;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isAttachment } from \"../object/Attachment.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n */\nexport function toDataValue(value) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n return Array.from(value, toDataValue);\n }\n\n // attachments just send the rid directly\n if (isAttachment(value)) {\n return value.rid;\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return toDataValue(value.__primaryKey);\n }\n\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce((acc, [key, structValue]) => {\n acc[key] = toDataValue(structValue);\n return acc;\n }, {});\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyActionV2 } from \"@osdk/omniapi/OntologiesV2_Action\";\nimport { addUserAgent } from \"../util/addUserAgent.js\";\nimport { toDataValue } from \"../util/toDataValue.js\";\nimport { ActionValidationError } from \"./ActionValidationError.js\";\n\n// cannot specify both validateOnly and returnEdits as true\n\nexport async function applyAction(client, action, parameters, options = {}) {\n const response = await applyActionV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {\n parameters: remapActionParams(parameters),\n options: {\n mode: options?.validateOnly ? \"VALIDATE_ONLY\" : \"VALIDATE_AND_EXECUTE\",\n returnEdits: options?.returnEdits ? \"ALL\" : \"NONE\"\n }\n });\n if (options?.validateOnly) {\n return response.validation;\n }\n if (response.validation?.result === \"INVALID\") {\n throw new ActionValidationError(response.validation);\n }\n return options?.returnEdits ? response.edits : undefined;\n}\nfunction remapActionParams(params) {\n if (params == null) {\n return {};\n }\n const parameterMap = {};\n const remappedParams = Object.entries(params).reduce((acc, [key, value]) => {\n acc[key] = toDataValue(value);\n return acc;\n }, parameterMap);\n return remappedParams;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyAction } from \"./applyAction.js\";\nexport function createActionInvoker(client, action) {\n return function (...args) {\n return applyAction(client, action, ...args);\n };\n}\nexport function createOldActionInvoker(client, ontology) {\n const proxy = new Proxy({}, {\n get: (_target, p, _receiver) => {\n if (typeof p === \"string\") {\n return createActionInvoker(client, ontology.actions[p]);\n }\n return undefined;\n },\n ownKeys(_target) {\n return Object.keys(ontology.actions);\n },\n getOwnPropertyDescriptor(_target, p) {\n if (typeof p === \"string\") {\n return {\n enumerable: ontology.actions[p] != null,\n configurable: true,\n value: proxy[p]\n };\n }\n }\n });\n return proxy;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createClientContext } from \"@osdk/shared.net\";\nimport { createStandardOntologyProviderFactory } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\nexport function createMinimalClient(metadata, stack, tokenProvider, options = {}, fetchFn = global.fetch) {\n if (process?.env?.NODE_ENV !== \"production\") {\n try {\n new URL(stack);\n } catch (e) {\n const hint = !stack.startsWith(\"http://\") || !stack.startsWith(\"https://\") ? \". Did you forget to add 'http://' or 'https://'?\" : \"\";\n throw new Error(`Invalid stack URL: ${stack}${hint}`);\n }\n }\n const clientCtx = {\n ...createClientContext({\n metadata\n }, stack, tokenProvider, USER_AGENT, fetchFn),\n ontologyRid: metadata.ontologyRid,\n ontologyProvider: undefined,\n logger: options.logger\n };\n clientCtx.ontologyProvider = createStandardOntologyProviderFactory(options)(clientCtx);\n return clientCtx;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport { listInterfaceTypes } from \"@osdk/omniapi/OntologiesV2_OntologyObjectV2\";\nimport { getOntologyFullMetadata } from \"@osdk/omniapi/OntologiesV2_OntologyV2\";\nimport deepEqual from \"fast-deep-equal\";\nimport { createAsyncCache } from \"../object/Cache.js\";\nimport { loadFullObjectMetadata } from \"./loadFullObjectMetadata.js\";\nimport { loadInterfaceDefinition } from \"./loadInterfaceDefinition.js\";\nconst alwaysRevalidateDefault = false;\n\n// SLLLLLLOOOOOOOWWWW\nasync function fullOntologyLoad(client) {\n return await Promise.all([listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), getOntologyFullMetadata(client, client.ontologyRid)]);\n}\nexport const USE_FULL_ONTOLOGY = false;\nexport const createStandardOntologyProviderFactory = client => {\n const alwaysRevalidate = client.alwaysRevalidate ?? alwaysRevalidateDefault;\n return client => {\n let fullCache;\n async function initLocalCache(client, skipCache) {\n if (skipCache) {\n return await fullOntologyLoad(client);\n }\n if (!fullCache) {\n fullCache = fullOntologyLoad(client);\n }\n return await fullCache;\n }\n async function loadObject(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return {\n ...wireObjectTypeFullMetadataToSdkObjectTypeDefinition(fullCacheLocal[1].objectTypes[key], true),\n implements: fullCacheLocal[0].data.map(i => i.apiName)\n };\n } else {\n return await loadFullObjectMetadata(client, key);\n }\n }\n async function loadInterface(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(fullCacheLocal[1].interfaceTypes[key], true);\n } else {\n return loadInterfaceDefinition(client, key);\n }\n }\n function makeGetter(fn) {\n const cache = createAsyncCache((client, key) => fn(client, key, false));\n return async apiName => {\n const n = alwaysRevalidate ? await fn(client, apiName, true) : await cache.get(client, apiName);\n if (alwaysRevalidate) {\n const og = cache.getOrUndefined(client, apiName);\n if (deepEqual(og, n)) {\n return og; // ! because we can be sure `n` would throw if it were undefined\n } else {\n return cache.set(client, apiName, n);\n }\n }\n return n;\n };\n }\n return {\n getObjectDefinition: makeGetter(loadObject),\n getInterfaceDefinition: makeGetter(loadInterface),\n maybeSeed(definition) {\n // not using this for now\n }\n };\n };\n};","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_OntologyV2.ts\nvar _listOntologiesV2 = [0, \"/v2/ontologies\"];\nfunction listOntologiesV2($ctx, ...args) {\n return omniFetch($ctx, _listOntologiesV2, ...args);\n}\nvar _getOntologyV2 = [0, \"/v2/ontologies/{0}\"];\nfunction getOntologyV2($ctx, ...args) {\n return omniFetch($ctx, _getOntologyV2, ...args);\n}\nvar _getOntologyFullMetadata = [0, \"/v2/ontologies/{0}/fullMetadata\"];\nfunction getOntologyFullMetadata($ctx, ...args) {\n return omniFetch($ctx, _getOntologyFullMetadata, ...args);\n}\nexport { getOntologyFullMetadata, getOntologyV2, listOntologiesV2 };","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport { getObjectTypeV2, listOutgoingLinkTypesV2 } from \"@osdk/omniapi/OntologiesV2_ObjectTypeV2\";\nimport { listInterfaceTypes } from \"@osdk/omniapi/OntologiesV2_OntologyObjectV2\";\nimport invariant from \"tiny-invariant\";\nimport { loadAllOntologies } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadAllOntologies.js\";\nimport { loadOntologyEntities } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadOntologyEntities.js\";\nasync function loadAllOutgoingLinkTypes(client, objtype) {\n const linkTypes = [];\n let pageToken;\n do {\n const result = await listOutgoingLinkTypesV2(client, client.ontologyRid, objtype, {\n pageToken\n });\n pageToken = result.nextPageToken;\n linkTypes.push(...result.data);\n } while (pageToken != null);\n return linkTypes;\n}\nfunction makeConjureContext(client, servicePath) {\n return {\n baseUrl: client.stack,\n servicePath,\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider()\n };\n}\nexport async function loadFullObjectMetadata(client, objtype) {\n const conjureCtx = makeConjureContext(client, \"/ontology-metadata/api\");\n const [objectType, linkTypes, interfaceTypes, metadata] = await Promise.all([getObjectTypeV2(client, client.ontologyRid, objtype), loadAllOutgoingLinkTypes(client, objtype), listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), await loadAllOntologies(conjureCtx, {})]);\n const sharedPropertyTypeMapping = await loadSptMap(conjureCtx, metadata, client.ontologyRid, objectType.rid);\n const full = {\n implementsInterfaces: interfaceTypes.data.map(i => i.apiName),\n linkTypes,\n objectType,\n sharedPropertyTypeMapping\n };\n\n // TODO: reuse the loaded interface data!\n return wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);\n}\nasync function loadSptMap(ctx, ontologyMetadata, ontologyRid, objectRid) {\n const ontologyVersion = ontologyMetadata.ontologies[ontologyRid].currentOntologyVersion;\n const body = {\n objectTypeVersions: {\n [objectRid]: ontologyVersion\n },\n linkTypeVersions: {},\n loadRedacted: false,\n includeObjectTypesWithoutSearchableDatasources: true\n };\n const entities = await loadOntologyEntities(ctx, body);\n const objectType = entities.objectTypes[objectRid];\n !objectType ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"object type should be loaded\") : invariant(false) : void 0;\n const sptMap = {};\n for (const property of Object.values(objectType.propertyTypes)) {\n if (property.sharedPropertyTypeApiName && property.apiName) {\n sptMap[property.sharedPropertyTypeApiName] = property.apiName;\n }\n }\n return sptMap;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport { getInterfaceType } from \"@osdk/omniapi/OntologiesV2_OntologyObjectV2\";\nexport async function loadInterfaceDefinition(client, objtype) {\n const r = await getInterfaceType(client, client.ontologyRid, objtype, {\n preview: true\n });\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;","/*\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 { createActionInvoker } from \"./actions/createActionInvoker.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nexport function createClient(stack, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({\n ontologyRid,\n userAgent: \"\" // ontology specific user agent injected elsewhere\n }, stack, tokenProvider, options, fetchFn);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createObjectSet(o, clientCtx);\n } else if (o.type === \"action\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createActionInvoker(clientCtx, o);\n } else {\n throw new Error(\"not implemented\");\n }\n }\n const client = Object.defineProperties(clientFn, {\n __UNSTABLE_preexistingObjectSet: {\n get: () => (definition, rid) => {\n return createObjectSet(definition, clientCtx, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: definition.apiName\n }, {\n type: \"reference\",\n reference: rid\n }]\n });\n }\n },\n ctx: {\n value: clientCtx\n }\n });\n return client;\n}"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/actions/ActionValidationError.ts","../../../foundry/build/js/public/OntologiesV2_Action.mjs","../../src/util/isOntologyObjectV2.ts","../../src/util/toDataValue.ts","../../src/actions/applyAction.ts","../../src/actions/createActionInvoker.ts","../../src/createMinimalClient.ts","../../../foundry/build/js/public/OntologiesV2_OntologyV2.mjs","../../src/ontology/StandardOntologyProvider.ts","../../src/ontology/loadFullObjectMetadata.ts","../../src/ontology/loadInterfaceDefinition.ts","../../src/util/UserAgent.ts","../../src/createClient.ts"],"names":["omniFetch","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectTypeDefinition","client"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,SAAS,YAAY;;;ACAd,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAC/C,YAAY,YAAY;AACtB,UAAM,kBAAkB;AACxB,SAAK,aAAa;AAAA,EACpB;AACF;;;ACrBA,SAAS,iBAAiB;AAG1B,IAAI,iBAAiB,CAAC,GAAG,wCAAwC,CAAC;AAClE,SAAS,cAAc,SAAS,MAAM;AACpC,SAAO,UAAU,MAAM,gBAAgB,GAAG,IAAI;AAChD;;;ACUO,SAAS,mBAAmB,GAAG;AACpC,SAAO,KAAK,OAAO,MAAM,YAAY,OAAO,EAAE,cAAc,YAAY,EAAE,gBAAgB;AAC5F;;;ACQO,SAAS,YAAY,OAAO;AACjC,MAAI,SAAS,MAAM;AAEjB,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,QAAQ,KAAK,KAAK,iBAAiB,KAAK;AAChD,WAAO,MAAM,KAAK,OAAO,WAAW;AAAA,EACtC;AAGA,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,MAAM;AAAA,EACf;AAGA,MAAI,mBAAmB,KAAK,GAAG;AAC7B,WAAO,YAAY,MAAM,YAAY;AAAA,EACvC;AAGA,MAAI,gBAAgB,KAAK,GAAG;AAC1B,WAAO;AAAA,EACT;AACA,MAAI,YAAY,KAAK,GAAG;AACtB,WAAO,iBAAiB,KAAK;AAAA,EAC/B;AAOA,MAAI,OAAO,UAAU,UAAU;AAC7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AAC;AAAA,YACX,MAAM;AAAA,YACN,YAAY,WAAW;AAAA,UACzB,GAAG;AAAA,YACD,MAAM;AAAA,YACN,WAAW;AAAA,UACb,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,KAAK;AAAA,MACH,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AACD,SAAO;AACT","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\nexport { isOk } from \"@osdk/shared.net\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { augment } from \"./object/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\nexport class ActionValidationError extends Error {\n constructor(validation) {\n super(\"Validation Error\");\n this.validation = validation;\n }\n}","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_Action.ts\nvar _applyActionV2 = [1, \"/v2/ontologies/{0}/actions/{1}/apply\", 3];\nfunction applyActionV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionV2, ...args);\n}\nvar _applyActionBatchV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyBatch\", 3];\nfunction applyActionBatchV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionBatchV2, ...args);\n}\nvar _applyActionAsyncV2 = [1, \"/v2/ontologies/{0}/actions/{1}/applyAsync\", 3];\nfunction applyActionAsyncV2($ctx, ...args) {\n return omniFetch($ctx, _applyActionAsyncV2, ...args);\n}\nexport { applyActionAsyncV2, applyActionBatchV2, applyActionV2 };","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\" && o.__primaryKey != null;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isAttachment } from \"../object/Attachment.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n */\nexport function toDataValue(value) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n return Array.from(value, toDataValue);\n }\n\n // attachments just send the rid directly\n if (isAttachment(value)) {\n return value.rid;\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return toDataValue(value.__primaryKey);\n }\n\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce((acc, [key, structValue]) => {\n acc[key] = toDataValue(structValue);\n return acc;\n }, {});\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyActionV2 } from \"@osdk/foundry/OntologiesV2_Action\";\nimport { addUserAgent } from \"../util/addUserAgent.js\";\nimport { toDataValue } from \"../util/toDataValue.js\";\nimport { ActionValidationError } from \"./ActionValidationError.js\";\n\n// cannot specify both validateOnly and returnEdits as true\n\nexport async function applyAction(client, action, parameters, options = {}) {\n const response = await applyActionV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {\n parameters: remapActionParams(parameters),\n options: {\n mode: options?.validateOnly ? \"VALIDATE_ONLY\" : \"VALIDATE_AND_EXECUTE\",\n returnEdits: options?.returnEdits ? \"ALL\" : \"NONE\"\n }\n });\n if (options?.validateOnly) {\n return response.validation;\n }\n if (response.validation?.result === \"INVALID\") {\n throw new ActionValidationError(response.validation);\n }\n return options?.returnEdits ? response.edits : undefined;\n}\nfunction remapActionParams(params) {\n if (params == null) {\n return {};\n }\n const parameterMap = {};\n const remappedParams = Object.entries(params).reduce((acc, [key, value]) => {\n acc[key] = toDataValue(value);\n return acc;\n }, parameterMap);\n return remappedParams;\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { applyAction } from \"./applyAction.js\";\nexport function createActionInvoker(client, action) {\n return function (...args) {\n return applyAction(client, action, ...args);\n };\n}\nexport function createOldActionInvoker(client, ontology) {\n const proxy = new Proxy({}, {\n get: (_target, p, _receiver) => {\n if (typeof p === \"string\") {\n return createActionInvoker(client, ontology.actions[p]);\n }\n return undefined;\n },\n ownKeys(_target) {\n return Object.keys(ontology.actions);\n },\n getOwnPropertyDescriptor(_target, p) {\n if (typeof p === \"string\") {\n return {\n enumerable: ontology.actions[p] != null,\n configurable: true,\n value: proxy[p]\n };\n }\n }\n });\n return proxy;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createClientContext } from \"@osdk/shared.net\";\nimport { createStandardOntologyProviderFactory } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\nexport function createMinimalClient(metadata, stack, tokenProvider, options = {}, fetchFn = global.fetch) {\n if (process?.env?.NODE_ENV !== \"production\") {\n try {\n new URL(stack);\n } catch (e) {\n const hint = !stack.startsWith(\"http://\") || !stack.startsWith(\"https://\") ? \". Did you forget to add 'http://' or 'https://'?\" : \"\";\n throw new Error(`Invalid stack URL: ${stack}${hint}`);\n }\n }\n const clientCtx = {\n ...createClientContext({\n metadata\n }, stack, tokenProvider, USER_AGENT, fetchFn),\n ontologyRid: metadata.ontologyRid,\n ontologyProvider: undefined,\n logger: options.logger\n };\n clientCtx.ontologyProvider = createStandardOntologyProviderFactory(options)(clientCtx);\n return clientCtx;\n}","import { omniFetch } from '@osdk/shared.net';\n\n// src/public/OntologiesV2_OntologyV2.ts\nvar _listOntologiesV2 = [0, \"/v2/ontologies\"];\nfunction listOntologiesV2($ctx, ...args) {\n return omniFetch($ctx, _listOntologiesV2, ...args);\n}\nvar _getOntologyV2 = [0, \"/v2/ontologies/{0}\"];\nfunction getOntologyV2($ctx, ...args) {\n return omniFetch($ctx, _getOntologyV2, ...args);\n}\nvar _getOntologyFullMetadata = [0, \"/v2/ontologies/{0}/fullMetadata\"];\nfunction getOntologyFullMetadata($ctx, ...args) {\n return omniFetch($ctx, _getOntologyFullMetadata, ...args);\n}\nexport { getOntologyFullMetadata, getOntologyV2, listOntologiesV2 };","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { listInterfaceTypes } from \"@osdk/foundry/OntologiesV2_OntologyObjectV2\";\nimport { getOntologyFullMetadata } from \"@osdk/foundry/OntologiesV2_OntologyV2\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport deepEqual from \"fast-deep-equal\";\nimport { createAsyncCache } from \"../object/Cache.js\";\nimport { loadFullObjectMetadata } from \"./loadFullObjectMetadata.js\";\nimport { loadInterfaceDefinition } from \"./loadInterfaceDefinition.js\";\nconst alwaysRevalidateDefault = false;\n\n// SLLLLLLOOOOOOOWWWW\nasync function fullOntologyLoad(client) {\n return await Promise.all([listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), getOntologyFullMetadata(client, client.ontologyRid)]);\n}\nexport const USE_FULL_ONTOLOGY = false;\nexport const createStandardOntologyProviderFactory = client => {\n const alwaysRevalidate = client.alwaysRevalidate ?? alwaysRevalidateDefault;\n return client => {\n let fullCache;\n async function initLocalCache(client, skipCache) {\n if (skipCache) {\n return await fullOntologyLoad(client);\n }\n if (!fullCache) {\n fullCache = fullOntologyLoad(client);\n }\n return await fullCache;\n }\n async function loadObject(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return {\n ...wireObjectTypeFullMetadataToSdkObjectTypeDefinition(fullCacheLocal[1].objectTypes[key], true),\n implements: fullCacheLocal[0].data.map(i => i.apiName)\n };\n } else {\n return await loadFullObjectMetadata(client, key);\n }\n }\n async function loadInterface(client, key, skipCache = false) {\n if (USE_FULL_ONTOLOGY) {\n const fullCacheLocal = await initLocalCache(client, skipCache);\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(fullCacheLocal[1].interfaceTypes[key], true);\n } else {\n return loadInterfaceDefinition(client, key);\n }\n }\n function makeGetter(fn) {\n const cache = createAsyncCache((client, key) => fn(client, key, false));\n return async apiName => {\n const n = alwaysRevalidate ? await fn(client, apiName, true) : await cache.get(client, apiName);\n if (alwaysRevalidate) {\n const og = cache.getOrUndefined(client, apiName);\n if (deepEqual(og, n)) {\n return og; // ! because we can be sure `n` would throw if it were undefined\n } else {\n return cache.set(client, apiName, n);\n }\n }\n return n;\n };\n }\n return {\n getObjectDefinition: makeGetter(loadObject),\n getInterfaceDefinition: makeGetter(loadInterface),\n maybeSeed(definition) {\n // not using this for now\n }\n };\n };\n};","/*\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 { getObjectTypeV2, listOutgoingLinkTypesV2 } from \"@osdk/foundry/OntologiesV2_ObjectTypeV2\";\nimport { listInterfaceTypes } from \"@osdk/foundry/OntologiesV2_OntologyObjectV2\";\nimport { wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from \"@osdk/generator-converters\";\nimport invariant from \"tiny-invariant\";\nimport { loadAllOntologies } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadAllOntologies.js\";\nimport { loadOntologyEntities } from \"../generated/ontology-metadata/api/OntologyMetadataService/loadOntologyEntities.js\";\nasync function loadAllOutgoingLinkTypes(client, objtype) {\n const linkTypes = [];\n let pageToken;\n do {\n const result = await listOutgoingLinkTypesV2(client, client.ontologyRid, objtype, {\n pageToken\n });\n pageToken = result.nextPageToken;\n linkTypes.push(...result.data);\n } while (pageToken != null);\n return linkTypes;\n}\nfunction makeConjureContext(client, servicePath) {\n return {\n baseUrl: client.stack,\n servicePath,\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider()\n };\n}\nexport async function loadFullObjectMetadata(client, objtype) {\n const conjureCtx = makeConjureContext(client, \"/ontology-metadata/api\");\n const [objectType, linkTypes, interfaceTypes, metadata] = await Promise.all([getObjectTypeV2(client, client.ontologyRid, objtype), loadAllOutgoingLinkTypes(client, objtype), listInterfaceTypes(client, client.ontologyRid, {\n pageSize: 200,\n preview: true\n }), await loadAllOntologies(conjureCtx, {})]);\n const sharedPropertyTypeMapping = await loadSptMap(conjureCtx, metadata, client.ontologyRid, objectType.rid);\n const full = {\n implementsInterfaces: interfaceTypes.data.map(i => i.apiName),\n linkTypes,\n objectType,\n sharedPropertyTypeMapping\n };\n\n // TODO: reuse the loaded interface data!\n return wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);\n}\nasync function loadSptMap(ctx, ontologyMetadata, ontologyRid, objectRid) {\n const ontologyVersion = ontologyMetadata.ontologies[ontologyRid].currentOntologyVersion;\n const body = {\n objectTypeVersions: {\n [objectRid]: ontologyVersion\n },\n linkTypeVersions: {},\n loadRedacted: false,\n includeObjectTypesWithoutSearchableDatasources: true\n };\n const entities = await loadOntologyEntities(ctx, body);\n const objectType = entities.objectTypes[objectRid];\n !objectType ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"object type should be loaded\") : invariant(false) : void 0;\n const sptMap = {};\n for (const property of Object.values(objectType.propertyTypes)) {\n if (property.sharedPropertyTypeApiName && property.apiName) {\n sptMap[property.sharedPropertyTypeApiName] = property.apiName;\n }\n }\n return sptMap;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInterfaceType } from \"@osdk/foundry/OntologiesV2_OntologyObjectV2\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nexport async function loadInterfaceDefinition(client, objtype) {\n const r = await getInterfaceType(client, client.ontologyRid, objtype, {\n preview: true\n });\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;","/*\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 { createActionInvoker } from \"./actions/createActionInvoker.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nexport function createClient(stack, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({\n ontologyRid,\n userAgent: \"\" // ontology specific user agent injected elsewhere\n }, stack, tokenProvider, options, fetchFn);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createObjectSet(o, clientCtx);\n } else if (o.type === \"action\") {\n clientCtx.ontologyProvider.maybeSeed(o);\n return createActionInvoker(clientCtx, o);\n } else {\n throw new Error(\"not implemented\");\n }\n }\n const client = Object.defineProperties(clientFn, {\n __UNSTABLE_preexistingObjectSet: {\n get: () => (definition, rid) => {\n return createObjectSet(definition, clientCtx, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: definition.apiName\n }, {\n type: \"reference\",\n reference: rid\n }]\n });\n }\n },\n ctx: {\n value: clientCtx\n }\n });\n return client;\n}"]}
@@ -9,7 +9,7 @@ export interface Client {
9
9
  __UNSTABLE_preexistingObjectSet<T extends ObjectOrInterfaceDefinition>(type: T, rid: string): ObjectSet<T>;
10
10
  ctx: unknown;
11
11
  }
12
- declare const MaxOsdkVersion = "0.16.0";
12
+ declare const MaxOsdkVersion = "0.17.0";
13
13
  export type MaxOsdkVersion = typeof MaxOsdkVersion;
14
14
  declare const ErrorMessage: unique symbol;
15
15
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { ActionDefinition, ActionParameterDefinition, ObjectActionDataType, ObjectSetActionDataType, OntologyDefinition } from "@osdk/api";
2
- import type { ActionResults, ValidateActionResponseV2 } from "@osdk/omniapi";
2
+ import type { ActionResults, ValidateActionResponseV2 } from "@osdk/foundry";
3
3
  import type { ObjectSet } from "../index.js";
4
4
  import type { DataValueClientToWire } from "../mapping/DataValueMapping.js";
5
5
  import type { Osdk, OsdkObjectPrimaryKeyType } from "../OsdkObjectFrom.js";
@@ -1,5 +1,5 @@
1
1
  import { OntologyMetadata as OM } from '@osdk/api';
2
- export type $ExpectedClientVersion = '0.16.0';
2
+ export type $ExpectedClientVersion = '0.17.0';
3
3
  export declare const $osdkMetadata: {
4
4
  extraUserAgent: string;
5
5
  };
@@ -1,4 +1,4 @@
1
- import type { AggregateObjectsResponseV2 } from "@osdk/omniapi";
1
+ import type { AggregateObjectsResponseV2 } from "@osdk/foundry";
2
2
  import type { AggregationClause, AggregationResultsWithoutGroups } from "../../query/index.js";
3
3
  import type { ArrayElement } from "../../util/ArrayElement.js";
4
4
  export declare function legacyToModernSingleAggregationResult<AC extends AggregationClause<any>>(entry: ArrayElement<AggregateObjectsResponseV2["data"]>): AggregationResultsWithoutGroups<any, AC>;
@@ -1,4 +1,4 @@
1
- import type { AggregationV2 } from "@osdk/omniapi";
1
+ import type { AggregationV2 } from "@osdk/foundry";
2
2
  import type { AggregationClause } from "../../query/index.js";
3
3
  export declare function modernToLegacyAggregationClause<AC extends AggregationClause<any>>(select: AC): AggregationV2[];
4
4
  //# sourceMappingURL=modernToLegacyAggregationClause.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { AggregationGroupByV2 } from "@osdk/omniapi";
1
+ import type { AggregationGroupByV2 } from "@osdk/foundry";
2
2
  import type { GroupByClause } from "../../query/index.js";
3
3
  export declare function modernToLegacyGroupByClause(groupByClause: GroupByClause<any> | undefined): AggregationGroupByV2[];
4
4
  //# sourceMappingURL=modernToLegacyGroupByClause.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
- import type { SearchJsonQueryV2 } from "@osdk/omniapi";
2
+ import type { SearchJsonQueryV2 } from "@osdk/foundry";
3
3
  import type { WhereClause } from "../../query/index.js";
4
4
  export declare function modernToLegacyWhereClause<T extends ObjectOrInterfaceDefinition<any, any>>(whereClause: WhereClause<T>): SearchJsonQueryV2;
5
5
  //# sourceMappingURL=modernToLegacyWhereClause.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
- import type { ObjectSet } from "@osdk/omniapi";
2
+ import type { ObjectSet } from "@osdk/foundry";
3
3
  import type { MinimalClient } from "../MinimalClientContext.js";
4
4
  import type { AggregateOpts } from "../query/aggregations/AggregateOpts.js";
5
5
  import type { AggregationsResults, GroupByClause } from "../query/index.js";
@@ -1,5 +1,5 @@
1
1
  import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
- import type { OntologyObjectV2 } from "@osdk/omniapi";
2
+ import type { OntologyObjectV2 } from "@osdk/foundry";
3
3
  import type { MinimalClient } from "../MinimalClientContext.js";
4
4
  import type { Osdk } from "../OsdkObjectFrom.js";
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import type { BrandedApiName, InterfaceDefinition, ObjectOrInterfaceDefinition, ObjectOrInterfacePropertyKeysFrom2, ObjectTypeDefinition } from "@osdk/api";
2
- import type { ObjectSet, SearchJsonQueryV2 } from "@osdk/omniapi";
2
+ import type { ObjectSet, SearchJsonQueryV2 } from "@osdk/foundry";
3
3
  import type { DefaultToFalse } from "../definitions/LinkDefinitions.js";
4
4
  import type { MinimalClient } from "../MinimalClientContext.js";
5
5
  import type { Osdk } from "../OsdkObjectFrom.js";
@@ -1,5 +1,5 @@
1
1
  import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
- import type { ObjectSet } from "@osdk/omniapi/types";
2
+ import type { ObjectSet } from "@osdk/foundry/types";
3
3
  import type { Osdk } from "../index.js";
4
4
  import type { MinimalClient } from "../MinimalClientContext.js";
5
5
  import { type FetchPageArgs, type SelectArgToKeys } from "./fetchPage.js";
@@ -1,5 +1,5 @@
1
1
  import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
- import type { ObjectSet } from "@osdk/omniapi/types";
2
+ import type { ObjectSet } from "@osdk/foundry/types";
3
3
  import type { MinimalClient } from "../MinimalClientContext.js";
4
4
  import type { ObjectSetListener } from "./ObjectSetListener.js";
5
5
  export declare class ObjectSetListenerWebsocket {
@@ -1,5 +1,5 @@
1
1
  import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
- import type { ObjectSet as WireObjectSet } from "@osdk/omniapi";
2
+ import type { ObjectSet as WireObjectSet } from "@osdk/foundry";
3
3
  import type { MinimalClient } from "../MinimalClientContext.js";
4
4
  import type { MinimalObjectSet, ObjectSet } from "./ObjectSet.js";
5
5
  export declare function isObjectSet(o: any): o is ObjectSet<any>;
@@ -1,5 +1,5 @@
1
1
  import type { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
2
- import type { ObjectSet } from "@osdk/omniapi/types";
2
+ import type { ObjectSet } from "@osdk/foundry/types";
3
3
  import type { ObjectSet as OssObjectSet } from "../generated/object-set-service/api/index.js";
4
4
  import type { ObjectPropertyMapping } from "./ObjectSetListenerWebsocket.js";
5
5
  export declare function toConjureObjectSet<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>>(objectSet: ObjectSet, objectPropertyMapping: ObjectPropertyMapping): OssObjectSet;
@@ -1,3 +1,3 @@
1
- import type { ObjectSet as WireObjectSet } from "@osdk/omniapi/types";
1
+ import type { ObjectSet as WireObjectSet } from "@osdk/foundry/types";
2
2
  export declare function isWireObjectSet(o: any): o is WireObjectSet;
3
3
  //# sourceMappingURL=WireObjectSet.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { OntologyObjectV2 } from "@osdk/omniapi/types";
1
+ import type { OntologyObjectV2 } from "@osdk/foundry/types";
2
2
  export declare function isOntologyObjectV2(o: any): o is OntologyObjectV2;
3
3
  //# sourceMappingURL=isOntologyObjectV2.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { DataValue } from "@osdk/omniapi/types";
1
+ import type { DataValue } from "@osdk/foundry/types";
2
2
  /**
3
3
  * Marshall user-facing data into the wire DataValue type
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/client",
3
- "version": "0.16.0",
3
+ "version": "0.17.0-main-20240426184921",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -11,13 +11,11 @@
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./build/types/index.d.ts",
14
- "import": "./build/js/index.mjs",
15
- "require": "./build/js/index.cjs"
14
+ "import": "./build/js/index.mjs"
16
15
  },
17
16
  "./*": {
18
17
  "types": "./build/types/public/*.d.ts",
19
- "import": "./build/js/public/*.mjs",
20
- "require": "./build/js/public/*.cjs"
18
+ "import": "./build/js/public/*.mjs"
21
19
  }
22
20
  },
23
21
  "dependencies": {
@@ -26,7 +24,7 @@
26
24
  "fetch-retry": "^5.0.6",
27
25
  "isomorphic-ws": "^5.0.0",
28
26
  "tiny-invariant": "^1.3.1",
29
- "ws": "^8.14.2",
27
+ "ws": "^8.16.0",
30
28
  "@osdk/api": "^1.7.0",
31
29
  "@osdk/generator-converters": "^0.5.0",
32
30
  "@osdk/shared.net": "^1.10.0"
@@ -35,15 +33,15 @@
35
33
  "@types/geojson": "^7946.0.14",
36
34
  "@types/ws": "^8.5.10",
37
35
  "jest-extended": "^4.0.2",
38
- "p-defer": "^4.0.0",
39
- "p-state": "^2.0.0",
36
+ "p-defer": "^4.0.1",
37
+ "p-state": "^2.0.1",
40
38
  "pino": "^8.20.0",
41
39
  "ts-expect": "^1.3.0",
42
- "type-fest": "^4.14.0",
43
- "typescript": "^5.4.2",
44
- "@osdk/generator": "^1.10.0",
40
+ "type-fest": "^4.17.0",
41
+ "typescript": "^5.4.5",
45
42
  "@osdk/shared.test": "^1.3.0",
46
- "@osdk/omniapi": "^0.1.0"
43
+ "@osdk/generator": "^1.10.0",
44
+ "@osdk/foundry": "^0.2.0-main-20240426184921"
47
45
  },
48
46
  "publishConfig": {
49
47
  "access": "public"
@@ -57,7 +55,6 @@
57
55
  "templates",
58
56
  "*.d.ts"
59
57
  ],
60
- "main": "./build/js/index.cjs",
61
58
  "module": "./build/js/index.mjs",
62
59
  "types": "./build/types/index.d.ts",
63
60
  "peerDependencies": {