@osdk/client 2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4 → 2.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +9 -7
  2. package/build/browser/internal/conversions/modernToLegacyWhereClause.js +21 -2
  3. package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  4. package/build/browser/util/UserAgent.js +2 -2
  5. package/build/browser/util/UserAgent.js.map +1 -1
  6. package/build/cjs/{applyStreamingQuery-GG6YRECI.cjs → applyStreamingQuery-OFE276IY.cjs} +11 -11
  7. package/build/cjs/{applyStreamingQuery-GG6YRECI.cjs.map → applyStreamingQuery-OFE276IY.cjs.map} +1 -1
  8. package/build/cjs/{chunk-NJFXSQ4X.cjs → chunk-B4UCZI2Z.cjs} +13 -9
  9. package/build/cjs/chunk-B4UCZI2Z.cjs.map +1 -0
  10. package/build/cjs/{chunk-XCQOINFF.cjs → chunk-FRZNF77P.cjs} +38 -116
  11. package/build/cjs/chunk-FRZNF77P.cjs.map +1 -0
  12. package/build/cjs/{chunk-I536YZL7.cjs → chunk-HL7TDBEU.cjs} +5 -5
  13. package/build/cjs/{chunk-I536YZL7.cjs.map → chunk-HL7TDBEU.cjs.map} +1 -1
  14. package/build/cjs/{chunk-JVTQVCST.cjs → chunk-JPO5C5QG.cjs} +18 -18
  15. package/build/cjs/{chunk-JVTQVCST.cjs.map → chunk-JPO5C5QG.cjs.map} +1 -1
  16. package/build/cjs/{chunk-F7VOYQZZ.cjs → chunk-PPEWTL53.cjs} +83 -83
  17. package/build/cjs/{chunk-F7VOYQZZ.cjs.map → chunk-PPEWTL53.cjs.map} +1 -1
  18. package/build/cjs/{chunk-6NHMELIG.cjs → chunk-US5WI5KS.cjs} +8 -8
  19. package/build/cjs/{chunk-6NHMELIG.cjs.map → chunk-US5WI5KS.cjs.map} +1 -1
  20. package/build/cjs/{chunk-JILZ2BLD.cjs → chunk-VK37CUQE.cjs} +98 -98
  21. package/build/cjs/chunk-VK37CUQE.cjs.map +1 -0
  22. package/build/cjs/index.cjs +13 -13
  23. package/build/cjs/public/experimental.cjs +11 -11
  24. package/build/cjs/public/internal.cjs +11 -11
  25. package/build/cjs/public/observable.cjs +7 -7
  26. package/build/cjs/public/unstable-do-not-use.cjs +18 -18
  27. package/build/cjs/{transformAndWaitInternal-MXF3R6YX.cjs → transformAndWaitInternal-J3XOTTQ2.cjs} +6 -6
  28. package/build/cjs/{transformAndWaitInternal-MXF3R6YX.cjs.map → transformAndWaitInternal-J3XOTTQ2.cjs.map} +1 -1
  29. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +21 -2
  30. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  31. package/build/esm/util/UserAgent.js +2 -2
  32. package/build/esm/util/UserAgent.js.map +1 -1
  33. package/package.json +14 -14
  34. package/build/cjs/chunk-JILZ2BLD.cjs.map +0 -1
  35. package/build/cjs/chunk-NJFXSQ4X.cjs.map +0 -1
  36. package/build/cjs/chunk-XCQOINFF.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,23 +1,25 @@
1
1
  # @osdk/client
2
2
 
3
- ## 2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4
3
+ ## 2.87.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
7
  - 093d27c: Add experimental support for sending events to agent sessions.
8
+ - ff00439: Adding support for phonetic search
9
+ - 3c3014d: Read sizeBytes from sizeBytesLong so basic and full media metadata report sizes above 2 GiB.
10
+ - e674a83: Share local list membership and row updates between list and object-set queries. Revalidate uncertain additions so queries do not remain loading.
8
11
  - 8300415: Add generated argument types for agent session creation.
9
12
  - 9c93e57: Export getClientBranch from @osdk/client/internal. Inherit the OSDK client's global branch in WorkshopModule and support an explicit branchRid in BaseWorkshopModule, including navigation back to main.
10
13
 
11
14
  ### Patch Changes
12
15
 
13
- - 3c3014d: Read sizeBytes from sizeBytesLong so basic and full media metadata report sizes above 2 GiB.
14
- - e674a83: Share local list membership and row updates between list and object-set queries. Revalidate uncertain additions so queries do not remain loading.
15
16
  - Updated dependencies [093d27c]
17
+ - Updated dependencies [ff00439]
16
18
  - Updated dependencies [8300415]
17
- - @osdk/api@2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4
18
- - @osdk/generator-converters@2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4
19
- - @osdk/shared.test@2.58.1-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4
20
- - @osdk/client.unstable@2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4
19
+ - @osdk/api@2.87.0
20
+ - @osdk/generator-converters@2.87.0
21
+ - @osdk/shared.test@2.59.0
22
+ - @osdk/client.unstable@2.87.0
21
23
 
22
24
  ## 2.86.0
23
25
 
@@ -162,14 +162,33 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
162
162
  return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);
163
163
  }
164
164
  if (firstKey === "$containsAllTerms" || firstKey === "$containsAnyTerm") {
165
+ const searchOptions = filter[firstKey];
166
+ !(typeof searchOptions === "string" || !(searchOptions.fuzzySearch === true && searchOptions.phoneticSearch === true)) ? process.env.NODE_ENV !== "production" ? invariant(false, "fuzzySearch and phoneticSearch cannot both be true.") : invariant(false) : void 0;
165
167
  return {
166
168
  type: firstKey.substring(1),
167
169
  ...(propertyIdentifier != null && {
168
170
  propertyIdentifier
169
171
  }),
170
172
  field,
171
- value: typeof filter[firstKey] === "string" ? filter[firstKey] : filter[firstKey].term,
172
- fuzzy: typeof filter[firstKey] === "string" ? false : filter[firstKey].fuzzySearch ?? false
173
+ value: typeof searchOptions === "string" ? searchOptions : searchOptions.term,
174
+ fuzzy: typeof searchOptions === "string" ? false : searchOptions.fuzzySearch ?? false,
175
+ ...(typeof searchOptions !== "string" && searchOptions.phoneticSearch === true && {
176
+ analyzerSelection: "PHONETIC_ANALYZER"
177
+ })
178
+ };
179
+ }
180
+ if (firstKey === "$startsWith" || firstKey === "$containsAllTermsInOrder") {
181
+ const searchOptions = filter[firstKey];
182
+ return {
183
+ type: firstKey.substring(1),
184
+ ...(propertyIdentifier != null && {
185
+ propertyIdentifier
186
+ }),
187
+ field,
188
+ value: typeof searchOptions === "string" ? searchOptions : searchOptions.term,
189
+ ...(typeof searchOptions !== "string" && searchOptions.phoneticSearch === true && {
190
+ analyzerSelection: "PHONETIC_ANALYZER"
191
+ })
173
192
  };
174
193
  }
175
194
  if (firstKey === "$matchesRegex") {
@@ -1 +1 @@
1
- {"version":3,"file":"modernToLegacyWhereClause.js","names":["invariant","fullyQualifyPropName","makeGeoFilterIntersects","makeGeoFilterWithin","toIntervalQueryRule","isAndClause","whereClause","$and","undefined","isOrClause","$or","isNotClause","$not","modernToLegacyWhereClause","objectOrInterface","rdpNames","parts","Object","entries","map","key","value","length","modernToLegacyWhereClauseInner","type","v","process","env","NODE_ENV","clause","handleWherePair","resolvePropertyIdentifier","fieldName","isTitleProperty","isPrimaryKeyProperty","isRdp","structFieldSelector","apiName","propertyApiName","filter","isSpecialProperty","has","propertyIdentifier","field","keysOfFilter","keys","hasDollarSign","some","startsWith","structFilter","structFieldApiName","firstKey","containsValue","containsKeys","isFilterObject","substring","term","fuzzy","fuzzySearch","rule"],"sources":["modernToLegacyWhereClause.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 AndWhereClause,\n NotWhereClause,\n ObjectOrInterfaceDefinition,\n OrWhereClause,\n PossibleWhereClauseFilters,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\n\nimport { fullyQualifyPropName } from \"./fullyQualifyPropName.js\";\nimport { makeGeoFilterIntersects } from \"./makeGeoFilterIntersects.js\";\nimport { makeGeoFilterWithin } from \"./makeGeoFilterWithin.js\";\nimport { toIntervalQueryRule } from \"./toIntervalQuery.js\";\n\ntype DropDollarSign<T extends `$${string}`> = T extends `$${infer U}`\n ? U\n : never;\n\nfunction isAndClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(whereClause: WhereClause<T, RDPs>): whereClause is AndWhereClause<T, RDPs> {\n return \"$and\" in whereClause && whereClause.$and !== undefined;\n}\n\nfunction isOrClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(whereClause: WhereClause<T, RDPs>): whereClause is OrWhereClause<T, RDPs> {\n return \"$or\" in whereClause && whereClause.$or !== undefined;\n}\n\nfunction isNotClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(whereClause: WhereClause<T, RDPs>): whereClause is NotWhereClause<T, RDPs> {\n return \"$not\" in whereClause && whereClause.$not !== undefined;\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause).map(([key, value]) => ({\n [key]: value,\n })) as WhereClause<T, RDPs>[];\n if (parts.length === 1) {\n return modernToLegacyWhereClauseInner(\n whereClause,\n objectOrInterface,\n rdpNames,\n );\n }\n return {\n type: \"and\",\n value: parts.map<SearchJsonQueryV2>((v) =>\n modernToLegacyWhereClauseInner(v, objectOrInterface, rdpNames),\n ),\n };\n}\n\n/** @internal */\nexport function modernToLegacyWhereClauseInner<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause);\n\n invariant(parts.length === 1, \"Invalid where clause provided.\");\n\n if (isAndClause(whereClause)) {\n return {\n type: \"and\",\n value: (whereClause.$and as WhereClause<T, RDPs>[]).map((clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isOrClause(whereClause)) {\n return {\n type: \"or\",\n value: (whereClause.$or as WhereClause<T, RDPs>[]).map((clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isNotClause(whereClause)) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(\n whereClause.$not as WhereClause<T, RDPs>,\n objectOrInterface,\n rdpNames,\n ),\n };\n }\n\n return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);\n}\n\nfunction resolvePropertyIdentifier(\n fieldName: string,\n objectOrInterface: ObjectOrInterfaceDefinition,\n isTitleProperty: boolean,\n isPrimaryKeyProperty: boolean,\n isRdp: boolean | undefined,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n): PropertyIdentifier | undefined {\n if (isTitleProperty) {\n return { type: \"titleProperty\" } as PropertyIdentifier;\n } else if (isPrimaryKeyProperty) {\n return { type: \"primaryKeyProperty\" } as PropertyIdentifier;\n } else if (isRdp) {\n return {\n type: \"property\",\n apiName: fieldName,\n };\n } else if (structFieldSelector != null) {\n return {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(\n structFieldSelector.propertyApiName,\n objectOrInterface,\n ),\n };\n }\n return undefined;\n}\n\nfunction handleWherePair(\n [fieldName, filter]: [string, any],\n objectOrInterface: ObjectOrInterfaceDefinition,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n invariant(\n filter != null,\n `Cannot filter on property \"${fieldName}\" with an undefined or null value. ` +\n `If the value might be undefined, check it before adding to the where clause.`,\n );\n\n const isTitleProperty = fieldName === \"$title\";\n const isPrimaryKeyProperty = fieldName === \"$primaryKey\";\n const isSpecialProperty = isTitleProperty || isPrimaryKeyProperty;\n\n const isRdp =\n !structFieldSelector && !isSpecialProperty && rdpNames?.has(fieldName);\n\n const propertyIdentifier = resolvePropertyIdentifier(\n fieldName,\n objectOrInterface,\n isTitleProperty,\n isPrimaryKeyProperty,\n isRdp,\n structFieldSelector,\n );\n\n const field =\n !isRdp && !isSpecialProperty && structFieldSelector == null\n ? fullyQualifyPropName(fieldName, objectOrInterface)\n : undefined;\n\n invariant(\n field == null ||\n (propertyIdentifier == null && (field != null || isRdp != null)),\n \"Encountered error constructing where clause: field and propertyIdentifier cannot both be defined\",\n );\n\n if (\n typeof filter === \"string\" ||\n typeof filter === \"number\" ||\n typeof filter === \"boolean\"\n ) {\n return {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter,\n };\n }\n\n const keysOfFilter = Object.keys(filter);\n\n // If any of the keys start with `$` then they must be the only one.\n // e.g. `where({ name: { $eq: \"foo\", $ne: \"bar\" } })` is invalid currently\n const hasDollarSign = keysOfFilter.some((key) => key.startsWith(\"$\"));\n invariant(\n !hasDollarSign || keysOfFilter.length === 1,\n \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\",\n );\n\n // Struct\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(\n Object.entries(filter)[0],\n objectOrInterface,\n {\n propertyApiName: fieldName,\n structFieldApiName,\n },\n rdpNames,\n );\n }\n\n const firstKey = keysOfFilter[0] as PossibleWhereClauseFilters;\n invariant(filter[firstKey] != null);\n\n if (firstKey === \"$contains\" && filter[firstKey] instanceof Object) {\n const containsValue = filter[firstKey];\n const containsKeys = Object.keys(containsValue);\n\n const isFilterObject = containsKeys.some((key) => key.startsWith(\"$\"));\n\n if (isFilterObject) {\n return handleWherePair(\n [fieldName, containsValue],\n objectOrInterface,\n structFieldSelector,\n rdpNames,\n );\n } else {\n const structFilter: [string, any][] = Object.entries(containsValue);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = structFilter[0][0];\n\n return handleWherePair(structFilter[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n });\n }\n }\n\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n },\n };\n }\n\n if (firstKey === \"$within\") {\n return makeGeoFilterWithin(filter[firstKey], propertyIdentifier, field);\n }\n if (firstKey === \"$intersects\") {\n return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);\n }\n\n if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value:\n typeof filter[firstKey] === \"string\"\n ? filter[firstKey]\n : filter[firstKey].term,\n fuzzy:\n typeof filter[firstKey] === \"string\"\n ? false\n : (filter[firstKey].fuzzySearch ?? false),\n };\n }\n\n if (firstKey === \"$matchesRegex\") {\n return {\n type: \"regex\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n };\n }\n\n if (firstKey === \"$interval\") {\n return {\n type: \"interval\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n rule: toIntervalQueryRule(filter[firstKey]),\n };\n }\n\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey] as any,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA,OAAOA,SAAS,MAAM,gBAAgB;AAEtC,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,uBAAuB,QAAQ,8BAA8B;AACtE,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,mBAAmB,QAAQ,sBAAsB;AAM1D,SAASC,WAAWA,CAGlBC,WAAiC,EAA0C;EAC3E,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACC,IAAI,KAAKC,SAAS;AAChE;AAEA,SAASC,UAAUA,CAGjBH,WAAiC,EAAyC;EAC1E,OAAO,KAAK,IAAIA,WAAW,IAAIA,WAAW,CAACI,GAAG,KAAKF,SAAS;AAC9D;AAEA,SAASG,WAAWA,CAGlBL,WAAiC,EAA0C;EAC3E,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACM,IAAI,KAAKJ,SAAS;AAChE;;AAEA;AACA,OAAO,SAASK,yBAAyBA,CAIvCP,WAAiC,EACjCQ,iBAAoB,EACpBC,QAAsB,EACH;EACnB,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACZ,WAAW,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,MAAM;IAC/D,CAACD,GAAG,GAAGC;EACT,CAAC,CAAC,CAA2B;EAC7B,IAAIL,KAAK,CAACM,MAAM,KAAK,CAAC,EAAE;IACtB,OAAOC,8BAA8B,CACnCjB,WAAW,EACXQ,iBAAiB,EACjBC,QACF,CAAC;EACH;EACA,OAAO;IACLS,IAAI,EAAE,KAAK;IACXH,KAAK,EAAEL,KAAK,CAACG,GAAG,CAAqBM,CAAC,IACpCF,8BAA8B,CAACE,CAAC,EAAEX,iBAAi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AI,IAAI;QAAEA;MAAmB,CAAC,CAAC;MACzDC,KAAK;MACLgB,IAAI,EAAEvD,mBAAmB,CAACmC,MAAM,CAACY,QAAQ,CAAC;IAC5C,CAAC;EACH;EAEA,OAAO;IACL3B,IAAI,EAAE2B,QAAQ,CAACI,SAAS,CAAC,CAAC,CAAoC;IAC9D,IAAIb,kBAAkB,IAAI,IAAI,IAAI;MAAEA;IAAmB,CAAC,CAAC;IACzDC,KAAK;IACLtB,KAAK,EAAEkB,MAAM,CAACY,QAAQ;EACxB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"modernToLegacyWhereClause.js","names":["invariant","fullyQualifyPropName","makeGeoFilterIntersects","makeGeoFilterWithin","toIntervalQueryRule","isAndClause","whereClause","$and","undefined","isOrClause","$or","isNotClause","$not","modernToLegacyWhereClause","objectOrInterface","rdpNames","parts","Object","entries","map","key","value","length","modernToLegacyWhereClauseInner","type","v","process","env","NODE_ENV","clause","handleWherePair","resolvePropertyIdentifier","fieldName","isTitleProperty","isPrimaryKeyProperty","isRdp","structFieldSelector","apiName","propertyApiName","filter","isSpecialProperty","has","propertyIdentifier","field","keysOfFilter","keys","hasDollarSign","some","startsWith","structFilter","structFieldApiName","firstKey","containsValue","containsKeys","isFilterObject","searchOptions","fuzzySearch","phoneticSearch","substring","term","fuzzy","analyzerSelection","rule"],"sources":["modernToLegacyWhereClause.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 AndWhereClause,\n NotWhereClause,\n ObjectOrInterfaceDefinition,\n OrWhereClause,\n PossibleWhereClauseFilters,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\n\nimport { fullyQualifyPropName } from \"./fullyQualifyPropName.js\";\nimport { makeGeoFilterIntersects } from \"./makeGeoFilterIntersects.js\";\nimport { makeGeoFilterWithin } from \"./makeGeoFilterWithin.js\";\nimport { toIntervalQueryRule } from \"./toIntervalQuery.js\";\n\ntype DropDollarSign<T extends `$${string}`> = T extends `$${infer U}`\n ? U\n : never;\n\nfunction isAndClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(whereClause: WhereClause<T, RDPs>): whereClause is AndWhereClause<T, RDPs> {\n return \"$and\" in whereClause && whereClause.$and !== undefined;\n}\n\nfunction isOrClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(whereClause: WhereClause<T, RDPs>): whereClause is OrWhereClause<T, RDPs> {\n return \"$or\" in whereClause && whereClause.$or !== undefined;\n}\n\nfunction isNotClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(whereClause: WhereClause<T, RDPs>): whereClause is NotWhereClause<T, RDPs> {\n return \"$not\" in whereClause && whereClause.$not !== undefined;\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause).map(([key, value]) => ({\n [key]: value,\n })) as WhereClause<T, RDPs>[];\n if (parts.length === 1) {\n return modernToLegacyWhereClauseInner(\n whereClause,\n objectOrInterface,\n rdpNames,\n );\n }\n return {\n type: \"and\",\n value: parts.map<SearchJsonQueryV2>((v) =>\n modernToLegacyWhereClauseInner(v, objectOrInterface, rdpNames),\n ),\n };\n}\n\n/** @internal */\nexport function modernToLegacyWhereClauseInner<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n whereClause: WhereClause<T, RDPs>,\n objectOrInterface: T,\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n const parts = Object.entries(whereClause);\n\n invariant(parts.length === 1, \"Invalid where clause provided.\");\n\n if (isAndClause(whereClause)) {\n return {\n type: \"and\",\n value: (whereClause.$and as WhereClause<T, RDPs>[]).map((clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isOrClause(whereClause)) {\n return {\n type: \"or\",\n value: (whereClause.$or as WhereClause<T, RDPs>[]).map((clause) =>\n modernToLegacyWhereClause(clause, objectOrInterface, rdpNames),\n ),\n };\n } else if (isNotClause(whereClause)) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(\n whereClause.$not as WhereClause<T, RDPs>,\n objectOrInterface,\n rdpNames,\n ),\n };\n }\n\n return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);\n}\n\nfunction resolvePropertyIdentifier(\n fieldName: string,\n objectOrInterface: ObjectOrInterfaceDefinition,\n isTitleProperty: boolean,\n isPrimaryKeyProperty: boolean,\n isRdp: boolean | undefined,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n): PropertyIdentifier | undefined {\n if (isTitleProperty) {\n return { type: \"titleProperty\" } as PropertyIdentifier;\n } else if (isPrimaryKeyProperty) {\n return { type: \"primaryKeyProperty\" } as PropertyIdentifier;\n } else if (isRdp) {\n return {\n type: \"property\",\n apiName: fieldName,\n };\n } else if (structFieldSelector != null) {\n return {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(\n structFieldSelector.propertyApiName,\n objectOrInterface,\n ),\n };\n }\n return undefined;\n}\n\nfunction handleWherePair(\n [fieldName, filter]: [string, any],\n objectOrInterface: ObjectOrInterfaceDefinition,\n structFieldSelector?: { propertyApiName: string; structFieldApiName: string },\n rdpNames?: Set<string>,\n): SearchJsonQueryV2 {\n invariant(\n filter != null,\n `Cannot filter on property \"${fieldName}\" with an undefined or null value. ` +\n `If the value might be undefined, check it before adding to the where clause.`,\n );\n\n const isTitleProperty = fieldName === \"$title\";\n const isPrimaryKeyProperty = fieldName === \"$primaryKey\";\n const isSpecialProperty = isTitleProperty || isPrimaryKeyProperty;\n\n const isRdp =\n !structFieldSelector && !isSpecialProperty && rdpNames?.has(fieldName);\n\n const propertyIdentifier = resolvePropertyIdentifier(\n fieldName,\n objectOrInterface,\n isTitleProperty,\n isPrimaryKeyProperty,\n isRdp,\n structFieldSelector,\n );\n\n const field =\n !isRdp && !isSpecialProperty && structFieldSelector == null\n ? fullyQualifyPropName(fieldName, objectOrInterface)\n : undefined;\n\n invariant(\n field == null ||\n (propertyIdentifier == null && (field != null || isRdp != null)),\n \"Encountered error constructing where clause: field and propertyIdentifier cannot both be defined\",\n );\n\n if (\n typeof filter === \"string\" ||\n typeof filter === \"number\" ||\n typeof filter === \"boolean\"\n ) {\n return {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter,\n };\n }\n\n const keysOfFilter = Object.keys(filter);\n\n // If any of the keys start with `$` then they must be the only one.\n // e.g. `where({ name: { $eq: \"foo\", $ne: \"bar\" } })` is invalid currently\n const hasDollarSign = keysOfFilter.some((key) => key.startsWith(\"$\"));\n invariant(\n !hasDollarSign || keysOfFilter.length === 1,\n \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\",\n );\n\n // Struct\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(\n Object.entries(filter)[0],\n objectOrInterface,\n {\n propertyApiName: fieldName,\n structFieldApiName,\n },\n rdpNames,\n );\n }\n\n const firstKey = keysOfFilter[0] as PossibleWhereClauseFilters;\n invariant(filter[firstKey] != null);\n\n if (firstKey === \"$contains\" && filter[firstKey] instanceof Object) {\n const containsValue = filter[firstKey];\n const containsKeys = Object.keys(containsValue);\n\n const isFilterObject = containsKeys.some((key) => key.startsWith(\"$\"));\n\n if (isFilterObject) {\n return handleWherePair(\n [fieldName, containsValue],\n objectOrInterface,\n structFieldSelector,\n rdpNames,\n );\n } else {\n const structFilter: [string, any][] = Object.entries(containsValue);\n invariant(\n structFilter.length === 1,\n \"Cannot filter on more than one struct field in the same clause, need to use an and clause\",\n );\n const structFieldApiName = structFilter[0][0];\n\n return handleWherePair(structFilter[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName,\n });\n }\n }\n\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n },\n };\n }\n\n if (firstKey === \"$within\") {\n return makeGeoFilterWithin(filter[firstKey], propertyIdentifier, field);\n }\n if (firstKey === \"$intersects\") {\n return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);\n }\n\n if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n const searchOptions = filter[firstKey];\n invariant(\n typeof searchOptions === \"string\" ||\n !(\n searchOptions.fuzzySearch === true &&\n searchOptions.phoneticSearch === true\n ),\n \"fuzzySearch and phoneticSearch cannot both be true.\",\n );\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value:\n typeof searchOptions === \"string\" ? searchOptions : searchOptions.term,\n fuzzy:\n typeof searchOptions === \"string\"\n ? false\n : (searchOptions.fuzzySearch ?? false),\n ...(typeof searchOptions !== \"string\" &&\n searchOptions.phoneticSearch === true && {\n analyzerSelection: \"PHONETIC_ANALYZER\" as const,\n }),\n };\n }\n\n if (firstKey === \"$startsWith\" || firstKey === \"$containsAllTermsInOrder\") {\n const searchOptions = filter[firstKey];\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value:\n typeof searchOptions === \"string\" ? searchOptions : searchOptions.term,\n ...(typeof searchOptions !== \"string\" &&\n searchOptions.phoneticSearch === true && {\n analyzerSelection: \"PHONETIC_ANALYZER\" as const,\n }),\n };\n }\n\n if (firstKey === \"$matchesRegex\") {\n return {\n type: \"regex\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey],\n };\n }\n\n if (firstKey === \"$interval\") {\n return {\n type: \"interval\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n rule: toIntervalQueryRule(filter[firstKey]),\n };\n }\n\n return {\n type: firstKey.substring(1) as DropDollarSign<typeof firstKey>,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: filter[firstKey] as any,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA,OAAOA,SAAS,MAAM,gBAAgB;AAEtC,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,uBAAuB,QAAQ,8BAA8B;AACtE,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,mBAAmB,QAAQ,sBAAsB;AAM1D,SAASC,WAAWA,CAGlBC,WAAiC,EAA0C;EAC3E,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACC,IAAI,KAAKC,SAAS;AAChE;AAEA,SAASC,UAAUA,CAGjBH,WAAiC,EAAyC;EAC1E,OAAO,KAAK,IAAIA,WAAW,IAAIA,WAAW,CAACI,GAAG,KAAKF,SAAS;AAC9D;AAEA,SAASG,WAAWA,CAGlBL,WAAiC,EAA0C;EAC3E,OAAO,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACM,IAAI,KAAKJ,SAAS;AAChE;;A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B,IAAI,EAAE,UAAU;MAChB,IAAIkB,kBAAkB,IAAI,IAAI,IAAI;QAAEA;MAAmB,CAAC,CAAC;MACzDC,KAAK;MACLmB,IAAI,EAAE1D,mBAAmB,CAACmC,MAAM,CAACY,QAAQ,CAAC;IAC5C,CAAC;EACH;EAEA,OAAO;IACL3B,IAAI,EAAE2B,QAAQ,CAACO,SAAS,CAAC,CAAC,CAAoC;IAC9D,IAAIhB,kBAAkB,IAAI,IAAI,IAAI;MAAEA;IAAmB,CAAC,CAAC;IACzDC,KAAK;IACLtB,KAAK,EAAEkB,MAAM,CAACY,QAAQ;EACxB,CAAC;AACH","ignoreList":[]}
@@ -14,6 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const USER_AGENT = `osdk-client/${"2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4"}`;
18
- export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4"}`;
17
+ export const USER_AGENT = `osdk-client/${"2.87.0"}`;
18
+ export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.87.0"}`;
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,uEAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GAAG,kFAAuD","ignoreList":[]}
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,yBAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GAAG,oCAAuD","ignoreList":[]}
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunkJVTQVCST_cjs = require('./chunk-JVTQVCST.cjs');
4
- var chunkXCQOINFF_cjs = require('./chunk-XCQOINFF.cjs');
5
- var chunkNJFXSQ4X_cjs = require('./chunk-NJFXSQ4X.cjs');
3
+ var chunkJPO5C5QG_cjs = require('./chunk-JPO5C5QG.cjs');
4
+ var chunkFRZNF77P_cjs = require('./chunk-FRZNF77P.cjs');
5
+ var chunkB4UCZI2Z_cjs = require('./chunk-B4UCZI2Z.cjs');
6
6
  require('./chunk-Q7SFCCGT.cjs');
7
7
 
8
- // ../../node_modules/.pnpm/@osdk+foundry.functions@2.83.0/node_modules/@osdk/foundry.functions/build/esm/v2/public/Query.js
8
+ // ../../node_modules/.pnpm/@osdk+foundry.functions@2.87.0/node_modules/@osdk/foundry.functions/build/esm/v2/public/Query.js
9
9
  var _streamingExecute = [1, "/v2/functions/queries/{0}/streamingExecute", 7, , "text/event-stream"];
10
10
  function streamingExecute($ctx, ...args) {
11
- return chunkNJFXSQ4X_cjs.foundryPlatformFetch($ctx, _streamingExecute, ...args);
11
+ return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _streamingExecute, ...args);
12
12
  }
13
13
 
14
14
  // src/queries/applyStreamingQuery.ts
@@ -17,19 +17,19 @@ async function* applyStreamingQuery(client, query, params) {
17
17
  if (client.flushEdits != null) {
18
18
  await client.flushEdits();
19
19
  }
20
- const response = await streamingExecute(chunkXCQOINFF_cjs.addUserAgentHeader(client, query), query.apiName, {
20
+ const response = await streamingExecute(chunkFRZNF77P_cjs.addUserAgentHeader(client, query), query.apiName, {
21
21
  ontology: await client.ontologyRid,
22
- parameters: params ? await chunkJVTQVCST_cjs.remapQueryParams(params, client, qd.parameters) : {},
22
+ parameters: params ? await chunkJPO5C5QG_cjs.remapQueryParams(params, client, qd.parameters) : {},
23
23
  version: query.isFixedVersion ? query.version : void 0,
24
24
  branch: client.branch
25
25
  }, {
26
26
  transactionId: client.transactionId,
27
27
  preview: true
28
28
  });
29
- const definitions = await chunkJVTQVCST_cjs.getRequiredDefinitions(qd.output, client);
29
+ const definitions = await chunkJPO5C5QG_cjs.getRequiredDefinitions(qd.output, client);
30
30
  for await (const event of response) {
31
31
  if (event.type !== "data") continue;
32
- const remapped = await chunkJVTQVCST_cjs.remapQueryResponse(client, qd.output, event.value, definitions);
32
+ const remapped = await chunkJPO5C5QG_cjs.remapQueryResponse(client, qd.output, event.value, definitions);
33
33
  if (qd.output.type === "array" && Array.isArray(remapped)) {
34
34
  for (const item of remapped) {
35
35
  yield item;
@@ -41,5 +41,5 @@ async function* applyStreamingQuery(client, query, params) {
41
41
  }
42
42
 
43
43
  exports.applyStreamingQuery = applyStreamingQuery;
44
- //# sourceMappingURL=applyStreamingQuery-GG6YRECI.cjs.map
45
- //# sourceMappingURL=applyStreamingQuery-GG6YRECI.cjs.map
44
+ //# sourceMappingURL=applyStreamingQuery-OFE276IY.cjs.map
45
+ //# sourceMappingURL=applyStreamingQuery-OFE276IY.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.83.0/node_modules/@osdk/foundry.functions/build/esm/v2/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentHeader","remapQueryParams","getRequiredDefinitions","remapQueryResponse"],"mappings":";;;;;;;;AAgFA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,mBAAmB,CAAA;AA2B5F,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;AC1FA,gBAAuB,mBAAA,CAAoB,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ;AAChE,EAAA,MAAM,EAAA,GAAK,MAAM,MAAA,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,QAAA,GAAW,MAAgB,gBAAA,CAAiBC,oCAAA,CAAmB,QAAQ,KAAK,CAAA,EAAG,MAAM,OAAA,EAAS;AAAA,IAClG,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-GG6YRECI.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 { addUserAgentHeader } from \"../util/addUserAgentHeader.js\";\nimport { getRequiredDefinitions, remapQueryParams, remapQueryResponse } from \"./applyQuery.js\";\nexport async function* applyStreamingQuery(client, query, params) {\n const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Functions.streamingExecute(addUserAgentHeader(client, query), query.apiName, {\n ontology: await client.ontologyRid,\n parameters: params ? await remapQueryParams(params, client, qd.parameters) : {},\n version: query.isFixedVersion ? query.version : undefined,\n branch: client.branch\n }, {\n transactionId: client.transactionId,\n preview: true\n });\n const definitions = await getRequiredDefinitions(qd.output, client);\n for await (const event of response) {\n if (event.type !== \"data\") continue;\n const remapped = await remapQueryResponse(client, qd.output, event.value, definitions);\n if (qd.output.type === \"array\" && Array.isArray(remapped)) {\n for (const item of remapped) {\n yield item;\n }\n } else {\n yield remapped;\n }\n }\n}"]}
1
+ {"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.functions@2.87.0/node_modules/@osdk/foundry.functions/build/esm/v2/public/Query.js","../../src/queries/applyStreamingQuery.ts"],"names":["foundryPlatformFetch","addUserAgentHeader","remapQueryParams","getRequiredDefinitions","remapQueryResponse"],"mappings":";;;;;;;;AAgFA,IAAM,oBAAoB,CAAC,CAAA,EAAG,4CAAA,EAA8C,CAAA,IAAI,mBAAmB,CAAA;AA2B5F,SAAS,gBAAA,CAAiB,SAAS,IAAA,EAAM;AAC9C,EAAA,OAAOA,sCAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,GAAG,IAAI,CAAA;AAC/D;;;AC1FA,gBAAuB,mBAAA,CAAoB,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ;AAChE,EAAA,MAAM,EAAA,GAAK,MAAM,MAAA,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,QAAA,GAAW,MAAgB,gBAAA,CAAiBC,oCAAA,CAAmB,QAAQ,KAAK,CAAA,EAAG,MAAM,OAAA,EAAS;AAAA,IAClG,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-OFE276IY.cjs","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _get = [0, \"/v2/functions/queries/{0}\", 2];\n/**\n * Gets a specific query type with the given API name. By default, this returns the highest semantic\n * version of the query, excluding pre-release versions. To resolve the most recently published version\n * instead, including pre-release versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/{queryApiName}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getByRid = [0, \"/v2/functions/queries/getByRid\", 2];\n/**\n * Gets a specific query type with the given RID. By default, this gets the latest version of the query.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRid\n */\nexport function getByRid($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRid, ...args);\n}\nconst _getByRidBatch = [1, \"/v2/functions/queries/getByRidBatch\", 3];\n/**\n * Gets a list of query types by RID in bulk. By default, this gets the latest version of each query.\n *\n * Queries are filtered from the response if they don't exist or the requesting token lacks the required\n * permissions.\n *\n * The maximum batch size for this endpoint is 100.\n *\n * @beta\n *\n * Required Scopes: [api:functions-read]\n * URL: /v2/functions/queries/getByRidBatch\n */\nexport function getByRidBatch($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getByRidBatch, ...args);\n}\nconst _execute = [1, \"/v2/functions/queries/{0}/execute\", 7];\n/**\n * Executes a Query and returns the result as a single JSON object. By default, this executes\n * the highest semantic version of the query, excluding pre-release versions. To resolve the\n * most recently published version instead, including pre-release versions, set\n * `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint executes global (non-ontology-scoped) query functions. For ontology-scoped\n * functions, use the equivalent endpoint under\n * `/v2/ontologies/{ontology}/queries/{queryApiName}/execute`. For streaming or incremental\n * result delivery, use `streamingExecute`.\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/execute\n */\nexport function execute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _execute, ...args);\n}\nconst _streamingExecute = [1, \"/v2/functions/queries/{0}/streamingExecute\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @beta\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecute\n */\nexport function streamingExecute($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecute, ...args);\n}\nconst _streamingExecuteEvents = [1, \"/v2/functions/queries/{0}/streamingExecuteEvents\", 7,, \"text/event-stream\"];\n/**\n * Executes a Query and returns results as a Server-Sent Events (`text/event-stream`) stream.\n * By default, this executes the highest semantic version of the query, excluding pre-release\n * versions. To resolve the most recently published version instead, including pre-release\n * versions, set `latestVersionResolution` to `PUBLISH_TIME`.\n *\n * This endpoint supports all Query functions. Each SSE event's `data` field is a JSON-encoded\n * `StreamingExecuteQueryResponse` – either a data batch (`type: data`) carrying one or more\n * result values, or an error (`type: error`) emitted before stream termination if execution\n * fails. Non-streaming functions emit a single data event containing the entire result;\n * streaming functions emit a data event per batch as results become available.\n *\n * Per the Server-Sent Events specification, each event is terminated by a blank line:\n *\n * ```\n * data: {\"type\":\"data\",\"value\":[{\"productId\":\"SKU-001\",\"price\":29.99}]}\n *\n * data: {\"type\":\"error\",\"errorCode\":\"INVALID_ARGUMENT\",\"errorName\":\"QueryRuntimeError\",\"errorInstanceId\":\"3f8a9c7b-2e4d-4a1f-9b8c-7d6e5f4a3b2c\",\"errorDescription\":\"Division by zero\",\"parameters\":{}}\n *\n * ```\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/streamingExecuteEvents\n */\nexport function streamingExecuteEvents($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _streamingExecuteEvents, ...args);\n}\nconst _executeAsync = [1, \"/v2/functions/queries/{0}/executeAsync\", 7];\n/**\n * Submits a Query for asynchronous execution. Returns either an execution ID\n * for polling, or the complete result if execution finished immediately.\n *\n * Use the Execution resource's getResult endpoint to poll for the\n * result of a submitted execution.\n *\n * Supports maps represented as arrays of key/value entries, including nested maps.\n *\n * @alpha\n *\n * Required Scopes: [api:functions-execute]\n * URL: /v2/functions/queries/{queryApiName}/executeAsync\n */\nexport function executeAsync($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _executeAsync, ...args);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Functions from \"@osdk/foundry.functions/Query\";\nimport { addUserAgentHeader } from \"../util/addUserAgentHeader.js\";\nimport { getRequiredDefinitions, remapQueryParams, remapQueryResponse } from \"./applyQuery.js\";\nexport async function* applyStreamingQuery(client, query, params) {\n const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : undefined);\n if (client.flushEdits != null) {\n await client.flushEdits();\n }\n const response = await Functions.streamingExecute(addUserAgentHeader(client, query), query.apiName, {\n ontology: await client.ontologyRid,\n parameters: params ? await remapQueryParams(params, client, qd.parameters) : {},\n version: query.isFixedVersion ? query.version : undefined,\n branch: client.branch\n }, {\n transactionId: client.transactionId,\n preview: true\n });\n const definitions = await getRequiredDefinitions(qd.output, client);\n for await (const event of response) {\n if (event.type !== \"data\") continue;\n const remapped = await remapQueryResponse(client, qd.output, event.value, definitions);\n if (qd.output.type === \"array\" && Array.isArray(remapped)) {\n for (const item of remapped) {\n yield item;\n }\n } else {\n yield remapped;\n }\n }\n}"]}
@@ -3,7 +3,7 @@
3
3
  var chunkQ7SFCCGT_cjs = require('./chunk-Q7SFCCGT.cjs');
4
4
  var shared_net_errors = require('@osdk/shared.net.errors');
5
5
 
6
- // ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.83.0/node_modules/@osdk/foundry.mediasets/build/esm/v2/public/MediaSet.js
6
+ // ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.87.0/node_modules/@osdk/foundry.mediasets/build/esm/v2/public/MediaSet.js
7
7
  var MediaSet_exports = {};
8
8
  chunkQ7SFCCGT_cjs.__export(MediaSet_exports, {
9
9
  abort: () => abort,
@@ -23,6 +23,7 @@ chunkQ7SFCCGT_cjs.__export(MediaSet_exports, {
23
23
  register: () => register,
24
24
  retrieve: () => retrieve,
25
25
  tile: () => tile,
26
+ tileJson: () => tileJson,
26
27
  transform: () => transform,
27
28
  upload: () => upload,
28
29
  uploadMedia: () => uploadMedia
@@ -243,7 +244,7 @@ var EventSourceParserStream = class extends TransformStream {
243
244
  }
244
245
  };
245
246
 
246
- // ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.8.0/node_modules/@osdk/shared.net.platformapi/build/esm/sse.js
247
+ // ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.9.0/node_modules/@osdk/shared.net.platformapi/build/esm/sse.js
247
248
  async function* sseStream(response) {
248
249
  if (!response.body) {
249
250
  throw new shared_net_errors.UnknownError("Expected a text/event-stream body, but the response had none", "UNKNOWN", void 0, response.status);
@@ -272,7 +273,7 @@ function truncate(data) {
272
273
  return data.length > 512 ? `${data.slice(0, 512)}\u2026` : data;
273
274
  }
274
275
 
275
- // ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.8.0/node_modules/@osdk/shared.net.platformapi/build/esm/foundryPlatformFetch.js
276
+ // ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.9.0/node_modules/@osdk/shared.net.platformapi/build/esm/foundryPlatformFetch.js
276
277
  async function foundryPlatformFetch(client, [httpMethodNum, origPath, flags, contentType, responseContentType], ...args) {
277
278
  const path = origPath.replace(/\{([^}]+)\}/g, () => encodeURIComponent(args.shift()));
278
279
  const body = flags & 1 ? args.shift() : void 0;
@@ -296,7 +297,8 @@ async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, h
296
297
  }
297
298
  }
298
299
  const headersInit = new Headers();
299
- headersInit.set("Content-Type", requestMediaType ?? "application/json");
300
+ const resolvedRequestMediaType = requestMediaType === "*/*" && data instanceof globalThis.Blob ? data.type || "application/octet-stream" : requestMediaType ?? "application/json";
301
+ headersInit.set("Content-Type", resolvedRequestMediaType);
300
302
  headersInit.set("Accept", responseMediaType ?? "application/json");
301
303
  Object.entries(headers || {}).forEach(([key, value]) => {
302
304
  if (key === "Content-Type" && typeof value === "string") {
@@ -340,7 +342,7 @@ function parseUrl(baseUrl, endpointPath) {
340
342
  return new URL(`api${endpointPath}`, baseUrl);
341
343
  }
342
344
 
343
- // ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.83.0/node_modules/@osdk/foundry.mediasets/build/esm/v2/public/MediaSet.js
345
+ // ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.87.0/node_modules/@osdk/foundry.mediasets/build/esm/v2/public/MediaSet.js
344
346
  var _abort = [1, "/v2/mediasets/{0}/transactions/{1}/abort", 2];
345
347
  function abort($ctx, ...args) {
346
348
  return foundryPlatformFetch($ctx, _abort, ...args);
@@ -381,6 +383,10 @@ var _tile = [0, "/v2/mediasets/{0}/items/{1}/tiles/{2}/{3}/{4}", 6, , "*/*"];
381
383
  function tile($ctx, ...args) {
382
384
  return foundryPlatformFetch($ctx, _tile, ...args);
383
385
  }
386
+ var _tileJson = [0, "/v2/mediasets/{0}/items/{1}/tiles.json", 6, , "*/*"];
387
+ function tileJson($ctx, ...args) {
388
+ return foundryPlatformFetch($ctx, _tileJson, ...args);
389
+ }
384
390
  var _get = [0, "/v2/mediasets/{0}", 2];
385
391
  function get($ctx, ...args) {
386
392
  return foundryPlatformFetch($ctx, _get, ...args);
@@ -422,10 +428,8 @@ function uploadMedia($ctx, ...args) {
422
428
  return foundryPlatformFetch($ctx, _uploadMedia, ...args);
423
429
  }
424
430
 
425
- exports.EventSourceParserStream = EventSourceParserStream;
426
431
  exports.MediaSet_exports = MediaSet_exports;
427
432
  exports.foundryPlatformFetch = foundryPlatformFetch;
428
433
  exports.symbolClientContext = symbolClientContext;
429
- exports.symbolClientContext2 = symbolClientContext2;
430
- //# sourceMappingURL=chunk-NJFXSQ4X.cjs.map
431
- //# sourceMappingURL=chunk-NJFXSQ4X.cjs.map
434
+ //# sourceMappingURL=chunk-B4UCZI2Z.cjs.map
435
+ //# sourceMappingURL=chunk-B4UCZI2Z.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../node_modules/.pnpm/@osdk+foundry.mediasets@2.87.0/node_modules/@osdk/foundry.mediasets/build/esm/v2/public/MediaSet.js","../../../../node_modules/.pnpm/@osdk+shared.client@1.0.1/node_modules/@osdk/shared.client/index.js","../../../../node_modules/.pnpm/@osdk+shared.client2@1.0.0/node_modules/@osdk/shared.client2/index.js","../../../../node_modules/.pnpm/eventsource-parser@3.1.1/node_modules/eventsource-parser/dist/index.js","../../../../node_modules/.pnpm/eventsource-parser@3.1.1/node_modules/eventsource-parser/dist/stream.js","../../../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.9.0/node_modules/@osdk/shared.net.platformapi/build/esm/sse.js","../../../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.9.0/node_modules/@osdk/shared.net.platformapi/build/esm/foundryPlatformFetch.js"],"names":["__export","symbolClientContext","UnknownError","PalantirApiError"],"mappings":";;;;;;AAAA,IAAA,gBAAA,GAAA;AAAAA,0BAAA,CAAA,gBAAA,EAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,GAAA,EAAA,MAAA,GAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,WAAA,EAAA,MAAA;AAAA,CAAA,CAAA;;;ACg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,CAAsB,IAAA,EAAM,SAAA,EAAW,GAAG,IAAI,CAAA;AACvD;AACA,IAAM,YAAY,CAAC,CAAA,EAAG,kEAAA,EAAoE,CAAA,IAAI,KAAK,CAAA;AAW5F,SAAS,QAAA,CAAS,SAAS,IAAA,EAAM;AACtC,EAAA,OAAO,oBAAA,CAAsB,IAAA,EAAM,SAAA,EAAW,GAAG,IAAI,CAAA;AACvD;AACA,IAAM,UAAA,GAAa,CAAC,CAAA,EAAG,uCAAA,EAAyC,CAAC,CAAA;AAa1D,SAAS,SAAA,CAAU,SAAS,IAAA,EAAM;AACvC,EAAA,OAAO,oBAAA,CAAsB,IAAA,EAAM,UAAA,EAAY,GAAG,IAAI,CAAA;AACxD;AACA,IAAM,YAAA,GAAe,CAAC,CAAA,EAAG,4BAAA,EAA8B,GAAG,KAAK,CAAA;AAcxD,SAAS,WAAA,CAAY,SAAS,IAAA,EAAM;AACzC,EAAA,OAAO,oBAAA,CAAsB,IAAA,EAAM,YAAA,EAAc,GAAG,IAAI,CAAA;AAC1D","file":"chunk-B4UCZI2Z.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 _abort = [1, \"/v2/mediasets/{0}/transactions/{1}/abort\", 2];\n/**\n * Aborts an open transaction. Items uploaded to the media set during this transaction will be deleted.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/abort\n */\nexport function abort($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _abort, ...args);\n}\nconst _calculate = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/calculate\", 6];\n/**\n * Starts calculation of a thumbnail for a given image.\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/calculate\n */\nexport function calculate($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _calculate, ...args);\n}\nconst _clear = [3, \"/v2/mediasets/{0}/items/clearAtPath\", 2];\n/**\n * Clears (soft-deletes) the media item at the specified path within a media set, making it and all older\n * media items at that path un-retrievable.\n *\n * A branch name, branch RID, or view RID may optionally be specified. If none is specified,\n * the item will be cleared from the default branch. If more than one is specified, an error is thrown.\n *\n * For transactional media sets, a transaction ID must be provided. The deletion will not be\n * visible until the transaction is committed.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/items/clearAtPath\n */\nexport function clear($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _clear, ...args);\n}\nconst _commit = [1, \"/v2/mediasets/{0}/transactions/{1}/commit\", 2];\n/**\n * Commits an open transaction. On success, items uploaded to the media set during this transaction will become available.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/commit\n */\nexport function commit($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _commit, ...args);\n}\nconst _create = [1, \"/v2/mediasets/{0}/transactions\", 2];\n/**\n * Creates a new transaction. Items uploaded to the media set while this transaction is open will not be reflected until the transaction is committed.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions\n */\nexport function create($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _create, ...args);\n}\nconst _info = [0, \"/v2/mediasets/{0}/items/{1}\", 4];\n/**\n * Gets information about the media item.\n *\n * @public\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}\n */\nexport function info($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _info, ...args);\n}\nconst _metadata = [0, \"/v2/mediasets/{0}/items/{1}/metadata\", 4];\n/**\n * Gets detailed metadata about the media item, including type-specific information\n * such as dimensions for images, duration for audio/video, page count for documents, etc.\n *\n * @public\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/metadata\n */\nexport function metadata($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _metadata, ...args);\n}\nconst _reference = [0, \"/v2/mediasets/{0}/items/{1}/reference\", 6];\n/**\n * Gets the [media reference](https://www.palantir.com/docs/foundry/data-integration/media-sets/#media-references) for this media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/reference\n */\nexport function reference($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _reference, ...args);\n}\nconst _getRidByPath = [0, \"/v2/mediasets/{0}/items/getRidByPath\", 2];\n/**\n * Returns the media item RID for the media item with the specified path.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/getRidByPath\n */\nexport function getRidByPath($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getRidByPath, ...args);\n}\nconst _tile = [0, \"/v2/mediasets/{0}/items/{1}/tiles/{2}/{3}/{4}\", 6,, \"*/*\"];\n/**\n * Gets a PNG map tile for a media item. Only PNG tiles are currently supported.\n * Returns `204 No Content` for a blank tile.\n * Returns `400 Bad Request` when the tile path or coordinates are invalid or the tile transformation is unavailable.\n * Returns `404 Not Found` when the requested media set or media item does not exist.\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/tiles/{z}/{x}/{y}\n */\nexport function tile($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _tile, ...args);\n}\nconst _tileJson = [0, \"/v2/mediasets/{0}/items/{1}/tiles.json\", 6,, \"*/*\"];\n/**\n * Gets a TileJSON 3.0.0 document describing the media item's tiles.\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/tiles.json\n */\nexport function tileJson($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _tileJson, ...args);\n}\nconst _get = [0, \"/v2/mediasets/{0}\", 2];\n/**\n * Gets information about the media set.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}\n */\nexport function get($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _get, ...args);\n}\nconst _getResult = [0, \"/v2/mediasets/{0}/items/{1}/transformationJobs/{2}/result\", 6,, \"*/*\"];\n/**\n * Gets the result of a completed transformation job. Returns the transformed media content as binary data.\n * This endpoint will return an error if the transformation job has not completed successfully.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transformationJobs/{transformationJobId}/result\n */\nexport function getResult($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getResult, ...args);\n}\nconst _getStatus = [0, \"/v2/mediasets/{0}/items/{1}/transformationJobs/{2}\", 6];\n/**\n * Gets the status of a transformation job.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transformationJobs/{transformationJobId}\n */\nexport function getStatus($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getStatus, ...args);\n}\nconst _upload = [1, \"/v2/mediasets/{0}/items\", 3, \"*/*\"];\n/**\n * Uploads a media item to an existing media set.\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * A branch name, or branch rid, or view rid may optionally be specified. If none is specified, the item will be uploaded to the default branch. If more than one is specified, an error is thrown.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/items\n */\nexport function upload($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _upload, ...args);\n}\nconst _read = [0, \"/v2/mediasets/{0}/items/{1}/content\", 4,, \"*/*\"];\n/**\n * Gets the content of a media item.\n *\n * @public\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/content\n */\nexport function read($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _read, ...args);\n}\nconst _readOriginal = [0, \"/v2/mediasets/{0}/items/{1}/original\", 4,, \"*/*\"];\n/**\n * Gets the content of an original file uploaded to the media item, even if it was transformed on upload due to being an additional input format.\n *\n * @public\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/original\n */\nexport function readOriginal($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _readOriginal, ...args);\n}\nconst _register = [1, \"/v2/mediasets/{0}/items/register\", 3];\n/**\n * Registers a media item that currently resides in a federated media store. Registration will validate the item\n * against the media set's schema and perform initial metadata extraction.\n * This endpoint is only applicable for federated media sets.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/items/register\n */\nexport function register($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _register, ...args);\n}\nconst _retrieve = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/retrieve\", 6,, \"*/*\"];\n/**\n * Retrieves a successfully calculated thumbnail for a given image.\n *\n * Thumbnails are 200px wide in the format of `image/webp`\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/retrieve\n */\nexport function retrieve($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _retrieve, ...args);\n}\nconst _transform = [1, \"/v2/mediasets/{0}/items/{1}/transform\", 7];\n/**\n * Initiates a transformation on a media item. Returns a job ID that can be used to check the status and retrieve\n * the result of the transformation.\n *\n * Transforming a media item requires that you are able to read the media item, either via `api:mediasets-read` or\n * via a `MediaItemReadToken`\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-transform]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform\n */\nexport function transform($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _transform, ...args);\n}\nconst _uploadMedia = [2, \"/v2/mediasets/media/upload\", 7, \"*/*\"];\n/**\n * Uploads a temporary media item. If the media item isn't persisted within 1 hour, the item will be deleted.\n *\n * If multiple resources are attributed to, usage will be attributed to the first one in the list.\n *\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * Third-party applications using this endpoint via OAuth2 must request the following operation scopes: `api:ontologies-read api:ontologies-write`.\n *\n * @public\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/mediasets/media/upload\n */\nexport function uploadMedia($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _uploadMedia, ...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\nexport const symbolClientContext = Symbol(\"ClientContext\");","/*\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\nexport const symbolClientContext = \"__osdkClientContext\";","class ParseError extends Error {\n constructor(message, options) {\n super(message), this.name = \"ParseError\", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;\n }\n}\nconst LF = 10,\n CR = 13,\n SPACE = 32;\nfunction noop(_arg) {}\nfunction createParser(config) {\n if (typeof config == \"function\") throw new TypeError(\"`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?\");\n const {\n onEvent = noop,\n onError = noop,\n onRetry = noop,\n onComment,\n maxBufferSize\n } = config,\n pendingFragments = [];\n let pendingFragmentsLength = 0,\n isFirstChunk = !0,\n id,\n data = \"\",\n dataLines = 0,\n eventType,\n terminated = !1;\n function feed(chunk) {\n if (terminated) throw new Error(\"Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.\");\n if (isFirstChunk && (isFirstChunk = !1, chunk.charCodeAt(0) === 239 && chunk.charCodeAt(1) === 187 && chunk.charCodeAt(2) === 191 && (chunk = chunk.slice(3))), pendingFragments.length === 0) {\n const trailing2 = processLines(chunk);\n trailing2 !== \"\" && (pendingFragments.push(trailing2), pendingFragmentsLength = trailing2.length), checkBufferSize();\n return;\n }\n if (chunk.indexOf(`\n`) === -1 && chunk.indexOf(\"\\r\") === -1) {\n pendingFragments.push(chunk), pendingFragmentsLength += chunk.length, checkBufferSize();\n return;\n }\n pendingFragments.push(chunk);\n const input = pendingFragments.join(\"\");\n pendingFragments.length = 0, pendingFragmentsLength = 0;\n const trailing = processLines(input);\n trailing !== \"\" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();\n }\n function checkBufferSize() {\n maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = !0, pendingFragments.length = 0, pendingFragmentsLength = 0, id = void 0, data = \"\", dataLines = 0, eventType = void 0, onError(new ParseError(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {\n type: \"max-buffer-size-exceeded\"\n }))));\n }\n function processLines(chunk) {\n let searchIndex = 0;\n if (chunk.indexOf(\"\\r\") === -1) {\n let lfIndex = chunk.indexOf(`\n`, searchIndex);\n for (; lfIndex !== -1;) {\n if (searchIndex === lfIndex) {\n dataLines > 0 && onEvent({\n id,\n event: eventType,\n data\n }), id = void 0, data = \"\", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`\n`, searchIndex);\n continue;\n }\n const firstCharCode = chunk.charCodeAt(searchIndex);\n if (isDataPrefix(chunk, searchIndex, firstCharCode)) {\n const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE ? searchIndex + 6 : searchIndex + 5,\n value = chunk.slice(valueStart, lfIndex);\n if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF) {\n onEvent({\n id,\n event: eventType,\n data: value\n }), id = void 0, data = \"\", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`\n`, searchIndex);\n continue;\n }\n data = dataLines === 0 ? value : `${data}\n${value}`, dataLines++;\n } else isEventPrefix(chunk, searchIndex, firstCharCode) ? eventType = chunk.slice(chunk.charCodeAt(searchIndex + 6) === SPACE ? searchIndex + 7 : searchIndex + 6, lfIndex) || void 0 : parseLine(chunk, searchIndex, lfIndex);\n searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`\n`, searchIndex);\n }\n return chunk.slice(searchIndex);\n }\n for (; searchIndex < chunk.length;) {\n const crIndex = chunk.indexOf(\"\\r\", searchIndex),\n lfIndex = chunk.indexOf(`\n`, searchIndex);\n let lineEnd = -1;\n if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = crIndex < lfIndex ? crIndex : lfIndex : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) break;\n parseLine(chunk, searchIndex, lineEnd), searchIndex = lineEnd + 1, chunk.charCodeAt(searchIndex - 1) === CR && chunk.charCodeAt(searchIndex) === LF && searchIndex++;\n }\n return chunk.slice(searchIndex);\n }\n function parseLine(chunk, start, end) {\n if (start === end) {\n dispatchEvent();\n return;\n }\n const firstCharCode = chunk.charCodeAt(start);\n if (isDataPrefix(chunk, start, firstCharCode)) {\n const valueStart = chunk.charCodeAt(start + 5) === SPACE ? start + 6 : start + 5,\n value2 = chunk.slice(valueStart, end);\n data = dataLines === 0 ? value2 : `${data}\n${value2}`, dataLines++;\n return;\n }\n if (isEventPrefix(chunk, start, firstCharCode)) {\n eventType = chunk.slice(chunk.charCodeAt(start + 6) === SPACE ? start + 7 : start + 6, end) || void 0;\n return;\n }\n if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {\n const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);\n value2.includes(\"\\0\") || (id = value2);\n return;\n }\n if (firstCharCode === 58) {\n if (onComment) {\n const line2 = chunk.slice(start, end);\n onComment(line2.slice(chunk.charCodeAt(start + 1) === SPACE ? 2 : 1));\n }\n return;\n }\n const line = chunk.slice(start, end),\n fieldSeparatorIndex = line.indexOf(\":\");\n if (fieldSeparatorIndex === -1) {\n processField(line, \"\", line);\n return;\n }\n const field = line.slice(0, fieldSeparatorIndex),\n offset = line.charCodeAt(fieldSeparatorIndex + 1) === SPACE ? 2 : 1,\n value = line.slice(fieldSeparatorIndex + offset);\n processField(field, value, line);\n }\n function processField(field, value, line) {\n switch (field) {\n case \"event\":\n eventType = value || void 0;\n break;\n case \"data\":\n data = dataLines === 0 ? value : `${data}\n${value}`, dataLines++;\n break;\n case \"id\":\n value.includes(\"\\0\") || (id = value);\n break;\n case \"retry\":\n /^\\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(new ParseError(`Invalid \\`retry\\` value: \"${value}\"`, {\n type: \"invalid-retry\",\n value,\n line\n }));\n break;\n default:\n onError(new ParseError(`Unknown field \"${field.length > 20 ? `${field.slice(0, 20)}\\u2026` : field}\"`, {\n type: \"unknown-field\",\n field,\n value,\n line\n }));\n break;\n }\n }\n function dispatchEvent() {\n dataLines > 0 && onEvent({\n id,\n event: eventType,\n data\n }), id = void 0, data = \"\", dataLines = 0, eventType = void 0;\n }\n function reset(options = {}) {\n if (options.consume && pendingFragments.length > 0) {\n const incompleteLine = pendingFragments.join(\"\");\n parseLine(incompleteLine, 0, incompleteLine.length);\n }\n isFirstChunk = !0, id = void 0, data = \"\", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = !1;\n }\n return {\n feed,\n reset\n };\n}\nfunction isDataPrefix(chunk, i, firstCharCode) {\n return firstCharCode === 100 && chunk.charCodeAt(i + 1) === 97 && chunk.charCodeAt(i + 2) === 116 && chunk.charCodeAt(i + 3) === 97 && chunk.charCodeAt(i + 4) === 58;\n}\nfunction isEventPrefix(chunk, i, firstCharCode) {\n return firstCharCode === 101 && chunk.charCodeAt(i + 1) === 118 && chunk.charCodeAt(i + 2) === 101 && chunk.charCodeAt(i + 3) === 110 && chunk.charCodeAt(i + 4) === 116 && chunk.charCodeAt(i + 5) === 58;\n}\nexport { ParseError, createParser };","import { createParser } from \"./index.js\";\nimport { ParseError } from \"./index.js\";\nclass EventSourceParserStream extends TransformStream {\n constructor({\n onError,\n onRetry,\n onComment,\n maxBufferSize\n } = {}) {\n let parser;\n super({\n start(controller) {\n parser = createParser({\n onEvent: event => {\n controller.enqueue(event);\n },\n onError(error) {\n typeof onError == \"function\" && onError(error), (onError === \"terminate\" || error.type === \"max-buffer-size-exceeded\") && controller.error(error);\n },\n onRetry,\n onComment,\n maxBufferSize\n });\n },\n transform(chunk) {\n parser.feed(chunk);\n }\n });\n }\n}\nexport { EventSourceParserStream, ParseError };","/*\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 */\nimport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\nimport { EventSourceParserStream } from \"eventsource-parser/stream\";\nexport async function* sseStream(response) {\n if (!response.body) {\n throw new UnknownError(\"Expected a text/event-stream body, but the response had none\", \"UNKNOWN\", undefined, response.status);\n }\n const stream = response.body.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream({\n onError: \"terminate\"\n }));\n for await (const event of stream) {\n if (event.data === \"\") continue;\n let data;\n try {\n data = JSON.parse(event.data);\n } catch (e) {\n throw new UnknownError(`Unable to parse event data as JSON: ${truncate(event.data)}`, \"UNKNOWN\", e instanceof Error ? e : undefined, response.status);\n }\n if (isSseErrorEvent(data)) {\n throw new PalantirApiError(data.errorDescription ?? data.errorName ?? \"Streaming request failed\", data.errorName, data.errorCode, data.errorDescription, response.status, data.errorInstanceId, data.parameters);\n }\n yield data;\n }\n}\nfunction isSseErrorEvent(data) {\n return typeof data === \"object\" && data != null && data.type === \"error\";\n}\nfunction truncate(data) {\n return data.length > 512 ? `${data.slice(0, 512)}…` : data;\n}","/*\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 */\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { symbolClientContext } from \"@osdk/shared.client2\";\nimport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\nimport { sseStream } from \"./sse.js\";\nexport async function foundryPlatformFetch(client, [httpMethodNum, origPath, flags, contentType, responseContentType], ...args) {\n const path = origPath.replace(/\\{([^}]+)\\}/g, () => encodeURIComponent(args.shift()));\n const body = flags & 1 ? args.shift() : undefined;\n const queryArgs = flags & 2 ? args.shift() : undefined;\n const headerArgs = flags & 4 ? args.shift() : undefined;\n const method = [\"GET\", \"POST\", \"PUT\", \"DELETE\", \"PATCH\"][httpMethodNum];\n return await apiFetch(client[symbolClientContext] ?? client[oldSymbolClientContext] ?? client, method, path, body, queryArgs, headerArgs, contentType, responseContentType);\n}\nasync function apiFetch(clientCtx, method, endpointPath, data, queryArguments, headers, requestMediaType, responseMediaType) {\n const url = parseUrl(clientCtx.baseUrl, endpointPath);\n for (const [key, value] of Object.entries(queryArguments || {})) {\n if (value == null) {\n continue;\n }\n if (Array.isArray(value)) {\n for (const item of value) {\n url.searchParams.append(key, item);\n }\n } else {\n url.searchParams.append(key, value);\n }\n }\n const headersInit = new Headers();\n const resolvedRequestMediaType = requestMediaType === \"*/*\" && data instanceof globalThis.Blob ? data.type || \"application/octet-stream\" : requestMediaType ?? \"application/json\";\n headersInit.set(\"Content-Type\", resolvedRequestMediaType);\n headersInit.set(\"Accept\", responseMediaType ?? \"application/json\");\n Object.entries(headers || {}).forEach(([key, value]) => {\n if (key === \"Content-Type\" && typeof value === \"string\") {\n headersInit.set(\"Content-Type\", value);\n } else if (key === \"Accept\" && typeof value === \"string\") {\n headersInit.set(\"Accept\", value);\n } else if (value != null) {\n headersInit.append(key, value.toString());\n }\n });\n const body = data == null || data instanceof globalThis.Blob ? data : JSON.stringify(data);\n // Because this uses the client's fetch, there is a 99.99% chance that it is already going\n // to handle the error case and throw a PalantirApiError since its wrapped in a\n // createFetchOrThrow.\n const response = await clientCtx.fetch(url.toString(), {\n body,\n method: method,\n headers: headersInit\n });\n // However, if we ended up using a \"regular\" fetch, the\n // error status codes are not thrown by fetch automatically,\n // we have to look at the ok property and behave accordingly\n if (!response.ok) {\n try {\n const convertedError = await response.json();\n return new PalantirApiError(convertedError.message, convertedError.errorName, convertedError.errorCode, convertedError.errorDescription, response.status, convertedError.errorInstanceId, convertedError.parameters);\n } catch (e) {\n if (e instanceof Error) {\n return new UnknownError(e.message, \"UNKNOWN\");\n }\n return new UnknownError(\"Unable to parse error response\", \"UNKNOWN\");\n }\n }\n // Do not return anything if its a 204. Do not parse either!\n if (response.status === 204) {\n return;\n }\n if (responseMediaType === \"text/event-stream\") {\n return sseStream(response);\n }\n if (responseMediaType == null || responseMediaType === \"application/json\") {\n return await response.json();\n }\n return response;\n}\nexport function parseUrl(baseUrl, endpointPath) {\n baseUrl += baseUrl.endsWith(\"/\") ? \"\" : \"/\";\n return new URL(`api${endpointPath}`, baseUrl);\n}"]}