mp-front-cli 2.1.1 → 2.3.1

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 (60) hide show
  1. package/dist/AuthEngine-D65_iNdB.cjs +1 -0
  2. package/dist/{fetch-service-parent-be-CqCxXrf0.js → AuthEngine-Gl4gv5KD.js} +443 -232
  3. package/dist/core/errors/common-errors.d.ts +3 -0
  4. package/dist/core/errors/common-errors.d.ts.map +1 -0
  5. package/dist/core/errors/error-catalog.d.ts +5 -0
  6. package/dist/core/errors/error-catalog.d.ts.map +1 -1
  7. package/dist/core/errors/exception.d.ts +12 -0
  8. package/dist/core/errors/exception.d.ts.map +1 -0
  9. package/dist/core/errors/index.d.ts +1 -0
  10. package/dist/core/errors/index.d.ts.map +1 -1
  11. package/dist/core/middleware/index.d.ts.map +1 -1
  12. package/dist/core/utils/AuthEngine/AuthEngine.d.ts +29 -0
  13. package/dist/core/utils/AuthEngine/AuthEngine.d.ts.map +1 -0
  14. package/dist/core/utils/AuthEngine/EntraID.d.ts +11 -0
  15. package/dist/core/utils/AuthEngine/EntraID.d.ts.map +1 -0
  16. package/dist/core/utils/AuthEngine/index.d.ts +2 -0
  17. package/dist/core/utils/AuthEngine/index.d.ts.map +1 -0
  18. package/dist/core/utils/AuthEngine/interfaces/index.d.ts +51 -0
  19. package/dist/core/utils/AuthEngine/interfaces/index.d.ts.map +1 -0
  20. package/dist/core/utils/Terminal/constants/index.d.ts +1 -1
  21. package/dist/core/utils/api-request/fetch-service-be.d.ts +0 -5
  22. package/dist/core/utils/api-request/fetch-service-be.d.ts.map +1 -1
  23. package/dist/core/utils/api-request/fetch-service-fe.d.ts.map +1 -1
  24. package/dist/core/utils/custom-adapter.d.ts.map +1 -1
  25. package/dist/core/utils/index.d.ts +1 -0
  26. package/dist/core/utils/index.d.ts.map +1 -1
  27. package/dist/{mp-front-cli-encoder.es.js → custom-encoder-Cfd7FFMe.js} +3 -2
  28. package/dist/custom-encoder-d7rw7W8X.cjs +27 -0
  29. package/dist/custom-redis-BaTLH6jE.cjs +1 -0
  30. package/dist/index-D-Gvi_du.cjs +1 -0
  31. package/dist/loading-handler-CVkAHN_A.cjs +1 -0
  32. package/dist/mp-front-cli-adapter.cjs +1 -0
  33. package/dist/mp-front-cli-all.cjs +1 -0
  34. package/dist/mp-front-cli-all.js +16 -0
  35. package/dist/mp-front-cli-cache.cjs +1 -0
  36. package/dist/{mp-front-cli-cache.es.js → mp-front-cli-cache.js} +1 -1
  37. package/dist/mp-front-cli-core.cjs +1 -0
  38. package/dist/mp-front-cli-core.js +16 -0
  39. package/dist/mp-front-cli-encoder.cjs +1 -0
  40. package/dist/mp-front-cli-encoder.js +5 -0
  41. package/dist/mp-front-cli-encrypter.cjs +1 -0
  42. package/dist/{mp-front-cli-encrypter.es.js → mp-front-cli-encrypter.js} +1 -1
  43. package/dist/mp-front-cli-header.cjs +1 -0
  44. package/dist/{mp-front-cli-header.es.js → mp-front-cli-header.js} +2 -2
  45. package/dist/mp-front-cli-locale.cjs +1 -0
  46. package/dist/mp-front-cli-logger.cjs +1 -0
  47. package/dist/mp-front-cli-services.cjs +1 -0
  48. package/dist/mp-front-cli-services.js +4 -0
  49. package/dist/mp-front-cli-utils-rxjs.cjs +1 -0
  50. package/dist/service-token-Bv3BAiQd.cjs +3 -0
  51. package/dist/{service-token-DceocCHP.js → service-token-DUKgd-pZ.js} +1 -1
  52. package/dist/stringify-BN6t_WDt.cjs +1 -0
  53. package/package.json +29 -16
  54. package/dist/mp-front-cli-all.es.js +0 -14
  55. package/dist/mp-front-cli-core.es.js +0 -14
  56. package/dist/mp-front-cli-services.es.js +0 -4
  57. /package/dist/{mp-front-cli-adapter.es.js → mp-front-cli-adapter.js} +0 -0
  58. /package/dist/{mp-front-cli-locale.es.js → mp-front-cli-locale.js} +0 -0
  59. /package/dist/{mp-front-cli-logger.es.js → mp-front-cli-logger.js} +0 -0
  60. /package/dist/{mp-front-cli-utils-rxjs.es.js → mp-front-cli-utils-rxjs.js} +0 -0
@@ -0,0 +1,5 @@
1
+ import { C as t } from "./custom-encoder-Cfd7FFMe.js";
2
+ import "./mp-front-cli-logger.js";
3
+ export {
4
+ t as CustomEncoder
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var o=(r,t,e)=>t in r?c(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var i=(r,t,e)=>o(r,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("node-jose"),y=require("crypto"),E=require("./custom-encoder-d7rw7W8X.cjs"),u=r=>r.replace(/[\u00A0-\uffff]/gu,t=>"\\u"+("000"+t.charCodeAt(0).toString(16)).slice(-4));class g extends E.CustomEncoder{constructor(){super(...arguments);i(this,"signatureKey")}async generateKey(){const e=process.env.SECRET_SIGNATURE;if(!e)throw new Error("Define a SECRET_SIGNATURE from `.env`");this.signatureKey=await s.JWK.asKey({kty:"oct",k:s.util.base64url.encode(e)})}async encrypt(e){if(await this.generateKey(),!this.signatureKey)throw new Error("PLEASE CREATE A KEY TO ENCRYPT 🙂");const n=JSON.stringify(e),a=u(n);return await s.JWE.createEncrypt({format:"compact"},this.signatureKey).update(a).final()}async decrypt(e){if(await this.generateKey(),!this.signatureKey)throw new Error("PLEASE CREATE A KEY TO DECRYPT 🙂");const{payload:n}=await s.JWE.createDecrypt(this.signatureKey).decrypt(e);return JSON.parse(n.toString())}async isEncrypted(e){this.logInfo("EncryptionHandler",e);try{return await this.decrypt(e??""),this.logDebug("EncryptionHandler","IS ENCRYPTED 🥵"),!0}catch(n){return this.logWarn("EncryptionHandler",JSON.stringify(n)),this.logDebug("EncryptionHandler","IS NOT ENCRYPTED 🙂"),!1}}generateSHA(e){const n=JSON.stringify(e);return y.createHash("sha256").update(n).digest("hex")}}exports.CustomEncrypter=g;
@@ -3,7 +3,7 @@ var c = (r, e, t) => e in r ? o(r, e, { enumerable: !0, configurable: !0, writab
3
3
  var i = (r, e, t) => c(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import a from "node-jose";
5
5
  import { createHash as E } from "crypto";
6
- import { CustomEncoder as y } from "./mp-front-cli-encoder.es.js";
6
+ import { C as y } from "./custom-encoder-Cfd7FFMe.js";
7
7
  const p = (r) => r.replace(/[\u00A0-\uffff]/gu, (e) => "\\u" + ("000" + e.charCodeAt(0).toString(16)).slice(-4));
8
8
  class S extends y {
9
9
  constructor() {
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var c=(s,t,e)=>t in s?a(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var n=(s,t,e)=>c(s,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("rxjs"),d=require("./mp-front-cli-encrypter.cjs"),p=require("./service-token-Bv3BAiQd.cjs");class u extends d.CustomEncrypter{constructor(e={}){super();n(this,"headers");this.headers={Accept:"application/json","Content-Type":"application/vnd.api+json",...e}}addTokenBackend(e){return this.logDebug("addTokenBackend CustomHeader",JSON.stringify(e)),new p.ServiceToken().get().pipe(r.switchMap(o=>r.of({...e,Authorization:`Bearer ${o}`})))}getHeaders(e={},o=!0){return this.logDebug("getHeaders CustomHeader"),o?this.addTokenBackend(e).pipe(r.switchMap(i=>r.of({...i,...this.headers}))):r.of(e).pipe(r.switchMap(i=>r.of({...i,...this.headers})))}}exports.CustomHeader=u;
@@ -2,8 +2,8 @@ var p = Object.defineProperty;
2
2
  var d = (r, t, e) => t in r ? p(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
3
  var n = (r, t, e) => d(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { switchMap as a, of as o } from "rxjs";
5
- import { CustomEncrypter as c } from "./mp-front-cli-encrypter.es.js";
6
- import { S as u } from "./service-token-DceocCHP.js";
5
+ import { CustomEncrypter as c } from "./mp-front-cli-encrypter.js";
6
+ import { S as u } from "./service-token-DUKgd-pZ.js";
7
7
  class f extends c {
8
8
  constructor(e = {}) {
9
9
  super();
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D-Gvi_du.cjs"),r={errors:{}},n={validationMessages:{}},a={validationMessages:{mixed:{required:"Campo requerido",default:"Dato inválido",notType:"Ingresa un dato válido",min:"Debe tener al menos {{min}} caracteres",max:"Debe tener máximo {{max}} caracteres",matches:"Dato no válido"},number:{min:"Debe ser mayor que {{min}}",max:"Debe ser menor a {{max}}",lessThan:"Debe ser menor que {{less}}",moreThan:"Debe ser mayor que {{more}}",positive:"Debe ser un número positivo",negative:"Debe ser un número negativo",integer:"Debe ser un número entero"},string:{length:"Debe tener exactamente {{length}} caracteres",min:"Debe tener al menos {{min}} caracteres",max:"Debe tener máximo {{max}} caracteres",email:"E-mail inválido",url:"Debe ter un formato de URL válida",trim:"No debe contener espacios no iniciar con uno.",matches:"Dato no válido"},date:{min:"Debe ser después de {{min}}",max:"Debe ser antes de {{max}}"},array:{min:"Debe tener mínimo {{min}} items",max:"Debe tener máximo {{max}} items",length:"Debe tener {{max}} items"}}};exports.errorES_MX=e.translation;exports.errorEN_EN=r;exports.validatorEN_EN=n;exports.validatorES_MX=a;
@@ -0,0 +1 @@
1
+ "use strict";var n=Object.defineProperty;var l=(r,o,t)=>o in r?n(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t;var s=(r,o,t)=>l(r,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var g=(r=>(r[r.error=0]="error",r[r.warn=1]="warn",r[r.info=2]="info",r[r.http=3]="http",r[r.verbose=4]="verbose",r[r.debug=5]="debug",r[r.silly=6]="silly",r))(g||{});const e={error:"\x1B[31m",warn:"\x1B[33m",info:"\x1B[34m",http:"\x1B[35m",verbose:"\x1B[32m",debug:"\x1B[37m",silly:"\x1B[37m"};class a{constructor(){s(this,"appName");s(this,"logsLevel");s(this,"silentLogs");this.appName=process.env.NEXT_PUBLIC_APP_LOGS_NAME,this.logsLevel=process.env.NEXT_PUBLIC_LOGS_LEVEL,this.silentLogs=process.env.NEXT_PUBLIC_SILENT_LOGS==="true"}consoleFormat(o,t){try{return`${e[o]} ${this.appName} [${new Date().toISOString()}] [${o.toUpperCase()}]: ${t.toString()} \x1B[37m`}catch{return t}}log(o,t){if(o<=g[this.logsLevel]&&!this.silentLogs)try{console.log(this.consoleFormat(g[o],t))}catch(i){console.error("Fail to parse log",i)}}logError(...o){this.log(0,o)}logWarn(...o){this.log(1,o)}logInfo(...o){this.log(2,o)}logHttp(...o){this.log(3,o)}logVerbose(...o){this.log(4,o)}logDebug(...o){this.log(5,o)}logSilly(...o){this.log(6,o)}}exports.CustomLogger=a;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./service-token-Bv3BAiQd.cjs");exports.ServiceToken=e.ServiceToken;
@@ -0,0 +1,4 @@
1
+ import { S as r } from "./service-token-DUKgd-pZ.js";
2
+ export {
3
+ r as ServiceToken
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./loading-handler-CVkAHN_A.cjs");exports.LoadingHandler=e.LoadingHandler;exports.MessageHandler=e.MessageHandler;exports.RxSubjectManager=e.RxSubjectManager;
@@ -0,0 +1,3 @@
1
+ "use strict";var G=Object.defineProperty;var q=(r,t,e)=>t in r?G(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var m=(r,t,e)=>q(r,typeof t!="symbol"?t+"":t,e);const S=require("rxjs"),J=require("./mp-front-cli-logger.cjs");var O=function(r,t){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},O(r,t)};function x(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");O(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var g=function(){return g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},g.apply(this,arguments)};function V(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function N(r,t,e,n){function i(o){return o instanceof e?o:new e(function(c){c(o)})}return new(e||(e=Promise))(function(o,c){function a(l){try{u(n.next(l))}catch(p){c(p)}}function s(l){try{u(n.throw(l))}catch(p){c(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,s)}u((n=n.apply(r,t||[])).next())})}function C(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=a(0),c.throw=a(1),c.return=a(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function a(u){return function(l){return s([u,l])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(e=0)),e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function P(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,o=[],c;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){c={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(c)throw c.error}}return o}function I(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return r.concat(o||Array.prototype.slice.call(t))}function A(r){return this instanceof A?(this.v=r,this):new A(r)}function W(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",c),i[Symbol.asyncIterator]=function(){return this},i;function c(f){return function(d){return Promise.resolve(d).then(f,p)}}function a(f,d){n[f]&&(i[f]=function(h){return new Promise(function(Y,$){o.push([f,h,Y,$])>1||s(f,h)})},d&&(i[f]=d(i[f])))}function s(f,d){try{u(n[f](d))}catch(h){v(o[0][3],h)}}function u(f){f.value instanceof A?Promise.resolve(f.value.v).then(l,p):v(o[0][2],f)}function l(f){s("next",f)}function p(f){s("throw",f)}function v(f,d){f(d),o.shift(),o.length&&s(o[0][0],o[0][1])}}function Q(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof _=="function"?_(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(o){e[o]=r[o]&&function(c){return new Promise(function(a,s){c=r[o](c),i(a,s,c.done,c.value)})}}function i(o,c,a,s){Promise.resolve(s).then(function(u){o({value:u,done:a})},c)}}function y(r){return typeof r=="function"}function X(r){var t=function(n){Error.call(n),n.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var T=X(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
2
+ `+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function H(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var U=function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,n,i,o;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var a=_(c),s=a.next();!s.done;s=a.next()){var u=s.value;u.remove(this)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else c.remove(this);var l=this.initialTeardown;if(y(l))try{l()}catch(h){o=h instanceof T?h.errors:[h]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var v=_(p),f=v.next();!f.done;f=v.next()){var d=f.value;try{j(d)}catch(h){o=o??[],h instanceof T?o=I(I([],P(o)),P(h.errors)):o.push(h)}}}catch(h){n={error:h}}finally{try{f&&!f.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}if(o)throw new T(o)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)j(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&H(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&H(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}();U.EMPTY;function K(r){return r instanceof U||r&&"closed"in r&&y(r.remove)&&y(r.add)&&y(r.unsubscribe)}function j(r){y(r)?r():r.unsubscribe()}var Z={Promise:void 0},z={setTimeout:function(r,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,I([r,t],P(e)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function D(r){z.setTimeout(function(){throw r})}function k(){}function rr(r){r()}var R=function(r){x(t,r);function t(e){var n=r.call(this)||this;return n.isStopped=!1,e?(n.destination=e,K(e)&&e.add(n)):n.destination=nr,n}return t.create=function(e,n,i){return new E(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(U),er=function(){function r(t){this.partialObserver=t}return r.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){w(n)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){w(n)}else w(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){w(e)}},r}(),E=function(r){x(t,r);function t(e,n,i){var o=r.call(this)||this,c;return y(e)||!e?c={next:e??void 0,error:n??void 0,complete:i??void 0}:c=e,o.destination=new er(c),o}return t}(R);function w(r){D(r)}function tr(r){throw r}var nr={closed:!0,next:k,error:tr,complete:k};function or(r,t,e,n,i){return new ir(r,t,e,n,i)}var ir=function(r){x(t,r);function t(e,n,i,o,c,a){var s=r.call(this,e)||this;return s.onFinalize=c,s.shouldUnsubscribe=a,s._next=n?function(u){try{n(u)}catch(l){e.error(l)}}:r.prototype._next,s._error=o?function(u){try{o(u)}catch(l){e.error(l)}finally{this.unsubscribe()}}:r.prototype._error,s._complete=i?function(){try{i()}catch(u){e.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,s}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(R),B=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function cr(r){return r}function ur(r){return r.length===0?cr:r.length===1?r[0]:function(e){return r.reduce(function(n,i){return i(n)},e)}}var b=function(){function r(t){t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,n){var i=this,o=ar(t)?t:new E(t,e,n);return rr(function(){var c=i,a=c.operator,s=c.source;o.add(a?a.call(o,s):s?i._subscribe(o):i._trySubscribe(o))}),o},r.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},r.prototype.forEach=function(t,e){var n=this;return e=L(e),new e(function(i,o){var c=new E({next:function(a){try{t(a)}catch(s){o(s),c.unsubscribe()}},error:o,complete:i});n.subscribe(c)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[B]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ur(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=L(t),new t(function(n,i){var o;e.subscribe(function(c){return o=c},function(c){return i(c)},function(){return n(o)})})},r.create=function(t){return new r(t)},r}();function L(r){var t;return(t=r??Z.Promise)!==null&&t!==void 0?t:Promise}function sr(r){return r&&y(r.next)&&y(r.error)&&y(r.complete)}function ar(r){return r&&r instanceof R||sr(r)&&K(r)}var fr=function(r){return r&&typeof r.length=="number"&&typeof r!="function"};function lr(r){return y(r==null?void 0:r.then)}function hr(r){return y(r[B])}function yr(r){return Symbol.asyncIterator&&y(r==null?void 0:r[Symbol.asyncIterator])}function pr(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function vr(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dr=vr();function br(r){return y(r==null?void 0:r[dr])}function mr(r){return W(this,arguments,function(){var e,n,i,o;return C(this,function(c){switch(c.label){case 0:e=r.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,A(e.read())];case 3:return n=c.sent(),i=n.value,o=n.done,o?[4,A(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,A(i)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Ar(r){return y(r==null?void 0:r.getReader)}function Sr(r){if(r instanceof b)return r;if(r!=null){if(hr(r))return _r(r);if(fr(r))return wr(r);if(lr(r))return gr(r);if(yr(r))return F(r);if(br(r))return Tr(r);if(Ar(r))return Or(r)}throw pr(r)}function _r(r){return new b(function(t){var e=r[B]();if(y(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function wr(r){return new b(function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()})}function gr(r){return new b(function(t){r.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,D)})}function Tr(r){return new b(function(t){var e,n;try{for(var i=_(r),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}t.complete()})}function F(r){return new b(function(t){Pr(r,t).catch(function(e){return t.error(e)})})}function Or(r){return F(mr(r))}function Pr(r,t){var e,n,i,o;return N(this,void 0,void 0,function(){var c,a;return C(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),e=Q(r),s.label=1;case 1:return[4,e.next()];case 2:if(n=s.sent(),!!n.done)return[3,4];if(c=n.value,t.next(c),t.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=s.sent(),i={error:a},[3,11];case 6:return s.trys.push([6,,9,10]),n&&!n.done&&(o=e.return)?[4,o.call(e)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function M(r,t){t===void 0&&(t={});var e=t.selector,n=V(t,["selector"]);return new b(function(i){var o=new AbortController,c=o.signal,a=!0,s=n.signal;if(s)if(s.aborted)o.abort();else{var u=function(){c.aborted||o.abort()};s.addEventListener("abort",u),i.add(function(){return s.removeEventListener("abort",u)})}var l=g(g({},n),{signal:c}),p=function(v){a=!1,i.error(v)};return fetch(r,l).then(function(v){e?Sr(e(v)).subscribe(or(i,void 0,function(){a=!1,i.complete()},p)):(a=!1,i.next(v),i.complete())}).catch(p),function(){a&&o.abort()}})}class Ir extends J.CustomLogger{constructor(){super();m(this,"API_AUTH_BACK_URL");m(this,"API_AUTH_BACK_USERNAME_AUTH");m(this,"API_AUTH_BACK_PASSWORD_AUTH");m(this,"headers");m(this,"ID",process.env.ID_FRONT??"NOT_AVAILABLE");this.API_AUTH_BACK_URL=process.env.API_AUTH_BACK_URL,this.API_AUTH_BACK_USERNAME_AUTH=process.env.API_AUTH_BACK_USERNAME_AUTH,this.API_AUTH_BACK_PASSWORD_AUTH=process.env.API_AUTH_BACK_PASSWORD_AUTH,this.headers={Accept:"application/json","Content-Type":"application/vnd.api+json"}}get(){return this.logDebug("get ServiceToken"),M(this.API_AUTH_BACK_URL,{method:"POST",headers:this.headers,body:JSON.stringify({data:{id:this.ID,type:"AuthUser",attributes:{username:this.API_AUTH_BACK_USERNAME_AUTH,password:this.API_AUTH_BACK_PASSWORD_AUTH}}})}).pipe(S.switchMap(e=>e.json()),S.switchMap(e=>{var n;return this.logDebug(`ServiceToken <URL>: \x1B[33m ${this.API_AUTH_BACK_URL} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(this.headers)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(e)} \x1B[37m`),S.of(((n=e==null?void 0:e.data.attributes)==null?void 0:n.token)||"")}),S.catchError(e=>(this.logError(`ServiceToken ${e}`),S.of(""))))}}exports.ServiceToken=Ir;exports.fromFetch=M;
@@ -2,7 +2,7 @@ var G = Object.defineProperty;
2
2
  var J = (r, t, e) => t in r ? G(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
3
  var m = (r, t, e) => J(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { switchMap as B, of as H, catchError as V } from "rxjs";
5
- import { CustomLogger as q } from "./mp-front-cli-logger.es.js";
5
+ import { CustomLogger as q } from "./mp-front-cli-logger.js";
6
6
  var O = function(r, t) {
7
7
  return O = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
8
8
  e.__proto__ = n;
@@ -0,0 +1 @@
1
+ "use strict";const n=[];for(let i=0;i<256;++i)n.push((i+256).toString(16).slice(1));function c(i,u=0){return n[i[u+0]]+n[i[u+1]]+n[i[u+2]]+n[i[u+3]]+"-"+n[i[u+4]]+n[i[u+5]]+"-"+n[i[u+6]]+n[i[u+7]]+"-"+n[i[u+8]]+n[i[u+9]]+"-"+n[i[u+10]]+n[i[u+11]]+n[i[u+12]]+n[i[u+13]]+n[i[u+14]]+n[i[u+15]]}exports.unsafeStringify=c;
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "mp-front-cli",
3
- "version": "2.1.1",
3
+ "version": "2.3.1",
4
4
  "private": false,
5
5
  "type": "module",
6
+ "main": "./dist/mp-front-cli-all.cjs",
7
+ "module": "./dist/mp-front-cli-all.js",
6
8
  "scripts": {
7
9
  "build": "tsc && vite build",
8
10
  "package": "npm pack",
@@ -20,56 +22,67 @@
20
22
  "exports": {
21
23
  ".": {
22
24
  "types": "./dist/index.d.ts",
23
- "import": "./dist/mp-front-cli-all.es.js"
25
+ "import": "./dist/mp-front-cli-all.js",
26
+ "require": "./dist/mp-front-cli-all.cjs"
24
27
  },
25
28
  "./core": {
26
29
  "types": "./dist/core/index.d.ts",
27
- "import": "./dist/mp-front-cli-core.es.js"
30
+ "import": "./dist/mp-front-cli-core.js",
31
+ "require": "./dist/mp-front-cli-core.cjs"
28
32
  },
29
33
  "./core/rxjs": {
30
34
  "types": "./dist/core/utils/rxjs/index.d.ts",
31
- "import": "./dist/mp-front-cli-utils-rxjs.es.js"
35
+ "import": "./dist/mp-front-cli-utils-rxjs.js",
36
+ "require": "./dist/mp-front-cli-utils-rxjs.cjs"
32
37
  },
33
38
  "./core/encoder": {
34
39
  "types": "./dist/core/utils/custom-encoder.d.ts",
35
- "import": "./dist/mp-front-cli-encoder.es.js"
40
+ "import": "./dist/mp-front-cli-encoder.js",
41
+ "require": "./dist/mp-front-cli-encoder.cjs"
36
42
  },
37
43
  "./core/header": {
38
44
  "types": "./dist/core/utils/custom-header.d.ts",
39
- "import": "./dist/mp-front-cli-header.es.js"
45
+ "import": "./dist/mp-front-cli-header.js",
46
+ "require": "./dist/mp-front-cli-header.cjs"
40
47
  },
41
48
  "./core/logger": {
42
49
  "types": "./dist/core/utils/custom-logger.d.ts",
43
- "import": "./dist/mp-front-cli-logger.es.js"
50
+ "import": "./dist/mp-front-cli-logger.js",
51
+ "require": "./dist/mp-front-cli-logger.cjs"
44
52
  },
45
53
  "./core/encrypter": {
46
54
  "types": "./dist/core/utils/custom-encrypter.d.ts",
47
- "import": "./dist/mp-front-cli-encrypter.es.js"
55
+ "import": "./dist/mp-front-cli-encrypter.js",
56
+ "require": "./dist/mp-front-cli-encrypter.cjs"
48
57
  },
49
58
  "./core/cache": {
50
59
  "types": "./dist/core/utils/custom-cache.d.ts",
51
- "import": "./dist/mp-front-cli-cache.es.js"
60
+ "import": "./dist/mp-front-cli-cache.js",
61
+ "require": "./dist/mp-front-cli-cache.cjs"
52
62
  },
53
63
  "./core/adapter": {
54
64
  "types": "./dist/core/utils/custom-adapter.d.ts",
55
- "import": "./dist/mp-front-cli-adapter.es.js"
65
+ "import": "./dist/mp-front-cli-adapter.js",
66
+ "require": "./dist/mp-front-cli-adapter.cjs"
56
67
  },
57
68
  "./core/services": {
58
69
  "types": "./dist/core/services/index.d.ts",
59
- "import": "./dist/mp-front-cli-services.es.js"
70
+ "import": "./dist/mp-front-cli-services.js",
71
+ "require": "./dist/mp-front-cli-services.cjs"
60
72
  },
61
73
  "./locale": {
62
74
  "types": "./dist/lang/index.d.ts",
63
- "import": "./dist/mp-front-cli-locale.es.js"
75
+ "import": "./dist/mp-front-cli-locale.js",
76
+ "require": "./dist/mp-front-cli-locale.cjs"
64
77
  },
65
78
  "./types": {
66
79
  "types": "./dist/core/interfaces/index.d.ts"
67
80
  }
68
81
  },
69
82
  "peerDependencies": {
70
- "i18next": "24.2.1",
83
+ "i18next": "25.2.0",
71
84
  "ioredis": "5.3.2",
72
- "next-auth": "4.24.11",
85
+ "next-auth": "4.24.13",
73
86
  "node-jose": "2.2.0",
74
87
  "rxjs": "7.8.1"
75
88
  },
@@ -85,13 +98,13 @@
85
98
  "@types/node-jose": "1.1.13",
86
99
  "@types/uuid": "10.0.0",
87
100
  "@typescript-eslint/eslint-plugin": "8.22.0",
88
- "eslint": "9.19.0",
101
+ "eslint": "9.38.0",
89
102
  "eslint-config-prettier": "10.0.1",
90
103
  "eslint-plugin-prettier": "5.2.3",
91
104
  "globals": "15.14.0",
92
105
  "husky": "9.1.7",
93
106
  "typescript": "5.7.2",
94
- "vite": "6.0.11",
107
+ "vite": "6.4.1",
95
108
  "vite-plugin-dts": "4.5.0",
96
109
  "vite-tsconfig-paths": "5.1.4"
97
110
  }
@@ -1,14 +0,0 @@
1
- import { A as r, E as s, F as o, a as t, b as c } from "./fetch-service-parent-be-CqCxXrf0.js";
2
- import { L as n, M as S, R as d } from "./loading-handler-Br21zGTA.js";
3
- import { S as F } from "./service-token-DceocCHP.js";
4
- export {
5
- r as ApiMiddleware,
6
- s as ErrorCatalog,
7
- o as FetchServiceBE,
8
- t as FetchServiceFE,
9
- c as FetchServiceParentBE,
10
- n as LoadingHandler,
11
- S as MessageHandler,
12
- d as RxSubjectManager,
13
- F as ServiceToken
14
- };
@@ -1,14 +0,0 @@
1
- import { A as r, E as s, F as o, a as t, b as c } from "./fetch-service-parent-be-CqCxXrf0.js";
2
- import { L as n, M as S, R as d } from "./loading-handler-Br21zGTA.js";
3
- import { S as F } from "./service-token-DceocCHP.js";
4
- export {
5
- r as ApiMiddleware,
6
- s as ErrorCatalog,
7
- o as FetchServiceBE,
8
- t as FetchServiceFE,
9
- c as FetchServiceParentBE,
10
- n as LoadingHandler,
11
- S as MessageHandler,
12
- d as RxSubjectManager,
13
- F as ServiceToken
14
- };
@@ -1,4 +0,0 @@
1
- import { S as r } from "./service-token-DceocCHP.js";
2
- export {
3
- r as ServiceToken
4
- };