@univer-cli/config 1.0.0-beta.2 → 1.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.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const _0x41576a=_0x3a52;(function(_0x2f1af9,_0x581685){const _0xab6a2a=_0x3a52,_0x2eee13=_0x2f1af9();while(!![]){try{const _0x5644a1=-parseInt(_0xab6a2a(0x143))/0x1+-parseInt(_0xab6a2a(0x151))/0x2*(parseInt(_0xab6a2a(0x174))/0x3)+-parseInt(_0xab6a2a(0x170))/0x4+parseInt(_0xab6a2a(0x134))/0x5+-parseInt(_0xab6a2a(0x163))/0x6+-parseInt(_0xab6a2a(0x186))/0x7*(parseInt(_0xab6a2a(0x146))/0x8)+-parseInt(_0xab6a2a(0x133))/0x9*(-parseInt(_0xab6a2a(0x16d))/0xa);if(_0x5644a1===_0x581685)break;else _0x2eee13['push'](_0x2eee13['shift']());}catch(_0x4f9326){_0x2eee13['push'](_0x2eee13['shift']());}}}(_0x3512,0xc526b));import _0x1d3fae from'conf';import{mkdirSync as _0x58971a}from'node:fs';import{isAbsolute as _0x481089,parse as _0x183bad,resolve as _0x39c959}from'node:path';var a={'nonEmptyString'(){return{'parse':o,'parseText':o};},'boolean'(){return{'parse'(_0x495a92){const _0x13eb64=_0x3a52;if(typeof _0x495a92!=_0x13eb64(0x17a))throw Error(_0x13eb64(0x164));return _0x495a92;},'parseText'(_0x38cc98){const _0x4a3be0=_0x3a52;if(_0x38cc98==='true')return!0x0;if(_0x38cc98===_0x4a3be0(0x13e))return!0x1;throw Error(_0x4a3be0(0x136));}};},'integer'(_0x43c8ce={}){let _0x50f266=_0x1de4dc=>{const _0x32119b=_0x3a52;if(typeof _0x1de4dc!=_0x32119b(0x168)||!Number[_0x32119b(0x185)](_0x1de4dc))throw Error(_0x32119b(0x176));if(_0x43c8ce['minimum']!==void 0x0&&_0x1de4dc<_0x43c8ce['minimum'])throw Error(_0x32119b(0x17c)+_0x43c8ce[_0x32119b(0x16c)]+'.');if(_0x43c8ce[_0x32119b(0x182)]!==void 0x0&&_0x1de4dc>_0x43c8ce[_0x32119b(0x182)])throw Error(_0x32119b(0x16b)+_0x43c8ce[_0x32119b(0x182)]+'.');return _0x1de4dc;};return{'parse':_0x50f266,'parseText'(_0x2906f4){const _0x409684=_0x3a52;if(!/^-?(?:0|[1-9]\d*)$/u[_0x409684(0x172)](_0x2906f4))throw Error('Expected\x20an\x20integer.');return _0x50f266(Number(_0x2906f4));}};},'enumeration'(_0x9fbeb3){let _0x475382=_0x1dd0da=>{const _0x1a273e=_0x3a52;if(typeof _0x1dd0da!='string'||!_0x9fbeb3[_0x1a273e(0x17b)](_0x1dd0da))throw Error(_0x1a273e(0x132)+_0x9fbeb3[_0x1a273e(0x14b)](',\x20')+'.');return _0x1dd0da;};return{'parse':_0x475382,'parseText':_0x475382};},'httpUrl'(){return{'parse':s,'parseText':s};},'httpOrigin'(){const _0x116697=_0x3a52;let _0xdbb40e=_0x558053=>new URL(s(_0x558053))[_0x116697(0x13a)];return{'parse':_0xdbb40e,'parseText':_0xdbb40e};}};function o(_0x273879){const _0xd319d2=_0x3a52;if(typeof _0x273879!='string'||_0x273879['length']===0x0||_0x273879[_0xd319d2(0x13d)]()!==_0x273879)throw Error(_0xd319d2(0x17f));return _0x273879;}function s(_0x37c126){const _0xa7f3cd=_0x3a52;let _0x4eefd4=o(_0x37c126),_0x272f11;try{_0x272f11=new URL(_0x4eefd4);}catch{throw Error('Expected\x20an\x20absolute\x20HTTP\x20or\x20HTTPS\x20URL.');}if(_0x272f11[_0xa7f3cd(0x187)]!==_0xa7f3cd(0x140)&&_0x272f11['protocol']!==_0xa7f3cd(0x183))throw Error(_0xa7f3cd(0x14f));return _0x272f11[_0xa7f3cd(0x137)]();}function c(_0x1a8845){l(_0x1a8845,new Set());}function l(_0x3c5d4e,_0x101fb7){const _0x36bfdb=_0x3a52;if(_0x3c5d4e===null||typeof _0x3c5d4e==_0x36bfdb(0x141)||typeof _0x3c5d4e==_0x36bfdb(0x17a))return;if(typeof _0x3c5d4e==_0x36bfdb(0x168)){if(!Number[_0x36bfdb(0x150)](_0x3c5d4e))throw Error('Expected\x20a\x20finite\x20JSON\x20number.');return;}if(typeof _0x3c5d4e!=_0x36bfdb(0x130))throw Error(_0x36bfdb(0x18e));if(_0x101fb7[_0x36bfdb(0x160)](_0x3c5d4e))throw Error(_0x36bfdb(0x14e));if(_0x101fb7['add'](_0x3c5d4e),Array[_0x36bfdb(0x190)](_0x3c5d4e)){for(let _0x1f6bfe of _0x3c5d4e)l(_0x1f6bfe,_0x101fb7);_0x101fb7['delete'](_0x3c5d4e);return;}let _0x10fa67=Object[_0x36bfdb(0x158)](_0x3c5d4e);if(_0x10fa67!==Object[_0x36bfdb(0x15a)]&&_0x10fa67!==null)throw Error(_0x36bfdb(0x14a));for(let _0x379c12 of Object[_0x36bfdb(0x15c)](_0x3c5d4e))l(_0x379c12,_0x101fb7);_0x101fb7[_0x36bfdb(0x13f)](_0x3c5d4e);}function _0x3512(){const _0x3073c0=['Invalid\x20default\x20value:\x20','Config\x20path\x20must\x20be\x20absolute.','number','hasOwn','description','Expected\x20an\x20integer\x20less\x20than\x20or\x20equal\x20to\x20','minimum','1560qyzFSf','function','definitions','2995060YLsKmi','unset','test','length','3xONnPy','json','Expected\x20a\x20safe\x20integer.','code','path','CONFIG_INVALID_DEFINITION','boolean','includes','Expected\x20an\x20integer\x20greater\x20than\x20or\x20equal\x20to\x20','CONFIG_INVALID_DOCUMENT','Config\x20key\x20is\x20not\x20available:\x20','Expected\x20a\x20non-empty\x20string\x20without\x20surrounding\x20whitespace.','found','default','maximum','https:','ext','isSafeInteger','21HhmtAL','protocol','ConfigError','slice','then','details','segment','CONFIG_INVALID_VALUE','Expected\x20a\x20JSON-compatible\x20value.','codec','isArray','reverse','push','Invalid\x20config\x20definition\x20','object','CONFIG_WRITE_FAILED','Expected\x20one\x20of:\x20','251892UwftEz','178420KAnZuU','message','Expected\x20\x22true\x22\x20or\x20\x22false\x22.','toString','Config\x20path\x20must\x20use\x20the\x20.json\x20extension.','key','origin','CONFIG_UNKNOWN_KEY','entries','trim','false','delete','http:','string','freeze','622363mgLFoM','__proto__','dir','1998776vStynW','parse','Codec\x20must\x20provide\x20parse\x20and\x20parseText\x20functions.','Key\x20must\x20contain\x20safe\x20dot-separated\x20identifier\x20segments.','Expected\x20a\x20plain\x20JSON\x20object.','join','name','value','Expected\x20an\x20acyclic\x20JSON-compatible\x20value.','Expected\x20an\x20absolute\x20HTTP\x20or\x20HTTPS\x20URL.','isFinite','2388130ZBuvBQ','parseText','resolve','defaultValue','store','write','split','getPrototypeOf','text','prototype','some','values','keys','map','Invalid\x20value\x20for\x20config\x20key\x20','has','CONFIG_READ_FAILED','Config\x20document\x20conflicts\x20with\x20registered\x20key\x20','1677282yCiNEj','Expected\x20a\x20boolean.','constructor'];_0x3512=function(){return _0x3073c0;};return _0x3512();}var u=class extends Error{[_0x41576a(0x177)];[_0x41576a(0x18b)];constructor(_0x124f31,_0x942c7,_0x15391e={},_0x19db61){const _0x28100d=_0x41576a;super(_0x942c7,_0x19db61),this[_0x28100d(0x14c)]=_0x28100d(0x188),this['code']=_0x124f31,this[_0x28100d(0x18b)]=_0x15391e;}};function d(_0x1ce6ec){const _0x46edbc=_0x41576a;return _0x1ce6ec instanceof Error?_0x1ce6ec[_0x46edbc(0x135)]:String(_0x1ce6ec);}var f=new Set([_0x41576a(0x144),_0x41576a(0x165),_0x41576a(0x15a)]);function p(_0xee8a8a){const _0x506cc8=_0x41576a;let _0x39ee23={};for(let [_0x2851bc,_0x1ea68c]of Object[_0x506cc8(0x13c)](_0xee8a8a)){m(_0x2851bc);let _0x52a15b=_0x1ea68c['description'][_0x506cc8(0x13d)]();if(_0x52a15b==='')throw h(_0x2851bc,'Description\x20must\x20not\x20be\x20empty.');if(typeof _0x1ea68c['codec']?.['parse']!=_0x506cc8(0x16e)||typeof _0x1ea68c[_0x506cc8(0x18f)][_0x506cc8(0x152)]!=_0x506cc8(0x16e))throw h(_0x2851bc,_0x506cc8(0x148));let _0x172ecd;if(Object['hasOwn'](_0x1ea68c,_0x506cc8(0x154)))try{_0x172ecd=_0x1ea68c[_0x506cc8(0x18f)]['parse'](_0x1ea68c[_0x506cc8(0x154)]),c(_0x172ecd);}catch(_0x47f032){throw h(_0x2851bc,_0x506cc8(0x166)+d(_0x47f032),_0x47f032);}_0x39ee23[_0x2851bc]=Object[_0x506cc8(0x142)]({'codec':_0x1ea68c[_0x506cc8(0x18f)],'description':_0x52a15b,...Object[_0x506cc8(0x169)](_0x1ea68c,_0x506cc8(0x154))?{'defaultValue':_0x172ecd}:{}});}return Object[_0x506cc8(0x142)](_0x39ee23);}function m(_0x2d4bf8){const _0x446fba=_0x41576a;let _0x15b03e=_0x2d4bf8[_0x446fba(0x157)]('.');if(_0x2d4bf8[_0x446fba(0x173)]===0x0||_0x2d4bf8[_0x446fba(0x13d)]()!==_0x2d4bf8||_0x15b03e[_0x446fba(0x15b)](_0x3aaec1=>_0x3aaec1[_0x446fba(0x173)]===0x0||f[_0x446fba(0x160)](_0x3aaec1)||!/^[A-Za-z][A-Za-z0-9_-]*$/u[_0x446fba(0x172)](_0x3aaec1)))throw h(_0x2d4bf8,_0x446fba(0x149));}function h(_0x3e6481,_0x4eeaf1,_0x5c848e){const _0x1013b7=_0x41576a;return new u(_0x1013b7(0x179),_0x1013b7(0x12f)+_0x3e6481+':\x20'+_0x4eeaf1,{'key':_0x3e6481},_0x5c848e===void 0x0?void 0x0:{'cause':_0x5c848e});}function g(_0x347b04){const _0x1201f5=_0x41576a;if(!_0x481089(_0x347b04[_0x1201f5(0x178)]))throw Error(_0x1201f5(0x167));let _0x1e4d08=_0x39c959(_0x347b04[_0x1201f5(0x178)]),_0x1ea9ca=_0x183bad(_0x1e4d08);if(_0x1ea9ca[_0x1201f5(0x184)]!=='.json')throw Error(_0x1201f5(0x138));try{_0x58971a(_0x1ea9ca[_0x1201f5(0x145)],{'mode':0x1c0,'recursive':!0x0});}catch(_0x195d36){throw D(_0x1201f5(0x131),_0x1e4d08,_0x195d36);}let _0xb48cf0;try{_0xb48cf0=new _0x1d3fae({'configFileMode':0x180,'configName':_0x1ea9ca[_0x1201f5(0x14c)],'cwd':_0x1ea9ca[_0x1201f5(0x145)],'fileExtension':_0x1201f5(0x175)});}catch(_0x12c5ff){throw D('CONFIG_READ_FAILED',_0x1e4d08,_0x12c5ff);}let _0x10c23a=Promise[_0x1201f5(0x153)](),_0x4e0072=()=>{const _0x25e26a=_0x1201f5;try{return _0xb48cf0[_0x25e26a(0x155)];}catch(_0x219888){throw D(_0x25e26a(0x161),_0x1e4d08,_0x219888);}},_0x4bceb4=_0xeb0f9d=>{const _0x3f810e=_0x1201f5;try{_0xb48cf0[_0x3f810e(0x155)]=_0xeb0f9d;}catch(_0x27979e){throw D(_0x3f810e(0x131),_0x1e4d08,_0x27979e);}},_0x53e1fe=_0xc005a5=>{const _0x43ac8b=_0x1201f5;let _0x1918bb=_(_0x347b04,_0xc005a5),_0x177734=x(_0x4e0072(),_0xc005a5);return _0x177734[_0x43ac8b(0x180)]?v(_0xc005a5,_0x1918bb,_0x177734[_0x43ac8b(0x14d)]):b(_0xc005a5,_0x1918bb);},_0x2a5025=async(_0x2c1667,_0x4d2d53)=>{const _0x3f98be=_0x1201f5;let _0x3bb7e6=_0x10c23a[_0x3f98be(0x18a)](()=>{let _0x335714=_0x4e0072();if(_0x4d2d53===void 0x0&&!x(_0x335714,_0x2c1667)['found'])return _0x53e1fe(_0x2c1667);let _0x3104aa=_0x4d2d53===void 0x0?C(_0x335714,_0x2c1667):S(_0x335714,_0x2c1667,_0x4d2d53);return _0x4bceb4(_0x3104aa),_0x53e1fe(_0x2c1667);});return _0x10c23a=_0x3bb7e6['then'](()=>void 0x0,()=>void 0x0),await _0x3bb7e6;};return{'path':_0xb48cf0[_0x1201f5(0x178)],async 'get'(_0x24cba7){const _0x58043d=_0x1201f5;return _0x53e1fe(_0x24cba7[_0x58043d(0x139)]);},async 'list'(){const _0x37f68f=_0x1201f5;return Object[_0x37f68f(0x15d)](_0x347b04[_0x37f68f(0x16f)])[_0x37f68f(0x15e)](_0x41e6ee=>_0x53e1fe(_0x41e6ee));},async 'set'(_0x41dca1){const _0xd90e6c=_0x1201f5;let _0x396d71=_(_0x347b04,_0x41dca1[_0xd90e6c(0x139)]);return await _0x2a5025(_0x41dca1[_0xd90e6c(0x139)],y(_0x41dca1[_0xd90e6c(0x139)],()=>_0x396d71[_0xd90e6c(0x18f)]['parse'](_0x41dca1['value'])));},async 'setFromText'(_0x5206b1){const _0x1a1a90=_0x1201f5;let _0x5ac3bd=_(_0x347b04,_0x5206b1[_0x1a1a90(0x139)]);return await _0x2a5025(_0x5206b1[_0x1a1a90(0x139)],y(_0x5206b1[_0x1a1a90(0x139)],()=>_0x5ac3bd[_0x1a1a90(0x18f)]['parseText'](_0x5206b1[_0x1a1a90(0x159)])));},async 'unset'(_0x3a83f8){return _(_0x347b04,_0x3a83f8['key']),await _0x2a5025(_0x3a83f8['key'],void 0x0);}};}function _(_0x7532e5,_0x3c4d37){const _0x3a5904=_0x41576a;let _0x4abb83=_0x7532e5[_0x3a5904(0x16f)][_0x3c4d37];if(_0x4abb83===void 0x0)throw new u(_0x3a5904(0x13b),_0x3a5904(0x17e)+_0x3c4d37+'.',{'availableKeys':Object['keys'](_0x7532e5[_0x3a5904(0x16f)]),'key':_0x3c4d37});return _0x4abb83;}function v(_0x354064,_0x5357e1,_0x3b4bca){const _0x3a153b=_0x41576a;let _0x125c10=y(_0x354064,()=>_0x5357e1[_0x3a153b(0x18f)][_0x3a153b(0x147)](_0x3b4bca));return{'description':_0x5357e1[_0x3a153b(0x16a)],'key':_0x354064,'source':'config','value':_0x125c10,...Object[_0x3a153b(0x169)](_0x5357e1,'defaultValue')?{'defaultValue':_0x5357e1[_0x3a153b(0x154)]}:{}};}function y(_0x247e93,_0x3fd15b){const _0x2667c4=_0x41576a;try{let _0x32b0bb=_0x3fd15b();return c(_0x32b0bb),_0x32b0bb;}catch(_0x26f691){throw new u(_0x2667c4(0x18d),_0x2667c4(0x15f)+_0x247e93+':\x20'+d(_0x26f691),{'key':_0x247e93},{'cause':_0x26f691});}}function b(_0x18316f,_0x2dfae2){const _0x13d52b=_0x41576a;return Object[_0x13d52b(0x169)](_0x2dfae2,_0x13d52b(0x154))?{'defaultValue':_0x2dfae2[_0x13d52b(0x154)],'description':_0x2dfae2[_0x13d52b(0x16a)],'key':_0x18316f,'source':_0x13d52b(0x181),'value':_0x2dfae2[_0x13d52b(0x154)]}:{'description':_0x2dfae2[_0x13d52b(0x16a)],'key':_0x18316f,'source':_0x13d52b(0x171)};}function x(_0x3baffc,_0x46b766){const _0x1830ca=_0x41576a;let _0x563461=_0x3baffc;for(let _0x3766b8 of _0x46b766[_0x1830ca(0x157)]('.')){if(!w(_0x563461))throw E(_0x46b766);if(!Object[_0x1830ca(0x169)](_0x563461,_0x3766b8))return{'found':!0x1};_0x563461=_0x563461[_0x3766b8];}return{'found':!0x0,'value':_0x563461};}function S(_0x4277f4,_0x54c2c1,_0x18e257){const _0x5a0326=_0x41576a;let _0x4a32d4={...structuredClone(_0x4277f4)},_0x393f76=_0x54c2c1[_0x5a0326(0x157)]('.'),_0x6f87ba=_0x4a32d4;for(let _0x186dd8 of _0x393f76[_0x5a0326(0x189)](0x0,-0x1)){let _0x2f503f=_0x6f87ba[_0x186dd8];if(_0x2f503f===void 0x0){let _0x1b7b16={};_0x6f87ba[_0x186dd8]=_0x1b7b16,_0x6f87ba=_0x1b7b16;}else{if(T(_0x2f503f))_0x6f87ba=_0x2f503f;else throw E(_0x54c2c1);}}return _0x6f87ba[_0x393f76['at'](-0x1)]=structuredClone(_0x18e257),_0x4a32d4;}function _0x3a52(_0x4ad66c,_0x48d3de){_0x4ad66c=_0x4ad66c-0x12e;const _0x351211=_0x3512();let _0x3a52e2=_0x351211[_0x4ad66c];return _0x3a52e2;}function C(_0x242110,_0xd8b603){const _0x3d5254=_0x41576a;let _0x562460={...structuredClone(_0x242110)},_0x5b6a9f=_0xd8b603[_0x3d5254(0x157)]('.'),_0x340ac8=[],_0x2b2378=_0x562460;for(let _0x3c32ba of _0x5b6a9f['slice'](0x0,-0x1)){let _0x56384e=_0x2b2378[_0x3c32ba];if(_0x56384e===void 0x0)return _0x562460;if(!T(_0x56384e))throw E(_0xd8b603);_0x340ac8[_0x3d5254(0x12e)]({'object':_0x2b2378,'segment':_0x3c32ba}),_0x2b2378=_0x56384e;}delete _0x2b2378[_0x5b6a9f['at'](-0x1)];for(let _0x3c341e of _0x340ac8[_0x3d5254(0x191)]()){let _0x24471e=_0x3c341e[_0x3d5254(0x130)][_0x3c341e[_0x3d5254(0x18c)]];if(w(_0x24471e)&&Object[_0x3d5254(0x15d)](_0x24471e)[_0x3d5254(0x173)]===0x0)delete _0x3c341e[_0x3d5254(0x130)][_0x3c341e[_0x3d5254(0x18c)]];else break;}return _0x562460;}function w(_0x1f42f4){const _0x161eaf=_0x41576a;return typeof _0x1f42f4==_0x161eaf(0x130)&&!!_0x1f42f4&&!Array[_0x161eaf(0x190)](_0x1f42f4);}function T(_0x42069c){return w(_0x42069c);}function E(_0x206b99){const _0x4558ba=_0x41576a;return new u(_0x4558ba(0x17d),_0x4558ba(0x162)+_0x206b99+'.',{'key':_0x206b99});}function D(_0x3da7d7,_0x3aa544,_0x310c94){const _0x5dd69f=_0x41576a;return new u(_0x3da7d7,'Failed\x20to\x20'+(_0x3da7d7==='CONFIG_READ_FAILED'?'read':_0x5dd69f(0x156))+'\x20config\x20file\x20'+_0x3aa544+':\x20'+d(_0x310c94),{'path':_0x3aa544},{'cause':_0x310c94});}export{u as ConfigError,a as configCodecs,g as createFileConfig,p as defineConfig};
1
+ const _0x265f13=_0x67b4;(function(_0x1db407,_0x43a725){const _0x4a19f5=_0x67b4,_0x51b5c2=_0x1db407();while(!![]){try{const _0x44ff4e=-parseInt(_0x4a19f5(0x17e))/0x1+parseInt(_0x4a19f5(0x141))/0x2*(parseInt(_0x4a19f5(0x182))/0x3)+-parseInt(_0x4a19f5(0x175))/0x4+parseInt(_0x4a19f5(0x188))/0x5*(parseInt(_0x4a19f5(0x15e))/0x6)+-parseInt(_0x4a19f5(0x186))/0x7*(-parseInt(_0x4a19f5(0x147))/0x8)+-parseInt(_0x4a19f5(0x192))/0x9*(parseInt(_0x4a19f5(0x139))/0xa)+-parseInt(_0x4a19f5(0x143))/0xb*(-parseInt(_0x4a19f5(0x17c))/0xc);if(_0x44ff4e===_0x43a725)break;else _0x51b5c2['push'](_0x51b5c2['shift']());}catch(_0xdcb15b){_0x51b5c2['push'](_0x51b5c2['shift']());}}}(_0x1f8e,0x8c7ee));import _0x53c900 from'conf';import{mkdirSync as _0x46bd4b}from'node:fs';import{isAbsolute as _0x2e03e6,parse as _0x222072,resolve as _0x4ca1f8}from'node:path';var a={'nonEmptyString'(){return{'parse':o,'parseText':o};},'boolean'(){return{'parse'(_0x117628){const _0x5d0608=_0x67b4;if(typeof _0x117628!='boolean')throw Error(_0x5d0608(0x150));return _0x117628;},'parseText'(_0x4c6488){const _0xe48c28=_0x67b4;if(_0x4c6488==='true')return!0x0;if(_0x4c6488===_0xe48c28(0x196))return!0x1;throw Error(_0xe48c28(0x171));}};},'integer'(_0x30a18d={}){let _0x2f54ce=_0x34c0d2=>{const _0x298acc=_0x67b4;if(typeof _0x34c0d2!=_0x298acc(0x164)||!Number[_0x298acc(0x163)](_0x34c0d2))throw Error(_0x298acc(0x14b));if(_0x30a18d[_0x298acc(0x170)]!==void 0x0&&_0x34c0d2<_0x30a18d['minimum'])throw Error(_0x298acc(0x167)+_0x30a18d[_0x298acc(0x170)]+'.');if(_0x30a18d['maximum']!==void 0x0&&_0x34c0d2>_0x30a18d[_0x298acc(0x195)])throw Error(_0x298acc(0x169)+_0x30a18d[_0x298acc(0x195)]+'.');return _0x34c0d2;};return{'parse':_0x2f54ce,'parseText'(_0x7cc370){const _0x289cee=_0x67b4;if(!/^-?(?:0|[1-9]\d*)$/u[_0x289cee(0x187)](_0x7cc370))throw Error(_0x289cee(0x199));return _0x2f54ce(Number(_0x7cc370));}};},'enumeration'(_0x38cb0b){let _0x479e6f=_0x428b93=>{const _0x589e58=_0x67b4;if(typeof _0x428b93!='string'||!_0x38cb0b[_0x589e58(0x137)](_0x428b93))throw Error(_0x589e58(0x16d)+_0x38cb0b[_0x589e58(0x146)](',\x20')+'.');return _0x428b93;};return{'parse':_0x479e6f,'parseText':_0x479e6f};},'httpUrl'(){return{'parse':s,'parseText':s};},'httpOrigin'(){const _0x380aac=_0x67b4;let _0x528c31=_0x5b159a=>new URL(s(_0x5b159a))[_0x380aac(0x162)];return{'parse':_0x528c31,'parseText':_0x528c31};}};function o(_0x543457){const _0x53daa8=_0x67b4;if(typeof _0x543457!=_0x53daa8(0x165)||_0x543457[_0x53daa8(0x174)]===0x0||_0x543457[_0x53daa8(0x14d)]()!==_0x543457)throw Error(_0x53daa8(0x18b));return _0x543457;}function s(_0x3b1d03){const _0x519aa1=_0x67b4;let _0x450d1d=o(_0x3b1d03),_0x4cc9b6;try{_0x4cc9b6=new URL(_0x450d1d);}catch{throw Error(_0x519aa1(0x14c));}if(_0x4cc9b6[_0x519aa1(0x138)]!=='http:'&&_0x4cc9b6[_0x519aa1(0x138)]!==_0x519aa1(0x180))throw Error(_0x519aa1(0x14c));return _0x4cc9b6[_0x519aa1(0x190)]();}function c(_0x5484fb){l(_0x5484fb,new Set());}function _0x67b4(_0x246ead,_0x2e1c44){_0x246ead=_0x246ead-0x135;const _0x1f8efe=_0x1f8e();let _0x67b4a3=_0x1f8efe[_0x246ead];return _0x67b4a3;}function l(_0x2853e3,_0x210598){const _0x1babdd=_0x67b4;if(_0x2853e3===null||typeof _0x2853e3==_0x1babdd(0x165)||typeof _0x2853e3==_0x1babdd(0x16f))return;if(typeof _0x2853e3==_0x1babdd(0x164)){if(!Number[_0x1babdd(0x140)](_0x2853e3))throw Error(_0x1babdd(0x185));return;}if(typeof _0x2853e3!=_0x1babdd(0x157))throw Error(_0x1babdd(0x15c));if(_0x210598[_0x1babdd(0x194)](_0x2853e3))throw Error('Expected\x20an\x20acyclic\x20JSON-compatible\x20value.');if(_0x210598['add'](_0x2853e3),Array[_0x1babdd(0x151)](_0x2853e3)){for(let _0xc9af7b of _0x2853e3)l(_0xc9af7b,_0x210598);_0x210598[_0x1babdd(0x142)](_0x2853e3);return;}let _0x5665fa=Object[_0x1babdd(0x17a)](_0x2853e3);if(_0x5665fa!==Object[_0x1babdd(0x156)]&&_0x5665fa!==null)throw Error(_0x1babdd(0x15a));for(let _0x29330f of Object[_0x1babdd(0x152)](_0x2853e3))l(_0x29330f,_0x210598);_0x210598[_0x1babdd(0x142)](_0x2853e3);}var u=class extends Error{['code'];['details'];constructor(_0x4bea9f,_0x2207c7,_0x1f6652={},_0x5c8c9e){const _0x550881=_0x67b4;super(_0x2207c7,_0x5c8c9e),this['name']=_0x550881(0x179),this[_0x550881(0x18d)]=_0x4bea9f,this[_0x550881(0x13d)]=_0x1f6652;}};function d(_0x447e89){const _0x2951cf=_0x67b4;return _0x447e89 instanceof Error?_0x447e89[_0x2951cf(0x148)]:String(_0x447e89);}var f=new Set([_0x265f13(0x144),_0x265f13(0x15f),_0x265f13(0x156)]);function p(_0x25449e){const _0x25a93b=_0x265f13;let _0x1f3e3e={};for(let [_0x32c4a7,_0x39458d]of Object[_0x25a93b(0x193)](_0x25449e)){m(_0x32c4a7);let _0x1a7dc9=_0x39458d[_0x25a93b(0x149)][_0x25a93b(0x14d)]();if(_0x1a7dc9==='')throw h(_0x32c4a7,_0x25a93b(0x17d));if(typeof _0x39458d['codec']?.[_0x25a93b(0x181)]!=_0x25a93b(0x16b)||typeof _0x39458d['codec'][_0x25a93b(0x153)]!=_0x25a93b(0x16b))throw h(_0x32c4a7,_0x25a93b(0x13e));let _0x499e2a;if(Object[_0x25a93b(0x15d)](_0x39458d,_0x25a93b(0x16c)))try{_0x499e2a=_0x39458d[_0x25a93b(0x183)][_0x25a93b(0x181)](_0x39458d[_0x25a93b(0x16c)]),c(_0x499e2a);}catch(_0x115f68){throw h(_0x32c4a7,_0x25a93b(0x159)+d(_0x115f68),_0x115f68);}_0x1f3e3e[_0x32c4a7]=Object[_0x25a93b(0x135)]({'codec':_0x39458d['codec'],'description':_0x1a7dc9,...Object[_0x25a93b(0x15d)](_0x39458d,_0x25a93b(0x16c))?{'defaultValue':_0x499e2a}:{}});}return Object[_0x25a93b(0x135)](_0x1f3e3e);}function m(_0x358f98){const _0x1514e6=_0x265f13;let _0x2f9e27=_0x358f98[_0x1514e6(0x17b)]('.');if(_0x358f98[_0x1514e6(0x174)]===0x0||_0x358f98['trim']()!==_0x358f98||_0x2f9e27[_0x1514e6(0x136)](_0x38c573=>_0x38c573[_0x1514e6(0x174)]===0x0||f[_0x1514e6(0x194)](_0x38c573)||!/^[A-Za-z][A-Za-z0-9_-]*$/u[_0x1514e6(0x187)](_0x38c573)))throw h(_0x358f98,_0x1514e6(0x16a));}function h(_0x210e4d,_0x2b06d0,_0x26097d){return new u('CONFIG_INVALID_DEFINITION','Invalid\x20config\x20definition\x20'+_0x210e4d+':\x20'+_0x2b06d0,{'key':_0x210e4d},_0x26097d===void 0x0?void 0x0:{'cause':_0x26097d});}function g(_0x2712bb){const _0x27f900=_0x265f13;if(!_0x2e03e6(_0x2712bb['path']))throw Error(_0x27f900(0x191));let _0x41ab8e=_0x4ca1f8(_0x2712bb['path']),_0x1c4328=_0x222072(_0x41ab8e);if(_0x1c4328[_0x27f900(0x184)]!=='.json')throw Error(_0x27f900(0x173));try{_0x46bd4b(_0x1c4328[_0x27f900(0x13f)],{'mode':0x1c0,'recursive':!0x0});}catch(_0x5bc102){throw D('CONFIG_WRITE_FAILED',_0x41ab8e,_0x5bc102);}let _0x17ca5a;try{_0x17ca5a=new _0x53c900({'configFileMode':0x180,'configName':_0x1c4328[_0x27f900(0x168)],'cwd':_0x1c4328[_0x27f900(0x13f)],'fileExtension':_0x27f900(0x197)});}catch(_0x35b3e2){throw D(_0x27f900(0x13a),_0x41ab8e,_0x35b3e2);}let _0x5a29e6=Promise[_0x27f900(0x18c)](),_0x4ea719=()=>{const _0x10d15a=_0x27f900;try{return _0x17ca5a[_0x10d15a(0x160)];}catch(_0x3381af){throw D('CONFIG_READ_FAILED',_0x41ab8e,_0x3381af);}},_0xef868b=_0x34f3c1=>{const _0x5cc9fe=_0x27f900;try{_0x17ca5a['store']=_0x34f3c1;}catch(_0x5a2616){throw D(_0x5cc9fe(0x18a),_0x41ab8e,_0x5a2616);}},_0x266761=_0x21d312=>{const _0x20ca4d=_0x27f900;let _0x4d49f3=_(_0x2712bb,_0x21d312),_0x3502bd=x(_0x4ea719(),_0x21d312);return _0x3502bd[_0x20ca4d(0x177)]?v(_0x21d312,_0x4d49f3,_0x3502bd['value']):b(_0x21d312,_0x4d49f3);},_0x431ae6=async(_0x253bb4,_0x29d8d8)=>{const _0x5ec697=_0x27f900;let _0x354ef6=_0x5a29e6[_0x5ec697(0x15b)](()=>{const _0x3f0baf=_0x5ec697;let _0x381761=_0x4ea719();if(_0x29d8d8===void 0x0&&!x(_0x381761,_0x253bb4)[_0x3f0baf(0x177)])return _0x266761(_0x253bb4);let _0x258d74=_0x29d8d8===void 0x0?C(_0x381761,_0x253bb4):S(_0x381761,_0x253bb4,_0x29d8d8);return _0xef868b(_0x258d74),_0x266761(_0x253bb4);});return _0x5a29e6=_0x354ef6[_0x5ec697(0x15b)](()=>void 0x0,()=>void 0x0),await _0x354ef6;};return{'path':_0x17ca5a[_0x27f900(0x145)],async 'get'(_0x55e06f){const _0x1e421e=_0x27f900;return _0x266761(_0x55e06f[_0x1e421e(0x189)]);},async 'list'(){const _0x48b916=_0x27f900;return Object[_0x48b916(0x158)](_0x2712bb[_0x48b916(0x198)])[_0x48b916(0x14a)](_0x251b64=>_0x266761(_0x251b64));},async 'set'(_0x3d5e48){const _0x430243=_0x27f900;let _0x54e4f4=_(_0x2712bb,_0x3d5e48[_0x430243(0x189)]);return await _0x431ae6(_0x3d5e48[_0x430243(0x189)],y(_0x3d5e48['key'],()=>_0x54e4f4[_0x430243(0x183)][_0x430243(0x181)](_0x3d5e48[_0x430243(0x17f)])));},async 'setFromText'(_0x324115){const _0xcd8163=_0x27f900;let _0x290055=_(_0x2712bb,_0x324115[_0xcd8163(0x189)]);return await _0x431ae6(_0x324115[_0xcd8163(0x189)],y(_0x324115[_0xcd8163(0x189)],()=>_0x290055[_0xcd8163(0x183)]['parseText'](_0x324115[_0xcd8163(0x166)])));},async 'unset'(_0x2dd53e){const _0x39fa4c=_0x27f900;return _(_0x2712bb,_0x2dd53e['key']),await _0x431ae6(_0x2dd53e[_0x39fa4c(0x189)],void 0x0);}};}function _(_0x5e086f,_0x26f47c){const _0x554799=_0x265f13;let _0xb71a65=_0x5e086f['definitions'][_0x26f47c];if(_0xb71a65===void 0x0)throw new u(_0x554799(0x176),'Config\x20key\x20is\x20not\x20available:\x20'+_0x26f47c+'.',{'availableKeys':Object['keys'](_0x5e086f[_0x554799(0x198)]),'key':_0x26f47c});return _0xb71a65;}function v(_0x557532,_0x609430,_0x278a3a){const _0x1c2b13=_0x265f13;let _0x116fac=y(_0x557532,()=>_0x609430['codec'][_0x1c2b13(0x181)](_0x278a3a));return{'description':_0x609430[_0x1c2b13(0x149)],'key':_0x557532,'source':_0x1c2b13(0x178),'value':_0x116fac,...Object['hasOwn'](_0x609430,_0x1c2b13(0x16c))?{'defaultValue':_0x609430[_0x1c2b13(0x16c)]}:{}};}function y(_0x20fd8d,_0x218636){const _0x54b600=_0x265f13;try{let _0x368473=_0x218636();return c(_0x368473),_0x368473;}catch(_0x1f30d8){throw new u('CONFIG_INVALID_VALUE',_0x54b600(0x18f)+_0x20fd8d+':\x20'+d(_0x1f30d8),{'key':_0x20fd8d},{'cause':_0x1f30d8});}}function b(_0x4ffc05,_0x24f57f){const _0x41f9e0=_0x265f13;return Object[_0x41f9e0(0x15d)](_0x24f57f,_0x41f9e0(0x16c))?{'defaultValue':_0x24f57f[_0x41f9e0(0x16c)],'description':_0x24f57f['description'],'key':_0x4ffc05,'source':_0x41f9e0(0x18e),'value':_0x24f57f[_0x41f9e0(0x16c)]}:{'description':_0x24f57f[_0x41f9e0(0x149)],'key':_0x4ffc05,'source':_0x41f9e0(0x16e)};}function x(_0x313704,_0x4a63c8){const _0x2f0aa8=_0x265f13;let _0x21a022=_0x313704;for(let _0x2b1f73 of _0x4a63c8[_0x2f0aa8(0x17b)]('.')){if(!w(_0x21a022))throw E(_0x4a63c8);if(!Object['hasOwn'](_0x21a022,_0x2b1f73))return{'found':!0x1};_0x21a022=_0x21a022[_0x2b1f73];}return{'found':!0x0,'value':_0x21a022};}function S(_0x490238,_0x50f1dc,_0x1920f2){const _0x5aeba3=_0x265f13;let _0x99241f={...structuredClone(_0x490238)},_0x7d3bd5=_0x50f1dc['split']('.'),_0x507e1b=_0x99241f;for(let _0x402c1a of _0x7d3bd5[_0x5aeba3(0x14f)](0x0,-0x1)){let _0x39b4f8=_0x507e1b[_0x402c1a];if(_0x39b4f8===void 0x0){let _0x284e47={};_0x507e1b[_0x402c1a]=_0x284e47,_0x507e1b=_0x284e47;}else{if(T(_0x39b4f8))_0x507e1b=_0x39b4f8;else throw E(_0x50f1dc);}}return _0x507e1b[_0x7d3bd5['at'](-0x1)]=structuredClone(_0x1920f2),_0x99241f;}function C(_0x3f27bf,_0x51dd9e){const _0x2be939=_0x265f13;let _0x24fb75={...structuredClone(_0x3f27bf)},_0x59cf25=_0x51dd9e[_0x2be939(0x17b)]('.'),_0x428d01=[],_0x58233f=_0x24fb75;for(let _0x36e500 of _0x59cf25[_0x2be939(0x14f)](0x0,-0x1)){let _0x48d82e=_0x58233f[_0x36e500];if(_0x48d82e===void 0x0)return _0x24fb75;if(!T(_0x48d82e))throw E(_0x51dd9e);_0x428d01[_0x2be939(0x172)]({'object':_0x58233f,'segment':_0x36e500}),_0x58233f=_0x48d82e;}delete _0x58233f[_0x59cf25['at'](-0x1)];for(let _0x1ab1ac of _0x428d01['reverse']()){let _0x40ce50=_0x1ab1ac[_0x2be939(0x157)][_0x1ab1ac[_0x2be939(0x14e)]];if(w(_0x40ce50)&&Object[_0x2be939(0x158)](_0x40ce50)[_0x2be939(0x174)]===0x0)delete _0x1ab1ac[_0x2be939(0x157)][_0x1ab1ac[_0x2be939(0x14e)]];else break;}return _0x24fb75;}function w(_0x4fc64a){const _0x4773f1=_0x265f13;return typeof _0x4fc64a==_0x4773f1(0x157)&&!!_0x4fc64a&&!Array[_0x4773f1(0x151)](_0x4fc64a);}function _0x1f8e(){const _0x11dd58=['store','Config\x20document\x20conflicts\x20with\x20registered\x20key\x20','origin','isSafeInteger','number','string','text','Expected\x20an\x20integer\x20greater\x20than\x20or\x20equal\x20to\x20','name','Expected\x20an\x20integer\x20less\x20than\x20or\x20equal\x20to\x20','Key\x20must\x20contain\x20safe\x20dot-separated\x20identifier\x20segments.','function','defaultValue','Expected\x20one\x20of:\x20','unset','boolean','minimum','Expected\x20\x22true\x22\x20or\x20\x22false\x22.','push','Config\x20path\x20must\x20use\x20the\x20.json\x20extension.','length','858524AYLxLx','CONFIG_UNKNOWN_KEY','found','config','ConfigError','getPrototypeOf','split','5180508yofPUZ','Description\x20must\x20not\x20be\x20empty.','872212AdGetB','value','https:','parse','98775tSMxNt','codec','ext','Expected\x20a\x20finite\x20JSON\x20number.','35lPqHmE','test','139265ETWhHt','key','CONFIG_WRITE_FAILED','Expected\x20a\x20non-empty\x20string\x20without\x20surrounding\x20whitespace.','resolve','code','default','Invalid\x20value\x20for\x20config\x20key\x20','toString','Config\x20path\x20must\x20be\x20absolute.','9SMBwSn','entries','has','maximum','false','json','definitions','Expected\x20an\x20integer.','freeze','some','includes','protocol','7844710XyvRGD','CONFIG_READ_FAILED','read','CONFIG_INVALID_DOCUMENT','details','Codec\x20must\x20provide\x20parse\x20and\x20parseText\x20functions.','dir','isFinite','58umGYfX','delete','22IDYmEF','__proto__','path','join','916536SOaSyu','message','description','map','Expected\x20a\x20safe\x20integer.','Expected\x20an\x20absolute\x20HTTP\x20or\x20HTTPS\x20URL.','trim','segment','slice','Expected\x20a\x20boolean.','isArray','values','parseText','write','Failed\x20to\x20','prototype','object','keys','Invalid\x20default\x20value:\x20','Expected\x20a\x20plain\x20JSON\x20object.','then','Expected\x20a\x20JSON-compatible\x20value.','hasOwn','12VMNzUR','constructor'];_0x1f8e=function(){return _0x11dd58;};return _0x1f8e();}function T(_0x330409){return w(_0x330409);}function E(_0x206eb6){const _0x1e4ff0=_0x265f13;return new u(_0x1e4ff0(0x13c),_0x1e4ff0(0x161)+_0x206eb6+'.',{'key':_0x206eb6});}function D(_0x1ac7b9,_0x7514b9,_0x29b7bb){const _0x5d40fa=_0x265f13;return new u(_0x1ac7b9,_0x5d40fa(0x155)+(_0x1ac7b9==='CONFIG_READ_FAILED'?_0x5d40fa(0x13b):_0x5d40fa(0x154))+'\x20config\x20file\x20'+_0x7514b9+':\x20'+d(_0x29b7bb),{'path':_0x7514b9},{'cause':_0x29b7bb});}export{u as ConfigError,a as configCodecs,g as createFileConfig,p as defineConfig};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/config",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.2",
4
+ "version": "1.0.0",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",