@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,119 @@
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 { batch } from "../../common/batch.js";
17
+ import { Err, Ok } from "ts-results-es";
18
+ import { catalogObjectFromEntity } from "./catalogObjectFromEntity.js";
19
+ import { HttpError } from "../../common/HttpError.js";
20
+ import { unableToRetrieveProblem } from "../../oss/catalog/catalogErrors.js";
21
+ export const baseRetrieve = (config) => batch(async (ids) => {
22
+ const results = new Map();
23
+ if (ids.size === 1) {
24
+ const id = Array.from(ids).at(0);
25
+ return config
26
+ .sonarV3Request(`catalog/${id}?maxChildren=0`)
27
+ .then((res) => res.json())
28
+ .then((response) => {
29
+ results.set(id, Ok(catalogObjectFromEntity(config, baseRetrieveByPath(config))(response)));
30
+ return results;
31
+ })
32
+ .catch((e) => {
33
+ if (e instanceof HttpError && e.body?.detail) {
34
+ results.set(id, Err(unableToRetrieveProblem(e.body.detail)));
35
+ }
36
+ else {
37
+ results.set(id, Err(unableToRetrieveProblem()));
38
+ }
39
+ return results;
40
+ });
41
+ }
42
+ const idsArray = Array.from(ids);
43
+ const chunks = [];
44
+ while (idsArray.length > 0) {
45
+ chunks.push(idsArray.splice(0, Math.min(50, idsArray.length)));
46
+ }
47
+ const catalogItems = await Promise.all(chunks.map((chunk) => config
48
+ .sonarV3Request(`catalog/by-ids?maxChildren=0`, {
49
+ body: JSON.stringify(chunk),
50
+ headers: { "Content-Type": "application/json" },
51
+ method: "POST",
52
+ })
53
+ .then((res) => res.json())
54
+ .then((response) => response.data))).then((chunks) => chunks.flat());
55
+ for (const catalogItem of catalogItems) {
56
+ results.set(catalogItem.id, Ok(catalogObjectFromEntity(config, baseRetrieveByPath(config))(catalogItem)));
57
+ }
58
+ for (const id of ids) {
59
+ if (!results.has(id)) {
60
+ results.set(id, Err(unableToRetrieveProblem()));
61
+ }
62
+ }
63
+ return results;
64
+ });
65
+ export const baseRetrieveByPath = (config) => batch(async (paths) => {
66
+ const results = new Map();
67
+ // Because the key is a reference type (array), we need to store the
68
+ // original path reference
69
+ const originalKeyRef = new Map();
70
+ for (const key of paths) {
71
+ originalKeyRef.set(JSON.stringify(key), key);
72
+ }
73
+ if (paths.size === 1) {
74
+ const path = Array.from(paths).at(0);
75
+ return config
76
+ .sonarV3Request(`catalog/by-path/${path.map(encodeURIComponent).join("/")}?maxChildren=0`)
77
+ .then((res) => res.json())
78
+ .then((response) => {
79
+ results.set(path, Ok(catalogObjectFromEntity(config, baseRetrieveByPath(config))(response)));
80
+ return results;
81
+ })
82
+ .catch((e) => {
83
+ if (e instanceof HttpError && e.body?.detail) {
84
+ results.set(path, Err(unableToRetrieveProblem(e.body.detail)));
85
+ }
86
+ else {
87
+ results.set(path, Err(unableToRetrieveProblem()));
88
+ }
89
+ return results;
90
+ });
91
+ }
92
+ const pathsArray = Array.from(paths);
93
+ const chunks = [];
94
+ while (pathsArray.length > 0) {
95
+ chunks.push(pathsArray.splice(0, Math.min(50, pathsArray.length)));
96
+ }
97
+ const catalogItems = await Promise.all(chunks.map((chunk) => config
98
+ .sonarV3Request(`catalog/by-paths?maxChildren=0`, {
99
+ body: JSON.stringify(chunk),
100
+ headers: { "Content-Type": "application/json" },
101
+ method: "POST",
102
+ })
103
+ .then((res) => res.json())
104
+ .then((response) => response.data))).then((chunks) => chunks.flat());
105
+ for (const catalogItem of catalogItems) {
106
+ const resolved = catalogObjectFromEntity(config, baseRetrieveByPath(config))(catalogItem);
107
+ const originalKey = originalKeyRef.get(JSON.stringify(resolved.path));
108
+ if (originalKey) {
109
+ results.set(originalKey, Ok(resolved));
110
+ }
111
+ }
112
+ for (const path of paths) {
113
+ if (!results.has(path)) {
114
+ results.set(path, Err(unableToRetrieveProblem()));
115
+ }
116
+ }
117
+ return results;
118
+ });
119
+ //# sourceMappingURL=catalogRetrieve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogRetrieve.js","sourceRoot":"","sources":["../../../src/enterprise/catalog/catalogRetrieve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAqB,EAAE,EAAE,CACpD,KAAK,CAAC,KAAK,EAAE,GAAgB,EAAE,EAAE;IAC/B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoD,CAAC;IAE5E,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,CAAC;QAClC,OAAO,MAAM;aACV,cAAc,CAAC,WAAW,EAAE,gBAAgB,CAAC;aAC7C,IAAI,CAAC,CAAC,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C;IAED,OAAO,OAAO,CAAC;AACjB,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 { batch } from \"../../common/batch.ts\";\nimport { Err, Ok, type Result } from \"ts-results-es\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { catalogObjectFromEntity } from \"./catalogObjectFromEntity.ts\";\nimport { HttpError } from \"../../common/HttpError.ts\";\nimport type { EnterpriseCatalogObject } from \"./CatalogObjects/index.ts\";\nimport { unableToRetrieveProblem } from \"../../oss/catalog/catalogErrors.ts\";\n\nexport const baseRetrieve = (config: SonarV3Config) =>\n batch(async (ids: Set<string>) => {\n const results = new Map<string, Result<EnterpriseCatalogObject, unknown>>();\n\n if (ids.size === 1) {\n const id = Array.from(ids).at(0)!;\n return config\n .sonarV3Request(`catalog/${id}?maxChildren=0`)\n .then((res) => res.json())\n .then((response) => {\n results.set(\n id,\n Ok(catalogObjectFromEntity(config, baseRetrieveByPath(config))(response) as any),\n );\n return results;\n })\n .catch((e) => {\n if (e instanceof HttpError && (e.body as any)?.detail) {\n results.set(id, Err(unableToRetrieveProblem((e.body as any).detail)));\n } else {\n results.set(id, Err(unableToRetrieveProblem()));\n }\n\n return results;\n });\n }\n\n const idsArray = Array.from(ids);\n const chunks = [];\n\n while (idsArray.length > 0) {\n chunks.push(idsArray.splice(0, Math.min(50, idsArray.length)));\n }\n\n const catalogItems = await Promise.all(\n chunks.map((chunk) =>\n config\n .sonarV3Request(`catalog/by-ids?maxChildren=0`, {\n body: JSON.stringify(chunk),\n headers: { \"Content-Type\": \"application/json\" },\n method: \"POST\",\n })\n .then((res) => res.json())\n .then((response) => response.data),\n ),\n ).then((chunks) => chunks.flat());\n\n for (const catalogItem of catalogItems) {\n results.set(\n catalogItem.id,\n Ok(catalogObjectFromEntity(config, baseRetrieveByPath(config))(catalogItem) as any),\n );\n }\n\n for (const id of ids) {\n if (!results.has(id)) {\n results.set(id, Err(unableToRetrieveProblem()));\n }\n }\n\n return results;\n });\n\nexport const baseRetrieveByPath = (config: SonarV3Config) =>\n batch(async (paths: Set<string[]>) => {\n const results = new Map<string[], Result<EnterpriseCatalogObject, unknown>>();\n\n // Because the key is a reference type (array), we need to store the\n // original path reference\n const originalKeyRef = new Map<string, string[]>();\n for (const key of paths) {\n originalKeyRef.set(JSON.stringify(key), key);\n }\n\n if (paths.size === 1) {\n const path = Array.from(paths).at(0)!;\n return config\n .sonarV3Request(`catalog/by-path/${path.map(encodeURIComponent).join(\"/\")}?maxChildren=0`)\n .then((res) => res.json())\n .then((response) => {\n results.set(\n path,\n Ok(catalogObjectFromEntity(config, baseRetrieveByPath(config))(response)) as any,\n );\n return results;\n })\n .catch((e) => {\n if (e instanceof HttpError && (e.body as any)?.detail) {\n results.set(path, Err(unableToRetrieveProblem((e.body as any).detail)));\n } else {\n results.set(path, Err(unableToRetrieveProblem()));\n }\n return results;\n });\n }\n\n const pathsArray = Array.from(paths);\n const chunks = [];\n\n while (pathsArray.length > 0) {\n chunks.push(pathsArray.splice(0, Math.min(50, pathsArray.length)));\n }\n\n const catalogItems = await Promise.all(\n chunks.map((chunk) =>\n config\n .sonarV3Request(`catalog/by-paths?maxChildren=0`, {\n body: JSON.stringify(chunk),\n headers: { \"Content-Type\": \"application/json\" },\n method: \"POST\",\n })\n .then((res) => res.json())\n .then((response) => response.data),\n ),\n ).then((chunks) => chunks.flat());\n\n for (const catalogItem of catalogItems) {\n const resolved = catalogObjectFromEntity(config, baseRetrieveByPath(config))(catalogItem);\n const originalKey = originalKeyRef.get(JSON.stringify(resolved.path));\n if (originalKey) {\n results.set(originalKey, Ok(resolved) as any);\n }\n }\n\n for (const path of paths) {\n if (!results.has(path)) {\n results.set(path, Err(unableToRetrieveProblem()));\n }\n }\n\n return results;\n });\n"]}
@@ -0,0 +1,12 @@
1
+ import type { Config } from "../../common/Config.ts";
2
+ export declare const exchangePat: (endpoint: URL, config: Config) => (subject_token: string) => Promise<{
3
+ access_token: string;
4
+ expires_in: number;
5
+ token_type: string;
6
+ issued_token_type: string;
7
+ scope: string;
8
+ }>;
9
+ export declare const invalidSubjectToken: {
10
+ readonly title: "The provided subject_token is invalid.";
11
+ readonly type: "https://api.dremio.dev/problems/oauth2/invalid-subject-token";
12
+ };
@@ -0,0 +1,55 @@
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 "../../common/HttpError.js";
17
+ import {} from "../../common/Problem.js";
18
+ export const exchangePat = (endpoint, config) => (subject_token) => {
19
+ const body = new URLSearchParams({
20
+ grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
21
+ scope: "dremio.all",
22
+ subject_token,
23
+ subject_token_type: "urn:ietf:params:oauth:token-type:dremio:personal-access-token",
24
+ });
25
+ return (config.fetch || globalThis.fetch)(endpoint.toString(), {
26
+ body,
27
+ headers: {
28
+ Accept: "application/json",
29
+ "Content-Type": "application/x-www-form-urlencoded",
30
+ },
31
+ method: "POST",
32
+ })
33
+ .then(async (res) => {
34
+ if (!res.ok) {
35
+ throw await HttpError.fromResponse(res);
36
+ }
37
+ return res.json();
38
+ })
39
+ .catch((e) => {
40
+ if (e instanceof HttpError) {
41
+ if (e.status === 401) {
42
+ config.logger?.warn(invalidSubjectToken);
43
+ throw new Error(invalidSubjectToken.title, {
44
+ cause: invalidSubjectToken,
45
+ });
46
+ }
47
+ }
48
+ throw e;
49
+ });
50
+ };
51
+ export const invalidSubjectToken = {
52
+ title: "The provided subject_token is invalid.",
53
+ type: "https://api.dremio.dev/problems/oauth2/invalid-subject-token",
54
+ };
55
+ //# sourceMappingURL=exchangePat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchangePat.js","sourceRoot":"","sources":["../../../src/enterprise/credentials/exchangePat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAgB,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAa,EAAE,MAAc,EAAE,EAAE,CAAC,CAAC,aAAqB,EAAE,EAAE;IACtF,MAAM,IAAI,GAAG,IAAI,eAAe,CAAC;QAC/B,UAAU,EAAE,iDAAiD;QAC7D,KAAK,EAAE,YAAY;QACnB,aAAa;QACb,kBAAkB,EAAE,+DAA+D;KACpF,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE;QAC7D,IAAI;QACJ,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,cAAc,EAAE,mCAAmC;SACpD;QACD,MAAM,EAAE,MAAM;KACf,CAAC;SACC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAClB,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,MAAM,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,GAAG,CAAC,IAAI,EAMb,CAAC;IACL,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACX,IAAI,CAAC,YAAY,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACrB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,KAAK,EAAE;oBACzC,KAAK,EAAE,mBAAmB;iBAC3B,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,wCAAwC;IAC/C,IAAI,EAAE,8DAA8D;CAC1C,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 { HttpError } from \"../../common/HttpError.ts\";\nimport type { Config } from \"../../common/Config.ts\";\nimport { type Problem } from \"../../common/Problem.ts\";\n\nexport const exchangePat = (endpoint: URL, config: Config) => (subject_token: string) => {\n const body = new URLSearchParams({\n grant_type: \"urn:ietf:params:oauth:grant-type:token-exchange\",\n scope: \"dremio.all\",\n subject_token,\n subject_token_type: \"urn:ietf:params:oauth:token-type:dremio:personal-access-token\",\n });\n return (config.fetch || globalThis.fetch)(endpoint.toString(), {\n body,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n method: \"POST\",\n })\n .then(async (res) => {\n if (!res.ok) {\n throw await HttpError.fromResponse(res);\n }\n\n return res.json() as Promise<{\n access_token: string;\n expires_in: number;\n token_type: string;\n issued_token_type: string;\n scope: string;\n }>;\n })\n .catch((e) => {\n if (e instanceof HttpError) {\n if (e.status === 401) {\n config.logger?.warn(invalidSubjectToken);\n throw new Error(invalidSubjectToken.title, {\n cause: invalidSubjectToken,\n });\n }\n }\n throw e;\n });\n};\n\nexport const invalidSubjectToken = {\n title: \"The provided subject_token is invalid.\",\n type: \"https://api.dremio.dev/problems/oauth2/invalid-subject-token\",\n} as const satisfies Problem;\n"]}
@@ -0,0 +1,2 @@
1
+ import type { CredentialProvider } from "../../common/CredentialProvider.ts";
2
+ export declare const fromPat: (pat: string) => CredentialProvider;
@@ -0,0 +1,36 @@
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 { exchangePat } from "./exchangePat.js";
17
+ export const fromPat = (pat) => {
18
+ let access_token = null;
19
+ let expires_at = null;
20
+ return {
21
+ get: async (config) => {
22
+ if (!access_token || (expires_at && expires_at <= new Date(Date.now() - 60000))) {
23
+ try {
24
+ const response = await exchangePat(new URL("/oauth/token", config.origin), config)(pat);
25
+ access_token = response.access_token;
26
+ expires_at = new Date(Date.now() + response.expires_in * 1000);
27
+ }
28
+ catch (_e) {
29
+ access_token = pat;
30
+ }
31
+ }
32
+ return access_token;
33
+ },
34
+ };
35
+ };
36
+ //# sourceMappingURL=fromPat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromPat.js","sourceRoot":"","sources":["../../../src/enterprise/credentials/fromPat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAW,EAAsB,EAAE;IACzD,IAAI,YAAY,GAAkB,IAAI,CAAC;IACvC,IAAI,UAAU,GAAgB,IAAI,CAAC;IACnC,OAAO;QACL,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACpB,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,IAAI,UAAU,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;gBAChF,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;oBAExF,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;oBACrC,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;gBACjE,CAAC;gBAAC,OAAO,EAAW,EAAE,CAAC;oBACrB,YAAY,GAAG,GAAG,CAAC;gBACrB,CAAC;YACH,CAAC;YACD,OAAO,YAAY,CAAC;QACtB,CAAC;KACF,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\nimport { exchangePat } from \"./exchangePat.ts\";\nimport type { CredentialProvider } from \"../../common/CredentialProvider.ts\";\n\nexport const fromPat = (pat: string): CredentialProvider => {\n let access_token: string | null = null;\n let expires_at: Date | null = null;\n return {\n get: async (config) => {\n if (!access_token || (expires_at && expires_at <= new Date(Date.now() - 60000))) {\n try {\n const response = await exchangePat(new URL(\"/oauth/token\", config.origin), config)(pat);\n\n access_token = response.access_token;\n expires_at = new Date(Date.now() + response.expires_in * 1000);\n } catch (_e: unknown) {\n access_token = pat;\n }\n }\n return access_token;\n },\n };\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "../../oss/credentials/index.ts";
2
+ export * from "./fromPat.ts";
@@ -0,0 +1,18 @@
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 * from "../../oss/credentials/index.js";
17
+ export * from "./fromPat.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enterprise/credentials/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,gCAAgC,CAAC;AAC/C,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\nexport * from \"../../oss/credentials/index.ts\";\nexport * from \"./fromPat.ts\";\n"]}
@@ -0,0 +1,78 @@
1
+ import type { SonarV3Config } from "../../common/Config.ts";
2
+ import { type Result } from "ts-results-es";
3
+ export declare class Engine {
4
+ #private;
5
+ readonly id: EngineEntity["id"];
6
+ readonly name: EngineEntity["name"];
7
+ readonly spec: {
8
+ c3StorageSize: EngineEntity["spec"]["c3StorageSize"];
9
+ executorPodMetadata: {
10
+ annotations: EngineEntity["spec"]["executorPodMetadata"]["annotations"];
11
+ labels: EngineEntity["spec"]["executorPodMetadata"]["labels"];
12
+ nodeSelectors: EngineEntity["spec"]["executorPodMetadata"]["nodeSelectors"];
13
+ tolerations: {
14
+ key: EngineEntity["spec"]["executorPodMetadata"]["tolerations"][number]["key"];
15
+ operator: EngineEntity["spec"]["executorPodMetadata"]["tolerations"][number]["operator"];
16
+ effect: EngineEntity["spec"]["executorPodMetadata"]["tolerations"][number]["effect"];
17
+ tolerationDuration: Temporal.Duration;
18
+ value?: EngineEntity["spec"]["executorPodMetadata"]["tolerations"][number]["value"];
19
+ }[];
20
+ idleTimeout?: Temporal.Duration;
21
+ resourceAllocationOffset: EngineEntity["spec"]["executorPodMetadata"]["resourceAllocationOffset"];
22
+ size: EngineEntity["spec"]["executorPodMetadata"]["size"];
23
+ spillStorageSize: EngineEntity["spec"]["executorPodMetadata"]["spillStorageSize"];
24
+ targetCpuCapacity: EngineEntity["spec"]["executorPodMetadata"]["targetCpuCapacity"];
25
+ };
26
+ };
27
+ readonly status: Omit<EngineEntity["status"], "message"> & {
28
+ message: string | null;
29
+ };
30
+ constructor(entity: EngineEntity, config: SonarV3Config);
31
+ get settled(): boolean;
32
+ start(): Promise<Result<Engine, unknown>>;
33
+ stop(): Promise<Result<Engine, unknown>>;
34
+ }
35
+ export type EngineEntity = {
36
+ id: string;
37
+ name: string;
38
+ spec: {
39
+ c3StorageSize: string;
40
+ executorPodMetadata: {
41
+ labels: Record<string, string>;
42
+ annotations: Record<string, string>;
43
+ nodeSelectors: Record<string, string>;
44
+ tolerations: {
45
+ key: string;
46
+ operator: "Exists" | "Equal";
47
+ effect: "NoSchedule" | "PreferNoSchedule" | "NoExecute";
48
+ tolerationSeconds: number;
49
+ value?: number;
50
+ }[];
51
+ idleTimeout?: string;
52
+ resourceAllocationOffset: string;
53
+ size: "2XSmall" | "XSmall" | "Small" | "Medium" | "Large" | "XLarge" | "2XLarge";
54
+ spillStorageSize: string;
55
+ targetCpuCapacity: string;
56
+ };
57
+ };
58
+ status: {
59
+ message: string;
60
+ replicas: {
61
+ id: string;
62
+ executors: {
63
+ cpu: number;
64
+ memory: number;
65
+ name: string;
66
+ status: string;
67
+ }[];
68
+ }[];
69
+ runningExecutors: number;
70
+ runningReplicas: number;
71
+ startingExecutors: number;
72
+ startingReplicas: number;
73
+ state: "STARTING" | "RUNNING" | "STOPPING" | "STOPPED" | "WARNING" | "FAILED";
74
+ stoppingExecutors: number;
75
+ stoppingReplicas: number;
76
+ };
77
+ version: string;
78
+ };
@@ -0,0 +1,75 @@
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 parseMilliseconds from "parse-ms";
17
+ import { Err, Ok } from "ts-results-es";
18
+ export class Engine {
19
+ id;
20
+ name;
21
+ spec;
22
+ status;
23
+ #config;
24
+ // eslint-disable-next-line no-unused-private-class-members
25
+ #tag;
26
+ constructor(entity, config) {
27
+ this.id = entity.id;
28
+ this.name = entity.name;
29
+ this.spec = {
30
+ ...entity.spec,
31
+ executorPodMetadata: {
32
+ ...entity.spec.executorPodMetadata,
33
+ idleTimeout: entity.spec.executorPodMetadata.idleTimeout
34
+ ? Temporal.Duration.from(entity.spec.executorPodMetadata.idleTimeout)
35
+ : undefined,
36
+ tolerations: entity.spec.executorPodMetadata.tolerations.map(({ tolerationSeconds, ...toleration }) => ({
37
+ ...toleration,
38
+ tolerationDuration: Temporal.Duration.from(parseMilliseconds(tolerationSeconds * 1000)),
39
+ })),
40
+ },
41
+ };
42
+ this.status = {
43
+ ...entity.status,
44
+ message: entity.status.message?.length ? entity.status.message : null,
45
+ };
46
+ this.#tag = entity.version;
47
+ this.#config = config;
48
+ }
49
+ get settled() {
50
+ return this.status.state !== "STARTING" && this.status.state !== "STOPPING";
51
+ }
52
+ start() {
53
+ return this.#config
54
+ .sonarV3Request(`engines/${this.id}/start`, {
55
+ headers: { Accept: "application/json" },
56
+ keepalive: true,
57
+ method: "PUT",
58
+ })
59
+ .then((res) => res.json())
60
+ .then((entity) => Ok(new Engine(entity, this.#config)))
61
+ .catch((e) => Err(e));
62
+ }
63
+ stop() {
64
+ return this.#config
65
+ .sonarV3Request(`engines/${this.id}/stop`, {
66
+ headers: { Accept: "application/json" },
67
+ keepalive: true,
68
+ method: "PUT",
69
+ })
70
+ .then((res) => res.json())
71
+ .then((entity) => Ok(new Engine(entity, this.#config)))
72
+ .catch((e) => Err(e));
73
+ }
74
+ }
75
+ //# sourceMappingURL=Engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Engine.js","sourceRoot":"","sources":["../../../src/enterprise/engines/Engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,eAAe,CAAC;AAErD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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 parseMilliseconds from \"parse-ms\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { Err, Ok, type Result } from \"ts-results-es\";\n\nexport class Engine {\n public readonly id: EngineEntity[\"id\"];\n public readonly name: EngineEntity[\"name\"];\n public readonly spec: {\n c3StorageSize: EngineEntity[\"spec\"][\"c3StorageSize\"];\n executorPodMetadata: {\n annotations: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"annotations\"];\n labels: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"labels\"];\n nodeSelectors: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"nodeSelectors\"];\n tolerations: {\n key: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"key\"];\n operator: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"operator\"];\n effect: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"effect\"];\n tolerationDuration: Temporal.Duration;\n value?: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"value\"];\n }[];\n idleTimeout?: Temporal.Duration;\n resourceAllocationOffset: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"resourceAllocationOffset\"];\n size: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"size\"];\n spillStorageSize: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"spillStorageSize\"];\n targetCpuCapacity: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"targetCpuCapacity\"];\n };\n };\n public readonly status: Omit<EngineEntity[\"status\"], \"message\"> & {\n message: string | null;\n };\n\n readonly #config: SonarV3Config;\n\n // eslint-disable-next-line no-unused-private-class-members\n readonly #tag: string;\n\n constructor(entity: EngineEntity, config: SonarV3Config) {\n this.id = entity.id;\n this.name = entity.name;\n this.spec = {\n ...entity.spec,\n executorPodMetadata: {\n ...entity.spec.executorPodMetadata,\n idleTimeout: entity.spec.executorPodMetadata.idleTimeout\n ? Temporal.Duration.from(entity.spec.executorPodMetadata.idleTimeout)\n : undefined,\n tolerations: entity.spec.executorPodMetadata.tolerations.map(\n ({ tolerationSeconds, ...toleration }) => ({\n ...toleration,\n tolerationDuration: Temporal.Duration.from(parseMilliseconds(tolerationSeconds * 1000)),\n }),\n ),\n },\n };\n this.status = {\n ...entity.status,\n message: entity.status.message?.length ? entity.status.message : null,\n };\n this.#tag = entity.version;\n this.#config = config;\n }\n\n get settled() {\n return this.status.state !== \"STARTING\" && this.status.state !== \"STOPPING\";\n }\n\n start(): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}/start`, {\n headers: { Accept: \"application/json\" },\n keepalive: true,\n method: \"PUT\",\n })\n .then((res) => res.json() as Promise<EngineEntity>)\n .then((entity) => Ok(new Engine(entity, this.#config)))\n .catch((e: unknown) => Err(e));\n }\n\n stop(): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}/stop`, {\n headers: { Accept: \"application/json\" },\n keepalive: true,\n method: \"PUT\",\n })\n .then((res) => res.json() as Promise<EngineEntity>)\n .then((entity) => Ok(new Engine(entity, this.#config)))\n .catch((e: unknown) => Err(e));\n }\n}\n\nexport type EngineEntity = {\n id: string;\n name: string;\n spec: {\n c3StorageSize: string;\n executorPodMetadata: {\n labels: Record<string, string>;\n annotations: Record<string, string>;\n nodeSelectors: Record<string, string>;\n tolerations: {\n key: string;\n operator: \"Exists\" | \"Equal\";\n effect: \"NoSchedule\" | \"PreferNoSchedule\" | \"NoExecute\";\n tolerationSeconds: number;\n value?: number;\n }[];\n idleTimeout?: string;\n resourceAllocationOffset: string;\n size: \"2XSmall\" | \"XSmall\" | \"Small\" | \"Medium\" | \"Large\" | \"XLarge\" | \"2XLarge\";\n spillStorageSize: string;\n targetCpuCapacity: string;\n };\n };\n status: {\n message: string;\n replicas: {\n id: string;\n executors: {\n cpu: number;\n memory: number;\n name: string;\n status: string;\n }[];\n }[];\n runningExecutors: number;\n runningReplicas: number;\n startingExecutors: number;\n startingReplicas: number;\n state: \"STARTING\" | \"RUNNING\" | \"STOPPING\" | \"STOPPED\" | \"WARNING\" | \"FAILED\";\n stoppingExecutors: number;\n stoppingReplicas: number;\n };\n version: string;\n};\n"]}
@@ -0,0 +1,10 @@
1
+ import type { ResourceConfig, SonarV3Config } from "../../common/Config.ts";
2
+ import type { SignalParam } from "../../common/Params.ts";
3
+ import { Engine } from "./Engine.ts";
4
+ export declare class EnginesResource {
5
+ #private;
6
+ constructor(config: ResourceConfig & SonarV3Config);
7
+ list(): {
8
+ data({ signal }?: SignalParam): AsyncGenerator<Engine, void, unknown>;
9
+ };
10
+ }
@@ -0,0 +1,34 @@
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 { Engine } from "./Engine.js";
17
+ export class EnginesResource {
18
+ #config;
19
+ constructor(config) {
20
+ this.#config = config;
21
+ }
22
+ list() {
23
+ const getPage = ({ signal } = {}) => this.#config
24
+ .sonarV3Request("engines", { headers: { Accept: "application/json" }, signal })
25
+ .then((res) => res.json())
26
+ .then((res) => res.data.map((entity) => new Engine(entity, this.#config)));
27
+ return {
28
+ async *data({ signal } = {}) {
29
+ yield* await getPage({ signal });
30
+ },
31
+ };
32
+ }
33
+ }
34
+ //# sourceMappingURL=EnginesResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnginesResource.js","sourceRoot":"","sources":["../../../src/enterprise/engines/EnginesResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAC;AAExD,MAAM,OAAO,eAAe;IACjB,OAAO,CAAiC;IAEjD,YAAY,MAAsC;QAChD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,IAAI;QACF,MAAM,OAAO,GAAG,CAAC,EAAE,MAAM,KAAkB,EAAE,EAAE,EAAE,CAC/C,IAAI,CAAC,OAAO;aACT,cAAc,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,MAAM,EAAE,CAAC;aAC9E,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAuC,CAAC;aAC9D,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/E,OAAO;YACL,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,KAAkB,EAAE;gBACtC,KAAK,CAAC,CAAC,MAAM,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;YACnC,CAAC;SACF,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 type { ResourceConfig, SonarV3Config } from \"../../common/Config.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { Engine, type EngineEntity } from \"./Engine.ts\";\n\nexport class EnginesResource {\n readonly #config: ResourceConfig & SonarV3Config;\n\n constructor(config: ResourceConfig & SonarV3Config) {\n this.#config = config;\n }\n\n list() {\n const getPage = ({ signal }: SignalParam = {}) =>\n this.#config\n .sonarV3Request(\"engines\", { headers: { Accept: \"application/json\" }, signal })\n .then((res) => res.json() as Promise<{ data: EngineEntity[] }>)\n .then((res) => res.data.map((entity) => new Engine(entity, this.#config)));\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* await getPage({ signal });\n },\n };\n }\n}\n"]}
@@ -0,0 +1,60 @@
1
+ import type { Config } from "../common/Config.ts";
2
+ import { Resources } from "./resources.ts";
3
+ export declare const Dremio: (config: Config) => {
4
+ _request: import("../common/Config.ts").RequestFn;
5
+ _sonarResourceConfig: {
6
+ logger: {
7
+ debug: typeof console.debug;
8
+ error: typeof console.error;
9
+ info: typeof console.info;
10
+ warn: typeof console.warn;
11
+ } | undefined;
12
+ origin: string;
13
+ request: import("../common/Config.ts").RequestFn;
14
+ sonarV2Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
15
+ sonarV3Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
16
+ v3Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
17
+ };
18
+ _sonarV2Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
19
+ _sonarV3Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
20
+ catalog: {
21
+ _catalogReferenceFromEntity: (entity: unknown) => import("./interfaces.ts").EnterpriseCatalogReference;
22
+ list: () => {
23
+ data(): AsyncGenerator<import("./interfaces.ts").EnterpriseFunctionCatalogReference | import("./interfaces.ts").EnterpriseHomeCatalogReference | import("./interfaces.ts").EnterpriseSourceCatalogReference | import("./interfaces.ts").EnterpriseSpaceCatalogReference, void, unknown>;
24
+ };
25
+ retrieve: (key: string) => Promise<import("ts-results-es").Result<import("./interfaces.ts").EnterpriseCatalogObject, unknown>>;
26
+ retrieveByPath: (key: string[]) => Promise<import("ts-results-es").Result<import("./interfaces.ts").EnterpriseCatalogObject, unknown>>;
27
+ };
28
+ engines: import("./engines/EnginesResource.ts").EnginesResource;
29
+ jobs: {
30
+ create: (query: import("../common/Query.ts").Query) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<string>>;
31
+ observe: (id: string) => import("rxjs").Observable<import("../oss/jobs/Job.ts").JobResult>;
32
+ retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("../oss/jobs/Job.ts").JobResult>;
33
+ };
34
+ roles: {
35
+ retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Result<import("./interfaces.ts").Role, unknown>>;
36
+ retrieveByName: (name: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Result<import("./interfaces.ts").Role, unknown>>;
37
+ };
38
+ scripts: {
39
+ list(): {
40
+ data({ signal }?: import("../common/Params.ts").SignalParam): AsyncGenerator<import("./interfaces.ts").EnterpriseScript, void, unknown>;
41
+ };
42
+ retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseScript>>;
43
+ store: (properties: {
44
+ name: string;
45
+ query: import("../common/Query.ts").Query;
46
+ }) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseScript>>;
47
+ };
48
+ users: {
49
+ retrieveById: (id: string, { signal }?: {
50
+ signal?: AbortSignal;
51
+ }) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseUser>>;
52
+ retrieveByName: (name: string, { signal }?: {
53
+ signal?: AbortSignal;
54
+ }) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseUser>>;
55
+ };
56
+ };
57
+ export * from "../common/sharedExports.ts";
58
+ export * from "./credentials/index.ts";
59
+ export * from "./interfaces.ts";
60
+ export { Resources as _Resources };
@@ -0,0 +1,43 @@
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 { createRequest } from "../common/createRequest.js";
17
+ import { Resources } from "./resources.js";
18
+ const getSonarResourceConfig = (config) => {
19
+ const request = createRequest(config);
20
+ return {
21
+ logger: config.logger,
22
+ origin: config.origin,
23
+ request,
24
+ sonarV2Request: (path, init) => request(`/apiv2/${path}`, init),
25
+ sonarV3Request: (path, init) => request(`/api/v3/${path}`, init),
26
+ v3Request: (path, init) => request(`/api/v3/${path}`, init),
27
+ };
28
+ };
29
+ export const Dremio = (config) => {
30
+ const sonarResourceConfig = getSonarResourceConfig(config);
31
+ return {
32
+ ...Resources(sonarResourceConfig),
33
+ _request: sonarResourceConfig.request,
34
+ _sonarResourceConfig: sonarResourceConfig,
35
+ _sonarV2Request: sonarResourceConfig.sonarV2Request,
36
+ _sonarV3Request: sonarResourceConfig.sonarV3Request,
37
+ };
38
+ };
39
+ export * from "../common/sharedExports.js";
40
+ export * from "./credentials/index.js";
41
+ export * from "./interfaces.js";
42
+ export { Resources as _Resources };
43
+ //# sourceMappingURL=index.js.map