@datalayer/core 0.0.3 → 0.0.4

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 (330) hide show
  1. package/README.md +114 -3
  2. package/lib/App.css +2 -2
  3. package/lib/App.d.ts +1 -1
  4. package/lib/App.js +9 -9
  5. package/lib/__tests__/index.test.js +5 -5
  6. package/lib/api/DatalayerApi.d.ts +1 -1
  7. package/lib/api/DatalayerApi.js +3 -3
  8. package/lib/api/index.d.ts +3 -3
  9. package/lib/api/index.js +3 -3
  10. package/lib/api/runtimes/actions.js +22 -23
  11. package/lib/api/runtimes/settings.js +3 -3
  12. package/lib/api/runtimes/snapshots.d.ts +1 -1
  13. package/lib/api/runtimes/snapshots.js +8 -8
  14. package/lib/api/runtimes/utils.js +1 -4
  15. package/lib/collaboration/DatalayerCollaboration.d.ts +9 -0
  16. package/lib/collaboration/DatalayerCollaboration.js +28 -0
  17. package/lib/collaboration/DatalayerCollaborationProvider.d.ts +54 -0
  18. package/lib/collaboration/DatalayerCollaborationProvider.js +162 -0
  19. package/lib/collaboration/index.d.ts +2 -0
  20. package/lib/collaboration/index.js +6 -0
  21. package/lib/components/avatars/BoringAvatar.d.ts +1 -1
  22. package/lib/components/avatars/BoringAvatar.js +2 -2
  23. package/lib/components/avatars/UserProfileAvatar.js +2 -9
  24. package/lib/components/banners/NoAutomationBanner.js +4 -4
  25. package/lib/components/buttons/DownloadCSVButton.js +1 -1
  26. package/lib/components/buttons/UploadButton.js +1 -1
  27. package/lib/components/checkout/StripeCheckout.d.ts +1 -1
  28. package/lib/components/checkout/StripeCheckout.js +6 -6
  29. package/lib/components/confetti/ConfettiSuccess.js +1 -1
  30. package/lib/components/context/OrganizationSelect.js +5 -5
  31. package/lib/components/context/SpaceSelect.js +7 -7
  32. package/lib/components/display/AvatarSkeleton.js +1 -1
  33. package/lib/components/display/CenteredSpinner.js +4 -4
  34. package/lib/components/display/CodePreview.js +4 -4
  35. package/lib/components/display/DatalayerBox.js +13 -14
  36. package/lib/components/display/HorizontalCenter.d.ts +1 -1
  37. package/lib/components/display/HorizontalCenter.js +1 -1
  38. package/lib/components/display/JupyterDialog.js +17 -15
  39. package/lib/components/display/NavLink.d.ts +4 -2
  40. package/lib/components/display/NavLink.js +6 -4
  41. package/lib/components/display/NotebookSkeleton.js +2 -2
  42. package/lib/components/display/Placeholder.js +1 -1
  43. package/lib/components/display/ToTopBranded.js +1 -1
  44. package/lib/components/echarts/EChartsReact.d.ts +1 -1
  45. package/lib/components/echarts/EChartsReact.js +1 -1
  46. package/lib/components/flashes/FlashClosable.js +11 -11
  47. package/lib/components/flashes/FlashDisclaimer.js +2 -3
  48. package/lib/components/flashes/FlashGuest.js +3 -4
  49. package/lib/components/flashes/FlashSurveys.js +3 -4
  50. package/lib/components/flashes/FlashUnauthorized.js +2 -2
  51. package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
  52. package/lib/components/flashes/surveys/Survey2025_1.js +62 -85
  53. package/lib/components/iam/ExternalTokenSilentLogin.js +6 -4
  54. package/lib/components/icons/ArtifactIcon.d.ts +2 -2
  55. package/lib/components/icons/ArtifactIcon.js +39 -39
  56. package/lib/components/labels/VisibilityLabel.js +2 -5
  57. package/lib/components/landings/StepBlock.d.ts +1 -1
  58. package/lib/components/landings/StepBlock.js +1 -1
  59. package/lib/components/navbar/NavigationVisbilityObserver.js +2 -2
  60. package/lib/components/navbar/SubdomainNavBar.js +45 -23
  61. package/lib/components/navbar/SubdomainNavBar.module.css +33 -14
  62. package/lib/components/nbgrader/NbGradesDetails.d.ts +1 -1
  63. package/lib/components/nbgrader/NbGradesDetails.js +5 -8
  64. package/lib/components/notebooks/JupyterNotebook.js +5 -5
  65. package/lib/components/notebooks/JupyterNotebookToolbar.js +3 -3
  66. package/lib/components/primer/Helper.d.ts +1 -1
  67. package/lib/components/primer/Helper.js +5 -3
  68. package/lib/components/primer/Portals.d.ts +1 -1
  69. package/lib/components/primer/Portals.js +2 -2
  70. package/lib/components/primer/Styles.js +1 -1
  71. package/lib/components/progress/ConsumptionBar.js +2 -2
  72. package/lib/components/progress/CreditsIndicator.d.ts +1 -1
  73. package/lib/components/progress/CreditsIndicator.js +4 -7
  74. package/lib/components/progress/ProgressRing.js +2 -2
  75. package/lib/components/runtimes/RuntimeCellVariables.js +9 -9
  76. package/lib/components/runtimes/RuntimeCellVariablesDialog.js +3 -3
  77. package/lib/components/runtimes/RuntimeLauncherDialog.js +30 -34
  78. package/lib/components/runtimes/RuntimePickerBase.js +42 -31
  79. package/lib/components/runtimes/RuntimePickerCell.js +9 -12
  80. package/lib/components/runtimes/RuntimePickerNotebook.js +44 -44
  81. package/lib/components/runtimes/RuntimeReservationControl.js +10 -15
  82. package/lib/components/runtimes/RuntimeSimplePicker.js +9 -12
  83. package/lib/components/runtimes/RuntimeUtils.js +22 -12
  84. package/lib/components/runtimes/RuntimeVariables.js +7 -7
  85. package/lib/components/screenshot/ScreenCapture.js +9 -13
  86. package/lib/components/screenshot/ScreenCaptureButton.d.ts +1 -1
  87. package/lib/components/screenshot/ScreenCaptureButton.js +14 -8
  88. package/lib/components/snapshots/RuntimeSnapshotMenu.js +19 -17
  89. package/lib/components/snippets/SnippetDialog.js +5 -5
  90. package/lib/components/storage/ContentsBrowser.js +63 -56
  91. package/lib/components/storage/ContentsItems.js +10 -8
  92. package/lib/components/students/StudentItemStatus.d.ts +1 -1
  93. package/lib/components/students/StudentItemStatus.js +35 -16
  94. package/lib/components/subnav/SubNav.d.ts +1 -1
  95. package/lib/components/subnav/SubNav.js +30 -15
  96. package/lib/components/subnav/SubNav.module.css +55 -21
  97. package/lib/components/tables/DataTable.js +1 -4
  98. package/lib/components/text-reveal/TextRevealAnimation.js +7 -2
  99. package/lib/components/text-reveal/TextRevealAnimation.module.css +4 -2
  100. package/lib/components/tokens/SpaceVariantToken.d.ts +1 -1
  101. package/lib/components/tokens/SpaceVariantToken.js +5 -5
  102. package/lib/components/toolbars/AssignmentEditorToolbar.js +1 -3
  103. package/lib/components/users/PeerIndicator.d.ts +1 -1
  104. package/lib/components/users/PeerIndicator.js +5 -5
  105. package/lib/config/Configuration.d.ts +48 -0
  106. package/lib/config/Configuration.js +42 -0
  107. package/lib/config/integrations/Loom.js +3 -3
  108. package/lib/examples/CellExample.d.ts +2 -2
  109. package/lib/examples/CellExample.js +34 -3
  110. package/lib/examples/DatalayerNotebookExample.d.ts +16 -0
  111. package/lib/examples/DatalayerNotebookExample.js +75 -0
  112. package/lib/examples/NativeNavigationExample.d.ts +8 -0
  113. package/lib/examples/NativeNavigationExample.js +97 -0
  114. package/lib/examples/NotebookExample.d.ts +1 -3
  115. package/lib/examples/NotebookExample.js +9 -7
  116. package/lib/examples/NotebookMutationsKernel.d.ts +2 -0
  117. package/lib/examples/NotebookMutationsKernel.js +115 -0
  118. package/lib/examples/NotebookMutationsServiceManager.d.ts +2 -0
  119. package/lib/examples/NotebookMutationsServiceManager.js +107 -0
  120. package/lib/examples/ReactRouterExample.d.ts +6 -0
  121. package/lib/examples/ReactRouterExample.js +175 -0
  122. package/lib/examples/example-selector.d.ts +22 -0
  123. package/lib/examples/example-selector.js +45 -0
  124. package/lib/examples/index.d.ts +2 -0
  125. package/lib/examples/index.js +6 -0
  126. package/lib/examples/main.js +153 -0
  127. package/lib/examples/notebooks/IPyWidgetsExample.ipynb.json +101 -0
  128. package/lib/examples/notebooks/IPyWidgetsExampleWithState.ipynb.json +112 -0
  129. package/lib/examples/{NotebookExample1.ipynb.json → notebooks/Lite.ipynb.json} +45 -53
  130. package/lib/examples/notebooks/Matplotlib.ipynb.json +137 -0
  131. package/lib/examples/notebooks/NotebookExample1.ipynb.json +126 -0
  132. package/lib/examples/notebooks/NotebookExample2.ipynb.json +48 -0
  133. package/lib/examples/notebooks/NotebookOutputs.ipynb.json +49 -0
  134. package/lib/examples/notebooks/NotebookToCExample.ipynb.json +102 -0
  135. package/lib/examples/notebooks/OutputIPyWidgetsExample.d.ts +145 -0
  136. package/lib/examples/notebooks/OutputIPyWidgetsExample.js +153 -0
  137. package/lib/examples/notebooks/PyGWalker.ipynb.json +55 -0
  138. package/lib/hooks/assets/OutputshotPlaceholders.d.ts +10 -10
  139. package/lib/hooks/assets/OutputshotPlaceholders.js +10 -10
  140. package/lib/hooks/index.d.ts +29 -28
  141. package/lib/hooks/index.js +29 -28
  142. package/lib/hooks/layouts/LayoutBackdrop.js +3 -6
  143. package/lib/hooks/layouts/LayoutScreenshot.css +1 -1
  144. package/lib/hooks/layouts/LayoutScreenshot.js +6 -6
  145. package/lib/hooks/useAIAgents.d.ts +1 -1
  146. package/lib/hooks/useAIAgents.js +6 -6
  147. package/lib/hooks/useAuthorization.js +4 -4
  148. package/lib/hooks/useBackdrop.js +7 -7
  149. package/lib/hooks/useBackdropJupyterLab.d.ts +1 -1
  150. package/lib/hooks/useBackdropJupyterLab.js +4 -4
  151. package/lib/hooks/useCache.d.ts +6 -2
  152. package/lib/hooks/useCache.js +233 -179
  153. package/lib/hooks/useCellOutputshot.js +3 -6
  154. package/lib/hooks/useContainsFocus.js +2 -1
  155. package/lib/hooks/useDatalayer.js +5 -3
  156. package/lib/hooks/useError.d.ts +1 -1
  157. package/lib/hooks/useError.js +2 -2
  158. package/lib/hooks/useExternalScript.js +4 -4
  159. package/lib/hooks/useFocusTrap.js +2 -1
  160. package/lib/hooks/useIAM.js +4 -5
  161. package/lib/hooks/useId.js +3 -3
  162. package/lib/hooks/useJupyterLabTheme.js +3 -1
  163. package/lib/hooks/useLocation.d.ts +22 -0
  164. package/lib/hooks/useLocation.js +149 -0
  165. package/lib/hooks/useLocationHandles.d.ts +2 -2
  166. package/lib/hooks/useLocationHandles.js +6 -4
  167. package/lib/hooks/useNavigate.d.ts +5 -1
  168. package/lib/hooks/useNavigate.js +62 -7
  169. package/lib/hooks/useNotebookAIAgent.js +3 -1
  170. package/lib/hooks/useParams.d.ts +5 -0
  171. package/lib/hooks/useParams.js +152 -0
  172. package/lib/hooks/useRuntimes.js +2 -2
  173. package/lib/hooks/useScreenshot.js +5 -5
  174. package/lib/hooks/useToast.js +15 -13
  175. package/lib/hooks/useUpload.js +9 -9
  176. package/lib/hooks/useUser.js +1 -1
  177. package/lib/index.css +1 -1
  178. package/lib/index.d.ts +6 -3
  179. package/lib/index.js +7 -3
  180. package/lib/mocks/components/FlashMock.js +4 -4
  181. package/lib/mocks/hooks/rests/rests.js +15 -18
  182. package/lib/mocks/hooks/useDatalayerMock.d.ts +2 -2
  183. package/lib/mocks/hooks/useDatalayerMock.js +7 -7
  184. package/lib/mocks/models/CodeBlockMock.js +1 -1
  185. package/lib/mocks/models/CodelineMock.js +1 -1
  186. package/lib/mocks/models/CourseMock.d.ts +1 -1
  187. package/lib/mocks/models/CourseMock.js +10 -10
  188. package/lib/mocks/models/InviteMock.d.ts +1 -1
  189. package/lib/mocks/models/InviteMock.js +21 -6
  190. package/lib/mocks/models/JupyterLabUserMock.js +2 -2
  191. package/lib/mocks/models/OrganisationMock.d.ts +1 -1
  192. package/lib/mocks/models/OrganisationMock.js +11 -7
  193. package/lib/mocks/models/SchoolMock.d.ts +1 -1
  194. package/lib/mocks/models/SchoolMock.js +6 -6
  195. package/lib/mocks/models/SpaceMock.d.ts +1 -1
  196. package/lib/mocks/models/SpaceMock.js +9 -9
  197. package/lib/mocks/models/TeamMock.d.ts +1 -1
  198. package/lib/mocks/models/TeamMock.js +6 -6
  199. package/lib/mocks/models/UserMock.d.ts +1 -1
  200. package/lib/mocks/models/UserMock.js +4 -6
  201. package/lib/mocks/views/ActionMenuMock.js +1 -1
  202. package/lib/mocks/views/ChartMock.js +3 -3
  203. package/lib/mocks/views/ChartMockOptions.js +24 -24
  204. package/lib/mocks/views/DashboardMock.js +74 -74
  205. package/lib/mocks/views/FormMock.js +1 -1
  206. package/lib/mocks/views/TableMock.js +1 -1
  207. package/lib/models/Account.d.ts +2 -2
  208. package/lib/models/Assignment.d.ts +2 -2
  209. package/lib/models/Cell.d.ts +1 -1
  210. package/lib/models/CodeBlock.d.ts +1 -1
  211. package/lib/models/CodefeedBlocks.d.ts +2 -2
  212. package/lib/models/Contact.d.ts +1 -1
  213. package/lib/models/Contact.js +14 -14
  214. package/lib/models/ContactIAMProvider.js +2 -2
  215. package/lib/models/Course.d.ts +7 -7
  216. package/lib/models/Dataset.d.ts +1 -1
  217. package/lib/models/Dean.d.ts +1 -1
  218. package/lib/models/Document.d.ts +1 -1
  219. package/lib/models/Environment.d.ts +2 -2
  220. package/lib/models/Exercise.d.ts +1 -1
  221. package/lib/models/IAMProviderLinked.js +1 -1
  222. package/lib/models/Instructor.d.ts +1 -1
  223. package/lib/models/Invite.d.ts +2 -2
  224. package/lib/models/Invite.js +1 -1
  225. package/lib/models/Item.d.ts +5 -5
  226. package/lib/models/LandingRoles.js +18 -18
  227. package/lib/models/Lesson.d.ts +1 -1
  228. package/lib/models/Member.d.ts +1 -1
  229. package/lib/models/Notebook.d.ts +1 -1
  230. package/lib/models/Organization.d.ts +4 -4
  231. package/lib/models/Organization.js +2 -2
  232. package/lib/models/OrganizationMember.d.ts +2 -2
  233. package/lib/models/Page.js +4 -2
  234. package/lib/models/PageTag.d.ts +1 -1
  235. package/lib/models/PageTag.js +56 -9
  236. package/lib/models/Profile.d.ts +1 -1
  237. package/lib/models/RolesOrganization.d.ts +1 -1
  238. package/lib/models/RolesOrganization.js +4 -12
  239. package/lib/models/RolesPlatform.d.ts +1 -1
  240. package/lib/models/RolesPlatform.js +12 -34
  241. package/lib/models/RolesTeam.d.ts +1 -1
  242. package/lib/models/RolesTeam.js +3 -10
  243. package/lib/models/Runtime.js +4 -4
  244. package/lib/models/RuntimeSnapshot.js +1 -1
  245. package/lib/models/School.d.ts +4 -4
  246. package/lib/models/Space.d.ts +5 -5
  247. package/lib/models/Space.js +3 -3
  248. package/lib/models/SpaceItem.d.ts +8 -8
  249. package/lib/models/SpaceMember.d.ts +2 -2
  250. package/lib/models/Student.d.ts +2 -2
  251. package/lib/models/StudentItem.d.ts +3 -3
  252. package/lib/models/Team.d.ts +3 -3
  253. package/lib/models/Team.js +2 -2
  254. package/lib/models/TeamMember.d.ts +2 -2
  255. package/lib/models/URN.js +1 -1
  256. package/lib/models/User.d.ts +2 -2
  257. package/lib/models/User.js +5 -3
  258. package/lib/models/UserOnboarding.d.ts +1 -1
  259. package/lib/models/UserOnboarding.js +7 -7
  260. package/lib/models/UserSettings.js +2 -2
  261. package/lib/models/index.d.ts +2 -2
  262. package/lib/models/index.js +2 -2
  263. package/lib/navigation/adapters/native.d.ts +11 -0
  264. package/lib/navigation/adapters/native.js +48 -0
  265. package/lib/navigation/adapters/nextjs.d.ts +9 -0
  266. package/lib/navigation/adapters/nextjs.js +35 -0
  267. package/lib/navigation/adapters/react-router.d.ts +4 -0
  268. package/lib/navigation/adapters/react-router.js +12 -0
  269. package/lib/navigation/components.d.ts +20 -0
  270. package/lib/navigation/components.js +36 -0
  271. package/lib/navigation/index.d.ts +4 -0
  272. package/lib/navigation/index.js +12 -0
  273. package/lib/routes/index.d.ts +1 -1
  274. package/lib/routes/index.js +1 -1
  275. package/lib/services/DatalayerServiceManager.d.ts +22 -0
  276. package/lib/services/DatalayerServiceManager.js +79 -0
  277. package/lib/services/index.d.ts +4 -0
  278. package/lib/services/index.js +7 -0
  279. package/lib/services/reconnectToRuntime.d.ts +32 -0
  280. package/lib/services/reconnectToRuntime.js +59 -0
  281. package/lib/state/State.d.ts +1 -1
  282. package/lib/state/State.js +1 -1
  283. package/lib/state/index.d.ts +1 -1
  284. package/lib/state/index.js +1 -1
  285. package/lib/state/storage/IAMStorage.js +14 -2
  286. package/lib/state/storage/index.d.ts +1 -1
  287. package/lib/state/storage/index.js +1 -1
  288. package/lib/state/substates/AIAgentState.js +4 -2
  289. package/lib/state/substates/CellState.js +6 -5
  290. package/lib/state/substates/CoreState.d.ts +1 -1
  291. package/lib/state/substates/CoreState.js +23 -15
  292. package/lib/state/substates/DatasourceState.js +1 -1
  293. package/lib/state/substates/IAMState.d.ts +4 -0
  294. package/lib/state/substates/IAMState.js +75 -56
  295. package/lib/state/substates/JupyterLabState.js +1 -1
  296. package/lib/state/substates/LayoutState.d.ts +2 -2
  297. package/lib/state/substates/LayoutState.js +41 -28
  298. package/lib/state/substates/OrganizationState.js +1 -1
  299. package/lib/state/substates/RuntimesState.js +6 -5
  300. package/lib/state/substates/SpaceState.js +1 -1
  301. package/lib/state/substates/SurveysState.js +4 -4
  302. package/lib/state/substates/TeamState.js +1 -1
  303. package/lib/test-setup.js +25 -3
  304. package/lib/theme/DatalayerTheme.js +1 -1
  305. package/lib/theme/DatalayerThemeProvider.js +17 -14
  306. package/lib/theme/Palette.js +1 -1
  307. package/lib/utils/Avatar.js +2 -2
  308. package/lib/utils/Browser.js +6 -6
  309. package/lib/utils/Cells.d.ts +1 -1
  310. package/lib/utils/Cookie.js +1 -1
  311. package/lib/utils/Date.js +2 -2
  312. package/lib/utils/Download.js +5 -3
  313. package/lib/utils/DownloadFile.js +4 -2
  314. package/lib/utils/Env.js +2 -1
  315. package/lib/utils/Lazy.d.ts +1 -1
  316. package/lib/utils/Lazy.js +2 -2
  317. package/lib/utils/Name.js +10 -8
  318. package/lib/utils/Notebook.d.ts +1 -1
  319. package/lib/utils/Notebook.js +3 -3
  320. package/lib/utils/Number.js +13 -9
  321. package/lib/utils/Plots.js +4 -4
  322. package/lib/utils/Screenshot.js +1 -1
  323. package/lib/utils/Sleep.js +1 -1
  324. package/lib/utils/Snapshot.js +2 -2
  325. package/lib/utils/String.js +2 -2
  326. package/lib/utils/Uri.js +1 -1
  327. package/lib/utils/WithSuspense.js +3 -6
  328. package/package.json +41 -5
  329. package/lib/__tests__/App.test.js +0 -17
  330. /package/lib/{__tests__/App.test.d.ts → examples/main.d.ts} +0 -0
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ // Global event emitter for navigation changes
6
+ const navigationListeners = new Set();
7
+ const notifyNavigationChange = () => {
8
+ navigationListeners.forEach(listener => listener());
9
+ };
10
+ /**
11
+ * Create native browser navigation function
12
+ */
13
+ export const createNativeNavigate = () => {
14
+ return (to, options) => {
15
+ if (typeof window === 'undefined')
16
+ return;
17
+ // Parse the URL
18
+ const url = new URL(to, window.location.href);
19
+ // Use options if provided, otherwise default to empty object
20
+ const navOptions = options || {};
21
+ const state = navOptions.state || null;
22
+ if (navOptions.replace) {
23
+ window.history.replaceState(state, '', url.href);
24
+ // Dispatch custom event for location hooks
25
+ window.dispatchEvent(new Event('replacestate'));
26
+ }
27
+ else {
28
+ window.history.pushState(state, '', url.href);
29
+ // Dispatch custom event for location hooks
30
+ window.dispatchEvent(new Event('pushstate'));
31
+ }
32
+ // Notify all listeners of the navigation
33
+ notifyNavigationChange();
34
+ // Handle scrolling
35
+ if (navOptions.scroll !== false) {
36
+ window.scrollTo(0, 0);
37
+ }
38
+ };
39
+ };
40
+ /**
41
+ * Simple native adapter for backward compatibility
42
+ */
43
+ export const createNativeAdapter = () => {
44
+ return {
45
+ name: 'native',
46
+ isAvailable: () => typeof window !== 'undefined' && !!window.history && !!window.location,
47
+ };
48
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Check if we're in a Next.js environment
3
+ */
4
+ export declare const isNextJsEnvironment: () => boolean;
5
+ export declare const useParamsNext: any;
6
+ export declare const useSearchParamsNext: any;
7
+ export declare const useRouterNext: any;
8
+ export declare const usePathnameNext: any;
9
+ export declare const useRouterNextPages: any;
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ // Try to import Next.js modules if available
6
+ let nextNavigationModule = null;
7
+ let nextRouterModule = null;
8
+ // Only try to load Next.js modules if we're in a Next.js environment
9
+ if (typeof window !== 'undefined' && window.__NEXT_DATA__) {
10
+ try {
11
+ nextNavigationModule = require('next/navigation');
12
+ }
13
+ catch {
14
+ // Next.js App Router not available
15
+ }
16
+ try {
17
+ nextRouterModule = require('next/router');
18
+ }
19
+ catch {
20
+ // Next.js Pages Router not available
21
+ }
22
+ }
23
+ /**
24
+ * Check if we're in a Next.js environment
25
+ */
26
+ export const isNextJsEnvironment = () => {
27
+ return typeof window !== 'undefined' && window.__NEXT_DATA__;
28
+ };
29
+ // Export App Router hooks directly for synchronous access
30
+ export const useParamsNext = nextNavigationModule?.useParams || undefined;
31
+ export const useSearchParamsNext = nextNavigationModule?.useSearchParams || undefined;
32
+ export const useRouterNext = nextNavigationModule?.useRouter || undefined;
33
+ export const usePathnameNext = nextNavigationModule?.usePathname || undefined;
34
+ // Export Pages Router hooks (for potential future use)
35
+ export const useRouterNextPages = nextRouterModule?.useRouter || undefined;
@@ -0,0 +1,4 @@
1
+ import * as ReactRouterDom from 'react-router-dom';
2
+ export declare const useParamsRR: typeof ReactRouterDom.useParams;
3
+ export declare const useLocationRR: typeof ReactRouterDom.useLocation;
4
+ export declare const useNavigateRR: typeof ReactRouterDom.useNavigate;
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ // Import React Router hooks directly
6
+ // If react-router-dom is not installed, the build will fail
7
+ // which is expected behavior
8
+ import * as ReactRouterDom from 'react-router-dom';
9
+ // Export hooks for use in our navigation hooks
10
+ export const useParamsRR = ReactRouterDom.useParams;
11
+ export const useLocationRR = ReactRouterDom.useLocation;
12
+ export const useNavigateRR = ReactRouterDom.useNavigate;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ export interface NavigationLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
3
+ to: string;
4
+ replace?: boolean;
5
+ state?: any;
6
+ }
7
+ /**
8
+ * Navigation link component that works with any routing solution
9
+ */
10
+ export declare const NavigationLink: React.ForwardRefExoticComponent<NavigationLinkProps & React.RefAttributes<HTMLAnchorElement>>;
11
+ /**
12
+ * Compatibility export for react-router-dom Link
13
+ * @deprecated Use NavigationLink
14
+ */
15
+ export declare const Link: React.ForwardRefExoticComponent<NavigationLinkProps & React.RefAttributes<HTMLAnchorElement>>;
16
+ /**
17
+ * Compatibility export for react-router-dom NavLink
18
+ * @deprecated Use NavigationLink with custom styling
19
+ */
20
+ export declare const NavLink: React.ForwardRefExoticComponent<NavigationLinkProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright (c) 2023-2025 Datalayer, Inc.
4
+ * Distributed under the terms of the Modified BSD License.
5
+ */
6
+ import { forwardRef, useCallback } from 'react';
7
+ import { useNavigate } from '../hooks/useNavigate';
8
+ /**
9
+ * Navigation link component that works with any routing solution
10
+ */
11
+ export const NavigationLink = forwardRef(({ to, children, replace = false, state, onClick, ...props }, ref) => {
12
+ const navigate = useNavigate();
13
+ const handleClick = useCallback((e) => {
14
+ // Allow custom onClick handler
15
+ if (onClick) {
16
+ onClick(e);
17
+ }
18
+ // If not prevented, navigate
19
+ if (!e.defaultPrevented) {
20
+ e.preventDefault();
21
+ navigate(to, e, true, { replace, state });
22
+ }
23
+ }, [to, replace, state, navigate, onClick]);
24
+ return (_jsx("a", { ref: ref, href: to, onClick: handleClick, ...props, children: children }));
25
+ });
26
+ NavigationLink.displayName = 'NavigationLink';
27
+ /**
28
+ * Compatibility export for react-router-dom Link
29
+ * @deprecated Use NavigationLink
30
+ */
31
+ export const Link = NavigationLink;
32
+ /**
33
+ * Compatibility export for react-router-dom NavLink
34
+ * @deprecated Use NavigationLink with custom styling
35
+ */
36
+ export const NavLink = NavigationLink;
@@ -0,0 +1,4 @@
1
+ export { useParamsRR, useLocationRR, useNavigateRR, } from './adapters/react-router';
2
+ export { useParamsNext, useSearchParamsNext, useRouterNext, usePathnameNext, useRouterNextPages, isNextJsEnvironment, } from './adapters/nextjs';
3
+ export { createNativeAdapter, createNativeNavigate } from './adapters/native';
4
+ export { NavigationLink, Link, NavLink } from './components';
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ // Export React Router hook exports for direct use
6
+ export { useParamsRR, useLocationRR, useNavigateRR, } from './adapters/react-router';
7
+ // Export Next.js hook exports for direct use
8
+ export { useParamsNext, useSearchParamsNext, useRouterNext, usePathnameNext, useRouterNextPages, isNextJsEnvironment, } from './adapters/nextjs';
9
+ // Native adapter utilities
10
+ export { createNativeAdapter, createNativeNavigate } from './adapters/native';
11
+ // Export components if they exist
12
+ export { NavigationLink, Link, NavLink } from './components';
@@ -1 +1 @@
1
- export * from "./Routes";
1
+ export * from './Routes';
@@ -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 "./Routes";
5
+ export * from './Routes';
@@ -0,0 +1,22 @@
1
+ import { ServiceManager } from '@jupyterlab/services';
2
+ /**
3
+ * Creates a ServiceManager configured for Datalayer's infrastructure
4
+ *
5
+ * This function requests a new kernel from Datalayer's platform and
6
+ * returns a configured ServiceManager that connects to the allocated
7
+ * Jupyter server instance.
8
+ *
9
+ * @param environmentName - The name of the Datalayer environment to use
10
+ * @param credits - The credit limit for this kernel session
11
+ * @returns A configured ServiceManager instance
12
+ * @throws Error if the kernel request fails or configuration is missing
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const serviceManager = await createDatalayerServiceManager('python-cpu-env', 100);
17
+ * await serviceManager.ready;
18
+ * // Use the service manager with notebooks
19
+ * ```
20
+ */
21
+ export declare const createDatalayerServiceManager: (environmentName?: string, credits?: number) => Promise<ServiceManager.IManager>;
22
+ export default createDatalayerServiceManager;
@@ -0,0 +1,79 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ import { ServerConnection, ServiceManager } from '@jupyterlab/services';
6
+ import { coreStore } from '../state/substates/CoreState';
7
+ import { DEFAULT_DATALAYER_CONFIG } from '../config/Configuration';
8
+ import { createRuntime } from '../api/runtimes/actions';
9
+ /**
10
+ * Creates a ServiceManager configured for Datalayer's infrastructure
11
+ *
12
+ * This function requests a new kernel from Datalayer's platform and
13
+ * returns a configured ServiceManager that connects to the allocated
14
+ * Jupyter server instance.
15
+ *
16
+ * @param environmentName - The name of the Datalayer environment to use
17
+ * @param credits - The credit limit for this kernel session
18
+ * @returns A configured ServiceManager instance
19
+ * @throws Error if the kernel request fails or configuration is missing
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const serviceManager = await createDatalayerServiceManager('python-cpu-env', 100);
24
+ * await serviceManager.ready;
25
+ * // Use the service manager with notebooks
26
+ * ```
27
+ */
28
+ export const createDatalayerServiceManager = async (environmentName, credits) => {
29
+ const { configuration } = coreStore.getState();
30
+ const token = configuration?.token || '';
31
+ // Use provided values or fall back to config or defaults
32
+ const actualEnvironmentName = environmentName ||
33
+ configuration?.cpuEnvironment ||
34
+ DEFAULT_DATALAYER_CONFIG.cpuEnvironment;
35
+ const actualCredits = credits ?? configuration?.credits ?? DEFAULT_DATALAYER_CONFIG.credits;
36
+ if (!token) {
37
+ throw new Error('Datalayer API token is required to create a service manager');
38
+ }
39
+ try {
40
+ // Use the existing createRuntime function which handles auth properly
41
+ const runtime = await createRuntime({
42
+ environmentName: actualEnvironmentName,
43
+ type: 'notebook',
44
+ givenName: `Jupyter React Kernel - ${new Date().toISOString()}`,
45
+ creditsLimit: actualCredits,
46
+ capabilities: [],
47
+ });
48
+ const serverSettings = ServerConnection.makeSettings({
49
+ baseUrl: runtime.ingress,
50
+ wsUrl: runtime.ingress.replace(/^http/, 'ws'),
51
+ token: runtime.token,
52
+ appendToken: true,
53
+ });
54
+ const serviceManager = new ServiceManager({ serverSettings });
55
+ // Store runtime info on the serviceManager instance for access
56
+ serviceManager.__datalayerRuntime = {
57
+ environmentName: actualEnvironmentName,
58
+ credits: actualCredits,
59
+ reservationId: runtime.reservation_id,
60
+ podName: runtime.pod_name,
61
+ ingress: runtime.ingress,
62
+ token: runtime.token,
63
+ createdAt: new Date().toISOString(),
64
+ };
65
+ console.log('Created Datalayer service manager:', {
66
+ environmentName: actualEnvironmentName,
67
+ credits: actualCredits,
68
+ reservationId: runtime.reservation_id,
69
+ podName: runtime.pod_name,
70
+ ingress: runtime.ingress,
71
+ });
72
+ return serviceManager;
73
+ }
74
+ catch (error) {
75
+ console.error('Error creating Datalayer service manager:', error);
76
+ throw error;
77
+ }
78
+ };
79
+ export default createDatalayerServiceManager;
@@ -0,0 +1,4 @@
1
+ export { createDatalayerServiceManager } from './DatalayerServiceManager';
2
+ export { default as DatalayerServiceManager } from './DatalayerServiceManager';
3
+ export { reconnectToRuntime } from './reconnectToRuntime';
4
+ export type { RuntimeInfo } from './reconnectToRuntime';
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ export { createDatalayerServiceManager } from './DatalayerServiceManager';
6
+ export { default as DatalayerServiceManager } from './DatalayerServiceManager';
7
+ export { reconnectToRuntime } from './reconnectToRuntime';
@@ -0,0 +1,32 @@
1
+ import { ServiceManager } from '@jupyterlab/services';
2
+ export interface RuntimeInfo {
3
+ runtimeId: string;
4
+ podName: string;
5
+ ingress: string;
6
+ token: string;
7
+ environmentName?: string;
8
+ }
9
+ /**
10
+ * Reconnects to an existing Datalayer runtime
11
+ *
12
+ * This function creates a ServiceManager that connects to an already
13
+ * allocated Jupyter server instance using stored runtime information.
14
+ *
15
+ * @param runtimeInfo - The stored runtime information
16
+ * @returns A configured ServiceManager instance
17
+ * @throws Error if the reconnection fails
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const runtimeInfo = {
22
+ * runtimeId: 'abc123',
23
+ * podName: 'jupyter-pod-xyz',
24
+ * ingress: 'https://jupyter.example.com',
25
+ * token: 'secret-token'
26
+ * };
27
+ * const serviceManager = await reconnectToRuntime(runtimeInfo);
28
+ * await serviceManager.ready;
29
+ * ```
30
+ */
31
+ export declare const reconnectToRuntime: (runtimeInfo: RuntimeInfo) => Promise<ServiceManager.IManager>;
32
+ export default reconnectToRuntime;
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ import { ServerConnection, ServiceManager } from '@jupyterlab/services';
6
+ /**
7
+ * Reconnects to an existing Datalayer runtime
8
+ *
9
+ * This function creates a ServiceManager that connects to an already
10
+ * allocated Jupyter server instance using stored runtime information.
11
+ *
12
+ * @param runtimeInfo - The stored runtime information
13
+ * @returns A configured ServiceManager instance
14
+ * @throws Error if the reconnection fails
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const runtimeInfo = {
19
+ * runtimeId: 'abc123',
20
+ * podName: 'jupyter-pod-xyz',
21
+ * ingress: 'https://jupyter.example.com',
22
+ * token: 'secret-token'
23
+ * };
24
+ * const serviceManager = await reconnectToRuntime(runtimeInfo);
25
+ * await serviceManager.ready;
26
+ * ```
27
+ */
28
+ export const reconnectToRuntime = async (runtimeInfo) => {
29
+ try {
30
+ const serverSettings = ServerConnection.makeSettings({
31
+ baseUrl: runtimeInfo.ingress,
32
+ wsUrl: runtimeInfo.ingress.replace(/^http/, 'ws'),
33
+ token: runtimeInfo.token,
34
+ appendToken: true,
35
+ });
36
+ const serviceManager = new ServiceManager({ serverSettings });
37
+ // Store runtime info on the serviceManager instance for access
38
+ serviceManager.__datalayerRuntime = {
39
+ environmentName: runtimeInfo.environmentName || 'unknown',
40
+ credits: 0,
41
+ reservationId: runtimeInfo.runtimeId,
42
+ podName: runtimeInfo.podName,
43
+ ingress: runtimeInfo.ingress,
44
+ token: runtimeInfo.token,
45
+ createdAt: new Date().toISOString(),
46
+ };
47
+ console.log('Reconnected to existing runtime:', {
48
+ runtimeId: runtimeInfo.runtimeId,
49
+ podName: runtimeInfo.podName,
50
+ ingress: runtimeInfo.ingress,
51
+ });
52
+ return serviceManager;
53
+ }
54
+ catch (error) {
55
+ console.error('Error reconnecting to runtime:', error);
56
+ throw error;
57
+ }
58
+ };
59
+ export default reconnectToRuntime;
@@ -19,7 +19,7 @@ export type DatalayerRunState = {
19
19
  document: typeof documentStore.getState;
20
20
  grade: typeof gradeStore.getState;
21
21
  iam: typeof iamStore.getState;
22
- kernels: typeof runtimesStore.getState;
22
+ runtimes: typeof runtimesStore.getState;
23
23
  layout: typeof layoutStore.getState;
24
24
  nbformat: typeof nbformatStore.getState;
25
25
  organization: typeof organizationStore.getState;
@@ -30,7 +30,7 @@ export const runStore = createStore((set, get) => ({
30
30
  document: documentStore.getState,
31
31
  grade: gradeStore.getState,
32
32
  iam: iamStore.getState,
33
- kernels: runtimesStore.getState,
33
+ runtimes: runtimesStore.getState,
34
34
  layout: layoutStore.getState,
35
35
  nbformat: nbformatStore.getState,
36
36
  organization: organizationStore.getState,
@@ -1,3 +1,3 @@
1
- export * from "./storage";
1
+ export * from './storage';
2
2
  export * from './State';
3
3
  export * from './substates';
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from "./storage";
5
+ export * from './storage';
6
6
  export * from './State';
7
7
  export * from './substates';
@@ -13,6 +13,9 @@ export const JWT_REFRESH_TOKEN_COOKIE_NAME = 'refresh_token';
13
13
  * Return the user from the local storage.
14
14
  */
15
15
  export const getStoredUser = () => {
16
+ if (typeof window === 'undefined') {
17
+ return ANONYMOUS_USER;
18
+ }
16
19
  const user = window.localStorage.getItem(DATALAYER_IAM_USER_KEY);
17
20
  if (user) {
18
21
  try {
@@ -30,6 +33,9 @@ export const getStoredUser = () => {
30
33
  * Set the user in the local storage.
31
34
  */
32
35
  export const storeUser = (user) => {
36
+ if (typeof window === 'undefined') {
37
+ return;
38
+ }
33
39
  if (user) {
34
40
  window.localStorage.setItem(DATALAYER_IAM_USER_KEY, JSON.stringify(user));
35
41
  }
@@ -41,6 +47,9 @@ export const storeUser = (user) => {
41
47
  * Return the IAM token from the local storage.
42
48
  */
43
49
  export const getStoredToken = () => {
50
+ if (typeof window === 'undefined') {
51
+ return ANONYMOUS_USER_TOKEN;
52
+ }
44
53
  const token = window.localStorage.getItem(DATALAYER_IAM_TOKEN_KEY);
45
54
  if (token) {
46
55
  return token;
@@ -51,6 +60,9 @@ export const getStoredToken = () => {
51
60
  * Set the IAM token in the local storage.
52
61
  */
53
62
  export const storeToken = (token) => {
63
+ if (typeof window === 'undefined') {
64
+ return;
65
+ }
54
66
  if (token) {
55
67
  if (token !== ANONYMOUS_USER_TOKEN) {
56
68
  try {
@@ -58,11 +70,11 @@ export const storeToken = (token) => {
58
70
  console.debug('JWT Token', jwt);
59
71
  }
60
72
  catch (error) {
61
- console.error("Error while decoding JWT Token.", error);
73
+ console.error('Error while decoding JWT Token.', error);
62
74
  throw error;
63
75
  }
64
76
  }
65
- localStorage.setItem(DATALAYER_IAM_TOKEN_KEY, token);
77
+ window.localStorage.setItem(DATALAYER_IAM_TOKEN_KEY, token);
66
78
  }
67
79
  else {
68
80
  window.localStorage.removeItem(DATALAYER_IAM_TOKEN_KEY);
@@ -1 +1 @@
1
- export * from "./IAMStorage";
1
+ export * from './IAMStorage';
@@ -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 "./IAMStorage";
5
+ export * from './IAMStorage';
@@ -18,7 +18,9 @@ export const aiAgentStore = createStore(set => ({
18
18
  },
19
19
  deleteAIAgent: (documentId) => {
20
20
  set((state) => {
21
- return { aiAgents: state.aiAgents.filter(a => a.documentId === documentId) };
21
+ return {
22
+ aiAgents: state.aiAgents.filter(a => a.documentId === documentId),
23
+ };
22
24
  });
23
25
  },
24
26
  updateAIAgent: (documentId, runtimeId) => {
@@ -32,7 +34,7 @@ export const aiAgentStore = createStore(set => ({
32
34
  return {};
33
35
  }
34
36
  });
35
- }
37
+ },
36
38
  }));
37
39
  export function useAIAgentStore(selector) {
38
40
  return useStore(aiAgentStore, selector);
@@ -8,11 +8,12 @@ export const cellStore = createStore((set, get) => ({
8
8
  cell: undefined,
9
9
  create: (cell) => set((state) => ({ cell })),
10
10
  update: (cell) => set((state) => ({
11
- cell: cell ? {
12
- ...state.cell,
13
- ...cell,
14
- }
15
- : undefined
11
+ cell: cell
12
+ ? {
13
+ ...state.cell,
14
+ ...cell,
15
+ }
16
+ : undefined,
16
17
  })),
17
18
  }));
18
19
  export function useCellStore(selector) {
@@ -1,4 +1,4 @@
1
- import type { IDatalayerCoreConfig } from '../../config';
1
+ import type { IDatalayerCoreConfig } from '../../config/Configuration';
2
2
  export type DatalayerCoreState = {
3
3
  tab: number;
4
4
  getIntTab: () => number;
@@ -6,6 +6,11 @@ import { createStore } from 'zustand/vanilla';
6
6
  import { useStore } from 'zustand';
7
7
  let loadConfigurationFromServer = true;
8
8
  let initialConfiguration = {
9
+ runUrl: 'https://prod1.datalayer.run',
10
+ token: '',
11
+ credits: 0,
12
+ cpuEnvironment: 'python-cpu-env"',
13
+ gpuEnvironment: 'ai-env',
9
14
  useMock: false,
10
15
  whiteLabel: true,
11
16
  loadConfigurationFromServer: true,
@@ -23,7 +28,7 @@ let initialConfiguration = {
23
28
  category: 'Datalayer',
24
29
  name: 'Datalayer Runtimes',
25
30
  icon: 'https://raw.githubusercontent.com/datalayer/icons/main/svg/data1/jupyter-base.svg',
26
- rank: 1
31
+ rank: 1,
27
32
  },
28
33
  brand: {
29
34
  name: 'Datalayer',
@@ -36,22 +41,25 @@ let initialConfiguration = {
36
41
  termsUrl: 'https://datalayer.app/terms',
37
42
  pricingUrl: 'https://datalayer.app/pricing',
38
43
  privacyUrl: 'https://datalayer.app/privacy',
39
- }
44
+ },
40
45
  };
41
46
  // Try loading initial state from datalayer-config-data element
42
47
  try {
43
- const rawConfig = document.getElementById('datalayer-config-data');
44
- if (rawConfig?.innerText) {
45
- const htmlOverridingConfiguration = JSON.parse(rawConfig?.innerText || '{}');
46
- if (htmlOverridingConfiguration.loadConfigurationFromServer != undefined) {
47
- loadConfigurationFromServer = htmlOverridingConfiguration.loadConfigurationFromServer;
48
+ if (typeof document !== 'undefined') {
49
+ const rawConfig = document.getElementById('datalayer-config-data');
50
+ if (rawConfig?.innerText) {
51
+ const htmlOverridingConfiguration = JSON.parse(rawConfig?.innerText || '{}');
52
+ if (htmlOverridingConfiguration.loadConfigurationFromServer != undefined) {
53
+ loadConfigurationFromServer =
54
+ htmlOverridingConfiguration.loadConfigurationFromServer;
55
+ }
56
+ initialConfiguration = {
57
+ ...initialConfiguration,
58
+ ...htmlOverridingConfiguration,
59
+ };
60
+ console.log('Datalayer configuration loaded from HTML page', initialConfiguration);
61
+ window.document.title = `${initialConfiguration.brand.name} Ξ ${initialConfiguration.brand.about}`;
48
62
  }
49
- initialConfiguration = {
50
- ...initialConfiguration,
51
- ...htmlOverridingConfiguration,
52
- };
53
- console.log('Datalayer configuration loaded from HTML page', initialConfiguration);
54
- window.document.title = `${initialConfiguration.brand.name} Ξ ${initialConfiguration.brand.about}`;
55
63
  }
56
64
  }
57
65
  catch (error) {
@@ -67,8 +75,8 @@ export const coreStore = createStore((set, get) => ({
67
75
  set(state => ({
68
76
  configuration: {
69
77
  ...state.configuration,
70
- ...configuration
71
- }
78
+ ...configuration,
79
+ },
72
80
  }));
73
81
  },
74
82
  version: '',
@@ -7,7 +7,7 @@ import { useStore } from 'zustand';
7
7
  export const datasourceStore = createStore((set, get) => ({
8
8
  datasources: [],
9
9
  updateDatasources: (datasources) => set((state) => ({
10
- datasources
10
+ datasources,
11
11
  })),
12
12
  }));
13
13
  export function useDatasourceStore(selector) {
@@ -40,6 +40,10 @@ export type IIAMState = {
40
40
  * IAM service version
41
41
  */
42
42
  version: string;
43
+ /**
44
+ * Flag to indicate if login is in progress
45
+ */
46
+ isLoginInProgress?: boolean;
43
47
  };
44
48
  export type IAMState = IIAMState & {
45
49
  addIAMProviderAuthorizationURL: (provider: IIAMProviderName, authorizationURL: IAMProviderAuthorizationURL) => void;