@osdk/client 2.33.0 → 2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc
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 +8 -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-56Q3H7FK.cjs → applyStreamingQuery-FASICU3E.cjs} +9 -9
- package/build/cjs/{applyStreamingQuery-56Q3H7FK.cjs.map → applyStreamingQuery-FASICU3E.cjs.map} +1 -1
- package/build/cjs/{chunk-JT74HWVB.cjs → chunk-3TZJ2ERU.cjs} +45 -45
- package/build/cjs/chunk-3TZJ2ERU.cjs.map +1 -0
- package/build/cjs/{chunk-RSJT5VQV.cjs → chunk-GOGNJDBM.cjs} +2 -2
- package/build/cjs/{chunk-RSJT5VQV.cjs.map → chunk-GOGNJDBM.cjs.map} +1 -1
- package/build/cjs/{chunk-NCNIJULJ.cjs → chunk-PMS2ZICE.cjs} +76 -76
- package/build/cjs/{chunk-NCNIJULJ.cjs.map → chunk-PMS2ZICE.cjs.map} +1 -1
- package/build/cjs/{chunk-5BI4JUX6.cjs → chunk-WG2EE5DH.cjs} +13 -13
- package/build/cjs/{chunk-5BI4JUX6.cjs.map → chunk-WG2EE5DH.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/esm/util/UserAgent.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/package.json +6 -6
- package/build/cjs/chunk-JT74HWVB.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
+
## 2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @osdk/api@2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc
|
|
8
|
+
- @osdk/client.unstable@2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc
|
|
9
|
+
- @osdk/generator-converters@2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc
|
|
10
|
+
|
|
3
11
|
## 2.33.0
|
|
4
12
|
|
|
5
13
|
### Patch 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.33.
|
|
24
|
+
const MaxOsdkVersion = "2.33.1";
|
|
25
25
|
// END: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
26
26
|
|
|
27
27
|
const ErrorMessage = Symbol("ErrorMessage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n /**\n * Returns the operation surface for the given ontology definition. The shape of the\n * returned value is dispatched on what kind of definition is passed:\n * - object type → the object set type for that ontology object (typically a generated extension of {@link ObjectSet})\n * - interface → a {@link MinimalObjectSet} for the interface\n * - action → a callable with `applyAction` / `batchApplyAction`\n * - query → a callable with `executeFunction`\n * - experiment → the unstable feature surface for that experiment\n *\n * @param o - The object type definition to wrap.\n * @example\n * ```ts\n * const employees = await client(Employee).fetchPage({ $pageSize: 30 });\n * const employee = await client(Employee).fetchOne(12345);\n * ```\n * @returns an object set scoped to all objects of this type.\n */\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n /**\n * @param o - The interface definition to wrap.\n * @example\n * ```ts\n * const page = await client(MyInterface).fetchPage({ $pageSize: 30 });\n * ```\n * @returns a minimal object set over all objects implementing the interface.\n */\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n /**\n * @param o - The action definition to invoke.\n * @example\n * ```ts\n * const result = await client(createEmployee).applyAction(\n * { name: \"Jane\", department: \"Engineering\" },\n * { $returnEdits: true },\n * );\n * ```\n * @returns a callable for applying (or batch-applying) the action.\n */\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n /**\n * @param o - The query definition to invoke.\n * @example\n * ```ts\n * const result = await client(getEmployeeCount).executeFunction({ department: \"Engineering\" });\n * ```\n * @returns a callable for executing the query function.\n */\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n /**\n * @param experiment - The experiment marker that gates an unstable feature.\n * @example\n * ```ts\n * const ref = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference)\n * .createMediaReference({ data: blob, fileName: \"media.mp4\", objectType: Employee, propertyType: \"photo\" });\n * ```\n * @returns the experiment-specific function surface.\n */\n <\n Q extends\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">\n | Experiment<\"2.2.0\">\n | Experiment<\"2.8.0\">\n | Experiment<\"2.19.0\">,\n >(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n /**\n * Fetches runtime metadata for the given ontology definition. The returned shape\n * is dispatched on the kind of definition passed: {@link ObjectMetadata},\n * {@link InterfaceMetadata}, {@link ActionMetadata}, or {@link QueryMetadata}.\n * @param o - The object type, interface, action, or query definition to look up.\n * @example\n * ```ts\n * const meta = await client.fetchMetadata(Employee);\n * console.log(meta.displayName, meta.description);\n * ```\n * @returns a promise resolving to the metadata for the given definition.\n */\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.33.
|
|
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.33.1\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;;AA8HA;AACA;AACA,OAAO,MAAMA,iBAAgC,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAE3E;AACA,MAAMC,cAAc,GAAG,QAAQ;AAC/B;;AAEA,MAAMC,YAA2B,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.33.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.33.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,uEAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,kFAAuD","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkWG2EE5DH_cjs = require('./chunk-WG2EE5DH.cjs');
|
|
4
|
+
var chunkGOGNJDBM_cjs = require('./chunk-GOGNJDBM.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(chunkGOGNJDBM_cjs.addUserAgentAndRequestContextHeaders(chunkGOGNJDBM_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 chunkWG2EE5DH_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 chunkWG2EE5DH_cjs.getRequiredDefinitions(qd.output, client);
|
|
36
36
|
const reader = response.body.getReader();
|
|
37
|
-
for await (const line of
|
|
37
|
+
for await (const line of chunkWG2EE5DH_cjs.parseNdjsonStream(chunkWG2EE5DH_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 chunkWG2EE5DH_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-FASICU3E.cjs.map
|
|
56
|
+
//# sourceMappingURL=applyStreamingQuery-FASICU3E.cjs.map
|
package/build/cjs/{applyStreamingQuery-56Q3H7FK.cjs.map → applyStreamingQuery-FASICU3E.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-56Q3H7FK.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-FASICU3E.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 chunkWG2EE5DH_cjs = require('./chunk-WG2EE5DH.cjs');
|
|
8
|
+
var chunkGOGNJDBM_cjs = require('./chunk-GOGNJDBM.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[chunkGOGNJDBM_cjs.additionalContext];
|
|
128
128
|
if (ctx.transactionId != null) {
|
|
129
129
|
throw new Error("withScenario / createScenario: the supplied client already has an active transaction. Scenarios cannot be nested on transactions.");
|
|
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[chunkGOGNJDBM_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) => chunkWG2EE5DH_cjs.isAttachmentUpload(dataValue) || chunkWG2EE5DH_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 (chunkWG2EE5DH_cjs.isAttachmentUpload(value)) {
|
|
291
|
+
const attachment = await chunkGOGNJDBM_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 (chunkWG2EE5DH_cjs.isAttachmentFile(value)) {
|
|
297
|
+
const attachment = await chunkGOGNJDBM_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 (chunkWG2EE5DH_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 (chunkWG2EE5DH_cjs.isMedia(value)) {
|
|
310
310
|
return value.getMediaReference();
|
|
311
311
|
}
|
|
312
|
-
if (
|
|
312
|
+
if (chunkWG2EE5DH_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 (chunkWG2EE5DH_cjs.isObjectSpecifiersObject(value)) {
|
|
319
319
|
return await toDataValue(value.$primaryKey, client);
|
|
320
320
|
}
|
|
321
|
-
if (
|
|
321
|
+
if (chunkGOGNJDBM_cjs.isWireObjectSet(value)) {
|
|
322
322
|
return value;
|
|
323
323
|
}
|
|
324
|
-
if (
|
|
325
|
-
return
|
|
324
|
+
if (chunkGOGNJDBM_cjs.isObjectSet(value)) {
|
|
325
|
+
return chunkGOGNJDBM_cjs.getWireObjectSet(value);
|
|
326
326
|
}
|
|
327
|
-
if (
|
|
327
|
+
if (chunkWG2EE5DH_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 = chunkGOGNJDBM_cjs.addUserAgentAndRequestContextHeaders(chunkGOGNJDBM_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 chunkWG2EE5DH_cjs.parseStreamedResponse(chunkWG2EE5DH_cjs.iterateReadableStream(reader))) {
|
|
481
481
|
yield {
|
|
482
482
|
time: point.time,
|
|
483
483
|
value: point.value
|
|
@@ -981,8 +981,8 @@ function get$link(holder) {
|
|
|
981
981
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
982
982
|
}).pivotTo(linkName);
|
|
983
983
|
const value = !linkDef.multiplicity ? {
|
|
984
|
-
fetchOne: (options) =>
|
|
985
|
-
fetchOneWithErrors: (options) =>
|
|
984
|
+
fetchOne: (options) => chunkGOGNJDBM_cjs.fetchSingle(client, objDef, options ?? {}, chunkGOGNJDBM_cjs.getWireObjectSet(objectSet)),
|
|
985
|
+
fetchOneWithErrors: (options) => chunkGOGNJDBM_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkGOGNJDBM_cjs.getWireObjectSet(objectSet))
|
|
986
986
|
} : objectSet;
|
|
987
987
|
return [linkName, value];
|
|
988
988
|
})));
|
|
@@ -1005,8 +1005,8 @@ function get$linkForInterface(holder) {
|
|
|
1005
1005
|
apiName: linkDef.targetTypeApiName
|
|
1006
1006
|
};
|
|
1007
1007
|
const value = !linkDef.multiplicity ? {
|
|
1008
|
-
fetchOne: (options) =>
|
|
1009
|
-
fetchOneWithErrors: (options) =>
|
|
1008
|
+
fetchOne: (options) => chunkGOGNJDBM_cjs.fetchSingle(client, linkTargetDef, options ?? {}, chunkGOGNJDBM_cjs.getWireObjectSet(objectSet)),
|
|
1009
|
+
fetchOneWithErrors: (options) => chunkGOGNJDBM_cjs.fetchSingleWithErrors(client, linkTargetDef, options ?? {}, chunkGOGNJDBM_cjs.getWireObjectSet(objectSet))
|
|
1010
1010
|
} : objectSet;
|
|
1011
1011
|
return [linkName, value];
|
|
1012
1012
|
})));
|
|
@@ -1014,7 +1014,7 @@ function get$linkForInterface(holder) {
|
|
|
1014
1014
|
|
|
1015
1015
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
1016
1016
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
1017
|
-
const [objApiNamespace] =
|
|
1017
|
+
const [objApiNamespace] = chunkGOGNJDBM_cjs.extractNamespace(interfaceDef.apiName);
|
|
1018
1018
|
return Object.freeze(Object.defineProperties({}, {
|
|
1019
1019
|
// first to minimize hidden classes
|
|
1020
1020
|
[UnderlyingOsdkObject]: {
|
|
@@ -1077,7 +1077,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
1077
1077
|
},
|
|
1078
1078
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
1079
1079
|
const objDef = underlying[ObjectDefRef];
|
|
1080
|
-
const [apiNamespace, apiName] =
|
|
1080
|
+
const [apiNamespace, apiName] = chunkGOGNJDBM_cjs.extractNamespace(p);
|
|
1081
1081
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
1082
1082
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
1083
1083
|
enumerable: targetPropName in underlying,
|
|
@@ -1117,7 +1117,7 @@ function remapPropertySecuritiesForInterface(underlyingSecurities, objDef, inter
|
|
|
1117
1117
|
}
|
|
1118
1118
|
const interfacePropName = inverseMap[objPropName];
|
|
1119
1119
|
if (interfacePropName == null) continue;
|
|
1120
|
-
const [apiNamespace, apiName] =
|
|
1120
|
+
const [apiNamespace, apiName] = chunkGOGNJDBM_cjs.extractNamespace(interfacePropName);
|
|
1121
1121
|
const key = apiNamespace === objApiNamespace ? apiName : interfacePropName;
|
|
1122
1122
|
remapped[key] = underlyingSecurities[objPropName];
|
|
1123
1123
|
}
|
|
@@ -1198,7 +1198,7 @@ var basePropDefs = {
|
|
|
1198
1198
|
"$objectSpecifier": {
|
|
1199
1199
|
get() {
|
|
1200
1200
|
const rawObj = this[UnderlyingOsdkObject];
|
|
1201
|
-
return
|
|
1201
|
+
return chunkWG2EE5DH_cjs.createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);
|
|
1202
1202
|
},
|
|
1203
1203
|
enumerable: true
|
|
1204
1204
|
},
|
|
@@ -1270,9 +1270,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1270
1270
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1271
1271
|
case "attachment":
|
|
1272
1272
|
if (Array.isArray(rawValue)) {
|
|
1273
|
-
return rawValue.map((a) =>
|
|
1273
|
+
return rawValue.map((a) => chunkGOGNJDBM_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1274
1274
|
} else {
|
|
1275
|
-
return
|
|
1275
|
+
return chunkGOGNJDBM_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1276
1276
|
}
|
|
1277
1277
|
default:
|
|
1278
1278
|
process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant2__default.default(false) ;
|
|
@@ -1288,9 +1288,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
if (propDef.type === "attachment") {
|
|
1290
1290
|
if (Array.isArray(rawValue)) {
|
|
1291
|
-
return rawValue.map((a) =>
|
|
1291
|
+
return rawValue.map((a) => chunkGOGNJDBM_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1292
1292
|
}
|
|
1293
|
-
return
|
|
1293
|
+
return chunkGOGNJDBM_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1294
1294
|
}
|
|
1295
1295
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1296
1296
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1633,11 +1633,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1633
1633
|
};
|
|
1634
1634
|
|
|
1635
1635
|
// src/util/UserAgent.ts
|
|
1636
|
-
var USER_AGENT = `osdk-client/${"2.33.
|
|
1637
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.33.
|
|
1636
|
+
var USER_AGENT = `osdk-client/${"2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc"}`;
|
|
1637
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.33.1-main-48eb46e4d50fccb8b47eccf94fd7b58514fdd7bc"}`;
|
|
1638
1638
|
|
|
1639
1639
|
// src/createMinimalClient.ts
|
|
1640
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1640
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkGOGNJDBM_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1641
1641
|
if (process.env.NODE_ENV !== "production") {
|
|
1642
1642
|
try {
|
|
1643
1643
|
new URL(baseUrl);
|
|
@@ -2229,7 +2229,7 @@ var ActionInvoker = class {
|
|
|
2229
2229
|
};
|
|
2230
2230
|
var QueryInvoker = class {
|
|
2231
2231
|
constructor(clientCtx, queryDef) {
|
|
2232
|
-
this.executeFunction =
|
|
2232
|
+
this.executeFunction = chunkWG2EE5DH_cjs.applyQuery.bind(void 0, clientCtx, queryDef);
|
|
2233
2233
|
}
|
|
2234
2234
|
};
|
|
2235
2235
|
function createClientInternal(objectSetFactory, transactionRid, flushEdits, scenarioRid, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
@@ -2271,7 +2271,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2271
2271
|
async *executeStreamingFunction(query, params) {
|
|
2272
2272
|
const {
|
|
2273
2273
|
applyStreamingQuery
|
|
2274
|
-
} = await import('./applyStreamingQuery-
|
|
2274
|
+
} = await import('./applyStreamingQuery-FASICU3E.cjs');
|
|
2275
2275
|
yield* applyStreamingQuery(clientCtx, query, params);
|
|
2276
2276
|
}
|
|
2277
2277
|
};
|
|
@@ -2287,7 +2287,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2287
2287
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
2288
2288
|
return {
|
|
2289
2289
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
2290
|
-
return await
|
|
2290
|
+
return await chunkGOGNJDBM_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
2291
2291
|
}
|
|
2292
2292
|
};
|
|
2293
2293
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -2311,10 +2311,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2311
2311
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
2312
2312
|
return {
|
|
2313
2313
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
2314
|
-
return await
|
|
2314
|
+
return await chunkGOGNJDBM_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
2315
2315
|
},
|
|
2316
2316
|
fetchPageByRidNoType: async (rids, options) => {
|
|
2317
|
-
return await
|
|
2317
|
+
return await chunkGOGNJDBM_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
2318
2318
|
}
|
|
2319
2319
|
};
|
|
2320
2320
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__subscribeToNoTypeObjectSet.name:
|
|
@@ -2358,7 +2358,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2358
2358
|
[symbolClientContext2]: {
|
|
2359
2359
|
value: clientCtx
|
|
2360
2360
|
},
|
|
2361
|
-
[
|
|
2361
|
+
[chunkGOGNJDBM_cjs.additionalContext]: {
|
|
2362
2362
|
value: clientCtx
|
|
2363
2363
|
},
|
|
2364
2364
|
fetchMetadata: {
|
|
@@ -2367,9 +2367,9 @@ function createClientFromContext(clientCtx) {
|
|
|
2367
2367
|
});
|
|
2368
2368
|
return client;
|
|
2369
2369
|
}
|
|
2370
|
-
var createClient = createClientInternal.bind(void 0,
|
|
2371
|
-
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(
|
|
2372
|
-
var createClientWithScenario = (scenarioRid, ...args) => createClientInternal(
|
|
2370
|
+
var createClient = createClientInternal.bind(void 0, chunkGOGNJDBM_cjs.createObjectSet, void 0, void 0, void 0);
|
|
2371
|
+
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(chunkGOGNJDBM_cjs.createObjectSet, transactionRid, flushEdits, void 0, ...args);
|
|
2372
|
+
var createClientWithScenario = (scenarioRid, ...args) => createClientInternal(chunkGOGNJDBM_cjs.createObjectSet, void 0, void 0, scenarioRid, ...args);
|
|
2373
2373
|
function createWithRid(rids) {
|
|
2374
2374
|
const withRid = {
|
|
2375
2375
|
type: "static",
|
|
@@ -2391,5 +2391,5 @@ exports.createClient = createClient;
|
|
|
2391
2391
|
exports.createClientFromContext = createClientFromContext;
|
|
2392
2392
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
2393
2393
|
exports.createOsdkObject = createOsdkObject;
|
|
2394
|
-
//# sourceMappingURL=chunk-
|
|
2395
|
-
//# sourceMappingURL=chunk-
|
|
2394
|
+
//# sourceMappingURL=chunk-3TZJ2ERU.cjs.map
|
|
2395
|
+
//# sourceMappingURL=chunk-3TZJ2ERU.cjs.map
|