tnp-core 21.0.162 → 21.0.164

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 (134) hide show
  1. package/VERIFIED-BUILD-DATA.jsonc +3 -3
  2. package/browser/fesm2022/tnp-core-browser.mjs +120 -48
  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 -6
  6. package/browser-prod/fesm2022/tnp-core-browser-prod.mjs +130 -60
  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 -7
  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 +3 -4
  14. package/lib/core-imports.js +5 -17
  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 -1
  25. package/lib/index.js +1 -1
  26. package/lib/index.js.map +1 -1
  27. package/lib/package.json +1 -1
  28. package/lib/utils-binary.js +7 -7
  29. package/lib/utils-binary.js.map +1 -1
  30. package/lib/utils-http.d.ts +0 -1
  31. package/lib/utils-http.js +0 -24
  32. package/lib/utils-http.js.map +1 -1
  33. package/lib/utils-passwords.d.ts +8 -0
  34. package/lib/utils-passwords.js +80 -0
  35. package/lib/utils-passwords.js.map +1 -0
  36. package/lib/utils-secret-env.js +1 -1
  37. package/lib/utils-secret-env.js.map +1 -1
  38. package/lib/utils-terminal.d.ts +6 -0
  39. package/lib/utils-terminal.js +24 -0
  40. package/lib/utils-terminal.js.map +1 -1
  41. package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
  42. package/lib-esm/lib/build-info._auto-generated_.js +1 -1
  43. package/lib-esm/lib/core-imports.d.ts +3 -4
  44. package/lib-esm/lib/core-imports.js +4 -16
  45. package/lib-esm/lib/core-imports.js.map +1 -1
  46. package/lib-esm/lib/core-models.d.ts +1 -0
  47. package/lib-esm/lib/core-models.js.map +1 -1
  48. package/lib-esm/lib/env/env.angular-node-app.js.map +1 -1
  49. package/lib-esm/lib/env/env.docs-webapp.js.map +1 -1
  50. package/lib-esm/lib/env/env.electron-app.js.map +1 -1
  51. package/lib-esm/lib/env/env.mobile-app.js.map +1 -1
  52. package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  53. package/lib-esm/lib/env/env.vscode-plugin.js.map +1 -1
  54. package/lib-esm/lib/index.d.ts +1 -1
  55. package/lib-esm/lib/index.js +1 -1
  56. package/lib-esm/lib/index.js.map +1 -1
  57. package/lib-esm/lib/utils-binary.js +6 -6
  58. package/lib-esm/lib/utils-binary.js.map +1 -1
  59. package/lib-esm/lib/utils-http.d.ts +0 -1
  60. package/lib-esm/lib/utils-http.js +0 -24
  61. package/lib-esm/lib/utils-http.js.map +1 -1
  62. package/lib-esm/lib/utils-passwords.d.ts +8 -0
  63. package/lib-esm/lib/utils-passwords.js +77 -0
  64. package/lib-esm/lib/utils-passwords.js.map +1 -0
  65. package/lib-esm/lib/utils-secret-env.js +1 -1
  66. package/lib-esm/lib/utils-secret-env.js.map +1 -1
  67. package/lib-esm/lib/utils-terminal.d.ts +6 -0
  68. package/lib-esm/lib/utils-terminal.js +24 -0
  69. package/lib-esm/lib/utils-terminal.js.map +1 -1
  70. package/lib-prod/build-info._auto-generated_.d.ts +1 -1
  71. package/lib-prod/build-info._auto-generated_.js +1 -1
  72. package/lib-prod/core-imports.d.ts +3 -4
  73. package/lib-prod/core-imports.js +5 -16
  74. package/lib-prod/core-imports.js.map +1 -1
  75. package/lib-prod/core-models.d.ts +1 -0
  76. package/lib-prod/core-models.js.map +1 -1
  77. package/lib-prod/env/env.angular-node-app.js.map +1 -1
  78. package/lib-prod/env/env.docs-webapp.js.map +1 -1
  79. package/lib-prod/env/env.electron-app.js.map +1 -1
  80. package/lib-prod/env/env.mobile-app.js.map +1 -1
  81. package/lib-prod/env/env.npm-lib-and-cli-tool.js.map +1 -1
  82. package/lib-prod/env/env.vscode-plugin.js.map +1 -1
  83. package/lib-prod/helpers.js.map +1 -1
  84. package/lib-prod/index.d.ts +1 -1
  85. package/lib-prod/index.js +1 -1
  86. package/lib-prod/index.js.map +1 -1
  87. package/lib-prod/package.json +1 -1
  88. package/lib-prod/start-cli.js.map +1 -1
  89. package/lib-prod/utils-binary.js +6 -6
  90. package/lib-prod/utils-binary.js.map +1 -1
  91. package/lib-prod/utils-cli.js.map +1 -1
  92. package/lib-prod/utils-files-folders.js.map +1 -1
  93. package/lib-prod/utils-http.d.ts +0 -1
  94. package/lib-prod/utils-http.js +0 -23
  95. package/lib-prod/utils-http.js.map +1 -1
  96. package/lib-prod/utils-os.js.map +1 -1
  97. package/lib-prod/utils-passwords.d.ts +6 -0
  98. package/lib-prod/utils-passwords.js +74 -0
  99. package/lib-prod/utils-passwords.js.map +1 -0
  100. package/lib-prod/utils-process-logger.js.map +1 -1
  101. package/lib-prod/utils-secret-env.js +2 -2
  102. package/lib-prod/utils-secret-env.js.map +1 -1
  103. package/lib-prod/utils-terminal.d.ts +6 -0
  104. package/lib-prod/utils-terminal.js +24 -0
  105. package/lib-prod/utils-terminal.js.map +1 -1
  106. package/lib-prod.split-namespaces.json +10 -2
  107. package/package.json +1 -1
  108. package/websql/fesm2022/tnp-core-websql.mjs +120 -48
  109. package/websql/fesm2022/tnp-core-websql.mjs.map +1 -1
  110. package/websql/package.json +1 -1
  111. package/websql/types/tnp-core-websql.d.ts +20 -6
  112. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs +130 -60
  113. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs.map +1 -1
  114. package/websql-prod/package.json +1 -1
  115. package/websql-prod/types/tnp-core-websql-prod.d.ts +19 -7
  116. package/websql-prod.split-namespaces.json +10 -2
  117. package/lib/axios-fetch.d.ts +0 -34
  118. package/lib/axios-fetch.js +0 -113
  119. package/lib/axios-fetch.js.map +0 -1
  120. package/lib/axios-simple-cookie-jar.d.ts +0 -6
  121. package/lib/axios-simple-cookie-jar.js +0 -34
  122. package/lib/axios-simple-cookie-jar.js.map +0 -1
  123. package/lib-esm/lib/axios-fetch.d.ts +0 -34
  124. package/lib-esm/lib/axios-fetch.js +0 -108
  125. package/lib-esm/lib/axios-fetch.js.map +0 -1
  126. package/lib-esm/lib/axios-simple-cookie-jar.d.ts +0 -6
  127. package/lib-esm/lib/axios-simple-cookie-jar.js +0 -30
  128. package/lib-esm/lib/axios-simple-cookie-jar.js.map +0 -1
  129. package/lib-prod/axios-fetch.d.ts +0 -34
  130. package/lib-prod/axios-fetch.js +0 -108
  131. package/lib-prod/axios-fetch.js.map +0 -1
  132. package/lib-prod/axios-simple-cookie-jar.d.ts +0 -6
  133. package/lib-prod/axios-simple-cookie-jar.js +0 -30
  134. package/lib-prod/axios-simple-cookie-jar.js.map +0 -1
@@ -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": "72e4e6afe53ef781dbe878a34b3b52a5a2a50fef",
3
+ "commitName": "chore: axios replaced with fetch",
4
+ "commitDate": "30-09-2026 20:02:51"
5
5
  }
@@ -302,11 +302,10 @@ import * as _zip from 'lodash/zip';
302
302
  import * as _zipObject from 'lodash/zipObject';
303
303
  import * as _zipObjectDeep from 'lodash/zipObjectDeep';
304
304
  import * as _zipWith from 'lodash/zipWith';
305
- import axiosBasebrowser from 'axios';
306
305
  import jQuery from 'jquery';
307
306
  import { format } from 'date-fns';
308
- import * as json5 from 'json5';
309
- export { json5 };
307
+ import * as json5def from 'json5';
308
+ import json5def__default from 'json5';
310
309
  export { Injectable, inject, signal } from '@angular/core';
311
310
  import 'reflect-metadata';
312
311
  import { Subject, BehaviorSubject } from 'rxjs';
@@ -1135,6 +1134,8 @@ let dateformat = ((date, mask) => {
1135
1134
  .replace(/mm/g, 'MM') // month
1136
1135
  .replace(/MM/g, 'mm'));
1137
1136
  });
1137
+ const json5 = json5def__default ? json5def__default : json5def;
1138
+ // import { Helpers } from './helpers';
1138
1139
  //#region set up browser mocks
1139
1140
  //#region set up browser mocks / mock jquery
1140
1141
  let $;
@@ -1161,20 +1162,6 @@ let path = void 0;
1161
1162
  path = path$1;
1162
1163
  //#endregion
1163
1164
  //#endregion
1164
- //#region set up browser mocks / mock axios
1165
- let axios = void 0;
1166
- /* */
1167
- /* */
1168
- /* */
1169
- /* */
1170
- /* */
1171
- /* */
1172
- /* */
1173
- /* */
1174
- //#region @browser
1175
- axios = axiosBasebrowser;
1176
- //#endregion
1177
- //#endregion
1178
1165
  //#region set up browser mocks / mock chalk
1179
1166
  let chalk = void 0;
1180
1167
  /* */
@@ -1336,30 +1323,6 @@ var UtilsHttp;
1336
1323
  'jsonp',
1337
1324
  ];
1338
1325
  //#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
1326
  //#region get mimie type
1364
1327
  function mimeType(type) {
1365
1328
  if (type.includes('/')) {
@@ -6517,6 +6480,37 @@ var UtilsTerminal;
6517
6480
  return (void 0);
6518
6481
  };
6519
6482
  //#endregion
6483
+ //#region utils terminal / password
6484
+ UtilsTerminal.password = async ({ question, required, validate, }) => {
6485
+ /* */
6486
+ /* */
6487
+ /* */
6488
+ /* */
6489
+ /* */
6490
+ /* */
6491
+ /* */
6492
+ /* */
6493
+ /* */
6494
+ /* */
6495
+ /* */
6496
+ /* */
6497
+ /* */
6498
+ /* */
6499
+ /* */
6500
+ /* */
6501
+ /* */
6502
+ /* */
6503
+ /* */
6504
+ /* */
6505
+ /* */
6506
+ /* */
6507
+ /* */
6508
+ /* */
6509
+ /* */
6510
+ /* */
6511
+ return (void 0);
6512
+ };
6513
+ //#endregion
6520
6514
  //#region utils terminal / can use interactive toogle
6521
6515
  async function canUseInteractiveToggle() {
6522
6516
  /* */
@@ -13037,11 +13031,12 @@ var UtilsBinary;
13037
13031
  //#endregion
13038
13032
  //#region binay utils / get blob from url
13039
13033
  async function getBlobFrom(url) {
13040
- return (await axios.request({
13041
- url,
13042
- method: 'get',
13043
- responseType: 'blob',
13044
- })).data;
13034
+ const response = await fetch(url);
13035
+ if (!response.ok) {
13036
+ throw new Error(`Failed to get blob from "${url}". ` +
13037
+ `HTTP ${response.status}: ${response.statusText}`);
13038
+ }
13039
+ return (await response.blob());
13045
13040
  }
13046
13041
  UtilsBinary.getBlobFrom = getBlobFrom;
13047
13042
  //#endregion
@@ -14013,7 +14008,7 @@ var UtilsSecretEnv;
14013
14008
  return new TextDecoder().decode(decrypted);
14014
14009
  }
14015
14010
  catch {
14016
- Helpers.error('Unable to decrypt Taon secret. Invalid password or corrupted data.', false, true);
14011
+ throw new Error('Unable to decrypt Taon secret. Invalid password or corrupted data.');
14017
14012
  }
14018
14013
  }
14019
14014
  UtilsSecretEnv.decrypt = decrypt;
@@ -14256,6 +14251,83 @@ var UtilsSecretEnv;
14256
14251
  //#endregion
14257
14252
  })(UtilsSecretEnv || (UtilsSecretEnv = {}));
14258
14253
 
14254
+ var UtilsPasswords;
14255
+ (function (UtilsPasswords) {
14256
+ const VERSION = 'v1';
14257
+ const ITERATIONS = 600_000;
14258
+ const SALT_LENGTH = 16;
14259
+ const HASH_LENGTH = 32;
14260
+ /**
14261
+ * Result:
14262
+ * v1:<iterations>:<salt-base64>:<hash-base64>
14263
+ */
14264
+ async function hash(password) {
14265
+ const encoder = new TextEncoder();
14266
+ const salt = crypto.getRandomValues(new Uint8Array(SALT_LENGTH));
14267
+ const passwordKey = await crypto.subtle.importKey('raw', encoder.encode(password), 'PBKDF2', false, ['deriveBits']);
14268
+ const hash = await crypto.subtle.deriveBits({
14269
+ name: 'PBKDF2',
14270
+ hash: 'SHA-256',
14271
+ salt,
14272
+ iterations: ITERATIONS,
14273
+ }, passwordKey, HASH_LENGTH * 8);
14274
+ return [
14275
+ VERSION,
14276
+ ITERATIONS,
14277
+ bytesToBase64(salt),
14278
+ bytesToBase64(new Uint8Array(hash)),
14279
+ ].join(':');
14280
+ }
14281
+ UtilsPasswords.hash = hash;
14282
+ async function verify(password, storedHash) {
14283
+ const [version, iterationsStr, saltBase64, hashBase64] = storedHash.split(':');
14284
+ if (version !== VERSION) {
14285
+ return false;
14286
+ }
14287
+ const iterations = Number(iterationsStr);
14288
+ if (!Number.isInteger(iterations) || iterations <= 0) {
14289
+ return false;
14290
+ }
14291
+ const salt = base64ToBytes(saltBase64);
14292
+ const expectedHash = base64ToBytes(hashBase64);
14293
+ const passwordKey = await crypto.subtle.importKey('raw', new TextEncoder().encode(password), 'PBKDF2', false, ['deriveBits']);
14294
+ const actualHash = new Uint8Array(await crypto.subtle.deriveBits({
14295
+ name: 'PBKDF2',
14296
+ hash: 'SHA-256',
14297
+ // @ts-ignore
14298
+ salt,
14299
+ iterations,
14300
+ }, passwordKey, expectedHash.length * 8));
14301
+ return timingSafeEqual(actualHash, expectedHash);
14302
+ }
14303
+ UtilsPasswords.verify = verify;
14304
+ function timingSafeEqual(a, b) {
14305
+ if (a.length !== b.length) {
14306
+ return false;
14307
+ }
14308
+ let diff = 0;
14309
+ for (let i = 0; i < a.length; i++) {
14310
+ diff |= a[i] ^ b[i];
14311
+ }
14312
+ return diff === 0;
14313
+ }
14314
+ function bytesToBase64(bytes) {
14315
+ let binary = '';
14316
+ for (const byte of bytes) {
14317
+ binary += String.fromCharCode(byte);
14318
+ }
14319
+ return btoa(binary);
14320
+ }
14321
+ function base64ToBytes(base64) {
14322
+ const binary = atob(base64);
14323
+ const result = new Uint8Array(binary.length);
14324
+ for (let i = 0; i < binary.length; i++) {
14325
+ result[i] = binary.charCodeAt(i);
14326
+ }
14327
+ return result;
14328
+ }
14329
+ })(UtilsPasswords || (UtilsPasswords = {}));
14330
+
14259
14331
  const jsoncFormattingOptions = {
14260
14332
  insertSpaces: true,
14261
14333
  tabSize: 2,
@@ -14786,5 +14858,5 @@ var index = {};
14786
14858
  * Generated bundle index. Do not edit.
14787
14859
  */
14788
14860
 
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 };
14861
+ 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, 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
14862
  //# sourceMappingURL=tnp-core-browser.mjs.map