@osdk/client 2.42.0 → 2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e
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 +12 -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/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{applyStreamingQuery-E6GDJE2U.cjs → applyStreamingQuery-4FOMQPEE.cjs} +9 -9
- package/build/cjs/{applyStreamingQuery-E6GDJE2U.cjs.map → applyStreamingQuery-4FOMQPEE.cjs.map} +1 -1
- package/build/cjs/{chunk-SWA7ABCI.cjs → chunk-4CQYZ55E.cjs} +47 -47
- package/build/cjs/chunk-4CQYZ55E.cjs.map +1 -0
- package/build/cjs/{chunk-NSP6LLJE.cjs → chunk-IKIGSV7U.cjs} +2 -2
- package/build/cjs/{chunk-NSP6LLJE.cjs.map → chunk-IKIGSV7U.cjs.map} +1 -1
- package/build/cjs/{chunk-FEWD6O2A.cjs → chunk-JZFXK54W.cjs} +80 -80
- package/build/cjs/{chunk-FEWD6O2A.cjs.map → chunk-JZFXK54W.cjs.map} +1 -1
- package/build/cjs/{chunk-OXB3RV2R.cjs → chunk-OS7Q6R6Y.cjs} +13 -13
- package/build/cjs/{chunk-OXB3RV2R.cjs.map → chunk-OS7Q6R6Y.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 +15 -15
- 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/esm/util/UserAgent.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-SWA7ABCI.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
+
## 2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3c48f5a: Set the `name` property on custom error classes so thrown errors report their own class name
|
|
8
|
+
- Updated dependencies [3c48f5a]
|
|
9
|
+
- @osdk/shared.net.errors@2.11.1-main-12e5e63aaee98d704e38748853b40679e847249e
|
|
10
|
+
- @osdk/shared.net.fetch@1.11.1-main-12e5e63aaee98d704e38748853b40679e847249e
|
|
11
|
+
- @osdk/api@2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e
|
|
12
|
+
- @osdk/client.unstable@2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e
|
|
13
|
+
- @osdk/generator-converters@2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e
|
|
14
|
+
|
|
3
15
|
## 2.42.0
|
|
4
16
|
|
|
5
17
|
### 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.42.
|
|
24
|
+
const MaxOsdkVersion = "2.42.1";
|
|
25
25
|
// END: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
26
26
|
|
|
27
27
|
const ErrorMessage = Symbol("ErrorMessage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\n\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> =\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 /**\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\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.42.
|
|
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\";\n\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> =\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 /**\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\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.42.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;;AA2BA;;AAiIA;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.42.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.42.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e"}`;
|
|
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 chunkOS7Q6R6Y_cjs = require('./chunk-OS7Q6R6Y.cjs');
|
|
4
|
+
var chunkIKIGSV7U_cjs = require('./chunk-IKIGSV7U.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(chunkIKIGSV7U_cjs.addUserAgentAndRequestContextHeaders(chunkIKIGSV7U_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 chunkOS7Q6R6Y_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 chunkOS7Q6R6Y_cjs.getRequiredDefinitions(qd.output, client);
|
|
36
36
|
const reader = response.body.getReader();
|
|
37
|
-
for await (const line of
|
|
37
|
+
for await (const line of chunkOS7Q6R6Y_cjs.parseNdjsonStream(chunkOS7Q6R6Y_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 chunkOS7Q6R6Y_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-4FOMQPEE.cjs.map
|
|
56
|
+
//# sourceMappingURL=applyStreamingQuery-4FOMQPEE.cjs.map
|
package/build/cjs/{applyStreamingQuery-E6GDJE2U.cjs.map → applyStreamingQuery-4FOMQPEE.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-E6GDJE2U.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-4FOMQPEE.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 chunkIBY4PG26_cjs = require('./chunk-IBY4PG26.cjs');
|
|
5
5
|
var chunkPIWGMK3H_cjs = require('./chunk-PIWGMK3H.cjs');
|
|
6
6
|
var chunkCEBSLQQC_cjs = require('./chunk-CEBSLQQC.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var chunkOS7Q6R6Y_cjs = require('./chunk-OS7Q6R6Y.cjs');
|
|
8
|
+
var chunkIKIGSV7U_cjs = require('./chunk-IKIGSV7U.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');
|
|
@@ -131,7 +131,7 @@ function isScenarioClient(value) {
|
|
|
131
131
|
return value != null && (typeof value === "object" || typeof value === "function") && typeof value.getScenarioReference === "function";
|
|
132
132
|
}
|
|
133
133
|
function buildScenarioClient(parent, scenarioRid) {
|
|
134
|
-
const ctx = parent[
|
|
134
|
+
const ctx = parent[chunkIKIGSV7U_cjs.additionalContext];
|
|
135
135
|
if (ctx.transactionId != null) {
|
|
136
136
|
console.warn("withScenario / createScenario: the supplied client has an active transaction. Ignoring the transaction and scoping to the scenario instead.");
|
|
137
137
|
}
|
|
@@ -142,7 +142,7 @@ function buildScenarioClient(parent, scenarioRid) {
|
|
|
142
142
|
logger: ctx.logger,
|
|
143
143
|
UNSTABLE_DO_NOT_USE_BRANCH: ctx.branch
|
|
144
144
|
}, ctx.fetch);
|
|
145
|
-
const innerCtx = inner[
|
|
145
|
+
const innerCtx = inner[chunkIKIGSV7U_cjs.additionalContext];
|
|
146
146
|
async function getEditedEntityTypes() {
|
|
147
147
|
const ontologyRid = await innerCtx.ontologyRid;
|
|
148
148
|
const response = await OntologyScenario_exports.listScenarioEditedEntityTypes(innerCtx, ontologyRid, scenarioRid, {
|
|
@@ -284,7 +284,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
284
284
|
}
|
|
285
285
|
if (Array.isArray(value) || value instanceof Set) {
|
|
286
286
|
const values = Array.from(value);
|
|
287
|
-
if (values.some((dataValue) =>
|
|
287
|
+
if (values.some((dataValue) => chunkOS7Q6R6Y_cjs.isAttachmentUpload(dataValue) || chunkOS7Q6R6Y_cjs.isAttachmentFile(dataValue))) {
|
|
288
288
|
const converted = [];
|
|
289
289
|
for (const value2 of values) {
|
|
290
290
|
converted.push(await toDataValue(value2, client));
|
|
@@ -294,44 +294,44 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
294
294
|
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));
|
|
295
295
|
return Promise.all(promiseArray);
|
|
296
296
|
}
|
|
297
|
-
if (
|
|
298
|
-
const attachment = await
|
|
297
|
+
if (chunkOS7Q6R6Y_cjs.isAttachmentUpload(value)) {
|
|
298
|
+
const attachment = await chunkIKIGSV7U_cjs.upload(client, value.data, {
|
|
299
299
|
filename: value.name
|
|
300
300
|
});
|
|
301
301
|
return await toDataValue(attachment.rid, client);
|
|
302
302
|
}
|
|
303
|
-
if (
|
|
304
|
-
const attachment = await
|
|
303
|
+
if (chunkOS7Q6R6Y_cjs.isAttachmentFile(value)) {
|
|
304
|
+
const attachment = await chunkIKIGSV7U_cjs.upload(client, value, {
|
|
305
305
|
filename: value.name
|
|
306
306
|
});
|
|
307
307
|
return await toDataValue(attachment.rid, client);
|
|
308
308
|
}
|
|
309
|
-
if (
|
|
309
|
+
if (chunkOS7Q6R6Y_cjs.isMediaUpload(value)) {
|
|
310
310
|
const mediaRef = await chunkROJIXXGF_cjs.MediaSet_exports.uploadMedia(client, value.data, {
|
|
311
311
|
filename: value.fileName,
|
|
312
312
|
preview: true
|
|
313
313
|
});
|
|
314
314
|
return await toDataValue(mediaRef, client);
|
|
315
315
|
}
|
|
316
|
-
if (
|
|
316
|
+
if (chunkOS7Q6R6Y_cjs.isMedia(value)) {
|
|
317
317
|
return value.getMediaReference();
|
|
318
318
|
}
|
|
319
|
-
if (
|
|
319
|
+
if (chunkOS7Q6R6Y_cjs.isMediaReference(value)) {
|
|
320
320
|
return value;
|
|
321
321
|
}
|
|
322
322
|
if (isOntologyObjectV2(value)) {
|
|
323
323
|
return await toDataValue(value.__primaryKey, client);
|
|
324
324
|
}
|
|
325
|
-
if (
|
|
325
|
+
if (chunkOS7Q6R6Y_cjs.isObjectSpecifiersObject(value)) {
|
|
326
326
|
return await toDataValue(value.$primaryKey, client);
|
|
327
327
|
}
|
|
328
|
-
if (
|
|
328
|
+
if (chunkIKIGSV7U_cjs.isWireObjectSet(value)) {
|
|
329
329
|
return value;
|
|
330
330
|
}
|
|
331
|
-
if (
|
|
332
|
-
return
|
|
331
|
+
if (chunkIKIGSV7U_cjs.isObjectSet(value)) {
|
|
332
|
+
return chunkIKIGSV7U_cjs.getWireObjectSet(value);
|
|
333
333
|
}
|
|
334
|
-
if (
|
|
334
|
+
if (chunkOS7Q6R6Y_cjs.isInterfaceActionParam(value)) {
|
|
335
335
|
return {
|
|
336
336
|
objectTypeApiName: value.$objectType,
|
|
337
337
|
primaryKeyValue: value.$primaryKey
|
|
@@ -352,7 +352,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
352
352
|
|
|
353
353
|
// src/actions/applyAction.ts
|
|
354
354
|
async function applyAction(client, action, parameters, options = {}) {
|
|
355
|
-
const clientWithHeaders =
|
|
355
|
+
const clientWithHeaders = chunkIKIGSV7U_cjs.addUserAgentAndRequestContextHeaders(chunkIKIGSV7U_cjs.augmentRequestContext(client, (_) => ({
|
|
356
356
|
finalMethodCall: "applyAction"
|
|
357
357
|
})), action);
|
|
358
358
|
if (Array.isArray(parameters)) {
|
|
@@ -504,7 +504,7 @@ function getTimeRange(body) {
|
|
|
504
504
|
}
|
|
505
505
|
async function* asyncIterPointsHelper(iterator) {
|
|
506
506
|
const reader = iterator.body?.getReader();
|
|
507
|
-
for await (const point of
|
|
507
|
+
for await (const point of chunkOS7Q6R6Y_cjs.parseStreamedResponse(chunkOS7Q6R6Y_cjs.iterateReadableStream(reader))) {
|
|
508
508
|
yield {
|
|
509
509
|
time: point.time,
|
|
510
510
|
value: point.value
|
|
@@ -600,7 +600,7 @@ var MediaReferencePropertyImpl = class {
|
|
|
600
600
|
ReadToken: token
|
|
601
601
|
} : void 0);
|
|
602
602
|
return {
|
|
603
|
-
itemMetadata:
|
|
603
|
+
itemMetadata: chunkIKIGSV7U_cjs.validateMediaItemMetadata(raw)
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
606
|
getMediaReference() {
|
|
@@ -1028,8 +1028,8 @@ function get$link(holder) {
|
|
|
1028
1028
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
1029
1029
|
}).pivotTo(linkName);
|
|
1030
1030
|
const value = !linkDef.multiplicity ? {
|
|
1031
|
-
fetchOne: (options) =>
|
|
1032
|
-
fetchOneWithErrors: (options) =>
|
|
1031
|
+
fetchOne: (options) => chunkIKIGSV7U_cjs.fetchSingle(client, objDef, options ?? {}, chunkIKIGSV7U_cjs.getWireObjectSet(objectSet)),
|
|
1032
|
+
fetchOneWithErrors: (options) => chunkIKIGSV7U_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkIKIGSV7U_cjs.getWireObjectSet(objectSet))
|
|
1033
1033
|
} : objectSet;
|
|
1034
1034
|
return [linkName, value];
|
|
1035
1035
|
})));
|
|
@@ -1052,8 +1052,8 @@ function get$linkForInterface(holder) {
|
|
|
1052
1052
|
apiName: linkDef.targetTypeApiName
|
|
1053
1053
|
};
|
|
1054
1054
|
const value = !linkDef.multiplicity ? {
|
|
1055
|
-
fetchOne: (options) =>
|
|
1056
|
-
fetchOneWithErrors: (options) =>
|
|
1055
|
+
fetchOne: (options) => chunkIKIGSV7U_cjs.fetchSingle(client, linkTargetDef, options ?? {}, chunkIKIGSV7U_cjs.getWireObjectSet(objectSet)),
|
|
1056
|
+
fetchOneWithErrors: (options) => chunkIKIGSV7U_cjs.fetchSingleWithErrors(client, linkTargetDef, options ?? {}, chunkIKIGSV7U_cjs.getWireObjectSet(objectSet))
|
|
1057
1057
|
} : objectSet;
|
|
1058
1058
|
return [linkName, value];
|
|
1059
1059
|
})));
|
|
@@ -1081,7 +1081,7 @@ function extractValueByImplementation(underlying, impl) {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
1083
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
1084
|
-
const [objApiNamespace] =
|
|
1084
|
+
const [objApiNamespace] = chunkIKIGSV7U_cjs.extractNamespace(interfaceDef.apiName);
|
|
1085
1085
|
const objDef = underlying[ObjectDefRef];
|
|
1086
1086
|
return Object.freeze(Object.defineProperties({}, {
|
|
1087
1087
|
// first to minimize hidden classes
|
|
@@ -1144,7 +1144,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
1144
1144
|
value: interfaceDef
|
|
1145
1145
|
},
|
|
1146
1146
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
1147
|
-
const [apiNamespace, apiName] =
|
|
1147
|
+
const [apiNamespace, apiName] = chunkIKIGSV7U_cjs.extractNamespace(p);
|
|
1148
1148
|
const exposedName = apiNamespace === objApiNamespace ? apiName : p;
|
|
1149
1149
|
const impl = objDef.interfaceImplementations?.[interfaceDef.apiName]?.[p];
|
|
1150
1150
|
if (impl != null) {
|
|
@@ -1193,7 +1193,7 @@ function remapPropertySecuritiesForInterface(underlyingSecurities, objDef, inter
|
|
|
1193
1193
|
}
|
|
1194
1194
|
const interfacePropName = inverseMap[objPropName];
|
|
1195
1195
|
if (interfacePropName == null) continue;
|
|
1196
|
-
const [apiNamespace, apiName] =
|
|
1196
|
+
const [apiNamespace, apiName] = chunkIKIGSV7U_cjs.extractNamespace(interfacePropName);
|
|
1197
1197
|
const key = apiNamespace === objApiNamespace ? apiName : interfacePropName;
|
|
1198
1198
|
remapped[key] = underlyingSecurities[objPropName];
|
|
1199
1199
|
}
|
|
@@ -1286,7 +1286,7 @@ var basePropDefs = {
|
|
|
1286
1286
|
$objectSpecifier: {
|
|
1287
1287
|
get() {
|
|
1288
1288
|
const rawObj = this[UnderlyingOsdkObject];
|
|
1289
|
-
return
|
|
1289
|
+
return chunkOS7Q6R6Y_cjs.createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);
|
|
1290
1290
|
},
|
|
1291
1291
|
enumerable: true
|
|
1292
1292
|
},
|
|
@@ -1358,9 +1358,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1358
1358
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1359
1359
|
case "attachment":
|
|
1360
1360
|
if (Array.isArray(rawValue)) {
|
|
1361
|
-
return rawValue.map((a) =>
|
|
1361
|
+
return rawValue.map((a) => chunkIKIGSV7U_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1362
1362
|
} else {
|
|
1363
|
-
return
|
|
1363
|
+
return chunkIKIGSV7U_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1364
1364
|
}
|
|
1365
1365
|
default:
|
|
1366
1366
|
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant3__default.default(false) ;
|
|
@@ -1376,9 +1376,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1376
1376
|
}
|
|
1377
1377
|
if (propDef.type === "attachment") {
|
|
1378
1378
|
if (Array.isArray(rawValue)) {
|
|
1379
|
-
return rawValue.map((a) =>
|
|
1379
|
+
return rawValue.map((a) => chunkIKIGSV7U_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1380
1380
|
}
|
|
1381
|
-
return
|
|
1381
|
+
return chunkIKIGSV7U_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1382
1382
|
}
|
|
1383
1383
|
if (propDef.type === "cipherText") {
|
|
1384
1384
|
return new CipherTextPropertyImpl({
|
|
@@ -1729,11 +1729,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1729
1729
|
};
|
|
1730
1730
|
|
|
1731
1731
|
// src/util/UserAgent.ts
|
|
1732
|
-
var USER_AGENT = `osdk-client/${"2.42.
|
|
1733
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.42.
|
|
1732
|
+
var USER_AGENT = `osdk-client/${"2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e"}`;
|
|
1733
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.42.1-main-12e5e63aaee98d704e38748853b40679e847249e"}`;
|
|
1734
1734
|
|
|
1735
1735
|
// src/createMinimalClient.ts
|
|
1736
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1736
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkIKIGSV7U_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1737
1737
|
if (process.env.NODE_ENV !== "production") {
|
|
1738
1738
|
try {
|
|
1739
1739
|
new URL(baseUrl);
|
|
@@ -2328,7 +2328,7 @@ var ActionInvoker = class {
|
|
|
2328
2328
|
};
|
|
2329
2329
|
var QueryInvoker = class {
|
|
2330
2330
|
constructor(clientCtx, queryDef) {
|
|
2331
|
-
this.executeFunction =
|
|
2331
|
+
this.executeFunction = chunkOS7Q6R6Y_cjs.applyQuery.bind(void 0, clientCtx, queryDef);
|
|
2332
2332
|
}
|
|
2333
2333
|
};
|
|
2334
2334
|
function createClientInternal(objectSetFactory, transactionRid, flushEdits, scenarioRid, subscribeFn, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
@@ -2371,7 +2371,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2371
2371
|
async *executeStreamingFunction(query, params) {
|
|
2372
2372
|
const {
|
|
2373
2373
|
applyStreamingQuery
|
|
2374
|
-
} = await import('./applyStreamingQuery-
|
|
2374
|
+
} = await import('./applyStreamingQuery-4FOMQPEE.cjs');
|
|
2375
2375
|
yield* applyStreamingQuery(clientCtx, query, params);
|
|
2376
2376
|
}
|
|
2377
2377
|
};
|
|
@@ -2387,7 +2387,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2387
2387
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
2388
2388
|
return {
|
|
2389
2389
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
2390
|
-
return await
|
|
2390
|
+
return await chunkIKIGSV7U_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
2391
2391
|
}
|
|
2392
2392
|
};
|
|
2393
2393
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -2411,10 +2411,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2411
2411
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
2412
2412
|
return {
|
|
2413
2413
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
2414
|
-
return await
|
|
2414
|
+
return await chunkIKIGSV7U_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
2415
2415
|
},
|
|
2416
2416
|
fetchPageByRidNoType: async (rids, options) => {
|
|
2417
|
-
return await
|
|
2417
|
+
return await chunkIKIGSV7U_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
2418
2418
|
}
|
|
2419
2419
|
};
|
|
2420
2420
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__subscribeToNoTypeObjectSet.name:
|
|
@@ -2458,7 +2458,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2458
2458
|
[symbolClientContext2]: {
|
|
2459
2459
|
value: clientCtx
|
|
2460
2460
|
},
|
|
2461
|
-
[
|
|
2461
|
+
[chunkIKIGSV7U_cjs.additionalContext]: {
|
|
2462
2462
|
value: clientCtx
|
|
2463
2463
|
},
|
|
2464
2464
|
fetchMetadata: {
|
|
@@ -2467,10 +2467,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2467
2467
|
});
|
|
2468
2468
|
return client;
|
|
2469
2469
|
}
|
|
2470
|
-
var createClient = createClientInternal.bind(void 0,
|
|
2471
|
-
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(
|
|
2472
|
-
var createClientWithSubscribe = (subscribeFn, ...args) => createClientInternal(
|
|
2473
|
-
var createClientWithScenario = (scenarioRid, ...args) => createClientInternal(
|
|
2470
|
+
var createClient = createClientInternal.bind(void 0, chunkIKIGSV7U_cjs.createObjectSet, void 0, void 0, void 0, void 0);
|
|
2471
|
+
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(chunkIKIGSV7U_cjs.createObjectSet, transactionRid, flushEdits, void 0, void 0, ...args);
|
|
2472
|
+
var createClientWithSubscribe = (subscribeFn, ...args) => createClientInternal(chunkIKIGSV7U_cjs.createObjectSet, void 0, void 0, void 0, subscribeFn, ...args);
|
|
2473
|
+
var createClientWithScenario = (scenarioRid, ...args) => createClientInternal(chunkIKIGSV7U_cjs.createObjectSet, void 0, void 0, scenarioRid, void 0, ...args);
|
|
2474
2474
|
function createWithRid(rids) {
|
|
2475
2475
|
const withRid = {
|
|
2476
2476
|
type: "static",
|
|
@@ -2493,5 +2493,5 @@ exports.createClientFromContext = createClientFromContext;
|
|
|
2493
2493
|
exports.createClientWithSubscribe = createClientWithSubscribe;
|
|
2494
2494
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
2495
2495
|
exports.createOsdkObject = createOsdkObject;
|
|
2496
|
-
//# sourceMappingURL=chunk-
|
|
2497
|
-
//# sourceMappingURL=chunk-
|
|
2496
|
+
//# sourceMappingURL=chunk-4CQYZ55E.cjs.map
|
|
2497
|
+
//# sourceMappingURL=chunk-4CQYZ55E.cjs.map
|