@osdk/client 2.26.0 → 2.26.1-main-5ff7aa5e89d44fb5b4f50b80614f80d7cd167ac1

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 (48) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/browser/Client.js +1 -1
  3. package/build/browser/Client.js.map +1 -1
  4. package/build/browser/scenarios/ScenarioClient.js +10 -4
  5. package/build/browser/scenarios/ScenarioClient.js.map +1 -1
  6. package/build/browser/scenarios/createScenario.js +3 -1
  7. package/build/browser/scenarios/createScenario.js.map +1 -1
  8. package/build/browser/util/UserAgent.js +2 -2
  9. package/build/browser/util/UserAgent.js.map +1 -1
  10. package/build/cjs/MediaReferenceProperty-SYUA2YYQ.cjs +22 -0
  11. package/build/cjs/{MediaReferenceProperty-CBPMMD73.cjs.map → MediaReferenceProperty-SYUA2YYQ.cjs.map} +1 -1
  12. package/build/cjs/{applyStreamingQuery-US6OU3WN.cjs → applyStreamingQuery-KNDRTOBJ.cjs} +13 -13
  13. package/build/cjs/{applyStreamingQuery-US6OU3WN.cjs.map → applyStreamingQuery-KNDRTOBJ.cjs.map} +1 -1
  14. package/build/cjs/{chunk-YP43NHIA.cjs → chunk-AN2R7X5W.cjs} +7 -7
  15. package/build/cjs/{chunk-YP43NHIA.cjs.map → chunk-AN2R7X5W.cjs.map} +1 -1
  16. package/build/cjs/{chunk-42JVCEPG.cjs → chunk-GHU5R2D3.cjs} +18 -18
  17. package/build/cjs/{chunk-42JVCEPG.cjs.map → chunk-GHU5R2D3.cjs.map} +1 -1
  18. package/build/cjs/{chunk-D26YLHTV.cjs → chunk-H6PXPU6F.cjs} +2 -2
  19. package/build/cjs/{chunk-D26YLHTV.cjs.map → chunk-H6PXPU6F.cjs.map} +1 -1
  20. package/build/cjs/{chunk-CAUXOFUO.cjs → chunk-HM2I7NAJ.cjs} +16 -16
  21. package/build/cjs/chunk-HM2I7NAJ.cjs.map +1 -0
  22. package/build/cjs/{chunk-ZFNHWPQA.cjs → chunk-HRWHTCP3.cjs} +23 -23
  23. package/build/cjs/{chunk-ZFNHWPQA.cjs.map → chunk-HRWHTCP3.cjs.map} +1 -1
  24. package/build/cjs/{chunk-W2AWD4AH.cjs → chunk-L6UNEOJR.cjs} +93 -87
  25. package/build/cjs/chunk-L6UNEOJR.cjs.map +1 -0
  26. package/build/cjs/{chunk-GVKJAORH.cjs → chunk-O5RH4FAR.cjs} +75 -75
  27. package/build/cjs/{chunk-GVKJAORH.cjs.map → chunk-O5RH4FAR.cjs.map} +1 -1
  28. package/build/cjs/index.cjs +14 -14
  29. package/build/cjs/public/experimental.cjs +9 -9
  30. package/build/cjs/public/internal.cjs +9 -9
  31. package/build/cjs/public/observable.cjs +8 -8
  32. package/build/cjs/public/unstable-do-not-use.cjs +20 -18
  33. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  34. package/build/cjs/{transformAndWaitInternal-2GORZXPK.cjs → transformAndWaitInternal-JGUDGNDJ.cjs} +7 -7
  35. package/build/cjs/{transformAndWaitInternal-2GORZXPK.cjs.map → transformAndWaitInternal-JGUDGNDJ.cjs.map} +1 -1
  36. package/build/esm/Client.js +1 -1
  37. package/build/esm/Client.js.map +1 -1
  38. package/build/esm/scenarios/ScenarioClient.js +10 -4
  39. package/build/esm/scenarios/ScenarioClient.js.map +1 -1
  40. package/build/esm/scenarios/createScenario.js +3 -1
  41. package/build/esm/scenarios/createScenario.js.map +1 -1
  42. package/build/esm/util/UserAgent.js +2 -2
  43. package/build/esm/util/UserAgent.js.map +1 -1
  44. package/build/types/Client.d.ts +1 -1
  45. package/package.json +10 -10
  46. package/build/cjs/MediaReferenceProperty-CBPMMD73.cjs +0 -22
  47. package/build/cjs/chunk-CAUXOFUO.cjs.map +0 -1
  48. package/build/cjs/chunk-W2AWD4AH.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @osdk/client
2
2
 
3
+ ## 2.26.1-main-5ff7aa5e89d44fb5b4f50b80614f80d7cd167ac1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5ff7aa5: Bump `@osdk/foundry.*` and `@osdk/internal.foundry.*` catalog entries from `2.61.0` to `2.63.0`. The OntologyScenarios endpoints now expose a `preview` query-param slot, so `createScenario` and the `EXPERIMENTAL_ScenarioClient` read methods pass `{ preview: true }` directly instead of relying on a fetch-level URL rewrite.
8
+ - Updated dependencies [5ff7aa5]
9
+ - @osdk/generator-converters@2.26.1-main-5ff7aa5e89d44fb5b4f50b80614f80d7cd167ac1
10
+ - @osdk/api@2.26.1-main-5ff7aa5e89d44fb5b4f50b80614f80d7cd167ac1
11
+ - @osdk/client.unstable@2.26.1-main-5ff7aa5e89d44fb5b4f50b80614f80d7cd167ac1
12
+
3
13
  ## 2.26.0
4
14
 
5
15
  ### Patch Changes
@@ -21,7 +21,7 @@
21
21
  export const additionalContext = Symbol("additionalContext");
22
22
 
23
23
  // BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.
24
- const MaxOsdkVersion = "2.26.0";
24
+ const MaxOsdkVersion = "2.26.1";
25
25
  // END: THIS IS GENERATED CODE. DO NOT EDIT.
26
26
 
27
27
  const ErrorMessage = Symbol("ErrorMessage");
@@ -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.26.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.26.1\";\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":[]}
@@ -76,7 +76,8 @@ export function buildScenarioClient(parent, scenarioRid) {
76
76
  const ontologyRid = await innerCtx.ontologyRid;
77
77
  const response = await OntologyScenarios.listScenarioEditedObjects(innerCtx, ontologyRid, scenarioRid, objectType.apiName, {
78
78
  pageSize: options?.pageSize,
79
- pageToken: options?.pageToken
79
+ pageToken: options?.pageToken,
80
+ preview: true
80
81
  });
81
82
  const data = response.data.map(entry => {
82
83
  const wire = entry;
@@ -94,7 +95,8 @@ export function buildScenarioClient(parent, scenarioRid) {
94
95
  const ontologyRid = await innerCtx.ontologyRid;
95
96
  const response = await OntologyScenarios.listScenarioEditedLinks(innerCtx, ontologyRid, scenarioRid, sourceObjectType.apiName, linkType, {
96
97
  pageSize: options?.pageSize,
97
- pageToken: options?.pageToken
98
+ pageToken: options?.pageToken,
99
+ preview: true
98
100
  });
99
101
  const data = [];
100
102
  for (const entry of response.data) {
@@ -134,7 +136,9 @@ export function buildScenarioClient(parent, scenarioRid) {
134
136
  getEditedEntityTypes: {
135
137
  value: async function () {
136
138
  const ontologyRid = await innerCtx.ontologyRid;
137
- const response = await OntologyScenarios.listScenarioEditedEntityTypes(innerCtx, ontologyRid, scenarioRid);
139
+ const response = await OntologyScenarios.listScenarioEditedEntityTypes(innerCtx, ontologyRid, scenarioRid, {
140
+ preview: true
141
+ });
138
142
  return {
139
143
  objectTypes: response.objectTypes,
140
144
  linkTypes: response.linkTypes
@@ -166,7 +170,9 @@ export function buildScenarioClient(parent, scenarioRid) {
166
170
  getEditedLinkTypes: {
167
171
  value: async function (sourceObjectType) {
168
172
  const ontologyRid = await innerCtx.ontologyRid;
169
- const response = await OntologyScenarios.listScenarioEditedLinkTypes(innerCtx, ontologyRid, scenarioRid, sourceObjectType.apiName);
173
+ const response = await OntologyScenarios.listScenarioEditedLinkTypes(innerCtx, ontologyRid, scenarioRid, sourceObjectType.apiName, {
174
+ preview: true
175
+ });
170
176
  return response.data;
171
177
  }
172
178
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ScenarioClient.js","names":["OntologyScenarios","additionalContext","createClientWithScenario","isScenarioClient","value","getScenarioReference","buildScenarioClient","parent","scenarioRid","ctx","transactionId","Error","inner","baseUrl","ontologyRid","tokenProvider","logger","UNSTABLE_DO_NOT_USE_BRANCH","branch","fetch","innerCtx","getEditedEntities","objectType","options","response","listScenarioEditedObjects","apiName","pageSize","pageToken","data","map","entry","wire","$apiName","__apiName","$primaryKey","__primaryKey","nextPageToken","getEditedLinks","sourceObjectType","linkType","listScenarioEditedLinks","sourceWire","sourceObject","source","linked","linkedObjects","targetWire","targetObject","target","push","Object","defineProperties","getEditedEntityTypes","listScenarioEditedEntityTypes","objectTypes","linkTypes","editedEntitiesAsyncIter","seen","Set","page","obj","key","has","add","getEditedLinkTypes","listScenarioEditedLinkTypes","editedLinksAsyncIter","link"],"sources":["ScenarioClient.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 {\n LinkTypeApiNamesFor,\n MinimalDirectedObjectLinkInstance,\n ObjectIdentifiers,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n PrimaryKeyType,\n} from \"@osdk/api\";\nimport { OntologyScenarios } from \"@osdk/foundry.ontologies\";\nimport { additionalContext, type Client } from \"../Client.js\";\nimport { createClientWithScenario } from \"../createClient.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\n/**\n * The set of many-to-many link types modified within a scenario for one source object type. Returned as part of\n * {@link ScenarioEditedEntityTypes.linkTypes}.\n */\nexport interface EditedLinksForObjectType {\n objectTypeApiName: string;\n linkTypes: string[];\n}\n\n/**\n * The object types and link types that have been modified within a scenario. Only many-to-many link type edits are\n * surfaced via `linkTypes`; one-to-many edits surface as object edits on the object type that owns the foreign key\n * property.\n */\nexport interface ScenarioEditedEntityTypes {\n objectTypes: string[];\n linkTypes: EditedLinksForObjectType[];\n}\n\n/**\n * A page of edited object identifiers within a scenario for a given object type. Returned by\n * {@link EXPERIMENTAL_ScenarioClient.getEditedEntities}. To load full property values, pass the primary keys back\n * through the scenario client, e.g.\n * `scenario(MyObject).where({ $primaryKey: { $in: keys } }).fetchPage()`.\n */\nexport interface EditedEntitiesPage<Q extends ObjectTypeDefinition> {\n data: ObjectIdentifiers<Q>[];\n nextPageToken?: string;\n}\n\n/**\n * A page of directed link instances edited within a scenario for a given source object type and link api name.\n * Returned by {@link EXPERIMENTAL_ScenarioClient.getEditedLinks}. Source and target carry only `$primaryKey` + `$apiName`.\n */\nexport interface EditedLinksPage<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n> {\n data: MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[];\n nextPageToken?: string;\n}\n\n/**\n * A {@link Client} attached to an ontology scenario. All read and write operations performed via this client are\n * scoped to that scenario. `EXPERIMENTAL_ScenarioClient` is a superset of {@link Client}.\n *\n * @beta This is an experimental, unstable feature subject to change.\n */\nexport interface EXPERIMENTAL_ScenarioClient extends Client {\n /**\n * The scenario RID this client is scoped to.\n */\n getScenarioReference(): string;\n\n /**\n * List the object types and many-to-many link types that have been modified within this scenario. Useful as a\n * pre-step before paginating individual edited objects per type.\n */\n getEditedEntityTypes(): Promise<ScenarioEditedEntityTypes>;\n\n /**\n * Get a page of object identifiers that have been\n * edited within this scenario for the given object type. Use the scenario client to fetch full property values\n * if needed.\n *\n * @example\n * ```ts\n * let pageToken: string | undefined;\n * const keys: string[] = [];\n * do {\n * const page = await scenario.getEditedEntities(Doctor, { pageSize: 500, pageToken });\n * keys.push(...page.data.map(o => o.$primaryKey));\n * pageToken = page.nextPageToken;\n * } while (pageToken);\n * ```\n */\n getEditedEntities<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedEntitiesPage<Q>>;\n\n /**\n * Stream object identifiers for the objects edited within this scenario for the\n * given object type. Pages are fetched lazily and deduplicated by `$primaryKey` across pages (Funnel may return\n * duplicates).\n *\n * @example\n * ```ts\n * for await (const obj of scenario.editedEntitiesAsyncIter(Doctor, { pageSize: 500 })) {\n * // obj.$primaryKey is the unique key for this edited object\n * }\n * ```\n */\n editedEntitiesAsyncIter<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<ObjectIdentifiers<Q>>;\n\n /**\n * List the outgoing many-to-many link API names that have been modified within this scenario for the given\n * source object type. One-to-many link edits surface as object edits on the FK-owning side and are not returned\n * here.\n */\n getEditedLinkTypes<Q extends ObjectOrInterfaceDefinition>(\n sourceObjectType: Q,\n ): Promise<LinkTypeApiNamesFor<Q>[]>;\n\n /**\n * Get a page of directed link instances edited within this scenario for a given source object type and link\n * api name. The page form returns a flattened array of `{ source, target, linkType }` triples.\n */\n getEditedLinks<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedLinksPage<Q, LINK_TYPE_API_NAME>>;\n\n /**\n * Stream directed link instances edited within this scenario for a given source object type and link api name.\n * Pages are fetched lazily.\n *\n * @example\n * ```ts\n * for await (\n * const { source, target, linkType } of scenario.editedLinksAsyncIter(Doctor, \"treats\")\n * ) {\n * graph.addEdge(source, target, linkType);\n * }\n * ```\n */\n editedLinksAsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n >;\n}\n\nexport function isScenarioClient(\n value: unknown,\n): value is EXPERIMENTAL_ScenarioClient {\n return (\n value != null\n && (typeof value === \"object\" || typeof value === \"function\")\n && typeof (value as { getScenarioReference?: unknown })\n .getScenarioReference === \"function\"\n );\n}\n\n/**\n * Shared internal builder used by both {@link withScenario} and {@link createScenario}. Validates the parent client\n * is not already inside a scenario or transaction, then constructs a fresh {@link Client} via\n * `createClientWithScenario` and decorates it with {@link EXPERIMENTAL_ScenarioClient}-only methods.\n *\n * @internal\n */\nexport function buildScenarioClient(\n parent: Client,\n scenarioRid: string,\n): EXPERIMENTAL_ScenarioClient {\n const ctx: MinimalClient = parent[additionalContext];\n\n if (ctx.transactionId != null) {\n throw new Error(\n \"withScenario / createScenario: the supplied client already has an active transaction. Scenarios cannot be nested on transactions.\",\n );\n }\n if (ctx.scenarioRid != null) {\n throw new Error(\n \"withScenario / createScenario: the supplied client already has an active scenario. Scenarios cannot be nested.\",\n );\n }\n\n const inner: Client = createClientWithScenario(\n scenarioRid,\n ctx.baseUrl,\n ctx.ontologyRid,\n ctx.tokenProvider,\n {\n logger: ctx.logger,\n UNSTABLE_DO_NOT_USE_BRANCH: ctx.branch,\n },\n ctx.fetch,\n );\n\n const innerCtx: MinimalClient = inner[additionalContext];\n\n async function getEditedEntityTypes(): Promise<ScenarioEditedEntityTypes> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedEntityTypes(\n innerCtx,\n ontologyRid,\n scenarioRid,\n );\n return {\n objectTypes: response.objectTypes,\n linkTypes: response.linkTypes,\n };\n }\n\n async function getEditedEntities<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedEntitiesPage<Q>> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedObjects(\n innerCtx,\n ontologyRid,\n scenarioRid,\n objectType.apiName,\n { pageSize: options?.pageSize, pageToken: options?.pageToken },\n );\n const data: ObjectIdentifiers<Q>[] = response.data.map((entry) => {\n const wire = entry as { __apiName?: unknown; __primaryKey?: unknown };\n return {\n $apiName: wire.__apiName as Q[\"apiName\"],\n $primaryKey: wire.__primaryKey as PrimaryKeyType<Q>,\n };\n });\n return {\n data,\n nextPageToken: response.nextPageToken,\n };\n }\n\n async function* editedEntitiesAsyncIter<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<ObjectIdentifiers<Q>> {\n const seen = new Set<unknown>();\n let pageToken: string | undefined;\n do {\n const page = await getEditedEntities(objectType, {\n pageSize: options?.pageSize,\n pageToken,\n });\n for (const obj of page.data) {\n const key = obj.$primaryKey;\n if (seen.has(key)) continue;\n seen.add(key);\n yield obj;\n }\n pageToken = page.nextPageToken;\n } while (pageToken != null);\n }\n\n async function getEditedLinkTypes<Q extends ObjectOrInterfaceDefinition>(\n sourceObjectType: Q,\n ): Promise<LinkTypeApiNamesFor<Q>[]> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedLinkTypes(\n innerCtx,\n ontologyRid,\n scenarioRid,\n sourceObjectType.apiName,\n );\n return response.data as LinkTypeApiNamesFor<Q>[];\n }\n\n async function getEditedLinks<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedLinksPage<Q, LINK_TYPE_API_NAME>> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedLinks(\n innerCtx,\n ontologyRid,\n scenarioRid,\n sourceObjectType.apiName,\n linkType as string,\n { pageSize: options?.pageSize, pageToken: options?.pageToken },\n );\n\n const data: MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[] = [];\n for (const entry of response.data) {\n const sourceWire = entry.sourceObject as\n | { __apiName?: unknown; __primaryKey?: unknown }\n | undefined;\n if (sourceWire?.__apiName == null || sourceWire.__primaryKey == null) {\n continue;\n }\n const source = {\n $apiName: sourceWire.__apiName,\n $primaryKey: sourceWire.__primaryKey,\n } as MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[\"source\"];\n\n for (const linked of entry.linkedObjects) {\n const targetWire = linked.targetObject as\n | { __apiName?: unknown; __primaryKey?: unknown }\n | undefined;\n if (targetWire?.__apiName == null || targetWire.__primaryKey == null) {\n continue;\n }\n const target = {\n $apiName: targetWire.__apiName,\n $primaryKey: targetWire.__primaryKey,\n } as MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[\"target\"];\n\n data.push({\n source,\n target,\n linkType: ((linked.linkType as string | undefined)\n ?? linkType) as LINK_TYPE_API_NAME,\n });\n }\n }\n\n return { data, nextPageToken: response.nextPageToken };\n }\n\n async function* editedLinksAsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n > {\n let pageToken: string | undefined;\n do {\n const page = await getEditedLinks(sourceObjectType, linkType, {\n pageSize: options?.pageSize,\n pageToken,\n });\n for (const link of page.data) {\n yield link;\n }\n pageToken = page.nextPageToken;\n } while (pageToken != null);\n }\n\n return Object.defineProperties(inner, {\n getScenarioReference: {\n value: () => scenarioRid,\n },\n getEditedEntityTypes: {\n value: getEditedEntityTypes,\n },\n getEditedEntities: {\n value: getEditedEntities,\n },\n editedEntitiesAsyncIter: {\n value: editedEntitiesAsyncIter,\n },\n getEditedLinkTypes: {\n value: getEditedLinkTypes,\n },\n getEditedLinks: {\n value: getEditedLinks,\n },\n editedLinksAsyncIter: {\n value: editedLinksAsyncIter,\n },\n }) as EXPERIMENTAL_ScenarioClient;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,iBAAiB,QAAqB,cAAc;AAC7D,SAASC,wBAAwB,QAAQ,oBAAoB;;AAG7D;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;;AAkGA,OAAO,SAASC,gBAAgBA,CAC9BC,KAAc,EACwB;EACtC,OACEA,KAAK,IAAI,IAAI,KACT,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,UAAU,CAAC,IAC1D,OAAQA,KAAK,CACXC,oBAAoB,KAAK,UAAU;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,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AAG,MAAMM,QAAQ,CAACN,WAAW;QAC9C,MAAMU,QAAQ,GAAG,MAAMxB,iBAAiB,CAACkE,2BAA2B,CAClE9C,QAAQ,EACRN,WAAW,EACXN,WAAW,EACX+B,gBAAgB,CAACb,OACnB,CAAC;QACD,OAAOF,QAAQ,CAACK,IAAI;MACtB;IA+FE,CAAC;IACDS,cAAc,EAAE;MACdlC,KAAK,EAAEkC;IACT,CAAC;IACD6B,oBAAoB,EAAE;MACpB/D,KAAK,EA3CT,gBAAAA,CAIEmC,gBAAmB,EACnBC,QAA4B,EAC5BjB,OAA+B,EAG/B;QACA,IAAIK,SAA6B;QACjC,GAAG;UACD,MAAMgC,IAAI,GAAG,MAAMtB,cAAc,CAACC,gBAAgB,EAAEC,QAAQ,EAAE;YAC5Db,QAAQ,EAAEJ,OAAO,EAAEI,QAAQ;YAC3BC;UACF,CAAC,CAAC;UACF,KAAK,MAAMwC,IAAI,IAAIR,IAAI,CAAC/B,IAAI,EAAE;YAC5B,MAAMuC,IAAI;UACZ;UACAxC,SAAS,GAAGgC,IAAI,CAACvB,aAAa;QAChC,CAAC,QAAQT,SAAS,IAAI,IAAI;MAC5B;IAuBE;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"ScenarioClient.js","names":["OntologyScenarios","additionalContext","createClientWithScenario","isScenarioClient","value","getScenarioReference","buildScenarioClient","parent","scenarioRid","ctx","transactionId","Error","inner","baseUrl","ontologyRid","tokenProvider","logger","UNSTABLE_DO_NOT_USE_BRANCH","branch","fetch","innerCtx","getEditedEntities","objectType","options","response","listScenarioEditedObjects","apiName","pageSize","pageToken","preview","data","map","entry","wire","$apiName","__apiName","$primaryKey","__primaryKey","nextPageToken","getEditedLinks","sourceObjectType","linkType","listScenarioEditedLinks","sourceWire","sourceObject","source","linked","linkedObjects","targetWire","targetObject","target","push","Object","defineProperties","getEditedEntityTypes","listScenarioEditedEntityTypes","objectTypes","linkTypes","editedEntitiesAsyncIter","seen","Set","page","obj","key","has","add","getEditedLinkTypes","listScenarioEditedLinkTypes","editedLinksAsyncIter","link"],"sources":["ScenarioClient.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 {\n LinkTypeApiNamesFor,\n MinimalDirectedObjectLinkInstance,\n ObjectIdentifiers,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n PrimaryKeyType,\n} from \"@osdk/api\";\nimport { OntologyScenarios } from \"@osdk/foundry.ontologies\";\nimport { additionalContext, type Client } from \"../Client.js\";\nimport { createClientWithScenario } from \"../createClient.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\n/**\n * The set of many-to-many link types modified within a scenario for one source object type. Returned as part of\n * {@link ScenarioEditedEntityTypes.linkTypes}.\n */\nexport interface EditedLinksForObjectType {\n objectTypeApiName: string;\n linkTypes: string[];\n}\n\n/**\n * The object types and link types that have been modified within a scenario. Only many-to-many link type edits are\n * surfaced via `linkTypes`; one-to-many edits surface as object edits on the object type that owns the foreign key\n * property.\n */\nexport interface ScenarioEditedEntityTypes {\n objectTypes: string[];\n linkTypes: EditedLinksForObjectType[];\n}\n\n/**\n * A page of edited object identifiers within a scenario for a given object type. Returned by\n * {@link EXPERIMENTAL_ScenarioClient.getEditedEntities}. To load full property values, pass the primary keys back\n * through the scenario client, e.g.\n * `scenario(MyObject).where({ $primaryKey: { $in: keys } }).fetchPage()`.\n */\nexport interface EditedEntitiesPage<Q extends ObjectTypeDefinition> {\n data: ObjectIdentifiers<Q>[];\n nextPageToken?: string;\n}\n\n/**\n * A page of directed link instances edited within a scenario for a given source object type and link api name.\n * Returned by {@link EXPERIMENTAL_ScenarioClient.getEditedLinks}. Source and target carry only `$primaryKey` + `$apiName`.\n */\nexport interface EditedLinksPage<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n> {\n data: MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[];\n nextPageToken?: string;\n}\n\n/**\n * A {@link Client} attached to an ontology scenario. All read and write operations performed via this client are\n * scoped to that scenario. `EXPERIMENTAL_ScenarioClient` is a superset of {@link Client}.\n *\n * @beta This is an experimental, unstable feature subject to change.\n */\nexport interface EXPERIMENTAL_ScenarioClient extends Client {\n /**\n * The scenario RID this client is scoped to.\n */\n getScenarioReference(): string;\n\n /**\n * List the object types and many-to-many link types that have been modified within this scenario. Useful as a\n * pre-step before paginating individual edited objects per type.\n */\n getEditedEntityTypes(): Promise<ScenarioEditedEntityTypes>;\n\n /**\n * Get a page of object identifiers that have been\n * edited within this scenario for the given object type. Use the scenario client to fetch full property values\n * if needed.\n *\n * @example\n * ```ts\n * let pageToken: string | undefined;\n * const keys: string[] = [];\n * do {\n * const page = await scenario.getEditedEntities(Doctor, { pageSize: 500, pageToken });\n * keys.push(...page.data.map(o => o.$primaryKey));\n * pageToken = page.nextPageToken;\n * } while (pageToken);\n * ```\n */\n getEditedEntities<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedEntitiesPage<Q>>;\n\n /**\n * Stream object identifiers for the objects edited within this scenario for the\n * given object type. Pages are fetched lazily and deduplicated by `$primaryKey` across pages (Funnel may return\n * duplicates).\n *\n * @example\n * ```ts\n * for await (const obj of scenario.editedEntitiesAsyncIter(Doctor, { pageSize: 500 })) {\n * // obj.$primaryKey is the unique key for this edited object\n * }\n * ```\n */\n editedEntitiesAsyncIter<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<ObjectIdentifiers<Q>>;\n\n /**\n * List the outgoing many-to-many link API names that have been modified within this scenario for the given\n * source object type. One-to-many link edits surface as object edits on the FK-owning side and are not returned\n * here.\n */\n getEditedLinkTypes<Q extends ObjectOrInterfaceDefinition>(\n sourceObjectType: Q,\n ): Promise<LinkTypeApiNamesFor<Q>[]>;\n\n /**\n * Get a page of directed link instances edited within this scenario for a given source object type and link\n * api name. The page form returns a flattened array of `{ source, target, linkType }` triples.\n */\n getEditedLinks<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedLinksPage<Q, LINK_TYPE_API_NAME>>;\n\n /**\n * Stream directed link instances edited within this scenario for a given source object type and link api name.\n * Pages are fetched lazily.\n *\n * @example\n * ```ts\n * for await (\n * const { source, target, linkType } of scenario.editedLinksAsyncIter(Doctor, \"treats\")\n * ) {\n * graph.addEdge(source, target, linkType);\n * }\n * ```\n */\n editedLinksAsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n >;\n}\n\nexport function isScenarioClient(\n value: unknown,\n): value is EXPERIMENTAL_ScenarioClient {\n return (\n value != null\n && (typeof value === \"object\" || typeof value === \"function\")\n && typeof (value as { getScenarioReference?: unknown })\n .getScenarioReference === \"function\"\n );\n}\n\n/**\n * Shared internal builder used by both {@link withScenario} and {@link createScenario}. Validates the parent client\n * is not already inside a scenario or transaction, then constructs a fresh {@link Client} via\n * `createClientWithScenario` and decorates it with {@link EXPERIMENTAL_ScenarioClient}-only methods.\n *\n * @internal\n */\nexport function buildScenarioClient(\n parent: Client,\n scenarioRid: string,\n): EXPERIMENTAL_ScenarioClient {\n const ctx: MinimalClient = parent[additionalContext];\n\n if (ctx.transactionId != null) {\n throw new Error(\n \"withScenario / createScenario: the supplied client already has an active transaction. Scenarios cannot be nested on transactions.\",\n );\n }\n if (ctx.scenarioRid != null) {\n throw new Error(\n \"withScenario / createScenario: the supplied client already has an active scenario. Scenarios cannot be nested.\",\n );\n }\n\n const inner: Client = createClientWithScenario(\n scenarioRid,\n ctx.baseUrl,\n ctx.ontologyRid,\n ctx.tokenProvider,\n {\n logger: ctx.logger,\n UNSTABLE_DO_NOT_USE_BRANCH: ctx.branch,\n },\n ctx.fetch,\n );\n\n const innerCtx: MinimalClient = inner[additionalContext];\n\n async function getEditedEntityTypes(): Promise<ScenarioEditedEntityTypes> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedEntityTypes(\n innerCtx,\n ontologyRid,\n scenarioRid,\n { preview: true },\n );\n return {\n objectTypes: response.objectTypes,\n linkTypes: response.linkTypes,\n };\n }\n\n async function getEditedEntities<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedEntitiesPage<Q>> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedObjects(\n innerCtx,\n ontologyRid,\n scenarioRid,\n objectType.apiName,\n {\n pageSize: options?.pageSize,\n pageToken: options?.pageToken,\n preview: true,\n },\n );\n const data: ObjectIdentifiers<Q>[] = response.data.map((entry) => {\n const wire = entry as { __apiName?: unknown; __primaryKey?: unknown };\n return {\n $apiName: wire.__apiName as Q[\"apiName\"],\n $primaryKey: wire.__primaryKey as PrimaryKeyType<Q>,\n };\n });\n return {\n data,\n nextPageToken: response.nextPageToken,\n };\n }\n\n async function* editedEntitiesAsyncIter<Q extends ObjectTypeDefinition>(\n objectType: Q,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<ObjectIdentifiers<Q>> {\n const seen = new Set<unknown>();\n let pageToken: string | undefined;\n do {\n const page = await getEditedEntities(objectType, {\n pageSize: options?.pageSize,\n pageToken,\n });\n for (const obj of page.data) {\n const key = obj.$primaryKey;\n if (seen.has(key)) continue;\n seen.add(key);\n yield obj;\n }\n pageToken = page.nextPageToken;\n } while (pageToken != null);\n }\n\n async function getEditedLinkTypes<Q extends ObjectOrInterfaceDefinition>(\n sourceObjectType: Q,\n ): Promise<LinkTypeApiNamesFor<Q>[]> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedLinkTypes(\n innerCtx,\n ontologyRid,\n scenarioRid,\n sourceObjectType.apiName,\n { preview: true },\n );\n return response.data as LinkTypeApiNamesFor<Q>[];\n }\n\n async function getEditedLinks<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number; pageToken?: string },\n ): Promise<EditedLinksPage<Q, LINK_TYPE_API_NAME>> {\n const ontologyRid = await innerCtx.ontologyRid;\n const response = await OntologyScenarios.listScenarioEditedLinks(\n innerCtx,\n ontologyRid,\n scenarioRid,\n sourceObjectType.apiName,\n linkType as string,\n {\n pageSize: options?.pageSize,\n pageToken: options?.pageToken,\n preview: true,\n },\n );\n\n const data: MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[] = [];\n for (const entry of response.data) {\n const sourceWire = entry.sourceObject as\n | { __apiName?: unknown; __primaryKey?: unknown }\n | undefined;\n if (sourceWire?.__apiName == null || sourceWire.__primaryKey == null) {\n continue;\n }\n const source = {\n $apiName: sourceWire.__apiName,\n $primaryKey: sourceWire.__primaryKey,\n } as MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[\"source\"];\n\n for (const linked of entry.linkedObjects) {\n const targetWire = linked.targetObject as\n | { __apiName?: unknown; __primaryKey?: unknown }\n | undefined;\n if (targetWire?.__apiName == null || targetWire.__primaryKey == null) {\n continue;\n }\n const target = {\n $apiName: targetWire.__apiName,\n $primaryKey: targetWire.__primaryKey,\n } as MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>[\"target\"];\n\n data.push({\n source,\n target,\n linkType: ((linked.linkType as string | undefined)\n ?? linkType) as LINK_TYPE_API_NAME,\n });\n }\n }\n\n return { data, nextPageToken: response.nextPageToken };\n }\n\n async function* editedLinksAsyncIter<\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPE_API_NAME extends LinkTypeApiNamesFor<Q>,\n >(\n sourceObjectType: Q,\n linkType: LINK_TYPE_API_NAME,\n options?: { pageSize?: number },\n ): AsyncIterableIterator<\n MinimalDirectedObjectLinkInstance<Q, LINK_TYPE_API_NAME>\n > {\n let pageToken: string | undefined;\n do {\n const page = await getEditedLinks(sourceObjectType, linkType, {\n pageSize: options?.pageSize,\n pageToken,\n });\n for (const link of page.data) {\n yield link;\n }\n pageToken = page.nextPageToken;\n } while (pageToken != null);\n }\n\n return Object.defineProperties(inner, {\n getScenarioReference: {\n value: () => scenarioRid,\n },\n getEditedEntityTypes: {\n value: getEditedEntityTypes,\n },\n getEditedEntities: {\n value: getEditedEntities,\n },\n editedEntitiesAsyncIter: {\n value: editedEntitiesAsyncIter,\n },\n getEditedLinkTypes: {\n value: getEditedLinkTypes,\n },\n getEditedLinks: {\n value: getEditedLinks,\n },\n editedLinksAsyncIter: {\n value: editedLinksAsyncIter,\n },\n }) as EXPERIMENTAL_ScenarioClient;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,iBAAiB,QAAqB,cAAc;AAC7D,SAASC,wBAAwB,QAAQ,oBAAoB;;AAG7D;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;A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51
51
  }
52
- } : {});
52
+ } : {}, {
53
+ preview: true
54
+ });
53
55
  return buildScenarioClient(client, response.scenarioRid);
54
56
  }
55
57
  //# sourceMappingURL=createScenario.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createScenario.js","names":["OntologyScenarios","additionalContext","buildScenarioClient","createScenario","client","ctx","transactionId","Error","scenarioRid","response","ontologyRid","branch","base","type"],"sources":["createScenario.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 { OntologyScenarios } from \"@osdk/foundry.ontologies\";\nimport { additionalContext, type Client } from \"../Client.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n buildScenarioClient,\n type EXPERIMENTAL_ScenarioClient,\n} from \"./ScenarioClient.js\";\n\n/**\n * Mint a fresh ontology scenario and return a client scoped to it.\n *\n * @param client - The base {@link Client} to derive context (`baseUrl`, `ontologyRid`, `tokenProvider`, `branch`, …)\n * from. Throws at runtime if the client is already scoped to a scenario or transaction. When the base client has a\n * branch set, the newly minted scenario uses that branch as its base.\n * @returns a {@link EXPERIMENTAL_ScenarioClient} bound to the freshly minted scenario RID.\n *\n * @beta This is an experimental, unstable feature subject to change.\n *\n * @example\n * ```ts\n * import { createScenario } from \"@osdk/client/unstable-do-not-use\";\n *\n * const scenario = await createScenario(client);\n * const scenarioRid = scenario.getScenarioReference();\n * ```\n */\nexport async function createScenario(\n client: Client,\n): Promise<EXPERIMENTAL_ScenarioClient> {\n const ctx: MinimalClient = client[additionalContext];\n\n if (ctx.transactionId != null) {\n throw new Error(\n \"createScenario: the supplied client already has an active transaction. Scenarios cannot be nested on transactions.\",\n );\n }\n if (ctx.scenarioRid != null) {\n throw new Error(\n \"createScenario: the supplied client already has an active scenario. Scenarios cannot be nested.\",\n );\n }\n\n const response = await OntologyScenarios.createScenario(\n ctx,\n await ctx.ontologyRid,\n ctx.branch != null\n ? { base: { type: \"branch\", branch: ctx.branch } }\n : {},\n );\n\n return buildScenarioClient(client, response.scenarioRid);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,iBAAiB,QAAqB,cAAc;AAE7D,SACEC,mBAAmB,QAEd,qBAAqB;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,cAAcA,CAClCC,MAAc,EACwB;EACtC,MAAMC,GAAkB,GAAGD,MAAM,CAACH,iBAAiB,CAAC;EAEpD,IAAII,GAAG,CAACC,aAAa,IAAI,IAAI,EAAE;IAC7B,MAAM,IAAIC,KAAK,CACb,oHACF,CAAC;EACH;EACA,IAAIF,GAAG,CAACG,WAAW,IAAI,IAAI,EAAE;IAC3B,MAAM,IAAID,KAAK,CACb,iGACF,CAAC;EACH;EAEA,MAAME,QAAQ,GAAG,MAAMT,iBAAiB,CAACG,cAAc,CACrDE,GAAG,EACH,MAAMA,GAAG,CAACK,WAAW,EACrBL,GAAG,CAACM,MAAM,IAAI,IAAI,GACd;IAAEC,IAAI,EAAE;MAAEC,IAAI,EAAE,QAAQ;MAAEF,MAAM,EAAEN,GAAG,CAACM;IAAO;EAAE,CAAC,GAChD,CAAC,CACP,CAAC;EAED,OAAOT,mBAAmB,CAACE,MAAM,EAAEK,QAAQ,CAACD,WAAW,CAAC;AAC1D","ignoreList":[]}
1
+ {"version":3,"file":"createScenario.js","names":["OntologyScenarios","additionalContext","buildScenarioClient","createScenario","client","ctx","transactionId","Error","scenarioRid","response","ontologyRid","branch","base","type","preview"],"sources":["createScenario.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 { OntologyScenarios } from \"@osdk/foundry.ontologies\";\nimport { additionalContext, type Client } from \"../Client.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n buildScenarioClient,\n type EXPERIMENTAL_ScenarioClient,\n} from \"./ScenarioClient.js\";\n\n/**\n * Mint a fresh ontology scenario and return a client scoped to it.\n *\n * @param client - The base {@link Client} to derive context (`baseUrl`, `ontologyRid`, `tokenProvider`, `branch`, …)\n * from. Throws at runtime if the client is already scoped to a scenario or transaction. When the base client has a\n * branch set, the newly minted scenario uses that branch as its base.\n * @returns a {@link EXPERIMENTAL_ScenarioClient} bound to the freshly minted scenario RID.\n *\n * @beta This is an experimental, unstable feature subject to change.\n *\n * @example\n * ```ts\n * import { createScenario } from \"@osdk/client/unstable-do-not-use\";\n *\n * const scenario = await createScenario(client);\n * const scenarioRid = scenario.getScenarioReference();\n * ```\n */\nexport async function createScenario(\n client: Client,\n): Promise<EXPERIMENTAL_ScenarioClient> {\n const ctx: MinimalClient = client[additionalContext];\n\n if (ctx.transactionId != null) {\n throw new Error(\n \"createScenario: the supplied client already has an active transaction. Scenarios cannot be nested on transactions.\",\n );\n }\n if (ctx.scenarioRid != null) {\n throw new Error(\n \"createScenario: the supplied client already has an active scenario. Scenarios cannot be nested.\",\n );\n }\n\n const response = await OntologyScenarios.createScenario(\n ctx,\n await ctx.ontologyRid,\n ctx.branch != null\n ? { base: { type: \"branch\", branch: ctx.branch } }\n : {},\n { preview: true },\n );\n\n return buildScenarioClient(client, response.scenarioRid);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,iBAAiB,QAAqB,cAAc;AAE7D,SACEC,mBAAmB,QAEd,qBAAqB;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,cAAcA,CAClCC,MAAc,EACwB;EACtC,MAAMC,GAAkB,GAAGD,MAAM,CAACH,iBAAiB,CAAC;EAEpD,IAAII,GAAG,CAACC,aAAa,IAAI,IAAI,EAAE;IAC7B,MAAM,IAAIC,KAAK,CACb,oHACF,CAAC;EACH;EACA,IAAIF,GAAG,CAACG,WAAW,IAAI,IAAI,EAAE;IAC3B,MAAM,IAAID,KAAK,CACb,iGACF,CAAC;EACH;EAEA,MAAME,QAAQ,GAAG,MAAMT,iBAAiB,CAACG,cAAc,CACrDE,GAAG,EACH,MAAMA,GAAG,CAACK,WAAW,EACrBL,GAAG,CAACM,MAAM,IAAI,IAAI,GACd;IAAEC,IAAI,EAAE;MAAEC,IAAI,EAAE,QAAQ;MAAEF,MAAM,EAAEN,GAAG,CAACM;IAAO;EAAE,CAAC,GAChD,CAAC,CAAC,EACN;IAAEG,OAAO,EAAE;EAAK,CAClB,CAAC;EAED,OAAOZ,mBAAmB,CAACE,MAAM,EAAEK,QAAQ,CAACD,WAAW,CAAC;AAC1D","ignoreList":[]}
@@ -14,6 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const USER_AGENT = `osdk-client/${"2.26.0"}`;
18
- export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.26.0"}`;
17
+ export const USER_AGENT = `osdk-client/${"2.26.1-main-5ff7aa5e89d44fb5b4f50b80614f80d7cd167ac1"}`;
18
+ export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.26.1-main-5ff7aa5e89d44fb5b4f50b80614f80d7cd167ac1"}`;
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":[]}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var chunkAN2R7X5W_cjs = require('./chunk-AN2R7X5W.cjs');
4
+ require('./chunk-H6PXPU6F.cjs');
5
+ require('./chunk-74HV6NQQ.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "getMediaContent", {
10
+ enumerable: true,
11
+ get: function () { return chunkAN2R7X5W_cjs.getMediaContent; }
12
+ });
13
+ Object.defineProperty(exports, "getMediaMetadata", {
14
+ enumerable: true,
15
+ get: function () { return chunkAN2R7X5W_cjs.getMediaMetadata; }
16
+ });
17
+ Object.defineProperty(exports, "upload", {
18
+ enumerable: true,
19
+ get: function () { return chunkAN2R7X5W_cjs.upload; }
20
+ });
21
+ //# sourceMappingURL=MediaReferenceProperty-SYUA2YYQ.cjs.map
22
+ //# sourceMappingURL=MediaReferenceProperty-SYUA2YYQ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"MediaReferenceProperty-CBPMMD73.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"MediaReferenceProperty-SYUA2YYQ.cjs"}
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunk42JVCEPG_cjs = require('./chunk-42JVCEPG.cjs');
4
- var chunkCAUXOFUO_cjs = require('./chunk-CAUXOFUO.cjs');
5
- require('./chunk-ZFNHWPQA.cjs');
6
- var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
3
+ var chunkGHU5R2D3_cjs = require('./chunk-GHU5R2D3.cjs');
4
+ var chunkHM2I7NAJ_cjs = require('./chunk-HM2I7NAJ.cjs');
5
+ require('./chunk-HRWHTCP3.cjs');
6
+ var chunkH6PXPU6F_cjs = require('./chunk-H6PXPU6F.cjs');
7
7
  require('./chunk-74HV6NQQ.cjs');
8
8
 
9
- // ../../node_modules/.pnpm/@osdk+foundry.functions@2.61.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js
9
+ // ../../node_modules/.pnpm/@osdk+foundry.functions@2.63.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js
10
10
  var _streamingExecute = [1, "/v2/functions/queries/{0}/streamingExecute", 7, , "application/octet-stream"];
11
11
  function streamingExecute($ctx, ...args) {
12
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _streamingExecute, ...args);
12
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _streamingExecute, ...args);
13
13
  }
14
14
 
15
15
  // src/queries/applyStreamingQuery.ts
@@ -18,11 +18,11 @@ async function* applyStreamingQuery(client, query, params) {
18
18
  if (client.flushEdits != null) {
19
19
  await client.flushEdits();
20
20
  }
21
- const response = await streamingExecute(chunkCAUXOFUO_cjs.addUserAgentAndRequestContextHeaders(chunkCAUXOFUO_cjs.augmentRequestContext(client, (_) => ({
21
+ const response = await streamingExecute(chunkHM2I7NAJ_cjs.addUserAgentAndRequestContextHeaders(chunkHM2I7NAJ_cjs.augmentRequestContext(client, (_) => ({
22
22
  finalMethodCall: "applyStreamingQuery"
23
23
  })), query), query.apiName, {
24
24
  ontology: await client.ontologyRid,
25
- parameters: params ? await chunk42JVCEPG_cjs.remapQueryParams(params, client, qd.parameters) : {},
25
+ parameters: params ? await chunkGHU5R2D3_cjs.remapQueryParams(params, client, qd.parameters) : {},
26
26
  version: query.isFixedVersion ? query.version : void 0,
27
27
  branch: client.branch
28
28
  }, {
@@ -32,15 +32,15 @@ async function* applyStreamingQuery(client, query, params) {
32
32
  if (response.body == null) {
33
33
  throw new Error("streamingExecute returned no response body");
34
34
  }
35
- const definitions = await chunk42JVCEPG_cjs.getRequiredDefinitions(qd.output, client);
35
+ const definitions = await chunkGHU5R2D3_cjs.getRequiredDefinitions(qd.output, client);
36
36
  const reader = response.body.getReader();
37
- for await (const line of chunk42JVCEPG_cjs.parseNdjsonStream(chunk42JVCEPG_cjs.iterateReadableStream(reader))) {
37
+ for await (const line of chunkGHU5R2D3_cjs.parseNdjsonStream(chunkGHU5R2D3_cjs.iterateReadableStream(reader))) {
38
38
  if (line.type === "error") {
39
39
  const err = new Error(`${line.errorName} (${line.errorCode}) [${line.errorInstanceId}]: ${line.errorDescription ?? ""}`);
40
40
  Object.assign(err, line);
41
41
  throw err;
42
42
  }
43
- const remapped = await chunk42JVCEPG_cjs.remapQueryResponse(client, qd.output, line.value, definitions);
43
+ const remapped = await chunkGHU5R2D3_cjs.remapQueryResponse(client, qd.output, line.value, definitions);
44
44
  if (qd.output.type === "array" && Array.isArray(remapped)) {
45
45
  for (const item of remapped) {
46
46
  yield item;
@@ -52,5 +52,5 @@ async function* applyStreamingQuery(client, query, params) {
52
52
  }
53
53
 
54
54
  exports.applyStreamingQuery = applyStreamingQuery;
55
- //# sourceMappingURL=applyStreamingQuery-US6OU3WN.cjs.map
56
- //# sourceMappingURL=applyStreamingQuery-US6OU3WN.cjs.map
55
+ //# sourceMappingURL=applyStreamingQuery-KNDRTOBJ.cjs.map
56
+ //# sourceMappingURL=applyStreamingQuery-KNDRTOBJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.61.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentAndRequestContextHeaders","augmentRequestContext","remapQueryParams","getRequiredDefinitions","parseNdjsonStream","iterateReadableStream","remapQueryResponse"],"mappings":";;;;;;;;;AA2EA,I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AMC,wCAAA,CAAuB,EAAA,CAAG,QAAQ,MAAM,CAAA;AAClE,EAAA,MAAM,MAAA,GAAS,QAAA,CAAS,IAAA,CAAK,SAAA,EAAU;AACvC,EAAA,WAAA,MAAiB,IAAA,IAAQC,mCAAA,CAAkBC,uCAAA,CAAsB,MAAM,CAAC,CAAA,EAAG;AACzE,IAAA,IAAI,IAAA,CAAK,SAAS,OAAA,EAAS;AACzB,MAAA,MAAM,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAA,CAAK,SAAS,CAAA,EAAA,EAAK,IAAA,CAAK,SAAS,CAAA,GAAA,EAAM,KAAK,eAAe,CAAA,GAAA,EAAM,IAAA,CAAK,gBAAA,IAAoB,EAAE,CAAA,CAAE,CAAA;AACvH,MAAA,MAAA,CAAO,MAAA,CAAO,KAAK,IAAI,CAAA;AACvB,MAAA,MAAM,GAAA;AAAA,IACR;AACA,IAAA,MAAM,QAAA,GAAW,MAAMC,oCAAA,CAAmB,MAAA,EAAQ,GAAG,MAAA,EAAQ,IAAA,CAAK,OAAO,WAAW,CAAA;AACpF,IAAA,IAAI,GAAG,MAAA,CAAO,IAAA,KAAS,WAAW,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACzD,MAAA,KAAA,MAAW,QAAQ,QAAA,EAAU;AAC3B,QAAA,MAAM,IAAA;AAAA,MACR;AAAA,IACF,CAAA,MAAO;AACL,MAAA,MAAM,QAAA;AAAA,IACR;AAAA,EACF;AACF","file":"applyStreamingQuery-US6OU3WN.cjs","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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _get = [0, \"/v2/functions/queries/{0}\", 2];\n/**\n * Gets a specific query type with the given API name. By default, this gets the latest version of the query.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/functions/queries/getByRid\", 2];\n/**\n * Gets a specific query type with the given RID. By default, this gets the latest version of the query.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRid\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/functions/queries/getByRidBatch\", 3];\n/**\n * Gets a list of query types by RID in bulk. By default, this gets the latest version of each query.\n *\n * Queries 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 * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\n}\nconst _execute = [1, \"/v2/functions/queries/{0}/execute\", 7];\n/**\n * Executes a Query using the given parameters. By default, this executes the latest version of the query.\n *\n * This endpoint is maintained for backward compatibility only.\n *\n * For all new implementations, use the `streamingExecute` endpoint, which supports all function types\n * and provides enhanced functionality.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}\nconst _streamingExecute = [1, \"/v2/functions/queries/{0}/streamingExecute\", 7,, \"application/octet-stream\"];\n/**\n * Executes a Query using the given parameters, returning results as an NDJSON stream. By default, this executes the latest version of the query.\n *\n * This endpoint supports all Query functions. The endpoint name 'streamingExecute' refers to the NDJSON\n * streaming response format. Both streaming and non-streaming functions can use this endpoint.\n * Non-streaming functions return a single-line NDJSON response, while streaming functions return multi-line NDJSON responses.\n * This is the recommended endpoint for all query execution.\n *\n * The response is returned as a binary stream in NDJSON (Newline Delimited JSON) format, where each line\n * is a StreamingExecuteQueryResponse containing either a data batch or an error.\n *\n * For a function returning a list of 5 records with a batch size of 3, the response stream would contain\n * two lines. The first line contains the first 3 items, and the second line contains the remaining 2 items:\n *\n * ```\n * {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99},{\"productId\":\"SKU-002\",\"price\":49.99},{\"productId\":\"SKU-003\",\"price\":19.99}]}\n * {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-004\",\"price\":39.99},{\"productId\":\"SKU-005\",\"price\":59.99}]}\n * ```\n *\n * Each line is a separate JSON object followed by a newline character. Clients should parse the stream\n * line-by-line to process results as they arrive. If an error occurs during execution, the stream will\n * contain an error line:\n *\n * ```\n * {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _executeAsync = [1, \"/v2/functions/queries/{0}/executeAsync\", 7];\n/**\n * Submits a Query for asynchronous execution. Returns either an execution ID\n * for polling, or the complete result if execution finished immediately.\n *\n * Use the Execution resource's getResult endpoint to poll for the\n * result of a submitted execution.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/executeAsync\n */\nexport function executeAsync($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _executeAsync, ...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 Functions from \"@osdk/foundry.functions/Query\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { iterateReadableStream, parseNdjsonStream } from \"../util/streamutils.js\";\nimport { getRequiredDefinitions, remapQueryParams, remapQueryResponse } from \"./applyQuery.js\";\nexport async function* applyStreamingQuery(client, query, params) {\n const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Functions.streamingExecute(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyStreamingQuery\"\n })), query), query.apiName, {\n ontology: await client.ontologyRid,\n parameters: params ? await remapQueryParams(params, client, qd.parameters) : {},\n version: query.isFixedVersion ? query.version : undefined,\n branch: client.branch\n }, {\n transactionId: client.transactionId,\n preview: true\n });\n if (response.body == null) {\n throw new Error(\"streamingExecute returned no response body\");\n }\n const definitions = await getRequiredDefinitions(qd.output, client);\n const reader = response.body.getReader();\n for await (const line of parseNdjsonStream(iterateReadableStream(reader))) {\n if (line.type === \"error\") {\n const err = new Error(`${line.errorName} (${line.errorCode}) [${line.errorInstanceId}]: ${line.errorDescription ?? \"\"}`);\n Object.assign(err, line);\n throw err;\n }\n const remapped = await remapQueryResponse(client, qd.output, line.value, definitions);\n if (qd.output.type === \"array\" && Array.isArray(remapped)) {\n for (const item of remapped) {\n yield item;\n }\n } else {\n yield remapped;\n }\n }\n}"]}
1
+ {"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.63.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentAndRequestContextHeaders","augmentRequestContext","remapQueryParams","getRequiredDefinitions","parseNdjsonStream","iterateReadableStream","remapQueryResponse"],"mappings":";;;;;;;;;AA2EA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,0BAA0B,CAAA;AAiCnG,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;ACzFA,gBAAuB,mBAAA,CAAoB,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ;AAChE,EAAA,MAAM,EAAA,GAAK,MAAM,MAAA,CAAO,gBAAA,CAAiB,kBAAA,CAAmB,KAAA,CAAM,OAAA,EAAS,KAAA,CAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,GAAU,MAAS,CAAA;AAC3H,EAAA,IAAI,MAAA,CAAO,cAAc,IAAA,EAAM;AAC7B,IAAA,MAAM,OAAO,UAAA,EAAW;AAAA,EAC1B;AACA,EAAA,MAAM,WAAW,MAAgB,gBAAA,CAAiBC,sDAAA,CAAqCC,uCAAA,CAAsB,QAAQ,CAAA,CAAA,MAAM;AAAA,IACzH,eAAA,EAAiB;AAAA,GACnB,CAAE,CAAA,EAAG,KAAK,CAAA,EAAG,MAAM,OAAA,EAAS;AAAA,IAC1B,QAAA,EAAU,MAAM,MAAA,CAAO,WAAA;AAAA,IACvB,UAAA,EAAY,SAAS,MAAMC,kCAAA,CAAiB,QAAQ,MAAA,EAAQ,EAAA,CAAG,UAAU,CAAA,GAAI,EAAC;AAAA,IAC9E,OAAA,EAAS,KAAA,CAAM,cA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uery-KNDRTOBJ.cjs","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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _get = [0, \"/v2/functions/queries/{0}\", 2];\n/**\n * Gets a specific query type with the given API name. By default, this gets the latest version of the query.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/functions/queries/getByRid\", 2];\n/**\n * Gets a specific query type with the given RID. By default, this gets the latest version of the query.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRid\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/functions/queries/getByRidBatch\", 3];\n/**\n * Gets a list of query types by RID in bulk. By default, this gets the latest version of each query.\n *\n * Queries 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 * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\n}\nconst _execute = [1, \"/v2/functions/queries/{0}/execute\", 7];\n/**\n * Executes a Query using the given parameters. By default, this executes the latest version of the query.\n *\n * This endpoint is maintained for backward compatibility only.\n *\n * For all new implementations, use the `streamingExecute` endpoint, which supports all function types\n * and provides enhanced functionality.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}\nconst _streamingExecute = [1, \"/v2/functions/queries/{0}/streamingExecute\", 7,, \"application/octet-stream\"];\n/**\n * Executes a Query using the given parameters, returning results as an NDJSON stream. By default, this executes the latest version of the query.\n *\n * This endpoint supports all Query functions. The endpoint name 'streamingExecute' refers to the NDJSON\n * streaming response format. Both streaming and non-streaming functions can use this endpoint.\n * Non-streaming functions return a single-line NDJSON response, while streaming functions return multi-line NDJSON responses.\n * This is the recommended endpoint for all query execution.\n *\n * The response is returned as a binary stream in NDJSON (Newline Delimited JSON) format, where each line\n * is a StreamingExecuteQueryResponse containing either a data batch or an error.\n *\n * For a function returning a list of 5 records with a batch size of 3, the response stream would contain\n * two lines. The first line contains the first 3 items, and the second line contains the remaining 2 items:\n *\n * ```\n * {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99},{\"productId\":\"SKU-002\",\"price\":49.99},{\"productId\":\"SKU-003\",\"price\":19.99}]}\n * {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-004\",\"price\":39.99},{\"productId\":\"SKU-005\",\"price\":59.99}]}\n * ```\n *\n * Each line is a separate JSON object followed by a newline character. Clients should parse the stream\n * line-by-line to process results as they arrive. If an error occurs during execution, the stream will\n * contain an error line:\n *\n * ```\n * {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _executeAsync = [1, \"/v2/functions/queries/{0}/executeAsync\", 7];\n/**\n * Submits a Query for asynchronous execution. Returns either an execution ID\n * for polling, or the complete result if execution finished immediately.\n *\n * Use the Execution resource's getResult endpoint to poll for the\n * result of a submitted execution.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/executeAsync\n */\nexport function executeAsync($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _executeAsync, ...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 Functions from \"@osdk/foundry.functions/Query\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { iterateReadableStream, parseNdjsonStream } from \"../util/streamutils.js\";\nimport { getRequiredDefinitions, remapQueryParams, remapQueryResponse } from \"./applyQuery.js\";\nexport async function* applyStreamingQuery(client, query, params) {\n const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Functions.streamingExecute(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyStreamingQuery\"\n })), query), query.apiName, {\n ontology: await client.ontologyRid,\n parameters: params ? await remapQueryParams(params, client, qd.parameters) : {},\n version: query.isFixedVersion ? query.version : undefined,\n branch: client.branch\n }, {\n transactionId: client.transactionId,\n preview: true\n });\n if (response.body == null) {\n throw new Error(\"streamingExecute returned no response body\");\n }\n const definitions = await getRequiredDefinitions(qd.output, client);\n const reader = response.body.getReader();\n for await (const line of parseNdjsonStream(iterateReadableStream(reader))) {\n if (line.type === \"error\") {\n const err = new Error(`${line.errorName} (${line.errorCode}) [${line.errorInstanceId}]: ${line.errorDescription ?? \"\"}`);\n Object.assign(err, line);\n throw err;\n }\n const remapped = await remapQueryResponse(client, qd.output, line.value, definitions);\n if (qd.output.type === \"array\" && Array.isArray(remapped)) {\n for (const item of remapped) {\n yield item;\n }\n } else {\n yield remapped;\n }\n }\n}"]}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
3
+ var chunkH6PXPU6F_cjs = require('./chunk-H6PXPU6F.cjs');
4
4
  var chunk74HV6NQQ_cjs = require('./chunk-74HV6NQQ.cjs');
5
5
 
6
- // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
6
+ // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
7
7
  var MediaReferenceProperty_exports = {};
8
8
  chunk74HV6NQQ_cjs.__export(MediaReferenceProperty_exports, {
9
9
  getMediaContent: () => getMediaContent,
@@ -12,20 +12,20 @@ chunk74HV6NQQ_cjs.__export(MediaReferenceProperty_exports, {
12
12
  });
13
13
  var _getMediaContent = [0, "/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/content", 2, , "*/*"];
14
14
  function getMediaContent($ctx, ...args) {
15
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getMediaContent, ...args);
15
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _getMediaContent, ...args);
16
16
  }
17
17
  var _getMediaMetadata = [0, "/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/metadata", 2];
18
18
  function getMediaMetadata($ctx, ...args) {
19
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getMediaMetadata, ...args);
19
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _getMediaMetadata, ...args);
20
20
  }
21
21
  var _upload = [1, "/v2/ontologies/{0}/objectTypes/{1}/media/{2}/upload", 3, "*/*"];
22
22
  function upload($ctx, ...args) {
23
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _upload, ...args);
23
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _upload, ...args);
24
24
  }
25
25
 
26
26
  exports.MediaReferenceProperty_exports = MediaReferenceProperty_exports;
27
27
  exports.getMediaContent = getMediaContent;
28
28
  exports.getMediaMetadata = getMediaMetadata;
29
29
  exports.upload = upload;
30
- //# sourceMappingURL=chunk-YP43NHIA.cjs.map
31
- //# sourceMappingURL=chunk-YP43NHIA.cjs.map
30
+ //# sourceMappingURL=chunk-AN2R7X5W.cjs.map
31
+ //# sourceMappingURL=chunk-AN2R7X5W.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js"],"names":["__export","foundryPlatformFetch"],"mappings":";;;;;;AAAA,IAAA,8BAAA,GAAA;AAAAA,0BAAA,CAAA,8BAAA,EAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,MAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AAiBA,IAAM,mBAAmB,CAAC,CAAA,EAAG,sDAAA,EAAwD,CAAA,IAAI,KAAK,CAAA;AASvF,SAAS,eAAA,CAAgB,SAAS,IAAA,EAAM;AAC7C,EAAA,OAAOC,sCAAA,CAAsB,IAAA,EAAM,gBAAA,EAAkB,GAAG,IAAI,CAAA;AAC9D;AACA,IAAM,iBAAA,GAAoB,CAAC,CAAA,EAAG,uDAAA,EAAyD,CAAC,CAAA;AASjF,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;AACA,IAAM,OAAA,GAAU,CAAC,CAAA,EAAG,qDAAA,EAAuD,GAAG,KAAK,CAAA;AAU5E,SAAS,MAAA,CAAO,SAAS,IAAA,EAAM;AACpC,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,OAAA,EAAS,GAAG,IAAI,CAAA;AACrD","file":"chunk-YP43NHIA.cjs","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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _getMediaContent = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/content\", 2,, \"*/*\"];\n/**\n * Gets the content of a media item referenced by this property.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/media/{property}/content\n */\nexport function getMediaContent($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getMediaContent, ...args);\n}\nconst _getMediaMetadata = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/metadata\", 2];\n/**\n * Gets metadata about the media item referenced by this property.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/media/{property}/metadata\n */\nexport function getMediaMetadata($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getMediaMetadata, ...args);\n}\nconst _upload = [1, \"/v2/ontologies/{0}/objectTypes/{1}/media/{2}/upload\", 3, \"*/*\"];\n/**\n * Uploads a media item to the media set which backs the specified property. The property must be backed by a single media set and branch, otherwise an error will be thrown.\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 *\n * @beta\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/media/{property}/upload\n */\nexport function upload($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _upload, ...args);\n}"]}
1
+ {"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js"],"names":["__export","foundryPlatformFetch"],"mappings":";;;;;;AAAA,IAAA,8BAAA,GAAA;AAAAA,0BAAA,CAAA,8BAAA,EAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,MAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AAiBA,IAAM,mBAAmB,CAAC,CAAA,EAAG,sDAAA,EAAwD,CAAA,IAAI,KAAK,CAAA;AASvF,SAAS,eAAA,CAAgB,SAAS,IAAA,EAAM;AAC7C,EAAA,OAAOC,sCAAA,CAAsB,IAAA,EAAM,gBAAA,EAAkB,GAAG,IAAI,CAAA;AAC9D;AACA,IAAM,iBAAA,GAAoB,CAAC,CAAA,EAAG,uDAAA,EAAyD,CAAC,CAAA;AASjF,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;AACA,IAAM,OAAA,GAAU,CAAC,CAAA,EAAG,qDAAA,EAAuD,GAAG,KAAK,CAAA;AAU5E,SAAS,MAAA,CAAO,SAAS,IAAA,EAAM;AACpC,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,OAAA,EAAS,GAAG,IAAI,CAAA;AACrD","file":"chunk-AN2R7X5W.cjs","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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _getMediaContent = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/content\", 2,, \"*/*\"];\n/**\n * Gets the content of a media item referenced by this property.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/media/{property}/content\n */\nexport function getMediaContent($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getMediaContent, ...args);\n}\nconst _getMediaMetadata = [0, \"/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/metadata\", 2];\n/**\n * Gets metadata about the media item referenced by this property.\n *\n * @alpha\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/media/{property}/metadata\n */\nexport function getMediaMetadata($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getMediaMetadata, ...args);\n}\nconst _upload = [1, \"/v2/ontologies/{0}/objectTypes/{1}/media/{2}/upload\", 3, \"*/*\"];\n/**\n * Uploads a media item to the media set which backs the specified property. The property must be backed by a single media set and branch, otherwise an error will be thrown.\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 *\n * @beta\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/ontologies/{ontology}/objectTypes/{objectType}/media/{property}/upload\n */\nexport function upload($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _upload, ...args);\n}"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkCAUXOFUO_cjs = require('./chunk-CAUXOFUO.cjs');
4
- var chunkZFNHWPQA_cjs = require('./chunk-ZFNHWPQA.cjs');
5
- var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
3
+ var chunkHM2I7NAJ_cjs = require('./chunk-HM2I7NAJ.cjs');
4
+ var chunkHRWHTCP3_cjs = require('./chunk-HRWHTCP3.cjs');
5
+ var chunkH6PXPU6F_cjs = require('./chunk-H6PXPU6F.cjs');
6
6
  var invariant = require('tiny-invariant');
7
7
 
8
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -128,10 +128,10 @@ function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {
128
128
  return ObjectSpecifier.split(":")[1];
129
129
  }
130
130
 
131
- // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
131
+ // ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.63.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
132
132
  var _execute = [1, "/v2/ontologies/{0}/queries/{1}/execute", 7];
133
133
  function execute($ctx, ...args) {
134
- return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _execute, ...args);
134
+ return chunkH6PXPU6F_cjs.foundryPlatformFetch($ctx, _execute, ...args);
135
135
  }
136
136
 
137
137
  // src/object/mediaUpload.ts
@@ -184,13 +184,13 @@ async function toDataValueQueries(value, client, desiredType) {
184
184
  switch (desiredType.type) {
185
185
  case "attachment": {
186
186
  if (isAttachmentUpload(value)) {
187
- const attachment = await chunkCAUXOFUO_cjs.upload(client, value.data, {
187
+ const attachment = await chunkHM2I7NAJ_cjs.upload(client, value.data, {
188
188
  filename: value.name
189
189
  });
190
190
  return attachment.rid;
191
191
  }
192
192
  if (isAttachmentFile(value)) {
193
- const attachment = await chunkCAUXOFUO_cjs.upload(client, value, {
193
+ const attachment = await chunkHM2I7NAJ_cjs.upload(client, value, {
194
194
  filename: value.name
195
195
  });
196
196
  return attachment.rid;
@@ -209,7 +209,7 @@ async function toDataValueQueries(value, client, desiredType) {
209
209
  }
210
210
  case "mediaReference": {
211
211
  if (isMediaUpload(value)) {
212
- const mediaRef = await chunkZFNHWPQA_cjs.MediaSet_exports.uploadMedia(client, value.data, {
212
+ const mediaRef = await chunkHRWHTCP3_cjs.MediaSet_exports.uploadMedia(client, value.data, {
213
213
  filename: value.fileName,
214
214
  preview: true
215
215
  });
@@ -246,11 +246,11 @@ async function toDataValueQueries(value, client, desiredType) {
246
246
  }
247
247
  case "objectSet":
248
248
  case "interfaceObjectSet": {
249
- if (chunkCAUXOFUO_cjs.isWireObjectSet(value)) {
249
+ if (chunkHM2I7NAJ_cjs.isWireObjectSet(value)) {
250
250
  return value;
251
251
  }
252
- if (chunkCAUXOFUO_cjs.isObjectSet(value)) {
253
- return chunkCAUXOFUO_cjs.getWireObjectSet(value);
252
+ if (chunkHM2I7NAJ_cjs.isObjectSet(value)) {
253
+ return chunkHM2I7NAJ_cjs.getWireObjectSet(value);
254
254
  }
255
255
  break;
256
256
  }
@@ -295,7 +295,7 @@ async function applyQuery(client, query, params) {
295
295
  if (client.flushEdits != null) {
296
296
  await client.flushEdits();
297
297
  }
298
- const response = await execute(chunkCAUXOFUO_cjs.addUserAgentAndRequestContextHeaders(chunkCAUXOFUO_cjs.augmentRequestContext(client, (_) => ({
298
+ const response = await execute(chunkHM2I7NAJ_cjs.addUserAgentAndRequestContextHeaders(chunkHM2I7NAJ_cjs.augmentRequestContext(client, (_) => ({
299
299
  finalMethodCall: "applyQuery"
300
300
  })), query), await client.ontologyRid, query.apiName, {
301
301
  parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}
@@ -341,10 +341,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
341
341
  return responseValue;
342
342
  }
343
343
  case "attachment": {
344
- return chunkCAUXOFUO_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
344
+ return chunkHM2I7NAJ_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
345
345
  }
346
346
  case "mediaReference": {
347
- return chunkCAUXOFUO_cjs.createMediaFromReferenceInternal(client, responseValue);
347
+ return chunkHM2I7NAJ_cjs.createMediaFromReferenceInternal(client, responseValue);
348
348
  }
349
349
  case "object": {
350
350
  const def = definitions.get(responseDataType.object);
@@ -366,7 +366,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
366
366
  throw new Error(`Missing definition for ${responseDataType.objectSet}`);
367
367
  }
368
368
  if (typeof responseValue === "string") {
369
- return chunkCAUXOFUO_cjs.createObjectSet(def, client, {
369
+ return chunkHM2I7NAJ_cjs.createObjectSet(def, client, {
370
370
  type: "intersect",
371
371
  objectSets: [{
372
372
  type: "base",
@@ -377,7 +377,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
377
377
  }]
378
378
  });
379
379
  }
380
- return chunkCAUXOFUO_cjs.createObjectSet(def, client, responseValue);
380
+ return chunkHM2I7NAJ_cjs.createObjectSet(def, client, responseValue);
381
381
  }
382
382
  case "struct": {
383
383
  for (const [key, subtype] of Object.entries(responseDataType.struct)) {
@@ -562,5 +562,5 @@ exports.parseNdjsonStream = parseNdjsonStream;
562
562
  exports.parseStreamedResponse = parseStreamedResponse;
563
563
  exports.remapQueryParams = remapQueryParams;
564
564
  exports.remapQueryResponse = remapQueryResponse;
565
- //# sourceMappingURL=chunk-42JVCEPG.cjs.map
566
- //# sourceMappingURL=chunk-42JVCEPG.cjs.map
565
+ //# sourceMappingURL=chunk-GHU5R2D3.cjs.map
566
+ //# sourceMappingURL=chunk-GHU5R2D3.cjs.map