@univer-cli/config 1.0.0-rc.0 → 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 _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};
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-rc.0",
4
+ "version": "1.0.0",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",