tnp-core 21.0.162 → 21.0.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/VERIFIED-BUILD-DATA.jsonc +3 -3
  2. package/browser/fesm2022/tnp-core-browser.mjs +113 -28
  3. package/browser/fesm2022/tnp-core-browser.mjs.map +1 -1
  4. package/browser/package.json +1 -1
  5. package/browser/types/tnp-core-browser.d.ts +20 -4
  6. package/browser-prod/fesm2022/tnp-core-browser-prod.mjs +123 -40
  7. package/browser-prod/fesm2022/tnp-core-browser-prod.mjs.map +1 -1
  8. package/browser-prod/package.json +1 -1
  9. package/browser-prod/types/tnp-core-browser-prod.d.ts +19 -5
  10. package/browser-prod.split-namespaces.json +10 -2
  11. package/lib/build-info._auto-generated_.d.ts +1 -1
  12. package/lib/build-info._auto-generated_.js +1 -1
  13. package/lib/core-imports.d.ts +2 -1
  14. package/lib/core-imports.js +3 -1
  15. package/lib/core-imports.js.map +1 -1
  16. package/lib/core-models.d.ts +1 -0
  17. package/lib/core-models.js.map +1 -1
  18. package/lib/env/env.angular-node-app.js.map +1 -1
  19. package/lib/env/env.docs-webapp.js.map +1 -1
  20. package/lib/env/env.electron-app.js.map +1 -1
  21. package/lib/env/env.mobile-app.js.map +1 -1
  22. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  23. package/lib/env/env.vscode-plugin.js.map +1 -1
  24. package/lib/index.d.ts +1 -0
  25. package/lib/index.js +1 -0
  26. package/lib/index.js.map +1 -1
  27. package/lib/package.json +1 -1
  28. package/lib/utils-http.d.ts +0 -1
  29. package/lib/utils-http.js +0 -24
  30. package/lib/utils-http.js.map +1 -1
  31. package/lib/utils-passwords.d.ts +8 -0
  32. package/lib/utils-passwords.js +80 -0
  33. package/lib/utils-passwords.js.map +1 -0
  34. package/lib/utils-secret-env.js +1 -1
  35. package/lib/utils-secret-env.js.map +1 -1
  36. package/lib/utils-terminal.d.ts +6 -0
  37. package/lib/utils-terminal.js +24 -0
  38. package/lib/utils-terminal.js.map +1 -1
  39. package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
  40. package/lib-esm/lib/build-info._auto-generated_.js +1 -1
  41. package/lib-esm/lib/core-imports.d.ts +2 -1
  42. package/lib-esm/lib/core-imports.js +3 -1
  43. package/lib-esm/lib/core-imports.js.map +1 -1
  44. package/lib-esm/lib/core-models.d.ts +1 -0
  45. package/lib-esm/lib/core-models.js.map +1 -1
  46. package/lib-esm/lib/env/env.angular-node-app.js.map +1 -1
  47. package/lib-esm/lib/env/env.docs-webapp.js.map +1 -1
  48. package/lib-esm/lib/env/env.electron-app.js.map +1 -1
  49. package/lib-esm/lib/env/env.mobile-app.js.map +1 -1
  50. package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  51. package/lib-esm/lib/env/env.vscode-plugin.js.map +1 -1
  52. package/lib-esm/lib/index.d.ts +1 -0
  53. package/lib-esm/lib/index.js +1 -0
  54. package/lib-esm/lib/index.js.map +1 -1
  55. package/lib-esm/lib/utils-http.d.ts +0 -1
  56. package/lib-esm/lib/utils-http.js +0 -24
  57. package/lib-esm/lib/utils-http.js.map +1 -1
  58. package/lib-esm/lib/utils-passwords.d.ts +8 -0
  59. package/lib-esm/lib/utils-passwords.js +77 -0
  60. package/lib-esm/lib/utils-passwords.js.map +1 -0
  61. package/lib-esm/lib/utils-secret-env.js +1 -1
  62. package/lib-esm/lib/utils-secret-env.js.map +1 -1
  63. package/lib-esm/lib/utils-terminal.d.ts +6 -0
  64. package/lib-esm/lib/utils-terminal.js +24 -0
  65. package/lib-esm/lib/utils-terminal.js.map +1 -1
  66. package/lib-prod/build-info._auto-generated_.d.ts +1 -1
  67. package/lib-prod/build-info._auto-generated_.js +1 -1
  68. package/lib-prod/core-imports.d.ts +2 -1
  69. package/lib-prod/core-imports.js +3 -1
  70. package/lib-prod/core-imports.js.map +1 -1
  71. package/lib-prod/core-models.d.ts +1 -0
  72. package/lib-prod/core-models.js.map +1 -1
  73. package/lib-prod/env/env.angular-node-app.js.map +1 -1
  74. package/lib-prod/env/env.docs-webapp.js.map +1 -1
  75. package/lib-prod/env/env.electron-app.js.map +1 -1
  76. package/lib-prod/env/env.mobile-app.js.map +1 -1
  77. package/lib-prod/env/env.npm-lib-and-cli-tool.js.map +1 -1
  78. package/lib-prod/env/env.vscode-plugin.js.map +1 -1
  79. package/lib-prod/helpers.js.map +1 -1
  80. package/lib-prod/index.d.ts +1 -0
  81. package/lib-prod/index.js +1 -0
  82. package/lib-prod/index.js.map +1 -1
  83. package/lib-prod/package.json +1 -1
  84. package/lib-prod/start-cli.js.map +1 -1
  85. package/lib-prod/utils-binary.js.map +1 -1
  86. package/lib-prod/utils-cli.js.map +1 -1
  87. package/lib-prod/utils-files-folders.js.map +1 -1
  88. package/lib-prod/utils-http.d.ts +0 -1
  89. package/lib-prod/utils-http.js +0 -23
  90. package/lib-prod/utils-http.js.map +1 -1
  91. package/lib-prod/utils-os.js.map +1 -1
  92. package/lib-prod/utils-passwords.d.ts +6 -0
  93. package/lib-prod/utils-passwords.js +74 -0
  94. package/lib-prod/utils-passwords.js.map +1 -0
  95. package/lib-prod/utils-process-logger.js.map +1 -1
  96. package/lib-prod/utils-secret-env.js +2 -2
  97. package/lib-prod/utils-secret-env.js.map +1 -1
  98. package/lib-prod/utils-terminal.d.ts +6 -0
  99. package/lib-prod/utils-terminal.js +24 -0
  100. package/lib-prod/utils-terminal.js.map +1 -1
  101. package/lib-prod.split-namespaces.json +10 -2
  102. package/package.json +1 -1
  103. package/websql/fesm2022/tnp-core-websql.mjs +113 -28
  104. package/websql/fesm2022/tnp-core-websql.mjs.map +1 -1
  105. package/websql/package.json +1 -1
  106. package/websql/types/tnp-core-websql.d.ts +20 -4
  107. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs +123 -40
  108. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs.map +1 -1
  109. package/websql-prod/package.json +1 -1
  110. package/websql-prod/types/tnp-core-websql-prod.d.ts +19 -5
  111. package/websql-prod.split-namespaces.json +10 -2
@@ -1,5 +1,5 @@
1
1
  {
2
- "commitHash": "e119a5746b156132f891009071ac9a0d58d3828a",
3
- "commitName": "feat: utils env secret encode decode",
4
- "commitDate": "20-09-2026 16:28:52"
2
+ "commitHash": "2119b9278429e680c922cd4e367fa23e1da693b2",
3
+ "commitName": "feat: password input",
4
+ "commitDate": "27-09-2026 17:31:45"
5
5
  }
@@ -305,8 +305,8 @@ import * as _zipWith from 'lodash/zipWith';
305
305
  import axiosBasebrowser from 'axios';
306
306
  import jQuery from 'jquery';
307
307
  import { format } from 'date-fns';
308
- import * as json5 from 'json5';
309
- export { json5 };
308
+ import * as json5def from 'json5';
309
+ import json5def__default from 'json5';
310
310
  export { Injectable, inject, signal } from '@angular/core';
311
311
  import 'reflect-metadata';
312
312
  import { Subject, BehaviorSubject } from 'rxjs';
@@ -1135,6 +1135,7 @@ let dateformat = ((date, mask) => {
1135
1135
  .replace(/mm/g, 'MM') // month
1136
1136
  .replace(/MM/g, 'mm'));
1137
1137
  });
1138
+ const json5 = json5def__default ? json5def__default : json5def;
1138
1139
  //#region set up browser mocks
1139
1140
  //#region set up browser mocks / mock jquery
1140
1141
  let $;
@@ -1336,30 +1337,6 @@ var UtilsHttp;
1336
1337
  'jsonp',
1337
1338
  ];
1338
1339
  //#endregion
1339
- //#region get status text
1340
- function getStatusText(code) {
1341
- const map = {
1342
- 200: 'OK',
1343
- 201: 'Created',
1344
- 202: 'Accepted',
1345
- 204: 'No Content',
1346
- 301: 'Moved Permanently',
1347
- 302: 'Found',
1348
- 304: 'Not Modified',
1349
- 400: 'Bad Request',
1350
- 401: 'Unauthorized',
1351
- 403: 'Forbidden',
1352
- 404: 'Not Found',
1353
- 409: 'Conflict',
1354
- 422: 'Unprocessable Entity',
1355
- 500: 'Internal Server Error',
1356
- 502: 'Bad Gateway',
1357
- 503: 'Service Unavailable',
1358
- };
1359
- return map[code] || String(code);
1360
- }
1361
- UtilsHttp.getStatusText = getStatusText;
1362
- //#endregion
1363
1340
  //#region get mimie type
1364
1341
  function mimeType(type) {
1365
1342
  if (type.includes('/')) {
@@ -6517,6 +6494,37 @@ var UtilsTerminal;
6517
6494
  return (void 0);
6518
6495
  };
6519
6496
  //#endregion
6497
+ //#region utils terminal / password
6498
+ UtilsTerminal.password = async ({ question, required, validate, }) => {
6499
+ /* */
6500
+ /* */
6501
+ /* */
6502
+ /* */
6503
+ /* */
6504
+ /* */
6505
+ /* */
6506
+ /* */
6507
+ /* */
6508
+ /* */
6509
+ /* */
6510
+ /* */
6511
+ /* */
6512
+ /* */
6513
+ /* */
6514
+ /* */
6515
+ /* */
6516
+ /* */
6517
+ /* */
6518
+ /* */
6519
+ /* */
6520
+ /* */
6521
+ /* */
6522
+ /* */
6523
+ /* */
6524
+ /* */
6525
+ return (void 0);
6526
+ };
6527
+ //#endregion
6520
6528
  //#region utils terminal / can use interactive toogle
6521
6529
  async function canUseInteractiveToggle() {
6522
6530
  /* */
@@ -14013,7 +14021,7 @@ var UtilsSecretEnv;
14013
14021
  return new TextDecoder().decode(decrypted);
14014
14022
  }
14015
14023
  catch {
14016
- Helpers.error('Unable to decrypt Taon secret. Invalid password or corrupted data.', false, true);
14024
+ throw new Error('Unable to decrypt Taon secret. Invalid password or corrupted data.');
14017
14025
  }
14018
14026
  }
14019
14027
  UtilsSecretEnv.decrypt = decrypt;
@@ -14256,6 +14264,83 @@ var UtilsSecretEnv;
14256
14264
  //#endregion
14257
14265
  })(UtilsSecretEnv || (UtilsSecretEnv = {}));
14258
14266
 
14267
+ var UtilsPasswords;
14268
+ (function (UtilsPasswords) {
14269
+ const VERSION = 'v1';
14270
+ const ITERATIONS = 600_000;
14271
+ const SALT_LENGTH = 16;
14272
+ const HASH_LENGTH = 32;
14273
+ /**
14274
+ * Result:
14275
+ * v1:<iterations>:<salt-base64>:<hash-base64>
14276
+ */
14277
+ async function hash(password) {
14278
+ const encoder = new TextEncoder();
14279
+ const salt = crypto.getRandomValues(new Uint8Array(SALT_LENGTH));
14280
+ const passwordKey = await crypto.subtle.importKey('raw', encoder.encode(password), 'PBKDF2', false, ['deriveBits']);
14281
+ const hash = await crypto.subtle.deriveBits({
14282
+ name: 'PBKDF2',
14283
+ hash: 'SHA-256',
14284
+ salt,
14285
+ iterations: ITERATIONS,
14286
+ }, passwordKey, HASH_LENGTH * 8);
14287
+ return [
14288
+ VERSION,
14289
+ ITERATIONS,
14290
+ bytesToBase64(salt),
14291
+ bytesToBase64(new Uint8Array(hash)),
14292
+ ].join(':');
14293
+ }
14294
+ UtilsPasswords.hash = hash;
14295
+ async function verify(password, storedHash) {
14296
+ const [version, iterationsStr, saltBase64, hashBase64] = storedHash.split(':');
14297
+ if (version !== VERSION) {
14298
+ return false;
14299
+ }
14300
+ const iterations = Number(iterationsStr);
14301
+ if (!Number.isInteger(iterations) || iterations <= 0) {
14302
+ return false;
14303
+ }
14304
+ const salt = base64ToBytes(saltBase64);
14305
+ const expectedHash = base64ToBytes(hashBase64);
14306
+ const passwordKey = await crypto.subtle.importKey('raw', new TextEncoder().encode(password), 'PBKDF2', false, ['deriveBits']);
14307
+ const actualHash = new Uint8Array(await crypto.subtle.deriveBits({
14308
+ name: 'PBKDF2',
14309
+ hash: 'SHA-256',
14310
+ // @ts-ignore
14311
+ salt,
14312
+ iterations,
14313
+ }, passwordKey, expectedHash.length * 8));
14314
+ return timingSafeEqual(actualHash, expectedHash);
14315
+ }
14316
+ UtilsPasswords.verify = verify;
14317
+ function timingSafeEqual(a, b) {
14318
+ if (a.length !== b.length) {
14319
+ return false;
14320
+ }
14321
+ let diff = 0;
14322
+ for (let i = 0; i < a.length; i++) {
14323
+ diff |= a[i] ^ b[i];
14324
+ }
14325
+ return diff === 0;
14326
+ }
14327
+ function bytesToBase64(bytes) {
14328
+ let binary = '';
14329
+ for (const byte of bytes) {
14330
+ binary += String.fromCharCode(byte);
14331
+ }
14332
+ return btoa(binary);
14333
+ }
14334
+ function base64ToBytes(base64) {
14335
+ const binary = atob(base64);
14336
+ const result = new Uint8Array(binary.length);
14337
+ for (let i = 0; i < binary.length; i++) {
14338
+ result[i] = binary.charCodeAt(i);
14339
+ }
14340
+ return result;
14341
+ }
14342
+ })(UtilsPasswords || (UtilsPasswords = {}));
14343
+
14259
14344
  const jsoncFormattingOptions = {
14260
14345
  insertSpaces: true,
14261
14346
  tabSize: 2,
@@ -14786,5 +14871,5 @@ var index = {};
14786
14871
  * Generated bundle index. Do not edit.
14787
14872
  */
14788
14873
 
14789
- export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, DbBinaryFormatEnum, ExecAsyncVscodeError, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, REGEX_REGION, TAGS, TaonStateMachine, Utils, UtilsBinary, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEnv, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsHttp, UtilsI18n, UtilsJson, UtilsJwt, UtilsMdDocs, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsProcess, UtilsProcessLogger, UtilsProgress, UtilsProjects, UtilsSecretEnv, UtilsStdinStdoutLogger, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, axios, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, decodeEnv, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, execAsyncVscode, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, micromatch, mkdirp, ncp, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, stateServiceSuffix, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonCutNextLineCut, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, taonSkipCut, tempFoldersName, tnpPackageName, updateJsoncContent, urlRepoTaon, urlRepoTaonContainers, win32Path };
14874
+ export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, DbBinaryFormatEnum, ExecAsyncVscodeError, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, REGEX_REGION, TAGS, TaonStateMachine, Utils, UtilsBinary, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEnv, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsHttp, UtilsI18n, UtilsJson, UtilsJwt, UtilsMdDocs, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsPasswords, UtilsProcess, UtilsProcessLogger, UtilsProgress, UtilsProjects, UtilsSecretEnv, UtilsStdinStdoutLogger, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, axios, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, decodeEnv, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, execAsyncVscode, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, json5, micromatch, mkdirp, ncp, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, stateServiceSuffix, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonCutNextLineCut, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, taonSkipCut, tempFoldersName, tnpPackageName, updateJsoncContent, urlRepoTaon, urlRepoTaonContainers, win32Path };
14790
14875
  //# sourceMappingURL=tnp-core-browser.mjs.map