@osdk/client 2.8.0-beta.18 → 2.8.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/actions/ActionValidationError.ts","../../src/object/AttachmentUpload.ts","../../src/util/objectSpecifierUtils.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js","../../../../node_modules/.pnpm/@osdk+foundry.mediasets@2.50.0/node_modules/@osdk/foundry.mediasets/build/esm/public/MediaSet.js","../../src/object/mediaUpload.ts","../../src/util/interfaceUtils.ts","../../src/util/isObjectSpecifiersObject.ts","../../src/util/isOntologyObjectV2.ts","../../src/util/isPoint.ts","../../src/util/toDataValue.ts","../../src/actions/applyAction.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js","../../src/util/streamutils.ts","../../src/util/timeseriesUtils.ts","../../src/createGeotimeSeriesProperty.ts","../../src/createMediaReferenceProperty.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js","../../src/createTimeseriesProperty.ts","../../src/object/formatting/formatBoolean.ts","../../src/object/formatting/propertyFormattingUtils.ts","../../src/object/formatting/formatDateTime.ts","../../src/object/formatting/formatNumber.ts","../../src/object/formatting/applyPropertyFormatter.ts","../../src/ontology/OntologyProvider.ts","../../src/object/convertWireToOsdkObjects/InternalSymbols.ts","../../src/object/convertWireToOsdkObjects/getDollarLink.ts","../../src/object/convertWireToOsdkObjects/createOsdkInterface.ts","../../src/object/convertWireToOsdkObjects/getDollarAs.ts","../../src/object/convertWireToOsdkObjects/createOsdkObject.ts","../../src/object/convertWireToOsdkObjects.ts","../../src/object/Cache.ts","../../src/util/deepFreeze.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js","../../src/ontology/loadActionMetadata.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js","../../src/ontology/loadFullObjectMetadata.ts","../../src/ontology/loadInterfaceMetadata.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js","../../src/ontology/loadQueryMetadata.ts","../../src/ontology/StandardOntologyProvider.ts","../../src/util/UserAgent.ts","../../src/createMinimalClient.ts","../../src/fetchMetadata.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js","../../src/createMediaFromReference.ts","../../src/util/toDataValueQueries.ts","../../src/queries/applyQuery.ts","../../src/createClient.ts"],"names":["foundryPlatformFetch","__export","upload","value","isWireObjectSet","isObjectSet","getWireObjectSet","addUserAgentAndRequestContextHeaders","augmentRequestContext","TimeseriesDurationMapping","getMediaContent","getMediaMetadata","fetchSingle","fetchSingleWithErrors","extractNamespace","createSimpleCache","invariant","hydrateAttachmentFromRidInternal","get","_get","client","metadata","createObjectSet","createSharedClientContext","info","ontologyRid","MinimalLogger","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","fetchPage","fetchStaticRidPage","symbolClientContext","additionalContext"],"mappings":";;;;;;;;;;;;;;;;;AAgBa,IAAA,qBAAA,GAAN,cAAoC,KAAM,CAAA;AAAA,EAC/C,YAAY,UAAY,EAAA;AACtB,IAAA,KAAA,CAAM,uBAAuB,IAAK,CAAA,SAAA,CAAU,UAAY,EAAA,IAAA,EAAM,CAAC,CAAC,CAAA;AA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A,MAAA,EAAW,SAAS,CAAA;AACrE,EAAA,MAAMC,oBAAsB,GAAA,qBAAA;AAC5B,EAAM,MAAA,MAAA,GAAS,MAAO,CAAA,gBAAA,CAAiB,QAAU,EAAA;AAAA,IAC/C,CAACA,qCAAsB,GAAG;AAAA,MACxB,KAAO,EAAA;AAAA,KACT;AAAA,IACA,CAACA,oBAAmB,GAAG;AAAA,MACrB,KAAO,EAAA;AAAA,KACT;AAAA,IACA,CAACC,mCAAiB,GAAG;AAAA,MACnB,KAAO,EAAA;AAAA,KACT;AAAA,IACA,aAAe,EAAA;AAAA,MACb,KAAO,EAAA;AAAA;AACT,GACD,CAAA;AACD,EAAO,OAAA,MAAA;AACT;AACO,IAAM,eAAe,oBAAqB,CAAA,IAAA,CAAK,MAAW,EAAAZ,iCAAA,EAAiB,QAAW,MAAS;AACzF,IAAA,2BAAA,GAA8B,CAAC,cAAA,EAAgB,UAAe,EAAA,GAAA,IAAA,KAAS,qBAAqBA,iCAAiB,EAAA,cAAA,EAAgB,UAAY,EAAA,GAAG,IAAI;AAC7J,SAAS,cAAc,IAAM,EAAA;AAC3B,EAAA,MAAM,OAAU,GAAA;AAAA,IACd,IAAM,EAAA,QAAA;AAAA,IACN,SAAW,EAAA;AAAA,GACb;AACA,EAAO,OAAA,OAAA;AACT","file":"chunk-WZK2WYYS.cjs","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 class ActionValidationError extends Error {\n constructor(validation) {\n super(\"Validation Error: \" + JSON.stringify(validation, null, 2));\n this.validation = validation;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isAttachmentUpload(o) {\n return typeof o === \"object\" && o != null && \"name\" in o && typeof o.name === \"string\" && \"data\" in o && o.data instanceof Blob && !(\"fileName\" in o);\n}\nexport function isAttachmentFile(o) {\n return typeof o === \"object\" && o instanceof Blob && \"name\" in o;\n}\nexport function createAttachmentUpload(data, name) {\n return {\n data,\n name\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {\n return `${objectDef.apiName}:${primaryKey}`;\n}\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier) {\n return `${interfaceSpecifier.objectTypeApiName}:${interfaceSpecifier.primaryKeyValue}`;\n}\n\n/**\n * Extracts the primary key from an ObjectSpecifier on an OSDK object.\n *\n * @param ObjectSpecifier\n * @returns A string representing the primary key\n */\nexport function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[1];\n}\n\n/**\n * Extracts the object type from an ObjectSpecifier on an OSDK object.\n *\n * @param ObjectSpecifier\n * @returns The object type extracted from the ObjectSpecifier\n */\nexport function extractObjectTypeFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[0];\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _apply = [1, \"/v2/ontologies/{0}/actions/{1}/apply\", 3];\n/**\n * Applies an action using the given parameters.\n *\n * Changes to objects or links stored in Object Storage V1 are eventually consistent and may take some time to be visible.\n * Edits to objects or links in Object Storage V2 will be visible immediately after the action completes.\n *\n * Note that a 200 HTTP status code only indicates that the request was received and processed by the server.\n * See the validation result in the response body to determine if the action was applied successfully.\n *\n * Note that [parameter default values](https://www.palantir.com/docs/foundry/action-types/parameters-default-value/) are not currently supported by\n * this endpoint.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/apply\n */\nexport function apply($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _apply, ...args);\n}\nconst _applyAsync = [1, \"/v2/ontologies/{0}/actions/{1}/applyAsync\", 3];\n/**\n * Applies an action using the given parameters.\n *\n * Changes to objects or links stored in Object Storage V1 are eventually consistent and may take some time to be visible.\n * Edits to objects or links in Object Storage V2 will be visible immediately after the action completes.\n *\n * Note that [parameter default values](https://www.palantir.com/docs/foundry/action-types/parameters-default-value/) are not currently supported by\n * this endpoint.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/applyAsync\n */\nexport function applyAsync($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _applyAsync, ...args);\n}\nconst _applyBatch = [1, \"/v2/ontologies/{0}/actions/{1}/applyBatch\", 3];\n/**\n * Applies multiple actions (of the same Action Type) using the given parameters.\n *\n * Changes to objects or links stored in Object Storage V1 are eventually consistent and may take some time to be visible.\n * Edits to objects or links in Object Storage V2 will be visible immediately after the action completes.\n *\n * Up to 20 actions may be applied in one call. Actions that only modify objects in Object Storage v2 and do not\n * call Functions may receive a higher limit.\n *\n * Note that [notifications](https://www.palantir.com/docs/foundry/action-types/notifications/) are not currently supported by this endpoint.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/applyBatch\n */\nexport function applyBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _applyBatch, ...args);\n}\nconst _applyWithOverrides = [1, \"/v2/ontologies/{0}/actions/{1}/applyWithOverrides\", 3];\n/**\n * Same as regular apply action operation, but allows specifying overrides for UniqueIdentifier and\n * CurrentTime generated action parameters.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/applyWithOverrides\n */\nexport function applyWithOverrides($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _applyWithOverrides, ...args);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _abort = [1, \"/v2/mediasets/{0}/transactions/{1}/abort\", 2];\n/**\n * Aborts an open transaction. Items uploaded to the media set during this transaction will be deleted.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/abort\n */\nexport function abort($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _abort, ...args);\n}\nconst _calculate = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/calculate\", 6];\n/**\n * Starts calculation of a thumbnail for a given image.\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/calculate\n */\nexport function calculate($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _calculate, ...args);\n}\nconst _commit = [1, \"/v2/mediasets/{0}/transactions/{1}/commit\", 2];\n/**\n * Commits an open transaction. On success, items uploaded to the media set during this transaction will become available.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/commit\n */\nexport function commit($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _commit, ...args);\n}\nconst _create = [1, \"/v2/mediasets/{0}/transactions\", 2];\n/**\n * Creates a new transaction. Items uploaded to the media set while this transaction is open will not be reflected until the transaction is committed.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions\n */\nexport function create($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _create, ...args);\n}\nconst _info = [0, \"/v2/mediasets/{0}/items/{1}\", 6];\n/**\n * Gets information about the media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}\n */\nexport function info($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _info, ...args);\n}\nconst _metadata = [0, \"/v2/mediasets/{0}/items/{1}/metadata\", 6];\n/**\n * Gets detailed metadata about the media item, including type-specific information\n * such as dimensions for images, duration for audio/video, page count for documents, etc.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/metadata\n */\nexport function metadata($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _metadata, ...args);\n}\nconst _reference = [0, \"/v2/mediasets/{0}/items/{1}/reference\", 6];\n/**\n * Gets the [media reference](https://www.palantir.com/docs/foundry/data-integration/media-sets/#media-references) for this media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/reference\n */\nexport function reference($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _reference, ...args);\n}\nconst _getRidByPath = [0, \"/v2/mediasets/{0}/items/getRidByPath\", 2];\n/**\n * Returns the media item RID for the media item with the specified path.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/getRidByPath\n */\nexport function getRidByPath($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getRidByPath, ...args);\n}\nconst _getResult = [0, \"/v2/mediasets/{0}/items/{1}/transformationJobs/{2}/result\", 6,, \"*/*\"];\n/**\n * Gets the result of a completed transformation job. Returns the transformed media content as binary data.\n * This endpoint will return an error if the transformation job has not completed successfully.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transformationJobs/{transformationJobId}/result\n */\nexport function getResult($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getResult, ...args);\n}\nconst _getStatus = [0, \"/v2/mediasets/{0}/items/{1}/transformationJobs/{2}\", 6];\n/**\n * Gets the status of a transformation job.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transformationJobs/{transformationJobId}\n */\nexport function getStatus($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getStatus, ...args);\n}\nconst _upload = [1, \"/v2/mediasets/{0}/items\", 3, \"*/*\"];\n/**\n * Uploads a media item to an existing media set.\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * A branch name, or branch rid, or view rid may optionally be specified. If none is specified, the item will be uploaded to the default branch. If more than one is specified, an error is thrown.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/items\n */\nexport function upload($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _upload, ...args);\n}\nconst _read = [0, \"/v2/mediasets/{0}/items/{1}/content\", 6,, \"*/*\"];\n/**\n * Gets the content of a media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/content\n */\nexport function read($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _read, ...args);\n}\nconst _readOriginal = [0, \"/v2/mediasets/{0}/items/{1}/original\", 6,, \"*/*\"];\n/**\n * Gets the content of an original file uploaded to the media item, even if it was transformed on upload due to being an additional input format.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/original\n */\nexport function readOriginal($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _readOriginal, ...args);\n}\nconst _retrieve = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/retrieve\", 6,, \"*/*\"];\n/**\n * Retrieves a successfully calculated thumbnail for a given image.\n *\n * Thumbnails are 200px wide in the format of `image/webp`\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/retrieve\n */\nexport function retrieve($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _retrieve, ...args);\n}\nconst _transform = [1, \"/v2/mediasets/{0}/items/{1}/transform\", 7];\n/**\n * Initiates a transformation on a media item. Returns a job ID that can be used to check the status and retrieve\n * the result of the transformation.\n *\n * Transforming a media item requires that you are able to read the media item, either via `api:mediasets-read` or\n * via a `MediaItemReadToken`\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform\n */\nexport function transform($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _transform, ...args);\n}\nconst _uploadMedia = [2, \"/v2/mediasets/media/upload\", 7, \"*/*\"];\n/**\n * Uploads a temporary media item. If the media item isn't persisted within 1 hour, the item will be deleted.\n *\n * If multiple resources are attributed to, usage will be attributed to the first one in the list.\n *\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * Third-party applications using this endpoint via OAuth2 must request the following operation scopes: `api:ontologies-read api:ontologies-write`.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/mediasets/media/upload\n */\nexport function uploadMedia($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _uploadMedia, ...args);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isMedia(o) {\n return typeof o === \"object\" && o != null && typeof o.fetchMetadata === \"function\" && typeof o.fetchContents === \"function\" && typeof o.getMediaReference === \"function\";\n}\nexport function isMediaReference(o) {\n return typeof o === `object` && typeof o.mimeType === \"string\" && \"reference\" in o && typeof o.reference === \"object\" && o.reference.type === \"mediaSetViewItem\" && \"mediaSetViewItem\" in o.reference && typeof o.reference.mediaSetViewItem === \"object\" && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\nexport function isMediaUpload(o) {\n return typeof o === \"object\" && o != null && \"fileName\" in o && typeof o.fileName === \"string\" && \"data\" in o && typeof o.data === \"object\" && o.data instanceof Blob;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Type representing whether a definition is an object or interface */\n\n/** @internal */\nexport function getDefType(apiNameOrDef) {\n return typeof apiNameOrDef === \"string\" ? \"object\" : apiNameOrDef.type;\n}\n\n/** @internal */\nexport function isInterfaceActionParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceQueryParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceSpecifier(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o && o.$objectType !== o.$apiName;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isObjectSpecifiersObject(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\n/** @internal */\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\" && o.__primaryKey != null;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isPoint(o) {\n return o && typeof o === \"object\" && \"type\" in o && o.type === \"Point\" && \"coordinates\" in o && o.coordinates.length === 2;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport * as Attachments from \"@osdk/foundry.ontologies/Attachment\";\nimport { isAttachmentFile, isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMedia, isMediaReference, isMediaUpload } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceActionParam } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isPoint } from \"./isPoint.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 * @internal\n */\nexport async function toDataValue(value, client, actionMetadata) {\n if (value == null) {\n // typeof null is 'object' so do this first\n // Sending null over the wire clears the data, whereas undefined is dropped at request time.\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 const values = Array.from(value);\n if (values.some(dataValue => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValue(value, client, actionMetadata));\n }\n return converted;\n }\n const promiseArray = Array.from(value, async innerValue => await toDataValue(innerValue, client, actionMetadata));\n return Promise.all(promiseArray);\n }\n\n // For uploads, we need to upload ourselves first to get the RID of the attachment\n if (isAttachmentUpload(value)) {\n const attachment = await Attachments.upload(client, value.data, {\n filename: value.name\n });\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n if (isAttachmentFile(value)) {\n const attachment = await Attachments.upload(client, value, {\n filename: value.name\n });\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n if (isMediaUpload(value)) {\n const mediaRef = await MediaSets.uploadMedia(client, value.data, {\n filename: value.fileName,\n preview: true\n });\n return await toDataValue(mediaRef, client, actionMetadata);\n }\n if (isMedia(value)) {\n return value.getMediaReference();\n }\n if (isMediaReference(value)) {\n return value;\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return await toDataValue(value.__primaryKey, client, actionMetadata);\n }\n if (isObjectSpecifiersObject(value)) {\n return await toDataValue(value.$primaryKey, client, actionMetadata);\n }\n if (isPoint(value)) {\n return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);\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 if (isInterfaceActionParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey\n };\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(async (promisedAcc, [key, structValue]) => {\n const acc = await promisedAcc;\n acc[key] = await toDataValue(structValue, client, actionMetadata);\n return acc;\n }, Promise.resolve({}));\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp, object type reference\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 * as Actions from \"@osdk/foundry.ontologies/Action\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { toDataValue } from \"../util/toDataValue.js\";\nimport { ActionValidationError } from \"./ActionValidationError.js\";\nexport async function applyAction(client, action, parameters, options = {}) {\n const clientWithHeaders = addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyAction\"\n })), action);\n if (Array.isArray(parameters)) {\n const response = await Actions.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {\n requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],\n options: {\n returnEdits: options?.$returnEdits ? \"ALL\" : \"NONE\"\n }\n }, {\n branch: client.branch\n });\n const edits = response.edits;\n return options?.$returnEdits ? edits?.type === \"edits\" ? remapActionResponse(response) : edits : undefined;\n } else {\n const response = await Actions.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {\n parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),\n options: {\n mode: options?.$validateOnly ? \"VALIDATE_ONLY\" : \"VALIDATE_AND_EXECUTE\",\n returnEdits: options?.$returnEdits ? \"ALL_V2_WITH_DELETIONS\" : \"NONE\"\n }\n }, {\n branch: client.branch,\n transactionId: client.transactionId\n });\n if (options?.$validateOnly) {\n return response.validation;\n }\n if (response.validation && response.validation?.result === \"INVALID\") {\n const validation = response.validation;\n throw new ActionValidationError(validation);\n }\n const edits = response.edits;\n return options?.$returnEdits ? edits?.type === \"edits\" ? remapActionResponse(response) : edits : undefined;\n }\n}\nasync function remapActionParams(params, client, actionMetadata) {\n if (params == null) {\n return {};\n }\n const parameterMap = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValue(value, client, actionMetadata);\n }\n return parameterMap;\n}\nasync function remapBatchActionParams(params, client, actionMetadata) {\n const remappedParams = await Promise.all(params.map(async param => {\n return {\n parameters: await remapActionParams(param, client, actionMetadata)\n };\n }));\n return remappedParams;\n}\nexport function remapActionResponse(response) {\n const editResponses = response?.edits;\n if (editResponses?.type === \"edits\") {\n const remappedActionResponse = {\n type: editResponses.type,\n deletedLinksCount: editResponses.deletedLinksCount,\n deletedObjectsCount: editResponses.deletedObjectsCount,\n addedLinks: [],\n deletedLinks: [],\n addedObjects: [],\n deletedObjects: [],\n modifiedObjects: [],\n editedObjectTypes: []\n };\n const editedObjectTypesSet = new Set();\n for (const edit of editResponses.edits) {\n if (edit.type === \"addLink\" || edit.type === \"deleteLink\") {\n const osdkEdit = {\n linkTypeApiNameAtoB: edit.linkTypeApiNameAtoB,\n linkTypeApiNameBtoA: edit.linkTypeApiNameBtoA,\n aSideObject: edit.aSideObject,\n bSideObject: edit.bSideObject\n };\n edit.type === \"addLink\" ? remappedActionResponse.addedLinks.push(osdkEdit) : remappedActionResponse.deletedLinks?.push(osdkEdit);\n editedObjectTypesSet.add(edit.aSideObject.objectType);\n editedObjectTypesSet.add(edit.bSideObject.objectType);\n } else if (edit.type === \"addObject\" || edit.type === \"deleteObject\" || edit.type === \"modifyObject\") {\n const osdkEdit = {\n objectType: edit.objectType,\n primaryKey: edit.primaryKey\n };\n if (edit.type === \"addObject\") {\n remappedActionResponse.addedObjects.push(osdkEdit);\n } else if (edit.type === \"deleteObject\") {\n remappedActionResponse.deletedObjects?.push(osdkEdit);\n } else if (edit.type === \"modifyObject\") {\n remappedActionResponse.modifiedObjects.push(osdkEdit);\n }\n editedObjectTypesSet.add(edit.objectType);\n } else {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(`Unexpected edit type: ${JSON.stringify(edit)}`);\n }\n }\n }\n remappedActionResponse.editedObjectTypes = [...editedObjectTypesSet];\n return remappedActionResponse;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _getLatestValue = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/latestValue\", 2];\n/**\n * Get the latest value of a property backed by a timeseries. If a specific geotime series integration has both a history and a live integration, we will give precedence to the live integration.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{propertyName}/latestValue\n */\nexport function getLatestValue($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getLatestValue, ...args);\n}\nconst _streamValues = [1, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamValues\", 3,, \"*/*\"];\n/**\n * Stream all of the points of a time series property (this includes geotime series references).\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/streamValues\n */\nexport function streamValues($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamValues, ...args);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{\"data\":[`\nconst OBJECT_OPEN_CHAR_CODE = 123; // '{'\nconst OBJECT_CLOSE_CHAR_CODE = 125; // '}'\n\nexport async function* parseStreamedResponse(asyncIterable) {\n const utf8decoder = new TextDecoder(\"utf-8\");\n let parsedStart = false;\n let prevChunks = [];\n let openBracesCount = 0;\n for await (const chunk of asyncIterable) {\n // on the first chunk, skip the expected START_TOKEN if we see it\n let i = 0;\n if (!parsedStart) {\n parsedStart = true;\n if (startsWith(chunk, START_TOKEN)) {\n i = START_TOKEN.length;\n }\n }\n for (; i < chunk.length; i++) {\n // if we aren't currently parsing an object, skip until we find the next object start\n while (openBracesCount === 0 && chunk[i] !== OBJECT_OPEN_CHAR_CODE && i < chunk.length) {\n i++;\n }\n\n // iterate through the chunk looking for the end of the current top level object\n let j = i;\n for (; j < chunk.length; j++) {\n const c = chunk[j];\n if (c === OBJECT_OPEN_CHAR_CODE) {\n openBracesCount++;\n } else if (c === OBJECT_CLOSE_CHAR_CODE) {\n openBracesCount--;\n\n // found a complete top level object, emit it\n if (0 === openBracesCount) {\n yield combineAndParse(utf8decoder, prevChunks, chunk.subarray(i, j + 1));\n\n // if there was a prevChunk, we've consumed it now\n prevChunks = [];\n\n // advance the start index to the final '}' of the current object,\n // which lets us start seeking the beginning of the next object\n i = j;\n break;\n }\n }\n }\n\n // if we reached the end of our chunk before finding the end of the object\n // store off the relevant remainder of our current chunk and go grab the next one\n if (j === chunk.length) {\n prevChunks.push(chunk.subarray(i));\n break;\n }\n }\n }\n}\nfunction startsWith(a, b) {\n if (a.length < b.length) {\n return false;\n }\n for (let i = 0; i < b.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\nfunction combineAndParse(utf8decoder, prev, curr) {\n let str = \"\";\n for (const chunk of prev) {\n str += utf8decoder.decode(chunk, {\n stream: true\n });\n }\n str += utf8decoder.decode(curr);\n return JSON.parse(str);\n}\nexport async function* iterateReadableStream(readableStream) {\n let res = await readableStream.read();\n while (!res.done) {\n yield res.value;\n res = await readableStream.read();\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 { TimeseriesDurationMapping } from \"@osdk/api\";\nimport { iterateReadableStream, parseStreamedResponse } from \"./streamutils.js\";\nexport function getTimeRange(body) {\n if (\"$startTime\" in body || \"$endTime\" in body) {\n return {\n type: \"absolute\",\n startTime: body.$startTime,\n endTime: body.$endTime\n };\n }\n return body.$before ? {\n type: \"relative\",\n startTime: {\n when: \"BEFORE\",\n value: body.$before,\n unit: TimeseriesDurationMapping[body.$unit]\n }\n } : {\n type: \"relative\",\n endTime: {\n when: \"AFTER\",\n value: body.$after,\n unit: TimeseriesDurationMapping[body.$unit]\n }\n };\n}\nexport async function* asyncIterPointsHelper(iterator) {\n const reader = iterator.body?.getReader();\n for await (const point of parseStreamedResponse(iterateReadableStream(reader))) {\n yield {\n time: point.time,\n value: point.value\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 * as TimeSeriesValueBankProperties from \"@osdk/foundry.ontologies/TimeSeriesValueBankProperty\";\nimport { asyncIterPointsHelper, getTimeRange } from \"./util/timeseriesUtils.js\";\nexport class GeotimeSeriesPropertyImpl {\n #triplet;\n #client;\n constructor(client, objectApiName, primaryKey, propertyName, initialValue) {\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n if (initialValue != null) {\n this.lastFetchedValue = initialValue;\n }\n }\n async getLatestValue() {\n const latestPointPromise = TimeSeriesValueBankProperties.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n latestPointPromise.then(latestPoint => this.lastFetchedValue = latestPoint,\n // eslint-disable-next-line no-console\n err => void console.error(err));\n return latestPointPromise;\n }\n async getAllValues(query) {\n const allPoints = [];\n for await (const point of this.asyncIterValues(query)) {\n allPoints.push(point);\n }\n return allPoints;\n }\n async *asyncIterValues(query) {\n const streamPointsIterator = await TimeSeriesValueBankProperties.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {\n range: getTimeRange(query)\n } : {});\n for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {\n yield timeseriesPoint;\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 * as MediaReferenceProperties from \"@osdk/foundry.ontologies/MediaReferenceProperty\";\nexport class MediaReferencePropertyImpl {\n #mediaReference;\n #triplet;\n #client;\n constructor(args) {\n const {\n client,\n objectApiName,\n primaryKey,\n propertyName,\n mediaReference\n } = args;\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n this.#mediaReference = mediaReference;\n }\n async fetchContents() {\n return MediaReferenceProperties.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {\n preview: true // TODO: Can turn this back off when backend is no longer in beta.\n });\n }\n async fetchMetadata() {\n const r = await MediaReferenceProperties.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {\n preview: true // TODO: Can turn this back off when backend is no longer in beta.\n });\n return {\n path: r.path,\n sizeBytes: Number(r.sizeBytes),\n mediaType: r.mediaType\n };\n }\n getMediaReference() {\n return this.#mediaReference;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _getFirstPoint = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint\", 2];\n/**\n * Get the first point of a time series property.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/firstPoint\n */\nexport function getFirstPoint($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getFirstPoint, ...args);\n}\nconst _getLastPoint = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint\", 2];\n/**\n * Get the last point of a time series property.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/lastPoint\n */\nexport function getLastPoint($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getLastPoint, ...args);\n}\nconst _streamPoints = [1, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamPoints\", 3,, \"*/*\"];\n/**\n * Stream all of the points of a time series property.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/streamPoints\n */\nexport function streamPoints($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamPoints, ...args);\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 * as TimeSeriesPropertiesV2 from \"@osdk/foundry.ontologies/TimeSeriesPropertyV2\";\nimport { asyncIterPointsHelper, getTimeRange } from \"./util/timeseriesUtils.js\";\nexport class TimeSeriesPropertyImpl {\n #triplet;\n #client;\n constructor(client, objectApiName, primaryKey, propertyName) {\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n }\n async getFirstPoint() {\n return TimeSeriesPropertiesV2.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n }\n async getLastPoint() {\n return TimeSeriesPropertiesV2.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n }\n async getAllPoints(query) {\n const allPoints = [];\n for await (const point of this.asyncIterPoints(query)) {\n allPoints.push(point);\n }\n return allPoints;\n }\n async *asyncIterPoints(query) {\n const streamPointsIterator = await TimeSeriesPropertiesV2.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {\n range: getTimeRange(query)\n } : {});\n for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {\n yield timeseriesPoint;\n }\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Formats a boolean value according to the specified formatting rule\n */\nexport function formatBoolean(value, rule) {\n return value ? rule.valueIfTrue : rule.valueIfFalse;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Resolves a property reference or string constant to its actual value\n */\n\nexport function resolvePropertyReference(ref, objectData) {\n if (ref.type === \"constant\") {\n return ref.value;\n } else if (ref.type === \"propertyType\") {\n const value = objectData[ref.propertyApiName];\n return value != null ? String(value) : undefined;\n }\n return undefined;\n}\n/**\n * Gets the browser's current locale\n */\nexport function getBrowserLocale() {\n if (typeof navigator !== \"undefined\" && navigator.language != null) {\n return navigator.language;\n }\n return \"en-US\";\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolvePropertyReference } from \"./propertyFormattingUtils.js\";\n\n/**\n * Formats a date/timestamp value according to the specified formatting rule\n */\nexport function formatDateTime(value, format, timezone, objectData, locale, userTimezoneOverride) {\n const date = value instanceof Date ? value : new Date(value);\n if (isNaN(date.getTime())) {\n return undefined;\n }\n const resolvedTimezone = resolveTimezone(timezone, objectData, userTimezoneOverride);\n switch (format.type) {\n case \"localizedFormat\":\n return formatLocalized(date, format, locale, resolvedTimezone);\n case \"stringFormat\":\n // TODO - pattern formatting\n return undefined;\n default:\n format;\n return undefined;\n }\n}\nconst INVALID_DATE_STRING = \"Invalid date or timezone\";\nfunction formatLocalized(date, format, locale, timezone) {\n if (format.format === \"DATE_FORMAT_ISO_INSTANT\") {\n return date.toISOString();\n }\n if (format.format === \"DATE_FORMAT_RELATIVE_TO_NOW\") {\n return formatRelativeToNow(date, locale, timezone);\n }\n const options = getLocalizedFormatOptions(format.format);\n try {\n return new Intl.DateTimeFormat(locale, timezone ? {\n ...options,\n timeZone: timezone\n } : options).format(date);\n } catch (_e) {\n // If a property reference is an invalid timezone we specifically say that it's invalid instead of returning undefined;\n return INVALID_DATE_STRING;\n }\n}\nfunction getLocalizedFormatOptions(format) {\n switch (format) {\n case \"DATE_FORMAT_DATE\":\n return FORMAT_DATE;\n case \"DATE_FORMAT_YEAR_AND_MONTH\":\n return FORMAT_YEAR_AND_MONTH;\n case \"DATE_FORMAT_DATE_TIME\":\n return FORMAT_DATE_TIME;\n case \"DATE_FORMAT_DATE_TIME_SHORT\":\n return FORMAT_DATE_TIME_SHORT;\n case \"DATE_FORMAT_TIME\":\n return FORMAT_TIME;\n default:\n format;\n return {};\n }\n}\nconst FORMAT_DATE = {\n day: \"numeric\",\n month: \"short\",\n weekday: \"short\",\n year: \"numeric\"\n};\nconst FORMAT_YEAR_AND_MONTH = {\n month: \"short\",\n year: \"numeric\"\n};\nconst FORMAT_DATE_TIME = {\n day: \"numeric\",\n month: \"short\",\n weekday: \"short\",\n year: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n};\nconst FORMAT_DATE_TIME_SHORT = {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\"\n};\nconst FORMAT_TIME = {\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n};\nconst DATE_TIME_SHORT_WITH_WEEKDAY = {\n day: \"numeric\",\n month: \"short\",\n weekday: \"short\",\n year: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\"\n};\nfunction resolveTimezone(timezone, objectData, userTimezoneOverride) {\n if (userTimezoneOverride != null) {\n return userTimezoneOverride;\n }\n if (timezone == null) {\n return undefined;\n }\n switch (timezone.type) {\n case \"user\":\n return undefined;\n case \"static\":\n return resolvePropertyReference(timezone.zoneId, objectData);\n default:\n timezone;\n return undefined;\n }\n}\nconst SECOND_MS = 1_000;\nconst MINUTE_MS = 60 * SECOND_MS;\nconst HOUR_MS = 60 * MINUTE_MS;\nconst DAY_MS = 24 * HOUR_MS;\nfunction formatRelativeToNow(date, locale, timezone) {\n const now = Date.now();\n const diff = date.valueOf() - now;\n const absDiff = Math.abs(diff);\n\n // More than 1 day - fall back to absolute date formatting\n if (absDiff >= DAY_MS) {\n const dtf = new Intl.DateTimeFormat(locale, {\n ...DATE_TIME_SHORT_WITH_WEEKDAY,\n timeZone: timezone\n });\n return dtf.format(date);\n }\n\n // Within 1 day - use relative formatting\n const rtf = new Intl.RelativeTimeFormat(locale, {\n numeric: \"auto\"\n });\n const units = [[\"hour\", HOUR_MS], [\"minute\", MINUTE_MS], [\"second\", SECOND_MS]];\n for (const [unit, ms] of units) {\n if (absDiff >= ms) {\n return rtf.format(Math.floor(diff / ms), unit);\n }\n }\n return rtf.format(0, \"second\");\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolvePropertyReference } from \"./propertyFormattingUtils.js\";\n\n/**\n * Extended NumberFormatOptions that includes rounding mode support\n * which is available in modern browsers but not yet in TypeScript types.\n * Only includes modes that are actually supported by Intl.NumberFormat and used in our API.\n */\n\n/**\n * Formats a number value according to the specified formatting rule\n */\nexport function formatNumber(value, numberType, objectData, locale) {\n switch (numberType.type) {\n case \"standard\":\n return formatStandardNumber(value, numberType.baseFormatOptions, locale);\n case \"fixedValues\":\n return numberType.values[value];\n case \"currency\":\n return formatCurrency(value, numberType, objectData, locale);\n case \"standardUnit\":\n return formatStandardUnit(value, numberType, objectData, locale);\n case \"customUnit\":\n return formatCustomUnit(value, numberType, objectData, locale);\n case \"affix\":\n return formatAffix(value, numberType, objectData, locale);\n case \"duration\":\n // TODO (duration is a bit more complex)\n return undefined;\n case \"scale\":\n return formatScale(value, numberType, locale);\n case \"ratio\":\n return formatRatio(value, numberType, locale);\n default:\n numberType;\n return undefined;\n }\n}\nfunction formatStandardNumber(value, options, locale) {\n return formatNumberWithAffixes(value, options, locale);\n}\nfunction formatCurrency(value, rule, objectData, locale) {\n const currencyCode = resolvePropertyReference(rule.currencyCode, objectData);\n if (currencyCode == null) {\n return formatStandardNumber(value, rule.baseFormatOptions, locale);\n }\n const options = {\n ...convertToIntlOptions(rule.baseFormatOptions),\n style: \"currency\",\n currency: currencyCode,\n currencyDisplay: rule.style === \"COMPACT\" ? \"narrowSymbol\" : \"symbol\"\n };\n return formatWithIntl(value, options, locale);\n}\nfunction formatStandardUnit(value, rule, objectData, locale) {\n const unit = resolvePropertyReference(rule.unit, objectData);\n if (unit == null) {\n return formatStandardNumber(value, rule.baseFormatOptions, locale);\n }\n const options = {\n ...convertToIntlOptions(rule.baseFormatOptions),\n style: \"unit\",\n unit: unit\n };\n try {\n return formatWithIntl(value, options, locale);\n } catch (error) {\n const suffix = ` ${unit}`;\n return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, \"\", suffix);\n }\n}\nfunction formatCustomUnit(value, rule, objectData, locale) {\n const unit = resolvePropertyReference(rule.unit, objectData);\n const suffix = unit != null ? ` ${unit}` : \"\";\n return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, \"\", suffix);\n}\nfunction formatAffix(value, rule, objectData, locale) {\n const prefix = rule.affix.prefix != null ? resolvePropertyReference(rule.affix.prefix, objectData) ?? \"\" : \"\";\n const suffix = rule.affix.postfix != null ? resolvePropertyReference(rule.affix.postfix, objectData) ?? \"\" : \"\";\n return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, prefix, suffix);\n}\n\n/**\n * Gets the scale divisor for a given scale type\n */\nfunction getScaleDivisor(scaleType) {\n switch (scaleType) {\n case \"THOUSANDS\":\n return 1e3;\n case \"MILLIONS\":\n return 1e6;\n case \"BILLIONS\":\n return 1e9;\n default:\n scaleType;\n throw new Error(`Unknown scale type: ${scaleType}`);\n }\n}\n\n/**\n * Extracts the localized compact suffix for a given scale.\n * Uses Intl.NumberFormat with compact notation to get the proper i18n suffix.\n */\nfunction getLocalizedCompactSuffix(scaleDivisor, locale) {\n const compactFormatter = new Intl.NumberFormat(locale, {\n notation: \"compact\",\n compactDisplay: \"short\"\n });\n const parts = compactFormatter.formatToParts(scaleDivisor);\n const compactPart = parts.find(p => p.type === \"compact\");\n return compactPart?.value ?? \"\";\n}\nfunction formatScale(value, rule, locale) {\n const scaleDivisor = getScaleDivisor(rule.scaleType);\n const scaledValue = value / scaleDivisor;\n const suffix = getLocalizedCompactSuffix(scaleDivisor, locale);\n return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, \"\", suffix);\n}\nfunction getRatioScaledValue(value, ratioType) {\n switch (ratioType) {\n case \"PERCENTAGE\":\n return value * 100;\n case \"PER_MILLE\":\n return value * 1000;\n case \"BASIS_POINTS\":\n return value * 10000;\n default:\n ratioType;\n throw new Error(`Unknown ratio type: ${ratioType}`);\n }\n}\nfunction formatRatio(value, rule, locale) {\n // Special case: PERCENTAGE uses Intl's native percent style\n if (rule.ratioType === \"PERCENTAGE\") {\n const options = {\n ...convertToIntlOptions(rule.baseFormatOptions),\n style: \"percent\"\n };\n return formatWithIntl(value, options, locale);\n }\n\n // Other ratio types: scale and add suffix\n const scaledValue = getRatioScaledValue(value, rule.ratioType);\n let suffix;\n switch (rule.ratioType) {\n case \"PER_MILLE\":\n suffix = \"‰\";\n break;\n case \"BASIS_POINTS\":\n suffix = \" bps\";\n break;\n default:\n rule.ratioType;\n throw new Error(`Unknown ratio type: ${rule.ratioType}`);\n }\n return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, \"\", suffix);\n}\n\n/**\n * Maps notation from OSDK format to Intl format\n */\nfunction mapNotation(notation) {\n switch (notation) {\n case \"STANDARD\":\n return \"standard\";\n case \"SCIENTIFIC\":\n return \"scientific\";\n case \"ENGINEERING\":\n return \"engineering\";\n case \"COMPACT\":\n return \"compact\";\n default:\n notation;\n }\n}\n\n/**\n * Maps rounding mode from OSDK format to Intl format\n */\nfunction mapRoundingMode(mode) {\n switch (mode) {\n case \"CEIL\":\n return \"ceil\";\n case \"FLOOR\":\n return \"floor\";\n case \"ROUND_CLOSEST\":\n return \"halfExpand\";\n default:\n mode;\n return undefined;\n }\n}\nfunction convertToIntlOptions(options) {\n return {\n useGrouping: options.useGrouping,\n minimumIntegerDigits: options.minimumIntegerDigits,\n minimumFractionDigits: options.minimumFractionDigits,\n maximumFractionDigits: options.maximumFractionDigits,\n minimumSignificantDigits: options.minimumSignificantDigits,\n maximumSignificantDigits: options.maximumSignificantDigits,\n notation: options.notation ? mapNotation(options.notation) : undefined,\n roundingMode: options.roundingMode ? mapRoundingMode(options.roundingMode) : undefined,\n convertNegativeToParenthesis: options.convertNegativeToParenthesis\n };\n}\n\n/**\n * Applies negative-to-parenthesis conversion if requested\n */\nfunction maybeConvertNegativeToParenthesis(formatted, value, shouldConvert) {\n if (shouldConvert && value < 0) {\n return formatted.replace(/^-/, \"(\") + \")\";\n }\n return formatted;\n}\n\n/**\n * Formats a number using Intl.NumberFormat with the given options\n */\nfunction formatWithIntl(value, options, locale) {\n const formatter = new Intl.NumberFormat(locale, options);\n const formatted = formatter.format(value);\n return maybeConvertNegativeToParenthesis(formatted, value, options.convertNegativeToParenthesis ?? false);\n}\n\n/**\n * Formats a number and optionally adds prefix/suffix\n */\nfunction formatNumberWithAffixes(value, baseOptions, locale, prefix, suffix) {\n const intlOptions = convertToIntlOptions(baseOptions);\n const formatted = formatWithIntl(value, intlOptions, locale);\n return `${prefix || \"\"}${formatted}${suffix || \"\"}`;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { formatBoolean } from \"./formatBoolean.js\";\nimport { formatDateTime } from \"./formatDateTime.js\";\nimport { formatNumber } from \"./formatNumber.js\";\nimport { getBrowserLocale } from \"./propertyFormattingUtils.js\";\n/**\n * Applies formatting rules to a property value and returns the formatted string value.\n *\n * @param propertyValue - The value of the property to format\n * @returns The formatted string value, or undefined if the property cannot be formatted\n *\n * @experimental This is a stub implementation that returns undefined.\n * The actual formatting logic will be implemented later.\n */\nexport function applyPropertyFormatter(propertyValue, propertyDefinition, objectData, options = {}) {\n if (propertyDefinition?.valueFormatting == null || propertyValue == null) {\n return undefined;\n }\n return formatPropertyValue(propertyValue, propertyDefinition.valueFormatting, objectData, options);\n}\nfunction formatPropertyValue(value, rule, objectData, options) {\n switch (rule.type) {\n case \"boolean\":\n if (typeof value !== \"boolean\") {\n return undefined;\n }\n return formatBoolean(value, rule);\n case \"number\":\n if (typeof value !== \"number\") {\n return undefined;\n }\n return formatNumber(value, rule.numberType, objectData, options.locale ?? getBrowserLocale());\n case \"date\":\n case \"timestamp\":\n if (typeof value !== \"string\") {\n return undefined;\n }\n return formatDateTime(new Date(value), rule.format, rule.type === \"timestamp\" ? rule.displayTimezone : undefined, objectData, options.locale ?? getBrowserLocale(), options.timezoneId);\n default:\n return undefined;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const InterfaceDefinitions = Symbol(process.env.MODE !== \"production\" ? \"InterfaceDefinitions\" : undefined);","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @internal */\nexport const UnderlyingOsdkObject = Symbol(process.env.MODE !== \"production\" ? \"Underlying Object\" : undefined);\n\n/** @internal */\nexport const ObjectDefRef = Symbol(process.env.MODE !== \"production\" ? \"ObjectDefinition\" : undefined);\n\n/** @internal */\nexport const InterfaceDefRef = Symbol(process.env.MODE !== \"production\" ? \"InterfaceDefinition\" : undefined);\n\n/** @internal */\nexport const ClientRef = Symbol(process.env.MODE !== \"production\" ? \"ClientRef\" : undefined);\n\n/** @internal */\nexport const PropertySecuritiesRef = Symbol(process.env.MODE !== \"production\" ? \"Property Securities\" : undefined);","/*\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 { getWireObjectSet } from \"../../objectSet/createObjectSet.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../fetchSingle.js\";\nimport { ClientRef, InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject } from \"./InternalSymbols.js\";\n/** @internal */\nexport function get$link(holder) {\n const client = holder[ClientRef];\n const objDef = holder[ObjectDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(Object.keys(objDef.links).map(linkName => {\n const linkDef = objDef.links[linkName];\n const objectSet = client.objectSetFactory(objDef, client).where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey\n }).pivotTo(linkName);\n const value = !linkDef.multiplicity ? {\n fetchOne: options => fetchSingle(client, objDef, options ?? {}, getWireObjectSet(objectSet)),\n fetchOneWithErrors: options => fetchSingleWithErrors(client, objDef, options ?? {}, getWireObjectSet(objectSet))\n } : objectSet;\n return [linkName, value];\n })));\n}\n\n/** @internal */\nexport function get$linkForInterface(holder) {\n const client = holder[UnderlyingOsdkObject][ClientRef];\n const objDef = holder[UnderlyingOsdkObject][ObjectDefRef];\n const interfaceDef = holder[InterfaceDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(Object.keys(interfaceDef.links).map(linkName => {\n const linkDef = interfaceDef.links[linkName];\n const objectSet = client.objectSetFactory(interfaceDef, client).intersect(client.objectSetFactory(objDef, client).where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey\n })).pivotTo(linkName);\n const value = !linkDef.multiplicity ? {\n fetchOne: options => fetchSingle(client, objDef, options ?? {}, getWireObjectSet(objectSet)),\n fetchOneWithErrors: options => fetchSingleWithErrors(client, objDef, options ?? {}, getWireObjectSet(objectSet))\n } : objectSet;\n return [linkName, value];\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 { extractNamespace } from \"../../internal/conversions/extractNamespace.js\";\nimport { get$linkForInterface } from \"./getDollarLink.js\";\nimport { InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject } from \"./InternalSymbols.js\";\n/** @internal */\nexport function createOsdkInterface(underlying, interfaceDef) {\n const [objApiNamespace] = extractNamespace(interfaceDef.apiName);\n return Object.freeze(Object.defineProperties({}, {\n // first to minimize hidden classes\n [UnderlyingOsdkObject]: {\n value: underlying\n },\n \"$apiName\": {\n value: interfaceDef.apiName,\n enumerable: true\n },\n \"$as\": {\n value: underlying.$as,\n enumerable: false\n },\n \"$objectType\": {\n value: underlying.$objectType,\n enumerable: \"$objectType\" in underlying\n },\n \"$primaryKey\": {\n value: underlying.$primaryKey,\n enumerable: \"$primaryKey\" in underlying\n },\n \"$objectSpecifier\": {\n value: underlying.$objectSpecifier,\n enumerable: \"$objectSpecifier\" in underlying\n },\n \"$title\": {\n value: underlying.$title,\n enumerable: \"$title\" in underlying\n },\n \"$rid\": {\n value: underlying.$rid,\n enumerable: \"$rid\" in underlying\n },\n \"$clone\": {\n value: clone,\n enumerable: false\n },\n \"$propertySecurities\": {\n value: underlying.$propertySecurities,\n enumerable: \"$propertySecurities\" in underlying\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata\": {\n value: {\n \"ObjectMetadata\": underlying[ObjectDefRef],\n \"InterfaceMetadata\": interfaceDef\n },\n enumerable: false\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue\": {\n value: underlying.$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue,\n enumerable: false\n },\n \"$link\": {\n get: function () {\n return get$linkForInterface(this);\n }\n },\n [InterfaceDefRef]: {\n value: interfaceDef\n },\n ...Object.fromEntries(Object.keys(interfaceDef.properties).map(p => {\n const objDef = underlying[ObjectDefRef];\n const [apiNamespace, apiName] = extractNamespace(p);\n const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];\n return [apiNamespace === objApiNamespace ? apiName : p, {\n enumerable: targetPropName in underlying,\n value: underlying[targetPropName]\n }];\n }))\n }));\n function clone(update) {\n if (update == null) {\n return underlying.$clone().$as(interfaceDef);\n }\n for (const key of Object.keys(update)) {\n if (!(key in interfaceDef.properties)) {\n throw new Error(`Invalid property ${key} for interface ${interfaceDef.apiName}`);\n }\n }\n const remappedProps = Object.fromEntries(Object.keys(update).map(p => mapProperty(p, update[p])).filter(x => x != null));\n return underlying.$clone(remappedProps).$as(interfaceDef);\n }\n function mapProperty(propertyName, value) {\n const objDef = underlying[ObjectDefRef];\n const targetPropName = objDef.interfaceMap[interfaceDef.apiName][propertyName];\n // If the underlying object does not implement the SPT, throw errors\n if (targetPropName == null) {\n throw new Error(`Cannot clone interface with ${propertyName} as property is not implemented by the underlying object type ${objDef.apiName}`);\n }\n return [targetPropName, value];\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 { InterfaceDefinitions } from \"../../ontology/OntologyProvider.js\";\nimport { createSimpleCache } from \"../SimpleCache.js\";\nimport { createOsdkInterface } from \"./createOsdkInterface.js\";\nimport { UnderlyingOsdkObject } from \"./InternalSymbols.js\";\n\n/** @internal */\n\nexport const get$as = createSimpleCache(new WeakMap(), $asFactory).get;\nconst osdkObjectToInterfaceView = createSimpleCache(new WeakMap(), () => new Map());\nfunction $asFactory(objDef) {\n // We use the exact same logic for both the interface rep and the underlying rep\n\n return function $as(targetMinDef) {\n let targetInterfaceApiName;\n if (typeof targetMinDef === \"string\") {\n if (targetMinDef === objDef.apiName) {\n return this[UnderlyingOsdkObject];\n }\n\n // this is sufficient to determine if we implement the interface\n if (objDef.interfaceMap?.[targetMinDef] == null) {\n throw new Error(`Object does not implement interface '${targetMinDef}'.`);\n }\n targetInterfaceApiName = targetMinDef;\n } else if (targetMinDef.apiName === objDef.apiName) {\n return this[UnderlyingOsdkObject];\n } else {\n if (targetMinDef.type === \"object\") {\n throw new Error(`'${targetMinDef.apiName}' is not an interface nor is it '${objDef.apiName}', which is the object type.`);\n }\n targetInterfaceApiName = targetMinDef.apiName;\n }\n const def = objDef[InterfaceDefinitions][targetInterfaceApiName];\n if (!def) {\n throw new Error(`Object does not implement interface '${targetInterfaceApiName}'.`);\n }\n const underlying = this[UnderlyingOsdkObject];\n const existing = osdkObjectToInterfaceView.get(underlying).get(targetInterfaceApiName)?.deref();\n if (existing) return existing;\n const osdkInterface = createOsdkInterface(underlying, def.def);\n osdkObjectToInterfaceView.get(underlying).set(targetInterfaceApiName, new WeakRef(osdkInterface));\n return osdkInterface;\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 invariant from \"tiny-invariant\";\nimport { GeotimeSeriesPropertyImpl } from \"../../createGeotimeSeriesProperty.js\";\nimport { MediaReferencePropertyImpl } from \"../../createMediaReferenceProperty.js\";\nimport { TimeSeriesPropertyImpl } from \"../../createTimeseriesProperty.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../../public-utils/hydrateAttachmentFromRid.js\";\nimport { createObjectSpecifierFromPrimaryKey } from \"../../util/objectSpecifierUtils.js\";\nimport { applyPropertyFormatter } from \"../formatting/applyPropertyFormatter.js\";\nimport { get$as } from \"./getDollarAs.js\";\nimport { get$link } from \"./getDollarLink.js\";\nimport { ClientRef, ObjectDefRef, PropertySecuritiesRef, UnderlyingOsdkObject } from \"./InternalSymbols.js\";\nconst specialPropertyTypes = new Set([\"attachment\", \"geotimeSeriesReference\", \"mediaReference\", \"numericTimeseries\", \"stringTimeseries\", \"sensorTimeseries\"]);\n\n// kept separate so we are not redefining these functions\n// every time an object is created.\nconst basePropDefs = {\n \"$as\": {\n get: function () {\n return get$as(this[ObjectDefRef]);\n }\n },\n \"$link\": {\n get: function () {\n return get$link(this);\n }\n },\n \"$clone\": {\n value: function (update) {\n // I think `rawObj` is the same thing as `this` and can be removed?\n const rawObj = this[UnderlyingOsdkObject];\n const def = this[ObjectDefRef];\n if (update == null) {\n return createOsdkObject(this[ClientRef], def, {\n ...rawObj\n });\n }\n if (def.primaryKeyApiName in update && rawObj[def.primaryKeyApiName] !== update[def.primaryKeyApiName]) {\n throw new Error(`Cannot update ${def.apiName} object with differing primary key values `);\n }\n if (def.titleProperty in update && !(\"$title\" in update)) {\n update.$title = update[def.titleProperty];\n }\n const newObject = {\n ...this[UnderlyingOsdkObject],\n ...update\n };\n return createOsdkObject(this[ClientRef], this[ObjectDefRef], newObject);\n }\n },\n \"$objectSpecifier\": {\n get: function () {\n const rawObj = this[UnderlyingOsdkObject];\n return createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);\n },\n enumerable: true\n },\n \"$propertySecurities\": {\n get: function () {\n return this[PropertySecuritiesRef];\n },\n enumerable: true\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata\": {\n get: function () {\n return {\n ObjectMetadata: this[ObjectDefRef]\n };\n },\n enumerable: false\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue\": {\n value: function (propertyApiName, options) {\n const rawObj = this[UnderlyingOsdkObject];\n const def = this[ObjectDefRef];\n const propertyValue = rawObj[propertyApiName];\n return applyPropertyFormatter(propertyValue, def.properties[propertyApiName], rawObj, options);\n },\n enumerable: false\n }\n};\n\n/**\n * @internal\n * @param client\n * @param objectDef\n * @param simpleOsdkProperties\n */\nexport function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}, wirePropertySecurities = []) {\n const {\n parsedObject,\n clientPropertySecurities\n } = parseWhenSecuritiesLoaded(wirePropertySecurities, simpleOsdkProperties, objectDef, derivedPropertyTypeByName);\n\n // updates the object's \"hidden class/map\".\n const rawObj = parsedObject;\n Object.defineProperties(rawObj, {\n [UnderlyingOsdkObject]: {\n enumerable: false,\n value: simpleOsdkProperties\n },\n [PropertySecuritiesRef]: {\n enumerable: false,\n value: clientPropertySecurities\n },\n [ObjectDefRef]: {\n value: objectDef,\n enumerable: false\n },\n // TODO: Potentially update when GA metadata field\n [ClientRef]: {\n value: client,\n enumerable: false\n },\n ...basePropDefs\n });\n\n // Assign the special values\n for (const propKey of Object.keys(rawObj)) {\n if (propKey in objectDef.properties && typeof objectDef.properties[propKey].type === \"string\" && specialPropertyTypes.has(objectDef.properties[propKey].type)) {\n rawObj[propKey] = createSpecialProperty(client, objectDef, rawObj, propKey);\n } else if (propKey in derivedPropertyTypeByName) {\n rawObj[propKey] = modifyRdpProperties(client, derivedPropertyTypeByName, rawObj[propKey], propKey);\n }\n }\n return Object.freeze(rawObj);\n}\nfunction modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKey) {\n if (derivedPropertyTypeByName[propKey].definition.type === \"selection\" && derivedPropertyTypeByName[propKey].definition.operation.type === \"count\") {\n const num = Number(rawValue);\n !Number.isSafeInteger(num) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Count aggregation for derived property \" + propKey + \" returned a value larger than safe integer.\") : invariant(false) : void 0;\n return num;\n } // Selected or collected properties need to be deserialized specially when constructed with RDP\n else if (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType != null && typeof derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type === \"string\" && specialPropertyTypes.has(derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type)) {\n switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {\n case \"attachment\":\n if (Array.isArray(rawValue)) {\n return rawValue.map(a => hydrateAttachmentFromRidInternal(client, a.rid));\n } else {\n return hydrateAttachmentFromRidInternal(client, rawValue.rid);\n }\n break;\n default:\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Derived property aggregations for Timeseries and Media are not supported\") : invariant(false) : void 0;\n }\n }\n return rawValue;\n}\nfunction createSpecialProperty(client, objectDef, rawObject, p) {\n const rawValue = rawObject[p];\n const propDef = objectDef.properties[p];\n if (process.env.NODE_ENV !== \"production\") {\n !(propDef != null && typeof propDef.type === \"string\" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n }\n if (propDef.type === \"attachment\") {\n if (Array.isArray(rawValue)) {\n return rawValue.map(a => hydrateAttachmentFromRidInternal(client, a.rid));\n }\n return hydrateAttachmentFromRidInternal(client, rawValue.rid);\n }\n if (propDef.type === \"numericTimeseries\" || propDef.type === \"stringTimeseries\" || propDef.type === \"sensorTimeseries\") {\n return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);\n }\n if (propDef.type === \"geotimeSeriesReference\") {\n return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === \"geotimeSeriesValue\" ? {\n time: rawValue.timestamp,\n value: {\n type: \"Point\",\n coordinates: rawValue.position\n }\n } : undefined);\n }\n if (propDef.type === \"mediaReference\") {\n return new MediaReferencePropertyImpl({\n client,\n objectApiName: objectDef.apiName,\n primaryKey: rawObject[objectDef.primaryKeyApiName],\n propertyName: p,\n mediaReference: rawValue\n });\n }\n}\nfunction parseWhenSecuritiesLoaded(wirePropertySecurities, rawObject, objectDef, derivedPropertyTypeByName = {}) {\n if (wirePropertySecurities == null || wirePropertySecurities.length === 0) {\n return {\n parsedObject: rawObject,\n clientPropertySecurities: undefined\n };\n }\n const parsedObject = {\n ...rawObject\n };\n const clientPropertySecurities = {};\n for (const propKey of Object.keys(rawObject)) {\n if (propKey in objectDef.properties || propKey in derivedPropertyTypeByName) {\n const value = rawObject[propKey];\n if (Array.isArray(value)) {\n const newVal = [];\n const newSecurities = [];\n value.forEach(spv => {\n !(typeof spv === \"object\" && spv != null && \"value\" in spv && \"propertySecurityIndex\" in spv) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected destructured secured property value object in array\") : invariant(false) : void 0;\n const securedValue = spv;\n newVal.push(securedValue.value);\n const securityIndex = securedValue.propertySecurityIndex;\n !(securityIndex != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be defined\") : invariant(false) : void 0;\n !(securityIndex < wirePropertySecurities.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be within bounds\") : invariant(false) : void 0;\n newSecurities.push(wirePropertySecurities[securityIndex].disjunction.map(wireToClientPropertySecurities));\n });\n parsedObject[propKey] = newVal;\n clientPropertySecurities[propKey] = newSecurities;\n } // Check if this is a secured property value object\n else if (typeof value === \"object\" && value != null && \"value\" in value && \"propertySecurityIndex\" in value) {\n const securedValue = value;\n parsedObject[propKey] = securedValue.value;\n const securityIndex = securedValue.propertySecurityIndex;\n !(securityIndex != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be defined\") : invariant(false) : void 0;\n !(securityIndex < wirePropertySecurities.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be within bounds\") : invariant(false) : void 0;\n clientPropertySecurities[propKey] = wirePropertySecurities[securityIndex].disjunction.map(wireToClientPropertySecurities);\n } else {\n // Regular property without security\n parsedObject[propKey] = value;\n }\n }\n }\n return {\n parsedObject,\n clientPropertySecurities\n };\n}\nfunction wireToClientPropertySecurities(propertySecurity) {\n switch (propertySecurity.type) {\n case \"propertyMarkingSummary\":\n return {\n type: \"propertyMarkings\",\n conjunctive: propertySecurity.conjunctive,\n containerConjunctive: propertySecurity.containerConjunctive,\n disjunctive: propertySecurity.disjunctive,\n containerDisjunctive: propertySecurity.containerDisjunctive\n };\n case \"errorComputingSecurity\":\n return {\n type: \"errorComputingSecurity\"\n };\n case \"unsupportedPolicy\":\n return {\n type: \"unsupportedPolicy\"\n };\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport invariant from \"tiny-invariant\";\nimport { createOsdkObject } from \"./convertWireToOsdkObjects/createOsdkObject.js\";\n/**\n * If interfaceApiName is not undefined, converts the instances of the\n * interface into their respective\n * underlying concrete types and then returns the $as() representation\n * for the consumers.\n *\n * Otherwise just does the conversion\n *\n * May mutate in place for performance reasons. If you need a clean copy,\n * keep it first.\n *\n * However, you must use the returned value, which will be whatever is correct.\n *\n * @internal\n * @param interfaceApiName - if undefined\n */\nexport async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, propertySecurities, selectedProps, strictNonNull = false) {\n // remove the __ prefixed properties and convert them to $ prefixed.\n // updates in place\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) : undefined;\n const ifaceSelected = ifaceDef ? selectedProps ?? Object.keys(ifaceDef.properties) : undefined;\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);\n !objectDef ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing definition for '${rawObj.$apiName}'`) : invariant(false) : void 0;\n\n // default value for when we are checking an object\n let objProps;\n let conforming = true;\n if (ifaceDef && ifaceSelected) {\n // API returns interface spt names but we cache by real values\n invariantInterfacesAsViews(objectDef, ifaceDef.apiName, client);\n conforming &&= isConforming(client, ifaceDef, rawObj, ifaceSelected);\n reframeAsObjectInPlace(objectDef, ifaceDef.apiName, rawObj);\n objProps = convertInterfacePropNamesToObjectPropNames(objectDef, ifaceDef.apiName, ifaceSelected);\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\"Unable to safely convert objects as some non nullable properties are null\");\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName, propertySecurities);\n if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);\n ret.push(osdkObject);\n }\n return ret;\n}\n/**\n * @internal\n */\nexport async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, propertySecurities, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}, interfaceToObjectTypeMappingsV2 = {}) {\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n\n // prefer V2 mappings if non-empty, otherwise fall back to V1\n const effectiveMappings = Object.keys(interfaceToObjectTypeMappingsV2).length > 0 ? convertInterfaceToObjectTypeMappingsV2ToV1(interfaceToObjectTypeMappingsV2) : interfaceToObjectTypeMappings;\n const isInterfaceScoped = Object.keys(effectiveMappings).length > 0;\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);\n !objectDef ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing definition for '${rawObj.$apiName}'`) : invariant(false) : void 0;\n const interfaceToObjMapping = interfaceApiName && isInterfaceScoped ? effectiveMappings[interfaceApiName][rawObj.$apiName] : undefined;\n const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter(val => {\n selectedProps?.includes(interfaceToObjMapping[val]);\n }) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] : undefined;\n\n // default value for when we are checking an object\n let objProps;\n let conforming = true;\n if (interfaceApiName && ifaceSelected) {\n invariantInterfacesAsViews(objectDef, interfaceApiName, client);\n objProps = ifaceSelected;\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\"Unable to safely convert objects as some non nullable properties are null\");\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName, propertySecurities);\n if (interfaceApiName && isInterfaceScoped) osdkObject = osdkObject.$as(interfaceApiName);\n ret.push(osdkObject);\n }\n return ret;\n}\n\n/**\n * @internal\n *\n * Utility function that lets us take down selected property names from an interface\n * and convert them to an array of property names on an object.\n */\nexport function convertInterfacePropNamesToObjectPropNames(objectDef, interfaceApiName, ifacePropsToMap) {\n return ifacePropsToMap.map(ifaceProp => objectDef.interfaceMap[interfaceApiName][ifaceProp]);\n}\n\n/**\n * Takes a raw object from the wire (contextually as an interface) and\n * updates the fields to reflect the underlying objectDef instead\n * @param objectDef\n * @param interfaceApiName\n * @param client\n * @param rawObj\n */\nfunction reframeAsObjectInPlace(objectDef, interfaceApiName, rawObj) {\n const newProps = {};\n for (const [sptProp, regularProp] of Object.entries(objectDef.interfaceMap[interfaceApiName])) {\n if (sptProp in rawObj) {\n const value = rawObj[sptProp];\n delete rawObj[sptProp];\n if (value !== undefined) {\n newProps[regularProp] = value;\n }\n }\n }\n Object.assign(rawObj, newProps);\n if (!(objectDef.primaryKeyApiName in rawObj)) {\n rawObj[objectDef.primaryKeyApiName] = rawObj.$primaryKey;\n }\n}\nfunction isConforming(client, def, obj, propsToCheck) {\n for (const propName of propsToCheck) {\n if (propName in def.properties && def.properties[propName].nullable === false && obj[propName] == null) {\n if (process.env.NODE_ENV !== \"production\") {\n client.logger?.debug({\n obj: {\n $apiName: obj[\"$apiName\"],\n $objectType: obj[\"$objectType\"],\n $primaryKey: obj[\"$primaryKey\"]\n }\n }, `Found object that does not conform to its definition. Expected ${def.apiName}'s ${propName} to not be null.`);\n }\n return false;\n }\n }\n return true;\n}\nfunction invariantInterfacesAsViews(objectDef, interfaceApiName, client) {\n if (objectDef.interfaceMap?.[interfaceApiName] == null) {\n const warning = \"Interfaces are only supported 'as views' but your metadata object is missing the correct information. This suggests your interfaces have not been migrated to the newer version yet and you cannot use this version of the SDK.\";\n if (client.logger) {\n client.logger.warn(warning);\n } else {\n // eslint-disable-next-line no-console\n console.error(`WARNING! ${warning}`);\n }\n throw new Error(warning);\n }\n}\nfunction fixObjectPropertiesInPlace(objs, forceRemoveRid) {\n for (const obj of objs) {\n if (forceRemoveRid) {\n delete obj.__rid;\n }\n if (obj.__rid) {\n obj.$rid = obj.__rid;\n delete obj.__rid;\n }\n if (obj.__score) {\n obj.$score = obj.__score;\n delete obj.__score;\n }\n\n // Backend returns as __apiName but we want to stick to $ structure\n obj.$apiName ??= obj.__apiName;\n\n // for now these are the same but when we start doing interface projections the $objectType will always be underlying and\n // the $apiName will be for the current view (in current designs)\n obj.$objectType = obj.$apiName;\n\n // copying over for now as its always returned. In the future, this should just be inferred from underlying\n obj.$primaryKey ??= obj.__primaryKey;\n obj.$title ??= obj.__title;\n\n // we don't want people to use these\n delete obj.__apiName;\n delete obj.__primaryKey;\n delete obj.__title;\n }\n}\n\n/**\n * Converts interfaceToObjectTypeMappingsV2 format to the V1 format.\n * V2 format: { interfaceProp: { type: \"localPropertyImplementation\", propertyApiName: \"objectProp\" } }\n * V1 format: { interfaceProp: \"objectProp\" }\n */\nfunction convertInterfaceToObjectTypeMappingsV2ToV1(mappingsV2) {\n return Object.fromEntries(Object.entries(mappingsV2).map(([interfaceApiName, objectTypeMappingsV2]) => [interfaceApiName, Object.fromEntries(Object.entries(objectTypeMappingsV2).map(([objectTypeName, propertyMappings]) => [objectTypeName, Object.fromEntries(Object.entries(propertyMappings).filter(([, impl]) => impl.type === \"localPropertyImplementation\").map(([interfaceProp, impl]) => [interfaceProp, impl.propertyApiName]))]))]));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A simple cache that can be used to store values for a given client.\n */\n\n/**\n * @internal\n * A simple async cache that can be used to store values for a given client.\n */\n\n/** @internal */\n\n/**\n * @internal\n * Create a new cache without a factory function.\n */\n\n/**\n * @internal\n * Create a new cache with a factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n */\n\nexport function createClientCache(fn) {\n const cache = new WeakMap();\n function get(client, key) {\n if (cache.get(client.clientCacheKey) == null) {\n cache.set(client.clientCacheKey, new Map());\n }\n const r = cache.get(client.clientCacheKey).get(key);\n if (r === undefined && fn !== undefined) {\n return set(client, key, fn(client, key));\n } else {\n return r;\n }\n }\n function set(client, key, value) {\n if (cache.get(client.clientCacheKey) == null) {\n cache.set(client.clientCacheKey, new Map());\n }\n cache.get(client.clientCacheKey).set(key, value);\n return value;\n }\n function remove(client, key) {\n if (cache.get(client.clientCacheKey) == null) return false;\n return cache.get(client.clientCacheKey).delete(key);\n }\n return {\n get,\n set,\n remove\n };\n}\n\n/** @internal */\n\n/**\n * @internal\n * Create a new cache with an async factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n * @returns\n */\nexport function createAsyncClientCache(fn, createCacheLocal = createClientCache) {\n const cache = createCacheLocal();\n const inProgress = createCacheLocal();\n const ret = {\n getOrUndefined: function getOrUndefined(client, key) {\n return cache.get(client, key);\n },\n get: async function get(client, key) {\n return cache.get(client, key) ?? inProgress.get(client, key) ?? ret.set(client, key, fn(client, key));\n },\n set: async function set(client, k, v) {\n // the `.set` happens first to prevent races.\n try {\n const r = await inProgress.set(client, k, v); // returns v\n\n cache.set(client, k, r);\n inProgress.remove(client, k);\n return r;\n } catch (e) {\n // we don't want to cache failures\n inProgress.remove(client, k);\n throw e;\n }\n }\n };\n return ret;\n}","/*\n * 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 deepFreeze(obj) {\n Object.getOwnPropertyNames(obj).forEach(name => {\n const prop = obj[name];\n if (typeof prop === \"object\" && prop != null && !Object.isFrozen(prop)) {\n deepFreeze(prop);\n }\n });\n return Object.freeze(obj);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _list = [0, \"/v2/ontologies/{0}/actionTypes\", 2];\n/**\n * Lists the action types for the given Ontology.\n *\n * Each page may be smaller than the requested page size. However, it is guaranteed that if there are more\n * results available, at least one result will be present in the response.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes\n */\nexport function list($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _list, ...args);\n}\nconst _get = [0, \"/v2/ontologies/{0}/actionTypes/{1}\", 2];\n/**\n * Gets a specific action type with the given API name.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes/{actionType}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/ontologies/{0}/actionTypes/byRid/{1}\", 2];\n/**\n * Gets a specific action type with the given RID.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes/byRid/{actionTypeRid}\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/ontologies/{0}/actionTypes/getByRidBatch\", 3];\n/**\n * Gets a list of action types by RID in bulk.\n *\n * Action types are filtered from the response if they don't exist or the requesting token lacks the required\n * permissions.\n *\n * The maximum batch size for this endpoint is 100.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\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 * as ActionTypesV2 from \"@osdk/foundry.ontologies/ActionTypeV2\";\nexport async function loadActionMetadata(client, actionType) {\n const r = await ActionTypesV2.get(client, await client.ontologyRid, actionType, {\n branch: client.branch\n });\n const {\n wireActionTypeV2ToSdkActionMetadata\n } = await import(\"@osdk/generator-converters\");\n return wireActionTypeV2ToSdkActionMetadata(r);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _list = [0, \"/v2/ontologies/{0}/objectTypes\", 2];\n/**\n * Lists the object types for the given Ontology.\n *\n * Each page may be smaller or larger than the requested page size. However, it is guaranteed that if there are\n * more results available, at least one result will be present in the\n * response.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes\n */\nexport function list($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _list, ...args);\n}\nconst _get = [0, \"/v2/ontologies/{0}/objectTypes/{1}\", 2];\n/**\n * Gets a specific object type with the given API name.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getFullMetadata = [0, \"/v2/ontologies/{0}/objectTypes/{1}/fullMetadata\", 2];\n/**\n * Gets the full metadata for a specific object type with the given API name.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/fullMetadata\n */\nexport function getFullMetadata($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getFullMetadata, ...args);\n}\nconst _getEditsHistory = [1, \"/v2/ontologies/{0}/objectTypes/{1}/editsHistory\", 3];\n/**\n * Returns the history of edits (additions, modifications, deletions) for objects of a\n * specific object type. This endpoint provides visibility into all actions that have\n * modified objects of this type.\n *\n * The edits are returned in reverse chronological order (most recent first) by default.\n *\n * Note that filters are ignored for OSv1 object types.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/editsHistory\n */\nexport function getEditsHistory($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getEditsHistory, ...args);\n}\nconst _listOutgoingLinkTypes = [0, \"/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes\", 2];\n/**\n * List the outgoing links for an object type.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/outgoingLinkTypes\n */\nexport function listOutgoingLinkTypes($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _listOutgoingLinkTypes, ...args);\n}\nconst _getOutgoingLinkType = [0, \"/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes/{2}\", 2];\n/**\n * Get an outgoing link for an object type.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/outgoingLinkTypes/{linkType}\n */\nexport function getOutgoingLinkType($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);\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 * as ObjectTypesV2 from \"@osdk/foundry.ontologies/ObjectTypeV2\";\nexport async function loadFullObjectMetadata(client, objectType) {\n const full = await ObjectTypesV2.getFullMetadata(client, await client.ontologyRid, objectType, {\n preview: true,\n branch: client.branch\n });\n const {\n wireObjectTypeFullMetadataToSdkObjectMetadata\n } = await import(\"@osdk/generator-converters\");\n const ret = wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);\n return {\n ...ret\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 * as OntologyInterfaces from \"@osdk/foundry.ontologies/OntologyInterface\";\nexport async function loadInterfaceMetadata(client, objectType) {\n const r = await OntologyInterfaces.get(client, await client.ontologyRid, objectType, {\n preview: true,\n branch: client.branch\n });\n const {\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition\n } = await import(\"@osdk/generator-converters\");\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _list = [0, \"/v2/ontologies/{0}/queryTypes\", 2];\n/**\n * Lists the query types for the given Ontology.\n *\n * Each page may be smaller than the requested page size. However, it is guaranteed that if there are more\n * results available, at least one result will be present in the response.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queryTypes\n */\nexport function list($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _list, ...args);\n}\nconst _get = [0, \"/v2/ontologies/{0}/queryTypes/{1}\", 2];\n/**\n * Gets a specific query type with the given API name.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queryTypes/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\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 * as QueryTypes from \"@osdk/foundry.ontologies/QueryType\";\nexport async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {\n const [apiName, version] = queryTypeApiNameAndVersion.split(\":\");\n const r = await QueryTypes.get(client, await client.ontologyRid, apiName, {\n version\n });\n const {\n wireQueryTypeV2ToSdkQueryMetadata\n } = await import(\"@osdk/generator-converters\");\n return wireQueryTypeV2ToSdkQueryMetadata(r);\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 { createAsyncClientCache } from \"../object/Cache.js\";\nimport { deepFreeze } from \"../util/deepFreeze.js\";\nimport { loadActionMetadata } from \"./loadActionMetadata.js\";\nimport { loadFullObjectMetadata } from \"./loadFullObjectMetadata.js\";\nimport { loadInterfaceMetadata } from \"./loadInterfaceMetadata.js\";\nimport { loadQueryMetadata } from \"./loadQueryMetadata.js\";\nimport { InterfaceDefinitions } from \"./OntologyProvider.js\";\nexport const createStandardOntologyProviderFactory = client => {\n return client => {\n async function loadObject(client, key) {\n const objectDef = await loadFullObjectMetadata(client, key);\n\n // ensure we have all of the interfaces loaded\n const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map(i => ret.getInterfaceDefinition(i)) ?? [])).map(i => [i.apiName, {\n def: i,\n handler: undefined\n }]));\n const fullObjectDef = {\n ...objectDef,\n [InterfaceDefinitions]: interfaceDefs\n };\n return deepFreeze(fullObjectDef);\n }\n async function loadInterface(client, key) {\n return deepFreeze(await loadInterfaceMetadata(client, key));\n }\n async function loadQuery(client, key) {\n return loadQueryMetadata(client, key);\n }\n async function loadAction(client, key) {\n const r = await loadActionMetadata(client, key);\n return r;\n }\n function makeGetter(fn) {\n const cache = createAsyncClientCache((client, key) => fn(client, key, false));\n return async apiName => {\n return await cache.get(client, apiName);\n };\n }\n function makeQueryGetter(client, fn) {\n const queryCache = createAsyncClientCache((client, key) => {\n return fn(client, key);\n });\n return async (apiName, version) => {\n const key = version ? `${apiName}:${version}` : apiName;\n return await queryCache.get(client, key);\n };\n }\n const ret = {\n getObjectDefinition: makeGetter(loadObject),\n getInterfaceDefinition: makeGetter(loadInterface),\n getActionDefinition: makeGetter(loadAction),\n getQueryDefinition: makeQueryGetter(client, loadQuery)\n };\n return ret;\n };\n};","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT = `osdk-observable-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 { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport { convertWireToOsdkObjects, convertWireToOsdkObjects2 } from \"./object/convertWireToOsdkObjects.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport { createStandardOntologyProviderFactory } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n\n/** @internal */\nexport function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n } catch (e) {\n const hint = !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\") ? \". Did you forget to add 'http://' or 'https://'?\" : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const processedBaseUrl = new URL(baseUrl);\n processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith(\"/\") ? \"\" : \"/\";\n const minimalClient = {\n ...createSharedClientContext(processedBaseUrl.toString(), tokenProvider, USER_AGENT, fetchFn),\n objectSetFactory,\n objectFactory: convertWireToOsdkObjects,\n objectFactory2: convertWireToOsdkObjects2,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger,\n transactionId: options.transactionId,\n clientCacheKey: {},\n requestContext: {},\n branch: options.branch,\n narrowTypeInterfaceOrObjectMapping: {}\n };\n return Object.freeze(Object.assign(minimalClient, {\n ontologyProvider: createOntologyProviderFactory(options)(minimalClient)\n }));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InterfaceDefinitions } from \"./ontology/OntologyProvider.js\";\n\n/** @internal */\nexport const fetchMetadataInternal = async (client, definition) => {\n if (definition.type === \"object\") {\n const {\n [InterfaceDefinitions]: interfaceDefs,\n ...objectTypeDef\n } = await client.ontologyProvider.getObjectDefinition(definition.apiName);\n return objectTypeDef;\n } else if (definition.type === \"interface\") {\n return client.ontologyProvider.getInterfaceDefinition(definition.apiName);\n } else if (definition.type === \"action\") {\n return client.ontologyProvider.getActionDefinition(definition.apiName);\n } else if (definition.type === \"query\") {\n return client.ontologyProvider.getQueryDefinition(definition.apiName, definition.isFixedVersion ? definition.version : undefined);\n } else {\n throw new Error(\"Not implemented for given definition\");\n }\n};","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _execute = [1, \"/v2/ontologies/{0}/queries/{1}/execute\", 7];\n/**\n * Executes a Query using the given parameters. By default, the latest version of the Query is executed.\n *\n * Optional parameters do not need to be supplied.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\n/**\n * @internal\n * Creates a Media object from a MediaReference for query results.\n * Unlike MediaReferencePropertyImpl, this doesn't require object context\n * and directly accesses the media set APIs. This is intended for MediaReferences returned\n * from query results or to be used by the functions runtime,\n */\nexport function createMediaFromReference(client, mediaReference) {\n const {\n mediaSetRid,\n mediaItemRid\n } = mediaReference.reference.mediaSetViewItem;\n const token = mediaReference.reference.mediaSetViewItem.token;\n return {\n async fetchContents() {\n return MediaSets.read(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n },\n async fetchMetadata() {\n const metadata = await MediaSets.metadata(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n const info = await MediaSets.info(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n return {\n path: info.path,\n sizeBytes: metadata.sizeBytes,\n mediaType: undefined // Media type is not currently returned by the API, so we return undefined here. This can be updated when the API returns media type.\n };\n },\n getMediaReference() {\n return mediaReference;\n }\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport * as Attachments from \"@osdk/foundry.ontologies/Attachment\";\nimport { isAttachmentFile, isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMedia, isMediaReference, isMediaUpload } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceQueryParam, isInterfaceSpecifier } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { extractPrimaryKeyFromObjectSpecifier } from \"./objectSpecifierUtils.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 * @internal\n */\nexport async function toDataValueQueries(value, client, desiredType) {\n if (value == null) {\n return value;\n }\n if (Array.isArray(value) && desiredType.type === \"array\") {\n const values = Array.from(value);\n if (values.some(dataValue => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValueQueries(value, client, desiredType));\n }\n return converted;\n }\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType.array));\n return Promise.all(promiseArray);\n }\n switch (desiredType.type) {\n case \"attachment\":\n {\n if (isAttachmentUpload(value)) {\n const attachment = await Attachments.upload(client, value.data, {\n filename: value.name\n });\n return attachment.rid;\n }\n if (isAttachmentFile(value)) {\n const attachment = await Attachments.upload(client, value, {\n filename: value.name\n });\n return attachment.rid;\n }\n\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"threeDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"mediaReference\":\n {\n if (isMediaUpload(value)) {\n const mediaRef = await MediaSets.uploadMedia(client, value.data, {\n filename: value.fileName,\n preview: true\n });\n return mediaRef;\n }\n if (isMedia(value)) {\n return value.getMediaReference();\n }\n if (isMediaReference(value)) {\n return value;\n }\n throw new Error(\"Expected media reference type but got value that is not a MediaReference or MediaUpload\");\n }\n case \"set\":\n {\n if (value instanceof Set) {\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType[\"set\"]));\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\":\n {\n if (isObjectSpecifiersObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"interface\":\n {\n if (isInterfaceSpecifier(value) || isInterfaceQueryParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey\n };\n }\n }\n case \"objectSet\":\n case \"interfaceObjectSet\":\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 break;\n }\n case \"map\":\n {\n if (typeof value === \"object\") {\n const entrySet = [];\n for (const [key, mapValue] of Object.entries(value)) {\n entrySet.push({\n key: desiredType.keyType.type === \"object\" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),\n value: await toDataValueQueries(mapValue, client, desiredType.valueType)\n });\n }\n return entrySet;\n }\n break;\n }\n case \"struct\":\n {\n if (typeof value === \"object\") {\n const structMap = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(structValue, client, desiredType[\"struct\"][key]);\n }\n return structMap;\n }\n }\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\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 * as Queries from \"@osdk/foundry.ontologies/Query\";\nimport invariant from \"tiny-invariant\";\nimport { createMediaFromReference } from \"../createMediaFromReference.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { createObjectSpecifierFromInterfaceSpecifier, createObjectSpecifierFromPrimaryKey } from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nexport async function applyQuery(client, query, params) {\n // We fire and forget so if a function has no parameters we don't unnecessarily load all metadata\n const qd = client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Queries.execute(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyQuery\"\n })), query), await client.ontologyRid, query.apiName, {\n parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}\n }, {\n version: query.isFixedVersion ? query.version : undefined,\n transactionId: client.transactionId,\n branch: client.branch\n });\n const objectOutputDefs = await getRequiredDefinitions((await qd).output, client);\n const remappedResponse = await remapQueryResponse(client, (await qd).output, response.value, objectOutputDefs);\n return remappedResponse;\n}\nasync function remapQueryParams(params, client, paramTypes) {\n const parameterMap = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(value, client, paramTypes[key]);\n }\n return parameterMap;\n}\nasync function remapQueryResponse(client, responseDataType, responseValue, definitions) {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n switch (responseDataType.type) {\n case \"union\":\n {\n throw new Error(\"Union return types are not yet supported\");\n }\n case \"array\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.array, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"set\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.set, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"attachment\":\n {\n return hydrateAttachmentFromRidInternal(client, responseValue);\n }\n case \"mediaReference\":\n {\n return createMediaFromReference(client, responseValue);\n }\n case \"object\":\n {\n const def = definitions.get(responseDataType.object);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${responseDataType.object}`);\n }\n return createQueryObjectResponse(responseValue, def);\n }\n case \"interface\":\n {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(`Missing definition for ${responseDataType.interface}`);\n }\n return createQueryInterfaceResponse(responseValue, def);\n }\n case \"objectSet\":\n {\n const def = definitions.get(responseDataType.objectSet);\n if (!def) {\n throw new Error(`Missing definition for ${responseDataType.objectSet}`);\n }\n if (typeof responseValue === \"string\") {\n return createObjectSet(def, client, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: responseDataType.objectSet\n }, {\n type: \"reference\",\n reference: responseValue\n }]\n });\n }\n return createObjectSet(def, client, responseValue);\n }\n case \"struct\":\n {\n // figure out what keys need to be fixed up\n for (const [key, subtype] of Object.entries(responseDataType.struct)) {\n if (requiresConversion(subtype) || responseValue[key] == null) {\n responseValue[key] = await remapQueryResponse(client, subtype, responseValue[key], definitions);\n }\n }\n return responseValue;\n }\n case \"map\":\n {\n const map = {};\n !Array.isArray(responseValue) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected array entry\") : invariant(false) : void 0;\n for (const entry of responseValue) {\n !(entry.key != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected key\") : invariant(false) : void 0;\n !(entry.value != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected value\") : invariant(false) : void 0;\n const key = responseDataType.keyType.type === \"object\" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;\n const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);\n map[key] = value;\n }\n return map;\n }\n case \"twoDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n value\n } of responseValue.groups) {\n result.push({\n key,\n value\n });\n }\n return result;\n }\n case \"threeDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n groups\n } of responseValue.groups) {\n const subResult = [];\n for (const {\n key: subKey,\n value\n } of groups) {\n subResult.push({\n key: subKey,\n value\n });\n }\n result.push({\n key,\n groups: subResult\n });\n }\n return result;\n }\n }\n return responseValue;\n}\nasync function getRequiredDefinitions(dataType, client) {\n const result = new Map();\n switch (dataType.type) {\n case \"objectSet\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.objectSet);\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"interfaceObjectSet\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.objectSet);\n result.set(dataType.objectSet, interfaceDef);\n break;\n }\n case \"object\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.object);\n result.set(dataType.object, objectDef);\n break;\n }\n case \"interface\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.interface);\n result.set(dataType.interface, interfaceDef);\n break;\n }\n case \"set\":\n {\n return getRequiredDefinitions(dataType.set, client);\n }\n case \"array\":\n {\n return getRequiredDefinitions(dataType.array, client);\n }\n case \"map\":\n {\n const types = [dataType.keyType, dataType.valueType];\n const allDefs = await Promise.all(types.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"struct\":\n {\n const structValues = Object.values(dataType.struct);\n const allDefs = await Promise.all(structValues.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"mediaReference\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"union\":\n break;\n default:\n {\n const _ = dataType;\n break;\n }\n }\n return result;\n}\nfunction requiresConversion(dataType) {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return false;\n case \"union\":\n return true;\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n case \"set\":\n return requiresConversion(dataType.set);\n case \"attachment\":\n case \"mediaReference\":\n case \"objectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n return true;\n default:\n return false;\n }\n}\nfunction getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {\n const def = definitions.get(objectTypeApiName);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${objectTypeApiName}`);\n }\n return createObjectSpecifierFromPrimaryKey(def, primaryKey);\n}\nexport function createQueryObjectResponse(primaryKey, objectDef) {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)\n };\n}\nexport function createQueryInterfaceResponse(interfaceSpecifier, interfaceDef) {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier)\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 { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"@osdk/api/unstable\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { MinimalLogger } from \"./logger/MinimalLogger.js\";\nimport { fetchPage, fetchStaticRidPage } from \"./object/fetchPage.js\";\nimport { fetchSingle } from \"./object/fetchSingle.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\n\n// We import it this way to keep compatible with CJS. If we referenced the\n// value of `symbolClientContext` directly, then we would have to a dynamic import\n// in `createClientInternal` which would make it async and a break.\n// Since this is just a string in `@osdk/shared.client2` instead of a symbol,\n// we can safely perform this trick.\n\nclass ActionInvoker {\n constructor(clientCtx, actionDef) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n}\nclass QueryInvoker {\n constructor(clientCtx, queryDef) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n}\n\n/** @internal */\nexport function createClientInternal(objectSetFactory, transactionRid, flushEdits, baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n if (typeof ontologyRid === \"string\") {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ontologyRid.then(ontologyRid => {\n if (!ontologyRid.startsWith(\"ri.\")) {\n // FIXME this promise is not await so this just shows up as an unhandled promise rejection\n throw new Error(\"Invalid ontology RID\");\n }\n });\n }\n const clientCtx = createMinimalClient({\n ontologyRid\n }, baseUrl, tokenProvider, {\n ...options,\n logger: options?.logger ?? new MinimalLogger(),\n transactionId: transactionRid,\n flushEdits,\n branch: options?.UNSTABLE_DO_NOT_USE_BRANCH\n }, fetchFn, objectSetFactory);\n return createClientFromContext(clientCtx);\n}\n\n/**\n * @internal\n */\nexport function createClientFromContext(clientCtx) {\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n return clientCtx.objectSetFactory(o, clientCtx);\n } else if (o.type === \"action\") {\n return new ActionInvoker(clientCtx, o); // then as any for dealing with the conditional return value\n } else if (o.type === \"query\") {\n return new QueryInvoker(clientCtx, o);\n } else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: async function* (objs, linkTypes) {\n const {\n createBulkLinksAsyncIterFactory\n } = await import(\"./__unstable/createBulkLinksAsyncIterFactory.js\");\n yield* createBulkLinksAsyncIterFactory(clientCtx)(objs, linkTypes);\n }\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:\n return {\n fetchOneByRid: async (objectType, rid, options) => {\n return await fetchSingle(clientCtx, objectType, options, createWithRid([rid]));\n }\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:\n return {\n createMediaReference: async args => {\n const {\n data,\n fileName,\n objectType,\n propertyType\n } = args;\n const {\n upload\n } = await import(\"@osdk/foundry.ontologies/MediaReferenceProperty\");\n return await upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {\n mediaItemPath: fileName,\n preview: true\n });\n }\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:\n return {\n fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {\n return await fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));\n },\n fetchPageByRidNoType: async (rids, options) => {\n return await fetchStaticRidPage(clientCtx, rids, options ?? {});\n }\n };\n }\n throw new Error(\"not implemented\");\n } else {\n throw new Error(\"not implemented\");\n }\n }\n const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);\n const symbolClientContext = \"__osdkClientContext\";\n const client = Object.defineProperties(clientFn, {\n [oldSymbolClientContext]: {\n value: clientCtx\n },\n [symbolClientContext]: {\n value: clientCtx\n },\n [additionalContext]: {\n value: clientCtx\n },\n fetchMetadata: {\n value: fetchMetadata\n }\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet, undefined, undefined);\nexport const createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(createObjectSet, transactionRid, flushEdits, ...args);\nfunction createWithRid(rids) {\n const withRid = {\n type: \"static\",\n \"objects\": rids\n };\n return withRid;\n}"]}
1
+ {"version":3,"sources":["../../src/actions/ActionValidationError.ts","../../src/object/AttachmentUpload.ts","../../src/util/objectSpecifierUtils.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js","../../../../node_modules/.pnpm/@osdk+foundry.mediasets@2.50.0/node_modules/@osdk/foundry.mediasets/build/esm/public/MediaSet.js","../../src/object/mediaUpload.ts","../../src/util/interfaceUtils.ts","../../src/util/isObjectSpecifiersObject.ts","../../src/util/isOntologyObjectV2.ts","../../src/util/isPoint.ts","../../src/util/toDataValue.ts","../../src/actions/applyAction.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js","../../src/util/streamutils.ts","../../src/util/timeseriesUtils.ts","../../src/createGeotimeSeriesProperty.ts","../../src/createMediaReferenceProperty.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js","../../src/createTimeseriesProperty.ts","../../src/object/formatting/formatBoolean.ts","../../src/object/formatting/propertyFormattingUtils.ts","../../src/object/formatting/formatDateTime.ts","../../src/object/formatting/formatNumber.ts","../../src/object/formatting/applyPropertyFormatter.ts","../../src/ontology/OntologyProvider.ts","../../src/object/convertWireToOsdkObjects/InternalSymbols.ts","../../src/object/convertWireToOsdkObjects/getDollarLink.ts","../../src/object/convertWireToOsdkObjects/createOsdkInterface.ts","../../src/object/convertWireToOsdkObjects/getDollarAs.ts","../../src/object/convertWireToOsdkObjects/createOsdkObject.ts","../../src/object/convertWireToOsdkObjects.ts","../../src/object/Cache.ts","../../src/util/deepFreeze.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js","../../src/ontology/loadActionMetadata.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js","../../src/ontology/loadFullObjectMetadata.ts","../../src/ontology/loadInterfaceMetadata.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js","../../src/ontology/loadQueryMetadata.ts","../../src/ontology/StandardOntologyProvider.ts","../../src/util/UserAgent.ts","../../src/createMinimalClient.ts","../../src/fetchMetadata.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.50.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js","../../src/createMediaFromReference.ts","../../src/util/toDataValueQueries.ts","../../src/queries/applyQuery.ts","../../src/createClient.ts"],"names":["foundryPlatformFetch","__export","upload","value","isWireObjectSet","isObjectSet","getWireObjectSet","addUserAgentAndRequestContextHeaders","augmentRequestContext","TimeseriesDurationMapping","getMediaContent","getMediaMetadata","fetchSingle","fetchSingleWithErrors","extractNamespace","createSimpleCache","invariant","hydrateAttachmentFromRidInternal","get","_get","client","metadata","createObjectSet","createSharedClientContext","info","ontologyRid","MinimalLogger","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","fetchPage","fetchStaticRidPage","symbolClientContext","additionalContext"],"mappings":";;;;;;;;;;;;;;;;;AAgBa,IAAA,qBAAA,GAAN,cAAoC,KAAM,CAAA;AAAA,EAC/C,YAAY,UAAY,EAAA;AACtB,IAAA,KAAA,CAAM,uBAAuB,IAAK,CAAA,SAAA,CAAU,UAAY,EAAA,IAAA,EAAM,CAAC,CAAC,CAAA;AAChE,IAAA,IAAA,CAAK,UAAa,GAAA,UAAA;AAAA;AAEtB;;;ACLO,SAAS,mBAAmB,CAAG,EAAA;AACpC,EAAA,OAAO,OAAO,CAAM,KAAA,QAAA,IAAY,CAAK,IAAA,IAAA,IAAQ,UAAU,CAAK,IAAA,OAAO,CAAE,CAAA,IAAA,KAAS,YAAY,MAAU,IAAA,CAAA,IAAK,EAAE,IAAgB,YAAA,IAAA,IAAQ,EAAE,UAAc,IAAA,CAAA,CAAA;AACrJ;AACO,SAAS,iBAAiB,CAAG,EAAA;AAClC,EAAA,OAAO,OAAO,CAAA,KAAM,QAAY,IAAA,CAAA,YAAa,QAAQ,MAAU,IAAA,CAAA;AACjE;AACO,SAAS,sBAAA,CAAuB,MAAM,IAAM,EAAA;AACjD,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA;AAAA,GACF;AACF;;;ACHO,SAAS,mCAAA,CAAoC,WAAW,UAAY,EAAA;AACzE,EAAA,OAAO,CAAG,EAAA,SAAA,CAAU,OAAO,CAAA,CAA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,GAAG,IAAI;AAC7J,SAAS,cAAc,IAAM,EAAA;AAC3B,EAAA,MAAM,OAAU,GAAA;AAAA,IACd,IAAM,EAAA,QAAA;AAAA,IACN,SAAW,EAAA;AAAA,GACb;AACA,EAAO,OAAA,OAAA;AACT","file":"chunk-QA6ZDTCC.cjs","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 class ActionValidationError extends Error {\n constructor(validation) {\n super(\"Validation Error: \" + JSON.stringify(validation, null, 2));\n this.validation = validation;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isAttachmentUpload(o) {\n return typeof o === \"object\" && o != null && \"name\" in o && typeof o.name === \"string\" && \"data\" in o && o.data instanceof Blob && !(\"fileName\" in o);\n}\nexport function isAttachmentFile(o) {\n return typeof o === \"object\" && o instanceof Blob && \"name\" in o;\n}\nexport function createAttachmentUpload(data, name) {\n return {\n data,\n name\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {\n return `${objectDef.apiName}:${primaryKey}`;\n}\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier) {\n return `${interfaceSpecifier.objectTypeApiName}:${interfaceSpecifier.primaryKeyValue}`;\n}\n\n/**\n * Extracts the primary key from an ObjectSpecifier on an OSDK object.\n *\n * @param ObjectSpecifier\n * @returns A string representing the primary key\n */\nexport function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[1];\n}\n\n/**\n * Extracts the object type from an ObjectSpecifier on an OSDK object.\n *\n * @param ObjectSpecifier\n * @returns The object type extracted from the ObjectSpecifier\n */\nexport function extractObjectTypeFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[0];\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _apply = [1, \"/v2/ontologies/{0}/actions/{1}/apply\", 3];\n/**\n * Applies an action using the given parameters.\n *\n * Changes to objects or links stored in Object Storage V1 are eventually consistent and may take some time to be visible.\n * Edits to objects or links in Object Storage V2 will be visible immediately after the action completes.\n *\n * Note that a 200 HTTP status code only indicates that the request was received and processed by the server.\n * See the validation result in the response body to determine if the action was applied successfully.\n *\n * Note that [parameter default values](https://www.palantir.com/docs/foundry/action-types/parameters-default-value/) are not currently supported by\n * this endpoint.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/apply\n */\nexport function apply($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _apply, ...args);\n}\nconst _applyAsync = [1, \"/v2/ontologies/{0}/actions/{1}/applyAsync\", 3];\n/**\n * Applies an action using the given parameters.\n *\n * Changes to objects or links stored in Object Storage V1 are eventually consistent and may take some time to be visible.\n * Edits to objects or links in Object Storage V2 will be visible immediately after the action completes.\n *\n * Note that [parameter default values](https://www.palantir.com/docs/foundry/action-types/parameters-default-value/) are not currently supported by\n * this endpoint.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/applyAsync\n */\nexport function applyAsync($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _applyAsync, ...args);\n}\nconst _applyBatch = [1, \"/v2/ontologies/{0}/actions/{1}/applyBatch\", 3];\n/**\n * Applies multiple actions (of the same Action Type) using the given parameters.\n *\n * Changes to objects or links stored in Object Storage V1 are eventually consistent and may take some time to be visible.\n * Edits to objects or links in Object Storage V2 will be visible immediately after the action completes.\n *\n * Up to 20 actions may be applied in one call. Actions that only modify objects in Object Storage v2 and do not\n * call Functions may receive a higher limit.\n *\n * Note that [notifications](https://www.palantir.com/docs/foundry/action-types/notifications/) are not currently supported by this endpoint.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/applyBatch\n */\nexport function applyBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _applyBatch, ...args);\n}\nconst _applyWithOverrides = [1, \"/v2/ontologies/{0}/actions/{1}/applyWithOverrides\", 3];\n/**\n * Same as regular apply action operation, but allows specifying overrides for UniqueIdentifier and\n * CurrentTime generated action parameters.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/actions/{action}/applyWithOverrides\n */\nexport function applyWithOverrides($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _applyWithOverrides, ...args);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _abort = [1, \"/v2/mediasets/{0}/transactions/{1}/abort\", 2];\n/**\n * Aborts an open transaction. Items uploaded to the media set during this transaction will be deleted.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/abort\n */\nexport function abort($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _abort, ...args);\n}\nconst _calculate = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/calculate\", 6];\n/**\n * Starts calculation of a thumbnail for a given image.\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/calculate\n */\nexport function calculate($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _calculate, ...args);\n}\nconst _commit = [1, \"/v2/mediasets/{0}/transactions/{1}/commit\", 2];\n/**\n * Commits an open transaction. On success, items uploaded to the media set during this transaction will become available.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/commit\n */\nexport function commit($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _commit, ...args);\n}\nconst _create = [1, \"/v2/mediasets/{0}/transactions\", 2];\n/**\n * Creates a new transaction. Items uploaded to the media set while this transaction is open will not be reflected until the transaction is committed.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions\n */\nexport function create($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _create, ...args);\n}\nconst _info = [0, \"/v2/mediasets/{0}/items/{1}\", 6];\n/**\n * Gets information about the media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}\n */\nexport function info($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _info, ...args);\n}\nconst _metadata = [0, \"/v2/mediasets/{0}/items/{1}/metadata\", 6];\n/**\n * Gets detailed metadata about the media item, including type-specific information\n * such as dimensions for images, duration for audio/video, page count for documents, etc.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/metadata\n */\nexport function metadata($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _metadata, ...args);\n}\nconst _reference = [0, \"/v2/mediasets/{0}/items/{1}/reference\", 6];\n/**\n * Gets the [media reference](https://www.palantir.com/docs/foundry/data-integration/media-sets/#media-references) for this media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/reference\n */\nexport function reference($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _reference, ...args);\n}\nconst _getRidByPath = [0, \"/v2/mediasets/{0}/items/getRidByPath\", 2];\n/**\n * Returns the media item RID for the media item with the specified path.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/getRidByPath\n */\nexport function getRidByPath($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getRidByPath, ...args);\n}\nconst _getResult = [0, \"/v2/mediasets/{0}/items/{1}/transformationJobs/{2}/result\", 6,, \"*/*\"];\n/**\n * Gets the result of a completed transformation job. Returns the transformed media content as binary data.\n * This endpoint will return an error if the transformation job has not completed successfully.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transformationJobs/{transformationJobId}/result\n */\nexport function getResult($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getResult, ...args);\n}\nconst _getStatus = [0, \"/v2/mediasets/{0}/items/{1}/transformationJobs/{2}\", 6];\n/**\n * Gets the status of a transformation job.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transformationJobs/{transformationJobId}\n */\nexport function getStatus($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getStatus, ...args);\n}\nconst _upload = [1, \"/v2/mediasets/{0}/items\", 3, \"*/*\"];\n/**\n * Uploads a media item to an existing media set.\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * A branch name, or branch rid, or view rid may optionally be specified. If none is specified, the item will be uploaded to the default branch. If more than one is specified, an error is thrown.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/items\n */\nexport function upload($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _upload, ...args);\n}\nconst _read = [0, \"/v2/mediasets/{0}/items/{1}/content\", 6,, \"*/*\"];\n/**\n * Gets the content of a media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/content\n */\nexport function read($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _read, ...args);\n}\nconst _readOriginal = [0, \"/v2/mediasets/{0}/items/{1}/original\", 6,, \"*/*\"];\n/**\n * Gets the content of an original file uploaded to the media item, even if it was transformed on upload due to being an additional input format.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/original\n */\nexport function readOriginal($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _readOriginal, ...args);\n}\nconst _retrieve = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/retrieve\", 6,, \"*/*\"];\n/**\n * Retrieves a successfully calculated thumbnail for a given image.\n *\n * Thumbnails are 200px wide in the format of `image/webp`\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/retrieve\n */\nexport function retrieve($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _retrieve, ...args);\n}\nconst _transform = [1, \"/v2/mediasets/{0}/items/{1}/transform\", 7];\n/**\n * Initiates a transformation on a media item. Returns a job ID that can be used to check the status and retrieve\n * the result of the transformation.\n *\n * Transforming a media item requires that you are able to read the media item, either via `api:mediasets-read` or\n * via a `MediaItemReadToken`\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform\n */\nexport function transform($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _transform, ...args);\n}\nconst _uploadMedia = [2, \"/v2/mediasets/media/upload\", 7, \"*/*\"];\n/**\n * Uploads a temporary media item. If the media item isn't persisted within 1 hour, the item will be deleted.\n *\n * If multiple resources are attributed to, usage will be attributed to the first one in the list.\n *\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * Third-party applications using this endpoint via OAuth2 must request the following operation scopes: `api:ontologies-read api:ontologies-write`.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/mediasets/media/upload\n */\nexport function uploadMedia($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _uploadMedia, ...args);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isMedia(o) {\n return typeof o === \"object\" && o != null && typeof o.fetchMetadata === \"function\" && typeof o.fetchContents === \"function\" && typeof o.getMediaReference === \"function\";\n}\nexport function isMediaReference(o) {\n return typeof o === `object` && typeof o.mimeType === \"string\" && \"reference\" in o && typeof o.reference === \"object\" && o.reference.type === \"mediaSetViewItem\" && \"mediaSetViewItem\" in o.reference && typeof o.reference.mediaSetViewItem === \"object\" && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\nexport function isMediaUpload(o) {\n return typeof o === \"object\" && o != null && \"fileName\" in o && typeof o.fileName === \"string\" && \"data\" in o && typeof o.data === \"object\" && o.data instanceof Blob;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Type representing whether a definition is an object or interface */\n\n/** @internal */\nexport function getDefType(apiNameOrDef) {\n return typeof apiNameOrDef === \"string\" ? \"object\" : apiNameOrDef.type;\n}\n\n/** @internal */\nexport function isInterfaceActionParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceQueryParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceSpecifier(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o && o.$objectType !== o.$apiName;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isObjectSpecifiersObject(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\n/** @internal */\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\" && o.__primaryKey != null;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isPoint(o) {\n return o && typeof o === \"object\" && \"type\" in o && o.type === \"Point\" && \"coordinates\" in o && o.coordinates.length === 2;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport * as Attachments from \"@osdk/foundry.ontologies/Attachment\";\nimport { isAttachmentFile, isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMedia, isMediaReference, isMediaUpload } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceActionParam } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isPoint } from \"./isPoint.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 * @internal\n */\nexport async function toDataValue(value, client, actionMetadata) {\n if (value == null) {\n // typeof null is 'object' so do this first\n // Sending null over the wire clears the data, whereas undefined is dropped at request time.\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 const values = Array.from(value);\n if (values.some(dataValue => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValue(value, client, actionMetadata));\n }\n return converted;\n }\n const promiseArray = Array.from(value, async innerValue => await toDataValue(innerValue, client, actionMetadata));\n return Promise.all(promiseArray);\n }\n\n // For uploads, we need to upload ourselves first to get the RID of the attachment\n if (isAttachmentUpload(value)) {\n const attachment = await Attachments.upload(client, value.data, {\n filename: value.name\n });\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n if (isAttachmentFile(value)) {\n const attachment = await Attachments.upload(client, value, {\n filename: value.name\n });\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n if (isMediaUpload(value)) {\n const mediaRef = await MediaSets.uploadMedia(client, value.data, {\n filename: value.fileName,\n preview: true\n });\n return await toDataValue(mediaRef, client, actionMetadata);\n }\n if (isMedia(value)) {\n return value.getMediaReference();\n }\n if (isMediaReference(value)) {\n return value;\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return await toDataValue(value.__primaryKey, client, actionMetadata);\n }\n if (isObjectSpecifiersObject(value)) {\n return await toDataValue(value.$primaryKey, client, actionMetadata);\n }\n if (isPoint(value)) {\n return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);\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 if (isInterfaceActionParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey\n };\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(async (promisedAcc, [key, structValue]) => {\n const acc = await promisedAcc;\n acc[key] = await toDataValue(structValue, client, actionMetadata);\n return acc;\n }, Promise.resolve({}));\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp, object type reference\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 * as Actions from \"@osdk/foundry.ontologies/Action\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { toDataValue } from \"../util/toDataValue.js\";\nimport { ActionValidationError } from \"./ActionValidationError.js\";\nexport async function applyAction(client, action, parameters, options = {}) {\n const clientWithHeaders = addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyAction\"\n })), action);\n if (Array.isArray(parameters)) {\n const response = await Actions.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {\n requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],\n options: {\n returnEdits: options?.$returnEdits ? \"ALL\" : \"NONE\"\n }\n }, {\n branch: client.branch\n });\n const edits = response.edits;\n return options?.$returnEdits ? edits?.type === \"edits\" ? remapActionResponse(response) : edits : undefined;\n } else {\n const response = await Actions.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {\n parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),\n options: {\n mode: options?.$validateOnly ? \"VALIDATE_ONLY\" : \"VALIDATE_AND_EXECUTE\",\n returnEdits: options?.$returnEdits ? \"ALL_V2_WITH_DELETIONS\" : \"NONE\"\n }\n }, {\n branch: client.branch,\n transactionId: client.transactionId\n });\n if (options?.$validateOnly) {\n return response.validation;\n }\n if (response.validation && response.validation?.result === \"INVALID\") {\n const validation = response.validation;\n throw new ActionValidationError(validation);\n }\n const edits = response.edits;\n return options?.$returnEdits ? edits?.type === \"edits\" ? remapActionResponse(response) : edits : undefined;\n }\n}\nasync function remapActionParams(params, client, actionMetadata) {\n if (params == null) {\n return {};\n }\n const parameterMap = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValue(value, client, actionMetadata);\n }\n return parameterMap;\n}\nasync function remapBatchActionParams(params, client, actionMetadata) {\n const remappedParams = await Promise.all(params.map(async param => {\n return {\n parameters: await remapActionParams(param, client, actionMetadata)\n };\n }));\n return remappedParams;\n}\nexport function remapActionResponse(response) {\n const editResponses = response?.edits;\n if (editResponses?.type === \"edits\") {\n const remappedActionResponse = {\n type: editResponses.type,\n deletedLinksCount: editResponses.deletedLinksCount,\n deletedObjectsCount: editResponses.deletedObjectsCount,\n addedLinks: [],\n deletedLinks: [],\n addedObjects: [],\n deletedObjects: [],\n modifiedObjects: [],\n editedObjectTypes: []\n };\n const editedObjectTypesSet = new Set();\n for (const edit of editResponses.edits) {\n if (edit.type === \"addLink\" || edit.type === \"deleteLink\") {\n const osdkEdit = {\n linkTypeApiNameAtoB: edit.linkTypeApiNameAtoB,\n linkTypeApiNameBtoA: edit.linkTypeApiNameBtoA,\n aSideObject: edit.aSideObject,\n bSideObject: edit.bSideObject\n };\n edit.type === \"addLink\" ? remappedActionResponse.addedLinks.push(osdkEdit) : remappedActionResponse.deletedLinks?.push(osdkEdit);\n editedObjectTypesSet.add(edit.aSideObject.objectType);\n editedObjectTypesSet.add(edit.bSideObject.objectType);\n } else if (edit.type === \"addObject\" || edit.type === \"deleteObject\" || edit.type === \"modifyObject\") {\n const osdkEdit = {\n objectType: edit.objectType,\n primaryKey: edit.primaryKey\n };\n if (edit.type === \"addObject\") {\n remappedActionResponse.addedObjects.push(osdkEdit);\n } else if (edit.type === \"deleteObject\") {\n remappedActionResponse.deletedObjects?.push(osdkEdit);\n } else if (edit.type === \"modifyObject\") {\n remappedActionResponse.modifiedObjects.push(osdkEdit);\n }\n editedObjectTypesSet.add(edit.objectType);\n } else {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(`Unexpected edit type: ${JSON.stringify(edit)}`);\n }\n }\n }\n remappedActionResponse.editedObjectTypes = [...editedObjectTypesSet];\n return remappedActionResponse;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _getLatestValue = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/latestValue\", 2];\n/**\n * Get the latest value of a property backed by a timeseries. If a specific geotime series integration has both a history and a live integration, we will give precedence to the live integration.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{propertyName}/latestValue\n */\nexport function getLatestValue($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getLatestValue, ...args);\n}\nconst _streamValues = [1, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamValues\", 3,, \"*/*\"];\n/**\n * Stream all of the points of a time series property (this includes geotime series references).\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/streamValues\n */\nexport function streamValues($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamValues, ...args);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{\"data\":[`\nconst OBJECT_OPEN_CHAR_CODE = 123; // '{'\nconst OBJECT_CLOSE_CHAR_CODE = 125; // '}'\n\nexport async function* parseStreamedResponse(asyncIterable) {\n const utf8decoder = new TextDecoder(\"utf-8\");\n let parsedStart = false;\n let prevChunks = [];\n let openBracesCount = 0;\n for await (const chunk of asyncIterable) {\n // on the first chunk, skip the expected START_TOKEN if we see it\n let i = 0;\n if (!parsedStart) {\n parsedStart = true;\n if (startsWith(chunk, START_TOKEN)) {\n i = START_TOKEN.length;\n }\n }\n for (; i < chunk.length; i++) {\n // if we aren't currently parsing an object, skip until we find the next object start\n while (openBracesCount === 0 && chunk[i] !== OBJECT_OPEN_CHAR_CODE && i < chunk.length) {\n i++;\n }\n\n // iterate through the chunk looking for the end of the current top level object\n let j = i;\n for (; j < chunk.length; j++) {\n const c = chunk[j];\n if (c === OBJECT_OPEN_CHAR_CODE) {\n openBracesCount++;\n } else if (c === OBJECT_CLOSE_CHAR_CODE) {\n openBracesCount--;\n\n // found a complete top level object, emit it\n if (0 === openBracesCount) {\n yield combineAndParse(utf8decoder, prevChunks, chunk.subarray(i, j + 1));\n\n // if there was a prevChunk, we've consumed it now\n prevChunks = [];\n\n // advance the start index to the final '}' of the current object,\n // which lets us start seeking the beginning of the next object\n i = j;\n break;\n }\n }\n }\n\n // if we reached the end of our chunk before finding the end of the object\n // store off the relevant remainder of our current chunk and go grab the next one\n if (j === chunk.length) {\n prevChunks.push(chunk.subarray(i));\n break;\n }\n }\n }\n}\nfunction startsWith(a, b) {\n if (a.length < b.length) {\n return false;\n }\n for (let i = 0; i < b.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\nfunction combineAndParse(utf8decoder, prev, curr) {\n let str = \"\";\n for (const chunk of prev) {\n str += utf8decoder.decode(chunk, {\n stream: true\n });\n }\n str += utf8decoder.decode(curr);\n return JSON.parse(str);\n}\nexport async function* iterateReadableStream(readableStream) {\n let res = await readableStream.read();\n while (!res.done) {\n yield res.value;\n res = await readableStream.read();\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 { TimeseriesDurationMapping } from \"@osdk/api\";\nimport { iterateReadableStream, parseStreamedResponse } from \"./streamutils.js\";\nexport function getTimeRange(body) {\n if (\"$startTime\" in body || \"$endTime\" in body) {\n return {\n type: \"absolute\",\n startTime: body.$startTime,\n endTime: body.$endTime\n };\n }\n return body.$before ? {\n type: \"relative\",\n startTime: {\n when: \"BEFORE\",\n value: body.$before,\n unit: TimeseriesDurationMapping[body.$unit]\n }\n } : {\n type: \"relative\",\n endTime: {\n when: \"AFTER\",\n value: body.$after,\n unit: TimeseriesDurationMapping[body.$unit]\n }\n };\n}\nexport async function* asyncIterPointsHelper(iterator) {\n const reader = iterator.body?.getReader();\n for await (const point of parseStreamedResponse(iterateReadableStream(reader))) {\n yield {\n time: point.time,\n value: point.value\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 * as TimeSeriesValueBankProperties from \"@osdk/foundry.ontologies/TimeSeriesValueBankProperty\";\nimport { asyncIterPointsHelper, getTimeRange } from \"./util/timeseriesUtils.js\";\nexport class GeotimeSeriesPropertyImpl {\n #triplet;\n #client;\n constructor(client, objectApiName, primaryKey, propertyName, initialValue) {\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n if (initialValue != null) {\n this.lastFetchedValue = initialValue;\n }\n }\n async getLatestValue() {\n const latestPointPromise = TimeSeriesValueBankProperties.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n latestPointPromise.then(latestPoint => this.lastFetchedValue = latestPoint,\n // eslint-disable-next-line no-console\n err => void console.error(err));\n return latestPointPromise;\n }\n async getAllValues(query) {\n const allPoints = [];\n for await (const point of this.asyncIterValues(query)) {\n allPoints.push(point);\n }\n return allPoints;\n }\n async *asyncIterValues(query) {\n const streamPointsIterator = await TimeSeriesValueBankProperties.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {\n range: getTimeRange(query)\n } : {});\n for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {\n yield timeseriesPoint;\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 * as MediaReferenceProperties from \"@osdk/foundry.ontologies/MediaReferenceProperty\";\nexport class MediaReferencePropertyImpl {\n #mediaReference;\n #triplet;\n #client;\n constructor(args) {\n const {\n client,\n objectApiName,\n primaryKey,\n propertyName,\n mediaReference\n } = args;\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n this.#mediaReference = mediaReference;\n }\n async fetchContents() {\n return MediaReferenceProperties.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {\n preview: true // TODO: Can turn this back off when backend is no longer in beta.\n });\n }\n async fetchMetadata() {\n const r = await MediaReferenceProperties.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {\n preview: true // TODO: Can turn this back off when backend is no longer in beta.\n });\n return {\n path: r.path,\n sizeBytes: Number(r.sizeBytes),\n mediaType: r.mediaType\n };\n }\n getMediaReference() {\n return this.#mediaReference;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _getFirstPoint = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint\", 2];\n/**\n * Get the first point of a time series property.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/firstPoint\n */\nexport function getFirstPoint($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getFirstPoint, ...args);\n}\nconst _getLastPoint = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint\", 2];\n/**\n * Get the last point of a time series property.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/lastPoint\n */\nexport function getLastPoint($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getLastPoint, ...args);\n}\nconst _streamPoints = [1, \"/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamPoints\", 3,, \"*/*\"];\n/**\n * Stream all of the points of a time series property.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/streamPoints\n */\nexport function streamPoints($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamPoints, ...args);\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 * as TimeSeriesPropertiesV2 from \"@osdk/foundry.ontologies/TimeSeriesPropertyV2\";\nimport { asyncIterPointsHelper, getTimeRange } from \"./util/timeseriesUtils.js\";\nexport class TimeSeriesPropertyImpl {\n #triplet;\n #client;\n constructor(client, objectApiName, primaryKey, propertyName) {\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n }\n async getFirstPoint() {\n return TimeSeriesPropertiesV2.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n }\n async getLastPoint() {\n return TimeSeriesPropertiesV2.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n }\n async getAllPoints(query) {\n const allPoints = [];\n for await (const point of this.asyncIterPoints(query)) {\n allPoints.push(point);\n }\n return allPoints;\n }\n async *asyncIterPoints(query) {\n const streamPointsIterator = await TimeSeriesPropertiesV2.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {\n range: getTimeRange(query)\n } : {});\n for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {\n yield timeseriesPoint;\n }\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Formats a boolean value according to the specified formatting rule\n */\nexport function formatBoolean(value, rule) {\n return value ? rule.valueIfTrue : rule.valueIfFalse;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Resolves a property reference or string constant to its actual value\n */\n\nexport function resolvePropertyReference(ref, objectData) {\n if (ref.type === \"constant\") {\n return ref.value;\n } else if (ref.type === \"propertyType\") {\n const value = objectData[ref.propertyApiName];\n return value != null ? String(value) : undefined;\n }\n return undefined;\n}\n/**\n * Gets the browser's current locale\n */\nexport function getBrowserLocale() {\n if (typeof navigator !== \"undefined\" && navigator.language != null) {\n return navigator.language;\n }\n return \"en-US\";\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolvePropertyReference } from \"./propertyFormattingUtils.js\";\n\n/**\n * Formats a date/timestamp value according to the specified formatting rule\n */\nexport function formatDateTime(value, format, timezone, objectData, locale, userTimezoneOverride) {\n const date = value instanceof Date ? value : new Date(value);\n if (isNaN(date.getTime())) {\n return undefined;\n }\n const resolvedTimezone = resolveTimezone(timezone, objectData, userTimezoneOverride);\n switch (format.type) {\n case \"localizedFormat\":\n return formatLocalized(date, format, locale, resolvedTimezone);\n case \"stringFormat\":\n // TODO - pattern formatting\n return undefined;\n default:\n format;\n return undefined;\n }\n}\nconst INVALID_DATE_STRING = \"Invalid date or timezone\";\nfunction formatLocalized(date, format, locale, timezone) {\n if (format.format === \"DATE_FORMAT_ISO_INSTANT\") {\n return date.toISOString();\n }\n if (format.format === \"DATE_FORMAT_RELATIVE_TO_NOW\") {\n return formatRelativeToNow(date, locale, timezone);\n }\n const options = getLocalizedFormatOptions(format.format);\n try {\n return new Intl.DateTimeFormat(locale, timezone ? {\n ...options,\n timeZone: timezone\n } : options).format(date);\n } catch (_e) {\n // If a property reference is an invalid timezone we specifically say that it's invalid instead of returning undefined;\n return INVALID_DATE_STRING;\n }\n}\nfunction getLocalizedFormatOptions(format) {\n switch (format) {\n case \"DATE_FORMAT_DATE\":\n return FORMAT_DATE;\n case \"DATE_FORMAT_YEAR_AND_MONTH\":\n return FORMAT_YEAR_AND_MONTH;\n case \"DATE_FORMAT_DATE_TIME\":\n return FORMAT_DATE_TIME;\n case \"DATE_FORMAT_DATE_TIME_SHORT\":\n return FORMAT_DATE_TIME_SHORT;\n case \"DATE_FORMAT_TIME\":\n return FORMAT_TIME;\n default:\n format;\n return {};\n }\n}\nconst FORMAT_DATE = {\n day: \"numeric\",\n month: \"short\",\n weekday: \"short\",\n year: \"numeric\"\n};\nconst FORMAT_YEAR_AND_MONTH = {\n month: \"short\",\n year: \"numeric\"\n};\nconst FORMAT_DATE_TIME = {\n day: \"numeric\",\n month: \"short\",\n weekday: \"short\",\n year: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n};\nconst FORMAT_DATE_TIME_SHORT = {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\"\n};\nconst FORMAT_TIME = {\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n};\nconst DATE_TIME_SHORT_WITH_WEEKDAY = {\n day: \"numeric\",\n month: \"short\",\n weekday: \"short\",\n year: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\"\n};\nfunction resolveTimezone(timezone, objectData, userTimezoneOverride) {\n if (userTimezoneOverride != null) {\n return userTimezoneOverride;\n }\n if (timezone == null) {\n return undefined;\n }\n switch (timezone.type) {\n case \"user\":\n return undefined;\n case \"static\":\n return resolvePropertyReference(timezone.zoneId, objectData);\n default:\n timezone;\n return undefined;\n }\n}\nconst SECOND_MS = 1_000;\nconst MINUTE_MS = 60 * SECOND_MS;\nconst HOUR_MS = 60 * MINUTE_MS;\nconst DAY_MS = 24 * HOUR_MS;\nfunction formatRelativeToNow(date, locale, timezone) {\n const now = Date.now();\n const diff = date.valueOf() - now;\n const absDiff = Math.abs(diff);\n\n // More than 1 day - fall back to absolute date formatting\n if (absDiff >= DAY_MS) {\n const dtf = new Intl.DateTimeFormat(locale, {\n ...DATE_TIME_SHORT_WITH_WEEKDAY,\n timeZone: timezone\n });\n return dtf.format(date);\n }\n\n // Within 1 day - use relative formatting\n const rtf = new Intl.RelativeTimeFormat(locale, {\n numeric: \"auto\"\n });\n const units = [[\"hour\", HOUR_MS], [\"minute\", MINUTE_MS], [\"second\", SECOND_MS]];\n for (const [unit, ms] of units) {\n if (absDiff >= ms) {\n return rtf.format(Math.floor(diff / ms), unit);\n }\n }\n return rtf.format(0, \"second\");\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolvePropertyReference } from \"./propertyFormattingUtils.js\";\n\n/**\n * Extended NumberFormatOptions that includes rounding mode support\n * which is available in modern browsers but not yet in TypeScript types.\n * Only includes modes that are actually supported by Intl.NumberFormat and used in our API.\n */\n\n/**\n * Formats a number value according to the specified formatting rule\n */\nexport function formatNumber(value, numberType, objectData, locale) {\n switch (numberType.type) {\n case \"standard\":\n return formatStandardNumber(value, numberType.baseFormatOptions, locale);\n case \"fixedValues\":\n return numberType.values[value];\n case \"currency\":\n return formatCurrency(value, numberType, objectData, locale);\n case \"standardUnit\":\n return formatStandardUnit(value, numberType, objectData, locale);\n case \"customUnit\":\n return formatCustomUnit(value, numberType, objectData, locale);\n case \"affix\":\n return formatAffix(value, numberType, objectData, locale);\n case \"duration\":\n // TODO (duration is a bit more complex)\n return undefined;\n case \"scale\":\n return formatScale(value, numberType, locale);\n case \"ratio\":\n return formatRatio(value, numberType, locale);\n default:\n numberType;\n return undefined;\n }\n}\nfunction formatStandardNumber(value, options, locale) {\n return formatNumberWithAffixes(value, options, locale);\n}\nfunction formatCurrency(value, rule, objectData, locale) {\n const currencyCode = resolvePropertyReference(rule.currencyCode, objectData);\n if (currencyCode == null) {\n return formatStandardNumber(value, rule.baseFormatOptions, locale);\n }\n const options = {\n ...convertToIntlOptions(rule.baseFormatOptions),\n style: \"currency\",\n currency: currencyCode,\n currencyDisplay: rule.style === \"COMPACT\" ? \"narrowSymbol\" : \"symbol\"\n };\n return formatWithIntl(value, options, locale);\n}\nfunction formatStandardUnit(value, rule, objectData, locale) {\n const unit = resolvePropertyReference(rule.unit, objectData);\n if (unit == null) {\n return formatStandardNumber(value, rule.baseFormatOptions, locale);\n }\n const options = {\n ...convertToIntlOptions(rule.baseFormatOptions),\n style: \"unit\",\n unit: unit\n };\n try {\n return formatWithIntl(value, options, locale);\n } catch (error) {\n const suffix = ` ${unit}`;\n return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, \"\", suffix);\n }\n}\nfunction formatCustomUnit(value, rule, objectData, locale) {\n const unit = resolvePropertyReference(rule.unit, objectData);\n const suffix = unit != null ? ` ${unit}` : \"\";\n return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, \"\", suffix);\n}\nfunction formatAffix(value, rule, objectData, locale) {\n const prefix = rule.affix.prefix != null ? resolvePropertyReference(rule.affix.prefix, objectData) ?? \"\" : \"\";\n const suffix = rule.affix.postfix != null ? resolvePropertyReference(rule.affix.postfix, objectData) ?? \"\" : \"\";\n return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, prefix, suffix);\n}\n\n/**\n * Gets the scale divisor for a given scale type\n */\nfunction getScaleDivisor(scaleType) {\n switch (scaleType) {\n case \"THOUSANDS\":\n return 1e3;\n case \"MILLIONS\":\n return 1e6;\n case \"BILLIONS\":\n return 1e9;\n default:\n scaleType;\n throw new Error(`Unknown scale type: ${scaleType}`);\n }\n}\n\n/**\n * Extracts the localized compact suffix for a given scale.\n * Uses Intl.NumberFormat with compact notation to get the proper i18n suffix.\n */\nfunction getLocalizedCompactSuffix(scaleDivisor, locale) {\n const compactFormatter = new Intl.NumberFormat(locale, {\n notation: \"compact\",\n compactDisplay: \"short\"\n });\n const parts = compactFormatter.formatToParts(scaleDivisor);\n const compactPart = parts.find(p => p.type === \"compact\");\n return compactPart?.value ?? \"\";\n}\nfunction formatScale(value, rule, locale) {\n const scaleDivisor = getScaleDivisor(rule.scaleType);\n const scaledValue = value / scaleDivisor;\n const suffix = getLocalizedCompactSuffix(scaleDivisor, locale);\n return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, \"\", suffix);\n}\nfunction getRatioScaledValue(value, ratioType) {\n switch (ratioType) {\n case \"PERCENTAGE\":\n return value * 100;\n case \"PER_MILLE\":\n return value * 1000;\n case \"BASIS_POINTS\":\n return value * 10000;\n default:\n ratioType;\n throw new Error(`Unknown ratio type: ${ratioType}`);\n }\n}\nfunction formatRatio(value, rule, locale) {\n // Special case: PERCENTAGE uses Intl's native percent style\n if (rule.ratioType === \"PERCENTAGE\") {\n const options = {\n ...convertToIntlOptions(rule.baseFormatOptions),\n style: \"percent\"\n };\n return formatWithIntl(value, options, locale);\n }\n\n // Other ratio types: scale and add suffix\n const scaledValue = getRatioScaledValue(value, rule.ratioType);\n let suffix;\n switch (rule.ratioType) {\n case \"PER_MILLE\":\n suffix = \"‰\";\n break;\n case \"BASIS_POINTS\":\n suffix = \" bps\";\n break;\n default:\n rule.ratioType;\n throw new Error(`Unknown ratio type: ${rule.ratioType}`);\n }\n return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, \"\", suffix);\n}\n\n/**\n * Maps notation from OSDK format to Intl format\n */\nfunction mapNotation(notation) {\n switch (notation) {\n case \"STANDARD\":\n return \"standard\";\n case \"SCIENTIFIC\":\n return \"scientific\";\n case \"ENGINEERING\":\n return \"engineering\";\n case \"COMPACT\":\n return \"compact\";\n default:\n notation;\n }\n}\n\n/**\n * Maps rounding mode from OSDK format to Intl format\n */\nfunction mapRoundingMode(mode) {\n switch (mode) {\n case \"CEIL\":\n return \"ceil\";\n case \"FLOOR\":\n return \"floor\";\n case \"ROUND_CLOSEST\":\n return \"halfExpand\";\n default:\n mode;\n return undefined;\n }\n}\nfunction convertToIntlOptions(options) {\n return {\n useGrouping: options.useGrouping,\n minimumIntegerDigits: options.minimumIntegerDigits,\n minimumFractionDigits: options.minimumFractionDigits,\n maximumFractionDigits: options.maximumFractionDigits,\n minimumSignificantDigits: options.minimumSignificantDigits,\n maximumSignificantDigits: options.maximumSignificantDigits,\n notation: options.notation ? mapNotation(options.notation) : undefined,\n roundingMode: options.roundingMode ? mapRoundingMode(options.roundingMode) : undefined,\n convertNegativeToParenthesis: options.convertNegativeToParenthesis\n };\n}\n\n/**\n * Applies negative-to-parenthesis conversion if requested\n */\nfunction maybeConvertNegativeToParenthesis(formatted, value, shouldConvert) {\n if (shouldConvert && value < 0) {\n return formatted.replace(/^-/, \"(\") + \")\";\n }\n return formatted;\n}\n\n/**\n * Formats a number using Intl.NumberFormat with the given options\n */\nfunction formatWithIntl(value, options, locale) {\n const formatter = new Intl.NumberFormat(locale, options);\n const formatted = formatter.format(value);\n return maybeConvertNegativeToParenthesis(formatted, value, options.convertNegativeToParenthesis ?? false);\n}\n\n/**\n * Formats a number and optionally adds prefix/suffix\n */\nfunction formatNumberWithAffixes(value, baseOptions, locale, prefix, suffix) {\n const intlOptions = convertToIntlOptions(baseOptions);\n const formatted = formatWithIntl(value, intlOptions, locale);\n return `${prefix || \"\"}${formatted}${suffix || \"\"}`;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { formatBoolean } from \"./formatBoolean.js\";\nimport { formatDateTime } from \"./formatDateTime.js\";\nimport { formatNumber } from \"./formatNumber.js\";\nimport { getBrowserLocale } from \"./propertyFormattingUtils.js\";\n/**\n * Applies formatting rules to a property value and returns the formatted string value.\n *\n * @param propertyValue - The value of the property to format\n * @returns The formatted string value, or undefined if the property cannot be formatted\n *\n * @experimental This is a stub implementation that returns undefined.\n * The actual formatting logic will be implemented later.\n */\nexport function applyPropertyFormatter(propertyValue, propertyDefinition, objectData, options = {}) {\n if (propertyDefinition?.valueFormatting == null || propertyValue == null) {\n return undefined;\n }\n return formatPropertyValue(propertyValue, propertyDefinition.valueFormatting, objectData, options);\n}\nfunction formatPropertyValue(value, rule, objectData, options) {\n switch (rule.type) {\n case \"boolean\":\n if (typeof value !== \"boolean\") {\n return undefined;\n }\n return formatBoolean(value, rule);\n case \"number\":\n if (typeof value !== \"number\") {\n return undefined;\n }\n return formatNumber(value, rule.numberType, objectData, options.locale ?? getBrowserLocale());\n case \"date\":\n case \"timestamp\":\n if (typeof value !== \"string\") {\n return undefined;\n }\n return formatDateTime(new Date(value), rule.format, rule.type === \"timestamp\" ? rule.displayTimezone : undefined, objectData, options.locale ?? getBrowserLocale(), options.timezoneId);\n default:\n return undefined;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const InterfaceDefinitions = Symbol(process.env.MODE !== \"production\" ? \"InterfaceDefinitions\" : undefined);","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @internal */\nexport const UnderlyingOsdkObject = Symbol(process.env.MODE !== \"production\" ? \"Underlying Object\" : undefined);\n\n/** @internal */\nexport const ObjectDefRef = Symbol(process.env.MODE !== \"production\" ? \"ObjectDefinition\" : undefined);\n\n/** @internal */\nexport const InterfaceDefRef = Symbol(process.env.MODE !== \"production\" ? \"InterfaceDefinition\" : undefined);\n\n/** @internal */\nexport const ClientRef = Symbol(process.env.MODE !== \"production\" ? \"ClientRef\" : undefined);\n\n/** @internal */\nexport const PropertySecuritiesRef = Symbol(process.env.MODE !== \"production\" ? \"Property Securities\" : undefined);","/*\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 { getWireObjectSet } from \"../../objectSet/createObjectSet.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../fetchSingle.js\";\nimport { ClientRef, InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject } from \"./InternalSymbols.js\";\n/** @internal */\nexport function get$link(holder) {\n const client = holder[ClientRef];\n const objDef = holder[ObjectDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(Object.keys(objDef.links).map(linkName => {\n const linkDef = objDef.links[linkName];\n const objectSet = client.objectSetFactory(objDef, client).where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey\n }).pivotTo(linkName);\n const value = !linkDef.multiplicity ? {\n fetchOne: options => fetchSingle(client, objDef, options ?? {}, getWireObjectSet(objectSet)),\n fetchOneWithErrors: options => fetchSingleWithErrors(client, objDef, options ?? {}, getWireObjectSet(objectSet))\n } : objectSet;\n return [linkName, value];\n })));\n}\n\n/** @internal */\nexport function get$linkForInterface(holder) {\n const client = holder[UnderlyingOsdkObject][ClientRef];\n const objDef = holder[UnderlyingOsdkObject][ObjectDefRef];\n const interfaceDef = holder[InterfaceDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(Object.keys(interfaceDef.links).map(linkName => {\n const linkDef = interfaceDef.links[linkName];\n const objectSet = client.objectSetFactory(interfaceDef, client).intersect(client.objectSetFactory(objDef, client).where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey\n })).pivotTo(linkName);\n const value = !linkDef.multiplicity ? {\n fetchOne: options => fetchSingle(client, objDef, options ?? {}, getWireObjectSet(objectSet)),\n fetchOneWithErrors: options => fetchSingleWithErrors(client, objDef, options ?? {}, getWireObjectSet(objectSet))\n } : objectSet;\n return [linkName, value];\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 { extractNamespace } from \"../../internal/conversions/extractNamespace.js\";\nimport { get$linkForInterface } from \"./getDollarLink.js\";\nimport { InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject } from \"./InternalSymbols.js\";\n/** @internal */\nexport function createOsdkInterface(underlying, interfaceDef) {\n const [objApiNamespace] = extractNamespace(interfaceDef.apiName);\n return Object.freeze(Object.defineProperties({}, {\n // first to minimize hidden classes\n [UnderlyingOsdkObject]: {\n value: underlying\n },\n \"$apiName\": {\n value: interfaceDef.apiName,\n enumerable: true\n },\n \"$as\": {\n value: underlying.$as,\n enumerable: false\n },\n \"$objectType\": {\n value: underlying.$objectType,\n enumerable: \"$objectType\" in underlying\n },\n \"$primaryKey\": {\n value: underlying.$primaryKey,\n enumerable: \"$primaryKey\" in underlying\n },\n \"$objectSpecifier\": {\n value: underlying.$objectSpecifier,\n enumerable: \"$objectSpecifier\" in underlying\n },\n \"$title\": {\n value: underlying.$title,\n enumerable: \"$title\" in underlying\n },\n \"$rid\": {\n value: underlying.$rid,\n enumerable: \"$rid\" in underlying\n },\n \"$clone\": {\n value: clone,\n enumerable: false\n },\n \"$propertySecurities\": {\n value: underlying.$propertySecurities,\n enumerable: \"$propertySecurities\" in underlying\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata\": {\n value: {\n \"ObjectMetadata\": underlying[ObjectDefRef],\n \"InterfaceMetadata\": interfaceDef\n },\n enumerable: false\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue\": {\n value: underlying.$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue,\n enumerable: false\n },\n \"$link\": {\n get: function () {\n return get$linkForInterface(this);\n }\n },\n [InterfaceDefRef]: {\n value: interfaceDef\n },\n ...Object.fromEntries(Object.keys(interfaceDef.properties).map(p => {\n const objDef = underlying[ObjectDefRef];\n const [apiNamespace, apiName] = extractNamespace(p);\n const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];\n return [apiNamespace === objApiNamespace ? apiName : p, {\n enumerable: targetPropName in underlying,\n value: underlying[targetPropName]\n }];\n }))\n }));\n function clone(update) {\n if (update == null) {\n return underlying.$clone().$as(interfaceDef);\n }\n for (const key of Object.keys(update)) {\n if (!(key in interfaceDef.properties)) {\n throw new Error(`Invalid property ${key} for interface ${interfaceDef.apiName}`);\n }\n }\n const remappedProps = Object.fromEntries(Object.keys(update).map(p => mapProperty(p, update[p])).filter(x => x != null));\n return underlying.$clone(remappedProps).$as(interfaceDef);\n }\n function mapProperty(propertyName, value) {\n const objDef = underlying[ObjectDefRef];\n const targetPropName = objDef.interfaceMap[interfaceDef.apiName][propertyName];\n // If the underlying object does not implement the SPT, throw errors\n if (targetPropName == null) {\n throw new Error(`Cannot clone interface with ${propertyName} as property is not implemented by the underlying object type ${objDef.apiName}`);\n }\n return [targetPropName, value];\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 { InterfaceDefinitions } from \"../../ontology/OntologyProvider.js\";\nimport { createSimpleCache } from \"../SimpleCache.js\";\nimport { createOsdkInterface } from \"./createOsdkInterface.js\";\nimport { UnderlyingOsdkObject } from \"./InternalSymbols.js\";\n\n/** @internal */\n\nexport const get$as = createSimpleCache(new WeakMap(), $asFactory).get;\nconst osdkObjectToInterfaceView = createSimpleCache(new WeakMap(), () => new Map());\nfunction $asFactory(objDef) {\n // We use the exact same logic for both the interface rep and the underlying rep\n\n return function $as(targetMinDef) {\n let targetInterfaceApiName;\n if (typeof targetMinDef === \"string\") {\n if (targetMinDef === objDef.apiName) {\n return this[UnderlyingOsdkObject];\n }\n\n // this is sufficient to determine if we implement the interface\n if (objDef.interfaceMap?.[targetMinDef] == null) {\n throw new Error(`Object does not implement interface '${targetMinDef}'.`);\n }\n targetInterfaceApiName = targetMinDef;\n } else if (targetMinDef.apiName === objDef.apiName) {\n return this[UnderlyingOsdkObject];\n } else {\n if (targetMinDef.type === \"object\") {\n throw new Error(`'${targetMinDef.apiName}' is not an interface nor is it '${objDef.apiName}', which is the object type.`);\n }\n targetInterfaceApiName = targetMinDef.apiName;\n }\n const def = objDef[InterfaceDefinitions][targetInterfaceApiName];\n if (!def) {\n throw new Error(`Object does not implement interface '${targetInterfaceApiName}'.`);\n }\n const underlying = this[UnderlyingOsdkObject];\n const existing = osdkObjectToInterfaceView.get(underlying).get(targetInterfaceApiName)?.deref();\n if (existing) return existing;\n const osdkInterface = createOsdkInterface(underlying, def.def);\n osdkObjectToInterfaceView.get(underlying).set(targetInterfaceApiName, new WeakRef(osdkInterface));\n return osdkInterface;\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 invariant from \"tiny-invariant\";\nimport { GeotimeSeriesPropertyImpl } from \"../../createGeotimeSeriesProperty.js\";\nimport { MediaReferencePropertyImpl } from \"../../createMediaReferenceProperty.js\";\nimport { TimeSeriesPropertyImpl } from \"../../createTimeseriesProperty.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../../public-utils/hydrateAttachmentFromRid.js\";\nimport { createObjectSpecifierFromPrimaryKey } from \"../../util/objectSpecifierUtils.js\";\nimport { applyPropertyFormatter } from \"../formatting/applyPropertyFormatter.js\";\nimport { get$as } from \"./getDollarAs.js\";\nimport { get$link } from \"./getDollarLink.js\";\nimport { ClientRef, ObjectDefRef, PropertySecuritiesRef, UnderlyingOsdkObject } from \"./InternalSymbols.js\";\nconst specialPropertyTypes = new Set([\"attachment\", \"geotimeSeriesReference\", \"mediaReference\", \"numericTimeseries\", \"stringTimeseries\", \"sensorTimeseries\"]);\n\n// kept separate so we are not redefining these functions\n// every time an object is created.\nconst basePropDefs = {\n \"$as\": {\n get: function () {\n return get$as(this[ObjectDefRef]);\n }\n },\n \"$link\": {\n get: function () {\n return get$link(this);\n }\n },\n \"$clone\": {\n value: function (update) {\n // I think `rawObj` is the same thing as `this` and can be removed?\n const rawObj = this[UnderlyingOsdkObject];\n const def = this[ObjectDefRef];\n if (update == null) {\n return createOsdkObject(this[ClientRef], def, {\n ...rawObj\n });\n }\n if (def.primaryKeyApiName in update && rawObj[def.primaryKeyApiName] !== update[def.primaryKeyApiName]) {\n throw new Error(`Cannot update ${def.apiName} object with differing primary key values `);\n }\n if (def.titleProperty in update && !(\"$title\" in update)) {\n update.$title = update[def.titleProperty];\n }\n const newObject = {\n ...this[UnderlyingOsdkObject],\n ...update\n };\n return createOsdkObject(this[ClientRef], this[ObjectDefRef], newObject);\n }\n },\n \"$objectSpecifier\": {\n get: function () {\n const rawObj = this[UnderlyingOsdkObject];\n return createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);\n },\n enumerable: true\n },\n \"$propertySecurities\": {\n get: function () {\n return this[PropertySecuritiesRef];\n },\n enumerable: true\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata\": {\n get: function () {\n return {\n ObjectMetadata: this[ObjectDefRef]\n };\n },\n enumerable: false\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue\": {\n value: function (propertyApiName, options) {\n const rawObj = this[UnderlyingOsdkObject];\n const def = this[ObjectDefRef];\n const propertyValue = rawObj[propertyApiName];\n return applyPropertyFormatter(propertyValue, def.properties[propertyApiName], rawObj, options);\n },\n enumerable: false\n }\n};\n\n/**\n * @internal\n * @param client\n * @param objectDef\n * @param simpleOsdkProperties\n */\nexport function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}, wirePropertySecurities = []) {\n const {\n parsedObject,\n clientPropertySecurities\n } = parseWhenSecuritiesLoaded(wirePropertySecurities, simpleOsdkProperties, objectDef, derivedPropertyTypeByName);\n\n // updates the object's \"hidden class/map\".\n const rawObj = parsedObject;\n Object.defineProperties(rawObj, {\n [UnderlyingOsdkObject]: {\n enumerable: false,\n value: simpleOsdkProperties\n },\n [PropertySecuritiesRef]: {\n enumerable: false,\n value: clientPropertySecurities\n },\n [ObjectDefRef]: {\n value: objectDef,\n enumerable: false\n },\n // TODO: Potentially update when GA metadata field\n [ClientRef]: {\n value: client,\n enumerable: false\n },\n ...basePropDefs\n });\n\n // Assign the special values\n for (const propKey of Object.keys(rawObj)) {\n if (propKey in objectDef.properties && typeof objectDef.properties[propKey].type === \"string\" && specialPropertyTypes.has(objectDef.properties[propKey].type)) {\n rawObj[propKey] = createSpecialProperty(client, objectDef, rawObj, propKey);\n } else if (propKey in derivedPropertyTypeByName) {\n rawObj[propKey] = modifyRdpProperties(client, derivedPropertyTypeByName, rawObj[propKey], propKey);\n }\n }\n return Object.freeze(rawObj);\n}\nfunction modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKey) {\n if (derivedPropertyTypeByName[propKey].definition.type === \"selection\" && derivedPropertyTypeByName[propKey].definition.operation.type === \"count\") {\n const num = Number(rawValue);\n !Number.isSafeInteger(num) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Count aggregation for derived property \" + propKey + \" returned a value larger than safe integer.\") : invariant(false) : void 0;\n return num;\n } // Selected or collected properties need to be deserialized specially when constructed with RDP\n else if (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType != null && typeof derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type === \"string\" && specialPropertyTypes.has(derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type)) {\n switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {\n case \"attachment\":\n if (Array.isArray(rawValue)) {\n return rawValue.map(a => hydrateAttachmentFromRidInternal(client, a.rid));\n } else {\n return hydrateAttachmentFromRidInternal(client, rawValue.rid);\n }\n break;\n default:\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Derived property aggregations for Timeseries and Media are not supported\") : invariant(false) : void 0;\n }\n }\n return rawValue;\n}\nfunction createSpecialProperty(client, objectDef, rawObject, p) {\n const rawValue = rawObject[p];\n const propDef = objectDef.properties[p];\n if (process.env.NODE_ENV !== \"production\") {\n !(propDef != null && typeof propDef.type === \"string\" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n }\n if (propDef.type === \"attachment\") {\n if (Array.isArray(rawValue)) {\n return rawValue.map(a => hydrateAttachmentFromRidInternal(client, a.rid));\n }\n return hydrateAttachmentFromRidInternal(client, rawValue.rid);\n }\n if (propDef.type === \"numericTimeseries\" || propDef.type === \"stringTimeseries\" || propDef.type === \"sensorTimeseries\") {\n return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);\n }\n if (propDef.type === \"geotimeSeriesReference\") {\n return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === \"geotimeSeriesValue\" ? {\n time: rawValue.timestamp,\n value: {\n type: \"Point\",\n coordinates: rawValue.position\n }\n } : undefined);\n }\n if (propDef.type === \"mediaReference\") {\n return new MediaReferencePropertyImpl({\n client,\n objectApiName: objectDef.apiName,\n primaryKey: rawObject[objectDef.primaryKeyApiName],\n propertyName: p,\n mediaReference: rawValue\n });\n }\n}\nfunction parseWhenSecuritiesLoaded(wirePropertySecurities, rawObject, objectDef, derivedPropertyTypeByName = {}) {\n if (wirePropertySecurities == null || wirePropertySecurities.length === 0) {\n return {\n parsedObject: rawObject,\n clientPropertySecurities: undefined\n };\n }\n const parsedObject = {\n ...rawObject\n };\n const clientPropertySecurities = {};\n for (const propKey of Object.keys(rawObject)) {\n if (propKey in objectDef.properties || propKey in derivedPropertyTypeByName) {\n const value = rawObject[propKey];\n if (Array.isArray(value)) {\n const newVal = [];\n const newSecurities = [];\n value.forEach(spv => {\n !(typeof spv === \"object\" && spv != null && \"value\" in spv && \"propertySecurityIndex\" in spv) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected destructured secured property value object in array\") : invariant(false) : void 0;\n const securedValue = spv;\n newVal.push(securedValue.value);\n const securityIndex = securedValue.propertySecurityIndex;\n !(securityIndex != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be defined\") : invariant(false) : void 0;\n !(securityIndex < wirePropertySecurities.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be within bounds\") : invariant(false) : void 0;\n newSecurities.push(wirePropertySecurities[securityIndex].disjunction.map(wireToClientPropertySecurities));\n });\n parsedObject[propKey] = newVal;\n clientPropertySecurities[propKey] = newSecurities;\n } // Check if this is a secured property value object\n else if (typeof value === \"object\" && value != null && \"value\" in value && \"propertySecurityIndex\" in value) {\n const securedValue = value;\n parsedObject[propKey] = securedValue.value;\n const securityIndex = securedValue.propertySecurityIndex;\n !(securityIndex != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be defined\") : invariant(false) : void 0;\n !(securityIndex < wirePropertySecurities.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected property security index to be within bounds\") : invariant(false) : void 0;\n clientPropertySecurities[propKey] = wirePropertySecurities[securityIndex].disjunction.map(wireToClientPropertySecurities);\n } else {\n // Regular property without security\n parsedObject[propKey] = value;\n }\n }\n }\n return {\n parsedObject,\n clientPropertySecurities\n };\n}\nfunction wireToClientPropertySecurities(propertySecurity) {\n switch (propertySecurity.type) {\n case \"propertyMarkingSummary\":\n return {\n type: \"propertyMarkings\",\n conjunctive: propertySecurity.conjunctive,\n containerConjunctive: propertySecurity.containerConjunctive,\n disjunctive: propertySecurity.disjunctive,\n containerDisjunctive: propertySecurity.containerDisjunctive\n };\n case \"errorComputingSecurity\":\n return {\n type: \"errorComputingSecurity\"\n };\n case \"unsupportedPolicy\":\n return {\n type: \"unsupportedPolicy\"\n };\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport invariant from \"tiny-invariant\";\nimport { createOsdkObject } from \"./convertWireToOsdkObjects/createOsdkObject.js\";\n/**\n * If interfaceApiName is not undefined, converts the instances of the\n * interface into their respective\n * underlying concrete types and then returns the $as() representation\n * for the consumers.\n *\n * Otherwise just does the conversion\n *\n * May mutate in place for performance reasons. If you need a clean copy,\n * keep it first.\n *\n * However, you must use the returned value, which will be whatever is correct.\n *\n * @internal\n * @param interfaceApiName - if undefined\n */\nexport async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, propertySecurities, selectedProps, strictNonNull = false) {\n // remove the __ prefixed properties and convert them to $ prefixed.\n // updates in place\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) : undefined;\n const ifaceSelected = ifaceDef ? selectedProps ?? Object.keys(ifaceDef.properties) : undefined;\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);\n !objectDef ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing definition for '${rawObj.$apiName}'`) : invariant(false) : void 0;\n\n // default value for when we are checking an object\n let objProps;\n let conforming = true;\n if (ifaceDef && ifaceSelected) {\n // API returns interface spt names but we cache by real values\n invariantInterfacesAsViews(objectDef, ifaceDef.apiName, client);\n conforming &&= isConforming(client, ifaceDef, rawObj, ifaceSelected);\n reframeAsObjectInPlace(objectDef, ifaceDef.apiName, rawObj);\n objProps = convertInterfacePropNamesToObjectPropNames(objectDef, ifaceDef.apiName, ifaceSelected);\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\"Unable to safely convert objects as some non nullable properties are null\");\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName, propertySecurities);\n if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);\n ret.push(osdkObject);\n }\n return ret;\n}\n/**\n * @internal\n */\nexport async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, propertySecurities, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}, interfaceToObjectTypeMappingsV2 = {}) {\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n\n // prefer V2 mappings if non-empty, otherwise fall back to V1\n const effectiveMappings = Object.keys(interfaceToObjectTypeMappingsV2).length > 0 ? convertInterfaceToObjectTypeMappingsV2ToV1(interfaceToObjectTypeMappingsV2) : interfaceToObjectTypeMappings;\n const isInterfaceScoped = Object.keys(effectiveMappings).length > 0;\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);\n !objectDef ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Missing definition for '${rawObj.$apiName}'`) : invariant(false) : void 0;\n const interfaceToObjMapping = interfaceApiName && isInterfaceScoped ? effectiveMappings[interfaceApiName][rawObj.$apiName] : undefined;\n const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter(val => {\n selectedProps?.includes(interfaceToObjMapping[val]);\n }) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] : undefined;\n\n // default value for when we are checking an object\n let objProps;\n let conforming = true;\n if (interfaceApiName && ifaceSelected) {\n invariantInterfacesAsViews(objectDef, interfaceApiName, client);\n objProps = ifaceSelected;\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\"Unable to safely convert objects as some non nullable properties are null\");\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName, propertySecurities);\n if (interfaceApiName && isInterfaceScoped) osdkObject = osdkObject.$as(interfaceApiName);\n ret.push(osdkObject);\n }\n return ret;\n}\n\n/**\n * @internal\n *\n * Utility function that lets us take down selected property names from an interface\n * and convert them to an array of property names on an object.\n */\nexport function convertInterfacePropNamesToObjectPropNames(objectDef, interfaceApiName, ifacePropsToMap) {\n return ifacePropsToMap.map(ifaceProp => objectDef.interfaceMap[interfaceApiName][ifaceProp]);\n}\n\n/**\n * Takes a raw object from the wire (contextually as an interface) and\n * updates the fields to reflect the underlying objectDef instead\n * @param objectDef\n * @param interfaceApiName\n * @param client\n * @param rawObj\n */\nfunction reframeAsObjectInPlace(objectDef, interfaceApiName, rawObj) {\n const newProps = {};\n for (const [sptProp, regularProp] of Object.entries(objectDef.interfaceMap[interfaceApiName])) {\n if (sptProp in rawObj) {\n const value = rawObj[sptProp];\n delete rawObj[sptProp];\n if (value !== undefined) {\n newProps[regularProp] = value;\n }\n }\n }\n Object.assign(rawObj, newProps);\n if (!(objectDef.primaryKeyApiName in rawObj)) {\n rawObj[objectDef.primaryKeyApiName] = rawObj.$primaryKey;\n }\n}\nfunction isConforming(client, def, obj, propsToCheck) {\n for (const propName of propsToCheck) {\n if (propName in def.properties && def.properties[propName].nullable === false && obj[propName] == null) {\n if (process.env.NODE_ENV !== \"production\") {\n client.logger?.debug({\n obj: {\n $apiName: obj[\"$apiName\"],\n $objectType: obj[\"$objectType\"],\n $primaryKey: obj[\"$primaryKey\"]\n }\n }, `Found object that does not conform to its definition. Expected ${def.apiName}'s ${propName} to not be null.`);\n }\n return false;\n }\n }\n return true;\n}\nfunction invariantInterfacesAsViews(objectDef, interfaceApiName, client) {\n if (objectDef.interfaceMap?.[interfaceApiName] == null) {\n const warning = \"Interfaces are only supported 'as views' but your metadata object is missing the correct information. This suggests your interfaces have not been migrated to the newer version yet and you cannot use this version of the SDK.\";\n if (client.logger) {\n client.logger.warn(warning);\n } else {\n // eslint-disable-next-line no-console\n console.error(`WARNING! ${warning}`);\n }\n throw new Error(warning);\n }\n}\nfunction fixObjectPropertiesInPlace(objs, forceRemoveRid) {\n for (const obj of objs) {\n if (forceRemoveRid) {\n delete obj.__rid;\n }\n if (obj.__rid) {\n obj.$rid = obj.__rid;\n delete obj.__rid;\n }\n if (obj.__score) {\n obj.$score = obj.__score;\n delete obj.__score;\n }\n\n // Backend returns as __apiName but we want to stick to $ structure\n obj.$apiName ??= obj.__apiName;\n\n // for now these are the same but when we start doing interface projections the $objectType will always be underlying and\n // the $apiName will be for the current view (in current designs)\n obj.$objectType = obj.$apiName;\n\n // copying over for now as its always returned. In the future, this should just be inferred from underlying\n obj.$primaryKey ??= obj.__primaryKey;\n obj.$title ??= obj.__title;\n\n // we don't want people to use these\n delete obj.__apiName;\n delete obj.__primaryKey;\n delete obj.__title;\n }\n}\n\n/**\n * Converts interfaceToObjectTypeMappingsV2 format to the V1 format.\n * V2 format: { interfaceProp: { type: \"localPropertyImplementation\", propertyApiName: \"objectProp\" } }\n * V1 format: { interfaceProp: \"objectProp\" }\n */\nfunction convertInterfaceToObjectTypeMappingsV2ToV1(mappingsV2) {\n return Object.fromEntries(Object.entries(mappingsV2).map(([interfaceApiName, objectTypeMappingsV2]) => [interfaceApiName, Object.fromEntries(Object.entries(objectTypeMappingsV2).map(([objectTypeName, propertyMappings]) => [objectTypeName, Object.fromEntries(Object.entries(propertyMappings).filter(([, impl]) => impl.type === \"localPropertyImplementation\").map(([interfaceProp, impl]) => [interfaceProp, impl.propertyApiName]))]))]));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A simple cache that can be used to store values for a given client.\n */\n\n/**\n * @internal\n * A simple async cache that can be used to store values for a given client.\n */\n\n/** @internal */\n\n/**\n * @internal\n * Create a new cache without a factory function.\n */\n\n/**\n * @internal\n * Create a new cache with a factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n */\n\nexport function createClientCache(fn) {\n const cache = new WeakMap();\n function get(client, key) {\n if (cache.get(client.clientCacheKey) == null) {\n cache.set(client.clientCacheKey, new Map());\n }\n const r = cache.get(client.clientCacheKey).get(key);\n if (r === undefined && fn !== undefined) {\n return set(client, key, fn(client, key));\n } else {\n return r;\n }\n }\n function set(client, key, value) {\n if (cache.get(client.clientCacheKey) == null) {\n cache.set(client.clientCacheKey, new Map());\n }\n cache.get(client.clientCacheKey).set(key, value);\n return value;\n }\n function remove(client, key) {\n if (cache.get(client.clientCacheKey) == null) return false;\n return cache.get(client.clientCacheKey).delete(key);\n }\n return {\n get,\n set,\n remove\n };\n}\n\n/** @internal */\n\n/**\n * @internal\n * Create a new cache with an async factory function.\n * @param fn A factory function that will be used to create the value if it does not exist in the cache.\n * @returns\n */\nexport function createAsyncClientCache(fn, createCacheLocal = createClientCache) {\n const cache = createCacheLocal();\n const inProgress = createCacheLocal();\n const ret = {\n getOrUndefined: function getOrUndefined(client, key) {\n return cache.get(client, key);\n },\n get: async function get(client, key) {\n return cache.get(client, key) ?? inProgress.get(client, key) ?? ret.set(client, key, fn(client, key));\n },\n set: async function set(client, k, v) {\n // the `.set` happens first to prevent races.\n try {\n const r = await inProgress.set(client, k, v); // returns v\n\n cache.set(client, k, r);\n inProgress.remove(client, k);\n return r;\n } catch (e) {\n // we don't want to cache failures\n inProgress.remove(client, k);\n throw e;\n }\n }\n };\n return ret;\n}","/*\n * 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 deepFreeze(obj) {\n Object.getOwnPropertyNames(obj).forEach(name => {\n const prop = obj[name];\n if (typeof prop === \"object\" && prop != null && !Object.isFrozen(prop)) {\n deepFreeze(prop);\n }\n });\n return Object.freeze(obj);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _list = [0, \"/v2/ontologies/{0}/actionTypes\", 2];\n/**\n * Lists the action types for the given Ontology.\n *\n * Each page may be smaller than the requested page size. However, it is guaranteed that if there are more\n * results available, at least one result will be present in the response.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes\n */\nexport function list($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _list, ...args);\n}\nconst _get = [0, \"/v2/ontologies/{0}/actionTypes/{1}\", 2];\n/**\n * Gets a specific action type with the given API name.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes/{actionType}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/ontologies/{0}/actionTypes/byRid/{1}\", 2];\n/**\n * Gets a specific action type with the given RID.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes/byRid/{actionTypeRid}\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/ontologies/{0}/actionTypes/getByRidBatch\", 3];\n/**\n * Gets a list of action types by RID in bulk.\n *\n * Action types are filtered from the response if they don't exist or the requesting token lacks the required\n * permissions.\n *\n * The maximum batch size for this endpoint is 100.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/actionTypes/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\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 * as ActionTypesV2 from \"@osdk/foundry.ontologies/ActionTypeV2\";\nexport async function loadActionMetadata(client, actionType) {\n const r = await ActionTypesV2.get(client, await client.ontologyRid, actionType, {\n branch: client.branch\n });\n const {\n wireActionTypeV2ToSdkActionMetadata\n } = await import(\"@osdk/generator-converters\");\n return wireActionTypeV2ToSdkActionMetadata(r);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _list = [0, \"/v2/ontologies/{0}/objectTypes\", 2];\n/**\n * Lists the object types for the given Ontology.\n *\n * Each page may be smaller or larger than the requested page size. However, it is guaranteed that if there are\n * more results available, at least one result will be present in the\n * response.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes\n */\nexport function list($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _list, ...args);\n}\nconst _get = [0, \"/v2/ontologies/{0}/objectTypes/{1}\", 2];\n/**\n * Gets a specific object type with the given API name.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getFullMetadata = [0, \"/v2/ontologies/{0}/objectTypes/{1}/fullMetadata\", 2];\n/**\n * Gets the full metadata for a specific object type with the given API name.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/fullMetadata\n */\nexport function getFullMetadata($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getFullMetadata, ...args);\n}\nconst _getEditsHistory = [1, \"/v2/ontologies/{0}/objectTypes/{1}/editsHistory\", 3];\n/**\n * Returns the history of edits (additions, modifications, deletions) for objects of a\n * specific object type. This endpoint provides visibility into all actions that have\n * modified objects of this type.\n *\n * The edits are returned in reverse chronological order (most recent first) by default.\n *\n * Note that filters are ignored for OSv1 object types.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/editsHistory\n */\nexport function getEditsHistory($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getEditsHistory, ...args);\n}\nconst _listOutgoingLinkTypes = [0, \"/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes\", 2];\n/**\n * List the outgoing links for an object type.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/outgoingLinkTypes\n */\nexport function listOutgoingLinkTypes($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _listOutgoingLinkTypes, ...args);\n}\nconst _getOutgoingLinkType = [0, \"/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes/{2}\", 2];\n/**\n * Get an outgoing link for an object type.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/outgoingLinkTypes/{linkType}\n */\nexport function getOutgoingLinkType($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);\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 * as ObjectTypesV2 from \"@osdk/foundry.ontologies/ObjectTypeV2\";\nexport async function loadFullObjectMetadata(client, objectType) {\n const full = await ObjectTypesV2.getFullMetadata(client, await client.ontologyRid, objectType, {\n preview: true,\n branch: client.branch\n });\n const {\n wireObjectTypeFullMetadataToSdkObjectMetadata\n } = await import(\"@osdk/generator-converters\");\n const ret = wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);\n return {\n ...ret\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 * as OntologyInterfaces from \"@osdk/foundry.ontologies/OntologyInterface\";\nexport async function loadInterfaceMetadata(client, objectType) {\n const r = await OntologyInterfaces.get(client, await client.ontologyRid, objectType, {\n preview: true,\n branch: client.branch\n });\n const {\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition\n } = await import(\"@osdk/generator-converters\");\n return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _list = [0, \"/v2/ontologies/{0}/queryTypes\", 2];\n/**\n * Lists the query types for the given Ontology.\n *\n * Each page may be smaller than the requested page size. However, it is guaranteed that if there are more\n * results available, at least one result will be present in the response.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queryTypes\n */\nexport function list($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _list, ...args);\n}\nconst _get = [0, \"/v2/ontologies/{0}/queryTypes/{1}\", 2];\n/**\n * Gets a specific query type with the given API name.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queryTypes/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\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 * as QueryTypes from \"@osdk/foundry.ontologies/QueryType\";\nexport async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {\n const [apiName, version] = queryTypeApiNameAndVersion.split(\":\");\n const r = await QueryTypes.get(client, await client.ontologyRid, apiName, {\n version\n });\n const {\n wireQueryTypeV2ToSdkQueryMetadata\n } = await import(\"@osdk/generator-converters\");\n return wireQueryTypeV2ToSdkQueryMetadata(r);\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 { createAsyncClientCache } from \"../object/Cache.js\";\nimport { deepFreeze } from \"../util/deepFreeze.js\";\nimport { loadActionMetadata } from \"./loadActionMetadata.js\";\nimport { loadFullObjectMetadata } from \"./loadFullObjectMetadata.js\";\nimport { loadInterfaceMetadata } from \"./loadInterfaceMetadata.js\";\nimport { loadQueryMetadata } from \"./loadQueryMetadata.js\";\nimport { InterfaceDefinitions } from \"./OntologyProvider.js\";\nexport const createStandardOntologyProviderFactory = client => {\n return client => {\n async function loadObject(client, key) {\n const objectDef = await loadFullObjectMetadata(client, key);\n\n // ensure we have all of the interfaces loaded\n const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map(i => ret.getInterfaceDefinition(i)) ?? [])).map(i => [i.apiName, {\n def: i,\n handler: undefined\n }]));\n const fullObjectDef = {\n ...objectDef,\n [InterfaceDefinitions]: interfaceDefs\n };\n return deepFreeze(fullObjectDef);\n }\n async function loadInterface(client, key) {\n return deepFreeze(await loadInterfaceMetadata(client, key));\n }\n async function loadQuery(client, key) {\n return loadQueryMetadata(client, key);\n }\n async function loadAction(client, key) {\n const r = await loadActionMetadata(client, key);\n return r;\n }\n function makeGetter(fn) {\n const cache = createAsyncClientCache((client, key) => fn(client, key, false));\n return async apiName => {\n return await cache.get(client, apiName);\n };\n }\n function makeQueryGetter(client, fn) {\n const queryCache = createAsyncClientCache((client, key) => {\n return fn(client, key);\n });\n return async (apiName, version) => {\n const key = version ? `${apiName}:${version}` : apiName;\n return await queryCache.get(client, key);\n };\n }\n const ret = {\n getObjectDefinition: makeGetter(loadObject),\n getInterfaceDefinition: makeGetter(loadInterface),\n getActionDefinition: makeGetter(loadAction),\n getQueryDefinition: makeQueryGetter(client, loadQuery)\n };\n return ret;\n };\n};","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT = `osdk-observable-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 { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport { convertWireToOsdkObjects, convertWireToOsdkObjects2 } from \"./object/convertWireToOsdkObjects.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport { createStandardOntologyProviderFactory } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n\n/** @internal */\nexport function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n } catch (e) {\n const hint = !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\") ? \". Did you forget to add 'http://' or 'https://'?\" : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const processedBaseUrl = new URL(baseUrl);\n processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith(\"/\") ? \"\" : \"/\";\n const minimalClient = {\n ...createSharedClientContext(processedBaseUrl.toString(), tokenProvider, USER_AGENT, fetchFn),\n objectSetFactory,\n objectFactory: convertWireToOsdkObjects,\n objectFactory2: convertWireToOsdkObjects2,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger,\n transactionId: options.transactionId,\n clientCacheKey: {},\n requestContext: {},\n branch: options.branch,\n narrowTypeInterfaceOrObjectMapping: {}\n };\n return Object.freeze(Object.assign(minimalClient, {\n ontologyProvider: createOntologyProviderFactory(options)(minimalClient)\n }));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InterfaceDefinitions } from \"./ontology/OntologyProvider.js\";\n\n/** @internal */\nexport const fetchMetadataInternal = async (client, definition) => {\n if (definition.type === \"object\") {\n const {\n [InterfaceDefinitions]: interfaceDefs,\n ...objectTypeDef\n } = await client.ontologyProvider.getObjectDefinition(definition.apiName);\n return objectTypeDef;\n } else if (definition.type === \"interface\") {\n return client.ontologyProvider.getInterfaceDefinition(definition.apiName);\n } else if (definition.type === \"action\") {\n return client.ontologyProvider.getActionDefinition(definition.apiName);\n } else if (definition.type === \"query\") {\n return client.ontologyProvider.getQueryDefinition(definition.apiName, definition.isFixedVersion ? definition.version : undefined);\n } else {\n throw new Error(\"Not implemented for given definition\");\n }\n};","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _execute = [1, \"/v2/ontologies/{0}/queries/{1}/execute\", 7];\n/**\n * Executes a Query using the given parameters. By default, the latest version of the Query is executed.\n *\n * Optional parameters do not need to be supplied.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\n/**\n * @internal\n * Creates a Media object from a MediaReference for query results.\n * Unlike MediaReferencePropertyImpl, this doesn't require object context\n * and directly accesses the media set APIs. This is intended for MediaReferences returned\n * from query results or to be used by the functions runtime,\n */\nexport function createMediaFromReference(client, mediaReference) {\n const {\n mediaSetRid,\n mediaItemRid\n } = mediaReference.reference.mediaSetViewItem;\n const token = mediaReference.reference.mediaSetViewItem.token;\n return {\n async fetchContents() {\n return MediaSets.read(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n },\n async fetchMetadata() {\n const metadata = await MediaSets.metadata(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n const info = await MediaSets.info(client, mediaSetRid, mediaItemRid, {\n preview: true\n }, token ? {\n ReadToken: token\n } : undefined);\n return {\n path: info.path,\n sizeBytes: metadata.sizeBytes,\n mediaType: undefined // Media type is not currently returned by the API, so we return undefined here. This can be updated when the API returns media type.\n };\n },\n getMediaReference() {\n return mediaReference;\n }\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport * as Attachments from \"@osdk/foundry.ontologies/Attachment\";\nimport { isAttachmentFile, isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMedia, isMediaReference, isMediaUpload } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceQueryParam, isInterfaceSpecifier } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { extractPrimaryKeyFromObjectSpecifier } from \"./objectSpecifierUtils.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 * @internal\n */\nexport async function toDataValueQueries(value, client, desiredType) {\n if (value == null) {\n return value;\n }\n if (Array.isArray(value) && desiredType.type === \"array\") {\n const values = Array.from(value);\n if (values.some(dataValue => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValueQueries(value, client, desiredType));\n }\n return converted;\n }\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType.array));\n return Promise.all(promiseArray);\n }\n switch (desiredType.type) {\n case \"attachment\":\n {\n if (isAttachmentUpload(value)) {\n const attachment = await Attachments.upload(client, value.data, {\n filename: value.name\n });\n return attachment.rid;\n }\n if (isAttachmentFile(value)) {\n const attachment = await Attachments.upload(client, value, {\n filename: value.name\n });\n return attachment.rid;\n }\n\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"threeDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"mediaReference\":\n {\n if (isMediaUpload(value)) {\n const mediaRef = await MediaSets.uploadMedia(client, value.data, {\n filename: value.fileName,\n preview: true\n });\n return mediaRef;\n }\n if (isMedia(value)) {\n return value.getMediaReference();\n }\n if (isMediaReference(value)) {\n return value;\n }\n throw new Error(\"Expected media reference type but got value that is not a MediaReference or MediaUpload\");\n }\n case \"set\":\n {\n if (value instanceof Set) {\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType[\"set\"]));\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\":\n {\n if (isObjectSpecifiersObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"interface\":\n {\n if (isInterfaceSpecifier(value) || isInterfaceQueryParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey\n };\n }\n }\n case \"objectSet\":\n case \"interfaceObjectSet\":\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 break;\n }\n case \"map\":\n {\n if (typeof value === \"object\") {\n const entrySet = [];\n for (const [key, mapValue] of Object.entries(value)) {\n entrySet.push({\n key: desiredType.keyType.type === \"object\" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),\n value: await toDataValueQueries(mapValue, client, desiredType.valueType)\n });\n }\n return entrySet;\n }\n break;\n }\n case \"struct\":\n {\n if (typeof value === \"object\") {\n const structMap = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(structValue, client, desiredType[\"struct\"][key]);\n }\n return structMap;\n }\n }\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\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 * as Queries from \"@osdk/foundry.ontologies/Query\";\nimport invariant from \"tiny-invariant\";\nimport { createMediaFromReference } from \"../createMediaFromReference.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { createObjectSpecifierFromInterfaceSpecifier, createObjectSpecifierFromPrimaryKey } from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nexport async function applyQuery(client, query, params) {\n // We fire and forget so if a function has no parameters we don't unnecessarily load all metadata\n const qd = client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Queries.execute(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyQuery\"\n })), query), await client.ontologyRid, query.apiName, {\n parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}\n }, {\n version: query.isFixedVersion ? query.version : undefined,\n transactionId: client.transactionId,\n branch: client.branch\n });\n const objectOutputDefs = await getRequiredDefinitions((await qd).output, client);\n const remappedResponse = await remapQueryResponse(client, (await qd).output, response.value, objectOutputDefs);\n return remappedResponse;\n}\nasync function remapQueryParams(params, client, paramTypes) {\n const parameterMap = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(value, client, paramTypes[key]);\n }\n return parameterMap;\n}\nasync function remapQueryResponse(client, responseDataType, responseValue, definitions) {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n switch (responseDataType.type) {\n case \"union\":\n {\n throw new Error(\"Union return types are not yet supported\");\n }\n case \"array\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.array, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"set\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.set, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"attachment\":\n {\n return hydrateAttachmentFromRidInternal(client, responseValue);\n }\n case \"mediaReference\":\n {\n return createMediaFromReference(client, responseValue);\n }\n case \"object\":\n {\n const def = definitions.get(responseDataType.object);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${responseDataType.object}`);\n }\n return createQueryObjectResponse(responseValue, def);\n }\n case \"interface\":\n {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(`Missing definition for ${responseDataType.interface}`);\n }\n return createQueryInterfaceResponse(responseValue, def);\n }\n case \"objectSet\":\n {\n const def = definitions.get(responseDataType.objectSet);\n if (!def) {\n throw new Error(`Missing definition for ${responseDataType.objectSet}`);\n }\n if (typeof responseValue === \"string\") {\n return createObjectSet(def, client, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: responseDataType.objectSet\n }, {\n type: \"reference\",\n reference: responseValue\n }]\n });\n }\n return createObjectSet(def, client, responseValue);\n }\n case \"struct\":\n {\n // figure out what keys need to be fixed up\n for (const [key, subtype] of Object.entries(responseDataType.struct)) {\n if (requiresConversion(subtype) || responseValue[key] == null) {\n responseValue[key] = await remapQueryResponse(client, subtype, responseValue[key], definitions);\n }\n }\n return responseValue;\n }\n case \"map\":\n {\n const map = {};\n !Array.isArray(responseValue) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected array entry\") : invariant(false) : void 0;\n for (const entry of responseValue) {\n !(entry.key != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected key\") : invariant(false) : void 0;\n !(entry.value != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected value\") : invariant(false) : void 0;\n const key = responseDataType.keyType.type === \"object\" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;\n const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);\n map[key] = value;\n }\n return map;\n }\n case \"twoDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n value\n } of responseValue.groups) {\n result.push({\n key,\n value\n });\n }\n return result;\n }\n case \"threeDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n groups\n } of responseValue.groups) {\n const subResult = [];\n for (const {\n key: subKey,\n value\n } of groups) {\n subResult.push({\n key: subKey,\n value\n });\n }\n result.push({\n key,\n groups: subResult\n });\n }\n return result;\n }\n }\n return responseValue;\n}\nasync function getRequiredDefinitions(dataType, client) {\n const result = new Map();\n switch (dataType.type) {\n case \"objectSet\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.objectSet);\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"interfaceObjectSet\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.objectSet);\n result.set(dataType.objectSet, interfaceDef);\n break;\n }\n case \"object\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.object);\n result.set(dataType.object, objectDef);\n break;\n }\n case \"interface\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.interface);\n result.set(dataType.interface, interfaceDef);\n break;\n }\n case \"set\":\n {\n return getRequiredDefinitions(dataType.set, client);\n }\n case \"array\":\n {\n return getRequiredDefinitions(dataType.array, client);\n }\n case \"map\":\n {\n const types = [dataType.keyType, dataType.valueType];\n const allDefs = await Promise.all(types.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"struct\":\n {\n const structValues = Object.values(dataType.struct);\n const allDefs = await Promise.all(structValues.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"mediaReference\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"union\":\n break;\n default:\n {\n const _ = dataType;\n break;\n }\n }\n return result;\n}\nfunction requiresConversion(dataType) {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return false;\n case \"union\":\n return true;\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n case \"set\":\n return requiresConversion(dataType.set);\n case \"attachment\":\n case \"mediaReference\":\n case \"objectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n return true;\n default:\n return false;\n }\n}\nfunction getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {\n const def = definitions.get(objectTypeApiName);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${objectTypeApiName}`);\n }\n return createObjectSpecifierFromPrimaryKey(def, primaryKey);\n}\nexport function createQueryObjectResponse(primaryKey, objectDef) {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)\n };\n}\nexport function createQueryInterfaceResponse(interfaceSpecifier, interfaceDef) {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier)\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 { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"@osdk/api/unstable\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { MinimalLogger } from \"./logger/MinimalLogger.js\";\nimport { fetchPage, fetchStaticRidPage } from \"./object/fetchPage.js\";\nimport { fetchSingle } from \"./object/fetchSingle.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\n\n// We import it this way to keep compatible with CJS. If we referenced the\n// value of `symbolClientContext` directly, then we would have to a dynamic import\n// in `createClientInternal` which would make it async and a break.\n// Since this is just a string in `@osdk/shared.client2` instead of a symbol,\n// we can safely perform this trick.\n\nclass ActionInvoker {\n constructor(clientCtx, actionDef) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n}\nclass QueryInvoker {\n constructor(clientCtx, queryDef) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n}\n\n/** @internal */\nexport function createClientInternal(objectSetFactory, transactionRid, flushEdits, baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n if (typeof ontologyRid === \"string\") {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ontologyRid.then(ontologyRid => {\n if (!ontologyRid.startsWith(\"ri.\")) {\n // FIXME this promise is not await so this just shows up as an unhandled promise rejection\n throw new Error(\"Invalid ontology RID\");\n }\n });\n }\n const clientCtx = createMinimalClient({\n ontologyRid\n }, baseUrl, tokenProvider, {\n ...options,\n logger: options?.logger ?? new MinimalLogger(),\n transactionId: transactionRid,\n flushEdits,\n branch: options?.UNSTABLE_DO_NOT_USE_BRANCH\n }, fetchFn, objectSetFactory);\n return createClientFromContext(clientCtx);\n}\n\n/**\n * @internal\n */\nexport function createClientFromContext(clientCtx) {\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n return clientCtx.objectSetFactory(o, clientCtx);\n } else if (o.type === \"action\") {\n return new ActionInvoker(clientCtx, o); // then as any for dealing with the conditional return value\n } else if (o.type === \"query\") {\n return new QueryInvoker(clientCtx, o);\n } else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: async function* (objs, linkTypes) {\n const {\n createBulkLinksAsyncIterFactory\n } = await import(\"./__unstable/createBulkLinksAsyncIterFactory.js\");\n yield* createBulkLinksAsyncIterFactory(clientCtx)(objs, linkTypes);\n }\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:\n return {\n fetchOneByRid: async (objectType, rid, options) => {\n return await fetchSingle(clientCtx, objectType, options, createWithRid([rid]));\n }\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:\n return {\n createMediaReference: async args => {\n const {\n data,\n fileName,\n objectType,\n propertyType\n } = args;\n const {\n upload\n } = await import(\"@osdk/foundry.ontologies/MediaReferenceProperty\");\n return await upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {\n mediaItemPath: fileName,\n preview: true\n });\n }\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:\n return {\n fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {\n return await fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));\n },\n fetchPageByRidNoType: async (rids, options) => {\n return await fetchStaticRidPage(clientCtx, rids, options ?? {});\n }\n };\n }\n throw new Error(\"not implemented\");\n } else {\n throw new Error(\"not implemented\");\n }\n }\n const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);\n const symbolClientContext = \"__osdkClientContext\";\n const client = Object.defineProperties(clientFn, {\n [oldSymbolClientContext]: {\n value: clientCtx\n },\n [symbolClientContext]: {\n value: clientCtx\n },\n [additionalContext]: {\n value: clientCtx\n },\n fetchMetadata: {\n value: fetchMetadata\n }\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet, undefined, undefined);\nexport const createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(createObjectSet, transactionRid, flushEdits, ...args);\nfunction createWithRid(rids) {\n const withRid = {\n type: \"static\",\n \"objects\": rids\n };\n return withRid;\n}"]}