@osdk/client 2.40.0 → 2.41.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/build/browser/Client.js +1 -1
  3. package/build/browser/Client.js.map +1 -1
  4. package/build/browser/createCipherTextProperty.js +39 -0
  5. package/build/browser/createCipherTextProperty.js.map +1 -0
  6. package/build/browser/index.js.map +1 -1
  7. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +10 -1
  8. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  9. package/build/browser/util/UserAgent.js +2 -2
  10. package/build/browser/util/UserAgent.js.map +1 -1
  11. package/build/cjs/{applyStreamingQuery-6ZZRUAB2.cjs → applyStreamingQuery-RBPTQJXT.cjs} +9 -9
  12. package/build/cjs/{applyStreamingQuery-6ZZRUAB2.cjs.map → applyStreamingQuery-RBPTQJXT.cjs.map} +1 -1
  13. package/build/cjs/{chunk-F4L4RFUT.cjs → chunk-6BO5YHRX.cjs} +2 -2
  14. package/build/cjs/{chunk-F4L4RFUT.cjs.map → chunk-6BO5YHRX.cjs.map} +1 -1
  15. package/build/cjs/{chunk-XLX6T4OB.cjs → chunk-CHIEZR53.cjs} +95 -61
  16. package/build/cjs/chunk-CHIEZR53.cjs.map +1 -0
  17. package/build/cjs/{chunk-GOW2XJR7.cjs → chunk-T6NQXSJY.cjs} +80 -80
  18. package/build/cjs/{chunk-GOW2XJR7.cjs.map → chunk-T6NQXSJY.cjs.map} +1 -1
  19. package/build/cjs/{chunk-JDRCSS7F.cjs → chunk-VUQAQMDE.cjs} +13 -13
  20. package/build/cjs/{chunk-JDRCSS7F.cjs.map → chunk-VUQAQMDE.cjs.map} +1 -1
  21. package/build/cjs/index.cjs +11 -11
  22. package/build/cjs/index.d.cts +1 -1
  23. package/build/cjs/public/experimental.cjs +6 -6
  24. package/build/cjs/public/internal.cjs +7 -7
  25. package/build/cjs/public/observable.cjs +5 -5
  26. package/build/cjs/public/unstable-do-not-use.cjs +15 -15
  27. package/build/esm/Client.js +1 -1
  28. package/build/esm/Client.js.map +1 -1
  29. package/build/esm/createCipherTextProperty.js +39 -0
  30. package/build/esm/createCipherTextProperty.js.map +1 -0
  31. package/build/esm/index.js.map +1 -1
  32. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +10 -1
  33. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  34. package/build/esm/util/UserAgent.js +2 -2
  35. package/build/esm/util/UserAgent.js.map +1 -1
  36. package/build/types/Client.d.ts +1 -1
  37. package/build/types/createCipherTextProperty.d.ts +12 -0
  38. package/build/types/createCipherTextProperty.d.ts.map +1 -0
  39. package/build/types/index.d.ts +1 -1
  40. package/build/types/index.d.ts.map +1 -1
  41. package/package.json +7 -7
  42. package/build/cjs/chunk-XLX6T4OB.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n /**\n * Returns the operation surface for the given ontology definition. The shape of the\n * returned value is dispatched on what kind of definition is passed:\n * - object type → the object set type for that ontology object (typically a generated extension of {@link ObjectSet})\n * - interface → a {@link MinimalObjectSet} for the interface\n * - action → a callable with `applyAction` / `batchApplyAction`\n * - query → a callable with `executeFunction`\n * - experiment → the unstable feature surface for that experiment\n *\n * @param o - The object type definition to wrap.\n * @example\n * ```ts\n * const employees = await client(Employee).fetchPage({ $pageSize: 30 });\n * const employee = await client(Employee).fetchOne(12345);\n * ```\n * @returns an object set scoped to all objects of this type.\n */\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n /**\n * @param o - The interface definition to wrap.\n * @example\n * ```ts\n * const page = await client(MyInterface).fetchPage({ $pageSize: 30 });\n * ```\n * @returns a minimal object set over all objects implementing the interface.\n */\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n /**\n * @param o - The action definition to invoke.\n * @example\n * ```ts\n * const result = await client(createEmployee).applyAction(\n * { name: \"Jane\", department: \"Engineering\" },\n * { $returnEdits: true },\n * );\n * ```\n * @returns a callable for applying (or batch-applying) the action.\n */\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n /**\n * @param o - The query definition to invoke.\n * @example\n * ```ts\n * const result = await client(getEmployeeCount).executeFunction({ department: \"Engineering\" });\n * ```\n * @returns a callable for executing the query function.\n */\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n /**\n * @param experiment - The experiment marker that gates an unstable feature.\n * @example\n * ```ts\n * const ref = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference)\n * .createMediaReference({ data: blob, fileName: \"media.mp4\", objectType: Employee, propertyType: \"photo\" });\n * ```\n * @returns the experiment-specific function surface.\n */\n <\n Q extends\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">\n | Experiment<\"2.2.0\">\n | Experiment<\"2.8.0\">\n | Experiment<\"2.19.0\">,\n >(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n /**\n * Fetches runtime metadata for the given ontology definition. The returned shape\n * is dispatched on the kind of definition passed: {@link ObjectMetadata},\n * {@link InterfaceMetadata}, {@link ActionMetadata}, or {@link QueryMetadata}.\n * @param o - The object type, interface, action, or query definition to look up.\n * @example\n * ```ts\n * const meta = await client.fetchMetadata(Employee);\n * console.log(meta.displayName, meta.description);\n * ```\n * @returns a promise resolving to the metadata for the given definition.\n */\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.40.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;;AA8HA;AACA;AACA,OAAO,MAAMA,iBAAgC,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAE3E;AACA,MAAMC,cAAc,GAAG,QAAQ;AAC/B;;AAEA,MAAMC,YAA2B,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n /**\n * Returns the operation surface for the given ontology definition. The shape of the\n * returned value is dispatched on what kind of definition is passed:\n * - object type → the object set type for that ontology object (typically a generated extension of {@link ObjectSet})\n * - interface → a {@link MinimalObjectSet} for the interface\n * - action → a callable with `applyAction` / `batchApplyAction`\n * - query → a callable with `executeFunction`\n * - experiment → the unstable feature surface for that experiment\n *\n * @param o - The object type definition to wrap.\n * @example\n * ```ts\n * const employees = await client(Employee).fetchPage({ $pageSize: 30 });\n * const employee = await client(Employee).fetchOne(12345);\n * ```\n * @returns an object set scoped to all objects of this type.\n */\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n /**\n * @param o - The interface definition to wrap.\n * @example\n * ```ts\n * const page = await client(MyInterface).fetchPage({ $pageSize: 30 });\n * ```\n * @returns a minimal object set over all objects implementing the interface.\n */\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n /**\n * @param o - The action definition to invoke.\n * @example\n * ```ts\n * const result = await client(createEmployee).applyAction(\n * { name: \"Jane\", department: \"Engineering\" },\n * { $returnEdits: true },\n * );\n * ```\n * @returns a callable for applying (or batch-applying) the action.\n */\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n /**\n * @param o - The query definition to invoke.\n * @example\n * ```ts\n * const result = await client(getEmployeeCount).executeFunction({ department: \"Engineering\" });\n * ```\n * @returns a callable for executing the query function.\n */\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n /**\n * @param experiment - The experiment marker that gates an unstable feature.\n * @example\n * ```ts\n * const ref = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference)\n * .createMediaReference({ data: blob, fileName: \"media.mp4\", objectType: Employee, propertyType: \"photo\" });\n * ```\n * @returns the experiment-specific function surface.\n */\n <\n Q extends\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">\n | Experiment<\"2.2.0\">\n | Experiment<\"2.8.0\">\n | Experiment<\"2.19.0\">,\n >(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n /**\n * Fetches runtime metadata for the given ontology definition. The returned shape\n * is dispatched on the kind of definition passed: {@link ObjectMetadata},\n * {@link InterfaceMetadata}, {@link ActionMetadata}, or {@link QueryMetadata}.\n * @param o - The object type, interface, action, or query definition to look up.\n * @example\n * ```ts\n * const meta = await client.fetchMetadata(Employee);\n * console.log(meta.displayName, meta.description);\n * ```\n * @returns a promise resolving to the metadata for the given definition.\n */\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.41.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;;AA8HA;AACA;AACA,OAAO,MAAMA,iBAAgC,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAE3E;AACA,MAAMC,cAAc,GAAG,QAAQ;AAC/B;;AAEA,MAAMC,YAA2B,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { decrypt as cipherTextDecrypt } from "@osdk/foundry.ontologies/CipherTextProperty";
18
+ import invariant from "tiny-invariant";
19
+ export class CipherTextPropertyImpl {
20
+ #client;
21
+ #locator;
22
+ constructor(args) {
23
+ const {
24
+ client,
25
+ objectApiName,
26
+ primaryKey,
27
+ propertyName
28
+ } = args;
29
+ this.#client = client;
30
+ this.#locator = [objectApiName, primaryKey, propertyName];
31
+ }
32
+ async decrypt() {
33
+ const ontologyRid = await this.#client.ontologyRid;
34
+ const result = await cipherTextDecrypt(this.#client, ontologyRid, ...this.#locator);
35
+ !Object.hasOwn(result, "plaintext") ? process.env.NODE_ENV !== "production" ? invariant(false, "Expected decryption result to have plaintext value") : invariant(false) : void 0;
36
+ return result.plaintext;
37
+ }
38
+ }
39
+ //# sourceMappingURL=createCipherTextProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCipherTextProperty.js","names":["decrypt","cipherTextDecrypt","invariant","CipherTextPropertyImpl","client","locator","constructor","args","objectApiName","primaryKey","propertyName","ontologyRid","result","Object","hasOwn","process","env","NODE_ENV","plaintext"],"sources":["createCipherTextProperty.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { CipherText } from \"@osdk/api\";\nimport { decrypt as cipherTextDecrypt } from \"@osdk/foundry.ontologies/CipherTextProperty\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\n\nexport class CipherTextPropertyImpl implements CipherText {\n #client: MinimalClient;\n #locator: [string, any, string];\n\n constructor(args: {\n client: MinimalClient;\n objectApiName: string;\n primaryKey: any;\n propertyName: string;\n }) {\n const { client, objectApiName, primaryKey, propertyName } = args;\n this.#client = client;\n this.#locator = [objectApiName, primaryKey, propertyName];\n }\n\n async decrypt(): Promise<string> {\n const ontologyRid = await this.#client.ontologyRid;\n const result = await cipherTextDecrypt(\n this.#client,\n ontologyRid,\n ...this.#locator,\n );\n invariant(\n Object.hasOwn(result, \"plaintext\"),\n \"Expected decryption result to have plaintext value\",\n );\n return result.plaintext!;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,6CAA6C;AAC1F,OAAOC,SAAS,MAAM,gBAAgB;AAGtC,OAAO,MAAMC,sBAAsB,CAAuB;EACxD,CAACC,MAAM;EACP,CAACC,OAAO;EAERC,WAAWA,CAACC,IAKX,EAAE;IACD,MAAM;MAAEH,MAAM;MAAEI,aAAa;MAAEC,UAAU;MAAEC;IAAa,CAAC,GAAGH,IAAI;IAChE,IAAI,CAAC,CAACH,MAAM,GAAGA,MAAM;IACrB,IAAI,CAAC,CAACC,OAAO,GAAG,CAACG,aAAa,EAAEC,UAAU,EAAEC,YAAY,CAAC;EAC3D;EAEA,MAAMV,OAAOA,CAAA,EAAoB;IAC/B,MAAMW,WAAW,GAAG,MAAM,IAAI,CAAC,CAACP,MAAM,CAACO,WAAW;IAClD,MAAMC,MAAM,GAAG,MAAMX,iBAAiB,CACpC,IAAI,CAAC,CAACG,MAAM,EACZO,WAAW,EACX,GAAG,IAAI,CAAC,CAACN,OACX,CAAC;IACD,CACEQ,MAAM,CAACC,MAAM,CAACF,MAAM,EAAE,WAAW,CAAC,GAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADpCf,SAAS,QAEP,oDAAoD,IAFtDA,SAAS;IAIT,OAAOU,MAAM,CAACM,SAAS;EACzB;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","getWireObjectSet","isObjectSet","extractDate","extractDateInLocalTime","extractDateInUTC","createObjectSpecifierFromPrimaryKey","extractPrimaryKeyFromObjectSpecifier"],"sources":["index.ts"],"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\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { isOk } from \"@osdk/api\";\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n DerivedProperty,\n InterfaceDefinition,\n InterfaceMetadata,\n Logger,\n Media,\n MediaFullMetadata,\n MediaItemMetadata,\n MediaMetadata,\n MediaReference,\n MediaUpload,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n UnknownMediaItemMetadata,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport type { ObjectSet as WireObjectSet } from \"@osdk/foundry.ontologies\";\nexport { getWireObjectSet, isObjectSet } from \"./objectSet/createObjectSet.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n\nexport {\n createObjectSpecifierFromPrimaryKey,\n extractPrimaryKeyFromObjectSpecifier,\n} from \"./util/objectSpecifierUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,QAAQ,WAAW;AA8ChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAIrE,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,gCAAgC;AAE9E,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B;AAErC,SACEC,mCAAmC,EACnCC,oCAAoC,QAC/B,gCAAgC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","getWireObjectSet","isObjectSet","extractDate","extractDateInLocalTime","extractDateInUTC","createObjectSpecifierFromPrimaryKey","extractPrimaryKeyFromObjectSpecifier"],"sources":["index.ts"],"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\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { isOk } from \"@osdk/api\";\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CipherText,\n CompileTimeMetadata,\n DerivedProperty,\n InterfaceDefinition,\n InterfaceMetadata,\n Logger,\n Media,\n MediaFullMetadata,\n MediaItemMetadata,\n MediaMetadata,\n MediaReference,\n MediaUpload,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n UnknownMediaItemMetadata,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport type { ObjectSet as WireObjectSet } from \"@osdk/foundry.ontologies\";\nexport { getWireObjectSet, isObjectSet } from \"./objectSet/createObjectSet.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n\nexport {\n createObjectSpecifierFromPrimaryKey,\n extractPrimaryKeyFromObjectSpecifier,\n} from \"./util/objectSpecifierUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,QAAQ,WAAW;AA+ChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAIrE,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,gCAAgC;AAE9E,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B;AAErC,SACEC,mCAAmC,EACnCC,oCAAoC,QAC/B,gCAAgC","ignoreList":[]}
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import invariant from "tiny-invariant";
18
+ import { CipherTextPropertyImpl } from "../../createCipherTextProperty.js";
18
19
  import { GeotimeSeriesPropertyImpl } from "../../createGeotimeSeriesProperty.js";
19
20
  import { MediaReferencePropertyImpl } from "../../createMediaReferenceProperty.js";
20
21
  import { TimeSeriesPropertyImpl } from "../../createTimeseriesProperty.js";
@@ -24,7 +25,7 @@ import { applyPropertyFormatter } from "../formatting/applyPropertyFormatter.js"
24
25
  import { get$as } from "./getDollarAs.js";
25
26
  import { get$link } from "./getDollarLink.js";
26
27
  import { ClientRef, ObjectDefRef, PropertySecuritiesRef, UnderlyingOsdkObject } from "./InternalSymbols.js";
27
- const specialPropertyTypes = new Set(["attachment", "geotimeSeriesReference", "mediaReference", "numericTimeseries", "stringTimeseries", "sensorTimeseries"]);
28
+ const specialPropertyTypes = new Set(["attachment", "cipherText", "geotimeSeriesReference", "mediaReference", "numericTimeseries", "stringTimeseries", "sensorTimeseries"]);
28
29
  const securableSpecialKeys = new Set(["$primaryKey", "$title"]);
29
30
 
30
31
  // kept separate so we are not redefining these functions
@@ -173,6 +174,14 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
173
174
  }
174
175
  return hydrateAttachmentFromRidInternal(client, rawValue.rid);
175
176
  }
177
+ if (propDef.type === "cipherText") {
178
+ return new CipherTextPropertyImpl({
179
+ client,
180
+ objectApiName: objectDef.apiName,
181
+ primaryKey: rawObject[objectDef.primaryKeyApiName],
182
+ propertyName: p
183
+ });
184
+ }
176
185
  if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
177
186
  return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
178
187
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createOsdkObject.js","names":["invariant","GeotimeSeriesPropertyImpl","MediaReferencePropertyImpl","TimeSeriesPropertyImpl","hydrateAttachmentFromRidInternal","createObjectSpecifierFromPrimaryKey","applyPropertyFormatter","get$as","get$link","ClientRef","ObjectDefRef","PropertySecuritiesRef","UnderlyingOsdkObject","specialPropertyTypes","Set","securableSpecialKeys","basePropDefs","get","value","update","rawObj","def","createOsdkObject","primaryKeyApiName","Error","apiName","titleProperty","$title","newObject","$primaryKey","enumerable","ObjectMetadata","propertyApiName","options","propertyValue","properties","client","objectDef","simpleOsdkProperties","derivedPropertyTypeByName","wirePropertySecurities","parsedObject","clientPropertySecurities","parseWhenSecuritiesLoaded","Object","defineProperties","propKey","keys","type","has","createSpecialProperty","modifyRdpProperties","freeze","rawValue","definition","operation","num","Number","isSafeInteger","process","env","NODE_ENV","selectedOrCollectedPropertyType","Array","isArray","map","a","rid","rawObject","p","propDef","time","timestamp","coordinates","position","undefined","objectApiName","primaryKey","propertyName","mediaReference","length","newVal","newSecurities","forEach","spv","securedValue","push","securityIndex","propertySecurityIndex","disjunction","wireToClientPropertySecurities","propertySecurity","conjunctive","containerConjunctive","disjunctive","containerDisjunctive"],"sources":["createOsdkObject.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PropertySecurity } from \"@osdk/api\";\nimport type { MediaReference } from \"@osdk/foundry.core\";\nimport type {\n Attachment,\n PropertySecurities,\n PropertySecurity as WirePropertySecurity,\n ReferenceValue,\n SecuredPropertyValue,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { GeotimeSeriesPropertyImpl } from \"../../createGeotimeSeriesProperty.js\";\nimport { MediaReferencePropertyImpl } from \"../../createMediaReferenceProperty.js\";\nimport { TimeSeriesPropertyImpl } from \"../../createTimeseriesProperty.js\";\nimport type { DerivedPropertyRuntimeMetadata } from \"../../derivedProperties/derivedPropertyRuntimeMetadata.js\";\nimport type { MinimalClient } from \"../../MinimalClientContext.js\";\nimport type { FetchedObjectTypeDefinition } from \"../../ontology/OntologyProvider.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../../public-utils/hydrateAttachmentFromRid.js\";\nimport { createObjectSpecifierFromPrimaryKey } from \"../../util/objectSpecifierUtils.js\";\nimport {\n applyPropertyFormatter,\n type FormatPropertyOptions,\n} from \"../formatting/applyPropertyFormatter.js\";\nimport type { SimpleOsdkProperties } from \"../SimpleOsdkProperties.js\";\nimport { get$as } from \"./getDollarAs.js\";\nimport { get$link } from \"./getDollarLink.js\";\nimport {\n ClientRef,\n ObjectDefRef,\n PropertySecuritiesRef,\n UnderlyingOsdkObject,\n} from \"./InternalSymbols.js\";\nimport type { ObjectHolder } from \"./ObjectHolder.js\";\n\nconst specialPropertyTypes = new Set(\n [\n \"attachment\",\n \"geotimeSeriesReference\",\n \"mediaReference\",\n \"numericTimeseries\",\n \"stringTimeseries\",\n \"sensorTimeseries\",\n ],\n);\n\nconst securableSpecialKeys = new Set([\"$primaryKey\", \"$title\"]);\n\n// kept separate so we are not redefining these functions\n// every time an object is created.\nconst basePropDefs = {\n \"$as\": {\n get(this: ObjectHolder) {\n return get$as(this[ObjectDefRef]);\n },\n },\n \"$link\": {\n get(this: ObjectHolder) {\n return get$link(this);\n },\n },\n \"$clone\": {\n value(\n this: ObjectHolder,\n update: Record<string, any> | undefined,\n ) {\n // I think `rawObj` is the same thing as `this` and can be removed?\n const rawObj = this[UnderlyingOsdkObject] as SimpleOsdkProperties;\n const def = this[ObjectDefRef];\n\n if (update == null) {\n return createOsdkObject(this[ClientRef], def, { ...rawObj });\n }\n\n if (\n def.primaryKeyApiName in update\n && rawObj[def.primaryKeyApiName] !== update[def.primaryKeyApiName]\n ) {\n throw new Error(\n `Cannot update ${def.apiName} object with differing primary key values `,\n );\n }\n\n if (def.titleProperty in update && !(\"$title\" in update)) {\n update.$title = update[def.titleProperty];\n }\n\n const newObject = { ...this[UnderlyingOsdkObject], ...update };\n return createOsdkObject(this[ClientRef], this[ObjectDefRef], newObject);\n },\n },\n \"$objectSpecifier\": {\n get(this: ObjectHolder) {\n const rawObj = this[UnderlyingOsdkObject];\n return createObjectSpecifierFromPrimaryKey(\n this[ObjectDefRef],\n rawObj.$primaryKey,\n );\n },\n enumerable: true,\n },\n \"$propertySecurities\": {\n get(this: ObjectHolder) {\n return this[PropertySecuritiesRef];\n },\n enumerable: true,\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata\": {\n get(this: ObjectHolder) {\n return {\n ObjectMetadata: this[ObjectDefRef],\n };\n },\n enumerable: false,\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue\": {\n value(\n this: ObjectHolder,\n propertyApiName: string,\n options?: FormatPropertyOptions,\n ): string | undefined {\n const rawObj = this[UnderlyingOsdkObject] as SimpleOsdkProperties;\n const def = this[ObjectDefRef];\n const propertyValue = rawObj[propertyApiName];\n\n return applyPropertyFormatter(\n propertyValue,\n def.properties[propertyApiName],\n rawObj,\n options,\n );\n },\n enumerable: false,\n },\n};\n\n/**\n * @internal\n * @param client\n * @param objectDef\n * @param simpleOsdkProperties\n */\nexport function createOsdkObject(\n client: MinimalClient,\n objectDef: FetchedObjectTypeDefinition,\n simpleOsdkProperties: SimpleOsdkProperties,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata = {},\n wirePropertySecurities: PropertySecurities[] | undefined = [],\n): ObjectHolder {\n const { parsedObject, clientPropertySecurities } = parseWhenSecuritiesLoaded(\n wirePropertySecurities,\n simpleOsdkProperties,\n objectDef,\n derivedPropertyTypeByName,\n );\n\n // updates the object's \"hidden class/map\".\n const rawObj = parsedObject as ObjectHolder;\n Object.defineProperties(\n rawObj,\n {\n [UnderlyingOsdkObject]: {\n enumerable: false,\n value: simpleOsdkProperties,\n },\n [PropertySecuritiesRef]: {\n enumerable: false,\n value: clientPropertySecurities,\n },\n [ObjectDefRef]: { value: objectDef, enumerable: false }, // TODO: Potentially update when GA metadata field\n [ClientRef]: { value: client, enumerable: false },\n ...basePropDefs,\n } satisfies Record<keyof ObjectHolder, PropertyDescriptor>,\n );\n\n // Assign the special values\n for (const propKey of Object.keys(rawObj)) {\n if (\n propKey in objectDef.properties\n && typeof (objectDef.properties[propKey].type) === \"string\"\n && specialPropertyTypes.has(objectDef.properties[propKey].type)\n ) {\n rawObj[propKey] = createSpecialProperty(\n client,\n objectDef,\n rawObj,\n propKey,\n );\n } else if (propKey in derivedPropertyTypeByName) {\n rawObj[propKey] = modifyRdpProperties(\n client,\n derivedPropertyTypeByName,\n rawObj[propKey],\n propKey,\n );\n }\n }\n\n return Object.freeze(rawObj);\n}\n\nfunction modifyRdpProperties(\n client: MinimalClient,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n rawValue: any,\n propKey: string,\n): any {\n if (\n derivedPropertyTypeByName[propKey].definition.type === \"selection\"\n && derivedPropertyTypeByName[propKey].definition.operation.type\n === \"count\"\n ) {\n const num = Number(rawValue);\n invariant(\n Number.isSafeInteger(num),\n \"Count aggregation for derived property \" + propKey\n + \" returned a value larger than safe integer.\",\n );\n return num;\n } // Selected or collected properties need to be deserialized specially when constructed with RDP\n else if (\n derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType\n != null\n && typeof (derivedPropertyTypeByName[propKey]\n .selectedOrCollectedPropertyType.type)\n === \"string\"\n && specialPropertyTypes.has(\n derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType\n .type,\n )\n ) {\n switch (\n derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType\n ?.type\n ) {\n case \"attachment\":\n if (Array.isArray(rawValue)) {\n return rawValue.map(a =>\n hydrateAttachmentFromRidInternal(client, a.rid)\n );\n } else {\n return hydrateAttachmentFromRidInternal(\n client,\n (rawValue as Attachment).rid,\n );\n }\n break;\n default:\n invariant(\n false,\n \"Derived property aggregations for Timeseries and Media are not supported\",\n );\n }\n }\n return rawValue;\n}\n\nfunction createSpecialProperty(\n client: MinimalClient,\n objectDef: FetchedObjectTypeDefinition,\n rawObject: ObjectHolder,\n p: keyof typeof rawObject & string | symbol,\n) {\n const rawValue = rawObject[p as any];\n const propDef = objectDef.properties[p as any];\n if (process.env.NODE_ENV !== \"production\") {\n invariant(\n propDef != null && typeof propDef.type === \"string\"\n && specialPropertyTypes.has(propDef.type),\n );\n }\n if (propDef.type === \"attachment\") {\n if (Array.isArray(rawValue)) {\n return rawValue.map(a => hydrateAttachmentFromRidInternal(client, a.rid));\n }\n return hydrateAttachmentFromRidInternal(\n client,\n (rawValue as Attachment).rid,\n );\n }\n\n if (\n propDef.type === \"numericTimeseries\"\n || propDef.type === \"stringTimeseries\"\n || propDef.type === \"sensorTimeseries\"\n ) {\n return new TimeSeriesPropertyImpl<\n (typeof propDef)[\"type\"] extends \"numericTimeseries\" ? number\n : (typeof propDef)[\"type\"] extends \"stringTimeseries\" ? string\n : number | string\n >(\n client,\n objectDef.apiName,\n rawObject[objectDef.primaryKeyApiName as string],\n p as string,\n );\n }\n\n if (propDef.type === \"geotimeSeriesReference\") {\n return new GeotimeSeriesPropertyImpl<GeoJSON.Point>(\n client,\n objectDef.apiName,\n rawObject[objectDef.primaryKeyApiName as string],\n p as string,\n (rawValue as ReferenceValue).type === \"geotimeSeriesValue\"\n ? {\n time: (rawValue as ReferenceValue).timestamp,\n value: {\n type: \"Point\",\n coordinates: (rawValue as ReferenceValue).position,\n },\n }\n : undefined,\n );\n }\n if (propDef.type === \"mediaReference\") {\n return new MediaReferencePropertyImpl({\n client,\n objectApiName: objectDef.apiName,\n primaryKey: rawObject[objectDef.primaryKeyApiName as string],\n propertyName: p as string,\n mediaReference: rawValue as MediaReference,\n });\n }\n}\n\nfunction parseWhenSecuritiesLoaded(\n wirePropertySecurities: PropertySecurities[] | undefined,\n rawObject: SimpleOsdkProperties,\n objectDef: FetchedObjectTypeDefinition,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata = {},\n): {\n parsedObject: SimpleOsdkProperties;\n clientPropertySecurities:\n | { [propName: string]: PropertySecurity[] | PropertySecurity[][] }\n | undefined;\n} {\n if (wirePropertySecurities == null || wirePropertySecurities.length === 0) {\n return { parsedObject: rawObject, clientPropertySecurities: undefined };\n }\n\n const parsedObject: SimpleOsdkProperties = rawObject;\n const clientPropertySecurities: {\n [propName: string]: PropertySecurity[] | PropertySecurity[][];\n } = {};\n\n for (const propKey of Object.keys(rawObject)) {\n if (\n propKey in objectDef.properties\n || propKey in derivedPropertyTypeByName\n || securableSpecialKeys.has(propKey)\n ) {\n const value = rawObject[propKey];\n\n if (Array.isArray(value)) {\n const newVal: any[] = [];\n const newSecurities: PropertySecurity[][] = [];\n value.forEach(spv => {\n invariant(\n typeof spv === \"object\"\n && spv != null\n && \"value\" in spv\n && \"propertySecurityIndex\" in spv,\n \"Expected destructured secured property value object in array\",\n );\n const securedValue = spv as SecuredPropertyValue;\n newVal.push(securedValue.value);\n const securityIndex = securedValue.propertySecurityIndex;\n invariant(\n securityIndex != null,\n \"Expected property security index to be defined\",\n );\n invariant(\n securityIndex < wirePropertySecurities.length,\n \"Expected property security index to be within bounds\",\n );\n newSecurities.push(\n wirePropertySecurities[securityIndex].disjunction\n .map(wireToClientPropertySecurities),\n );\n });\n parsedObject[propKey] = newVal;\n clientPropertySecurities[propKey] = newSecurities;\n } // Check if this is a secured property value object\n else if (\n typeof value === \"object\"\n && value != null\n && \"value\" in value\n && \"propertySecurityIndex\" in value\n ) {\n const securedValue = value as SecuredPropertyValue;\n parsedObject[propKey] = securedValue.value;\n\n const securityIndex = securedValue.propertySecurityIndex;\n invariant(\n securityIndex != null,\n \"Expected property security index to be defined\",\n );\n invariant(\n securityIndex < wirePropertySecurities.length,\n \"Expected property security index to be within bounds\",\n );\n clientPropertySecurities[propKey] =\n wirePropertySecurities[securityIndex].disjunction\n .map(wireToClientPropertySecurities);\n } else {\n // Regular property without security\n parsedObject[propKey] = value;\n }\n }\n }\n\n return { parsedObject, clientPropertySecurities };\n}\n\nfunction wireToClientPropertySecurities(\n propertySecurity: WirePropertySecurity,\n): 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 { type: \"errorComputingSecurity\" };\n case \"unsupportedPolicy\":\n return { type: \"unsupportedPolicy\" };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,0BAA0B,QAAQ,uCAAuC;AAClF,SAASC,sBAAsB,QAAQ,mCAAmC;AAI1E,SAASC,gCAAgC,QAAQ,gDAAgD;AACjG,SAASC,mCAAmC,QAAQ,oCAAoC;AACxF,SACEC,sBAAsB,QAEjB,yCAAyC;AAEhD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACEC,SAAS,EACTC,YAAY,EACZC,qBAAqB,EACrBC,oBAAoB,QACf,sBAAsB;AAG7B,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAClC,CACE,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,CAEtB,CAAC;AAED,MA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A,oBAD/C7D,SAAS,QAEP,sDAAsD,IAFxDA,SAAS;QAIT0C,wBAAwB,CAACI,OAAO,CAAC,GAC/BN,sBAAsB,CAAC+C,aAAa,CAAC,CAACE,WAAW,CAC9CxB,GAAG,CAACyB,8BAA8B,CAAC;MAC1C,CAAC,MAAM;QACL;QACAjD,YAAY,CAACK,OAAO,CAAC,GAAG5B,KAAK;MAC/B;IACF;EACF;EAEA,OAAO;IAAEuB,YAAY;IAAEC;EAAyB,CAAC;AACnD;AAEA,SAASgD,8BAA8BA,CACrCC,gBAAsC,EACpB;EAClB,QAAQA,gBAAgB,CAAC3C,IAAI;IAC3B,KAAK,wBAAwB;MAC3B,OAAO;QACLA,IAAI,EAAE,kBAAkB;QACxB4C,WAAW,EAAED,gBAAgB,CAACC,WAAW;QACzCC,oBAAoB,EAAEF,gBAAgB,CAACE,oBAAoB;QAC3DC,WAAW,EAAEH,gBAAgB,CAACG,WAAW;QACzCC,oBAAoB,EAAEJ,gBAAgB,CAACI;MACzC,CAAC;IACH,KAAK,wBAAwB;MAC3B,OAAO;QAAE/C,IAAI,EAAE;MAAyB,CAAC;IAC3C,KAAK,mBAAmB;MACtB,OAAO;QAAEA,IAAI,EAAE;MAAoB,CAAC;EACxC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"createOsdkObject.js","names":["invariant","CipherTextPropertyImpl","GeotimeSeriesPropertyImpl","MediaReferencePropertyImpl","TimeSeriesPropertyImpl","hydrateAttachmentFromRidInternal","createObjectSpecifierFromPrimaryKey","applyPropertyFormatter","get$as","get$link","ClientRef","ObjectDefRef","PropertySecuritiesRef","UnderlyingOsdkObject","specialPropertyTypes","Set","securableSpecialKeys","basePropDefs","get","value","update","rawObj","def","createOsdkObject","primaryKeyApiName","Error","apiName","titleProperty","$title","newObject","$primaryKey","enumerable","ObjectMetadata","propertyApiName","options","propertyValue","properties","client","objectDef","simpleOsdkProperties","derivedPropertyTypeByName","wirePropertySecurities","parsedObject","clientPropertySecurities","parseWhenSecuritiesLoaded","Object","defineProperties","propKey","keys","type","has","createSpecialProperty","modifyRdpProperties","freeze","rawValue","definition","operation","num","Number","isSafeInteger","process","env","NODE_ENV","selectedOrCollectedPropertyType","Array","isArray","map","a","rid","rawObject","p","propDef","objectApiName","primaryKey","propertyName","time","timestamp","coordinates","position","undefined","mediaReference","length","newVal","newSecurities","forEach","spv","securedValue","push","securityIndex","propertySecurityIndex","disjunction","wireToClientPropertySecurities","propertySecurity","conjunctive","containerConjunctive","disjunctive","containerDisjunctive"],"sources":["createOsdkObject.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { BaseWirePropertyTypes, PropertySecurity } from \"@osdk/api\";\nimport type { MediaReference } from \"@osdk/foundry.core\";\nimport type {\n Attachment,\n PropertySecurities,\n PropertySecurity as WirePropertySecurity,\n ReferenceValue,\n SecuredPropertyValue,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { CipherTextPropertyImpl } from \"../../createCipherTextProperty.js\";\nimport { GeotimeSeriesPropertyImpl } from \"../../createGeotimeSeriesProperty.js\";\nimport { MediaReferencePropertyImpl } from \"../../createMediaReferenceProperty.js\";\nimport { TimeSeriesPropertyImpl } from \"../../createTimeseriesProperty.js\";\nimport type { DerivedPropertyRuntimeMetadata } from \"../../derivedProperties/derivedPropertyRuntimeMetadata.js\";\nimport type { MinimalClient } from \"../../MinimalClientContext.js\";\nimport type { FetchedObjectTypeDefinition } from \"../../ontology/OntologyProvider.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../../public-utils/hydrateAttachmentFromRid.js\";\nimport { createObjectSpecifierFromPrimaryKey } from \"../../util/objectSpecifierUtils.js\";\nimport {\n applyPropertyFormatter,\n type FormatPropertyOptions,\n} from \"../formatting/applyPropertyFormatter.js\";\nimport type { SimpleOsdkProperties } from \"../SimpleOsdkProperties.js\";\nimport { get$as } from \"./getDollarAs.js\";\nimport { get$link } from \"./getDollarLink.js\";\nimport {\n ClientRef,\n ObjectDefRef,\n PropertySecuritiesRef,\n UnderlyingOsdkObject,\n} from \"./InternalSymbols.js\";\nimport type { ObjectHolder } from \"./ObjectHolder.js\";\n\nconst specialPropertyTypes = new Set<BaseWirePropertyTypes>(\n [\n \"attachment\",\n \"cipherText\",\n \"geotimeSeriesReference\",\n \"mediaReference\",\n \"numericTimeseries\",\n \"stringTimeseries\",\n \"sensorTimeseries\",\n ],\n);\n\nconst securableSpecialKeys = new Set([\"$primaryKey\", \"$title\"]);\n\n// kept separate so we are not redefining these functions\n// every time an object is created.\nconst basePropDefs = {\n \"$as\": {\n get(this: ObjectHolder) {\n return get$as(this[ObjectDefRef]);\n },\n },\n \"$link\": {\n get(this: ObjectHolder) {\n return get$link(this);\n },\n },\n \"$clone\": {\n value(\n this: ObjectHolder,\n update: Record<string, any> | undefined,\n ) {\n // I think `rawObj` is the same thing as `this` and can be removed?\n const rawObj = this[UnderlyingOsdkObject] as SimpleOsdkProperties;\n const def = this[ObjectDefRef];\n\n if (update == null) {\n return createOsdkObject(this[ClientRef], def, { ...rawObj });\n }\n\n if (\n def.primaryKeyApiName in update\n && rawObj[def.primaryKeyApiName] !== update[def.primaryKeyApiName]\n ) {\n throw new Error(\n `Cannot update ${def.apiName} object with differing primary key values `,\n );\n }\n\n if (def.titleProperty in update && !(\"$title\" in update)) {\n update.$title = update[def.titleProperty];\n }\n\n const newObject = { ...this[UnderlyingOsdkObject], ...update };\n return createOsdkObject(this[ClientRef], this[ObjectDefRef], newObject);\n },\n },\n \"$objectSpecifier\": {\n get(this: ObjectHolder) {\n const rawObj = this[UnderlyingOsdkObject];\n return createObjectSpecifierFromPrimaryKey(\n this[ObjectDefRef],\n rawObj.$primaryKey,\n );\n },\n enumerable: true,\n },\n \"$propertySecurities\": {\n get(this: ObjectHolder) {\n return this[PropertySecuritiesRef];\n },\n enumerable: true,\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata\": {\n get(this: ObjectHolder) {\n return {\n ObjectMetadata: this[ObjectDefRef],\n };\n },\n enumerable: false,\n },\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue\": {\n value(\n this: ObjectHolder,\n propertyApiName: string,\n options?: FormatPropertyOptions,\n ): string | undefined {\n const rawObj = this[UnderlyingOsdkObject] as SimpleOsdkProperties;\n const def = this[ObjectDefRef];\n const propertyValue = rawObj[propertyApiName];\n\n return applyPropertyFormatter(\n propertyValue,\n def.properties[propertyApiName],\n rawObj,\n options,\n );\n },\n enumerable: false,\n },\n};\n\n/**\n * @internal\n * @param client\n * @param objectDef\n * @param simpleOsdkProperties\n */\nexport function createOsdkObject(\n client: MinimalClient,\n objectDef: FetchedObjectTypeDefinition,\n simpleOsdkProperties: SimpleOsdkProperties,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata = {},\n wirePropertySecurities: PropertySecurities[] | undefined = [],\n): ObjectHolder {\n const { parsedObject, clientPropertySecurities } = parseWhenSecuritiesLoaded(\n wirePropertySecurities,\n simpleOsdkProperties,\n objectDef,\n derivedPropertyTypeByName,\n );\n\n // updates the object's \"hidden class/map\".\n const rawObj = parsedObject as ObjectHolder;\n Object.defineProperties(\n rawObj,\n {\n [UnderlyingOsdkObject]: {\n enumerable: false,\n value: simpleOsdkProperties,\n },\n [PropertySecuritiesRef]: {\n enumerable: false,\n value: clientPropertySecurities,\n },\n [ObjectDefRef]: { value: objectDef, enumerable: false }, // TODO: Potentially update when GA metadata field\n [ClientRef]: { value: client, enumerable: false },\n ...basePropDefs,\n } satisfies Record<keyof ObjectHolder, PropertyDescriptor>,\n );\n\n // Assign the special values\n for (const propKey of Object.keys(rawObj)) {\n if (\n propKey in objectDef.properties\n && typeof (objectDef.properties[propKey].type) === \"string\"\n && specialPropertyTypes.has(objectDef.properties[propKey].type)\n ) {\n rawObj[propKey] = createSpecialProperty(\n client,\n objectDef,\n rawObj,\n propKey,\n );\n } else if (propKey in derivedPropertyTypeByName) {\n rawObj[propKey] = modifyRdpProperties(\n client,\n derivedPropertyTypeByName,\n rawObj[propKey],\n propKey,\n );\n }\n }\n\n return Object.freeze(rawObj);\n}\n\nfunction modifyRdpProperties(\n client: MinimalClient,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n rawValue: any,\n propKey: string,\n): any {\n if (\n derivedPropertyTypeByName[propKey].definition.type === \"selection\"\n && derivedPropertyTypeByName[propKey].definition.operation.type\n === \"count\"\n ) {\n const num = Number(rawValue);\n invariant(\n Number.isSafeInteger(num),\n \"Count aggregation for derived property \" + propKey\n + \" returned a value larger than safe integer.\",\n );\n return num;\n } // Selected or collected properties need to be deserialized specially when constructed with RDP\n else if (\n derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType\n != null\n && typeof (derivedPropertyTypeByName[propKey]\n .selectedOrCollectedPropertyType.type)\n === \"string\"\n && specialPropertyTypes.has(\n derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType\n .type,\n )\n ) {\n switch (\n derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType\n ?.type\n ) {\n case \"attachment\":\n if (Array.isArray(rawValue)) {\n return rawValue.map(a =>\n hydrateAttachmentFromRidInternal(client, a.rid)\n );\n } else {\n return hydrateAttachmentFromRidInternal(\n client,\n (rawValue as Attachment).rid,\n );\n }\n break;\n default:\n invariant(\n false,\n \"Derived property aggregations for Timeseries and Media are not supported\",\n );\n }\n }\n return rawValue;\n}\n\nfunction createSpecialProperty(\n client: MinimalClient,\n objectDef: FetchedObjectTypeDefinition,\n rawObject: ObjectHolder,\n p: keyof typeof rawObject & string | symbol,\n) {\n const rawValue = rawObject[p as any];\n const propDef = objectDef.properties[p as any];\n if (process.env.NODE_ENV !== \"production\") {\n invariant(\n propDef != null && typeof propDef.type === \"string\"\n && specialPropertyTypes.has(propDef.type),\n );\n }\n if (propDef.type === \"attachment\") {\n if (Array.isArray(rawValue)) {\n return rawValue.map(a => hydrateAttachmentFromRidInternal(client, a.rid));\n }\n return hydrateAttachmentFromRidInternal(\n client,\n (rawValue as Attachment).rid,\n );\n }\n if (propDef.type === \"cipherText\") {\n return new CipherTextPropertyImpl(\n {\n client,\n objectApiName: objectDef.apiName,\n primaryKey: rawObject[\n objectDef.primaryKeyApiName as string\n ],\n propertyName: p as string,\n },\n );\n }\n if (\n propDef.type === \"numericTimeseries\"\n || propDef.type === \"stringTimeseries\"\n || propDef.type === \"sensorTimeseries\"\n ) {\n return new TimeSeriesPropertyImpl<\n (typeof propDef)[\"type\"] extends \"numericTimeseries\" ? number\n : (typeof propDef)[\"type\"] extends \"stringTimeseries\" ? string\n : number | string\n >(\n client,\n objectDef.apiName,\n rawObject[objectDef.primaryKeyApiName as string],\n p as string,\n );\n }\n\n if (propDef.type === \"geotimeSeriesReference\") {\n return new GeotimeSeriesPropertyImpl<GeoJSON.Point>(\n client,\n objectDef.apiName,\n rawObject[objectDef.primaryKeyApiName as string],\n p as string,\n (rawValue as ReferenceValue).type === \"geotimeSeriesValue\"\n ? {\n time: (rawValue as ReferenceValue).timestamp,\n value: {\n type: \"Point\",\n coordinates: (rawValue as ReferenceValue).position,\n },\n }\n : undefined,\n );\n }\n if (propDef.type === \"mediaReference\") {\n return new MediaReferencePropertyImpl({\n client,\n objectApiName: objectDef.apiName,\n primaryKey: rawObject[objectDef.primaryKeyApiName as string],\n propertyName: p as string,\n mediaReference: rawValue as MediaReference,\n });\n }\n}\n\nfunction parseWhenSecuritiesLoaded(\n wirePropertySecurities: PropertySecurities[] | undefined,\n rawObject: SimpleOsdkProperties,\n objectDef: FetchedObjectTypeDefinition,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata = {},\n): {\n parsedObject: SimpleOsdkProperties;\n clientPropertySecurities:\n | { [propName: string]: PropertySecurity[] | PropertySecurity[][] }\n | undefined;\n} {\n if (wirePropertySecurities == null || wirePropertySecurities.length === 0) {\n return { parsedObject: rawObject, clientPropertySecurities: undefined };\n }\n\n const parsedObject: SimpleOsdkProperties = rawObject;\n const clientPropertySecurities: {\n [propName: string]: PropertySecurity[] | PropertySecurity[][];\n } = {};\n\n for (const propKey of Object.keys(rawObject)) {\n if (\n propKey in objectDef.properties\n || propKey in derivedPropertyTypeByName\n || securableSpecialKeys.has(propKey)\n ) {\n const value = rawObject[propKey];\n\n if (Array.isArray(value)) {\n const newVal: any[] = [];\n const newSecurities: PropertySecurity[][] = [];\n value.forEach(spv => {\n invariant(\n typeof spv === \"object\"\n && spv != null\n && \"value\" in spv\n && \"propertySecurityIndex\" in spv,\n \"Expected destructured secured property value object in array\",\n );\n const securedValue = spv as SecuredPropertyValue;\n newVal.push(securedValue.value);\n const securityIndex = securedValue.propertySecurityIndex;\n invariant(\n securityIndex != null,\n \"Expected property security index to be defined\",\n );\n invariant(\n securityIndex < wirePropertySecurities.length,\n \"Expected property security index to be within bounds\",\n );\n newSecurities.push(\n wirePropertySecurities[securityIndex].disjunction\n .map(wireToClientPropertySecurities),\n );\n });\n parsedObject[propKey] = newVal;\n clientPropertySecurities[propKey] = newSecurities;\n } // Check if this is a secured property value object\n else if (\n typeof value === \"object\"\n && value != null\n && \"value\" in value\n && \"propertySecurityIndex\" in value\n ) {\n const securedValue = value as SecuredPropertyValue;\n parsedObject[propKey] = securedValue.value;\n\n const securityIndex = securedValue.propertySecurityIndex;\n invariant(\n securityIndex != null,\n \"Expected property security index to be defined\",\n );\n invariant(\n securityIndex < wirePropertySecurities.length,\n \"Expected property security index to be within bounds\",\n );\n clientPropertySecurities[propKey] =\n wirePropertySecurities[securityIndex].disjunction\n .map(wireToClientPropertySecurities);\n } else {\n // Regular property without security\n parsedObject[propKey] = value;\n }\n }\n }\n\n return { parsedObject, clientPropertySecurities };\n}\n\nfunction wireToClientPropertySecurities(\n propertySecurity: WirePropertySecurity,\n): 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 { type: \"errorComputingSecurity\" };\n case \"unsupportedPolicy\":\n return { type: \"unsupportedPolicy\" };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,QAAQ,mCAAmC;AAC1E,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,0BAA0B,QAAQ,uCAAuC;AAClF,SAASC,sBAAsB,QAAQ,mCAAmC;AAI1E,SAASC,gCAAgC,QAAQ,gDAAgD;AACjG,SAASC,mCAAmC,QAAQ,oCAAoC;AACxF,SACEC,sBAAsB,QAEjB,yCAAyC;AAEhD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACEC,SAAS,EACTC,YAAY,EACZC,qBAAqB,EACrBC,oBAAoB,QACf,sBAAsB;AAG7B,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAClC,CACE,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,CAEtB,CAAC;AAED,MAAMC,oBAAoB,GAAG,IAAID,GAAG,CAAC,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;;AAE/D;AACA;AACA,MAAME,YAAY,GAAG;EACnB,KAAK,EAAE;IACLC,GAAGA,CAAA,EAAqB;MACtB,OAAOV,MAAM,CAAC,IAA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AG/C,sBAAsB,CAACwC,MAAM,IAAArB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD/C9D,SAAS,QAEP,sDAAsD,IAFxDA,SAAS;QAIT2C,wBAAwB,CAACI,OAAO,CAAC,GAC/BN,sBAAsB,CAAC+C,aAAa,CAAC,CAACE,WAAW,CAC9CxB,GAAG,CAACyB,8BAA8B,CAAC;MAC1C,CAAC,MAAM;QACL;QACAjD,YAAY,CAACK,OAAO,CAAC,GAAG5B,KAAK;MAC/B;IACF;EACF;EAEA,OAAO;IAAEuB,YAAY;IAAEC;EAAyB,CAAC;AACnD;AAEA,SAASgD,8BAA8BA,CACrCC,gBAAsC,EACpB;EAClB,QAAQA,gBAAgB,CAAC3C,IAAI;IAC3B,KAAK,wBAAwB;MAC3B,OAAO;QACLA,IAAI,EAAE,kBAAkB;QACxB4C,WAAW,EAAED,gBAAgB,CAACC,WAAW;QACzCC,oBAAoB,EAAEF,gBAAgB,CAACE,oBAAoB;QAC3DC,WAAW,EAAEH,gBAAgB,CAACG,WAAW;QACzCC,oBAAoB,EAAEJ,gBAAgB,CAACI;MACzC,CAAC;IACH,KAAK,wBAAwB;MAC3B,OAAO;QAAE/C,IAAI,EAAE;MAAyB,CAAC;IAC3C,KAAK,mBAAmB;MACtB,OAAO;QAAEA,IAAI,EAAE;MAAoB,CAAC;EACxC;AACF","ignoreList":[]}
@@ -14,6 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const USER_AGENT = `osdk-client/${"2.40.0"}`;
18
- export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.40.0"}`;
17
+ export const USER_AGENT = `osdk-client/${"2.41.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a"}`;
18
+ export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.41.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a"}`;
19
19
  //# sourceMappingURL=UserAgent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"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 const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,yBAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,oCAAuD","ignoreList":[]}
1
+ {"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"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 const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,uEAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,kFAAuD","ignoreList":[]}
@@ -81,7 +81,7 @@ export interface Client extends SharedClient, OldSharedClient {
81
81
  */
82
82
  fetchMetadata<Q extends (ObjectTypeDefinition | InterfaceDefinition | ActionDefinition<any> | QueryDefinition<any>)>(o: Q): Promise<Q extends ObjectTypeDefinition ? ObjectMetadata : Q extends InterfaceDefinition ? InterfaceMetadata : Q extends ActionDefinition<any> ? ActionMetadata : Q extends QueryDefinition<any> ? QueryMetadata : never>;
83
83
  }
84
- declare const MaxOsdkVersion = "2.40.0";
84
+ declare const MaxOsdkVersion = "2.41.0";
85
85
  export type MaxOsdkVersion = typeof MaxOsdkVersion;
86
86
  declare const ErrorMessage: unique symbol;
87
87
  export {};
@@ -0,0 +1,12 @@
1
+ import type { CipherText } from "@osdk/api";
2
+ import type { MinimalClient } from "./MinimalClientContext.js";
3
+ export declare class CipherTextPropertyImpl implements CipherText {
4
+ #private;
5
+ constructor(args: {
6
+ client: MinimalClient
7
+ objectApiName: string
8
+ primaryKey: any
9
+ propertyName: string
10
+ });
11
+ decrypt(): Promise<string>;
12
+ }
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,kBAAkB,WAAY;AAG5C,cAAc,qBAAqB,2BAA4B;AAE/D,OAAO,cAAM,kCAAkC,WAAW;;CAIxD,YAAYA,MAAM;EAChB,QAAQ;EACR;EACA;EACA;CACD;CAMD,AAAM,WAAW;AAalB","names":["args: {\n client: MinimalClient;\n objectApiName: string;\n primaryKey: any;\n propertyName: string;\n }"],"sources":["../../src/createCipherTextProperty.ts"],"version":3,"file":"createCipherTextProperty.d.ts"}
@@ -1,5 +1,5 @@
1
1
  export { isOk } from "@osdk/api";
2
- export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, DerivedProperty, InterfaceDefinition, InterfaceMetadata, Logger, Media, MediaFullMetadata, MediaItemMetadata, MediaMetadata, MediaReference, MediaUpload, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, UnknownMediaItemMetadata, VersionBound, WhereClause } from "@osdk/api";
2
+ export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CipherText, CompileTimeMetadata, DerivedProperty, InterfaceDefinition, InterfaceMetadata, Logger, Media, MediaFullMetadata, MediaItemMetadata, MediaMetadata, MediaReference, MediaUpload, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, UnknownMediaItemMetadata, VersionBound, WhereClause } from "@osdk/api";
3
3
  export { PalantirApiError } from "@osdk/shared.net.errors";
4
4
  export { ActionValidationError } from "./actions/ActionValidationError.js";
5
5
  export type { Client } from "./Client.js";
@@ -1 +1 @@
1
- {"mappings":"AAkBA,SAAS,YAAY;AACrB,cACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,YACA,qBACA,iBACA,qBACA,mBACA,QACA,OACA,mBACA,mBACA,eACA,gBACA,aACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,8BACA,wBACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,OACA,QACA,oBACA,6BACA,2BACA,0BACA,cACA,mBACK;AACP,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,cAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,cAAc,sBAAsB;AACpC,SAAS,8BAA8B;AACvC,cAAc,qBAAqB;AAEnC,cAAc,aAAa,qBAAqB;AAChD,SAAS,kBAAkB,mBAAmB;AAE9C,SACE,aACA,wBACA,wBACK;AAEP,SACE,qCACA,4CACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
1
+ {"mappings":"AAkBA,SAAS,YAAY;AACrB,cACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,YACA,YACA,qBACA,iBACA,qBACA,mBACA,QACA,OACA,mBACA,mBACA,eACA,gBACA,aACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,8BACA,wBACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,OACA,QACA,oBACA,6BACA,2BACA,0BACA,cACA,mBACK;AACP,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,cAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,cAAc,sBAAsB;AACpC,SAAS,8BAA8B;AACvC,cAAc,qBAAqB;AAEnC,cAAc,aAAa,qBAAqB;AAChD,SAAS,kBAAkB,mBAAmB;AAE9C,SACE,aACA,wBACA,wBACK;AAEP,SACE,qCACA,4CACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/client",
3
- "version": "2.40.0",
3
+ "version": "2.41.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -82,15 +82,15 @@
82
82
  "tiny-invariant": "^1.3.3",
83
83
  "type-fest": "^4.41.0",
84
84
  "ws": "^8.20.1",
85
- "@osdk/api": "~2.40.0",
86
- "@osdk/client.unstable": "2.40.0",
85
+ "@osdk/api": "~2.41.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a",
86
+ "@osdk/client.unstable": "2.41.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a",
87
+ "@osdk/generator-converters": "2.41.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a",
87
88
  "@osdk/shared.client.impl": "~1.13.0",
88
89
  "@osdk/shared.net.errors": "~2.11.0",
89
- "@osdk/generator-converters": "2.40.0",
90
90
  "@osdk/shared.net.fetch": "~1.11.0"
91
91
  },
92
92
  "peerDependencies": {
93
- "@osdk/shared.test": "^2.29.0"
93
+ "@osdk/shared.test": "^2.30.0-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a"
94
94
  },
95
95
  "peerDependenciesMeta": {
96
96
  "@osdk/shared.test": {
@@ -117,10 +117,10 @@
117
117
  "ts-expect": "^1.3.0",
118
118
  "typescript": "~5.5.4",
119
119
  "zod": "^3.25.76",
120
- "@osdk/client.test.ontology": "2.40.0",
120
+ "@osdk/client.test.ontology": "2.40.1-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a",
121
121
  "@osdk/monorepo.api-extractor": "~0.7.0",
122
122
  "@osdk/monorepo.tsconfig": "~0.7.0",
123
- "@osdk/shared.test.intellisense": "~0.7.0"
123
+ "@osdk/shared.test.intellisense": "~0.7.1-main-d24cc61b1e7fde7722d8229ed2b6821f5ce1bf8a"
124
124
  },
125
125
  "publishConfig": {
126
126
  "access": "public"