tnp-core 21.0.134 → 21.0.136
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/VERIFIED-BUILD-DATA.jsonc +3 -3
- package/bin/start.js +1 -1
- package/browser/fesm2022/tnp-core-browser.mjs +5236 -5121
- package/browser/fesm2022/tnp-core-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/tnp-core-browser.d.ts +245 -194
- package/browser-prod/fesm2022/tnp-core-browser-prod.mjs +2832 -2716
- package/browser-prod/fesm2022/tnp-core-browser-prod.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/browser-prod/types/tnp-core-browser-prod.d.ts +206 -157
- package/browser-prod.split-namespaces.json +134 -112
- package/cli.backend.js +2 -2
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/config.js +6 -2
- package/lib/config.js.map +1 -1
- package/lib/core-models.d.ts +3 -0
- package/lib/core-models.js +0 -1
- package/lib/core-models.js.map +1 -1
- package/lib/helpers.js +7 -6
- package/lib/helpers.js.map +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/node-chalk-mock.js +2 -2
- package/lib/node-path-mock.js +2 -2
- package/lib/package.json +1 -1
- package/lib/utils-binary.d.ts +68 -0
- package/lib/utils-binary.js +337 -0
- package/lib/utils-binary.js.map +1 -0
- package/lib/utils-cli.d.ts +41 -0
- package/lib/utils-cli.js +117 -0
- package/lib/utils-cli.js.map +1 -0
- package/lib/utils-dot-file.d.ts +17 -0
- package/lib/utils-dot-file.js +249 -0
- package/lib/utils-dot-file.js.map +1 -0
- package/lib/utils-exec-proc.js +2 -2
- package/lib/utils-exec-proc.js.map +1 -1
- package/lib/utils-i18n.d.ts +38 -0
- package/lib/utils-i18n.js +51 -0
- package/lib/utils-i18n.js.map +1 -0
- package/lib/utils-json.d.ts +22 -0
- package/lib/utils-json.js +158 -0
- package/lib/utils-json.js.map +1 -0
- package/lib/utils-os.d.ts +2 -0
- package/lib/utils-os.js +85 -44
- package/lib/utils-os.js.map +1 -1
- package/lib/utils-string-regex.d.ts +6 -0
- package/lib/utils-string-regex.js +29 -0
- package/lib/utils-string-regex.js.map +1 -0
- package/lib/utils-sudo.d.ts +32 -0
- package/lib/utils-sudo.js +131 -0
- package/lib/utils-sudo.js.map +1 -0
- package/lib/utils-time.d.ts +16 -0
- package/lib/utils-time.js +99 -0
- package/lib/utils-time.js.map +1 -0
- package/lib/utils.d.ts +0 -202
- package/lib/utils.js +5 -1081
- package/lib/utils.js.map +1 -1
- package/lib-esm/cli.backend.d.ts +1 -1
- package/lib-esm/cli.backend.js +1 -1
- package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib-esm/lib/build-info._auto-generated_.js +1 -1
- package/lib-esm/lib/config.js +6 -2
- package/lib-esm/lib/config.js.map +1 -1
- package/lib-esm/lib/core-models.d.ts +3 -0
- package/lib-esm/lib/core-models.js +0 -1
- package/lib-esm/lib/core-models.js.map +1 -1
- package/lib-esm/lib/helpers.js +3 -2
- package/lib-esm/lib/helpers.js.map +1 -1
- package/lib-esm/lib/index.d.ts +8 -0
- package/lib-esm/lib/index.js +8 -0
- package/lib-esm/lib/index.js.map +1 -1
- package/lib-esm/lib/node-chalk-mock.d.ts +1 -1
- package/lib-esm/lib/node-chalk-mock.js +1 -1
- package/lib-esm/lib/node-path-mock.d.ts +1 -1
- package/lib-esm/lib/node-path-mock.js +1 -1
- package/lib-esm/lib/utils-binary.d.ts +60 -0
- package/lib-esm/lib/utils-binary.js +334 -0
- package/lib-esm/lib/utils-binary.js.map +1 -0
- package/lib-esm/lib/utils-cli.d.ts +41 -0
- package/lib-esm/lib/utils-cli.js +114 -0
- package/lib-esm/lib/utils-cli.js.map +1 -0
- package/lib-esm/lib/utils-dot-file.d.ts +17 -0
- package/lib-esm/lib/utils-dot-file.js +246 -0
- package/lib-esm/lib/utils-dot-file.js.map +1 -0
- package/lib-esm/lib/utils-exec-proc.js +1 -1
- package/lib-esm/lib/utils-exec-proc.js.map +1 -1
- package/lib-esm/lib/utils-i18n.d.ts +38 -0
- package/lib-esm/lib/utils-i18n.js +48 -0
- package/lib-esm/lib/utils-i18n.js.map +1 -0
- package/lib-esm/lib/utils-json.d.ts +22 -0
- package/lib-esm/lib/utils-json.js +155 -0
- package/lib-esm/lib/utils-json.js.map +1 -0
- package/lib-esm/lib/utils-os.d.ts +2 -0
- package/lib-esm/lib/utils-os.js +86 -45
- package/lib-esm/lib/utils-os.js.map +1 -1
- package/lib-esm/lib/utils-string-regex.d.ts +6 -0
- package/lib-esm/lib/utils-string-regex.js +26 -0
- package/lib-esm/lib/utils-string-regex.js.map +1 -0
- package/lib-esm/lib/utils-sudo.d.ts +32 -0
- package/lib-esm/lib/utils-sudo.js +128 -0
- package/lib-esm/lib/utils-sudo.js.map +1 -0
- package/lib-esm/lib/utils-time.d.ts +16 -0
- package/lib-esm/lib/utils-time.js +96 -0
- package/lib-esm/lib/utils-time.js.map +1 -0
- package/lib-esm/lib/utils.d.ts +0 -194
- package/lib-esm/lib/utils.js +3 -1079
- package/lib-esm/lib/utils.js.map +1 -1
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/config.js +6 -2
- package/lib-prod/config.js.map +1 -1
- package/lib-prod/core-cli.js.map +1 -1
- package/lib-prod/core-models.d.ts +3 -0
- package/lib-prod/core-models.js +0 -1
- package/lib-prod/core-models.js.map +1 -1
- package/lib-prod/global-task-manager.js.map +1 -1
- package/lib-prod/helpers.js +3 -2
- package/lib-prod/helpers.js.map +1 -1
- package/lib-prod/index.d.ts +8 -0
- package/lib-prod/index.js +8 -0
- package/lib-prod/index.js.map +1 -1
- package/lib-prod/node-chalk-mock.d.ts +1 -1
- package/lib-prod/node-chalk-mock.js +1 -1
- package/lib-prod/node-path-mock.d.ts +1 -1
- package/lib-prod/node-path-mock.js +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/start-cli.js.map +1 -1
- package/lib-prod/utils-binary.d.ts +58 -0
- package/lib-prod/utils-binary.js +311 -0
- package/lib-prod/utils-binary.js.map +1 -0
- package/lib-prod/utils-cli.d.ts +19 -0
- package/lib-prod/utils-cli.js +112 -0
- package/lib-prod/utils-cli.js.map +1 -0
- package/lib-prod/utils-dot-file.d.ts +15 -0
- package/lib-prod/utils-dot-file.js +245 -0
- package/lib-prod/utils-dot-file.js.map +1 -0
- package/lib-prod/utils-exec-proc.js +1 -1
- package/lib-prod/utils-exec-proc.js.map +1 -1
- package/lib-prod/utils-files-folders.js.map +1 -1
- package/lib-prod/utils-i18n.d.ts +36 -0
- package/lib-prod/utils-i18n.js +46 -0
- package/lib-prod/utils-i18n.js.map +1 -0
- package/lib-prod/utils-json.d.ts +20 -0
- package/lib-prod/utils-json.js +153 -0
- package/lib-prod/utils-json.js.map +1 -0
- package/lib-prod/utils-network.js.map +1 -1
- package/lib-prod/utils-os.d.ts +2 -0
- package/lib-prod/utils-os.js +87 -46
- package/lib-prod/utils-os.js.map +1 -1
- package/lib-prod/utils-process-logger.js.map +1 -1
- package/lib-prod/utils-process.js.map +1 -1
- package/lib-prod/utils-string-regex.d.ts +2 -0
- package/lib-prod/utils-string-regex.js +24 -0
- package/lib-prod/utils-string-regex.js.map +1 -0
- package/lib-prod/utils-sudo.d.ts +30 -0
- package/lib-prod/utils-sudo.js +126 -0
- package/lib-prod/utils-sudo.js.map +1 -0
- package/lib-prod/utils-terminal.js.map +1 -1
- package/lib-prod/utils-time.d.ts +14 -0
- package/lib-prod/utils-time.js +95 -0
- package/lib-prod/utils-time.js.map +1 -0
- package/lib-prod/utils.d.ts +0 -158
- package/lib-prod/utils.js +5 -1045
- package/lib-prod/utils.js.map +1 -1
- package/lib-prod.split-namespaces.json +144 -124
- package/package.json +1 -1
- package/websql/fesm2022/tnp-core-websql.mjs +5237 -5122
- package/websql/fesm2022/tnp-core-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/tnp-core-websql.d.ts +245 -194
- package/websql-prod/fesm2022/tnp-core-websql-prod.mjs +2839 -2723
- package/websql-prod/fesm2022/tnp-core-websql-prod.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
- package/websql-prod/types/tnp-core-websql-prod.d.ts +206 -157
- package/websql-prod.split-namespaces.json +134 -112
package/browser/package.json
CHANGED
|
@@ -1094,6 +1094,9 @@ declare namespace CoreModels {
|
|
|
1094
1094
|
*/
|
|
1095
1095
|
export const parentLocation = "parent-location";
|
|
1096
1096
|
export const hasExitCleaningFunction = "has-exit-cleaning-function-for";
|
|
1097
|
+
export type DeepPartial<T> = {
|
|
1098
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
1099
|
+
};
|
|
1097
1100
|
export {};
|
|
1098
1101
|
}
|
|
1099
1102
|
|
|
@@ -1149,64 +1152,6 @@ declare namespace Utils {
|
|
|
1149
1152
|
* all non word / repeated characters
|
|
1150
1153
|
*/
|
|
1151
1154
|
const camelize: (str?: string) => string;
|
|
1152
|
-
enum DbBinaryFormatEnum {
|
|
1153
|
-
Blob = "Blob",
|
|
1154
|
-
File = "File",
|
|
1155
|
-
string = "string"
|
|
1156
|
-
}
|
|
1157
|
-
type DbBinaryFormatForBrowser = Blob | File | string;
|
|
1158
|
-
/**
|
|
1159
|
-
* Binary format that can be stored in database
|
|
1160
|
-
*
|
|
1161
|
-
* for nodejs => Buffer
|
|
1162
|
-
* for sql.js => string (shoulb be blob - but not supported)
|
|
1163
|
-
*
|
|
1164
|
-
*/
|
|
1165
|
-
type DbBinaryFormat = DbBinaryFormatForBrowser;
|
|
1166
|
-
namespace binary {
|
|
1167
|
-
/**
|
|
1168
|
-
* This is for BROWSER ONLY
|
|
1169
|
-
*
|
|
1170
|
-
* @param buffer
|
|
1171
|
-
* @param contentType
|
|
1172
|
-
* @returns
|
|
1173
|
-
*/
|
|
1174
|
-
function arrayBufferToBlob(buffer: ArrayBuffer, contentType: CoreModels.ContentType): Promise<Blob>;
|
|
1175
|
-
/**
|
|
1176
|
-
* This is for BROWSER ONLY
|
|
1177
|
-
* @param blob
|
|
1178
|
-
* @returns
|
|
1179
|
-
*/
|
|
1180
|
-
function blobToArrayBuffer(blob: Blob): Promise<ArrayBuffer>;
|
|
1181
|
-
/**
|
|
1182
|
-
* it is revers to base64toBlob
|
|
1183
|
-
* @param blob
|
|
1184
|
-
* @returns
|
|
1185
|
-
*/
|
|
1186
|
-
function blobToBase64(blob: Blob): Promise<string>;
|
|
1187
|
-
/**
|
|
1188
|
-
* it is revers to blobToBase64()
|
|
1189
|
-
* @param base64Data
|
|
1190
|
-
* @returns
|
|
1191
|
-
*/
|
|
1192
|
-
function base64toBlob(base64Data: string, contentTypeOverride?: CoreModels.ContentType): Promise<Blob>;
|
|
1193
|
-
function base64toDbBinaryFormat(text: string): Promise<DbBinaryFormat>;
|
|
1194
|
-
function dbBinaryFormatToBase64(binaryFormat: DbBinaryFormat): Promise<string>;
|
|
1195
|
-
function textToDbBinaryFormat(text: string): Promise<DbBinaryFormat>;
|
|
1196
|
-
function dbBinaryFormatToText(binaryFormat: DbBinaryFormat): Promise<string>;
|
|
1197
|
-
function fileToBlob(file: File): Promise<Blob>;
|
|
1198
|
-
function blobToFile(blob: Blob, nameForFile?: string): Promise<File>;
|
|
1199
|
-
function textToBlob(text: string, type?: CoreModels.ContentType): Promise<Blob>;
|
|
1200
|
-
function blobToText(blob: Blob): Promise<string>;
|
|
1201
|
-
function textToFile(text: string, fileRelativePathOrName: string): Promise<File>;
|
|
1202
|
-
function fileToText(file: File): Promise<string>;
|
|
1203
|
-
function jsonToBlob(jsonObj: object): Promise<Blob>;
|
|
1204
|
-
/**
|
|
1205
|
-
* TODO NOT TESTED
|
|
1206
|
-
*/
|
|
1207
|
-
function blobToJson(blob: Blob): Promise<string>;
|
|
1208
|
-
function getBlobFrom(url: string): Promise<Blob>;
|
|
1209
|
-
}
|
|
1210
1155
|
namespace css {
|
|
1211
1156
|
/**
|
|
1212
1157
|
*
|
|
@@ -1216,25 +1161,6 @@ declare namespace Utils {
|
|
|
1216
1161
|
function numValue(pixelsCss: string | number): number;
|
|
1217
1162
|
}
|
|
1218
1163
|
}
|
|
1219
|
-
declare namespace UtilsTime {
|
|
1220
|
-
const formatDuration: (milliseconds: number) => string;
|
|
1221
|
-
const wait: (second: number) => Promise<void>;
|
|
1222
|
-
const waitMilliseconds: (milliseconds: number) => Promise<void>;
|
|
1223
|
-
interface MeasureOptions {
|
|
1224
|
-
hideLogs?: boolean;
|
|
1225
|
-
}
|
|
1226
|
-
interface ExecutionTimeResult {
|
|
1227
|
-
readonly milliseconds: number;
|
|
1228
|
-
readonly seconds: number;
|
|
1229
|
-
readonly minutes: number;
|
|
1230
|
-
readonly human: string;
|
|
1231
|
-
}
|
|
1232
|
-
const mesureExecutionTime: <T>(description: string, functionToExecute: () => Promise<T>, options?: MeasureOptions) => Promise<ExecutionTimeResult>;
|
|
1233
|
-
const mesureExecutionTimeSync: <T>(description: string, functionToExecute: () => T, options?: MeasureOptions) => ExecutionTimeResult;
|
|
1234
|
-
}
|
|
1235
|
-
declare namespace UtilsStringRegex {
|
|
1236
|
-
const containsNonAscii: (pathStringOrPathParts: string) => boolean;
|
|
1237
|
-
}
|
|
1238
1164
|
/**
|
|
1239
1165
|
* TODO @LAST @IN_PROGRESS
|
|
1240
1166
|
* - utils for messages
|
|
@@ -1244,41 +1170,6 @@ declare namespace UtilsStringRegex {
|
|
|
1244
1170
|
declare namespace UtilsMessages {
|
|
1245
1171
|
const compilationWrapper: (fn: () => any, taskName?: string, executionType?: "Compilation of" | "Code execution of" | "Event:") => Promise<void>;
|
|
1246
1172
|
}
|
|
1247
|
-
declare namespace UtilsSudo {
|
|
1248
|
-
/**
|
|
1249
|
-
* All possible sudo states on Windows 11 (24H2+)
|
|
1250
|
-
*/
|
|
1251
|
-
enum SudoStatus {
|
|
1252
|
-
NotInstalled = "NotInstalled",
|
|
1253
|
-
Disabled = "Disabled",
|
|
1254
|
-
Enabled_ForceNewWindow = "Enabled_ForceNewWindow",// Enabled = 2
|
|
1255
|
-
Enabled_Inline = "Enabled_Inline",// Enabled = 3 ← current default
|
|
1256
|
-
Unknown = "Unknown"
|
|
1257
|
-
}
|
|
1258
|
-
/**
|
|
1259
|
-
* @returns true if current process is elevated (admin or sudo root), false otherwise
|
|
1260
|
-
*/
|
|
1261
|
-
export const isCurrentProcessElevated: () => Promise<boolean>;
|
|
1262
|
-
/**
|
|
1263
|
-
* Main function – returns detailed sudo status
|
|
1264
|
-
*/
|
|
1265
|
-
export function getStatus(): Promise<{
|
|
1266
|
-
status: SudoStatus;
|
|
1267
|
-
label: string;
|
|
1268
|
-
isAvailable: boolean;
|
|
1269
|
-
isInline: boolean;
|
|
1270
|
-
}>;
|
|
1271
|
-
/**
|
|
1272
|
-
* check if sudo is available and in proper mode
|
|
1273
|
-
*/
|
|
1274
|
-
export const isInProperModeForTaon: ({ displayErrorMessage, }: {
|
|
1275
|
-
displayErrorMessage?: boolean;
|
|
1276
|
-
}) => Promise<boolean>;
|
|
1277
|
-
export {};
|
|
1278
|
-
}
|
|
1279
|
-
declare namespace UtilsString {
|
|
1280
|
-
const kebabCaseNoSplitNumbers: (input: string) => string;
|
|
1281
|
-
}
|
|
1282
1173
|
/**
|
|
1283
1174
|
* Taon migration utilities
|
|
1284
1175
|
*/
|
|
@@ -1288,28 +1179,6 @@ declare namespace UtilsMigrations {
|
|
|
1288
1179
|
const formatTimestamp: (timestamp: number) => string;
|
|
1289
1180
|
const isValidTimestamp: (value: any) => boolean;
|
|
1290
1181
|
}
|
|
1291
|
-
declare namespace UtilsJson {
|
|
1292
|
-
interface AttrJsoncProp {
|
|
1293
|
-
name: string;
|
|
1294
|
-
value?: any;
|
|
1295
|
-
}
|
|
1296
|
-
/**
|
|
1297
|
-
* ! TODO handle packages like zone.js with dot
|
|
1298
|
-
* Get attributes from jsonc or json5 file
|
|
1299
|
-
* @param jsonDeepPath lodash path to property in json ex. deep.path.to.prop
|
|
1300
|
-
* @param fileContent jsonc or json5 - json with comments
|
|
1301
|
-
* @returns array of attributes
|
|
1302
|
-
*/
|
|
1303
|
-
const getAtrributiesFromJsonWithComments: (jsonDeepPath: string, // lodash path to property in json ex. deep.path.to.prop
|
|
1304
|
-
fileContent: string) => AttrJsoncProp[];
|
|
1305
|
-
const getAttributiesFromComment: (comment: string, attributes?: AttrJsoncProp[]) => AttrJsoncProp[];
|
|
1306
|
-
/**
|
|
1307
|
-
* read json from absolute path
|
|
1308
|
-
* @returns json object
|
|
1309
|
-
*/
|
|
1310
|
-
const readJson: (absoluteFilePath: string | string[], defaultValue?: {}, useJson5?: boolean) => any;
|
|
1311
|
-
const readJsonWithComments: (absoluteFilePath: string | string[], defaultValue?: any) => any;
|
|
1312
|
-
}
|
|
1313
1182
|
declare namespace UtilsYaml {
|
|
1314
1183
|
const yamlToJson: <FORMAT = any>(yamlString: string) => any;
|
|
1315
1184
|
const jsonToYaml: (json: any) => string;
|
|
@@ -1354,64 +1223,6 @@ declare namespace FilePathMetaData {
|
|
|
1354
1223
|
}) => T;
|
|
1355
1224
|
const getOnlyMetadataString: (filename: string) => string;
|
|
1356
1225
|
}
|
|
1357
|
-
declare namespace UtilsDotFile {
|
|
1358
|
-
const setValueToDotFile: (dotFileAbsPath: string | string[], key: string, value: string | number | boolean) => void;
|
|
1359
|
-
const setCommentToKeyInDotFile: (dotFileAbsPath: string | string[], key: string, comment: string) => void;
|
|
1360
|
-
const getValueFromDotFile: (dotFileAbsPath: string | string[], key: string) => string | number | boolean;
|
|
1361
|
-
const addCommentAtTheBeginningOfDotFile: (dotFileAbsPath: string | string[], comment: string) => void;
|
|
1362
|
-
const setValuesKeysFromObject: (dotFileAbsPath: string | string[], obj: Record<string, string | number | boolean>, options?: {
|
|
1363
|
-
/**
|
|
1364
|
-
* if true, it will overwrite existing keys
|
|
1365
|
-
*/
|
|
1366
|
-
setAsNewFile?: boolean;
|
|
1367
|
-
}) => void;
|
|
1368
|
-
const getValuesKeysAsJsonObject: <T = Record<string, string | number | boolean>>(dotFileAbsPath: string | string[]) => T;
|
|
1369
|
-
/**
|
|
1370
|
-
* @returns key|comment pairs as json object
|
|
1371
|
-
*/
|
|
1372
|
-
const getCommentsKeysAsJsonObject: <T = Record<string, string | undefined>>(dotFileAbsPath: string | string[]) => T;
|
|
1373
|
-
}
|
|
1374
|
-
declare namespace UtilsCli {
|
|
1375
|
-
/**
|
|
1376
|
-
* Taon CLI specyfic mehtod for mesuring script execution time:
|
|
1377
|
-
* from beginning of script to this moment.
|
|
1378
|
-
*/
|
|
1379
|
-
const getTimeFromThisCLIScriptStart: () => {
|
|
1380
|
-
ms: string;
|
|
1381
|
-
sec: string;
|
|
1382
|
-
min: string;
|
|
1383
|
-
};
|
|
1384
|
-
}
|
|
1385
|
-
/**
|
|
1386
|
-
* Easy way to connect CLI commands to cli class methods.
|
|
1387
|
-
*
|
|
1388
|
-
* Example:
|
|
1389
|
-
* in clic class
|
|
1390
|
-
*
|
|
1391
|
-
* $FirstCli {
|
|
1392
|
-
* static [UtilsCliClassMethod.staticClassNameProperty] = '$FirstCli';
|
|
1393
|
-
*
|
|
1394
|
-
* @UtilsCliClassMethod.decoratorMethod('doSomething')
|
|
1395
|
-
* doSomething() {
|
|
1396
|
-
* console.log('doing something');
|
|
1397
|
-
* }
|
|
1398
|
-
* }
|
|
1399
|
-
*
|
|
1400
|
-
* UtilsCliClassMethod.getFrom($FirstCli.prototype.doSomething) // "firstcli:dosomething"
|
|
1401
|
-
*
|
|
1402
|
-
*/
|
|
1403
|
-
declare namespace UtilsCliClassMethod {
|
|
1404
|
-
const decoratorMethod: (methodName: string) => MethodDecorator;
|
|
1405
|
-
const getFrom: <ARGS_TO_PARSE extends object = any>(ClassPrototypeMethodFnHere: Function, options?: {
|
|
1406
|
-
globalMethod?: boolean;
|
|
1407
|
-
/**
|
|
1408
|
-
* arguments to parse into CLI format
|
|
1409
|
-
* Example: { projectName: "myproj", envName: "prod" } => "--projectName=myproj --envName=prod"
|
|
1410
|
-
* TODO @LAST add support for DEEP args parsing with lodash-walk-object
|
|
1411
|
-
*/
|
|
1412
|
-
argsToParse?: ARGS_TO_PARSE;
|
|
1413
|
-
}) => string;
|
|
1414
|
-
}
|
|
1415
1226
|
|
|
1416
1227
|
declare namespace UtilsEtcHosts {
|
|
1417
1228
|
const SIMULATE_DOMAIN_TAG = "@simulatedDomainByTaon";
|
|
@@ -1757,6 +1568,7 @@ declare namespace UtilsOs {
|
|
|
1757
1568
|
const isRunningInWsl: () => boolean;
|
|
1758
1569
|
const isRunningInWindowsPowerShell: () => boolean;
|
|
1759
1570
|
const isRunningInWindowsCmd: () => boolean;
|
|
1571
|
+
const isRunningInWindowsGitBash: () => boolean;
|
|
1760
1572
|
const isRunningInDocker: () => boolean;
|
|
1761
1573
|
const isRunningInLinuxGraphicsCapableEnvironment: () => boolean;
|
|
1762
1574
|
const isRunningInOsWithGraphicsCapableEnvironment: () => boolean;
|
|
@@ -1831,6 +1643,7 @@ declare namespace UtilsOs {
|
|
|
1831
1643
|
doneCallback?: () => any;
|
|
1832
1644
|
}) => Promise<void>;
|
|
1833
1645
|
function safeExitProgramCleanUp(cleanFn: () => Promise<void> | void): any;
|
|
1646
|
+
const whichOrWherePackageLocated: (packageName: string) => string | undefined;
|
|
1834
1647
|
}
|
|
1835
1648
|
declare const taonRepoPathUserInUserDirFn: () => string;
|
|
1836
1649
|
declare const taonBasePathToGlobalDockerTemplatesFn: () => string;
|
|
@@ -2572,6 +2385,244 @@ interface ProcessStartOptions {
|
|
|
2572
2385
|
*/
|
|
2573
2386
|
declare const startAsync: (command: string, cwd: string, options?: Partial<ProcessStartOptions>) => Promise<void>;
|
|
2574
2387
|
|
|
2388
|
+
declare namespace UtilsTime {
|
|
2389
|
+
const formatDuration: (milliseconds: number) => string;
|
|
2390
|
+
const wait: (second: number) => Promise<void>;
|
|
2391
|
+
const waitMilliseconds: (milliseconds: number) => Promise<void>;
|
|
2392
|
+
interface MeasureOptions {
|
|
2393
|
+
hideLogs?: boolean;
|
|
2394
|
+
}
|
|
2395
|
+
interface ExecutionTimeResult {
|
|
2396
|
+
readonly milliseconds: number;
|
|
2397
|
+
readonly seconds: number;
|
|
2398
|
+
readonly minutes: number;
|
|
2399
|
+
readonly human: string;
|
|
2400
|
+
}
|
|
2401
|
+
const mesureExecutionTime: <T>(description: string, functionToExecute: () => Promise<T>, options?: MeasureOptions) => Promise<ExecutionTimeResult>;
|
|
2402
|
+
const mesureExecutionTimeSync: <T>(description: string, functionToExecute: () => T, options?: MeasureOptions) => ExecutionTimeResult;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
declare namespace UtilsSudo {
|
|
2406
|
+
/**
|
|
2407
|
+
* All possible sudo states on Windows 11 (24H2+)
|
|
2408
|
+
*/
|
|
2409
|
+
enum SudoStatus {
|
|
2410
|
+
NotInstalled = "NotInstalled",
|
|
2411
|
+
Disabled = "Disabled",
|
|
2412
|
+
Enabled_ForceNewWindow = "Enabled_ForceNewWindow",// Enabled = 2
|
|
2413
|
+
Enabled_Inline = "Enabled_Inline",// Enabled = 3 ← current default
|
|
2414
|
+
Unknown = "Unknown"
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* @returns true if current process is elevated (admin or sudo root), false otherwise
|
|
2418
|
+
*/
|
|
2419
|
+
export const isCurrentProcessElevated: () => Promise<boolean>;
|
|
2420
|
+
/**
|
|
2421
|
+
* Main function – returns detailed sudo status
|
|
2422
|
+
*/
|
|
2423
|
+
export function getStatus(): Promise<{
|
|
2424
|
+
status: SudoStatus;
|
|
2425
|
+
label: string;
|
|
2426
|
+
isAvailable: boolean;
|
|
2427
|
+
isInline: boolean;
|
|
2428
|
+
}>;
|
|
2429
|
+
/**
|
|
2430
|
+
* check if sudo is available and in proper mode
|
|
2431
|
+
*/
|
|
2432
|
+
export const isInProperModeForTaon: ({ displayErrorMessage, }: {
|
|
2433
|
+
displayErrorMessage?: boolean;
|
|
2434
|
+
}) => Promise<boolean>;
|
|
2435
|
+
export {};
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
declare namespace UtilsCli {
|
|
2439
|
+
/**
|
|
2440
|
+
* Taon CLI specyfic mehtod for mesuring script execution time:
|
|
2441
|
+
* from beginning of script to this moment.
|
|
2442
|
+
*/
|
|
2443
|
+
const getTimeFromThisCLIScriptStart: () => {
|
|
2444
|
+
ms: string;
|
|
2445
|
+
sec: string;
|
|
2446
|
+
min: string;
|
|
2447
|
+
};
|
|
2448
|
+
}
|
|
2449
|
+
/**
|
|
2450
|
+
* Easy way to connect CLI commands to cli class methods.
|
|
2451
|
+
*
|
|
2452
|
+
* Example:
|
|
2453
|
+
* in clic class
|
|
2454
|
+
*
|
|
2455
|
+
* $FirstCli {
|
|
2456
|
+
* static [UtilsCliClassMethod.staticClassNameProperty] = '$FirstCli';
|
|
2457
|
+
*
|
|
2458
|
+
* @UtilsCliClassMethod.decoratorMethod('doSomething')
|
|
2459
|
+
* doSomething() {
|
|
2460
|
+
* console.log('doing something');
|
|
2461
|
+
* }
|
|
2462
|
+
* }
|
|
2463
|
+
*
|
|
2464
|
+
* UtilsCliClassMethod.getFrom($FirstCli.prototype.doSomething) // "firstcli:dosomething"
|
|
2465
|
+
*
|
|
2466
|
+
*/
|
|
2467
|
+
declare namespace UtilsCliClassMethod {
|
|
2468
|
+
const decoratorMethod: (methodName: string) => MethodDecorator;
|
|
2469
|
+
const getFrom: <ARGS_TO_PARSE extends object = any>(ClassPrototypeMethodFnHere: Function, options?: {
|
|
2470
|
+
globalMethod?: boolean;
|
|
2471
|
+
/**
|
|
2472
|
+
* arguments to parse into CLI format
|
|
2473
|
+
* Example: { projectName: "myproj", envName: "prod" } => "--projectName=myproj --envName=prod"
|
|
2474
|
+
* TODO @LAST add support for DEEP args parsing with lodash-walk-object
|
|
2475
|
+
*/
|
|
2476
|
+
argsToParse?: ARGS_TO_PARSE;
|
|
2477
|
+
}) => string;
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
declare namespace UtilsJson {
|
|
2481
|
+
interface AttrJsoncProp {
|
|
2482
|
+
name: string;
|
|
2483
|
+
value?: any;
|
|
2484
|
+
}
|
|
2485
|
+
/**
|
|
2486
|
+
* ! TODO handle packages like zone.js with dot
|
|
2487
|
+
* Get attributes from jsonc or json5 file
|
|
2488
|
+
* @param jsonDeepPath lodash path to property in json ex. deep.path.to.prop
|
|
2489
|
+
* @param fileContent jsonc or json5 - json with comments
|
|
2490
|
+
* @returns array of attributes
|
|
2491
|
+
*/
|
|
2492
|
+
const getAtrributiesFromJsonWithComments: (jsonDeepPath: string, // lodash path to property in json ex. deep.path.to.prop
|
|
2493
|
+
fileContent: string) => AttrJsoncProp[];
|
|
2494
|
+
const getAttributiesFromComment: (comment: string, attributes?: AttrJsoncProp[]) => AttrJsoncProp[];
|
|
2495
|
+
/**
|
|
2496
|
+
* read json from absolute path
|
|
2497
|
+
* @returns json object
|
|
2498
|
+
*/
|
|
2499
|
+
const readJson: (absoluteFilePath: string | string[], defaultValue?: {}, useJson5?: boolean) => any;
|
|
2500
|
+
const readJsonWithComments: (absoluteFilePath: string | string[], defaultValue?: any) => any;
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
declare namespace UtilsDotFile {
|
|
2504
|
+
const setValueToDotFile: (dotFileAbsPath: string | string[], key: string, value: string | number | boolean) => void;
|
|
2505
|
+
const setCommentToKeyInDotFile: (dotFileAbsPath: string | string[], key: string, comment: string) => void;
|
|
2506
|
+
const getValueFromDotFile: (dotFileAbsPath: string | string[], key: string) => string | number | boolean;
|
|
2507
|
+
const addCommentAtTheBeginningOfDotFile: (dotFileAbsPath: string | string[], comment: string) => void;
|
|
2508
|
+
const setValuesKeysFromObject: (dotFileAbsPath: string | string[], obj: Record<string, string | number | boolean>, options?: {
|
|
2509
|
+
/**
|
|
2510
|
+
* if true, it will overwrite existing keys
|
|
2511
|
+
*/
|
|
2512
|
+
setAsNewFile?: boolean;
|
|
2513
|
+
}) => void;
|
|
2514
|
+
const getValuesKeysAsJsonObject: <T = Record<string, string | number | boolean>>(dotFileAbsPath: string | string[]) => T;
|
|
2515
|
+
/**
|
|
2516
|
+
* @returns key|comment pairs as json object
|
|
2517
|
+
*/
|
|
2518
|
+
const getCommentsKeysAsJsonObject: <T = Record<string, string | undefined>>(dotFileAbsPath: string | string[]) => T;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
declare enum DbBinaryFormatEnum {
|
|
2522
|
+
Blob = "Blob",
|
|
2523
|
+
File = "File",
|
|
2524
|
+
string = "string"
|
|
2525
|
+
}
|
|
2526
|
+
type DbBinaryFormatForBrowser = Blob | File | string;
|
|
2527
|
+
/**
|
|
2528
|
+
* Binary format that can be stored in database
|
|
2529
|
+
*
|
|
2530
|
+
* for nodejs => Buffer
|
|
2531
|
+
* for sql.js => string (shoulb be blob - but not supported)
|
|
2532
|
+
*
|
|
2533
|
+
*/
|
|
2534
|
+
type DbBinaryFormat = DbBinaryFormatForBrowser;
|
|
2535
|
+
declare namespace UtilsBinary {
|
|
2536
|
+
/**
|
|
2537
|
+
* This is for BROWSER ONLY
|
|
2538
|
+
*
|
|
2539
|
+
* @param buffer
|
|
2540
|
+
* @param contentType
|
|
2541
|
+
* @returns
|
|
2542
|
+
*/
|
|
2543
|
+
function arrayBufferToBlob(buffer: ArrayBuffer, contentType: CoreModels.ContentType): Promise<Blob>;
|
|
2544
|
+
/**
|
|
2545
|
+
* This is for BROWSER ONLY
|
|
2546
|
+
* @param blob
|
|
2547
|
+
* @returns
|
|
2548
|
+
*/
|
|
2549
|
+
function blobToArrayBuffer(blob: Blob): Promise<ArrayBuffer>;
|
|
2550
|
+
/**
|
|
2551
|
+
* it is revers to base64toBlob
|
|
2552
|
+
* @param blob
|
|
2553
|
+
* @returns
|
|
2554
|
+
*/
|
|
2555
|
+
function blobToBase64(blob: Blob): Promise<string>;
|
|
2556
|
+
/**
|
|
2557
|
+
* it is revers to blobToBase64()
|
|
2558
|
+
* @param base64Data
|
|
2559
|
+
* @returns
|
|
2560
|
+
*/
|
|
2561
|
+
function base64toBlob(base64Data: string, contentTypeOverride?: CoreModels.ContentType): Promise<Blob>;
|
|
2562
|
+
function base64toDbBinaryFormat(text: string): Promise<DbBinaryFormat>;
|
|
2563
|
+
function dbBinaryFormatToBase64(binaryFormat: DbBinaryFormat): Promise<string>;
|
|
2564
|
+
function textToDbBinaryFormat(text: string): Promise<DbBinaryFormat>;
|
|
2565
|
+
function dbBinaryFormatToText(binaryFormat: DbBinaryFormat): Promise<string>;
|
|
2566
|
+
function fileToBlob(file: File): Promise<Blob>;
|
|
2567
|
+
function blobToFile(blob: Blob, nameForFile?: string): Promise<File>;
|
|
2568
|
+
function textToBlob(text: string, type?: CoreModels.ContentType): Promise<Blob>;
|
|
2569
|
+
function blobToText(blob: Blob): Promise<string>;
|
|
2570
|
+
function textToFile(text: string, fileRelativePathOrName: string): Promise<File>;
|
|
2571
|
+
function fileToText(file: File): Promise<string>;
|
|
2572
|
+
function jsonToBlob(jsonObj: object): Promise<Blob>;
|
|
2573
|
+
/**
|
|
2574
|
+
* TODO NOT TESTED
|
|
2575
|
+
*/
|
|
2576
|
+
function blobToJson(blob: Blob): Promise<string>;
|
|
2577
|
+
function getBlobFrom(url: string): Promise<Blob>;
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
declare namespace UtilsString {
|
|
2581
|
+
const kebabCaseNoSplitNumbers: (input: string) => string;
|
|
2582
|
+
}
|
|
2583
|
+
declare namespace UtilsStringRegex {
|
|
2584
|
+
const containsNonAscii: (pathStringOrPathParts: string) => boolean;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
declare namespace UtilsI18n {
|
|
2588
|
+
const defaultLangLocale: UtilsI18n.CommonLocaleCode;
|
|
2589
|
+
enum CommonLocaleCodeEnum {
|
|
2590
|
+
PL_PL = "pl-PL",
|
|
2591
|
+
EN_US = "en-US",
|
|
2592
|
+
EN_GB = "en-GB",
|
|
2593
|
+
DE_DE = "de-DE",
|
|
2594
|
+
FR_FR = "fr-FR",
|
|
2595
|
+
ES_ES = "es-ES",
|
|
2596
|
+
ZH_CN = "zh-CN"
|
|
2597
|
+
}
|
|
2598
|
+
const commonLocales: CommonLocaleCode[];
|
|
2599
|
+
type CommonLocaleCode = `${CommonLocaleCodeEnum}`;
|
|
2600
|
+
interface LangOption {
|
|
2601
|
+
code: UtilsI18n.CommonLocaleCode;
|
|
2602
|
+
label: string;
|
|
2603
|
+
}
|
|
2604
|
+
const LangOptionArr: LangOption[];
|
|
2605
|
+
function detectLocale(): CommonLocaleCode;
|
|
2606
|
+
interface GettextExtracted {
|
|
2607
|
+
lineNumber: number;
|
|
2608
|
+
gettextString: string;
|
|
2609
|
+
context?: string;
|
|
2610
|
+
/**
|
|
2611
|
+
* translation for specyfic language
|
|
2612
|
+
*/
|
|
2613
|
+
translation?: string;
|
|
2614
|
+
}
|
|
2615
|
+
interface GettextFile {
|
|
2616
|
+
fileAbsPath: string;
|
|
2617
|
+
fileRelativePath?: string;
|
|
2618
|
+
/**
|
|
2619
|
+
* taon thing - file can be for app or lib
|
|
2620
|
+
*/
|
|
2621
|
+
isAppFile?: boolean;
|
|
2622
|
+
tags: UtilsI18n.GettextExtracted[];
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2575
2626
|
declare class CLI {
|
|
2576
2627
|
static chalk: chalk$1.Chalk;
|
|
2577
2628
|
static installEnvironment(globalDependencies?: any): void;
|
|
@@ -3115,5 +3166,5 @@ declare const config: {
|
|
|
3115
3166
|
helpAlias: string[];
|
|
3116
3167
|
};
|
|
3117
3168
|
|
|
3118
|
-
export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, PROGRESS_DATA, REGEX_REGION, TAGS, Utils, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsJson, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsProcess, UtilsProcessLogger, UtilsProjects, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, fkill, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, load, mkdirp, ncp, net, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, tempFoldersName, tnpPackageName, urlRepoTaon, urlRepoTaonContainers, win32Path };
|
|
3119
|
-
export type { CommandOutputOptions, IPROGRESS_DATA, LibTypeNames, ProcessStartOptions, RunSyncOrAsyncOptions, TaskStats };
|
|
3169
|
+
export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, DbBinaryFormatEnum, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, PROGRESS_DATA, REGEX_REGION, TAGS, Utils, UtilsBinary, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsI18n, UtilsJson, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsProcess, UtilsProcessLogger, UtilsProjects, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, fkill, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, load, mkdirp, ncp, net, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, tempFoldersName, tnpPackageName, urlRepoTaon, urlRepoTaonContainers, win32Path };
|
|
3170
|
+
export type { CommandOutputOptions, DbBinaryFormat, DbBinaryFormatForBrowser, IPROGRESS_DATA, LibTypeNames, ProcessStartOptions, RunSyncOrAsyncOptions, TaskStats };
|