@datalayer/core 1.0.13 → 1.0.15

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 (275) hide show
  1. package/lib/App.js +2 -2
  2. package/lib/api/DatalayerApi.js +6 -1
  3. package/lib/api/constants.d.ts +1 -1
  4. package/lib/api/constants.js +1 -1
  5. package/lib/api/iam/authentication.js +3 -3
  6. package/lib/api/iam/datasources.js +3 -3
  7. package/lib/api/iam/healthz.js +2 -2
  8. package/lib/api/iam/index.js +12 -12
  9. package/lib/api/iam/oauth2.js +2 -2
  10. package/lib/api/iam/profile.js +3 -3
  11. package/lib/api/iam/secrets.js +3 -3
  12. package/lib/api/iam/usage.js +2 -2
  13. package/lib/api/index.js +8 -8
  14. package/lib/api/otel/index.js +5 -5
  15. package/lib/api/otel/logs.js +3 -3
  16. package/lib/api/otel/metrics.js +3 -3
  17. package/lib/api/otel/query.js +3 -3
  18. package/lib/api/otel/services.js +3 -3
  19. package/lib/api/otel/traces.js +3 -3
  20. package/lib/api/runtimes/checkpoints.js +3 -3
  21. package/lib/api/runtimes/environments.js +3 -3
  22. package/lib/api/runtimes/healthz.js +2 -2
  23. package/lib/api/runtimes/index.js +5 -5
  24. package/lib/api/runtimes/runtimes.js +3 -3
  25. package/lib/api/runtimes/snapshots.js +3 -3
  26. package/lib/api/spacer/documents.js +2 -2
  27. package/lib/api/spacer/healthz.js +2 -2
  28. package/lib/api/spacer/index.js +7 -7
  29. package/lib/api/spacer/items.js +2 -2
  30. package/lib/api/spacer/lexicals.d.ts +8 -0
  31. package/lib/api/spacer/lexicals.js +16 -2
  32. package/lib/api/spacer/notebooks.d.ts +8 -0
  33. package/lib/api/spacer/notebooks.js +16 -2
  34. package/lib/api/spacer/spaces.d.ts +76 -1
  35. package/lib/api/spacer/spaces.js +143 -3
  36. package/lib/api/spacer/users.js +3 -3
  37. package/lib/client/auth/AuthenticationManager.js +3 -3
  38. package/lib/client/auth/index.js +4 -4
  39. package/lib/client/auth/storage.d.ts +3 -1
  40. package/lib/client/auth/storage.js +35 -14
  41. package/lib/client/auth/strategies.js +3 -3
  42. package/lib/client/base.js +2 -2
  43. package/lib/client/index.d.ts +22 -2
  44. package/lib/client/index.js +21 -20
  45. package/lib/client/mixins/IAMMixin.js +10 -10
  46. package/lib/client/mixins/RuntimesMixin.js +7 -7
  47. package/lib/client/mixins/SpacerMixin.d.ts +99 -0
  48. package/lib/client/mixins/SpacerMixin.js +265 -11
  49. package/lib/client/utils/slugify.d.ts +8 -0
  50. package/lib/client/utils/slugify.js +18 -0
  51. package/lib/client/utils/spacerUtils.js +3 -3
  52. package/lib/collaboration/DatalayerCollaborationProvider.js +1 -1
  53. package/lib/collaboration/index.js +2 -2
  54. package/lib/components/auth/Login.js +6 -6
  55. package/lib/components/auth/Login.stories.js +2 -2
  56. package/lib/components/auth/LoginToken.js +2 -2
  57. package/lib/components/auth/index.js +3 -3
  58. package/lib/components/avatars/BoringAvatar.stories.js +1 -1
  59. package/lib/components/avatars/UserProfileAvatar.js +2 -2
  60. package/lib/components/avatars/index.js +2 -2
  61. package/lib/components/banners/NoAutomationBanner.js +1 -1
  62. package/lib/components/banners/index.js +1 -1
  63. package/lib/components/buttons/DownloadCSVButton.js +1 -1
  64. package/lib/components/buttons/DownloadJsonButton.js +1 -1
  65. package/lib/components/buttons/index.js +5 -5
  66. package/lib/components/checkout/StripeCheckout.js +1 -1
  67. package/lib/components/checkout/index.js +1 -1
  68. package/lib/components/confetti/index.js +1 -1
  69. package/lib/components/context/OrganizationSelect.js +2 -2
  70. package/lib/components/context/SpaceSelect.js +2 -2
  71. package/lib/components/context/index.js +2 -2
  72. package/lib/components/display/DatalayerBox.js +1 -1
  73. package/lib/components/display/LiveRelativeTime.js +1 -1
  74. package/lib/components/display/NavLink.js +1 -1
  75. package/lib/components/display/index.js +14 -14
  76. package/lib/components/echarts/index.js +1 -1
  77. package/lib/components/flashes/FlashDisclaimer.js +2 -2
  78. package/lib/components/flashes/FlashGuest.js +4 -4
  79. package/lib/components/flashes/FlashSurveys.js +4 -4
  80. package/lib/components/flashes/FlashUnauthorized.js +1 -1
  81. package/lib/components/flashes/index.js +6 -6
  82. package/lib/components/flashes/surveys/index.js +2 -2
  83. package/lib/components/iam/ExternalTokenSilentLogin.js +3 -3
  84. package/lib/components/iam/index.js +1 -1
  85. package/lib/components/icons/index.js +1 -1
  86. package/lib/components/index.js +2 -2
  87. package/lib/components/labels/index.js +1 -1
  88. package/lib/components/landings/index.js +1 -1
  89. package/lib/components/navbar/NavigationVisbilityObserver.js +4 -4
  90. package/lib/components/navbar/SubdomainNavBar.js +5 -5
  91. package/lib/components/navbar/index.js +2 -2
  92. package/lib/components/nbgrader/index.js +1 -1
  93. package/lib/components/notebooks/index.js +2 -2
  94. package/lib/components/progress/ConsumptionBar.js +1 -1
  95. package/lib/components/progress/CreditsIndicator.js +2 -2
  96. package/lib/components/progress/index.js +6 -6
  97. package/lib/components/runtimes/RuntimeCellVariablesDialog.js +2 -2
  98. package/lib/components/runtimes/RuntimeLauncherDialog.js +9 -9
  99. package/lib/components/runtimes/RuntimePickerBase.js +3 -3
  100. package/lib/components/runtimes/RuntimePickerCell.js +8 -8
  101. package/lib/components/runtimes/RuntimePickerNotebook.js +6 -6
  102. package/lib/components/runtimes/RuntimeSimplePicker.js +3 -3
  103. package/lib/components/runtimes/index.js +11 -11
  104. package/lib/components/screencapture/ScreencaptureButton.js +3 -3
  105. package/lib/components/screencapture/index.js +2 -2
  106. package/lib/components/snapshots/RuntimeSnapshotMenu.js +4 -4
  107. package/lib/components/snapshots/index.js +1 -1
  108. package/lib/components/snippets/SnippetDialog.js +1 -1
  109. package/lib/components/snippets/index.js +1 -1
  110. package/lib/components/sparklines/Sparklines.js +5 -1
  111. package/lib/components/sparklines/dataProcessing.d.ts +2 -4
  112. package/lib/components/sparklines/dataProcessing.js +1 -1
  113. package/lib/components/sparklines/index.d.ts +1 -0
  114. package/lib/components/sparklines/index.js +7 -3
  115. package/lib/components/sparklines/types.js +1 -1
  116. package/lib/components/storage/ContentsBrowser.js +3 -3
  117. package/lib/components/storage/index.js +2 -2
  118. package/lib/components/students/index.js +1 -1
  119. package/lib/components/subnav/SubNav.js +2 -2
  120. package/lib/components/subnav/index.js +1 -1
  121. package/lib/components/tables/index.js +1 -1
  122. package/lib/components/text-reveal/TextRevealAnimation.js +1 -1
  123. package/lib/components/text-reveal/index.js +1 -1
  124. package/lib/components/tokens/index.js +1 -1
  125. package/lib/components/toolbars/AssignmentEditorToolbar.js +1 -1
  126. package/lib/components/toolbars/DocumentEditorToolbar.js +1 -1
  127. package/lib/components/toolbars/index.js +3 -3
  128. package/lib/components/users/PeerIndicator.js +1 -1
  129. package/lib/components/users/index.js +1 -1
  130. package/lib/config/Configuration.d.ts +1 -1
  131. package/lib/config/Configuration.js +2 -2
  132. package/lib/config/index.js +2 -2
  133. package/lib/config/integrations/index.js +1 -1
  134. package/lib/hooks/assets/index.js +1 -1
  135. package/lib/hooks/index.js +33 -33
  136. package/lib/hooks/layouts/LayoutBackdrop.js +2 -2
  137. package/lib/hooks/layouts/LayoutScreencapture.js +3 -3
  138. package/lib/hooks/layouts/index.js +2 -2
  139. package/lib/hooks/useAuthorization.js +3 -3
  140. package/lib/hooks/useBackdrop.js +2 -2
  141. package/lib/hooks/useCache.js +9 -9
  142. package/lib/hooks/useCellOutputshot.js +2 -2
  143. package/lib/hooks/useDatalayer.js +6 -6
  144. package/lib/hooks/useIAM.js +4 -4
  145. package/lib/hooks/useLocation.js +2 -2
  146. package/lib/hooks/useLocationHandles.js +3 -3
  147. package/lib/hooks/useNavigate.js +4 -4
  148. package/lib/hooks/useParams.js +2 -2
  149. package/lib/hooks/useProjects.d.ts +2 -8
  150. package/lib/hooks/useProjects.js +2 -2
  151. package/lib/hooks/useRuntimes.js +1 -1
  152. package/lib/hooks/useScreencapture.js +1 -1
  153. package/lib/hooks/useToast.js +41 -5
  154. package/lib/hooks/useUpload.js +2 -2
  155. package/lib/hooks/useUser.js +1 -1
  156. package/lib/i18n/index.js +1 -1
  157. package/lib/index.d.ts +1 -1
  158. package/lib/index.js +17 -17
  159. package/lib/main.js +1 -1
  160. package/lib/mocks/components/FlashMock.js +1 -1
  161. package/lib/mocks/components/index.js +1 -1
  162. package/lib/mocks/hooks/index.js +1 -1
  163. package/lib/mocks/hooks/rests/index.js +1 -1
  164. package/lib/mocks/hooks/useDatalayerMock.js +5 -5
  165. package/lib/mocks/index.js +5 -5
  166. package/lib/mocks/models/CourseMock.js +3 -3
  167. package/lib/mocks/models/InviteMock.js +2 -2
  168. package/lib/mocks/models/OrganisationMock.js +1 -1
  169. package/lib/mocks/models/SchoolMock.js +1 -1
  170. package/lib/mocks/models/SpaceMock.js +2 -2
  171. package/lib/mocks/models/TeamMock.js +1 -1
  172. package/lib/mocks/models/UserMock.js +1 -1
  173. package/lib/mocks/models/index.js +9 -9
  174. package/lib/mocks/views/ChartMock.js +3 -3
  175. package/lib/mocks/views/DashboardMock.js +2 -2
  176. package/lib/mocks/views/TableMock.js +1 -1
  177. package/lib/mocks/views/index.js +7 -7
  178. package/lib/models/Contact.js +3 -3
  179. package/lib/models/CreditsDTO.js +1 -1
  180. package/lib/models/Datasource.js +1 -1
  181. package/lib/models/EnvironmentDTO.d.ts +1 -1
  182. package/lib/models/EnvironmentDTO.js +2 -2
  183. package/lib/models/HealthCheck.js +1 -1
  184. package/lib/models/IAMProviderUsers.js +1 -1
  185. package/lib/models/Invite.js +1 -1
  186. package/lib/models/ItemDTO.js +1 -1
  187. package/lib/models/LexicalDTO.js +4 -4
  188. package/lib/models/NotebookDTO.js +4 -4
  189. package/lib/models/Organization.js +2 -2
  190. package/lib/models/Page.js +2 -2
  191. package/lib/models/ProjectDTO.d.ts +89 -0
  192. package/lib/models/ProjectDTO.js +131 -0
  193. package/lib/models/RuntimeDTO.js +2 -2
  194. package/lib/models/RuntimeSnapshotDTO.js +2 -2
  195. package/lib/models/Secret.js +1 -1
  196. package/lib/models/Space.d.ts +1 -1
  197. package/lib/models/Space.js +3 -3
  198. package/lib/models/SpaceDTO.d.ts +61 -0
  199. package/lib/models/SpaceDTO.js +9 -9
  200. package/lib/models/Team.js +2 -2
  201. package/lib/models/User.js +5 -5
  202. package/lib/models/UserDTO.js +1 -1
  203. package/lib/models/index.js +75 -75
  204. package/lib/navigation/components.js +1 -1
  205. package/lib/navigation/index.js +4 -4
  206. package/lib/otel/client/OtelClient.js +1 -1
  207. package/lib/otel/client/index.js +1 -1
  208. package/lib/otel/hooks/index.js +1 -1
  209. package/lib/otel/index.js +15 -15
  210. package/lib/otel/types.d.ts +1 -1
  211. package/lib/otel/views/OtelLive.js +11 -11
  212. package/lib/otel/views/OtelLogsList.js +1 -1
  213. package/lib/otel/views/OtelMetricsList.d.ts +2 -5
  214. package/lib/otel/views/OtelMetricsList.js +2 -2
  215. package/lib/otel/views/OtelSpanDetail.js +2 -2
  216. package/lib/otel/views/OtelSpanTree.js +1 -1
  217. package/lib/otel/views/OtelSqlView.js +1 -1
  218. package/lib/otel/views/OtelSystemView.js +1 -1
  219. package/lib/otel/views/OtelTimeline.js +1 -1
  220. package/lib/otel/views/OtelTracesList.js +1 -1
  221. package/lib/otel/views/index.d.ts +1 -0
  222. package/lib/otel/views/index.js +12 -12
  223. package/lib/routes/index.js +1 -1
  224. package/lib/services/DatalayerServiceManager.d.ts +1 -1
  225. package/lib/services/DatalayerServiceManager.js +4 -4
  226. package/lib/services/index.js +3 -3
  227. package/lib/state/State.js +13 -13
  228. package/lib/state/index.js +3 -3
  229. package/lib/state/storage/IAMStorage.js +31 -6
  230. package/lib/state/storage/index.js +1 -1
  231. package/lib/state/substates/CoreState.js +2 -2
  232. package/lib/state/substates/IAMState.js +5 -5
  233. package/lib/state/substates/RuntimesState.js +3 -3
  234. package/lib/state/substates/SurveysState.js +4 -4
  235. package/lib/state/substates/TeamState.js +1 -1
  236. package/lib/state/substates/index.js +14 -14
  237. package/lib/stateful/index.js +2 -2
  238. package/lib/stateful/jupyter/exec/Snippets.js +1 -1
  239. package/lib/stateful/jupyter/exec/index.js +2 -2
  240. package/lib/stateful/jupyter/index.js +2 -2
  241. package/lib/stateful/runtimes/actions.js +4 -4
  242. package/lib/stateful/runtimes/index.js +5 -5
  243. package/lib/stateful/runtimes/snapshots.js +1 -1
  244. package/lib/utils/Date.d.ts +11 -0
  245. package/lib/utils/Date.js +30 -0
  246. package/lib/utils/cli/index.js +1 -1
  247. package/lib/utils/index.js +29 -29
  248. package/lib/views/datasources/DatasourceDetail.js +3 -3
  249. package/lib/views/datasources/DatasourceNew.js +2 -2
  250. package/lib/views/datasources/Datasources.js +1 -1
  251. package/lib/views/datasources/index.js +3 -3
  252. package/lib/views/iam/SignInSimple.js +1 -1
  253. package/lib/views/iam/index.js +1 -1
  254. package/lib/views/iam-tokens/IAMTokenEdit.js +3 -3
  255. package/lib/views/iam-tokens/IAMTokenNew.js +2 -2
  256. package/lib/views/iam-tokens/IAMTokens.js +1 -1
  257. package/lib/views/iam-tokens/Tokens.js +1 -1
  258. package/lib/views/iam-tokens/index.js +3 -3
  259. package/lib/views/index.js +3 -3
  260. package/lib/views/otel/DashboardView.js +1 -1
  261. package/lib/views/otel/LogsView.js +1 -1
  262. package/lib/views/otel/MetricsView.js +1 -1
  263. package/lib/views/otel/OtelHeader.js +1 -1
  264. package/lib/views/otel/SqlView.js +1 -1
  265. package/lib/views/otel/SystemView.js +1 -1
  266. package/lib/views/otel/TracesView.js +1 -1
  267. package/lib/views/otel/index.js +8 -8
  268. package/lib/views/otel/simpleAuthStore.js +1 -1
  269. package/lib/views/profile/UserBadge.js +1 -1
  270. package/lib/views/profile/index.js +1 -1
  271. package/lib/views/secrets/SecretEdit.js +3 -3
  272. package/lib/views/secrets/SecretNew.js +2 -2
  273. package/lib/views/secrets/Secrets.js +1 -1
  274. package/lib/views/secrets/index.js +3 -3
  275. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  */
6
6
  import { AlertIcon } from '@primer/octicons-react';
7
7
  import { Flash, Link } from '@primer/react';
8
- import { useNavigate } from '../../hooks';
8
+ import { useNavigate } from '../../hooks/index.js';
9
9
  export const FlashMock = () => {
10
10
  const navigate = useNavigate();
11
11
  return (_jsxs(Flash, { variant: "warning", style: { marginBottom: 10 }, children: [_jsx(AlertIcon, {}), " This is a mock content.", ' ', _jsx(Link, { href: "#", onClick: e => navigate('/contact', e), children: "Contact us" }), ' ', "if you'd like to know more about this feature."] }));
@@ -2,4 +2,4 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './FlashMock';
5
+ export * from './FlashMock.js';
@@ -2,4 +2,4 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './useDatalayerMock';
5
+ export * from './useDatalayerMock.js';
@@ -2,4 +2,4 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './rests';
5
+ export * from './rests.js';
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { useLocation } from './../../hooks';
6
- import { useNavigate } from './../../hooks';
7
- import { useToast } from './../../hooks';
8
- import { useIAMStore } from '../../state';
9
- import { systemAdminLogin } from './rests';
5
+ import { useLocation } from './../../hooks/index.js';
6
+ import { useNavigate } from './../../hooks/index.js';
7
+ import { useToast } from './../../hooks/index.js';
8
+ import { useIAMStore } from '../../state/index.js';
9
+ import { systemAdminLogin } from './rests/index.js';
10
10
  const getMockResponse = (request) => {
11
11
  const { url, method, body } = request;
12
12
  if (url.match('/api/iam/v1/login$') && method === 'POST') {
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './components';
6
- export * from './hooks';
7
- // export * from './jupyter';
8
- export * from './models';
9
- export * from './views';
5
+ export * from './components/index.js';
6
+ export * from './hooks/index.js';
7
+ // export * from './jupyter/index.js';
8
+ export * from './models/index.js';
9
+ export * from './views/index.js';
@@ -3,9 +3,9 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, names } from 'unique-names-generator';
6
- import { newUlid } from '../../utils';
7
- import { newSpaceMock } from './SpaceMock';
8
- import { newUserMock } from './UserMock';
6
+ import { newUlid } from '../../utils/index.js';
7
+ import { newSpaceMock } from './SpaceMock.js';
8
+ import { newUserMock } from './UserMock.js';
9
9
  export const newCourseMock = (name) => {
10
10
  const course = {
11
11
  id: newUlid(),
@@ -3,8 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, names, colors, adjectives, animals, } from 'unique-names-generator';
6
- import { newUlid } from '../../utils';
7
- import { newUserMock } from './UserMock';
6
+ import { newUlid } from '../../utils/index.js';
7
+ import { newUserMock } from './UserMock.js';
8
8
  export const newInviteMock = (message) => {
9
9
  const invite = {
10
10
  id: newUlid(),
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { newUlid } from '../../utils';
5
+ import { newUlid } from '../../utils/index.js';
6
6
  const newOrganizationMock = (name) => {
7
7
  const organization = {
8
8
  id: newUlid(),
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { newUlid } from '../../utils';
5
+ import { newUlid } from '../../utils/index.js';
6
6
  export const newSchoolMock = (name) => {
7
7
  const school = {
8
8
  id: newUlid(),
@@ -3,8 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, names } from 'unique-names-generator';
6
- import { newUlid } from '../../utils';
7
- import { newUserMock } from './UserMock';
6
+ import { newUlid } from '../../utils/index.js';
7
+ import { newUserMock } from './UserMock.js';
8
8
  export const newSpaceMock = (name) => {
9
9
  const space = {
10
10
  id: newUlid(),
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { newUlid } from '../../utils';
5
+ import { newUlid } from '../../utils/index.js';
6
6
  const newTeamMock = (name) => {
7
7
  const team = {
8
8
  id: newUlid(),
@@ -3,7 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, animals, names } from 'unique-names-generator';
6
- import { newUlid, asDisplayName, namesAsInitials } from '../../utils';
6
+ import { newUlid, asDisplayName, namesAsInitials } from '../../utils/index.js';
7
7
  export const newUserMock = (firstName, lastName) => {
8
8
  const mockFistName = firstName ?? uniqueNamesGenerator({ dictionaries: [names] });
9
9
  const mockLastName = lastName ?? uniqueNamesGenerator({ dictionaries: [names] });
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './CodeBlockMock';
6
- export * from './CodelineMock';
7
- export * from './InviteMock';
8
- export * from './JupyterLabUserMock';
9
- export * from './OrganisationMock';
10
- export * from './SchoolMock';
11
- export * from './SpaceMock';
12
- export * from './TeamMock';
13
- export * from './UserMock';
5
+ export * from './CodeBlockMock.js';
6
+ export * from './CodelineMock.js';
7
+ export * from './InviteMock.js';
8
+ export * from './JupyterLabUserMock.js';
9
+ export * from './OrganisationMock.js';
10
+ export * from './SchoolMock.js';
11
+ export * from './SpaceMock.js';
12
+ export * from './TeamMock.js';
13
+ export * from './UserMock.js';
@@ -4,9 +4,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { Heading } from '@primer/react-brand';
7
- import { lazyWithPreload, WithSuspense } from '../../utils';
8
- import { HorizontalCenter } from '../../components/display';
9
- import { CHART_4 } from './ChartMockOptions';
7
+ import { lazyWithPreload, WithSuspense } from '../../utils/index.js';
8
+ import { HorizontalCenter } from '../../components/display/index.js';
9
+ import { CHART_4 } from './ChartMockOptions.js';
10
10
  const ReactEcharts = WithSuspense(lazyWithPreload(() => import('echarts-for-react')), true);
11
11
  export const ChartMock = (props) => {
12
12
  const { title } = props;
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  import { Box, Link, Text, LabelGroup, Label, ActionMenu, ActionList, } from '@primer/react';
7
7
  import { ArrowRightIcon, CloudIcon, StarIcon, DotFillIcon, RepoForkedIcon, LinkIcon, } from '@primer/octicons-react';
8
8
  import { ReactJsIcon } from '@datalayer/icons-react';
9
- import { lazyWithPreload, WithSuspense } from '../../utils';
10
- import { ECHART_MOCK_1, ECHART_MOCK_2, ECHART_MOCK_3, FlashMock, } from '../../mocks';
9
+ import { lazyWithPreload, WithSuspense } from '../../utils/index.js';
10
+ import { ECHART_MOCK_1, ECHART_MOCK_2, ECHART_MOCK_3, FlashMock, } from '../../mocks/index.js';
11
11
  const ReactECharts = WithSuspense(lazyWithPreload(() => import('echarts-for-react')), true);
12
12
  export const DashboardMock = () => {
13
13
  return (_jsxs(_Fragment, { children: [_jsx(Box, { mb: 3, children: _jsx(FlashMock, {}) }), _jsxs(Box, { sx: {
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  import { Box, LabelGroup, ActionMenu, ActionList, IconButton, Label, RelativeTime, } from '@primer/react';
7
7
  import { Table, DataTable } from '@primer/react/experimental';
8
8
  import { KebabHorizontalIcon, DownloadIcon } from '@primer/octicons-react';
9
- import { VisuallyHidden } from './../../components/display';
9
+ import { VisuallyHidden } from './../../components/display/index.js';
10
10
  const now = Date.now();
11
11
  const Second = 1000;
12
12
  const Minute = 60 * Second;
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './ActionMenuMock';
6
- export * from './ChartMock';
7
- export * from './ChartMockOptions';
8
- export * from './DashboardMock';
9
- export * from './FormMock';
10
- export * from './TableMock';
11
- export * from './WipMock';
5
+ export * from './ActionMenuMock.js';
6
+ export * from './ChartMock.js';
7
+ export * from './ChartMockOptions.js';
8
+ export * from './DashboardMock.js';
9
+ export * from './FormMock.js';
10
+ export * from './TableMock.js';
11
+ export * from './WipMock.js';
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asContactIAMProvider, } from './ContactIAMProvider';
6
- import { asContactEvent } from './ContactEvent';
7
- import { asDisplayName, namesAsInitials } from '../utils';
5
+ import { asContactIAMProvider, } from './ContactIAMProvider.js';
6
+ import { asContactEvent } from './ContactEvent.js';
7
+ import { asDisplayName, namesAsInitials } from '../utils/index.js';
8
8
  export class Contact {
9
9
  id;
10
10
  handle;
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @module models/CreditsDTO
9
9
  */
10
- import { validateJSON } from '../api/utils/validation';
10
+ import { validateJSON } from '../api/utils/validation.js';
11
11
  /**
12
12
  * Credits model representing user's available credits and usage.
13
13
  *
@@ -18,7 +18,7 @@ export const asDatasource = (s) => {
18
18
  // ============================================================================
19
19
  // New API Types and DTO
20
20
  // ============================================================================
21
- import { validateJSON } from '../api/utils/validation';
21
+ import { validateJSON } from '../api/utils/validation.js';
22
22
  /**
23
23
  * Datasource domain model for the Datalayer Client.
24
24
  * Provides state management and operations for datasources.
@@ -97,7 +97,7 @@ export declare class EnvironmentDTO {
97
97
  constructor(data: EnvironmentData, _client: DatalayerClient);
98
98
  /** Human-readable title for the environment (e.g., 'AI Environment', 'Python CPU Environment'). */
99
99
  get title(): string;
100
- /** Unique name identifier for the environment (e.g., 'ai-env', 'python-cpu-env'). */
100
+ /** Unique name identifier for the environment (e.g., 'ai-env', 'ai-agents-env'). */
101
101
  get name(): string;
102
102
  /** Credits consumed per hour for this environment. */
103
103
  get burningRate(): number;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { validateJSON } from '../api/utils/validation';
5
+ import { validateJSON } from '../api/utils/validation.js';
6
6
  /**
7
7
  * Environment domain model that wraps API responses with convenient methods.
8
8
  * Provides information about available computational environments.
@@ -34,7 +34,7 @@ export class EnvironmentDTO {
34
34
  get title() {
35
35
  return this._data.title;
36
36
  }
37
- /** Unique name identifier for the environment (e.g., 'ai-env', 'python-cpu-env'). */
37
+ /** Unique name identifier for the environment (e.g., 'ai-env', 'ai-agents-env'). */
38
38
  get name() {
39
39
  return this._data.name;
40
40
  }
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { validateJSON } from '../api/utils/validation';
5
+ import { validateJSON } from '../api/utils/validation.js';
6
6
  /**
7
7
  * Represents a health check response from a Datalayer service.
8
8
  * Provides standardized health status information across all services.
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asDisplayName } from '../utils';
5
+ import { asDisplayName } from '../utils/index.js';
6
6
  export class LinkedInUser {
7
7
  iamProvider = 'linkedin';
8
8
  sub;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asDisplayName, namesAsInitials } from '../utils';
5
+ import { asDisplayName, namesAsInitials } from '../utils/index.js';
6
6
  export const asInvite = (i) => {
7
7
  const to = {
8
8
  id: i.to_contact_uid,
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import * as items from '../api/spacer/items';
5
+ import * as items from '../api/spacer/items.js';
6
6
  /**
7
7
  * Abstract base class for all Datalayer content items.
8
8
  * Provides common functionality for content management including lifecycle tracking.
@@ -7,10 +7,10 @@
7
7
  *
8
8
  * @module models/LexicalDTO
9
9
  */
10
- import * as lexicals from '../api/spacer/lexicals';
11
- import { ItemTypes } from '../client';
12
- import { ItemDTO } from './ItemDTO';
13
- import { validateJSON } from '../api/utils/validation';
10
+ import * as lexicals from '../api/spacer/lexicals.js';
11
+ import { ItemTypes } from '../client/index.js';
12
+ import { ItemDTO } from './ItemDTO.js';
13
+ import { validateJSON } from '../api/utils/validation.js';
14
14
  /**
15
15
  * Lexical domain model that extends the base Item class.
16
16
  * Provides lexical document functionality for managing rich text documents.
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import * as notebooks from '../api/spacer/notebooks';
6
- import { ItemDTO } from './ItemDTO';
7
- import { ItemTypes } from '../client/constants';
8
- import { validateJSON } from '../api/utils/validation';
5
+ import * as notebooks from '../api/spacer/notebooks.js';
6
+ import { ItemDTO } from './ItemDTO.js';
7
+ import { ItemTypes } from '../client/constants.js';
8
+ import { validateJSON } from '../api/utils/validation.js';
9
9
  /**
10
10
  * Notebook domain model that extends the base Item class.
11
11
  * Provides notebook-specific functionality for managing Jupyter notebooks.
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asArray } from '../utils';
6
- import { asUser } from './User';
5
+ import { asArray } from '../utils/index.js';
6
+ import { asUser } from './User.js';
7
7
  /**
8
8
  * Convert the raw user object to {@link IOrganization}.
9
9
  *
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asUser } from './User';
6
- import { asRuntimeSnapshot } from './RuntimeSnapshot';
5
+ import { asUser } from './User.js';
6
+ import { asRuntimeSnapshot } from './RuntimeSnapshot.js';
7
7
  export const asPage = (s) => {
8
8
  return {
9
9
  id: s.uid,
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Project domain model for the Datalayer Client.
3
+ *
4
+ * Projects are spaces with variant='project' that can have attached agents.
5
+ * This is a standalone model (no inheritance from SpaceDTO) to avoid
6
+ * circular dependency issues in the module graph.
7
+ *
8
+ * @module models/ProjectDTO
9
+ */
10
+ import type { SpaceData } from './SpaceDTO';
11
+ /**
12
+ * Stable public interface for Project data.
13
+ */
14
+ export interface ProjectJSON {
15
+ uid: string;
16
+ id: string;
17
+ handle: string;
18
+ name: string;
19
+ description: string;
20
+ variant: string;
21
+ isPublic: boolean;
22
+ createdAt: string;
23
+ attachedAgentPodName: string | null;
24
+ attachedAgentSpecId: string | null;
25
+ attachedAgentGivenName: string | null;
26
+ hasAgent: boolean;
27
+ }
28
+ /**
29
+ * Default items (notebook UID and document UID) for a project.
30
+ */
31
+ export interface ProjectDefaultItems {
32
+ defaultNotebookUid: string | null;
33
+ defaultDocumentUid: string | null;
34
+ }
35
+ /**
36
+ * Project domain model wrapping raw space data with project-specific accessors.
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * const projects = await client.getProjects();
41
+ * const project = projects[0];
42
+ * console.log(project.hasAgent); // false
43
+ * await client.assignAgent(project.uid, 'my-agent-pod');
44
+ * ```
45
+ */
46
+ export declare class ProjectDTO {
47
+ private _data;
48
+ private _deleted;
49
+ private _createdAt;
50
+ constructor(data: SpaceData);
51
+ /** Unique identifier for the project. */
52
+ get uid(): string;
53
+ /** Internal numeric/string ID from the backend. Falls back to UID when not present. SDK client methods accept `uid` directly. */
54
+ get id(): string;
55
+ /** URL-friendly handle. */
56
+ get handle(): string;
57
+ /** Project name. */
58
+ get name(): string;
59
+ /** Project description. */
60
+ get description(): string;
61
+ /** Space variant (should be 'project'). */
62
+ get variant(): string;
63
+ /** Whether the project is public. */
64
+ get isPublic(): boolean;
65
+ /** Creation date (stable across calls). */
66
+ get createdAt(): Date;
67
+ /** Attached agent runtime pod name, if any. */
68
+ get attachedAgentPodName(): string | undefined;
69
+ /** Attached agent spec ID (e.g., 'data-acquisition'), if any. */
70
+ get attachedAgentSpecId(): string | undefined;
71
+ /** Human-readable name of the attached agent runtime, if any. */
72
+ get attachedAgentGivenName(): string | undefined;
73
+ /** Whether an agent is currently attached to this project. */
74
+ get hasAgent(): boolean;
75
+ /** Mark this project as deleted. */
76
+ markDeleted(): void;
77
+ /** Whether this project has been deleted. */
78
+ get isDeleted(): boolean;
79
+ /**
80
+ * Get project data in camelCase format.
81
+ * @returns Project data with camelCase properties
82
+ */
83
+ toJSON(): ProjectJSON;
84
+ /** Get raw space data as received from the API. */
85
+ rawData(): SpaceData;
86
+ /** String representation of the project. */
87
+ toString(): string;
88
+ private _checkDeleted;
89
+ }
@@ -0,0 +1,131 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * Project domain model wrapping raw space data with project-specific accessors.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const projects = await client.getProjects();
11
+ * const project = projects[0];
12
+ * console.log(project.hasAgent); // false
13
+ * await client.assignAgent(project.uid, 'my-agent-pod');
14
+ * ```
15
+ */
16
+ export class ProjectDTO {
17
+ _data;
18
+ _deleted = false;
19
+ _createdAt;
20
+ constructor(data) {
21
+ this._data = data;
22
+ // Cache creation date at construction to ensure stable value
23
+ this._createdAt = data.creation_ts_dt
24
+ ? new Date(data.creation_ts_dt)
25
+ : new Date();
26
+ }
27
+ /** Unique identifier for the project. */
28
+ get uid() {
29
+ this._checkDeleted();
30
+ return this._data.uid;
31
+ }
32
+ /** Internal numeric/string ID from the backend. Falls back to UID when not present. SDK client methods accept `uid` directly. */
33
+ get id() {
34
+ this._checkDeleted();
35
+ return this._data.id ?? this._data.uid;
36
+ }
37
+ /** URL-friendly handle. */
38
+ get handle() {
39
+ this._checkDeleted();
40
+ return this._data.handle_s;
41
+ }
42
+ /** Project name. */
43
+ get name() {
44
+ this._checkDeleted();
45
+ return this._data.name_t;
46
+ }
47
+ /** Project description. */
48
+ get description() {
49
+ this._checkDeleted();
50
+ return this._data.description_t ?? '';
51
+ }
52
+ /** Space variant (should be 'project'). */
53
+ get variant() {
54
+ this._checkDeleted();
55
+ return this._data.variant_s;
56
+ }
57
+ /** Whether the project is public. */
58
+ get isPublic() {
59
+ this._checkDeleted();
60
+ return this._data.public_b ?? false;
61
+ }
62
+ /** Creation date (stable across calls). */
63
+ get createdAt() {
64
+ this._checkDeleted();
65
+ return this._createdAt;
66
+ }
67
+ /** Attached agent runtime pod name, if any. */
68
+ get attachedAgentPodName() {
69
+ this._checkDeleted();
70
+ return this._data.attached_agent_pod_name_s || undefined;
71
+ }
72
+ /** Attached agent spec ID (e.g., 'data-acquisition'), if any. */
73
+ get attachedAgentSpecId() {
74
+ this._checkDeleted();
75
+ return this._data.attached_agent_spec_id_s || undefined;
76
+ }
77
+ /** Human-readable name of the attached agent runtime, if any. */
78
+ get attachedAgentGivenName() {
79
+ this._checkDeleted();
80
+ return this._data.attached_agent_given_name_s || undefined;
81
+ }
82
+ /** Whether an agent is currently attached to this project. */
83
+ get hasAgent() {
84
+ this._checkDeleted();
85
+ return !!this._data.attached_agent_pod_name_s;
86
+ }
87
+ /** Mark this project as deleted. */
88
+ markDeleted() {
89
+ this._deleted = true;
90
+ }
91
+ /** Whether this project has been deleted. */
92
+ get isDeleted() {
93
+ return this._deleted;
94
+ }
95
+ /**
96
+ * Get project data in camelCase format.
97
+ * @returns Project data with camelCase properties
98
+ */
99
+ toJSON() {
100
+ this._checkDeleted();
101
+ return {
102
+ uid: this.uid,
103
+ id: this.id,
104
+ handle: this.handle,
105
+ name: this.name,
106
+ description: this.description,
107
+ variant: this.variant,
108
+ isPublic: this.isPublic,
109
+ createdAt: this.createdAt.toISOString(),
110
+ attachedAgentPodName: this.attachedAgentPodName ?? null,
111
+ attachedAgentSpecId: this.attachedAgentSpecId ?? null,
112
+ attachedAgentGivenName: this.attachedAgentGivenName ?? null,
113
+ hasAgent: this.hasAgent,
114
+ };
115
+ }
116
+ /** Get raw space data as received from the API. */
117
+ rawData() {
118
+ this._checkDeleted();
119
+ return this._data;
120
+ }
121
+ /** String representation of the project. */
122
+ toString() {
123
+ this._checkDeleted();
124
+ return `Project(${this._data.uid}, ${this._data.name_t})`;
125
+ }
126
+ _checkDeleted() {
127
+ if (this._deleted) {
128
+ throw new Error(`Project ${this._data.uid} has been deleted and no longer exists`);
129
+ }
130
+ }
131
+ }
@@ -7,8 +7,8 @@
7
7
  *
8
8
  * @module models/RuntimeDTO
9
9
  */
10
- import { updateRuntime } from '../api/runtimes/runtimes';
11
- import { validateJSON } from '../api/utils/validation';
10
+ import { updateRuntime } from '../api/runtimes/runtimes.js';
11
+ import { validateJSON } from '../api/utils/validation.js';
12
12
  /**
13
13
  * Runtime domain model that wraps API responses with convenient methods.
14
14
  * Provides state management and lifecycle operations for computational runtimes.
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { snapshots } from '../api/runtimes';
6
- import { validateJSON } from '../api/utils/validation';
5
+ import { snapshots } from '../api/runtimes/index.js';
6
+ import { validateJSON } from '../api/utils/validation.js';
7
7
  /**
8
8
  * Snapshot domain model that wraps API responses with convenient methods.
9
9
  * Provides runtime snapshot management with data refresh and lifecycle operations.
@@ -14,7 +14,7 @@ export const asSecret = (s) => {
14
14
  // ============================================================================
15
15
  // New API Types and DTO
16
16
  // ============================================================================
17
- import { validateJSON } from '../api/utils/validation';
17
+ import { validateJSON } from '../api/utils/validation.js';
18
18
  /**
19
19
  * Secret domain model for the Datalayer Client.
20
20
  * Provides state management and operations for user secrets.
@@ -10,7 +10,7 @@ import { IUser } from './User';
10
10
  * @returns Space
11
11
  */
12
12
  export declare const asSpace: (raw_space: any) => ISpace;
13
- export type ISpaceVariant = 'default' | 'course';
13
+ export type ISpaceVariant = 'default' | 'course' | 'project';
14
14
  export type IAnySpace = ISpace | ICourse;
15
15
  export type IBaseSpace = {
16
16
  id: string;