@datalayer/core 1.1.59 → 1.1.66

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 (366) hide show
  1. package/README.md +2 -2
  2. package/lib/api/DatalayerApi.d.ts +42 -1
  3. package/lib/api/DatalayerApi.js +90 -3
  4. package/lib/api/constants.d.ts +18 -0
  5. package/lib/api/constants.js +18 -0
  6. package/lib/api/contents/attachments.d.ts +9 -0
  7. package/lib/api/contents/attachments.js +43 -0
  8. package/lib/api/contents/bridges.d.ts +22 -0
  9. package/lib/api/contents/bridges.js +79 -0
  10. package/lib/api/contents/capabilities.d.ts +11 -0
  11. package/lib/api/contents/capabilities.js +21 -0
  12. package/lib/api/contents/cloudStorage.d.ts +31 -0
  13. package/lib/api/contents/cloudStorage.js +89 -0
  14. package/lib/api/contents/dataservers.d.ts +37 -0
  15. package/lib/api/contents/dataservers.js +121 -0
  16. package/lib/api/contents/datasets.d.ts +15 -0
  17. package/lib/api/contents/datasets.js +45 -0
  18. package/lib/api/contents/datasources.d.ts +70 -0
  19. package/lib/api/contents/datasources.js +149 -0
  20. package/lib/api/contents/generated.d.ts +1070 -0
  21. package/lib/api/contents/index.d.ts +16 -0
  22. package/lib/api/contents/index.js +20 -0
  23. package/lib/api/contents/mcp.d.ts +46 -0
  24. package/lib/api/contents/mcp.js +157 -0
  25. package/lib/api/contents/objects.d.ts +31 -0
  26. package/lib/api/contents/objects.js +88 -0
  27. package/lib/api/contents/operations.d.ts +3 -0
  28. package/lib/api/contents/operations.js +19 -0
  29. package/lib/api/contents/runtimeMounts.d.ts +40 -0
  30. package/lib/api/contents/runtimeMounts.js +59 -0
  31. package/lib/api/contents/sandboxUid.d.ts +53 -0
  32. package/lib/api/contents/sandboxUid.js +78 -0
  33. package/lib/api/contents/sources.d.ts +19 -0
  34. package/lib/api/contents/sources.js +119 -0
  35. package/lib/api/contents/sync.d.ts +18 -0
  36. package/lib/api/contents/sync.js +69 -0
  37. package/lib/api/contents/transfers.d.ts +38 -0
  38. package/lib/api/contents/transfers.js +123 -0
  39. package/lib/api/iam/connectedAgents.d.ts +39 -0
  40. package/lib/api/iam/connectedAgents.js +52 -0
  41. package/lib/api/iam/index.d.ts +2 -1
  42. package/lib/api/iam/index.js +2 -1
  43. package/lib/api/iam/mcpAlertRules.d.ts +51 -0
  44. package/lib/api/iam/mcpAlertRules.js +198 -0
  45. package/lib/api/iam/mcpAuditSettings.d.ts +46 -0
  46. package/lib/api/iam/mcpAuditSettings.js +120 -0
  47. package/lib/api/iam/mcpPolicy.d.ts +80 -0
  48. package/lib/api/iam/mcpPolicy.js +132 -0
  49. package/lib/api/iam/organizationTeams.d.ts +13 -0
  50. package/lib/api/iam/organizationTeams.js +43 -0
  51. package/lib/api/iam/serviceAgents.d.ts +68 -0
  52. package/lib/api/iam/serviceAgents.js +119 -0
  53. package/lib/api/index.d.ts +4 -1
  54. package/lib/api/index.js +3 -1
  55. package/lib/api/mcp/activity.d.ts +37 -0
  56. package/lib/api/mcp/activity.js +26 -0
  57. package/lib/api/mcp/alerts.d.ts +25 -0
  58. package/lib/api/mcp/alerts.js +51 -0
  59. package/lib/api/mcp/audit.d.ts +29 -0
  60. package/lib/api/mcp/audit.js +55 -0
  61. package/lib/api/mcp/bindings.d.ts +18 -0
  62. package/lib/api/mcp/bindings.js +42 -0
  63. package/lib/api/mcp/forwarding.d.ts +25 -0
  64. package/lib/api/mcp/forwarding.js +46 -0
  65. package/lib/api/mcp/gateway.d.ts +16 -0
  66. package/lib/api/mcp/gateway.js +70 -0
  67. package/lib/api/mcp/generated.d.ts +22 -0
  68. package/lib/api/mcp/generated.js +213 -0
  69. package/lib/api/mcp/index.d.ts +17 -0
  70. package/lib/api/mcp/index.js +25 -0
  71. package/lib/api/mcp/observability.d.ts +125 -0
  72. package/lib/api/mcp/observability.js +254 -0
  73. package/lib/api/mcp/operations.d.ts +83 -0
  74. package/lib/api/mcp/operations.js +50 -0
  75. package/lib/api/mcp/organizations.d.ts +102 -0
  76. package/lib/api/mcp/organizations.js +46 -0
  77. package/lib/api/mcp/policy.d.ts +9 -0
  78. package/lib/api/mcp/policy.js +23 -0
  79. package/lib/api/mcp/tasks.d.ts +49 -0
  80. package/lib/api/mcp/tasks.js +147 -0
  81. package/lib/api/utils/validation.d.ts +1 -1
  82. package/lib/api/utils/validation.js +1 -1
  83. package/lib/client/auth/index.js +0 -5
  84. package/lib/client/auth/storage.js +0 -5
  85. package/lib/client/auth/strategies.js +0 -5
  86. package/lib/client/base.d.ts +6 -0
  87. package/lib/client/base.js +8 -0
  88. package/lib/client/index.d.ts +0 -10
  89. package/lib/client/index.js +2 -2
  90. package/lib/client/mixins/ContentsMixin.d.ts +71 -0
  91. package/lib/client/mixins/ContentsMixin.js +157 -0
  92. package/lib/client/mixins/IAMMixin.d.ts +0 -31
  93. package/lib/client/mixins/IAMMixin.js +0 -58
  94. package/lib/components/animation/AnimatedText.d.ts +1 -0
  95. package/lib/components/animation/AnimatedText.js +0 -4
  96. package/lib/components/auth/SigInAPIKey.d.ts +1 -0
  97. package/lib/components/auth/SigInAPIKey.js +0 -6
  98. package/lib/components/auth/SignIn.d.ts +1 -0
  99. package/lib/components/auth/SignIn.js +0 -4
  100. package/lib/components/auth/SignIn.stories.d.ts +2 -2
  101. package/lib/components/avatars/BoringAvatar.d.ts +1 -1
  102. package/lib/components/avatars/BoringAvatar.stories.d.ts +1 -1
  103. package/lib/components/avatars/DLAvatar.d.ts +1 -1
  104. package/lib/components/avatars/DLAvatar.js +0 -4
  105. package/lib/components/avatars/UserAvatar.d.ts +18 -1
  106. package/lib/components/avatars/UserAvatar.js +14 -14
  107. package/lib/components/avatars/UserProfileAvatar.d.ts +1 -1
  108. package/lib/components/banners/NoAutomationBanner.d.ts +1 -1
  109. package/lib/components/billing/BillingEntitySelect.d.ts +10 -0
  110. package/lib/components/billing/BillingEntitySelect.js +0 -17
  111. package/lib/components/billing/index.js +0 -4
  112. package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
  113. package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
  114. package/lib/components/buttons/LongActionButton.d.ts +1 -0
  115. package/lib/components/buttons/LongActionButton.js +0 -4
  116. package/lib/components/buttons/UploadButton.d.ts +1 -0
  117. package/lib/components/buttons/UploadButton.js +0 -4
  118. package/lib/components/checkout/StripeCheckout.d.ts +1 -1
  119. package/lib/components/collaboration/LiveEditorCollaborators.d.ts +31 -0
  120. package/lib/components/collaboration/LiveEditorCollaborators.js +98 -53
  121. package/lib/components/collaboration/index.js +0 -4
  122. package/lib/components/confetti/ConfettiSuccess.d.ts +1 -1
  123. package/lib/components/contents/ContentSourceCard.d.ts +8 -0
  124. package/lib/components/contents/ContentSourceCard.js +23 -0
  125. package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +10 -0
  126. package/lib/components/contents/HomeFolderObjectsBrowser.js +148 -0
  127. package/lib/components/contents/index.d.ts +2 -0
  128. package/lib/components/contents/index.js +6 -0
  129. package/lib/components/context/OrganizationSelect.d.ts +1 -1
  130. package/lib/components/display/AvatarSkeleton.d.ts +1 -1
  131. package/lib/components/display/BusyDots.d.ts +1 -1
  132. package/lib/components/display/CenteredSpinner.d.ts +1 -1
  133. package/lib/components/display/CodePreview.d.ts +1 -1
  134. package/lib/components/display/DatalayerBox.d.ts +7 -2
  135. package/lib/components/display/DatalayerBox.js +6 -6
  136. package/lib/components/display/HorizontalCenter.d.ts +1 -1
  137. package/lib/components/display/JupyterDialog.d.ts +1 -0
  138. package/lib/components/display/JupyterDialog.js +1 -7
  139. package/lib/components/display/Markdown.d.ts +1 -0
  140. package/lib/components/display/NotebookSkeleton.d.ts +1 -1
  141. package/lib/components/display/Placeholder.d.ts +1 -1
  142. package/lib/components/display/ToTopBranded.d.ts +1 -1
  143. package/lib/components/echarts/EChartsReact.d.ts +1 -1
  144. package/lib/components/flashes/FlashClosable.d.ts +1 -0
  145. package/lib/components/flashes/FlashClosable.js +0 -4
  146. package/lib/components/flashes/FlashGuest.d.ts +1 -1
  147. package/lib/components/flashes/FlashSurveys.d.ts +1 -1
  148. package/lib/components/flashes/FlashUnauthorized.d.ts +1 -0
  149. package/lib/components/flashes/FlashUnauthorized.js +0 -6
  150. package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
  151. package/lib/components/iam/ExternalTokenSilentLogin.d.ts +1 -1
  152. package/lib/components/index.d.ts +2 -0
  153. package/lib/components/index.js +2 -0
  154. package/lib/components/labels/StatusLabels.d.ts +10 -0
  155. package/lib/components/labels/StatusLabels.js +30 -1
  156. package/lib/components/labels/VisibilityLabel.d.ts +1 -1
  157. package/lib/components/landings/StepBlock.d.ts +1 -1
  158. package/lib/components/mcp/ClientBadge.d.ts +41 -0
  159. package/lib/components/mcp/ClientBadge.js +33 -0
  160. package/lib/components/mcp/McpErrorBlankslate.d.ts +21 -0
  161. package/lib/components/mcp/McpErrorBlankslate.js +17 -0
  162. package/lib/components/mcp/ScopeList.d.ts +28 -0
  163. package/lib/components/mcp/ScopeList.js +14 -0
  164. package/lib/components/mcp/index.d.ts +10 -0
  165. package/lib/components/mcp/index.js +18 -0
  166. package/lib/components/navbar/NavigationVisbilityObserver.d.ts +2 -1
  167. package/lib/components/navbar/SubdomainNavBar.d.ts +10 -5
  168. package/lib/components/navbar/SubdomainNavBar.js +2 -1
  169. package/lib/components/notebooks/JupyterNotebook.d.ts +1 -1
  170. package/lib/components/notebooks/JupyterNotebookToolbar.d.ts +1 -1
  171. package/lib/components/principal/PrincipalAppearance.d.ts +1 -0
  172. package/lib/components/principal/PrincipalAppearance.js +0 -8
  173. package/lib/components/principal/PrincipalAvatar.d.ts +9 -1
  174. package/lib/components/principal/PrincipalAvatar.js +25 -10
  175. package/lib/components/principal/PrincipalBadge.d.ts +1 -1
  176. package/lib/components/principal/PrincipalBanner.d.ts +1 -1
  177. package/lib/components/principal/PrincipalDetailsOverlay.d.ts +31 -1
  178. package/lib/components/principal/PrincipalDetailsOverlay.js +64 -33
  179. package/lib/components/principal/PrincipalHoverCard.d.ts +31 -0
  180. package/lib/components/principal/PrincipalHoverCard.js +52 -0
  181. package/lib/components/principal/PrincipalSwitcherMenu.d.ts +1 -0
  182. package/lib/components/principal/PrincipalSwitcherMenu.js +7 -15
  183. package/lib/components/principal/index.d.ts +2 -1
  184. package/lib/components/principal/index.js +2 -1
  185. package/lib/components/progress/ConsumptionBar.d.ts +1 -0
  186. package/lib/components/progress/ConsumptionBar.js +0 -4
  187. package/lib/components/progress/ProgressRing.d.ts +1 -0
  188. package/lib/components/progress/SpinnerBar.d.ts +1 -1
  189. package/lib/components/progress/Timer.d.ts +1 -0
  190. package/lib/components/progress/Timer.js +0 -4
  191. package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
  192. package/lib/components/sharing/ShareAccessComponent.d.ts +15 -1
  193. package/lib/components/sharing/ShareAccessComponent.js +36 -23
  194. package/lib/components/sharing/SharingEditor.d.ts +17 -0
  195. package/lib/components/sharing/SharingEditor.js +0 -24
  196. package/lib/components/sparklines/Sparklines.js +3 -4
  197. package/lib/components/sparklines/index.js +0 -4
  198. package/lib/components/storage/ContentsBrowser.d.ts +25 -1
  199. package/lib/components/storage/ContentsBrowser.js +145 -52
  200. package/lib/components/storage/ContentsBrowserMock.d.ts +3 -0
  201. package/lib/components/storage/ContentsBrowserMock.js +75 -0
  202. package/lib/components/storage/ContentsItems.d.ts +2 -1
  203. package/lib/components/storage/ContentsItems.js +0 -4
  204. package/lib/components/storage/ContentsTable.d.ts +50 -0
  205. package/lib/components/storage/ContentsTable.js +134 -0
  206. package/lib/components/storage/HomeFolderDrive.d.ts +71 -0
  207. package/lib/components/storage/HomeFolderDrive.js +248 -0
  208. package/lib/components/storage/index.d.ts +2 -0
  209. package/lib/components/storage/index.js +2 -0
  210. package/lib/components/students/StudentItemStatus.d.ts +1 -1
  211. package/lib/components/students/StudentResultCircle.d.ts +1 -1
  212. package/lib/components/subnav/SubNav.d.ts +5 -5
  213. package/lib/components/subnav/SubNav.js +11 -9
  214. package/lib/components/tables/DataTable.d.ts +1 -1
  215. package/lib/components/text-reveal/TextRevealAnimation.d.ts +2 -2
  216. package/lib/components/text-reveal/useTextRevealAnimationLines.d.ts +1 -1
  217. package/lib/components/time/LiveRelativeTime.d.ts +1 -0
  218. package/lib/components/time/LiveRelativeTime.js +0 -8
  219. package/lib/components/time/index.js +0 -4
  220. package/lib/components/timeline/Timeline.d.ts +1 -1
  221. package/lib/components/timeline/index.js +0 -4
  222. package/lib/components/users/PeerIndicator.d.ts +1 -0
  223. package/lib/components/users/PeerIndicator.js +0 -4
  224. package/lib/config/Configuration.d.ts +15 -17
  225. package/lib/config/Configuration.js +7 -0
  226. package/lib/hooks/index.d.ts +2 -0
  227. package/lib/hooks/index.js +2 -0
  228. package/lib/hooks/layouts/LayoutBackdrop.d.ts +1 -1
  229. package/lib/hooks/layouts/LayoutScreencapture.d.ts +1 -1
  230. package/lib/hooks/useBackdrop.d.ts +1 -1
  231. package/lib/hooks/useBackdropJupyterLab.d.ts +3 -2
  232. package/lib/hooks/useBackdropJupyterLab.js +0 -4
  233. package/lib/hooks/useCache.d.ts +310 -105
  234. package/lib/hooks/useCache.js +142 -355
  235. package/lib/hooks/useContainsFocus.d.ts +1 -1
  236. package/lib/hooks/useContents.d.ts +313 -0
  237. package/lib/hooks/useContents.js +964 -0
  238. package/lib/hooks/useFocusTrap.d.ts +4 -4
  239. package/lib/hooks/useFocusTrap.js +1 -1
  240. package/lib/hooks/useMcp.d.ts +229 -0
  241. package/lib/hooks/useMcp.js +656 -0
  242. package/lib/hooks/useMobile.js +0 -5
  243. package/lib/hooks/useProjectStore.d.ts +3 -3
  244. package/lib/hooks/useProjectStore.js +4 -4
  245. package/lib/hooks/useRef.d.ts +1 -1
  246. package/lib/hooks/useRef.js +3 -0
  247. package/lib/hooks/useScreencapture.d.ts +2 -1
  248. package/lib/hooks/useScreencapture.js +0 -4
  249. package/lib/hooks/useToast.js +0 -4
  250. package/lib/hooks/useUser.js +42 -0
  251. package/lib/hooks/useVisibilityObserver.d.ts +1 -1
  252. package/lib/index.d.ts +4 -1
  253. package/lib/index.js +3 -1
  254. package/lib/mocks/components/FlashMock.d.ts +1 -1
  255. package/lib/mocks/views/ActionMenuMock.d.ts +1 -1
  256. package/lib/mocks/views/ChartMock.d.ts +1 -1
  257. package/lib/mocks/views/DashboardMock.d.ts +1 -1
  258. package/lib/mocks/views/FormMock.d.ts +1 -1
  259. package/lib/mocks/views/TableMock.d.ts +1 -1
  260. package/lib/mocks/views/WipMock.d.ts +1 -1
  261. package/lib/models/Credits.d.ts +16 -0
  262. package/lib/models/Credits.js +22 -0
  263. package/lib/models/McpAuditEvent.d.ts +52 -0
  264. package/lib/models/McpAuditEvent.js +5 -0
  265. package/lib/models/McpBinding.d.ts +51 -0
  266. package/lib/models/McpBinding.js +5 -0
  267. package/lib/models/McpPolicy.d.ts +77 -0
  268. package/lib/models/McpPolicy.js +5 -0
  269. package/lib/models/McpTask.d.ts +94 -0
  270. package/lib/models/McpTask.js +7 -0
  271. package/lib/models/StartedBy.d.ts +57 -0
  272. package/lib/models/StartedBy.js +81 -0
  273. package/lib/models/UserDTO.js +4 -2
  274. package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
  275. package/lib/models/contents/__fixtures__/v1-contracts.json +66 -0
  276. package/lib/models/contents/fieldCase.d.ts +8 -0
  277. package/lib/models/contents/fieldCase.js +37 -0
  278. package/lib/models/contents/index.d.ts +2 -0
  279. package/lib/models/contents/index.js +6 -0
  280. package/lib/models/contents/permissions.d.ts +16 -0
  281. package/lib/models/contents/permissions.js +34 -0
  282. package/lib/models/index.d.ts +5 -1
  283. package/lib/models/index.js +5 -1
  284. package/lib/state/substates/CoreState.d.ts +15 -7
  285. package/lib/state/substates/CoreState.js +18 -14
  286. package/lib/state/substates/IAMState.d.ts +1 -1
  287. package/lib/state/substates/IAMState.js +5 -5
  288. package/lib/state/substates/ProfileState.js +0 -4
  289. package/lib/state/substates/index.d.ts +0 -1
  290. package/lib/state/substates/index.js +0 -1
  291. package/lib/utils/Jwt.d.ts +26 -0
  292. package/lib/utils/Jwt.js +37 -0
  293. package/lib/utils/WithSuspense.d.ts +1 -1
  294. package/lib/views/api-keys/APIKeyEdit.d.ts +1 -1
  295. package/lib/views/api-keys/APIKeyNew.d.ts +1 -1
  296. package/lib/views/api-keys/APIKeys.d.ts +1 -1
  297. package/lib/views/api-keys/APIKeys.js +30 -4
  298. package/lib/views/api-keys/APIKeysStandalone.d.ts +5 -1
  299. package/lib/views/api-keys/APIKeysStandalone.js +2 -2
  300. package/lib/views/datasources/DatasourceDetail.d.ts +12 -5
  301. package/lib/views/datasources/DatasourceDetail.js +80 -110
  302. package/lib/views/datasources/DatasourceNew.d.ts +14 -8
  303. package/lib/views/datasources/DatasourceNew.js +129 -118
  304. package/lib/views/datasources/Datasources.d.ts +39 -7
  305. package/lib/views/datasources/Datasources.js +95 -40
  306. package/lib/views/datasources/DatasourcesMock.d.ts +3 -0
  307. package/lib/views/datasources/DatasourcesMock.js +57 -0
  308. package/lib/views/iam/SignInSimple.d.ts +12 -0
  309. package/lib/views/iam/SignInSimple.js +4 -4
  310. package/lib/views/index.d.ts +1 -0
  311. package/lib/views/index.js +1 -0
  312. package/lib/views/mcp/AlertDestinations.d.ts +34 -0
  313. package/lib/views/mcp/AlertDestinations.js +75 -0
  314. package/lib/views/mcp/AlertRules.d.ts +32 -0
  315. package/lib/views/mcp/AlertRules.js +245 -0
  316. package/lib/views/mcp/AuditLog.d.ts +42 -0
  317. package/lib/views/mcp/AuditLog.js +144 -0
  318. package/lib/views/mcp/ConnectedAgents.d.ts +34 -0
  319. package/lib/views/mcp/ConnectedAgents.js +100 -0
  320. package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
  321. package/lib/views/mcp/EnterpriseConsole.js +173 -0
  322. package/lib/views/mcp/McpDashboard.d.ts +50 -0
  323. package/lib/views/mcp/McpDashboard.js +347 -0
  324. package/lib/views/mcp/McpHome.d.ts +92 -0
  325. package/lib/views/mcp/McpHome.js +153 -0
  326. package/lib/views/mcp/McpObservability.d.ts +50 -0
  327. package/lib/views/mcp/McpObservability.js +150 -0
  328. package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
  329. package/lib/views/mcp/OrganizationPolicy.js +107 -0
  330. package/lib/views/mcp/OrganizationUsage.d.ts +69 -0
  331. package/lib/views/mcp/OrganizationUsage.js +113 -0
  332. package/lib/views/mcp/PersonalPolicy.d.ts +54 -0
  333. package/lib/views/mcp/PersonalPolicy.js +125 -0
  334. package/lib/views/mcp/Policies.d.ts +53 -0
  335. package/lib/views/mcp/Policies.js +210 -0
  336. package/lib/views/mcp/PolicyForm.d.ts +67 -0
  337. package/lib/views/mcp/PolicyForm.js +91 -0
  338. package/lib/views/mcp/PolicyHistory.d.ts +45 -0
  339. package/lib/views/mcp/PolicyHistory.js +62 -0
  340. package/lib/views/mcp/ServiceAgents.d.ts +46 -0
  341. package/lib/views/mcp/ServiceAgents.js +194 -0
  342. package/lib/views/mcp/TeamPolicies.d.ts +33 -0
  343. package/lib/views/mcp/TeamPolicies.js +98 -0
  344. package/lib/views/mcp/format.d.ts +25 -0
  345. package/lib/views/mcp/format.js +77 -0
  346. package/lib/views/mcp/index.d.ts +29 -0
  347. package/lib/views/mcp/index.js +37 -0
  348. package/lib/views/mcp/types.d.ts +66 -0
  349. package/lib/views/mcp/types.js +5 -0
  350. package/lib/views/secrets/SecretEdit.d.ts +5 -1
  351. package/lib/views/secrets/SecretEdit.js +2 -2
  352. package/lib/views/secrets/SecretNew.d.ts +11 -1
  353. package/lib/views/secrets/SecretNew.js +2 -2
  354. package/lib/views/secrets/Secrets.d.ts +12 -1
  355. package/lib/views/secrets/Secrets.js +2 -2
  356. package/package.json +28 -24
  357. package/scripts/generate-contents-types.py +169 -0
  358. package/scripts/generate-mcp-types.py +233 -0
  359. package/lib/api/iam/datasources.d.ts +0 -86
  360. package/lib/api/iam/datasources.js +0 -185
  361. package/lib/components/toolbars/index.d.ts +0 -1
  362. package/lib/models/Datasource.d.ts +0 -181
  363. package/lib/models/Datasource.js +0 -154
  364. package/lib/state/substates/DatasourceState.d.ts +0 -11
  365. package/lib/state/substates/DatasourceState.js +0 -16
  366. /package/lib/{components/toolbars/index.js → api/contents/generated.js} +0 -0
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /*
6
+ * Copyright (c) 2023-2026 Datalayer, Inc.
7
+ * Distributed under the terms of the Modified BSD License.
8
+ */
9
+ /**
10
+ * Who started a runtime: a person, one of their agents, or a service agent.
11
+ *
12
+ * The reservation has carried this since agents could make one — IAM writes
13
+ * `client_id_s` and `agent_uid_s` onto the usage record's metadata, and
14
+ * `useUsages` already hands the whole map to the views. Nothing displayed
15
+ * it, so a person looking at their running runtimes could not tell which of
16
+ * them they had started and which an agent had, on a platform whose premise
17
+ * is that agents start things on your behalf.
18
+ *
19
+ * The distinction that matters is **agent versus service agent**, not
20
+ * "automated versus not". A delegated agent runs as you, spends your
21
+ * credits, and stops when you disconnect it. A service agent is the
22
+ * organization's own principal with its own key: it keeps running when the
23
+ * person who set it up leaves, and it is the row somebody has to go and turn
24
+ * off. Told apart, one is "I did that yesterday" and the other is "who owns
25
+ * this".
26
+ *
27
+ * @module models/StartedBy
28
+ */
29
+ /** The Solr field names IAM writes the dimensions on. */
30
+ export const CLIENT_ID_KEY = 'client_id_s';
31
+ export const AGENT_UID_KEY = 'agent_uid_s';
32
+ const read = (metadata, key) => {
33
+ if (!metadata) {
34
+ return '';
35
+ }
36
+ const value = metadata instanceof Map
37
+ ? metadata.get(key)
38
+ : metadata[key];
39
+ return typeof value === 'string' ? value.trim() : '';
40
+ };
41
+ /**
42
+ * Who started this reservation.
43
+ *
44
+ * `agent_uid_s` decides before `client_id_s`, because a service agent
45
+ * reaching Runtimes through the MCP gateway carries **the gateway's** client
46
+ * id: read the other way round, every one of an organization's pipelines
47
+ * would show as the same agent.
48
+ *
49
+ * A record with neither dimension is a person's own work. It is *not* an
50
+ * agent whose name we failed to read, and saying "unknown" would suggest it
51
+ * was — so the answer is the reader themselves.
52
+ */
53
+ export const startedBy = (metadata) => {
54
+ const agentUid = read(metadata, AGENT_UID_KEY);
55
+ const clientId = read(metadata, CLIENT_ID_KEY);
56
+ if (agentUid) {
57
+ return { kind: 'service-agent', label: agentUid, clientId, agentUid };
58
+ }
59
+ if (clientId) {
60
+ return { kind: 'agent', label: clientId, clientId, agentUid: '' };
61
+ }
62
+ return { kind: 'person', label: 'You', clientId: '', agentUid: '' };
63
+ };
64
+ /**
65
+ * The words a search box matches on for this row.
66
+ *
67
+ * "agent" matches every agent-started runtime, the client id matches one
68
+ * client, and "you" matches your own — so the filter the plan asks for is the
69
+ * search box that is already there rather than a second control beside it.
70
+ */
71
+ export const startedBySearchTerms = (metadata) => {
72
+ const who = startedBy(metadata);
73
+ if (who.kind === 'person') {
74
+ return 'you person';
75
+ }
76
+ if (who.kind === 'service-agent') {
77
+ return `agent service-agent ${who.agentUid} ${who.clientId}`.trim();
78
+ }
79
+ return `agent ${who.clientId}`;
80
+ };
81
+ export default startedBy;
@@ -60,6 +60,8 @@ export class UserDTO {
60
60
  * @returns Core user data with camelCase properties
61
61
  */
62
62
  toJSON() {
63
+ // avatarIcon and banner are optional: omit them when the API did not
64
+ // return them, as validateJSON rejects undefined property values.
63
65
  const obj = {
64
66
  id: this.id,
65
67
  uid: this.uid,
@@ -69,8 +71,8 @@ export class UserDTO {
69
71
  email: this.email,
70
72
  handle: this.handle,
71
73
  avatarUrl: this.avatarUrl,
72
- avatarIcon: this.avatarIcon,
73
- banner: this.banner,
74
+ ...(this.avatarIcon !== undefined ? { avatarIcon: this.avatarIcon } : {}),
75
+ ...(this.banner !== undefined ? { banner: this.banner } : {}),
74
76
  };
75
77
  validateJSON(obj, 'User');
76
78
  return obj;
@@ -0,0 +1,57 @@
1
+ {
2
+ "solr": {
3
+ "id": "internal-root",
4
+ "_version_": 42,
5
+ "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
6
+ "source_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
7
+ "type_s": "content_source",
8
+ "name_t": "Earth observations",
9
+ "code_s": "earth-observations",
10
+ "capabilities_ss": ["browse", "query"],
11
+ "rank_i": 7,
12
+ "ranks_is": [7, 8],
13
+ "completed_bytes_l": 12,
14
+ "part_sizes_ls": [5, 7],
15
+ "progress_f": 0.5,
16
+ "progress_samples_fs": [0.25, 0.5],
17
+ "ratio_d": 0.125,
18
+ "ratios_ds": [0.125, 0.25],
19
+ "is_public_b": false,
20
+ "checks_bs": [true, false],
21
+ "created_at_dt": "2026-08-24T12:00:00Z",
22
+ "observed_at_dts": ["2026-08-24T12:00:00Z", "2026-08-24T12:01:00Z"],
23
+ "notes_txt": "typed suffix coverage",
24
+ "description_t": null,
25
+ "grants": [{
26
+ "id": "internal-child",
27
+ "_root_": "internal-root",
28
+ "_nest_parent_": "internal-root",
29
+ "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
30
+ "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
31
+ "access_level_s": "view"
32
+ }]
33
+ },
34
+ "python": {
35
+ "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
36
+ "source_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
37
+ "type": "content_source",
38
+ "name": "Earth observations",
39
+ "code": "earth-observations",
40
+ "capabilities": ["browse", "query"],
41
+ "rank": 7,
42
+ "ranks": [7, 8],
43
+ "completed_bytes": 12,
44
+ "part_sizes": [5, 7],
45
+ "progress": 0.5,
46
+ "progress_samples": [0.25, 0.5],
47
+ "ratio": 0.125,
48
+ "ratios": [0.125, 0.25],
49
+ "is_public": false,
50
+ "checks": [true, false],
51
+ "created_at": "2026-08-24T12:00:00Z",
52
+ "observed_at": ["2026-08-24T12:00:00Z", "2026-08-24T12:01:00Z"],
53
+ "notes": "typed suffix coverage",
54
+ "description": null,
55
+ "grants": [{"uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "access_level": "view"}]
56
+ }
57
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "sources": [
3
+ {
4
+ "contract_version": "v1",
5
+ "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
6
+ "kind": "files",
7
+ "name": "User Folder",
8
+ "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
9
+ "principal_kind": "user",
10
+ "configuration": {"kind": "files", "owning_user_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "storage_backend_id": "users", "quota_policy": "standard", "versioning_policy": "retained"},
11
+ "capabilities": ["browse", "transfer", "mount"],
12
+ "status": "ready",
13
+ "created_at": "2026-08-24T12:00:00Z",
14
+ "updated_at": "2026-08-24T12:00:00Z"
15
+ },
16
+ {
17
+ "contract_version": "v1", "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "kind": "dataset", "name": "Dataset", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "principal_kind": "user",
18
+ "configuration": {"kind": "dataset", "tags": ["curated"], "publication_eligible": true}, "capabilities": ["browse", "materialize"], "status": "ready", "created_at": "2026-08-24T12:00:00Z", "updated_at": "2026-08-24T12:00:00Z"
19
+ },
20
+ {
21
+ "contract_version": "v1", "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "kind": "volume", "name": "Volume", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "principal_kind": "user",
22
+ "configuration": {"kind": "volume", "capacity_bytes": 1073741824, "scope": "user", "backing_resource_id": "pvc-1", "default_mount_path": "/home/jovyan/data", "access_modes": ["ro", "rw"], "concurrent_readers": true, "concurrent_writers": false}, "capabilities": ["browse", "mount"], "status": "ready", "created_at": "2026-08-24T12:00:00Z", "updated_at": "2026-08-24T12:00:00Z"
23
+ },
24
+ {
25
+ "contract_version": "v1", "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "kind": "cloud-storage", "name": "S3", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "principal_kind": "user",
26
+ "configuration": {"kind": "cloud-storage", "provider": "s3", "bucket_or_container": "research", "prefix": "inputs/", "region": "eu-west-1", "access_preference": "automatic"}, "capabilities": ["browse", "transfer"], "status": "ready", "created_at": "2026-08-24T12:00:00Z", "updated_at": "2026-08-24T12:00:00Z"
27
+ },
28
+ {
29
+ "contract_version": "v1", "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "kind": "datasource", "name": "Warehouse", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "principal_kind": "user",
30
+ "configuration": {"kind": "datasource", "connector_type": "sql", "endpoint": "duckdb://", "credential_uid": "01HZY7WQ8XKJ4M2N5P6R7S8T9V", "database_or_project": "analytics", "allowed_operations": ["select"], "default_row_limit": 10000}, "capabilities": ["query"], "status": "ready", "created_at": "2026-08-24T12:00:00Z", "updated_at": "2026-08-24T12:00:00Z"
31
+ },
32
+ {
33
+ "contract_version": "v1", "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "kind": "data-server", "name": "Private gateway", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "principal_kind": "organization",
34
+ "configuration": {"kind": "data-server", "registration_identity": "gateway-1", "mtls_issuer": "datalayer-contents-ca", "connectors": [{"connector_type": "sql", "operations": ["select"], "policy_version": "v1"}], "policy_version": "v1"}, "capabilities": ["query"], "status": "ready", "created_at": "2026-08-24T12:00:00Z", "updated_at": "2026-08-24T12:00:00Z"
35
+ },
36
+ {
37
+ "contract_version": "v1", "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "kind": "mcp", "name": "Earthdata", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "principal_kind": "team",
38
+ "configuration": {"kind": "mcp", "transport": "streamable-http", "endpoint": "https://example.test/mcp", "allowed_tools": ["search_earthdata"], "allowed_domains": ["earthdata.nasa.gov"], "allowed_destinations": ["home-folder:///acquisitions/"], "approval_policy": "explicit", "destination_policy": "home-folder-only", "max_result_bytes": 67108864}, "capabilities": ["browse", "transfer"], "status": "ready", "created_at": "2026-08-24T12:00:00Z", "updated_at": "2026-08-24T12:00:00Z"
39
+ },
40
+ {
41
+ "contract_version": "v1", "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "kind": "environment", "name": "Environment content", "principal_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "principal_kind": "organization",
42
+ "configuration": {"kind": "environment", "environment_uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "build_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ", "runtime_content_uids": [], "resolved_provider_paths": {}, "build_entries": []}, "capabilities": ["materialize"], "status": "ready", "created_at": "2026-08-24T12:00:00Z", "updated_at": "2026-08-24T12:00:00Z"
43
+ }
44
+ ],
45
+ "attachment_manifest": {
46
+ "contract_version": "v1",
47
+ "sandbox_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
48
+ "sandbox_provider": "daytona",
49
+ "generated_at": "2026-08-24T12:00:00Z",
50
+ "attachments": [{
51
+ "uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
52
+ "source_uid": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
53
+ "sandbox_uid": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
54
+ "sandbox_provider": "daytona",
55
+ "mode": "ro",
56
+ "mount_path": "/home/daytona/data",
57
+ "delivery": "materialize",
58
+ "required": true,
59
+ "capabilities": ["browse", "materialize"],
60
+ "status": "ready",
61
+ "limits": {"bytes": 1073741824},
62
+ "created_at": "2026-08-24T12:00:00Z",
63
+ "cleanup_policy": "remove-materialization"
64
+ }]
65
+ }
66
+ }
@@ -0,0 +1,8 @@
1
+ /** JSON values accepted at the Contents HTTP boundary. */
2
+ export type JsonValue = null | boolean | number | string | JsonValue[] | {
3
+ [key: string]: JsonValue;
4
+ };
5
+ /** Recursively convert suffixless Python/API snake-case fields to camel case. */
6
+ export declare const contentsToCamelCase: (value: JsonValue) => JsonValue;
7
+ /** Recursively convert camel-case Contents client values to API snake case. */
8
+ export declare const contentsToSnakeCase: (value: JsonValue) => JsonValue;
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ const snakeToCamelKey = (key) => key.replace(/_([a-zA-Z0-9])/g, (_, character) => character.toUpperCase());
6
+ const camelToSnakeKey = (key) => key.replace(/([A-Z])/g, '_$1').toLowerCase();
7
+ const convertObject = (value, keyConverter, valueConverter) => {
8
+ const converted = {};
9
+ for (const [key, item] of Object.entries(value)) {
10
+ const convertedKey = keyConverter(key);
11
+ if (Object.hasOwn(converted, convertedKey)) {
12
+ throw new Error(`Contents field collision: ${key} -> ${convertedKey}`);
13
+ }
14
+ converted[convertedKey] = valueConverter(item);
15
+ }
16
+ return converted;
17
+ };
18
+ /** Recursively convert suffixless Python/API snake-case fields to camel case. */
19
+ export const contentsToCamelCase = (value) => {
20
+ if (Array.isArray(value)) {
21
+ return value.map(contentsToCamelCase);
22
+ }
23
+ if (value !== null && typeof value === 'object') {
24
+ return convertObject(value, snakeToCamelKey, contentsToCamelCase);
25
+ }
26
+ return value;
27
+ };
28
+ /** Recursively convert camel-case Contents client values to API snake case. */
29
+ export const contentsToSnakeCase = (value) => {
30
+ if (Array.isArray(value)) {
31
+ return value.map(contentsToSnakeCase);
32
+ }
33
+ if (value !== null && typeof value === 'object') {
34
+ return convertObject(value, camelToSnakeKey, contentsToSnakeCase);
35
+ }
36
+ return value;
37
+ };
@@ -0,0 +1,2 @@
1
+ export * from './fieldCase';
2
+ export * from './permissions';
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ export * from './fieldCase.js';
6
+ export * from './permissions.js';
@@ -0,0 +1,16 @@
1
+ import type { CatalogSource, ContentSource } from '../../api/contents';
2
+ /**
3
+ * What each content source is called where a person reads it.
4
+ *
5
+ * Keyed by the wire field, which is still `kind`: the contract names it that,
6
+ * and renaming a stored field is a migration rather than a vocabulary choice.
7
+ * Everything above the wire says content source.
8
+ */
9
+ export declare const CONTENT_SOURCE_LABELS: Record<ContentSource['kind'], string>;
10
+ export declare const contentSourceLabel: (kind: ContentSource["kind"]) => string;
11
+ export declare const contentSourceEffectiveRole: (item: CatalogSource) => string;
12
+ export declare const canViewContentSource: (item: CatalogSource) => boolean;
13
+ export declare const canUpdateContentSource: (item: CatalogSource) => boolean;
14
+ export declare const canExecuteContentSource: (item: CatalogSource) => boolean;
15
+ /** Sharing mutations are owner-only in the v1 Contents service contract. */
16
+ export declare const canShareContentSource: (item: CatalogSource) => boolean;
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * What each content source is called where a person reads it.
7
+ *
8
+ * Keyed by the wire field, which is still `kind`: the contract names it that,
9
+ * and renaming a stored field is a migration rather than a vocabulary choice.
10
+ * Everything above the wire says content source.
11
+ */
12
+ export const CONTENT_SOURCE_LABELS = {
13
+ files: 'Home Folder',
14
+ dataset: 'Dataset',
15
+ volume: 'Volume',
16
+ 'cloud-storage': 'Cloud Storage',
17
+ datasource: 'Datasource',
18
+ 'data-server': 'Dataserver',
19
+ mcp: 'MCP',
20
+ environment: 'Environment',
21
+ };
22
+ export const contentSourceLabel = (kind) => CONTENT_SOURCE_LABELS[kind];
23
+ export const contentSourceEffectiveRole = (item) => {
24
+ if (item.permissions.isOwner) {
25
+ return 'Owner';
26
+ }
27
+ const level = item.permissions.effectiveAccessLevel;
28
+ return level ? `${level[0].toUpperCase()}${level.slice(1)}` : 'No access';
29
+ };
30
+ export const canViewContentSource = (item) => item.permissions.view;
31
+ export const canUpdateContentSource = (item) => item.permissions.update;
32
+ export const canExecuteContentSource = (item) => item.permissions.execute;
33
+ /** Sharing mutations are owner-only in the v1 Contents service contract. */
34
+ export const canShareContentSource = (item) => item.source.kind !== 'files' && item.permissions.isOwner;
@@ -36,7 +36,6 @@ export * from './ContactIAMProvider';
36
36
  export * from './ContactTags';
37
37
  export * from './Credits';
38
38
  export * from './CreditsDTO';
39
- export * from './Datasource';
40
39
  export * from './Dean';
41
40
  export * from './Errors';
42
41
  export * from './GrowthKPI';
@@ -50,6 +49,10 @@ export * from './Inbound';
50
49
  export * from './Instructor';
51
50
  export * from './Invite';
52
51
  export * from './LandingRoles';
52
+ export * from './McpAuditEvent';
53
+ export * from './McpBinding';
54
+ export * from './McpPolicy';
55
+ export * from './McpTask';
53
56
  export * from './Member';
54
57
  export * from './Organization';
55
58
  export * from './OrganizationMember';
@@ -68,6 +71,7 @@ export * from './TeamMember';
68
71
  export * from './URN';
69
72
  export * from './Usage';
70
73
  export * from './User';
74
+ export * from './StartedBy';
71
75
  export * from './UserDTO';
72
76
  export * from './UserEvent';
73
77
  export * from './UserOnboarding';
@@ -40,7 +40,6 @@ export * from './ContactIAMProvider.js';
40
40
  export * from './ContactTags.js';
41
41
  export * from './Credits.js';
42
42
  export * from './CreditsDTO.js';
43
- export * from './Datasource.js';
44
43
  export * from './Dean.js';
45
44
  export * from './Errors.js';
46
45
  export * from './GrowthKPI.js';
@@ -54,6 +53,10 @@ export * from './Inbound.js';
54
53
  export * from './Instructor.js';
55
54
  export * from './Invite.js';
56
55
  export * from './LandingRoles.js';
56
+ export * from './McpAuditEvent.js';
57
+ export * from './McpBinding.js';
58
+ export * from './McpPolicy.js';
59
+ export * from './McpTask.js';
57
60
  export * from './Member.js';
58
61
  export * from './Organization.js';
59
62
  export * from './OrganizationMember.js';
@@ -72,6 +75,7 @@ export * from './TeamMember.js';
72
75
  export * from './URN.js';
73
76
  export * from './Usage.js';
74
77
  export * from './User.js';
78
+ export * from './StartedBy.js';
75
79
  export * from './UserDTO.js';
76
80
  export * from './UserEvent.js';
77
81
  export * from './UserOnboarding.js';
@@ -1,4 +1,15 @@
1
1
  import type { IDatalayerCoreConfig } from '../../config/Configuration';
2
+ /**
3
+ * What the page itself stated, as opposed to what this module defaults to.
4
+ *
5
+ * The two cannot be told apart once merged, and they do not carry the same
6
+ * weight: a value written into the page describes the deployment that served
7
+ * it, while a default is only a guess. A consumer that reconciles this
8
+ * configuration with another source — the Jupyter server extension, say —
9
+ * needs to know which keys were actually stated, or it will let a stale
10
+ * answer from elsewhere override a deliberate one from here.
11
+ */
12
+ export declare const pageConfiguration: Partial<IDatalayerCoreConfig>;
2
13
  export type DatalayerCoreState = {
3
14
  tab: number;
4
15
  getIntTab: () => number;
@@ -23,14 +34,11 @@ export declare const coreStore: import("zustand").StoreApi<DatalayerCoreState>;
23
34
  export declare function useCoreStore(): DatalayerCoreState;
24
35
  export declare function useCoreStore<T>(selector: (state: DatalayerCoreState) => T): T;
25
36
  /**
26
- * Resolve the OTEL base URL used to *consume* (read/query) telemetry.
27
- *
28
- * Prefers `otelInUrl` when set, otherwise falls back to `otelUrl`. This allows
29
- * local development to fetch telemetry from a remote (e.g. production) OTEL
30
- * service even when the local runtime exports telemetry to a different endpoint.
37
+ * The OTEL base URL used to *consume* (read/query) telemetry.
31
38
  *
32
- * Mirrors the `DATALAYER_OTEL_IN_URL` (consume) / `DATALAYER_OTEL_URL` (export)
33
- * split on the backend/build side.
39
+ * One address, `otelUrl`. A second one existed so local development could read
40
+ * from a remote service while exporting elsewhere; pointing `otelUrl` at that
41
+ * remote does the same thing without two fields that disagree.
34
42
  */
35
43
  export declare const getOtelConsumeUrl: () => string;
36
44
  export default useCoreStore;
@@ -16,6 +16,7 @@ let initialConfiguration = {
16
16
  loadConfigurationFromServer: true,
17
17
  jupyterServerless: false,
18
18
  iamUrl: 'https://prod1.datalayer.run',
19
+ contentsUrl: 'https://r1.datalayer.run',
19
20
  managerUrl: 'https://prod1.datalayer.run',
20
21
  runtimesUrl: 'https://r1.datalayer.run',
21
22
  schedulerUrl: 'https://prod1.datalayer.run',
@@ -26,9 +27,6 @@ let initialConfiguration = {
26
27
  jupyterMcpServerUrl: 'https://mcp.datalayer.run/mcp',
27
28
  otelUrl: 'https://prod1.datalayer.run',
28
29
  // Defaults to prod so telemetry is consumed from the production OTEL service
29
- // even when runtimes export elsewhere (see `getOtelConsumeUrl` and the
30
- // `DATALAYER_OTEL_IN_URL` env var). Override to '' to consume from `otelUrl`.
31
- otelInUrl: 'https://prod1.datalayer.run',
32
30
  growthUrl: 'https://prod1.datalayer.run',
33
31
  inboundsUrl: 'https://prod1.datalayer.run',
34
32
  successUrl: 'https://prod1.datalayer.run',
@@ -52,12 +50,24 @@ let initialConfiguration = {
52
50
  privacyUrl: 'https://datalayer.ai/privacy',
53
51
  },
54
52
  };
53
+ /**
54
+ * What the page itself stated, as opposed to what this module defaults to.
55
+ *
56
+ * The two cannot be told apart once merged, and they do not carry the same
57
+ * weight: a value written into the page describes the deployment that served
58
+ * it, while a default is only a guess. A consumer that reconciles this
59
+ * configuration with another source — the Jupyter server extension, say —
60
+ * needs to know which keys were actually stated, or it will let a stale
61
+ * answer from elsewhere override a deliberate one from here.
62
+ */
63
+ export const pageConfiguration = {};
55
64
  // Try loading initial state from datalayer-config-data element
56
65
  try {
57
66
  if (typeof document !== 'undefined') {
58
67
  const rawConfig = document.getElementById('datalayer-config-data');
59
68
  if (rawConfig?.innerText) {
60
69
  const htmlOverridingConfiguration = JSON.parse(rawConfig?.innerText || '{}');
70
+ Object.assign(pageConfiguration, htmlOverridingConfiguration);
61
71
  if (htmlOverridingConfiguration.loadConfigurationFromServer != undefined) {
62
72
  loadConfigurationFromServer =
63
73
  htmlOverridingConfiguration.loadConfigurationFromServer;
@@ -103,17 +113,11 @@ export function useCoreStore(selector) {
103
113
  return useStore(coreStore, selector);
104
114
  }
105
115
  /**
106
- * Resolve the OTEL base URL used to *consume* (read/query) telemetry.
116
+ * The OTEL base URL used to *consume* (read/query) telemetry.
107
117
  *
108
- * Prefers `otelInUrl` when set, otherwise falls back to `otelUrl`. This allows
109
- * local development to fetch telemetry from a remote (e.g. production) OTEL
110
- * service even when the local runtime exports telemetry to a different endpoint.
111
- *
112
- * Mirrors the `DATALAYER_OTEL_IN_URL` (consume) / `DATALAYER_OTEL_URL` (export)
113
- * split on the backend/build side.
118
+ * One address, `otelUrl`. A second one existed so local development could read
119
+ * from a remote service while exporting elsewhere; pointing `otelUrl` at that
120
+ * remote does the same thing without two fields that disagree.
114
121
  */
115
- export const getOtelConsumeUrl = () => {
116
- const cfg = coreStore.getState().configuration;
117
- return cfg.otelInUrl || cfg.otelUrl;
118
- };
122
+ export const getOtelConsumeUrl = () => coreStore.getState().configuration.otelUrl;
119
123
  export default useCoreStore;
@@ -63,7 +63,7 @@ export type IAMState = IIAMState & {
63
63
  setExternalToken: (externalToken: string) => void;
64
64
  setVersion: (version: string) => void;
65
65
  /**
66
- * Set the {@link token} and the {@link user}.
66
+ * Set the `token` and the `user`.
67
67
  *
68
68
  * The user detail will be automatically retrieve
69
69
  * to avoid inconsistency.
@@ -6,6 +6,7 @@ import { Poll } from '@lumino/polling';
6
6
  import { useStore } from 'zustand';
7
7
  import { createStore } from 'zustand/vanilla';
8
8
  import { ANONYMOUS_USER_TOKEN, ANONYMOUS_USER, asUser, IAMProvidersSpecs, } from '../../models/index.js';
9
+ import { availableCredits } from '../../models/Credits.js';
9
10
  import { getStoredToken, getStoredUser, loadRefreshTokenFromCookie, storeToken, storeUser, } from '../storage/index.js';
10
11
  import { requestDatalayerAPI, } from '../../api/DatalayerApi.js';
11
12
  import { getCookie, setCookie, deleteCookie } from '../../utils/index.js';
@@ -130,12 +131,11 @@ export const iamStore = createStore((set, get) => {
130
131
  : undefined,
131
132
  });
132
133
  const { credits, reservations: creditsReservations = [] } = creditsRaw;
133
- let available = credits.quota !== null
134
- ? credits.quota - credits.credits
135
- : credits.credits;
136
- available -= creditsReservations.reduce((consumed, reservation) => consumed + reservation.credits, 0);
137
134
  set({
138
- credits: { ...credits, available: Math.max(0, available) },
135
+ credits: {
136
+ ...credits,
137
+ available: availableCredits(credits, creditsReservations),
138
+ },
139
139
  creditsReservations: creditsReservations,
140
140
  });
141
141
  }
@@ -2,10 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2023-2026 Datalayer, Inc.
7
- * Distributed under the terms of the Modified BSD License.
8
- */
9
5
  /**
10
6
  * ProfileState — the one place the authenticated user's profile lives.
11
7
  *
@@ -1,5 +1,4 @@
1
1
  export * from './CoreState';
2
- export * from './DatasourceState';
3
2
  export * from './IAMState';
4
3
  export * from './LayoutState';
5
4
  export * from './ProfileState';
@@ -3,7 +3,6 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  export * from './CoreState.js';
6
- export * from './DatasourceState.js';
7
6
  export * from './IAMState.js';
8
7
  export * from './LayoutState.js';
9
8
  export * from './ProfileState.js';
@@ -24,6 +24,32 @@ export interface DatalayerJwtPayload {
24
24
  * Returns `null` on any error (malformed token, invalid base64, etc.).
25
25
  */
26
26
  export declare function parseJwtPayload<T = DatalayerJwtPayload>(token: string): T | null;
27
+ /**
28
+ * When a JWT expires, in milliseconds since the epoch.
29
+ *
30
+ * `null` when there is no token, when it cannot be decoded, or when it
31
+ * carries no `exp` — three different unknowns that all mean the same thing to
32
+ * a caller: nothing here says this token has expired.
33
+ */
34
+ export declare function getJwtExpiryMs(token: string | null | undefined): number | null;
35
+ /**
36
+ * Whether a JWT has already expired.
37
+ *
38
+ * Answers `false` for anything it cannot read — a missing token, an opaque
39
+ * one, a payload with no `exp`. This is the only safe direction: a caller
40
+ * uses it to refuse a request before making it, and refusing on a token we
41
+ * failed to parse would break every non-JWT credential the API accepts.
42
+ *
43
+ * Unverified, and deliberately so. The signature is the server's business;
44
+ * what a client can usefully do with `exp` is avoid sending a request whose
45
+ * only possible answer is 401, and tell the person why in the meantime.
46
+ *
47
+ * `leewaySeconds` counts a token as expired slightly early. A request takes
48
+ * time to arrive, so a token with a second left on it is one the server may
49
+ * well reject by the time it reads it — and a typed expiry error is a better
50
+ * answer for the reader than an opaque 401.
51
+ */
52
+ export declare function isJwtExpired(token: string | null | undefined, leewaySeconds?: number): boolean;
27
53
  /**
28
54
  * Extract the Datalayer user object from a JWT, returning `null` if the
29
55
  * token is missing or cannot be decoded.
package/lib/utils/Jwt.js CHANGED
@@ -29,6 +29,43 @@ export function parseJwtPayload(token) {
29
29
  return null;
30
30
  }
31
31
  }
32
+ /**
33
+ * When a JWT expires, in milliseconds since the epoch.
34
+ *
35
+ * `null` when there is no token, when it cannot be decoded, or when it
36
+ * carries no `exp` — three different unknowns that all mean the same thing to
37
+ * a caller: nothing here says this token has expired.
38
+ */
39
+ export function getJwtExpiryMs(token) {
40
+ if (!token)
41
+ return null;
42
+ const payload = parseJwtPayload(token);
43
+ const exp = payload?.exp;
44
+ return typeof exp === 'number' && Number.isFinite(exp) ? exp * 1000 : null;
45
+ }
46
+ /**
47
+ * Whether a JWT has already expired.
48
+ *
49
+ * Answers `false` for anything it cannot read — a missing token, an opaque
50
+ * one, a payload with no `exp`. This is the only safe direction: a caller
51
+ * uses it to refuse a request before making it, and refusing on a token we
52
+ * failed to parse would break every non-JWT credential the API accepts.
53
+ *
54
+ * Unverified, and deliberately so. The signature is the server's business;
55
+ * what a client can usefully do with `exp` is avoid sending a request whose
56
+ * only possible answer is 401, and tell the person why in the meantime.
57
+ *
58
+ * `leewaySeconds` counts a token as expired slightly early. A request takes
59
+ * time to arrive, so a token with a second left on it is one the server may
60
+ * well reject by the time it reads it — and a typed expiry error is a better
61
+ * answer for the reader than an opaque 401.
62
+ */
63
+ export function isJwtExpired(token, leewaySeconds = 0) {
64
+ const expiryMs = getJwtExpiryMs(token);
65
+ if (expiryMs === null)
66
+ return false;
67
+ return expiryMs - leewaySeconds * 1000 <= Date.now();
68
+ }
32
69
  /**
33
70
  * Extract the Datalayer user object from a JWT, returning `null` if the
34
71
  * token is missing or cannot be decoded.
@@ -1,2 +1,2 @@
1
- export declare const WithSuspense: (Component: any, preload?: boolean, skeleton?: boolean) => (props: any) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const WithSuspense: (Component: any, preload?: boolean, skeleton?: boolean) => (props: any) => import("react").JSX.Element;
2
2
  export default WithSuspense;