@jsfsi-core/ts-nodejs 1.0.4 → 1.0.7
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/dist/index.cjs +3 -3
- package/dist/index.mjs +104 -103
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`);let y;for(;(y=
|
|
3
|
-
`),f=f.replace(/\\r/g,"\r")),a[N]=f}return a}function S(e){e=e||{};const a=g(e);e.path=a;const d=h.configDotenv(e);if(!d.parsed){const o=new Error(`MISSING_DATA: Cannot parse ${a} for an unknown reason`);throw o.code="MISSING_DATA",o}const y=r(e).split(","),N=y.length;let f;for(let o=0;o<N;o++)try{const w=y[o].trim(),T=u(d,w);f=h.decrypt(T.ciphertext,T.key);break}catch(w){if(o+1>=N)throw w}return h.parse(f)}function b(e){console.error(`[dotenv@${O}][WARN] ${e}`)}function R(e){console.log(`[dotenv@${O}][DEBUG] ${e}`)}function A(e){console.log(`[dotenv@${O}] ${e}`)}function r(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function u(e,a){let d;try{d=new URL(a)}catch(w){if(w.code==="ERR_INVALID_URL"){const T=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw T.code="INVALID_DOTENV_KEY",T}throw w}const y=d.password;if(!y){const w=new Error("INVALID_DOTENV_KEY: Missing key part");throw w.code="INVALID_DOTENV_KEY",w}const N=d.searchParams.get("environment");if(!N){const w=new Error("INVALID_DOTENV_KEY: Missing environment part");throw w.code="INVALID_DOTENV_KEY",w}const f=`DOTENV_VAULT_${N.toUpperCase()}`,o=e.parsed[f];if(!o){const w=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${f} in your .env.vault file.`);throw w.code="NOT_FOUND_DOTENV_ENVIRONMENT",w}return{ciphertext:o,key:y}}function g(e){let a=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const d of e.path)E.existsSync(d)&&(a=d.endsWith(".vault")?d:`${d}.vault`);else a=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else a=t.resolve(process.cwd(),".env.vault");return E.existsSync(a)?a:null}function i(e){return e[0]==="~"?t.join(n.homedir(),e.slice(1)):e}function l(e){const a=!!(e&&e.debug),d=!!(e&&e.quiet);(a||!d)&&A("Loading env from encrypted .env.vault");const y=h._parseVault(e);let N=process.env;return e&&e.processEnv!=null&&(N=e.processEnv),h.populate(N,y,e),{parsed:y}}function p(e){const a=t.resolve(process.cwd(),".env");let d="utf8";const y=!!(e&&e.debug),N=!!(e&&e.quiet);e&&e.encoding?d=e.encoding:y&&R("No encoding is specified. UTF-8 is used by default");let f=[a];if(e&&e.path)if(!Array.isArray(e.path))f=[i(e.path)];else{f=[];for(const L of e.path)f.push(i(L))}let o;const w={};for(const L of f)try{const $=h.parse(E.readFileSync(L,{encoding:d}));h.populate(w,$,e)}catch($){y&&R(`Failed to load ${L} ${$.message}`),o=$}let T=process.env;e&&e.processEnv!=null&&(T=e.processEnv);const P=h.populate(T,w,e);if(y||!N){const L=Object.keys(P).length,$=[];for(const K of f)try{const M=t.relative(process.cwd(),K);$.push(M)}catch(M){y&&R(`Failed to load ${K} ${M.message}`),o=M}A(`injecting env (${L}) from ${$.join(",")} – [tip] encrypt with dotenvx: https://dotenvx.com`)}return o?{parsed:w,error:o}:{parsed:w}}function v(e){if(r(e).length===0)return h.configDotenv(e);const a=g(e);return a?h._configVault(e):(b(`You set DOTENV_KEY but you are missing a .env.vault file at ${a}. Did you forget to build it?`),h.configDotenv(e))}function c(e,a){const d=Buffer.from(a.slice(-64),"hex");let y=Buffer.from(e,"base64");const N=y.subarray(0,12),f=y.subarray(-16);y=y.subarray(12,-16);try{const o=s.createDecipheriv("aes-256-gcm",d,N);return o.setAuthTag(f),`${o.update(y)}${o.final()}`}catch(o){const w=o instanceof RangeError,T=o.message==="Invalid key length",P=o.message==="Unsupported state or unable to authenticate data";if(w||T){const L=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw L.code="INVALID_DOTENV_KEY",L}else if(P){const L=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw L.code="DECRYPTION_FAILED",L}else throw o}}function V(e,a,d={}){const y=!!(d&&d.debug),N=!!(d&&d.override),f={};if(typeof a!="object"){const o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(const o of Object.keys(a))Object.prototype.hasOwnProperty.call(e,o)?(N===!0&&(e[o]=a[o],f[o]=a[o]),y&&R(N===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):(e[o]=a[o],f[o]=a[o]);return f}const h={configDotenv:p,_configVault:l,_parseVault:S,config:v,decrypt:c,parse:D,populate:V};return I.exports.configDotenv=h.configDotenv,I.exports._configVault=h._configVault,I.exports._parseVault=h._parseVault,I.exports.config=h.config,I.exports.decrypt=h.decrypt,I.exports.parse=h.parse,I.exports.populate=h.populate,I.exports=h,I.exports}var Q=W();const H=(E={})=>{const{env:t,configPath:n}=E,s=F.resolve(__dirname,`${n??"."}/.env${t?`.${t}`:""}`),{parsed:_}=Q.config({path:s});return _};var C,j;function X(){if(j)return C;j=1,C=O,O.default=O,O.stable=b,O.stableStringify=b;var E="[...]",t="[Circular]",n=[],s=[];function _(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function O(r,u,g,i){typeof i>"u"&&(i=_()),D(r,"",0,[],void 0,0,i);var l;try{s.length===0?l=JSON.stringify(r,u,g):l=JSON.stringify(r,A(u),g)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var p=n.pop();p.length===4?Object.defineProperty(p[0],p[1],p[3]):p[0][p[1]]=p[2]}}return l}function m(r,u,g,i){var l=Object.getOwnPropertyDescriptor(i,g);l.get!==void 0?l.configurable?(Object.defineProperty(i,g,{value:r}),n.push([i,g,u,l])):s.push([u,g,r]):(i[g]=r,n.push([i,g,u]))}function D(r,u,g,i,l,p,v){p+=1;var c;if(typeof r=="object"&&r!==null){for(c=0;c<i.length;c++)if(i[c]===r){m(t,r,u,l);return}if(typeof v.depthLimit<"u"&&p>v.depthLimit){m(E,r,u,l);return}if(typeof v.edgesLimit<"u"&&g+1>v.edgesLimit){m(E,r,u,l);return}if(i.push(r),Array.isArray(r))for(c=0;c<r.length;c++)D(r[c],c,c,i,r,p,v);else{var V=Object.keys(r);for(c=0;c<V.length;c++){var h=V[c];D(r[h],h,c,i,r,p,v)}}i.pop()}}function S(r,u){return r<u?-1:r>u?1:0}function b(r,u,g,i){typeof i>"u"&&(i=_());var l=R(r,"",0,[],void 0,0,i)||r,p;try{s.length===0?p=JSON.stringify(l,u,g):p=JSON.stringify(l,A(u),g)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var v=n.pop();v.length===4?Object.defineProperty(v[0],v[1],v[3]):v[0][v[1]]=v[2]}}return p}function R(r,u,g,i,l,p,v){p+=1;var c;if(typeof r=="object"&&r!==null){for(c=0;c<i.length;c++)if(i[c]===r){m(t,r,u,l);return}try{if(typeof r.toJSON=="function")return}catch{return}if(typeof v.depthLimit<"u"&&p>v.depthLimit){m(E,r,u,l);return}if(typeof v.edgesLimit<"u"&&g+1>v.edgesLimit){m(E,r,u,l);return}if(i.push(r),Array.isArray(r))for(c=0;c<r.length;c++)R(r[c],c,c,i,r,p,v);else{var V={},h=Object.keys(r).sort(S);for(c=0;c<h.length;c++){var e=h[c];R(r[e],e,c,i,r,p,v),V[e]=r[e]}if(typeof l<"u")n.push([l,u,r]),l[u]=V;else return V}i.pop()}}function A(r){return r=typeof r<"u"?r:function(u,g){return g},function(u,g){if(s.length>0)for(var i=0;i<s.length;i++){var l=s[i];if(l[1]===u&&l[0]===g){g=l[2],s.splice(i,1);break}}return r.call(this,u,g)}}return C}var Z=X();const ee=G(Z),q={debug:"debug",verbose:"debug",log:"log",warn:"warn",error:"error",fatal:"error"},te={verbose:"DEFAULT",debug:"DEBUG",log:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},re=["x-api-key","x-api-token","x-key","x-token","cookie","password","pass","psw","auth","authentication","authorization","token","access_token","client-secret","credentials","secret"];class ne{constructor(t,n={}){this.module=t,n.logLevels&&(this.levels=new Set(n.logLevels))}levels=new Set(["verbose","debug","log","warn","error","fatal"]);mapLogLevelToConsoleMethod(t){return q[t]}write(t,n,s,_,O){if(!this.levels.has(t))return;const m=this.buildLog(t,n,s,_,O),D=ee(m,this.sensitiveReplacer),S=this.mapLogLevelToConsoleMethod(t);console[S](D)}buildLog(t,n,s,_,O){const{writeMetadata:m,writeContext:D,writeError:S}=this.sanitizeLog(s,_,O),b={};return typeof n=="string"&&(b.textPayload=n),!m&&typeof n!="string"&&!(n instanceof Error)&&(b.metadata=n),n instanceof Error&&(b.error=JSON.stringify(n,Object.getOwnPropertyNames(n))),D&&(b.context=D),m&&(b.metadata=m),!b.error&&S&&(b.error=JSON.stringify(S,Object.getOwnPropertyNames(S))),{severity:te[t],module:this.module,textPayload:b.textPayload,message:b}}sanitizeLog(t,n,s){if(n instanceof Error&&(!s||typeof s=="string"))return{writeMetadata:void 0,writeContext:t||s,writeError:n};let _=n,O=t;return typeof _=="string"&&!t&&(O=_,_=void 0),{writeMetadata:_,writeContext:O,writeError:s}}sensitiveReplacer(t,n){return re.includes(t.toLowerCase())?"[HIDDEN BY LOGGER]":n}debug(t,n,s){this.write("debug",t,s,n)}verbose(t,n,s){this.write("verbose",t,s,n)}log(t,n,s){this.write("log",t,s,n)}warn(t,n,s,_){this.write("warn",t,_,n,s)}error(t,n,s,_){this.write("error",t,_,n,s)}fatal(t,n,s,_){this.write("fatal",t,_,n,s)}setLogLevels(t){this.levels=new Set(t)}}class oe{debug=()=>{};verbose=()=>{};log=()=>{};warn=()=>{};error=()=>{};fatal=()=>{};setLogLevels=()=>{}}class x{constructor(t){this.dataSource=t}em;static newInstance(t){const n=t.constructor;return new n(t.dataSource)}withEntityManager(t){return this.em=t,this}withRepositoryManager(t){return x.newInstance(this).withEntityManager(t.em)}lockInTransaction(t="pessimistic_write"){return this.em?{mode:t}:void 0}getRepository(t){return this.em?this.em.getRepository(t):this.dataSource.getRepository(t)}async withTransaction(t){let n;return await this.dataSource.transaction(async s=>{n=await t(x.newInstance(this).withEntityManager(s))}),n}}const ie=E=>({...E,withTransaction:async t=>await t(E),withRepositoryManager:()=>E}),se=(E,t)=>`unaccent(LOWER(${E})) ILIKE unaccent(LOWER(:${t}))`,ce=Object.freeze(Object.defineProperty({__proto__:null,unaccentSearch:se},Symbol.toStringTag,{value:"Module"}));exports.GCPLogger=ne;exports.LogLevelToConsoleMethodMap=q;exports.MockLogger=oe;exports.TransactionalRepository=x;exports.buildTransactionalRepositoryMock=ie;exports.loadEnvConfig=H;exports.postgres=ce;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("path"),B=require("url"),J=require("fs"),G=require("os"),k=require("crypto");var C=typeof document<"u"?document.currentScript:null;function z(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var I={exports:{}};const W="17.0.1",Q={version:W};var F;function H(){if(F)return I.exports;F=1;const p=J,t=K,n=G,s=k,N=Q.version,O=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function D(e){const a={};let d=e.toString();d=d.replace(/\r\n?/mg,`
|
|
2
|
+
`);let y;for(;(y=O.exec(d))!=null;){const m=y[1];let f=y[2]||"";f=f.trim();const o=f[0];f=f.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(f=f.replace(/\\n/g,`
|
|
3
|
+
`),f=f.replace(/\\r/g,"\r")),a[m]=f}return a}function S(e){e=e||{};const a=g(e);e.path=a;const d=h.configDotenv(e);if(!d.parsed){const o=new Error(`MISSING_DATA: Cannot parse ${a} for an unknown reason`);throw o.code="MISSING_DATA",o}const y=r(e).split(","),m=y.length;let f;for(let o=0;o<m;o++)try{const w=y[o].trim(),T=u(d,w);f=h.decrypt(T.ciphertext,T.key);break}catch(w){if(o+1>=m)throw w}return h.parse(f)}function b(e){console.error(`[dotenv@${N}][WARN] ${e}`)}function R(e){console.log(`[dotenv@${N}][DEBUG] ${e}`)}function A(e){console.log(`[dotenv@${N}] ${e}`)}function r(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function u(e,a){let d;try{d=new URL(a)}catch(w){if(w.code==="ERR_INVALID_URL"){const T=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw T.code="INVALID_DOTENV_KEY",T}throw w}const y=d.password;if(!y){const w=new Error("INVALID_DOTENV_KEY: Missing key part");throw w.code="INVALID_DOTENV_KEY",w}const m=d.searchParams.get("environment");if(!m){const w=new Error("INVALID_DOTENV_KEY: Missing environment part");throw w.code="INVALID_DOTENV_KEY",w}const f=`DOTENV_VAULT_${m.toUpperCase()}`,o=e.parsed[f];if(!o){const w=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${f} in your .env.vault file.`);throw w.code="NOT_FOUND_DOTENV_ENVIRONMENT",w}return{ciphertext:o,key:y}}function g(e){let a=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const d of e.path)p.existsSync(d)&&(a=d.endsWith(".vault")?d:`${d}.vault`);else a=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else a=t.resolve(process.cwd(),".env.vault");return p.existsSync(a)?a:null}function i(e){return e[0]==="~"?t.join(n.homedir(),e.slice(1)):e}function l(e){const a=!!(e&&e.debug),d=!!(e&&e.quiet);(a||!d)&&A("Loading env from encrypted .env.vault");const y=h._parseVault(e);let m=process.env;return e&&e.processEnv!=null&&(m=e.processEnv),h.populate(m,y,e),{parsed:y}}function v(e){const a=t.resolve(process.cwd(),".env");let d="utf8";const y=!!(e&&e.debug),m=!!(e&&e.quiet);e&&e.encoding?d=e.encoding:y&&R("No encoding is specified. UTF-8 is used by default");let f=[a];if(e&&e.path)if(!Array.isArray(e.path))f=[i(e.path)];else{f=[];for(const L of e.path)f.push(i(L))}let o;const w={};for(const L of f)try{const $=h.parse(p.readFileSync(L,{encoding:d}));h.populate(w,$,e)}catch($){y&&R(`Failed to load ${L} ${$.message}`),o=$}let T=process.env;e&&e.processEnv!=null&&(T=e.processEnv);const P=h.populate(T,w,e);if(y||!m){const L=Object.keys(P).length,$=[];for(const Y of f)try{const M=t.relative(process.cwd(),Y);$.push(M)}catch(M){y&&R(`Failed to load ${Y} ${M.message}`),o=M}A(`injecting env (${L}) from ${$.join(",")} – [tip] encrypt with dotenvx: https://dotenvx.com`)}return o?{parsed:w,error:o}:{parsed:w}}function E(e){if(r(e).length===0)return h.configDotenv(e);const a=g(e);return a?h._configVault(e):(b(`You set DOTENV_KEY but you are missing a .env.vault file at ${a}. Did you forget to build it?`),h.configDotenv(e))}function c(e,a){const d=Buffer.from(a.slice(-64),"hex");let y=Buffer.from(e,"base64");const m=y.subarray(0,12),f=y.subarray(-16);y=y.subarray(12,-16);try{const o=s.createDecipheriv("aes-256-gcm",d,m);return o.setAuthTag(f),`${o.update(y)}${o.final()}`}catch(o){const w=o instanceof RangeError,T=o.message==="Invalid key length",P=o.message==="Unsupported state or unable to authenticate data";if(w||T){const L=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw L.code="INVALID_DOTENV_KEY",L}else if(P){const L=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw L.code="DECRYPTION_FAILED",L}else throw o}}function V(e,a,d={}){const y=!!(d&&d.debug),m=!!(d&&d.override),f={};if(typeof a!="object"){const o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(const o of Object.keys(a))Object.prototype.hasOwnProperty.call(e,o)?(m===!0&&(e[o]=a[o],f[o]=a[o]),y&&R(m===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):(e[o]=a[o],f[o]=a[o]);return f}const h={configDotenv:v,_configVault:l,_parseVault:S,config:E,decrypt:c,parse:D,populate:V};return I.exports.configDotenv=h.configDotenv,I.exports._configVault=h._configVault,I.exports._parseVault=h._parseVault,I.exports.config=h.config,I.exports.decrypt=h.decrypt,I.exports.parse=h.parse,I.exports.populate=h.populate,I.exports=h,I.exports}var X=H();const Z=B.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:C&&C.tagName.toUpperCase()==="SCRIPT"&&C.src||new URL("index.cjs",document.baseURI).href),ee=K.dirname(Z),te=(p={})=>{const{env:t,configPath:n}=p,s=K.resolve(ee,`${n??"."}/.env${t?`.${t}`:""}`),{parsed:_}=X.config({path:s});return _};var j,U;function re(){if(U)return j;U=1,j=N,N.default=N,N.stable=b,N.stableStringify=b;var p="[...]",t="[Circular]",n=[],s=[];function _(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N(r,u,g,i){typeof i>"u"&&(i=_()),D(r,"",0,[],void 0,0,i);var l;try{s.length===0?l=JSON.stringify(r,u,g):l=JSON.stringify(r,A(u),g)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var v=n.pop();v.length===4?Object.defineProperty(v[0],v[1],v[3]):v[0][v[1]]=v[2]}}return l}function O(r,u,g,i){var l=Object.getOwnPropertyDescriptor(i,g);l.get!==void 0?l.configurable?(Object.defineProperty(i,g,{value:r}),n.push([i,g,u,l])):s.push([u,g,r]):(i[g]=r,n.push([i,g,u]))}function D(r,u,g,i,l,v,E){v+=1;var c;if(typeof r=="object"&&r!==null){for(c=0;c<i.length;c++)if(i[c]===r){O(t,r,u,l);return}if(typeof E.depthLimit<"u"&&v>E.depthLimit){O(p,r,u,l);return}if(typeof E.edgesLimit<"u"&&g+1>E.edgesLimit){O(p,r,u,l);return}if(i.push(r),Array.isArray(r))for(c=0;c<r.length;c++)D(r[c],c,c,i,r,v,E);else{var V=Object.keys(r);for(c=0;c<V.length;c++){var h=V[c];D(r[h],h,c,i,r,v,E)}}i.pop()}}function S(r,u){return r<u?-1:r>u?1:0}function b(r,u,g,i){typeof i>"u"&&(i=_());var l=R(r,"",0,[],void 0,0,i)||r,v;try{s.length===0?v=JSON.stringify(l,u,g):v=JSON.stringify(l,A(u),g)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var E=n.pop();E.length===4?Object.defineProperty(E[0],E[1],E[3]):E[0][E[1]]=E[2]}}return v}function R(r,u,g,i,l,v,E){v+=1;var c;if(typeof r=="object"&&r!==null){for(c=0;c<i.length;c++)if(i[c]===r){O(t,r,u,l);return}try{if(typeof r.toJSON=="function")return}catch{return}if(typeof E.depthLimit<"u"&&v>E.depthLimit){O(p,r,u,l);return}if(typeof E.edgesLimit<"u"&&g+1>E.edgesLimit){O(p,r,u,l);return}if(i.push(r),Array.isArray(r))for(c=0;c<r.length;c++)R(r[c],c,c,i,r,v,E);else{var V={},h=Object.keys(r).sort(S);for(c=0;c<h.length;c++){var e=h[c];R(r[e],e,c,i,r,v,E),V[e]=r[e]}if(typeof l<"u")n.push([l,u,r]),l[u]=V;else return V}i.pop()}}function A(r){return r=typeof r<"u"?r:function(u,g){return g},function(u,g){if(s.length>0)for(var i=0;i<s.length;i++){var l=s[i];if(l[1]===u&&l[0]===g){g=l[2],s.splice(i,1);break}}return r.call(this,u,g)}}return j}var ne=re();const oe=z(ne),q={debug:"debug",verbose:"debug",log:"log",warn:"warn",error:"error",fatal:"error"},ie={verbose:"DEFAULT",debug:"DEBUG",log:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},se=["x-api-key","x-api-token","x-key","x-token","cookie","password","pass","psw","auth","authentication","authorization","token","access_token","client-secret","credentials","secret"];class ce{constructor(t,n={}){this.module=t,n.logLevels&&(this.levels=new Set(n.logLevels))}levels=new Set(["verbose","debug","log","warn","error","fatal"]);mapLogLevelToConsoleMethod(t){return q[t]}write(t,n,s,_,N){if(!this.levels.has(t))return;const O=this.buildLog(t,n,s,_,N),D=oe(O,this.sensitiveReplacer),S=this.mapLogLevelToConsoleMethod(t);console[S](D)}buildLog(t,n,s,_,N){const{writeMetadata:O,writeContext:D,writeError:S}=this.sanitizeLog(s,_,N),b={};return typeof n=="string"&&(b.textPayload=n),!O&&typeof n!="string"&&!(n instanceof Error)&&(b.metadata=n),n instanceof Error&&(b.error=JSON.stringify(n,Object.getOwnPropertyNames(n))),D&&(b.context=D),O&&(b.metadata=O),!b.error&&S&&(b.error=JSON.stringify(S,Object.getOwnPropertyNames(S))),{severity:ie[t],module:this.module,textPayload:b.textPayload,message:b}}sanitizeLog(t,n,s){if(n instanceof Error&&(!s||typeof s=="string"))return{writeMetadata:void 0,writeContext:t||s,writeError:n};let _=n,N=t;return typeof _=="string"&&!t&&(N=_,_=void 0),{writeMetadata:_,writeContext:N,writeError:s}}sensitiveReplacer(t,n){return se.includes(t.toLowerCase())?"[HIDDEN BY LOGGER]":n}debug(t,n,s){this.write("debug",t,s,n)}verbose(t,n,s){this.write("verbose",t,s,n)}log(t,n,s){this.write("log",t,s,n)}warn(t,n,s,_){this.write("warn",t,_,n,s)}error(t,n,s,_){this.write("error",t,_,n,s)}fatal(t,n,s,_){this.write("fatal",t,_,n,s)}setLogLevels(t){this.levels=new Set(t)}}class ae{debug=()=>{};verbose=()=>{};log=()=>{};warn=()=>{};error=()=>{};fatal=()=>{};setLogLevels=()=>{}}class x{constructor(t){this.dataSource=t}em;static newInstance(t){const n=t.constructor;return new n(t.dataSource)}withEntityManager(t){return this.em=t,this}withRepositoryManager(t){return x.newInstance(this).withEntityManager(t.em)}lockInTransaction(t="pessimistic_write"){return this.em?{mode:t}:void 0}getRepository(t){return this.em?this.em.getRepository(t):this.dataSource.getRepository(t)}async withTransaction(t){let n;return await this.dataSource.transaction(async s=>{n=await t(x.newInstance(this).withEntityManager(s))}),n}}const ue=p=>({...p,withTransaction:async t=>await t(p),withRepositoryManager:()=>p}),fe=(p,t)=>`unaccent(LOWER(${p})) ILIKE unaccent(LOWER(:${t}))`,le=Object.freeze(Object.defineProperty({__proto__:null,unaccentSearch:fe},Symbol.toStringTag,{value:"Module"}));exports.GCPLogger=ce;exports.LogLevelToConsoleMethodMap=q;exports.MockLogger=ae;exports.TransactionalRepository=x;exports.buildTransactionalRepositoryMock=ue;exports.loadEnvConfig=te;exports.postgres=le;
|
package/dist/index.mjs
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import U from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import K from "path";
|
|
2
|
+
import { fileURLToPath as U } from "url";
|
|
3
|
+
import B from "fs";
|
|
4
|
+
import J from "os";
|
|
5
|
+
import q from "crypto";
|
|
6
|
+
function G(E) {
|
|
6
7
|
return E && E.__esModule && Object.prototype.hasOwnProperty.call(E, "default") ? E.default : E;
|
|
7
8
|
}
|
|
8
9
|
var T = { exports: {} };
|
|
9
|
-
const
|
|
10
|
-
version:
|
|
10
|
+
const z = "17.0.1", W = {
|
|
11
|
+
version: z
|
|
11
12
|
};
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
const E =
|
|
17
|
-
function
|
|
13
|
+
var j;
|
|
14
|
+
function k() {
|
|
15
|
+
if (j) return T.exports;
|
|
16
|
+
j = 1;
|
|
17
|
+
const E = B, t = K, n = J, s = q, N = W.version, O = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
18
|
+
function D(e) {
|
|
18
19
|
const a = {};
|
|
19
20
|
let d = e.toString();
|
|
20
21
|
d = d.replace(/\r\n?/mg, `
|
|
21
22
|
`);
|
|
22
23
|
let y;
|
|
23
24
|
for (; (y = O.exec(d)) != null; ) {
|
|
24
|
-
const
|
|
25
|
+
const _ = y[1];
|
|
25
26
|
let f = y[2] || "";
|
|
26
27
|
f = f.trim();
|
|
27
28
|
const o = f[0];
|
|
28
29
|
f = f.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), o === '"' && (f = f.replace(/\\n/g, `
|
|
29
|
-
`), f = f.replace(/\\r/g, "\r")), a[
|
|
30
|
+
`), f = f.replace(/\\r/g, "\r")), a[_] = f;
|
|
30
31
|
}
|
|
31
32
|
return a;
|
|
32
33
|
}
|
|
@@ -39,15 +40,15 @@ function W() {
|
|
|
39
40
|
const o = new Error(`MISSING_DATA: Cannot parse ${a} for an unknown reason`);
|
|
40
41
|
throw o.code = "MISSING_DATA", o;
|
|
41
42
|
}
|
|
42
|
-
const y = r(e).split(","),
|
|
43
|
+
const y = r(e).split(","), _ = y.length;
|
|
43
44
|
let f;
|
|
44
|
-
for (let o = 0; o <
|
|
45
|
+
for (let o = 0; o < _; o++)
|
|
45
46
|
try {
|
|
46
47
|
const w = y[o].trim(), I = u(d, w);
|
|
47
48
|
f = h.decrypt(I.ciphertext, I.key);
|
|
48
49
|
break;
|
|
49
50
|
} catch (w) {
|
|
50
|
-
if (o + 1 >=
|
|
51
|
+
if (o + 1 >= _)
|
|
51
52
|
throw w;
|
|
52
53
|
}
|
|
53
54
|
return h.parse(f);
|
|
@@ -80,12 +81,12 @@ function W() {
|
|
|
80
81
|
const w = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
81
82
|
throw w.code = "INVALID_DOTENV_KEY", w;
|
|
82
83
|
}
|
|
83
|
-
const
|
|
84
|
-
if (!
|
|
84
|
+
const _ = d.searchParams.get("environment");
|
|
85
|
+
if (!_) {
|
|
85
86
|
const w = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
86
87
|
throw w.code = "INVALID_DOTENV_KEY", w;
|
|
87
88
|
}
|
|
88
|
-
const f = `DOTENV_VAULT_${
|
|
89
|
+
const f = `DOTENV_VAULT_${_.toUpperCase()}`, o = e.parsed[f];
|
|
89
90
|
if (!o) {
|
|
90
91
|
const w = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${f} in your .env.vault file.`);
|
|
91
92
|
throw w.code = "NOT_FOUND_DOTENV_ENVIRONMENT", w;
|
|
@@ -111,13 +112,13 @@ function W() {
|
|
|
111
112
|
const a = !!(e && e.debug), d = !!(e && e.quiet);
|
|
112
113
|
(a || !d) && A("Loading env from encrypted .env.vault");
|
|
113
114
|
const y = h._parseVault(e);
|
|
114
|
-
let
|
|
115
|
-
return e && e.processEnv != null && (
|
|
115
|
+
let _ = process.env;
|
|
116
|
+
return e && e.processEnv != null && (_ = e.processEnv), h.populate(_, y, e), { parsed: y };
|
|
116
117
|
}
|
|
117
118
|
function v(e) {
|
|
118
119
|
const a = t.resolve(process.cwd(), ".env");
|
|
119
120
|
let d = "utf8";
|
|
120
|
-
const y = !!(e && e.debug),
|
|
121
|
+
const y = !!(e && e.debug), _ = !!(e && e.quiet);
|
|
121
122
|
e && e.encoding ? d = e.encoding : y && V("No encoding is specified. UTF-8 is used by default");
|
|
122
123
|
let f = [a];
|
|
123
124
|
if (e && e.path)
|
|
@@ -125,31 +126,31 @@ function W() {
|
|
|
125
126
|
f = [i(e.path)];
|
|
126
127
|
else {
|
|
127
128
|
f = [];
|
|
128
|
-
for (const
|
|
129
|
-
f.push(i(
|
|
129
|
+
for (const L of e.path)
|
|
130
|
+
f.push(i(L));
|
|
130
131
|
}
|
|
131
132
|
let o;
|
|
132
133
|
const w = {};
|
|
133
|
-
for (const
|
|
134
|
+
for (const L of f)
|
|
134
135
|
try {
|
|
135
|
-
const
|
|
136
|
-
h.populate(w,
|
|
137
|
-
} catch (
|
|
138
|
-
y && V(`Failed to load ${
|
|
136
|
+
const $ = h.parse(E.readFileSync(L, { encoding: d }));
|
|
137
|
+
h.populate(w, $, e);
|
|
138
|
+
} catch ($) {
|
|
139
|
+
y && V(`Failed to load ${L} ${$.message}`), o = $;
|
|
139
140
|
}
|
|
140
141
|
let I = process.env;
|
|
141
142
|
e && e.processEnv != null && (I = e.processEnv);
|
|
142
143
|
const M = h.populate(I, w, e);
|
|
143
|
-
if (y || !
|
|
144
|
-
const
|
|
145
|
-
for (const
|
|
144
|
+
if (y || !_) {
|
|
145
|
+
const L = Object.keys(M).length, $ = [];
|
|
146
|
+
for (const Y of f)
|
|
146
147
|
try {
|
|
147
|
-
const x = t.relative(process.cwd(),
|
|
148
|
-
|
|
148
|
+
const x = t.relative(process.cwd(), Y);
|
|
149
|
+
$.push(x);
|
|
149
150
|
} catch (x) {
|
|
150
|
-
y && V(`Failed to load ${
|
|
151
|
+
y && V(`Failed to load ${Y} ${x.message}`), o = x;
|
|
151
152
|
}
|
|
152
|
-
A(`injecting env (${
|
|
153
|
+
A(`injecting env (${L}) from ${$.join(",")} – [tip] encrypt with dotenvx: https://dotenvx.com`);
|
|
153
154
|
}
|
|
154
155
|
return o ? { parsed: w, error: o } : { parsed: w };
|
|
155
156
|
}
|
|
@@ -162,31 +163,31 @@ function W() {
|
|
|
162
163
|
function c(e, a) {
|
|
163
164
|
const d = Buffer.from(a.slice(-64), "hex");
|
|
164
165
|
let y = Buffer.from(e, "base64");
|
|
165
|
-
const
|
|
166
|
+
const _ = y.subarray(0, 12), f = y.subarray(-16);
|
|
166
167
|
y = y.subarray(12, -16);
|
|
167
168
|
try {
|
|
168
|
-
const o = s.createDecipheriv("aes-256-gcm", d,
|
|
169
|
+
const o = s.createDecipheriv("aes-256-gcm", d, _);
|
|
169
170
|
return o.setAuthTag(f), `${o.update(y)}${o.final()}`;
|
|
170
171
|
} catch (o) {
|
|
171
172
|
const w = o instanceof RangeError, I = o.message === "Invalid key length", M = o.message === "Unsupported state or unable to authenticate data";
|
|
172
173
|
if (w || I) {
|
|
173
|
-
const
|
|
174
|
-
throw
|
|
174
|
+
const L = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
175
|
+
throw L.code = "INVALID_DOTENV_KEY", L;
|
|
175
176
|
} else if (M) {
|
|
176
|
-
const
|
|
177
|
-
throw
|
|
177
|
+
const L = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
178
|
+
throw L.code = "DECRYPTION_FAILED", L;
|
|
178
179
|
} else
|
|
179
180
|
throw o;
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
-
const y = !!(d && d.debug),
|
|
183
|
+
function R(e, a, d = {}) {
|
|
184
|
+
const y = !!(d && d.debug), _ = !!(d && d.override), f = {};
|
|
184
185
|
if (typeof a != "object") {
|
|
185
186
|
const o = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
186
187
|
throw o.code = "OBJECT_REQUIRED", o;
|
|
187
188
|
}
|
|
188
189
|
for (const o of Object.keys(a))
|
|
189
|
-
Object.prototype.hasOwnProperty.call(e, o) ? (
|
|
190
|
+
Object.prototype.hasOwnProperty.call(e, o) ? (_ === !0 && (e[o] = a[o], f[o] = a[o]), y && V(_ === !0 ? `"${o}" is already defined and WAS overwritten` : `"${o}" is already defined and was NOT overwritten`)) : (e[o] = a[o], f[o] = a[o]);
|
|
190
191
|
return f;
|
|
191
192
|
}
|
|
192
193
|
const h = {
|
|
@@ -195,29 +196,29 @@ function W() {
|
|
|
195
196
|
_parseVault: S,
|
|
196
197
|
config: p,
|
|
197
198
|
decrypt: c,
|
|
198
|
-
parse:
|
|
199
|
-
populate:
|
|
199
|
+
parse: D,
|
|
200
|
+
populate: R
|
|
200
201
|
};
|
|
201
202
|
return T.exports.configDotenv = h.configDotenv, T.exports._configVault = h._configVault, T.exports._parseVault = h._parseVault, T.exports.config = h.config, T.exports.decrypt = h.decrypt, T.exports.parse = h.parse, T.exports.populate = h.populate, T.exports = h, T.exports;
|
|
202
203
|
}
|
|
203
|
-
var
|
|
204
|
-
const
|
|
205
|
-
const { env: t, configPath: n } = E, s =
|
|
206
|
-
return
|
|
204
|
+
var Q = k();
|
|
205
|
+
const H = U(import.meta.url), X = K.dirname(H), le = (E = {}) => {
|
|
206
|
+
const { env: t, configPath: n } = E, s = K.resolve(X, `${n ?? "."}/.env${t ? `.${t}` : ""}`), { parsed: m } = Q.config({ path: s });
|
|
207
|
+
return m;
|
|
207
208
|
};
|
|
208
|
-
var P,
|
|
209
|
-
function
|
|
210
|
-
if (
|
|
211
|
-
|
|
209
|
+
var P, F;
|
|
210
|
+
function Z() {
|
|
211
|
+
if (F) return P;
|
|
212
|
+
F = 1, P = N, N.default = N, N.stable = b, N.stableStringify = b;
|
|
212
213
|
var E = "[...]", t = "[Circular]", n = [], s = [];
|
|
213
|
-
function
|
|
214
|
+
function m() {
|
|
214
215
|
return {
|
|
215
216
|
depthLimit: Number.MAX_SAFE_INTEGER,
|
|
216
217
|
edgesLimit: Number.MAX_SAFE_INTEGER
|
|
217
218
|
};
|
|
218
219
|
}
|
|
219
220
|
function N(r, u, g, i) {
|
|
220
|
-
typeof i > "u" && (i =
|
|
221
|
+
typeof i > "u" && (i = m()), D(r, "", 0, [], void 0, 0, i);
|
|
221
222
|
var l;
|
|
222
223
|
try {
|
|
223
224
|
s.length === 0 ? l = JSON.stringify(r, u, g) : l = JSON.stringify(r, A(u), g);
|
|
@@ -235,7 +236,7 @@ function Q() {
|
|
|
235
236
|
var l = Object.getOwnPropertyDescriptor(i, g);
|
|
236
237
|
l.get !== void 0 ? l.configurable ? (Object.defineProperty(i, g, { value: r }), n.push([i, g, u, l])) : s.push([u, g, r]) : (i[g] = r, n.push([i, g, u]));
|
|
237
238
|
}
|
|
238
|
-
function
|
|
239
|
+
function D(r, u, g, i, l, v, p) {
|
|
239
240
|
v += 1;
|
|
240
241
|
var c;
|
|
241
242
|
if (typeof r == "object" && r !== null) {
|
|
@@ -254,12 +255,12 @@ function Q() {
|
|
|
254
255
|
}
|
|
255
256
|
if (i.push(r), Array.isArray(r))
|
|
256
257
|
for (c = 0; c < r.length; c++)
|
|
257
|
-
|
|
258
|
+
D(r[c], c, c, i, r, v, p);
|
|
258
259
|
else {
|
|
259
|
-
var
|
|
260
|
-
for (c = 0; c <
|
|
261
|
-
var h =
|
|
262
|
-
|
|
260
|
+
var R = Object.keys(r);
|
|
261
|
+
for (c = 0; c < R.length; c++) {
|
|
262
|
+
var h = R[c];
|
|
263
|
+
D(r[h], h, c, i, r, v, p);
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
266
|
i.pop();
|
|
@@ -269,7 +270,7 @@ function Q() {
|
|
|
269
270
|
return r < u ? -1 : r > u ? 1 : 0;
|
|
270
271
|
}
|
|
271
272
|
function b(r, u, g, i) {
|
|
272
|
-
typeof i > "u" && (i =
|
|
273
|
+
typeof i > "u" && (i = m());
|
|
273
274
|
var l = V(r, "", 0, [], void 0, 0, i) || r, v;
|
|
274
275
|
try {
|
|
275
276
|
s.length === 0 ? v = JSON.stringify(l, u, g) : v = JSON.stringify(l, A(u), g);
|
|
@@ -310,15 +311,15 @@ function Q() {
|
|
|
310
311
|
for (c = 0; c < r.length; c++)
|
|
311
312
|
V(r[c], c, c, i, r, v, p);
|
|
312
313
|
else {
|
|
313
|
-
var
|
|
314
|
+
var R = {}, h = Object.keys(r).sort(S);
|
|
314
315
|
for (c = 0; c < h.length; c++) {
|
|
315
316
|
var e = h[c];
|
|
316
|
-
V(r[e], e, c, i, r, v, p),
|
|
317
|
+
V(r[e], e, c, i, r, v, p), R[e] = r[e];
|
|
317
318
|
}
|
|
318
319
|
if (typeof l < "u")
|
|
319
|
-
n.push([l, u, r]), l[u] =
|
|
320
|
+
n.push([l, u, r]), l[u] = R;
|
|
320
321
|
else
|
|
321
|
-
return
|
|
322
|
+
return R;
|
|
322
323
|
}
|
|
323
324
|
i.pop();
|
|
324
325
|
}
|
|
@@ -340,22 +341,22 @@ function Q() {
|
|
|
340
341
|
}
|
|
341
342
|
return P;
|
|
342
343
|
}
|
|
343
|
-
var
|
|
344
|
-
const
|
|
344
|
+
var ee = Z();
|
|
345
|
+
const te = /* @__PURE__ */ G(ee), re = {
|
|
345
346
|
debug: "debug",
|
|
346
347
|
verbose: "debug",
|
|
347
348
|
log: "log",
|
|
348
349
|
warn: "warn",
|
|
349
350
|
error: "error",
|
|
350
351
|
fatal: "error"
|
|
351
|
-
},
|
|
352
|
+
}, ne = {
|
|
352
353
|
verbose: "DEFAULT",
|
|
353
354
|
debug: "DEBUG",
|
|
354
355
|
log: "INFO",
|
|
355
356
|
warn: "WARNING",
|
|
356
357
|
error: "ERROR",
|
|
357
358
|
fatal: "CRITICAL"
|
|
358
|
-
},
|
|
359
|
+
}, oe = [
|
|
359
360
|
"x-api-key",
|
|
360
361
|
"x-api-token",
|
|
361
362
|
"x-key",
|
|
@@ -373,24 +374,24 @@ const X = /* @__PURE__ */ J(H), Z = {
|
|
|
373
374
|
"credentials",
|
|
374
375
|
"secret"
|
|
375
376
|
];
|
|
376
|
-
class
|
|
377
|
+
class de {
|
|
377
378
|
constructor(t, n = {}) {
|
|
378
379
|
this.module = t, n.logLevels && (this.levels = new Set(n.logLevels));
|
|
379
380
|
}
|
|
380
381
|
levels = /* @__PURE__ */ new Set(["verbose", "debug", "log", "warn", "error", "fatal"]);
|
|
381
382
|
mapLogLevelToConsoleMethod(t) {
|
|
382
|
-
return
|
|
383
|
+
return re[t];
|
|
383
384
|
}
|
|
384
|
-
write(t, n, s,
|
|
385
|
+
write(t, n, s, m, N) {
|
|
385
386
|
if (!this.levels.has(t))
|
|
386
387
|
return;
|
|
387
|
-
const O = this.buildLog(t, n, s,
|
|
388
|
-
console[S](
|
|
388
|
+
const O = this.buildLog(t, n, s, m, N), D = te(O, this.sensitiveReplacer), S = this.mapLogLevelToConsoleMethod(t);
|
|
389
|
+
console[S](D);
|
|
389
390
|
}
|
|
390
|
-
buildLog(t, n, s,
|
|
391
|
-
const { writeMetadata: O, writeContext:
|
|
392
|
-
return typeof n == "string" && (b.textPayload = n), !O && typeof n != "string" && !(n instanceof Error) && (b.metadata = n), n instanceof Error && (b.error = JSON.stringify(n, Object.getOwnPropertyNames(n))),
|
|
393
|
-
severity:
|
|
391
|
+
buildLog(t, n, s, m, N) {
|
|
392
|
+
const { writeMetadata: O, writeContext: D, writeError: S } = this.sanitizeLog(s, m, N), b = {};
|
|
393
|
+
return typeof n == "string" && (b.textPayload = n), !O && typeof n != "string" && !(n instanceof Error) && (b.metadata = n), n instanceof Error && (b.error = JSON.stringify(n, Object.getOwnPropertyNames(n))), D && (b.context = D), O && (b.metadata = O), !b.error && S && (b.error = JSON.stringify(S, Object.getOwnPropertyNames(S))), {
|
|
394
|
+
severity: ne[t],
|
|
394
395
|
module: this.module,
|
|
395
396
|
textPayload: b.textPayload,
|
|
396
397
|
message: b
|
|
@@ -403,15 +404,15 @@ class ae {
|
|
|
403
404
|
writeContext: t || s,
|
|
404
405
|
writeError: n
|
|
405
406
|
};
|
|
406
|
-
let
|
|
407
|
-
return typeof
|
|
408
|
-
writeMetadata:
|
|
407
|
+
let m = n, N = t;
|
|
408
|
+
return typeof m == "string" && !t && (N = m, m = void 0), {
|
|
409
|
+
writeMetadata: m,
|
|
409
410
|
writeContext: N,
|
|
410
411
|
writeError: s
|
|
411
412
|
};
|
|
412
413
|
}
|
|
413
414
|
sensitiveReplacer(t, n) {
|
|
414
|
-
return
|
|
415
|
+
return oe.includes(t.toLowerCase()) ? "[HIDDEN BY LOGGER]" : n;
|
|
415
416
|
}
|
|
416
417
|
debug(t, n, s) {
|
|
417
418
|
this.write("debug", t, s, n);
|
|
@@ -422,20 +423,20 @@ class ae {
|
|
|
422
423
|
log(t, n, s) {
|
|
423
424
|
this.write("log", t, s, n);
|
|
424
425
|
}
|
|
425
|
-
warn(t, n, s,
|
|
426
|
-
this.write("warn", t,
|
|
426
|
+
warn(t, n, s, m) {
|
|
427
|
+
this.write("warn", t, m, n, s);
|
|
427
428
|
}
|
|
428
|
-
error(t, n, s,
|
|
429
|
-
this.write("error", t,
|
|
429
|
+
error(t, n, s, m) {
|
|
430
|
+
this.write("error", t, m, n, s);
|
|
430
431
|
}
|
|
431
|
-
fatal(t, n, s,
|
|
432
|
-
this.write("fatal", t,
|
|
432
|
+
fatal(t, n, s, m) {
|
|
433
|
+
this.write("fatal", t, m, n, s);
|
|
433
434
|
}
|
|
434
435
|
setLogLevels(t) {
|
|
435
436
|
this.levels = new Set(t);
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
|
-
class
|
|
439
|
+
class ge {
|
|
439
440
|
debug = () => {
|
|
440
441
|
};
|
|
441
442
|
verbose = () => {
|
|
@@ -485,20 +486,20 @@ class C {
|
|
|
485
486
|
}), n;
|
|
486
487
|
}
|
|
487
488
|
}
|
|
488
|
-
const
|
|
489
|
+
const he = (E) => ({
|
|
489
490
|
...E,
|
|
490
491
|
withTransaction: async (t) => await t(E),
|
|
491
492
|
withRepositoryManager: () => E
|
|
492
|
-
}),
|
|
493
|
+
}), ie = (E, t) => `unaccent(LOWER(${E})) ILIKE unaccent(LOWER(:${t}))`, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
493
494
|
__proto__: null,
|
|
494
|
-
unaccentSearch:
|
|
495
|
+
unaccentSearch: ie
|
|
495
496
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
496
497
|
export {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
de as GCPLogger,
|
|
499
|
+
re as LogLevelToConsoleMethodMap,
|
|
500
|
+
ge as MockLogger,
|
|
500
501
|
C as TransactionalRepository,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
he as buildTransactionalRepositoryMock,
|
|
503
|
+
le as loadEnvConfig,
|
|
504
|
+
ye as postgres
|
|
504
505
|
};
|