datajunction-ui 0.0.154 → 0.0.155

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.
@@ -1238,58 +1238,16 @@ describe('DataJunctionAPI', () => {
1238
1238
 
1239
1239
  it('calls node_counts_by_type correctly', async () => {
1240
1240
  fetch.mockResponseOnce(
1241
- JSON.stringify([
1242
- [
1243
- {
1244
- value: 'cube',
1245
- col: 'system.dj.node_type.type',
1246
- },
1247
- {
1248
- value: 226,
1249
- col: 'system.dj.number_of_nodes',
1250
- },
1251
- ],
1252
- [
1253
- {
1254
- value: 'dimension',
1255
- col: 'system.dj.node_type.type',
1256
- },
1257
- {
1258
- value: 241,
1259
- col: 'system.dj.number_of_nodes',
1260
- },
1261
- ],
1262
- [
1263
- {
1264
- value: 'metric',
1265
- col: 'system.dj.node_type.type',
1266
- },
1267
- {
1268
- value: 2853,
1269
- col: 'system.dj.number_of_nodes',
1270
- },
1271
- ],
1272
- [
1273
- {
1274
- value: 'source',
1275
- col: 'system.dj.node_type.type',
1276
- },
1277
- {
1278
- value: 540,
1279
- col: 'system.dj.number_of_nodes',
1280
- },
1281
- ],
1282
- [
1283
- {
1284
- value: 'transform',
1285
- col: 'system.dj.node_type.type',
1286
- },
1287
- {
1288
- value: 663,
1289
- col: 'system.dj.number_of_nodes',
1290
- },
1241
+ JSON.stringify({
1242
+ columns: ['system.dj.node_type.type', 'system.dj.number_of_nodes'],
1243
+ rows: [
1244
+ ['cube', 226],
1245
+ ['dimension', 241],
1246
+ ['metric', 2853],
1247
+ ['source', 540],
1248
+ ['transform', 663],
1291
1249
  ],
1292
- ]),
1250
+ }),
1293
1251
  );
1294
1252
  const results = await DataJunctionAPI.system.node_counts_by_type();
1295
1253
  expect(fetch).toHaveBeenCalledWith(
@@ -1309,28 +1267,13 @@ describe('DataJunctionAPI', () => {
1309
1267
 
1310
1268
  it('calls node_counts_by_active correctly', async () => {
1311
1269
  fetch.mockResponseOnce(
1312
- JSON.stringify([
1313
- [
1314
- {
1315
- value: false,
1316
- col: 'system.dj.is_active.active_id',
1317
- },
1318
- {
1319
- value: 3136,
1320
- col: 'system.dj.number_of_nodes',
1321
- },
1322
- ],
1323
- [
1324
- {
1325
- value: true,
1326
- col: 'system.dj.is_active.active_id',
1327
- },
1328
- {
1329
- value: 4523,
1330
- col: 'system.dj.number_of_nodes',
1331
- },
1270
+ JSON.stringify({
1271
+ columns: ['system.dj.is_active.active_id', 'system.dj.number_of_nodes'],
1272
+ rows: [
1273
+ [false, 3136],
1274
+ [true, 4523],
1332
1275
  ],
1333
- ]),
1276
+ }),
1334
1277
  );
1335
1278
  const results = await DataJunctionAPI.system.node_counts_by_active();
1336
1279
  expect(fetch).toHaveBeenCalledWith(
@@ -1347,28 +1290,13 @@ describe('DataJunctionAPI', () => {
1347
1290
 
1348
1291
  it('calls node_counts_by_status correctly', async () => {
1349
1292
  fetch.mockResponseOnce(
1350
- JSON.stringify([
1351
- [
1352
- {
1353
- value: 'VALID',
1354
- col: 'system.dj.nodes.status',
1355
- },
1356
- {
1357
- value: 4333,
1358
- col: 'system.dj.number_of_nodes',
1359
- },
1360
- ],
1361
- [
1362
- {
1363
- value: 'INVALID',
1364
- col: 'system.dj.nodes.status',
1365
- },
1366
- {
1367
- value: 190,
1368
- col: 'system.dj.number_of_nodes',
1369
- },
1293
+ JSON.stringify({
1294
+ columns: ['system.dj.nodes.status', 'system.dj.number_of_nodes'],
1295
+ rows: [
1296
+ ['VALID', 4333],
1297
+ ['INVALID', 190],
1370
1298
  ],
1371
- ]),
1299
+ }),
1372
1300
  );
1373
1301
  const results = await DataJunctionAPI.system.node_counts_by_status();
1374
1302
  expect(fetch).toHaveBeenCalledWith(
@@ -1385,58 +1313,19 @@ describe('DataJunctionAPI', () => {
1385
1313
 
1386
1314
  it('calls nodes_without_description correctly', async () => {
1387
1315
  fetch.mockResponseOnce(
1388
- JSON.stringify([
1389
- [
1390
- {
1391
- value: 'cube',
1392
- col: 'system.dj.node_type.type',
1393
- },
1394
- {
1395
- value: 0.1,
1396
- col: 'system.dj.node_without_description',
1397
- },
1398
- ],
1399
- [
1400
- {
1401
- value: 'dimension',
1402
- col: 'system.dj.node_type.type',
1403
- },
1404
- {
1405
- value: 0.2,
1406
- col: 'system.dj.node_without_description',
1407
- },
1408
- ],
1409
- [
1410
- {
1411
- value: 'metric',
1412
- col: 'system.dj.node_type.type',
1413
- },
1414
- {
1415
- value: 0.3,
1416
- col: 'system.dj.node_without_description',
1417
- },
1418
- ],
1419
- [
1420
- {
1421
- value: 'source',
1422
- col: 'system.dj.node_type.type',
1423
- },
1424
- {
1425
- value: 0.4,
1426
- col: 'system.dj.node_without_description',
1427
- },
1316
+ JSON.stringify({
1317
+ columns: [
1318
+ 'system.dj.node_type.type',
1319
+ 'system.dj.node_without_description',
1428
1320
  ],
1429
- [
1430
- {
1431
- value: 'transform',
1432
- col: 'system.dj.node_type.type',
1433
- },
1434
- {
1435
- value: 0.5,
1436
- col: 'system.dj.node_without_description',
1437
- },
1321
+ rows: [
1322
+ ['cube', 0.1],
1323
+ ['dimension', 0.2],
1324
+ ['metric', 0.3],
1325
+ ['source', 0.4],
1326
+ ['transform', 0.5],
1438
1327
  ],
1439
- ]),
1328
+ }),
1440
1329
  );
1441
1330
  const results = await DataJunctionAPI.system.nodes_without_description();
1442
1331
  expect(fetch).toHaveBeenCalledWith(
@@ -1455,78 +1344,20 @@ describe('DataJunctionAPI', () => {
1455
1344
  });
1456
1345
  it('calls node_trends correctly', async () => {
1457
1346
  fetch.mockResponseOnce(
1458
- JSON.stringify([
1459
- [
1460
- {
1461
- value: 20250630,
1462
- col: 'system.dj.nodes.created_at_week',
1463
- },
1464
- {
1465
- value: 'metric',
1466
- col: 'system.dj.node_type.type',
1467
- },
1468
- {
1469
- value: 42,
1470
- col: 'system.dj.number_of_nodes',
1471
- },
1472
- ],
1473
- [
1474
- {
1475
- value: 20250707,
1476
- col: 'system.dj.nodes.created_at_week',
1477
- },
1478
- {
1479
- value: 'dimension',
1480
- col: 'system.dj.node_type.type',
1481
- },
1482
- {
1483
- value: 21,
1484
- col: 'system.dj.number_of_nodes',
1485
- },
1486
- ],
1487
- [
1488
- {
1489
- value: 20250707,
1490
- col: 'system.dj.nodes.created_at_week',
1491
- },
1492
- {
1493
- value: 'metric',
1494
- col: 'system.dj.node_type.type',
1495
- },
1496
- {
1497
- value: 9,
1498
- col: 'system.dj.number_of_nodes',
1499
- },
1500
- ],
1501
- [
1502
- {
1503
- value: 20250714,
1504
- col: 'system.dj.nodes.created_at_week',
1505
- },
1506
- {
1507
- value: 'metric',
1508
- col: 'system.dj.node_type.type',
1509
- },
1510
- {
1511
- value: 3,
1512
- col: 'system.dj.number_of_nodes',
1513
- },
1347
+ JSON.stringify({
1348
+ columns: [
1349
+ 'system.dj.nodes.created_at_week',
1350
+ 'system.dj.node_type.type',
1351
+ 'system.dj.number_of_nodes',
1514
1352
  ],
1515
- [
1516
- {
1517
- value: 20250714,
1518
- col: 'system.dj.nodes.created_at_week',
1519
- },
1520
- {
1521
- value: 'dimension',
1522
- col: 'system.dj.node_type.type',
1523
- },
1524
- {
1525
- value: 7,
1526
- col: 'system.dj.number_of_nodes',
1527
- },
1353
+ rows: [
1354
+ [20250630, 'metric', 42],
1355
+ [20250707, 'dimension', 21],
1356
+ [20250707, 'metric', 9],
1357
+ [20250714, 'metric', 3],
1358
+ [20250714, 'dimension', 7],
1528
1359
  ],
1529
- ]),
1360
+ }),
1530
1361
  );
1531
1362
  const results = await DataJunctionAPI.system.node_trends();
1532
1363
  expect(fetch).toHaveBeenCalledWith(
@@ -1544,38 +1375,17 @@ describe('DataJunctionAPI', () => {
1544
1375
 
1545
1376
  it('calls materialization_counts_by_type correctly', async () => {
1546
1377
  fetch.mockResponseOnce(
1547
- JSON.stringify([
1548
- [
1549
- {
1550
- value: 'cube',
1551
- col: 'system.dj.node_type.type',
1552
- },
1553
- {
1554
- value: 76,
1555
- col: 'system.dj.number_of_materializations',
1556
- },
1557
- ],
1558
- [
1559
- {
1560
- value: 'dimension',
1561
- col: 'system.dj.node_type.type',
1562
- },
1563
- {
1564
- value: 3,
1565
- col: 'system.dj.number_of_materializations',
1566
- },
1378
+ JSON.stringify({
1379
+ columns: [
1380
+ 'system.dj.node_type.type',
1381
+ 'system.dj.number_of_materializations',
1567
1382
  ],
1568
- [
1569
- {
1570
- value: 'transform',
1571
- col: 'system.dj.node_type.type',
1572
- },
1573
- {
1574
- value: 9,
1575
- col: 'system.dj.number_of_materializations',
1576
- },
1383
+ rows: [
1384
+ ['cube', 76],
1385
+ ['dimension', 3],
1386
+ ['transform', 9],
1577
1387
  ],
1578
- ]),
1388
+ }),
1579
1389
  );
1580
1390
  const results =
1581
1391
  await DataJunctionAPI.system.materialization_counts_by_type();
@@ -1886,12 +1696,10 @@ describe('DataJunctionAPI', () => {
1886
1696
  // Test system metrics APIs
1887
1697
  it('calls system.node_counts_by_active correctly', async () => {
1888
1698
  fetch.mockResponseOnce(
1889
- JSON.stringify([
1890
- [
1891
- { col: 'system.dj.is_active.active_id', value: true },
1892
- { col: 'system.dj.number_of_nodes', value: 100 },
1893
- ],
1894
- ]),
1699
+ JSON.stringify({
1700
+ columns: ['system.dj.is_active.active_id', 'system.dj.number_of_nodes'],
1701
+ rows: [[true, 100]],
1702
+ }),
1895
1703
  );
1896
1704
 
1897
1705
  const result = await DataJunctionAPI.system.node_counts_by_active();
@@ -1900,12 +1708,10 @@ describe('DataJunctionAPI', () => {
1900
1708
 
1901
1709
  it('calls system.node_counts_by_type correctly', async () => {
1902
1710
  fetch.mockResponseOnce(
1903
- JSON.stringify([
1904
- [
1905
- { col: 'system.dj.node_type.type', value: 'metric' },
1906
- { col: 'system.dj.number_of_nodes', value: 50 },
1907
- ],
1908
- ]),
1711
+ JSON.stringify({
1712
+ columns: ['system.dj.node_type.type', 'system.dj.number_of_nodes'],
1713
+ rows: [['metric', 50]],
1714
+ }),
1909
1715
  );
1910
1716
 
1911
1717
  const result = await DataJunctionAPI.system.node_counts_by_type();
@@ -1914,12 +1720,10 @@ describe('DataJunctionAPI', () => {
1914
1720
 
1915
1721
  it('calls system.node_counts_by_status correctly', async () => {
1916
1722
  fetch.mockResponseOnce(
1917
- JSON.stringify([
1918
- [
1919
- { col: 'system.dj.nodes.status', value: 'valid' },
1920
- { col: 'system.dj.number_of_nodes', value: 80 },
1921
- ],
1922
- ]),
1723
+ JSON.stringify({
1724
+ columns: ['system.dj.nodes.status', 'system.dj.number_of_nodes'],
1725
+ rows: [['valid', 80]],
1726
+ }),
1923
1727
  );
1924
1728
 
1925
1729
  const result = await DataJunctionAPI.system.node_counts_by_status();
@@ -1928,12 +1732,13 @@ describe('DataJunctionAPI', () => {
1928
1732
 
1929
1733
  it('calls system.nodes_without_description correctly', async () => {
1930
1734
  fetch.mockResponseOnce(
1931
- JSON.stringify([
1932
- [
1933
- { col: 'system.dj.node_type.type', value: 'transform' },
1934
- { col: 'system.dj.node_without_description', value: 10 },
1735
+ JSON.stringify({
1736
+ columns: [
1737
+ 'system.dj.node_type.type',
1738
+ 'system.dj.node_without_description',
1935
1739
  ],
1936
- ]),
1740
+ rows: [['transform', 10]],
1741
+ }),
1937
1742
  );
1938
1743
 
1939
1744
  const result = await DataJunctionAPI.system.nodes_without_description();
@@ -1942,12 +1747,13 @@ describe('DataJunctionAPI', () => {
1942
1747
 
1943
1748
  it('calls system.materialization_counts_by_type correctly', async () => {
1944
1749
  fetch.mockResponseOnce(
1945
- JSON.stringify([
1946
- [
1947
- { col: 'system.dj.node_type.type', value: 'cube' },
1948
- { col: 'system.dj.number_of_materializations', value: 5 },
1750
+ JSON.stringify({
1751
+ columns: [
1752
+ 'system.dj.node_type.type',
1753
+ 'system.dj.number_of_materializations',
1949
1754
  ],
1950
- ]),
1755
+ rows: [['cube', 5]],
1756
+ }),
1951
1757
  );
1952
1758
 
1953
1759
  const result =
@@ -1968,13 +1774,14 @@ describe('DataJunctionAPI', () => {
1968
1774
 
1969
1775
  it('calls system.node_trends correctly', async () => {
1970
1776
  fetch.mockResponseOnce(
1971
- JSON.stringify([
1972
- [
1973
- { col: 'system.dj.nodes.created_at_week', value: 20240101 },
1974
- { col: 'system.dj.node_type.type', value: 'metric' },
1975
- { col: 'system.dj.number_of_nodes', value: 10 },
1777
+ JSON.stringify({
1778
+ columns: [
1779
+ 'system.dj.nodes.created_at_week',
1780
+ 'system.dj.node_type.type',
1781
+ 'system.dj.number_of_nodes',
1976
1782
  ],
1977
- ]),
1783
+ rows: [[20240101, 'metric', 10]],
1784
+ }),
1978
1785
  );
1979
1786
 
1980
1787
  const result = await DataJunctionAPI.system.node_trends();
@@ -1986,12 +1793,10 @@ describe('DataJunctionAPI', () => {
1986
1793
  // Test querySystemMetricSingleDimension edge cases
1987
1794
  it('handles missing values in querySystemMetricSingleDimension', async () => {
1988
1795
  fetch.mockResponseOnce(
1989
- JSON.stringify([
1990
- [
1991
- { col: 'some_dimension', value: null },
1992
- { col: 'some_metric', value: undefined },
1993
- ],
1994
- ]),
1796
+ JSON.stringify({
1797
+ columns: ['some_dimension', 'some_metric'],
1798
+ rows: [[null, null]],
1799
+ }),
1995
1800
  );
1996
1801
 
1997
1802
  const result = await DataJunctionAPI.querySystemMetricSingleDimension({