@osdk/client 2.1.0-beta.21 → 2.1.0-beta.23

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 (146) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/build/browser/Client.d.ts.map +1 -1
  3. package/build/browser/__unstable/ConjureSupport.d.ts +18 -35
  4. package/build/browser/__unstable/ConjureSupport.d.ts.map +1 -1
  5. package/build/browser/__unstable/ConjureSupport.js +4 -1
  6. package/build/browser/__unstable/ConjureSupport.js.map +1 -1
  7. package/build/browser/actions/actions.test.js +20 -4
  8. package/build/browser/actions/actions.test.js.map +1 -1
  9. package/build/browser/actions/applyAction.d.ts +1 -1
  10. package/build/browser/actions/applyAction.d.ts.map +1 -1
  11. package/build/browser/createClient.d.ts.map +1 -1
  12. package/build/browser/createClient.js +2 -0
  13. package/build/browser/createClient.js.map +1 -1
  14. package/build/browser/createClient.test.js +1 -1
  15. package/build/browser/createClient.test.js.map +1 -1
  16. package/build/browser/createGeotimeSeriesProperty.d.ts.map +1 -1
  17. package/build/browser/createGeotimeSeriesProperty.js +3 -1
  18. package/build/browser/createGeotimeSeriesProperty.js.map +1 -1
  19. package/build/browser/createMediaReferenceProperty.d.ts +14 -0
  20. package/build/browser/createMediaReferenceProperty.d.ts.map +1 -0
  21. package/build/browser/createMediaReferenceProperty.js +46 -0
  22. package/build/browser/createMediaReferenceProperty.js.map +1 -0
  23. package/build/browser/createTimeseriesProperty.d.ts.map +1 -1
  24. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js +1 -1
  25. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
  26. package/build/browser/intellisense.test.js +1 -1
  27. package/build/browser/intellisense.test.js.map +1 -1
  28. package/build/browser/object/Cache.test.js +1 -1
  29. package/build/browser/object/Cache.test.js.map +1 -1
  30. package/build/browser/object/aggregate.test.js +1 -1
  31. package/build/browser/object/aggregate.test.js.map +1 -1
  32. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +17 -1
  33. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
  34. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +2 -1
  35. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
  36. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +10 -1
  37. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  38. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
  39. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +1 -1
  40. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
  41. package/build/browser/object/convertWireToOsdkObjects.test.js +18 -0
  42. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
  43. package/build/browser/object/media.test.d.ts +2 -0
  44. package/build/browser/object/media.test.d.ts.map +1 -0
  45. package/build/browser/object/media.test.js +54 -0
  46. package/build/browser/object/media.test.js.map +1 -0
  47. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +9 -7
  48. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  49. package/build/browser/ontology/OntologyProvider.d.ts.map +1 -1
  50. package/build/browser/pageRequestAsAsyncIter.d.ts.map +1 -1
  51. package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts +2 -2
  52. package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -1
  53. package/build/browser/public-utils/createAndFetchTempObjectSetRid.js +1 -1
  54. package/build/browser/public-utils/createAndFetchTempObjectSetRid.js.map +1 -1
  55. package/build/browser/public-utils/hydrateAttachmentFromRid.d.ts +1 -1
  56. package/build/browser/public-utils/hydrateAttachmentFromRid.js +1 -1
  57. package/build/browser/public-utils/hydrateAttachmentFromRid.js.map +1 -1
  58. package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts +7 -7
  59. package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -1
  60. package/build/browser/public-utils/hydrateObjectSetFromRid.js +5 -5
  61. package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -1
  62. package/build/browser/tsserver.d.ts +6 -8
  63. package/build/browser/tsserver.d.ts.map +1 -1
  64. package/build/browser/tsserver.js.map +1 -1
  65. package/build/browser/util/UserAgent.d.ts.map +1 -1
  66. package/build/browser/util/UserAgent.js +1 -1
  67. package/build/browser/util/datetimeConverters.d.ts.map +1 -1
  68. package/build/browser/util/streamutils.d.ts.map +1 -1
  69. package/build/browser/util/timeseriesUtils.d.ts.map +1 -1
  70. package/build/esm/Client.d.ts.map +1 -1
  71. package/build/esm/__unstable/ConjureSupport.d.ts +18 -35
  72. package/build/esm/__unstable/ConjureSupport.d.ts.map +1 -1
  73. package/build/esm/__unstable/ConjureSupport.js +4 -1
  74. package/build/esm/__unstable/ConjureSupport.js.map +1 -1
  75. package/build/esm/actions/actions.test.js +20 -4
  76. package/build/esm/actions/actions.test.js.map +1 -1
  77. package/build/esm/actions/applyAction.d.ts +1 -1
  78. package/build/esm/actions/applyAction.d.ts.map +1 -1
  79. package/build/esm/createClient.d.ts.map +1 -1
  80. package/build/esm/createClient.js +2 -0
  81. package/build/esm/createClient.js.map +1 -1
  82. package/build/esm/createClient.test.js +1 -1
  83. package/build/esm/createClient.test.js.map +1 -1
  84. package/build/esm/createGeotimeSeriesProperty.d.ts.map +1 -1
  85. package/build/esm/createGeotimeSeriesProperty.js +3 -1
  86. package/build/esm/createGeotimeSeriesProperty.js.map +1 -1
  87. package/build/esm/createMediaReferenceProperty.d.ts +14 -0
  88. package/build/esm/createMediaReferenceProperty.d.ts.map +1 -0
  89. package/build/esm/createMediaReferenceProperty.js +46 -0
  90. package/build/esm/createMediaReferenceProperty.js.map +1 -0
  91. package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
  92. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +1 -1
  93. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
  94. package/build/esm/intellisense.test.js +1 -1
  95. package/build/esm/intellisense.test.js.map +1 -1
  96. package/build/esm/object/Cache.test.js +1 -1
  97. package/build/esm/object/Cache.test.js.map +1 -1
  98. package/build/esm/object/aggregate.test.js +1 -1
  99. package/build/esm/object/aggregate.test.js.map +1 -1
  100. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +17 -1
  101. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
  102. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +2 -1
  103. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
  104. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +10 -1
  105. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  106. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
  107. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +1 -1
  108. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
  109. package/build/esm/object/convertWireToOsdkObjects.test.js +18 -0
  110. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
  111. package/build/esm/object/media.test.d.ts +2 -0
  112. package/build/esm/object/media.test.d.ts.map +1 -0
  113. package/build/esm/object/media.test.js +54 -0
  114. package/build/esm/object/media.test.js.map +1 -0
  115. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +9 -7
  116. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  117. package/build/esm/ontology/OntologyProvider.d.ts.map +1 -1
  118. package/build/esm/pageRequestAsAsyncIter.d.ts.map +1 -1
  119. package/build/esm/public-utils/createAndFetchTempObjectSetRid.d.ts +2 -2
  120. package/build/esm/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -1
  121. package/build/esm/public-utils/createAndFetchTempObjectSetRid.js +1 -1
  122. package/build/esm/public-utils/createAndFetchTempObjectSetRid.js.map +1 -1
  123. package/build/esm/public-utils/hydrateAttachmentFromRid.d.ts +1 -1
  124. package/build/esm/public-utils/hydrateAttachmentFromRid.js +1 -1
  125. package/build/esm/public-utils/hydrateAttachmentFromRid.js.map +1 -1
  126. package/build/esm/public-utils/hydrateObjectSetFromRid.d.ts +7 -7
  127. package/build/esm/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -1
  128. package/build/esm/public-utils/hydrateObjectSetFromRid.js +5 -5
  129. package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -1
  130. package/build/esm/tsserver.d.ts +6 -8
  131. package/build/esm/tsserver.d.ts.map +1 -1
  132. package/build/esm/tsserver.js.map +1 -1
  133. package/build/esm/util/UserAgent.d.ts.map +1 -1
  134. package/build/esm/util/UserAgent.js +1 -1
  135. package/build/esm/util/datetimeConverters.d.ts.map +1 -1
  136. package/build/esm/util/streamutils.d.ts.map +1 -1
  137. package/build/esm/util/timeseriesUtils.d.ts.map +1 -1
  138. package/package.json +13 -13
  139. package/build/browser/objectSet/toConjureObjectSet.d.ts +0 -2
  140. package/build/browser/objectSet/toConjureObjectSet.d.ts.map +0 -1
  141. package/build/browser/objectSet/toConjureObjectSet.js +0 -167
  142. package/build/browser/objectSet/toConjureObjectSet.js.map +0 -1
  143. package/build/esm/objectSet/toConjureObjectSet.d.ts +0 -2
  144. package/build/esm/objectSet/toConjureObjectSet.d.ts.map +0 -1
  145. package/build/esm/objectSet/toConjureObjectSet.js +0 -167
  146. package/build/esm/objectSet/toConjureObjectSet.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"hydrateAttachmentFromRid.js","names":["OntologiesV2","additionalContext","hydrateAttachmentFromRid","client","rid","hydrateAttachmentFromRidInternal","fetchContents","Attachments","read","fetchMetadata","r","get","sizeBytes","Number"],"sources":["hydrateAttachmentFromRid.js"],"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 * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { additionalContext } from \"../Client.js\";\n/**\n * Helper function to create an attachment type from a rid\n * @param client - An OSDK client.\n * @param rid - The rid of attachment in Foundry.\n * @returns\n */\nexport function hydrateAttachmentFromRid(client, rid) {\n return hydrateAttachmentFromRidInternal(client[additionalContext], rid);\n}\n/** @internal */\nexport function hydrateAttachmentFromRidInternal(client, rid) {\n return {\n rid,\n async fetchContents() {\n return OntologiesV2.Attachments.read(client, rid);\n },\n async fetchMetadata() {\n const r = await OntologiesV2.Attachments.get(client, rid);\n return {\n ...r,\n sizeBytes: Number(r.sizeBytes),\n };\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,iBAAiB,QAAQ,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAACC,MAAM,EAAEC,GAAG,EAAE;EAClD,OAAOC,gCAAgC,CAACF,MAAM,CAACF,iBAAiB,CAAC,EAAEG,GAAG,CAAC;AAC3E;AACA;AACA,OAAO,SAASC,gCAAgCA,CAACF,MAAM,EAAEC,GAAG,EAAE;EAC1D,OAAO;IACHA,GAAG;IACH,MAAME,aAAaA,CAAA,EAAG;MAClB,OAAON,YAAY,CAACO,WAAW,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;IACrD,CAAC;IACD,MAAMK,aAAaA,CAAA,EAAG;MAClB,MAAMC,CAAC,GAAG,MAAMV,YAAY,CAACO,WAAW,CAACI,GAAG,CAACR,MAAM,EAAEC,GAAG,CAAC;MACzD,OAAO;QACH,GAAGM,CAAC;QACJE,SAAS,EAAEC,MAAM,CAACH,CAAC,CAACE,SAAS;MACjC,CAAC;IACL;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"hydrateAttachmentFromRid.js","names":["OntologiesV2","additionalContext","hydrateAttachmentFromRid","client","rid","hydrateAttachmentFromRidInternal","fetchContents","Attachments","read","fetchMetadata","r","get","sizeBytes","Number"],"sources":["hydrateAttachmentFromRid.js"],"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 * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { additionalContext } from \"../Client.js\";\n/**\n * Helper function to create an attachment type from a rid\n * @param client - An OSDK client.\n * @param rid - The rid of attachment in Foundry.\n * @returns An OSDK attachment object\n */\nexport function hydrateAttachmentFromRid(client, rid) {\n return hydrateAttachmentFromRidInternal(client[additionalContext], rid);\n}\n/** @internal */\nexport function hydrateAttachmentFromRidInternal(client, rid) {\n return {\n rid,\n async fetchContents() {\n return OntologiesV2.Attachments.read(client, rid);\n },\n async fetchMetadata() {\n const r = await OntologiesV2.Attachments.get(client, rid);\n return {\n ...r,\n sizeBytes: Number(r.sizeBytes),\n };\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,iBAAiB,QAAQ,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAACC,MAAM,EAAEC,GAAG,EAAE;EAClD,OAAOC,gCAAgC,CAACF,MAAM,CAACF,iBAAiB,CAAC,EAAEG,GAAG,CAAC;AAC3E;AACA;AACA,OAAO,SAASC,gCAAgCA,CAACF,MAAM,EAAEC,GAAG,EAAE;EAC1D,OAAO;IACHA,GAAG;IACH,MAAME,aAAaA,CAAA,EAAG;MAClB,OAAON,YAAY,CAACO,WAAW,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;IACrD,CAAC;IACD,MAAMK,aAAaA,CAAA,EAAG;MAClB,MAAMC,CAAC,GAAG,MAAMV,YAAY,CAACO,WAAW,CAACI,GAAG,CAACR,MAAM,EAAEC,GAAG,CAAC;MACzD,OAAO;QACH,GAAGM,CAAC;QACJE,SAAS,EAAEC,MAAM,CAACH,CAAC,CAACE,SAAS;MACjC,CAAC;IACL;EACJ,CAAC;AACL","ignoreList":[]}
@@ -1,11 +1,11 @@
1
- import type { ObjectOrInterfaceDefinition } from "@osdk/api";
1
+ import type { ObjectOrInterfaceDefinition, ObjectSet } from "@osdk/api";
2
2
  import type { Client } from "../Client.js";
3
3
  /**
4
- * Creates an OSDK object set from a temporary object set RID.
5
- * @param client An OSDK client.
6
- * @param definition An OSDK object or interface definition.
7
- * @param rid The RID of the temporary object set.
8
- * @returns
4
+ * Creates an OSDK object set from an object set RID.
5
+ * @param client - An OSDK client.
6
+ * @param definition - An OSDK object or interface definition.
7
+ * @param rid - The RID of an object set.
8
+ * @returns An OSDK object set.
9
9
  */
10
- export declare function hydrateObjectSetFromRid<T extends ObjectOrInterfaceDefinition>(client: Client, definition: T, rid: string): import("@osdk/api").ObjectSet<T, any>;
10
+ export declare function hydrateObjectSetFromRid<T extends ObjectOrInterfaceDefinition>(client: Client, definition: T, rid: string): ObjectSet<T>;
11
11
  //# sourceMappingURL=hydrateObjectSetFromRid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hydrateObjectSetFromRid.d.ts","sourceRoot":"","sources":["../../../src/public-utils/hydrateObjectSetFromRid.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,2BAA2B,EAC3E,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,CAAC,EACb,GAAG,EAAE,MAAM,yCAmBZ"}
1
+ {"version":3,"file":"hydrateObjectSetFromRid.d.ts","sourceRoot":"","sources":["../../../src/public-utils/hydrateObjectSetFromRid.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,2BAA2B,EAC3E,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,CAAC,EACb,GAAG,EAAE,MAAM,GACV,SAAS,CAAC,CAAC,CAAC,CAkBd"}
@@ -16,11 +16,11 @@
16
16
  import { additionalContext } from "../Client.js";
17
17
  import { createObjectSet } from "../objectSet/createObjectSet.js";
18
18
  /**
19
- * Creates an OSDK object set from a temporary object set RID.
20
- * @param client An OSDK client.
21
- * @param definition An OSDK object or interface definition.
22
- * @param rid The RID of the temporary object set.
23
- * @returns
19
+ * Creates an OSDK object set from an object set RID.
20
+ * @param client - An OSDK client.
21
+ * @param definition - An OSDK object or interface definition.
22
+ * @param rid - The RID of an object set.
23
+ * @returns An OSDK object set.
24
24
  */
25
25
  export function hydrateObjectSetFromRid(client, definition, rid) {
26
26
  return createObjectSet(definition, client[additionalContext], {
@@ -1 +1 @@
1
- {"version":3,"file":"hydrateObjectSetFromRid.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromRid","client","definition","rid","type","objectSets","objectType","apiName","reference"],"sources":["hydrateObjectSetFromRid.js"],"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 */\nimport { additionalContext } from \"../Client.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\n/**\n * Creates an OSDK object set from a temporary object set RID.\n * @param client An OSDK client.\n * @param definition An OSDK object or interface definition.\n * @param rid The RID of the temporary object set.\n * @returns\n */\nexport function hydrateObjectSetFromRid(client, definition, rid) {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAChD,SAASC,eAAe,QAAQ,iCAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,MAAM,EAAEC,UAAU,EAAEC,GAAG,EAAE;EAC7D,OAAOJ,eAAe,CAACG,UAAU,EAAED,MAAM,CAACH,iBAAiB,CAAC,EAAE;IAC1DM,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,CACR;MACID,IAAI,EAAE,MAAM;MACZE,UAAU,EAAEJ,UAAU,CAACK;IAC3B,CAAC,EACD;MACIH,IAAI,EAAE,WAAW;MACjBI,SAAS,EAAEL;IACf,CAAC;EAET,CAAC,CAAC;AACN","ignoreList":[]}
1
+ {"version":3,"file":"hydrateObjectSetFromRid.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromRid","client","definition","rid","type","objectSets","objectType","apiName","reference"],"sources":["hydrateObjectSetFromRid.js"],"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 */\nimport { additionalContext } from \"../Client.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\n/**\n * Creates an OSDK object set from an object set RID.\n * @param client - An OSDK client.\n * @param definition - An OSDK object or interface definition.\n * @param rid - The RID of an object set.\n * @returns An OSDK object set.\n */\nexport function hydrateObjectSetFromRid(client, definition, rid) {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAChD,SAASC,eAAe,QAAQ,iCAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,MAAM,EAAEC,UAAU,EAAEC,GAAG,EAAE;EAC7D,OAAOJ,eAAe,CAACG,UAAU,EAAED,MAAM,CAACH,iBAAiB,CAAC,EAAE;IAC1DM,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,CACR;MACID,IAAI,EAAE,MAAM;MACZE,UAAU,EAAEJ,UAAU,CAACK;IAC3B,CAAC,EACD;MACIH,IAAI,EAAE,WAAW;MACjBI,SAAS,EAAEL;IACf,CAAC;EAET,CAAC,CAAC;AACN","ignoreList":[]}
@@ -2,6 +2,10 @@ import type { Subprocess } from "execa";
2
2
  import { EventEmitter } from "node:events";
3
3
  import { server as s } from "typescript";
4
4
  import type { Logger } from "./Logger.js";
5
+ type RequestFn<T extends s.protocol.Request, X extends s.protocol.Response = never> = (args: T["arguments"]) => Promise<{
6
+ req: T;
7
+ resp: X;
8
+ }>;
5
9
  declare class TsServerImpl extends EventEmitter<{
6
10
  exit: [];
7
11
  }> {
@@ -14,14 +18,8 @@ declare class TsServerImpl extends EventEmitter<{
14
18
  start(): Promise<this>;
15
19
  stop(): void;
16
20
  getOneMessage<X>(filter?: (m: unknown) => m is X): Promise<X>;
17
- sendOpenRequest: (args: s.protocol.OpenRequestArgs) => Promise<{
18
- req: s.protocol.OpenRequest;
19
- resp: never;
20
- }>;
21
- sendQuickInfoRequest: (args: s.protocol.FileLocationRequestArgs) => Promise<{
22
- req: s.protocol.QuickInfoRequest;
23
- resp: s.protocol.QuickInfoResponse;
24
- }>;
21
+ sendOpenRequest: RequestFn<s.protocol.OpenRequest>;
22
+ sendQuickInfoRequest: RequestFn<s.protocol.QuickInfoRequest, s.protocol.QuickInfoResponse>;
25
23
  }
26
24
  export type TsServer = Omit<TsServerImpl, Exclude<keyof EventEmitter, "on" | "addListener" | "off" | "once" | "removeListener" | "removeAllListeners">>;
27
25
  export declare function startTsServer(logger: Logger): Promise<TsServer>;
@@ -1 +1 @@
1
- {"version":3,"file":"tsserver.d.ts","sourceRoot":"","sources":["../../src/tsserver.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,OAAO,EAAE,MAAM,IAAI,C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,CAC7B,CAGC;CA+BH;AAED,MAAM,MAAM,QAAQ,GAAG,IAAI,CACzB,YAAY,EACZ,OAAO,CACL,MAAM,YAAY,EAChB,IAAI,GACJ,aAAa,GACb,KAAK,GACL,MAAM,GACN,gBAAgB,GAChB,oBAAoB,CACvB,CACF,CAAC;AAEF,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAKrE;AA4BD,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAGzD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAG/D;AAED,wBAAgB,qBAAqB,CACnC,CAAC,EAAE,OAAO,GACT,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAE1C;AACD,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,OAAO,GACT,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAE1C;AACD,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,OAAO,EACV,UAAU,CAAC,EAAE,MAAM,GAClB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAInC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","process","env","NODE_ENV","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","m","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.js"],"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 { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n }) `${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({ filter });\n }\n #requestFactory = (command, isResponse) => async (args) => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n };\n this.#logger.trace({ req }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }),\n };\n }\n return { req, resp: undefined };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async (dir) => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n }\n catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m) && m.command === s.protocol.CommandTypes.Quickinfo\n && (requestSeq == null || m.request_seq === requestSeq);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MA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AK,QAAQ,IAAI,MAAM,IAAIA,CAAC,IAC5CA,CAAC,CAACvB,IAAI,KAAK,UAAU,CAAC;AACjC;AACA,OAAO,SAASwB,qBAAqBA,CAACD,CAAC,EAAE;EACrC,OAAOD,OAAO,CAACC,CAAC,CAAC,IAAIA,CAAC,CAACE,KAAK,KAAK,qBAAqB;AAC1D;AACA,OAAO,SAASC,mBAAmBA,CAACH,CAAC,EAAE;EACnC,OAAOD,OAAO,CAACC,CAAC,CAAC,IAAIA,CAAC,CAACE,KAAK,KAAK,sBAAsB;AAC3D;AACA,OAAO,SAAS5B,mBAAmBA,CAAC0B,CAAC,EAAEI,UAAU,EAAE;EAC/C,OAAOvC,UAAU,CAACmC,CAAC,CAAC,IAAIA,CAAC,CAACpC,OAAO,KAAKvB,CAAC,CAAC4B,QAAQ,CAACC,YAAY,CAACG,SAAS,KAC/D+B,UAAU,IAAI,IAAI,IAAIJ,CAAC,CAACK,WAAW,KAAKD,UAAU,CAAC;AAC/D","ignoreList":[]}
1
+ {"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","process","env","NODE_ENV","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","m","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.js"],"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 { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n }) `${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({ filter });\n }\n #requestFactory = (command, isResponse) => async (args) => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n };\n this.#logger.trace({ req }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }),\n };\n }\n return { req, resp: undefined };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async (dir) => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n }\n catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m)\n && m.command === s.protocol.CommandTypes.Quickinfo\n && (requestSeq == null || m.request_seq === requestSeq);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,OAAO,MAAM,UAAU;AAC9B,OAAOC,IAAI,MAAM,OAAO;AACxB,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,MAAM,IAAIC,CAAC,QAAQ,YAAY;AACxC,MAAMC,YAAY,SAASR,YAAY,CAAC;EACpC,CAACS,YAA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AAqB;AAC1D;AACA,OAAO,SAASC,mBAAmBA,CAACH,CAAC,EAAE;EACnC,OAAOD,OAAO,CAACC,CAAC,CAAC,IAAIA,CAAC,CAACE,KAAK,KAAK,sBAAsB;AAC3D;AACA,OAAO,SAAS5B,mBAAmBA,CAAC0B,CAAC,EAAEI,UAAU,EAAE;EAC/C,OAAOvC,UAAU,CAACmC,CAAC,CAAC,IACbA,CAAC,CAACpC,OAAO,KAAKvB,CAAC,CAAC4B,QAAQ,CAACC,YAAY,CAACG,SAAS,KAC9C+B,UAAU,IAAI,IAAI,IAAIJ,CAAC,CAACK,WAAW,KAAKD,UAAU,CAAC;AAC/D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.d.ts","sourceRoot":"","sources":["../../../src/util/UserAgent.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU,QAA+C,CAAC"}
1
+ {"version":3,"file":"UserAgent.d.ts","sourceRoot":"","sources":["../../../src/util/UserAgent.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU,EAAE,MAAqD,CAAC"}
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export const USER_AGENT = `osdk-client/${"2.1.0-beta.21"}`;
16
+ export const USER_AGENT = `osdk-client/${"2.1.0-beta.23"}`;
17
17
  //# sourceMappingURL=UserAgent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"datetimeConverters.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,WAU3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,WAE1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,IAAI,WAEhD,CAAC"}
1
+ {"version":3,"file":"datetimeConverters.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,KAAG,MAU9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,KAAG,MAE7C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,IAAI,KAAG,MAEnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"streamutils.d.ts","sourceRoot":"","sources":["../../../src/util/streamutils.ts"],"names":[],"mappings":"AAoBA,wBAAuB,qBAAqB,CAC1C,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,sCA+DzC;AA8BD,wBAAuB,qBAAqB,CAC1C,cAAc,EAAE,2BAA2B,CAAC,UAAU,CAAC,6CAOxD"}
1
+ {"version":3,"file":"streamutils.d.ts","sourceRoot":"","sources":["../../../src/util/streamutils.ts"],"names":[],"mappings":"AAoBA,wBAAuB,qBAAqB,CAC1C,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,GACvC,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CA8DpC;AA8BD,wBAAuB,qBAAqB,CAC1C,cAAc,EAAE,2BAA2B,CAAC,UAAU,CAAC,GACtD,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAM3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"timeseriesUtils.d.ts","sourceRoot":"","sources":["../../../src/util/timeseriesUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,CAyB7D;AAED,wBAAuB,qBAAqB,CAC1C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,EAEzC,QAAQ,EAAE,QAAQ;;WAQQ,CAAC;kBAG5B"}
1
+ {"version":3,"file":"timeseriesUtils.d.ts","sourceRoot":"","sources":["../../../src/util/timeseriesUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,CAyB7D;AAED,wBAAuB,qBAAqB,CAC1C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,EAEzC,QAAQ,EAAE,QAAQ,GACjB,cAAc,CACf;IACE,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,CAAC,CAAC;CACV,EACD,IAAI,EACJ,OAAO,CACR,CAUA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/client",
3
- "version": "2.1.0-beta.21",
3
+ "version": "2.1.0-beta.23",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -21,8 +21,8 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@osdk/internal.foundry.core": "2.8.0",
25
- "@osdk/internal.foundry.ontologiesv2": "2.8.0",
24
+ "@osdk/internal.foundry.core": "2.9.0",
25
+ "@osdk/internal.foundry.ontologiesv2": "2.9.0",
26
26
  "@osdk/shared.client": "^1.0.1",
27
27
  "@osdk/shared.client2": "^1.0.0",
28
28
  "@types/geojson": "^7946.0.14",
@@ -34,16 +34,16 @@
34
34
  "tiny-invariant": "^1.3.1",
35
35
  "type-fest": "^4.18.2",
36
36
  "ws": "^8.18.0",
37
- "@osdk/api": "~2.1.0-beta.21",
38
- "@osdk/client.unstable": "2.1.0-beta.21",
39
- "@osdk/generator-converters": "2.1.0-beta.21",
37
+ "@osdk/client.unstable": "2.1.0-beta.23",
38
+ "@osdk/generator-converters": "2.1.0-beta.23",
39
+ "@osdk/api": "~2.1.0-beta.23",
40
+ "@osdk/shared.client.impl": "~1.1.0-beta.4",
40
41
  "@osdk/shared.net.errors": "~2.1.0-beta.1",
41
- "@osdk/shared.net.fetch": "~1.1.0-beta.2",
42
- "@osdk/shared.client.impl": "~1.1.0-beta.4"
42
+ "@osdk/shared.net.fetch": "~1.1.0-beta.2"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-documenter": "^7.25.3",
46
- "@microsoft/api-extractor": "^7.47.0",
45
+ "@microsoft/api-documenter": "^7.26.5",
46
+ "@microsoft/api-extractor": "^7.49.1",
47
47
  "@types/geojson": "^7946.0.14",
48
48
  "@types/ws": "^8.5.11",
49
49
  "execa": "^9.5.1",
@@ -59,11 +59,11 @@
59
59
  "ts-expect": "^1.3.0",
60
60
  "typescript": "~5.5.4",
61
61
  "zod": "^3.23.8",
62
+ "@osdk/client.test.ontology": "~2.1.0-beta.23",
62
63
  "@osdk/monorepo.api-extractor": "~0.0.0",
63
- "@osdk/client.test.ontology": "~2.1.0-beta.21",
64
- "@osdk/monorepo.tsup": "~0.0.0",
65
64
  "@osdk/monorepo.tsconfig": "~0.0.0",
66
- "@osdk/shared.test": "~2.1.0-beta.21"
65
+ "@osdk/monorepo.tsup": "~0.0.0",
66
+ "@osdk/shared.test": "~2.1.0-beta.23"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public"
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=toConjureObjectSet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toConjureObjectSet.d.ts","sourceRoot":"","sources":["../../../src/objectSet/toConjureObjectSet.ts"],"names":[],"mappings":""}
@@ -1,167 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import { conjureUnionType } from "./conjureUnionType.js";
17
- /** @internal */
18
- export function toConjureObjectSet(objectSet, objectPropertyMapping) {
19
- switch (objectSet.type) {
20
- case "base":
21
- return conjureUnionType("base", {
22
- objectTypeId: objectPropertyMapping.id
23
- });
24
- case "static":
25
- return conjureUnionType("static", {
26
- objectRids: objectSet.objects,
27
- provenance: undefined
28
- });
29
- case "reference":
30
- return conjureUnionType("referenced", {
31
- objectSetRid: objectSet.reference
32
- });
33
- case "filter":
34
- return conjureUnionType("filtered", {
35
- objectSet: toConjureObjectSet(objectSet.objectSet, objectPropertyMapping),
36
- runtimeDerivedProperties: undefined,
37
- filter: mapWhereClauseToObjectSetFilter(objectSet.where, objectPropertyMapping)
38
- });
39
- case "union":
40
- return conjureUnionType("unioned", {
41
- objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))
42
- });
43
- case "intersect":
44
- return conjureUnionType("intersected", {
45
- objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))
46
- });
47
- case "subtract":
48
- return conjureUnionType("subtracted", {
49
- objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))
50
- });
51
- case "searchAround":
52
- case "asBaseObjectTypes":
53
- case "asType":
54
- case "interfaceBase":
55
- case "withProperties":
56
- case "methodInput":
57
- throw new Error("not implemented");
58
- }
59
- }
60
- /** @internal */
61
- export async function getObjectSetBaseType(objectSet) {
62
- switch (objectSet.type) {
63
- case "base":
64
- return objectSet.objectType;
65
- case "static":
66
- // TODO: Get the object type from a wire call
67
- // This is not supported at the moment by the API anyway
68
- throw new Error("not implemented");
69
- case "reference":
70
- // TODO: Get the object type from a wire call
71
- throw new Error("not implemented");
72
- case "filter":
73
- return getObjectSetBaseType(objectSet.objectSet);
74
- case "union":
75
- // Technically you can have multiple ObjectTypes but at the moment we only support one
76
- return getObjectSetBaseType(objectSet.objectSets[0]);
77
- case "intersect":
78
- return getObjectSetBaseType(objectSet.objectSets[0]);
79
- case "subtract":
80
- return getObjectSetBaseType(objectSet.objectSets[0]);
81
- case "searchAround":
82
- // TODO: Get a mapping using the link
83
- throw new Error("not implemented");
84
- case "asBaseObjectTypes":
85
- case "asType":
86
- case "interfaceBase":
87
- throw new Error("not implemented");
88
- }
89
- }
90
- function mapWhereClauseToObjectSetFilter(objectSetFilter, propertyMapping) {
91
- switch (objectSetFilter.type) {
92
- case "lt":
93
- return conjureUnionType("range", {
94
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
95
- lt: objectSetFilter.value,
96
- lte: undefined,
97
- gt: undefined,
98
- gte: undefined
99
- });
100
- case "gt":
101
- return conjureUnionType("range", {
102
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
103
- gt: objectSetFilter.value,
104
- lte: undefined,
105
- lt: undefined,
106
- gte: undefined
107
- });
108
- case "lte":
109
- return conjureUnionType("range", {
110
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
111
- lte: objectSetFilter.value,
112
- lt: undefined,
113
- gt: undefined,
114
- gte: undefined
115
- });
116
- case "gte":
117
- return conjureUnionType("range", {
118
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
119
- gte: objectSetFilter.value,
120
- lt: undefined,
121
- lte: undefined,
122
- gt: undefined
123
- });
124
- case "eq":
125
- return conjureUnionType("exactMatch", {
126
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
127
- terms: [objectSetFilter.value]
128
- });
129
- case "and":
130
- return conjureUnionType("and", {
131
- filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping))
132
- });
133
- case "or":
134
- return conjureUnionType("or", {
135
- filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping))
136
- });
137
- case "isNull":
138
- return conjureUnionType("not", {
139
- filter: {
140
- type: "hasProperty",
141
- hasProperty: {
142
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field]
143
- }
144
- }
145
- });
146
- case "not":
147
- return conjureUnionType("not", {
148
- filter: mapWhereClauseToObjectSetFilter(objectSetFilter.value, propertyMapping)
149
- });
150
- case "contains":
151
- case "startsWith":
152
- case "containsAllTermsInOrder":
153
- case "containsAnyTerm":
154
- case "containsAllTerms":
155
- case "withinDistanceOf":
156
- case "withinBoundingBox":
157
- case "intersectsBoundingBox":
158
- case "doesNotIntersectBoundingBox":
159
- case "withinPolygon":
160
- case "intersectsPolygon":
161
- case "doesNotIntersectPolygon":
162
- case "containsAllTermsInOrderPrefixLastTerm":
163
- case "in":
164
- throw new Error("not implemented");
165
- }
166
- }
167
- //# sourceMappingURL=toConjureObjectSet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toConjureObjectSet.js","names":["conjureUnionType","toConjureObjectSet","objectSet","objectPropertyMapping","type","objectTypeId","id","objectRids","objects","provenance","undefined","objectSetRid","reference","runtimeDerivedProperties","filter","mapWhereClauseToObjectSetFilter","where","objectSets","map","os","Error","getObjectSetBaseType","objectType","objectSetFilter","propertyMapping","propertyId","propertyApiNameToIdMapping","field","lt","value","lte","gt","gte","terms","filters","hasProperty"],"sources":["toConjureObjectSet.js"],"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 */\nimport { conjureUnionType } from \"./conjureUnionType.js\";\n/** @internal */\nexport function toConjureObjectSet(objectSet, objectPropertyMapping) {\n switch (objectSet.type) {\n case \"base\":\n return conjureUnionType(\"base\", {\n objectTypeId: objectPropertyMapping.id,\n });\n case \"static\":\n return conjureUnionType(\"static\", {\n objectRids: objectSet.objects,\n provenance: undefined,\n });\n case \"reference\":\n return conjureUnionType(\"referenced\", {\n objectSetRid: objectSet.reference,\n });\n case \"filter\":\n return conjureUnionType(\"filtered\", {\n objectSet: toConjureObjectSet(objectSet.objectSet, objectPropertyMapping),\n runtimeDerivedProperties: undefined,\n filter: mapWhereClauseToObjectSetFilter(objectSet.where, objectPropertyMapping),\n });\n case \"union\":\n return conjureUnionType(\"unioned\", {\n objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping)),\n });\n case \"intersect\":\n return conjureUnionType(\"intersected\", {\n objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping)),\n });\n case \"subtract\":\n return conjureUnionType(\"subtracted\", {\n objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping)),\n });\n case \"searchAround\":\n case \"asBaseObjectTypes\":\n case \"asType\":\n case \"interfaceBase\":\n case \"withProperties\":\n case \"methodInput\":\n throw new Error(\"not implemented\");\n }\n}\n/** @internal */\nexport async function getObjectSetBaseType(objectSet) {\n switch (objectSet.type) {\n case \"base\":\n return objectSet.objectType;\n case \"static\":\n // TODO: Get the object type from a wire call\n // This is not supported at the moment by the API anyway\n throw new Error(\"not implemented\");\n case \"reference\":\n // TODO: Get the object type from a wire call\n throw new Error(\"not implemented\");\n case \"filter\":\n return getObjectSetBaseType(objectSet.objectSet);\n case \"union\":\n // Technically you can have multiple ObjectTypes but at the moment we only support one\n return getObjectSetBaseType(objectSet.objectSets[0]);\n case \"intersect\":\n return getObjectSetBaseType(objectSet.objectSets[0]);\n case \"subtract\":\n return getObjectSetBaseType(objectSet.objectSets[0]);\n case \"searchAround\":\n // TODO: Get a mapping using the link\n throw new Error(\"not implemented\");\n case \"asBaseObjectTypes\":\n case \"asType\":\n case \"interfaceBase\":\n throw new Error(\"not implemented\");\n }\n}\nfunction mapWhereClauseToObjectSetFilter(objectSetFilter, propertyMapping) {\n switch (objectSetFilter.type) {\n case \"lt\":\n return conjureUnionType(\"range\", {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n lt: objectSetFilter.value,\n lte: undefined,\n gt: undefined,\n gte: undefined,\n });\n case \"gt\":\n return conjureUnionType(\"range\", {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n gt: objectSetFilter.value,\n lte: undefined,\n lt: undefined,\n gte: undefined,\n });\n case \"lte\":\n return conjureUnionType(\"range\", {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n lte: objectSetFilter.value,\n lt: undefined,\n gt: undefined,\n gte: undefined,\n });\n case \"gte\":\n return conjureUnionType(\"range\", {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n gte: objectSetFilter.value,\n lt: undefined,\n lte: undefined,\n gt: undefined,\n });\n case \"eq\":\n return conjureUnionType(\"exactMatch\", {\n propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],\n terms: [objectSetFilter.value],\n });\n case \"and\":\n return conjureUnionType(\"and\", {\n filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping)),\n });\n case \"or\":\n return conjureUnionType(\"or\", {\n filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping)),\n });\n case \"isNull\":\n return conjureUnionType(\"not\", {\n filter: {\n type: \"hasProperty\",\n hasProperty: {\n propertyId: propertyMapping\n .propertyApiNameToIdMapping[objectSetFilter.field],\n },\n },\n });\n case \"not\":\n return conjureUnionType(\"not\", {\n filter: mapWhereClauseToObjectSetFilter(objectSetFilter.value, propertyMapping),\n });\n case \"contains\":\n case \"startsWith\":\n case \"containsAllTermsInOrder\":\n case \"containsAnyTerm\":\n case \"containsAllTerms\":\n case \"withinDistanceOf\":\n case \"withinBoundingBox\":\n case \"intersectsBoundingBox\":\n case \"doesNotIntersectBoundingBox\":\n case \"withinPolygon\":\n case \"intersectsPolygon\":\n case \"doesNotIntersectPolygon\":\n case \"containsAllTermsInOrderPrefixLastTerm\":\n case \"in\":\n throw new Error(\"not implemented\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,uBAAuB;AACxD;AACA,OAAO,SAASC,kBAAkBA,CAACC,SAAS,EAAEC,qBAAqB,EAAE;EACjE,QAAQD,SAAS,CAACE,IAAI;IAClB,KAAK,MAAM;MACP,OAAOJ,gBAAgB,CAAC,MAAM,EAAE;QAC5BK,YAAY,EAAEF,qBAAqB,CAACG;MACxC,CAAC,CAAC;IACN,KAAK,QAAQ;MACT,OAAON,gBAAgB,CAAC,QAAQ,EAAE;QAC9BO,UAAU,EAAEL,SAAS,CAACM,OAAO;QAC7BC,UAAU,EAAEC;MAChB,CAAC,CAAC;IACN,KAAK,WAAW;MACZ,OAAOV,gBAAgB,CAAC,YAAY,EAAE;QAClCW,YAAY,EAAET,SAAS,CAACU;MAC5B,CAAC,CAAC;IACN,KAAK,QAAQ;MACT,OAAOZ,gBAAgB,CAAC,UAAU,EAAE;QAChCE,SAAS,EAAED,kBAAkB,CAACC,SAAS,CAACA,SAAS,EAAEC,qBAAqB,CAAC;QACzEU,wBAAwB,EAAEH,SAAS;QACnCI,MAAM,EAAEC,+BAA+B,CAACb,SAAS,CAACc,KAAK,EAAEb,qBAAqB;MAClF,CAAC,CAAC;IACN,KAAK,OAAO;MACR,OAAOH,gBAAgB,CAAC,SAAS,EAAE;QAC/BiB,UAAU,EAAEf,SAAS,CAACe,UAAU,CAACC,GAAG,CAACC,EAAE,IAAIlB,kBAAkB,CAACkB,EAAE,EAAEhB,qBAAqB,CAAC;MAC5F,CAAC,CAAC;IACN,KAAK,WAAW;MACZ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BAAiB,CAAC;EAC1C;AACJ","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=toConjureObjectSet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toConjureObjectSet.d.ts","sourceRoot":"","sources":["../../../src/objectSet/toConjureObjectSet.ts"],"names":[],"mappings":""}
@@ -1,167 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import { conjureUnionType } from "./conjureUnionType.js";
17
- /** @internal */
18
- export function toConjureObjectSet(objectSet, objectPropertyMapping) {
19
- switch (objectSet.type) {
20
- case "base":
21
- return conjureUnionType("base", {
22
- objectTypeId: objectPropertyMapping.id
23
- });
24
- case "static":
25
- return conjureUnionType("static", {
26
- objectRids: objectSet.objects,
27
- provenance: undefined
28
- });
29
- case "reference":
30
- return conjureUnionType("referenced", {
31
- objectSetRid: objectSet.reference
32
- });
33
- case "filter":
34
- return conjureUnionType("filtered", {
35
- objectSet: toConjureObjectSet(objectSet.objectSet, objectPropertyMapping),
36
- runtimeDerivedProperties: undefined,
37
- filter: mapWhereClauseToObjectSetFilter(objectSet.where, objectPropertyMapping)
38
- });
39
- case "union":
40
- return conjureUnionType("unioned", {
41
- objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))
42
- });
43
- case "intersect":
44
- return conjureUnionType("intersected", {
45
- objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))
46
- });
47
- case "subtract":
48
- return conjureUnionType("subtracted", {
49
- objectSets: objectSet.objectSets.map(os => toConjureObjectSet(os, objectPropertyMapping))
50
- });
51
- case "searchAround":
52
- case "asBaseObjectTypes":
53
- case "asType":
54
- case "interfaceBase":
55
- case "withProperties":
56
- case "methodInput":
57
- throw new Error("not implemented");
58
- }
59
- }
60
- /** @internal */
61
- export async function getObjectSetBaseType(objectSet) {
62
- switch (objectSet.type) {
63
- case "base":
64
- return objectSet.objectType;
65
- case "static":
66
- // TODO: Get the object type from a wire call
67
- // This is not supported at the moment by the API anyway
68
- throw new Error("not implemented");
69
- case "reference":
70
- // TODO: Get the object type from a wire call
71
- throw new Error("not implemented");
72
- case "filter":
73
- return getObjectSetBaseType(objectSet.objectSet);
74
- case "union":
75
- // Technically you can have multiple ObjectTypes but at the moment we only support one
76
- return getObjectSetBaseType(objectSet.objectSets[0]);
77
- case "intersect":
78
- return getObjectSetBaseType(objectSet.objectSets[0]);
79
- case "subtract":
80
- return getObjectSetBaseType(objectSet.objectSets[0]);
81
- case "searchAround":
82
- // TODO: Get a mapping using the link
83
- throw new Error("not implemented");
84
- case "asBaseObjectTypes":
85
- case "asType":
86
- case "interfaceBase":
87
- throw new Error("not implemented");
88
- }
89
- }
90
- function mapWhereClauseToObjectSetFilter(objectSetFilter, propertyMapping) {
91
- switch (objectSetFilter.type) {
92
- case "lt":
93
- return conjureUnionType("range", {
94
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
95
- lt: objectSetFilter.value,
96
- lte: undefined,
97
- gt: undefined,
98
- gte: undefined
99
- });
100
- case "gt":
101
- return conjureUnionType("range", {
102
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
103
- gt: objectSetFilter.value,
104
- lte: undefined,
105
- lt: undefined,
106
- gte: undefined
107
- });
108
- case "lte":
109
- return conjureUnionType("range", {
110
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
111
- lte: objectSetFilter.value,
112
- lt: undefined,
113
- gt: undefined,
114
- gte: undefined
115
- });
116
- case "gte":
117
- return conjureUnionType("range", {
118
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
119
- gte: objectSetFilter.value,
120
- lt: undefined,
121
- lte: undefined,
122
- gt: undefined
123
- });
124
- case "eq":
125
- return conjureUnionType("exactMatch", {
126
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
127
- terms: [objectSetFilter.value]
128
- });
129
- case "and":
130
- return conjureUnionType("and", {
131
- filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping))
132
- });
133
- case "or":
134
- return conjureUnionType("or", {
135
- filters: objectSetFilter.value.map(filter => mapWhereClauseToObjectSetFilter(filter, propertyMapping))
136
- });
137
- case "isNull":
138
- return conjureUnionType("not", {
139
- filter: {
140
- type: "hasProperty",
141
- hasProperty: {
142
- propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field]
143
- }
144
- }
145
- });
146
- case "not":
147
- return conjureUnionType("not", {
148
- filter: mapWhereClauseToObjectSetFilter(objectSetFilter.value, propertyMapping)
149
- });
150
- case "contains":
151
- case "startsWith":
152
- case "containsAllTermsInOrder":
153
- case "containsAnyTerm":
154
- case "containsAllTerms":
155
- case "withinDistanceOf":
156
- case "withinBoundingBox":
157
- case "intersectsBoundingBox":
158
- case "doesNotIntersectBoundingBox":
159
- case "withinPolygon":
160
- case "intersectsPolygon":
161
- case "doesNotIntersectPolygon":
162
- case "containsAllTermsInOrderPrefixLastTerm":
163
- case "in":
164
- throw new Error("not implemented");
165
- }
166
- }
167
- //# sourceMappingURL=toConjureObjectSet.js.map