node-env-resolver 3.0.0 → 4.0.0
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/README.md +349 -50
- package/dist/advanced-features.test.d.ts +2 -0
- package/dist/advanced-features.test.d.ts.map +1 -0
- package/dist/audit.cjs +1 -0
- package/dist/audit.d.ts +13 -1
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +1 -1
- package/dist/builder.cjs +1 -0
- package/dist/builder.js +1 -1
- package/dist/chunk-4ZOF2PI4.cjs +1 -0
- package/dist/chunk-54OHKWZJ.js +1 -0
- package/dist/chunk-5PELJRUQ.js +1 -0
- package/dist/chunk-FCFDGYTF.cjs +15 -0
- package/dist/chunk-HCVTYYLE.js +9 -0
- package/dist/chunk-IU5TG3HL.js +15 -0
- package/dist/chunk-J7ZHEMRP.js +9 -0
- package/dist/chunk-KIQXH265.cjs +1 -0
- package/dist/chunk-NKPXKLF7.js +1 -0
- package/dist/chunk-P3ZWKKKW.cjs +1 -0
- package/dist/chunk-THFGEKYL.cjs +9 -0
- package/dist/chunk-ULL4WKTV.cjs +9 -0
- package/dist/chunk-XPGSWVRT.cjs +1 -0
- package/dist/chunk-YOHHFBZN.js +1 -0
- package/dist/cli.cjs +1 -0
- package/dist/cli.d.ts +49 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1 -0
- package/dist/cli.test.d.ts +2 -0
- package/dist/cli.test.d.ts.map +1 -0
- package/dist/computed.test.d.ts +2 -0
- package/dist/computed.test.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +93 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/nested.test.d.ts +2 -0
- package/dist/nested.test.d.ts.map +1 -0
- package/dist/resolver.cjs +1 -0
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +1 -1
- package/dist/resolvers.cjs +1 -0
- package/dist/resolvers.d.ts +131 -2
- package/dist/resolvers.d.ts.map +1 -1
- package/dist/resolvers.js +1 -1
- package/dist/sync-resolvers.test.d.ts +2 -0
- package/dist/sync-resolvers.test.d.ts.map +1 -0
- package/dist/type-inference.test.d.ts +2 -0
- package/dist/type-inference.test.d.ts.map +1 -0
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +82 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +170 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/valibot.cjs +1 -0
- package/dist/valibot.js +1 -1
- package/dist/validation-types.cjs +1 -0
- package/dist/validators.cjs +1 -0
- package/dist/validators.d.ts +17 -0
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +1 -1
- package/dist/web.cjs +6 -0
- package/dist/web.js +4 -4
- package/dist/zod.cjs +1 -0
- package/dist/zod.js +1 -1
- package/package.json +30 -14
- package/dist/chunk-5SFFBKLW.js +0 -9
- package/dist/chunk-CC4LJOXE.js +0 -3
- package/dist/chunk-DAGPFV3V.js +0 -1
- package/dist/chunk-ICRS72Z4.js +0 -1
- package/dist/chunk-WOT6VMZA.js +0 -1
- package/dist/chunk-XP3U6MKF.js +0 -5
package/dist/audit.d.ts
CHANGED
|
@@ -9,8 +9,20 @@ export interface AuditEvent {
|
|
|
9
9
|
source?: string;
|
|
10
10
|
error?: string;
|
|
11
11
|
metadata?: Record<string, unknown>;
|
|
12
|
+
sessionId?: string;
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Attach an audit session ID to a config object
|
|
16
|
+
* Returns the session ID for use in audit events
|
|
17
|
+
*/
|
|
18
|
+
export declare function attachAuditSession(config: object): string;
|
|
13
19
|
export declare function logAuditEvent(event: AuditEvent): void;
|
|
14
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Get audit log, optionally filtered by config object
|
|
22
|
+
*
|
|
23
|
+
* @param config - Optional config object to filter audit events for
|
|
24
|
+
* @returns Audit events (all events if no config provided, or filtered by config's session)
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAuditLog(config?: object): readonly AuditEvent[];
|
|
15
27
|
export declare function clearAuditLog(): void;
|
|
16
28
|
//# sourceMappingURL=audit.d.ts.map
|
package/dist/audit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAMrD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,UAAU,EAAE,CAelE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
|
package/dist/audit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
import {f}from'./chunk-YOHHFBZN.js';export{a as attachAuditSession,d as clearAuditLog,c as getAuditLog,b as logAuditEvent}from'./chunk-YOHHFBZN.js';import'./chunk-5PELJRUQ.js';f();
|
package/dist/builder.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkULL4WKTV_cjs=require('./chunk-ULL4WKTV.cjs');require('./chunk-XPGSWVRT.cjs'),require('./chunk-4ZOF2PI4.cjs');var chunkFCFDGYTF_cjs=require('./chunk-FCFDGYTF.cjs');require('./chunk-KIQXH265.cjs');var i=class{constructor(e,s={}){this.localSchema=e;this.options=s;}layers=[];from(e,s){return this.layers.push({resolver:e,schema:s}),this}resolve(){let e=chunkULL4WKTV_cjs.a(this.localSchema);for(let l of this.layers){let m=chunkULL4WKTV_cjs.a(l.schema);Object.assign(e,m);}let s=this.buildDefaultResolvers(),r=this.layers.map(l=>l.resolver),a=this.options.extend||[],c=[...s,...r,...a],u=this.options.policies??{};return chunkULL4WKTV_cjs.c(e,c,{...this.options,policies:u,interpolate:this.options.interpolate??true,strict:this.options.strict??true})}buildDefaultResolvers(){let e=process.env.NODE_ENV==="production",s=[];return e||s.push(chunkFCFDGYTF_cjs.a({expand:true})),s.push(chunkFCFDGYTF_cjs.b()),s}},n=class{constructor(e,s={}){this.localSchema=e;this.options=s;}layers=[];from(e,s){return this.layers.push({resolver:e,schema:s}),this}resolveSync(){let e=chunkULL4WKTV_cjs.a(this.localSchema);for(let l of this.layers){let m=chunkULL4WKTV_cjs.a(l.schema);Object.assign(e,m);}let s=this.buildDefaultResolvers(),r=this.layers.map(l=>l.resolver),a=this.options.extend||[],c=[...s,...r,...a],u=this.options.policies??{};return chunkULL4WKTV_cjs.c(e,c,{...this.options,policies:u,interpolate:this.options.interpolate??true,strict:this.options.strict??true})}buildDefaultResolvers(){let e=process.env.NODE_ENV==="production",s=[];return e||s.push(chunkFCFDGYTF_cjs.a({expand:true})),s.push(chunkFCFDGYTF_cjs.b()),s}};function y(t,e){return new i(t,e)}function b(t,e){return new n(t,e)}var d=class{builder;simpleResolve=null;constructor(e,s={}){this.builder=new i(e,s);}from(e,s){return this.builder.from(e,s),this}async compose(){return this.builder.resolve()}then(e,s){return this.simpleResolve||(this.simpleResolve=Promise.resolve(this.builder.resolve())),this.simpleResolve.then(e,s)}catch(e){return this.simpleResolve||(this.simpleResolve=Promise.resolve(this.builder.resolve())),this.simpleResolve.catch(e)}finally(e){return this.simpleResolve||(this.simpleResolve=Promise.resolve(this.builder.resolve())),this.simpleResolve.finally(e)}},S=class{builder;_resolved=null;_hasComposition=false;constructor(e,s={}){Object.defineProperty(this,"builder",{value:new n(e,s),enumerable:false,writable:true}),Object.defineProperty(this,"_hasComposition",{value:false,enumerable:false,writable:true});let r=this.builder.resolveSync();Object.defineProperty(this,"_resolved",{value:r,enumerable:false,writable:true}),Object.assign(this,r);}from(e,s){return Object.defineProperty(this,"_hasComposition",{value:true,enumerable:false,writable:true}),this.builder.from(e,s),this}compose(){return this._hasComposition&&(this._resolved=this.builder.resolveSync(),Object.assign(this,this._resolved)),this._resolved}valueOf(){return this._resolved}toJSON(){return this._resolved}};exports.EnvBuilder=i;exports.EnvBuilderSync=n;exports.ResolvableBuilder=d;exports.ResolvableBuilderSync=S;exports.env=y;exports.envSync=b;
|
package/dist/builder.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a
|
|
1
|
+
import {a,c}from'./chunk-J7ZHEMRP.js';import'./chunk-NKPXKLF7.js';import'./chunk-YOHHFBZN.js';import {a as a$1,b as b$1}from'./chunk-IU5TG3HL.js';import'./chunk-5PELJRUQ.js';var i=class{constructor(e,s={}){this.localSchema=e;this.options=s;}layers=[];from(e,s){return this.layers.push({resolver:e,schema:s}),this}resolve(){let e=a(this.localSchema);for(let l of this.layers){let m=a(l.schema);Object.assign(e,m);}let s=this.buildDefaultResolvers(),r=this.layers.map(l=>l.resolver),a$1=this.options.extend||[],c$1=[...s,...r,...a$1],u=this.options.policies??{};return c(e,c$1,{...this.options,policies:u,interpolate:this.options.interpolate??true,strict:this.options.strict??true})}buildDefaultResolvers(){let e=process.env.NODE_ENV==="production",s=[];return e||s.push(a$1({expand:true})),s.push(b$1()),s}},n=class{constructor(e,s={}){this.localSchema=e;this.options=s;}layers=[];from(e,s){return this.layers.push({resolver:e,schema:s}),this}resolveSync(){let e=a(this.localSchema);for(let l of this.layers){let m=a(l.schema);Object.assign(e,m);}let s=this.buildDefaultResolvers(),r=this.layers.map(l=>l.resolver),a$1=this.options.extend||[],c$1=[...s,...r,...a$1],u=this.options.policies??{};return c(e,c$1,{...this.options,policies:u,interpolate:this.options.interpolate??true,strict:this.options.strict??true})}buildDefaultResolvers(){let e=process.env.NODE_ENV==="production",s=[];return e||s.push(a$1({expand:true})),s.push(b$1()),s}};function y(t,e){return new i(t,e)}function b(t,e){return new n(t,e)}var d=class{builder;simpleResolve=null;constructor(e,s={}){this.builder=new i(e,s);}from(e,s){return this.builder.from(e,s),this}async compose(){return this.builder.resolve()}then(e,s){return this.simpleResolve||(this.simpleResolve=Promise.resolve(this.builder.resolve())),this.simpleResolve.then(e,s)}catch(e){return this.simpleResolve||(this.simpleResolve=Promise.resolve(this.builder.resolve())),this.simpleResolve.catch(e)}finally(e){return this.simpleResolve||(this.simpleResolve=Promise.resolve(this.builder.resolve())),this.simpleResolve.finally(e)}},S=class{builder;_resolved=null;_hasComposition=false;constructor(e,s={}){Object.defineProperty(this,"builder",{value:new n(e,s),enumerable:false,writable:true}),Object.defineProperty(this,"_hasComposition",{value:false,enumerable:false,writable:true});let r=this.builder.resolveSync();Object.defineProperty(this,"_resolved",{value:r,enumerable:false,writable:true}),Object.assign(this,r);}from(e,s){return Object.defineProperty(this,"_hasComposition",{value:true,enumerable:false,writable:true}),this.builder.from(e,s),this}compose(){return this._hasComposition&&(this._resolved=this.builder.resolveSync(),Object.assign(this,this._resolved)),this._resolved}valueOf(){return this._resolved}toJSON(){return this._resolved}};export{i as EnvBuilder,n as EnvBuilderSync,d as ResolvableBuilder,S as ResolvableBuilderSync,y as env,b as envSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkKIQXH265_cjs=require('./chunk-KIQXH265.cjs');var g={};chunkKIQXH265_cjs.c(g,{attachAuditSession:()=>d,clearAuditLog:()=>c,getAuditLog:()=>a,logAuditEvent:()=>u});function d(t){let n=Date.now().toString(36)+Math.random().toString(36).substring(2,9);return o.set(t,n),n}function u(t){e.push(t),e.length>1e3&&e.shift();}function a(t){if(!t)return [...e];let n=o.get(t);return n?e.filter(i=>i.sessionId===n):[]}function c(){e.length=0;}var e,o,p=chunkKIQXH265_cjs.b(()=>{e=[],o=new WeakMap;});exports.a=d;exports.b=u;exports.c=a;exports.d=c;exports.e=g;exports.f=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(e){return typeof e.loadSync=="function"}function t(e){return !e.loadSync}export{n as a,t as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var k=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var m=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:true});},j=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of h(b))!i.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=g(b,d))||f.enumerable});return a};var n=a=>j(e({},"__esModule",{value:true}),a);export{k as a,l as b,m as c,n as d};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';var chunkKIQXH265_cjs=require('./chunk-KIQXH265.cjs'),fs=require('fs'),path=require('path');var h=l=>{let a={},e=l.split(`
|
|
2
|
+
`);for(let t=0;t<e.length;t++){let i=e[t]?.trim()??"";if(!i||i[0]==="#")continue;let o=i.indexOf("=");if(o<=0)continue;let n=i.slice(0,o).trim();if(!/^[A-Z_][A-Z0-9_]*$/i.test(n))continue;let r=i.slice(o+1).trim();if(r.length>=2){let s=r[0];(s==='"'||s==="'")&&r[r.length-1]===s&&(r=r.slice(1,-1),s==='"'&&(r=r.replace(/\\n/g,`
|
|
3
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\\\/g,"\\").replace(/\\"/g,'"').replace(/\\'/g,"'")));}else {let s=r.indexOf("#");s>=0&&(r=r.slice(0,s).trim());}a[n]=r;}return a};function E(l){let a=typeof l=="string"?{path:l,expand:false}:{path:l?.path??".env",expand:l?.expand??false};return {name:a.expand?`dotenv-expand(${a.path})`:`dotenv(${a.path})`,async load(){if(!a.expand){let n=path.resolve(process.cwd(),a.path);return fs.existsSync(n)?h(fs.readFileSync(n,"utf8")):{}}let e=a.path,t=process.env.NODE_ENV||"development",i=[`${e}.defaults`,e,`${e}.local`,`${e}.${t}`,`${e}.${t}.local`],o={};for(let n of i){let r=path.resolve(process.cwd(),n);if(fs.existsSync(r))try{o={...o,...h(fs.readFileSync(r,"utf8"))};}catch{}}return o},loadSync(){if(!a.expand){let n=path.resolve(process.cwd(),a.path);return fs.existsSync(n)?h(fs.readFileSync(n,"utf8")):{}}let e=a.path,t=process.env.NODE_ENV||"development",i=[`${e}.defaults`,e,`${e}.local`,`${e}.${t}`,`${e}.${t}.local`],o={};for(let n of i){let r=path.resolve(process.cwd(),n);if(fs.existsSync(r))try{o={...o,...h(fs.readFileSync(r,"utf8"))};}catch{}}return o}}}function O(){return {name:"process.env",async load(){return {...process.env}},loadSync(){return {...process.env}}}}function S(l){let a={path:l?.path??"package.json",fields:l?.fields??["version","name","config"]};return {name:"package.json",async load(){let e=path.resolve(process.cwd(),a.path);if(!fs.existsSync(e))return {};try{let t=fs.readFileSync(e,"utf8"),i=JSON.parse(t),o={};for(let n of a.fields){let r=i[n];if(r!==void 0)if(n==="config"&&typeof r=="object"){let s=(c,d)=>{if(c&&typeof c=="object"&&!Array.isArray(c))for(let[f,p]of Object.entries(c)){let m=`${d}_${f.toUpperCase()}`;p&&typeof p=="object"&&!Array.isArray(p)?s(p,m):o[m]=String(p);}};s(r,"CONFIG");}else o[n.toUpperCase()]=String(r);}return o}catch(t){throw new Error(`Failed to read package.json: ${t instanceof Error?t.message:String(t)}`)}},loadSync(){let e=path.resolve(process.cwd(),a.path);if(!fs.existsSync(e))return {};try{let t=fs.readFileSync(e,"utf8"),i=JSON.parse(t),o={};for(let n of a.fields){let r=i[n];if(r!==void 0)if(n==="config"&&typeof r=="object"){let s=(c,d)=>{if(c&&typeof c=="object"&&!Array.isArray(c))for(let[f,p]of Object.entries(c)){let m=`${d}_${f.toUpperCase()}`;p&&typeof p=="object"&&!Array.isArray(p)?s(p,m):o[m]=String(p);}};s(r,"CONFIG");}else o[n.toUpperCase()]=String(r);}return o}catch(t){throw new Error(`Failed to read package.json: ${t instanceof Error?t.message:String(t)}`)}}}}function k(l,a){return {name:`http(${l})`,async load(){try{let e=new AbortController,t=a?.timeout??5e3,i=setTimeout(()=>e.abort(),t),o=await fetch(l,{...a,signal:e.signal});if(clearTimeout(i),!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);let n=await o.json(),r={},s=(c,d="")=>{if(c&&typeof c=="object"&&!Array.isArray(c))for(let[f,p]of Object.entries(c)){let m=d?`${d}_${f}`:f;p&&typeof p=="object"&&!Array.isArray(p)?s(p,m):r[m.toUpperCase()]=String(p);}};return s(n),r}catch(e){throw e.name==="AbortError"?new Error(`HTTP request timeout after ${a?.timeout??5e3}ms`):new Error(`Failed to fetch config from ${l}: ${e instanceof Error?e.message:String(e)}`)}}}}function R(l="config.json"){return {name:`json(${l})`,async load(){let a=path.resolve(process.cwd(),l);if(!fs.existsSync(a))return {};try{let e=fs.readFileSync(a,"utf8"),t=JSON.parse(e),i={},o=(n,r="")=>{if(n&&typeof n=="object"&&!Array.isArray(n))for(let[s,c]of Object.entries(n)){let d=r?`${r}_${s}`:s;c&&typeof c=="object"&&!Array.isArray(c)?o(c,d):i[d.toUpperCase()]=String(c);}};return o(t),i}catch(e){throw new Error(`Failed to parse JSON file ${l}: ${e instanceof Error?e.message:String(e)}`)}},loadSync(){let a=path.resolve(process.cwd(),l);if(!fs.existsSync(a))return {};try{let e=fs.readFileSync(a,"utf8"),t=JSON.parse(e),i={},o=(n,r="")=>{if(n&&typeof n=="object"&&!Array.isArray(n))for(let[s,c]of Object.entries(n)){let d=r?`${r}_${s}`:s;c&&typeof c=="object"&&!Array.isArray(c)?o(c,d):i[d.toUpperCase()]=String(c);}};return o(t),i}catch(e){throw new Error(`Failed to parse JSON file ${l}: ${e instanceof Error?e.message:String(e)}`)}}}}function _(l="/run/secrets"){return {name:`secrets(${l})`,async load(){let{readdirSync:a,statSync:e}=await import('fs'),t=path.resolve(process.cwd(),l);if(!fs.existsSync(t))return {};try{let i=a(t),o={};for(let n of i){let r=path.join(t,n);if(!e(r).isFile())continue;let c=n.toUpperCase().replace(/[.-]/g,"_"),d=fs.readFileSync(r,"utf8").trim();o[c]=d;}return o}catch(i){throw new Error(`Failed to read secrets from ${l}: ${i instanceof Error?i.message:String(i)}`)}},loadSync(){let{readdirSync:a,statSync:e}=chunkKIQXH265_cjs.a("fs"),t=path.resolve(process.cwd(),l);if(!fs.existsSync(t))return {};try{let i=a(t),o={};for(let n of i){let r=path.join(t,n);if(!e(r).isFile())continue;let c=n.toUpperCase().replace(/[.-]/g,"_"),d=fs.readFileSync(r,"utf8").trim();o[c]=d;}return o}catch(i){throw new Error(`Failed to read secrets from ${l}: ${i instanceof Error?i.message:String(i)}`)}}}}function U(l){let a=typeof l=="string"?{path:l}:{path:l?.path??"config.yaml"};return {name:`yaml(${a.path})`,async load(){let e=path.join(process.cwd(),a.path);if(!fs.existsSync(e))return {};try{let{load:t}=await import('js-yaml'),i=fs.readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`YAML resolver requires 'js-yaml' package. Install it with:
|
|
4
|
+
npm install js-yaml
|
|
5
|
+
# or
|
|
6
|
+
pnpm add js-yaml`):new Error(`Failed to parse YAML file ${a.path}: ${t instanceof Error?t.message:String(t)}`)}},loadSync(){let e=path.join(process.cwd(),a.path);if(!fs.existsSync(e))return {};try{let{load:t}=chunkKIQXH265_cjs.a("js-yaml"),i=fs.readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`YAML resolver requires 'js-yaml' package. Install it with:
|
|
7
|
+
npm install js-yaml
|
|
8
|
+
# or
|
|
9
|
+
pnpm add js-yaml`):new Error(`Failed to parse YAML file ${a.path}: ${t instanceof Error?t.message:String(t)}`)}}}}function C(l){let a=typeof l=="string"?{path:l}:{path:l?.path??"config.toml"};return {name:`toml(${a.path})`,async load(){let e=path.resolve(process.cwd(),a.path);if(!fs.existsSync(e))return {};try{let{parse:t}=await import('smol-toml'),i=fs.readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`TOML resolver requires 'smol-toml' package. Install it with:
|
|
10
|
+
npm install smol-toml
|
|
11
|
+
# or
|
|
12
|
+
pnpm add smol-toml`):new Error(`Failed to parse TOML file ${a.path}: ${t instanceof Error?t.message:String(t)}`)}},loadSync(){let e=path.resolve(process.cwd(),a.path);if(!fs.existsSync(e))return {};try{let{parse:t}=chunkKIQXH265_cjs.a("smol-toml"),i=fs.readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`TOML resolver requires 'smol-toml' package. Install it with:
|
|
13
|
+
npm install smol-toml
|
|
14
|
+
# or
|
|
15
|
+
pnpm add smol-toml`):new Error(`Failed to parse TOML file ${a.path}: ${t instanceof Error?t.message:String(t)}`)}}}}exports.a=E;exports.b=O;exports.c=S;exports.d=k;exports.e=R;exports.f=_;exports.g=U;exports.h=C;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {a,c,b}from'./chunk-J7ZHEMRP.js';import {f}from'./chunk-YOHHFBZN.js';f();function T(){return {name:"process.env",async load(){return {...process.env}},loadSync(){return {...process.env}}}}function m(){return [T()]}function S(a$1,...l){let i=[a$1,...l],r,t,n;if(!Array.isArray(a$1))r=a$1,t=m(),n=l[0];else {let o=[];for(let s of i)Array.isArray(s)&&s.length===2&&typeof s[0]=="object"&&"load"in s[0]?o.push(s):typeof s=="object"&&!Array.isArray(s)&&(n=s);if(o.length===0)throw new Error("resolve() requires at least one [resolver, schema] tuple when using array syntax");r={};for(let[,s]of o)Object.assign(r,s);t=o.map(([s])=>s);}for(let[o,s]of Object.entries(r))if(s&&typeof s=="object"&&"~standard"in s)throw new Error(`\u274C resolve() cannot be used with async validators.
|
|
2
|
+
Variable '${o}' uses a Standard Schema validator (Zod, Valibot, etc.)
|
|
3
|
+
\u{1F4A1} Use resolve.async() instead, or use shorthand syntax for sync validation.`);for(let o of t)if(!o.loadSync)throw new Error(`\u274C Resolver '${o.name}' does not support synchronous loading.
|
|
4
|
+
All resolvers passed to resolve() must have a loadSync() method.
|
|
5
|
+
\u{1F4A1} Use resolve.async() for async resolvers, or use a sync-compatible resolver.`);let c$1=(process.env.NODE_ENV||"").toLowerCase()==="production",p=n?.policies??{},v={interpolate:true,strict:true,enableAudit:c$1,policies:p,...n},u=a(r);return c(u,t,v)}async function O(a$1,...l){let i=[a$1,...l],r=[],t;for(let s of i)Array.isArray(s)&&s.length===2&&typeof s[0]=="object"&&"load"in s[0]?r.push(s):typeof s=="object"&&!Array.isArray(s)&&(t=s);if(r.length===0)throw new Error("resolve.async() requires at least one [resolver, schema] tuple");let n={};for(let[,s]of r)Object.assign(n,s);let c=r.map(([s])=>s),p=(process.env.NODE_ENV||"").toLowerCase()==="production",v=t?.policies??{},u={interpolate:true,strict:true,enableAudit:p,policies:v,...t},e=a(n);return await b(e,c,u)}S.async=O;function R(a$1,...l){let i=[a$1,...l],r,t,n;if(!Array.isArray(a$1))r=a$1,t=m(),n=l[0];else {let e=[];for(let o of i)Array.isArray(o)&&o.length===2&&typeof o[0]=="object"&&"load"in o[0]?e.push(o):typeof o=="object"&&!Array.isArray(o)&&(n=o);if(e.length===0)return {success:false,error:"safeResolve() requires at least one [resolver, schema] tuple when using array syntax"};r={};for(let[,o]of e)Object.assign(r,o);t=e.map(([o])=>o);}for(let[e,o]of Object.entries(r))if(o&&typeof o=="object"&&"~standard"in o)return {success:false,error:`\u274C safeResolve() cannot be used with async validators.
|
|
6
|
+
Variable '${e}' uses a Standard Schema validator (Zod, Valibot, etc.)
|
|
7
|
+
\u{1F4A1} Use safeResolve.async() instead, or use shorthand syntax for sync validation.`};for(let e of t)if(!e.loadSync)return {success:false,error:`\u274C Resolver '${e.name}' does not support synchronous loading.
|
|
8
|
+
All resolvers passed to safeResolve() must have a loadSync() method.
|
|
9
|
+
\u{1F4A1} Use safeResolve.async() for async resolvers.`};let c$1=(process.env.NODE_ENV||"").toLowerCase()==="production",p=n?.policies??{},v={interpolate:true,strict:true,enableAudit:c$1,policies:p,...n},u=a(r);try{return {success:!0,data:c(u,t,v)}}catch(e){return {success:false,error:e instanceof Error?e.message:String(e)}}}async function A(a$1,...l){let i=[a$1,...l],r=[],t;for(let e of i)Array.isArray(e)&&e.length===2&&typeof e[0]=="object"&&"load"in e[0]?r.push(e):typeof e=="object"&&!Array.isArray(e)&&(t=e);if(r.length===0)return {success:false,error:"safeResolve.async() requires at least one [resolver, schema] tuple"};let n={};for(let[,e]of r)Object.assign(n,e);let c=r.map(([e])=>e),p=(process.env.NODE_ENV||"").toLowerCase()==="production",v=t?.policies??{},u={interpolate:true,strict:true,enableAudit:p,policies:v,...t};try{let e=a(n);return {success:!0,data:await b(e,c,u)}}catch(e){return {success:false,error:e instanceof Error?e.message:String(e)}}}R.async=A;var x=S,I=R;export{T as a,x as b,I as c};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {a}from'./chunk-5PELJRUQ.js';import {existsSync,readFileSync}from'fs';import {resolve,join}from'path';var h=l=>{let a={},e=l.split(`
|
|
2
|
+
`);for(let t=0;t<e.length;t++){let i=e[t]?.trim()??"";if(!i||i[0]==="#")continue;let o=i.indexOf("=");if(o<=0)continue;let n=i.slice(0,o).trim();if(!/^[A-Z_][A-Z0-9_]*$/i.test(n))continue;let r=i.slice(o+1).trim();if(r.length>=2){let s=r[0];(s==='"'||s==="'")&&r[r.length-1]===s&&(r=r.slice(1,-1),s==='"'&&(r=r.replace(/\\n/g,`
|
|
3
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\\\/g,"\\").replace(/\\"/g,'"').replace(/\\'/g,"'")));}else {let s=r.indexOf("#");s>=0&&(r=r.slice(0,s).trim());}a[n]=r;}return a};function E(l){let a=typeof l=="string"?{path:l,expand:false}:{path:l?.path??".env",expand:l?.expand??false};return {name:a.expand?`dotenv-expand(${a.path})`:`dotenv(${a.path})`,async load(){if(!a.expand){let n=resolve(process.cwd(),a.path);return existsSync(n)?h(readFileSync(n,"utf8")):{}}let e=a.path,t=process.env.NODE_ENV||"development",i=[`${e}.defaults`,e,`${e}.local`,`${e}.${t}`,`${e}.${t}.local`],o={};for(let n of i){let r=resolve(process.cwd(),n);if(existsSync(r))try{o={...o,...h(readFileSync(r,"utf8"))};}catch{}}return o},loadSync(){if(!a.expand){let n=resolve(process.cwd(),a.path);return existsSync(n)?h(readFileSync(n,"utf8")):{}}let e=a.path,t=process.env.NODE_ENV||"development",i=[`${e}.defaults`,e,`${e}.local`,`${e}.${t}`,`${e}.${t}.local`],o={};for(let n of i){let r=resolve(process.cwd(),n);if(existsSync(r))try{o={...o,...h(readFileSync(r,"utf8"))};}catch{}}return o}}}function O(){return {name:"process.env",async load(){return {...process.env}},loadSync(){return {...process.env}}}}function S(l){let a={path:l?.path??"package.json",fields:l?.fields??["version","name","config"]};return {name:"package.json",async load(){let e=resolve(process.cwd(),a.path);if(!existsSync(e))return {};try{let t=readFileSync(e,"utf8"),i=JSON.parse(t),o={};for(let n of a.fields){let r=i[n];if(r!==void 0)if(n==="config"&&typeof r=="object"){let s=(c,d)=>{if(c&&typeof c=="object"&&!Array.isArray(c))for(let[f,p]of Object.entries(c)){let m=`${d}_${f.toUpperCase()}`;p&&typeof p=="object"&&!Array.isArray(p)?s(p,m):o[m]=String(p);}};s(r,"CONFIG");}else o[n.toUpperCase()]=String(r);}return o}catch(t){throw new Error(`Failed to read package.json: ${t instanceof Error?t.message:String(t)}`)}},loadSync(){let e=resolve(process.cwd(),a.path);if(!existsSync(e))return {};try{let t=readFileSync(e,"utf8"),i=JSON.parse(t),o={};for(let n of a.fields){let r=i[n];if(r!==void 0)if(n==="config"&&typeof r=="object"){let s=(c,d)=>{if(c&&typeof c=="object"&&!Array.isArray(c))for(let[f,p]of Object.entries(c)){let m=`${d}_${f.toUpperCase()}`;p&&typeof p=="object"&&!Array.isArray(p)?s(p,m):o[m]=String(p);}};s(r,"CONFIG");}else o[n.toUpperCase()]=String(r);}return o}catch(t){throw new Error(`Failed to read package.json: ${t instanceof Error?t.message:String(t)}`)}}}}function k(l,a){return {name:`http(${l})`,async load(){try{let e=new AbortController,t=a?.timeout??5e3,i=setTimeout(()=>e.abort(),t),o=await fetch(l,{...a,signal:e.signal});if(clearTimeout(i),!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);let n=await o.json(),r={},s=(c,d="")=>{if(c&&typeof c=="object"&&!Array.isArray(c))for(let[f,p]of Object.entries(c)){let m=d?`${d}_${f}`:f;p&&typeof p=="object"&&!Array.isArray(p)?s(p,m):r[m.toUpperCase()]=String(p);}};return s(n),r}catch(e){throw e.name==="AbortError"?new Error(`HTTP request timeout after ${a?.timeout??5e3}ms`):new Error(`Failed to fetch config from ${l}: ${e instanceof Error?e.message:String(e)}`)}}}}function R(l="config.json"){return {name:`json(${l})`,async load(){let a=resolve(process.cwd(),l);if(!existsSync(a))return {};try{let e=readFileSync(a,"utf8"),t=JSON.parse(e),i={},o=(n,r="")=>{if(n&&typeof n=="object"&&!Array.isArray(n))for(let[s,c]of Object.entries(n)){let d=r?`${r}_${s}`:s;c&&typeof c=="object"&&!Array.isArray(c)?o(c,d):i[d.toUpperCase()]=String(c);}};return o(t),i}catch(e){throw new Error(`Failed to parse JSON file ${l}: ${e instanceof Error?e.message:String(e)}`)}},loadSync(){let a=resolve(process.cwd(),l);if(!existsSync(a))return {};try{let e=readFileSync(a,"utf8"),t=JSON.parse(e),i={},o=(n,r="")=>{if(n&&typeof n=="object"&&!Array.isArray(n))for(let[s,c]of Object.entries(n)){let d=r?`${r}_${s}`:s;c&&typeof c=="object"&&!Array.isArray(c)?o(c,d):i[d.toUpperCase()]=String(c);}};return o(t),i}catch(e){throw new Error(`Failed to parse JSON file ${l}: ${e instanceof Error?e.message:String(e)}`)}}}}function _(l="/run/secrets"){return {name:`secrets(${l})`,async load(){let{readdirSync:a,statSync:e}=await import('fs'),t=resolve(process.cwd(),l);if(!existsSync(t))return {};try{let i=a(t),o={};for(let n of i){let r=join(t,n);if(!e(r).isFile())continue;let c=n.toUpperCase().replace(/[.-]/g,"_"),d=readFileSync(r,"utf8").trim();o[c]=d;}return o}catch(i){throw new Error(`Failed to read secrets from ${l}: ${i instanceof Error?i.message:String(i)}`)}},loadSync(){let{readdirSync:a$1,statSync:e}=a("fs"),t=resolve(process.cwd(),l);if(!existsSync(t))return {};try{let i=a$1(t),o={};for(let n of i){let r=join(t,n);if(!e(r).isFile())continue;let c=n.toUpperCase().replace(/[.-]/g,"_"),d=readFileSync(r,"utf8").trim();o[c]=d;}return o}catch(i){throw new Error(`Failed to read secrets from ${l}: ${i instanceof Error?i.message:String(i)}`)}}}}function U(l){let a$1=typeof l=="string"?{path:l}:{path:l?.path??"config.yaml"};return {name:`yaml(${a$1.path})`,async load(){let e=join(process.cwd(),a$1.path);if(!existsSync(e))return {};try{let{load:t}=await import('js-yaml'),i=readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`YAML resolver requires 'js-yaml' package. Install it with:
|
|
4
|
+
npm install js-yaml
|
|
5
|
+
# or
|
|
6
|
+
pnpm add js-yaml`):new Error(`Failed to parse YAML file ${a$1.path}: ${t instanceof Error?t.message:String(t)}`)}},loadSync(){let e=join(process.cwd(),a$1.path);if(!existsSync(e))return {};try{let{load:t}=a("js-yaml"),i=readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`YAML resolver requires 'js-yaml' package. Install it with:
|
|
7
|
+
npm install js-yaml
|
|
8
|
+
# or
|
|
9
|
+
pnpm add js-yaml`):new Error(`Failed to parse YAML file ${a$1.path}: ${t instanceof Error?t.message:String(t)}`)}}}}function C(l){let a$1=typeof l=="string"?{path:l}:{path:l?.path??"config.toml"};return {name:`toml(${a$1.path})`,async load(){let e=resolve(process.cwd(),a$1.path);if(!existsSync(e))return {};try{let{parse:t}=await import('smol-toml'),i=readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`TOML resolver requires 'smol-toml' package. Install it with:
|
|
10
|
+
npm install smol-toml
|
|
11
|
+
# or
|
|
12
|
+
pnpm add smol-toml`):new Error(`Failed to parse TOML file ${a$1.path}: ${t instanceof Error?t.message:String(t)}`)}},loadSync(){let e=resolve(process.cwd(),a$1.path);if(!existsSync(e))return {};try{let{parse:t}=a("smol-toml"),i=readFileSync(e,"utf8"),o=t(i),n={},r=(s,c="")=>{if(s&&typeof s=="object"&&!Array.isArray(s))for(let[d,f]of Object.entries(s)){let p=c?`${c}_${d}`:d;f&&typeof f=="object"&&!Array.isArray(f)?r(f,p):n[p.toUpperCase()]=String(f);}};return r(o),n}catch(t){throw t.code==="MODULE_NOT_FOUND"||t.message?.includes("Cannot find package")?new Error(`TOML resolver requires 'smol-toml' package. Install it with:
|
|
13
|
+
npm install smol-toml
|
|
14
|
+
# or
|
|
15
|
+
pnpm add smol-toml`):new Error(`Failed to parse TOML file ${a$1.path}: ${t instanceof Error?t.message:String(t)}`)}}}}export{E as a,O as b,S as c,k as d,R as e,_ as f,U as g,C as h};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {q as q$1}from'./chunk-NKPXKLF7.js';import {f,e}from'./chunk-YOHHFBZN.js';import {d}from'./chunk-5PELJRUQ.js';var D=null,E=null;async function w(s){if(!D){let t=await import('./audit.js');D=t.logAuditEvent,E=t.attachAuditSession;}D(s);}function $(s){if(!D)try{let t=(f(),d(e));D=t.logAuditEvent,E=t.attachAuditSession;}catch{return}D&&D(s);}var S=null;async function L(){return S||(S=q$1),S}function U(){return S||(S=q$1),S}var T=new Set(["postgres","postgresql","mysql","mongodb","redis","http","https","url","email","port","json","date","timestamp","duration","file","url[]"]);function M(s){let t=s.match(/^(\w+):(\/.*\/)$/);if(t){let[,a,i]=t;return {type:a,pattern:i?.slice(1,-1)??""}}let n=s.indexOf(":");if(n>0&&n<s.length-1){let a=s.slice(0,n).replace(/[?]/g,""),i=s.slice(n+1),r=s.includes("?"),e=i;if(a==="number"||a==="port"||a==="timestamp")e=Number(i);else if(a==="boolean")e=i==="true";else if(a==="json")try{e=JSON.parse(i);}catch{}return {type:a,default:e,...r&&{optional:true}}}let c=s.endsWith("?");return {type:s.replace(/[?]/g,"")||"string",...c&&{optional:true}}}function H(s){let t={};for(let[n,c]of Object.entries(s))typeof c=="string"?t[n]=M(c):typeof c=="number"?t[n]={type:"number",default:c}:typeof c=="boolean"?t[n]={type:"boolean",default:c}:Array.isArray(c)?t[n]={type:"string",enum:c}:typeof c=="function"?t[n]={type:"custom",validator:c}:t[n]=c;return t}function C(s,t){return s.replace(/\$\{([^}]+)\}/g,(n,c)=>t[c]||n)}function _(s,t,n,c=false){let f=t.type||"string";if(n===void 0){if(t.default!==void 0){if(c){let a=String(t.default);return _(s,{...t,default:void 0},a,false)}return {success:true,value:t.default}}return t.optional?{success:true,value:void 0}:{success:false,error:`Missing required environment variable: ${s}`}}if(n===""&&!t.allowEmpty)return t.default!==void 0?{success:true,value:t.default}:t.optional?{success:true,value:void 0}:{success:false,error:`${s} cannot be empty`};if(t.enum)return t.enum.includes(n)?{success:true,value:n}:{success:false,error:`${s} must be one of: ${t.enum.join(", ")}`};if(t.pattern&&!new RegExp(t.pattern).test(n))return {success:false,error:`${s} does not match required pattern: ${t.pattern}`};switch(f){case "string":return t.min!==void 0&&n.length<t.min?{success:false,error:`${s} must be at least ${t.min} characters`}:t.max!==void 0&&n.length>t.max?{success:false,error:`${s} must be at most ${t.max} characters`}:{success:true,value:n};case "number":{let a=Number(n);return isNaN(a)?{success:false,error:`${s}: Invalid number`}:t.min!==void 0&&a<t.min?{success:false,error:`${s} must be at least ${t.min}`}:t.max!==void 0&&a>t.max?{success:false,error:`${s} must be at most ${t.max}`}:{success:true,value:a}}case "boolean":{let a=n.toLowerCase();return ["true","1","yes","on","false","0","no","off",""].includes(a)?{success:true,value:["true","1","yes","on"].includes(a)}:{success:false,error:`${s}: Invalid boolean`}}case "string[]":{let a=t.separator||",";return {success:true,value:n.split(a).map(r=>r.trim()).filter(r=>r.length>0)}}case "number[]":{let a=t.separator||",",i=n.split(a).map(e=>e.trim()).filter(e=>e.length>0),r=[];for(let e of i){let u=Number(e);if(isNaN(u))return {success:false,error:`${s}: Invalid number in array: "${e}"`};r.push(u);}return {success:true,value:r}}case "custom":{if(!t.validator)return {success:false,error:"Custom validator function is required for type 'custom'"};try{return {success:!0,value:t.validator(n)}}catch(a){return {success:false,error:a instanceof Error?a.message:`Custom validation failed for ${s}`}}}default:return {success:false,error:"NEEDS_ADVANCED_VALIDATION"}}}async function O(s,t,n,c=false,f){let a=t.type||"string";if((n===void 0||n==="")&&!(a==="file"&&(t.secretsDir||f?.secretsDir)))if(t.default!==void 0){if(c){let o=String(t.default);return await O(s,{...t,default:void 0},o,false,f)}return {success:true,value:t.default}}else return t.optional?{success:true,value:void 0}:{success:false,error:`Missing required environment variable: ${s}`};let i=await L(),r=n,e;switch(a){case "postgres":case "postgresql":e=i.validatePostgres(r);break;case "mysql":e=i.validateMysql(r);break;case "mongodb":e=i.validateMongodb(r);break;case "redis":e=i.validateRedis(r);break;case "http":e=i.validateHttp(r);break;case "https":e=i.validateHttps(r);break;case "url":e=i.validateUrl(r);break;case "email":e=i.validateEmail(r);break;case "port":if(e=i.validatePort(r),e.valid)return {success:true,value:Number(r)};break;case "json":if(e=i.validateJson(r),e.valid)return {success:true,value:JSON.parse(r)};break;case "date":e=i.validateDate(r);break;case "timestamp":if(e=i.validateTimestamp(r),e.valid)return {success:true,value:Number(r)};break;case "duration":if(e=i.validateDuration(r),e.valid)return {success:true,value:e.value};break;case "file":{let o=n;if(!o){let d=t.secretsDir||f?.secretsDir;if(d){let p=s.toLowerCase().replace(/_/g,"-");o=`${d}/${p}`;}}if(!o)return {success:false,error:`${s}: No file path provided and no secretsDir configured`};e=i.validateFile(o,s);break}case "url[]":{let o=t.separator||",",d=r.split(o).map(m=>m.trim()).filter(m=>m.length>0),p=[];for(let m of d){let g=i.validateUrl(m);if(!g.valid)return {success:false,error:`${s}: Invalid URL in array: "${m}" - ${g.error}`};p.push(m);}return {success:true,value:p}}default:return {success:false,error:`Unknown type: ${a}`}}return e.valid?{success:true,value:"value"in e&&e.value!==void 0?e.value:n}:{success:false,error:`${s}: ${e.error}`}}function k(s,t,n,c=false,f){let a=t.type||"string";if((n===void 0||n==="")&&!(a==="file"&&(t.secretsDir||f?.secretsDir)))if(t.default!==void 0){if(c){let i=String(t.default);return k(s,{...t,default:void 0},i,false,f)}return {success:true,value:t.default}}else return t.optional?{success:true,value:void 0}:{success:false,error:`Missing required environment variable: ${s}`};try{let i=U(),r=n,e;switch(a){case "postgres":case "postgresql":e=i.validatePostgres(r);break;case "mysql":e=i.validateMysql(r);break;case "mongodb":e=i.validateMongodb(r);break;case "redis":e=i.validateRedis(r);break;case "http":e=i.validateHttp(r);break;case "https":e=i.validateHttps(r);break;case "url":e=i.validateUrl(r);break;case "email":e=i.validateEmail(r);break;case "port":if(e=i.validatePort(r),e.valid)return {success:!0,value:Number(r)};break;case "json":if(e=i.validateJson(r),e.valid)return {success:!0,value:JSON.parse(r)};break;case "date":e=i.validateDate(r);break;case "timestamp":if(e=i.validateTimestamp(r),e.valid)return {success:!0,value:Number(r)};break;case "duration":if(e=i.validateDuration(r),e.valid)return {success:!0,value:e.value};break;case "file":{let o=n;if(!o){let d=t.secretsDir||f?.secretsDir;if(d){let p=s.toLowerCase().replace(/_/g,"-");o=`${d}/${p}`;}}if(!o)return {success:!1,error:`${s}: No file path provided and no secretsDir configured`};e=i.validateFile(o,s);break}case "url[]":{let o=t.separator||",",d=r.split(o).map(m=>m.trim()).filter(m=>m.length>0),p=[];for(let m of d){let g=i.validateUrl(m);if(!g.valid)return {success:!1,error:`${s}: Invalid URL in array: "${m}" - ${g.error}`};p.push(m);}return {success:!0,value:p}}default:return {success:!1,error:`Unknown type: ${a}`}}return e.valid?{success:!0,value:"value"in e&&e.value!==void 0?e.value:n}:{success:!1,error:`${s}: ${e.error}`}}catch{return {success:false,error:`${s}: Advanced type '${a}' requires async validation. Use resolve.async() or preload validators.`}}}async function z(s,t,n,c="last",f){let a={},i={};if(c==="last"){let r=await Promise.allSettled(s.map(async e=>({resolver:e,env:await e.load()})));for(let e of r){if(e.status==="rejected"){let d=e.reason;if(await w({type:"resolver_error",timestamp:Date.now(),source:"unknown",error:d instanceof Error?d.message:String(d)}),n)throw new Error(`Resolver failed: ${d instanceof Error?d.message:d}`);continue}let{resolver:u,env:o}=e.value;for(let[d,p]of Object.entries(o))p!==void 0&&(a[d]=p,i[d]={source:u.name,timestamp:Date.now(),...u.metadata?.cached!==void 0&&{cached:u.metadata.cached}});}}else for(let r of s)try{let e=await r.load();for(let[u,o]of Object.entries(e))if(o!==void 0){if(a[u]!==void 0)continue;a[u]=o,i[u]={source:r.name,timestamp:Date.now(),...r.metadata?.cached!==void 0&&{cached:r.metadata.cached}};}if(f&&f.size>0&&Array.from(f).every(o=>a[o]!==void 0))break}catch(e){if(await w({type:"resolver_error",timestamp:Date.now(),source:r.name,error:e instanceof Error?e.message:String(e)}),n)throw new Error(`Resolver ${r.name} failed: ${e instanceof Error?e.message:e}`)}if(t)for(let[r,e]of Object.entries(a))a[r]=C(e,a);return {mergedEnv:a,provenance:i}}function J(s,t,n,c="last",f){let a={},i={};for(let r of s)try{if(!r.loadSync){if(n)throw new Error(`Resolver ${r.name} has no loadSync() method`);continue}let e=r.loadSync();for(let[u,o]of Object.entries(e))if(o!==void 0){if(c==="first"&&a[u]!==void 0)continue;a[u]=o,i[u]={source:r.name,timestamp:Date.now(),...r.metadata?.cached!==void 0&&{cached:r.metadata.cached}};}if(c==="first"&&f&&f.size>0&&Array.from(f).every(o=>a[o]!==void 0))break}catch(e){if($({type:"resolver_error",timestamp:Date.now(),source:r.name,error:e instanceof Error?e.message:String(e)}),n)throw new Error(`Resolver ${r.name} failed: ${e instanceof Error?e.message:e}`)}if(t)for(let[r,e]of Object.entries(a))a[r]=C(e,a);return {mergedEnv:a,provenance:i}}function V(s,t,n,c){if(!c)return null;if((process.env.NODE_ENV||"").toLowerCase()==="production"&&n&&n.source.startsWith("dotenv(")){let a=c.allowDotenvInProduction;return a===true?null:Array.isArray(a)?a.includes(s)?null:`${s} cannot be sourced from .env files in production. Use process.env or cloud resolvers. To allow: policies.allowDotenvInProduction: ['${s}'] or set to true for all.`:`${s} cannot be sourced from .env files in production (secure default). Production platforms (Vercel, AWS, etc.) use process.env. To allow .env in production: policies.allowDotenvInProduction: true`}if(c.enforceAllowedSources&&c.enforceAllowedSources[s]&&n){let a=c.enforceAllowedSources[s];if(!a.includes(n.source))return `${s} must be sourced from one of: ${a.join(", ")} (actual: ${n.source})`}return null}function x(s){let t=[],n=/^[A-Za-z_][A-Za-z0-9_]*$/;for(let c of Object.keys(s))n.test(c)||t.push(`Invalid environment variable name: "${c}". Environment variable names must contain only letters, numbers, and underscores, and cannot start with a number.`);return t}function q(s,t){let n={};for(let[c,f]of Object.entries(s)){if(!c.includes(t)){n[c]=f;continue}let a=c.split(t),i=n;for(let e=0;e<a.length-1;e++){let u=a[e].toLowerCase();u in i||(i[u]={}),i=i[u];}let r=a[a.length-1].toLowerCase();i[r]=f;}return n}async function W(s,t,n){let c=(process.env.NODE_ENV||"").toLowerCase()==="production",{interpolate:f=false,strict:a=true,policies:i,enableAudit:r=c,priority:e="last"}=n,u={},o;if(r){if(!E){let l=await import('./audit.js');D=l.logAuditEvent,E=l.attachAuditSession;}E&&(o=E(u));}let d=x(s);if(d.length>0)throw r&&await w({type:"validation_failure",timestamp:Date.now(),error:`Invalid environment variable names: ${d.join(", ")}`,sessionId:o}),new Error(`Environment validation failed:
|
|
2
|
+
${d.map(l=>` - ${l}`).join(`
|
|
3
|
+
`)}`);let p=new Set(Object.keys(s)),{mergedEnv:m,provenance:g}=await z(t,f,a,e,p),b=[];for(let[l,h]of Object.entries(s)){let A=m[l],R=V(l,h,g[l],i);if(R){b.push(R),r&&w({type:"policy_violation",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",error:R,sessionId:o});continue}try{let y=h.type||"string",v;T.has(y)?v=await O(l,h,A,n.validateDefaults,n):(v=_(l,h,A,n.validateDefaults),!v.success&&v.error==="NEEDS_ADVANCED_VALIDATION"&&(v=await O(l,h,A,n.validateDefaults,n))),v.success?(u[l]=v.value,r&&await w({type:"env_loaded",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",metadata:{cached:g[l]?.cached},sessionId:o})):(b.push(v.error),r&&await w({type:"validation_failure",timestamp:Date.now(),key:l,error:v.error,sessionId:o}));}catch(y){let v=y instanceof Error?y.message:String(y);b.push(`${l}: ${v}`),r&&await w({type:"validation_failure",timestamp:Date.now(),key:l,error:v,sessionId:o});}}if(b.length>0)throw r&&await w({type:"validation_failure",timestamp:Date.now(),error:`${b.length} validation error(s)`,metadata:{errorCount:b.length},sessionId:o}),new Error(`Environment validation failed:
|
|
4
|
+
${b.map(l=>` - ${l}`).join(`
|
|
5
|
+
`)}`);return r&&await w({type:"validation_success",timestamp:Date.now(),metadata:{variableCount:Object.keys(s).length},sessionId:o}),n.nestedDelimiter?q(u,n.nestedDelimiter):u}function Z(s,t,n){let c=(process.env.NODE_ENV||"").toLowerCase()==="production",{interpolate:f$1=false,strict:a=true,policies:i,enableAudit:r=c,priority:e$1="last"}=n,u={},o;if(r){if(!E)try{let l=(f(),d(e));D=l.logAuditEvent,E=l.attachAuditSession;}catch{}E&&(o=E(u));}let d$1=x(s);if(d$1.length>0)throw r&&$({type:"validation_failure",timestamp:Date.now(),error:`Invalid environment variable names: ${d$1.join(", ")}`,sessionId:o}),new Error(`Environment validation failed:
|
|
6
|
+
${d$1.map(l=>` - ${l}`).join(`
|
|
7
|
+
`)}`);let p=new Set(Object.keys(s)),{mergedEnv:m,provenance:g}=J(t,f$1,a,e$1,p),b=[];for(let[l,h]of Object.entries(s)){let A=m[l],R=V(l,h,g[l],i);if(R){b.push(R),r&&$({type:"policy_violation",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",error:R,sessionId:o});continue}try{let y=h.type||"string",v;T.has(y)?v=k(l,h,A,n.validateDefaults,n):(v=_(l,h,A,n.validateDefaults),!v.success&&v.error==="NEEDS_ADVANCED_VALIDATION"&&(v=k(l,h,A,n.validateDefaults,n))),v.success?(u[l]=v.value,r&&$({type:"env_loaded",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",metadata:{cached:g[l]?.cached},sessionId:o})):(b.push(v.error),r&&$({type:"validation_failure",timestamp:Date.now(),key:l,error:v.error,sessionId:o}));}catch(y){let v=y instanceof Error?y.message:String(y);b.push(`${l}: ${v}`),r&&$({type:"validation_failure",timestamp:Date.now(),key:l,error:v,sessionId:o});}}if(b.length>0)throw r&&$({type:"validation_failure",timestamp:Date.now(),error:`${b.length} validation error(s)`,metadata:{errorCount:b.length},sessionId:o}),new Error(`Environment validation failed:
|
|
8
|
+
${b.map(l=>` - ${l}`).join(`
|
|
9
|
+
`)}`);return r&&$({type:"validation_success",timestamp:Date.now(),metadata:{variableCount:Object.keys(s).length},sessionId:o}),n.nestedDelimiter?q(u,n.nestedDelimiter):u}export{H as a,W as b,Z as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var k=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var m=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:true});},j=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of h(b))!i.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=g(b,d))||f.enumerable});return a};var n=a=>j(e({},"__esModule",{value:true}),a);exports.a=k;exports.b=l;exports.c=m;exports.d=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c as c$1,a}from'./chunk-5PELJRUQ.js';var M={};c$1(M,{validateBoolean:()=>L,validateDate:()=>x,validateDuration:()=>y,validateEmail:()=>R,validateFile:()=>V,validateHttp:()=>m,validateHttps:()=>p,validateJson:()=>U,validateMongodb:()=>v,validateMysql:()=>f,validateNumber:()=>I,validatePort:()=>h,validatePostgres:()=>u,validateRedis:()=>c,validateTimestamp:()=>b,validateUrl:()=>g});function u(t){if(!/^postgres(ql)?:\/\/.+/.test(t))return {valid:false,error:"Invalid PostgreSQL URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid PostgreSQL URL"}}}function f(t){if(!/^mysql:\/\/.+/.test(t))return {valid:false,error:"Invalid MySQL URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid MySQL URL"}}}function v(t){return /^mongodb(\+srv)?:\/\/.+/.test(t)?/^mongodb(\+srv)?:\/\/([^@]+@)?[^/]+(\/[^?]*)?(\\?.*)?$/.test(t)?{valid:true}:{valid:false,error:"Invalid MongoDB URL"}:{valid:false,error:"Invalid MongoDB URL"}}function c(t){if(!/^rediss?:\/\/.+/.test(t))return {valid:false,error:"Invalid Redis URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid Redis URL"}}}function m(t){if(!/^https?:\/\/.+/.test(t))return {valid:false,error:"Invalid HTTP URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid HTTP URL"}}}function p(t){if(!/^https:\/\/.+/.test(t))return {valid:false,error:"Invalid HTTPS URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid HTTPS URL"}}}function g(t){try{let r=new URL(t);return ["http:","https:","ws:","wss:","ftp:","ftps:","file:","postgres:","postgresql:","mysql:","mongodb:","redis:","rediss:"].includes(r.protocol)?{valid:!0}:{valid:!1,error:`URL protocol '${r.protocol}' is not allowed`}}catch{return {valid:false,error:"Invalid URL"}}}function R(t){return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)?t.length>254?{valid:false,error:"Invalid email"}:{valid:true}:{valid:false,error:"Invalid email"}}function h(t){let r=Number(t);return r!==r||r<1||r>65535?{valid:false,error:"Invalid port"}:{valid:true}}function I(t){let r=Number(t);return r!==r?{valid:false,error:"Invalid number"}:{valid:true}}function L(t){let r=t.toLowerCase();return ["true","1","yes","on","false","0","no","off",""].includes(r)?{valid:true}:{valid:false,error:"Invalid boolean"}}function U(t){try{return JSON.parse(t),{valid:!0}}catch{return {valid:false,error:"Invalid JSON"}}}function x(t){let r=new Date(t);if(isNaN(r.getTime()))return {valid:false,error:"Invalid date - cannot parse date value"};if(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})?)?$/.test(t)){if(/^\d{4}-\d{2}-\d{2}$/.test(t)){let[n,e,a]=t.split("-").map(Number);if(r.getUTCFullYear()!==n||r.getUTCMonth()+1!==e||r.getUTCDate()!==a)return {valid:false,error:"Invalid date value"}}return {valid:true}}return {valid:false,error:"Date must be in ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.sssZ)"}}function b(t){if(!/^\d+$/.test(t))return {valid:false,error:"Invalid timestamp"};let r=Number(t);return isNaN(r)||r<0?{valid:false,error:"Invalid timestamp"}:r>253402300799?{valid:false,error:"Timestamp too large"}:{valid:true}}function y(t){let r=/^(\d+(?:\.\d+)?)(ms|s|m|h|d)$/,i=/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?(?:(\d+(?:\.\d+)?)s)?(?:(\d+(?:\.\d+)?)ms)?$/,n=t.match(r);if(n){let a=parseFloat(n[1]),l=n[2],o={ms:1,s:1e3,m:60*1e3,h:3600*1e3,d:1440*60*1e3};return {valid:true,value:Math.floor(a*o[l])}}let e=t.match(i);if(e&&e[0]){let a=0;if(e[1]&&(a+=parseFloat(e[1])*60*60*1e3),e[2]&&(a+=parseFloat(e[2])*60*1e3),e[3]&&(a+=parseFloat(e[3])*1e3),e[4]&&(a+=parseFloat(e[4])),a>0)return {valid:true,value:Math.floor(a)}}return {valid:false,error:"Duration must be in format: 5s, 2h, 30m, 1h30m, etc."}}function V(t,r){try{return {valid:!0,value:a("fs").readFileSync(t,"utf8").trim()}}catch(i){return {valid:false,error:`Failed to read file${r?` for ${r}`:""}: ${i instanceof Error?i.message:String(i)}`}}}export{u as a,f as b,v as c,c as d,m as e,p as f,g,R as h,h as i,I as j,L as k,U as l,x as m,b as n,y as o,V as p,M as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function n(e){return typeof e.loadSync=="function"}function t(e){return !e.loadSync}exports.a=n;exports.b=t;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';var chunkULL4WKTV_cjs=require('./chunk-ULL4WKTV.cjs'),chunk4ZOF2PI4_cjs=require('./chunk-4ZOF2PI4.cjs');chunk4ZOF2PI4_cjs.f();function T(){return {name:"process.env",async load(){return {...process.env}},loadSync(){return {...process.env}}}}function m(){return [T()]}function S(a,...l){let i=[a,...l],r,t,n;if(!Array.isArray(a))r=a,t=m(),n=l[0];else {let o=[];for(let s of i)Array.isArray(s)&&s.length===2&&typeof s[0]=="object"&&"load"in s[0]?o.push(s):typeof s=="object"&&!Array.isArray(s)&&(n=s);if(o.length===0)throw new Error("resolve() requires at least one [resolver, schema] tuple when using array syntax");r={};for(let[,s]of o)Object.assign(r,s);t=o.map(([s])=>s);}for(let[o,s]of Object.entries(r))if(s&&typeof s=="object"&&"~standard"in s)throw new Error(`\u274C resolve() cannot be used with async validators.
|
|
2
|
+
Variable '${o}' uses a Standard Schema validator (Zod, Valibot, etc.)
|
|
3
|
+
\u{1F4A1} Use resolve.async() instead, or use shorthand syntax for sync validation.`);for(let o of t)if(!o.loadSync)throw new Error(`\u274C Resolver '${o.name}' does not support synchronous loading.
|
|
4
|
+
All resolvers passed to resolve() must have a loadSync() method.
|
|
5
|
+
\u{1F4A1} Use resolve.async() for async resolvers, or use a sync-compatible resolver.`);let c=(process.env.NODE_ENV||"").toLowerCase()==="production",p=n?.policies??{},v={interpolate:true,strict:true,enableAudit:c,policies:p,...n},u=chunkULL4WKTV_cjs.a(r);return chunkULL4WKTV_cjs.c(u,t,v)}async function O(a,...l){let i=[a,...l],r=[],t;for(let s of i)Array.isArray(s)&&s.length===2&&typeof s[0]=="object"&&"load"in s[0]?r.push(s):typeof s=="object"&&!Array.isArray(s)&&(t=s);if(r.length===0)throw new Error("resolve.async() requires at least one [resolver, schema] tuple");let n={};for(let[,s]of r)Object.assign(n,s);let c=r.map(([s])=>s),p=(process.env.NODE_ENV||"").toLowerCase()==="production",v=t?.policies??{},u={interpolate:true,strict:true,enableAudit:p,policies:v,...t},e=chunkULL4WKTV_cjs.a(n);return await chunkULL4WKTV_cjs.b(e,c,u)}S.async=O;function R(a,...l){let i=[a,...l],r,t,n;if(!Array.isArray(a))r=a,t=m(),n=l[0];else {let e=[];for(let o of i)Array.isArray(o)&&o.length===2&&typeof o[0]=="object"&&"load"in o[0]?e.push(o):typeof o=="object"&&!Array.isArray(o)&&(n=o);if(e.length===0)return {success:false,error:"safeResolve() requires at least one [resolver, schema] tuple when using array syntax"};r={};for(let[,o]of e)Object.assign(r,o);t=e.map(([o])=>o);}for(let[e,o]of Object.entries(r))if(o&&typeof o=="object"&&"~standard"in o)return {success:false,error:`\u274C safeResolve() cannot be used with async validators.
|
|
6
|
+
Variable '${e}' uses a Standard Schema validator (Zod, Valibot, etc.)
|
|
7
|
+
\u{1F4A1} Use safeResolve.async() instead, or use shorthand syntax for sync validation.`};for(let e of t)if(!e.loadSync)return {success:false,error:`\u274C Resolver '${e.name}' does not support synchronous loading.
|
|
8
|
+
All resolvers passed to safeResolve() must have a loadSync() method.
|
|
9
|
+
\u{1F4A1} Use safeResolve.async() for async resolvers.`};let c=(process.env.NODE_ENV||"").toLowerCase()==="production",p=n?.policies??{},v={interpolate:true,strict:true,enableAudit:c,policies:p,...n},u=chunkULL4WKTV_cjs.a(r);try{return {success:!0,data:chunkULL4WKTV_cjs.c(u,t,v)}}catch(e){return {success:false,error:e instanceof Error?e.message:String(e)}}}async function A(a,...l){let i=[a,...l],r=[],t;for(let e of i)Array.isArray(e)&&e.length===2&&typeof e[0]=="object"&&"load"in e[0]?r.push(e):typeof e=="object"&&!Array.isArray(e)&&(t=e);if(r.length===0)return {success:false,error:"safeResolve.async() requires at least one [resolver, schema] tuple"};let n={};for(let[,e]of r)Object.assign(n,e);let c=r.map(([e])=>e),p=(process.env.NODE_ENV||"").toLowerCase()==="production",v=t?.policies??{},u={interpolate:true,strict:true,enableAudit:p,policies:v,...t};try{let e=chunkULL4WKTV_cjs.a(n);return {success:!0,data:await chunkULL4WKTV_cjs.b(e,c,u)}}catch(e){return {success:false,error:e instanceof Error?e.message:String(e)}}}R.async=A;var x=S,I=R;exports.a=T;exports.b=x;exports.c=I;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';var chunkXPGSWVRT_cjs=require('./chunk-XPGSWVRT.cjs'),chunk4ZOF2PI4_cjs=require('./chunk-4ZOF2PI4.cjs'),chunkKIQXH265_cjs=require('./chunk-KIQXH265.cjs');var D=null,E=null;async function w(s){if(!D){let t=await import('./audit.cjs');D=t.logAuditEvent,E=t.attachAuditSession;}D(s);}function $(s){if(!D)try{let t=(chunk4ZOF2PI4_cjs.f(),chunkKIQXH265_cjs.d(chunk4ZOF2PI4_cjs.e));D=t.logAuditEvent,E=t.attachAuditSession;}catch{return}D&&D(s);}var S=null;async function L(){return S||(S=chunkXPGSWVRT_cjs.q),S}function U(){return S||(S=chunkXPGSWVRT_cjs.q),S}var T=new Set(["postgres","postgresql","mysql","mongodb","redis","http","https","url","email","port","json","date","timestamp","duration","file","url[]"]);function M(s){let t=s.match(/^(\w+):(\/.*\/)$/);if(t){let[,a,i]=t;return {type:a,pattern:i?.slice(1,-1)??""}}let n=s.indexOf(":");if(n>0&&n<s.length-1){let a=s.slice(0,n).replace(/[?]/g,""),i=s.slice(n+1),r=s.includes("?"),e=i;if(a==="number"||a==="port"||a==="timestamp")e=Number(i);else if(a==="boolean")e=i==="true";else if(a==="json")try{e=JSON.parse(i);}catch{}return {type:a,default:e,...r&&{optional:true}}}let c=s.endsWith("?");return {type:s.replace(/[?]/g,"")||"string",...c&&{optional:true}}}function H(s){let t={};for(let[n,c]of Object.entries(s))typeof c=="string"?t[n]=M(c):typeof c=="number"?t[n]={type:"number",default:c}:typeof c=="boolean"?t[n]={type:"boolean",default:c}:Array.isArray(c)?t[n]={type:"string",enum:c}:typeof c=="function"?t[n]={type:"custom",validator:c}:t[n]=c;return t}function C(s,t){return s.replace(/\$\{([^}]+)\}/g,(n,c)=>t[c]||n)}function _(s,t,n,c=false){let f=t.type||"string";if(n===void 0){if(t.default!==void 0){if(c){let a=String(t.default);return _(s,{...t,default:void 0},a,false)}return {success:true,value:t.default}}return t.optional?{success:true,value:void 0}:{success:false,error:`Missing required environment variable: ${s}`}}if(n===""&&!t.allowEmpty)return t.default!==void 0?{success:true,value:t.default}:t.optional?{success:true,value:void 0}:{success:false,error:`${s} cannot be empty`};if(t.enum)return t.enum.includes(n)?{success:true,value:n}:{success:false,error:`${s} must be one of: ${t.enum.join(", ")}`};if(t.pattern&&!new RegExp(t.pattern).test(n))return {success:false,error:`${s} does not match required pattern: ${t.pattern}`};switch(f){case "string":return t.min!==void 0&&n.length<t.min?{success:false,error:`${s} must be at least ${t.min} characters`}:t.max!==void 0&&n.length>t.max?{success:false,error:`${s} must be at most ${t.max} characters`}:{success:true,value:n};case "number":{let a=Number(n);return isNaN(a)?{success:false,error:`${s}: Invalid number`}:t.min!==void 0&&a<t.min?{success:false,error:`${s} must be at least ${t.min}`}:t.max!==void 0&&a>t.max?{success:false,error:`${s} must be at most ${t.max}`}:{success:true,value:a}}case "boolean":{let a=n.toLowerCase();return ["true","1","yes","on","false","0","no","off",""].includes(a)?{success:true,value:["true","1","yes","on"].includes(a)}:{success:false,error:`${s}: Invalid boolean`}}case "string[]":{let a=t.separator||",";return {success:true,value:n.split(a).map(r=>r.trim()).filter(r=>r.length>0)}}case "number[]":{let a=t.separator||",",i=n.split(a).map(e=>e.trim()).filter(e=>e.length>0),r=[];for(let e of i){let u=Number(e);if(isNaN(u))return {success:false,error:`${s}: Invalid number in array: "${e}"`};r.push(u);}return {success:true,value:r}}case "custom":{if(!t.validator)return {success:false,error:"Custom validator function is required for type 'custom'"};try{return {success:!0,value:t.validator(n)}}catch(a){return {success:false,error:a instanceof Error?a.message:`Custom validation failed for ${s}`}}}default:return {success:false,error:"NEEDS_ADVANCED_VALIDATION"}}}async function O(s,t,n,c=false,f){let a=t.type||"string";if((n===void 0||n==="")&&!(a==="file"&&(t.secretsDir||f?.secretsDir)))if(t.default!==void 0){if(c){let o=String(t.default);return await O(s,{...t,default:void 0},o,false,f)}return {success:true,value:t.default}}else return t.optional?{success:true,value:void 0}:{success:false,error:`Missing required environment variable: ${s}`};let i=await L(),r=n,e;switch(a){case "postgres":case "postgresql":e=i.validatePostgres(r);break;case "mysql":e=i.validateMysql(r);break;case "mongodb":e=i.validateMongodb(r);break;case "redis":e=i.validateRedis(r);break;case "http":e=i.validateHttp(r);break;case "https":e=i.validateHttps(r);break;case "url":e=i.validateUrl(r);break;case "email":e=i.validateEmail(r);break;case "port":if(e=i.validatePort(r),e.valid)return {success:true,value:Number(r)};break;case "json":if(e=i.validateJson(r),e.valid)return {success:true,value:JSON.parse(r)};break;case "date":e=i.validateDate(r);break;case "timestamp":if(e=i.validateTimestamp(r),e.valid)return {success:true,value:Number(r)};break;case "duration":if(e=i.validateDuration(r),e.valid)return {success:true,value:e.value};break;case "file":{let o=n;if(!o){let d=t.secretsDir||f?.secretsDir;if(d){let p=s.toLowerCase().replace(/_/g,"-");o=`${d}/${p}`;}}if(!o)return {success:false,error:`${s}: No file path provided and no secretsDir configured`};e=i.validateFile(o,s);break}case "url[]":{let o=t.separator||",",d=r.split(o).map(m=>m.trim()).filter(m=>m.length>0),p=[];for(let m of d){let g=i.validateUrl(m);if(!g.valid)return {success:false,error:`${s}: Invalid URL in array: "${m}" - ${g.error}`};p.push(m);}return {success:true,value:p}}default:return {success:false,error:`Unknown type: ${a}`}}return e.valid?{success:true,value:"value"in e&&e.value!==void 0?e.value:n}:{success:false,error:`${s}: ${e.error}`}}function k(s,t,n,c=false,f){let a=t.type||"string";if((n===void 0||n==="")&&!(a==="file"&&(t.secretsDir||f?.secretsDir)))if(t.default!==void 0){if(c){let i=String(t.default);return k(s,{...t,default:void 0},i,false,f)}return {success:true,value:t.default}}else return t.optional?{success:true,value:void 0}:{success:false,error:`Missing required environment variable: ${s}`};try{let i=U(),r=n,e;switch(a){case "postgres":case "postgresql":e=i.validatePostgres(r);break;case "mysql":e=i.validateMysql(r);break;case "mongodb":e=i.validateMongodb(r);break;case "redis":e=i.validateRedis(r);break;case "http":e=i.validateHttp(r);break;case "https":e=i.validateHttps(r);break;case "url":e=i.validateUrl(r);break;case "email":e=i.validateEmail(r);break;case "port":if(e=i.validatePort(r),e.valid)return {success:!0,value:Number(r)};break;case "json":if(e=i.validateJson(r),e.valid)return {success:!0,value:JSON.parse(r)};break;case "date":e=i.validateDate(r);break;case "timestamp":if(e=i.validateTimestamp(r),e.valid)return {success:!0,value:Number(r)};break;case "duration":if(e=i.validateDuration(r),e.valid)return {success:!0,value:e.value};break;case "file":{let o=n;if(!o){let d=t.secretsDir||f?.secretsDir;if(d){let p=s.toLowerCase().replace(/_/g,"-");o=`${d}/${p}`;}}if(!o)return {success:!1,error:`${s}: No file path provided and no secretsDir configured`};e=i.validateFile(o,s);break}case "url[]":{let o=t.separator||",",d=r.split(o).map(m=>m.trim()).filter(m=>m.length>0),p=[];for(let m of d){let g=i.validateUrl(m);if(!g.valid)return {success:!1,error:`${s}: Invalid URL in array: "${m}" - ${g.error}`};p.push(m);}return {success:!0,value:p}}default:return {success:!1,error:`Unknown type: ${a}`}}return e.valid?{success:!0,value:"value"in e&&e.value!==void 0?e.value:n}:{success:!1,error:`${s}: ${e.error}`}}catch{return {success:false,error:`${s}: Advanced type '${a}' requires async validation. Use resolve.async() or preload validators.`}}}async function z(s,t,n,c="last",f){let a={},i={};if(c==="last"){let r=await Promise.allSettled(s.map(async e=>({resolver:e,env:await e.load()})));for(let e of r){if(e.status==="rejected"){let d=e.reason;if(await w({type:"resolver_error",timestamp:Date.now(),source:"unknown",error:d instanceof Error?d.message:String(d)}),n)throw new Error(`Resolver failed: ${d instanceof Error?d.message:d}`);continue}let{resolver:u,env:o}=e.value;for(let[d,p]of Object.entries(o))p!==void 0&&(a[d]=p,i[d]={source:u.name,timestamp:Date.now(),...u.metadata?.cached!==void 0&&{cached:u.metadata.cached}});}}else for(let r of s)try{let e=await r.load();for(let[u,o]of Object.entries(e))if(o!==void 0){if(a[u]!==void 0)continue;a[u]=o,i[u]={source:r.name,timestamp:Date.now(),...r.metadata?.cached!==void 0&&{cached:r.metadata.cached}};}if(f&&f.size>0&&Array.from(f).every(o=>a[o]!==void 0))break}catch(e){if(await w({type:"resolver_error",timestamp:Date.now(),source:r.name,error:e instanceof Error?e.message:String(e)}),n)throw new Error(`Resolver ${r.name} failed: ${e instanceof Error?e.message:e}`)}if(t)for(let[r,e]of Object.entries(a))a[r]=C(e,a);return {mergedEnv:a,provenance:i}}function J(s,t,n,c="last",f){let a={},i={};for(let r of s)try{if(!r.loadSync){if(n)throw new Error(`Resolver ${r.name} has no loadSync() method`);continue}let e=r.loadSync();for(let[u,o]of Object.entries(e))if(o!==void 0){if(c==="first"&&a[u]!==void 0)continue;a[u]=o,i[u]={source:r.name,timestamp:Date.now(),...r.metadata?.cached!==void 0&&{cached:r.metadata.cached}};}if(c==="first"&&f&&f.size>0&&Array.from(f).every(o=>a[o]!==void 0))break}catch(e){if($({type:"resolver_error",timestamp:Date.now(),source:r.name,error:e instanceof Error?e.message:String(e)}),n)throw new Error(`Resolver ${r.name} failed: ${e instanceof Error?e.message:e}`)}if(t)for(let[r,e]of Object.entries(a))a[r]=C(e,a);return {mergedEnv:a,provenance:i}}function V(s,t,n,c){if(!c)return null;if((process.env.NODE_ENV||"").toLowerCase()==="production"&&n&&n.source.startsWith("dotenv(")){let a=c.allowDotenvInProduction;return a===true?null:Array.isArray(a)?a.includes(s)?null:`${s} cannot be sourced from .env files in production. Use process.env or cloud resolvers. To allow: policies.allowDotenvInProduction: ['${s}'] or set to true for all.`:`${s} cannot be sourced from .env files in production (secure default). Production platforms (Vercel, AWS, etc.) use process.env. To allow .env in production: policies.allowDotenvInProduction: true`}if(c.enforceAllowedSources&&c.enforceAllowedSources[s]&&n){let a=c.enforceAllowedSources[s];if(!a.includes(n.source))return `${s} must be sourced from one of: ${a.join(", ")} (actual: ${n.source})`}return null}function x(s){let t=[],n=/^[A-Za-z_][A-Za-z0-9_]*$/;for(let c of Object.keys(s))n.test(c)||t.push(`Invalid environment variable name: "${c}". Environment variable names must contain only letters, numbers, and underscores, and cannot start with a number.`);return t}function q(s,t){let n={};for(let[c,f]of Object.entries(s)){if(!c.includes(t)){n[c]=f;continue}let a=c.split(t),i=n;for(let e=0;e<a.length-1;e++){let u=a[e].toLowerCase();u in i||(i[u]={}),i=i[u];}let r=a[a.length-1].toLowerCase();i[r]=f;}return n}async function W(s,t,n){let c=(process.env.NODE_ENV||"").toLowerCase()==="production",{interpolate:f=false,strict:a=true,policies:i,enableAudit:r=c,priority:e="last"}=n,u={},o;if(r){if(!E){let l=await import('./audit.cjs');D=l.logAuditEvent,E=l.attachAuditSession;}E&&(o=E(u));}let d=x(s);if(d.length>0)throw r&&await w({type:"validation_failure",timestamp:Date.now(),error:`Invalid environment variable names: ${d.join(", ")}`,sessionId:o}),new Error(`Environment validation failed:
|
|
2
|
+
${d.map(l=>` - ${l}`).join(`
|
|
3
|
+
`)}`);let p=new Set(Object.keys(s)),{mergedEnv:m,provenance:g}=await z(t,f,a,e,p),b=[];for(let[l,h]of Object.entries(s)){let A=m[l],R=V(l,h,g[l],i);if(R){b.push(R),r&&w({type:"policy_violation",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",error:R,sessionId:o});continue}try{let y=h.type||"string",v;T.has(y)?v=await O(l,h,A,n.validateDefaults,n):(v=_(l,h,A,n.validateDefaults),!v.success&&v.error==="NEEDS_ADVANCED_VALIDATION"&&(v=await O(l,h,A,n.validateDefaults,n))),v.success?(u[l]=v.value,r&&await w({type:"env_loaded",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",metadata:{cached:g[l]?.cached},sessionId:o})):(b.push(v.error),r&&await w({type:"validation_failure",timestamp:Date.now(),key:l,error:v.error,sessionId:o}));}catch(y){let v=y instanceof Error?y.message:String(y);b.push(`${l}: ${v}`),r&&await w({type:"validation_failure",timestamp:Date.now(),key:l,error:v,sessionId:o});}}if(b.length>0)throw r&&await w({type:"validation_failure",timestamp:Date.now(),error:`${b.length} validation error(s)`,metadata:{errorCount:b.length},sessionId:o}),new Error(`Environment validation failed:
|
|
4
|
+
${b.map(l=>` - ${l}`).join(`
|
|
5
|
+
`)}`);return r&&await w({type:"validation_success",timestamp:Date.now(),metadata:{variableCount:Object.keys(s).length},sessionId:o}),n.nestedDelimiter?q(u,n.nestedDelimiter):u}function Z(s,t,n){let c=(process.env.NODE_ENV||"").toLowerCase()==="production",{interpolate:f=false,strict:a=true,policies:i,enableAudit:r=c,priority:e="last"}=n,u={},o;if(r){if(!E)try{let l=(chunk4ZOF2PI4_cjs.f(),chunkKIQXH265_cjs.d(chunk4ZOF2PI4_cjs.e));D=l.logAuditEvent,E=l.attachAuditSession;}catch{}E&&(o=E(u));}let d=x(s);if(d.length>0)throw r&&$({type:"validation_failure",timestamp:Date.now(),error:`Invalid environment variable names: ${d.join(", ")}`,sessionId:o}),new Error(`Environment validation failed:
|
|
6
|
+
${d.map(l=>` - ${l}`).join(`
|
|
7
|
+
`)}`);let p=new Set(Object.keys(s)),{mergedEnv:m,provenance:g}=J(t,f,a,e,p),b=[];for(let[l,h]of Object.entries(s)){let A=m[l],R=V(l,h,g[l],i);if(R){b.push(R),r&&$({type:"policy_violation",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",error:R,sessionId:o});continue}try{let y=h.type||"string",v;T.has(y)?v=k(l,h,A,n.validateDefaults,n):(v=_(l,h,A,n.validateDefaults),!v.success&&v.error==="NEEDS_ADVANCED_VALIDATION"&&(v=k(l,h,A,n.validateDefaults,n))),v.success?(u[l]=v.value,r&&$({type:"env_loaded",timestamp:Date.now(),key:l,source:g[l]?.source??"unknown",metadata:{cached:g[l]?.cached},sessionId:o})):(b.push(v.error),r&&$({type:"validation_failure",timestamp:Date.now(),key:l,error:v.error,sessionId:o}));}catch(y){let v=y instanceof Error?y.message:String(y);b.push(`${l}: ${v}`),r&&$({type:"validation_failure",timestamp:Date.now(),key:l,error:v,sessionId:o});}}if(b.length>0)throw r&&$({type:"validation_failure",timestamp:Date.now(),error:`${b.length} validation error(s)`,metadata:{errorCount:b.length},sessionId:o}),new Error(`Environment validation failed:
|
|
8
|
+
${b.map(l=>` - ${l}`).join(`
|
|
9
|
+
`)}`);return r&&$({type:"validation_success",timestamp:Date.now(),metadata:{variableCount:Object.keys(s).length},sessionId:o}),n.nestedDelimiter?q(u,n.nestedDelimiter):u}exports.a=H;exports.b=W;exports.c=Z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkKIQXH265_cjs=require('./chunk-KIQXH265.cjs');var M={};chunkKIQXH265_cjs.c(M,{validateBoolean:()=>L,validateDate:()=>x,validateDuration:()=>y,validateEmail:()=>R,validateFile:()=>V,validateHttp:()=>m,validateHttps:()=>p,validateJson:()=>U,validateMongodb:()=>v,validateMysql:()=>f,validateNumber:()=>I,validatePort:()=>h,validatePostgres:()=>u,validateRedis:()=>c,validateTimestamp:()=>b,validateUrl:()=>g});function u(t){if(!/^postgres(ql)?:\/\/.+/.test(t))return {valid:false,error:"Invalid PostgreSQL URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid PostgreSQL URL"}}}function f(t){if(!/^mysql:\/\/.+/.test(t))return {valid:false,error:"Invalid MySQL URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid MySQL URL"}}}function v(t){return /^mongodb(\+srv)?:\/\/.+/.test(t)?/^mongodb(\+srv)?:\/\/([^@]+@)?[^/]+(\/[^?]*)?(\\?.*)?$/.test(t)?{valid:true}:{valid:false,error:"Invalid MongoDB URL"}:{valid:false,error:"Invalid MongoDB URL"}}function c(t){if(!/^rediss?:\/\/.+/.test(t))return {valid:false,error:"Invalid Redis URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid Redis URL"}}}function m(t){if(!/^https?:\/\/.+/.test(t))return {valid:false,error:"Invalid HTTP URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid HTTP URL"}}}function p(t){if(!/^https:\/\/.+/.test(t))return {valid:false,error:"Invalid HTTPS URL"};try{return new URL(t),{valid:!0}}catch{return {valid:false,error:"Invalid HTTPS URL"}}}function g(t){try{let r=new URL(t);return ["http:","https:","ws:","wss:","ftp:","ftps:","file:","postgres:","postgresql:","mysql:","mongodb:","redis:","rediss:"].includes(r.protocol)?{valid:!0}:{valid:!1,error:`URL protocol '${r.protocol}' is not allowed`}}catch{return {valid:false,error:"Invalid URL"}}}function R(t){return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)?t.length>254?{valid:false,error:"Invalid email"}:{valid:true}:{valid:false,error:"Invalid email"}}function h(t){let r=Number(t);return r!==r||r<1||r>65535?{valid:false,error:"Invalid port"}:{valid:true}}function I(t){let r=Number(t);return r!==r?{valid:false,error:"Invalid number"}:{valid:true}}function L(t){let r=t.toLowerCase();return ["true","1","yes","on","false","0","no","off",""].includes(r)?{valid:true}:{valid:false,error:"Invalid boolean"}}function U(t){try{return JSON.parse(t),{valid:!0}}catch{return {valid:false,error:"Invalid JSON"}}}function x(t){let r=new Date(t);if(isNaN(r.getTime()))return {valid:false,error:"Invalid date - cannot parse date value"};if(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})?)?$/.test(t)){if(/^\d{4}-\d{2}-\d{2}$/.test(t)){let[n,e,a]=t.split("-").map(Number);if(r.getUTCFullYear()!==n||r.getUTCMonth()+1!==e||r.getUTCDate()!==a)return {valid:false,error:"Invalid date value"}}return {valid:true}}return {valid:false,error:"Date must be in ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.sssZ)"}}function b(t){if(!/^\d+$/.test(t))return {valid:false,error:"Invalid timestamp"};let r=Number(t);return isNaN(r)||r<0?{valid:false,error:"Invalid timestamp"}:r>253402300799?{valid:false,error:"Timestamp too large"}:{valid:true}}function y(t){let r=/^(\d+(?:\.\d+)?)(ms|s|m|h|d)$/,i=/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?(?:(\d+(?:\.\d+)?)s)?(?:(\d+(?:\.\d+)?)ms)?$/,n=t.match(r);if(n){let a=parseFloat(n[1]),l=n[2],o={ms:1,s:1e3,m:60*1e3,h:3600*1e3,d:1440*60*1e3};return {valid:true,value:Math.floor(a*o[l])}}let e=t.match(i);if(e&&e[0]){let a=0;if(e[1]&&(a+=parseFloat(e[1])*60*60*1e3),e[2]&&(a+=parseFloat(e[2])*60*1e3),e[3]&&(a+=parseFloat(e[3])*1e3),e[4]&&(a+=parseFloat(e[4])),a>0)return {valid:true,value:Math.floor(a)}}return {valid:false,error:"Duration must be in format: 5s, 2h, 30m, 1h30m, etc."}}function V(t,r){try{return {valid:!0,value:chunkKIQXH265_cjs.a("fs").readFileSync(t,"utf8").trim()}}catch(i){return {valid:false,error:`Failed to read file${r?` for ${r}`:""}: ${i instanceof Error?i.message:String(i)}`}}}exports.a=u;exports.b=f;exports.c=v;exports.d=c;exports.e=m;exports.f=p;exports.g=g;exports.h=R;exports.i=h;exports.j=I;exports.k=L;exports.l=U;exports.m=x;exports.n=b;exports.o=y;exports.p=V;exports.q=M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c as c$1,b}from'./chunk-5PELJRUQ.js';var g={};c$1(g,{attachAuditSession:()=>d,clearAuditLog:()=>c,getAuditLog:()=>a,logAuditEvent:()=>u});function d(t){let n=Date.now().toString(36)+Math.random().toString(36).substring(2,9);return o.set(t,n),n}function u(t){e.push(t),e.length>1e3&&e.shift();}function a(t){if(!t)return [...e];let n=o.get(t);return n?e.filter(i=>i.sessionId===n):[]}function c(){e.length=0;}var e,o,p=b(()=>{e=[],o=new WeakMap;});export{d as a,u as b,a as c,c as d,g as e,p as f};
|
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('./chunk-KIQXH265.cjs');function f(g={}){let{argv:s=process.argv.slice(2),prefix:n="--",normalizeKeys:i=true}=g,l=()=>{let t={};for(let r=0;r<s.length;r++){let c=s[r];if(!c.startsWith(n))continue;let e=c.slice(n.length);if(e.includes("=")){let[p,u]=e.split("=",2);e=i?p.replace(/-/g,"_").toUpperCase():p,t[e]=u;continue}let a=i?e.replace(/-/g,"_").toUpperCase():e,o=s[r+1];!o||o.startsWith(n)?t[a]="true":(t[a]=o,r++);}return t};return {name:"cli-args",load(){return Promise.resolve(l())},loadSync(){return l()}}}exports.cliArgs=f;
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI argument parser resolver
|
|
3
|
+
* Converts --kebab-case flags to SCREAMING_SNAKE_CASE env vars
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```bash
|
|
7
|
+
* node app.js --port 8080 --database-url postgres://localhost --verbose
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { resolve } from 'node-env-resolver';
|
|
13
|
+
* import { cliArgs } from 'node-env-resolver/cli';
|
|
14
|
+
*
|
|
15
|
+
* const config = await resolve.async(
|
|
16
|
+
* [cliArgs(), {
|
|
17
|
+
* PORT: 3000,
|
|
18
|
+
* DATABASE_URL: 'postgres',
|
|
19
|
+
* VERBOSE: false
|
|
20
|
+
* }]
|
|
21
|
+
* );
|
|
22
|
+
* // config.PORT === 8080
|
|
23
|
+
* // config.DATABASE_URL === 'postgres://localhost'
|
|
24
|
+
* // config.VERBOSE === true
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import type { Resolver } from './types';
|
|
28
|
+
export interface CliArgsOptions {
|
|
29
|
+
/** Arguments to parse (default: process.argv.slice(2)) */
|
|
30
|
+
argv?: string[];
|
|
31
|
+
/** Prefix for flags (default: '--') */
|
|
32
|
+
prefix?: string;
|
|
33
|
+
/** Convert kebab-case to SCREAMING_SNAKE_CASE (default: true) */
|
|
34
|
+
normalizeKeys?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse CLI arguments as environment variables
|
|
38
|
+
*
|
|
39
|
+
* Supports:
|
|
40
|
+
* - `--key value` → KEY=value
|
|
41
|
+
* - `--key=value` → KEY=value
|
|
42
|
+
* - `--flag` → FLAG=true (boolean flags)
|
|
43
|
+
* - `--kebab-case` → KEBAB_CASE (auto-normalization)
|
|
44
|
+
*
|
|
45
|
+
* @param options Configuration options
|
|
46
|
+
* @returns Resolver that parses CLI arguments
|
|
47
|
+
*/
|
|
48
|
+
export declare function cliArgs(options?: CliArgsOptions): Resolver;
|
|
49
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,QAAQ,CAmD9D"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-5PELJRUQ.js';function f(g={}){let{argv:s=process.argv.slice(2),prefix:n="--",normalizeKeys:i=true}=g,l=()=>{let t={};for(let r=0;r<s.length;r++){let c=s[r];if(!c.startsWith(n))continue;let e=c.slice(n.length);if(e.includes("=")){let[p,u]=e.split("=",2);e=i?p.replace(/-/g,"_").toUpperCase():p,t[e]=u;continue}let a=i?e.replace(/-/g,"_").toUpperCase():e,o=s[r+1];!o||o.startsWith(n)?t[a]="true":(t[a]=o,r++);}return t};return {name:"cli-args",load(){return Promise.resolve(l())},loadSync(){return l()}}}export{f as cliArgs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.test.d.ts","sourceRoot":"","sources":["../src/cli.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computed.test.d.ts","sourceRoot":"","sources":["../src/computed.test.ts"],"names":[],"mappings":""}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkTHFGEKYL_cjs=require('./chunk-THFGEKYL.cjs');require('./chunk-ULL4WKTV.cjs'),require('./chunk-XPGSWVRT.cjs');var chunk4ZOF2PI4_cjs=require('./chunk-4ZOF2PI4.cjs'),chunkP3ZWKKKW_cjs=require('./chunk-P3ZWKKKW.cjs');require('./chunk-KIQXH265.cjs');Object.defineProperty(exports,"processEnv",{enumerable:true,get:function(){return chunkTHFGEKYL_cjs.a}});Object.defineProperty(exports,"resolve",{enumerable:true,get:function(){return chunkTHFGEKYL_cjs.b}});Object.defineProperty(exports,"safeResolve",{enumerable:true,get:function(){return chunkTHFGEKYL_cjs.c}});Object.defineProperty(exports,"clearAuditLog",{enumerable:true,get:function(){return chunk4ZOF2PI4_cjs.d}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk4ZOF2PI4_cjs.c}});Object.defineProperty(exports,"isAsyncOnlyResolver",{enumerable:true,get:function(){return chunkP3ZWKKKW_cjs.b}});Object.defineProperty(exports,"isSyncResolver",{enumerable:true,get:function(){return chunkP3ZWKKKW_cjs.a}});
|
package/dist/index.d.ts
CHANGED
|
@@ -14,14 +14,12 @@
|
|
|
14
14
|
* });
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
import type { Resolver, ResolveOptions, SimpleEnvSchema, InferSimpleSchema } from './types';
|
|
18
|
-
export type { EnvDefinition, EnvSchema, Resolver, ResolveOptions, Provenance, PolicyOptions, SimpleEnvValue, SimpleEnvSchema, InferType, InferSchema, InferSimpleSchema, } from './types';
|
|
17
|
+
import type { Resolver, SyncResolver, ResolveOptions, SimpleEnvSchema, InferSimpleSchema } from './types';
|
|
18
|
+
export type { EnvDefinition, EnvSchema, Resolver, SyncResolver, AsyncOnlyResolver, ResolveOptions, Provenance, PolicyOptions, SimpleEnvValue, SimpleEnvSchema, InferType, InferSchema, InferSimpleSchema, } from './types';
|
|
19
|
+
export { isSyncResolver, isAsyncOnlyResolver } from './types';
|
|
19
20
|
export type { ValidationIssue, SafeResolveResult as SafeResolveResultWithIssues } from './validation-types';
|
|
20
21
|
export { getAuditLog, clearAuditLog, type AuditEvent, type AuditEventType } from './audit';
|
|
21
|
-
|
|
22
|
-
export declare function processEnv(): Resolver;
|
|
23
|
-
type FilterOptions<T extends ReadonlyArray<unknown>> = T extends readonly [infer First, ...infer Rest] ? First extends readonly [Resolver, SimpleEnvSchema] ? readonly [First, ...FilterOptions<Rest>] : FilterOptions<Rest> : readonly [];
|
|
24
|
-
type MergeTupleSchemas<T extends ReadonlyArray<unknown>> = T extends readonly [infer First, ...infer Rest] ? First extends readonly [Resolver, infer Schema extends SimpleEnvSchema] ? Rest extends ReadonlyArray<unknown> ? Rest['length'] extends 0 ? InferSimpleSchema<Schema> : MergeSchemas<InferSimpleSchema<Schema>, MergeTupleSchemas<Rest>> : InferSimpleSchema<Schema> : never : Record<string, never>;
|
|
22
|
+
export declare function processEnv(): SyncResolver;
|
|
25
23
|
export interface SafeResolveResult<T> {
|
|
26
24
|
success: true;
|
|
27
25
|
data: T;
|
|
@@ -33,36 +31,111 @@ export interface SafeResolveError {
|
|
|
33
31
|
}
|
|
34
32
|
export type SafeResolveResultType<T> = SafeResolveResult<T> | SafeResolveError;
|
|
35
33
|
/**
|
|
36
|
-
* Resolve environment variables
|
|
34
|
+
* Resolve environment variables synchronously
|
|
37
35
|
*
|
|
38
36
|
* @example
|
|
39
37
|
* ```typescript
|
|
40
|
-
* // Simple usage -
|
|
41
|
-
* const config =
|
|
38
|
+
* // Simple usage - process.env only (default)
|
|
39
|
+
* const config = resolve({
|
|
42
40
|
* PORT: 3000, // number with default
|
|
43
41
|
* DATABASE_URL: 'url', // required secret url
|
|
44
42
|
* NODE_ENV: ['dev', 'prod'], // enum
|
|
45
43
|
* FEATURE_FLAG: 'string?', // optional string
|
|
46
44
|
* });
|
|
47
45
|
*
|
|
48
|
-
* //
|
|
49
|
-
* const config =
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
46
|
+
* // With custom sync resolver - array syntax
|
|
47
|
+
* const config = resolve([
|
|
48
|
+
* processEnv(),
|
|
49
|
+
* { PORT: 3000, NODE_ENV: ['dev', 'prod'] }
|
|
50
|
+
* ]);
|
|
51
|
+
*
|
|
52
|
+
* // With custom sync resolver and options
|
|
53
|
+
* const config = resolve([
|
|
54
|
+
* dotenv(),
|
|
55
|
+
* { PORT: 3000, DATABASE_URL: 'postgres' }
|
|
56
|
+
* ], { strict: true });
|
|
57
|
+
*
|
|
58
|
+
* // Multiple sync resolvers (NEW!)
|
|
59
|
+
* const config = resolve(
|
|
60
|
+
* [dotenv(), { PORT: 3000 }],
|
|
61
|
+
* [json('config.json'), { DATABASE_URL: 'postgres' }],
|
|
62
|
+
* { strict: true }
|
|
53
63
|
* );
|
|
64
|
+
*
|
|
65
|
+
* // Async resolution with resolve.async()
|
|
66
|
+
* const config = await resolve.async([
|
|
67
|
+
* awsSecrets(),
|
|
68
|
+
* { DATABASE_URL: 'url', API_KEY: 'string' }
|
|
69
|
+
* ]);
|
|
54
70
|
* ```
|
|
55
71
|
*/
|
|
56
|
-
declare function resolveImpl<T extends SimpleEnvSchema>(
|
|
72
|
+
declare function resolveImpl<T extends SimpleEnvSchema>(arg1: T | [SyncResolver, T], ...rest: ([SyncResolver, T] | Partial<ResolveOptions>)[]): InferSimpleSchema<T>;
|
|
57
73
|
declare namespace resolveImpl {
|
|
58
|
-
var
|
|
59
|
-
export { _a as with };
|
|
74
|
+
var async: typeof resolveAsync;
|
|
60
75
|
}
|
|
61
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Resolve environment variables asynchronously (supports all resolver types - both sync and async)
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* // Works with async-only resolvers
|
|
82
|
+
* const config = await resolve.async([
|
|
83
|
+
* awsSecrets(),
|
|
84
|
+
* { PORT: 3000, DATABASE_URL: 'url', API_KEY: 'string' }
|
|
85
|
+
* ]);
|
|
86
|
+
*
|
|
87
|
+
* // Also works with sync resolvers (automatically wrapped in Promise)
|
|
88
|
+
* const config = await resolve.async([
|
|
89
|
+
* processEnv(), // Sync resolver works in async context
|
|
90
|
+
* { DATABASE_URL: 'postgres' }
|
|
91
|
+
* ], { strict: true });
|
|
92
|
+
*
|
|
93
|
+
* // Multiple resolvers
|
|
94
|
+
* const config = await resolve.async(
|
|
95
|
+
* [dotenv(), { PORT: 3000 }],
|
|
96
|
+
* [awsSecrets(), { DATABASE_URL: 'url' }],
|
|
97
|
+
* { strict: true }
|
|
98
|
+
* );
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
declare function resolveAsync<T extends SimpleEnvSchema>(arg1: [Resolver, T] | Partial<ResolveOptions>, ...rest: ([Resolver, T] | Partial<ResolveOptions>)[]): Promise<InferSimpleSchema<T>>;
|
|
102
|
+
declare function safeResolveImpl<T extends SimpleEnvSchema>(arg1: T | [SyncResolver, T], ...rest: ([SyncResolver, T] | Partial<ResolveOptions>)[]): SafeResolveResultType<InferSimpleSchema<T>>;
|
|
62
103
|
declare namespace safeResolveImpl {
|
|
63
|
-
var
|
|
64
|
-
export { _a as with };
|
|
104
|
+
var async: typeof safeResolveAsync;
|
|
65
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Safe async resolve (doesn't throw, returns result object)
|
|
108
|
+
* Supports both sync and async resolvers
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* // Works with async resolvers
|
|
113
|
+
* const result = await safeResolve.async([
|
|
114
|
+
* awsSecrets({ region: 'us-east-1' }),
|
|
115
|
+
* { PORT: 3000, DATABASE_URL: 'url' }
|
|
116
|
+
* ]);
|
|
117
|
+
*
|
|
118
|
+
* // Also works with sync resolvers
|
|
119
|
+
* const result = await safeResolve.async([
|
|
120
|
+
* processEnv(), // Sync resolver works fine
|
|
121
|
+
* { PORT: 3000 }
|
|
122
|
+
* ]);
|
|
123
|
+
*
|
|
124
|
+
* // Multiple resolvers
|
|
125
|
+
* const result = await safeResolve.async(
|
|
126
|
+
* [dotenv(), { PORT: 3000 }],
|
|
127
|
+
* [awsSecrets(), { DATABASE_URL: 'url' }],
|
|
128
|
+
* { strict: true }
|
|
129
|
+
* );
|
|
130
|
+
*
|
|
131
|
+
* if (result.success) {
|
|
132
|
+
* console.log(result.data.PORT); // Type-safe access
|
|
133
|
+
* } else {
|
|
134
|
+
* console.error(result.error); // Detailed error message
|
|
135
|
+
* }
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare function safeResolveAsync<T extends SimpleEnvSchema>(arg1: [Resolver, T] | Partial<ResolveOptions>, ...rest: ([Resolver, T] | Partial<ResolveOptions>)[]): Promise<SafeResolveResultType<InferSimpleSchema<T>>>;
|
|
66
139
|
export declare const resolve: typeof resolveImpl;
|
|
67
140
|
export declare const safeResolve: typeof safeResolveImpl;
|
|
68
141
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,SAAS,EACT,WAAW,EACX,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9D,YAAY,EACV,eAAe,EACf,iBAAiB,IAAI,2BAA2B,EACjD,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAM3F,wBAAgB,UAAU,IAAI,YAAY,CAUzC;AAUD,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC;CACT;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC;AAG/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,iBAAS,WAAW,CAAC,CAAC,SAAS,eAAe,EAC5C,IAAI,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,EAC3B,GAAG,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,GACvD,iBAAiB,CAAC,CAAC,CAAC,CA8EtB;kBAjFQ,WAAW;;;AAmFpB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iBAAe,YAAY,CAAC,CAAC,SAAS,eAAe,EACnD,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,EAC7C,GAAG,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,GACnD,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CA2C/B;AAKD,iBAAS,eAAe,CAAC,CAAC,SAAS,eAAe,EAChD,IAAI,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,EAC3B,GAAG,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,GACvD,qBAAqB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CA0F7C;kBA7FQ,eAAe;;;AA+FxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,iBAAe,gBAAgB,CAAC,CAAC,SAAS,eAAe,EACvD,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,EAC7C,GAAG,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,GACnD,OAAO,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAqDtD;AAID,eAAO,MAAM,OAAO,oBAAc,CAAC;AACnC,eAAO,MAAM,WAAW,wBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as processEnv,b as resolve,c as safeResolve}from'./chunk-
|
|
1
|
+
export{a as processEnv,b as resolve,c as safeResolve}from'./chunk-HCVTYYLE.js';import'./chunk-J7ZHEMRP.js';import'./chunk-NKPXKLF7.js';export{d as clearAuditLog,c as getAuditLog}from'./chunk-YOHHFBZN.js';export{b as isAsyncOnlyResolver,a as isSyncResolver}from'./chunk-54OHKWZJ.js';import'./chunk-5PELJRUQ.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nested.test.d.ts","sourceRoot":"","sources":["../src/nested.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkULL4WKTV_cjs=require('./chunk-ULL4WKTV.cjs');require('./chunk-XPGSWVRT.cjs'),require('./chunk-4ZOF2PI4.cjs'),require('./chunk-KIQXH265.cjs');Object.defineProperty(exports,"normalizeSchema",{enumerable:true,get:function(){return chunkULL4WKTV_cjs.a}});Object.defineProperty(exports,"resolveEnvInternal",{enumerable:true,get:function(){return chunkULL4WKTV_cjs.b}});Object.defineProperty(exports,"resolveEnvInternalSync",{enumerable:true,get:function(){return chunkULL4WKTV_cjs.c}});
|
package/dist/resolver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EAET,eAAe,EACf,cAAc,EAGf,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EAET,eAAe,EACf,cAAc,EAGf,MAAM,SAAS,CAAC;AA0HjB;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAsBlE;AAuuBD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,SAAS,SAAS,EAC1D,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,QAAQ,EAAE,EACrB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA+JlC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,SAAS,EACxD,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,QAAQ,EAAE,EACrB,OAAO,EAAE,cAAc,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoKzB"}
|
package/dist/resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as normalizeSchema,b as resolveEnvInternal,c as resolveEnvInternalSync}from'./chunk-
|
|
1
|
+
export{a as normalizeSchema,b as resolveEnvInternal,c as resolveEnvInternalSync}from'./chunk-J7ZHEMRP.js';import'./chunk-NKPXKLF7.js';import'./chunk-YOHHFBZN.js';import'./chunk-5PELJRUQ.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkFCFDGYTF_cjs=require('./chunk-FCFDGYTF.cjs');require('./chunk-KIQXH265.cjs');Object.defineProperty(exports,"dotenv",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.a}});Object.defineProperty(exports,"http",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.d}});Object.defineProperty(exports,"json",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.e}});Object.defineProperty(exports,"packageJson",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.c}});Object.defineProperty(exports,"processEnv",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.b}});Object.defineProperty(exports,"secrets",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.f}});Object.defineProperty(exports,"toml",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.h}});Object.defineProperty(exports,"yaml",{enumerable:true,get:function(){return chunkFCFDGYTF_cjs.g}});
|