tnp-core 18.0.42 → 18.0.44
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 +20 -20
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/README.md +24 -24
- package/browser/esm2022/lib/helpers.mjs +23 -28
- package/browser/esm2022/lib/utils.mjs +498 -1
- package/browser/fesm2022/tnp-core.mjs +638 -134
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/lib/helpers.d.ts +5 -3
- package/browser/lib/utils.d.ts +117 -0
- package/cli.backend.d.ts +1 -0
- package/cli.backend.js +2 -2
- package/client/README.md +24 -24
- package/client/esm2022/lib/helpers.mjs +23 -28
- package/client/esm2022/lib/utils.mjs +498 -1
- package/client/fesm2022/tnp-core.mjs +638 -134
- package/client/fesm2022/tnp-core.mjs.map +1 -1
- package/client/lib/helpers.d.ts +5 -3
- package/client/lib/utils.d.ts +117 -0
- package/lib/helpers.d.ts +17 -6
- package/lib/helpers.js +156 -172
- package/lib/helpers.js.map +1 -1
- package/lib/node-chalk-mock.d.ts +1 -2
- package/lib/node-chalk-mock.js +2 -2
- package/lib/node-path-mock.d.ts +1 -25
- package/lib/node-path-mock.js +2 -2
- package/lib/utils.d.ts +121 -9
- package/lib/utils.js +580 -1
- package/lib/utils.js.map +1 -1
- package/package.json +2 -2
- package/taon.jsonc +65 -65
- package/tmp-environment.json +30 -29
- package/websql/README.md +24 -24
- package/websql/esm2022/lib/helpers.mjs +23 -28
- package/websql/esm2022/lib/utils.mjs +498 -1
- package/websql/fesm2022/tnp-core.mjs +726 -222
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/lib/helpers.d.ts +5 -3
- package/websql/lib/utils.d.ts +117 -0
@@ -9,8 +9,8 @@ import * as dateformat from 'dateformat';
|
|
9
9
|
export { dateformat };
|
10
10
|
import * as json5 from 'json5';
|
11
11
|
export { json5 };
|
12
|
-
import axios from 'axios';
|
13
12
|
import { Subject } from 'rxjs';
|
13
|
+
import axios from 'axios';
|
14
14
|
|
15
15
|
let isBrowser = false;
|
16
16
|
isBrowser = true;
|
@@ -729,6 +729,7 @@ var CoreModels;
|
|
729
729
|
/* */
|
730
730
|
/* */
|
731
731
|
/* */
|
732
|
+
/* */
|
732
733
|
const BLOB_SUPPORTED_IN_SQLJS = false;
|
733
734
|
var Utils;
|
734
735
|
(function (Utils) {
|
@@ -1188,11 +1189,505 @@ var UtilsProcess;
|
|
1188
1189
|
/* */
|
1189
1190
|
return (void 0);
|
1190
1191
|
};
|
1191
|
-
/**
|
1192
|
-
* TODO IMPLEMENT
|
1193
|
-
* start async node process
|
1194
|
-
*/
|
1195
|
-
UtilsProcess.startInNewTerminalWindow = (command, options) => {
|
1192
|
+
/**
|
1193
|
+
* TODO IMPLEMENT
|
1194
|
+
* start async node process
|
1195
|
+
*/
|
1196
|
+
UtilsProcess.startInNewTerminalWindow = (command, options) => {
|
1197
|
+
/* */
|
1198
|
+
/* */
|
1199
|
+
/* */
|
1200
|
+
/* */
|
1201
|
+
/* */
|
1202
|
+
/* */
|
1203
|
+
/* */
|
1204
|
+
/* */
|
1205
|
+
/* */
|
1206
|
+
/* */
|
1207
|
+
/* */
|
1208
|
+
/* */
|
1209
|
+
/* */
|
1210
|
+
/* */
|
1211
|
+
/* */
|
1212
|
+
/* */
|
1213
|
+
/* */
|
1214
|
+
/* */
|
1215
|
+
/* */
|
1216
|
+
/* */
|
1217
|
+
/* */
|
1218
|
+
/* */
|
1219
|
+
/* */
|
1220
|
+
/* */
|
1221
|
+
/* */
|
1222
|
+
/* */
|
1223
|
+
/* */
|
1224
|
+
/* */
|
1225
|
+
/* */
|
1226
|
+
/* */
|
1227
|
+
/* */
|
1228
|
+
/* */
|
1229
|
+
/* */
|
1230
|
+
/* */
|
1231
|
+
/* */
|
1232
|
+
/* */
|
1233
|
+
/* */
|
1234
|
+
/* */
|
1235
|
+
/* */
|
1236
|
+
/* */
|
1237
|
+
/* */
|
1238
|
+
/* */
|
1239
|
+
/* */
|
1240
|
+
/* */
|
1241
|
+
/* */
|
1242
|
+
/* */
|
1243
|
+
/* */
|
1244
|
+
/* */
|
1245
|
+
/* */
|
1246
|
+
/* */
|
1247
|
+
/* */
|
1248
|
+
/* */
|
1249
|
+
/* */
|
1250
|
+
/* */
|
1251
|
+
/* */
|
1252
|
+
/* */
|
1253
|
+
/* */
|
1254
|
+
/* */
|
1255
|
+
/* */
|
1256
|
+
/* */
|
1257
|
+
/* */
|
1258
|
+
/* */
|
1259
|
+
/* */
|
1260
|
+
/* */
|
1261
|
+
/* */
|
1262
|
+
/* */
|
1263
|
+
/* */
|
1264
|
+
/* */
|
1265
|
+
/* */
|
1266
|
+
/* */
|
1267
|
+
/* */
|
1268
|
+
/* */
|
1269
|
+
/* */
|
1270
|
+
/* */
|
1271
|
+
/* */
|
1272
|
+
/* */
|
1273
|
+
/* */
|
1274
|
+
/* */
|
1275
|
+
/* */
|
1276
|
+
/* */
|
1277
|
+
/* */
|
1278
|
+
/* */
|
1279
|
+
/* */
|
1280
|
+
/* */
|
1281
|
+
/* */
|
1282
|
+
/* */
|
1283
|
+
/* */
|
1284
|
+
/* */
|
1285
|
+
/* */
|
1286
|
+
/* */
|
1287
|
+
/* */
|
1288
|
+
/* */
|
1289
|
+
/* */
|
1290
|
+
/* */
|
1291
|
+
/* */
|
1292
|
+
/* */
|
1293
|
+
/* */
|
1294
|
+
/* */
|
1295
|
+
/* */
|
1296
|
+
/* */
|
1297
|
+
/* */
|
1298
|
+
return (void 0);
|
1299
|
+
};
|
1300
|
+
UtilsProcess.getBashOrShellName = () => {
|
1301
|
+
return 'browser';
|
1302
|
+
/* */
|
1303
|
+
/* */
|
1304
|
+
/* */
|
1305
|
+
/* */
|
1306
|
+
/* */
|
1307
|
+
/* */
|
1308
|
+
/* */
|
1309
|
+
/* */
|
1310
|
+
/* */
|
1311
|
+
/* */
|
1312
|
+
/* */
|
1313
|
+
/* */
|
1314
|
+
/* */
|
1315
|
+
/* */
|
1316
|
+
/* */
|
1317
|
+
/* */
|
1318
|
+
/* */
|
1319
|
+
/* */
|
1320
|
+
/* */
|
1321
|
+
/* */
|
1322
|
+
/* */
|
1323
|
+
/* */
|
1324
|
+
/* */
|
1325
|
+
/* */
|
1326
|
+
/* */
|
1327
|
+
/* */
|
1328
|
+
/* */
|
1329
|
+
/* */
|
1330
|
+
/* */
|
1331
|
+
/* */
|
1332
|
+
/* */
|
1333
|
+
/* */
|
1334
|
+
return (void 0);
|
1335
|
+
};
|
1336
|
+
})(UtilsProcess || (UtilsProcess = {}));
|
1337
|
+
var UtilsOs;
|
1338
|
+
(function (UtilsOs) {
|
1339
|
+
/**
|
1340
|
+
* check if script is running in client browser
|
1341
|
+
* (websql model -> is also considered as browser
|
1342
|
+
* because it is running in browser)
|
1343
|
+
*/
|
1344
|
+
UtilsOs.isRunningInBrowser = () => {
|
1345
|
+
/* */
|
1346
|
+
/* */
|
1347
|
+
return true;
|
1348
|
+
};
|
1349
|
+
/**
|
1350
|
+
* check if script is running in nodejs
|
1351
|
+
* (backend script or electron script)
|
1352
|
+
*/
|
1353
|
+
UtilsOs.isRunningInNode = () => {
|
1354
|
+
/* */
|
1355
|
+
/* */
|
1356
|
+
return false;
|
1357
|
+
};
|
1358
|
+
/**
|
1359
|
+
* check if script is running special
|
1360
|
+
* browser mode that has sql.js backend
|
1361
|
+
* and executes sql queries in browser
|
1362
|
+
*/
|
1363
|
+
UtilsOs.isRunningInWebSQL = () => {
|
1364
|
+
/* */
|
1365
|
+
/* */
|
1366
|
+
/* */
|
1367
|
+
/* */
|
1368
|
+
return false;
|
1369
|
+
};
|
1370
|
+
/**
|
1371
|
+
* check whether the current process is running inside
|
1372
|
+
* Electron backend or browser.
|
1373
|
+
*/
|
1374
|
+
UtilsOs.isRunningInElectron = () => {
|
1375
|
+
// @ts-ignore
|
1376
|
+
if (typeof window !== 'undefined' &&
|
1377
|
+
typeof window.process === 'object' &&
|
1378
|
+
window.process.type === 'renderer') {
|
1379
|
+
return true;
|
1380
|
+
}
|
1381
|
+
// @ts-ignore
|
1382
|
+
if (typeof process !== 'undefined' &&
|
1383
|
+
typeof process.versions === 'object' &&
|
1384
|
+
!!process.versions.electron) {
|
1385
|
+
return true;
|
1386
|
+
}
|
1387
|
+
if (typeof navigator === 'object' &&
|
1388
|
+
typeof navigator.userAgent === 'string' &&
|
1389
|
+
navigator.userAgent.indexOf('Electron') >= 0) {
|
1390
|
+
return true;
|
1391
|
+
}
|
1392
|
+
return false;
|
1393
|
+
};
|
1394
|
+
/**
|
1395
|
+
* Check wether the current process is running inside
|
1396
|
+
* windows subsystem for linux (WSL).
|
1397
|
+
*/
|
1398
|
+
UtilsOs.isRunningInWsl = () => {
|
1399
|
+
return false;
|
1400
|
+
/* */
|
1401
|
+
/* */
|
1402
|
+
/* */
|
1403
|
+
/* */
|
1404
|
+
/* */
|
1405
|
+
/* */
|
1406
|
+
/* */
|
1407
|
+
/* */
|
1408
|
+
/* */
|
1409
|
+
/* */
|
1410
|
+
/* */
|
1411
|
+
/* */
|
1412
|
+
/* */
|
1413
|
+
/* */
|
1414
|
+
/* */
|
1415
|
+
/* */
|
1416
|
+
/* */
|
1417
|
+
return (void 0);
|
1418
|
+
};
|
1419
|
+
UtilsOs.isRunningInDocker = () => {
|
1420
|
+
return false;
|
1421
|
+
/* */
|
1422
|
+
/* */
|
1423
|
+
/* */
|
1424
|
+
/* */
|
1425
|
+
/* */
|
1426
|
+
/* */
|
1427
|
+
/* */
|
1428
|
+
return (void 0);
|
1429
|
+
};
|
1430
|
+
UtilsOs.isRunningInLinuxGraphicsCapableEnvironment = () => {
|
1431
|
+
/* */
|
1432
|
+
/* */
|
1433
|
+
/* */
|
1434
|
+
/* */
|
1435
|
+
/* */
|
1436
|
+
/* */
|
1437
|
+
/* */
|
1438
|
+
return (void 0);
|
1439
|
+
};
|
1440
|
+
/**
|
1441
|
+
* Check whether the current process is running in CLI mode.
|
1442
|
+
*/
|
1443
|
+
UtilsOs.isRunningInCliMode = () => {
|
1444
|
+
return false;
|
1445
|
+
/* */
|
1446
|
+
/* */
|
1447
|
+
return (void 0);
|
1448
|
+
};
|
1449
|
+
/**
|
1450
|
+
* Check whether the current process is running in mocha test.
|
1451
|
+
*/
|
1452
|
+
UtilsOs.isRunningInMochaTest = () => {
|
1453
|
+
return false;
|
1454
|
+
/* */
|
1455
|
+
/* */
|
1456
|
+
return (void 0);
|
1457
|
+
};
|
1458
|
+
const isPortInUseOnHost = (port, host) => {
|
1459
|
+
/* */
|
1460
|
+
/* */
|
1461
|
+
/* */
|
1462
|
+
/* */
|
1463
|
+
/* */
|
1464
|
+
/* */
|
1465
|
+
/* */
|
1466
|
+
/* */
|
1467
|
+
/* */
|
1468
|
+
/* */
|
1469
|
+
/* */
|
1470
|
+
/* */
|
1471
|
+
/* */
|
1472
|
+
/* */
|
1473
|
+
/* */
|
1474
|
+
/* */
|
1475
|
+
/* */
|
1476
|
+
/* */
|
1477
|
+
/* */
|
1478
|
+
/* */
|
1479
|
+
/* */
|
1480
|
+
/* */
|
1481
|
+
/* */
|
1482
|
+
/* */
|
1483
|
+
return (void 0);
|
1484
|
+
};
|
1485
|
+
/**
|
1486
|
+
* Checks if a given port is already in use (bound by another process).
|
1487
|
+
*
|
1488
|
+
* @param port - The port number to check.
|
1489
|
+
* @param host - The hostname or IP address to bind to (default: '127.0.0.1').
|
1490
|
+
* @returns Promise<boolean> - Resolves to `true` if the port is in use, otherwise `false`.
|
1491
|
+
*/
|
1492
|
+
UtilsOs.isPortInUse = async (port, options) => {
|
1493
|
+
/* */
|
1494
|
+
/* */
|
1495
|
+
/* */
|
1496
|
+
/* */
|
1497
|
+
/* */
|
1498
|
+
/* */
|
1499
|
+
/* */
|
1500
|
+
/* */
|
1501
|
+
/* */
|
1502
|
+
/* */
|
1503
|
+
/* */
|
1504
|
+
/* */
|
1505
|
+
/* */
|
1506
|
+
return (void 0);
|
1507
|
+
};
|
1508
|
+
})(UtilsOs || (UtilsOs = {}));
|
1509
|
+
var UtilsString;
|
1510
|
+
(function (UtilsString) {
|
1511
|
+
UtilsString.kebabCaseNoSplitNumbers = (input) => {
|
1512
|
+
return (input
|
1513
|
+
.replace(/\s+/g, '-')
|
1514
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
1515
|
+
.toLowerCase());
|
1516
|
+
};
|
1517
|
+
})(UtilsString || (UtilsString = {}));
|
1518
|
+
/**
|
1519
|
+
* Taon migration utilities
|
1520
|
+
*/
|
1521
|
+
var UtilsMigrations;
|
1522
|
+
(function (UtilsMigrations) {
|
1523
|
+
UtilsMigrations.getTimestampFromClassName = (className) => {
|
1524
|
+
const [maybeTimestamp1, maybeTimestamp2] = className.split('_') || [];
|
1525
|
+
const timestamp1 = parseInt(maybeTimestamp1);
|
1526
|
+
const timestamp2 = parseInt(maybeTimestamp2);
|
1527
|
+
const timestamp = !_.isNaN(timestamp1) ? timestamp1 : timestamp2;
|
1528
|
+
return UtilsMigrations.isValidTimestamp(timestamp) ? timestamp : void 0;
|
1529
|
+
};
|
1530
|
+
UtilsMigrations.getFormattedTimestampFromClassName = (className) => {
|
1531
|
+
const timestamp = UtilsMigrations.getTimestampFromClassName(className);
|
1532
|
+
if (!timestamp) {
|
1533
|
+
return void 0;
|
1534
|
+
}
|
1535
|
+
return UtilsMigrations.formatTimestamp(timestamp);
|
1536
|
+
};
|
1537
|
+
UtilsMigrations.formatTimestamp = (timestamp) => {
|
1538
|
+
const dateFromTimestamp = new Date(timestamp);
|
1539
|
+
return `${dateformat(dateFromTimestamp, 'dd-mm-yyyy HH:MM:ss')}`;
|
1540
|
+
};
|
1541
|
+
UtilsMigrations.isValidTimestamp = (value) => {
|
1542
|
+
if (typeof value !== 'number') {
|
1543
|
+
return false; // Must be a number
|
1544
|
+
}
|
1545
|
+
const minTimestamp = 0; // Minimum possible timestamp (Unix epoch)
|
1546
|
+
const maxTimestamp = 8640000000000000; // Max safe timestamp in JS (represents year ~275760)
|
1547
|
+
return value >= minTimestamp && value <= maxTimestamp;
|
1548
|
+
};
|
1549
|
+
})(UtilsMigrations || (UtilsMigrations = {}));
|
1550
|
+
var UtilsTerminal;
|
1551
|
+
(function (UtilsTerminal) {
|
1552
|
+
UtilsTerminal.clearConsole = () => {
|
1553
|
+
/* */
|
1554
|
+
/* */
|
1555
|
+
/* */
|
1556
|
+
/* */
|
1557
|
+
/* */
|
1558
|
+
/* */
|
1559
|
+
/* */
|
1560
|
+
/* */
|
1561
|
+
/* */
|
1562
|
+
return (void 0);
|
1563
|
+
};
|
1564
|
+
const transformChoices = (choices) => {
|
1565
|
+
/* */
|
1566
|
+
/* */
|
1567
|
+
/* */
|
1568
|
+
/* */
|
1569
|
+
/* */
|
1570
|
+
/* */
|
1571
|
+
/* */
|
1572
|
+
/* */
|
1573
|
+
/* */
|
1574
|
+
/* */
|
1575
|
+
/* */
|
1576
|
+
/* */
|
1577
|
+
return (void 0);
|
1578
|
+
};
|
1579
|
+
UtilsTerminal.multiselect = async (options) => {
|
1580
|
+
/* */
|
1581
|
+
/* */
|
1582
|
+
/* */
|
1583
|
+
/* */
|
1584
|
+
/* */
|
1585
|
+
/* */
|
1586
|
+
/* */
|
1587
|
+
/* */
|
1588
|
+
/* */
|
1589
|
+
/* */
|
1590
|
+
/* */
|
1591
|
+
/* */
|
1592
|
+
/* */
|
1593
|
+
/* */
|
1594
|
+
/* */
|
1595
|
+
/* */
|
1596
|
+
/* */
|
1597
|
+
/* */
|
1598
|
+
/* */
|
1599
|
+
/* */
|
1600
|
+
/* */
|
1601
|
+
/* */
|
1602
|
+
/* */
|
1603
|
+
/* */
|
1604
|
+
/* */
|
1605
|
+
/* */
|
1606
|
+
/* */
|
1607
|
+
/* */
|
1608
|
+
/* */
|
1609
|
+
/* */
|
1610
|
+
/* */
|
1611
|
+
/* */
|
1612
|
+
/* */
|
1613
|
+
/* */
|
1614
|
+
/* */
|
1615
|
+
/* */
|
1616
|
+
/* */
|
1617
|
+
/* */
|
1618
|
+
/* */
|
1619
|
+
/* */
|
1620
|
+
/* */
|
1621
|
+
/* */
|
1622
|
+
/* */
|
1623
|
+
/* */
|
1624
|
+
/* */
|
1625
|
+
/* */
|
1626
|
+
/* */
|
1627
|
+
/* */
|
1628
|
+
/* */
|
1629
|
+
/* */
|
1630
|
+
/* */
|
1631
|
+
/* */
|
1632
|
+
/* */
|
1633
|
+
/* */
|
1634
|
+
/* */
|
1635
|
+
/* */
|
1636
|
+
/* */
|
1637
|
+
/* */
|
1638
|
+
/* */
|
1639
|
+
/* */
|
1640
|
+
/* */
|
1641
|
+
/* */
|
1642
|
+
/* */
|
1643
|
+
/* */
|
1644
|
+
/* */
|
1645
|
+
/* */
|
1646
|
+
/* */
|
1647
|
+
/* */
|
1648
|
+
/* */
|
1649
|
+
/* */
|
1650
|
+
/* */
|
1651
|
+
/* */
|
1652
|
+
/* */
|
1653
|
+
/* */
|
1654
|
+
/* */
|
1655
|
+
return (void 0);
|
1656
|
+
};
|
1657
|
+
/**
|
1658
|
+
* Similar to select but executes action if provided
|
1659
|
+
* @returns selected and executed value
|
1660
|
+
*/
|
1661
|
+
UtilsTerminal.selectActionAndExecute = async (choices, options) => {
|
1662
|
+
/* */
|
1663
|
+
/* */
|
1664
|
+
/* */
|
1665
|
+
/* */
|
1666
|
+
/* */
|
1667
|
+
/* */
|
1668
|
+
/* */
|
1669
|
+
/* */
|
1670
|
+
/* */
|
1671
|
+
/* */
|
1672
|
+
/* */
|
1673
|
+
/* */
|
1674
|
+
/* */
|
1675
|
+
/* */
|
1676
|
+
/* */
|
1677
|
+
/* */
|
1678
|
+
/* */
|
1679
|
+
/* */
|
1680
|
+
/* */
|
1681
|
+
/* */
|
1682
|
+
/* */
|
1683
|
+
/* */
|
1684
|
+
return (void 0);
|
1685
|
+
};
|
1686
|
+
UtilsTerminal.select = async (options) => {
|
1687
|
+
/* */
|
1688
|
+
/* */
|
1689
|
+
/* */
|
1690
|
+
/* */
|
1196
1691
|
/* */
|
1197
1692
|
/* */
|
1198
1693
|
/* */
|
@@ -1248,6 +1743,49 @@ var UtilsProcess;
|
|
1248
1743
|
/* */
|
1249
1744
|
/* */
|
1250
1745
|
/* */
|
1746
|
+
/* */
|
1747
|
+
return (void 0);
|
1748
|
+
};
|
1749
|
+
UtilsTerminal.pipeEnterToStdin = () => {
|
1750
|
+
/* */
|
1751
|
+
/* */
|
1752
|
+
return (void 0);
|
1753
|
+
};
|
1754
|
+
UtilsTerminal.input = async ({ defaultValue, question, required, // TODO something is werid with required
|
1755
|
+
}) => {
|
1756
|
+
/* */
|
1757
|
+
/* */
|
1758
|
+
/* */
|
1759
|
+
/* */
|
1760
|
+
/* */
|
1761
|
+
/* */
|
1762
|
+
/* */
|
1763
|
+
/* */
|
1764
|
+
/* */
|
1765
|
+
/* */
|
1766
|
+
/* */
|
1767
|
+
/* */
|
1768
|
+
/* */
|
1769
|
+
/* */
|
1770
|
+
/* */
|
1771
|
+
/* */
|
1772
|
+
/* */
|
1773
|
+
/* */
|
1774
|
+
/* */
|
1775
|
+
/* */
|
1776
|
+
/* */
|
1777
|
+
/* */
|
1778
|
+
/* */
|
1779
|
+
/* */
|
1780
|
+
/* */
|
1781
|
+
/* */
|
1782
|
+
/* */
|
1783
|
+
/* */
|
1784
|
+
/* */
|
1785
|
+
/* */
|
1786
|
+
return (void 0);
|
1787
|
+
};
|
1788
|
+
UtilsTerminal.confirm = async (options) => {
|
1251
1789
|
/* */
|
1252
1790
|
/* */
|
1253
1791
|
/* */
|
@@ -1294,10 +1832,6 @@ var UtilsProcess;
|
|
1294
1832
|
/* */
|
1295
1833
|
/* */
|
1296
1834
|
/* */
|
1297
|
-
return (void 0);
|
1298
|
-
};
|
1299
|
-
UtilsProcess.getBashOrShellName = () => {
|
1300
|
-
return 'browser';
|
1301
1835
|
/* */
|
1302
1836
|
/* */
|
1303
1837
|
/* */
|
@@ -1332,70 +1866,41 @@ var UtilsProcess;
|
|
1332
1866
|
/* */
|
1333
1867
|
return (void 0);
|
1334
1868
|
};
|
1335
|
-
|
1336
|
-
var UtilsOs;
|
1337
|
-
(function (UtilsOs) {
|
1338
|
-
/**
|
1339
|
-
* check if script is running in client browser
|
1340
|
-
* (websql model -> is also considered as browser
|
1341
|
-
* because it is running in browser)
|
1342
|
-
*/
|
1343
|
-
UtilsOs.isRunningInBrowser = () => {
|
1869
|
+
UtilsTerminal.pressAnyKeyToContinueAsync = (options) => {
|
1344
1870
|
/* */
|
1345
1871
|
/* */
|
1346
|
-
return true;
|
1347
|
-
};
|
1348
|
-
/**
|
1349
|
-
* check if script is running in nodejs
|
1350
|
-
* (backend script or electron script)
|
1351
|
-
*/
|
1352
|
-
UtilsOs.isRunningInNode = () => {
|
1353
1872
|
/* */
|
1354
1873
|
/* */
|
1355
|
-
return false;
|
1356
|
-
};
|
1357
|
-
/**
|
1358
|
-
* check if script is running special
|
1359
|
-
* browser mode that has sql.js backend
|
1360
|
-
* and executes sql queries in browser
|
1361
|
-
*/
|
1362
|
-
UtilsOs.isRunningInWebSQL = () => {
|
1363
1874
|
/* */
|
1364
1875
|
/* */
|
1365
1876
|
/* */
|
1366
1877
|
/* */
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
return true;
|
1379
|
-
}
|
1380
|
-
// @ts-ignore
|
1381
|
-
if (typeof process !== 'undefined' &&
|
1382
|
-
typeof process.versions === 'object' &&
|
1383
|
-
!!process.versions.electron) {
|
1384
|
-
return true;
|
1385
|
-
}
|
1386
|
-
if (typeof navigator === 'object' &&
|
1387
|
-
typeof navigator.userAgent === 'string' &&
|
1388
|
-
navigator.userAgent.indexOf('Electron') >= 0) {
|
1389
|
-
return true;
|
1390
|
-
}
|
1391
|
-
return false;
|
1878
|
+
/* */
|
1879
|
+
/* */
|
1880
|
+
/* */
|
1881
|
+
/* */
|
1882
|
+
/* */
|
1883
|
+
/* */
|
1884
|
+
/* */
|
1885
|
+
/* */
|
1886
|
+
/* */
|
1887
|
+
/* */
|
1888
|
+
return (void 0);
|
1392
1889
|
};
|
1393
1890
|
/**
|
1394
|
-
*
|
1395
|
-
* windows subsystem for linux (WSL).
|
1891
|
+
* @deprecated use UtilsTerminal.pressAnyKeyToContinueAsync()
|
1396
1892
|
*/
|
1397
|
-
|
1398
|
-
|
1893
|
+
UtilsTerminal.pressAnyKey = (options) => {
|
1894
|
+
/* */
|
1895
|
+
/* */
|
1896
|
+
/* */
|
1897
|
+
/* */
|
1898
|
+
/* */
|
1899
|
+
/* */
|
1900
|
+
/* */
|
1901
|
+
/* */
|
1902
|
+
/* */
|
1903
|
+
/* */
|
1399
1904
|
/* */
|
1400
1905
|
/* */
|
1401
1906
|
/* */
|
@@ -1415,8 +1920,17 @@ var UtilsOs;
|
|
1415
1920
|
/* */
|
1416
1921
|
return (void 0);
|
1417
1922
|
};
|
1418
|
-
|
1419
|
-
|
1923
|
+
UtilsTerminal.previewLongList = async (list, listName = 'List') => {
|
1924
|
+
/* */
|
1925
|
+
/* */
|
1926
|
+
/* */
|
1927
|
+
/* */
|
1928
|
+
/* */
|
1929
|
+
/* */
|
1930
|
+
/* */
|
1931
|
+
/* */
|
1932
|
+
/* */
|
1933
|
+
/* */
|
1420
1934
|
/* */
|
1421
1935
|
/* */
|
1422
1936
|
/* */
|
@@ -1426,7 +1940,31 @@ var UtilsOs;
|
|
1426
1940
|
/* */
|
1427
1941
|
return (void 0);
|
1428
1942
|
};
|
1429
|
-
|
1943
|
+
/**
|
1944
|
+
* Displays a long list in the console using a pager like `less`.
|
1945
|
+
* Returns a Promise that resolves when the user exits the pager.
|
1946
|
+
*
|
1947
|
+
* @param {string} list - The long string content to display.
|
1948
|
+
* @returns {Promise<void>} A Promise that resolves when the pager exits.
|
1949
|
+
*/
|
1950
|
+
UtilsTerminal.previewLongListGitLogLike = (list) => {
|
1951
|
+
/* */
|
1952
|
+
/* */
|
1953
|
+
/* */
|
1954
|
+
/* */
|
1955
|
+
/* */
|
1956
|
+
/* */
|
1957
|
+
/* */
|
1958
|
+
/* */
|
1959
|
+
/* */
|
1960
|
+
/* */
|
1961
|
+
/* */
|
1962
|
+
/* */
|
1963
|
+
/* */
|
1964
|
+
/* */
|
1965
|
+
/* */
|
1966
|
+
/* */
|
1967
|
+
/* */
|
1430
1968
|
/* */
|
1431
1969
|
/* */
|
1432
1970
|
/* */
|
@@ -1436,48 +1974,7 @@ var UtilsOs;
|
|
1436
1974
|
/* */
|
1437
1975
|
return (void 0);
|
1438
1976
|
};
|
1439
|
-
})(
|
1440
|
-
var UtilsString;
|
1441
|
-
(function (UtilsString) {
|
1442
|
-
UtilsString.kebabCaseNoSplitNumbers = (input) => {
|
1443
|
-
return (input
|
1444
|
-
.replace(/\s+/g, '-')
|
1445
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
1446
|
-
.toLowerCase());
|
1447
|
-
};
|
1448
|
-
})(UtilsString || (UtilsString = {}));
|
1449
|
-
/**
|
1450
|
-
* Taon migration utilities
|
1451
|
-
*/
|
1452
|
-
var UtilsMigrations;
|
1453
|
-
(function (UtilsMigrations) {
|
1454
|
-
UtilsMigrations.getTimestampFromClassName = (className) => {
|
1455
|
-
const [maybeTimestamp1, maybeTimestamp2] = className.split('_') || [];
|
1456
|
-
const timestamp1 = parseInt(maybeTimestamp1);
|
1457
|
-
const timestamp2 = parseInt(maybeTimestamp2);
|
1458
|
-
const timestamp = !_.isNaN(timestamp1) ? timestamp1 : timestamp2;
|
1459
|
-
return UtilsMigrations.isValidTimestamp(timestamp) ? timestamp : void 0;
|
1460
|
-
};
|
1461
|
-
UtilsMigrations.getFormattedTimestampFromClassName = (className) => {
|
1462
|
-
const timestamp = UtilsMigrations.getTimestampFromClassName(className);
|
1463
|
-
if (!timestamp) {
|
1464
|
-
return void 0;
|
1465
|
-
}
|
1466
|
-
return UtilsMigrations.formatTimestamp(timestamp);
|
1467
|
-
};
|
1468
|
-
UtilsMigrations.formatTimestamp = (timestamp) => {
|
1469
|
-
const dateFromTimestamp = new Date(timestamp);
|
1470
|
-
return `${dateformat(dateFromTimestamp, 'dd-mm-yyyy HH:MM:ss')}`;
|
1471
|
-
};
|
1472
|
-
UtilsMigrations.isValidTimestamp = (value) => {
|
1473
|
-
if (typeof value !== 'number') {
|
1474
|
-
return false; // Must be a number
|
1475
|
-
}
|
1476
|
-
const minTimestamp = 0; // Minimum possible timestamp (Unix epoch)
|
1477
|
-
const maxTimestamp = 8640000000000000; // Max safe timestamp in JS (represents year ~275760)
|
1478
|
-
return value >= minTimestamp && value <= maxTimestamp;
|
1479
|
-
};
|
1480
|
-
})(UtilsMigrations || (UtilsMigrations = {}));
|
1977
|
+
})(UtilsTerminal || (UtilsTerminal = {}));
|
1481
1978
|
;
|
1482
1979
|
({}); // @--end-of-file-for-module=tnp-core lib/utils.ts
|
1483
1980
|
|
@@ -2076,10 +2573,26 @@ class HelpersMessages extends HelpersIsomorphic {
|
|
2076
2573
|
;
|
2077
2574
|
({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
|
2078
2575
|
|
2079
|
-
const encoding = 'utf8';
|
2080
2576
|
/* */
|
2081
2577
|
/* */
|
2082
2578
|
/* */
|
2579
|
+
/* */
|
2580
|
+
/* */
|
2581
|
+
/* */
|
2582
|
+
/* */
|
2583
|
+
/* */
|
2584
|
+
/* */
|
2585
|
+
/* */
|
2586
|
+
/* */
|
2587
|
+
/* */
|
2588
|
+
/* */
|
2589
|
+
/* */
|
2590
|
+
/* */
|
2591
|
+
/* */
|
2592
|
+
/* */
|
2593
|
+
const encoding = 'utf8';
|
2594
|
+
/* */
|
2595
|
+
/* */
|
2083
2596
|
const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
|
2084
2597
|
const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
|
2085
2598
|
class HelpersCore extends HelpersMessages {
|
@@ -2100,6 +2613,15 @@ class HelpersCore extends HelpersMessages {
|
|
2100
2613
|
/* */
|
2101
2614
|
/* */
|
2102
2615
|
/* */
|
2616
|
+
/* */
|
2617
|
+
/* */
|
2618
|
+
/* */
|
2619
|
+
/* */
|
2620
|
+
/* */
|
2621
|
+
/* */
|
2622
|
+
/* */
|
2623
|
+
/* */
|
2624
|
+
/* */
|
2103
2625
|
constructor() {
|
2104
2626
|
super();
|
2105
2627
|
/* */
|
@@ -2127,9 +2649,11 @@ class HelpersCore extends HelpersMessages {
|
|
2127
2649
|
isRunningInLinuxGraphicsCapableEnvironment() {
|
2128
2650
|
return UtilsOs.isRunningInLinuxGraphicsCapableEnvironment();
|
2129
2651
|
}
|
2652
|
+
/**
|
2653
|
+
* @deprecated use UtilsTerminal.clearConsole
|
2654
|
+
*/
|
2130
2655
|
clearConsole() {
|
2131
|
-
|
2132
|
-
console.log('\x1Bc');
|
2656
|
+
return UtilsTerminal.clearConsole();
|
2133
2657
|
}
|
2134
2658
|
/**
|
2135
2659
|
* get electron browser ipc renderer
|
@@ -3409,30 +3933,10 @@ class HelpersCore extends HelpersMessages {
|
|
3409
3933
|
},
|
3410
3934
|
};
|
3411
3935
|
}
|
3412
|
-
async questionYesNo(message, callbackTrue, callbackFalse, defaultValue = true,
|
3413
3936
|
/**
|
3414
|
-
*
|
3937
|
+
* @deprecated use UtilsTerminal.confirm
|
3415
3938
|
*/
|
3416
|
-
|
3417
|
-
/* */
|
3418
|
-
/* */
|
3419
|
-
/* */
|
3420
|
-
/* */
|
3421
|
-
/* */
|
3422
|
-
/* */
|
3423
|
-
/* */
|
3424
|
-
/* */
|
3425
|
-
/* */
|
3426
|
-
/* */
|
3427
|
-
/* */
|
3428
|
-
/* */
|
3429
|
-
/* */
|
3430
|
-
/* */
|
3431
|
-
/* */
|
3432
|
-
/* */
|
3433
|
-
/* */
|
3434
|
-
/* */
|
3435
|
-
/* */
|
3939
|
+
async questionYesNo(message, callbackTrue, callbackFalse, defaultValue = true) {
|
3436
3940
|
/* */
|
3437
3941
|
/* */
|
3438
3942
|
/* */
|
@@ -4661,5 +5165,5 @@ let Helpers = HelpersCore.InstanceCore;
|
|
4661
5165
|
* Generated bundle index. Do not edit.
|
4662
5166
|
*/
|
4663
5167
|
|
4664
|
-
export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, requiredForDev, win32Path };
|
5168
|
+
export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, UtilsTerminal, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, requiredForDev, win32Path };
|
4665
5169
|
//# sourceMappingURL=tnp-core.mjs.map
|