@osdk/client 2.93.0 → 2.93.1-main-4ebde4f6852955187ba23bb3e22e08d44cb8745c
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 +9 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/queries/applyQuery.js +31 -1
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{applyStreamingQuery-JOFNSSQT.cjs → applyStreamingQuery-4KCFTMFJ.cjs} +8 -8
- package/build/cjs/{applyStreamingQuery-JOFNSSQT.cjs.map → applyStreamingQuery-4KCFTMFJ.cjs.map} +1 -1
- package/build/cjs/{chunk-LXM7EXZJ.cjs → chunk-AU4XW5MQ.cjs} +8 -8
- package/build/cjs/{chunk-LXM7EXZJ.cjs.map → chunk-AU4XW5MQ.cjs.map} +1 -1
- package/build/cjs/{chunk-44KKSD6S.cjs → chunk-DL7RI6HN.cjs} +5 -5
- package/build/cjs/{chunk-44KKSD6S.cjs.map → chunk-DL7RI6HN.cjs.map} +1 -1
- package/build/cjs/{chunk-3VTDGLP7.cjs → chunk-G5FA7YFJ.cjs} +85 -85
- package/build/cjs/{chunk-3VTDGLP7.cjs.map → chunk-G5FA7YFJ.cjs.map} +1 -1
- package/build/cjs/{chunk-NFFHNVHT.cjs → chunk-GOWQ4ETF.cjs} +2 -2
- package/build/cjs/{chunk-NFFHNVHT.cjs.map → chunk-GOWQ4ETF.cjs.map} +1 -1
- package/build/cjs/{chunk-JAQCZ7BD.cjs → chunk-I5D3T56Y.cjs} +58 -58
- package/build/cjs/chunk-I5D3T56Y.cjs.map +1 -0
- package/build/cjs/{chunk-CAHESCUU.cjs → chunk-YYE7GE4B.cjs} +42 -15
- package/build/cjs/chunk-YYE7GE4B.cjs.map +1 -0
- package/build/cjs/index.cjs +12 -12
- package/build/cjs/public/experimental.cjs +10 -10
- package/build/cjs/public/internal.cjs +10 -10
- package/build/cjs/public/observable.cjs +6 -6
- package/build/cjs/public/unstable-do-not-use.cjs +17 -17
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/queries/applyQuery.js +31 -1
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/package.json +7 -7
- package/build/cjs/chunk-CAHESCUU.cjs.map +0 -1
- package/build/cjs/chunk-JAQCZ7BD.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
+
## 2.93.1-main-4ebde4f6852955187ba23bb3e22e08d44cb8745c
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4ebde4f: Hydrate interface object sets, interfaces, and arrays nested in query struct responses.
|
|
8
|
+
- @osdk/api@2.93.1-main-4ebde4f6852955187ba23bb3e22e08d44cb8745c
|
|
9
|
+
- @osdk/client.unstable@2.93.1-main-4ebde4f6852955187ba23bb3e22e08d44cb8745c
|
|
10
|
+
- @osdk/generator-converters@2.93.1-main-4ebde4f6852955187ba23bb3e22e08d44cb8745c
|
|
11
|
+
|
|
3
12
|
## 2.93.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/build/browser/Client.js
CHANGED
|
@@ -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.93.
|
|
24
|
+
const MaxOsdkVersion = "2.93.1";
|
|
25
25
|
// END: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
26
26
|
|
|
27
27
|
const ErrorMessage = Symbol("ErrorMessage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n AgentDefinition,\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\n\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { AgentSignatureFromDef } from \"./agents/types.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> =\n Q extends VersionBound<infer V>\n ? SatisfiesSemver<V, MaxOsdkVersion> extends true\n ? Q\n : Q & {\n [ErrorMessage]: `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\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\"]\n ? 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\"]\n ? 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>>(o: Q): 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>>(o: Q): QuerySignatureFromDef<Q>;\n\n /** @beta */\n <Q extends AgentDefinition<unknown>>(o: Q): AgentSignatureFromDef<Q>;\n\n /**\n * @param experiment - The experiment marker that gates an unstable feature.\n * @example\n * ```ts\n * const employee = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid)\n * .fetchOneByRid(Employee, \"ri.phonograph2-objects.main.object.1234\");\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.59.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,\n ): Promise<\n Q extends ObjectTypeDefinition\n ? ObjectMetadata\n : Q extends InterfaceDefinition\n ? InterfaceMetadata\n : Q extends ActionDefinition<any>\n ? ActionMetadata\n : Q extends QueryDefinition<any>\n ? 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.93.
|
|
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 AgentDefinition,\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\n\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { AgentSignatureFromDef } from \"./agents/types.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> =\n Q extends VersionBound<infer V>\n ? SatisfiesSemver<V, MaxOsdkVersion> extends true\n ? Q\n : Q & {\n [ErrorMessage]: `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\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\"]\n ? 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\"]\n ? 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>>(o: Q): 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>>(o: Q): QuerySignatureFromDef<Q>;\n\n /** @beta */\n <Q extends AgentDefinition<unknown>>(o: Q): AgentSignatureFromDef<Q>;\n\n /**\n * @param experiment - The experiment marker that gates an unstable feature.\n * @example\n * ```ts\n * const employee = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid)\n * .fetchOneByRid(Employee, \"ri.phonograph2-objects.main.object.1234\");\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.59.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,\n ): Promise<\n Q extends ObjectTypeDefinition\n ? ObjectMetadata\n : Q extends InterfaceDefinition\n ? InterfaceMetadata\n : Q extends ActionDefinition<any>\n ? ActionMetadata\n : Q extends QueryDefinition<any>\n ? 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.93.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;;AA6BA;;AAqIA;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":[]}
|
|
@@ -119,6 +119,26 @@ export async function remapQueryResponse(client, responseDataType, responseValue
|
|
|
119
119
|
}
|
|
120
120
|
return createObjectSet(def, client, responseValue);
|
|
121
121
|
}
|
|
122
|
+
case "interfaceObjectSet":
|
|
123
|
+
{
|
|
124
|
+
const def = definitions.get(responseDataType.objectSet);
|
|
125
|
+
if (!def || def.type !== "interface") {
|
|
126
|
+
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
127
|
+
}
|
|
128
|
+
if (typeof responseValue === "string") {
|
|
129
|
+
return createObjectSet(def, client, {
|
|
130
|
+
type: "intersect",
|
|
131
|
+
objectSets: [{
|
|
132
|
+
type: "interfaceBase",
|
|
133
|
+
interfaceType: def.apiName
|
|
134
|
+
}, {
|
|
135
|
+
type: "reference",
|
|
136
|
+
reference: responseValue
|
|
137
|
+
}]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return createObjectSet(def, client, responseValue);
|
|
141
|
+
}
|
|
122
142
|
case "struct":
|
|
123
143
|
{
|
|
124
144
|
// figure out what keys need to be fixed up
|
|
@@ -274,6 +294,7 @@ function requiresConversion(dataType) {
|
|
|
274
294
|
case "long":
|
|
275
295
|
case "string":
|
|
276
296
|
case "timestamp":
|
|
297
|
+
case "typeReference":
|
|
277
298
|
return false;
|
|
278
299
|
case "union":
|
|
279
300
|
return true;
|
|
@@ -281,15 +302,24 @@ function requiresConversion(dataType) {
|
|
|
281
302
|
return Object.values(dataType.struct).some(requiresConversion);
|
|
282
303
|
case "set":
|
|
283
304
|
return requiresConversion(dataType.set);
|
|
305
|
+
case "array":
|
|
306
|
+
return requiresConversion(dataType.array);
|
|
307
|
+
|
|
308
|
+
// maps are always converted from an entry array into a record
|
|
309
|
+
case "map":
|
|
284
310
|
case "attachment":
|
|
285
311
|
case "mediaReference":
|
|
286
312
|
case "objectSet":
|
|
313
|
+
case "interfaceObjectSet":
|
|
287
314
|
case "twoDimensionalAggregation":
|
|
288
315
|
case "threeDimensionalAggregation":
|
|
289
316
|
case "object":
|
|
317
|
+
case "interface":
|
|
290
318
|
return true;
|
|
291
319
|
default:
|
|
292
|
-
|
|
320
|
+
{
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
293
323
|
}
|
|
294
324
|
}
|
|
295
325
|
function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyQuery.js","names":["Queries","invariant","createMediaFromReferenceInternal","createObjectSet","hydrateAttachmentFromRidInternal","addUserAgentHeader","createObjectSpecifierFromInterfaceSpecifier","createObjectSpecifierFromPrimaryKey","toDataValueQueries","applyQuery","client","query","params","qd","ontologyProvider","getQueryDefinition","apiName","isFixedVersion","version","undefined","flushEdits","response","execute","ontologyRid","parameters","remapQueryParams","transactionId","scenarioRid","branch","objectOutputDefs","getRequiredDefinitions","output","remappedResponse","remapQueryResponse","value","paramTypes","parameterMap","key","Object","entries","responseDataType","responseValue","definitions","nullable","Error","type","i","length","array","set","def","get","object","createQueryObjectResponse","interface","createQueryInterfaceResponse","objectSet","objectSets","objectType","reference","subtype","struct","requiresConversion","map","Array","isArray","process","env","NODE_ENV","entry","valueType","keyType","getObjectSpecifier","result","groups","push","subResult","subKey","dataType","Map","objectDef","getObjectDefinition","interfaceDef","getInterfaceDefinition","types","allDefs","Promise","all","defs","structValues","values","some","primaryKey","objectTypeApiName","$apiName","$title","$objectType","$primaryKey","$objectSpecifier","interfaceSpecifier","primaryKeyValue"],"sources":["applyQuery.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n CompileTimeMetadata,\n InterfaceDefinition,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n OsdkBase,\n PrimaryKeyType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n} from \"@osdk/api\";\nimport type { DataValue } from \"@osdk/foundry.ontologies\";\nimport * as Queries from \"@osdk/foundry.ontologies/Query\";\nimport invariant from \"tiny-invariant\";\n\nimport { createMediaFromReferenceInternal } from \"../createMediaFromReference.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentHeader } from \"../util/addUserAgentHeader.js\";\nimport {\n createObjectSpecifierFromInterfaceSpecifier,\n createObjectSpecifierFromPrimaryKey,\n} from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nimport type { QueryParameterType, QueryReturnType } from \"./types.js\";\n\nexport async function applyQuery<\n QD extends QueryDefinition<any>,\n P extends QueryParameterType<CompileTimeMetadata<QD>[\"parameters\"]>,\n>(\n client: MinimalClient,\n query: QD,\n params?: P,\n): Promise<QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>> {\n // We fire and forget so if a function has no parameters we don't unnecessarily load all metadata\n const qd: Promise<QueryMetadata> = client.ontologyProvider.getQueryDefinition(\n query.apiName,\n query.isFixedVersion ? query.version : undefined,\n );\n\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n\n const response = await Queries.execute(\n addUserAgentHeader(client, query),\n await client.ontologyRid,\n query.apiName,\n {\n parameters: params\n ? await remapQueryParams(\n params as { [parameterId: string]: any },\n client,\n (await qd).parameters,\n )\n : {},\n },\n {\n version: query.isFixedVersion ? query.version : undefined,\n transactionId: client.transactionId,\n scenarioRid: client.scenarioRid,\n branch: client.branch,\n },\n );\n\n const objectOutputDefs = await getRequiredDefinitions(\n (await qd).output,\n client,\n );\n const remappedResponse = await remapQueryResponse(\n client,\n (await qd).output,\n response.value,\n objectOutputDefs,\n );\n return remappedResponse as QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>;\n}\n\nexport async function remapQueryParams(\n params: { [parameterId: string]: any },\n client: MinimalClient,\n paramTypes: Record<string, QueryParameterDefinition<any>>,\n): Promise<{ [parameterId: string]: any }> {\n const parameterMap: { [parameterName: string]: unknown } = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(\n value,\n client,\n paramTypes[key],\n );\n }\n return parameterMap;\n}\n\nexport async function remapQueryResponse<\n Q extends ObjectTypeDefinition,\n T extends QueryDataTypeDefinition<Q | never>,\n>(\n client: MinimalClient,\n responseDataType: T,\n responseValue: DataValue,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): Promise<QueryReturnType<T>> {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined as unknown as QueryReturnType<typeof responseDataType>;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n\n switch (responseDataType.type) {\n case \"union\": {\n throw new Error(\"Union return types are not yet supported\");\n }\n\n case \"array\": {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n responseDataType.array,\n responseValue[i],\n definitions,\n );\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"set\": {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n responseDataType.set,\n responseValue[i],\n definitions,\n );\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"attachment\": {\n return hydrateAttachmentFromRidInternal(\n client,\n responseValue,\n ) as QueryReturnType<typeof responseDataType>;\n }\n\n case \"mediaReference\": {\n return createMediaFromReferenceInternal(\n client,\n responseValue,\n ) as unknown as QueryReturnType<typeof responseDataType>;\n }\n\n case \"object\": {\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) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"interface\": {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(`Missing definition for ${responseDataType.interface}`);\n }\n\n return createQueryInterfaceResponse(\n responseValue,\n def,\n ) as QueryReturnType<typeof responseDataType>;\n }\n\n case \"objectSet\": {\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\", objectType: responseDataType.objectSet },\n { type: \"reference\", reference: responseValue },\n ],\n }) as QueryReturnType<typeof responseDataType>;\n }\n\n return createObjectSet(def, client, responseValue) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"struct\": {\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(\n client,\n subtype,\n responseValue[key],\n definitions,\n );\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"map\": {\n const map = {} as any;\n\n invariant(Array.isArray(responseValue), \"Expected array entry\");\n for (const entry of responseValue) {\n invariant(entry.key != null, \"Expected key\");\n invariant(\n responseDataType.valueType.nullable || entry.value != null,\n \"Expected value\",\n );\n const key =\n responseDataType.keyType.type === \"object\"\n ? getObjectSpecifier(\n entry.key,\n responseDataType.keyType.object,\n definitions,\n )\n : entry.key;\n const value = await remapQueryResponse(\n client,\n responseDataType.valueType,\n entry.value,\n definitions,\n );\n map[key] = value;\n }\n return map;\n }\n\n case \"twoDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[] = [];\n for (const { key, value } of responseValue.groups) {\n result.push({ key, value });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n\n case \"threeDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[] = [];\n for (const { key, groups } of responseValue.groups) {\n const subResult: { key: any; value: any }[] = [];\n for (const { key: subKey, value } of groups) {\n subResult.push({ key: subKey, value });\n }\n result.push({ key, groups: subResult });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n}\n\nexport async function getRequiredDefinitions(\n dataType: QueryDataTypeDefinition,\n client: MinimalClient,\n): Promise<Map<string, ObjectOrInterfaceDefinition>> {\n const result = new Map<string, ObjectOrInterfaceDefinition>();\n switch (dataType.type) {\n case \"objectSet\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.objectSet,\n );\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"interfaceObjectSet\": {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(\n dataType.objectSet,\n );\n result.set(dataType.objectSet, interfaceDef);\n break;\n }\n case \"object\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.object,\n );\n result.set(dataType.object, objectDef);\n break;\n }\n\n case \"interface\": {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(\n dataType.interface,\n );\n result.set(dataType.interface, interfaceDef);\n break;\n }\n\n case \"set\": {\n return getRequiredDefinitions(dataType.set, client);\n }\n case \"array\": {\n return getRequiredDefinitions(dataType.array, client);\n }\n\n case \"map\": {\n const types = [dataType.keyType, dataType.valueType];\n\n const allDefs = await Promise.all(\n types.map((value) => getRequiredDefinitions(value, client)),\n );\n\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n\n case \"struct\": {\n const structValues = Object.values(dataType.struct);\n\n const allDefs = await Promise.all(\n structValues.map((value) => getRequiredDefinitions(value, client)),\n );\n\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 \"geoshape\":\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 const _: never = dataType;\n break;\n }\n }\n\n return result;\n}\nfunction requiresConversion(dataType: QueryDataTypeDefinition) {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"geoshape\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return false;\n\n case \"union\":\n return true;\n\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n\n case \"set\":\n return requiresConversion(dataType.set);\n\n case \"attachment\":\n case \"mediaReference\":\n case \"objectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n return true;\n\n default:\n return false;\n }\n}\n\nfunction getObjectSpecifier(\n primaryKey: any,\n objectTypeApiName: string,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): string {\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}\n\nexport function createQueryObjectResponse<Q extends ObjectTypeDefinition>(\n primaryKey: PrimaryKeyType<Q>,\n objectDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(\n objectDef,\n primaryKey,\n ),\n };\n}\n\nexport function createQueryInterfaceResponse<Q extends InterfaceDefinition>(\n interfaceSpecifier: {\n objectTypeApiName: string;\n primaryKeyValue: PrimaryKeyType<Q>;\n },\n interfaceDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(\n interfaceDef,\n interfaceSpecifier,\n ),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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S,CAAChE,OAAO;IAC3B+E,MAAM,EAAE5E,SAAS;IACjB6E,WAAW,EAAEhB,SAAS,CAAChE,OAAO;IAC9BiF,WAAW,EAAEL,UAAU;IACvBM,gBAAgB,EAAE3F,mCAAmC,CACnDyE,SAAS,EACTY,UACF;EACF,CAAC;AACH;AAEA,OAAO,SAASrC,4BAA4BA,CAC1C4C,kBAGC,EACDjB,YAAe,EACF;EACb,OAAO;IACLY,QAAQ,EAAEZ,YAAY,CAAClE,OAAO;IAC9B+E,MAAM,EAAE5E,SAAS;IACjB6E,WAAW,EAAEG,kBAAkB,CAACN,iBAAiB;IACjDI,WAAW,EAAEE,kBAAkB,CAACC,eAAe;IAC/CF,gBAAgB,EAAE5F,2CAA2C,CAC3D4E,YAAY,EACZiB,kBACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"applyQuery.js","names":["Queries","invariant","createMediaFromReferenceInternal","createObjectSet","hydrateAttachmentFromRidInternal","addUserAgentHeader","createObjectSpecifierFromInterfaceSpecifier","createObjectSpecifierFromPrimaryKey","toDataValueQueries","applyQuery","client","query","params","qd","ontologyProvider","getQueryDefinition","apiName","isFixedVersion","version","undefined","flushEdits","response","execute","ontologyRid","parameters","remapQueryParams","transactionId","scenarioRid","branch","objectOutputDefs","getRequiredDefinitions","output","remappedResponse","remapQueryResponse","value","paramTypes","parameterMap","key","Object","entries","responseDataType","responseValue","definitions","nullable","Error","type","i","length","array","set","def","get","object","createQueryObjectResponse","interface","createQueryInterfaceResponse","objectSet","objectSets","objectType","reference","interfaceType","subtype","struct","requiresConversion","map","Array","isArray","process","env","NODE_ENV","entry","valueType","keyType","getObjectSpecifier","result","groups","push","subResult","subKey","dataType","Map","objectDef","getObjectDefinition","interfaceDef","getInterfaceDefinition","types","allDefs","Promise","all","defs","structValues","values","some","primaryKey","objectTypeApiName","$apiName","$title","$objectType","$primaryKey","$objectSpecifier","interfaceSpecifier","primaryKeyValue"],"sources":["applyQuery.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n CompileTimeMetadata,\n InterfaceDefinition,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n OsdkBase,\n PrimaryKeyType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n QueryParameterDefinition,\n} from \"@osdk/api\";\nimport type { DataValue } from \"@osdk/foundry.ontologies\";\nimport * as Queries from \"@osdk/foundry.ontologies/Query\";\nimport invariant from \"tiny-invariant\";\n\nimport { createMediaFromReferenceInternal } from \"../createMediaFromReference.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentHeader } from \"../util/addUserAgentHeader.js\";\nimport {\n createObjectSpecifierFromInterfaceSpecifier,\n createObjectSpecifierFromPrimaryKey,\n} from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nimport type { QueryParameterType, QueryReturnType } from \"./types.js\";\n\nexport async function applyQuery<\n QD extends QueryDefinition<any>,\n P extends QueryParameterType<CompileTimeMetadata<QD>[\"parameters\"]>,\n>(\n client: MinimalClient,\n query: QD,\n params?: P,\n): Promise<QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>> {\n // We fire and forget so if a function has no parameters we don't unnecessarily load all metadata\n const qd: Promise<QueryMetadata> = client.ontologyProvider.getQueryDefinition(\n query.apiName,\n query.isFixedVersion ? query.version : undefined,\n );\n\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n\n const response = await Queries.execute(\n addUserAgentHeader(client, query),\n await client.ontologyRid,\n query.apiName,\n {\n parameters: params\n ? await remapQueryParams(\n params as { [parameterId: string]: any },\n client,\n (await qd).parameters,\n )\n : {},\n },\n {\n version: query.isFixedVersion ? query.version : undefined,\n transactionId: client.transactionId,\n scenarioRid: client.scenarioRid,\n branch: client.branch,\n },\n );\n\n const objectOutputDefs = await getRequiredDefinitions(\n (await qd).output,\n client,\n );\n const remappedResponse = await remapQueryResponse(\n client,\n (await qd).output,\n response.value,\n objectOutputDefs,\n );\n return remappedResponse as QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>;\n}\n\nexport async function remapQueryParams(\n params: { [parameterId: string]: any },\n client: MinimalClient,\n paramTypes: Record<string, QueryParameterDefinition<any>>,\n): Promise<{ [parameterId: string]: any }> {\n const parameterMap: { [parameterName: string]: unknown } = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(\n value,\n client,\n paramTypes[key],\n );\n }\n return parameterMap;\n}\n\nexport async function remapQueryResponse<\n Q extends ObjectTypeDefinition,\n T extends QueryDataTypeDefinition<Q | never>,\n>(\n client: MinimalClient,\n responseDataType: T,\n responseValue: DataValue,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): Promise<QueryReturnType<T>> {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined as unknown as QueryReturnType<typeof responseDataType>;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n\n switch (responseDataType.type) {\n case \"union\": {\n throw new Error(\"Union return types are not yet supported\");\n }\n\n case \"array\": {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n responseDataType.array,\n responseValue[i],\n definitions,\n );\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"set\": {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n responseDataType.set,\n responseValue[i],\n definitions,\n );\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"attachment\": {\n return hydrateAttachmentFromRidInternal(\n client,\n responseValue,\n ) as QueryReturnType<typeof responseDataType>;\n }\n\n case \"mediaReference\": {\n return createMediaFromReferenceInternal(\n client,\n responseValue,\n ) as unknown as QueryReturnType<typeof responseDataType>;\n }\n\n case \"object\": {\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) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"interface\": {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(`Missing definition for ${responseDataType.interface}`);\n }\n\n return createQueryInterfaceResponse(\n responseValue,\n def,\n ) as QueryReturnType<typeof responseDataType>;\n }\n\n case \"objectSet\": {\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\", objectType: responseDataType.objectSet },\n { type: \"reference\", reference: responseValue },\n ],\n }) as QueryReturnType<typeof responseDataType>;\n }\n\n return createObjectSet(def, client, responseValue) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"interfaceObjectSet\": {\n const def = definitions.get(responseDataType.objectSet);\n if (!def || def.type !== \"interface\") {\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: \"interfaceBase\", interfaceType: def.apiName },\n { type: \"reference\", reference: responseValue },\n ],\n }) as QueryReturnType<typeof responseDataType>;\n }\n\n return createObjectSet(def, client, responseValue) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"struct\": {\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(\n client,\n subtype,\n responseValue[key],\n definitions,\n );\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"map\": {\n const map = {} as any;\n\n invariant(Array.isArray(responseValue), \"Expected array entry\");\n for (const entry of responseValue) {\n invariant(entry.key != null, \"Expected key\");\n invariant(\n responseDataType.valueType.nullable || entry.value != null,\n \"Expected value\",\n );\n const key =\n responseDataType.keyType.type === \"object\"\n ? getObjectSpecifier(\n entry.key,\n responseDataType.keyType.object,\n definitions,\n )\n : entry.key;\n const value = await remapQueryResponse(\n client,\n responseDataType.valueType,\n entry.value,\n definitions,\n );\n map[key] = value;\n }\n return map;\n }\n\n case \"twoDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[] = [];\n for (const { key, value } of responseValue.groups) {\n result.push({ key, value });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n\n case \"threeDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[] = [];\n for (const { key, groups } of responseValue.groups) {\n const subResult: { key: any; value: any }[] = [];\n for (const { key: subKey, value } of groups) {\n subResult.push({ key: subKey, value });\n }\n result.push({ key, groups: subResult });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n}\n\nexport async function getRequiredDefinitions(\n dataType: QueryDataTypeDefinition,\n client: MinimalClient,\n): Promise<Map<string, ObjectOrInterfaceDefinition>> {\n const result = new Map<string, ObjectOrInterfaceDefinition>();\n switch (dataType.type) {\n case \"objectSet\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.objectSet,\n );\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"interfaceObjectSet\": {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(\n dataType.objectSet,\n );\n result.set(dataType.objectSet, interfaceDef);\n break;\n }\n case \"object\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.object,\n );\n result.set(dataType.object, objectDef);\n break;\n }\n\n case \"interface\": {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(\n dataType.interface,\n );\n result.set(dataType.interface, interfaceDef);\n break;\n }\n\n case \"set\": {\n return getRequiredDefinitions(dataType.set, client);\n }\n case \"array\": {\n return getRequiredDefinitions(dataType.array, client);\n }\n\n case \"map\": {\n const types = [dataType.keyType, dataType.valueType];\n\n const allDefs = await Promise.all(\n types.map((value) => getRequiredDefinitions(value, client)),\n );\n\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n\n case \"struct\": {\n const structValues = Object.values(dataType.struct);\n\n const allDefs = await Promise.all(\n structValues.map((value) => getRequiredDefinitions(value, client)),\n );\n\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 \"geoshape\":\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 const _: never = dataType;\n break;\n }\n }\n\n return result;\n}\nfunction requiresConversion(dataType: QueryDataTypeDefinition): boolean {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"geoshape\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n case \"typeReference\":\n return false;\n\n case \"union\":\n return true;\n\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n\n case \"set\":\n return requiresConversion(dataType.set);\n\n case \"array\":\n return requiresConversion(dataType.array);\n\n // maps are always converted from an entry array into a record\n case \"map\":\n case \"attachment\":\n case \"mediaReference\":\n case \"objectSet\":\n case \"interfaceObjectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n case \"interface\":\n return true;\n\n default: {\n const _: never = dataType;\n return false;\n }\n }\n}\n\nfunction getObjectSpecifier(\n primaryKey: any,\n objectTypeApiName: string,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): string {\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}\n\nexport function createQueryObjectResponse<Q extends ObjectTypeDefinition>(\n primaryKey: PrimaryKeyType<Q>,\n objectDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(\n objectDef,\n primaryKey,\n ),\n };\n}\n\nexport function createQueryInterfaceResponse<Q extends InterfaceDefinition>(\n interfaceSpecifier: {\n objectTypeApiName: string;\n primaryKeyValue: PrimaryKeyType<Q>;\n },\n interfaceDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(\n interfaceDef,\n interfaceSpecifier,\n ),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA,OAAO,KAAKA,OAAO,MAAM,gCAAgC;AACzD,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SAASC,gCAAgC,QAAQ,gCAAgC;AAEjF,SAASC,eAAe,QAAQ,iCAAiC;AACjE,SAASC,gCAAgC,QAAQ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GENT = `osdk-client/${"2.93.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.93.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.93.1-main-4ebde4f6852955187ba23bb3e22e08d44cb8745c"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.93.1-main-4ebde4f6852955187ba23bb3e22e08d44cb8745c"}`;
|
|
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 = `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,
|
|
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 = `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,GAAG,kFAAuD","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkYYE7GE4B_cjs = require('./chunk-YYE7GE4B.cjs');
|
|
4
|
+
var chunkGOWQ4ETF_cjs = require('./chunk-GOWQ4ETF.cjs');
|
|
5
5
|
var chunkB4UCZI2Z_cjs = require('./chunk-B4UCZI2Z.cjs');
|
|
6
6
|
require('./chunk-Q7SFCCGT.cjs');
|
|
7
7
|
|
|
@@ -17,19 +17,19 @@ async function* applyStreamingQuery(client, query, params) {
|
|
|
17
17
|
if (client.flushEdits != null) {
|
|
18
18
|
await client.flushEdits();
|
|
19
19
|
}
|
|
20
|
-
const response = await streamingExecute(
|
|
20
|
+
const response = await streamingExecute(chunkGOWQ4ETF_cjs.addUserAgentHeader(client, query), query.apiName, {
|
|
21
21
|
ontology: await client.ontologyRid,
|
|
22
|
-
parameters: params ? await
|
|
22
|
+
parameters: params ? await chunkYYE7GE4B_cjs.remapQueryParams(params, client, qd.parameters) : {},
|
|
23
23
|
version: query.isFixedVersion ? query.version : void 0,
|
|
24
24
|
branch: client.branch
|
|
25
25
|
}, {
|
|
26
26
|
transactionId: client.transactionId,
|
|
27
27
|
preview: true
|
|
28
28
|
});
|
|
29
|
-
const definitions = await
|
|
29
|
+
const definitions = await chunkYYE7GE4B_cjs.getRequiredDefinitions(qd.output, client);
|
|
30
30
|
for await (const event of response) {
|
|
31
31
|
if (event.type !== "data") continue;
|
|
32
|
-
const remapped = await
|
|
32
|
+
const remapped = await chunkYYE7GE4B_cjs.remapQueryResponse(client, qd.output, event.value, definitions);
|
|
33
33
|
if (qd.output.type === "array" && Array.isArray(remapped)) {
|
|
34
34
|
for (const item of remapped) {
|
|
35
35
|
yield item;
|
|
@@ -41,5 +41,5 @@ async function* applyStreamingQuery(client, query, params) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
exports.applyStreamingQuery = applyStreamingQuery;
|
|
44
|
-
//# sourceMappingURL=applyStreamingQuery-
|
|
45
|
-
//# sourceMappingURL=applyStreamingQuery-
|
|
44
|
+
//# sourceMappingURL=applyStreamingQuery-4KCFTMFJ.cjs.map
|
|
45
|
+
//# sourceMappingURL=applyStreamingQuery-4KCFTMFJ.cjs.map
|
package/build/cjs/{applyStreamingQuery-JOFNSSQT.cjs.map → applyStreamingQuery-4KCFTMFJ.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.87.0/node_modules/@osdk/foundry.functions/build/esm/v2/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentHeader","remapQueryParams","getRequiredDefinitions","remapQueryResponse"],"mappings":";;;;;;;;AAgFA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,mBAAmB,CAAA;AA2B5F,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;AC1FA,gBAAuB,mBAAA,CAAoB,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ;AAChE,EAAA,MAAM,EAAA,GAAK,MAAM,MAAA,CA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"applyStreamingQuery-JOFNSSQT.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 returns the highest semantic\n * version of the query, excluding pre-release versions. To resolve the most recently published version\n * instead, including pre-release versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * @beta\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 * @beta\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 * @beta\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 and returns the result as a single JSON object. By default, this executes\n * the highest semantic version of the query, excluding pre-release versions. To resolve the\n * most recently published version instead, including pre-release versions, set\n * `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint executes global (non-ontology-scoped) query functions. For ontology-scoped\n * functions, use the equivalent endpoint under\n * `/v2/ontologies/{ontology}/queries/{queryApiName}/execute`. For streaming or incremental\n * result delivery, use `streamingExecute`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\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,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _streamingExecuteEvents = [1, \"/v2/functions/queries/{0}/streamingExecuteEvents\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecuteEvents\n */\nexport function streamingExecuteEvents($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecuteEvents, ...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 * Supports maps represented as arrays of key/value entries, including nested maps.\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 { addUserAgentHeader } from \"../util/addUserAgentHeader.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(addUserAgentHeader(client, 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 const definitions = await getRequiredDefinitions(qd.output, client);\n for await (const event of response) {\n if (event.type !== \"data\") continue;\n const remapped = await remapQueryResponse(client, qd.output, event.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.87.0/node_modules/@osdk/foundry.functions/build/esm/v2/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentHeader","remapQueryParams","getRequiredDefinitions","remapQueryResponse"],"mappings":";;;;;;;;AAgFA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,mBAAmB,CAAA;AA2B5F,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,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,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-4KCFTMFJ.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 returns the highest semantic\n * version of the query, excluding pre-release versions. To resolve the most recently published version\n * instead, including pre-release versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * @beta\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 * @beta\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 * @beta\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 and returns the result as a single JSON object. By default, this executes\n * the highest semantic version of the query, excluding pre-release versions. To resolve the\n * most recently published version instead, including pre-release versions, set\n * `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint executes global (non-ontology-scoped) query functions. For ontology-scoped\n * functions, use the equivalent endpoint under\n * `/v2/ontologies/{ontology}/queries/{queryApiName}/execute`. For streaming or incremental\n * result delivery, use `streamingExecute`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\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,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _streamingExecuteEvents = [1, \"/v2/functions/queries/{0}/streamingExecuteEvents\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecuteEvents\n */\nexport function streamingExecuteEvents($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecuteEvents, ...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 * Supports maps represented as arrays of key/value entries, including nested maps.\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 { addUserAgentHeader } from \"../util/addUserAgentHeader.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(addUserAgentHeader(client, 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 const definitions = await getRequiredDefinitions(qd.output, client);\n for await (const event of response) {\n if (event.type !== \"data\") continue;\n const remapped = await remapQueryResponse(client, qd.output, event.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,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkI5D3T56Y_cjs = require('./chunk-I5D3T56Y.cjs');
|
|
4
|
+
var chunkGOWQ4ETF_cjs = require('./chunk-GOWQ4ETF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/scenarios/createScenario.ts
|
|
7
7
|
async function createScenario(client, options) {
|
|
8
|
-
const ctx = client[
|
|
8
|
+
const ctx = client[chunkGOWQ4ETF_cjs.additionalContext];
|
|
9
9
|
if (ctx.scenarioRid != null) {
|
|
10
10
|
throw new Error("createScenario: the supplied client already has an active scenario. Scenarios cannot be nested.");
|
|
11
11
|
}
|
|
@@ -19,18 +19,18 @@ async function createScenario(client, options) {
|
|
|
19
19
|
if (options?.expireAfter != null) {
|
|
20
20
|
request.expireAfter = options.expireAfter.toISOString();
|
|
21
21
|
}
|
|
22
|
-
const response = await
|
|
22
|
+
const response = await chunkI5D3T56Y_cjs.OntologyScenario_exports.createScenario(ctx, await ctx.ontologyRid, request, {
|
|
23
23
|
preview: true
|
|
24
24
|
});
|
|
25
|
-
return
|
|
25
|
+
return chunkI5D3T56Y_cjs.buildScenarioClient(client, response.scenarioRid);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// src/scenarios/withScenario.ts
|
|
29
29
|
function withScenario(client, scenarioRid) {
|
|
30
|
-
return
|
|
30
|
+
return chunkI5D3T56Y_cjs.buildScenarioClient(client, scenarioRid);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
exports.createScenario = createScenario;
|
|
34
34
|
exports.withScenario = withScenario;
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-AU4XW5MQ.cjs.map
|
|
36
|
+
//# sourceMappingURL=chunk-AU4XW5MQ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/scenarios/createScenario.ts","../../src/scenarios/withScenario.ts"],"names":["additionalContext","OntologyScenario_exports","buildScenarioClient"],"mappings":";;;;;;AAyCA,eAAsB,cAAA,CAAe,QAAQ,OAAA,EAAS;AACpD,EAAA,MAAM,GAAA,GAAM,OAAOA,mCAAiB,CAAA;AACpC,EAAA,IAAI,GAAA,CAAI,eAAe,IAAA,EAAM;AAC3B,IAAA,MAAM,IAAI,MAAM,iGAAiG,CAAA;AAAA,EACnH;AACA,EAAA,MAAM,UAAU,EAAC;AACjB,EAAA,IAAI,GAAA,CAAI,UAAU,IAAA,EAAM;AACtB,IAAA,OAAA,CAAQ,IAAA,GAAO;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,QAAQ,GAAA,CAAI;AAAA,KACd;AAAA,EACF;AACA,EAAA,IAAI,OAAA,EAAS,eAAe,IAAA,EAAM;AAChC,IAAA,OAAA,CAAQ,WAAA,GAAc,OAAA,CAAQ,WAAA,CAAY,WAAA,EAAY;AAAA,EACxD;AACA,EAAA,MAAM,QAAA,GAAW,MAAMC,0CAAA,CAAkB,cAAA,CAAe,KAAK,MAAM,GAAA,CAAI,aAAa,OAAA,EAAS;AAAA,IAC3F,OAAA,EAAS;AAAA,GACV,CAAA;AACD,EAAA,OAAOC,qCAAA,CAAoB,MAAA,EAAQ,QAAA,CAAS,WAAW,CAAA;AACzD;;;ACrBO,SAAS,YAAA,CAAa,QAAQ,WAAA,EAAa;AAChD,EAAA,OAAOA,qCAAA,CAAoB,QAAQ,WAAW,CAAA;AAChD","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/scenarios/createScenario.ts","../../src/scenarios/withScenario.ts"],"names":["additionalContext","OntologyScenario_exports","buildScenarioClient"],"mappings":";;;;;;AAyCA,eAAsB,cAAA,CAAe,QAAQ,OAAA,EAAS;AACpD,EAAA,MAAM,GAAA,GAAM,OAAOA,mCAAiB,CAAA;AACpC,EAAA,IAAI,GAAA,CAAI,eAAe,IAAA,EAAM;AAC3B,IAAA,MAAM,IAAI,MAAM,iGAAiG,CAAA;AAAA,EACnH;AACA,EAAA,MAAM,UAAU,EAAC;AACjB,EAAA,IAAI,GAAA,CAAI,UAAU,IAAA,EAAM;AACtB,IAAA,OAAA,CAAQ,IAAA,GAAO;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,QAAQ,GAAA,CAAI;AAAA,KACd;AAAA,EACF;AACA,EAAA,IAAI,OAAA,EAAS,eAAe,IAAA,EAAM;AAChC,IAAA,OAAA,CAAQ,WAAA,GAAc,OAAA,CAAQ,WAAA,CAAY,WAAA,EAAY;AAAA,EACxD;AACA,EAAA,MAAM,QAAA,GAAW,MAAMC,0CAAA,CAAkB,cAAA,CAAe,KAAK,MAAM,GAAA,CAAI,aAAa,OAAA,EAAS;AAAA,IAC3F,OAAA,EAAS;AAAA,GACV,CAAA;AACD,EAAA,OAAOC,qCAAA,CAAoB,MAAA,EAAQ,QAAA,CAAS,WAAW,CAAA;AACzD;;;ACrBO,SAAS,YAAA,CAAa,QAAQ,WAAA,EAAa;AAChD,EAAA,OAAOA,qCAAA,CAAoB,QAAQ,WAAW,CAAA;AAChD","file":"chunk-AU4XW5MQ.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OntologyScenarios } from \"@osdk/foundry.ontologies\";\nimport { additionalContext } from \"../Client.js\";\nimport { buildScenarioClient } from \"./ScenarioClient.js\";\n\n/**\n * Mint a fresh ontology scenario and return a client scoped to it.\n *\n * @param client - The base {@link Client} to derive context (`baseUrl`, `ontologyRid`, `tokenProvider`, `branch`, …)\n * from. Throws at runtime if the client is already scoped to a scenario. If the client has an active transaction,\n * the transaction is ignored (a warning is logged) and the client is scoped to the new scenario. When the base\n * client has a branch set, the newly minted scenario uses that branch as its base.\n * @param options - Optional settings for the new scenario.\n * @returns a {@link EXPERIMENTAL_ScenarioClient} bound to the freshly minted scenario RID.\n *\n * @beta This is an experimental, unstable feature subject to change.\n *\n * @example\n * ```ts\n * import { createScenario } from \"@osdk/client/unstable-do-not-use\";\n *\n * const expireAfter = new Date(Date.now() + 60 * 60 * 1000);\n * const scenario = await createScenario(client, { expireAfter });\n * const scenarioRid = scenario.getScenarioReference();\n * ```\n */\nexport async function createScenario(client, options) {\n const ctx = client[additionalContext];\n if (ctx.scenarioRid != null) {\n throw new Error(\"createScenario: the supplied client already has an active scenario. Scenarios cannot be nested.\");\n }\n const request = {};\n if (ctx.branch != null) {\n request.base = {\n type: \"branch\",\n branch: ctx.branch\n };\n }\n if (options?.expireAfter != null) {\n request.expireAfter = options.expireAfter.toISOString();\n }\n const response = await OntologyScenarios.createScenario(ctx, await ctx.ontologyRid, request, {\n preview: true\n });\n return buildScenarioClient(client, response.scenarioRid);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { buildScenarioClient } from \"./ScenarioClient.js\";\n\n/**\n * Attach to an existing ontology scenario. Synchronous — no network call is made. The returned client scopes all\n * subsequent operations (`fetchPage`, `applyAction`, `executeFunction`, etc.) to the given `scenarioRid`.\n *\n * @param client - The base {@link Client} to derive context (`baseUrl`, `ontologyRid`, `tokenProvider`, `branch`, …)\n * from. Throws at runtime if the client is already scoped to a scenario. If the client has an active transaction,\n * the transaction is ignored (a warning is logged) and the client is scoped to the scenario.\n * @param scenarioRid - The RID of the scenario to attach to.\n * @returns a {@link EXPERIMENTAL_ScenarioClient} bound to `scenarioRid`.\n *\n * @beta This is an experimental, unstable feature subject to change.\n *\n * @example\n * ```ts\n * import { withScenario } from \"@osdk/client/unstable-do-not-use\";\n *\n * const scenario = withScenario(client, \"ri.actions..scenario.abc\");\n * const page = await scenario(Doctor).fetchPage();\n * await scenario(Schedule).applyAction({ doctor: page.data[0], shift: \"AM\" });\n * ```\n */\nexport function withScenario(client, scenarioRid) {\n return buildScenarioClient(client, scenarioRid);\n}"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGOWQ4ETF_cjs = require('./chunk-GOWQ4ETF.cjs');
|
|
4
4
|
|
|
5
5
|
// src/logger/BaseLogger.ts
|
|
6
6
|
function noop() {
|
|
@@ -71,8 +71,8 @@ var MinimalLogger = class _MinimalLogger extends BaseLogger {
|
|
|
71
71
|
|
|
72
72
|
// src/objectSet/createTemporaryObjectSet.ts
|
|
73
73
|
async function createTemporaryObjectSet(client, objectSet) {
|
|
74
|
-
const response = await
|
|
75
|
-
objectSet: await
|
|
74
|
+
const response = await chunkGOWQ4ETF_cjs.createTemporary(client, await client.ontologyRid, {
|
|
75
|
+
objectSet: await chunkGOWQ4ETF_cjs.normalizeInterfaceLinkSearchArounds(client, chunkGOWQ4ETF_cjs.isWireObjectSet(objectSet) ? objectSet : chunkGOWQ4ETF_cjs.getWireObjectSet(objectSet))
|
|
76
76
|
}, {
|
|
77
77
|
branch: client.branch
|
|
78
78
|
});
|
|
@@ -82,5 +82,5 @@ async function createTemporaryObjectSet(client, objectSet) {
|
|
|
82
82
|
exports.BaseLogger = BaseLogger;
|
|
83
83
|
exports.MinimalLogger = MinimalLogger;
|
|
84
84
|
exports.createTemporaryObjectSet = createTemporaryObjectSet;
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-DL7RI6HN.cjs.map
|
|
86
|
+
//# sourceMappingURL=chunk-DL7RI6HN.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/logger/BaseLogger.ts","../../src/logger/MinimalLogger.ts","../../src/objectSet/createTemporaryObjectSet.ts"],"names":["createTemporary","normalizeInterfaceLinkSearchArounds","isWireObjectSet","getWireObjectSet"],"mappings":";;;;;AAgBO,SAAS,IAAA,GAAO;AAAC;AACxB,IAAM,MAAA,GAAS;AAAA,EACb,KAAA,EAAO,EAAA;AAAA,EACP,KAAA,EAAO,EAAA;AAAA,EACP,IAAA,EAAM,EAAA;AAAA,EACN,IAAA,EAAM,EAAA;AAAA,EACN,KAAA,EAAO,EAAA;AAAA,EACP,KAAA,EAAO;AACT,CAAA;AACO,IAAM,aAAN,MAAiB;AAAA,EACtB,QAAA;AAAA,EACA,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,OAAA,EAAS;AACtC,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AACf,IAAA,IAAA,CAAK,QAAA,GAAW,OAAA;AAChB,IAAA,KAAA,MAAW,CAAA,IAAK,CAAC,OAAA,EAAS,OAAA,EAAS,QAAQ,MAAA,EAAQ,OAAA,EAAS,OAAO,CAAA,EAAG;AACpE,MAAA,IAAI,KAAK,OAAA,EAAS,KAAA,IAAS,CAAC,IAAA,CAAK,cAAA,CAAe,CAAC,CAAA,EAAG;AAClD,QAAA;AAAA,MACF;AACA,MAAA,IAAA,CAAK,CAAC,CAAA,GAAI,IAAA,CAAK,eAAA,CAAgB,GAAG,QAAQ,CAAA;AAAA,IAC5C;AAAA,EACF;AAAA,EACA,KAAA,GAAQ,IAAA;AAAA,EACR,KAAA,GAAQ,IAAA;AAAA,EACR,IAAA,GAAO,IAAA;AAAA,EACP,IAAA,GAAO,IAAA;AAAA,EACP,KAAA,GAAQ,IAAA;AAAA,EACR,KAAA,GAAQ,IAAA;AAAA,EACR,KAAA,CAAM,UAAU,OAAA,EAAS;AACvB,IAAA,OAAO,IAAI,KAA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,IACvC;AACA,IAAA,OAAO,IAAI,IAAA,KAAS;AAElB,MAAA,OAAA,CAAQ,IAAA,KAAS,OAAA,GAAU,OAAA,GAAU,IAAI,CAAA,CAAE,KAAK,IAAA,CAAK,GAAG,CAAA,EAAG,GAAG,IAAI,CAAA;AAAA,IACpE,CAAA;AAAA,EACF;AACF;;;ACjBA,eAAsB,wBAAA,CAAyB,QAAQ,SAAA,EAAW;AAChE,EAAA,MAAM,WAAW,MAAyBA,iCAAA,CAAgB,MAAA,EAAQ,MAAM,OAAO,WAAA,EAAa;AAAA,IAC1F,SAAA,EAAW,MAAMC,qDAAA,CAAoC,MAAA,EAAQC,iCAAA,CAAgB,SAAS,CAAA,GAAI,SAAA,GAAYC,kCAAA,CAAiB,SAAS,CAAC;AAAA,GACnI,EAAG;AAAA,IACD,QAAQ,MAAA,CAAO;AAAA,GAChB,CAAA;AACD,EAAA,OAAO,QAAA,CAAS,YAAA;AAClB","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/logger/BaseLogger.ts","../../src/logger/MinimalLogger.ts","../../src/objectSet/createTemporaryObjectSet.ts"],"names":["createTemporary","normalizeInterfaceLinkSearchArounds","isWireObjectSet","getWireObjectSet"],"mappings":";;;;;AAgBO,SAAS,IAAA,GAAO;AAAC;AACxB,IAAM,MAAA,GAAS;AAAA,EACb,KAAA,EAAO,EAAA;AAAA,EACP,KAAA,EAAO,EAAA;AAAA,EACP,IAAA,EAAM,EAAA;AAAA,EACN,IAAA,EAAM,EAAA;AAAA,EACN,KAAA,EAAO,EAAA;AAAA,EACP,KAAA,EAAO;AACT,CAAA;AACO,IAAM,aAAN,MAAiB;AAAA,EACtB,QAAA;AAAA,EACA,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,OAAA,EAAS;AACtC,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AACf,IAAA,IAAA,CAAK,QAAA,GAAW,OAAA;AAChB,IAAA,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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 noop() {}\nconst levels = {\n trace: 10,\n debug: 20,\n info: 30,\n warn: 40,\n error: 50,\n fatal: 60\n};\nexport class BaseLogger {\n #factory;\n constructor(bindings, options, factory) {\n this.bindings = bindings;\n this.options = options;\n this.#factory = factory;\n for (const k of [\"trace\", \"debug\", \"info\", \"warn\", \"error\", \"fatal\"]) {\n if (this.options?.level && !this.isLevelEnabled(k)) {\n continue;\n }\n this[k] = this.createLogMethod(k, bindings);\n }\n }\n trace = noop;\n debug = noop;\n warn = noop;\n info = noop;\n error = noop;\n fatal = noop;\n child(bindings, options) {\n return new this.#factory({\n ...this.bindings,\n ...bindings\n }, {\n level: options?.level ?? this.options?.level,\n msgPrefix: [this.options?.msgPrefix, options?.msgPrefix].filter(x => x).join(\" \")\n });\n }\n isLevelEnabled(level) {\n const ourLevel = this.options?.level ?? \"info\";\n return level in levels && ourLevel in levels && levels[level] >= levels[ourLevel];\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\nimport { BaseLogger } from \"./BaseLogger.js\";\nexport class MinimalLogger extends BaseLogger {\n constructor(bindings = {}, options = {}) {\n super(bindings, {\n ...options,\n level: options.level ?? \"error\"\n }, MinimalLogger);\n }\n createLogMethod(name, bindings) {\n const msgs = [name];\n if (this.options?.msgPrefix) {\n msgs.push(this.options.msgPrefix);\n }\n if (typeof bindings === \"object\" && \"methodName\" in bindings) {\n msgs.push(`.${bindings.methodName}()`);\n }\n return (...args) => {\n // eslint-disable-next-line no-console\n console[name === \"fatal\" ? \"error\" : name](msgs.join(\" \"), ...args);\n };\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as OntologyObjectSets from \"@osdk/foundry.ontologies/OntologyObjectSet\";\nimport { normalizeInterfaceLinkSearchArounds } from \"../util/normalizeInterfaceLinkSearchArounds.js\";\nimport { isWireObjectSet } from \"../util/WireObjectSet.js\";\nimport { getWireObjectSet } from \"./createObjectSet.js\";\nexport async function createTemporaryObjectSet(client, objectSet) {\n const response = await OntologyObjectSets.createTemporary(client, await client.ontologyRid, {\n objectSet: await normalizeInterfaceLinkSearchArounds(client, isWireObjectSet(objectSet) ? objectSet : getWireObjectSet(objectSet))\n }, {\n branch: client.branch\n });\n return response.objectSetRid;\n}"]}
|