@osdk/client 2.60.0 → 2.61.0-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4
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 +14 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/internal/conversions/makeMediaTransformation.js +3 -0
- package/build/browser/internal/conversions/makeMediaTransformation.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-YUORZ6RZ.cjs → applyStreamingQuery-XVCEQR5M.cjs} +8 -8
- package/build/cjs/{applyStreamingQuery-YUORZ6RZ.cjs.map → applyStreamingQuery-XVCEQR5M.cjs.map} +1 -1
- package/build/cjs/{chunk-LGBJONZC.cjs → chunk-CVND37QU.cjs} +46 -46
- package/build/cjs/chunk-CVND37QU.cjs.map +1 -0
- package/build/cjs/{chunk-YPQD3ZXO.cjs → chunk-OF32UWWG.cjs} +2 -2
- package/build/cjs/{chunk-YPQD3ZXO.cjs.map → chunk-OF32UWWG.cjs.map} +1 -1
- package/build/cjs/{chunk-LXGY4YO4.cjs → chunk-RFOMMOGJ.cjs} +80 -80
- package/build/cjs/{chunk-LXGY4YO4.cjs.map → chunk-RFOMMOGJ.cjs.map} +1 -1
- package/build/cjs/{chunk-XOULFBXY.cjs → chunk-T776B5KR.cjs} +8 -8
- package/build/cjs/{chunk-XOULFBXY.cjs.map → chunk-T776B5KR.cjs.map} +1 -1
- package/build/cjs/{chunk-2FESWW7E.cjs → chunk-TLF57A6A.cjs} +13 -13
- package/build/cjs/{chunk-2FESWW7E.cjs.map → chunk-TLF57A6A.cjs.map} +1 -1
- package/build/cjs/index.cjs +11 -11
- package/build/cjs/public/experimental.cjs +9 -9
- 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 +16 -16
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/internal/conversions/makeMediaTransformation.js +3 -0
- package/build/esm/internal/conversions/makeMediaTransformation.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/internal/conversions/makeMediaTransformation.d.ts.map +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-LGBJONZC.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
+
## 2.61.0-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 34cb7e0: Type the OCR and transcription language parameters on the experimental media transformation surface as the closed enums the platform actually declares, and export the encoding types that were previously unreachable.
|
|
8
|
+
|
|
9
|
+
These four parameters were previously `string`, so this narrows a shipped public type on the `@osdk/api/unstable` entrypoint. Existing call sites holding a `string` in those positions no longer compile, and a language the pinned platform SDK does not list must be cast until the pin moves.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [34cb7e0]
|
|
12
|
+
- @osdk/api@2.61.0-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4
|
|
13
|
+
- @osdk/generator-converters@2.61.0-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4
|
|
14
|
+
- @osdk/shared.test@2.40.1-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4
|
|
15
|
+
- @osdk/client.unstable@2.61.0-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4
|
|
16
|
+
|
|
3
17
|
## 2.60.0
|
|
4
18
|
|
|
5
19
|
### 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.
|
|
24
|
+
const MaxOsdkVersion = "2.61.0";
|
|
25
25
|
// END: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
26
26
|
|
|
27
27
|
const ErrorMessage = Symbol("ErrorMessage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\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 employee = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid)\n * .fetchOneByRid(Employee, \"ri.phonograph2-objects.main.object.1234\");\n * ```\n * @returns the experiment-specific function surface.\n */\n <\n Q extends\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">\n | Experiment<\"2.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.
|
|
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 employee = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid)\n * .fetchOneByRid(Employee, \"ri.phonograph2-objects.main.object.1234\");\n * ```\n * @returns the experiment-specific function surface.\n */\n <\n Q extends\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">\n | Experiment<\"2.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.61.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;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,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
// hand-copied into `@osdk/api`, which cannot depend on `@osdk/foundry.*`. a narrower copy stays
|
|
18
|
+
// assignable to the wire type, so only an equality check catches a value the platform adds
|
|
19
|
+
|
|
17
20
|
export function makeMediaTransformation(transformation) {
|
|
18
21
|
if ("$image" in transformation && transformation.$image != null) {
|
|
19
22
|
const t = transformation.$image;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeMediaTransformation.js","names":["makeMediaTransformation","transformation","$image","t","type","encoding","$encoding","operations","$operations","map","convertImageOperation","$video","operation","convertVideoOperation","$operation","$audio","convertAudioOperation","$emailToText","convertEmailToTextOperation","$spreadsheetToText","convertSpreadsheetToTextOperation","$videoToAudio","convertAudioEncoding","convertVideoToAudioOperation","$audioToText","convertAudioToTextOperation","$emailToAttachment","convertEmailToAttachmentOperation","$videoToArchive","convertVideoToArchiveOperation","$videoToText","convertVideoToTextOperation","$imageToText","convertImageToTextOperation","$videoToImage","convertVideoToImageOperation","$imageToDocument","convertImageToDocumentOperation","$dicomToImage","convertDicomToImageOperation","$documentToDocument","convertDocumentToDocumentOperation","$documentToImage","convertDocumentToImageOperation","$imageToEmbedding","convertImageToEmbeddingOperation","convertDocumentToTextOperation","$documentToText","sampleRate","$wav","$sampleRate","audioChannelLayout","$audioChannelLayout","numberOfChannels","$numberOfChannels","undefined","convertPageRange","range","startPageInclusive","$startPageInclusive","endPageExclusive","$endPageExclusive","convertOcrOutputFormat","fmt","convertOcrLanguageOrScript","item","$language","language","script","$script","convertOcrParameters","params","outputFormat","$outputFormat","languages","$languages","convertLayoutAwareExtractionParameters","convertDocumentTextExtractionConfig","config","format","$format","mode","$mode","convertTranscribeOutputFormat","$plainTextNoSegmentData","addTimestamps","$addTimestamps","convertLlmSpec","spec","chat","modelLocator","apiName","$chat","$modelLocator","systemPrompt","$systemPrompt","userPrompt","$userPrompt","maxTokens","$maxTokens","convertVlmPreprocessingConfig","$layoutAware","layoutAware","transformationConfig","$transformationConfig","cropConfig","$cropConfig","tablePrompt","$tablePrompt","ext","$extractText","extractText","convertImageSpec","resizingMode","$resizingMode","height","$height","width","$width","mimeType","$mimeType","op","$resize","autoOrient","$autoOrient","$resizeToFitBoundingBox","$rotate","angle","$angle","$crop","xOffset","$xOffset","yOffset","$yOffset","$tile","zoom","$zoom","x","$x","y","$y","$annotate","annotations","$annotations","convertAnnotation","$contrast","contrastType","convertContrastType","$contrastType","$encrypt","polygons","$polygons","convertImageRegionPolygon","cipherLicenseRid","$cipherLicenseRid","decrypt","$decrypt","annotation","geometry","convertAnnotateGeometry","$geometry","label","$label","color","$color","convertColor","thickness","$thickness","fontSize","$fontSize","boundingBox","left","$boundingBox","$left","top","$top","r","$r","g","$g","b","$b","a","$a","$rayleigh","sigma","$sigma","binarize","$binarize","threshold","$threshold","polygon","coordinate","chunk","$chunk","chunkDurationMilliseconds","$chunkDurationMilliseconds","chunkIndex","$chunkIndex","$channel","encodeFormat","$encodeFormat","channel","convert","$convert","$transcribe","diarize","$diarize","performanceMode","$performanceMode","waveform","$waveform","peaksPerSecond","$peaksPerSecond","$getEmailBody","$getEmailAttachment","attachmentIndex","$attachmentIndex","sheetName","$convertSheetToJson","$sheetName","$extractSceneFrames","sceneScore","$sceneScore","$getTimestampsForSceneFrames","$extractLayoutAwareContent","parameters","$parameters","ocr","$ocr","$extractFirstFrame","$extractFramesAtTimestamps","timestamp","$timestamp","layerNumber","$renderImageLayer","$layerNumber","$slicePdfRange","strictlyEnforceEndPage","$strictlyEnforceEndPage","$renderPage","pageNumber","$pageNumber","bb","$renderPageToFitBoundingBox","modelId","$generateEmbedding","$modelId","$extractUnstructuredTextFromPage","$extractTextFromPagesToArray","startPage","$startPage","endPage","$endPage","$ocrOnPage","$ocrOnPages","$extractLayoutAwareTextV2","pageRange","$pageRange","$config","$extractTextV2","vlm","$extractVlmText","llmSpec","$llmSpec","preprocessingConfiguration","$preprocessingConfiguration","imageSpec","$imageSpec"],"sources":["makeMediaTransformation.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnnotateGeometry,\n Annotation,\n AudioEncoding,\n AudioOperation,\n AudioToTextOperation,\n Color,\n ContrastType,\n DicomToImageOperation,\n DocumentTextExtractionConfig,\n DocumentToDocumentOperation,\n DocumentToImageOperation,\n DocumentToTextOperation,\n EmailToAttachmentOperation,\n EmailToTextOperation,\n ImageOperation,\n ImageRegionPolygon,\n ImageSpec,\n ImageToDocumentOperation,\n ImageToEmbeddingOperation,\n ImageToTextOperation,\n LayoutAwareExtractionParameters,\n LlmSpec,\n MediaTransformation,\n OcrLanguageOrScript,\n OcrOutputFormat,\n OcrParameters,\n PageRange,\n SpreadsheetToTextOperation,\n TranscribeOutputFormat,\n VideoOperation,\n VideoToArchiveOperation,\n VideoToAudioOperation,\n VideoToImageOperation,\n VideoToTextOperation,\n VlmPreprocessingConfig,\n} from \"@osdk/api/unstable\";\nimport type { Transformation } from \"@osdk/foundry.mediasets\";\n\nexport function makeMediaTransformation(\n transformation: MediaTransformation,\n): Transformation {\n if (\"$image\" in transformation && transformation.$image != null) {\n const t = transformation.$image;\n return {\n type: \"image\" as const,\n encoding: { type: t.$encoding },\n operations: t.$operations.map(convertImageOperation),\n };\n } else if (\"$video\" in transformation && transformation.$video != null) {\n const t = transformation.$video;\n return {\n type: \"video\" as const,\n encoding: { type: t.$encoding },\n operation: convertVideoOperation(t.$operation),\n };\n } else if (\"$audio\" in transformation && transformation.$audio != null) {\n return {\n type: \"audio\" as const,\n operation: convertAudioOperation(transformation.$audio.$operation),\n };\n } else if (\n \"$emailToText\" in transformation &&\n transformation.$emailToText != null\n ) {\n return {\n type: \"emailToText\" as const,\n operation: convertEmailToTextOperation(\n transformation.$emailToText.$operation,\n ),\n };\n } else if (\n \"$spreadsheetToText\" in transformation &&\n transformation.$spreadsheetToText != null\n ) {\n return {\n type: \"spreadsheetToText\" as const,\n operation: convertSpreadsheetToTextOperation(\n transformation.$spreadsheetToText.$operation,\n ),\n };\n } else if (\n \"$videoToAudio\" in transformation &&\n transformation.$videoToAudio != null\n ) {\n const t = transformation.$videoToAudio;\n return {\n type: \"videoToAudio\" as const,\n encoding: convertAudioEncoding(t.$encoding),\n operation: convertVideoToAudioOperation(t.$operation),\n };\n } else if (\n \"$audioToText\" in transformation &&\n transformation.$audioToText != null\n ) {\n return {\n type: \"audioToText\" as const,\n operation: convertAudioToTextOperation(\n transformation.$audioToText.$operation,\n ),\n } as Transformation;\n } else if (\n \"$emailToAttachment\" in transformation &&\n transformation.$emailToAttachment != null\n ) {\n return {\n type: \"emailToAttachment\" as const,\n operation: convertEmailToAttachmentOperation(\n transformation.$emailToAttachment.$operation,\n ),\n };\n } else if (\n \"$videoToArchive\" in transformation &&\n transformation.$videoToArchive != null\n ) {\n const t = transformation.$videoToArchive;\n return {\n type: \"videoToArchive\" as const,\n encoding: { type: t.$encoding },\n operation: convertVideoToArchiveOperation(t.$operation),\n };\n } else if (\n \"$videoToText\" in transformation &&\n transformation.$videoToText != null\n ) {\n return {\n type: \"videoToText\" as const,\n operation: convertVideoToTextOperation(\n transformation.$videoToText.$operation,\n ),\n };\n } else if (\n \"$imageToText\" in transformation &&\n transformation.$imageToText != null\n ) {\n return {\n type: \"imageToText\" as const,\n operation: convertImageToTextOperation(\n transformation.$imageToText.$operation,\n ),\n } as Transformation;\n } else if (\n \"$videoToImage\" in transformation &&\n transformation.$videoToImage != null\n ) {\n const t = transformation.$videoToImage;\n return {\n type: \"videoToImage\" as const,\n encoding: { type: t.$encoding },\n operation: convertVideoToImageOperation(t.$operation),\n };\n } else if (\n \"$imageToDocument\" in transformation &&\n transformation.$imageToDocument != null\n ) {\n return {\n type: \"imageToDocument\" as const,\n operation: convertImageToDocumentOperation(\n transformation.$imageToDocument.$operation,\n ),\n };\n } else if (\n \"$dicomToImage\" in transformation &&\n transformation.$dicomToImage != null\n ) {\n const t = transformation.$dicomToImage;\n return {\n type: \"dicomToImage\" as const,\n encoding: { type: t.$encoding },\n operation: convertDicomToImageOperation(t.$operation),\n };\n } else if (\n \"$documentToDocument\" in transformation &&\n transformation.$documentToDocument != null\n ) {\n const t = transformation.$documentToDocument;\n return {\n type: \"documentToDocument\" as const,\n encoding: { type: t.$encoding },\n operation: convertDocumentToDocumentOperation(t.$operation),\n };\n } else if (\n \"$documentToImage\" in transformation &&\n transformation.$documentToImage != null\n ) {\n const t = transformation.$documentToImage;\n return {\n type: \"documentToImage\" as const,\n encoding: { type: t.$encoding },\n operation: convertDocumentToImageOperation(t.$operation),\n };\n } else if (\n \"$imageToEmbedding\" in transformation &&\n transformation.$imageToEmbedding != null\n ) {\n return {\n type: \"imageToEmbedding\" as const,\n operation: convertImageToEmbeddingOperation(\n transformation.$imageToEmbedding.$operation,\n ),\n } as Transformation;\n } else {\n return {\n type: \"documentToText\" as const,\n operation: convertDocumentToTextOperation(\n (transformation as MediaTransformation & { $documentToText: {} })\n .$documentToText.$operation,\n ),\n } as Transformation;\n }\n}\n\n// ─── Shared converters ──────────────────────────────────────────────────────\n\nfunction convertAudioEncoding(encoding: AudioEncoding) {\n if (typeof encoding === \"string\") {\n if (encoding === \"mp3\") {\n return { type: \"mp3\" as const };\n } else {\n return { type: \"ts\" as const };\n }\n }\n return {\n type: \"wav\" as const,\n sampleRate: encoding.$wav.$sampleRate,\n audioChannelLayout:\n encoding.$wav.$audioChannelLayout != null\n ? {\n type: \"numberOfChannels\" as const,\n numberOfChannels:\n encoding.$wav.$audioChannelLayout.$numberOfChannels,\n }\n : undefined,\n };\n}\n\nfunction convertPageRange(range: PageRange) {\n return {\n startPageInclusive: range.$startPageInclusive,\n endPageExclusive: range.$endPageExclusive,\n };\n}\n\nfunction convertOcrOutputFormat(fmt: OcrOutputFormat) {\n if (\"$hocr\" in fmt) {\n return { type: \"hocr\" as const };\n } else {\n return { type: \"text\" as const };\n }\n}\n\nfunction convertOcrLanguageOrScript(item: OcrLanguageOrScript) {\n if (\"$language\" in item && item.$language != null) {\n return { type: \"language\" as const, language: item.$language };\n } else {\n const script = (item as OcrLanguageOrScript & { $script: string }).$script;\n return { type: \"script\" as const, script };\n }\n}\n\nfunction convertOcrParameters(params: OcrParameters) {\n return {\n outputFormat: convertOcrOutputFormat(params.$outputFormat),\n languages: params.$languages.map(convertOcrLanguageOrScript),\n };\n}\n\nfunction convertLayoutAwareExtractionParameters(\n params: LayoutAwareExtractionParameters,\n) {\n return {\n languages: params.$languages,\n };\n}\n\nfunction convertDocumentTextExtractionConfig(\n config: DocumentTextExtractionConfig,\n) {\n return {\n format: config.$format,\n mode: config.$mode,\n languages: config.$languages.map(convertOcrLanguageOrScript),\n };\n}\n\nfunction convertTranscribeOutputFormat(fmt: TranscribeOutputFormat) {\n if (\"$plainTextNoSegmentData\" in fmt && fmt.$plainTextNoSegmentData != null) {\n return {\n type: \"plainTextNoSegmentData\" as const,\n addTimestamps: fmt.$plainTextNoSegmentData.$addTimestamps,\n };\n } else if (\"$json\" in fmt) {\n return { type: \"json\" as const };\n } else {\n return { type: \"pttml\" as const };\n }\n}\n\nfunction convertLlmSpec(spec: LlmSpec) {\n return {\n type: \"chat\" as const,\n chat: {\n modelLocator: {\n type: \"apiName\" as const,\n apiName: spec.$chat.$modelLocator,\n },\n systemPrompt: spec.$chat.$systemPrompt,\n userPrompt: spec.$chat.$userPrompt,\n maxTokens: spec.$chat.$maxTokens,\n },\n };\n}\n\nfunction convertVlmPreprocessingConfig(config: VlmPreprocessingConfig) {\n if (\"$layoutAware\" in config && config.$layoutAware != null) {\n return {\n type: \"layoutAware\" as const,\n layoutAware: {\n transformationConfig: convertDocumentTextExtractionConfig(\n config.$layoutAware.$transformationConfig,\n ),\n cropConfig:\n config.$layoutAware.$cropConfig != null\n ? { tablePrompt: config.$layoutAware.$cropConfig.$tablePrompt }\n : undefined,\n },\n };\n } else {\n const ext = (\n config as VlmPreprocessingConfig & {\n $extractText: DocumentTextExtractionConfig;\n }\n ).$extractText;\n return {\n type: \"extractText\" as const,\n extractText: convertDocumentTextExtractionConfig(ext),\n };\n }\n}\n\nfunction convertImageSpec(spec: ImageSpec) {\n return {\n resizingMode: spec.$resizingMode,\n height: spec.$height,\n width: spec.$width,\n mimeType: spec.$mimeType,\n };\n}\n\n// ─── Operation converters ───────────────────────────────────────────────────\n\nfunction convertImageOperation(op: ImageOperation) {\n if (\"$resize\" in op && op.$resize != null) {\n return {\n type: \"resize\" as const,\n width: op.$resize.$width,\n height: op.$resize.$height,\n autoOrient: op.$resize.$autoOrient,\n };\n } else if (\n \"$resizeToFitBoundingBox\" in op &&\n op.$resizeToFitBoundingBox != null\n ) {\n return {\n type: \"resizeToFitBoundingBox\" as const,\n width: op.$resizeToFitBoundingBox.$width,\n height: op.$resizeToFitBoundingBox.$height,\n };\n } else if (\"$rotate\" in op && op.$rotate != null) {\n return {\n type: \"rotate\" as const,\n angle: op.$rotate.$angle,\n };\n } else if (\"$crop\" in op && op.$crop != null) {\n return {\n type: \"crop\" as const,\n xOffset: op.$crop.$xOffset,\n yOffset: op.$crop.$yOffset,\n width: op.$crop.$width,\n height: op.$crop.$height,\n };\n } else if (\"$grayscale\" in op) {\n return { type: \"grayscale\" as const };\n } else if (\"$tile\" in op && op.$tile != null) {\n return {\n type: \"tile\" as const,\n zoom: op.$tile.$zoom,\n x: op.$tile.$x,\n y: op.$tile.$y,\n };\n } else if (\"$annotate\" in op && op.$annotate != null) {\n return {\n type: \"annotate\" as const,\n annotations: op.$annotate.$annotations.map(convertAnnotation),\n };\n } else if (\"$contrast\" in op && op.$contrast != null) {\n return {\n type: \"contrast\" as const,\n contrastType: convertContrastType(op.$contrast.$contrastType),\n };\n } else if (\"$encrypt\" in op && op.$encrypt != null) {\n return {\n type: \"encrypt\" as const,\n polygons: op.$encrypt.$polygons.map(convertImageRegionPolygon),\n cipherLicenseRid: op.$encrypt.$cipherLicenseRid,\n };\n } else {\n const decrypt = (op as ImageOperation & { $decrypt: {} }).$decrypt;\n return {\n type: \"decrypt\" as const,\n polygons: decrypt.$polygons.map(convertImageRegionPolygon),\n cipherLicenseRid: decrypt.$cipherLicenseRid,\n };\n }\n}\n\nfunction convertAnnotation(annotation: Annotation) {\n return {\n geometry: convertAnnotateGeometry(annotation.$geometry),\n label: annotation.$label,\n color:\n annotation.$color != null ? convertColor(annotation.$color) : undefined,\n thickness: annotation.$thickness,\n fontSize: annotation.$fontSize,\n };\n}\n\nfunction convertAnnotateGeometry(geometry: AnnotateGeometry) {\n return {\n type: \"boundingBox\" as const,\n boundingBox: {\n left: geometry.$boundingBox.$left,\n top: geometry.$boundingBox.$top,\n width: geometry.$boundingBox.$width,\n height: geometry.$boundingBox.$height,\n },\n };\n}\n\nfunction convertColor(color: Color) {\n return { r: color.$r, g: color.$g, b: color.$b, a: color.$a };\n}\n\nfunction convertContrastType(contrastType: ContrastType) {\n if (\"$equalize\" in contrastType) {\n return { type: \"equalize\" as const };\n } else if (\"$rayleigh\" in contrastType && contrastType.$rayleigh != null) {\n return {\n type: \"rayleigh\" as const,\n sigma: contrastType.$rayleigh.$sigma,\n };\n } else {\n const binarize = (contrastType as ContrastType & { $binarize: {} })\n .$binarize;\n return { type: \"binarize\" as const, threshold: binarize.$threshold };\n }\n}\n\nfunction convertImageRegionPolygon(polygon: ImageRegionPolygon) {\n return polygon.map((coordinate) => ({\n x: coordinate.$x,\n y: coordinate.$y,\n }));\n}\n\nfunction convertVideoOperation(op: VideoOperation) {\n if (\"$transcode\" in op) {\n return { type: \"transcode\" as const };\n } else {\n const chunk = (op as VideoOperation & { $chunk: {} }).$chunk;\n return {\n type: \"chunk\" as const,\n chunkDurationMilliseconds: chunk.$chunkDurationMilliseconds,\n chunkIndex: chunk.$chunkIndex,\n };\n }\n}\n\nfunction convertAudioOperation(op: AudioOperation) {\n if (\"$channel\" in op && op.$channel != null) {\n return {\n type: \"channel\" as const,\n encodeFormat: convertAudioEncoding(op.$channel.$encodeFormat),\n channel: op.$channel.$channel,\n };\n } else if (\"$chunk\" in op && op.$chunk != null) {\n return {\n type: \"chunk\" as const,\n encodeFormat: convertAudioEncoding(op.$chunk.$encodeFormat),\n chunkDurationMilliseconds: op.$chunk.$chunkDurationMilliseconds,\n chunkIndex: op.$chunk.$chunkIndex,\n };\n } else {\n const convert = (op as AudioOperation & { $convert: {} }).$convert;\n return {\n type: \"convert\" as const,\n encodeFormat: convertAudioEncoding(convert.$encodeFormat),\n };\n }\n}\n\nfunction convertVideoToAudioOperation(_op: VideoToAudioOperation) {\n return { type: \"extractAudio\" as const };\n}\n\nfunction convertAudioToTextOperation(op: AudioToTextOperation) {\n if (\"$transcribe\" in op && op.$transcribe != null) {\n return {\n type: \"transcribe\" as const,\n language: op.$transcribe.$language,\n diarize: op.$transcribe.$diarize,\n outputFormat:\n op.$transcribe.$outputFormat != null\n ? convertTranscribeOutputFormat(op.$transcribe.$outputFormat)\n : undefined,\n performanceMode: op.$transcribe.$performanceMode,\n };\n } else {\n const waveform = (op as AudioToTextOperation & { $waveform: {} }).$waveform;\n return {\n type: \"waveform\" as const,\n peaksPerSecond: waveform.$peaksPerSecond,\n };\n }\n}\n\nfunction convertEmailToTextOperation(op: EmailToTextOperation) {\n return {\n type: \"getEmailBody\" as const,\n outputFormat: op.$getEmailBody.$outputFormat,\n };\n}\n\nfunction convertEmailToAttachmentOperation(op: EmailToAttachmentOperation) {\n return {\n type: \"getEmailAttachment\" as const,\n mimeType: op.$getEmailAttachment.$mimeType,\n attachmentIndex: op.$getEmailAttachment.$attachmentIndex,\n };\n}\n\nfunction convertSpreadsheetToTextOperation(op: SpreadsheetToTextOperation) {\n return {\n type: \"convertSheetToJson\" as const,\n sheetName: op.$convertSheetToJson.$sheetName,\n };\n}\n\nfunction convertVideoToArchiveOperation(op: VideoToArchiveOperation) {\n return {\n type: \"extractSceneFrames\" as const,\n encoding: { type: op.$extractSceneFrames.$encoding },\n sceneScore: op.$extractSceneFrames.$sceneScore,\n };\n}\n\nfunction convertVideoToTextOperation(op: VideoToTextOperation) {\n return {\n type: \"getTimestampsForSceneFrames\" as const,\n sceneScore: op.$getTimestampsForSceneFrames.$sceneScore,\n };\n}\n\nfunction convertImageToTextOperation(op: ImageToTextOperation) {\n if (\n \"$extractLayoutAwareContent\" in op &&\n op.$extractLayoutAwareContent != null\n ) {\n return {\n type: \"extractLayoutAwareContent\" as const,\n parameters: convertLayoutAwareExtractionParameters(\n op.$extractLayoutAwareContent.$parameters,\n ),\n };\n } else {\n const ocr = (op as ImageToTextOperation & { $ocr: {} }).$ocr;\n return {\n type: \"ocr\" as const,\n parameters: convertOcrParameters(ocr.$parameters),\n };\n }\n}\n\nfunction convertVideoToImageOperation(op: VideoToImageOperation) {\n if (\"$extractFirstFrame\" in op && op.$extractFirstFrame != null) {\n return {\n type: \"extractFirstFrame\" as const,\n height: op.$extractFirstFrame.$height,\n width: op.$extractFirstFrame.$width,\n };\n } else {\n const ext = (\n op as VideoToImageOperation & { $extractFramesAtTimestamps: {} }\n ).$extractFramesAtTimestamps;\n return {\n type: \"extractFramesAtTimestamps\" as const,\n height: ext.$height,\n width: ext.$width,\n timestamp: ext.$timestamp,\n };\n }\n}\n\nfunction convertImageToDocumentOperation(_op: ImageToDocumentOperation) {\n return { type: \"createPdf\" as const };\n}\n\nfunction convertDicomToImageOperation(op: DicomToImageOperation) {\n return {\n type: \"renderImageLayer\" as const,\n layerNumber: op.$renderImageLayer.$layerNumber,\n height: op.$renderImageLayer.$height,\n width: op.$renderImageLayer.$width,\n };\n}\n\nfunction convertDocumentToDocumentOperation(op: DocumentToDocumentOperation) {\n if (\"$slicePdfRange\" in op && op.$slicePdfRange != null) {\n return {\n type: \"slicePdfRange\" as const,\n startPageInclusive: op.$slicePdfRange.$startPageInclusive,\n endPageExclusive: op.$slicePdfRange.$endPageExclusive,\n strictlyEnforceEndPage: op.$slicePdfRange.$strictlyEnforceEndPage,\n };\n } else {\n return { type: \"convertDocument\" as const };\n }\n}\n\nfunction convertDocumentToImageOperation(op: DocumentToImageOperation) {\n if (\"$renderPage\" in op && op.$renderPage != null) {\n return {\n type: \"renderPage\" as const,\n pageNumber: op.$renderPage.$pageNumber,\n height: op.$renderPage.$height,\n width: op.$renderPage.$width,\n };\n } else {\n const bb = (\n op as DocumentToImageOperation & { $renderPageToFitBoundingBox: {} }\n ).$renderPageToFitBoundingBox;\n return {\n type: \"renderPageToFitBoundingBox\" as const,\n pageNumber: bb.$pageNumber,\n width: bb.$width,\n height: bb.$height,\n };\n }\n}\n\nfunction convertImageToEmbeddingOperation(op: ImageToEmbeddingOperation) {\n return {\n type: \"generateEmbedding\" as const,\n modelId: op.$generateEmbedding.$modelId,\n };\n}\n\nfunction convertDocumentToTextOperation(op: DocumentToTextOperation) {\n if (\"$extractAllText\" in op) {\n return { type: \"extractAllText\" as const };\n } else if (\"$extractTableOfContents\" in op) {\n return { type: \"extractTableOfContents\" as const };\n } else if (\"$getPdfPageDimensions\" in op) {\n return { type: \"getPdfPageDimensions\" as const };\n } else if (\"$extractFormFields\" in op) {\n return { type: \"extractFormFields\" as const };\n } else if (\n \"$extractUnstructuredTextFromPage\" in op &&\n op.$extractUnstructuredTextFromPage != null\n ) {\n return {\n type: \"extractUnstructuredTextFromPage\" as const,\n pageNumber: op.$extractUnstructuredTextFromPage.$pageNumber,\n };\n } else if (\n \"$extractTextFromPagesToArray\" in op &&\n op.$extractTextFromPagesToArray != null\n ) {\n return {\n type: \"extractTextFromPagesToArray\" as const,\n startPage: op.$extractTextFromPagesToArray.$startPage,\n endPage: op.$extractTextFromPagesToArray.$endPage,\n };\n } else if (\"$ocrOnPage\" in op && op.$ocrOnPage != null) {\n return {\n type: \"ocrOnPage\" as const,\n pageNumber: op.$ocrOnPage.$pageNumber,\n parameters: convertOcrParameters(op.$ocrOnPage.$parameters),\n };\n } else if (\"$ocrOnPages\" in op && op.$ocrOnPages != null) {\n return {\n type: \"ocrOnPages\" as const,\n pageNumber: op.$ocrOnPages.$pageNumber,\n parameters: convertOcrParameters(op.$ocrOnPages.$parameters),\n };\n } else if (\n \"$extractLayoutAwareContent\" in op &&\n op.$extractLayoutAwareContent != null\n ) {\n return {\n type: \"extractLayoutAwareContent\" as const,\n parameters: convertLayoutAwareExtractionParameters(\n op.$extractLayoutAwareContent.$parameters,\n ),\n };\n } else if (\n \"$extractLayoutAwareTextV2\" in op &&\n op.$extractLayoutAwareTextV2 != null\n ) {\n return {\n type: \"extractLayoutAwareTextV2\" as const,\n pageRange:\n op.$extractLayoutAwareTextV2.$pageRange != null\n ? convertPageRange(op.$extractLayoutAwareTextV2.$pageRange)\n : undefined,\n config: convertDocumentTextExtractionConfig(\n op.$extractLayoutAwareTextV2.$config,\n ),\n };\n } else if (\"$extractTextV2\" in op && op.$extractTextV2 != null) {\n return {\n type: \"extractTextV2\" as const,\n pageRange:\n op.$extractTextV2.$pageRange != null\n ? convertPageRange(op.$extractTextV2.$pageRange)\n : undefined,\n config: convertDocumentTextExtractionConfig(op.$extractTextV2.$config),\n };\n } else {\n const vlm = (op as DocumentToTextOperation & { $extractVlmText: {} })\n .$extractVlmText;\n return {\n type: \"extractVlmText\" as const,\n llmSpec: convertLlmSpec(vlm.$llmSpec),\n preprocessingConfiguration:\n vlm.$preprocessingConfiguration != null\n ? convertVlmPreprocessingConfig(vlm.$preprocessingConfiguration)\n : undefined,\n imageSpec:\n vlm.$imageSpec != null ? convertImageSpec(vlm.$imageSpec) : undefined,\n outputFormat: vlm.$outputFormat,\n pageRange:\n vlm.$pageRange != null ? convertPageRange(vlm.$pageRange) : undefined,\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyCA,OAAO,SAASA,uBAAuBA,CACrCC,cAAmC,EACnB;EAChB,IAAI,QAAQ,IAAIA,cAAc,IAAIA,cAAc,CAACC,MAAM,IAAI,IAAI,EAAE;IAC/D,MAAMC,CAAC,GAAGF,cAAc,CAACC,MAAM;IAC/B,OAAO;MACLE,IAAI,EAAE,OAAgB;MACtBC,QAAQ,EAAE;QAAED,IAAI,EAAED,CAAC,CAACG;MAAU,CAAC;MAC/BC,UAAU,EAAEJ,CAAC,CAACK,WAAW,CAACC,GAAG,CAACC,qBAAqB;IACrD,CAA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":3,"file":"makeMediaTransformation.js","names":["makeMediaTransformation","transformation","$image","t","type","encoding","$encoding","operations","$operations","map","convertImageOperation","$video","operation","convertVideoOperation","$operation","$audio","convertAudioOperation","$emailToText","convertEmailToTextOperation","$spreadsheetToText","convertSpreadsheetToTextOperation","$videoToAudio","convertAudioEncoding","convertVideoToAudioOperation","$audioToText","convertAudioToTextOperation","$emailToAttachment","convertEmailToAttachmentOperation","$videoToArchive","convertVideoToArchiveOperation","$videoToText","convertVideoToTextOperation","$imageToText","convertImageToTextOperation","$videoToImage","convertVideoToImageOperation","$imageToDocument","convertImageToDocumentOperation","$dicomToImage","convertDicomToImageOperation","$documentToDocument","convertDocumentToDocumentOperation","$documentToImage","convertDocumentToImageOperation","$imageToEmbedding","convertImageToEmbeddingOperation","convertDocumentToTextOperation","$documentToText","sampleRate","$wav","$sampleRate","audioChannelLayout","$audioChannelLayout","numberOfChannels","$numberOfChannels","undefined","convertPageRange","range","startPageInclusive","$startPageInclusive","endPageExclusive","$endPageExclusive","convertOcrOutputFormat","fmt","convertOcrLanguageOrScript","item","$language","language","script","$script","convertOcrParameters","params","outputFormat","$outputFormat","languages","$languages","convertLayoutAwareExtractionParameters","convertDocumentTextExtractionConfig","config","format","$format","mode","$mode","convertTranscribeOutputFormat","$plainTextNoSegmentData","addTimestamps","$addTimestamps","convertLlmSpec","spec","chat","modelLocator","apiName","$chat","$modelLocator","systemPrompt","$systemPrompt","userPrompt","$userPrompt","maxTokens","$maxTokens","convertVlmPreprocessingConfig","$layoutAware","layoutAware","transformationConfig","$transformationConfig","cropConfig","$cropConfig","tablePrompt","$tablePrompt","ext","$extractText","extractText","convertImageSpec","resizingMode","$resizingMode","height","$height","width","$width","mimeType","$mimeType","op","$resize","autoOrient","$autoOrient","$resizeToFitBoundingBox","$rotate","angle","$angle","$crop","xOffset","$xOffset","yOffset","$yOffset","$tile","zoom","$zoom","x","$x","y","$y","$annotate","annotations","$annotations","convertAnnotation","$contrast","contrastType","convertContrastType","$contrastType","$encrypt","polygons","$polygons","convertImageRegionPolygon","cipherLicenseRid","$cipherLicenseRid","decrypt","$decrypt","annotation","geometry","convertAnnotateGeometry","$geometry","label","$label","color","$color","convertColor","thickness","$thickness","fontSize","$fontSize","boundingBox","left","$boundingBox","$left","top","$top","r","$r","g","$g","b","$b","a","$a","$rayleigh","sigma","$sigma","binarize","$binarize","threshold","$threshold","polygon","coordinate","chunk","$chunk","chunkDurationMilliseconds","$chunkDurationMilliseconds","chunkIndex","$chunkIndex","$channel","encodeFormat","$encodeFormat","channel","convert","$convert","$transcribe","diarize","$diarize","performanceMode","$performanceMode","waveform","$waveform","peaksPerSecond","$peaksPerSecond","$getEmailBody","$getEmailAttachment","attachmentIndex","$attachmentIndex","sheetName","$convertSheetToJson","$sheetName","$extractSceneFrames","sceneScore","$sceneScore","$getTimestampsForSceneFrames","$extractLayoutAwareContent","parameters","$parameters","ocr","$ocr","$extractFirstFrame","$extractFramesAtTimestamps","timestamp","$timestamp","layerNumber","$renderImageLayer","$layerNumber","$slicePdfRange","strictlyEnforceEndPage","$strictlyEnforceEndPage","$renderPage","pageNumber","$pageNumber","bb","$renderPageToFitBoundingBox","modelId","$generateEmbedding","$modelId","$extractUnstructuredTextFromPage","$extractTextFromPagesToArray","startPage","$startPage","endPage","$endPage","$ocrOnPage","$ocrOnPages","$extractLayoutAwareTextV2","pageRange","$pageRange","$config","$extractTextV2","vlm","$extractVlmText","llmSpec","$llmSpec","preprocessingConfiguration","$preprocessingConfiguration","imageSpec","$imageSpec"],"sources":["makeMediaTransformation.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnnotateGeometry,\n Annotation,\n AudioEncoding,\n AudioOperation,\n AudioToTextOperation,\n Color,\n ContrastType,\n DicomToImageOperation,\n DocumentTextExtractionConfig,\n DocumentToDocumentOperation,\n DocumentToImageOperation,\n DocumentToTextOperation,\n EmailToAttachmentOperation,\n EmailToTextOperation,\n ImageOperation,\n ImageRegionPolygon,\n ImageSpec,\n ImageToDocumentOperation,\n ImageToEmbeddingOperation,\n ImageToTextOperation,\n LayoutAwareExtractionParameters,\n LlmSpec,\n MediaTransformation,\n OcrLanguage,\n OcrLanguageOrScript,\n OcrOutputFormat,\n OcrParameters,\n OcrScript,\n PageRange,\n SpreadsheetToTextOperation,\n TranscribeOutputFormat,\n TranscriptionLanguage,\n VideoOperation,\n VideoToArchiveOperation,\n VideoToAudioOperation,\n VideoToImageOperation,\n VideoToTextOperation,\n VlmPreprocessingConfig,\n} from \"@osdk/api/unstable\";\nimport type {\n OcrLanguage as WireOcrLanguage,\n OcrScript as WireOcrScript,\n Transformation,\n TranscriptionLanguage as WireTranscriptionLanguage,\n} from \"@osdk/foundry.mediasets\";\nimport type { IsEqual } from \"type-fest\";\n\n// hand-copied into `@osdk/api`, which cannot depend on `@osdk/foundry.*`. a narrower copy stays\n// assignable to the wire type, so only an equality check catches a value the platform adds\ntype AssertPlatformParity<T extends true> = T;\n\ntype _OcrLanguageMatchesPlatform = AssertPlatformParity<\n IsEqual<OcrLanguage, WireOcrLanguage>\n>;\ntype _OcrScriptMatchesPlatform = AssertPlatformParity<\n IsEqual<OcrScript, WireOcrScript>\n>;\ntype _TranscriptionLanguageMatchesPlatform = AssertPlatformParity<\n IsEqual<TranscriptionLanguage, WireTranscriptionLanguage>\n>;\n\nexport function makeMediaTransformation(\n transformation: MediaTransformation,\n): Transformation {\n if (\"$image\" in transformation && transformation.$image != null) {\n const t = transformation.$image;\n return {\n type: \"image\" as const,\n encoding: { type: t.$encoding },\n operations: t.$operations.map(convertImageOperation),\n };\n } else if (\"$video\" in transformation && transformation.$video != null) {\n const t = transformation.$video;\n return {\n type: \"video\" as const,\n encoding: { type: t.$encoding },\n operation: convertVideoOperation(t.$operation),\n };\n } else if (\"$audio\" in transformation && transformation.$audio != null) {\n return {\n type: \"audio\" as const,\n operation: convertAudioOperation(transformation.$audio.$operation),\n };\n } else if (\n \"$emailToText\" in transformation &&\n transformation.$emailToText != null\n ) {\n return {\n type: \"emailToText\" as const,\n operation: convertEmailToTextOperation(\n transformation.$emailToText.$operation,\n ),\n };\n } else if (\n \"$spreadsheetToText\" in transformation &&\n transformation.$spreadsheetToText != null\n ) {\n return {\n type: \"spreadsheetToText\" as const,\n operation: convertSpreadsheetToTextOperation(\n transformation.$spreadsheetToText.$operation,\n ),\n };\n } else if (\n \"$videoToAudio\" in transformation &&\n transformation.$videoToAudio != null\n ) {\n const t = transformation.$videoToAudio;\n return {\n type: \"videoToAudio\" as const,\n encoding: convertAudioEncoding(t.$encoding),\n operation: convertVideoToAudioOperation(t.$operation),\n };\n } else if (\n \"$audioToText\" in transformation &&\n transformation.$audioToText != null\n ) {\n return {\n type: \"audioToText\" as const,\n operation: convertAudioToTextOperation(\n transformation.$audioToText.$operation,\n ),\n } as Transformation;\n } else if (\n \"$emailToAttachment\" in transformation &&\n transformation.$emailToAttachment != null\n ) {\n return {\n type: \"emailToAttachment\" as const,\n operation: convertEmailToAttachmentOperation(\n transformation.$emailToAttachment.$operation,\n ),\n };\n } else if (\n \"$videoToArchive\" in transformation &&\n transformation.$videoToArchive != null\n ) {\n const t = transformation.$videoToArchive;\n return {\n type: \"videoToArchive\" as const,\n encoding: { type: t.$encoding },\n operation: convertVideoToArchiveOperation(t.$operation),\n };\n } else if (\n \"$videoToText\" in transformation &&\n transformation.$videoToText != null\n ) {\n return {\n type: \"videoToText\" as const,\n operation: convertVideoToTextOperation(\n transformation.$videoToText.$operation,\n ),\n };\n } else if (\n \"$imageToText\" in transformation &&\n transformation.$imageToText != null\n ) {\n return {\n type: \"imageToText\" as const,\n operation: convertImageToTextOperation(\n transformation.$imageToText.$operation,\n ),\n } as Transformation;\n } else if (\n \"$videoToImage\" in transformation &&\n transformation.$videoToImage != null\n ) {\n const t = transformation.$videoToImage;\n return {\n type: \"videoToImage\" as const,\n encoding: { type: t.$encoding },\n operation: convertVideoToImageOperation(t.$operation),\n };\n } else if (\n \"$imageToDocument\" in transformation &&\n transformation.$imageToDocument != null\n ) {\n return {\n type: \"imageToDocument\" as const,\n operation: convertImageToDocumentOperation(\n transformation.$imageToDocument.$operation,\n ),\n };\n } else if (\n \"$dicomToImage\" in transformation &&\n transformation.$dicomToImage != null\n ) {\n const t = transformation.$dicomToImage;\n return {\n type: \"dicomToImage\" as const,\n encoding: { type: t.$encoding },\n operation: convertDicomToImageOperation(t.$operation),\n };\n } else if (\n \"$documentToDocument\" in transformation &&\n transformation.$documentToDocument != null\n ) {\n const t = transformation.$documentToDocument;\n return {\n type: \"documentToDocument\" as const,\n encoding: { type: t.$encoding },\n operation: convertDocumentToDocumentOperation(t.$operation),\n };\n } else if (\n \"$documentToImage\" in transformation &&\n transformation.$documentToImage != null\n ) {\n const t = transformation.$documentToImage;\n return {\n type: \"documentToImage\" as const,\n encoding: { type: t.$encoding },\n operation: convertDocumentToImageOperation(t.$operation),\n };\n } else if (\n \"$imageToEmbedding\" in transformation &&\n transformation.$imageToEmbedding != null\n ) {\n return {\n type: \"imageToEmbedding\" as const,\n operation: convertImageToEmbeddingOperation(\n transformation.$imageToEmbedding.$operation,\n ),\n } as Transformation;\n } else {\n return {\n type: \"documentToText\" as const,\n operation: convertDocumentToTextOperation(\n (transformation as MediaTransformation & { $documentToText: {} })\n .$documentToText.$operation,\n ),\n } as Transformation;\n }\n}\n\n// ─── Shared converters ──────────────────────────────────────────────────────\n\nfunction convertAudioEncoding(encoding: AudioEncoding) {\n if (typeof encoding === \"string\") {\n if (encoding === \"mp3\") {\n return { type: \"mp3\" as const };\n } else {\n return { type: \"ts\" as const };\n }\n }\n return {\n type: \"wav\" as const,\n sampleRate: encoding.$wav.$sampleRate,\n audioChannelLayout:\n encoding.$wav.$audioChannelLayout != null\n ? {\n type: \"numberOfChannels\" as const,\n numberOfChannels:\n encoding.$wav.$audioChannelLayout.$numberOfChannels,\n }\n : undefined,\n };\n}\n\nfunction convertPageRange(range: PageRange) {\n return {\n startPageInclusive: range.$startPageInclusive,\n endPageExclusive: range.$endPageExclusive,\n };\n}\n\nfunction convertOcrOutputFormat(fmt: OcrOutputFormat) {\n if (\"$hocr\" in fmt) {\n return { type: \"hocr\" as const };\n } else {\n return { type: \"text\" as const };\n }\n}\n\nfunction convertOcrLanguageOrScript(item: OcrLanguageOrScript) {\n if (\"$language\" in item && item.$language != null) {\n return { type: \"language\" as const, language: item.$language };\n } else {\n const script = (item as OcrLanguageOrScript & { $script: OcrScript })\n .$script;\n return { type: \"script\" as const, script };\n }\n}\n\nfunction convertOcrParameters(params: OcrParameters) {\n return {\n outputFormat: convertOcrOutputFormat(params.$outputFormat),\n languages: params.$languages.map(convertOcrLanguageOrScript),\n };\n}\n\nfunction convertLayoutAwareExtractionParameters(\n params: LayoutAwareExtractionParameters,\n) {\n return {\n languages: params.$languages,\n };\n}\n\nfunction convertDocumentTextExtractionConfig(\n config: DocumentTextExtractionConfig,\n) {\n return {\n format: config.$format,\n mode: config.$mode,\n languages: config.$languages.map(convertOcrLanguageOrScript),\n };\n}\n\nfunction convertTranscribeOutputFormat(fmt: TranscribeOutputFormat) {\n if (\"$plainTextNoSegmentData\" in fmt && fmt.$plainTextNoSegmentData != null) {\n return {\n type: \"plainTextNoSegmentData\" as const,\n addTimestamps: fmt.$plainTextNoSegmentData.$addTimestamps,\n };\n } else if (\"$json\" in fmt) {\n return { type: \"json\" as const };\n } else {\n return { type: \"pttml\" as const };\n }\n}\n\nfunction convertLlmSpec(spec: LlmSpec) {\n return {\n type: \"chat\" as const,\n chat: {\n modelLocator: {\n type: \"apiName\" as const,\n apiName: spec.$chat.$modelLocator,\n },\n systemPrompt: spec.$chat.$systemPrompt,\n userPrompt: spec.$chat.$userPrompt,\n maxTokens: spec.$chat.$maxTokens,\n },\n };\n}\n\nfunction convertVlmPreprocessingConfig(config: VlmPreprocessingConfig) {\n if (\"$layoutAware\" in config && config.$layoutAware != null) {\n return {\n type: \"layoutAware\" as const,\n layoutAware: {\n transformationConfig: convertDocumentTextExtractionConfig(\n config.$layoutAware.$transformationConfig,\n ),\n cropConfig:\n config.$layoutAware.$cropConfig != null\n ? { tablePrompt: config.$layoutAware.$cropConfig.$tablePrompt }\n : undefined,\n },\n };\n } else {\n const ext = (\n config as VlmPreprocessingConfig & {\n $extractText: DocumentTextExtractionConfig;\n }\n ).$extractText;\n return {\n type: \"extractText\" as const,\n extractText: convertDocumentTextExtractionConfig(ext),\n };\n }\n}\n\nfunction convertImageSpec(spec: ImageSpec) {\n return {\n resizingMode: spec.$resizingMode,\n height: spec.$height,\n width: spec.$width,\n mimeType: spec.$mimeType,\n };\n}\n\n// ─── Operation converters ───────────────────────────────────────────────────\n\nfunction convertImageOperation(op: ImageOperation) {\n if (\"$resize\" in op && op.$resize != null) {\n return {\n type: \"resize\" as const,\n width: op.$resize.$width,\n height: op.$resize.$height,\n autoOrient: op.$resize.$autoOrient,\n };\n } else if (\n \"$resizeToFitBoundingBox\" in op &&\n op.$resizeToFitBoundingBox != null\n ) {\n return {\n type: \"resizeToFitBoundingBox\" as const,\n width: op.$resizeToFitBoundingBox.$width,\n height: op.$resizeToFitBoundingBox.$height,\n };\n } else if (\"$rotate\" in op && op.$rotate != null) {\n return {\n type: \"rotate\" as const,\n angle: op.$rotate.$angle,\n };\n } else if (\"$crop\" in op && op.$crop != null) {\n return {\n type: \"crop\" as const,\n xOffset: op.$crop.$xOffset,\n yOffset: op.$crop.$yOffset,\n width: op.$crop.$width,\n height: op.$crop.$height,\n };\n } else if (\"$grayscale\" in op) {\n return { type: \"grayscale\" as const };\n } else if (\"$tile\" in op && op.$tile != null) {\n return {\n type: \"tile\" as const,\n zoom: op.$tile.$zoom,\n x: op.$tile.$x,\n y: op.$tile.$y,\n };\n } else if (\"$annotate\" in op && op.$annotate != null) {\n return {\n type: \"annotate\" as const,\n annotations: op.$annotate.$annotations.map(convertAnnotation),\n };\n } else if (\"$contrast\" in op && op.$contrast != null) {\n return {\n type: \"contrast\" as const,\n contrastType: convertContrastType(op.$contrast.$contrastType),\n };\n } else if (\"$encrypt\" in op && op.$encrypt != null) {\n return {\n type: \"encrypt\" as const,\n polygons: op.$encrypt.$polygons.map(convertImageRegionPolygon),\n cipherLicenseRid: op.$encrypt.$cipherLicenseRid,\n };\n } else {\n const decrypt = (op as ImageOperation & { $decrypt: {} }).$decrypt;\n return {\n type: \"decrypt\" as const,\n polygons: decrypt.$polygons.map(convertImageRegionPolygon),\n cipherLicenseRid: decrypt.$cipherLicenseRid,\n };\n }\n}\n\nfunction convertAnnotation(annotation: Annotation) {\n return {\n geometry: convertAnnotateGeometry(annotation.$geometry),\n label: annotation.$label,\n color:\n annotation.$color != null ? convertColor(annotation.$color) : undefined,\n thickness: annotation.$thickness,\n fontSize: annotation.$fontSize,\n };\n}\n\nfunction convertAnnotateGeometry(geometry: AnnotateGeometry) {\n return {\n type: \"boundingBox\" as const,\n boundingBox: {\n left: geometry.$boundingBox.$left,\n top: geometry.$boundingBox.$top,\n width: geometry.$boundingBox.$width,\n height: geometry.$boundingBox.$height,\n },\n };\n}\n\nfunction convertColor(color: Color) {\n return { r: color.$r, g: color.$g, b: color.$b, a: color.$a };\n}\n\nfunction convertContrastType(contrastType: ContrastType) {\n if (\"$equalize\" in contrastType) {\n return { type: \"equalize\" as const };\n } else if (\"$rayleigh\" in contrastType && contrastType.$rayleigh != null) {\n return {\n type: \"rayleigh\" as const,\n sigma: contrastType.$rayleigh.$sigma,\n };\n } else {\n const binarize = (contrastType as ContrastType & { $binarize: {} })\n .$binarize;\n return { type: \"binarize\" as const, threshold: binarize.$threshold };\n }\n}\n\nfunction convertImageRegionPolygon(polygon: ImageRegionPolygon) {\n return polygon.map((coordinate) => ({\n x: coordinate.$x,\n y: coordinate.$y,\n }));\n}\n\nfunction convertVideoOperation(op: VideoOperation) {\n if (\"$transcode\" in op) {\n return { type: \"transcode\" as const };\n } else {\n const chunk = (op as VideoOperation & { $chunk: {} }).$chunk;\n return {\n type: \"chunk\" as const,\n chunkDurationMilliseconds: chunk.$chunkDurationMilliseconds,\n chunkIndex: chunk.$chunkIndex,\n };\n }\n}\n\nfunction convertAudioOperation(op: AudioOperation) {\n if (\"$channel\" in op && op.$channel != null) {\n return {\n type: \"channel\" as const,\n encodeFormat: convertAudioEncoding(op.$channel.$encodeFormat),\n channel: op.$channel.$channel,\n };\n } else if (\"$chunk\" in op && op.$chunk != null) {\n return {\n type: \"chunk\" as const,\n encodeFormat: convertAudioEncoding(op.$chunk.$encodeFormat),\n chunkDurationMilliseconds: op.$chunk.$chunkDurationMilliseconds,\n chunkIndex: op.$chunk.$chunkIndex,\n };\n } else {\n const convert = (op as AudioOperation & { $convert: {} }).$convert;\n return {\n type: \"convert\" as const,\n encodeFormat: convertAudioEncoding(convert.$encodeFormat),\n };\n }\n}\n\nfunction convertVideoToAudioOperation(_op: VideoToAudioOperation) {\n return { type: \"extractAudio\" as const };\n}\n\nfunction convertAudioToTextOperation(op: AudioToTextOperation) {\n if (\"$transcribe\" in op && op.$transcribe != null) {\n return {\n type: \"transcribe\" as const,\n language: op.$transcribe.$language,\n diarize: op.$transcribe.$diarize,\n outputFormat:\n op.$transcribe.$outputFormat != null\n ? convertTranscribeOutputFormat(op.$transcribe.$outputFormat)\n : undefined,\n performanceMode: op.$transcribe.$performanceMode,\n };\n } else {\n const waveform = (op as AudioToTextOperation & { $waveform: {} }).$waveform;\n return {\n type: \"waveform\" as const,\n peaksPerSecond: waveform.$peaksPerSecond,\n };\n }\n}\n\nfunction convertEmailToTextOperation(op: EmailToTextOperation) {\n return {\n type: \"getEmailBody\" as const,\n outputFormat: op.$getEmailBody.$outputFormat,\n };\n}\n\nfunction convertEmailToAttachmentOperation(op: EmailToAttachmentOperation) {\n return {\n type: \"getEmailAttachment\" as const,\n mimeType: op.$getEmailAttachment.$mimeType,\n attachmentIndex: op.$getEmailAttachment.$attachmentIndex,\n };\n}\n\nfunction convertSpreadsheetToTextOperation(op: SpreadsheetToTextOperation) {\n return {\n type: \"convertSheetToJson\" as const,\n sheetName: op.$convertSheetToJson.$sheetName,\n };\n}\n\nfunction convertVideoToArchiveOperation(op: VideoToArchiveOperation) {\n return {\n type: \"extractSceneFrames\" as const,\n encoding: { type: op.$extractSceneFrames.$encoding },\n sceneScore: op.$extractSceneFrames.$sceneScore,\n };\n}\n\nfunction convertVideoToTextOperation(op: VideoToTextOperation) {\n return {\n type: \"getTimestampsForSceneFrames\" as const,\n sceneScore: op.$getTimestampsForSceneFrames.$sceneScore,\n };\n}\n\nfunction convertImageToTextOperation(op: ImageToTextOperation) {\n if (\n \"$extractLayoutAwareContent\" in op &&\n op.$extractLayoutAwareContent != null\n ) {\n return {\n type: \"extractLayoutAwareContent\" as const,\n parameters: convertLayoutAwareExtractionParameters(\n op.$extractLayoutAwareContent.$parameters,\n ),\n };\n } else {\n const ocr = (op as ImageToTextOperation & { $ocr: {} }).$ocr;\n return {\n type: \"ocr\" as const,\n parameters: convertOcrParameters(ocr.$parameters),\n };\n }\n}\n\nfunction convertVideoToImageOperation(op: VideoToImageOperation) {\n if (\"$extractFirstFrame\" in op && op.$extractFirstFrame != null) {\n return {\n type: \"extractFirstFrame\" as const,\n height: op.$extractFirstFrame.$height,\n width: op.$extractFirstFrame.$width,\n };\n } else {\n const ext = (\n op as VideoToImageOperation & { $extractFramesAtTimestamps: {} }\n ).$extractFramesAtTimestamps;\n return {\n type: \"extractFramesAtTimestamps\" as const,\n height: ext.$height,\n width: ext.$width,\n timestamp: ext.$timestamp,\n };\n }\n}\n\nfunction convertImageToDocumentOperation(_op: ImageToDocumentOperation) {\n return { type: \"createPdf\" as const };\n}\n\nfunction convertDicomToImageOperation(op: DicomToImageOperation) {\n return {\n type: \"renderImageLayer\" as const,\n layerNumber: op.$renderImageLayer.$layerNumber,\n height: op.$renderImageLayer.$height,\n width: op.$renderImageLayer.$width,\n };\n}\n\nfunction convertDocumentToDocumentOperation(op: DocumentToDocumentOperation) {\n if (\"$slicePdfRange\" in op && op.$slicePdfRange != null) {\n return {\n type: \"slicePdfRange\" as const,\n startPageInclusive: op.$slicePdfRange.$startPageInclusive,\n endPageExclusive: op.$slicePdfRange.$endPageExclusive,\n strictlyEnforceEndPage: op.$slicePdfRange.$strictlyEnforceEndPage,\n };\n } else {\n return { type: \"convertDocument\" as const };\n }\n}\n\nfunction convertDocumentToImageOperation(op: DocumentToImageOperation) {\n if (\"$renderPage\" in op && op.$renderPage != null) {\n return {\n type: \"renderPage\" as const,\n pageNumber: op.$renderPage.$pageNumber,\n height: op.$renderPage.$height,\n width: op.$renderPage.$width,\n };\n } else {\n const bb = (\n op as DocumentToImageOperation & { $renderPageToFitBoundingBox: {} }\n ).$renderPageToFitBoundingBox;\n return {\n type: \"renderPageToFitBoundingBox\" as const,\n pageNumber: bb.$pageNumber,\n width: bb.$width,\n height: bb.$height,\n };\n }\n}\n\nfunction convertImageToEmbeddingOperation(op: ImageToEmbeddingOperation) {\n return {\n type: \"generateEmbedding\" as const,\n modelId: op.$generateEmbedding.$modelId,\n };\n}\n\nfunction convertDocumentToTextOperation(op: DocumentToTextOperation) {\n if (\"$extractAllText\" in op) {\n return { type: \"extractAllText\" as const };\n } else if (\"$extractTableOfContents\" in op) {\n return { type: \"extractTableOfContents\" as const };\n } else if (\"$getPdfPageDimensions\" in op) {\n return { type: \"getPdfPageDimensions\" as const };\n } else if (\"$extractFormFields\" in op) {\n return { type: \"extractFormFields\" as const };\n } else if (\n \"$extractUnstructuredTextFromPage\" in op &&\n op.$extractUnstructuredTextFromPage != null\n ) {\n return {\n type: \"extractUnstructuredTextFromPage\" as const,\n pageNumber: op.$extractUnstructuredTextFromPage.$pageNumber,\n };\n } else if (\n \"$extractTextFromPagesToArray\" in op &&\n op.$extractTextFromPagesToArray != null\n ) {\n return {\n type: \"extractTextFromPagesToArray\" as const,\n startPage: op.$extractTextFromPagesToArray.$startPage,\n endPage: op.$extractTextFromPagesToArray.$endPage,\n };\n } else if (\"$ocrOnPage\" in op && op.$ocrOnPage != null) {\n return {\n type: \"ocrOnPage\" as const,\n pageNumber: op.$ocrOnPage.$pageNumber,\n parameters: convertOcrParameters(op.$ocrOnPage.$parameters),\n };\n } else if (\"$ocrOnPages\" in op && op.$ocrOnPages != null) {\n return {\n type: \"ocrOnPages\" as const,\n pageNumber: op.$ocrOnPages.$pageNumber,\n parameters: convertOcrParameters(op.$ocrOnPages.$parameters),\n };\n } else if (\n \"$extractLayoutAwareContent\" in op &&\n op.$extractLayoutAwareContent != null\n ) {\n return {\n type: \"extractLayoutAwareContent\" as const,\n parameters: convertLayoutAwareExtractionParameters(\n op.$extractLayoutAwareContent.$parameters,\n ),\n };\n } else if (\n \"$extractLayoutAwareTextV2\" in op &&\n op.$extractLayoutAwareTextV2 != null\n ) {\n return {\n type: \"extractLayoutAwareTextV2\" as const,\n pageRange:\n op.$extractLayoutAwareTextV2.$pageRange != null\n ? convertPageRange(op.$extractLayoutAwareTextV2.$pageRange)\n : undefined,\n config: convertDocumentTextExtractionConfig(\n op.$extractLayoutAwareTextV2.$config,\n ),\n };\n } else if (\"$extractTextV2\" in op && op.$extractTextV2 != null) {\n return {\n type: \"extractTextV2\" as const,\n pageRange:\n op.$extractTextV2.$pageRange != null\n ? convertPageRange(op.$extractTextV2.$pageRange)\n : undefined,\n config: convertDocumentTextExtractionConfig(op.$extractTextV2.$config),\n };\n } else {\n const vlm = (op as DocumentToTextOperation & { $extractVlmText: {} })\n .$extractVlmText;\n return {\n type: \"extractVlmText\" as const,\n llmSpec: convertLlmSpec(vlm.$llmSpec),\n preprocessingConfiguration:\n vlm.$preprocessingConfiguration != null\n ? convertVlmPreprocessingConfig(vlm.$preprocessingConfiguration)\n : undefined,\n imageSpec:\n vlm.$imageSpec != null ? convertImageSpec(vlm.$imageSpec) : undefined,\n outputFormat: vlm.$outputFormat,\n pageRange:\n vlm.$pageRange != null ? convertPageRange(vlm.$pageRange) : undefined,\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkDA;AACA;;AAaA,OAAO,SAASA,uBAAuBA,CACrCC,cAAmC,EACnB;EAChB,IAAI,QAAQ,IAAIA,cAAc,IAAIA,cAAc,CAACC,MAAM,IAAI,IAAI,EAAE;IAC/D,MAAMC,CAAC,GAAGF,cAAc,CAACC,MAAM;IAC/B,OAAO;MACLE,IAAI,EAAE,OAAgB;MACtBC,QAAQ,EAAE;QAAED,IAAI,EAAED,CAAC,CAACG;MAAU,CAAC;MAC/BC,UAAU,EAAEJ,CAAC,CAACK,WAAW,CAACC,GAAG,CAACC,qBAAqB;IACrD,CAAC;EACH,CAAC,MAAM,IAAI,QAAQ,IAAIT,cAAc,IAAIA,cAAc,CAACU,MAAM,IAAI,IAAI,EAAE;IACtE,MAAMR,CAAC,GAAGF,cAAc,CAACU,MAAM;IAC/B,OAAO;MACLP,IAAI,EAAE,OAAgB;MACtBC,QAAQ,EAAE;QAAED,IAAI,EAAED,CAAC,CAACG;MAAU,CAAC;MAC/BM,SAAS,EAAEC,qBAAqB,CAACV,CAAC,CAACW,UAAU;IAC/C,CAAC;EACH,CAAC,MAAM,IAAI,QAAQ,IAAIb,cAAc,IAAIA,cAAc,CAACc,MAAM,IAAI,IAAI,EAAE;IACtE,OAAO;MACLX,IAAI,EAAE,OAAgB;MACtBQ,SAAS,EAAEI,qBAAqB,CAACf,cAAc,CAACc,MAAM,CAACD,UAAU;IACnE,CAAC;EACH,CAAC,MAAM,IACL,cAAc,IAAIb,cAAc,IAChCA,cAAc,CAACgB,YAAY,IAAI,IAAI,EACnC;IACA,OAAO;MACLb,IAAI,EAAE,aAAsB;MAC5BQ,SAAS,EAAEM,2BAA2B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GAAI5I,EAAE,CACZ6I,eAAe;IAClB,OAAO;MACLlQ,IAAI,EAAE,gBAAyB;MAC/BmQ,OAAO,EAAEhL,cAAc,CAAC8K,GAAG,CAACG,QAAQ,CAAC;MACrCC,0BAA0B,EACxBJ,GAAG,CAACK,2BAA2B,IAAI,IAAI,GACnCtK,6BAA6B,CAACiK,GAAG,CAACK,2BAA2B,CAAC,GAC9DnN,SAAS;MACfoN,SAAS,EACPN,GAAG,CAACO,UAAU,IAAI,IAAI,GAAG5J,gBAAgB,CAACqJ,GAAG,CAACO,UAAU,CAAC,GAAGrN,SAAS;MACvEiB,YAAY,EAAE6L,GAAG,CAAC5L,aAAa;MAC/BwL,SAAS,EACPI,GAAG,CAACH,UAAU,IAAI,IAAI,GAAG1M,gBAAgB,CAAC6M,GAAG,CAACH,UAAU,CAAC,GAAG3M;IAChE,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.61.0-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.61.0-main-34cb7e0f9aacae2172c7a172aaccdbd863c76bf4"}`;
|
|
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 chunkTLF57A6A_cjs = require('./chunk-TLF57A6A.cjs');
|
|
4
|
+
var chunkOF32UWWG_cjs = require('./chunk-OF32UWWG.cjs');
|
|
5
5
|
var chunkQ7QYW5NE_cjs = require('./chunk-Q7QYW5NE.cjs');
|
|
6
6
|
require('./chunk-Q7SFCCGT.cjs');
|
|
7
7
|
|
|
@@ -17,21 +17,21 @@ async function* applyStreamingQuery(client, query, params) {
|
|
|
17
17
|
if (client.flushEdits != null) {
|
|
18
18
|
await client.flushEdits();
|
|
19
19
|
}
|
|
20
|
-
const response = await streamingExecute(
|
|
20
|
+
const response = await streamingExecute(chunkOF32UWWG_cjs.addUserAgentAndRequestContextHeaders(chunkOF32UWWG_cjs.augmentRequestContext(client, (_) => ({
|
|
21
21
|
finalMethodCall: "applyStreamingQuery"
|
|
22
22
|
})), query), query.apiName, {
|
|
23
23
|
ontology: await client.ontologyRid,
|
|
24
|
-
parameters: params ? await
|
|
24
|
+
parameters: params ? await chunkTLF57A6A_cjs.remapQueryParams(params, client, qd.parameters) : {},
|
|
25
25
|
version: query.isFixedVersion ? query.version : void 0,
|
|
26
26
|
branch: client.branch
|
|
27
27
|
}, {
|
|
28
28
|
transactionId: client.transactionId,
|
|
29
29
|
preview: true
|
|
30
30
|
});
|
|
31
|
-
const definitions = await
|
|
31
|
+
const definitions = await chunkTLF57A6A_cjs.getRequiredDefinitions(qd.output, client);
|
|
32
32
|
for await (const event of response) {
|
|
33
33
|
if (event.type !== "data") continue;
|
|
34
|
-
const remapped = await
|
|
34
|
+
const remapped = await chunkTLF57A6A_cjs.remapQueryResponse(client, qd.output, event.value, definitions);
|
|
35
35
|
if (qd.output.type === "array" && Array.isArray(remapped)) {
|
|
36
36
|
for (const item of remapped) {
|
|
37
37
|
yield item;
|
|
@@ -43,5 +43,5 @@ async function* applyStreamingQuery(client, query, params) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
exports.applyStreamingQuery = applyStreamingQuery;
|
|
46
|
-
//# sourceMappingURL=applyStreamingQuery-
|
|
47
|
-
//# sourceMappingURL=applyStreamingQuery-
|
|
46
|
+
//# sourceMappingURL=applyStreamingQuery-XVCEQR5M.cjs.map
|
|
47
|
+
//# sourceMappingURL=applyStreamingQuery-XVCEQR5M.cjs.map
|
package/build/cjs/{applyStreamingQuery-YUORZ6RZ.cjs.map → applyStreamingQuery-XVCEQR5M.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.75.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentAndRequestContextHeaders","augmentRequestContext","remapQueryParams","getRequiredDefinitions","remapQueryResponse"],"mappings":";;;;;;;;AAgFA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,mBAAmB,CAAA;AA2B5F,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;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,MAAM,WAAA,GAAc,MAAMC,wCAAA,CAAuB,EAAA,CAAG,QAAQ,MAAM,CAAA;AAClE,EAAA,WAAA,MAAiB,SAAS,QAAA,EAAU;AAClC,IAAA,IAAI,KAAA,CAAM,SAAS,MAAA,EAAQ;AAC3B,IAAA,MAAM,QAAA,GAAW,MAAMC,oCAAA,CAAmB,MAAA,EAAQ,GAAG,MAAA,EAAQ,KAAA,CAAM,OAAO,WAAW,CAAA;AACrF,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-YUORZ6RZ.cjs","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _get = [0, \"/v2/functions/queries/{0}\", 2];\n/**\n * Gets a specific query type with the given API name. By default, this returns the highest semantic\n * version of the query, excluding pre-release versions. To resolve the most recently published version\n * instead, including pre-release versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/functions/queries/getByRid\", 2];\n/**\n * Gets a specific query type with the given RID. By default, this gets the latest version of the query.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRid\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/functions/queries/getByRidBatch\", 3];\n/**\n * Gets a list of query types by RID in bulk. By default, this gets the latest version of each query.\n *\n * Queries are filtered from the response if they don't exist or the requesting token lacks the required\n * permissions.\n *\n * The maximum batch size for this endpoint is 100.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\n}\nconst _execute = [1, \"/v2/functions/queries/{0}/execute\", 7];\n/**\n * Executes a Query and returns the result as a single JSON object. By default, this executes\n * the highest semantic version of the query, excluding pre-release versions. To resolve the\n * most recently published version instead, including pre-release versions, set\n * `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint executes global (non-ontology-scoped) query functions. For ontology-scoped\n * functions, use the equivalent endpoint under\n * `/v2/ontologies/{ontology}/queries/{queryApiName}/execute`. For streaming or incremental\n * result delivery, use `streamingExecute`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}\nconst _streamingExecute = [1, \"/v2/functions/queries/{0}/streamingExecute\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _streamingExecuteEvents = [1, \"/v2/functions/queries/{0}/streamingExecuteEvents\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecuteEvents\n */\nexport function streamingExecuteEvents($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecuteEvents, ...args);\n}\nconst _executeAsync = [1, \"/v2/functions/queries/{0}/executeAsync\", 7];\n/**\n * Submits a Query for asynchronous execution. Returns either an execution ID\n * for polling, or the complete result if execution finished immediately.\n *\n * Use the Execution resource's getResult endpoint to poll for the\n * result of a submitted execution.\n *\n * @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 { 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 const definitions = await getRequiredDefinitions(qd.output, client);\n for await (const event of response) {\n if (event.type !== \"data\") continue;\n const remapped = await remapQueryResponse(client, qd.output, event.value, definitions);\n if (qd.output.type === \"array\" && Array.isArray(remapped)) {\n for (const item of remapped) {\n yield item;\n }\n } else {\n yield remapped;\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.75.0/node_modules/@osdk/foundry.functions/build/esm/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentAndRequestContextHeaders","augmentRequestContext","remapQueryParams","getRequiredDefinitions","remapQueryResponse"],"mappings":";;;;;;;;AAgFA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,mBAAmB,CAAA;AA2B5F,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;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;AAC3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/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _get = [0, \"/v2/functions/queries/{0}\", 2];\n/**\n * Gets a specific query type with the given API name. By default, this returns the highest semantic\n * version of the query, excluding pre-release versions. To resolve the most recently published version\n * instead, including pre-release versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/functions/queries/getByRid\", 2];\n/**\n * Gets a specific query type with the given RID. By default, this gets the latest version of the query.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRid\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/functions/queries/getByRidBatch\", 3];\n/**\n * Gets a list of query types by RID in bulk. By default, this gets the latest version of each query.\n *\n * Queries are filtered from the response if they don't exist or the requesting token lacks the required\n * permissions.\n *\n * The maximum batch size for this endpoint is 100.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\n}\nconst _execute = [1, \"/v2/functions/queries/{0}/execute\", 7];\n/**\n * Executes a Query and returns the result as a single JSON object. By default, this executes\n * the highest semantic version of the query, excluding pre-release versions. To resolve the\n * most recently published version instead, including pre-release versions, set\n * `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint executes global (non-ontology-scoped) query functions. For ontology-scoped\n * functions, use the equivalent endpoint under\n * `/v2/ontologies/{ontology}/queries/{queryApiName}/execute`. For streaming or incremental\n * result delivery, use `streamingExecute`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}\nconst _streamingExecute = [1, \"/v2/functions/queries/{0}/streamingExecute\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _streamingExecuteEvents = [1, \"/v2/functions/queries/{0}/streamingExecuteEvents\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecuteEvents\n */\nexport function streamingExecuteEvents($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecuteEvents, ...args);\n}\nconst _executeAsync = [1, \"/v2/functions/queries/{0}/executeAsync\", 7];\n/**\n * Submits a Query for asynchronous execution. Returns either an execution ID\n * for polling, or the complete result if execution finished immediately.\n *\n * Use the Execution resource's getResult endpoint to poll for the\n * result of a submitted execution.\n *\n * @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 { 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 const definitions = await getRequiredDefinitions(qd.output, client);\n for await (const event of response) {\n if (event.type !== \"data\") continue;\n const remapped = await remapQueryResponse(client, qd.output, event.value, definitions);\n if (qd.output.type === \"array\" && Array.isArray(remapped)) {\n for (const item of remapped) {\n yield item;\n }\n } else {\n yield remapped;\n }\n }\n}"]}
|