@jsfsi-core/ts-nodejs 1.0.11 → 1.0.15
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 +2 -2
- package/dist/index.mjs +81 -78
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("path"),W=require("url"),Q=require("fs"),H=require("os"),X=require("crypto");var U=typeof document<"u"?document.currentScript:null;function Z(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var S={exports:{}};const ee="17.2.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("path"),W=require("url"),Q=require("fs"),H=require("os"),X=require("crypto");var U=typeof document<"u"?document.currentScript:null;function Z(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var S={exports:{}};const ee="17.2.1",te={version:ee};var q;function re(){if(q)return S.exports;q=1;const h=Q,t=Y,n=H,c=X,N=te.version,O=["🔐 encrypt with Dotenvx: https://dotenvx.com","🔐 prevent committing .env to code: https://dotenvx.com/precommit","🔐 prevent building .env in docker: https://dotenvx.com/prebuild","📡 observe env with Radar: https://dotenvx.com/radar","📡 auto-backup env with Radar: https://dotenvx.com/radar","📡 version env with Radar: https://dotenvx.com/radar","🛠️ run anywhere with `dotenvx run -- yourcommand`","⚙️ specify custom .env file path with { path: '/custom/path/.env' }","⚙️ enable debug logging with { debug: true }","⚙️ override existing env vars with { override: true }","⚙️ suppress all logs with { quiet: true }","⚙️ write to custom object with { processEnv: myObject }","⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"];function I(){return O[Math.floor(Math.random()*O.length)]}function b(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function D(){return process.stdout.isTTY}function A(e){return D()?`\x1B[2m${e}\x1B[0m`:e}const M=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function r(e){const a={};let l=e.toString();l=l.replace(/\r\n?/mg,`
|
|
2
2
|
`);let d;for(;(d=M.exec(l))!=null;){const E=d[1];let g=d[2]||"";g=g.trim();const o=g[0];g=g.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(g=g.replace(/\\n/g,`
|
|
3
|
-
`),g=g.replace(/\\r/g,"\r")),a[E]=g}return a}function u(e){e=e||{};const a=s(e);e.path=a;const l=m.configDotenv(e);if(!l.parsed){const o=new Error(`MISSING_DATA: Cannot parse ${a} for an unknown reason`);throw o.code="MISSING_DATA",o}const d=y(e).split(","),E=d.length;let g;for(let o=0;o<E;o++)try{const w=d[o].trim(),D=v(l,w);g=m.decrypt(D.ciphertext,D.key);break}catch(w){if(o+1>=E)throw w}return m.parse(g)}function p(e){console.error(`[dotenv@${N}][WARN] ${e}`)}function i(e){console.log(`[dotenv@${N}][DEBUG] ${e}`)}function f(e){console.log(`[dotenv@${N}] ${e}`)}function y(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 v(e,a){let l;try{l=new URL(a)}catch(w){if(w.code==="ERR_INVALID_URL"){const D=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 D.code="INVALID_DOTENV_KEY",D}throw w}const d=l.password;if(!d){const w=new Error("INVALID_DOTENV_KEY: Missing key part");throw w.code="INVALID_DOTENV_KEY",w}const E=l.searchParams.get("environment");if(!E){const w=new Error("INVALID_DOTENV_KEY: Missing environment part");throw w.code="INVALID_DOTENV_KEY",w}const g=`DOTENV_VAULT_${E.toUpperCase()}`,o=e.parsed[g];if(!o){const w=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${g} in your .env.vault file.`);throw w.code="NOT_FOUND_DOTENV_ENVIRONMENT",w}return{ciphertext:o,key:d}}function s(e){let a=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const l of e.path)h.existsSync(l)&&(a=l.endsWith(".vault")?l:`${l}.vault`);else a=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else a=t.resolve(process.cwd(),".env.vault");return h.existsSync(a)?a:null}function R(e){return e[0]==="~"?t.join(n.homedir(),e.slice(1)):e}function V(e){const a=b(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),l=b(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(a||!l)&&f("Loading env from encrypted .env.vault");const d=m._parseVault(e);let E=process.env;return e&&e.processEnv!=null&&(E=e.processEnv),m.populate(E,d,e),{parsed:d}}function x(e){const a=t.resolve(process.cwd(),".env");let l="utf8",d=process.env;e&&e.processEnv!=null&&(d=e.processEnv);let E=b(d.DOTENV_CONFIG_DEBUG||e&&e.debug),g=b(d.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?l=e.encoding:E&&i("No encoding is specified. UTF-8 is used by default");let o=[a];if(e&&e.path)if(!Array.isArray(e.path))o=[R(e.path)];else{o=[];for(const L of e.path)o.push(R(L))}let w;const D={};for(const L of o)try{const $=m.parse(h.readFileSync(L,{encoding:l}));m.populate(D,$,e)}catch($){E&&i(`Failed to load ${L} ${$.message}`),w=$}const F=m.populate(d,D,e);if(E=b(d.DOTENV_CONFIG_DEBUG||E),g=b(d.DOTENV_CONFIG_QUIET||g),E||!g){const L=Object.keys(F).length,$=[];for(const K of o)try{const C=t.relative(process.cwd(),K);$.push(C)}catch(C){E&&i(`Failed to load ${K} ${C.message}`),w=C}f(`injecting env (${L}) from ${$.join(",")} ${A(`(tip: ${I()})`)}`)}return w?{parsed:D,error:w}:{parsed:D}}function G(e){if(y(e).length===0)return m.configDotenv(e);const a=s(e);return a?m._configVault(e):(p(`You set DOTENV_KEY but you are missing a .env.vault file at ${a}. Did you forget to build it?`),m.configDotenv(e))}function k(e,a){const l=Buffer.from(a.slice(-64),"hex");let d=Buffer.from(e,"base64");const E=d.subarray(0,12),g=d.subarray(-16);d=d.subarray(12,-16);try{const o=c.createDecipheriv("aes-256-gcm",l,E);return o.setAuthTag(g),`${o.update(d)}${o.final()}`}catch(o){const w=o instanceof RangeError,D=o.message==="Invalid key length",F=o.message==="Unsupported state or unable to authenticate data";if(w||D){const L=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw L.code="INVALID_DOTENV_KEY",L}else if(F){const L=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw L.code="DECRYPTION_FAILED",L}else throw o}}function z(e,a,l={}){const d=!!(l&&l.debug),E=!!(l&&l.override),g={};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)?(E===!0&&(e[o]=a[o],g[o]=a[o]),d&&i(E===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):(e[o]=a[o],g[o]=a[o]);return g}const m={configDotenv:x,_configVault:V,_parseVault:u,config:G,decrypt:k,parse:r,populate:z};return S.exports.configDotenv=m.configDotenv,S.exports._configVault=m._configVault,S.exports._parseVault=m._parseVault,S.exports.config=m.config,S.exports.decrypt=m.decrypt,S.exports.parse=m.parse,S.exports.populate=m.populate,S.exports=m,S.exports}var ne=re();const oe=W.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:U&&U.tagName.toUpperCase()==="SCRIPT"&&U.src||new URL("index.cjs",document.baseURI).href),ie=Y.dirname(oe),se=(h={})=>{const{env:t,configPath:n}=h,c=Y.resolve(ie,`${n??"."}/.env${t?`.${t}`:""}`),{parsed:_}=ne.config({path:c});return _};var j,B;function ce(){if(B)return j;B=1,j=N,N.default=N,N.stable=T,N.stableStringify=T;var h="[...]",t="[Circular]",n=[],c=[];function _(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N(r,u,p,i){typeof i>"u"&&(i=_()),I(r,"",0,[],void 0,0,i);var f;try{c.length===0?f=JSON.stringify(r,u,p):f=JSON.stringify(r,M(u),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var y=n.pop();y.length===4?Object.defineProperty(y[0],y[1],y[3]):y[0][y[1]]=y[2]}}return f}function O(r,u,p,i){var f=Object.getOwnPropertyDescriptor(i,p);f.get!==void 0?f.configurable?(Object.defineProperty(i,p,{value:r}),n.push([i,p,u,f])):c.push([u,p,r]):(i[p]=r,n.push([i,p,u]))}function I(r,u,p,i,f,y,v){y+=1;var s;if(typeof r=="object"&&r!==null){for(s=0;s<i.length;s++)if(i[s]===r){O(t,r,u,f);return}if(typeof v.depthLimit<"u"&&y>v.depthLimit){O(h,r,u,f);return}if(typeof v.edgesLimit<"u"&&p+1>v.edgesLimit){O(h,r,u,f);return}if(i.push(r),Array.isArray(r))for(s=0;s<r.length;s++)I(r[s],s,s,i,r,y,v);else{var R=Object.keys(r);for(s=0;s<R.length;s++){var V=R[s];I(r[V],V,s,i,r,y,v)}}i.pop()}}function b(r,u){return r<u?-1:r>u?1:0}function T(r,u,p,i){typeof i>"u"&&(i=_());var f=A(r,"",0,[],void 0,0,i)||r,y;try{c.length===0?y=JSON.stringify(f,u,p):y=JSON.stringify(f,M(u),p)}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 y}function A(r,u,p,i,f,y,v){y+=1;var s;if(typeof r=="object"&&r!==null){for(s=0;s<i.length;s++)if(i[s]===r){O(t,r,u,f);return}try{if(typeof r.toJSON=="function")return}catch{return}if(typeof v.depthLimit<"u"&&y>v.depthLimit){O(h,r,u,f);return}if(typeof v.edgesLimit<"u"&&p+1>v.edgesLimit){O(h,r,u,f);return}if(i.push(r),Array.isArray(r))for(s=0;s<r.length;s++)A(r[s],s,s,i,r,y,v);else{var R={},V=Object.keys(r).sort(b);for(s=0;s<V.length;s++){var x=V[s];A(r[x],x,s,i,r,y,v),R[x]=r[x]}if(typeof f<"u")n.push([f,u,r]),f[u]=R;else return R}i.pop()}}function M(r){return r=typeof r<"u"?r:function(u,p){return p},function(u,p){if(c.length>0)for(var i=0;i<c.length;i++){var f=c[i];if(f[1]===u&&f[0]===p){p=f[2],c.splice(i,1);break}}return r.call(this,u,p)}}return j}var ae=ce();const ue=Z(ae),J={debug:"debug",verbose:"debug",log:"log",warn:"warn",error:"error",fatal:"error"},fe={verbose:"DEFAULT",debug:"DEBUG",log:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},le=["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 de{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 J[t]}write(t,n,c,_,N){if(!this.levels.has(t))return;const O=this.buildLog(t,n,c,_,N),I=ue(O,this.sensitiveReplacer),b=this.mapLogLevelToConsoleMethod(t);console[b](I)}buildLog(t,n,c,_,N){const{writeMetadata:O,writeContext:I,writeError:b}=this.sanitizeLog(c,_,N),T={};return typeof n=="string"&&(T.textPayload=n),!O&&typeof n!="string"&&!(n instanceof Error)&&(T.metadata=n),n instanceof Error&&(T.error=JSON.stringify(n,Object.getOwnPropertyNames(n))),I&&(T.context=I),O&&(T.metadata=O),!T.error&&b&&(T.error=JSON.stringify(b,Object.getOwnPropertyNames(b))),{severity:fe[t],module:this.module,textPayload:T.textPayload,message:T}}sanitizeLog(t,n,c){if(n instanceof Error&&(!c||typeof c=="string"))return{writeMetadata:void 0,writeContext:t||c,writeError:n};let _=n,N=t;return typeof _=="string"&&!t&&(N=_,_=void 0),{writeMetadata:_,writeContext:N,writeError:c}}sensitiveReplacer(t,n){return le.includes(t.toLowerCase())?"[HIDDEN BY LOGGER]":n}debug(t,n,c){this.write("debug",t,c,n)}verbose(t,n,c){this.write("verbose",t,c,n)}log(t,n,c){this.write("log",t,c,n)}warn(t,n,c,_){this.write("warn",t,_,n,c)}error(t,n,c,_){this.write("error",t,_,n,c)}fatal(t,n,c,_){this.write("fatal",t,_,n,c)}setLogLevels(t){this.levels=new Set(t)}}class ge{debug=()=>{};verbose=()=>{};log=()=>{};warn=()=>{};error=()=>{};fatal=()=>{};setLogLevels=()=>{}}class P{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 P.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 c=>{n=await t(P.newInstance(this).withEntityManager(c))}),n}}const he=h=>({...h,withTransaction:async t=>await t(h),withRepositoryManager:()=>h}),pe=(h,t)=>`unaccent(LOWER(${h})) ILIKE unaccent(LOWER(:${t}))`,ye=Object.freeze(Object.defineProperty({__proto__:null,unaccentSearch:pe},Symbol.toStringTag,{value:"Module"}));exports.GCPLogger=de;exports.LogLevelToConsoleMethodMap=J;exports.MockLogger=ge;exports.TransactionalRepository=P;exports.buildTransactionalRepositoryMock=he;exports.loadEnvConfig=se;exports.postgres=ye;
|
|
3
|
+
`),g=g.replace(/\\r/g,"\r")),a[E]=g}return a}function u(e){e=e||{};const a=s(e);e.path=a;const l=_.configDotenv(e);if(!l.parsed){const o=new Error(`MISSING_DATA: Cannot parse ${a} for an unknown reason`);throw o.code="MISSING_DATA",o}const d=y(e).split(","),E=d.length;let g;for(let o=0;o<E;o++)try{const w=d[o].trim(),T=v(l,w);g=_.decrypt(T.ciphertext,T.key);break}catch(w){if(o+1>=E)throw w}return _.parse(g)}function p(e){console.error(`[dotenv@${N}][WARN] ${e}`)}function i(e){console.log(`[dotenv@${N}][DEBUG] ${e}`)}function f(e){console.log(`[dotenv@${N}] ${e}`)}function y(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 v(e,a){let l;try{l=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 d=l.password;if(!d){const w=new Error("INVALID_DOTENV_KEY: Missing key part");throw w.code="INVALID_DOTENV_KEY",w}const E=l.searchParams.get("environment");if(!E){const w=new Error("INVALID_DOTENV_KEY: Missing environment part");throw w.code="INVALID_DOTENV_KEY",w}const g=`DOTENV_VAULT_${E.toUpperCase()}`,o=e.parsed[g];if(!o){const w=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${g} in your .env.vault file.`);throw w.code="NOT_FOUND_DOTENV_ENVIRONMENT",w}return{ciphertext:o,key:d}}function s(e){let a=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const l of e.path)h.existsSync(l)&&(a=l.endsWith(".vault")?l:`${l}.vault`);else a=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else a=t.resolve(process.cwd(),".env.vault");return h.existsSync(a)?a:null}function R(e){return e[0]==="~"?t.join(n.homedir(),e.slice(1)):e}function V(e){const a=b(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),l=b(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(a||!l)&&f("Loading env from encrypted .env.vault");const d=_._parseVault(e);let E=process.env;return e&&e.processEnv!=null&&(E=e.processEnv),_.populate(E,d,e),{parsed:d}}function x(e){const a=t.resolve(process.cwd(),".env");let l="utf8",d=process.env;e&&e.processEnv!=null&&(d=e.processEnv);let E=b(d.DOTENV_CONFIG_DEBUG||e&&e.debug),g=b(d.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?l=e.encoding:E&&i("No encoding is specified. UTF-8 is used by default");let o=[a];if(e&&e.path)if(!Array.isArray(e.path))o=[R(e.path)];else{o=[];for(const L of e.path)o.push(R(L))}let w;const T={};for(const L of o)try{const $=_.parse(h.readFileSync(L,{encoding:l}));_.populate(T,$,e)}catch($){E&&i(`Failed to load ${L} ${$.message}`),w=$}const F=_.populate(d,T,e);if(E=b(d.DOTENV_CONFIG_DEBUG||E),g=b(d.DOTENV_CONFIG_QUIET||g),E||!g){const L=Object.keys(F).length,$=[];for(const K of o)try{const C=t.relative(process.cwd(),K);$.push(C)}catch(C){E&&i(`Failed to load ${K} ${C.message}`),w=C}f(`injecting env (${L}) from ${$.join(",")} ${A(`-- tip: ${I()}`)}`)}return w?{parsed:T,error:w}:{parsed:T}}function G(e){if(y(e).length===0)return _.configDotenv(e);const a=s(e);return a?_._configVault(e):(p(`You set DOTENV_KEY but you are missing a .env.vault file at ${a}. Did you forget to build it?`),_.configDotenv(e))}function k(e,a){const l=Buffer.from(a.slice(-64),"hex");let d=Buffer.from(e,"base64");const E=d.subarray(0,12),g=d.subarray(-16);d=d.subarray(12,-16);try{const o=c.createDecipheriv("aes-256-gcm",l,E);return o.setAuthTag(g),`${o.update(d)}${o.final()}`}catch(o){const w=o instanceof RangeError,T=o.message==="Invalid key length",F=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(F){const L=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw L.code="DECRYPTION_FAILED",L}else throw o}}function z(e,a,l={}){const d=!!(l&&l.debug),E=!!(l&&l.override),g={};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)?(E===!0&&(e[o]=a[o],g[o]=a[o]),d&&i(E===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):(e[o]=a[o],g[o]=a[o]);return g}const _={configDotenv:x,_configVault:V,_parseVault:u,config:G,decrypt:k,parse:r,populate:z};return S.exports.configDotenv=_.configDotenv,S.exports._configVault=_._configVault,S.exports._parseVault=_._parseVault,S.exports.config=_.config,S.exports.decrypt=_.decrypt,S.exports.parse=_.parse,S.exports.populate=_.populate,S.exports=_,S.exports}var ne=re();const oe=W.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:U&&U.tagName.toUpperCase()==="SCRIPT"&&U.src||new URL("index.cjs",document.baseURI).href),ie=Y.dirname(oe),se=(h={})=>{const{env:t,configPath:n}=h,c=Y.resolve(ie,`${n??"."}/.env${t?`.${t}`:""}`),{parsed:m}=ne.config({path:c});return m};var j,B;function ce(){if(B)return j;B=1,j=N,N.default=N,N.stable=D,N.stableStringify=D;var h="[...]",t="[Circular]",n=[],c=[];function m(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N(r,u,p,i){typeof i>"u"&&(i=m()),I(r,"",0,[],void 0,0,i);var f;try{c.length===0?f=JSON.stringify(r,u,p):f=JSON.stringify(r,M(u),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var y=n.pop();y.length===4?Object.defineProperty(y[0],y[1],y[3]):y[0][y[1]]=y[2]}}return f}function O(r,u,p,i){var f=Object.getOwnPropertyDescriptor(i,p);f.get!==void 0?f.configurable?(Object.defineProperty(i,p,{value:r}),n.push([i,p,u,f])):c.push([u,p,r]):(i[p]=r,n.push([i,p,u]))}function I(r,u,p,i,f,y,v){y+=1;var s;if(typeof r=="object"&&r!==null){for(s=0;s<i.length;s++)if(i[s]===r){O(t,r,u,f);return}if(typeof v.depthLimit<"u"&&y>v.depthLimit){O(h,r,u,f);return}if(typeof v.edgesLimit<"u"&&p+1>v.edgesLimit){O(h,r,u,f);return}if(i.push(r),Array.isArray(r))for(s=0;s<r.length;s++)I(r[s],s,s,i,r,y,v);else{var R=Object.keys(r);for(s=0;s<R.length;s++){var V=R[s];I(r[V],V,s,i,r,y,v)}}i.pop()}}function b(r,u){return r<u?-1:r>u?1:0}function D(r,u,p,i){typeof i>"u"&&(i=m());var f=A(r,"",0,[],void 0,0,i)||r,y;try{c.length===0?y=JSON.stringify(f,u,p):y=JSON.stringify(f,M(u),p)}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 y}function A(r,u,p,i,f,y,v){y+=1;var s;if(typeof r=="object"&&r!==null){for(s=0;s<i.length;s++)if(i[s]===r){O(t,r,u,f);return}try{if(typeof r.toJSON=="function")return}catch{return}if(typeof v.depthLimit<"u"&&y>v.depthLimit){O(h,r,u,f);return}if(typeof v.edgesLimit<"u"&&p+1>v.edgesLimit){O(h,r,u,f);return}if(i.push(r),Array.isArray(r))for(s=0;s<r.length;s++)A(r[s],s,s,i,r,y,v);else{var R={},V=Object.keys(r).sort(b);for(s=0;s<V.length;s++){var x=V[s];A(r[x],x,s,i,r,y,v),R[x]=r[x]}if(typeof f<"u")n.push([f,u,r]),f[u]=R;else return R}i.pop()}}function M(r){return r=typeof r<"u"?r:function(u,p){return p},function(u,p){if(c.length>0)for(var i=0;i<c.length;i++){var f=c[i];if(f[1]===u&&f[0]===p){p=f[2],c.splice(i,1);break}}return r.call(this,u,p)}}return j}var ae=ce();const ue=Z(ae),J={debug:"debug",verbose:"debug",log:"log",warn:"warn",error:"error",fatal:"error"},fe={verbose:"DEFAULT",debug:"DEBUG",log:"INFO",warn:"WARNING",error:"ERROR",fatal:"CRITICAL"},le=["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 de{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 J[t]}write(t,n,c,m,N){if(!this.levels.has(t))return;const O=this.buildLog(t,n,c,m,N),I=ue(O,this.sensitiveReplacer),b=this.mapLogLevelToConsoleMethod(t);console[b](I)}buildLog(t,n,c,m,N){const{writeMetadata:O,writeContext:I,writeError:b}=this.sanitizeLog(c,m,N),D={};return typeof n=="string"&&(D.textPayload=n),!O&&typeof n!="string"&&!(n instanceof Error)&&(D.metadata=n),n instanceof Error&&(D.error=JSON.stringify(n,Object.getOwnPropertyNames(n))),I&&(D.context=I),O&&(D.metadata=O),!D.error&&b&&(D.error=JSON.stringify(b,Object.getOwnPropertyNames(b))),{severity:fe[t],module:this.module,textPayload:D.textPayload,message:D}}sanitizeLog(t,n,c){if(n instanceof Error&&(!c||typeof c=="string"))return{writeMetadata:void 0,writeContext:t||c,writeError:n};let m=n,N=t;return typeof m=="string"&&!t&&(N=m,m=void 0),{writeMetadata:m,writeContext:N,writeError:c}}sensitiveReplacer(t,n){return le.includes(t.toLowerCase())?"[HIDDEN BY LOGGER]":n}debug(t,n,c){this.write("debug",t,c,n)}verbose(t,n,c){this.write("verbose",t,c,n)}log(t,n,c){this.write("log",t,c,n)}warn(t,n,c,m){this.write("warn",t,m,n,c)}error(t,n,c,m){this.write("error",t,m,n,c)}fatal(t,n,c,m){this.write("fatal",t,m,n,c)}setLogLevels(t){this.levels=new Set(t)}}class ge{debug=()=>{};verbose=()=>{};log=()=>{};warn=()=>{};error=()=>{};fatal=()=>{};setLogLevels=()=>{}}class P{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 P.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 c=>{n=await t(P.newInstance(this).withEntityManager(c))}),n}}const he=h=>({...h,withTransaction:async t=>await t(h),withRepositoryManager:()=>h}),pe=(h,t)=>`unaccent(LOWER(${h})) ILIKE unaccent(LOWER(:${t}))`,ye=Object.freeze(Object.defineProperty({__proto__:null,unaccentSearch:pe},Symbol.toStringTag,{value:"Module"}));exports.GCPLogger=de;exports.LogLevelToConsoleMethodMap=J;exports.MockLogger=ge;exports.TransactionalRepository=P;exports.buildTransactionalRepositoryMock=he;exports.loadEnvConfig=se;exports.postgres=ye;
|
package/dist/index.mjs
CHANGED
|
@@ -3,21 +3,24 @@ import { fileURLToPath as k } from "url";
|
|
|
3
3
|
import z from "fs";
|
|
4
4
|
import W from "os";
|
|
5
5
|
import Q from "crypto";
|
|
6
|
-
function H(
|
|
7
|
-
return
|
|
6
|
+
function H(g) {
|
|
7
|
+
return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g;
|
|
8
8
|
}
|
|
9
9
|
var S = { exports: {} };
|
|
10
|
-
const X = "17.2.
|
|
10
|
+
const X = "17.2.1", Z = {
|
|
11
11
|
version: X
|
|
12
12
|
};
|
|
13
13
|
var G;
|
|
14
14
|
function ee() {
|
|
15
15
|
if (G) return S.exports;
|
|
16
16
|
G = 1;
|
|
17
|
-
const
|
|
18
|
-
"🔐 encrypt with
|
|
17
|
+
const g = z, t = j, n = W, c = Q, N = Z.version, O = [
|
|
18
|
+
"🔐 encrypt with Dotenvx: https://dotenvx.com",
|
|
19
19
|
"🔐 prevent committing .env to code: https://dotenvx.com/precommit",
|
|
20
20
|
"🔐 prevent building .env in docker: https://dotenvx.com/prebuild",
|
|
21
|
+
"📡 observe env with Radar: https://dotenvx.com/radar",
|
|
22
|
+
"📡 auto-backup env with Radar: https://dotenvx.com/radar",
|
|
23
|
+
"📡 version env with Radar: https://dotenvx.com/radar",
|
|
21
24
|
"🛠️ run anywhere with `dotenvx run -- yourcommand`",
|
|
22
25
|
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
|
23
26
|
"⚙️ enable debug logging with { debug: true }",
|
|
@@ -46,12 +49,12 @@ function ee() {
|
|
|
46
49
|
`);
|
|
47
50
|
let d;
|
|
48
51
|
for (; (d = M.exec(l)) != null; ) {
|
|
49
|
-
const
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
const o =
|
|
53
|
-
|
|
54
|
-
`),
|
|
52
|
+
const E = d[1];
|
|
53
|
+
let h = d[2] || "";
|
|
54
|
+
h = h.trim();
|
|
55
|
+
const o = h[0];
|
|
56
|
+
h = h.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), o === '"' && (h = h.replace(/\\n/g, `
|
|
57
|
+
`), h = h.replace(/\\r/g, "\r")), a[E] = h;
|
|
55
58
|
}
|
|
56
59
|
return a;
|
|
57
60
|
}
|
|
@@ -64,18 +67,18 @@ function ee() {
|
|
|
64
67
|
const o = new Error(`MISSING_DATA: Cannot parse ${a} for an unknown reason`);
|
|
65
68
|
throw o.code = "MISSING_DATA", o;
|
|
66
69
|
}
|
|
67
|
-
const d = y(e).split(","),
|
|
68
|
-
let
|
|
69
|
-
for (let o = 0; o <
|
|
70
|
+
const d = y(e).split(","), E = d.length;
|
|
71
|
+
let h;
|
|
72
|
+
for (let o = 0; o < E; o++)
|
|
70
73
|
try {
|
|
71
|
-
const m = d[o].trim(), T =
|
|
72
|
-
|
|
74
|
+
const m = d[o].trim(), T = v(l, m);
|
|
75
|
+
h = _.decrypt(T.ciphertext, T.key);
|
|
73
76
|
break;
|
|
74
77
|
} catch (m) {
|
|
75
|
-
if (o + 1 >=
|
|
78
|
+
if (o + 1 >= E)
|
|
76
79
|
throw m;
|
|
77
80
|
}
|
|
78
|
-
return _.parse(
|
|
81
|
+
return _.parse(h);
|
|
79
82
|
}
|
|
80
83
|
function p(e) {
|
|
81
84
|
console.error(`[dotenv@${N}][WARN] ${e}`);
|
|
@@ -89,7 +92,7 @@ function ee() {
|
|
|
89
92
|
function y(e) {
|
|
90
93
|
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 : "";
|
|
91
94
|
}
|
|
92
|
-
function
|
|
95
|
+
function v(e, a) {
|
|
93
96
|
let l;
|
|
94
97
|
try {
|
|
95
98
|
l = new URL(a);
|
|
@@ -105,14 +108,14 @@ function ee() {
|
|
|
105
108
|
const m = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
106
109
|
throw m.code = "INVALID_DOTENV_KEY", m;
|
|
107
110
|
}
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
111
|
+
const E = l.searchParams.get("environment");
|
|
112
|
+
if (!E) {
|
|
110
113
|
const m = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
111
114
|
throw m.code = "INVALID_DOTENV_KEY", m;
|
|
112
115
|
}
|
|
113
|
-
const
|
|
116
|
+
const h = `DOTENV_VAULT_${E.toUpperCase()}`, o = e.parsed[h];
|
|
114
117
|
if (!o) {
|
|
115
|
-
const m = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${
|
|
118
|
+
const m = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${h} in your .env.vault file.`);
|
|
116
119
|
throw m.code = "NOT_FOUND_DOTENV_ENVIRONMENT", m;
|
|
117
120
|
}
|
|
118
121
|
return { ciphertext: o, key: d };
|
|
@@ -122,29 +125,29 @@ function ee() {
|
|
|
122
125
|
if (e && e.path && e.path.length > 0)
|
|
123
126
|
if (Array.isArray(e.path))
|
|
124
127
|
for (const l of e.path)
|
|
125
|
-
|
|
128
|
+
g.existsSync(l) && (a = l.endsWith(".vault") ? l : `${l}.vault`);
|
|
126
129
|
else
|
|
127
130
|
a = e.path.endsWith(".vault") ? e.path : `${e.path}.vault`;
|
|
128
131
|
else
|
|
129
132
|
a = t.resolve(process.cwd(), ".env.vault");
|
|
130
|
-
return
|
|
133
|
+
return g.existsSync(a) ? a : null;
|
|
131
134
|
}
|
|
132
135
|
function V(e) {
|
|
133
136
|
return e[0] === "~" ? t.join(n.homedir(), e.slice(1)) : e;
|
|
134
137
|
}
|
|
135
|
-
function
|
|
138
|
+
function R(e) {
|
|
136
139
|
const a = b(process.env.DOTENV_CONFIG_DEBUG || e && e.debug), l = b(process.env.DOTENV_CONFIG_QUIET || e && e.quiet);
|
|
137
140
|
(a || !l) && f("Loading env from encrypted .env.vault");
|
|
138
141
|
const d = _._parseVault(e);
|
|
139
|
-
let
|
|
140
|
-
return e && e.processEnv != null && (
|
|
142
|
+
let E = process.env;
|
|
143
|
+
return e && e.processEnv != null && (E = e.processEnv), _.populate(E, d, e), { parsed: d };
|
|
141
144
|
}
|
|
142
145
|
function x(e) {
|
|
143
146
|
const a = t.resolve(process.cwd(), ".env");
|
|
144
147
|
let l = "utf8", d = process.env;
|
|
145
148
|
e && e.processEnv != null && (d = e.processEnv);
|
|
146
|
-
let
|
|
147
|
-
e && e.encoding ? l = e.encoding :
|
|
149
|
+
let E = b(d.DOTENV_CONFIG_DEBUG || e && e.debug), h = b(d.DOTENV_CONFIG_QUIET || e && e.quiet);
|
|
150
|
+
e && e.encoding ? l = e.encoding : E && i("No encoding is specified. UTF-8 is used by default");
|
|
148
151
|
let o = [a];
|
|
149
152
|
if (e && e.path)
|
|
150
153
|
if (!Array.isArray(e.path))
|
|
@@ -158,22 +161,22 @@ function ee() {
|
|
|
158
161
|
const T = {};
|
|
159
162
|
for (const I of o)
|
|
160
163
|
try {
|
|
161
|
-
const
|
|
162
|
-
_.populate(T,
|
|
163
|
-
} catch (
|
|
164
|
-
|
|
164
|
+
const $ = _.parse(g.readFileSync(I, { encoding: l }));
|
|
165
|
+
_.populate(T, $, e);
|
|
166
|
+
} catch ($) {
|
|
167
|
+
E && i(`Failed to load ${I} ${$.message}`), m = $;
|
|
165
168
|
}
|
|
166
169
|
const P = _.populate(d, T, e);
|
|
167
|
-
if (
|
|
168
|
-
const I = Object.keys(P).length,
|
|
170
|
+
if (E = b(d.DOTENV_CONFIG_DEBUG || E), h = b(d.DOTENV_CONFIG_QUIET || h), E || !h) {
|
|
171
|
+
const I = Object.keys(P).length, $ = [];
|
|
169
172
|
for (const U of o)
|
|
170
173
|
try {
|
|
171
174
|
const C = t.relative(process.cwd(), U);
|
|
172
|
-
|
|
175
|
+
$.push(C);
|
|
173
176
|
} catch (C) {
|
|
174
|
-
|
|
177
|
+
E && i(`Failed to load ${U} ${C.message}`), m = C;
|
|
175
178
|
}
|
|
176
|
-
f(`injecting env (${I}) from ${
|
|
179
|
+
f(`injecting env (${I}) from ${$.join(",")} ${A(`-- tip: ${L()}`)}`);
|
|
177
180
|
}
|
|
178
181
|
return m ? { parsed: T, error: m } : { parsed: T };
|
|
179
182
|
}
|
|
@@ -186,11 +189,11 @@ function ee() {
|
|
|
186
189
|
function q(e, a) {
|
|
187
190
|
const l = Buffer.from(a.slice(-64), "hex");
|
|
188
191
|
let d = Buffer.from(e, "base64");
|
|
189
|
-
const
|
|
192
|
+
const E = d.subarray(0, 12), h = d.subarray(-16);
|
|
190
193
|
d = d.subarray(12, -16);
|
|
191
194
|
try {
|
|
192
|
-
const o = c.createDecipheriv("aes-256-gcm", l,
|
|
193
|
-
return o.setAuthTag(
|
|
195
|
+
const o = c.createDecipheriv("aes-256-gcm", l, E);
|
|
196
|
+
return o.setAuthTag(h), `${o.update(d)}${o.final()}`;
|
|
194
197
|
} catch (o) {
|
|
195
198
|
const m = o instanceof RangeError, T = o.message === "Invalid key length", P = o.message === "Unsupported state or unable to authenticate data";
|
|
196
199
|
if (m || T) {
|
|
@@ -204,18 +207,18 @@ function ee() {
|
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
209
|
function J(e, a, l = {}) {
|
|
207
|
-
const d = !!(l && l.debug),
|
|
210
|
+
const d = !!(l && l.debug), E = !!(l && l.override), h = {};
|
|
208
211
|
if (typeof a != "object") {
|
|
209
212
|
const o = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
210
213
|
throw o.code = "OBJECT_REQUIRED", o;
|
|
211
214
|
}
|
|
212
215
|
for (const o of Object.keys(a))
|
|
213
|
-
Object.prototype.hasOwnProperty.call(e, o) ? (
|
|
214
|
-
return
|
|
216
|
+
Object.prototype.hasOwnProperty.call(e, o) ? (E === !0 && (e[o] = a[o], h[o] = a[o]), d && i(E === !0 ? `"${o}" is already defined and WAS overwritten` : `"${o}" is already defined and was NOT overwritten`)) : (e[o] = a[o], h[o] = a[o]);
|
|
217
|
+
return h;
|
|
215
218
|
}
|
|
216
219
|
const _ = {
|
|
217
220
|
configDotenv: x,
|
|
218
|
-
_configVault:
|
|
221
|
+
_configVault: R,
|
|
219
222
|
_parseVault: u,
|
|
220
223
|
config: K,
|
|
221
224
|
decrypt: q,
|
|
@@ -225,15 +228,15 @@ function ee() {
|
|
|
225
228
|
return S.exports.configDotenv = _.configDotenv, S.exports._configVault = _._configVault, S.exports._parseVault = _._parseVault, S.exports.config = _.config, S.exports.decrypt = _.decrypt, S.exports.parse = _.parse, S.exports.populate = _.populate, S.exports = _, S.exports;
|
|
226
229
|
}
|
|
227
230
|
var te = ee();
|
|
228
|
-
const re = k(import.meta.url), ne = j.dirname(re), ye = (
|
|
229
|
-
const { env: t, configPath: n } =
|
|
231
|
+
const re = k(import.meta.url), ne = j.dirname(re), ye = (g = {}) => {
|
|
232
|
+
const { env: t, configPath: n } = g, c = j.resolve(ne, `${n ?? "."}/.env${t ? `.${t}` : ""}`), { parsed: w } = te.config({ path: c });
|
|
230
233
|
return w;
|
|
231
234
|
};
|
|
232
235
|
var F, B;
|
|
233
236
|
function oe() {
|
|
234
237
|
if (B) return F;
|
|
235
238
|
B = 1, F = N, N.default = N, N.stable = D, N.stableStringify = D;
|
|
236
|
-
var
|
|
239
|
+
var g = "[...]", t = "[Circular]", n = [], c = [];
|
|
237
240
|
function w() {
|
|
238
241
|
return {
|
|
239
242
|
depthLimit: Number.MAX_SAFE_INTEGER,
|
|
@@ -259,7 +262,7 @@ function oe() {
|
|
|
259
262
|
var f = Object.getOwnPropertyDescriptor(i, p);
|
|
260
263
|
f.get !== void 0 ? f.configurable ? (Object.defineProperty(i, p, { value: r }), n.push([i, p, u, f])) : c.push([u, p, r]) : (i[p] = r, n.push([i, p, u]));
|
|
261
264
|
}
|
|
262
|
-
function L(r, u, p, i, f, y,
|
|
265
|
+
function L(r, u, p, i, f, y, v) {
|
|
263
266
|
y += 1;
|
|
264
267
|
var s;
|
|
265
268
|
if (typeof r == "object" && r !== null) {
|
|
@@ -268,22 +271,22 @@ function oe() {
|
|
|
268
271
|
O(t, r, u, f);
|
|
269
272
|
return;
|
|
270
273
|
}
|
|
271
|
-
if (typeof
|
|
272
|
-
O(
|
|
274
|
+
if (typeof v.depthLimit < "u" && y > v.depthLimit) {
|
|
275
|
+
O(g, r, u, f);
|
|
273
276
|
return;
|
|
274
277
|
}
|
|
275
|
-
if (typeof
|
|
276
|
-
O(
|
|
278
|
+
if (typeof v.edgesLimit < "u" && p + 1 > v.edgesLimit) {
|
|
279
|
+
O(g, r, u, f);
|
|
277
280
|
return;
|
|
278
281
|
}
|
|
279
282
|
if (i.push(r), Array.isArray(r))
|
|
280
283
|
for (s = 0; s < r.length; s++)
|
|
281
|
-
L(r[s], s, s, i, r, y,
|
|
284
|
+
L(r[s], s, s, i, r, y, v);
|
|
282
285
|
else {
|
|
283
286
|
var V = Object.keys(r);
|
|
284
287
|
for (s = 0; s < V.length; s++) {
|
|
285
|
-
var
|
|
286
|
-
L(r[
|
|
288
|
+
var R = V[s];
|
|
289
|
+
L(r[R], R, s, i, r, y, v);
|
|
287
290
|
}
|
|
288
291
|
}
|
|
289
292
|
i.pop();
|
|
@@ -301,13 +304,13 @@ function oe() {
|
|
|
301
304
|
return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
|
|
302
305
|
} finally {
|
|
303
306
|
for (; n.length !== 0; ) {
|
|
304
|
-
var
|
|
305
|
-
|
|
307
|
+
var v = n.pop();
|
|
308
|
+
v.length === 4 ? Object.defineProperty(v[0], v[1], v[3]) : v[0][v[1]] = v[2];
|
|
306
309
|
}
|
|
307
310
|
}
|
|
308
311
|
return y;
|
|
309
312
|
}
|
|
310
|
-
function A(r, u, p, i, f, y,
|
|
313
|
+
function A(r, u, p, i, f, y, v) {
|
|
311
314
|
y += 1;
|
|
312
315
|
var s;
|
|
313
316
|
if (typeof r == "object" && r !== null) {
|
|
@@ -322,22 +325,22 @@ function oe() {
|
|
|
322
325
|
} catch {
|
|
323
326
|
return;
|
|
324
327
|
}
|
|
325
|
-
if (typeof
|
|
326
|
-
O(
|
|
328
|
+
if (typeof v.depthLimit < "u" && y > v.depthLimit) {
|
|
329
|
+
O(g, r, u, f);
|
|
327
330
|
return;
|
|
328
331
|
}
|
|
329
|
-
if (typeof
|
|
330
|
-
O(
|
|
332
|
+
if (typeof v.edgesLimit < "u" && p + 1 > v.edgesLimit) {
|
|
333
|
+
O(g, r, u, f);
|
|
331
334
|
return;
|
|
332
335
|
}
|
|
333
336
|
if (i.push(r), Array.isArray(r))
|
|
334
337
|
for (s = 0; s < r.length; s++)
|
|
335
|
-
A(r[s], s, s, i, r, y,
|
|
338
|
+
A(r[s], s, s, i, r, y, v);
|
|
336
339
|
else {
|
|
337
|
-
var V = {},
|
|
338
|
-
for (s = 0; s <
|
|
339
|
-
var x =
|
|
340
|
-
A(r[x], x, s, i, r, y,
|
|
340
|
+
var V = {}, R = Object.keys(r).sort(b);
|
|
341
|
+
for (s = 0; s < R.length; s++) {
|
|
342
|
+
var x = R[s];
|
|
343
|
+
A(r[x], x, s, i, r, y, v), V[x] = r[x];
|
|
341
344
|
}
|
|
342
345
|
if (typeof f < "u")
|
|
343
346
|
n.push([f, u, r]), f[u] = V;
|
|
@@ -397,7 +400,7 @@ const se = /* @__PURE__ */ H(ie), ce = {
|
|
|
397
400
|
"credentials",
|
|
398
401
|
"secret"
|
|
399
402
|
];
|
|
400
|
-
class
|
|
403
|
+
class ve {
|
|
401
404
|
constructor(t, n = {}) {
|
|
402
405
|
this.module = t, n.logLevels && (this.levels = new Set(n.logLevels));
|
|
403
406
|
}
|
|
@@ -459,7 +462,7 @@ class Ee {
|
|
|
459
462
|
this.levels = new Set(t);
|
|
460
463
|
}
|
|
461
464
|
}
|
|
462
|
-
class
|
|
465
|
+
class Ee {
|
|
463
466
|
debug = () => {
|
|
464
467
|
};
|
|
465
468
|
verbose = () => {
|
|
@@ -509,18 +512,18 @@ class Y {
|
|
|
509
512
|
}), n;
|
|
510
513
|
}
|
|
511
514
|
}
|
|
512
|
-
const me = (
|
|
513
|
-
...
|
|
514
|
-
withTransaction: async (t) => await t(
|
|
515
|
-
withRepositoryManager: () =>
|
|
516
|
-
}), fe = (
|
|
515
|
+
const me = (g) => ({
|
|
516
|
+
...g,
|
|
517
|
+
withTransaction: async (t) => await t(g),
|
|
518
|
+
withRepositoryManager: () => g
|
|
519
|
+
}), fe = (g, t) => `unaccent(LOWER(${g})) ILIKE unaccent(LOWER(:${t}))`, we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
517
520
|
__proto__: null,
|
|
518
521
|
unaccentSearch: fe
|
|
519
522
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
520
523
|
export {
|
|
521
|
-
|
|
524
|
+
ve as GCPLogger,
|
|
522
525
|
ce as LogLevelToConsoleMethodMap,
|
|
523
|
-
|
|
526
|
+
Ee as MockLogger,
|
|
524
527
|
Y as TransactionalRepository,
|
|
525
528
|
me as buildTransactionalRepositoryMock,
|
|
526
529
|
ye as loadEnvConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsfsi-core/ts-nodejs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@jsfsi-core/ts-crossplatform": "file:../ts-crossplatform",
|
|
33
|
-
"dotenv": "17.2.
|
|
33
|
+
"dotenv": "17.2.1",
|
|
34
34
|
"fast-safe-stringify": "2.1.1",
|
|
35
35
|
"typeorm": "0.3.25"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@vitest/coverage-v8": "3.2.4",
|
|
39
|
-
"vite": "7.
|
|
39
|
+
"vite": "7.1.1",
|
|
40
40
|
"vite-plugin-dts": "4.5.4",
|
|
41
41
|
"vitest": "3.2.4"
|
|
42
42
|
}
|