@datalayer/core 1.0.25 → 1.1.41

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 (339) hide show
  1. package/README.md +14 -26
  2. package/lib/api/index.d.ts +0 -9
  3. package/lib/api/index.js +0 -9
  4. package/lib/cli-login.js +167 -0
  5. package/lib/client/base.d.ts +0 -3
  6. package/lib/client/base.js +0 -2
  7. package/lib/client/index.d.ts +10 -98
  8. package/lib/client/index.js +12 -21
  9. package/lib/components/avatars/UserAvatar.d.ts +16 -0
  10. package/lib/components/avatars/UserAvatar.js +47 -0
  11. package/lib/components/avatars/index.d.ts +1 -0
  12. package/lib/components/avatars/index.js +1 -0
  13. package/lib/components/billing/BillableAccountSelect.js +4 -0
  14. package/lib/components/billing/index.js +4 -0
  15. package/lib/components/context/index.d.ts +0 -1
  16. package/lib/components/context/index.js +0 -1
  17. package/lib/components/display/DisplayHandle.d.ts +12 -0
  18. package/lib/components/display/DisplayHandle.js +11 -0
  19. package/lib/components/display/LiveRelativeTime.js +4 -0
  20. package/lib/components/display/index.d.ts +1 -0
  21. package/lib/components/display/index.js +1 -0
  22. package/lib/components/flashes/index.d.ts +0 -1
  23. package/lib/components/flashes/index.js +0 -1
  24. package/lib/components/index.d.ts +0 -1
  25. package/lib/components/index.js +0 -1
  26. package/lib/components/principal/Principal.d.ts +7 -0
  27. package/lib/components/principal/Principal.js +153 -16
  28. package/lib/components/principal/PrincipalAvatar.d.ts +1 -1
  29. package/lib/components/principal/PrincipalAvatar.js +4 -28
  30. package/lib/components/principal/PrincipalBadge.js +4 -4
  31. package/lib/components/principal/PrincipalDetailsOverlay.d.ts +4 -2
  32. package/lib/components/principal/PrincipalDetailsOverlay.js +27 -7
  33. package/lib/components/principal/PrincipalSwitcherMenu.js +76 -39
  34. package/lib/components/progress/index.d.ts +0 -1
  35. package/lib/components/progress/index.js +0 -1
  36. package/lib/components/sharing/ShareAccessComponent.d.ts +3 -2
  37. package/lib/components/sharing/ShareAccessComponent.js +180 -133
  38. package/lib/components/sharing/SharingEditor.js +4 -0
  39. package/lib/components/snippets/index.d.ts +1 -1
  40. package/lib/components/snippets/index.js +1 -1
  41. package/lib/components/students/StudentResultCircle.d.ts +21 -0
  42. package/lib/components/students/StudentResultCircle.js +59 -0
  43. package/lib/components/students/index.d.ts +1 -1
  44. package/lib/components/students/index.js +1 -1
  45. package/lib/components/time/LiveRelativeTime.js +4 -0
  46. package/lib/components/time/index.js +4 -0
  47. package/lib/components/timeline/index.js +4 -0
  48. package/lib/components/tokens/index.d.ts +1 -1
  49. package/lib/components/tokens/index.js +1 -1
  50. package/lib/components/toolbars/index.d.ts +1 -3
  51. package/lib/components/toolbars/index.js +1 -3
  52. package/lib/hooks/cacheConverters.d.ts +21 -0
  53. package/lib/hooks/cacheConverters.js +110 -0
  54. package/lib/hooks/index.d.ts +0 -2
  55. package/lib/hooks/index.js +0 -2
  56. package/lib/hooks/useCache.d.ts +64 -35
  57. package/lib/hooks/useCache.js +407 -52
  58. package/lib/hooks/useDatalayer.js +3 -1
  59. package/lib/hooks/useIAM.js +1 -3
  60. package/lib/hooks/useLocationHandles.d.ts +3 -1
  61. package/lib/hooks/useLocationHandles.js +2 -1
  62. package/lib/hooks/usePrincipalStore.d.ts +2 -2
  63. package/lib/hooks/usePrincipalStore.js +97 -14
  64. package/lib/hooks/useSelectedPrincipal.js +1 -1
  65. package/lib/hooks/useUser.js +19 -2
  66. package/lib/index.d.ts +1 -6
  67. package/lib/index.js +1 -13
  68. package/lib/main.js +3 -3
  69. package/lib/mocks/index.js +1 -1
  70. package/lib/mocks/models/index.d.ts +0 -1
  71. package/lib/mocks/models/index.js +0 -1
  72. package/lib/models/Datasource.d.ts +2 -2
  73. package/lib/models/IAM.d.ts +1 -1
  74. package/lib/models/School.d.ts +12 -3
  75. package/lib/models/Secret.d.ts +2 -2
  76. package/lib/models/Student.d.ts +13 -3
  77. package/lib/models/Usage.d.ts +11 -1
  78. package/lib/models/UserDTO.d.ts +2 -2
  79. package/lib/models/index.d.ts +0 -30
  80. package/lib/models/index.js +0 -30
  81. package/lib/routes/index.d.ts +1 -0
  82. package/lib/routes/index.js +1 -0
  83. package/lib/routes/publicPaths.d.ts +23 -0
  84. package/lib/routes/publicPaths.js +74 -0
  85. package/lib/state/State.d.ts +0 -12
  86. package/lib/state/State.js +0 -12
  87. package/lib/state/substates/LayoutState.d.ts +12 -1
  88. package/lib/state/substates/index.d.ts +0 -7
  89. package/lib/state/substates/index.js +0 -7
  90. package/lib/utils/Handles.js +3 -1
  91. package/lib/utils/index.d.ts +0 -1
  92. package/lib/utils/index.js +0 -1
  93. package/lib/views/api-keys/APIKeys.js +12 -3
  94. package/lib/views/datasources/DatasourceDetail.d.ts +1 -1
  95. package/lib/views/datasources/DatasourceNew.d.ts +1 -1
  96. package/lib/views/datasources/Datasources.d.ts +1 -1
  97. package/lib/views/datasources/Datasources.js +12 -3
  98. package/lib/views/iam/SignInSimple.d.ts +37 -1
  99. package/lib/views/iam/SignInSimple.js +110 -12
  100. package/package.json +5 -3
  101. package/lib/App.css +0 -47
  102. package/lib/App.d.ts +0 -3
  103. package/lib/App.js +0 -21
  104. package/lib/api/runtimes/checkpoints.d.ts +0 -122
  105. package/lib/api/runtimes/checkpoints.js +0 -118
  106. package/lib/api/runtimes/environments.d.ts +0 -9
  107. package/lib/api/runtimes/environments.js +0 -29
  108. package/lib/api/runtimes/healthz.d.ts +0 -15
  109. package/lib/api/runtimes/healthz.js +0 -44
  110. package/lib/api/runtimes/index.d.ts +0 -12
  111. package/lib/api/runtimes/index.js +0 -16
  112. package/lib/api/runtimes/runtimes.d.ts +0 -138
  113. package/lib/api/runtimes/runtimes.js +0 -230
  114. package/lib/api/runtimes/snapshots.d.ts +0 -38
  115. package/lib/api/runtimes/snapshots.js +0 -82
  116. package/lib/api/scheduler/index.d.ts +0 -6
  117. package/lib/api/scheduler/index.js +0 -10
  118. package/lib/api/scheduler/schedules.d.ts +0 -85
  119. package/lib/api/scheduler/schedules.js +0 -78
  120. package/lib/api/spacer/documents.d.ts +0 -12
  121. package/lib/api/spacer/documents.js +0 -43
  122. package/lib/api/spacer/healthz.d.ts +0 -15
  123. package/lib/api/spacer/healthz.js +0 -44
  124. package/lib/api/spacer/index.d.ts +0 -15
  125. package/lib/api/spacer/index.js +0 -19
  126. package/lib/api/spacer/items.d.ts +0 -25
  127. package/lib/api/spacer/items.js +0 -55
  128. package/lib/api/spacer/lexicals.d.ts +0 -34
  129. package/lib/api/spacer/lexicals.js +0 -89
  130. package/lib/api/spacer/notebooks.d.ts +0 -34
  131. package/lib/api/spacer/notebooks.js +0 -89
  132. package/lib/api/spacer/spaces.d.ts +0 -84
  133. package/lib/api/spacer/spaces.js +0 -170
  134. package/lib/api/spacer/users.d.ts +0 -9
  135. package/lib/api/spacer/users.js +0 -29
  136. package/lib/client/mixins/RuntimesMixin.d.ts +0 -93
  137. package/lib/client/mixins/RuntimesMixin.js +0 -229
  138. package/lib/client/mixins/SpacerMixin.d.ts +0 -210
  139. package/lib/client/mixins/SpacerMixin.js +0 -615
  140. package/lib/client/utils/spacerUtils.d.ts +0 -18
  141. package/lib/client/utils/spacerUtils.js +0 -32
  142. package/lib/collaboration/DatalayerCollaboration.d.ts +0 -13
  143. package/lib/collaboration/DatalayerCollaboration.js +0 -28
  144. package/lib/collaboration/DatalayerCollaborationProvider.d.ts +0 -60
  145. package/lib/collaboration/DatalayerCollaborationProvider.js +0 -163
  146. package/lib/collaboration/index.d.ts +0 -2
  147. package/lib/collaboration/index.js +0 -6
  148. package/lib/components/context/SpaceSelect.d.ts +0 -2
  149. package/lib/components/context/SpaceSelect.js +0 -42
  150. package/lib/components/flashes/FlashDisclaimer.d.ts +0 -2
  151. package/lib/components/flashes/FlashDisclaimer.js +0 -17
  152. package/lib/components/icons/ArtifactIcon.d.ts +0 -10
  153. package/lib/components/icons/ArtifactIcon.js +0 -58
  154. package/lib/components/icons/index.d.ts +0 -1
  155. package/lib/components/icons/index.js +0 -5
  156. package/lib/components/nbgrader/NbGradesDetails.d.ts +0 -5
  157. package/lib/components/nbgrader/NbGradesDetails.js +0 -14
  158. package/lib/components/nbgrader/index.d.ts +0 -1
  159. package/lib/components/nbgrader/index.js +0 -5
  160. package/lib/components/progress/CreditsIndicator.d.ts +0 -33
  161. package/lib/components/progress/CreditsIndicator.js +0 -23
  162. package/lib/components/runtimes/RuntimeCellVariables.d.ts +0 -39
  163. package/lib/components/runtimes/RuntimeCellVariables.js +0 -172
  164. package/lib/components/runtimes/RuntimeCellVariablesDialog.d.ts +0 -37
  165. package/lib/components/runtimes/RuntimeCellVariablesDialog.js +0 -101
  166. package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +0 -57
  167. package/lib/components/runtimes/RuntimeLauncherDialog.js +0 -275
  168. package/lib/components/runtimes/RuntimePickerBase.d.ts +0 -69
  169. package/lib/components/runtimes/RuntimePickerBase.js +0 -122
  170. package/lib/components/runtimes/RuntimePickerCell.d.ts +0 -34
  171. package/lib/components/runtimes/RuntimePickerCell.js +0 -104
  172. package/lib/components/runtimes/RuntimePickerNotebook.d.ts +0 -42
  173. package/lib/components/runtimes/RuntimePickerNotebook.js +0 -232
  174. package/lib/components/runtimes/RuntimeReservationControl.d.ts +0 -47
  175. package/lib/components/runtimes/RuntimeReservationControl.js +0 -42
  176. package/lib/components/runtimes/RuntimeSimplePicker.d.ts +0 -38
  177. package/lib/components/runtimes/RuntimeSimplePicker.js +0 -155
  178. package/lib/components/runtimes/RuntimeTransfer.d.ts +0 -16
  179. package/lib/components/runtimes/RuntimeTransfer.js +0 -5
  180. package/lib/components/runtimes/RuntimeUtils.d.ts +0 -17
  181. package/lib/components/runtimes/RuntimeUtils.js +0 -178
  182. package/lib/components/runtimes/RuntimeVariables.d.ts +0 -38
  183. package/lib/components/runtimes/RuntimeVariables.js +0 -75
  184. package/lib/components/runtimes/index.d.ts +0 -11
  185. package/lib/components/runtimes/index.js +0 -15
  186. package/lib/components/scheduler/ScheduleMenu.d.ts +0 -54
  187. package/lib/components/scheduler/ScheduleMenu.js +0 -154
  188. package/lib/components/scheduler/index.d.ts +0 -1
  189. package/lib/components/scheduler/index.js +0 -5
  190. package/lib/components/snapshots/SandboxSnapshotMenu.d.ts +0 -33
  191. package/lib/components/snapshots/SandboxSnapshotMenu.js +0 -169
  192. package/lib/components/snapshots/index.d.ts +0 -1
  193. package/lib/components/snapshots/index.js +0 -5
  194. package/lib/components/snippets/SnippetDialog.d.ts +0 -42
  195. package/lib/components/snippets/SnippetDialog.js +0 -42
  196. package/lib/components/students/StudentItemStatus.d.ts +0 -7
  197. package/lib/components/students/StudentItemStatus.js +0 -66
  198. package/lib/components/tokens/SpaceVariantToken.d.ts +0 -5
  199. package/lib/components/tokens/SpaceVariantToken.js +0 -23
  200. package/lib/components/toolbars/AssignmentEditorToolbar.d.ts +0 -4
  201. package/lib/components/toolbars/AssignmentEditorToolbar.js +0 -18
  202. package/lib/components/toolbars/DocumentEditorToolbar.d.ts +0 -2
  203. package/lib/components/toolbars/DocumentEditorToolbar.js +0 -12
  204. package/lib/components/toolbars/NotebookEditorToolbar.d.ts +0 -29
  205. package/lib/components/toolbars/NotebookEditorToolbar.js +0 -30
  206. package/lib/examples/CellExample.d.ts +0 -6
  207. package/lib/examples/CellExample.js +0 -20
  208. package/lib/examples/NotebookExample.d.ts +0 -6
  209. package/lib/examples/NotebookExample.js +0 -19
  210. package/lib/examples/lexical-theme.css +0 -436
  211. package/lib/examples/notebooks/IPyWidgetsExample.ipynb.json +0 -101
  212. package/lib/examples/notebooks/IPyWidgetsExampleWithState.ipynb.json +0 -112
  213. package/lib/examples/notebooks/Lite.ipynb.json +0 -128
  214. package/lib/examples/notebooks/Matplotlib.ipynb.json +0 -137
  215. package/lib/examples/notebooks/NotebookExample1.ipynb.json +0 -126
  216. package/lib/examples/notebooks/NotebookExample2.ipynb.json +0 -48
  217. package/lib/examples/notebooks/NotebookOutputs.ipynb.json +0 -49
  218. package/lib/examples/notebooks/NotebookToCExample.ipynb.json +0 -102
  219. package/lib/examples/notebooks/PyGWalker.ipynb.json +0 -55
  220. package/lib/hooks/useCellOutputshot.d.ts +0 -4
  221. package/lib/hooks/useCellOutputshot.js +0 -25
  222. package/lib/hooks/useProjects.d.ts +0 -628
  223. package/lib/hooks/useProjects.js +0 -190
  224. package/lib/hooks/useRuntimes.d.ts +0 -5
  225. package/lib/hooks/useRuntimes.js +0 -34
  226. package/lib/mocks/jupyter/index.js +0 -5
  227. package/lib/mocks/models/CourseMock.d.ts +0 -6
  228. package/lib/mocks/models/CourseMock.js +0 -29
  229. package/lib/mocks/models/SpaceMock.d.ts +0 -6
  230. package/lib/mocks/models/SpaceMock.js +0 -25
  231. package/lib/models/Assignment.d.ts +0 -7
  232. package/lib/models/Assignment.js +0 -5
  233. package/lib/models/Cell.d.ts +0 -8
  234. package/lib/models/Cell.js +0 -5
  235. package/lib/models/CodeBlock.d.ts +0 -10
  236. package/lib/models/CodeBlock.js +0 -5
  237. package/lib/models/CodeSandboxSnapshot.d.ts +0 -92
  238. package/lib/models/CodeSandboxSnapshot.js +0 -13
  239. package/lib/models/CodeSandboxSnapshotDTO.d.ts +0 -173
  240. package/lib/models/CodeSandboxSnapshotDTO.js +0 -139
  241. package/lib/models/CodefeedBlocks.d.ts +0 -7
  242. package/lib/models/CodefeedBlocks.js +0 -5
  243. package/lib/models/Content.d.ts +0 -5
  244. package/lib/models/Content.js +0 -5
  245. package/lib/models/Course.d.ts +0 -17
  246. package/lib/models/Course.js +0 -5
  247. package/lib/models/Dataset.d.ts +0 -16
  248. package/lib/models/Dataset.js +0 -5
  249. package/lib/models/Document.d.ts +0 -8
  250. package/lib/models/Document.js +0 -5
  251. package/lib/models/Environment.d.ts +0 -86
  252. package/lib/models/Environment.js +0 -5
  253. package/lib/models/EnvironmentDTO.d.ts +0 -125
  254. package/lib/models/EnvironmentDTO.js +0 -88
  255. package/lib/models/Exercise.d.ts +0 -16
  256. package/lib/models/Exercise.js +0 -5
  257. package/lib/models/Item.d.ts +0 -20
  258. package/lib/models/Item.js +0 -5
  259. package/lib/models/ItemDTO.d.ts +0 -74
  260. package/lib/models/ItemDTO.js +0 -186
  261. package/lib/models/ItemType.d.ts +0 -2
  262. package/lib/models/ItemType.js +0 -5
  263. package/lib/models/Lesson.d.ts +0 -5
  264. package/lib/models/Lesson.js +0 -5
  265. package/lib/models/LexicalDTO.d.ts +0 -155
  266. package/lib/models/LexicalDTO.js +0 -157
  267. package/lib/models/Library.d.ts +0 -10
  268. package/lib/models/Library.js +0 -5
  269. package/lib/models/Notebook.d.ts +0 -11
  270. package/lib/models/Notebook.js +0 -5
  271. package/lib/models/NotebookDTO.d.ts +0 -96
  272. package/lib/models/NotebookDTO.js +0 -153
  273. package/lib/models/Page.d.ts +0 -41
  274. package/lib/models/Page.js +0 -25
  275. package/lib/models/PageTag.d.ts +0 -19
  276. package/lib/models/PageTag.js +0 -94
  277. package/lib/models/ProjectDTO.d.ts +0 -89
  278. package/lib/models/ProjectDTO.js +0 -131
  279. package/lib/models/Runtime.d.ts +0 -123
  280. package/lib/models/Runtime.js +0 -18
  281. package/lib/models/RuntimeDTO.d.ts +0 -191
  282. package/lib/models/RuntimeDTO.js +0 -204
  283. package/lib/models/Space.d.ts +0 -35
  284. package/lib/models/Space.js +0 -66
  285. package/lib/models/SpaceDTO.d.ts +0 -334
  286. package/lib/models/SpaceDTO.js +0 -244
  287. package/lib/models/SpaceItem.d.ts +0 -10
  288. package/lib/models/SpaceItem.js +0 -5
  289. package/lib/models/SpaceMember.d.ts +0 -6
  290. package/lib/models/SpaceMember.js +0 -5
  291. package/lib/models/StudentItem.d.ts +0 -21
  292. package/lib/models/StudentItem.js +0 -5
  293. package/lib/services/DatalayerServiceManager.d.ts +0 -22
  294. package/lib/services/DatalayerServiceManager.js +0 -69
  295. package/lib/services/index.d.ts +0 -4
  296. package/lib/services/index.js +0 -7
  297. package/lib/services/reconnectToRuntime.d.ts +0 -32
  298. package/lib/services/reconnectToRuntime.js +0 -59
  299. package/lib/state/substates/CellState.d.ts +0 -12
  300. package/lib/state/substates/CellState.js +0 -22
  301. package/lib/state/substates/DocumentState.d.ts +0 -10
  302. package/lib/state/substates/DocumentState.js +0 -14
  303. package/lib/state/substates/GradeState.d.ts +0 -10
  304. package/lib/state/substates/GradeState.js +0 -14
  305. package/lib/state/substates/JupyterLabState.d.ts +0 -16
  306. package/lib/state/substates/JupyterLabState.js +0 -17
  307. package/lib/state/substates/NbformatState.d.ts +0 -13
  308. package/lib/state/substates/NbformatState.js +0 -16
  309. package/lib/state/substates/RuntimesState.d.ts +0 -79
  310. package/lib/state/substates/RuntimesState.js +0 -180
  311. package/lib/state/substates/SpaceState.d.ts +0 -11
  312. package/lib/state/substates/SpaceState.js +0 -16
  313. package/lib/stateful/index.d.ts +0 -2
  314. package/lib/stateful/index.js +0 -6
  315. package/lib/stateful/jupyter/exec/Python.d.ts +0 -5
  316. package/lib/stateful/jupyter/exec/Python.js +0 -100
  317. package/lib/stateful/jupyter/exec/Snippets.d.ts +0 -105
  318. package/lib/stateful/jupyter/exec/Snippets.js +0 -101
  319. package/lib/stateful/jupyter/exec/index.d.ts +0 -2
  320. package/lib/stateful/jupyter/exec/index.js +0 -6
  321. package/lib/stateful/jupyter/index.d.ts +0 -2
  322. package/lib/stateful/jupyter/index.js +0 -6
  323. package/lib/stateful/jupyter/kernelsHandler.d.ts +0 -8
  324. package/lib/stateful/jupyter/kernelsHandler.js +0 -39
  325. package/lib/stateful/runtimes/actions.d.ts +0 -102
  326. package/lib/stateful/runtimes/actions.js +0 -249
  327. package/lib/stateful/runtimes/apis.d.ts +0 -273
  328. package/lib/stateful/runtimes/apis.js +0 -5
  329. package/lib/stateful/runtimes/index.d.ts +0 -5
  330. package/lib/stateful/runtimes/index.js +0 -9
  331. package/lib/stateful/runtimes/settings.d.ts +0 -15
  332. package/lib/stateful/runtimes/settings.js +0 -31
  333. package/lib/stateful/runtimes/snapshots.d.ts +0 -25
  334. package/lib/stateful/runtimes/snapshots.js +0 -150
  335. package/lib/stateful/runtimes/utils.d.ts +0 -7
  336. package/lib/stateful/runtimes/utils.js +0 -14
  337. package/lib/utils/Cells.d.ts +0 -2
  338. package/lib/utils/Cells.js +0 -28
  339. /package/lib/{mocks/jupyter/index.d.ts → cli-login.d.ts} +0 -0
@@ -8,6 +8,7 @@ import { useToast } from './useToast.js';
8
8
  // import { useRuMnock } from './../mocks/index.js';
9
9
  import { useIAMStore } from '../state/index.js';
10
10
  import { requestDatalayerAPI } from '../api/DatalayerApi.js';
11
+ import { isPublicPath } from '../routes/publicPaths.js';
11
12
  export function useDatalayer(props = {}) {
12
13
  const { loginRoute = '/login', notifyOnError = true } = props;
13
14
  const location = useLocation();
@@ -56,9 +57,10 @@ export function useDatalayer(props = {}) {
56
57
  if (responseError.response.status === 401) {
57
58
  console.log('Datalayer sent a 401 return code.');
58
59
  const resolvedLoginRoute = resolveLoginRoute(loginRoute_);
60
+ const isPublicRoute = isPublicPath(location.pathname || '');
59
61
  const alreadyOnLoginRoute = location.pathname === resolvedLoginRoute ||
60
62
  location.pathname.endsWith('/login');
61
- if (!alreadyOnLoginRoute) {
63
+ if (!alreadyOnLoginRoute && !isPublicRoute) {
62
64
  iamStore.logout();
63
65
  navigate(resolvedLoginRoute);
64
66
  }
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { useEffect, useState } from 'react';
6
6
  import { useCache } from './useCache.js';
7
- import { useIAMStore, useLayoutStore, useOrganizationStore, useSpaceStore, } from '../state/index.js';
7
+ import { useIAMStore, useLayoutStore, useOrganizationStore, } from '../state/index.js';
8
8
  import { asUser, ANONYMOUS_USER, ANONYMOUS_USER_TOKEN, } from '../models/index.js';
9
9
  import { requestDatalayerAPI, } from '../api/DatalayerApi.js';
10
10
  export const useIAM = (props = { user: undefined, token: undefined }) => {
@@ -13,7 +13,6 @@ export const useIAM = (props = { user: undefined, token: undefined }) => {
13
13
  const iamStore = useIAMStore();
14
14
  const layoutStore = useLayoutStore();
15
15
  const organizationStore = useOrganizationStore();
16
- const spaceStore = useSpaceStore();
17
16
  const { useWhoami, useLogout } = useCache();
18
17
  const { data: whoamiData } = useWhoami();
19
18
  const logoutMutation = useLogout();
@@ -61,7 +60,6 @@ export const useIAM = (props = { user: undefined, token: undefined }) => {
61
60
  iamStore.logout();
62
61
  layoutStore.reset();
63
62
  organizationStore.updateOrganizations([]);
64
- spaceStore.updateSpaces([]);
65
63
  // Call TanStack Query logout mutation which will clear all caches
66
64
  logoutMutation.mutate();
67
65
  setIAMState({ user: ANONYMOUS_USER, token: ANONYMOUS_USER_TOKEN });
@@ -1,9 +1,11 @@
1
1
  export declare const useLocationHandles: () => {
2
2
  accountHandle: string | undefined;
3
- spaceHandler: string | undefined;
3
+ spaceHandler: any;
4
+ teamHandle?: undefined;
4
5
  spaceHandle?: undefined;
5
6
  } | {
6
7
  accountHandle: string;
8
+ teamHandle: string;
7
9
  spaceHandle: string;
8
10
  spaceHandler?: undefined;
9
11
  };
@@ -7,7 +7,7 @@ import { useParams } from './useParams.js';
7
7
  import { useRunStore } from '../state/index.js';
8
8
  export const useLocationHandles = () => {
9
9
  const params = useParams();
10
- const { accountHandle, spaceHandle } = params;
10
+ const { accountHandle, teamHandle, spaceHandle } = params;
11
11
  const { pathname } = useLocation();
12
12
  const runStore = useRunStore();
13
13
  if (pathname.startsWith('/public')) {
@@ -18,6 +18,7 @@ export const useLocationHandles = () => {
18
18
  }
19
19
  return {
20
20
  accountHandle,
21
+ teamHandle,
21
22
  spaceHandle,
22
23
  };
23
24
  };
@@ -5,7 +5,7 @@
5
5
  * and sharing of artifacts. Only user / organization / team are principals.
6
6
  * Agents are NOT principals (an agent is owned by an account).
7
7
  */
8
- export type PrincipalKind = 'user' | 'organization' | 'team';
8
+ export type PrincipalKind = 'personal' | 'organization' | 'team';
9
9
  export type PrincipalState = {
10
10
  /** Kind of the currently selected principal. */
11
11
  selectedPrincipalKind: PrincipalKind;
@@ -17,7 +17,7 @@ export type PrincipalState = {
17
17
  selectedTeamParentOrganizationUid?: string;
18
18
  /** Parent organization handle — set only when `selectedPrincipalKind === 'team'`. */
19
19
  selectedTeamParentOrganizationHandle?: string;
20
- selectUserPrincipal: (uid: string, handle: string) => void;
20
+ selectPersonalPrincipal: (uid: string, handle: string) => void;
21
21
  selectOrganizationPrincipal: (uid: string, handle: string) => void;
22
22
  selectTeamPrincipal: (args: {
23
23
  teamUid: string;
@@ -5,14 +5,73 @@
5
5
  import { create } from 'zustand';
6
6
  import { createJSONStorage, persist } from 'zustand/middleware';
7
7
  import { useUsageRefreshStore } from './useUsageRefreshStore.js';
8
+ const PRINCIPAL_CONTEXT_COOKIE = 'datalayer-principal-context';
9
+ const PRINCIPAL_CONTEXT_COOKIE_MAX_AGE = 60 * 60 * 24 * 365;
10
+ const readPrincipalContextCookie = () => {
11
+ if (typeof document === 'undefined') {
12
+ return {};
13
+ }
14
+ const escaped = PRINCIPAL_CONTEXT_COOKIE.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
15
+ const match = document.cookie.match(new RegExp(`(?:^|;\\s*)${escaped}=([^;]*)`));
16
+ if (!match?.[1]) {
17
+ return {};
18
+ }
19
+ try {
20
+ const parsed = JSON.parse(decodeURIComponent(match[1]));
21
+ if (!parsed || typeof parsed !== 'object') {
22
+ return {};
23
+ }
24
+ const kind = parsed.selectedPrincipalKind === 'organization' ||
25
+ parsed.selectedPrincipalKind === 'team' ||
26
+ parsed.selectedPrincipalKind === 'personal'
27
+ ? parsed.selectedPrincipalKind
28
+ : undefined;
29
+ return {
30
+ selectedPrincipalKind: kind,
31
+ selectedPrincipalUid: typeof parsed.selectedPrincipalUid === 'string'
32
+ ? parsed.selectedPrincipalUid
33
+ : undefined,
34
+ selectedPrincipalHandle: typeof parsed.selectedPrincipalHandle === 'string'
35
+ ? parsed.selectedPrincipalHandle
36
+ : undefined,
37
+ selectedTeamParentOrganizationUid: typeof parsed.selectedTeamParentOrganizationUid === 'string'
38
+ ? parsed.selectedTeamParentOrganizationUid
39
+ : undefined,
40
+ selectedTeamParentOrganizationHandle: typeof parsed.selectedTeamParentOrganizationHandle === 'string'
41
+ ? parsed.selectedTeamParentOrganizationHandle
42
+ : undefined,
43
+ };
44
+ }
45
+ catch {
46
+ return {};
47
+ }
48
+ };
49
+ const writePrincipalContextCookie = (context) => {
50
+ if (typeof document === 'undefined') {
51
+ return;
52
+ }
53
+ const value = encodeURIComponent(JSON.stringify(context));
54
+ document.cookie =
55
+ `${PRINCIPAL_CONTEXT_COOKIE}=${value};` +
56
+ ` path=/; max-age=${PRINCIPAL_CONTEXT_COOKIE_MAX_AGE}; SameSite=Lax`;
57
+ };
58
+ const clearPrincipalContextCookie = () => {
59
+ if (typeof document === 'undefined') {
60
+ return;
61
+ }
62
+ document.cookie =
63
+ `${PRINCIPAL_CONTEXT_COOKIE}=;` +
64
+ ' path=/; max-age=0; SameSite=Lax';
65
+ };
66
+ const initialPrincipalContext = readPrincipalContextCookie();
8
67
  export const usePrincipalStore = create()(persist(set => ({
9
- selectedPrincipalKind: 'user',
10
- selectedPrincipalUid: undefined,
11
- selectedPrincipalHandle: undefined,
12
- selectedTeamParentOrganizationUid: undefined,
13
- selectedTeamParentOrganizationHandle: undefined,
14
- selectUserPrincipal: (uid, handle) => set(state => {
15
- const unchanged = state.selectedPrincipalKind === 'user' &&
68
+ selectedPrincipalKind: initialPrincipalContext.selectedPrincipalKind || 'personal',
69
+ selectedPrincipalUid: initialPrincipalContext.selectedPrincipalUid,
70
+ selectedPrincipalHandle: initialPrincipalContext.selectedPrincipalHandle,
71
+ selectedTeamParentOrganizationUid: initialPrincipalContext.selectedTeamParentOrganizationUid,
72
+ selectedTeamParentOrganizationHandle: initialPrincipalContext.selectedTeamParentOrganizationHandle,
73
+ selectPersonalPrincipal: (uid, handle) => set(state => {
74
+ const unchanged = state.selectedPrincipalKind === 'personal' &&
16
75
  state.selectedPrincipalUid === uid &&
17
76
  state.selectedPrincipalHandle === handle;
18
77
  if (unchanged) {
@@ -21,13 +80,15 @@ export const usePrincipalStore = create()(persist(set => ({
21
80
  useUsageRefreshStore
22
81
  .getState()
23
82
  .requestUsageRefresh('principal-user-changed');
24
- return {
25
- selectedPrincipalKind: 'user',
83
+ const nextState = {
84
+ selectedPrincipalKind: 'personal',
26
85
  selectedPrincipalUid: uid,
27
86
  selectedPrincipalHandle: handle,
28
87
  selectedTeamParentOrganizationUid: undefined,
29
88
  selectedTeamParentOrganizationHandle: undefined,
30
89
  };
90
+ writePrincipalContextCookie(nextState);
91
+ return nextState;
31
92
  }),
32
93
  selectOrganizationPrincipal: (uid, handle) => set(state => {
33
94
  const unchanged = state.selectedPrincipalKind === 'organization' &&
@@ -39,13 +100,15 @@ export const usePrincipalStore = create()(persist(set => ({
39
100
  useUsageRefreshStore
40
101
  .getState()
41
102
  .requestUsageRefresh('principal-organization-changed');
42
- return {
103
+ const nextState = {
43
104
  selectedPrincipalKind: 'organization',
44
105
  selectedPrincipalUid: uid,
45
106
  selectedPrincipalHandle: handle,
46
107
  selectedTeamParentOrganizationUid: undefined,
47
108
  selectedTeamParentOrganizationHandle: undefined,
48
109
  };
110
+ writePrincipalContextCookie(nextState);
111
+ return nextState;
49
112
  }),
50
113
  selectTeamPrincipal: ({ teamUid, teamHandle, organizationUid, organizationHandle, }) => set(state => {
51
114
  const unchanged = state.selectedPrincipalKind === 'team' &&
@@ -59,16 +122,18 @@ export const usePrincipalStore = create()(persist(set => ({
59
122
  useUsageRefreshStore
60
123
  .getState()
61
124
  .requestUsageRefresh('principal-team-changed');
62
- return {
125
+ const nextState = {
63
126
  selectedPrincipalKind: 'team',
64
127
  selectedPrincipalUid: teamUid,
65
128
  selectedPrincipalHandle: teamHandle,
66
129
  selectedTeamParentOrganizationUid: organizationUid,
67
130
  selectedTeamParentOrganizationHandle: organizationHandle,
68
131
  };
132
+ writePrincipalContextCookie(nextState);
133
+ return nextState;
69
134
  }),
70
135
  resetPrincipal: () => set(state => {
71
- const unchanged = state.selectedPrincipalKind === 'user' &&
136
+ const unchanged = state.selectedPrincipalKind === 'personal' &&
72
137
  state.selectedPrincipalUid === undefined &&
73
138
  state.selectedPrincipalHandle === undefined &&
74
139
  state.selectedTeamParentOrganizationUid === undefined &&
@@ -79,13 +144,15 @@ export const usePrincipalStore = create()(persist(set => ({
79
144
  useUsageRefreshStore
80
145
  .getState()
81
146
  .requestUsageRefresh('principal-reset');
82
- return {
83
- selectedPrincipalKind: 'user',
147
+ const nextState = {
148
+ selectedPrincipalKind: 'personal',
84
149
  selectedPrincipalUid: undefined,
85
150
  selectedPrincipalHandle: undefined,
86
151
  selectedTeamParentOrganizationUid: undefined,
87
152
  selectedTeamParentOrganizationHandle: undefined,
88
153
  };
154
+ clearPrincipalContextCookie();
155
+ return nextState;
89
156
  }),
90
157
  }), {
91
158
  name: 'datalayer-principal',
@@ -97,5 +164,21 @@ export const usePrincipalStore = create()(persist(set => ({
97
164
  selectedTeamParentOrganizationUid: state.selectedTeamParentOrganizationUid,
98
165
  selectedTeamParentOrganizationHandle: state.selectedTeamParentOrganizationHandle,
99
166
  }),
167
+ onRehydrateStorage: () => state => {
168
+ if (!state) {
169
+ return;
170
+ }
171
+ if (state.selectedPrincipalKind === 'personal' && !state.selectedPrincipalUid) {
172
+ clearPrincipalContextCookie();
173
+ return;
174
+ }
175
+ writePrincipalContextCookie({
176
+ selectedPrincipalKind: state.selectedPrincipalKind,
177
+ selectedPrincipalUid: state.selectedPrincipalUid,
178
+ selectedPrincipalHandle: state.selectedPrincipalHandle,
179
+ selectedTeamParentOrganizationUid: state.selectedTeamParentOrganizationUid,
180
+ selectedTeamParentOrganizationHandle: state.selectedTeamParentOrganizationHandle,
181
+ });
182
+ },
100
183
  }));
101
184
  export default usePrincipalStore;
@@ -21,7 +21,7 @@ export function useSelectedPrincipal() {
21
21
  selectedPrincipalHandle,
22
22
  selectedTeamParentOrganizationUid,
23
23
  selectedTeamParentOrganizationHandle,
24
- isUserSelected: selectedPrincipalKind === 'user',
24
+ isUserSelected: selectedPrincipalKind === 'personal',
25
25
  isOrganizationSelected: selectedPrincipalKind === 'organization',
26
26
  isTeamSelected: selectedPrincipalKind === 'team',
27
27
  };
@@ -3,18 +3,35 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { useIAMStore } from '../state/index.js';
6
+ import { isPublicPath } from '../routes/publicPaths.js';
6
7
  const LOGIN_HREF = '/login';
8
+ /**
9
+ * Whether the browser is currently on a public route where anonymous users are
10
+ * allowed, so `useUser` must NOT force a navigation to the login page.
11
+ */
12
+ const isOnPublicPath = () => {
13
+ if (typeof window === 'undefined') {
14
+ return false;
15
+ }
16
+ return isPublicPath(window.location?.pathname || '');
17
+ };
7
18
  export const useUser = (role) => {
8
19
  const { user } = useIAMStore();
9
20
  if (role) {
10
21
  if (!user?.roles.includes(role.handle)) {
11
- console.log(`User should have role ${role.handle} - Forcing navigation to login page...`);
22
+ if (isOnPublicPath()) {
23
+ return user;
24
+ }
25
+ console.warn(`User should have role ${role.handle} - Forcing navigation to login page...`);
12
26
  window.location.href = LOGIN_HREF;
13
27
  throw new Error(`User should have role ${role.handle}`);
14
28
  }
15
29
  }
16
30
  if (!user) {
17
- console.log('No user found... Forcing navigation to /login');
31
+ if (isOnPublicPath()) {
32
+ return user;
33
+ }
34
+ console.warn('No user found... Forcing navigation to /login');
18
35
  window.location.href = LOGIN_HREF;
19
36
  }
20
37
  return user;
package/lib/index.d.ts CHANGED
@@ -1,17 +1,12 @@
1
1
  export * from './components';
2
2
  export * from './utils';
3
3
  export * from './state';
4
- export * from './collaboration';
5
- export * from './services';
6
4
  export * from './navigation';
7
5
  export * from './hooks';
8
6
  export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi';
9
7
  export type { IRequestDatalayerAPIOptions } from './api/DatalayerApi';
10
8
  export { API_BASE_PATHS } from './api/constants';
11
- export * as runtimesApi from './api/runtimes';
12
9
  export * as iamApi from './api/iam';
13
- export * as spacerApi from './api/spacer';
14
- export { DatalayerClient, type DatalayerClientConfig, type ClientHandlers, User, Runtime, Environment, Snapshot, Space, Project, Notebook, LexicalDTO, Secret, Credits, Item, type RuntimeJSON, type EnvironmentJSON, type UserJSON, type RuntimeData, type EnvironmentData, type UserData, type SpaceData, type SpaceItem, type NotebookData, type LexicalData, type CodeSandboxSnapshotData, type CreditsInfo, type CreditReservation, type CreateRuntimeRequest, type CreateRuntimeResponse, type ListRuntimesResponse, type ListEnvironmentsResponse, type CreateCodeSandboxSnapshotRequest, type CreateCodeSandboxSnapshotResponse, type GetCodeSandboxSnapshotResponse, type ListCodeSandboxSnapshotsResponse, type CreateSpaceRequest, type CreateSpaceResponse, type SpacesForUserResponse, type CollaborationSessionResponse, type DeleteSpaceItemResponse, type GetSpaceItemResponse, type GetSpaceItemsResponse, type CreateNotebookRequest, type CreateNotebookResponse, type GetNotebookResponse, type UpdateNotebookRequest, type UpdateNotebookResponse, type CreateLexicalRequest, type CreateLexicalResponse, type GetLexicalResponse, type UpdateLexicalRequest, type UpdateLexicalResponse, type CreditsResponse, type CreateDatasourceResponse, type GetDatasourceResponse, type ListDatasourcesResponse, type UpdateDatasourceResponse, type CreateSecretRequest, type CreateSecretResponse, type GetSecretResponse, type ListSecretsResponse, type UpdateSecretRequest, type UpdateSecretResponse, type SpaceJSON, type ProjectJSON, type ProjectDefaultItems, type UpdateSpaceRequest, type GetSpaceResponse, type UpdateSpaceResponse, type DeleteSpaceResponse, type GetSpaceDefaultItemsResponse, type GetSpacesByTypeResponse, type NotebookJSON, type LexicalJSON, type CodeSandboxSnapshotJSON, HealthCheck, type HealthCheckJSON, type LoginRequest, type LoginResponse, type UserMeResponse, type MembershipsResponse, type WhoAmIResponse, type HealthzPingResponse, AuthenticationManager, type IUser, type IBaseUser, type ICell, type IDatasource, type IDatasourceVariant, type ICredits, type ICreditsReservation, type ISpaceItem, type ISurvey, type ISpace, type IBaseSpace, type IAnySpace, type ISpaceVariant, type IBaseTeam, type IAnyTeam, type IOrganization, type IAnyOrganization, type IBaseOrganization, type IRuntimeModel, type IRuntimePod, type IRuntimeType, type IRuntimeLocation, type IRuntimeCapabilities, type ICodeSandboxSnapshot, type IDatalayerEnvironment, type IResources, type ISnippet, type IRole, type IAssignment, type IContact, type ICourse, type IOrganizationMember, type IPage, type PageTagName, type PageTheme, type PageVariant, type ISecret, type ISecretVariant, type SecretData, type SecretJSON, type DatasourceData, type DatasourceJSON, type DatasourceType, type CreateDatasourceRequest, type UpdateDatasourceRequest, Datasource, type IIAMToken, type IIAMTokenVariant, type IDocument, type IBaseDocument, type IEnvironment, type IExercise, type ICode, type IHelp, type IInvite, type ILesson, type INotebook, type IBaseNotebook, type ISchool, type ITeam, type TeamMember, type IUserOnboarding, type IClient, type IOnboardingPosition, type IOnboardingTours, type ITour, type ITourStatus, type IUserSettings, type IDataset, type IUsage, type IItem, type IItemType, type Member, type Profile, type SpaceMember, type IContactEvent, type IContactIAMProvider, type IStudentItem, type Instructor, type IStudent, type IDean, type IUserEvent, type IIAMProviderLinked, type IContent, type AuthResult, type TokenValidationResult, type AuthOptions, type TokenStorage, type IRuntimeOptions, type IMultiServiceManager, type IRemoteServicesManager, type IEnvironmentsManager, type IRemoteRuntimesManager, type NavigationLinkProps, type IDatalayerCoreConfig, type IRuntimesConfiguration, type IIAMProviderName, } from './client';
15
- export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getSandboxSnapshots, loadSandboxSnapshot, } from './stateful/runtimes/actions';
10
+ export * from './client';
16
11
  export * from './otel';
17
12
  export * from './views';
package/lib/index.js CHANGED
@@ -6,26 +6,14 @@
6
6
  export * from './components/index.js';
7
7
  export * from './utils/index.js';
8
8
  export * from './state/index.js';
9
- export * from './collaboration/index.js';
10
- export * from './services/index.js';
11
9
  // Export navigation before hooks to avoid conflicts
12
10
  export * from './navigation/index.js';
13
11
  export * from './hooks/index.js';
14
12
  // Export APIs.
15
13
  export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi.js';
16
14
  export { API_BASE_PATHS } from './api/constants.js';
17
- export * as runtimesApi from './api/runtimes/index.js';
18
15
  export * as iamApi from './api/iam/index.js';
19
- export * as spacerApi from './api/spacer/index.js';
20
- export {
21
- // Export client and config types
22
- DatalayerClient,
23
- // Export domain models
24
- User, Runtime, Environment, Snapshot, Space, Project, Notebook, LexicalDTO, Secret, Credits, Item, HealthCheck,
25
- // Export auth
26
- AuthenticationManager, Datasource, } from './client/index.js';
27
- // Export commonly used functions directly for convenience
28
- export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getSandboxSnapshots, loadSandboxSnapshot, } from './stateful/runtimes/actions.js';
16
+ export * from './client/index.js';
29
17
  // OTEL observability components, hooks, and types
30
18
  export * from './otel/index.js';
31
19
  // Reusable views (sign-in pages, etc.)
package/lib/main.js CHANGED
@@ -1,12 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  /*
3
3
  * Copyright (c) 2023-2025 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { createRoot } from 'react-dom/client';
7
- import App from './App.js';
7
+ // import App from './App.js';
8
8
  import './index.css';
9
9
  const rootElement = document.getElementById('root');
10
10
  if (rootElement) {
11
- createRoot(rootElement).render(_jsx(App, {}));
11
+ createRoot(rootElement).render(_jsx(_Fragment, {}));
12
12
  }
@@ -4,6 +4,6 @@
4
4
  */
5
5
  export * from './components/index.js';
6
6
  export * from './hooks/index.js';
7
- // export * from './jupyter/index.js';
7
+ // export * from './jupyter.js';
8
8
  export * from './models/index.js';
9
9
  export * from './views/index.js';
@@ -4,6 +4,5 @@ export * from './InviteMock';
4
4
  export * from './JupyterLabUserMock';
5
5
  export * from './OrganisationMock';
6
6
  export * from './SchoolMock';
7
- export * from './SpaceMock';
8
7
  export * from './TeamMock';
9
8
  export * from './UserMock';
@@ -8,6 +8,5 @@ export * from './InviteMock.js';
8
8
  export * from './JupyterLabUserMock.js';
9
9
  export * from './OrganisationMock.js';
10
10
  export * from './SchoolMock.js';
11
- export * from './SpaceMock.js';
12
11
  export * from './TeamMock.js';
13
12
  export * from './UserMock.js';
@@ -9,7 +9,7 @@ export type IDatasource = {
9
9
  outputBucket: string;
10
10
  };
11
11
  export default IDatasource;
12
- import type { DatalayerClient } from '../client';
12
+ import type { DatalayerCoreClient } from '../client';
13
13
  /**
14
14
  * Datasource type matching UI and API.
15
15
  */
@@ -148,7 +148,7 @@ export declare class DatasourceDTO {
148
148
  * @param data - Datasource data from API
149
149
  * @param client - Client instance
150
150
  */
151
- constructor(data: DatasourceData, client: DatalayerClient);
151
+ constructor(data: DatasourceData, client: DatalayerCoreClient);
152
152
  private _checkDeleted;
153
153
  get uid(): string;
154
154
  get type(): DatasourceType;
@@ -120,7 +120,7 @@ export interface MembershipsResponse {
120
120
  * user can share artifacts with.
121
121
  */
122
122
  export interface ShareablePrincipal {
123
- kind: 'user' | 'organization' | 'team';
123
+ kind: 'personal' | 'organization' | 'team';
124
124
  uid: string;
125
125
  handle: string;
126
126
  name?: string | null;
@@ -1,11 +1,20 @@
1
1
  import { IDean } from './Dean';
2
2
  import { IStudent } from './Student';
3
- import { ICourse } from './Course';
4
3
  import { IBaseOrganization } from './Organization';
5
- export type ISchool = IBaseOrganization & {
4
+ /**
5
+ * A school organization.
6
+ *
7
+ * The `courses` field is generic over the course type. The concrete course
8
+ * model lives in the runtime/content package (`@datalayer/agent-runtimes`),
9
+ * so consumers that need the rich `ICourse` shape parameterize this type; the
10
+ * core package intentionally does not depend on the content models.
11
+ *
12
+ * @typeParam C - The course type carried by the `courses` array.
13
+ */
14
+ export type ISchool<C = unknown> = IBaseOrganization & {
6
15
  type: 'school';
7
16
  dean?: IDean;
8
17
  students: Array<IStudent>;
9
- courses: Array<ICourse>;
18
+ courses: Array<C>;
10
19
  };
11
20
  export default ISchool;
@@ -8,7 +8,7 @@ export type ISecret = {
8
8
  value: string;
9
9
  };
10
10
  export default ISecret;
11
- import type { DatalayerClient } from '../client';
11
+ import type { DatalayerCoreClient } from '../client';
12
12
  /**
13
13
  * Raw secret data from API (snake_case with suffixes).
14
14
  */
@@ -138,7 +138,7 @@ export declare class SecretDTO {
138
138
  * @param data - Secret data from API
139
139
  * @param client - Client instance
140
140
  */
141
- constructor(data: SecretData, client: DatalayerClient);
141
+ constructor(data: SecretData, client: DatalayerCoreClient);
142
142
  private _checkDeleted;
143
143
  private _decodeValue;
144
144
  get uid(): string;
@@ -1,6 +1,16 @@
1
1
  import { IUser } from './User';
2
- import { IStudentItem } from './StudentItem';
3
- export type IStudent = IUser & {
4
- studentItems?: Map<string, IStudentItem>;
2
+ /**
3
+ * A student user.
4
+ *
5
+ * The `studentItems` map is generic over the student-item type. The concrete
6
+ * `IStudentItem` model lives in the runtime/content package
7
+ * (`@datalayer/agent-runtimes`), so consumers that need the rich shape
8
+ * parameterize this type; the core package intentionally does not depend on
9
+ * the content models.
10
+ *
11
+ * @typeParam SI - The student-item type carried by the `studentItems` map.
12
+ */
13
+ export type IStudent<SI = unknown> = IUser & {
14
+ studentItems?: Map<string, SI>;
5
15
  };
6
16
  export default IStudent;
@@ -1,4 +1,13 @@
1
- import { IResources } from './Environment';
1
+ /**
2
+ * Compute resource shape (CPU / memory / GPU) associated with a usage record.
3
+ * Mirrors the runtime environment resource shape but is declared locally so
4
+ * the account/usage model does not depend on the runtime/content package.
5
+ */
6
+ interface IResources {
7
+ cpu: string;
8
+ memory: string;
9
+ 'nvidia.com/gpu'?: string;
10
+ }
2
11
  export interface IRawUsage {
3
12
  account_uid: string;
4
13
  resource_uid: string;
@@ -59,3 +68,4 @@ export interface IUsage {
59
68
  usagePeriodEnd?: Date;
60
69
  metadata: Map<string, string>;
61
70
  }
71
+ export {};
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module models/UserDTO
5
5
  */
6
- import type { DatalayerClient } from '../index';
6
+ import type { DatalayerCoreClient } from '../client';
7
7
  /**
8
8
  * Represents a user in the Datalayer platform
9
9
  * @interface UserData
@@ -56,7 +56,7 @@ export declare class UserDTO {
56
56
  * @param data - User data from API
57
57
  * @param client - Client instance (currently unused but kept for compatibility)
58
58
  */
59
- constructor(data: UserData, client?: DatalayerClient);
59
+ constructor(data: UserData, client?: DatalayerCoreClient);
60
60
  get id(): string;
61
61
  get uid(): string;
62
62
  get email(): string;
@@ -28,28 +28,17 @@
28
28
  *
29
29
  * @module models
30
30
  */
31
- export * from './Assignment';
32
31
  export * from './Base';
33
- export * from './Cell';
34
- export * from './CodeBlock';
35
- export * from './CodefeedBlocks';
36
32
  export * from './Common';
37
33
  export * from './Contact';
38
34
  export * from './ContactEvent';
39
35
  export * from './ContactIAMProvider';
40
36
  export * from './ContactTags';
41
- export * from './Content';
42
- export * from './Course';
43
37
  export * from './Credits';
44
38
  export * from './CreditsDTO';
45
- export * from './Dataset';
46
39
  export * from './Datasource';
47
40
  export * from './Dean';
48
- export * from './Document';
49
- export * from './Environment';
50
- export * from './EnvironmentDTO';
51
41
  export * from './Errors';
52
- export * from './Exercise';
53
42
  export * from './GrowthKPI';
54
43
  export * from './IAM';
55
44
  export * from './IAMProviderLinked';
@@ -60,38 +49,19 @@ export * from './IAMToken';
60
49
  export * from './Inbound';
61
50
  export * from './Instructor';
62
51
  export * from './Invite';
63
- export * from './Item';
64
- export * from './ItemDTO';
65
- export * from './ItemType';
66
52
  export * from './LandingRoles';
67
- export * from './Lesson';
68
- export * from './LexicalDTO';
69
- export * from './Library';
70
53
  export * from './Member';
71
- export * from './Notebook';
72
- export * from './NotebookDTO';
73
54
  export * from './Organization';
74
55
  export * from './OrganizationMember';
75
56
  export * from './Outbound';
76
- export * from './Page';
77
- export * from './PageTag';
78
57
  export * from './Profile';
79
58
  export * from './Role';
80
59
  export * from './RolesOrganization';
81
60
  export * from './RolesPlatform';
82
61
  export * from './RolesTeam';
83
- export * from './Runtime';
84
- export * from './RuntimeDTO';
85
- export * from './CodeSandboxSnapshot';
86
- export * from './CodeSandboxSnapshotDTO';
87
62
  export * from './School';
88
63
  export * from './Secret';
89
- export * from './Space';
90
- export * from './SpaceDTO';
91
- export * from './SpaceItem';
92
- export * from './SpaceMember';
93
64
  export * from './Student';
94
- export * from './StudentItem';
95
65
  export * from './Survey';
96
66
  export * from './Team';
97
67
  export * from './TeamMember';