@osdk/client 2.6.0-beta.3 → 2.6.0-beta.5

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 (251) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +2 -1
  3. package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
  4. package/build/browser/index.js.map +1 -1
  5. package/build/browser/internal/conversions/extractNamespace.js +22 -0
  6. package/build/browser/internal/conversions/extractNamespace.js.map +1 -0
  7. package/build/browser/internal/conversions/fullyQualifyPropName.js +26 -0
  8. package/build/browser/internal/conversions/fullyQualifyPropName.js.map +1 -0
  9. package/build/browser/internal/conversions/makeGeoFilterBbox.js +41 -0
  10. package/build/browser/internal/conversions/makeGeoFilterBbox.js.map +1 -0
  11. package/build/browser/internal/conversions/makeGeoFilterIntersects.js +29 -0
  12. package/build/browser/internal/conversions/makeGeoFilterIntersects.js.map +1 -0
  13. package/build/browser/internal/conversions/makeGeoFilterPolygon.js +30 -0
  14. package/build/browser/internal/conversions/makeGeoFilterPolygon.js.map +1 -0
  15. package/build/browser/internal/conversions/makeGeoFilterWithin.js +48 -0
  16. package/build/browser/internal/conversions/makeGeoFilterWithin.js.map +1 -0
  17. package/build/browser/internal/conversions/modernToLegacyWhereClause.js +30 -99
  18. package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  19. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +139 -0
  20. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
  21. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +1 -1
  22. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  23. package/build/browser/object/fetchPage.js +1 -1
  24. package/build/browser/object/fetchPage.js.map +1 -1
  25. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +17 -0
  26. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  27. package/build/browser/observable/ObservableClient.js.map +1 -1
  28. package/build/browser/observable/internal/BulkObjectLoader.js +12 -4
  29. package/build/browser/observable/internal/BulkObjectLoader.js.map +1 -1
  30. package/build/browser/observable/internal/BulkObjectLoader.test.js +48 -0
  31. package/build/browser/observable/internal/BulkObjectLoader.test.js.map +1 -1
  32. package/build/browser/observable/internal/CacheKeys.js +9 -3
  33. package/build/browser/observable/internal/CacheKeys.js.map +1 -1
  34. package/build/browser/observable/internal/Canonicalizer.js +51 -0
  35. package/build/browser/observable/internal/Canonicalizer.js.map +1 -0
  36. package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
  37. package/build/browser/observable/internal/OrderByCanonicalizer.js +1 -4
  38. package/build/browser/observable/internal/OrderByCanonicalizer.js.map +1 -1
  39. package/build/browser/observable/internal/RdpCanonicalizer.js +66 -0
  40. package/build/browser/observable/internal/RdpCanonicalizer.js.map +1 -0
  41. package/build/browser/observable/internal/RdpCanonicalizer.test.js +68 -0
  42. package/build/browser/observable/internal/RdpCanonicalizer.test.js.map +1 -0
  43. package/build/browser/observable/internal/SimpleWhereClause.js.map +1 -1
  44. package/build/browser/observable/internal/Store.js +160 -6
  45. package/build/browser/observable/internal/Store.js.map +1 -1
  46. package/build/browser/observable/internal/WhereClauseCanonicalizer.js +1 -1
  47. package/build/browser/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
  48. package/build/browser/observable/internal/actions/ActionApplication.js +1 -1
  49. package/build/browser/observable/internal/actions/ActionApplication.js.map +1 -1
  50. package/build/browser/observable/internal/actions/OptimisticJob.js +3 -3
  51. package/build/browser/observable/internal/actions/OptimisticJob.js.map +1 -1
  52. package/build/browser/observable/internal/base-list/BaseListQuery.js +12 -3
  53. package/build/browser/observable/internal/base-list/BaseListQuery.js.map +1 -1
  54. package/build/browser/observable/internal/base-list/createCollectionConnectable.js +0 -5
  55. package/build/browser/observable/internal/base-list/createCollectionConnectable.js.map +1 -1
  56. package/build/browser/observable/internal/base-list/createCollectionConnectable.test.js +26 -13
  57. package/build/browser/observable/internal/base-list/createCollectionConnectable.test.js.map +1 -1
  58. package/build/browser/observable/internal/evaluateFilter.js +61 -0
  59. package/build/browser/observable/internal/evaluateFilter.js.map +1 -0
  60. package/build/browser/observable/internal/links/SpecificLinkCacheKey.js +33 -1
  61. package/build/browser/observable/internal/links/SpecificLinkCacheKey.js.map +1 -1
  62. package/build/browser/observable/internal/list/InterfaceListQuery.js +8 -3
  63. package/build/browser/observable/internal/list/InterfaceListQuery.js.map +1 -1
  64. package/build/browser/observable/internal/list/ListCacheKey.js +22 -1
  65. package/build/browser/observable/internal/list/ListCacheKey.js.map +1 -1
  66. package/build/browser/observable/internal/list/ListQuery.js +39 -24
  67. package/build/browser/observable/internal/list/ListQuery.js.map +1 -1
  68. package/build/browser/observable/internal/list/ListsHelper.js +12 -8
  69. package/build/browser/observable/internal/list/ListsHelper.js.map +1 -1
  70. package/build/browser/observable/internal/list/ObjectListQuery.js +10 -1
  71. package/build/browser/observable/internal/list/ObjectListQuery.js.map +1 -1
  72. package/build/browser/observable/internal/object/ObjectCacheKey.js +20 -1
  73. package/build/browser/observable/internal/object/ObjectCacheKey.js.map +1 -1
  74. package/build/browser/observable/internal/object/ObjectCacheKeyRegistry.js +126 -0
  75. package/build/browser/observable/internal/object/ObjectCacheKeyRegistry.js.map +1 -0
  76. package/build/browser/observable/internal/object/ObjectCacheKeyRegistry.test.js +173 -0
  77. package/build/browser/observable/internal/object/ObjectCacheKeyRegistry.test.js.map +1 -0
  78. package/build/browser/observable/internal/object/ObjectQuery.js +10 -58
  79. package/build/browser/observable/internal/object/ObjectQuery.js.map +1 -1
  80. package/build/browser/observable/internal/object/ObjectsHelper.js +65 -5
  81. package/build/browser/observable/internal/object/ObjectsHelper.js.map +1 -1
  82. package/build/browser/observable/internal/objectMatchesWhereClause.js +3 -37
  83. package/build/browser/observable/internal/objectMatchesWhereClause.js.map +1 -1
  84. package/build/browser/observable/internal/testUtils.js +3 -2
  85. package/build/browser/observable/internal/testUtils.js.map +1 -1
  86. package/build/browser/observable/internal/utils/rdpFieldOperations.js +83 -0
  87. package/build/browser/observable/internal/utils/rdpFieldOperations.js.map +1 -0
  88. package/build/browser/util/UserAgent.js +2 -2
  89. package/build/cjs/{chunk-BRYZR53E.cjs → chunk-OSI7NG7T.cjs} +54 -54
  90. package/build/cjs/{chunk-BRYZR53E.cjs.map → chunk-OSI7NG7T.cjs.map} +1 -1
  91. package/build/cjs/{chunk-6L3MX4LH.cjs → chunk-VNLY3YOJ.cjs} +241 -196
  92. package/build/cjs/chunk-VNLY3YOJ.cjs.map +1 -0
  93. package/build/cjs/index.cjs +8 -8
  94. package/build/cjs/index.d.cts +1 -1
  95. package/build/cjs/public/internal.cjs +8 -8
  96. package/build/cjs/public/unstable-do-not-use.cjs +652 -215
  97. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  98. package/build/cjs/public/unstable-do-not-use.d.cts +6 -5
  99. package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +2 -1
  100. package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
  101. package/build/esm/index.js.map +1 -1
  102. package/build/esm/internal/conversions/extractNamespace.js +22 -0
  103. package/build/esm/internal/conversions/extractNamespace.js.map +1 -0
  104. package/build/esm/internal/conversions/fullyQualifyPropName.js +26 -0
  105. package/build/esm/internal/conversions/fullyQualifyPropName.js.map +1 -0
  106. package/build/esm/internal/conversions/makeGeoFilterBbox.js +41 -0
  107. package/build/esm/internal/conversions/makeGeoFilterBbox.js.map +1 -0
  108. package/build/esm/internal/conversions/makeGeoFilterIntersects.js +29 -0
  109. package/build/esm/internal/conversions/makeGeoFilterIntersects.js.map +1 -0
  110. package/build/esm/internal/conversions/makeGeoFilterPolygon.js +30 -0
  111. package/build/esm/internal/conversions/makeGeoFilterPolygon.js.map +1 -0
  112. package/build/esm/internal/conversions/makeGeoFilterWithin.js +48 -0
  113. package/build/esm/internal/conversions/makeGeoFilterWithin.js.map +1 -0
  114. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +30 -99
  115. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  116. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +139 -0
  117. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
  118. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +1 -1
  119. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  120. package/build/esm/object/fetchPage.js +1 -1
  121. package/build/esm/object/fetchPage.js.map +1 -1
  122. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +17 -0
  123. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  124. package/build/esm/observable/ObservableClient.js.map +1 -1
  125. package/build/esm/observable/internal/BulkObjectLoader.js +12 -4
  126. package/build/esm/observable/internal/BulkObjectLoader.js.map +1 -1
  127. package/build/esm/observable/internal/BulkObjectLoader.test.js +48 -0
  128. package/build/esm/observable/internal/BulkObjectLoader.test.js.map +1 -1
  129. package/build/esm/observable/internal/CacheKeys.js +9 -3
  130. package/build/esm/observable/internal/CacheKeys.js.map +1 -1
  131. package/build/esm/observable/internal/Canonicalizer.js +51 -0
  132. package/build/esm/observable/internal/Canonicalizer.js.map +1 -0
  133. package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
  134. package/build/esm/observable/internal/OrderByCanonicalizer.js +1 -4
  135. package/build/esm/observable/internal/OrderByCanonicalizer.js.map +1 -1
  136. package/build/esm/observable/internal/RdpCanonicalizer.js +66 -0
  137. package/build/esm/observable/internal/RdpCanonicalizer.js.map +1 -0
  138. package/build/esm/observable/internal/RdpCanonicalizer.test.js +68 -0
  139. package/build/esm/observable/internal/RdpCanonicalizer.test.js.map +1 -0
  140. package/build/esm/observable/internal/SimpleWhereClause.js.map +1 -1
  141. package/build/esm/observable/internal/Store.js +160 -6
  142. package/build/esm/observable/internal/Store.js.map +1 -1
  143. package/build/esm/observable/internal/WhereClauseCanonicalizer.js +1 -1
  144. package/build/esm/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
  145. package/build/esm/observable/internal/actions/ActionApplication.js +1 -1
  146. package/build/esm/observable/internal/actions/ActionApplication.js.map +1 -1
  147. package/build/esm/observable/internal/actions/OptimisticJob.js +3 -3
  148. package/build/esm/observable/internal/actions/OptimisticJob.js.map +1 -1
  149. package/build/esm/observable/internal/base-list/BaseListQuery.js +12 -3
  150. package/build/esm/observable/internal/base-list/BaseListQuery.js.map +1 -1
  151. package/build/esm/observable/internal/base-list/createCollectionConnectable.js +0 -5
  152. package/build/esm/observable/internal/base-list/createCollectionConnectable.js.map +1 -1
  153. package/build/esm/observable/internal/base-list/createCollectionConnectable.test.js +26 -13
  154. package/build/esm/observable/internal/base-list/createCollectionConnectable.test.js.map +1 -1
  155. package/build/esm/observable/internal/evaluateFilter.js +61 -0
  156. package/build/esm/observable/internal/evaluateFilter.js.map +1 -0
  157. package/build/esm/observable/internal/links/SpecificLinkCacheKey.js +33 -1
  158. package/build/esm/observable/internal/links/SpecificLinkCacheKey.js.map +1 -1
  159. package/build/esm/observable/internal/list/InterfaceListQuery.js +8 -3
  160. package/build/esm/observable/internal/list/InterfaceListQuery.js.map +1 -1
  161. package/build/esm/observable/internal/list/ListCacheKey.js +22 -1
  162. package/build/esm/observable/internal/list/ListCacheKey.js.map +1 -1
  163. package/build/esm/observable/internal/list/ListQuery.js +39 -24
  164. package/build/esm/observable/internal/list/ListQuery.js.map +1 -1
  165. package/build/esm/observable/internal/list/ListsHelper.js +12 -8
  166. package/build/esm/observable/internal/list/ListsHelper.js.map +1 -1
  167. package/build/esm/observable/internal/list/ObjectListQuery.js +10 -1
  168. package/build/esm/observable/internal/list/ObjectListQuery.js.map +1 -1
  169. package/build/esm/observable/internal/object/ObjectCacheKey.js +20 -1
  170. package/build/esm/observable/internal/object/ObjectCacheKey.js.map +1 -1
  171. package/build/esm/observable/internal/object/ObjectCacheKeyRegistry.js +126 -0
  172. package/build/esm/observable/internal/object/ObjectCacheKeyRegistry.js.map +1 -0
  173. package/build/esm/observable/internal/object/ObjectCacheKeyRegistry.test.js +173 -0
  174. package/build/esm/observable/internal/object/ObjectCacheKeyRegistry.test.js.map +1 -0
  175. package/build/esm/observable/internal/object/ObjectQuery.js +10 -58
  176. package/build/esm/observable/internal/object/ObjectQuery.js.map +1 -1
  177. package/build/esm/observable/internal/object/ObjectsHelper.js +65 -5
  178. package/build/esm/observable/internal/object/ObjectsHelper.js.map +1 -1
  179. package/build/esm/observable/internal/objectMatchesWhereClause.js +3 -37
  180. package/build/esm/observable/internal/objectMatchesWhereClause.js.map +1 -1
  181. package/build/esm/observable/internal/testUtils.js +3 -2
  182. package/build/esm/observable/internal/testUtils.js.map +1 -1
  183. package/build/esm/observable/internal/utils/rdpFieldOperations.js +83 -0
  184. package/build/esm/observable/internal/utils/rdpFieldOperations.js.map +1 -0
  185. package/build/esm/util/UserAgent.js +2 -2
  186. package/build/types/index.d.ts +1 -1
  187. package/build/types/index.d.ts.map +1 -1
  188. package/build/types/internal/conversions/extractNamespace.d.ts +1 -0
  189. package/build/types/internal/conversions/extractNamespace.d.ts.map +1 -0
  190. package/build/types/internal/conversions/fullyQualifyPropName.d.ts +2 -0
  191. package/build/types/internal/conversions/fullyQualifyPropName.d.ts.map +1 -0
  192. package/build/types/internal/conversions/makeGeoFilterBbox.d.ts +3 -0
  193. package/build/types/internal/conversions/makeGeoFilterBbox.d.ts.map +1 -0
  194. package/build/types/internal/conversions/makeGeoFilterIntersects.d.ts +3 -0
  195. package/build/types/internal/conversions/makeGeoFilterIntersects.d.ts.map +1 -0
  196. package/build/types/internal/conversions/makeGeoFilterPolygon.d.ts +3 -0
  197. package/build/types/internal/conversions/makeGeoFilterPolygon.d.ts.map +1 -0
  198. package/build/types/internal/conversions/makeGeoFilterWithin.d.ts +3 -0
  199. package/build/types/internal/conversions/makeGeoFilterWithin.d.ts.map +1 -0
  200. package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts +1 -1
  201. package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts.map +1 -1
  202. package/build/types/observable/ObservableClient.d.ts +15 -5
  203. package/build/types/observable/ObservableClient.d.ts.map +1 -1
  204. package/build/types/observable/internal/BulkObjectLoader.d.ts.map +1 -1
  205. package/build/types/observable/internal/CacheKeys.d.ts.map +1 -1
  206. package/build/types/observable/internal/Canonicalizer.d.ts +37 -0
  207. package/build/types/observable/internal/Canonicalizer.d.ts.map +1 -0
  208. package/build/types/observable/internal/OrderByCanonicalizer.d.ts.map +1 -1
  209. package/build/types/observable/internal/RdpCanonicalizer.d.ts +8 -0
  210. package/build/types/observable/internal/RdpCanonicalizer.d.ts.map +1 -0
  211. package/build/types/observable/internal/RdpCanonicalizer.test.d.ts +1 -0
  212. package/build/types/observable/internal/RdpCanonicalizer.test.d.ts.map +1 -0
  213. package/build/types/observable/internal/SimpleWhereClause.d.ts +6 -2
  214. package/build/types/observable/internal/SimpleWhereClause.d.ts.map +1 -1
  215. package/build/types/observable/internal/Store.d.ts +4 -0
  216. package/build/types/observable/internal/Store.d.ts.map +1 -1
  217. package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts +5 -2
  218. package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts.map +1 -1
  219. package/build/types/observable/internal/actions/ActionApplication.d.ts.map +1 -1
  220. package/build/types/observable/internal/base-list/BaseListQuery.d.ts +6 -0
  221. package/build/types/observable/internal/base-list/BaseListQuery.d.ts.map +1 -1
  222. package/build/types/observable/internal/base-list/createCollectionConnectable.d.ts +1 -23
  223. package/build/types/observable/internal/base-list/createCollectionConnectable.d.ts.map +1 -1
  224. package/build/types/observable/internal/evaluateFilter.d.ts +6 -0
  225. package/build/types/observable/internal/evaluateFilter.d.ts.map +1 -0
  226. package/build/types/observable/internal/links/SpecificLinkCacheKey.d.ts +5 -0
  227. package/build/types/observable/internal/links/SpecificLinkCacheKey.d.ts.map +1 -1
  228. package/build/types/observable/internal/list/InterfaceListQuery.d.ts.map +1 -1
  229. package/build/types/observable/internal/list/ListCacheKey.d.ts +7 -1
  230. package/build/types/observable/internal/list/ListCacheKey.d.ts.map +1 -1
  231. package/build/types/observable/internal/list/ListQuery.d.ts +7 -7
  232. package/build/types/observable/internal/list/ListQuery.d.ts.map +1 -1
  233. package/build/types/observable/internal/list/ListsHelper.d.ts +3 -1
  234. package/build/types/observable/internal/list/ListsHelper.d.ts.map +1 -1
  235. package/build/types/observable/internal/list/ObjectListQuery.d.ts.map +1 -1
  236. package/build/types/observable/internal/object/ObjectCacheKey.d.ts +6 -1
  237. package/build/types/observable/internal/object/ObjectCacheKey.d.ts.map +1 -1
  238. package/build/types/observable/internal/object/ObjectCacheKeyRegistry.d.ts +60 -0
  239. package/build/types/observable/internal/object/ObjectCacheKeyRegistry.d.ts.map +1 -0
  240. package/build/types/observable/internal/object/ObjectCacheKeyRegistry.test.d.ts +1 -0
  241. package/build/types/observable/internal/object/ObjectCacheKeyRegistry.test.d.ts.map +1 -0
  242. package/build/types/observable/internal/object/ObjectQuery.d.ts +1 -1
  243. package/build/types/observable/internal/object/ObjectQuery.d.ts.map +1 -1
  244. package/build/types/observable/internal/object/ObjectsHelper.d.ts +15 -1
  245. package/build/types/observable/internal/object/ObjectsHelper.d.ts.map +1 -1
  246. package/build/types/observable/internal/objectMatchesWhereClause.d.ts.map +1 -1
  247. package/build/types/observable/internal/testUtils.d.ts.map +1 -1
  248. package/build/types/observable/internal/utils/rdpFieldOperations.d.ts +5 -0
  249. package/build/types/observable/internal/utils/rdpFieldOperations.d.ts.map +1 -0
  250. package/package.json +6 -6
  251. package/build/cjs/chunk-6L3MX4LH.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @osdk/client
2
2
 
3
+ ## 2.6.0-beta.5
4
+
5
+ ### Minor Changes
6
+
7
+ - b48526f: fix ListQuery websocket subscription management
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [2556c64]
12
+ - @osdk/api@2.6.0-beta.5
13
+ - @osdk/client.unstable@2.6.0-beta.5
14
+ - @osdk/generator-converters@2.6.0-beta.5
15
+
16
+ ## 2.6.0-beta.4
17
+
18
+ ### Minor Changes
19
+
20
+ - 61eb5b0: Add heartbeat to object set subscriptions
21
+ - e7bf02a: Add RDP support to React toolkit
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [7fd788b]
26
+ - Updated dependencies [e7bf02a]
27
+ - @osdk/client.unstable@2.6.0-beta.4
28
+ - @osdk/api@2.6.0-beta.4
29
+ - @osdk/generator-converters@2.6.0-beta.4
30
+
3
31
  ## 2.6.0-beta.3
4
32
 
5
33
  ### Minor Changes
@@ -28,10 +28,11 @@ export function createWithPropertiesObjectSet(objectType, objectSet, definitionM
28
28
  }, definitionMap);
29
29
  },
30
30
  where: clause => {
31
+ const rdpNames = new Set(definitionMap.keys());
31
32
  return createWithPropertiesObjectSet(objectType, {
32
33
  type: "filter",
33
34
  objectSet: objectSet,
34
- where: modernToLegacyWhereClause(clause, objectType)
35
+ where: modernToLegacyWhereClause(clause, objectType, rdpNames)
35
36
  }, definitionMap);
36
37
  },
37
38
  aggregate: (aggregation, opt) => {
@@ -1 +1 @@
1
- {"version":3,"file":"createWithPropertiesObjectSet.js","names":["invariant","modernToLegacyWhereClause","derivedPropertyDefinitionFactory","createWithPropertiesObjectSet","objectType","objectSet","definitionMap","fromBaseObjectSet","pivotTo","link","type","where","clause","aggregate","aggregation","opt","splitAggregation","split","length","process","env","NODE_ENV","aggregationPropertyName","aggregationOperation","aggregationOperationDefinition","selectedPropertyApiName","approximatePercentile","percentile","limit","undefined","wrappedObjectSet","operation","selectorResult","set","selectProperty","name","apiName","constant","double","integer","long","datetime","timestamp"],"sources":["createWithPropertiesObjectSet.ts"],"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 */\n\nimport type { DerivedProperty, ObjectOrInterfaceDefinition } from \"@osdk/api\";\nimport type {\n DerivedPropertyDefinition,\n ObjectSet as WireObjectSet,\n SelectedPropertyOperation,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { derivedPropertyDefinitionFactory } from \"./derivedPropertyDefinitionFactory.js\";\n\ntype WithConstSelect<Q extends ObjectOrInterfaceDefinition> =\n & DerivedProperty.SelectPropertyBuilder<Q, false>\n & {\n constant: DerivedProperty.Builder<Q, true>[\"constant\"];\n };\n\n/** @internal */\nexport function createWithPropertiesObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n>(\n objectType: Q,\n objectSet: WireObjectSet,\n definitionMap: Map<any, DerivedPropertyDefinition>,\n fromBaseObjectSet: boolean = false,\n): WithConstSelect<Q> {\n return {\n pivotTo: (link) => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"searchAround\",\n objectSet,\n link,\n }, definitionMap);\n },\n where: (clause) => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause, objectType),\n }, definitionMap);\n },\n aggregate: (aggregation: string, opt: any) => {\n const splitAggregation = aggregation.split(\":\");\n invariant(\n splitAggregation.length === 2 || splitAggregation[0] === \"$count\",\n \"Invalid aggregation format\",\n );\n const [aggregationPropertyName, aggregationOperation] = splitAggregation;\n let aggregationOperationDefinition: SelectedPropertyOperation;\n switch (aggregationOperation) {\n case \"sum\":\n case \"avg\":\n case \"min\":\n case \"max\":\n case \"exactDistinct\":\n case \"approximateDistinct\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n };\n break;\n case \"approximatePercentile\":\n aggregationOperationDefinition = {\n type: \"approximatePercentile\",\n selectedPropertyApiName: aggregationPropertyName,\n approximatePercentile: opt?.percentile ?? .5,\n };\n break;\n case \"collectSet\":\n case \"collectList\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n limit: opt?.limit ?? 100,\n };\n break;\n case undefined:\n if (aggregationPropertyName === \"$count\") {\n aggregationOperationDefinition = {\n type: \"count\",\n };\n break;\n }\n default:\n invariant(\n false,\n \"Invalid aggregation operation \" + aggregationOperation,\n );\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: aggregationOperationDefinition,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n selectProperty: (name) => {\n if (fromBaseObjectSet) {\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"property\",\n apiName: name,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: {\n type: \"get\",\n selectedPropertyApiName: name,\n },\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n constant: {\n double: (value) => {\n invariant(false, \"Not supported\");\n },\n integer: (value) => {\n invariant(false, \"Not supported\");\n },\n long: (value) => {\n invariant(false, \"Not supported\");\n },\n datetime: (value) => {\n invariant(false, \"Not supported\");\n },\n timestamp: (value) => {\n invariant(false, \"Not supported\");\n },\n },\n };\n}\n"],"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A,MAAMF,gBAA2C,GAAG;QAClDpB,IAAI,EAAE,WAAW;QACjBL,SAAS,EAAEA,SAAS;QACpB0B,SAAS,EAAE;UACTrB,IAAI,EAAE,KAAK;UACXe,uBAAuB,EAAEU;QAC3B;MACF,CAAC;MACD,MAAMH,cAAoD,GACxD9B,gCAAgC,CAAC4B,gBAAgB,EAAExB,aAAa,CAAC;MACnEA,aAAa,CAAC2B,GAAG,CAACD,cAAc,EAAEF,gBAAgB,CAAC;MACnD,OAAOE,cAAc;IACvB,CAAC;IACDK,QAAQ,EAAE;MACRC,MAAM,EAAEA,CAAA,KAAW;QACjBnB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX,CAAC;MACDuC,OAAO,EAAEA,CAAA,KAAW;QAClBpB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX,CAAC;MACDwC,IAAI,EAAEA,CAAA,KAAW;QACfrB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX,CAAC;MACDyC,QAAQ,EAAEA,CAAA,KAAW;QACnBtB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX,CAAC;MACD0C,SAAS,EAAEA,CAAA,KAAW;QACpBvB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"createWithPropertiesObjectSet.js","names":["invariant","modernToLegacyWhereClause","derivedPropertyDefinitionFactory","createWithPropertiesObjectSet","objectType","objectSet","definitionMap","fromBaseObjectSet","pivotTo","link","type","where","clause","rdpNames","Set","keys","aggregate","aggregation","opt","splitAggregation","split","length","process","env","NODE_ENV","aggregationPropertyName","aggregationOperation","aggregationOperationDefinition","selectedPropertyApiName","approximatePercentile","percentile","limit","undefined","wrappedObjectSet","operation","selectorResult","set","selectProperty","name","apiName","constant","double","integer","long","datetime","timestamp"],"sources":["createWithPropertiesObjectSet.ts"],"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 */\n\nimport type { DerivedProperty, ObjectOrInterfaceDefinition } from \"@osdk/api\";\nimport type {\n DerivedPropertyDefinition,\n ObjectSet as WireObjectSet,\n SelectedPropertyOperation,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { derivedPropertyDefinitionFactory } from \"./derivedPropertyDefinitionFactory.js\";\n\ntype WithConstSelect<Q extends ObjectOrInterfaceDefinition> =\n & DerivedProperty.SelectPropertyBuilder<Q, false>\n & {\n constant: DerivedProperty.Builder<Q, true>[\"constant\"];\n };\n\n/** @internal */\nexport function createWithPropertiesObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n>(\n objectType: Q,\n objectSet: WireObjectSet,\n definitionMap: Map<any, DerivedPropertyDefinition>,\n fromBaseObjectSet: boolean = false,\n): WithConstSelect<Q> {\n return {\n pivotTo: (link) => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"searchAround\",\n objectSet,\n link,\n }, definitionMap);\n },\n where: (clause) => {\n const rdpNames = new Set(definitionMap.keys());\n return createWithPropertiesObjectSet(objectType, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause, objectType, rdpNames),\n }, definitionMap);\n },\n aggregate: (aggregation: string, opt: any) => {\n const splitAggregation = aggregation.split(\":\");\n invariant(\n splitAggregation.length === 2 || splitAggregation[0] === \"$count\",\n \"Invalid aggregation format\",\n );\n const [aggregationPropertyName, aggregationOperation] = splitAggregation;\n let aggregationOperationDefinition: SelectedPropertyOperation;\n switch (aggregationOperation) {\n case \"sum\":\n case \"avg\":\n case \"min\":\n case \"max\":\n case \"exactDistinct\":\n case \"approximateDistinct\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n };\n break;\n case \"approximatePercentile\":\n aggregationOperationDefinition = {\n type: \"approximatePercentile\",\n selectedPropertyApiName: aggregationPropertyName,\n approximatePercentile: opt?.percentile ?? .5,\n };\n break;\n case \"collectSet\":\n case \"collectList\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n limit: opt?.limit ?? 100,\n };\n break;\n case undefined:\n if (aggregationPropertyName === \"$count\") {\n aggregationOperationDefinition = {\n type: \"count\",\n };\n break;\n }\n default:\n invariant(\n false,\n \"Invalid aggregation operation \" + aggregationOperation,\n );\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: aggregationOperationDefinition,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n selectProperty: (name) => {\n if (fromBaseObjectSet) {\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"property\",\n apiName: name,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: {\n type: \"get\",\n selectedPropertyApiName: name,\n },\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n constant: {\n double: (value) => {\n invariant(false, \"Not supported\");\n },\n integer: (value) => {\n invariant(false, \"Not supported\");\n },\n long: (value) => {\n invariant(false, \"Not supported\");\n },\n datetime: (value) => {\n invariant(false, \"Not supported\");\n },\n timestamp: (value) => {\n invariant(false, \"Not supported\");\n },\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,yBAAyB,QAAQ,sDAAsD;AAChG,SAASC,gCAAgC,QAAQ,uCAAuC;AAQxF;AACA,OAAO,SAASC,6BAA6BA,CAG3CC,UAAa,EACbC,SAAwB,EACxBC,aAAkD,EAClDC,iBAA0B,GAAG,KAAK,EACd;EACpB,OAAO;IACLC,OAAO,EAAGC,IAAI,IAAK;MACjB,OAAON,6BAA6B,CAACC,UAAU,EAAE;QAC/CM,IAAI,EAAE,cAAc;QACpBL,SAAS;QACTI;MACF,CAAC,EAAEH,aAAa,CAAC;IACnB,CAAC;IACDK,KAAK,EAAGC,MAAM,IAAK;MACjB,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAACR,aAAa,CAACS,IAAI,CAAC,CAAC,CAAC;MAC9C,OAAOZ,6BAA6B,CAACC,UAAU,EAAE;QAC/CM,IAAI,EAAE,QAAQ;QACdL,SAAS,EAAEA,SAAS;QACpBM,KAAK,EAAEV,yBAAyB,CAACW,MAAM,EAAER,UAAU,EAAES,QAAQ;MAC/D,CAAC,EAAEP,aAAa,CAAC;IACnB,CAAC;IACDU,SAAS,EAAEA,CAACC,WAAmB,EAAEC,GAAQ,KAAK;MAC5C,MAAMC,gBAAgB,GAAGF,WAAW,CAACG,KAAK,CAAC,GAAG,CAAC;MAC/C,EACED,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AAxB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX,CAAC;MACD6C,SAAS,EAAEA,CAAA,KAAW;QACpBvB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAxB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isOk","NULL_VALUE","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC","createObjectSpecifierFromPrimaryKey","extractPrimaryKeyFromObjectSpecifier"],"sources":["index.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\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { isOk, NULL_VALUE } from \"@osdk/api\";\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n Logger,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n\nexport {\n createObjectSpecifierFromPrimaryKey,\n extractPrimaryKeyFromObjectSpecifier,\n} from \"./util/objectSpecifierUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,EAAEC,UAAU,QAAQ,WAAW;AAsC5C,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B;AAErC,SACEC,mCAAmC,EACnCC,oCAAoC,QAC/B,gCAAgC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["isOk","NULL_VALUE","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC","createObjectSpecifierFromPrimaryKey","extractPrimaryKeyFromObjectSpecifier"],"sources":["index.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\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { isOk, NULL_VALUE } from \"@osdk/api\";\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n DerivedProperty,\n InterfaceDefinition,\n InterfaceMetadata,\n Logger,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n\nexport {\n createObjectSpecifierFromPrimaryKey,\n extractPrimaryKeyFromObjectSpecifier,\n} from \"./util/objectSpecifierUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,EAAEC,UAAU,QAAQ,WAAW;AAuC5C,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B;AAErC,SACEC,mCAAmC,EACnCC,oCAAoC,QAC/B,gCAAgC","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export function extractNamespace(fqApiName) {
18
+ const last = fqApiName.lastIndexOf(".");
19
+ if (last === -1) return [undefined, fqApiName];
20
+ return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];
21
+ }
22
+ //# sourceMappingURL=extractNamespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractNamespace.js","names":["extractNamespace","fqApiName","last","lastIndexOf","undefined","slice"],"sources":["extractNamespace.ts"],"sourcesContent":["/*\n * Copyright 2025 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 function extractNamespace(\n fqApiName: string,\n): [string | undefined, string] {\n const last = fqApiName.lastIndexOf(\".\");\n if (last === -1) return [undefined, fqApiName];\n return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,gBAAgBA,CAC9BC,SAAiB,EACa;EAC9B,MAAMC,IAAI,GAAGD,SAAS,CAACE,WAAW,CAAC,GAAG,CAAC;EACvC,IAAID,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,CAACE,SAAS,EAAEH,SAAS,CAAC;EAC9C,OAAO,CAACA,SAAS,CAACI,KAAK,CAAC,CAAC,EAAEH,IAAI,CAAC,EAAED,SAAS,CAACI,KAAK,CAACH,IAAI,GAAG,CAAC,CAAC,CAAC;AAC9D","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { extractNamespace } from "./extractNamespace.js";
18
+ export function fullyQualifyPropName(fieldName, objectOrInterface) {
19
+ if (objectOrInterface.type === "interface") {
20
+ const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);
21
+ const [fieldApiNamespace, fieldShortName] = extractNamespace(fieldName);
22
+ return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : fieldName;
23
+ }
24
+ return fieldName;
25
+ }
26
+ //# sourceMappingURL=fullyQualifyPropName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullyQualifyPropName.js","names":["extractNamespace","fullyQualifyPropName","fieldName","objectOrInterface","type","objApiNamespace","apiName","fieldApiNamespace","fieldShortName"],"sources":["fullyQualifyPropName.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { ObjectOrInterfaceDefinition } from \"@osdk/api\";\nimport { extractNamespace } from \"./extractNamespace.js\";\n\nexport function fullyQualifyPropName(\n fieldName: string,\n objectOrInterface: ObjectOrInterfaceDefinition,\n): string {\n if (objectOrInterface.type === \"interface\") {\n const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);\n const [fieldApiNamespace, fieldShortName] = extractNamespace(fieldName);\n return (fieldApiNamespace == null && objApiNamespace != null)\n ? `${objApiNamespace}.${fieldShortName}`\n : fieldName;\n }\n return fieldName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,SAASC,oBAAoBA,CAClCC,SAAiB,EACjBC,iBAA8C,EACtC;EACR,IAAIA,iBAAiB,CAACC,IAAI,KAAK,WAAW,EAAE;IAC1C,MAAM,CAACC,eAAe,CAAC,GAAGL,gBAAgB,CAACG,iBAAiB,CAACG,OAAO,CAAC;IACrE,MAAM,CAACC,iBAAiB,EAAEC,cAAc,CAAC,GAAGR,gBAAgB,CAACE,SAAS,CAAC;IACvE,OAAQK,iBAAiB,IAAI,IAAI,IAAIF,eAAe,IAAI,IAAI,GACxD,GAAGA,eAAe,IAAIG,cAAc,EAAE,GACtCN,SAAS;EACf;EACA,OAAOA,SAAS;AAClB","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export function makeGeoFilterBbox(bbox, filterType, propertyIdentifier, field) {
18
+ return {
19
+ type: filterType === "$within" ? "withinBoundingBox" : "intersectsBoundingBox",
20
+ /**
21
+ * This is a bit ugly, but did this so that propertyIdentifier only shows up in the return object if its defined,
22
+ * this makes it so we don't need to go update our entire test bed either to include a field which may change in near future.
23
+ * Once we solidify that this is the way forward, I can remove field and clean this up
24
+ */
25
+ ...(propertyIdentifier != null && {
26
+ propertyIdentifier
27
+ }),
28
+ field,
29
+ value: {
30
+ topLeft: {
31
+ type: "Point",
32
+ coordinates: [bbox[0], bbox[3]]
33
+ },
34
+ bottomRight: {
35
+ type: "Point",
36
+ coordinates: [bbox[2], bbox[1]]
37
+ }
38
+ }
39
+ };
40
+ }
41
+ //# sourceMappingURL=makeGeoFilterBbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeGeoFilterBbox.js","names":["makeGeoFilterBbox","bbox","filterType","propertyIdentifier","field","type","value","topLeft","coordinates","bottomRight"],"sources":["makeGeoFilterBbox.ts"],"sourcesContent":["/*\n * Copyright 2025 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 PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport type { BBox } from \"geojson\";\n\nexport function makeGeoFilterBbox(\n bbox: BBox,\n filterType: \"$within\" | \"$intersects\",\n propertyIdentifier?: PropertyIdentifier,\n field?: string,\n): SearchJsonQueryV2 {\n return {\n type: filterType === \"$within\"\n ? \"withinBoundingBox\"\n : \"intersectsBoundingBox\",\n /**\n * This is a bit ugly, but did this so that propertyIdentifier only shows up in the return object if its defined,\n * this makes it so we don't need to go update our entire test bed either to include a field which may change in near future.\n * Once we solidify that this is the way forward, I can remove field and clean this up\n */\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: {\n topLeft: {\n type: \"Point\",\n coordinates: [bbox[0], bbox[3]],\n },\n bottomRight: {\n type: \"Point\",\n coordinates: [bbox[2], bbox[1]],\n },\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAO,SAASA,iBAAiBA,CAC/BC,IAAU,EACVC,UAAqC,EACrCC,kBAAuC,EACvCC,KAAc,EACK;EACnB,OAAO;IACLC,IAAI,EAAEH,UAAU,KAAK,SAAS,GAC1B,mBAAmB,GACnB,uBAAuB;IAC3B;AACJ;AACA;AACA;AACA;IACI,IAAIC,kBAAkB,IAAI,IAAI,IAAI;MAAEA;IAAmB,CAAC,CAAC;IACzDC,KAAK;IACLE,KAAK,EAAE;MACLC,OAAO,EAAE;QACPF,IAAI,EAAE,OAAO;QACbG,WAAW,EAAE,CAACP,IAAI,CAAC,CAAC,CAAC,EAAEA,IAAI,CAAC,CAAC,CAAC;MAChC,CAAC;MACDQ,WAAW,EAAE;QACXJ,IAAI,EAAE,OAAO;QACbG,WAAW,EAAE,CAACP,IAAI,CAAC,CAAC,CAAC,EAAEA,IAAI,CAAC,CAAC,CAAC;MAChC;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { makeGeoFilterBbox } from "./makeGeoFilterBbox.js";
18
+ import { makeGeoFilterPolygon } from "./makeGeoFilterPolygon.js";
19
+ export function makeGeoFilterIntersects(intersectsBody, propertyIdentifier, field) {
20
+ if (Array.isArray(intersectsBody)) {
21
+ return makeGeoFilterBbox(intersectsBody, "$intersects", propertyIdentifier, field);
22
+ } else if ("$bbox" in intersectsBody && intersectsBody.$bbox != null) {
23
+ return makeGeoFilterBbox(intersectsBody.$bbox, "$intersects", propertyIdentifier, field);
24
+ } else {
25
+ const coordinates = "$polygon" in intersectsBody ? intersectsBody.$polygon : intersectsBody.coordinates;
26
+ return makeGeoFilterPolygon(coordinates, "intersectsPolygon", propertyIdentifier, field);
27
+ }
28
+ }
29
+ //# sourceMappingURL=makeGeoFilterIntersects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeGeoFilterIntersects.js","names":["makeGeoFilterBbox","makeGeoFilterPolygon","makeGeoFilterIntersects","intersectsBody","propertyIdentifier","field","Array","isArray","$bbox","coordinates","$polygon"],"sources":["makeGeoFilterIntersects.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { GeoFilterOptions } from \"@osdk/api\";\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport { makeGeoFilterBbox } from \"./makeGeoFilterBbox.js\";\nimport { makeGeoFilterPolygon } from \"./makeGeoFilterPolygon.js\";\n\nexport function makeGeoFilterIntersects(\n intersectsBody: GeoFilterOptions[\"$intersects\"],\n propertyIdentifier?: PropertyIdentifier,\n field?: string,\n): SearchJsonQueryV2 {\n if (Array.isArray(intersectsBody)) {\n return makeGeoFilterBbox(\n intersectsBody,\n \"$intersects\",\n propertyIdentifier,\n field,\n );\n } else if (\"$bbox\" in intersectsBody && intersectsBody.$bbox != null) {\n return makeGeoFilterBbox(\n intersectsBody.$bbox,\n \"$intersects\",\n propertyIdentifier,\n field,\n );\n } else {\n const coordinates = (\"$polygon\" in intersectsBody)\n ? intersectsBody.$polygon\n : intersectsBody.coordinates;\n return makeGeoFilterPolygon(\n coordinates,\n \"intersectsPolygon\",\n propertyIdentifier,\n field,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,OAAO,SAASC,uBAAuBA,CACrCC,cAA+C,EAC/CC,kBAAuC,EACvCC,KAAc,EACK;EACnB,IAAIC,KAAK,CAACC,OAAO,CAACJ,cAAc,CAAC,EAAE;IACjC,OAAOH,iBAAiB,CACtBG,cAAc,EACd,aAAa,EACbC,kBAAkB,EAClBC,KACF,CAAC;EACH,CAAC,MAAM,IAAI,OAAO,IAAIF,cAAc,IAAIA,cAAc,CAACK,KAAK,IAAI,IAAI,EAAE;IACpE,OAAOR,iBAAiB,CACtBG,cAAc,CAACK,KAAK,EACpB,aAAa,EACbJ,kBAAkB,EAClBC,KACF,CAAC;EACH,CAAC,MAAM;IACL,MAAMI,WAAW,GAAI,UAAU,IAAIN,cAAc,GAC7CA,cAAc,CAACO,QAAQ,GACvBP,cAAc,CAACM,WAAW;IAC9B,OAAOR,oBAAoB,CACzBQ,WAAW,EACX,mBAAmB,EACnBL,kBAAkB,EAClBC,KACF,CAAC;EACH;AACF","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field) {
18
+ return {
19
+ type: filterType,
20
+ ...(propertyIdentifier != null && {
21
+ propertyIdentifier
22
+ }),
23
+ field,
24
+ value: {
25
+ type: "Polygon",
26
+ coordinates
27
+ }
28
+ };
29
+ }
30
+ //# sourceMappingURL=makeGeoFilterPolygon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeGeoFilterPolygon.js","names":["makeGeoFilterPolygon","coordinates","filterType","propertyIdentifier","field","type","value"],"sources":["makeGeoFilterPolygon.ts"],"sourcesContent":["/*\n * Copyright 2025 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 PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport type { Position } from \"geojson\";\n\nexport function makeGeoFilterPolygon(\n coordinates: Position[][],\n filterType: \"intersectsPolygon\" | \"withinPolygon\",\n propertyIdentifier?: PropertyIdentifier,\n field?: string,\n): SearchJsonQueryV2 {\n return {\n type: filterType,\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: {\n type: \"Polygon\",\n coordinates,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAO,SAASA,oBAAoBA,CAClCC,WAAyB,EACzBC,UAAiD,EACjDC,kBAAuC,EACvCC,KAAc,EACK;EACnB,OAAO;IACLC,IAAI,EAAEH,UAAU;IAChB,IAAIC,kBAAkB,IAAI,IAAI,IAAI;MAAEA;IAAmB,CAAC,CAAC;IACzDC,KAAK;IACLE,KAAK,EAAE;MACLD,IAAI,EAAE,SAAS;MACfJ;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { DistanceUnitMapping } from "@osdk/api";
18
+ import { makeGeoFilterBbox } from "./makeGeoFilterBbox.js";
19
+ import { makeGeoFilterPolygon } from "./makeGeoFilterPolygon.js";
20
+ export function makeGeoFilterWithin(withinBody, propertyIdentifier, field) {
21
+ if (Array.isArray(withinBody)) {
22
+ return makeGeoFilterBbox(withinBody, "$within", propertyIdentifier, field);
23
+ } else if ("$bbox" in withinBody && withinBody.$bbox != null) {
24
+ return makeGeoFilterBbox(withinBody.$bbox, "$within", propertyIdentifier, field);
25
+ } else if ("$distance" in withinBody && "$of" in withinBody && withinBody.$distance != null && withinBody.$of != null) {
26
+ return {
27
+ type: "withinDistanceOf",
28
+ ...(propertyIdentifier != null && {
29
+ propertyIdentifier
30
+ }),
31
+ field,
32
+ value: {
33
+ center: Array.isArray(withinBody.$of) ? {
34
+ type: "Point",
35
+ coordinates: withinBody.$of
36
+ } : withinBody.$of,
37
+ distance: {
38
+ value: withinBody.$distance[0],
39
+ unit: DistanceUnitMapping[withinBody.$distance[1]]
40
+ }
41
+ }
42
+ };
43
+ } else {
44
+ const coordinates = "$polygon" in withinBody ? withinBody.$polygon : withinBody.coordinates;
45
+ return makeGeoFilterPolygon(coordinates, "withinPolygon", propertyIdentifier, field);
46
+ }
47
+ }
48
+ //# sourceMappingURL=makeGeoFilterWithin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeGeoFilterWithin.js","names":["DistanceUnitMapping","makeGeoFilterBbox","makeGeoFilterPolygon","makeGeoFilterWithin","withinBody","propertyIdentifier","field","Array","isArray","$bbox","$distance","$of","type","value","center","coordinates","distance","unit","$polygon"],"sources":["makeGeoFilterWithin.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { GeoFilterOptions } from \"@osdk/api\";\nimport { DistanceUnitMapping } from \"@osdk/api\";\nimport type {\n PropertyIdentifier,\n SearchJsonQueryV2,\n} from \"@osdk/foundry.ontologies\";\nimport { makeGeoFilterBbox } from \"./makeGeoFilterBbox.js\";\nimport { makeGeoFilterPolygon } from \"./makeGeoFilterPolygon.js\";\n\nexport function makeGeoFilterWithin(\n withinBody: GeoFilterOptions[\"$within\"],\n propertyIdentifier?: PropertyIdentifier,\n field?: string,\n): SearchJsonQueryV2 {\n if (Array.isArray(withinBody)) {\n return makeGeoFilterBbox(withinBody, \"$within\", propertyIdentifier, field);\n } else if (\"$bbox\" in withinBody && withinBody.$bbox != null) {\n return makeGeoFilterBbox(\n withinBody.$bbox,\n \"$within\",\n propertyIdentifier,\n field,\n );\n } else if (\n (\"$distance\" in withinBody && \"$of\" in withinBody)\n && withinBody.$distance != null\n && withinBody.$of != null\n ) {\n return {\n type: \"withinDistanceOf\",\n ...(propertyIdentifier != null && { propertyIdentifier }),\n field,\n value: {\n center: Array.isArray(withinBody.$of)\n ? {\n type: \"Point\",\n coordinates: withinBody.$of,\n }\n : withinBody.$of,\n distance: {\n value: withinBody.$distance[0],\n unit: DistanceUnitMapping[withinBody.$distance[1]],\n },\n },\n };\n } else {\n const coordinates = (\"$polygon\" in withinBody)\n ? withinBody.$polygon\n : withinBody.coordinates;\n return makeGeoFilterPolygon(\n coordinates,\n \"withinPolygon\",\n propertyIdentifier,\n field,\n );\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AAM;IACL,MAAMK,WAAW,GAAI,UAAU,IAAIX,UAAU,GACzCA,UAAU,CAACc,QAAQ,GACnBd,UAAU,CAACW,WAAW;IAC1B,OAAOb,oBAAoB,CACzBa,WAAW,EACX,eAAe,EACfV,kBAAkB,EAClBC,KACF,CAAC;EACH;AACF","ignoreList":[]}
@@ -14,86 +14,59 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { DistanceUnitMapping } from "@osdk/api";
18
17
  import invariant from "tiny-invariant";
19
- export function extractNamespace(fqApiName) {
20
- const last = fqApiName.lastIndexOf(".");
21
- if (last === -1) return [undefined, fqApiName];
22
- return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];
18
+ import { fullyQualifyPropName } from "./fullyQualifyPropName.js";
19
+ import { makeGeoFilterIntersects } from "./makeGeoFilterIntersects.js";
20
+ import { makeGeoFilterWithin } from "./makeGeoFilterWithin.js";
21
+ function isAndClause(whereClause) {
22
+ return "$and" in whereClause && whereClause.$and !== undefined;
23
+ }
24
+ function isOrClause(whereClause) {
25
+ return "$or" in whereClause && whereClause.$or !== undefined;
26
+ }
27
+ function isNotClause(whereClause) {
28
+ return "$not" in whereClause && whereClause.$not !== undefined;
23
29
  }
24
30
 
25
31
  /** @internal */
26
- export function modernToLegacyWhereClause(whereClause, objectOrInterface) {
27
- if ("$and" in whereClause) {
32
+ export function modernToLegacyWhereClause(whereClause, objectOrInterface, rdpNames) {
33
+ if (isAndClause(whereClause)) {
28
34
  return {
29
35
  type: "and",
30
- value: whereClause.$and.map(clause => modernToLegacyWhereClause(clause, objectOrInterface))
36
+ value: whereClause.$and.map(clause => modernToLegacyWhereClause(clause, objectOrInterface, rdpNames))
31
37
  };
32
- } else if ("$or" in whereClause) {
38
+ } else if (isOrClause(whereClause)) {
33
39
  return {
34
40
  type: "or",
35
- value: whereClause.$or.map(clause => modernToLegacyWhereClause(clause, objectOrInterface))
41
+ value: whereClause.$or.map(clause => modernToLegacyWhereClause(clause, objectOrInterface, rdpNames))
36
42
  };
37
- } else if ("$not" in whereClause) {
43
+ } else if (isNotClause(whereClause)) {
38
44
  return {
39
45
  type: "not",
40
- value: modernToLegacyWhereClause(whereClause.$not, objectOrInterface)
46
+ value: modernToLegacyWhereClause(whereClause.$not, objectOrInterface, rdpNames)
41
47
  };
42
48
  }
43
49
  const parts = Object.entries(whereClause);
44
50
  if (parts.length === 1) {
45
- return handleWherePair(parts[0], objectOrInterface);
51
+ return handleWherePair(parts[0], objectOrInterface, undefined, rdpNames);
46
52
  }
47
53
  return {
48
54
  type: "and",
49
- value: parts.map(v => handleWherePair(v, objectOrInterface))
50
- };
51
- }
52
- function makeGeoFilterBbox(bbox, filterType, propertyIdentifier, field) {
53
- return {
54
- type: filterType === "$within" ? "withinBoundingBox" : "intersectsBoundingBox",
55
- /**
56
- * This is a bit ugly, but did this so that propertyIdentifier only shows up in the return object if its defined,
57
- * this makes it so we don't need to go update our entire test bed either to include a field which may change in near future.
58
- * Once we solidify that this is the way forward, I can remove field and clean this up
59
- */
60
- ...(propertyIdentifier != null && {
61
- propertyIdentifier
62
- }),
63
- field,
64
- value: {
65
- topLeft: {
66
- type: "Point",
67
- coordinates: [bbox[0], bbox[3]]
68
- },
69
- bottomRight: {
70
- type: "Point",
71
- coordinates: [bbox[2], bbox[1]]
72
- }
73
- }
74
- };
75
- }
76
- function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field) {
77
- return {
78
- type: filterType,
79
- ...(propertyIdentifier != null && {
80
- propertyIdentifier
81
- }),
82
- field,
83
- value: {
84
- type: "Polygon",
85
- coordinates
86
- }
55
+ value: parts.map(v => handleWherePair(v, objectOrInterface, undefined, rdpNames))
87
56
  };
88
57
  }
89
- function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {
58
+ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector, rdpNames) {
90
59
  !(filter != null) ? process.env.NODE_ENV !== "production" ? invariant(false, "Defined key values are only allowed when they are not undefined.") : invariant(false) : void 0;
91
- const propertyIdentifier = structFieldSelector != null ? {
60
+ const isRdp = !structFieldSelector && rdpNames?.has(fieldName);
61
+ const propertyIdentifier = isRdp ? {
62
+ type: "property",
63
+ apiName: fieldName
64
+ } : structFieldSelector != null ? {
92
65
  type: "structField",
93
66
  ...structFieldSelector,
94
67
  propertyApiName: fullyQualifyPropName(structFieldSelector.propertyApiName, objectOrInterface)
95
68
  } : undefined;
96
- const field = structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : undefined;
69
+ const field = !isRdp && structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : undefined;
97
70
  if (typeof filter === "string" || typeof filter === "number" || typeof filter === "boolean") {
98
71
  return {
99
72
  type: "eq",
@@ -117,7 +90,7 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
117
90
  return handleWherePair(Object.entries(filter)[0], objectOrInterface, {
118
91
  propertyApiName: fieldName,
119
92
  structFieldApiName
120
- });
93
+ }, rdpNames);
121
94
  }
122
95
  const firstKey = keysOfFilter[0];
123
96
  !(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
@@ -135,44 +108,10 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
135
108
  };
136
109
  }
137
110
  if (firstKey === "$within") {
138
- const withinBody = filter[firstKey];
139
- if (Array.isArray(withinBody)) {
140
- return makeGeoFilterBbox(withinBody, firstKey, propertyIdentifier, field);
141
- } else if ("$bbox" in withinBody && withinBody.$bbox != null) {
142
- return makeGeoFilterBbox(withinBody.$bbox, firstKey, propertyIdentifier, field);
143
- } else if ("$distance" in withinBody && "$of" in withinBody && withinBody.$distance != null && withinBody.$of != null) {
144
- return {
145
- type: "withinDistanceOf",
146
- ...(propertyIdentifier != null && {
147
- propertyIdentifier
148
- }),
149
- field,
150
- value: {
151
- center: Array.isArray(withinBody.$of) ? {
152
- type: "Point",
153
- coordinates: withinBody.$of
154
- } : withinBody.$of,
155
- distance: {
156
- value: withinBody.$distance[0],
157
- unit: DistanceUnitMapping[withinBody.$distance[1]]
158
- }
159
- }
160
- };
161
- } else {
162
- const coordinates = "$polygon" in withinBody ? withinBody.$polygon : withinBody.coordinates;
163
- return makeGeoFilterPolygon(coordinates, "withinPolygon", propertyIdentifier, fieldName);
164
- }
111
+ return makeGeoFilterWithin(filter[firstKey], propertyIdentifier, field);
165
112
  }
166
113
  if (firstKey === "$intersects") {
167
- const intersectsBody = filter[firstKey];
168
- if (Array.isArray(intersectsBody)) {
169
- return makeGeoFilterBbox(intersectsBody, firstKey, propertyIdentifier, field);
170
- } else if ("$bbox" in intersectsBody && intersectsBody.$bbox != null) {
171
- return makeGeoFilterBbox(intersectsBody.$bbox, firstKey, propertyIdentifier, field);
172
- } else {
173
- const coordinates = "$polygon" in intersectsBody ? intersectsBody.$polygon : intersectsBody.coordinates;
174
- return makeGeoFilterPolygon(coordinates, "intersectsPolygon", propertyIdentifier, field);
175
- }
114
+ return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);
176
115
  }
177
116
  if (firstKey === "$containsAllTerms" || firstKey === "$containsAnyTerm") {
178
117
  return {
@@ -209,12 +148,4 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
209
148
  value: filter[firstKey]
210
149
  };
211
150
  }
212
- function fullyQualifyPropName(fieldName, objectOrInterface) {
213
- if (objectOrInterface.type === "interface") {
214
- const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);
215
- const [fieldApiNamespace, fieldShortName] = extractNamespace(fieldName);
216
- return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : fieldName;
217
- }
218
- return fieldName;
219
- }
220
151
  //# sourceMappingURL=modernToLegacyWhereClause.js.map