@osdk/client 2.25.1-main-ceeabb580a7cde55b2ae85dd02c5782dff66c08b → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # @osdk/client
2
2
 
3
- ## 2.25.1-main-ceeabb580a7cde55b2ae85dd02c5782dff66c08b
3
+ ## 2.26.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - @osdk/api@2.25.1-main-ceeabb580a7cde55b2ae85dd02c5782dff66c08b
8
- - @osdk/client.unstable@2.25.1-main-ceeabb580a7cde55b2ae85dd02c5782dff66c08b
9
- - @osdk/generator-converters@2.25.1-main-ceeabb580a7cde55b2ae85dd02c5782dff66c08b
7
+ - @osdk/api@2.26.0
8
+ - @osdk/client.unstable@2.26.0
9
+ - @osdk/generator-converters@2.26.0
10
10
 
11
11
  ## 2.25.0
12
12
 
@@ -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.25.1";
24
+ const MaxOsdkVersion = "2.26.0";
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.25.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":[]}
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":[]}
@@ -14,6 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const USER_AGENT = `osdk-client/${"2.25.1-main-ceeabb580a7cde55b2ae85dd02c5782dff66c08b"}`;
18
- export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.25.1-main-ceeabb580a7cde55b2ae85dd02c5782dff66c08b"}`;
17
+ export const USER_AGENT = `osdk-client/${"2.26.0"}`;
18
+ export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.26.0"}`;
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,uEAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,kFAAuD","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,yBAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,oCAAuD","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk26AZ3LMH_cjs = require('./chunk-26AZ3LMH.cjs');
4
- var chunkPCJDAUL2_cjs = require('./chunk-PCJDAUL2.cjs');
3
+ var chunk42JVCEPG_cjs = require('./chunk-42JVCEPG.cjs');
4
+ var chunkCAUXOFUO_cjs = require('./chunk-CAUXOFUO.cjs');
5
5
  require('./chunk-ZFNHWPQA.cjs');
6
6
  var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
7
7
  require('./chunk-74HV6NQQ.cjs');
@@ -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(chunkPCJDAUL2_cjs.addUserAgentAndRequestContextHeaders(chunkPCJDAUL2_cjs.augmentRequestContext(client, (_) => ({
21
+ const response = await streamingExecute(chunkCAUXOFUO_cjs.addUserAgentAndRequestContextHeaders(chunkCAUXOFUO_cjs.augmentRequestContext(client, (_) => ({
22
22
  finalMethodCall: "applyStreamingQuery"
23
23
  })), query), query.apiName, {
24
24
  ontology: await client.ontologyRid,
25
- parameters: params ? await chunk26AZ3LMH_cjs.remapQueryParams(params, client, qd.parameters) : {},
25
+ parameters: params ? await chunk42JVCEPG_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 chunk26AZ3LMH_cjs.getRequiredDefinitions(qd.output, client);
35
+ const definitions = await chunk42JVCEPG_cjs.getRequiredDefinitions(qd.output, client);
36
36
  const reader = response.body.getReader();
37
- for await (const line of chunk26AZ3LMH_cjs.parseNdjsonStream(chunk26AZ3LMH_cjs.iterateReadableStream(reader))) {
37
+ for await (const line of chunk42JVCEPG_cjs.parseNdjsonStream(chunk42JVCEPG_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 chunk26AZ3LMH_cjs.remapQueryResponse(client, qd.output, line.value, definitions);
43
+ const remapped = await chunk42JVCEPG_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-HYPSPLFN.cjs.map
56
- //# sourceMappingURL=applyStreamingQuery-HYPSPLFN.cjs.map
55
+ //# sourceMappingURL=applyStreamingQuery-US6OU3WN.cjs.map
56
+ //# sourceMappingURL=applyStreamingQuery-US6OU3WN.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,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,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AAM,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-HYPSPLFN.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.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,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,0BAA0B,CAAA;AAiCnG,SAAS,gBAAA,CAAiB,SAA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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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkPCJDAUL2_cjs = require('./chunk-PCJDAUL2.cjs');
3
+ var chunkCAUXOFUO_cjs = require('./chunk-CAUXOFUO.cjs');
4
4
  var chunkZFNHWPQA_cjs = require('./chunk-ZFNHWPQA.cjs');
5
5
  var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
6
6
  var invariant = require('tiny-invariant');
@@ -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 chunkPCJDAUL2_cjs.upload(client, value.data, {
187
+ const attachment = await chunkCAUXOFUO_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 chunkPCJDAUL2_cjs.upload(client, value, {
193
+ const attachment = await chunkCAUXOFUO_cjs.upload(client, value, {
194
194
  filename: value.name
195
195
  });
196
196
  return attachment.rid;
@@ -246,11 +246,11 @@ async function toDataValueQueries(value, client, desiredType) {
246
246
  }
247
247
  case "objectSet":
248
248
  case "interfaceObjectSet": {
249
- if (chunkPCJDAUL2_cjs.isWireObjectSet(value)) {
249
+ if (chunkCAUXOFUO_cjs.isWireObjectSet(value)) {
250
250
  return value;
251
251
  }
252
- if (chunkPCJDAUL2_cjs.isObjectSet(value)) {
253
- return chunkPCJDAUL2_cjs.getWireObjectSet(value);
252
+ if (chunkCAUXOFUO_cjs.isObjectSet(value)) {
253
+ return chunkCAUXOFUO_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(chunkPCJDAUL2_cjs.addUserAgentAndRequestContextHeaders(chunkPCJDAUL2_cjs.augmentRequestContext(client, (_) => ({
298
+ const response = await execute(chunkCAUXOFUO_cjs.addUserAgentAndRequestContextHeaders(chunkCAUXOFUO_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 chunkPCJDAUL2_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
344
+ return chunkCAUXOFUO_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
345
345
  }
346
346
  case "mediaReference": {
347
- return chunkPCJDAUL2_cjs.createMediaFromReferenceInternal(client, responseValue);
347
+ return chunkCAUXOFUO_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 chunkPCJDAUL2_cjs.createObjectSet(def, client, {
369
+ return chunkCAUXOFUO_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 chunkPCJDAUL2_cjs.createObjectSet(def, client, responseValue);
380
+ return chunkCAUXOFUO_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-26AZ3LMH.cjs.map
566
- //# sourceMappingURL=chunk-26AZ3LMH.cjs.map
565
+ //# sourceMappingURL=chunk-42JVCEPG.cjs.map
566
+ //# sourceMappingURL=chunk-42JVCEPG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/AttachmentUpload.ts","../../src/util/streamutils.ts","../../src/util/objectSpecifierUtils.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js","../../src/object/mediaUpload.ts","../../src/util/interfaceUtils.ts","../../src/util/isObjectSpecifiersObject.ts","../../src/util/toDataValueQueries.ts","../../src/queries/applyQuery.ts"],"names":["foundryPlatformFetch","value","upload","MediaSet_exports","isWireObjectSet","isObjectSet","getWireObjectSet","addUserAgentAndRequestContextHeaders","augmentRequestContext","hydrateAttachmentFromRidInternal","createMediaFromReferenceInternal","createObjectSet","invariant"],"mappings":";;;;;;;;;;;;AAgBO,SAAS,mBAAmB,CAAA,EAAG;AACpC,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,IAAK,IAAA,IAAQ,UAAU,CAAA,IAAK,OAAO,CAAA,CAAE,IAAA,KAAS,YAAY,MAAA,IAAU,CAAA,IAAK,EAAE,IAAA,YAAgB,IAAA,IAAQ,EAAE,UAAA,IAAc,CAAA,CAAA;AACrJ;AACO,SAAS,iBAAiB,CAAA,EAAG;AAClC,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,YAAa,QAAQ,MAAA,IAAU,CAAA;AACjE;AACO,SAAS,sBAAA,CAAuB,MAAM,IAAA,EAAM;AACjD,EAAA,OAAO;AAAA,IACL,IAAA;AAAA,IACA;AAAA,GACF;AACF;;;ACXA,IAAM,WAAA,GAAc,IAAI,UAAA,CAAW,CAAC,GAAA,EAAK,EAAA,EAAI,GAAA,EAAK,EAAA,EAAI,GAAA,EAAK,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAE,CAAC,CAAA;AAC1E,IAAM,qBAAA,GAAwB,GAAA;AAC9B,IAAM,sBAAA,GAAyB,GA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,YAAA,EAAc;AAC7E,EAAA,OAAO;AAAA,IACL,UAAU,YAAA,CAAa,OAAA;AAAA,IACvB,MAAA,EAAQ,MAAA;AAAA,IACR,aAAa,kBAAA,CAAmB,iBAAA;AAAA,IAChC,aAAa,kBAAA,CAAmB,eAAA;AAAA,IAChC,gBAAA,EAAkB,2CAAA,CAA4C,YAAA,EAAc,kBAAkB;AAAA,GAChG;AACF","file":"chunk-26AZ3LMH.cjs","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isAttachmentUpload(o) {\n return typeof o === \"object\" && o != null && \"name\" in o && typeof o.name === \"string\" && \"data\" in o && o.data instanceof Blob && !(\"fileName\" in o);\n}\nexport function isAttachmentFile(o) {\n return typeof o === \"object\" && o instanceof Blob && \"name\" in o;\n}\nexport function createAttachmentUpload(data, name) {\n return {\n data,\n name\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{\"data\":[`\nconst OBJECT_OPEN_CHAR_CODE = 123; // '{'\nconst OBJECT_CLOSE_CHAR_CODE = 125; // '}'\n\nexport async function* parseStreamedResponse(asyncIterable) {\n const utf8decoder = new TextDecoder(\"utf-8\");\n let parsedStart = false;\n let prevChunks = [];\n let openBracesCount = 0;\n for await (const chunk of asyncIterable) {\n // on the first chunk, skip the expected START_TOKEN if we see it\n let i = 0;\n if (!parsedStart) {\n parsedStart = true;\n if (startsWith(chunk, START_TOKEN)) {\n i = START_TOKEN.length;\n }\n }\n for (; i < chunk.length; i++) {\n // if we aren't currently parsing an object, skip until we find the next object start\n while (openBracesCount === 0 && chunk[i] !== OBJECT_OPEN_CHAR_CODE && i < chunk.length) {\n i++;\n }\n\n // iterate through the chunk looking for the end of the current top level object\n let j = i;\n for (; j < chunk.length; j++) {\n const c = chunk[j];\n if (c === OBJECT_OPEN_CHAR_CODE) {\n openBracesCount++;\n } else if (c === OBJECT_CLOSE_CHAR_CODE) {\n openBracesCount--;\n\n // found a complete top level object, emit it\n if (0 === openBracesCount) {\n yield combineAndParse(utf8decoder, prevChunks, chunk.subarray(i, j + 1));\n\n // if there was a prevChunk, we've consumed it now\n prevChunks = [];\n\n // advance the start index to the final '}' of the current object,\n // which lets us start seeking the beginning of the next object\n i = j;\n break;\n }\n }\n }\n\n // if we reached the end of our chunk before finding the end of the object\n // store off the relevant remainder of our current chunk and go grab the next one\n if (j === chunk.length) {\n prevChunks.push(chunk.subarray(i));\n break;\n }\n }\n }\n}\nfunction startsWith(a, b) {\n if (a.length < b.length) {\n return false;\n }\n for (let i = 0; i < b.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\nfunction combineAndParse(utf8decoder, prev, curr) {\n let str = \"\";\n for (const chunk of prev) {\n str += utf8decoder.decode(chunk, {\n stream: true\n });\n }\n str += utf8decoder.decode(curr);\n return JSON.parse(str);\n}\nexport async function* iterateReadableStream(readableStream) {\n let res = await readableStream.read();\n while (!res.done) {\n yield res.value;\n res = await readableStream.read();\n }\n}\nexport async function* parseNdjsonStream(asyncIterable) {\n const decoder = new TextDecoder(\"utf-8\");\n let buffer = \"\";\n for await (const chunk of asyncIterable) {\n buffer += decoder.decode(chunk, {\n stream: true\n });\n let newlineIdx;\n while ((newlineIdx = buffer.indexOf(\"\\n\")) !== -1) {\n const line = buffer.slice(0, newlineIdx);\n buffer = buffer.slice(newlineIdx + 1);\n if (line.length > 0) {\n yield JSON.parse(line);\n }\n }\n }\n buffer += decoder.decode();\n const trailing = buffer.trim();\n if (trailing.length > 0) {\n yield JSON.parse(trailing);\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {\n return `${objectDef.apiName}:${primaryKey}`;\n}\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier) {\n return `${interfaceSpecifier.objectTypeApiName}:${interfaceSpecifier.primaryKeyValue}`;\n}\n\n/**\n * Extracts the primary key from an ObjectSpecifier on an OSDK object.\n *\n * @returns A string representing the primary key\n */\nexport function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[1];\n}\n\n/**\n * Extracts the object type from an ObjectSpecifier on an OSDK object.\n *\n * @returns The object type extracted from the ObjectSpecifier\n */\nexport function extractObjectTypeFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[0];\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _execute = [1, \"/v2/ontologies/{0}/queries/{1}/execute\", 7];\n/**\n * Executes a Query using the given parameters. By default, the latest version of the Query is executed.\n *\n * Optional parameters do not need to be supplied.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isMedia(o) {\n return typeof o === \"object\" && o != null && typeof o.fetchMetadata === \"function\" && typeof o.fetchContents === \"function\" && typeof o.getMediaReference === \"function\";\n}\nexport function isMediaReference(o) {\n return typeof o === `object` && typeof o.mimeType === \"string\" && \"reference\" in o && typeof o.reference === \"object\" && o.reference.type === \"mediaSetViewItem\" && \"mediaSetViewItem\" in o.reference && typeof o.reference.mediaSetViewItem === \"object\" && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\nexport function isMediaUpload(o) {\n return typeof o === \"object\" && o != null && \"fileName\" in o && typeof o.fileName === \"string\" && \"data\" in o && typeof o.data === \"object\" && o.data instanceof Blob;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Type representing whether a definition is an object or interface */\n\n/** @internal */\nexport function getDefType(apiNameOrDef) {\n return typeof apiNameOrDef === \"string\" ? \"object\" : apiNameOrDef.type;\n}\n\n/** @internal */\nexport function isInterfaceActionParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceQueryParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceSpecifier(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o && o.$objectType !== o.$apiName;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isObjectSpecifiersObject(o) {\n return o && typeof o === \"object\" && typeof o.$apiName === \"string\" && o.$primaryKey != null;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport * as Attachments from \"@osdk/foundry.ontologies/Attachment\";\nimport { isAttachmentFile, isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMedia, isMediaReference, isMediaUpload } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceQueryParam, isInterfaceSpecifier } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { extractPrimaryKeyFromObjectSpecifier } from \"./objectSpecifierUtils.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n * @internal\n */\nexport async function toDataValueQueries(value, client, desiredType) {\n if (value == null) {\n return value;\n }\n if (Array.isArray(value) && desiredType.type === \"array\") {\n const values = Array.from(value);\n if (values.some(dataValue => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValueQueries(value, client, desiredType));\n }\n return converted;\n }\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType.array));\n return Promise.all(promiseArray);\n }\n switch (desiredType.type) {\n case \"attachment\":\n {\n if (isAttachmentUpload(value)) {\n const attachment = await Attachments.upload(client, value.data, {\n filename: value.name\n });\n return attachment.rid;\n }\n if (isAttachmentFile(value)) {\n const attachment = await Attachments.upload(client, value, {\n filename: value.name\n });\n return attachment.rid;\n }\n\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"threeDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"mediaReference\":\n {\n if (isMediaUpload(value)) {\n const mediaRef = await MediaSets.uploadMedia(client, value.data, {\n filename: value.fileName,\n preview: true\n });\n return mediaRef;\n }\n if (isMedia(value)) {\n return value.getMediaReference();\n }\n if (isMediaReference(value)) {\n return value;\n }\n throw new Error(\"Expected media reference type but got value that is not a MediaReference or MediaUpload\");\n }\n case \"set\":\n {\n if (value instanceof Set) {\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType[\"set\"]));\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\":\n {\n if (isObjectSpecifiersObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"interface\":\n {\n if (isInterfaceSpecifier(value) || isInterfaceQueryParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey\n };\n }\n }\n case \"objectSet\":\n case \"interfaceObjectSet\":\n {\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n break;\n }\n case \"map\":\n {\n if (typeof value === \"object\") {\n const entrySet = [];\n for (const [key, mapValue] of Object.entries(value)) {\n entrySet.push({\n key: desiredType.keyType.type === \"object\" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),\n value: await toDataValueQueries(mapValue, client, desiredType.valueType)\n });\n }\n return entrySet;\n }\n break;\n }\n case \"struct\":\n {\n if (typeof value === \"object\") {\n const structMap = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(structValue, client, desiredType[\"struct\"][key]);\n }\n return structMap;\n }\n }\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Queries from \"@osdk/foundry.ontologies/Query\";\nimport invariant from \"tiny-invariant\";\nimport { createMediaFromReferenceInternal } from \"../createMediaFromReference.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { createObjectSpecifierFromInterfaceSpecifier, createObjectSpecifierFromPrimaryKey } from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nexport async function applyQuery(client, query, params) {\n // We fire and forget so if a function has no parameters we don't unnecessarily load all metadata\n const qd = client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Queries.execute(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyQuery\"\n })), query), await client.ontologyRid, query.apiName, {\n parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}\n }, {\n version: query.isFixedVersion ? query.version : undefined,\n transactionId: client.transactionId,\n scenarioRid: client.scenarioRid,\n branch: client.branch\n });\n const objectOutputDefs = await getRequiredDefinitions((await qd).output, client);\n const remappedResponse = await remapQueryResponse(client, (await qd).output, response.value, objectOutputDefs);\n return remappedResponse;\n}\nexport async function remapQueryParams(params, client, paramTypes) {\n const parameterMap = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(value, client, paramTypes[key]);\n }\n return parameterMap;\n}\nexport async function remapQueryResponse(client, responseDataType, responseValue, definitions) {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n switch (responseDataType.type) {\n case \"union\":\n {\n throw new Error(\"Union return types are not yet supported\");\n }\n case \"array\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.array, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"set\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.set, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"attachment\":\n {\n return hydrateAttachmentFromRidInternal(client, responseValue);\n }\n case \"mediaReference\":\n {\n return createMediaFromReferenceInternal(client, responseValue);\n }\n case \"object\":\n {\n const def = definitions.get(responseDataType.object);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${responseDataType.object}`);\n }\n return createQueryObjectResponse(responseValue, def);\n }\n case \"interface\":\n {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(`Missing definition for ${responseDataType.interface}`);\n }\n return createQueryInterfaceResponse(responseValue, def);\n }\n case \"objectSet\":\n {\n const def = definitions.get(responseDataType.objectSet);\n if (!def) {\n throw new Error(`Missing definition for ${responseDataType.objectSet}`);\n }\n if (typeof responseValue === \"string\") {\n return createObjectSet(def, client, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: responseDataType.objectSet\n }, {\n type: \"reference\",\n reference: responseValue\n }]\n });\n }\n return createObjectSet(def, client, responseValue);\n }\n case \"struct\":\n {\n // figure out what keys need to be fixed up\n for (const [key, subtype] of Object.entries(responseDataType.struct)) {\n if (requiresConversion(subtype) || responseValue[key] == null) {\n responseValue[key] = await remapQueryResponse(client, subtype, responseValue[key], definitions);\n }\n }\n return responseValue;\n }\n case \"map\":\n {\n const map = {};\n !Array.isArray(responseValue) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected array entry\") : invariant(false) : void 0;\n for (const entry of responseValue) {\n !(entry.key != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected key\") : invariant(false) : void 0;\n !(responseDataType.valueType.nullable || entry.value != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected value\") : invariant(false) : void 0;\n const key = responseDataType.keyType.type === \"object\" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;\n const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);\n map[key] = value;\n }\n return map;\n }\n case \"twoDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n value\n } of responseValue.groups) {\n result.push({\n key,\n value\n });\n }\n return result;\n }\n case \"threeDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n groups\n } of responseValue.groups) {\n const subResult = [];\n for (const {\n key: subKey,\n value\n } of groups) {\n subResult.push({\n key: subKey,\n value\n });\n }\n result.push({\n key,\n groups: subResult\n });\n }\n return result;\n }\n }\n return responseValue;\n}\nexport async function getRequiredDefinitions(dataType, client) {\n const result = new Map();\n switch (dataType.type) {\n case \"objectSet\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.objectSet);\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"interfaceObjectSet\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.objectSet);\n result.set(dataType.objectSet, interfaceDef);\n break;\n }\n case \"object\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.object);\n result.set(dataType.object, objectDef);\n break;\n }\n case \"interface\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.interface);\n result.set(dataType.interface, interfaceDef);\n break;\n }\n case \"set\":\n {\n return getRequiredDefinitions(dataType.set, client);\n }\n case \"array\":\n {\n return getRequiredDefinitions(dataType.array, client);\n }\n case \"map\":\n {\n const types = [dataType.keyType, dataType.valueType];\n const allDefs = await Promise.all(types.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"struct\":\n {\n const structValues = Object.values(dataType.struct);\n const allDefs = await Promise.all(structValues.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"mediaReference\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"typeReference\":\n case \"union\":\n break;\n default:\n {\n const _ = dataType;\n break;\n }\n }\n return result;\n}\nfunction requiresConversion(dataType) {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return false;\n case \"union\":\n return true;\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n case \"set\":\n return requiresConversion(dataType.set);\n case \"attachment\":\n case \"mediaReference\":\n case \"objectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n return true;\n default:\n return false;\n }\n}\nfunction getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {\n const def = definitions.get(objectTypeApiName);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${objectTypeApiName}`);\n }\n return createObjectSpecifierFromPrimaryKey(def, primaryKey);\n}\nexport function createQueryObjectResponse(primaryKey, objectDef) {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)\n };\n}\nexport function createQueryInterfaceResponse(interfaceSpecifier, interfaceDef) {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier)\n };\n}"]}
1
+ {"version":3,"sources":["../../src/object/AttachmentUpload.ts","../../src/util/streamutils.ts","../../src/util/objectSpecifierUtils.ts","../../../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js","../../src/object/mediaUpload.ts","../../src/util/interfaceUtils.ts","../../src/util/isObjectSpecifiersObject.ts","../../src/util/toDataValueQueries.ts","../../src/queries/applyQuery.ts"],"names":["foundryPlatformFetch","value","upload","MediaSet_exports","isWireObjectSet","isObjectSet","getWireObjectSet","addUserAgentAndRequestContextHeaders","augmentRequestContext","hydrateAttachmentFromRidInternal","createMediaFromReferenceInternal","createObjectSet","invariant"],"mappings":";;;;;;;;;;;;AAgBO,SAAS,mBAAmB,CAAA,EAAG;AACpC,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,IAAK,IAAA,IAAQ,UAAU,CAAA,IAAK,OAAO,CAAA,CAAE,IAAA,KAAS,YAAY,MAAA,IAAU,CAAA,IAAK,EAAE,IAAA,YAAgB,IAAA,IAAQ,EAAE,UAAA,IAAc,CAAA,CAAA;AACrJ;AACO,SAAS,iBAAiB,CAAA,EAAG;AA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AM,CAAA,uBAAA,EAA0B,iBAAiB,CAAA,CAAE,CAAA;AAAA,EAC/D;AACA,EAAA,OAAO,mCAAA,CAAoC,KAAK,UAAU,CAAA;AAC5D;AACO,SAAS,yBAAA,CAA0B,YAAY,SAAA,EAAW;AAC/D,EAAA,OAAO;AAAA,IACL,UAAU,SAAA,CAAU,OAAA;AAAA,IACpB,MAAA,EAAQ,MAAA;AAAA,IACR,aAAa,SAAA,CAAU,OAAA;AAAA,IACvB,WAAA,EAAa,UAAA;AAAA,IACb,gBAAA,EAAkB,mCAAA,CAAoC,SAAA,EAAW,UAAU;AAAA,GAC7E;AACF;AACO,SAAS,4BAAA,CAA6B,oBAAoB,YAAA,EAAc;AAC7E,EAAA,OAAO;AAAA,IACL,UAAU,YAAA,CAAa,OAAA;AAAA,IACvB,MAAA,EAAQ,MAAA;AAAA,IACR,aAAa,kBAAA,CAAmB,iBAAA;AAAA,IAChC,aAAa,kBAAA,CAAmB,eAAA;AAAA,IAChC,gBAAA,EAAkB,2CAAA,CAA4C,YAAA,EAAc,kBAAkB;AAAA,GAChG;AACF","file":"chunk-42JVCEPG.cjs","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isAttachmentUpload(o) {\n return typeof o === \"object\" && o != null && \"name\" in o && typeof o.name === \"string\" && \"data\" in o && o.data instanceof Blob && !(\"fileName\" in o);\n}\nexport function isAttachmentFile(o) {\n return typeof o === \"object\" && o instanceof Blob && \"name\" in o;\n}\nexport function createAttachmentUpload(data, name) {\n return {\n data,\n name\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{\"data\":[`\nconst OBJECT_OPEN_CHAR_CODE = 123; // '{'\nconst OBJECT_CLOSE_CHAR_CODE = 125; // '}'\n\nexport async function* parseStreamedResponse(asyncIterable) {\n const utf8decoder = new TextDecoder(\"utf-8\");\n let parsedStart = false;\n let prevChunks = [];\n let openBracesCount = 0;\n for await (const chunk of asyncIterable) {\n // on the first chunk, skip the expected START_TOKEN if we see it\n let i = 0;\n if (!parsedStart) {\n parsedStart = true;\n if (startsWith(chunk, START_TOKEN)) {\n i = START_TOKEN.length;\n }\n }\n for (; i < chunk.length; i++) {\n // if we aren't currently parsing an object, skip until we find the next object start\n while (openBracesCount === 0 && chunk[i] !== OBJECT_OPEN_CHAR_CODE && i < chunk.length) {\n i++;\n }\n\n // iterate through the chunk looking for the end of the current top level object\n let j = i;\n for (; j < chunk.length; j++) {\n const c = chunk[j];\n if (c === OBJECT_OPEN_CHAR_CODE) {\n openBracesCount++;\n } else if (c === OBJECT_CLOSE_CHAR_CODE) {\n openBracesCount--;\n\n // found a complete top level object, emit it\n if (0 === openBracesCount) {\n yield combineAndParse(utf8decoder, prevChunks, chunk.subarray(i, j + 1));\n\n // if there was a prevChunk, we've consumed it now\n prevChunks = [];\n\n // advance the start index to the final '}' of the current object,\n // which lets us start seeking the beginning of the next object\n i = j;\n break;\n }\n }\n }\n\n // if we reached the end of our chunk before finding the end of the object\n // store off the relevant remainder of our current chunk and go grab the next one\n if (j === chunk.length) {\n prevChunks.push(chunk.subarray(i));\n break;\n }\n }\n }\n}\nfunction startsWith(a, b) {\n if (a.length < b.length) {\n return false;\n }\n for (let i = 0; i < b.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\nfunction combineAndParse(utf8decoder, prev, curr) {\n let str = \"\";\n for (const chunk of prev) {\n str += utf8decoder.decode(chunk, {\n stream: true\n });\n }\n str += utf8decoder.decode(curr);\n return JSON.parse(str);\n}\nexport async function* iterateReadableStream(readableStream) {\n let res = await readableStream.read();\n while (!res.done) {\n yield res.value;\n res = await readableStream.read();\n }\n}\nexport async function* parseNdjsonStream(asyncIterable) {\n const decoder = new TextDecoder(\"utf-8\");\n let buffer = \"\";\n for await (const chunk of asyncIterable) {\n buffer += decoder.decode(chunk, {\n stream: true\n });\n let newlineIdx;\n while ((newlineIdx = buffer.indexOf(\"\\n\")) !== -1) {\n const line = buffer.slice(0, newlineIdx);\n buffer = buffer.slice(newlineIdx + 1);\n if (line.length > 0) {\n yield JSON.parse(line);\n }\n }\n }\n buffer += decoder.decode();\n const trailing = buffer.trim();\n if (trailing.length > 0) {\n yield JSON.parse(trailing);\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {\n return `${objectDef.apiName}:${primaryKey}`;\n}\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier) {\n return `${interfaceSpecifier.objectTypeApiName}:${interfaceSpecifier.primaryKeyValue}`;\n}\n\n/**\n * Extracts the primary key from an ObjectSpecifier on an OSDK object.\n *\n * @returns A string representing the primary key\n */\nexport function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[1];\n}\n\n/**\n * Extracts the object type from an ObjectSpecifier on an OSDK object.\n *\n * @returns The object type extracted from the ObjectSpecifier\n */\nexport function extractObjectTypeFromObjectSpecifier(ObjectSpecifier) {\n return ObjectSpecifier.split(\":\")[0];\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _execute = [1, \"/v2/ontologies/{0}/queries/{1}/execute\", 7];\n/**\n * Executes a Query using the given parameters. By default, the latest version of the Query is executed.\n *\n * Optional parameters do not need to be supplied.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read]\n * URL: /v2/ontologies/{ontology}/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isMedia(o) {\n return typeof o === \"object\" && o != null && typeof o.fetchMetadata === \"function\" && typeof o.fetchContents === \"function\" && typeof o.getMediaReference === \"function\";\n}\nexport function isMediaReference(o) {\n return typeof o === `object` && typeof o.mimeType === \"string\" && \"reference\" in o && typeof o.reference === \"object\" && o.reference.type === \"mediaSetViewItem\" && \"mediaSetViewItem\" in o.reference && typeof o.reference.mediaSetViewItem === \"object\" && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\" && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\nexport function isMediaUpload(o) {\n return typeof o === \"object\" && o != null && \"fileName\" in o && typeof o.fileName === \"string\" && \"data\" in o && typeof o.data === \"object\" && o.data instanceof Blob;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Type representing whether a definition is an object or interface */\n\n/** @internal */\nexport function getDefType(apiNameOrDef) {\n return typeof apiNameOrDef === \"string\" ? \"object\" : apiNameOrDef.type;\n}\n\n/** @internal */\nexport function isInterfaceActionParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceQueryParam(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o;\n}\n\n/** @internal */\nexport function isInterfaceSpecifier(o) {\n return o != null && typeof o === \"object\" && \"$objectType\" in o && \"$primaryKey\" in o && o.$objectType !== o.$apiName;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isObjectSpecifiersObject(o) {\n return o && typeof o === \"object\" && typeof o.$apiName === \"string\" && o.$primaryKey != null;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport * as Attachments from \"@osdk/foundry.ontologies/Attachment\";\nimport { isAttachmentFile, isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMedia, isMediaReference, isMediaUpload } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceQueryParam, isInterfaceSpecifier } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { extractPrimaryKeyFromObjectSpecifier } from \"./objectSpecifierUtils.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n * @internal\n */\nexport async function toDataValueQueries(value, client, desiredType) {\n if (value == null) {\n return value;\n }\n if (Array.isArray(value) && desiredType.type === \"array\") {\n const values = Array.from(value);\n if (values.some(dataValue => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValueQueries(value, client, desiredType));\n }\n return converted;\n }\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType.array));\n return Promise.all(promiseArray);\n }\n switch (desiredType.type) {\n case \"attachment\":\n {\n if (isAttachmentUpload(value)) {\n const attachment = await Attachments.upload(client, value.data, {\n filename: value.name\n });\n return attachment.rid;\n }\n if (isAttachmentFile(value)) {\n const attachment = await Attachments.upload(client, value, {\n filename: value.name\n });\n return attachment.rid;\n }\n\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"threeDimensionalAggregation\":\n {\n return {\n groups: value\n };\n }\n case \"mediaReference\":\n {\n if (isMediaUpload(value)) {\n const mediaRef = await MediaSets.uploadMedia(client, value.data, {\n filename: value.fileName,\n preview: true\n });\n return mediaRef;\n }\n if (isMedia(value)) {\n return value.getMediaReference();\n }\n if (isMediaReference(value)) {\n return value;\n }\n throw new Error(\"Expected media reference type but got value that is not a MediaReference or MediaUpload\");\n }\n case \"set\":\n {\n if (value instanceof Set) {\n const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType[\"set\"]));\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\":\n {\n if (isObjectSpecifiersObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"interface\":\n {\n if (isInterfaceSpecifier(value) || isInterfaceQueryParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey\n };\n }\n }\n case \"objectSet\":\n case \"interfaceObjectSet\":\n {\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n break;\n }\n case \"map\":\n {\n if (typeof value === \"object\") {\n const entrySet = [];\n for (const [key, mapValue] of Object.entries(value)) {\n entrySet.push({\n key: desiredType.keyType.type === \"object\" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),\n value: await toDataValueQueries(mapValue, client, desiredType.valueType)\n });\n }\n return entrySet;\n }\n break;\n }\n case \"struct\":\n {\n if (typeof value === \"object\") {\n const structMap = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(structValue, client, desiredType[\"struct\"][key]);\n }\n return structMap;\n }\n }\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Queries from \"@osdk/foundry.ontologies/Query\";\nimport invariant from \"tiny-invariant\";\nimport { createMediaFromReferenceInternal } from \"../createMediaFromReference.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { createObjectSpecifierFromInterfaceSpecifier, createObjectSpecifierFromPrimaryKey } from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nexport async function applyQuery(client, query, params) {\n // We fire and forget so if a function has no parameters we don't unnecessarily load all metadata\n const qd = client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Queries.execute(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyQuery\"\n })), query), await client.ontologyRid, query.apiName, {\n parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}\n }, {\n version: query.isFixedVersion ? query.version : undefined,\n transactionId: client.transactionId,\n scenarioRid: client.scenarioRid,\n branch: client.branch\n });\n const objectOutputDefs = await getRequiredDefinitions((await qd).output, client);\n const remappedResponse = await remapQueryResponse(client, (await qd).output, response.value, objectOutputDefs);\n return remappedResponse;\n}\nexport async function remapQueryParams(params, client, paramTypes) {\n const parameterMap = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(value, client, paramTypes[key]);\n }\n return parameterMap;\n}\nexport async function remapQueryResponse(client, responseDataType, responseValue, definitions) {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n switch (responseDataType.type) {\n case \"union\":\n {\n throw new Error(\"Union return types are not yet supported\");\n }\n case \"array\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.array, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"set\":\n {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(client, responseDataType.set, responseValue[i], definitions);\n }\n return responseValue;\n }\n case \"attachment\":\n {\n return hydrateAttachmentFromRidInternal(client, responseValue);\n }\n case \"mediaReference\":\n {\n return createMediaFromReferenceInternal(client, responseValue);\n }\n case \"object\":\n {\n const def = definitions.get(responseDataType.object);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${responseDataType.object}`);\n }\n return createQueryObjectResponse(responseValue, def);\n }\n case \"interface\":\n {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(`Missing definition for ${responseDataType.interface}`);\n }\n return createQueryInterfaceResponse(responseValue, def);\n }\n case \"objectSet\":\n {\n const def = definitions.get(responseDataType.objectSet);\n if (!def) {\n throw new Error(`Missing definition for ${responseDataType.objectSet}`);\n }\n if (typeof responseValue === \"string\") {\n return createObjectSet(def, client, {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: responseDataType.objectSet\n }, {\n type: \"reference\",\n reference: responseValue\n }]\n });\n }\n return createObjectSet(def, client, responseValue);\n }\n case \"struct\":\n {\n // figure out what keys need to be fixed up\n for (const [key, subtype] of Object.entries(responseDataType.struct)) {\n if (requiresConversion(subtype) || responseValue[key] == null) {\n responseValue[key] = await remapQueryResponse(client, subtype, responseValue[key], definitions);\n }\n }\n return responseValue;\n }\n case \"map\":\n {\n const map = {};\n !Array.isArray(responseValue) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected array entry\") : invariant(false) : void 0;\n for (const entry of responseValue) {\n !(entry.key != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected key\") : invariant(false) : void 0;\n !(responseDataType.valueType.nullable || entry.value != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Expected value\") : invariant(false) : void 0;\n const key = responseDataType.keyType.type === \"object\" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;\n const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);\n map[key] = value;\n }\n return map;\n }\n case \"twoDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n value\n } of responseValue.groups) {\n result.push({\n key,\n value\n });\n }\n return result;\n }\n case \"threeDimensionalAggregation\":\n {\n const result = [];\n for (const {\n key,\n groups\n } of responseValue.groups) {\n const subResult = [];\n for (const {\n key: subKey,\n value\n } of groups) {\n subResult.push({\n key: subKey,\n value\n });\n }\n result.push({\n key,\n groups: subResult\n });\n }\n return result;\n }\n }\n return responseValue;\n}\nexport async function getRequiredDefinitions(dataType, client) {\n const result = new Map();\n switch (dataType.type) {\n case \"objectSet\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.objectSet);\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"interfaceObjectSet\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.objectSet);\n result.set(dataType.objectSet, interfaceDef);\n break;\n }\n case \"object\":\n {\n const objectDef = await client.ontologyProvider.getObjectDefinition(dataType.object);\n result.set(dataType.object, objectDef);\n break;\n }\n case \"interface\":\n {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.interface);\n result.set(dataType.interface, interfaceDef);\n break;\n }\n case \"set\":\n {\n return getRequiredDefinitions(dataType.set, client);\n }\n case \"array\":\n {\n return getRequiredDefinitions(dataType.array, client);\n }\n case \"map\":\n {\n const types = [dataType.keyType, dataType.valueType];\n const allDefs = await Promise.all(types.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"struct\":\n {\n const structValues = Object.values(dataType.struct);\n const allDefs = await Promise.all(structValues.map(value => getRequiredDefinitions(value, client)));\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"mediaReference\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"typeReference\":\n case \"union\":\n break;\n default:\n {\n const _ = dataType;\n break;\n }\n }\n return result;\n}\nfunction requiresConversion(dataType) {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return false;\n case \"union\":\n return true;\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n case \"set\":\n return requiresConversion(dataType.set);\n case \"attachment\":\n case \"mediaReference\":\n case \"objectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n return true;\n default:\n return false;\n }\n}\nfunction getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {\n const def = definitions.get(objectTypeApiName);\n if (!def || def.type !== \"object\") {\n throw new Error(`Missing definition for ${objectTypeApiName}`);\n }\n return createObjectSpecifierFromPrimaryKey(def, primaryKey);\n}\nexport function createQueryObjectResponse(primaryKey, objectDef) {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)\n };\n}\nexport function createQueryInterfaceResponse(interfaceSpecifier, interfaceDef) {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier)\n };\n}"]}
@@ -1585,5 +1585,5 @@ exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
1585
1585
  exports.isObjectSet = isObjectSet;
1586
1586
  exports.isWireObjectSet = isWireObjectSet;
1587
1587
  exports.upload = upload;
1588
- //# sourceMappingURL=chunk-PCJDAUL2.cjs.map
1589
- //# sourceMappingURL=chunk-PCJDAUL2.cjs.map
1588
+ //# sourceMappingURL=chunk-CAUXOFUO.cjs.map
1589
+ //# sourceMappingURL=chunk-CAUXOFUO.cjs.map