@dremio/js-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/LICENSE +202 -0
  2. package/dist/cloud/arctic/ArcticCatalog.d.ts +34 -0
  3. package/dist/cloud/arctic/ArcticCatalog.js +46 -0
  4. package/dist/cloud/arctic/ArcticCatalog.js.map +1 -0
  5. package/dist/cloud/arctic/ArcticResource.d.ts +15 -0
  6. package/dist/cloud/arctic/ArcticResource.js +40 -0
  7. package/dist/cloud/arctic/ArcticResource.js.map +1 -0
  8. package/dist/cloud/credentials/fromAccessToken.d.ts +2 -0
  9. package/dist/cloud/credentials/fromAccessToken.js +19 -0
  10. package/dist/cloud/credentials/fromAccessToken.js.map +1 -0
  11. package/dist/cloud/credentials/fromRefreshToken.d.ts +5 -0
  12. package/dist/cloud/credentials/fromRefreshToken.js +47 -0
  13. package/dist/cloud/credentials/fromRefreshToken.js.map +1 -0
  14. package/dist/cloud/credentials/fromUsernamePassword.d.ts +2 -0
  15. package/dist/cloud/credentials/fromUsernamePassword.js +41 -0
  16. package/dist/cloud/credentials/fromUsernamePassword.js.map +1 -0
  17. package/dist/cloud/credentials/index.d.ts +4 -0
  18. package/dist/cloud/credentials/index.js +20 -0
  19. package/dist/cloud/credentials/index.js.map +1 -0
  20. package/dist/cloud/engines/Engine.d.ts +47 -0
  21. package/dist/cloud/engines/Engine.js +58 -0
  22. package/dist/cloud/engines/Engine.js.map +1 -0
  23. package/dist/cloud/engines/EnginesResource.d.ts +15 -0
  24. package/dist/cloud/engines/EnginesResource.js +42 -0
  25. package/dist/cloud/engines/EnginesResource.js.map +1 -0
  26. package/dist/cloud/engines/utils.d.ts +17 -0
  27. package/dist/cloud/engines/utils.js +59 -0
  28. package/dist/cloud/engines/utils.js.map +1 -0
  29. package/dist/cloud/index.d.ts +487 -0
  30. package/dist/cloud/index.js +47 -0
  31. package/dist/cloud/index.js.map +1 -0
  32. package/dist/cloud/interfaces.d.ts +13 -0
  33. package/dist/cloud/interfaces.js +18 -0
  34. package/dist/cloud/interfaces.js.map +1 -0
  35. package/dist/cloud/oauth/OAuthApplication.d.ts +26 -0
  36. package/dist/cloud/oauth/OAuthApplication.js +49 -0
  37. package/dist/cloud/oauth/OAuthApplication.js.map +1 -0
  38. package/dist/cloud/oauth/OAuthApplicationsResource.d.ts +15 -0
  39. package/dist/cloud/oauth/OAuthApplicationsResource.js +66 -0
  40. package/dist/cloud/oauth/OAuthApplicationsResource.js.map +1 -0
  41. package/dist/cloud/oauth/oauth.d.ts +32 -0
  42. package/dist/cloud/oauth/oauth.js +57 -0
  43. package/dist/cloud/oauth/oauth.js.map +1 -0
  44. package/dist/cloud/projects/Project.d.ts +49 -0
  45. package/dist/cloud/projects/Project.js +61 -0
  46. package/dist/cloud/projects/Project.js.map +1 -0
  47. package/dist/cloud/projects/ProjectsResource.d.ts +17 -0
  48. package/dist/cloud/projects/ProjectsResource.js +50 -0
  49. package/dist/cloud/projects/ProjectsResource.js.map +1 -0
  50. package/dist/cloud/projects/projectApiMethods.d.ts +9 -0
  51. package/dist/cloud/projects/projectApiMethods.js +43 -0
  52. package/dist/cloud/projects/projectApiMethods.js.map +1 -0
  53. package/dist/cloud/projects/utils.d.ts +2 -0
  54. package/dist/cloud/projects/utils.js +37 -0
  55. package/dist/cloud/projects/utils.js.map +1 -0
  56. package/dist/cloud/resources.d.ts +472 -0
  57. package/dist/cloud/resources.js +41 -0
  58. package/dist/cloud/resources.js.map +1 -0
  59. package/dist/cloud/users/CloudUser.d.ts +4 -0
  60. package/dist/cloud/users/CloudUser.js +27 -0
  61. package/dist/cloud/users/CloudUser.js.map +1 -0
  62. package/dist/cloud/users/CloudUsersResource.d.ts +13 -0
  63. package/dist/cloud/users/CloudUsersResource.js +37 -0
  64. package/dist/cloud/users/CloudUsersResource.js.map +1 -0
  65. package/dist/common/Config.d.ts +54 -0
  66. package/dist/common/Config.js +17 -0
  67. package/dist/common/Config.js.map +1 -0
  68. package/dist/common/CredentialProvider.d.ts +4 -0
  69. package/dist/common/CredentialProvider.js +17 -0
  70. package/dist/common/CredentialProvider.js.map +1 -0
  71. package/dist/common/HttpError.d.ts +21 -0
  72. package/dist/common/HttpError.js +74 -0
  73. package/dist/common/HttpError.js.map +1 -0
  74. package/dist/common/Params.d.ts +16 -0
  75. package/dist/common/Params.js +17 -0
  76. package/dist/common/Params.js.map +1 -0
  77. package/dist/common/Problem.d.ts +45 -0
  78. package/dist/common/Problem.js +37 -0
  79. package/dist/common/Problem.js.map +1 -0
  80. package/dist/common/Query.d.ts +6 -0
  81. package/dist/common/Query.js +30 -0
  82. package/dist/common/Query.js.map +1 -0
  83. package/dist/common/batch.d.ts +2 -0
  84. package/dist/common/batch.js +42 -0
  85. package/dist/common/batch.js.map +1 -0
  86. package/dist/common/createRequest.d.ts +6 -0
  87. package/dist/common/createRequest.js +71 -0
  88. package/dist/common/createRequest.js.map +1 -0
  89. package/dist/common/fromAbortable.d.ts +4 -0
  90. package/dist/common/fromAbortable.js +35 -0
  91. package/dist/common/fromAbortable.js.map +1 -0
  92. package/dist/common/problems.d.ts +9 -0
  93. package/dist/common/problems.js +25 -0
  94. package/dist/common/problems.js.map +1 -0
  95. package/dist/common/sharedExports.d.ts +5 -0
  96. package/dist/common/sharedExports.js +21 -0
  97. package/dist/common/sharedExports.js.map +1 -0
  98. package/dist/enterprise/Grantee.d.ts +9 -0
  99. package/dist/enterprise/Grantee.js +17 -0
  100. package/dist/enterprise/Grantee.js.map +1 -0
  101. package/dist/enterprise/Ownable.d.ts +7 -0
  102. package/dist/enterprise/Ownable.js +17 -0
  103. package/dist/enterprise/Ownable.js.map +1 -0
  104. package/dist/enterprise/catalog/CatalogLineage.d.ts +37 -0
  105. package/dist/enterprise/catalog/CatalogLineage.js +26 -0
  106. package/dist/enterprise/catalog/CatalogLineage.js.map +1 -0
  107. package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.d.ts +39 -0
  108. package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.js +45 -0
  109. package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.js.map +1 -0
  110. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFileCatalogObject.d.ts +6 -0
  111. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFileCatalogObject.js +22 -0
  112. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFileCatalogObject.js.map +1 -0
  113. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFolderCatalogObject.d.ts +7 -0
  114. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFolderCatalogObject.js +25 -0
  115. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFolderCatalogObject.js.map +1 -0
  116. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFunctionCatalogObject.d.ts +6 -0
  117. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFunctionCatalogObject.js +22 -0
  118. package/dist/enterprise/catalog/CatalogObjects/EnterpriseFunctionCatalogObject.js.map +1 -0
  119. package/dist/enterprise/catalog/CatalogObjects/EnterpriseHomeCatalogObject.d.ts +6 -0
  120. package/dist/enterprise/catalog/CatalogObjects/EnterpriseHomeCatalogObject.js +22 -0
  121. package/dist/enterprise/catalog/CatalogObjects/EnterpriseHomeCatalogObject.js.map +1 -0
  122. package/dist/enterprise/catalog/CatalogObjects/EnterpriseSourceCatalogObject.d.ts +46 -0
  123. package/dist/enterprise/catalog/CatalogObjects/EnterpriseSourceCatalogObject.js +44 -0
  124. package/dist/enterprise/catalog/CatalogObjects/EnterpriseSourceCatalogObject.js.map +1 -0
  125. package/dist/enterprise/catalog/CatalogObjects/EnterpriseSpaceCatalogObject.d.ts +6 -0
  126. package/dist/enterprise/catalog/CatalogObjects/EnterpriseSpaceCatalogObject.js +22 -0
  127. package/dist/enterprise/catalog/CatalogObjects/EnterpriseSpaceCatalogObject.js.map +1 -0
  128. package/dist/enterprise/catalog/CatalogObjects/index.d.ts +10 -0
  129. package/dist/enterprise/catalog/CatalogObjects/index.js +17 -0
  130. package/dist/enterprise/catalog/CatalogObjects/index.js.map +1 -0
  131. package/dist/enterprise/catalog/CatalogReferences/EnterpriseDatasetCatalogReference.d.ts +14 -0
  132. package/dist/enterprise/catalog/CatalogReferences/EnterpriseDatasetCatalogReference.js +28 -0
  133. package/dist/enterprise/catalog/CatalogReferences/EnterpriseDatasetCatalogReference.js.map +1 -0
  134. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFileCatalogReference.d.ts +3 -0
  135. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFileCatalogReference.js +19 -0
  136. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFileCatalogReference.js.map +1 -0
  137. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFolderCatalogReference.d.ts +12 -0
  138. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFolderCatalogReference.js +28 -0
  139. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFolderCatalogReference.js.map +1 -0
  140. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFunctionCatalogReference.d.ts +3 -0
  141. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFunctionCatalogReference.js +19 -0
  142. package/dist/enterprise/catalog/CatalogReferences/EnterpriseFunctionCatalogReference.js.map +1 -0
  143. package/dist/enterprise/catalog/CatalogReferences/EnterpriseHomeCatalogReference.d.ts +3 -0
  144. package/dist/enterprise/catalog/CatalogReferences/EnterpriseHomeCatalogReference.js +19 -0
  145. package/dist/enterprise/catalog/CatalogReferences/EnterpriseHomeCatalogReference.js.map +1 -0
  146. package/dist/enterprise/catalog/CatalogReferences/EnterpriseSourceCatalogReference.d.ts +12 -0
  147. package/dist/enterprise/catalog/CatalogReferences/EnterpriseSourceCatalogReference.js +28 -0
  148. package/dist/enterprise/catalog/CatalogReferences/EnterpriseSourceCatalogReference.js.map +1 -0
  149. package/dist/enterprise/catalog/CatalogReferences/EnterpriseSpaceCatalogReference.d.ts +3 -0
  150. package/dist/enterprise/catalog/CatalogReferences/EnterpriseSpaceCatalogReference.js +19 -0
  151. package/dist/enterprise/catalog/CatalogReferences/EnterpriseSpaceCatalogReference.js.map +1 -0
  152. package/dist/enterprise/catalog/CatalogReferences/index.d.ts +9 -0
  153. package/dist/enterprise/catalog/CatalogReferences/index.js +17 -0
  154. package/dist/enterprise/catalog/CatalogReferences/index.js.map +1 -0
  155. package/dist/enterprise/catalog/CatalogReferences/retrieveCatalogGrants.d.ts +15 -0
  156. package/dist/enterprise/catalog/CatalogReferences/retrieveCatalogGrants.js +30 -0
  157. package/dist/enterprise/catalog/CatalogReferences/retrieveCatalogGrants.js.map +1 -0
  158. package/dist/enterprise/catalog/EnterpriseCatalogResource.d.ts +10 -0
  159. package/dist/enterprise/catalog/EnterpriseCatalogResource.js +38 -0
  160. package/dist/enterprise/catalog/EnterpriseCatalogResource.js.map +1 -0
  161. package/dist/enterprise/catalog/catalogObjectFromEntity.d.ts +3 -0
  162. package/dist/enterprise/catalog/catalogObjectFromEntity.js +73 -0
  163. package/dist/enterprise/catalog/catalogObjectFromEntity.js.map +1 -0
  164. package/dist/enterprise/catalog/catalogReferenceFromProperties.d.ts +6 -0
  165. package/dist/enterprise/catalog/catalogReferenceFromProperties.js +46 -0
  166. package/dist/enterprise/catalog/catalogReferenceFromProperties.js.map +1 -0
  167. package/dist/enterprise/catalog/catalogRetrieve.d.ts +5 -0
  168. package/dist/enterprise/catalog/catalogRetrieve.js +119 -0
  169. package/dist/enterprise/catalog/catalogRetrieve.js.map +1 -0
  170. package/dist/enterprise/credentials/exchangePat.d.ts +12 -0
  171. package/dist/enterprise/credentials/exchangePat.js +55 -0
  172. package/dist/enterprise/credentials/exchangePat.js.map +1 -0
  173. package/dist/enterprise/credentials/fromPat.d.ts +2 -0
  174. package/dist/enterprise/credentials/fromPat.js +36 -0
  175. package/dist/enterprise/credentials/fromPat.js.map +1 -0
  176. package/dist/enterprise/credentials/index.d.ts +2 -0
  177. package/dist/enterprise/credentials/index.js +18 -0
  178. package/dist/enterprise/credentials/index.js.map +1 -0
  179. package/dist/enterprise/engines/Engine.d.ts +78 -0
  180. package/dist/enterprise/engines/Engine.js +75 -0
  181. package/dist/enterprise/engines/Engine.js.map +1 -0
  182. package/dist/enterprise/engines/EnginesResource.d.ts +10 -0
  183. package/dist/enterprise/engines/EnginesResource.js +34 -0
  184. package/dist/enterprise/engines/EnginesResource.js.map +1 -0
  185. package/dist/enterprise/index.d.ts +60 -0
  186. package/dist/enterprise/index.js +43 -0
  187. package/dist/enterprise/index.js.map +1 -0
  188. package/dist/enterprise/interfaces.d.ts +12 -0
  189. package/dist/enterprise/interfaces.js +18 -0
  190. package/dist/enterprise/interfaces.js.map +1 -0
  191. package/dist/enterprise/reflections/ReflectionSummary.d.ts +74 -0
  192. package/dist/enterprise/reflections/ReflectionSummary.js +82 -0
  193. package/dist/enterprise/reflections/ReflectionSummary.js.map +1 -0
  194. package/dist/enterprise/resources.d.ts +44 -0
  195. package/dist/enterprise/resources.js +36 -0
  196. package/dist/enterprise/resources.js.map +1 -0
  197. package/dist/enterprise/roles/Role.d.ts +23 -0
  198. package/dist/enterprise/roles/Role.js +38 -0
  199. package/dist/enterprise/roles/Role.js.map +1 -0
  200. package/dist/enterprise/roles/RolesResource.d.ts +8 -0
  201. package/dist/enterprise/roles/RolesResource.js +32 -0
  202. package/dist/enterprise/roles/RolesResource.js.map +1 -0
  203. package/dist/enterprise/scripts/EnterpriseScript.d.ts +46 -0
  204. package/dist/enterprise/scripts/EnterpriseScript.js +62 -0
  205. package/dist/enterprise/scripts/EnterpriseScript.js.map +1 -0
  206. package/dist/enterprise/scripts/EnterpriseScriptsResource.d.ts +15 -0
  207. package/dist/enterprise/scripts/EnterpriseScriptsResource.js +72 -0
  208. package/dist/enterprise/scripts/EnterpriseScriptsResource.js.map +1 -0
  209. package/dist/enterprise/users/EnterpriseUser.d.ts +23 -0
  210. package/dist/enterprise/users/EnterpriseUser.js +43 -0
  211. package/dist/enterprise/users/EnterpriseUser.js.map +1 -0
  212. package/dist/enterprise/users/EnterpriseUsersResource.d.ts +11 -0
  213. package/dist/enterprise/users/EnterpriseUsersResource.js +32 -0
  214. package/dist/enterprise/users/EnterpriseUsersResource.js.map +1 -0
  215. package/dist/oss/catalog/CatalogObjects/DatasetCatalogObject.d.ts +43 -0
  216. package/dist/oss/catalog/CatalogObjects/DatasetCatalogObject.js +56 -0
  217. package/dist/oss/catalog/CatalogObjects/DatasetCatalogObject.js.map +1 -0
  218. package/dist/oss/catalog/CatalogObjects/FileCatalogObject.d.ts +17 -0
  219. package/dist/oss/catalog/CatalogObjects/FileCatalogObject.js +48 -0
  220. package/dist/oss/catalog/CatalogObjects/FileCatalogObject.js.map +1 -0
  221. package/dist/oss/catalog/CatalogObjects/FolderCatalogObject.d.ts +20 -0
  222. package/dist/oss/catalog/CatalogObjects/FolderCatalogObject.js +48 -0
  223. package/dist/oss/catalog/CatalogObjects/FolderCatalogObject.js.map +1 -0
  224. package/dist/oss/catalog/CatalogObjects/FunctionCatalogObject.d.ts +17 -0
  225. package/dist/oss/catalog/CatalogObjects/FunctionCatalogObject.js +47 -0
  226. package/dist/oss/catalog/CatalogObjects/FunctionCatalogObject.js.map +1 -0
  227. package/dist/oss/catalog/CatalogObjects/HomeCatalogObject.d.ts +18 -0
  228. package/dist/oss/catalog/CatalogObjects/HomeCatalogObject.js +48 -0
  229. package/dist/oss/catalog/CatalogObjects/HomeCatalogObject.js.map +1 -0
  230. package/dist/oss/catalog/CatalogObjects/SourceCatalogObject.d.ts +60 -0
  231. package/dist/oss/catalog/CatalogObjects/SourceCatalogObject.js +95 -0
  232. package/dist/oss/catalog/CatalogObjects/SourceCatalogObject.js.map +1 -0
  233. package/dist/oss/catalog/CatalogObjects/SpaceCatalogObject.d.ts +19 -0
  234. package/dist/oss/catalog/CatalogObjects/SpaceCatalogObject.js +53 -0
  235. package/dist/oss/catalog/CatalogObjects/SpaceCatalogObject.js.map +1 -0
  236. package/dist/oss/catalog/CatalogObjects/VersionedDatasetCatalogObject.d.ts +31 -0
  237. package/dist/oss/catalog/CatalogObjects/VersionedDatasetCatalogObject.js +58 -0
  238. package/dist/oss/catalog/CatalogObjects/VersionedDatasetCatalogObject.js.map +1 -0
  239. package/dist/oss/catalog/CatalogObjects/index.d.ts +10 -0
  240. package/dist/oss/catalog/CatalogObjects/index.js +17 -0
  241. package/dist/oss/catalog/CatalogObjects/index.js.map +1 -0
  242. package/dist/oss/catalog/CatalogObjects/utils/catalogObjectFromEntity.d.ts +11 -0
  243. package/dist/oss/catalog/CatalogObjects/utils/catalogObjectFromEntity.js +73 -0
  244. package/dist/oss/catalog/CatalogObjects/utils/catalogObjectFromEntity.js.map +1 -0
  245. package/dist/oss/catalog/CatalogReferences/BaseCatalogReference.d.ts +16 -0
  246. package/dist/oss/catalog/CatalogReferences/BaseCatalogReference.js +34 -0
  247. package/dist/oss/catalog/CatalogReferences/BaseCatalogReference.js.map +1 -0
  248. package/dist/oss/catalog/CatalogReferences/DatasetCatalogReference.d.ts +17 -0
  249. package/dist/oss/catalog/CatalogReferences/DatasetCatalogReference.js +39 -0
  250. package/dist/oss/catalog/CatalogReferences/DatasetCatalogReference.js.map +1 -0
  251. package/dist/oss/catalog/CatalogReferences/FileCatalogReference.d.ts +9 -0
  252. package/dist/oss/catalog/CatalogReferences/FileCatalogReference.js +28 -0
  253. package/dist/oss/catalog/CatalogReferences/FileCatalogReference.js.map +1 -0
  254. package/dist/oss/catalog/CatalogReferences/FolderCatalogReference.d.ts +22 -0
  255. package/dist/oss/catalog/CatalogReferences/FolderCatalogReference.js +40 -0
  256. package/dist/oss/catalog/CatalogReferences/FolderCatalogReference.js.map +1 -0
  257. package/dist/oss/catalog/CatalogReferences/FunctionCatalogReference.d.ts +9 -0
  258. package/dist/oss/catalog/CatalogReferences/FunctionCatalogReference.js +28 -0
  259. package/dist/oss/catalog/CatalogReferences/FunctionCatalogReference.js.map +1 -0
  260. package/dist/oss/catalog/CatalogReferences/HomeCatalogReference.d.ts +20 -0
  261. package/dist/oss/catalog/CatalogReferences/HomeCatalogReference.js +38 -0
  262. package/dist/oss/catalog/CatalogReferences/HomeCatalogReference.js.map +1 -0
  263. package/dist/oss/catalog/CatalogReferences/SourceCatalogReference.d.ts +24 -0
  264. package/dist/oss/catalog/CatalogReferences/SourceCatalogReference.js +61 -0
  265. package/dist/oss/catalog/CatalogReferences/SourceCatalogReference.js.map +1 -0
  266. package/dist/oss/catalog/CatalogReferences/SpaceCatalogReference.d.ts +20 -0
  267. package/dist/oss/catalog/CatalogReferences/SpaceCatalogReference.js +38 -0
  268. package/dist/oss/catalog/CatalogReferences/SpaceCatalogReference.js.map +1 -0
  269. package/dist/oss/catalog/CatalogReferences/index.d.ts +9 -0
  270. package/dist/oss/catalog/CatalogReferences/index.js +17 -0
  271. package/dist/oss/catalog/CatalogReferences/index.js.map +1 -0
  272. package/dist/oss/catalog/CatalogReferences/utils/catalogChildren.d.ts +14 -0
  273. package/dist/oss/catalog/CatalogReferences/utils/catalogChildren.js +62 -0
  274. package/dist/oss/catalog/CatalogReferences/utils/catalogChildren.js.map +1 -0
  275. package/dist/oss/catalog/CatalogReferences/utils/catalogReferenceEntityToProperties.d.ts +1 -0
  276. package/dist/oss/catalog/CatalogReferences/utils/catalogReferenceEntityToProperties.js +42 -0
  277. package/dist/oss/catalog/CatalogReferences/utils/catalogReferenceEntityToProperties.js.map +1 -0
  278. package/dist/oss/catalog/CatalogReferences/utils/catalogReferenceFromProperties.d.ts +6 -0
  279. package/dist/oss/catalog/CatalogReferences/utils/catalogReferenceFromProperties.js +45 -0
  280. package/dist/oss/catalog/CatalogReferences/utils/catalogReferenceFromProperties.js.map +1 -0
  281. package/dist/oss/catalog/CatalogReferences/utils/getTags.d.ts +5 -0
  282. package/dist/oss/catalog/CatalogReferences/utils/getTags.js +23 -0
  283. package/dist/oss/catalog/CatalogReferences/utils/getTags.js.map +1 -0
  284. package/dist/oss/catalog/CatalogReferences/utils/getWiki.d.ts +5 -0
  285. package/dist/oss/catalog/CatalogReferences/utils/getWiki.js +23 -0
  286. package/dist/oss/catalog/CatalogReferences/utils/getWiki.js.map +1 -0
  287. package/dist/oss/catalog/CatalogResource.d.ts +10 -0
  288. package/dist/oss/catalog/CatalogResource.js +38 -0
  289. package/dist/oss/catalog/CatalogResource.js.map +1 -0
  290. package/dist/oss/catalog/CatalogTags.d.ts +26 -0
  291. package/dist/oss/catalog/CatalogTags.js +60 -0
  292. package/dist/oss/catalog/CatalogTags.js.map +1 -0
  293. package/dist/oss/catalog/CatalogWiki.d.ts +26 -0
  294. package/dist/oss/catalog/CatalogWiki.js +60 -0
  295. package/dist/oss/catalog/CatalogWiki.js.map +1 -0
  296. package/dist/oss/catalog/VersionReference.d.ts +13 -0
  297. package/dist/oss/catalog/VersionReference.js +19 -0
  298. package/dist/oss/catalog/VersionReference.js.map +1 -0
  299. package/dist/oss/catalog/catalogErrors.d.ts +18 -0
  300. package/dist/oss/catalog/catalogErrors.js +36 -0
  301. package/dist/oss/catalog/catalogErrors.js.map +1 -0
  302. package/dist/oss/catalog/catalogRetrieve.d.ts +6 -0
  303. package/dist/oss/catalog/catalogRetrieve.js +119 -0
  304. package/dist/oss/catalog/catalogRetrieve.js.map +1 -0
  305. package/dist/oss/credentials/fromUsernamePassword.d.ts +2 -0
  306. package/dist/oss/credentials/fromUsernamePassword.js +41 -0
  307. package/dist/oss/credentials/fromUsernamePassword.js.map +1 -0
  308. package/dist/oss/credentials/index.d.ts +1 -0
  309. package/dist/oss/credentials/index.js +17 -0
  310. package/dist/oss/credentials/index.js.map +1 -0
  311. package/dist/oss/index.d.ts +55 -0
  312. package/dist/oss/index.js +42 -0
  313. package/dist/oss/index.js.map +1 -0
  314. package/dist/oss/interfaces.d.ts +8 -0
  315. package/dist/oss/interfaces.js +18 -0
  316. package/dist/oss/interfaces.js.map +1 -0
  317. package/dist/oss/jobs/Job.d.ts +71 -0
  318. package/dist/oss/jobs/Job.js +133 -0
  319. package/dist/oss/jobs/Job.js.map +1 -0
  320. package/dist/oss/jobs/JobsResource.d.ts +10 -0
  321. package/dist/oss/jobs/JobsResource.js +74 -0
  322. package/dist/oss/jobs/JobsResource.js.map +1 -0
  323. package/dist/oss/jobs/utils/JobResultsResponse.d.ts +85 -0
  324. package/dist/oss/jobs/utils/JobResultsResponse.js +17 -0
  325. package/dist/oss/jobs/utils/JobResultsResponse.js.map +1 -0
  326. package/dist/oss/jobs/utils/createArrayForFieldType.d.ts +2 -0
  327. package/dist/oss/jobs/utils/createArrayForFieldType.js +55 -0
  328. package/dist/oss/jobs/utils/createArrayForFieldType.js.map +1 -0
  329. package/dist/oss/jobs/utils/createColumnRecordFromSchema.d.ts +2 -0
  330. package/dist/oss/jobs/utils/createColumnRecordFromSchema.js +21 -0
  331. package/dist/oss/jobs/utils/createColumnRecordFromSchema.js.map +1 -0
  332. package/dist/oss/jobs/utils/mapRowData.d.ts +3 -0
  333. package/dist/oss/jobs/utils/mapRowData.js +46 -0
  334. package/dist/oss/jobs/utils/mapRowData.js.map +1 -0
  335. package/dist/oss/jobs/utils/mapRowsToColumns.d.ts +2 -0
  336. package/dist/oss/jobs/utils/mapRowsToColumns.js +27 -0
  337. package/dist/oss/jobs/utils/mapRowsToColumns.js.map +1 -0
  338. package/dist/oss/reflections/Reflection.d.ts +60 -0
  339. package/dist/oss/reflections/Reflection.js +41 -0
  340. package/dist/oss/reflections/Reflection.js.map +1 -0
  341. package/dist/oss/resources.d.ts +38 -0
  342. package/dist/oss/resources.js +30 -0
  343. package/dist/oss/resources.js.map +1 -0
  344. package/dist/oss/scripts/Script.d.ts +64 -0
  345. package/dist/oss/scripts/Script.js +94 -0
  346. package/dist/oss/scripts/Script.js.map +1 -0
  347. package/dist/oss/scripts/ScriptErrors.d.ts +19 -0
  348. package/dist/oss/scripts/ScriptErrors.js +37 -0
  349. package/dist/oss/scripts/ScriptErrors.js.map +1 -0
  350. package/dist/oss/scripts/ScriptsResource.d.ts +15 -0
  351. package/dist/oss/scripts/ScriptsResource.js +72 -0
  352. package/dist/oss/scripts/ScriptsResource.js.map +1 -0
  353. package/dist/oss/users/User.d.ts +30 -0
  354. package/dist/oss/users/User.js +60 -0
  355. package/dist/oss/users/User.js.map +1 -0
  356. package/dist/oss/users/UsersResource.d.ts +11 -0
  357. package/dist/oss/users/UsersResource.js +32 -0
  358. package/dist/oss/users/UsersResource.js.map +1 -0
  359. package/package.json +70 -0
@@ -0,0 +1,54 @@
1
+ import type { CredentialProvider } from "./CredentialProvider.ts";
2
+ export type RequestFn = (input: string, init?: RequestInit) => Promise<Response>;
3
+ export type Config = {
4
+ /**
5
+ * Custom `fetch` provider
6
+ * @default globalThis.fetch
7
+ */
8
+ fetch?: RequestFn;
9
+ /**
10
+ * Dremio API base origin
11
+ */
12
+ origin: string;
13
+ logger?: {
14
+ debug: typeof console.debug;
15
+ error: typeof console.error;
16
+ info: typeof console.info;
17
+ warn: typeof console.warn;
18
+ };
19
+ /**
20
+ * Provides credentials to Dremio for all authenticated API requests.
21
+ * Required unless using a custom `fetch` provider with its own credentials provision
22
+ */
23
+ credentials?: CredentialProvider;
24
+ };
25
+ /**
26
+ * @hidden
27
+ * @internal
28
+ */
29
+ export type ResourceConfig = {
30
+ logger?: Config["logger"];
31
+ origin: Config["origin"];
32
+ request: RequestFn;
33
+ };
34
+ /**
35
+ * @hidden
36
+ * @internal
37
+ */
38
+ export type SonarV2Config = {
39
+ sonarV2Request: RequestFn;
40
+ };
41
+ /**
42
+ * @hidden
43
+ * @internal
44
+ */
45
+ export type SonarV3Config = {
46
+ sonarV3Request: RequestFn;
47
+ };
48
+ /**
49
+ * @hidden
50
+ * @internal
51
+ */
52
+ export type V3Config = {
53
+ v3Request: RequestFn;
54
+ };
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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
+ export {};
17
+ //# sourceMappingURL=Config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/common/Config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 { CredentialProvider } from \"./CredentialProvider.ts\";\n\nexport type RequestFn = (input: string, init?: RequestInit) => Promise<Response>;\n\nexport type Config = {\n /**\n * Custom `fetch` provider\n * @default globalThis.fetch\n */\n fetch?: RequestFn;\n\n /**\n * Dremio API base origin\n */\n origin: string;\n\n logger?: {\n debug: typeof console.debug;\n error: typeof console.error;\n info: typeof console.info;\n warn: typeof console.warn;\n };\n\n /**\n * Provides credentials to Dremio for all authenticated API requests.\n * Required unless using a custom `fetch` provider with its own credentials provision\n */\n credentials?: CredentialProvider;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type ResourceConfig = {\n logger?: Config[\"logger\"];\n origin: Config[\"origin\"];\n request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV2Config = {\n sonarV2Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV3Config = {\n sonarV3Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type V3Config = {\n v3Request: RequestFn;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import type { Config } from "./Config.ts";
2
+ export type CredentialProvider = {
3
+ get: (config: Config) => Promise<string>;
4
+ };
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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
+ export {};
17
+ //# sourceMappingURL=CredentialProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialProvider.js","sourceRoot":"","sources":["../../src/common/CredentialProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 { Config } from \"./Config.ts\";\n\nexport type CredentialProvider = {\n get: (config: Config) => Promise<string>;\n};\n"]}
@@ -0,0 +1,21 @@
1
+ import { type Problem } from "./Problem.ts";
2
+ /**
3
+ * @hidden
4
+ * @internal
5
+ */
6
+ export declare class HttpError extends Error {
7
+ readonly status: number;
8
+ readonly body: Problem;
9
+ constructor(status: number, body: Problem);
10
+ static fromResponse(res: Response): Promise<HttpError>;
11
+ }
12
+ export declare const tokenInvalidError: {
13
+ readonly title: "The provided authentication token was rejected because it was invalid or may have expired.";
14
+ readonly type: "https://api.dremio.dev/problems/auth/token-invalid";
15
+ };
16
+ type DremioApiError = {
17
+ errorMessage: string;
18
+ moreInfo?: string;
19
+ };
20
+ export declare const isDremioApiError: (body: unknown) => body is DremioApiError;
21
+ export {};
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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 { isProblem } from "./Problem.js";
17
+ import { unexpectedError } from "./problems.js";
18
+ const extractResponseBody = async (res) => {
19
+ let result;
20
+ if (res.headers.get("content-type")?.includes("application/json")) {
21
+ result = await res.json();
22
+ }
23
+ else {
24
+ result = await res.text();
25
+ }
26
+ switch (res.status) {
27
+ case 401:
28
+ return tokenInvalidError;
29
+ case 500:
30
+ case 502:
31
+ case 503:
32
+ case 504:
33
+ return isDremioApiError(result) ? systemError(result.errorMessage) : systemError(result);
34
+ default:
35
+ return isDremioApiError(result)
36
+ ? unexpectedError(result.errorMessage)
37
+ : unexpectedError(result);
38
+ }
39
+ };
40
+ /**
41
+ * @hidden
42
+ * @internal
43
+ */
44
+ export class HttpError extends Error {
45
+ status;
46
+ body;
47
+ constructor(status, body) {
48
+ if (typeof body === "string") {
49
+ super(body);
50
+ }
51
+ else if (isProblem(body)) {
52
+ super(body.title);
53
+ }
54
+ else {
55
+ super("An unexpected error occurred while processing this request.");
56
+ }
57
+ this.status = status;
58
+ this.body = body;
59
+ }
60
+ static async fromResponse(res) {
61
+ return new HttpError(res.status, await extractResponseBody(res));
62
+ }
63
+ }
64
+ const systemError = (detail) => ({
65
+ detail,
66
+ title: "An unexpected error occurred while processing your request. Please contact Dremio support if this problem persists.",
67
+ type: "https://api.dremio.dev/problems/system-error",
68
+ });
69
+ export const tokenInvalidError = {
70
+ title: "The provided authentication token was rejected because it was invalid or may have expired.",
71
+ type: "https://api.dremio.dev/problems/auth/token-invalid",
72
+ };
73
+ export const isDremioApiError = (body) => typeof body === "object" && Object.prototype.hasOwnProperty.call(body, "errorMessage");
74
+ //# sourceMappingURL=HttpError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../src/common/HttpError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,mBAAmB,GAAG,KAAK,EAAE,GAAa,EAAE,EAAE;IAClD,IAAI,MAAM,CAAC;IAEX,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAClE,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC;QACnB,KAAK,GAAG;YACN,OAAO,iBAAiB,CAAC;QAC3B,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,GAAG;YACN,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC3F;YACE,OAAO,gBAAgB,CAAC,MAAM,CAAC;gBAC7B,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC;gBACtC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACzB,MAAM,CAAS;IACf,IAAI,CAAU;IACvB,YAAY,MAAc,EAAE,IAAa;QACvC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,GAAa;QACrC,OAAO,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;IACnE,CAAC;CACF;AAED,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE,CACrC,CAAC;IACC,MAAM;IACN,KAAK,EACH,qHAAqH;IACvH,IAAI,EAAE,8CAA8C;CACrD,CAA4B,CAAC;AAEhC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EACH,4FAA4F;IAC9F,IAAI,EAAE,oDAAoD;CAChC,CAAC;AAO7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAA0B,EAAE,CACxE,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 { isProblem, type Problem } from \"./Problem.ts\";\nimport { unexpectedError } from \"./problems.ts\";\n\nconst extractResponseBody = async (res: Response) => {\n let result;\n\n if (res.headers.get(\"content-type\")?.includes(\"application/json\")) {\n result = await res.json();\n } else {\n result = await res.text();\n }\n\n switch (res.status) {\n case 401:\n return tokenInvalidError;\n case 500:\n case 502:\n case 503:\n case 504:\n return isDremioApiError(result) ? systemError(result.errorMessage) : systemError(result);\n default:\n return isDremioApiError(result)\n ? unexpectedError(result.errorMessage)\n : unexpectedError(result);\n }\n};\n\n/**\n * @hidden\n * @internal\n */\nexport class HttpError extends Error {\n readonly status: number;\n readonly body: Problem;\n constructor(status: number, body: Problem) {\n if (typeof body === \"string\") {\n super(body);\n } else if (isProblem(body)) {\n super(body.title);\n } else {\n super(\"An unexpected error occurred while processing this request.\");\n }\n\n this.status = status;\n this.body = body;\n }\n\n static async fromResponse(res: Response) {\n return new HttpError(res.status, await extractResponseBody(res));\n }\n}\n\nconst systemError = (detail: string) =>\n ({\n detail,\n title:\n \"An unexpected error occurred while processing your request. Please contact Dremio support if this problem persists.\",\n type: \"https://api.dremio.dev/problems/system-error\",\n }) as const satisfies Problem;\n\nexport const tokenInvalidError = {\n title:\n \"The provided authentication token was rejected because it was invalid or may have expired.\",\n type: \"https://api.dremio.dev/problems/auth/token-invalid\",\n} as const satisfies Problem;\n\ntype DremioApiError = {\n errorMessage: string;\n moreInfo?: string;\n};\n\nexport const isDremioApiError = (body: unknown): body is DremioApiError =>\n typeof body === \"object\" && Object.prototype.hasOwnProperty.call(body, \"errorMessage\");\n"]}
@@ -0,0 +1,16 @@
1
+ export type CursorParams = {
2
+ starting_after: string;
3
+ ending_before?: void;
4
+ } | {
5
+ starting_after?: void;
6
+ ending_before: string;
7
+ };
8
+ export type LimitParams = {
9
+ limit: number;
10
+ };
11
+ export type OffsetParams = {
12
+ offset: number;
13
+ };
14
+ export type SignalParam = {
15
+ signal?: AbortSignal;
16
+ };
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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
+ export {};
17
+ //# sourceMappingURL=Params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Params.js","sourceRoot":"","sources":["../../src/common/Params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 type CursorParams =\n | { starting_after: string; ending_before?: void }\n | { starting_after?: void; ending_before: string };\n\nexport type LimitParams = {\n limit: number;\n};\n\nexport type OffsetParams = {\n offset: number;\n};\n\nexport type SignalParam = {\n signal?: AbortSignal;\n};\n"]}
@@ -0,0 +1,45 @@
1
+ declare const problemPrefix = "https://api.dremio.dev/problems/";
2
+ type ProblemType = `${typeof problemPrefix}${string}`;
3
+ type ValidationProblemType = `${typeof problemPrefix}validation/${string}`;
4
+ export interface Problem {
5
+ /**
6
+ * A human-readable explanation specific to this occurrence of the problem
7
+ */
8
+ readonly detail?: string;
9
+ /**
10
+ * Additional information specific to this type of problem
11
+ */
12
+ readonly meta?: Record<string, any>;
13
+ /**
14
+ * A human-readable summary of the problem type
15
+ */
16
+ readonly title?: string;
17
+ /**
18
+ * A URI reference that uniquely identifies the problem type
19
+ */
20
+ readonly type: ProblemType;
21
+ }
22
+ export interface ValidationProblem {
23
+ readonly errors: {
24
+ readonly detail?: string;
25
+ readonly pointer: string;
26
+ readonly type: ValidationProblemType;
27
+ readonly value?: unknown;
28
+ }[];
29
+ readonly title: "There was a problem validating the content of the request";
30
+ readonly type: "https://api.dremio.dev/problems/validation-problem";
31
+ }
32
+ /**
33
+ * Resolves an `unknown` object type into a `Problem` if it has
34
+ * the required `type` field set with the proper prefix
35
+ *
36
+ * @internal
37
+ * @hidden
38
+ */
39
+ export declare const isProblem: (object: unknown) => object is Problem;
40
+ /**
41
+ * @hidden
42
+ * @internal
43
+ */
44
+ export declare const isValidationProblem: (object: unknown) => object is ValidationProblem;
45
+ export {};
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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
+ const problemPrefix = "https://api.dremio.dev/problems/";
17
+ /**
18
+ * Resolves an `unknown` object type into a `Problem` if it has
19
+ * the required `type` field set with the proper prefix
20
+ *
21
+ * @internal
22
+ * @hidden
23
+ */
24
+ export const isProblem = (object) => {
25
+ return (object !== null &&
26
+ typeof object === "object" &&
27
+ typeof object["type"] === "string" &&
28
+ object["type"].startsWith(problemPrefix));
29
+ };
30
+ /**
31
+ * @hidden
32
+ * @internal
33
+ */
34
+ export const isValidationProblem = (object) => {
35
+ return isProblem(object) && object.type === "https://api.dremio.dev/problems/validation-problem";
36
+ };
37
+ //# sourceMappingURL=Problem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Problem.js","sourceRoot":"","sources":["../../src/common/Problem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,aAAa,GAAG,kCAAkC,CAAC;AAsCzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAe,EAAqB,EAAE;IAC9D,OAAO,CACL,MAAM,KAAK,IAAI;QACf,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAQ,MAA8B,CAAC,MAAM,CAAC,KAAK,QAAQ;QAC1D,MAA8B,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAClE,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAe,EAA+B,EAAE;IAClF,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,oDAAoD,CAAC;AACnG,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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\nconst problemPrefix = \"https://api.dremio.dev/problems/\";\n\ntype ProblemType = `${typeof problemPrefix}${string}`;\ntype ValidationProblemType = `${typeof problemPrefix}validation/${string}`;\n\nexport interface Problem {\n /**\n * A human-readable explanation specific to this occurrence of the problem\n */\n readonly detail?: string;\n\n /**\n * Additional information specific to this type of problem\n */\n readonly meta?: Record<string, any>;\n\n /**\n * A human-readable summary of the problem type\n */\n readonly title?: string;\n\n /**\n * A URI reference that uniquely identifies the problem type\n */\n readonly type: ProblemType;\n}\n\nexport interface ValidationProblem {\n readonly errors: {\n readonly detail?: string;\n readonly pointer: string;\n readonly type: ValidationProblemType;\n readonly value?: unknown;\n }[];\n readonly title: \"There was a problem validating the content of the request\";\n readonly type: \"https://api.dremio.dev/problems/validation-problem\";\n}\n\n/**\n * Resolves an `unknown` object type into a `Problem` if it has\n * the required `type` field set with the proper prefix\n *\n * @internal\n * @hidden\n */\nexport const isProblem = (object: unknown): object is Problem => {\n return (\n object !== null &&\n typeof object === \"object\" &&\n typeof (object as Record<string, any>)[\"type\"] === \"string\" &&\n (object as Record<string, any>)[\"type\"].startsWith(problemPrefix)\n );\n};\n\n/**\n * @hidden\n * @internal\n */\nexport const isValidationProblem = (object: unknown): object is ValidationProblem => {\n return isProblem(object) && object.type === \"https://api.dremio.dev/problems/validation-problem\";\n};\n"]}
@@ -0,0 +1,6 @@
1
+ export declare class Query {
2
+ readonly sql: string;
3
+ readonly context: string[];
4
+ constructor(sql: string, context?: string[]);
5
+ equals(other: Query): boolean;
6
+ }
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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 deepEqual from "deep-equal";
17
+ export class Query {
18
+ sql;
19
+ context;
20
+ constructor(sql, context = []) {
21
+ this.sql = sql;
22
+ this.context = context;
23
+ }
24
+ equals(other) {
25
+ return (typeof other === typeof this &&
26
+ this.sql === other.sql &&
27
+ deepEqual(this.context, other.context));
28
+ }
29
+ }
30
+ //# sourceMappingURL=Query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Query.js","sourceRoot":"","sources":["../../src/common/Query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,MAAM,OAAO,KAAK;IACP,GAAG,CAAS;IACZ,OAAO,CAAW;IAE3B,YAAY,GAAW,EAAE,UAAoB,EAAE;QAC7C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,KAAY;QACjB,OAAO,CACL,OAAO,KAAK,KAAK,OAAO,IAAI;YAC5B,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG;YACtB,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CACvC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 deepEqual from \"deep-equal\";\n\nexport class Query {\n readonly sql: string;\n readonly context: string[];\n\n constructor(sql: string, context: string[] = []) {\n this.sql = sql;\n this.context = context;\n }\n\n equals(other: Query): boolean {\n return (\n typeof other === typeof this &&\n this.sql === other.sql &&\n deepEqual(this.context, other.context)\n );\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export type CollectBatchFn<K, T> = (keys: Set<K>) => Promise<Map<K, T>>;
2
+ export declare const batch: <K, T>(applyBatch: CollectBatchFn<K, T>) => (key: K) => Promise<T>;
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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
+ export const batch = (applyBatch) => {
17
+ let keys = new Set();
18
+ let p = null;
19
+ return (key) => {
20
+ keys.add(key);
21
+ if (!p) {
22
+ p = new Promise((resolve, reject) => {
23
+ setTimeout(() => {
24
+ const run = async () => {
25
+ p = null;
26
+ const savedKeys = new Set(keys);
27
+ keys = new Set();
28
+ try {
29
+ resolve(await applyBatch(savedKeys));
30
+ }
31
+ catch (e) {
32
+ reject(e);
33
+ }
34
+ };
35
+ void run();
36
+ });
37
+ });
38
+ }
39
+ return p.then((collection) => collection.get(key));
40
+ };
41
+ };
42
+ //# sourceMappingURL=batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.js","sourceRoot":"","sources":["../../src/common/batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAO,UAAgC,EAAE,EAAE;IAC9D,IAAI,IAAI,GAAG,IAAI,GAAG,EAAK,CAAC;IACxB,IAAI,CAAC,GAA8B,IAAI,CAAC;IAExC,OAAO,CAAC,GAAM,EAAc,EAAE;QAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEd,IAAI,CAAC,CAAC,EAAE,CAAC;YACP,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAClC,UAAU,CAAC,GAAG,EAAE;oBACd,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;wBACrB,CAAC,GAAG,IAAI,CAAC;wBACT,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;wBAChC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;wBACjB,IAAI,CAAC;4BACH,OAAO,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;wBACvC,CAAC;wBAAC,OAAO,CAAU,EAAE,CAAC;4BACpB,MAAM,CAAC,CAAU,CAAC,CAAC;wBACrB,CAAC;oBACH,CAAC,CAAC;oBACF,KAAK,GAAG,EAAE,CAAC;gBACb,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 type CollectBatchFn<K, T> = (keys: Set<K>) => Promise<Map<K, T>>;\n\nexport const batch = <K, T>(applyBatch: CollectBatchFn<K, T>) => {\n let keys = new Set<K>();\n let p: Promise<Map<K, T>> | null = null;\n\n return (key: K): Promise<T> => {\n keys.add(key);\n\n if (!p) {\n p = new Promise((resolve, reject) => {\n setTimeout(() => {\n const run = async () => {\n p = null;\n const savedKeys = new Set(keys);\n keys = new Set();\n try {\n resolve(await applyBatch(savedKeys));\n } catch (e: unknown) {\n reject(e as Error);\n }\n };\n void run();\n });\n });\n }\n\n return p.then((collection) => collection.get(key)!);\n };\n};\n"]}
@@ -0,0 +1,6 @@
1
+ import type { Config, RequestFn } from "./Config.ts";
2
+ /**
3
+ * @internal
4
+ * @hidden
5
+ */
6
+ export declare const createRequest: (config: Config) => RequestFn;
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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 { HttpError } from "./HttpError.js";
17
+ const getHeadersFromConfig = async (config) => {
18
+ if (config.credentials) {
19
+ return {
20
+ Authorization: `Bearer ${await config.credentials.get(config)}`,
21
+ };
22
+ }
23
+ return {};
24
+ };
25
+ /**
26
+ * @internal
27
+ * @hidden
28
+ */
29
+ export const createRequest = (config) => {
30
+ const fetch = config.fetch || globalThis.fetch;
31
+ return async (path, init) => {
32
+ const start = performance.now();
33
+ return fetch(new URL(path, config.origin), {
34
+ ...init,
35
+ headers: { ...(await getHeadersFromConfig(config)), ...init?.headers },
36
+ })
37
+ .then(async (res) => {
38
+ config.logger?.debug(`${init?.method?.toUpperCase() || "GET"} ${path} (${res.status}) [${Math.round(performance.now() - start)}ms]`);
39
+ if (!res.ok) {
40
+ throw await HttpError.fromResponse(res);
41
+ }
42
+ return res;
43
+ })
44
+ .catch((err) => {
45
+ if (isFetchFailedError(err)) {
46
+ throw new Error(networkError.title, {
47
+ cause: { ...networkError, additionalDetails: err },
48
+ });
49
+ }
50
+ throw err;
51
+ });
52
+ };
53
+ };
54
+ const networkError = {
55
+ title: "A network error occurred while processing your request. Please ensure that you have a working connection to Dremio.",
56
+ type: "https://api.dremio.dev/problems/network-error",
57
+ };
58
+ const isFetchFailedError = (err) => {
59
+ // Browser and Node fetch
60
+ if (err instanceof TypeError) {
61
+ return true;
62
+ }
63
+ // Bun fetch
64
+ if (typeof err === "object" && err !== null) {
65
+ if ("code" in err) {
66
+ return err.code === "ConnectionRefused";
67
+ }
68
+ }
69
+ return false;
70
+ };
71
+ //# sourceMappingURL=createRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRequest.js","sourceRoot":"","sources":["../../src/common/createRequest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,oBAAoB,GAAG,KAAK,EAAE,MAAc,EAAmC,EAAE;IACrF,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,OAAO;YACL,aAAa,EAAE,UAAU,MAAM,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;SAChE,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,EAAa,EAAE;IACzD,MAAM,KAAK,GAAI,MAAM,CAAC,KAAiC,IAAI,UAAU,CAAC,KAAK,CAAC;IAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC1B,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE;YACzC,GAAG,IAAI;YACP,OAAO,EAAE,EAAE,GAAG,CAAC,MAAM,oBAAoB,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;SACvE,CAAC;aACC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAClB,MAAM,CAAC,MAAM,EAAE,KAAK,CAClB,GAAG,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,KAAK,IAAI,IAAI,KAAK,GAAG,CAAC,MAAM,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,KAAK,CAC/G,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,MAAM,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACtB,IAAI,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;oBAClC,KAAK,EAAE,EAAE,GAAG,YAAY,EAAE,iBAAiB,EAAE,GAAG,EAAE;iBACnD,CAAC,CAAC;YACL,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,KAAK,EACH,qHAAqH;IACvH,IAAI,EAAE,+CAA+C;CAC3B,CAAC;AAE7B,MAAM,kBAAkB,GAAG,CAAC,GAAY,EAAW,EAAE;IACnD,yBAAyB;IACzB,IAAI,GAAG,YAAY,SAAS,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY;IACZ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC5C,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;YAClB,OAAO,GAAG,CAAC,IAAI,KAAK,mBAAmB,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 { Config, RequestFn } from \"./Config.ts\";\nimport { HttpError } from \"./HttpError.ts\";\nimport type { Problem } from \"./Problem.ts\";\n\nconst getHeadersFromConfig = async (config: Config): Promise<RequestInit[\"headers\"]> => {\n if (config.credentials) {\n return {\n Authorization: `Bearer ${await config.credentials.get(config)}`,\n };\n }\n return {};\n};\n\n/**\n * @internal\n * @hidden\n */\nexport const createRequest = (config: Config): RequestFn => {\n const fetch = (config.fetch as typeof globalThis.fetch) || globalThis.fetch;\n return async (path, init) => {\n const start = performance.now();\n return fetch(new URL(path, config.origin), {\n ...init,\n headers: { ...(await getHeadersFromConfig(config)), ...init?.headers },\n })\n .then(async (res) => {\n config.logger?.debug(\n `${init?.method?.toUpperCase() || \"GET\"} ${path} (${res.status}) [${Math.round(performance.now() - start)}ms]`,\n );\n if (!res.ok) {\n throw await HttpError.fromResponse(res);\n }\n return res;\n })\n .catch((err: unknown) => {\n if (isFetchFailedError(err)) {\n throw new Error(networkError.title, {\n cause: { ...networkError, additionalDetails: err },\n });\n }\n throw err;\n });\n };\n};\n\nconst networkError = {\n title:\n \"A network error occurred while processing your request. Please ensure that you have a working connection to Dremio.\",\n type: \"https://api.dremio.dev/problems/network-error\",\n} as const satisfies Problem;\n\nconst isFetchFailedError = (err: unknown): boolean => {\n // Browser and Node fetch\n if (err instanceof TypeError) {\n return true;\n }\n\n // Bun fetch\n if (typeof err === \"object\" && err !== null) {\n if (\"code\" in err) {\n return err.code === \"ConnectionRefused\";\n }\n }\n\n return false;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const fromAbortable: <T>(input: ({ signal }: {
3
+ signal: AbortSignal;
4
+ }) => Promise<T>) => Observable<T>;
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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 { Observable } from "rxjs";
17
+ export const fromAbortable = (input) => new Observable((subscriber) => {
18
+ const controller = new AbortController();
19
+ const { signal } = controller;
20
+ let abortable = true;
21
+ input({ signal }).then((v) => {
22
+ abortable = false;
23
+ subscriber.next(v);
24
+ subscriber.complete();
25
+ }, (e) => {
26
+ abortable = false;
27
+ subscriber.error(e);
28
+ });
29
+ return () => {
30
+ if (abortable) {
31
+ controller.abort();
32
+ }
33
+ };
34
+ });
35
+ //# sourceMappingURL=fromAbortable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromAbortable.js","sourceRoot":"","sources":["../../src/common/fromAbortable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,KAA0D,EAC3C,EAAE,CACjB,IAAI,UAAU,CAAC,CAAC,UAAU,EAAE,EAAE;IAC5B,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IAC9B,IAAI,SAAS,GAAG,IAAI,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CACpB,CAAC,CAAC,EAAE,EAAE;QACJ,SAAS,GAAG,KAAK,CAAC;QAClB,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,UAAU,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC,EACD,CAAC,CAAU,EAAE,EAAE;QACb,SAAS,GAAG,KAAK,CAAC;QAClB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC,CACF,CAAC;IACF,OAAO,GAAG,EAAE;QACV,IAAI,SAAS,EAAE,CAAC;YACd,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 { Observable } from \"rxjs\";\n\nexport const fromAbortable = <T>(\n input: ({ signal }: { signal: AbortSignal }) => Promise<T>,\n): Observable<T> =>\n new Observable((subscriber) => {\n const controller = new AbortController();\n const { signal } = controller;\n let abortable = true;\n\n input({ signal }).then(\n (v) => {\n abortable = false;\n subscriber.next(v);\n subscriber.complete();\n },\n (e: unknown) => {\n abortable = false;\n subscriber.error(e);\n },\n );\n return () => {\n if (abortable) {\n controller.abort();\n }\n };\n });\n"]}
@@ -0,0 +1,9 @@
1
+ export declare const unexpectedError: (detail: string) => {
2
+ readonly detail: string;
3
+ readonly title: "An unexpected error occurred while processing this request.";
4
+ readonly type: "https://api.dremio.dev/problems/unexpected-error";
5
+ };
6
+ export declare const versionConflictError: {
7
+ readonly title: "The version of the provided resource is older than the stored version";
8
+ readonly type: "https://api.dremio.dev/problems/version-conflict";
9
+ };
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (C) 2024-2025 Dremio Corporation
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
+ export const unexpectedError = (detail) => ({
17
+ detail,
18
+ title: "An unexpected error occurred while processing this request.",
19
+ type: "https://api.dremio.dev/problems/unexpected-error",
20
+ });
21
+ export const versionConflictError = {
22
+ title: "The version of the provided resource is older than the stored version",
23
+ type: "https://api.dremio.dev/problems/version-conflict",
24
+ };
25
+ //# sourceMappingURL=problems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"problems.js","sourceRoot":"","sources":["../../src/common/problems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,EAAE,CAChD,CAAC;IACC,MAAM;IACN,KAAK,EAAE,6DAA6D;IACpE,IAAI,EAAE,kDAAkD;CACzD,CAA4B,CAAC;AAEhC,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,uEAAuE;IAC9E,IAAI,EAAE,kDAAkD;CAC9B,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\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 { Problem } from \"./Problem.ts\";\n\nexport const unexpectedError = (detail: string) =>\n ({\n detail,\n title: \"An unexpected error occurred while processing this request.\",\n type: \"https://api.dremio.dev/problems/unexpected-error\",\n }) as const satisfies Problem;\n\nexport const versionConflictError = {\n title: \"The version of the provided resource is older than the stored version\",\n type: \"https://api.dremio.dev/problems/version-conflict\",\n} as const satisfies Problem;\n"]}
@@ -0,0 +1,5 @@
1
+ import { HttpError } from "../common/HttpError.ts";
2
+ export { HttpError };
3
+ export * from "./CredentialProvider.ts";
4
+ export * from "./Problem.ts";
5
+ export * from "./Query.ts";