@osdk/client 2.38.0 → 2.39.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 +9 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{applyStreamingQuery-5EBTC6PK.cjs → applyStreamingQuery-PSXJITWN.cjs} +9 -9
- package/build/cjs/{applyStreamingQuery-5EBTC6PK.cjs.map → applyStreamingQuery-PSXJITWN.cjs.map} +1 -1
- package/build/cjs/{chunk-O7S4QCBV.cjs → chunk-DZARYB4B.cjs} +46 -46
- package/build/cjs/{chunk-O7S4QCBV.cjs.map → chunk-DZARYB4B.cjs.map} +1 -1
- package/build/cjs/{chunk-MHRH2XSF.cjs → chunk-KLTUXSNI.cjs} +2 -2
- package/build/cjs/{chunk-MHRH2XSF.cjs.map → chunk-KLTUXSNI.cjs.map} +1 -1
- package/build/cjs/{chunk-GKBL44QY.cjs → chunk-P7EPRSKV.cjs} +80 -80
- package/build/cjs/{chunk-GKBL44QY.cjs.map → chunk-P7EPRSKV.cjs.map} +1 -1
- package/build/cjs/{chunk-7RMQABID.cjs → chunk-Q5F3SO2G.cjs} +13 -13
- package/build/cjs/{chunk-7RMQABID.cjs.map → chunk-Q5F3SO2G.cjs.map} +1 -1
- package/build/cjs/index.cjs +11 -11
- package/build/cjs/public/experimental.cjs +6 -6
- package/build/cjs/public/internal.cjs +7 -7
- package/build/cjs/public/observable.cjs +5 -5
- package/build/cjs/public/unstable-do-not-use.cjs +14 -14
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/Client.d.ts +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
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.
|
|
24
|
+
const MaxOsdkVersion = "2.39.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.
|
|
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.39.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.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.39.0"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.39.0"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkQ5F3SO2G_cjs = require('./chunk-Q5F3SO2G.cjs');
|
|
4
|
+
var chunkKLTUXSNI_cjs = require('./chunk-KLTUXSNI.cjs');
|
|
5
5
|
require('./chunk-ROJIXXGF.cjs');
|
|
6
6
|
var chunkH6PXPU6F_cjs = require('./chunk-H6PXPU6F.cjs');
|
|
7
7
|
require('./chunk-Q7SFCCGT.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(
|
|
21
|
+
const response = await streamingExecute(chunkKLTUXSNI_cjs.addUserAgentAndRequestContextHeaders(chunkKLTUXSNI_cjs.augmentRequestContext(client, (_) => ({
|
|
22
22
|
finalMethodCall: "applyStreamingQuery"
|
|
23
23
|
})), query), query.apiName, {
|
|
24
24
|
ontology: await client.ontologyRid,
|
|
25
|
-
parameters: params ? await
|
|
25
|
+
parameters: params ? await chunkQ5F3SO2G_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
|
|
35
|
+
const definitions = await chunkQ5F3SO2G_cjs.getRequiredDefinitions(qd.output, client);
|
|
36
36
|
const reader = response.body.getReader();
|
|
37
|
-
for await (const line of
|
|
37
|
+
for await (const line of chunkQ5F3SO2G_cjs.parseNdjsonStream(chunkQ5F3SO2G_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
|
|
43
|
+
const remapped = await chunkQ5F3SO2G_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-
|
|
56
|
-
//# sourceMappingURL=applyStreamingQuery-
|
|
55
|
+
//# sourceMappingURL=applyStreamingQuery-PSXJITWN.cjs.map
|
|
56
|
+
//# sourceMappingURL=applyStreamingQuery-PSXJITWN.cjs.map
|
package/build/cjs/{applyStreamingQuery-5EBTC6PK.cjs.map → applyStreamingQuery-PSXJITWN.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.63.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentAndRequestContextHeaders","augmentRequestContext","remapQueryParams","getRequiredDefinitions","parseNdjsonStream","iterateReadableStream","remapQueryResponse"],"mappings":";;;;;;;;;AA2EA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,0BAA0B,CAAA;AAiCnG,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;ACzFA,gBAAuB,mBAAA,CAAoB,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ;AAChE,EAAA,MAAM,EAAA,GAAK,MAAM,MAAA,CAAO,gBAAA,CAAiB,kBAAA,CAAmB,KAAA,CAAM,OAAA,EAAS,KAAA,CAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,GAAU,MAAS,CAAA;AAC3H,EAAA,IAAI,MAAA,CAAO,cAAc,IAAA,EAAM;AAC7B,IAAA,MAAM,OAAO,UAAA,EAAW;AAAA,EAC1B;AACA,EAAA,MAAM,WAAW,MAAgB,gBAAA,CAAiBC,sDAAA,CAAqCC,uCAAA,CAAsB,QAAQ,CAAA,CAAA,MAAM;AAAA,IACzH,eAAA,EAAiB;AAAA,GACnB,CAAE,CAAA,EAAG,KAAK,CAAA,EAAG,MAAM,OAAA,EAAS;AAAA,IAC1B,QAAA,EAAU,MAAM,MAAA,CAAO,WAAA;AAAA,IACvB,UAAA,EAAY,SAAS,MAAMC,kCAAA,CAAiB,QAAQ,MAAA,EAAQ,EAAA,CAAG,UAAU,CAAA,GAAI,EAAC;AAAA,IAC9E,OAAA,EAAS,KAAA,CAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,GAAU,MAAA;AAAA,IAChD,QAAQ,MAAA,CAAO;AAAA,GACjB,EAAG;AAAA,IACD,eAAe,MAAA,CAAO,aAAA;AAAA,IACtB,OAAA,EAAS;AAAA,GACV,CAAA;AACD,EAAA,IAAI,QAAA,CAAS,QAAQ,IAAA,EAAM;AACzB,IAAA,MAAM,IAAI,MAAM,4CAA4C,CAAA;AAAA,EAC9D;AACA,EAAA,MAAM,WAAA,GAAc,MAAMC,wCAAA,CAAuB,EAAA,CAAG,QAAQ,MAAM,CAAA;AAClE,EAAA,MAAM,MAAA,GAAS,QAAA,CAAS,IAAA,CAAK,SAAA,EAAU;AACvC,EAAA,WAAA,MAAiB,IAAA,IAAQC,mCAAA,CAAkBC,uCAAA,CAAsB,MAAM,CAAC,CAAA,EAAG;AACzE,IAAA,IAAI,IAAA,CAAK,SAAS,OAAA,EAAS;AACzB,MAAA,MAAM,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAA,CAAK,SAAS,CAAA,EAAA,EAAK,IAAA,CAAK,SAAS,CAAA,GAAA,EAAM,KAAK,eAAe,CAAA,GAAA,EAAM,IAAA,CAAK,gBAAA,IAAoB,EAAE,CAAA,CAAE,CAAA;AACvH,MAAA,MAAA,CAAO,MAAA,CAAO,KAAK,IAAI,CAAA;AACvB,MAAA,MAAM,GAAA;AAAA,IACR;AACA,IAAA,MAAM,QAAA,GAAW,MAAMC,oCAAA,CAAmB,MAAA,EAAQ,GAAG,MAAA,EAAQ,IAAA,CAAK,OAAO,WAAW,CAAA;AACpF,IAAA,IAAI,GAAG,MAAA,CAAO,IAAA,KAAS,WAAW,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACzD,MAAA,KAAA,MAAW,QAAQ,QAAA,EAAU;AAC3B,QAAA,MAAM,IAAA;AAAA,MACR;AAAA,IACF,CAAA,MAAO;AACL,MAAA,MAAM,QAAA;AAAA,IACR;AAAA,EACF;AACF","file":"applyStreamingQuery-5EBTC6PK.cjs","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _get = [0, \"/v2/functions/queries/{0}\", 2];\n/**\n * Gets a specific query type with the given API name. By default, this gets the latest version of the query.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/functions/queries/getByRid\", 2];\n/**\n * Gets a specific query type with the given RID. By default, this gets the latest version of the query.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRid\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/functions/queries/getByRidBatch\", 3];\n/**\n * Gets a list of query types by RID in bulk. By default, this gets the latest version of each query.\n *\n * Queries are filtered from the response if they don't exist or the requesting token lacks the required\n * permissions.\n *\n * The maximum batch size for this endpoint is 100.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\n}\nconst _execute = [1, \"/v2/functions/queries/{0}/execute\", 7];\n/**\n * Executes a Query using the given parameters. By default, this executes the latest version of the query.\n *\n * This endpoint is maintained for backward compatibility only.\n *\n * For all new implementations, use the `streamingExecute` endpoint, which supports all function types\n * and provides enhanced functionality.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}\nconst _streamingExecute = [1, \"/v2/functions/queries/{0}/streamingExecute\", 7,, \"application/octet-stream\"];\n/**\n * Executes a Query using the given parameters, returning results as an NDJSON stream. By default, this executes the latest version of the query.\n *\n * This endpoint supports all Query functions. The endpoint name 'streamingExecute' refers to the NDJSON\n * streaming response format. Both streaming and non-streaming functions can use this endpoint.\n * Non-streaming functions return a single-line NDJSON response, while streaming functions return multi-line NDJSON responses.\n * This is the recommended endpoint for all query execution.\n *\n * The response is returned as a binary stream in NDJSON (Newline Delimited JSON) format, where each line\n * is a StreamingExecuteQueryResponse containing either a data batch or an error.\n *\n * For a function returning a list of 5 records with a batch size of 3, the response stream would contain\n * two lines. The first line contains the first 3 items, and the second line contains the remaining 2 items:\n *\n * ```\n * {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99},{\"productId\":\"SKU-002\",\"price\":49.99},{\"productId\":\"SKU-003\",\"price\":19.99}]}\n * {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-004\",\"price\":39.99},{\"productId\":\"SKU-005\",\"price\":59.99}]}\n * ```\n *\n * Each line is a separate JSON object followed by a newline character. Clients should parse the stream\n * line-by-line to process results as they arrive. If an error occurs during execution, the stream will\n * contain an error line:\n *\n * ```\n * {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _executeAsync = [1, \"/v2/functions/queries/{0}/executeAsync\", 7];\n/**\n * Submits a Query for asynchronous execution. Returns either an execution ID\n * for polling, or the complete result if execution finished immediately.\n *\n * Use the Execution resource's getResult endpoint to poll for the\n * result of a submitted execution.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/executeAsync\n */\nexport function executeAsync($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _executeAsync, ...args);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Functions from \"@osdk/foundry.functions/Query\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { iterateReadableStream, parseNdjsonStream } from \"../util/streamutils.js\";\nimport { getRequiredDefinitions, remapQueryParams, remapQueryResponse } from \"./applyQuery.js\";\nexport async function* applyStreamingQuery(client, query, params) {\n const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Functions.streamingExecute(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, _ => ({\n finalMethodCall: \"applyStreamingQuery\"\n })), query), query.apiName, {\n ontology: await client.ontologyRid,\n parameters: params ? await remapQueryParams(params, client, qd.parameters) : {},\n version: query.isFixedVersion ? query.version : undefined,\n branch: client.branch\n }, {\n transactionId: client.transactionId,\n preview: true\n });\n if (response.body == null) {\n throw new Error(\"streamingExecute returned no response body\");\n }\n const definitions = await getRequiredDefinitions(qd.output, client);\n const reader = response.body.getReader();\n for await (const line of parseNdjsonStream(iterateReadableStream(reader))) {\n if (line.type === \"error\") {\n const err = new Error(`${line.errorName} (${line.errorCode}) [${line.errorInstanceId}]: ${line.errorDescription ?? \"\"}`);\n Object.assign(err, line);\n throw err;\n }\n const remapped = await remapQueryResponse(client, qd.output, line.value, definitions);\n if (qd.output.type === \"array\" && Array.isArray(remapped)) {\n for (const item of remapped) {\n yield item;\n }\n } else {\n yield remapped;\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.63.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentAndRequestContextHeaders","augmentRequestContext","remapQueryParams","getRequiredDefinitions","parseNdjsonStream","iterateReadableStream","remapQueryResponse"],"mappings":";;;;;;;;;AA2EA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,0BAA0B,CAAA;AAiCnG,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;ACzFA,gBAAuB,mBAAA,CAAoB,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ;AAChE,EAAA,MAAM,EAAA,GAAK,MAAM,MAAA,CAAO,gBAAA,CAAiB,kBAAA,CAAmB,KAAA,CAAM,OAAA,EAAS,KAAA,CAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,GAAU,MAAS,CAAA;AAC3H,EAAA,IAAI,MAAA,CAAO,cAAc,IAAA,EAAM;AAC7B,IAAA,MAAM,OAAO,UAAA,EAAW;AAAA,EAC1B;AACA,EAAA,MAAM,WAAW,MAAgB,gBAAA,CAAiBC,sDAAA,CAAqCC,uCAAA,CAAsB,QAAQ,CAAA,CAAA,MAAM;AAAA,IACzH,eAAA,EAAiB;AAAA,GACnB,CAAE,CAAA,EAAG,KAAK,CAAA,EAAG,MAAM,OAAA,EAAS;AAAA,IAC1B,QAAA,EAAU,MAAM,MAAA,CAAO,WAAA;AAAA,IACvB,UAAA,EAAY,SAAS,MAAMC,kCAAA,CAAiB,QAAQ,MAAA,EAAQ,EAAA,CAAG,UAAU,CAAA,GAAI,EAAC;AAAA,IAC9E,OAAA,EAAS,KAAA,CAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,GAAU,MAAA;AAAA,IAChD,QAAQ,MAAA,CAAO;AAAA,GACjB,EAAG;AAAA,IACD,eAAe,MAAA,CAAO,aAAA;AAAA,IACtB,OAAA,EAAS;AAAA,GACV,CAAA;AACD,EAAA,IAAI,QAAA,CAAS,QAAQ,IAAA,EAAM;AACzB,IAAA,MAAM,IAAI,MAAM,4CAA4C,CAAA;AAAA,EAC9D;AACA,EAAA,MAAM,WAAA,GAAc,MAAMC,wCAAA,CAAuB,EAAA,CAAG,QAAQ,MAAM,CAAA;AAClE,EAAA,MAAM,MAAA,GAAS,QAAA,CAAS,IAAA,CAAK,SAAA,EAAU;AACvC,EAAA,WAAA,MAAiB,IAAA,IAAQC,mCAAA,CAAkBC,uCAAA,CAAsB,MAAM,CAAC,CAAA,EAAG;AACzE,IAAA,IAAI,IAAA,CAAK,SAAS,OAAA,EAAS;AACzB,MAAA,MAAM,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAA,CAAK,SAAS,CAAA,EAAA,EAAK,IAAA,CAAK,SAAS,CAAA,GAAA,EAAM,KAAK,eAAe,CAAA,GAAA,EAAM,IAAA,CAAK,gBAAA,IAAoB,EAAE,CAAA,CAAE,CAAA;AACvH,MAAA,MAAA,CAAO,MAAA,CAAO,KAAK,IAAI,CAAA;AACvB,MAAA,MAAM,GAAA;AAAA,IACR;AACA,IAAA,MAAM,QAAA,GAAW,MAAMC,oCAAA,CAAmB,MAAA,EAAQ,GAAG,MAAA,EAAQ,IAAA,CAAK,OAAO,WAAW,CAAA;AACpF,IAAA,IAAI,GAAG,MAAA,CAAO,IAAA,KAAS,WAAW,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACzD,MAAA,KAAA,MAAW,QAAQ,QAAA,EAAU;AAC3B,QAAA,MAAM,IAAA;AAAA,MACR;AAAA,IACF,CAAA,MAAO;AACL,MAAA,MAAM,QAAA;AAAA,IACR;AAAA,EACF;AACF","file":"applyStreamingQuery-PSXJITWN.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}"]}
|
|
@@ -4,8 +4,8 @@ var chunkYJG67XL4_cjs = require('./chunk-YJG67XL4.cjs');
|
|
|
4
4
|
var chunkTQUNF2DZ_cjs = require('./chunk-TQUNF2DZ.cjs');
|
|
5
5
|
var chunkCEBSLQQC_cjs = require('./chunk-CEBSLQQC.cjs');
|
|
6
6
|
var chunkPIWGMK3H_cjs = require('./chunk-PIWGMK3H.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var chunkQ5F3SO2G_cjs = require('./chunk-Q5F3SO2G.cjs');
|
|
8
|
+
var chunkKLTUXSNI_cjs = require('./chunk-KLTUXSNI.cjs');
|
|
9
9
|
var chunkROJIXXGF_cjs = require('./chunk-ROJIXXGF.cjs');
|
|
10
10
|
var chunkH6PXPU6F_cjs = require('./chunk-H6PXPU6F.cjs');
|
|
11
11
|
var chunkQ7SFCCGT_cjs = require('./chunk-Q7SFCCGT.cjs');
|
|
@@ -124,7 +124,7 @@ function isScenarioClient(value) {
|
|
|
124
124
|
return value != null && (typeof value === "object" || typeof value === "function") && typeof value.getScenarioReference === "function";
|
|
125
125
|
}
|
|
126
126
|
function buildScenarioClient(parent, scenarioRid) {
|
|
127
|
-
const ctx = parent[
|
|
127
|
+
const ctx = parent[chunkKLTUXSNI_cjs.additionalContext];
|
|
128
128
|
if (ctx.transactionId != null) {
|
|
129
129
|
console.warn("withScenario / createScenario: the supplied client has an active transaction. Ignoring the transaction and scoping to the scenario instead.");
|
|
130
130
|
}
|
|
@@ -135,7 +135,7 @@ function buildScenarioClient(parent, scenarioRid) {
|
|
|
135
135
|
logger: ctx.logger,
|
|
136
136
|
UNSTABLE_DO_NOT_USE_BRANCH: ctx.branch
|
|
137
137
|
}, ctx.fetch);
|
|
138
|
-
const innerCtx = inner[
|
|
138
|
+
const innerCtx = inner[chunkKLTUXSNI_cjs.additionalContext];
|
|
139
139
|
async function getEditedEntityTypes() {
|
|
140
140
|
const ontologyRid = await innerCtx.ontologyRid;
|
|
141
141
|
const response = await OntologyScenario_exports.listScenarioEditedEntityTypes(innerCtx, ontologyRid, scenarioRid, {
|
|
@@ -277,7 +277,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
277
277
|
}
|
|
278
278
|
if (Array.isArray(value) || value instanceof Set) {
|
|
279
279
|
const values = Array.from(value);
|
|
280
|
-
if (values.some((dataValue) =>
|
|
280
|
+
if (values.some((dataValue) => chunkQ5F3SO2G_cjs.isAttachmentUpload(dataValue) || chunkQ5F3SO2G_cjs.isAttachmentFile(dataValue))) {
|
|
281
281
|
const converted = [];
|
|
282
282
|
for (const value2 of values) {
|
|
283
283
|
converted.push(await toDataValue(value2, client));
|
|
@@ -287,44 +287,44 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
287
287
|
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));
|
|
288
288
|
return Promise.all(promiseArray);
|
|
289
289
|
}
|
|
290
|
-
if (
|
|
291
|
-
const attachment = await
|
|
290
|
+
if (chunkQ5F3SO2G_cjs.isAttachmentUpload(value)) {
|
|
291
|
+
const attachment = await chunkKLTUXSNI_cjs.upload(client, value.data, {
|
|
292
292
|
filename: value.name
|
|
293
293
|
});
|
|
294
294
|
return await toDataValue(attachment.rid, client);
|
|
295
295
|
}
|
|
296
|
-
if (
|
|
297
|
-
const attachment = await
|
|
296
|
+
if (chunkQ5F3SO2G_cjs.isAttachmentFile(value)) {
|
|
297
|
+
const attachment = await chunkKLTUXSNI_cjs.upload(client, value, {
|
|
298
298
|
filename: value.name
|
|
299
299
|
});
|
|
300
300
|
return await toDataValue(attachment.rid, client);
|
|
301
301
|
}
|
|
302
|
-
if (
|
|
302
|
+
if (chunkQ5F3SO2G_cjs.isMediaUpload(value)) {
|
|
303
303
|
const mediaRef = await chunkROJIXXGF_cjs.MediaSet_exports.uploadMedia(client, value.data, {
|
|
304
304
|
filename: value.fileName,
|
|
305
305
|
preview: true
|
|
306
306
|
});
|
|
307
307
|
return await toDataValue(mediaRef, client);
|
|
308
308
|
}
|
|
309
|
-
if (
|
|
309
|
+
if (chunkQ5F3SO2G_cjs.isMedia(value)) {
|
|
310
310
|
return value.getMediaReference();
|
|
311
311
|
}
|
|
312
|
-
if (
|
|
312
|
+
if (chunkQ5F3SO2G_cjs.isMediaReference(value)) {
|
|
313
313
|
return value;
|
|
314
314
|
}
|
|
315
315
|
if (isOntologyObjectV2(value)) {
|
|
316
316
|
return await toDataValue(value.__primaryKey, client);
|
|
317
317
|
}
|
|
318
|
-
if (
|
|
318
|
+
if (chunkQ5F3SO2G_cjs.isObjectSpecifiersObject(value)) {
|
|
319
319
|
return await toDataValue(value.$primaryKey, client);
|
|
320
320
|
}
|
|
321
|
-
if (
|
|
321
|
+
if (chunkKLTUXSNI_cjs.isWireObjectSet(value)) {
|
|
322
322
|
return value;
|
|
323
323
|
}
|
|
324
|
-
if (
|
|
325
|
-
return
|
|
324
|
+
if (chunkKLTUXSNI_cjs.isObjectSet(value)) {
|
|
325
|
+
return chunkKLTUXSNI_cjs.getWireObjectSet(value);
|
|
326
326
|
}
|
|
327
|
-
if (
|
|
327
|
+
if (chunkQ5F3SO2G_cjs.isInterfaceActionParam(value)) {
|
|
328
328
|
return {
|
|
329
329
|
objectTypeApiName: value.$objectType,
|
|
330
330
|
primaryKeyValue: value.$primaryKey
|
|
@@ -345,7 +345,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
345
345
|
|
|
346
346
|
// src/actions/applyAction.ts
|
|
347
347
|
async function applyAction(client, action, parameters, options = {}) {
|
|
348
|
-
const clientWithHeaders =
|
|
348
|
+
const clientWithHeaders = chunkKLTUXSNI_cjs.addUserAgentAndRequestContextHeaders(chunkKLTUXSNI_cjs.augmentRequestContext(client, (_) => ({
|
|
349
349
|
finalMethodCall: "applyAction"
|
|
350
350
|
})), action);
|
|
351
351
|
if (Array.isArray(parameters)) {
|
|
@@ -477,7 +477,7 @@ function getTimeRange(body) {
|
|
|
477
477
|
}
|
|
478
478
|
async function* asyncIterPointsHelper(iterator) {
|
|
479
479
|
const reader = iterator.body?.getReader();
|
|
480
|
-
for await (const point of
|
|
480
|
+
for await (const point of chunkQ5F3SO2G_cjs.parseStreamedResponse(chunkQ5F3SO2G_cjs.iterateReadableStream(reader))) {
|
|
481
481
|
yield {
|
|
482
482
|
time: point.time,
|
|
483
483
|
value: point.value
|
|
@@ -573,7 +573,7 @@ var MediaReferencePropertyImpl = class {
|
|
|
573
573
|
ReadToken: token
|
|
574
574
|
} : void 0);
|
|
575
575
|
return {
|
|
576
|
-
itemMetadata:
|
|
576
|
+
itemMetadata: chunkKLTUXSNI_cjs.validateMediaItemMetadata(raw)
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
579
|
getMediaReference() {
|
|
@@ -1001,8 +1001,8 @@ function get$link(holder) {
|
|
|
1001
1001
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
1002
1002
|
}).pivotTo(linkName);
|
|
1003
1003
|
const value = !linkDef.multiplicity ? {
|
|
1004
|
-
fetchOne: (options) =>
|
|
1005
|
-
fetchOneWithErrors: (options) =>
|
|
1004
|
+
fetchOne: (options) => chunkKLTUXSNI_cjs.fetchSingle(client, objDef, options ?? {}, chunkKLTUXSNI_cjs.getWireObjectSet(objectSet)),
|
|
1005
|
+
fetchOneWithErrors: (options) => chunkKLTUXSNI_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkKLTUXSNI_cjs.getWireObjectSet(objectSet))
|
|
1006
1006
|
} : objectSet;
|
|
1007
1007
|
return [linkName, value];
|
|
1008
1008
|
})));
|
|
@@ -1025,8 +1025,8 @@ function get$linkForInterface(holder) {
|
|
|
1025
1025
|
apiName: linkDef.targetTypeApiName
|
|
1026
1026
|
};
|
|
1027
1027
|
const value = !linkDef.multiplicity ? {
|
|
1028
|
-
fetchOne: (options) =>
|
|
1029
|
-
fetchOneWithErrors: (options) =>
|
|
1028
|
+
fetchOne: (options) => chunkKLTUXSNI_cjs.fetchSingle(client, linkTargetDef, options ?? {}, chunkKLTUXSNI_cjs.getWireObjectSet(objectSet)),
|
|
1029
|
+
fetchOneWithErrors: (options) => chunkKLTUXSNI_cjs.fetchSingleWithErrors(client, linkTargetDef, options ?? {}, chunkKLTUXSNI_cjs.getWireObjectSet(objectSet))
|
|
1030
1030
|
} : objectSet;
|
|
1031
1031
|
return [linkName, value];
|
|
1032
1032
|
})));
|
|
@@ -1034,7 +1034,7 @@ function get$linkForInterface(holder) {
|
|
|
1034
1034
|
|
|
1035
1035
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
1036
1036
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
1037
|
-
const [objApiNamespace] =
|
|
1037
|
+
const [objApiNamespace] = chunkKLTUXSNI_cjs.extractNamespace(interfaceDef.apiName);
|
|
1038
1038
|
return Object.freeze(Object.defineProperties({}, {
|
|
1039
1039
|
// first to minimize hidden classes
|
|
1040
1040
|
[UnderlyingOsdkObject]: {
|
|
@@ -1097,7 +1097,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
1097
1097
|
},
|
|
1098
1098
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
1099
1099
|
const objDef = underlying[ObjectDefRef];
|
|
1100
|
-
const [apiNamespace, apiName] =
|
|
1100
|
+
const [apiNamespace, apiName] = chunkKLTUXSNI_cjs.extractNamespace(p);
|
|
1101
1101
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
1102
1102
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
1103
1103
|
enumerable: targetPropName in underlying,
|
|
@@ -1137,7 +1137,7 @@ function remapPropertySecuritiesForInterface(underlyingSecurities, objDef, inter
|
|
|
1137
1137
|
}
|
|
1138
1138
|
const interfacePropName = inverseMap[objPropName];
|
|
1139
1139
|
if (interfacePropName == null) continue;
|
|
1140
|
-
const [apiNamespace, apiName] =
|
|
1140
|
+
const [apiNamespace, apiName] = chunkKLTUXSNI_cjs.extractNamespace(interfacePropName);
|
|
1141
1141
|
const key = apiNamespace === objApiNamespace ? apiName : interfacePropName;
|
|
1142
1142
|
remapped[key] = underlyingSecurities[objPropName];
|
|
1143
1143
|
}
|
|
@@ -1218,7 +1218,7 @@ var basePropDefs = {
|
|
|
1218
1218
|
"$objectSpecifier": {
|
|
1219
1219
|
get() {
|
|
1220
1220
|
const rawObj = this[UnderlyingOsdkObject];
|
|
1221
|
-
return
|
|
1221
|
+
return chunkQ5F3SO2G_cjs.createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);
|
|
1222
1222
|
},
|
|
1223
1223
|
enumerable: true
|
|
1224
1224
|
},
|
|
@@ -1290,9 +1290,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1290
1290
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1291
1291
|
case "attachment":
|
|
1292
1292
|
if (Array.isArray(rawValue)) {
|
|
1293
|
-
return rawValue.map((a) =>
|
|
1293
|
+
return rawValue.map((a) => chunkKLTUXSNI_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1294
1294
|
} else {
|
|
1295
|
-
return
|
|
1295
|
+
return chunkKLTUXSNI_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1296
1296
|
}
|
|
1297
1297
|
default:
|
|
1298
1298
|
process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant2__default.default(false) ;
|
|
@@ -1308,9 +1308,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
if (propDef.type === "attachment") {
|
|
1310
1310
|
if (Array.isArray(rawValue)) {
|
|
1311
|
-
return rawValue.map((a) =>
|
|
1311
|
+
return rawValue.map((a) => chunkKLTUXSNI_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1312
1312
|
}
|
|
1313
|
-
return
|
|
1313
|
+
return chunkKLTUXSNI_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1314
1314
|
}
|
|
1315
1315
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1316
1316
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1653,11 +1653,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1653
1653
|
};
|
|
1654
1654
|
|
|
1655
1655
|
// src/util/UserAgent.ts
|
|
1656
|
-
var USER_AGENT = `osdk-client/${"2.
|
|
1657
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
1656
|
+
var USER_AGENT = `osdk-client/${"2.39.0"}`;
|
|
1657
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.39.0"}`;
|
|
1658
1658
|
|
|
1659
1659
|
// src/createMinimalClient.ts
|
|
1660
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1660
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkKLTUXSNI_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1661
1661
|
if (process.env.NODE_ENV !== "production") {
|
|
1662
1662
|
try {
|
|
1663
1663
|
new URL(baseUrl);
|
|
@@ -2249,7 +2249,7 @@ var ActionInvoker = class {
|
|
|
2249
2249
|
};
|
|
2250
2250
|
var QueryInvoker = class {
|
|
2251
2251
|
constructor(clientCtx, queryDef) {
|
|
2252
|
-
this.executeFunction =
|
|
2252
|
+
this.executeFunction = chunkQ5F3SO2G_cjs.applyQuery.bind(void 0, clientCtx, queryDef);
|
|
2253
2253
|
}
|
|
2254
2254
|
};
|
|
2255
2255
|
function createClientInternal(objectSetFactory, transactionRid, flushEdits, scenarioRid, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
@@ -2291,7 +2291,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2291
2291
|
async *executeStreamingFunction(query, params) {
|
|
2292
2292
|
const {
|
|
2293
2293
|
applyStreamingQuery
|
|
2294
|
-
} = await import('./applyStreamingQuery-
|
|
2294
|
+
} = await import('./applyStreamingQuery-PSXJITWN.cjs');
|
|
2295
2295
|
yield* applyStreamingQuery(clientCtx, query, params);
|
|
2296
2296
|
}
|
|
2297
2297
|
};
|
|
@@ -2307,7 +2307,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2307
2307
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
2308
2308
|
return {
|
|
2309
2309
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
2310
|
-
return await
|
|
2310
|
+
return await chunkKLTUXSNI_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
2311
2311
|
}
|
|
2312
2312
|
};
|
|
2313
2313
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -2331,10 +2331,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2331
2331
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
2332
2332
|
return {
|
|
2333
2333
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
2334
|
-
return await
|
|
2334
|
+
return await chunkKLTUXSNI_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
2335
2335
|
},
|
|
2336
2336
|
fetchPageByRidNoType: async (rids, options) => {
|
|
2337
|
-
return await
|
|
2337
|
+
return await chunkKLTUXSNI_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
2338
2338
|
}
|
|
2339
2339
|
};
|
|
2340
2340
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__subscribeToNoTypeObjectSet.name:
|
|
@@ -2378,7 +2378,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2378
2378
|
[symbolClientContext2]: {
|
|
2379
2379
|
value: clientCtx
|
|
2380
2380
|
},
|
|
2381
|
-
[
|
|
2381
|
+
[chunkKLTUXSNI_cjs.additionalContext]: {
|
|
2382
2382
|
value: clientCtx
|
|
2383
2383
|
},
|
|
2384
2384
|
fetchMetadata: {
|
|
@@ -2387,9 +2387,9 @@ function createClientFromContext(clientCtx) {
|
|
|
2387
2387
|
});
|
|
2388
2388
|
return client;
|
|
2389
2389
|
}
|
|
2390
|
-
var createClient = createClientInternal.bind(void 0,
|
|
2391
|
-
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(
|
|
2392
|
-
var createClientWithScenario = (scenarioRid, ...args) => createClientInternal(
|
|
2390
|
+
var createClient = createClientInternal.bind(void 0, chunkKLTUXSNI_cjs.createObjectSet, void 0, void 0, void 0);
|
|
2391
|
+
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(chunkKLTUXSNI_cjs.createObjectSet, transactionRid, flushEdits, void 0, ...args);
|
|
2392
|
+
var createClientWithScenario = (scenarioRid, ...args) => createClientInternal(chunkKLTUXSNI_cjs.createObjectSet, void 0, void 0, scenarioRid, ...args);
|
|
2393
2393
|
function createWithRid(rids) {
|
|
2394
2394
|
const withRid = {
|
|
2395
2395
|
type: "static",
|
|
@@ -2411,5 +2411,5 @@ exports.createClient = createClient;
|
|
|
2411
2411
|
exports.createClientFromContext = createClientFromContext;
|
|
2412
2412
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
2413
2413
|
exports.createOsdkObject = createOsdkObject;
|
|
2414
|
-
//# sourceMappingURL=chunk-
|
|
2415
|
-
//# sourceMappingURL=chunk-
|
|
2414
|
+
//# sourceMappingURL=chunk-DZARYB4B.cjs.map
|
|
2415
|
+
//# sourceMappingURL=chunk-DZARYB4B.cjs.map
|