@univer-cli/config 1.0.0-beta.2 → 1.0.0-rc.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 _0x42c1b3=_0xe286;(function(_0x5a950f,_0x3e11a5){const _0x443532=_0xe286,_0x2e6481=_0x5a950f();while(!![]){try{const _0x34e660=parseInt(_0x443532(0x71))/0x1+-parseInt(_0x443532(0xb6))/0x2*(parseInt(_0x443532(0xa3))/0x3)+parseInt(_0x443532(0x8b))/0x4*(parseInt(_0x443532(0x7b))/0x5)+parseInt(_0x443532(0x65))/0x6+-parseInt(_0x443532(0x75))/0x7*(-parseInt(_0x443532(0x79))/0x8)+-parseInt(_0x443532(0xa2))/0x9+parseInt(_0x443532(0xa4))/0xa*(parseInt(_0x443532(0x95))/0xb);if(_0x34e660===_0x3e11a5)break;else _0x2e6481['push'](_0x2e6481['shift']());}catch(_0x3ee627){_0x2e6481['push'](_0x2e6481['shift']());}}}(_0x24db,0x54d69));import _0x2ff5a9 from'conf';import{mkdirSync as _0x5f0b99}from'node:fs';function _0xe286(_0x55b4f7,_0x354fbb){_0x55b4f7=_0x55b4f7-0x65;const _0x24db0c=_0x24db();let _0xe28636=_0x24db0c[_0x55b4f7];return _0xe28636;}import{isAbsolute as _0x203676,parse as _0x3b92e1,resolve as _0x4c77e0}from'node:path';var a={'nonEmptyString'(){return{'parse':o,'parseText':o};},'boolean'(){return{'parse'(_0x5add82){const _0x1cd5a6=_0xe286;if(typeof _0x5add82!='boolean')throw Error(_0x1cd5a6(0x90));return _0x5add82;},'parseText'(_0x269be2){const _0x34f3b1=_0xe286;if(_0x269be2==='true')return!0x0;if(_0x269be2===_0x34f3b1(0x88))return!0x1;throw Error(_0x34f3b1(0x9b));}};},'integer'(_0x1e16bb={}){let _0x2e8fa2=_0x19dcd3=>{const _0x429cb1=_0xe286;if(typeof _0x19dcd3!=_0x429cb1(0xaa)||!Number[_0x429cb1(0x87)](_0x19dcd3))throw Error('Expected\x20a\x20safe\x20integer.');if(_0x1e16bb['minimum']!==void 0x0&&_0x19dcd3<_0x1e16bb[_0x429cb1(0x72)])throw Error('Expected\x20an\x20integer\x20greater\x20than\x20or\x20equal\x20to\x20'+_0x1e16bb[_0x429cb1(0x72)]+'.');if(_0x1e16bb[_0x429cb1(0xa7)]!==void 0x0&&_0x19dcd3>_0x1e16bb[_0x429cb1(0xa7)])throw Error(_0x429cb1(0x67)+_0x1e16bb['maximum']+'.');return _0x19dcd3;};return{'parse':_0x2e8fa2,'parseText'(_0x21b7f7){const _0x4fd1de=_0xe286;if(!/^-?(?:0|[1-9]\d*)$/u[_0x4fd1de(0x6c)](_0x21b7f7))throw Error(_0x4fd1de(0x68));return _0x2e8fa2(Number(_0x21b7f7));}};},'enumeration'(_0x504d27){let _0x13194b=_0xdf2674=>{const _0x1000e8=_0xe286;if(typeof _0xdf2674!=_0x1000e8(0x96)||!_0x504d27[_0x1000e8(0x97)](_0xdf2674))throw Error(_0x1000e8(0xb7)+_0x504d27[_0x1000e8(0x98)](',\x20')+'.');return _0xdf2674;};return{'parse':_0x13194b,'parseText':_0x13194b};},'httpUrl'(){return{'parse':s,'parseText':s};},'httpOrigin'(){const _0xd78c16=_0xe286;let _0x249ee3=_0x4387f5=>new URL(s(_0x4387f5))[_0xd78c16(0x8e)];return{'parse':_0x249ee3,'parseText':_0x249ee3};}};function o(_0x2bb827){const _0x430ca8=_0xe286;if(typeof _0x2bb827!=_0x430ca8(0x96)||_0x2bb827['length']===0x0||_0x2bb827[_0x430ca8(0x9c)]()!==_0x2bb827)throw Error(_0x430ca8(0xae));return _0x2bb827;}function s(_0x544324){const _0x2bfd31=_0xe286;let _0x16d439=o(_0x544324),_0x52fc7b;try{_0x52fc7b=new URL(_0x16d439);}catch{throw Error(_0x2bfd31(0xac));}if(_0x52fc7b[_0x2bfd31(0xb0)]!==_0x2bfd31(0xb9)&&_0x52fc7b[_0x2bfd31(0xb0)]!==_0x2bfd31(0x6b))throw Error('Expected\x20an\x20absolute\x20HTTP\x20or\x20HTTPS\x20URL.');return _0x52fc7b['toString']();}function _0x24db(){const _0x489a88=['Expected\x20a\x20boolean.','Config\x20document\x20conflicts\x20with\x20registered\x20key\x20','store','object','Config\x20path\x20must\x20use\x20the\x20.json\x20extension.','33737fQenHW','string','includes','join','definitions','add','Expected\x20\x22true\x22\x20or\x20\x22false\x22.','trim','Expected\x20a\x20finite\x20JSON\x20number.','config','Invalid\x20config\x20definition\x20','details','prototype','5893056BnRmjt','51603VEgjIQ','60kZYqGL','Expected\x20a\x20plain\x20JSON\x20object.','Failed\x20to\x20','maximum','Description\x20must\x20not\x20be\x20empty.','hasOwn','number','parseText','Expected\x20an\x20absolute\x20HTTP\x20or\x20HTTPS\x20URL.','values','Expected\x20a\x20non-empty\x20string\x20without\x20surrounding\x20whitespace.','delete','protocol','keys','name','write','has','ConfigError','12emgjKe','Expected\x20one\x20of:\x20','Config\x20key\x20is\x20not\x20available:\x20','http:','codec','text','defaultValue','692088mkznrQ','CONFIG_INVALID_VALUE','Expected\x20an\x20integer\x20less\x20than\x20or\x20equal\x20to\x20','Expected\x20an\x20integer.','json','\x20config\x20file\x20','https:','test','function','default','parse','key','100685hjpsMF','minimum','some','path','7VKHssq','Expected\x20an\x20acyclic\x20JSON-compatible\x20value.','slice','length','5257864PgkcYF','freeze','4065HQolMi','CONFIG_INVALID_DEFINITION','Invalid\x20value\x20for\x20config\x20key\x20','CONFIG_READ_FAILED','dir','Config\x20path\x20must\x20be\x20absolute.','split','unset','push','value','description','isArray','isSafeInteger','false','constructor','Key\x20must\x20contain\x20safe\x20dot-separated\x20identifier\x20segments.','1052OxcDeG','resolve','segment','origin','read'];_0x24db=function(){return _0x489a88;};return _0x24db();}function c(_0x15c403){l(_0x15c403,new Set());}function l(_0x14355f,_0x24498b){const _0x5d219d=_0xe286;if(_0x14355f===null||typeof _0x14355f=='string'||typeof _0x14355f=='boolean')return;if(typeof _0x14355f=='number'){if(!Number['isFinite'](_0x14355f))throw Error(_0x5d219d(0x9d));return;}if(typeof _0x14355f!=_0x5d219d(0x93))throw Error('Expected\x20a\x20JSON-compatible\x20value.');if(_0x24498b[_0x5d219d(0xb4)](_0x14355f))throw Error(_0x5d219d(0x76));if(_0x24498b[_0x5d219d(0x9a)](_0x14355f),Array[_0x5d219d(0x86)](_0x14355f)){for(let _0x4691a7 of _0x14355f)l(_0x4691a7,_0x24498b);_0x24498b[_0x5d219d(0xaf)](_0x14355f);return;}let _0x5670af=Object['getPrototypeOf'](_0x14355f);if(_0x5670af!==Object['prototype']&&_0x5670af!==null)throw Error(_0x5d219d(0xa5));for(let _0x1abe77 of Object[_0x5d219d(0xad)](_0x14355f))l(_0x1abe77,_0x24498b);_0x24498b[_0x5d219d(0xaf)](_0x14355f);}var u=class extends Error{['code'];[_0x42c1b3(0xa0)];constructor(_0x3ad1cb,_0x2f7753,_0x32adf9={},_0x341594){const _0x303d94=_0x42c1b3;super(_0x2f7753,_0x341594),this[_0x303d94(0xb2)]=_0x303d94(0xb5),this['code']=_0x3ad1cb,this[_0x303d94(0xa0)]=_0x32adf9;}};function d(_0x2bc5e0){return _0x2bc5e0 instanceof Error?_0x2bc5e0['message']:String(_0x2bc5e0);}var f=new Set(['__proto__',_0x42c1b3(0x89),_0x42c1b3(0xa1)]);function p(_0x421123){const _0x558597=_0x42c1b3;let _0x4b4f98={};for(let [_0x3712ee,_0x31ad2f]of Object['entries'](_0x421123)){m(_0x3712ee);let _0xbea0c4=_0x31ad2f[_0x558597(0x85)][_0x558597(0x9c)]();if(_0xbea0c4==='')throw h(_0x3712ee,_0x558597(0xa8));if(typeof _0x31ad2f['codec']?.['parse']!='function'||typeof _0x31ad2f[_0x558597(0xba)][_0x558597(0xab)]!=_0x558597(0x6d))throw h(_0x3712ee,'Codec\x20must\x20provide\x20parse\x20and\x20parseText\x20functions.');let _0x540826;if(Object['hasOwn'](_0x31ad2f,_0x558597(0xbc)))try{_0x540826=_0x31ad2f[_0x558597(0xba)][_0x558597(0x6f)](_0x31ad2f[_0x558597(0xbc)]),c(_0x540826);}catch(_0x3a7909){throw h(_0x3712ee,'Invalid\x20default\x20value:\x20'+d(_0x3a7909),_0x3a7909);}_0x4b4f98[_0x3712ee]=Object[_0x558597(0x7a)]({'codec':_0x31ad2f[_0x558597(0xba)],'description':_0xbea0c4,...Object[_0x558597(0xa9)](_0x31ad2f,_0x558597(0xbc))?{'defaultValue':_0x540826}:{}});}return Object['freeze'](_0x4b4f98);}function m(_0x330b12){const _0x149a37=_0x42c1b3;let _0x307126=_0x330b12['split']('.');if(_0x330b12[_0x149a37(0x78)]===0x0||_0x330b12['trim']()!==_0x330b12||_0x307126[_0x149a37(0x73)](_0x4d9346=>_0x4d9346['length']===0x0||f[_0x149a37(0xb4)](_0x4d9346)||!/^[A-Za-z][A-Za-z0-9_-]*$/u[_0x149a37(0x6c)](_0x4d9346)))throw h(_0x330b12,_0x149a37(0x8a));}function h(_0x2bcc44,_0x4ccd99,_0x22aba2){const _0x560ea2=_0x42c1b3;return new u(_0x560ea2(0x7c),_0x560ea2(0x9f)+_0x2bcc44+':\x20'+_0x4ccd99,{'key':_0x2bcc44},_0x22aba2===void 0x0?void 0x0:{'cause':_0x22aba2});}function g(_0x238804){const _0x3bf886=_0x42c1b3;if(!_0x203676(_0x238804[_0x3bf886(0x74)]))throw Error(_0x3bf886(0x80));let _0x54c3d1=_0x4c77e0(_0x238804['path']),_0x3221df=_0x3b92e1(_0x54c3d1);if(_0x3221df['ext']!=='.json')throw Error(_0x3bf886(0x94));try{_0x5f0b99(_0x3221df[_0x3bf886(0x7f)],{'mode':0x1c0,'recursive':!0x0});}catch(_0x2f4710){throw D('CONFIG_WRITE_FAILED',_0x54c3d1,_0x2f4710);}let _0x298d36;try{_0x298d36=new _0x2ff5a9({'configFileMode':0x180,'configName':_0x3221df[_0x3bf886(0xb2)],'cwd':_0x3221df[_0x3bf886(0x7f)],'fileExtension':_0x3bf886(0x69)});}catch(_0x241e70){throw D(_0x3bf886(0x7e),_0x54c3d1,_0x241e70);}let _0x18e3ee=Promise[_0x3bf886(0x8c)](),_0x25826e=()=>{const _0x58a440=_0x3bf886;try{return _0x298d36[_0x58a440(0x92)];}catch(_0xd0ca65){throw D(_0x58a440(0x7e),_0x54c3d1,_0xd0ca65);}},_0x4cbfe7=_0x39825a=>{const _0xa8d72d=_0x3bf886;try{_0x298d36[_0xa8d72d(0x92)]=_0x39825a;}catch(_0x9684a8){throw D('CONFIG_WRITE_FAILED',_0x54c3d1,_0x9684a8);}},_0xacbd0a=_0x490b31=>{const _0x16e4c7=_0x3bf886;let _0x18c3e5=_(_0x238804,_0x490b31),_0x3a5bfe=x(_0x25826e(),_0x490b31);return _0x3a5bfe['found']?v(_0x490b31,_0x18c3e5,_0x3a5bfe[_0x16e4c7(0x84)]):b(_0x490b31,_0x18c3e5);},_0x4fdfc6=async(_0x56b763,_0x440377)=>{let _0x2b6878=_0x18e3ee['then'](()=>{let _0x16b5c8=_0x25826e();if(_0x440377===void 0x0&&!x(_0x16b5c8,_0x56b763)['found'])return _0xacbd0a(_0x56b763);let _0x398cfa=_0x440377===void 0x0?C(_0x16b5c8,_0x56b763):S(_0x16b5c8,_0x56b763,_0x440377);return _0x4cbfe7(_0x398cfa),_0xacbd0a(_0x56b763);});return _0x18e3ee=_0x2b6878['then'](()=>void 0x0,()=>void 0x0),await _0x2b6878;};return{'path':_0x298d36[_0x3bf886(0x74)],async 'get'(_0xa9ae34){return _0xacbd0a(_0xa9ae34['key']);},async 'list'(){const _0x590831=_0x3bf886;return Object[_0x590831(0xb1)](_0x238804[_0x590831(0x99)])['map'](_0x5c3f1e=>_0xacbd0a(_0x5c3f1e));},async 'set'(_0x335478){const _0x570c2b=_0x3bf886;let _0x443d43=_(_0x238804,_0x335478[_0x570c2b(0x70)]);return await _0x4fdfc6(_0x335478[_0x570c2b(0x70)],y(_0x335478[_0x570c2b(0x70)],()=>_0x443d43[_0x570c2b(0xba)]['parse'](_0x335478[_0x570c2b(0x84)])));},async 'setFromText'(_0x1aaa1a){const _0x13add5=_0x3bf886;let _0x2ec05e=_(_0x238804,_0x1aaa1a['key']);return await _0x4fdfc6(_0x1aaa1a['key'],y(_0x1aaa1a[_0x13add5(0x70)],()=>_0x2ec05e[_0x13add5(0xba)][_0x13add5(0xab)](_0x1aaa1a[_0x13add5(0xbb)])));},async 'unset'(_0x123713){const _0x112ca9=_0x3bf886;return _(_0x238804,_0x123713[_0x112ca9(0x70)]),await _0x4fdfc6(_0x123713[_0x112ca9(0x70)],void 0x0);}};}function _(_0x4b46de,_0x4fdf94){const _0x1f7011=_0x42c1b3;let _0xd34896=_0x4b46de['definitions'][_0x4fdf94];if(_0xd34896===void 0x0)throw new u('CONFIG_UNKNOWN_KEY',_0x1f7011(0xb8)+_0x4fdf94+'.',{'availableKeys':Object[_0x1f7011(0xb1)](_0x4b46de[_0x1f7011(0x99)]),'key':_0x4fdf94});return _0xd34896;}function v(_0x40c4f1,_0x838654,_0x311ee5){const _0x567b30=_0x42c1b3;let _0x5d6e14=y(_0x40c4f1,()=>_0x838654[_0x567b30(0xba)][_0x567b30(0x6f)](_0x311ee5));return{'description':_0x838654[_0x567b30(0x85)],'key':_0x40c4f1,'source':_0x567b30(0x9e),'value':_0x5d6e14,...Object[_0x567b30(0xa9)](_0x838654,_0x567b30(0xbc))?{'defaultValue':_0x838654[_0x567b30(0xbc)]}:{}};}function y(_0x1e63dc,_0x242fdf){const _0x199f6f=_0x42c1b3;try{let _0x1fe4cc=_0x242fdf();return c(_0x1fe4cc),_0x1fe4cc;}catch(_0x53fea8){throw new u(_0x199f6f(0x66),_0x199f6f(0x7d)+_0x1e63dc+':\x20'+d(_0x53fea8),{'key':_0x1e63dc},{'cause':_0x53fea8});}}function b(_0x182d9d,_0x18d203){const _0x55c2e9=_0x42c1b3;return Object[_0x55c2e9(0xa9)](_0x18d203,_0x55c2e9(0xbc))?{'defaultValue':_0x18d203[_0x55c2e9(0xbc)],'description':_0x18d203['description'],'key':_0x182d9d,'source':_0x55c2e9(0x6e),'value':_0x18d203[_0x55c2e9(0xbc)]}:{'description':_0x18d203[_0x55c2e9(0x85)],'key':_0x182d9d,'source':_0x55c2e9(0x82)};}function x(_0x4a8c8d,_0x1fdd33){const _0x9ed1be=_0x42c1b3;let _0x521bdc=_0x4a8c8d;for(let _0x2361e2 of _0x1fdd33[_0x9ed1be(0x81)]('.')){if(!w(_0x521bdc))throw E(_0x1fdd33);if(!Object[_0x9ed1be(0xa9)](_0x521bdc,_0x2361e2))return{'found':!0x1};_0x521bdc=_0x521bdc[_0x2361e2];}return{'found':!0x0,'value':_0x521bdc};}function S(_0x4145d0,_0x2d69c7,_0x2b42e8){const _0x3072ff=_0x42c1b3;let _0x44bb2b={...structuredClone(_0x4145d0)},_0x5dce35=_0x2d69c7[_0x3072ff(0x81)]('.'),_0x4817ea=_0x44bb2b;for(let _0x41af90 of _0x5dce35['slice'](0x0,-0x1)){let _0x22999f=_0x4817ea[_0x41af90];if(_0x22999f===void 0x0){let _0x19e7f8={};_0x4817ea[_0x41af90]=_0x19e7f8,_0x4817ea=_0x19e7f8;}else{if(T(_0x22999f))_0x4817ea=_0x22999f;else throw E(_0x2d69c7);}}return _0x4817ea[_0x5dce35['at'](-0x1)]=structuredClone(_0x2b42e8),_0x44bb2b;}function C(_0x4942ea,_0x333a45){const _0x1897dd=_0x42c1b3;let _0x56f155={...structuredClone(_0x4942ea)},_0x3094dd=_0x333a45['split']('.'),_0x55cd3a=[],_0xa5cd14=_0x56f155;for(let _0xa707be of _0x3094dd[_0x1897dd(0x77)](0x0,-0x1)){let _0x672292=_0xa5cd14[_0xa707be];if(_0x672292===void 0x0)return _0x56f155;if(!T(_0x672292))throw E(_0x333a45);_0x55cd3a[_0x1897dd(0x83)]({'object':_0xa5cd14,'segment':_0xa707be}),_0xa5cd14=_0x672292;}delete _0xa5cd14[_0x3094dd['at'](-0x1)];for(let _0x4470e0 of _0x55cd3a['reverse']()){let _0xc349b5=_0x4470e0[_0x1897dd(0x93)][_0x4470e0[_0x1897dd(0x8d)]];if(w(_0xc349b5)&&Object[_0x1897dd(0xb1)](_0xc349b5)['length']===0x0)delete _0x4470e0[_0x1897dd(0x93)][_0x4470e0[_0x1897dd(0x8d)]];else break;}return _0x56f155;}function w(_0x45187b){return typeof _0x45187b=='object'&&!!_0x45187b&&!Array['isArray'](_0x45187b);}function T(_0x3409ce){return w(_0x3409ce);}function E(_0x160263){const _0x4dc09b=_0x42c1b3;return new u('CONFIG_INVALID_DOCUMENT',_0x4dc09b(0x91)+_0x160263+'.',{'key':_0x160263});}function D(_0x4d7e19,_0x3c364e,_0x5c6349){const _0x411316=_0x42c1b3;return new u(_0x4d7e19,_0x411316(0xa6)+(_0x4d7e19==='CONFIG_READ_FAILED'?_0x411316(0x8f):_0x411316(0xb3))+_0x411316(0x6a)+_0x3c364e+':\x20'+d(_0x5c6349),{'path':_0x3c364e},{'cause':_0x5c6349});}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-rc.0",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",