@datalayer/core 1.0.2 → 1.0.11
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.
- package/README.md +1 -1
- package/lib/api/constants.d.ts +6 -0
- package/lib/api/constants.js +6 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +1 -0
- package/lib/api/otel/index.d.ts +12 -0
- package/lib/api/otel/index.js +16 -0
- package/lib/api/otel/logs.d.ts +19 -0
- package/lib/api/otel/logs.js +43 -0
- package/lib/api/otel/metrics.d.ts +31 -0
- package/lib/api/otel/metrics.js +65 -0
- package/lib/api/otel/query.d.ts +16 -0
- package/lib/api/otel/query.js +37 -0
- package/lib/api/otel/services.d.ts +39 -0
- package/lib/api/otel/services.js +81 -0
- package/lib/api/otel/traces.d.ts +24 -0
- package/lib/api/otel/traces.js +53 -0
- package/lib/api/otel/types.d.ts +112 -0
- package/lib/api/otel/types.js +5 -0
- package/lib/api/runtimes/checkpoints.d.ts +122 -0
- package/lib/api/runtimes/checkpoints.js +118 -0
- package/lib/api/runtimes/index.d.ts +1 -0
- package/lib/api/runtimes/index.js +1 -0
- package/lib/api/runtimes/runtimes.d.ts +84 -0
- package/lib/api/runtimes/runtimes.js +50 -0
- package/lib/components/auth/Login.js +1 -1
- package/lib/components/display/BusyDots.d.ts +9 -0
- package/lib/components/display/BusyDots.js +31 -0
- package/lib/components/display/LiveRelativeTime.d.ts +10 -0
- package/lib/components/display/LiveRelativeTime.js +21 -0
- package/lib/components/display/index.d.ts +2 -0
- package/lib/components/display/index.js +2 -0
- package/lib/components/flashes/FlashSurveys.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/navbar/SubdomainNavBar.js +1 -1
- package/lib/components/progress/ConsumptionBar.js +6 -7
- package/lib/components/progress/CreditsIndicator.js +2 -2
- package/lib/components/progress/consumption.d.ts +12 -0
- package/lib/components/progress/consumption.js +31 -0
- package/lib/components/progress/index.d.ts +1 -0
- package/lib/components/progress/index.js +1 -0
- package/lib/components/sparklines/Sparklines.d.ts +16 -0
- package/lib/components/sparklines/Sparklines.js +65 -0
- package/lib/components/sparklines/SparklinesLine.d.ts +8 -0
- package/lib/components/sparklines/SparklinesLine.js +37 -0
- package/lib/components/sparklines/dataProcessing.d.ts +25 -0
- package/lib/components/sparklines/dataProcessing.js +35 -0
- package/lib/components/sparklines/index.d.ts +4 -0
- package/lib/components/sparklines/index.js +7 -0
- package/lib/components/sparklines/types.d.ts +36 -0
- package/lib/components/sparklines/types.js +5 -0
- package/lib/components/storage/ContentsBrowser.js +17 -1
- package/lib/components/subnav/SubNav.js +1 -1
- package/lib/config/Configuration.d.ts +4 -0
- package/lib/hooks/useCache.d.ts +6 -63
- package/lib/hooks/useCache.js +35 -205
- package/lib/hooks/useProjects.d.ts +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -0
- package/lib/models/ItemDTO.js +1 -1
- package/lib/models/RolesPlatform.js +2 -2
- package/lib/models/User.d.ts +2 -0
- package/lib/models/User.js +4 -1
- package/lib/otel/client/OtelClient.d.ts +93 -0
- package/lib/otel/client/OtelClient.js +232 -0
- package/lib/otel/client/index.d.ts +2 -0
- package/lib/otel/client/index.js +5 -0
- package/lib/otel/hooks/index.d.ts +186 -0
- package/lib/otel/hooks/index.js +532 -0
- package/lib/otel/index.d.ts +34 -0
- package/lib/otel/index.js +23 -0
- package/lib/otel/types.d.ts +190 -0
- package/lib/otel/types.js +5 -0
- package/lib/otel/utils.d.ts +33 -0
- package/lib/otel/utils.js +181 -0
- package/lib/otel/views/OtelLive.d.ts +12 -0
- package/lib/otel/views/OtelLive.js +372 -0
- package/lib/otel/views/OtelLogsList.d.ts +11 -0
- package/lib/otel/views/OtelLogsList.js +137 -0
- package/lib/otel/views/OtelMetricsChart.d.ts +22 -0
- package/lib/otel/views/OtelMetricsChart.js +300 -0
- package/lib/otel/views/OtelMetricsList.d.ts +15 -0
- package/lib/otel/views/OtelMetricsList.js +213 -0
- package/lib/otel/views/OtelSearchBar.d.ts +11 -0
- package/lib/otel/views/OtelSearchBar.js +22 -0
- package/lib/otel/views/OtelSpanDetail.d.ts +11 -0
- package/lib/otel/views/OtelSpanDetail.js +172 -0
- package/lib/otel/views/OtelSpanTree.d.ts +11 -0
- package/lib/otel/views/OtelSpanTree.js +176 -0
- package/lib/otel/views/OtelSqlView.d.ts +16 -0
- package/lib/otel/views/OtelSqlView.js +239 -0
- package/lib/otel/views/OtelSystemView.d.ts +15 -0
- package/lib/otel/views/OtelSystemView.js +75 -0
- package/lib/otel/views/OtelTimeline.d.ts +11 -0
- package/lib/otel/views/OtelTimeline.js +101 -0
- package/lib/otel/views/OtelTimelineRangeSlider.d.ts +16 -0
- package/lib/otel/views/OtelTimelineRangeSlider.js +338 -0
- package/lib/otel/views/OtelTracesList.d.ts +13 -0
- package/lib/otel/views/OtelTracesList.js +199 -0
- package/lib/otel/views/index.d.ts +20 -0
- package/lib/otel/views/index.js +21 -0
- package/lib/state/storage/IAMStorage.d.ts +2 -1
- package/lib/state/substates/CoreState.js +7 -6
- package/lib/utils/Date.d.ts +6 -0
- package/lib/utils/Date.js +37 -0
- package/lib/utils/Jwt.d.ts +42 -0
- package/lib/utils/Jwt.js +44 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/views/iam/SignInSimple.d.ts +43 -0
- package/lib/views/iam/SignInSimple.js +113 -0
- package/lib/views/iam/index.d.ts +2 -0
- package/lib/views/iam/index.js +5 -0
- package/lib/views/iam-tokens/IAMTokenEdit.d.ts +5 -1
- package/lib/views/iam-tokens/IAMTokenEdit.js +54 -5
- package/lib/views/iam-tokens/IAMTokenNew.js +2 -2
- package/lib/views/iam-tokens/IAMTokens.d.ts +4 -2
- package/lib/views/iam-tokens/IAMTokens.js +68 -36
- package/lib/views/iam-tokens/Tokens.js +63 -31
- package/lib/views/index.d.ts +3 -1
- package/lib/views/index.js +3 -1
- package/lib/views/otel/DashboardView.d.ts +16 -0
- package/lib/views/otel/DashboardView.js +4 -0
- package/lib/views/otel/LogsView.d.ts +12 -0
- package/lib/views/otel/LogsView.js +4 -0
- package/lib/views/otel/MetricsView.d.ts +12 -0
- package/lib/views/otel/MetricsView.js +4 -0
- package/lib/views/otel/OtelHeader.d.ts +33 -0
- package/lib/views/otel/OtelHeader.js +105 -0
- package/lib/views/otel/SqlView.d.ts +9 -0
- package/lib/views/otel/SqlView.js +4 -0
- package/lib/views/otel/SystemView.d.ts +9 -0
- package/lib/views/otel/SystemView.js +4 -0
- package/lib/views/otel/TracesView.d.ts +12 -0
- package/lib/views/otel/TracesView.js +4 -0
- package/lib/views/otel/index.d.ts +16 -0
- package/lib/views/otel/index.js +12 -0
- package/lib/views/otel/simpleAuthStore.d.ts +21 -0
- package/lib/views/otel/simpleAuthStore.js +22 -0
- package/lib/views/profile/UserBadge.d.ts +20 -0
- package/lib/views/profile/UserBadge.js +101 -0
- package/lib/views/profile/index.d.ts +2 -0
- package/lib/views/profile/index.js +5 -0
- package/package.json +3 -4
package/lib/hooks/useCache.js
CHANGED
|
@@ -272,13 +272,6 @@ export const queryKeys = {
|
|
|
272
272
|
bySpace: (spaceId) => [...queryKeys.items.all(), 'space', spaceId],
|
|
273
273
|
search: (opts) => [...queryKeys.items.all(), 'search', opts],
|
|
274
274
|
},
|
|
275
|
-
// Agent Runtimes (runtimes with ai-agents environment)
|
|
276
|
-
agentRuntimes: {
|
|
277
|
-
all: () => ['agentRuntimes'],
|
|
278
|
-
lists: () => [...queryKeys.agentRuntimes.all(), 'list'],
|
|
279
|
-
details: () => [...queryKeys.agentRuntimes.all(), 'detail'],
|
|
280
|
-
detail: (podName) => [...queryKeys.agentRuntimes.details(), podName],
|
|
281
|
-
},
|
|
282
275
|
// Layout
|
|
283
276
|
layout: {
|
|
284
277
|
byAccount: (accountHandle, spaceHandle) => spaceHandle
|
|
@@ -1362,198 +1355,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
1362
1355
|
},
|
|
1363
1356
|
});
|
|
1364
1357
|
};
|
|
1365
|
-
/**
|
|
1366
|
-
* List agent runtimes (runtimes with ai-agents-env environment)
|
|
1367
|
-
*/
|
|
1368
|
-
/**
|
|
1369
|
-
* Get all agent runtimes for the current user.
|
|
1370
|
-
*
|
|
1371
|
-
* Note on phase/status mapping:
|
|
1372
|
-
* The backend (operator) RuntimePod model does not include a 'phase' field.
|
|
1373
|
-
* The operator only keeps active/assigned runtimes in its cache (OperatorCache.USER_RUNTIMES),
|
|
1374
|
-
* so any runtime returned by this endpoint is inherently running or starting.
|
|
1375
|
-
* Therefore, if rt.phase is undefined (which it will be), we default to 'running'.
|
|
1376
|
-
* A 'paused' state would require explicit backend support to track paused runtimes.
|
|
1377
|
-
*/
|
|
1378
|
-
const useAgentRuntimes = () => {
|
|
1379
|
-
return useQuery({
|
|
1380
|
-
queryKey: queryKeys.agentRuntimes.lists(),
|
|
1381
|
-
queryFn: async () => {
|
|
1382
|
-
const resp = await requestDatalayer({
|
|
1383
|
-
url: `${configuration.runtimesRunUrl}/api/runtimes/v1/runtimes`,
|
|
1384
|
-
method: 'GET',
|
|
1385
|
-
});
|
|
1386
|
-
if (resp.success && resp.runtimes) {
|
|
1387
|
-
// Filter to only include ai-agents-env runtimes
|
|
1388
|
-
const agentRuntimes = resp.runtimes
|
|
1389
|
-
.filter((rt) => rt.environment_name === 'ai-agents-env')
|
|
1390
|
-
.map((rt) => ({
|
|
1391
|
-
...rt,
|
|
1392
|
-
// Phase/status mapping: see hook JSDoc for details.
|
|
1393
|
-
// Backend returns only active runtimes, so default to 'running'.
|
|
1394
|
-
status: rt.phase === 'Pending'
|
|
1395
|
-
? 'starting'
|
|
1396
|
-
: rt.phase === 'Terminated'
|
|
1397
|
-
? 'terminated'
|
|
1398
|
-
: rt.phase === 'Paused'
|
|
1399
|
-
? 'paused'
|
|
1400
|
-
: rt.phase === 'Archived'
|
|
1401
|
-
? 'archived'
|
|
1402
|
-
: 'running',
|
|
1403
|
-
name: rt.given_name || rt.pod_name,
|
|
1404
|
-
id: rt.pod_name,
|
|
1405
|
-
// Map ingress URL to url for UI consistency
|
|
1406
|
-
url: rt.ingress,
|
|
1407
|
-
messageCount: 0, // Default for UI compatibility
|
|
1408
|
-
agent_spec_id: rt.agent_spec_id || undefined,
|
|
1409
|
-
}));
|
|
1410
|
-
// Set detail cache for each runtime
|
|
1411
|
-
agentRuntimes.forEach((runtime) => {
|
|
1412
|
-
queryClient.setQueryData(queryKeys.agentRuntimes.detail(runtime.pod_name), runtime);
|
|
1413
|
-
});
|
|
1414
|
-
return agentRuntimes;
|
|
1415
|
-
}
|
|
1416
|
-
return [];
|
|
1417
|
-
},
|
|
1418
|
-
...DEFAULT_QUERY_OPTIONS,
|
|
1419
|
-
refetchInterval: 10000, // Refetch every 10 seconds for status updates
|
|
1420
|
-
enabled: !!user,
|
|
1421
|
-
});
|
|
1422
|
-
};
|
|
1423
|
-
/**
|
|
1424
|
-
* Get a single agent runtime by pod name.
|
|
1425
|
-
*
|
|
1426
|
-
* Note on phase/status mapping:
|
|
1427
|
-
* Same as useAgentRuntimes - the backend RuntimePod model has no 'phase' field,
|
|
1428
|
-
* and only active runtimes exist in the operator cache. Default to 'running'.
|
|
1429
|
-
*/
|
|
1430
|
-
const useAgentRuntime = (podName) => {
|
|
1431
|
-
return useQuery({
|
|
1432
|
-
queryKey: queryKeys.agentRuntimes.detail(podName ?? ''),
|
|
1433
|
-
queryFn: async () => {
|
|
1434
|
-
const resp = await requestDatalayer({
|
|
1435
|
-
url: `${configuration.runtimesRunUrl}/api/runtimes/v1/runtimes/${podName}`,
|
|
1436
|
-
method: 'GET',
|
|
1437
|
-
});
|
|
1438
|
-
if (resp.runtime) {
|
|
1439
|
-
const rt = resp.runtime;
|
|
1440
|
-
return {
|
|
1441
|
-
...rt,
|
|
1442
|
-
// Phase/status mapping: see useAgentRuntimes JSDoc for details.
|
|
1443
|
-
status: rt.phase === 'Pending'
|
|
1444
|
-
? 'starting'
|
|
1445
|
-
: rt.phase === 'Terminated'
|
|
1446
|
-
? 'terminated'
|
|
1447
|
-
: rt.phase === 'Paused'
|
|
1448
|
-
? 'paused'
|
|
1449
|
-
: rt.phase === 'Archived'
|
|
1450
|
-
? 'archived'
|
|
1451
|
-
: 'running',
|
|
1452
|
-
name: rt.given_name || rt.pod_name,
|
|
1453
|
-
id: rt.pod_name,
|
|
1454
|
-
// Map ingress URL to url for UI consistency
|
|
1455
|
-
url: rt.ingress,
|
|
1456
|
-
messageCount: 0,
|
|
1457
|
-
agent_spec_id: rt.agent_spec_id || undefined,
|
|
1458
|
-
};
|
|
1459
|
-
}
|
|
1460
|
-
throw new Error('Failed to fetch agent runtime');
|
|
1461
|
-
},
|
|
1462
|
-
...DEFAULT_QUERY_OPTIONS,
|
|
1463
|
-
// Poll every 5 seconds while the runtime exists. Stop polling on error
|
|
1464
|
-
// (e.g. 404 — runtime deleted, 500 — broken state) to avoid hammering the server.
|
|
1465
|
-
refetchInterval: query => {
|
|
1466
|
-
if (query.state.error)
|
|
1467
|
-
return false;
|
|
1468
|
-
return 5000;
|
|
1469
|
-
},
|
|
1470
|
-
// Don't retry failed detail requests. The refetchInterval handles
|
|
1471
|
-
// periodic re-checks, so retrying only generates duplicate failing requests.
|
|
1472
|
-
retry: false,
|
|
1473
|
-
enabled: !!podName,
|
|
1474
|
-
});
|
|
1475
|
-
};
|
|
1476
|
-
const useCreateAgentRuntime = () => {
|
|
1477
|
-
return useMutation({
|
|
1478
|
-
mutationFn: async (data) => {
|
|
1479
|
-
return requestDatalayer({
|
|
1480
|
-
url: `${configuration.runtimesRunUrl}/api/runtimes/v1/runtimes`,
|
|
1481
|
-
method: 'POST',
|
|
1482
|
-
body: {
|
|
1483
|
-
environment_name: data.environmentName || 'ai-agents-env',
|
|
1484
|
-
given_name: data.givenName || 'Agent',
|
|
1485
|
-
credits_limit: data.creditsLimit || 10,
|
|
1486
|
-
type: data.type || 'notebook',
|
|
1487
|
-
editor_variant: data.editorVariant || 'none',
|
|
1488
|
-
enable_codemode: data.enableCodemode ?? false,
|
|
1489
|
-
agent_spec_id: data.agentSpecId || undefined,
|
|
1490
|
-
},
|
|
1491
|
-
});
|
|
1492
|
-
},
|
|
1493
|
-
onSuccess: resp => {
|
|
1494
|
-
if (resp.success && resp.runtime) {
|
|
1495
|
-
const rt = resp.runtime;
|
|
1496
|
-
// Phase/status mapping: see useAgentRuntimes JSDoc for details.
|
|
1497
|
-
queryClient.setQueryData(queryKeys.agentRuntimes.detail(rt.pod_name), {
|
|
1498
|
-
...rt,
|
|
1499
|
-
status: rt.phase === 'Pending'
|
|
1500
|
-
? 'starting'
|
|
1501
|
-
: 'running',
|
|
1502
|
-
name: rt.given_name || rt.pod_name,
|
|
1503
|
-
id: rt.pod_name,
|
|
1504
|
-
// Map ingress URL to url for UI consistency
|
|
1505
|
-
url: rt.ingress,
|
|
1506
|
-
messageCount: 0,
|
|
1507
|
-
agent_spec_id: rt.agent_spec_id || undefined,
|
|
1508
|
-
});
|
|
1509
|
-
// Invalidate list
|
|
1510
|
-
queryClient.invalidateQueries({
|
|
1511
|
-
queryKey: queryKeys.agentRuntimes.all(),
|
|
1512
|
-
});
|
|
1513
|
-
}
|
|
1514
|
-
},
|
|
1515
|
-
});
|
|
1516
|
-
};
|
|
1517
|
-
/**
|
|
1518
|
-
* Delete agent runtime
|
|
1519
|
-
*/
|
|
1520
|
-
const useDeleteAgentRuntime = () => {
|
|
1521
|
-
return useMutation({
|
|
1522
|
-
mutationFn: async (podName) => {
|
|
1523
|
-
return requestDatalayer({
|
|
1524
|
-
url: `${configuration.runtimesRunUrl}/api/runtimes/v1/runtimes/${podName}`,
|
|
1525
|
-
method: 'DELETE',
|
|
1526
|
-
});
|
|
1527
|
-
},
|
|
1528
|
-
onSuccess: (_data, podName) => {
|
|
1529
|
-
// Cancel any in-flight queries for the deleted runtime so they
|
|
1530
|
-
// don't re-fetch a resource that no longer exists.
|
|
1531
|
-
queryClient.cancelQueries({
|
|
1532
|
-
queryKey: queryKeys.agentRuntimes.detail(podName),
|
|
1533
|
-
});
|
|
1534
|
-
// Remove the detail cache entry immediately — prevents React
|
|
1535
|
-
// Query from triggering a stale re-fetch while the component
|
|
1536
|
-
// unmounts.
|
|
1537
|
-
queryClient.removeQueries({
|
|
1538
|
-
queryKey: queryKeys.agentRuntimes.detail(podName),
|
|
1539
|
-
});
|
|
1540
|
-
// Invalidate the list so the sidebar refreshes.
|
|
1541
|
-
queryClient.invalidateQueries({
|
|
1542
|
-
queryKey: queryKeys.agentRuntimes.lists(),
|
|
1543
|
-
});
|
|
1544
|
-
},
|
|
1545
|
-
});
|
|
1546
|
-
};
|
|
1547
|
-
/**
|
|
1548
|
-
* Refresh agent runtimes list
|
|
1549
|
-
*/
|
|
1550
|
-
const useRefreshAgentRuntimes = () => {
|
|
1551
|
-
return () => {
|
|
1552
|
-
queryClient.invalidateQueries({
|
|
1553
|
-
queryKey: queryKeys.agentRuntimes.all(),
|
|
1554
|
-
});
|
|
1555
|
-
};
|
|
1556
|
-
};
|
|
1557
1358
|
// ============================================================================
|
|
1558
1359
|
// Notebook Hooks
|
|
1559
1360
|
// ============================================================================
|
|
@@ -2497,6 +2298,25 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
2497
2298
|
},
|
|
2498
2299
|
});
|
|
2499
2300
|
};
|
|
2301
|
+
/**
|
|
2302
|
+
* Delete token by ID
|
|
2303
|
+
*/
|
|
2304
|
+
const useDeleteToken = () => {
|
|
2305
|
+
return useMutation({
|
|
2306
|
+
mutationFn: async (tokenId) => {
|
|
2307
|
+
return requestDatalayer({
|
|
2308
|
+
url: `${configuration.iamRunUrl}/api/iam/v1/tokens/${tokenId}`,
|
|
2309
|
+
method: 'DELETE',
|
|
2310
|
+
});
|
|
2311
|
+
},
|
|
2312
|
+
onSuccess: (_, tokenId) => {
|
|
2313
|
+
queryClient.removeQueries({
|
|
2314
|
+
queryKey: queryKeys.tokens.detail(tokenId),
|
|
2315
|
+
});
|
|
2316
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.tokens.all() });
|
|
2317
|
+
},
|
|
2318
|
+
});
|
|
2319
|
+
};
|
|
2500
2320
|
/**
|
|
2501
2321
|
* Get contact by handle
|
|
2502
2322
|
*/
|
|
@@ -4685,6 +4505,20 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
4685
4505
|
},
|
|
4686
4506
|
});
|
|
4687
4507
|
};
|
|
4508
|
+
/**
|
|
4509
|
+
* Create URL for password change (sends clickable link via email)
|
|
4510
|
+
*/
|
|
4511
|
+
const useCreateUrlForPasswordChange = () => {
|
|
4512
|
+
return useMutation({
|
|
4513
|
+
mutationFn: async ({ handle, password, passwordConfirm, }) => {
|
|
4514
|
+
return requestDatalayer({
|
|
4515
|
+
url: `${configuration.iamRunUrl}/api/iam/v1/password`,
|
|
4516
|
+
method: 'PUT',
|
|
4517
|
+
body: { handle, password, passwordConfirm },
|
|
4518
|
+
});
|
|
4519
|
+
},
|
|
4520
|
+
});
|
|
4521
|
+
};
|
|
4688
4522
|
/**
|
|
4689
4523
|
* Confirm password change with token
|
|
4690
4524
|
*/
|
|
@@ -6237,6 +6071,7 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
6237
6071
|
useJoinWithInvite,
|
|
6238
6072
|
useConfirmJoinWithToken,
|
|
6239
6073
|
useCreateTokenForPasswordChange,
|
|
6074
|
+
useCreateUrlForPasswordChange,
|
|
6240
6075
|
useConfirmPasswordWithToken,
|
|
6241
6076
|
useOAuth2AuthorizationURL,
|
|
6242
6077
|
useOAuth2AuthorizationLinkURL,
|
|
@@ -6317,12 +6152,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
6317
6152
|
useRefreshUserSpace,
|
|
6318
6153
|
useRefreshLayout,
|
|
6319
6154
|
useExportSpace,
|
|
6320
|
-
// Agent Runtimes (runtimes with ai-agents environment)
|
|
6321
|
-
useAgentRuntime,
|
|
6322
|
-
useAgentRuntimes,
|
|
6323
|
-
useCreateAgentRuntime,
|
|
6324
|
-
useDeleteAgentRuntime,
|
|
6325
|
-
useRefreshAgentRuntimes,
|
|
6326
6155
|
// Courses
|
|
6327
6156
|
useCourse,
|
|
6328
6157
|
useUpdateCourse,
|
|
@@ -6434,6 +6263,7 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
6434
6263
|
useTokens,
|
|
6435
6264
|
useCreateToken,
|
|
6436
6265
|
useUpdateToken,
|
|
6266
|
+
useDeleteToken,
|
|
6437
6267
|
// Invites
|
|
6438
6268
|
useInvite,
|
|
6439
6269
|
useInvitesByUser,
|
|
@@ -20,7 +20,7 @@ export type ProjectData = {
|
|
|
20
20
|
isPublic: boolean;
|
|
21
21
|
/** Attached agent (runtime) pod name, if any */
|
|
22
22
|
attachedAgentPodName?: string;
|
|
23
|
-
/** Attached agent spec ID (e.g. '
|
|
23
|
+
/** Attached agent spec ID (e.g. 'data-acquisition'), if any */
|
|
24
24
|
attachedAgentSpecId?: string;
|
|
25
25
|
};
|
|
26
26
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export * as iamApi from './api/iam';
|
|
|
13
13
|
export * as spacerApi from './api/spacer';
|
|
14
14
|
export { DatalayerClient, type DatalayerClientConfig, type ClientHandlers, User, Runtime, Environment, Snapshot, Space, 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 RuntimeSnapshotData, type CreditsInfo, type CreditReservation, type CreateRuntimeRequest, type CreateRuntimeResponse, type ListRuntimesResponse, type ListEnvironmentsResponse, type CreateRuntimeSnapshotRequest, type CreateRuntimeSnapshotResponse, type GetRuntimeSnapshotResponse, type ListRuntimeSnapshotsResponse, 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 NotebookJSON, type LexicalJSON, type RuntimeSnapshotJSON, 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 IRuntimeSnapshot, 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
15
|
export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getRuntimeSnapshots, loadRuntimeSnapshot, } from './stateful/runtimes/actions';
|
|
16
|
+
export * from './otel';
|
|
17
|
+
export * from './views';
|
package/lib/index.js
CHANGED
|
@@ -26,3 +26,7 @@ User, Runtime, Environment, Snapshot, Space, Notebook, LexicalDTO, Secret, Credi
|
|
|
26
26
|
AuthenticationManager, Datasource, } from './client';
|
|
27
27
|
// Export commonly used functions directly for convenience
|
|
28
28
|
export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getRuntimeSnapshots, loadRuntimeSnapshot, } from './stateful/runtimes/actions';
|
|
29
|
+
// OTEL observability components, hooks, and types
|
|
30
|
+
export * from './otel';
|
|
31
|
+
// Reusable views (sign-in pages, etc.)
|
|
32
|
+
export * from './views';
|
package/lib/models/ItemDTO.js
CHANGED
|
@@ -59,7 +59,7 @@ export class ItemDTO {
|
|
|
59
59
|
if (this._data.space_id) {
|
|
60
60
|
return this._data.space_id;
|
|
61
61
|
}
|
|
62
|
-
// Extract from s3_path_s if available: "datalayer.
|
|
62
|
+
// Extract from s3_path_s if available: "datalayer.ai/SPACE_ID/..."
|
|
63
63
|
const s3Path = this._data.s3_path_s;
|
|
64
64
|
if (s3Path && typeof s3Path === 'string') {
|
|
65
65
|
const match = s3Path.match(/^datalayer\.app\/([^/]+)\//);
|
|
@@ -43,8 +43,8 @@ export class PlatformRoles {
|
|
|
43
43
|
static IAMToken = {
|
|
44
44
|
id: 'platform_iam_token',
|
|
45
45
|
handle: 'platform_iam_token',
|
|
46
|
-
displayName: 'Platform
|
|
47
|
-
description: 'A Platform
|
|
46
|
+
displayName: 'Platform API Key',
|
|
47
|
+
description: 'A Platform API Key.',
|
|
48
48
|
permissions: PLATFORM_IAM_TOKEN_PERMSSIONS,
|
|
49
49
|
icon: UserIcon,
|
|
50
50
|
};
|
package/lib/models/User.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare class User implements IUser {
|
|
|
18
18
|
lastName: string;
|
|
19
19
|
initials: string;
|
|
20
20
|
displayName: string;
|
|
21
|
+
friendlyName?: string;
|
|
21
22
|
joinDate?: Date;
|
|
22
23
|
roles: string[];
|
|
23
24
|
credits?: number;
|
|
@@ -48,6 +49,7 @@ export type IBaseUser = {
|
|
|
48
49
|
lastName: string;
|
|
49
50
|
initials: string;
|
|
50
51
|
displayName: string;
|
|
52
|
+
friendlyName?: string;
|
|
51
53
|
joinDate?: Date;
|
|
52
54
|
roles: string[];
|
|
53
55
|
setRoles: (roles: string[]) => void;
|
package/lib/models/User.js
CHANGED
|
@@ -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, toFriendlyName } from '../utils';
|
|
6
6
|
import { asIAMProviderLinked } from './IAMProviderLinked';
|
|
7
7
|
import { BOOTSTRAP_USER_ONBOARDING } from './UserOnboarding';
|
|
8
8
|
import { UserSettings } from './UserSettings';
|
|
@@ -34,6 +34,7 @@ export class User {
|
|
|
34
34
|
lastName;
|
|
35
35
|
initials;
|
|
36
36
|
displayName;
|
|
37
|
+
friendlyName;
|
|
37
38
|
joinDate;
|
|
38
39
|
roles;
|
|
39
40
|
credits;
|
|
@@ -57,6 +58,8 @@ export class User {
|
|
|
57
58
|
this.initials = namesAsInitials(u.first_name_t, u.last_name_t);
|
|
58
59
|
const displayName = asDisplayName(u.first_name_t, u.last_name_t);
|
|
59
60
|
this.displayName = displayName === '' ? u.handle_s : displayName;
|
|
61
|
+
this.friendlyName =
|
|
62
|
+
toFriendlyName(u.first_name_t, u.last_name_t) || u.handle_s;
|
|
60
63
|
this.avatarUrl = u.avatar_url_s;
|
|
61
64
|
this.origin = u.origin_s;
|
|
62
65
|
this.joinDate = u.join_ts_dt ? new Date(u.join_ts_dt) : undefined;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { OtelSpan, OtelLog, OtelMetric, OtelQueryResult } from '../types';
|
|
2
|
+
import type { OtelSystemData, OtelSystemProcess, OtelSystemDisk, OtelSystemTable } from '../hooks';
|
|
3
|
+
export interface OtelClientOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Base URL of the OTEL service.
|
|
6
|
+
* Defaults to `configuration.otelRunUrl` from the Datalayer core config
|
|
7
|
+
* (i.e. `https://prod1.datalayer.run`).
|
|
8
|
+
*/
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
/** JWT bearer token or API key for authentication. */
|
|
11
|
+
token?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FetchTracesOptions {
|
|
14
|
+
serviceName?: string;
|
|
15
|
+
limit?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface FetchLogsOptions {
|
|
18
|
+
serviceName?: string;
|
|
19
|
+
severity?: string;
|
|
20
|
+
traceId?: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface FetchMetricsOptions {
|
|
24
|
+
serviceName?: string;
|
|
25
|
+
metricName?: string;
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface FetchMetricTotalOptions {
|
|
29
|
+
serviceName?: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
fallbackWithoutService?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Typed HTTP client for all OTEL service endpoints.
|
|
35
|
+
*
|
|
36
|
+
* Construct via `createOtelClient()` or `new OtelClient(options)`.
|
|
37
|
+
*/
|
|
38
|
+
export declare class OtelClient {
|
|
39
|
+
private readonly baseUrl;
|
|
40
|
+
private readonly token?;
|
|
41
|
+
constructor(options?: OtelClientOptions);
|
|
42
|
+
/** List recent spans / traces. */
|
|
43
|
+
fetchTraces(options?: FetchTracesOptions): Promise<{
|
|
44
|
+
data: OtelSpan[];
|
|
45
|
+
count: number;
|
|
46
|
+
}>;
|
|
47
|
+
/** Fetch all spans for a single trace by `traceId`. */
|
|
48
|
+
fetchTrace(traceId: string): Promise<{
|
|
49
|
+
data: OtelSpan[];
|
|
50
|
+
}>;
|
|
51
|
+
/** List recent log records. */
|
|
52
|
+
fetchLogs(options?: FetchLogsOptions): Promise<{
|
|
53
|
+
data: OtelLog[];
|
|
54
|
+
count: number;
|
|
55
|
+
}>;
|
|
56
|
+
/** List recent metric data points. */
|
|
57
|
+
fetchMetrics(options?: FetchMetricsOptions): Promise<{
|
|
58
|
+
data: OtelMetric[];
|
|
59
|
+
count: number;
|
|
60
|
+
}>;
|
|
61
|
+
/** Sum all values for one metric name, with optional service filter. */
|
|
62
|
+
fetchMetricTotal(metricName: string, options?: FetchMetricTotalOptions): Promise<number>;
|
|
63
|
+
/** List known service names observed in traces. */
|
|
64
|
+
fetchServices(): Promise<string[]>;
|
|
65
|
+
/** Fetch storage / ingestion statistics. */
|
|
66
|
+
fetchStats(): Promise<Record<string, unknown>>;
|
|
67
|
+
/**
|
|
68
|
+
* Execute an ad-hoc DataFusion SQL query against the OTEL service.
|
|
69
|
+
*
|
|
70
|
+
* Available tables: `spans`, `logs`, `metrics`.
|
|
71
|
+
*/
|
|
72
|
+
executeQuery(sql: string): Promise<OtelQueryResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Fetch system statistics (platform_admin only).
|
|
75
|
+
*
|
|
76
|
+
* Returns process memory/CPU, disk usage, and per-table row counts.
|
|
77
|
+
*/
|
|
78
|
+
fetchSystem(): Promise<OtelSystemData>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create a new `OtelClient`.
|
|
82
|
+
*
|
|
83
|
+
* The `baseUrl` defaults to `configuration.otelRunUrl` from the Datalayer core
|
|
84
|
+
* configuration store, so only pass it when you want to override the default.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const client = createOtelClient({ token: jwt });
|
|
89
|
+
* const services = await client.fetchServices();
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function createOtelClient(options?: OtelClientOptions): OtelClient;
|
|
93
|
+
export type { OtelSystemData, OtelSystemProcess, OtelSystemDisk, OtelSystemTable, };
|