@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,94 @@
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 { Err, Ok } from "ts-results-es";
17
+ import { Query } from "../../common/Query.js";
18
+ import { HttpError } from "../../common/HttpError.js";
19
+ import { duplicateScriptNameError } from "./ScriptErrors.js";
20
+ export class Script {
21
+ createdAt;
22
+ createdBy;
23
+ id;
24
+ modifiedAt;
25
+ modifiedBy;
26
+ name;
27
+ query;
28
+ #config;
29
+ constructor(properties, config) {
30
+ this.createdAt = properties.createdAt;
31
+ this.createdBy = properties.createdBy;
32
+ this.id = properties.id;
33
+ this.modifiedAt = properties.modifiedAt;
34
+ this.modifiedBy = properties.modifiedBy;
35
+ this.name = properties.name;
36
+ this.query = properties.query;
37
+ this.#config = config;
38
+ }
39
+ async delete() {
40
+ return this.#config
41
+ .sonarV3Request(`scripts/${this.id}`, {
42
+ keepalive: true,
43
+ method: "DELETE",
44
+ })
45
+ .then(() => Ok(undefined))
46
+ .catch((e) => Err(e));
47
+ }
48
+ async save(properties) {
49
+ return saveScript(this.id, this.#config)(properties).then((result) => result.map((value) => new Script(scriptEntityToProperties(value), this.#config)));
50
+ }
51
+ }
52
+ export const scriptEntityToProperties = (entity) => ({
53
+ createdAt: Temporal.Instant.from(entity.createdAt),
54
+ createdBy: entity.createdBy,
55
+ id: entity.id,
56
+ modifiedAt: Temporal.Instant.from(entity.modifiedAt),
57
+ modifiedBy: entity.modifiedBy,
58
+ name: entity.name,
59
+ query: new Query(entity.content, entity.context),
60
+ });
61
+ export const createScriptPatchedFields = (properties) => {
62
+ const patchedFields = {};
63
+ if (properties.name) {
64
+ patchedFields.name = properties.name;
65
+ }
66
+ if (properties.query) {
67
+ patchedFields.content = properties.query.sql;
68
+ patchedFields.context = properties.query.context;
69
+ }
70
+ return patchedFields;
71
+ };
72
+ export const saveScript = (id, config) => (body) => {
73
+ return config
74
+ .sonarV3Request(`scripts/${id}`, {
75
+ body: JSON.stringify(body),
76
+ headers: {
77
+ "Content-Type": "application/json",
78
+ },
79
+ keepalive: true,
80
+ method: "PATCH",
81
+ })
82
+ .then((res) => res.json())
83
+ .then((entity) => Ok(entity))
84
+ .catch((e) => {
85
+ if (e instanceof HttpError) {
86
+ if (e.body.detail?.includes("Cannot reuse the same script name")) {
87
+ return Err(duplicateScriptNameError(body["name"]));
88
+ }
89
+ return Err(e.body);
90
+ }
91
+ throw e;
92
+ });
93
+ };
94
+ //# sourceMappingURL=Script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Script.js","sourceRoot":"","sources":["../../../src/oss/scripts/Script.ts"],"names":[],"mappings":"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","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 { Err, Ok } from \"ts-results-es\";\nimport { Query } from \"../../common/Query.ts\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { HttpError } from \"../../common/HttpError.ts\";\nimport { duplicateScriptNameError } from \"./ScriptErrors.ts\";\n\nexport class Script {\n readonly createdAt: ScriptProperties[\"createdAt\"];\n readonly createdBy: ScriptProperties[\"createdBy\"];\n readonly id: ScriptProperties[\"id\"];\n readonly modifiedAt: ScriptProperties[\"modifiedAt\"];\n readonly modifiedBy: ScriptProperties[\"modifiedBy\"];\n readonly name: ScriptProperties[\"name\"];\n readonly query: ScriptProperties[\"query\"];\n #config: SonarV3Config;\n\n constructor(properties: ScriptProperties, config: SonarV3Config) {\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.id = properties.id;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.query = properties.query;\n this.#config = config;\n }\n\n async delete() {\n return this.#config\n .sonarV3Request(`scripts/${this.id}`, {\n keepalive: true,\n method: \"DELETE\",\n })\n .then(() => Ok(undefined))\n .catch((e: unknown) => Err(e));\n }\n\n async save(properties: ScriptPatchableProperties) {\n return saveScript(\n this.id,\n this.#config,\n )(properties).then((result) =>\n result.map((value) => new Script(scriptEntityToProperties(value), this.#config)),\n );\n }\n}\n\nexport const scriptEntityToProperties = (entity: ScriptEntity) => ({\n createdAt: Temporal.Instant.from(entity.createdAt),\n createdBy: entity.createdBy,\n id: entity.id,\n modifiedAt: Temporal.Instant.from(entity.modifiedAt),\n modifiedBy: entity.modifiedBy,\n name: entity.name,\n query: new Query(entity.content, entity.context),\n});\n\nexport type ScriptEntity = {\n content: string;\n context: string[];\n createdAt: string;\n createdBy: string;\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n name: string;\n};\n\nexport type ScriptPatchableProperties = {\n name?: ScriptProperties[\"name\"];\n query?: ScriptProperties[\"query\"];\n};\n\nexport type ScriptProperties = ReturnType<typeof scriptEntityToProperties>;\n\nexport const createScriptPatchedFields = (properties: ScriptPatchableProperties) => {\n const patchedFields = {} as {\n name?: string;\n content?: string;\n context?: string[];\n };\n if (properties.name) {\n patchedFields.name = properties.name;\n }\n if (properties.query) {\n patchedFields.content = properties.query.sql;\n patchedFields.context = properties.query.context;\n }\n return patchedFields;\n};\n\nexport const saveScript = (id: string, config: SonarV3Config) => (body: Record<string, any>) => {\n return config\n .sonarV3Request(`scripts/${id}`, {\n body: JSON.stringify(body),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"PATCH\",\n })\n .then((res) => res.json())\n .then((entity: ScriptEntity) => Ok(entity))\n .catch((e: unknown) => {\n if (e instanceof HttpError) {\n if (e.body.detail?.includes(\"Cannot reuse the same script name\")) {\n return Err(duplicateScriptNameError(body[\"name\"]));\n }\n return Err(e.body);\n }\n\n throw e;\n });\n};\n"]}
@@ -0,0 +1,19 @@
1
+ export declare const scriptNotFoundError: (id: string) => {
2
+ readonly meta: {
3
+ readonly provided: {
4
+ readonly id: string;
5
+ };
6
+ };
7
+ readonly title: "The script could not be found or you do not have permission to view it";
8
+ readonly type: "https://api.dremio.dev/problems/scripts/not-found";
9
+ };
10
+ export declare const duplicateScriptNameError: (name: string) => {
11
+ readonly errors: [{
12
+ readonly detail: "A script with this name already exists";
13
+ readonly pointer: "#/name";
14
+ readonly type: "https://api.dremio.dev/problems/validation/field-conflict";
15
+ readonly value: string;
16
+ }];
17
+ readonly title: "There was a problem validating the content of the request";
18
+ readonly type: "https://api.dremio.dev/problems/validation-problem";
19
+ };
@@ -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
+ export const scriptNotFoundError = (id) => ({
17
+ meta: {
18
+ provided: {
19
+ id,
20
+ },
21
+ },
22
+ title: "The script could not be found or you do not have permission to view it",
23
+ type: "https://api.dremio.dev/problems/scripts/not-found",
24
+ });
25
+ export const duplicateScriptNameError = (name) => ({
26
+ errors: [
27
+ {
28
+ detail: "A script with this name already exists",
29
+ pointer: "#/name",
30
+ type: "https://api.dremio.dev/problems/validation/field-conflict",
31
+ value: name,
32
+ },
33
+ ],
34
+ title: "There was a problem validating the content of the request",
35
+ type: "https://api.dremio.dev/problems/validation-problem",
36
+ });
37
+ //# sourceMappingURL=ScriptErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScriptErrors.js","sourceRoot":"","sources":["../../../src/oss/scripts/ScriptErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAU,EAAE,EAAE,CAChD,CAAC;IACC,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,EAAE;SACH;KACF;IACD,KAAK,EAAE,wEAAwE;IAC/E,IAAI,EAAE,mDAAmD;CAC1D,CAA4B,CAAC;AAEhC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAE,EAAE,CACvD,CAAC;IACC,MAAM,EAAE;QACN;YACE,MAAM,EAAE,wCAAwC;YAChD,OAAO,EAAE,QAAQ;YACjB,IAAI,EAAE,2DAA2D;YACjE,KAAK,EAAE,IAAI;SACZ;KACF;IACD,KAAK,EAAE,2DAA2D;IAClE,IAAI,EAAE,oDAAoD;CAC3D,CAAsC,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, ValidationProblem } from \"../../common/Problem.ts\";\n\nexport const scriptNotFoundError = (id: string) =>\n ({\n meta: {\n provided: {\n id,\n },\n },\n title: \"The script could not be found or you do not have permission to view it\",\n type: \"https://api.dremio.dev/problems/scripts/not-found\",\n }) as const satisfies Problem;\n\nexport const duplicateScriptNameError = (name: string) =>\n ({\n errors: [\n {\n detail: \"A script with this name already exists\",\n pointer: \"#/name\",\n type: \"https://api.dremio.dev/problems/validation/field-conflict\",\n value: name,\n },\n ],\n title: \"There was a problem validating the content of the request\",\n type: \"https://api.dremio.dev/problems/validation-problem\",\n }) as const satisfies ValidationProblem;\n"]}
@@ -0,0 +1,15 @@
1
+ import type { ResourceConfig, SonarV3Config } from "../../common/Config.ts";
2
+ import { Script } from "./Script.ts";
3
+ import { Ok, Err } from "ts-results-es";
4
+ import type { Query } from "../../common/Query.ts";
5
+ import type { SignalParam } from "../../common/Params.ts";
6
+ export declare const ScriptsResource: (config: ResourceConfig & SonarV3Config) => {
7
+ list(): {
8
+ data({ signal }?: SignalParam): AsyncGenerator<Script, void, unknown>;
9
+ };
10
+ retrieve: (id: string, { signal }?: SignalParam) => Promise<Err<unknown> | Ok<Script>>;
11
+ store: (properties: {
12
+ name: string;
13
+ query: Query;
14
+ }) => Promise<Err<unknown> | Ok<Script>>;
15
+ };
@@ -0,0 +1,72 @@
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 { Script, scriptEntityToProperties } from "./Script.js";
17
+ import { Ok, Err } from "ts-results-es";
18
+ import { HttpError } from "../../common/HttpError.js";
19
+ import { isProblem } from "../../common/Problem.js";
20
+ import { duplicateScriptNameError, scriptNotFoundError } from "./ScriptErrors.js";
21
+ export const ScriptsResource = (config) => {
22
+ const retrieve = (id, { signal } = {}) => config
23
+ .sonarV3Request(`scripts/${id}`, { signal })
24
+ .then((res) => res.json())
25
+ .then((entity) => Ok(new Script(scriptEntityToProperties(entity), config)))
26
+ .catch((e) => {
27
+ if (e instanceof HttpError && e.status === 404) {
28
+ return Err(scriptNotFoundError(id));
29
+ }
30
+ return Err(e);
31
+ });
32
+ const store = (properties) => {
33
+ const { query, ...rest } = properties;
34
+ return config
35
+ .sonarV3Request("scripts", {
36
+ body: JSON.stringify({
37
+ ...rest,
38
+ content: query.sql,
39
+ context: query.context,
40
+ }),
41
+ headers: {
42
+ "Content-Type": "application/json",
43
+ },
44
+ keepalive: true,
45
+ method: "POST",
46
+ })
47
+ .then((res) => res.json())
48
+ .then((entity) => Ok(new Script(scriptEntityToProperties(entity), config)))
49
+ .catch((e) => {
50
+ if (e instanceof HttpError && isProblem(e.body)) {
51
+ if (e.body.detail?.includes("Cannot reuse the same script name"))
52
+ return Err(duplicateScriptNameError(properties.name));
53
+ }
54
+ return Err(e);
55
+ });
56
+ };
57
+ return {
58
+ list() {
59
+ return {
60
+ async *data({ signal } = {}) {
61
+ yield* await config
62
+ .sonarV3Request("scripts?maxResults=1000", { signal })
63
+ .then((res) => res.json())
64
+ .then((response) => response.data.map((entity) => new Script(scriptEntityToProperties(entity), config)));
65
+ },
66
+ };
67
+ },
68
+ retrieve,
69
+ store,
70
+ };
71
+ };
72
+ //# sourceMappingURL=ScriptsResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScriptsResource.js","sourceRoot":"","sources":["../../../src/oss/scripts/ScriptsResource.ts"],"names":[],"mappings":"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","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 { Script, scriptEntityToProperties } from \"./Script.ts\";\nimport { Ok, Err } from \"ts-results-es\";\nimport { HttpError } from \"../../common/HttpError.ts\";\nimport { isProblem } from \"../../common/Problem.ts\";\nimport type { Query } from \"../../common/Query.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { duplicateScriptNameError, scriptNotFoundError } from \"./ScriptErrors.ts\";\n\nexport const ScriptsResource = (config: ResourceConfig & SonarV3Config) => {\n const retrieve = (id: string, { signal }: SignalParam = {}) =>\n config\n .sonarV3Request(`scripts/${id}`, { signal })\n .then((res) => res.json())\n .then((entity) => Ok(new Script(scriptEntityToProperties(entity), config)))\n .catch((e: unknown) => {\n if (e instanceof HttpError && e.status === 404) {\n return Err(scriptNotFoundError(id));\n }\n return Err(e);\n });\n\n const store = (properties: { name: string; query: Query }) => {\n const { query, ...rest } = properties;\n return config\n .sonarV3Request(\"scripts\", {\n body: JSON.stringify({\n ...rest,\n content: query.sql,\n context: query.context,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .then((res) => res.json())\n .then((entity) => Ok(new Script(scriptEntityToProperties(entity), config)))\n .catch((e: unknown) => {\n if (e instanceof HttpError && isProblem(e.body)) {\n if (e.body.detail?.includes(\"Cannot reuse the same script name\"))\n return Err(duplicateScriptNameError(properties.name));\n }\n return Err(e);\n });\n };\n\n return {\n list() {\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* await config\n .sonarV3Request(\"scripts?maxResults=1000\", { signal })\n .then((res) => res.json())\n .then(\n (response) =>\n response.data.map(\n (entity: any) => new Script(scriptEntityToProperties(entity), config),\n ) as Script[],\n );\n },\n };\n },\n retrieve,\n store,\n };\n};\n"]}
@@ -0,0 +1,30 @@
1
+ type UserEntity = {
2
+ active: boolean;
3
+ email: string;
4
+ firstName: string;
5
+ id: string;
6
+ lastName: string;
7
+ name: string;
8
+ tag: string;
9
+ };
10
+ export declare class User {
11
+ readonly email: UserProperties["email"];
12
+ readonly id: UserProperties["id"];
13
+ readonly familyName: UserProperties["familyName"];
14
+ readonly givenName: UserProperties["givenName"];
15
+ readonly status: UserProperties["status"];
16
+ readonly username: UserProperties["username"];
17
+ constructor(properties: UserProperties);
18
+ get displayName(): string;
19
+ get initials(): string;
20
+ }
21
+ export declare const userEntityToProperties: (entity: UserEntity) => {
22
+ email: string;
23
+ familyName: string | null;
24
+ givenName: string | null;
25
+ id: string;
26
+ status: "ACTIVE" | "INACTIVE";
27
+ username: string;
28
+ };
29
+ export type UserProperties = ReturnType<typeof userEntityToProperties>;
30
+ export {};
@@ -0,0 +1,60 @@
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 class User {
17
+ email;
18
+ id;
19
+ familyName;
20
+ givenName;
21
+ status;
22
+ username;
23
+ constructor(properties) {
24
+ this.email = properties.email;
25
+ this.id = properties.id;
26
+ this.familyName = properties.familyName;
27
+ this.givenName = properties.givenName;
28
+ this.status = properties.status;
29
+ this.username = properties.username;
30
+ }
31
+ get displayName() {
32
+ if (this.givenName || this.familyName) {
33
+ return [this.givenName, this.familyName].filter(Boolean).join(" ");
34
+ }
35
+ if (this.username) {
36
+ return this.username;
37
+ }
38
+ if (this.email) {
39
+ return this.email;
40
+ }
41
+ return this.id;
42
+ }
43
+ get initials() {
44
+ const givenNameTrimmed = this.givenName?.trim();
45
+ const familyNameTrimmed = this.familyName?.trim();
46
+ if (givenNameTrimmed && familyNameTrimmed) {
47
+ return givenNameTrimmed.charAt(0) + familyNameTrimmed.charAt(0);
48
+ }
49
+ return this.displayName.slice(0, 2);
50
+ }
51
+ }
52
+ export const userEntityToProperties = (entity) => ({
53
+ email: entity.email,
54
+ familyName: entity.lastName || null,
55
+ givenName: entity.firstName || null,
56
+ id: entity.id,
57
+ status: entity.active ? "ACTIVE" : "INACTIVE",
58
+ username: entity.name,
59
+ });
60
+ //# sourceMappingURL=User.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/oss/users/User.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,MAAM,OAAO,IAAI;IACN,KAAK,CAA0B;IAC/B,EAAE,CAAuB;IACzB,UAAU,CAA+B;IACzC,SAAS,CAA8B;IACvC,MAAM,CAA2B;IACjC,QAAQ,CAA6B;IAE9C,YAAY,UAA0B;QACpC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,IAAI,WAAW;QACb,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrE,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,IAAI,QAAQ;QACV,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;QAChD,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;QAElD,IAAI,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;YAC1C,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAClE,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAkB,EAAE,EAAE,CAAC,CAAC;IAC7D,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,UAAU,EAAE,MAAM,CAAC,QAAQ,IAAI,IAAI;IACnC,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;IACnC,EAAE,EAAE,MAAM,CAAC,EAAE;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAE,QAAkB,CAAC,CAAC,CAAE,UAAoB;IACnE,QAAQ,EAAE,MAAM,CAAC,IAAI;CACtB,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\ntype UserEntity = {\n active: boolean;\n email: string;\n firstName: string;\n id: string;\n lastName: string;\n name: string;\n tag: string;\n};\n\nexport class User {\n readonly email: UserProperties[\"email\"];\n readonly id: UserProperties[\"id\"];\n readonly familyName: UserProperties[\"familyName\"];\n readonly givenName: UserProperties[\"givenName\"];\n readonly status: UserProperties[\"status\"];\n readonly username: UserProperties[\"username\"];\n\n constructor(properties: UserProperties) {\n this.email = properties.email;\n this.id = properties.id;\n this.familyName = properties.familyName;\n this.givenName = properties.givenName;\n this.status = properties.status;\n this.username = properties.username;\n }\n\n get displayName(): string {\n if (this.givenName || this.familyName) {\n return [this.givenName, this.familyName].filter(Boolean).join(\" \");\n }\n\n if (this.username) {\n return this.username;\n }\n\n if (this.email) {\n return this.email;\n }\n\n return this.id;\n }\n\n get initials(): string {\n const givenNameTrimmed = this.givenName?.trim();\n const familyNameTrimmed = this.familyName?.trim();\n\n if (givenNameTrimmed && familyNameTrimmed) {\n return givenNameTrimmed.charAt(0) + familyNameTrimmed.charAt(0);\n }\n\n return this.displayName.slice(0, 2);\n }\n}\n\nexport const userEntityToProperties = (entity: UserEntity) => ({\n email: entity.email,\n familyName: entity.lastName || null,\n givenName: entity.firstName || null,\n id: entity.id,\n status: entity.active ? (\"ACTIVE\" as const) : (\"INACTIVE\" as const),\n username: entity.name,\n});\n\nexport type UserProperties = ReturnType<typeof userEntityToProperties>;\n"]}
@@ -0,0 +1,11 @@
1
+ import { Err, Ok } from "ts-results-es";
2
+ import { User } from "./User.ts";
3
+ import type { SonarV3Config } from "../../common/Config.ts";
4
+ export declare const UsersResource: (config: SonarV3Config) => {
5
+ retrieveById: (id: string, { signal }?: {
6
+ signal?: AbortSignal;
7
+ }) => Promise<Err<unknown> | Ok<User>>;
8
+ retrieveByName: (name: string, { signal }?: {
9
+ signal?: AbortSignal;
10
+ }) => Promise<Err<unknown> | Ok<User>>;
11
+ };
@@ -0,0 +1,32 @@
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 { Err, Ok } from "ts-results-es";
17
+ import { User, userEntityToProperties } from "./User.js";
18
+ export const UsersResource = (config) => {
19
+ return {
20
+ retrieveById: (id, { signal } = {}) => config
21
+ .sonarV3Request(`user/${id}`, { signal })
22
+ .then((res) => res.json())
23
+ .then((entity) => Ok(new User(userEntityToProperties(entity))))
24
+ .catch((e) => Err(e)),
25
+ retrieveByName: (name, { signal } = {}) => config
26
+ .sonarV3Request(`user/by-name/${name}`, { signal })
27
+ .then((res) => res.json())
28
+ .then((entity) => Ok(new User(userEntityToProperties(entity))))
29
+ .catch((e) => Err(e)),
30
+ };
31
+ };
32
+ //# sourceMappingURL=UsersResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsersResource.js","sourceRoot":"","sources":["../../../src/oss/users/UsersResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAGzD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAE,EAAE;IACrD,OAAO;QACL,YAAY,EAAE,CAAC,EAAU,EAAE,EAAE,MAAM,KAA+B,EAAE,EAAE,EAAE,CACtE,MAAM;aACH,cAAc,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;aACxC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACzB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aAC9D,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAClC,cAAc,EAAE,CAAC,IAAY,EAAE,EAAE,MAAM,KAA+B,EAAE,EAAE,EAAE,CAC1E,MAAM;aACH,cAAc,CAAC,gBAAgB,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;aAClD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACzB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aAC9D,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACnC,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 { Err, Ok } from \"ts-results-es\";\nimport { User, userEntityToProperties } from \"./User.ts\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\n\nexport const UsersResource = (config: SonarV3Config) => {\n return {\n retrieveById: (id: string, { signal }: { signal?: AbortSignal } = {}) =>\n config\n .sonarV3Request(`user/${id}`, { signal })\n .then((res) => res.json())\n .then((entity) => Ok(new User(userEntityToProperties(entity))))\n .catch((e: unknown) => Err(e)),\n retrieveByName: (name: string, { signal }: { signal?: AbortSignal } = {}) =>\n config\n .sonarV3Request(`user/by-name/${name}`, { signal })\n .then((res) => res.json())\n .then((entity) => Ok(new User(userEntityToProperties(entity))))\n .catch((e: unknown) => Err(e)),\n };\n};\n"]}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@dremio/js-sdk",
3
+ "version": "0.1.0",
4
+ "description": "JavaScript library for the Dremio API",
5
+ "keywords": [
6
+ "dremio",
7
+ "sdk"
8
+ ],
9
+ "license": "Apache-2.0",
10
+ "author": {
11
+ "name": "Dremio",
12
+ "url": "https://dremio.com"
13
+ },
14
+ "homepage": "https://docs.dremio.com",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "type": "module",
19
+ "exports": {
20
+ "./cloud": "./dist/cloud/index.js",
21
+ "./community": "./dist/oss/index.js",
22
+ "./enterprise": "./dist/enterprise/index.js",
23
+ "./oss": "./dist/oss/index.js"
24
+ },
25
+ "scripts": {
26
+ "check-licenses": "jsgl --local .",
27
+ "dist": "tsc",
28
+ "docs": "typedoc src/oss/index.ts --hideGenerator --out ./docs/oss && typedoc src/enterprise/index.ts --hideGenerator --out ./docs/enterprise && typedoc src/cloud/index.ts --hideGenerator --out ./docs/cloud",
29
+ "lint": "eslint src",
30
+ "lint:fix": "eslint src --fix",
31
+ "lint:prettier": "prettier src --check",
32
+ "prepare": "node --run dist"
33
+ },
34
+ "dependencies": {
35
+ "deep-equal": "^2",
36
+ "moize": "^6",
37
+ "parse-ms": "^4",
38
+ "rxjs": "^7",
39
+ "ts-results-es": "^5.0.1"
40
+ },
41
+ "devDependencies": {
42
+ "@eslint/compat": "1.2.8",
43
+ "@eslint/js": "9.24.0",
44
+ "@types/deep-equal": "1.0.4",
45
+ "eslint": "9.24.0",
46
+ "eslint-config-prettier": "10.1.1",
47
+ "eslint-plugin-license-header": "0.8.0",
48
+ "eslint-plugin-perfectionist": "4.11.0",
49
+ "eslint-plugin-regexp": "2.7.0",
50
+ "js-green-licenses": "4.0.0",
51
+ "prettier": "3.5.3",
52
+ "semantic-release": "24.2.3",
53
+ "typedoc": "0.28.1",
54
+ "typescript": "5.8.3",
55
+ "typescript-eslint": "8.29.0"
56
+ },
57
+ "peerDependencies": {
58
+ "apache-arrow": ">=17",
59
+ "temporal-polyfill": ">=0.3.0"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "apache-arrow": {
63
+ "optional": true
64
+ },
65
+ "temporal-polyfill": {
66
+ "optional": true
67
+ }
68
+ },
69
+ "packageManager": "pnpm@10.7.1"
70
+ }