@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,49 @@
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
+ export class OAuthApplication {
18
+ id;
19
+ name;
20
+ state;
21
+ #config;
22
+ constructor(properties, config) {
23
+ this.id = properties.id;
24
+ this.name = properties.name;
25
+ this.state = properties.state;
26
+ this.#config = config;
27
+ }
28
+ delete() {
29
+ return this.#config
30
+ .request(new URL(`/ui/oauth-applications/${this.id}`, this.#config.origin.replace("api", "app")).toString(), {
31
+ keepalive: true,
32
+ method: "DELETE",
33
+ })
34
+ .then(() => Ok(undefined))
35
+ .catch((e) => Err(e));
36
+ }
37
+ }
38
+ export class OAuthApplicationDetails extends OAuthApplication {
39
+ clientId;
40
+ redirectUris;
41
+ type;
42
+ constructor(properties, config) {
43
+ super(properties, config);
44
+ this.clientId = properties.clientId;
45
+ this.redirectUris = properties.redirectUris;
46
+ this.type = properties.type;
47
+ }
48
+ }
49
+ //# sourceMappingURL=OAuthApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OAuthApplication.js","sourceRoot":"","sources":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5C,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;IAC9B,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 { Err, Ok } from \"ts-results-es\";\nimport type { ResourceConfig } from \"../../common/Config.ts\";\n\nexport class OAuthApplication {\n readonly id: OAuthApplicationProperties[\"id\"];\n readonly name: OAuthApplicationProperties[\"name\"];\n readonly state: OAuthApplicationProperties[\"state\"];\n readonly #config: ResourceConfig;\n\n constructor(properties: OAuthApplicationProperties, config: ResourceConfig) {\n this.id = properties.id;\n this.name = properties.name;\n this.state = properties.state;\n this.#config = config;\n }\n\n delete() {\n return this.#config\n .request(\n new URL(\n `/ui/oauth-applications/${this.id}`,\n this.#config.origin.replace(\"api\", \"app\"),\n ).toString(),\n {\n keepalive: true,\n method: \"DELETE\",\n },\n )\n .then(() => Ok(undefined))\n .catch((e: unknown) => Err(e));\n }\n}\n\nexport type OAuthApplicationProperties = {\n id: string;\n name: string;\n state: \"ENABLED\" | \"DISABLED\";\n};\n\nexport class OAuthApplicationDetails extends OAuthApplication {\n readonly clientId: OAuthApplicationDetailsProperties[\"clientId\"];\n readonly redirectUris: OAuthApplicationDetailsProperties[\"redirectUris\"];\n readonly type: OAuthApplicationDetailsProperties[\"type\"];\n\n constructor(properties: OAuthApplicationDetailsProperties, config: ResourceConfig) {\n super(properties, config);\n this.clientId = properties.clientId;\n this.redirectUris = properties.redirectUris;\n this.type = properties.type;\n }\n}\n\nexport type OAuthApplicationDetailsProperties = OAuthApplicationProperties & {\n clientId: string;\n redirectUris: Set<string>;\n type: \"NATIVE\" | \"REGULAR_WEB\" | \"SPA\";\n};\n"]}
@@ -0,0 +1,15 @@
1
+ import { Err, Ok } from "ts-results-es";
2
+ import type { ResourceConfig } from "../../common/Config.ts";
3
+ import type { SignalParam } from "../../common/Params.ts";
4
+ import { OAuthApplication, OAuthApplicationDetails } from "./OAuthApplication.ts";
5
+ export declare const OAuthApplicationsResource: (config: ResourceConfig) => {
6
+ create: (params: {
7
+ name: OAuthApplicationDetails["name"];
8
+ redirectUris: OAuthApplicationDetails["redirectUris"];
9
+ type: OAuthApplicationDetails["type"];
10
+ }) => Promise<Err<unknown> | Ok<string>>;
11
+ list: () => {
12
+ data({ signal }?: SignalParam): AsyncGenerator<OAuthApplication, void, unknown>;
13
+ };
14
+ retrieve: (id: string, { signal }?: SignalParam) => Promise<Err<unknown> | Ok<OAuthApplicationDetails>>;
15
+ };
@@ -0,0 +1,66 @@
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 { OAuthApplication, OAuthApplicationDetails, } from "./OAuthApplication.js";
18
+ export const OAuthApplicationsResource = (config) => {
19
+ return {
20
+ create: (params) => config
21
+ .request(new URL("/ui/oauth-applications", config.origin.replace("api", "app")).toString(), {
22
+ body: JSON.stringify({
23
+ ...params,
24
+ redirectUris: Array.from(params.redirectUris),
25
+ }),
26
+ headers: {
27
+ Accept: "application/json",
28
+ "Content-Type": "application/json",
29
+ },
30
+ keepalive: true,
31
+ method: "POST",
32
+ })
33
+ .then((res) => res.json())
34
+ .then((result) => Ok(result.id))
35
+ .catch((e) => Err(e)),
36
+ list: () => {
37
+ return {
38
+ async *data({ signal } = {}) {
39
+ yield* await config
40
+ .request(new URL("/ui/oauth-applications", config.origin.replace("api", "app")).toString(), {
41
+ headers: {
42
+ Accept: "application/json",
43
+ },
44
+ signal,
45
+ })
46
+ .then((res) => res.json())
47
+ .then((oauthApplications) => oauthApplications.map((properties) => new OAuthApplication(properties, config)));
48
+ },
49
+ };
50
+ },
51
+ retrieve: (id, { signal } = {}) => config
52
+ .request(new URL(`/ui/oauth-applications/${id}`, config.origin.replace("api", "app")).toString(), {
53
+ headers: {
54
+ Accept: "application/json",
55
+ },
56
+ signal,
57
+ })
58
+ .then((res) => res.json())
59
+ .then((entity) => Ok(new OAuthApplicationDetails({
60
+ ...entity,
61
+ redirectUris: new Set(entity.redirectUris),
62
+ }, config)))
63
+ .catch((e) => Err(e)),
64
+ };
65
+ };
66
+ //# sourceMappingURL=OAuthApplicationsResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OAuthApplicationsResource.js","sourceRoot":"","sources":["../../../src/cloud/oauth/OAuthApplicationsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GAExB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAsB,EAAE,EAAE;IAClE,OAAO;QACL,MAAM,EAAE,CAAC,MAIR,EAAE,EAAE,CACH,MAAM;aACH,OAAO,CACN,IAAI,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,EACjF;YACE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,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AC,0BAA0B,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,EACvF;YACE,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;YACD,MAAM;SACP,CACF;aACA,IAAI,CACH,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,IAAI,EAMP,CACJ;aACA,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CACf,EAAE,CACA,IAAI,uBAAuB,CACzB;YACE,GAAG,MAAM;YACT,YAAY,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC;SAC3C,EACD,MAAM,CACP,CACF,CACF;aACA,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 type { ResourceConfig } from \"../../common/Config.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport {\n OAuthApplication,\n OAuthApplicationDetails,\n type OAuthApplicationProperties,\n} from \"./OAuthApplication.ts\";\n\nexport const OAuthApplicationsResource = (config: ResourceConfig) => {\n return {\n create: (params: {\n name: OAuthApplicationDetails[\"name\"];\n redirectUris: OAuthApplicationDetails[\"redirectUris\"];\n type: OAuthApplicationDetails[\"type\"];\n }) =>\n config\n .request(\n new URL(\"/ui/oauth-applications\", config.origin.replace(\"api\", \"app\")).toString(),\n {\n body: JSON.stringify({\n ...params,\n redirectUris: Array.from(params.redirectUris),\n }),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n },\n )\n .then((res) => res.json() as Promise<{ id: string }>)\n .then((result) => Ok(result.id))\n .catch((e: unknown) => Err(e)),\n list: () => {\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* await config\n .request(\n new URL(\"/ui/oauth-applications\", config.origin.replace(\"api\", \"app\")).toString(),\n {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n },\n )\n .then((res) => res.json() as Promise<OAuthApplicationProperties[]>)\n .then((oauthApplications) =>\n oauthApplications.map((properties) => new OAuthApplication(properties, config)),\n );\n },\n };\n },\n retrieve: (id: string, { signal }: SignalParam = {}) =>\n config\n .request(\n new URL(`/ui/oauth-applications/${id}`, config.origin.replace(\"api\", \"app\")).toString(),\n {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n },\n )\n .then(\n (res) =>\n res.json() as Promise<\n OAuthApplicationProperties & {\n clientId: string;\n redirectUris: string[];\n type: OAuthApplicationDetails[\"type\"];\n }\n >,\n )\n .then((entity) =>\n Ok(\n new OAuthApplicationDetails(\n {\n ...entity,\n redirectUris: new Set(entity.redirectUris),\n },\n config,\n ),\n ),\n )\n .catch((e: unknown) => Err(e)),\n };\n};\n"]}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Creates a `URL` that can be used to start an OAuth Authorization Code flow
3
+ * and an exchangeCode function to exchange the code for a token
4
+ */
5
+ export declare const createAuthorizationCodeUrl: (params: {
6
+ client_id: string;
7
+ endpoint: string;
8
+ redirect_uri: string;
9
+ scope: Set<string>;
10
+ }, { code_challenge, state }: {
11
+ code_challenge: string;
12
+ state: string;
13
+ }) => {
14
+ /**
15
+ * Creates a `Request` to exchange an authorization code for an
16
+ * `access_token` (and optionally, a `refresh_token` if the `offline_access` scope
17
+ * is requested)
18
+ */
19
+ readonly createExchangeRequest: ({ code, code_verifier, state, }: {
20
+ code: string;
21
+ code_verifier: string;
22
+ state: string;
23
+ }) => Request;
24
+ readonly url: URL;
25
+ };
26
+ export type AuthorizationCodeExchangeResponse = {
27
+ access_token: string;
28
+ dremio_user_identifier: string;
29
+ expires_in: number;
30
+ refresh_token?: string;
31
+ token_type: string;
32
+ };
@@ -0,0 +1,57 @@
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
+ /**
17
+ * Creates a `URL` that can be used to start an OAuth Authorization Code flow
18
+ * and an exchangeCode function to exchange the code for a token
19
+ */
20
+ export const createAuthorizationCodeUrl = (params, { code_challenge, state }) => {
21
+ const endpoint = params.endpoint.replace("api.", "login.").replace("app.", "login.");
22
+ const url = new URL("/oauth/authorize", endpoint);
23
+ const searchParams = new URLSearchParams({
24
+ client_id: params.client_id,
25
+ code_challenge,
26
+ code_challenge_method: "S256",
27
+ redirect_uri: params.redirect_uri,
28
+ response_type: "code",
29
+ scope: Array.from(params.scope).join(" "),
30
+ state,
31
+ });
32
+ url.search = searchParams.toString();
33
+ return {
34
+ /**
35
+ * Creates a `Request` to exchange an authorization code for an
36
+ * `access_token` (and optionally, a `refresh_token` if the `offline_access` scope
37
+ * is requested)
38
+ */
39
+ createExchangeRequest: ({ code, code_verifier, state, }) => new Request(new URL("/oauth/token", endpoint), {
40
+ body: new URLSearchParams({
41
+ client_id: params.client_id,
42
+ code,
43
+ code_verifier,
44
+ grant_type: "authorization_code",
45
+ redirect_uri: params.redirect_uri,
46
+ state,
47
+ }),
48
+ headers: {
49
+ Accept: "application/json",
50
+ "Content-Type": "application/x-www-form-urlencoded",
51
+ },
52
+ method: "POST",
53
+ }),
54
+ url,
55
+ };
56
+ };
57
+ //# sourceMappingURL=oauth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/cloud/oauth/oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,MAAyF,EACzF,EAAE,cAAc,EAAE,KAAK,EAA6C,EACpE,EAAE;IACF,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IAElD,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC;QACvC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,cAAc;QACd,qBAAqB,EAAE,MAAM;QAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,aAAa,EAAE,MAAM;QACrB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACzC,KAAK;KACN,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IAErC,OAAO;QACL;;;;WAIG;QACH,qBAAqB,EAAE,CAAC,EACtB,IAAI,EACJ,aAAa,EACb,KAAK,GAKN,EAAE,EAAE,CACH,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE;YAC7C,IAAI,EAAE,IAAI,eAAe,CAAC;gBACxB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,IAAI;gBACJ,aAAa;gBACb,UAAU,EAAE,oBAAoB;gBAChC,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,KAAK;aACN,CAAC;YACF,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,mCAAmC;aACpD;YACD,MAAM,EAAE,MAAM;SACf,CAAC;QACJ,GAAG;KACK,CAAC;AACb,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\n/**\n * Creates a `URL` that can be used to start an OAuth Authorization Code flow\n * and an exchangeCode function to exchange the code for a token\n */\nexport const createAuthorizationCodeUrl = (\n params: { client_id: string; endpoint: string; redirect_uri: string; scope: Set<string> },\n { code_challenge, state }: { code_challenge: string; state: string },\n) => {\n const endpoint = params.endpoint.replace(\"api.\", \"login.\").replace(\"app.\", \"login.\");\n const url = new URL(\"/oauth/authorize\", endpoint);\n\n const searchParams = new URLSearchParams({\n client_id: params.client_id,\n code_challenge,\n code_challenge_method: \"S256\",\n redirect_uri: params.redirect_uri,\n response_type: \"code\",\n scope: Array.from(params.scope).join(\" \"),\n state,\n });\n\n url.search = searchParams.toString();\n\n return {\n /**\n * Creates a `Request` to exchange an authorization code for an\n * `access_token` (and optionally, a `refresh_token` if the `offline_access` scope\n * is requested)\n */\n createExchangeRequest: ({\n code,\n code_verifier,\n state,\n }: {\n code: string;\n code_verifier: string;\n state: string;\n }) =>\n new Request(new URL(\"/oauth/token\", endpoint), {\n body: new URLSearchParams({\n client_id: params.client_id,\n code,\n code_verifier,\n grant_type: \"authorization_code\",\n redirect_uri: params.redirect_uri,\n state,\n }),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n method: \"POST\",\n }),\n url,\n } as const;\n};\n\nexport type AuthorizationCodeExchangeResponse = {\n access_token: string;\n dremio_user_identifier: string;\n expires_in: number;\n refresh_token?: string;\n token_type: string;\n};\n"]}
@@ -0,0 +1,49 @@
1
+ import type { Result } from "ts-results-es";
2
+ import type { createProjectApiMethods } from "./projectApiMethods.ts";
3
+ export declare class Project implements ProjectInterface {
4
+ #private;
5
+ readonly cloudId: ProjectInterface["cloudId"];
6
+ readonly cloudType: ProjectInterface["cloudType"];
7
+ readonly createdAt: ProjectInterface["createdAt"];
8
+ readonly createdBy: ProjectInterface["createdBy"];
9
+ readonly credentials: ProjectInterface["credentials"];
10
+ readonly id: ProjectInterface["id"];
11
+ readonly lastStateError: ProjectInterface["lastStateError"];
12
+ readonly modifiedAt: ProjectInterface["modifiedAt"];
13
+ readonly modifiedBy: ProjectInterface["modifiedBy"];
14
+ readonly name: ProjectInterface["name"];
15
+ readonly numberOfEngines: ProjectInterface["numberOfEngines"];
16
+ readonly primaryCatalog: ProjectInterface["primaryCatalog"];
17
+ readonly projectStore: ProjectInterface["projectStore"];
18
+ readonly state: ProjectInterface["state"];
19
+ readonly type: ProjectInterface["type"];
20
+ constructor(properties: ProjectProperties, apiMethods: ReturnType<typeof createProjectApiMethods>);
21
+ activate(): Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<undefined>>;
22
+ delete(): Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<undefined>>;
23
+ get settled(): boolean;
24
+ }
25
+ export type ProjectProperties = {
26
+ readonly cloudId: string;
27
+ readonly cloudType: "AWS" | "AZURE" | "UNKNOWN";
28
+ readonly createdAt: Date;
29
+ readonly createdBy: string;
30
+ readonly credentials: Record<string, any>;
31
+ readonly id: string;
32
+ readonly lastStateError: {
33
+ error: string;
34
+ timestamp: Date;
35
+ } | null;
36
+ readonly modifiedAt: Date;
37
+ readonly modifiedBy: string;
38
+ readonly name: string;
39
+ readonly numberOfEngines: number;
40
+ readonly primaryCatalog: string;
41
+ readonly projectStore: string;
42
+ readonly state: "ACTIVATING" | "ACTIVE" | "ARCHIVED" | "ARCHIVING" | "CREATING" | "DEACTIVATING" | "INACTIVE" | "RESTORING";
43
+ readonly type: "QUERY_ENGINE";
44
+ };
45
+ export type ProjectMethods = {
46
+ delete(): Promise<Result<undefined, unknown>>;
47
+ get settled(): boolean;
48
+ };
49
+ export type ProjectInterface = ProjectProperties & ProjectMethods;
@@ -0,0 +1,61 @@
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 Project {
17
+ cloudId;
18
+ cloudType;
19
+ createdAt;
20
+ createdBy;
21
+ credentials;
22
+ id;
23
+ lastStateError;
24
+ modifiedAt;
25
+ modifiedBy;
26
+ name;
27
+ numberOfEngines;
28
+ primaryCatalog;
29
+ projectStore;
30
+ state;
31
+ type;
32
+ #apiMethods;
33
+ constructor(properties, apiMethods) {
34
+ this.cloudId = properties.cloudId;
35
+ this.cloudType = properties.cloudType;
36
+ this.createdAt = properties.createdAt;
37
+ this.createdBy = properties.createdBy;
38
+ this.credentials = properties.credentials;
39
+ this.id = properties.id;
40
+ this.lastStateError = properties.lastStateError;
41
+ this.modifiedAt = properties.modifiedAt;
42
+ this.modifiedBy = properties.modifiedBy;
43
+ this.name = properties.name;
44
+ this.numberOfEngines = properties.numberOfEngines;
45
+ this.primaryCatalog = properties.primaryCatalog;
46
+ this.projectStore = properties.projectStore;
47
+ this.state = properties.state;
48
+ this.type = properties.type;
49
+ this.#apiMethods = apiMethods;
50
+ }
51
+ activate() {
52
+ return this.#apiMethods.activate(this.id);
53
+ }
54
+ delete() {
55
+ return this.#apiMethods.delete(this.id);
56
+ }
57
+ get settled() {
58
+ return this.state === "ACTIVE" || this.state === "ARCHIVED" || this.state === "INACTIVE";
59
+ }
60
+ }
61
+ //# sourceMappingURL=Project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Project.js","sourceRoot":"","sources":["../../../src/cloud/projects/Project.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,OAAO,OAAO;IACT,OAAO,CAA8B;IACrC,SAAS,CAAgC;IACzC,SAAS,CAAgC;IACzC,SAAS,CAAgC;IACzC,WAAW,CAAkC;IAC7C,EAAE,CAAyB;IAC3B,cAAc,CAAqC;IACnD,UAAU,CAAiC;IAC3C,UAAU,CAAiC;IAC3C,IAAI,CAA2B;IAC/B,eAAe,CAAsC;IACrD,cAAc,CAAqC;IACnD,YAAY,CAAmC;IAC/C,KAAK,CAA4B;IACjC,IAAI,CAA2B;IAExC,WAAW,CAA6C;IAExD,YACE,UAA6B,EAC7B,UAAsD;QAEtD,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;QAClD,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC;IAC3F,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 { Result } from \"ts-results-es\";\nimport type { createProjectApiMethods } from \"./projectApiMethods.ts\";\n\nexport class Project implements ProjectInterface {\n readonly cloudId: ProjectInterface[\"cloudId\"];\n readonly cloudType: ProjectInterface[\"cloudType\"];\n readonly createdAt: ProjectInterface[\"createdAt\"];\n readonly createdBy: ProjectInterface[\"createdBy\"];\n readonly credentials: ProjectInterface[\"credentials\"];\n readonly id: ProjectInterface[\"id\"];\n readonly lastStateError: ProjectInterface[\"lastStateError\"];\n readonly modifiedAt: ProjectInterface[\"modifiedAt\"];\n readonly modifiedBy: ProjectInterface[\"modifiedBy\"];\n readonly name: ProjectInterface[\"name\"];\n readonly numberOfEngines: ProjectInterface[\"numberOfEngines\"];\n readonly primaryCatalog: ProjectInterface[\"primaryCatalog\"];\n readonly projectStore: ProjectInterface[\"projectStore\"];\n readonly state: ProjectInterface[\"state\"];\n readonly type: ProjectInterface[\"type\"];\n\n #apiMethods: ReturnType<typeof createProjectApiMethods>;\n\n constructor(\n properties: ProjectProperties,\n apiMethods: ReturnType<typeof createProjectApiMethods>,\n ) {\n this.cloudId = properties.cloudId;\n this.cloudType = properties.cloudType;\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.credentials = properties.credentials;\n this.id = properties.id;\n this.lastStateError = properties.lastStateError;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.numberOfEngines = properties.numberOfEngines;\n this.primaryCatalog = properties.primaryCatalog;\n this.projectStore = properties.projectStore;\n this.state = properties.state;\n this.type = properties.type;\n this.#apiMethods = apiMethods;\n }\n\n activate() {\n return this.#apiMethods.activate(this.id);\n }\n\n delete() {\n return this.#apiMethods.delete(this.id);\n }\n\n get settled() {\n return this.state === \"ACTIVE\" || this.state === \"ARCHIVED\" || this.state === \"INACTIVE\";\n }\n}\n\nexport type ProjectProperties = {\n readonly cloudId: string;\n readonly cloudType: \"AWS\" | \"AZURE\" | \"UNKNOWN\";\n readonly createdAt: Date;\n readonly createdBy: string;\n readonly credentials: Record<string, any>;\n readonly id: string;\n readonly lastStateError: {\n error: string;\n timestamp: Date;\n } | null;\n readonly modifiedAt: Date;\n readonly modifiedBy: string;\n readonly name: string;\n readonly numberOfEngines: number;\n readonly primaryCatalog: string;\n readonly projectStore: string;\n readonly state:\n | \"ACTIVATING\"\n | \"ACTIVE\"\n | \"ARCHIVED\"\n | \"ARCHIVING\"\n | \"CREATING\"\n | \"DEACTIVATING\"\n | \"INACTIVE\"\n | \"RESTORING\";\n readonly type: \"QUERY_ENGINE\";\n};\n\nexport type ProjectMethods = {\n delete(): Promise<Result<undefined, unknown>>;\n get settled(): boolean;\n};\n\nexport type ProjectInterface = ProjectProperties & ProjectMethods;\n"]}
@@ -0,0 +1,17 @@
1
+ import type { ResourceConfig, V3Config } from "../../common/Config.ts";
2
+ import { Project } from "./Project.ts";
3
+ import type { SignalParam } from "../../common/Params.ts";
4
+ export declare const ProjectsResource: (config: ResourceConfig & V3Config) => {
5
+ /**
6
+ * @hidden
7
+ * @internal
8
+ */
9
+ _createFromEntity: (properties: unknown) => Project;
10
+ activate: (id: string) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<undefined>>;
11
+ delete: (id: string) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<undefined>>;
12
+ list: () => {
13
+ data({ signal }?: SignalParam): AsyncGenerator<Project, void, unknown>;
14
+ };
15
+ observe: (id: string) => import("rxjs").Observable<Project>;
16
+ retrieve: (id: string, { signal }?: SignalParam) => Promise<import("ts-results-es").Result<Project, unknown>>;
17
+ };
@@ -0,0 +1,50 @@
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 { Project } from "./Project.js";
17
+ import { projectEntityToProperties } from "./utils.js";
18
+ import { fromAbortable } from "../../common/fromAbortable.js";
19
+ import { share, switchMap, timer } from "rxjs";
20
+ import { createProjectApiMethods } from "./projectApiMethods.js";
21
+ export const ProjectsResource = (config) => {
22
+ const projectApiMethods = createProjectApiMethods(config);
23
+ return {
24
+ /**
25
+ * @hidden
26
+ * @internal
27
+ */
28
+ _createFromEntity: (properties) => new Project(projectEntityToProperties(properties), projectApiMethods),
29
+ activate: projectApiMethods.activate,
30
+ delete: projectApiMethods.delete,
31
+ list: () => {
32
+ return {
33
+ async *data({ signal } = {}) {
34
+ yield* await config
35
+ .v3Request("projects", { signal })
36
+ .then((res) => res.json())
37
+ .then((projects) => projects.map((properties) => new Project(projectEntityToProperties(properties), projectApiMethods)));
38
+ },
39
+ };
40
+ },
41
+ observe: (id) => timer(0, 5000).pipe(switchMap(() => fromAbortable(({ signal }) => projectApiMethods.retrieve(id, { signal }).then((result) => {
42
+ if (result.isErr()) {
43
+ throw result.error;
44
+ }
45
+ return result.value;
46
+ }))), share()),
47
+ retrieve: projectApiMethods.retrieve,
48
+ };
49
+ };
50
+ //# sourceMappingURL=ProjectsResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectsResource.js","sourceRoot":"","sources":["../../../src/cloud/projects/ProjectsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAiC,EAAE,EAAE;IACpE,MAAM,iBAAiB,GAAG,uBAA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AAE,iBAAiB,CAAC,QAAQ;KACrC,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 type { ResourceConfig, V3Config } from \"../../common/Config.ts\";\nimport { Project } from \"./Project.ts\";\nimport { projectEntityToProperties } from \"./utils.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { fromAbortable } from \"../../common/fromAbortable.ts\";\nimport { share, switchMap, timer } from \"rxjs\";\nimport { createProjectApiMethods } from \"./projectApiMethods.ts\";\n\nexport const ProjectsResource = (config: ResourceConfig & V3Config) => {\n const projectApiMethods = createProjectApiMethods(config);\n return {\n /**\n * @hidden\n * @internal\n */\n _createFromEntity: (properties: unknown) =>\n new Project(projectEntityToProperties(properties), projectApiMethods),\n activate: projectApiMethods.activate,\n delete: projectApiMethods.delete,\n list: () => {\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* await config\n .v3Request(\"projects\", { signal })\n .then((res) => res.json())\n .then(\n (projects) =>\n projects.map(\n (properties: unknown) =>\n new Project(projectEntityToProperties(properties), projectApiMethods),\n ) as Project[],\n );\n },\n };\n },\n observe: (id: string) =>\n timer(0, 5000).pipe(\n switchMap(() =>\n fromAbortable(({ signal }) =>\n projectApiMethods.retrieve(id, { signal }).then((result) => {\n if (result.isErr()) {\n throw result.error;\n }\n return result.value;\n }),\n ),\n ),\n share(),\n ),\n retrieve: projectApiMethods.retrieve,\n };\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Err, Ok, Result } from "ts-results-es";
2
+ import type { ResourceConfig, V3Config } from "../../common/Config.ts";
3
+ import type { SignalParam } from "../../common/Params.ts";
4
+ import { Project } from "./Project.js";
5
+ export declare const createProjectApiMethods: (config: ResourceConfig & V3Config) => {
6
+ activate: (id: string) => Promise<Err<unknown> | Ok<undefined>>;
7
+ delete: (id: string) => Promise<Err<unknown> | Ok<undefined>>;
8
+ retrieve: (id: string, { signal }?: SignalParam) => Promise<Result<Project, unknown>>;
9
+ };
@@ -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 { Err, Ok, Result } from "ts-results-es";
17
+ import { Project } from "./Project.js";
18
+ import { projectEntityToProperties } from "./utils.js";
19
+ export const createProjectApiMethods = (config) => {
20
+ const activate = (id) => config
21
+ .v3Request(`projects/${id}/activate`, {
22
+ keepalive: true,
23
+ method: "PUT",
24
+ })
25
+ .then(() => Ok(undefined))
26
+ .catch((e) => Err(e));
27
+ const deleteProject = (id) => config
28
+ .v3Request(`projects/${id}`, { keepalive: true, method: "DELETE" })
29
+ .then(() => Ok(undefined))
30
+ .catch((e) => Err(e));
31
+ const retrieve = (id, { signal } = {}) => config
32
+ .v3Request(`projects/${id}`, { signal })
33
+ .then((res) => res.json())
34
+ .then((properties) => Ok(new Project(projectEntityToProperties(properties), projectApiMethods)))
35
+ .catch((e) => Err(e));
36
+ const projectApiMethods = {
37
+ activate,
38
+ delete: deleteProject,
39
+ retrieve,
40
+ };
41
+ return projectApiMethods;
42
+ };
43
+ //# sourceMappingURL=projectApiMethods.js.map
@@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zB,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CACnB,EAAE,CAAC,IAAI,OAAO,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAC1E;SACA,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnC,MAAM,iBAAiB,GAAG;QACxB,QAAQ;QACR,MAAM,EAAE,aAAa;QACrB,QAAQ;KACT,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,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, Result } from \"ts-results-es\";\nimport type { ResourceConfig, V3Config } from \"../../common/Config.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { Project } from \"./Project.js\";\nimport { projectEntityToProperties } from \"./utils.ts\";\n\nexport const createProjectApiMethods = (config: ResourceConfig & V3Config) => {\n const activate = (id: string) =>\n config\n .v3Request(`projects/${id}/activate`, {\n keepalive: true,\n method: \"PUT\",\n })\n .then(() => Ok(undefined))\n .catch((e: unknown) => Err(e));\n\n const deleteProject = (id: string) =>\n config\n .v3Request(`projects/${id}`, { keepalive: true, method: \"DELETE\" })\n .then(() => Ok(undefined))\n .catch((e: unknown) => Err(e));\n\n const retrieve = (id: string, { signal }: SignalParam = {}): Promise<Result<Project, unknown>> =>\n config\n .v3Request(`projects/${id}`, { signal })\n .then((res) => res.json())\n .then((properties) =>\n Ok(new Project(projectEntityToProperties(properties), projectApiMethods)),\n )\n .catch((e: unknown) => Err(e));\n\n const projectApiMethods = {\n activate,\n delete: deleteProject,\n retrieve,\n };\n\n return projectApiMethods;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import type { ProjectProperties } from "./Project.ts";
2
+ export declare const projectEntityToProperties: (properties: any) => ProjectProperties;
@@ -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 projectEntityToProperties = (
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ properties) => {
19
+ return {
20
+ cloudId: properties.cloudId,
21
+ cloudType: properties.cloudType,
22
+ createdAt: new Date(properties.createdAt),
23
+ createdBy: properties.createdBy,
24
+ credentials: properties.credentials,
25
+ id: properties.id,
26
+ lastStateError: properties.lastStateError || null,
27
+ modifiedAt: new Date(properties.modifiedAt),
28
+ modifiedBy: properties.modifiedBy,
29
+ name: properties.name,
30
+ numberOfEngines: properties.numberOfEngines,
31
+ primaryCatalog: properties.primaryCatalogId,
32
+ projectStore: properties.projectStore,
33
+ state: properties.state,
34
+ type: properties.type,
35
+ };
36
+ };
37
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/cloud/projects/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG;AACvC,8DAA8D;AAC9D,UAAe,EACI,EAAE;IACrB,OAAO;QACL,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,SAAS,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QACzC,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,EAAE,EAAE,UAAU,CAAC,EAAE;QACjB,cAAc,EAAE,UAAU,CAAC,cAAc,IAAI,IAAI;QACjD,UAAU,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAC3C,UAAU,EAAE,UAAU,CAAC,UAAU;QACjC,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,eAAe,EAAE,UAAU,CAAC,eAAe;QAC3C,cAAc,EAAE,UAAU,CAAC,gBAAgB;QAC3C,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,IAAI,EAAE,UAAU,CAAC,IAAI;KACtB,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 type { ProjectProperties } from \"./Project.ts\";\n\nexport const projectEntityToProperties = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n properties: any,\n): ProjectProperties => {\n return {\n cloudId: properties.cloudId,\n cloudType: properties.cloudType,\n createdAt: new Date(properties.createdAt),\n createdBy: properties.createdBy,\n credentials: properties.credentials,\n id: properties.id,\n lastStateError: properties.lastStateError || null,\n modifiedAt: new Date(properties.modifiedAt),\n modifiedBy: properties.modifiedBy,\n name: properties.name,\n numberOfEngines: properties.numberOfEngines,\n primaryCatalog: properties.primaryCatalogId,\n projectStore: properties.projectStore,\n state: properties.state,\n type: properties.type,\n };\n};\n"]}