@jsfsi-core/ts-nodejs 1.0.13 → 1.0.17
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 +86 -80
- package/package.json +4 -4
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.3",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","📡 add observability to secrets: https://dotenvx.com/ops","👥 sync secrets across teammates & machines: https://dotenvx.com/ops","🗂️ backup and recover secrets: https://dotenvx.com/ops","✅ audit secrets and track compliance: https://dotenvx.com/ops","🔄 add secrets lifecycle management: https://dotenvx.com/ops","🔑 add access controls to secrets: https://dotenvx.com/ops","🛠️ 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 m=d[o].trim(),T=v(l,m);g=_.decrypt(T.ciphertext,T.key);break}catch(m){if(o+1>=E)throw m}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(m){if(m.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 m}const d=l.password;if(!d){const m=new Error("INVALID_DOTENV_KEY: Missing key part");throw m.code="INVALID_DOTENV_KEY",m}const E=l.searchParams.get("environment");if(!E){const m=new Error("INVALID_DOTENV_KEY: Missing environment part");throw m.code="INVALID_DOTENV_KEY",m}const g=`DOTENV_VAULT_${E.toUpperCase()}`,o=e.parsed[g];if(!o){const m=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${g} in your .env.vault file.`);throw m.code="NOT_FOUND_DOTENV_ENVIRONMENT",m}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 $(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 m;const T={};for(const L of o)try{const x=_.parse(h.readFileSync(L,{encoding:l}));_.populate(T,x,e)}catch(x){E&&i(`Failed to load ${L} ${x.message}`),m=x}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,x=[];for(const K of o)try{const C=t.relative(process.cwd(),K);x.push(C)}catch(C){E&&i(`Failed to load ${K} ${C.message}`),m=C}f(`injecting env (${L}) from ${x.join(",")} ${A(`-- tip: ${I()}`)}`)}return m?{parsed:T,error:m}:{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 m=o instanceof RangeError,T=o.message==="Invalid key length",F=o.message==="Unsupported state or unable to authenticate data";if(m||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:$,_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:w}=ne.config({path:c});return w};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 w(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N(r,u,p,i){typeof i>"u"&&(i=w()),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=w());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 $=V[s];A(r[$],$,s,i,r,y,v),R[$]=r[$]}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,w,N){if(!this.levels.has(t))return;const O=this.buildLog(t,n,c,w,N),I=ue(O,this.sensitiveReplacer),b=this.mapLogLevelToConsoleMethod(t);console[b](I)}buildLog(t,n,c,w,N){const{writeMetadata:O,writeContext:I,writeError:b}=this.sanitizeLog(c,w,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 w=n,N=t;return typeof w=="string"&&!t&&(N=w,w=void 0),{writeMetadata:w,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,w){this.write("warn",t,w,n,c)}error(t,n,c,w){this.write("error",t,w,n,c)}fatal(t,n,c,w){this.write("fatal",t,w,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,27 @@ 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.3", 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
|
+
"📡 add observability to secrets: https://dotenvx.com/ops",
|
|
22
|
+
"👥 sync secrets across teammates & machines: https://dotenvx.com/ops",
|
|
23
|
+
"🗂️ backup and recover secrets: https://dotenvx.com/ops",
|
|
24
|
+
"✅ audit secrets and track compliance: https://dotenvx.com/ops",
|
|
25
|
+
"🔄 add secrets lifecycle management: https://dotenvx.com/ops",
|
|
26
|
+
"🔑 add access controls to secrets: https://dotenvx.com/ops",
|
|
21
27
|
"🛠️ run anywhere with `dotenvx run -- yourcommand`",
|
|
22
28
|
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
|
23
29
|
"⚙️ enable debug logging with { debug: true }",
|
|
@@ -46,12 +52,12 @@ function ee() {
|
|
|
46
52
|
`);
|
|
47
53
|
let d;
|
|
48
54
|
for (; (d = M.exec(l)) != null; ) {
|
|
49
|
-
const
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
const o =
|
|
53
|
-
|
|
54
|
-
`),
|
|
55
|
+
const E = d[1];
|
|
56
|
+
let h = d[2] || "";
|
|
57
|
+
h = h.trim();
|
|
58
|
+
const o = h[0];
|
|
59
|
+
h = h.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), o === '"' && (h = h.replace(/\\n/g, `
|
|
60
|
+
`), h = h.replace(/\\r/g, "\r")), a[E] = h;
|
|
55
61
|
}
|
|
56
62
|
return a;
|
|
57
63
|
}
|
|
@@ -64,18 +70,18 @@ function ee() {
|
|
|
64
70
|
const o = new Error(`MISSING_DATA: Cannot parse ${a} for an unknown reason`);
|
|
65
71
|
throw o.code = "MISSING_DATA", o;
|
|
66
72
|
}
|
|
67
|
-
const d = y(e).split(","),
|
|
68
|
-
let
|
|
69
|
-
for (let o = 0; o <
|
|
73
|
+
const d = y(e).split(","), E = d.length;
|
|
74
|
+
let h;
|
|
75
|
+
for (let o = 0; o < E; o++)
|
|
70
76
|
try {
|
|
71
|
-
const m = d[o].trim(), T =
|
|
72
|
-
|
|
77
|
+
const m = d[o].trim(), T = v(l, m);
|
|
78
|
+
h = _.decrypt(T.ciphertext, T.key);
|
|
73
79
|
break;
|
|
74
80
|
} catch (m) {
|
|
75
|
-
if (o + 1 >=
|
|
81
|
+
if (o + 1 >= E)
|
|
76
82
|
throw m;
|
|
77
83
|
}
|
|
78
|
-
return _.parse(
|
|
84
|
+
return _.parse(h);
|
|
79
85
|
}
|
|
80
86
|
function p(e) {
|
|
81
87
|
console.error(`[dotenv@${N}][WARN] ${e}`);
|
|
@@ -89,7 +95,7 @@ function ee() {
|
|
|
89
95
|
function y(e) {
|
|
90
96
|
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
97
|
}
|
|
92
|
-
function
|
|
98
|
+
function v(e, a) {
|
|
93
99
|
let l;
|
|
94
100
|
try {
|
|
95
101
|
l = new URL(a);
|
|
@@ -105,14 +111,14 @@ function ee() {
|
|
|
105
111
|
const m = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
106
112
|
throw m.code = "INVALID_DOTENV_KEY", m;
|
|
107
113
|
}
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
114
|
+
const E = l.searchParams.get("environment");
|
|
115
|
+
if (!E) {
|
|
110
116
|
const m = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
111
117
|
throw m.code = "INVALID_DOTENV_KEY", m;
|
|
112
118
|
}
|
|
113
|
-
const
|
|
119
|
+
const h = `DOTENV_VAULT_${E.toUpperCase()}`, o = e.parsed[h];
|
|
114
120
|
if (!o) {
|
|
115
|
-
const m = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${
|
|
121
|
+
const m = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${h} in your .env.vault file.`);
|
|
116
122
|
throw m.code = "NOT_FOUND_DOTENV_ENVIRONMENT", m;
|
|
117
123
|
}
|
|
118
124
|
return { ciphertext: o, key: d };
|
|
@@ -122,29 +128,29 @@ function ee() {
|
|
|
122
128
|
if (e && e.path && e.path.length > 0)
|
|
123
129
|
if (Array.isArray(e.path))
|
|
124
130
|
for (const l of e.path)
|
|
125
|
-
|
|
131
|
+
g.existsSync(l) && (a = l.endsWith(".vault") ? l : `${l}.vault`);
|
|
126
132
|
else
|
|
127
133
|
a = e.path.endsWith(".vault") ? e.path : `${e.path}.vault`;
|
|
128
134
|
else
|
|
129
135
|
a = t.resolve(process.cwd(), ".env.vault");
|
|
130
|
-
return
|
|
136
|
+
return g.existsSync(a) ? a : null;
|
|
131
137
|
}
|
|
132
138
|
function V(e) {
|
|
133
139
|
return e[0] === "~" ? t.join(n.homedir(), e.slice(1)) : e;
|
|
134
140
|
}
|
|
135
|
-
function
|
|
141
|
+
function x(e) {
|
|
136
142
|
const a = b(process.env.DOTENV_CONFIG_DEBUG || e && e.debug), l = b(process.env.DOTENV_CONFIG_QUIET || e && e.quiet);
|
|
137
143
|
(a || !l) && f("Loading env from encrypted .env.vault");
|
|
138
144
|
const d = _._parseVault(e);
|
|
139
|
-
let
|
|
140
|
-
return e && e.processEnv != null && (
|
|
145
|
+
let E = process.env;
|
|
146
|
+
return e && e.processEnv != null && (E = e.processEnv), _.populate(E, d, e), { parsed: d };
|
|
141
147
|
}
|
|
142
|
-
function
|
|
148
|
+
function R(e) {
|
|
143
149
|
const a = t.resolve(process.cwd(), ".env");
|
|
144
150
|
let l = "utf8", d = process.env;
|
|
145
151
|
e && e.processEnv != null && (d = e.processEnv);
|
|
146
|
-
let
|
|
147
|
-
e && e.encoding ? l = e.encoding :
|
|
152
|
+
let E = b(d.DOTENV_CONFIG_DEBUG || e && e.debug), h = b(d.DOTENV_CONFIG_QUIET || e && e.quiet);
|
|
153
|
+
e && e.encoding ? l = e.encoding : E && i("No encoding is specified. UTF-8 is used by default");
|
|
148
154
|
let o = [a];
|
|
149
155
|
if (e && e.path)
|
|
150
156
|
if (!Array.isArray(e.path))
|
|
@@ -158,22 +164,22 @@ function ee() {
|
|
|
158
164
|
const T = {};
|
|
159
165
|
for (const I of o)
|
|
160
166
|
try {
|
|
161
|
-
const
|
|
162
|
-
_.populate(T,
|
|
163
|
-
} catch (
|
|
164
|
-
|
|
167
|
+
const $ = _.parse(g.readFileSync(I, { encoding: l }));
|
|
168
|
+
_.populate(T, $, e);
|
|
169
|
+
} catch ($) {
|
|
170
|
+
E && i(`Failed to load ${I} ${$.message}`), m = $;
|
|
165
171
|
}
|
|
166
172
|
const P = _.populate(d, T, e);
|
|
167
|
-
if (
|
|
168
|
-
const I = Object.keys(P).length,
|
|
173
|
+
if (E = b(d.DOTENV_CONFIG_DEBUG || E), h = b(d.DOTENV_CONFIG_QUIET || h), E || !h) {
|
|
174
|
+
const I = Object.keys(P).length, $ = [];
|
|
169
175
|
for (const U of o)
|
|
170
176
|
try {
|
|
171
177
|
const C = t.relative(process.cwd(), U);
|
|
172
|
-
|
|
178
|
+
$.push(C);
|
|
173
179
|
} catch (C) {
|
|
174
|
-
|
|
180
|
+
E && i(`Failed to load ${U} ${C.message}`), m = C;
|
|
175
181
|
}
|
|
176
|
-
f(`injecting env (${I}) from ${
|
|
182
|
+
f(`injecting env (${I}) from ${$.join(",")} ${A(`-- tip: ${L()}`)}`);
|
|
177
183
|
}
|
|
178
184
|
return m ? { parsed: T, error: m } : { parsed: T };
|
|
179
185
|
}
|
|
@@ -186,11 +192,11 @@ function ee() {
|
|
|
186
192
|
function q(e, a) {
|
|
187
193
|
const l = Buffer.from(a.slice(-64), "hex");
|
|
188
194
|
let d = Buffer.from(e, "base64");
|
|
189
|
-
const
|
|
195
|
+
const E = d.subarray(0, 12), h = d.subarray(-16);
|
|
190
196
|
d = d.subarray(12, -16);
|
|
191
197
|
try {
|
|
192
|
-
const o = c.createDecipheriv("aes-256-gcm", l,
|
|
193
|
-
return o.setAuthTag(
|
|
198
|
+
const o = c.createDecipheriv("aes-256-gcm", l, E);
|
|
199
|
+
return o.setAuthTag(h), `${o.update(d)}${o.final()}`;
|
|
194
200
|
} catch (o) {
|
|
195
201
|
const m = o instanceof RangeError, T = o.message === "Invalid key length", P = o.message === "Unsupported state or unable to authenticate data";
|
|
196
202
|
if (m || T) {
|
|
@@ -204,18 +210,18 @@ function ee() {
|
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
function J(e, a, l = {}) {
|
|
207
|
-
const d = !!(l && l.debug),
|
|
213
|
+
const d = !!(l && l.debug), E = !!(l && l.override), h = {};
|
|
208
214
|
if (typeof a != "object") {
|
|
209
215
|
const o = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
210
216
|
throw o.code = "OBJECT_REQUIRED", o;
|
|
211
217
|
}
|
|
212
218
|
for (const o of Object.keys(a))
|
|
213
|
-
Object.prototype.hasOwnProperty.call(e, o) ? (
|
|
214
|
-
return
|
|
219
|
+
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]);
|
|
220
|
+
return h;
|
|
215
221
|
}
|
|
216
222
|
const _ = {
|
|
217
|
-
configDotenv:
|
|
218
|
-
_configVault:
|
|
223
|
+
configDotenv: R,
|
|
224
|
+
_configVault: x,
|
|
219
225
|
_parseVault: u,
|
|
220
226
|
config: K,
|
|
221
227
|
decrypt: q,
|
|
@@ -225,15 +231,15 @@ function ee() {
|
|
|
225
231
|
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
232
|
}
|
|
227
233
|
var te = ee();
|
|
228
|
-
const re = k(import.meta.url), ne = j.dirname(re), ye = (
|
|
229
|
-
const { env: t, configPath: n } =
|
|
234
|
+
const re = k(import.meta.url), ne = j.dirname(re), ye = (g = {}) => {
|
|
235
|
+
const { env: t, configPath: n } = g, c = j.resolve(ne, `${n ?? "."}/.env${t ? `.${t}` : ""}`), { parsed: w } = te.config({ path: c });
|
|
230
236
|
return w;
|
|
231
237
|
};
|
|
232
238
|
var F, B;
|
|
233
239
|
function oe() {
|
|
234
240
|
if (B) return F;
|
|
235
241
|
B = 1, F = N, N.default = N, N.stable = D, N.stableStringify = D;
|
|
236
|
-
var
|
|
242
|
+
var g = "[...]", t = "[Circular]", n = [], c = [];
|
|
237
243
|
function w() {
|
|
238
244
|
return {
|
|
239
245
|
depthLimit: Number.MAX_SAFE_INTEGER,
|
|
@@ -259,7 +265,7 @@ function oe() {
|
|
|
259
265
|
var f = Object.getOwnPropertyDescriptor(i, p);
|
|
260
266
|
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
267
|
}
|
|
262
|
-
function L(r, u, p, i, f, y,
|
|
268
|
+
function L(r, u, p, i, f, y, v) {
|
|
263
269
|
y += 1;
|
|
264
270
|
var s;
|
|
265
271
|
if (typeof r == "object" && r !== null) {
|
|
@@ -268,22 +274,22 @@ function oe() {
|
|
|
268
274
|
O(t, r, u, f);
|
|
269
275
|
return;
|
|
270
276
|
}
|
|
271
|
-
if (typeof
|
|
272
|
-
O(
|
|
277
|
+
if (typeof v.depthLimit < "u" && y > v.depthLimit) {
|
|
278
|
+
O(g, r, u, f);
|
|
273
279
|
return;
|
|
274
280
|
}
|
|
275
|
-
if (typeof
|
|
276
|
-
O(
|
|
281
|
+
if (typeof v.edgesLimit < "u" && p + 1 > v.edgesLimit) {
|
|
282
|
+
O(g, r, u, f);
|
|
277
283
|
return;
|
|
278
284
|
}
|
|
279
285
|
if (i.push(r), Array.isArray(r))
|
|
280
286
|
for (s = 0; s < r.length; s++)
|
|
281
|
-
L(r[s], s, s, i, r, y,
|
|
287
|
+
L(r[s], s, s, i, r, y, v);
|
|
282
288
|
else {
|
|
283
289
|
var V = Object.keys(r);
|
|
284
290
|
for (s = 0; s < V.length; s++) {
|
|
285
|
-
var
|
|
286
|
-
L(r[
|
|
291
|
+
var x = V[s];
|
|
292
|
+
L(r[x], x, s, i, r, y, v);
|
|
287
293
|
}
|
|
288
294
|
}
|
|
289
295
|
i.pop();
|
|
@@ -301,13 +307,13 @@ function oe() {
|
|
|
301
307
|
return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
|
|
302
308
|
} finally {
|
|
303
309
|
for (; n.length !== 0; ) {
|
|
304
|
-
var
|
|
305
|
-
|
|
310
|
+
var v = n.pop();
|
|
311
|
+
v.length === 4 ? Object.defineProperty(v[0], v[1], v[3]) : v[0][v[1]] = v[2];
|
|
306
312
|
}
|
|
307
313
|
}
|
|
308
314
|
return y;
|
|
309
315
|
}
|
|
310
|
-
function A(r, u, p, i, f, y,
|
|
316
|
+
function A(r, u, p, i, f, y, v) {
|
|
311
317
|
y += 1;
|
|
312
318
|
var s;
|
|
313
319
|
if (typeof r == "object" && r !== null) {
|
|
@@ -322,22 +328,22 @@ function oe() {
|
|
|
322
328
|
} catch {
|
|
323
329
|
return;
|
|
324
330
|
}
|
|
325
|
-
if (typeof
|
|
326
|
-
O(
|
|
331
|
+
if (typeof v.depthLimit < "u" && y > v.depthLimit) {
|
|
332
|
+
O(g, r, u, f);
|
|
327
333
|
return;
|
|
328
334
|
}
|
|
329
|
-
if (typeof
|
|
330
|
-
O(
|
|
335
|
+
if (typeof v.edgesLimit < "u" && p + 1 > v.edgesLimit) {
|
|
336
|
+
O(g, r, u, f);
|
|
331
337
|
return;
|
|
332
338
|
}
|
|
333
339
|
if (i.push(r), Array.isArray(r))
|
|
334
340
|
for (s = 0; s < r.length; s++)
|
|
335
|
-
A(r[s], s, s, i, r, y,
|
|
341
|
+
A(r[s], s, s, i, r, y, v);
|
|
336
342
|
else {
|
|
337
|
-
var V = {},
|
|
338
|
-
for (s = 0; s <
|
|
339
|
-
var
|
|
340
|
-
A(r[
|
|
343
|
+
var V = {}, x = Object.keys(r).sort(b);
|
|
344
|
+
for (s = 0; s < x.length; s++) {
|
|
345
|
+
var R = x[s];
|
|
346
|
+
A(r[R], R, s, i, r, y, v), V[R] = r[R];
|
|
341
347
|
}
|
|
342
348
|
if (typeof f < "u")
|
|
343
349
|
n.push([f, u, r]), f[u] = V;
|
|
@@ -397,7 +403,7 @@ const se = /* @__PURE__ */ H(ie), ce = {
|
|
|
397
403
|
"credentials",
|
|
398
404
|
"secret"
|
|
399
405
|
];
|
|
400
|
-
class
|
|
406
|
+
class ve {
|
|
401
407
|
constructor(t, n = {}) {
|
|
402
408
|
this.module = t, n.logLevels && (this.levels = new Set(n.logLevels));
|
|
403
409
|
}
|
|
@@ -459,7 +465,7 @@ class Ee {
|
|
|
459
465
|
this.levels = new Set(t);
|
|
460
466
|
}
|
|
461
467
|
}
|
|
462
|
-
class
|
|
468
|
+
class Ee {
|
|
463
469
|
debug = () => {
|
|
464
470
|
};
|
|
465
471
|
verbose = () => {
|
|
@@ -509,18 +515,18 @@ class Y {
|
|
|
509
515
|
}), n;
|
|
510
516
|
}
|
|
511
517
|
}
|
|
512
|
-
const me = (
|
|
513
|
-
...
|
|
514
|
-
withTransaction: async (t) => await t(
|
|
515
|
-
withRepositoryManager: () =>
|
|
516
|
-
}), fe = (
|
|
518
|
+
const me = (g) => ({
|
|
519
|
+
...g,
|
|
520
|
+
withTransaction: async (t) => await t(g),
|
|
521
|
+
withRepositoryManager: () => g
|
|
522
|
+
}), fe = (g, t) => `unaccent(LOWER(${g})) ILIKE unaccent(LOWER(:${t}))`, we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
517
523
|
__proto__: null,
|
|
518
524
|
unaccentSearch: fe
|
|
519
525
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
520
526
|
export {
|
|
521
|
-
|
|
527
|
+
ve as GCPLogger,
|
|
522
528
|
ce as LogLevelToConsoleMethodMap,
|
|
523
|
-
|
|
529
|
+
Ee as MockLogger,
|
|
524
530
|
Y as TransactionalRepository,
|
|
525
531
|
me as buildTransactionalRepositoryMock,
|
|
526
532
|
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.17",
|
|
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.3",
|
|
34
34
|
"fast-safe-stringify": "2.1.1",
|
|
35
|
-
"typeorm": "0.3.
|
|
35
|
+
"typeorm": "0.3.27"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@vitest/coverage-v8": "3.2.4",
|
|
39
|
-
"vite": "7.
|
|
39
|
+
"vite": "7.1.9",
|
|
40
40
|
"vite-plugin-dts": "4.5.4",
|
|
41
41
|
"vitest": "3.2.4"
|
|
42
42
|
}
|