@univer-cli/resource-library-command 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x4b31(){const _0x432b65=['\x20resources\x20(','write\x20flat\x20<registry>--<resource>.svg\x20files','Expected\x20a\x20positive\x20integer;\x20received\x20\x22','591363cHutPV','1142472cllssH','HANDLE','argument','writeOut','--json','canonical\x20<registryId>/<resourceId>\x20handles','33SiEBJE','\x20MB','path','message','Show\x20the\x20resource\x20cache\x20path','\x20\x20SIZE','colorEditable','4847931gOpHwm','toFixed','command','length','find','clearCache','svg','GROUP','read','padEnd','stringify','Clear\x20all\x20cached\x20resources','map','error','colorEditableCount','GROUPS','limit','978HbYyVd','argParser','--limit\x20<number>','\x20could\x20not\x20be\x20exported.','maximum\x20number\x20of\x20results','\x20more;\x20raise\x20--limit\x20or\x20narrow\x20the\x20query.','isInteger','clear','registry','TAGS','20IypQPM','export','resources.export.failed','default','<queries...>','83596UAXXOs','Find\x20and\x20export\x20SVG\x20resources\x20from\x20a\x20multi-registry\x20catalog','openLibrary','description','addOption','writeErr','total','761154MjOKnG','width','intrinsicSize','Find\x20resources\x20by\x20name,\x20description,\x20group,\x20tag,\x20or\x20keyword','join','cache','option','failed','exported','json','configureOutput','listRegistries','out','fixed','NAME','groupCount','outputHelp','action','No\x20resources\x20matched;\x20try\x20a\x20shorter\x20substring,\x20a\x20synonym,\x20or\x20another\x20registry.','COLOR','--registry\x20<id>','write\x20structured\x20JSON','resources','resources.invalid-input','14XJPnnI','handle','padStart','576485KBPGRv','332kYslqw','label','--out\x20<directory>','code','byteCount','EDITABLE'];_0x4b31=function(){return _0x432b65;};return _0x4b31();}(function(_0x48c426,_0x1094db){const _0x3541c2=_0x4052,_0x2d0456=_0x48c426();while(!![]){try{const _0xec52bc=-parseInt(_0x3541c2(0x1b6))/0x1*(parseInt(_0x3541c2(0x18e))/0x2)+-parseInt(_0x3541c2(0x19e))/0x3*(-parseInt(_0x3541c2(0x1c5))/0x4)+-parseInt(_0x3541c2(0x18d))/0x5+-parseInt(_0x3541c2(0x1cc))/0x6*(parseInt(_0x3541c2(0x18a))/0x7)+-parseInt(_0x3541c2(0x198))/0x8+-parseInt(_0x3541c2(0x197))/0x9*(-parseInt(_0x3541c2(0x1c0))/0xa)+parseInt(_0x3541c2(0x1a5))/0xb;if(_0xec52bc===_0x1094db)break;else _0x2d0456['push'](_0x2d0456['shift']());}catch(_0x1ba4b3){_0x2d0456['push'](_0x2d0456['shift']());}}}(_0x4b31,0x1f36c));function _0x4052(_0x8559b0,_0x124a9e){_0x8559b0=_0x8559b0-0x17e;const _0x4b31a1=_0x4b31();let _0x405269=_0x4b31a1[_0x8559b0];return _0x405269;}import{isResourceLibraryError as _0x4de70d}from'@univer-cli/resource-library';import{Command as _0x27c86b,InvalidArgumentError as _0x479f2c,Option as _0x3759c0}from'commander';var i=0x1e;function a(_0x53ad77){const _0x37f742=_0x4052;let _0x14910d=new _0x27c86b(_0x37f742(0x188))['description'](_0x37f742(0x1c6))[_0x37f742(0x183)](()=>_0x14910d[_0x37f742(0x182)]());_0x14910d[_0x37f742(0x1a7)]('registries')[_0x37f742(0x1c8)]('List\x20available\x20resource\x20registries')[_0x37f742(0x1d2)](_0x37f742(0x19c),_0x37f742(0x187))['action'](async _0x586691=>{const _0x40f231=_0x37f742;let _0x34092d=await c(_0x14910d,async()=>_0x53ad77['openLibrary']()[_0x40f231(0x1d7)]());l(_0x14910d,_0x586691,{'registries':_0x34092d},d(_0x34092d));}),_0x14910d[_0x37f742(0x1a7)](_0x37f742(0x1a9))[_0x37f742(0x1c8)](_0x37f742(0x1cf))[_0x37f742(0x19a)](_0x37f742(0x1c4),'one\x20or\x20more\x20queries,\x20searched\x20independently')[_0x37f742(0x1c9)](new _0x3759c0(_0x37f742(0x186),'restrict\x20results\x20to\x20a\x20registry;\x20repeatable')[_0x37f742(0x1b7)](o)[_0x37f742(0x1c3)]([]))[_0x37f742(0x1c9)](new _0x3759c0(_0x37f742(0x1b8),_0x37f742(0x1ba))[_0x37f742(0x1b7)](s)[_0x37f742(0x1c3)](i))[_0x37f742(0x1d2)]('--json',_0x37f742(0x187))[_0x37f742(0x183)](async(_0x38e8c8,_0x2da527)=>{const _0x591055=_0x37f742;let _0x4257f4=await c(_0x14910d,async()=>_0x53ad77[_0x591055(0x1c7)]()['find']({'queries':_0x38e8c8,'registries':_0x2da527['registry'],'limit':_0x2da527[_0x591055(0x1b5)]}));l(_0x14910d,_0x2da527,{'query':{'queries':_0x38e8c8,'registries':_0x2da527[_0x591055(0x1be)]},'resources':_0x4257f4[_0x591055(0x188)],'total':_0x4257f4[_0x591055(0x1cb)],'limit':_0x2da527[_0x591055(0x1b5)]},f(_0x4257f4[_0x591055(0x188)],_0x4257f4[_0x591055(0x1cb)]));}),_0x14910d[_0x37f742(0x1a7)](_0x37f742(0x1c1))[_0x37f742(0x1c8)]('Read\x20one\x20SVG\x20or\x20export\x20resources\x20to\x20a\x20directory')[_0x37f742(0x19a)]('<handles...>',_0x37f742(0x19d))[_0x37f742(0x1d2)](_0x37f742(0x190),_0x37f742(0x195))['option'](_0x37f742(0x19c),_0x37f742(0x187))[_0x37f742(0x183)](async(_0x62592d,_0x39005f)=>{const _0x310a12=_0x37f742;if(_0x39005f[_0x310a12(0x17e)]===void 0x0){_0x62592d[_0x310a12(0x1a8)]!==0x1&&_0x14910d['error']('Exporting\x20more\x20than\x20one\x20resource\x20requires\x20--out\x20<directory>.',{'code':_0x310a12(0x189),'exitCode':0x1});let _0x1ad6de=await c(_0x14910d,async()=>_0x53ad77[_0x310a12(0x1c7)]()[_0x310a12(0x1ad)]({'handle':_0x62592d[0x0]}));_0x39005f[_0x310a12(0x1d5)]===!0x0?u(_0x14910d,_0x1ad6de):_0x14910d[_0x310a12(0x1d6)]()['writeOut']?.(_0x1ad6de[_0x310a12(0x1ab)]);return;}let _0x4a87bd=await c(_0x14910d,async()=>_0x53ad77[_0x310a12(0x1c7)]()[_0x310a12(0x1c1)]({'handles':_0x62592d,'destination':_0x39005f[_0x310a12(0x17e)]}));if(_0x39005f['json']===!0x0)u(_0x14910d,_0x4a87bd);else{let _0x4d9a3b=_0x14910d[_0x310a12(0x1d6)]();for(let _0x45d4fc of _0x4a87bd[_0x310a12(0x1d4)])_0x4d9a3b['writeOut']?.(_0x45d4fc[_0x310a12(0x1a0)]+'\x0a');for(let _0x28ca19 of _0x4a87bd[_0x310a12(0x1d3)])_0x4d9a3b[_0x310a12(0x1ca)]?.(_0x28ca19['handle']+':\x20'+_0x28ca19[_0x310a12(0x191)]+':\x20'+_0x28ca19[_0x310a12(0x1a1)]+'\x0a');}_0x4a87bd['failed']['length']>0x0&&_0x14910d[_0x310a12(0x1b2)](_0x4a87bd[_0x310a12(0x1d3)][_0x310a12(0x1a8)]+'\x20resource'+(_0x4a87bd[_0x310a12(0x1d3)][_0x310a12(0x1a8)]===0x1?'':'s')+_0x310a12(0x1b9),{'code':_0x310a12(0x1c2),'exitCode':0x1});});let _0x4cbfab=_0x14910d[_0x37f742(0x1a7)](_0x37f742(0x1d1))[_0x37f742(0x1c8)]('Inspect\x20or\x20clear\x20the\x20resource\x20cache');return _0x4cbfab[_0x37f742(0x183)](()=>_0x4cbfab['outputHelp']()),_0x4cbfab[_0x37f742(0x1a7)]('path')[_0x37f742(0x1c8)](_0x37f742(0x1a2))[_0x37f742(0x1d2)](_0x37f742(0x19c),_0x37f742(0x187))[_0x37f742(0x183)](_0x4c89dd=>{const _0x10e629=_0x37f742;let _0x20b34c=_0x53ad77[_0x10e629(0x1c7)]()['cacheLocation'];l(_0x14910d,_0x4c89dd,{'path':_0x20b34c},_0x20b34c);}),_0x4cbfab[_0x37f742(0x1a7)](_0x37f742(0x1bd))[_0x37f742(0x1c8)](_0x37f742(0x1b0))[_0x37f742(0x1d2)]('--json',_0x37f742(0x187))[_0x37f742(0x183)](async _0x50c35a=>{const _0x4f28d6=_0x37f742;let _0x4b8628=await c(_0x14910d,async()=>_0x53ad77[_0x4f28d6(0x1c7)]()[_0x4f28d6(0x1aa)]());l(_0x14910d,_0x50c35a,{'cleared':_0x4b8628},'Cleared\x20'+_0x4b8628['resourceCount']+_0x4f28d6(0x194)+p(_0x4b8628[_0x4f28d6(0x192)])+')\x20from\x20'+_0x4b8628['path']+'.');}),_0x14910d;}function o(_0xe010db,_0x4c9d43){return[..._0x4c9d43,_0xe010db];}function s(_0x310d9a){const _0x9f6ab6=_0x4052;let _0x3256c8=Number(_0x310d9a);if(!Number[_0x9f6ab6(0x1bc)](_0x3256c8)||_0x3256c8<0x1)throw new _0x479f2c(_0x9f6ab6(0x196)+_0x310d9a+'\x22.');return _0x3256c8;}async function c(_0x23a04f,_0x198fc4){const _0x3ad2d3=_0x4052;try{return await _0x198fc4();}catch(_0x565163){throw _0x4de70d(_0x565163)&&_0x23a04f[_0x3ad2d3(0x1b2)](_0x565163[_0x3ad2d3(0x191)]+':\x20'+_0x565163[_0x3ad2d3(0x1a1)],{'code':'resources.failed','exitCode':0x1}),_0x565163;}}function l(_0x1c9bad,_0x241541,_0x5a7b55,_0x9d0dde){const _0x4edcbd=_0x4052;_0x241541['json']===!0x0?u(_0x1c9bad,_0x5a7b55):_0x1c9bad[_0x4edcbd(0x1d6)]()[_0x4edcbd(0x19b)]?.(_0x9d0dde+'\x0a');}function u(_0x51026c,_0x3b8258){const _0x26c06d=_0x4052;_0x51026c[_0x26c06d(0x1d6)]()[_0x26c06d(0x19b)]?.(JSON[_0x26c06d(0x1af)](_0x3b8258,null,0x2)+'\x0a');}function d(_0x23430b){const _0x12ac7e=_0x4052;return['REGISTRY'['padEnd'](0x22)+'\x20\x20'+'RESOURCES'['padStart'](0x9)+'\x20\x20'+_0x12ac7e(0x1b4)['padStart'](0x7)+'\x20\x20'+_0x12ac7e(0x1bf)[_0x12ac7e(0x18c)](0x6)+'\x20\x20'+_0x12ac7e(0x193)['padStart'](0xa),..._0x23430b[_0x12ac7e(0x1b1)](_0x408249=>[_0x408249['id'][_0x12ac7e(0x1ae)](0x22),String(_0x408249['resourceCount'])[_0x12ac7e(0x18c)](0x9),String(_0x408249[_0x12ac7e(0x181)])[_0x12ac7e(0x18c)](0x7),String(_0x408249['tagCount'])[_0x12ac7e(0x18c)](0x6),(_0x408249[_0x12ac7e(0x1b3)]+'/'+_0x408249['resourceCount'])[_0x12ac7e(0x18c)](0xa)][_0x12ac7e(0x1d0)]('\x20\x20'))][_0x12ac7e(0x1d0)]('\x0a');}function f(_0x1a1ee2,_0x5ade02){const _0x4713e1=_0x4052;if(_0x1a1ee2[_0x4713e1(0x1a8)]===0x0)return _0x4713e1(0x184);let _0x490847=[_0x4713e1(0x199)[_0x4713e1(0x1ae)](0x32)+'\x20\x20'+_0x4713e1(0x180)['padEnd'](0x1c)+'\x20\x20'+_0x4713e1(0x1ac)['padEnd'](0x12)+'\x20\x20'+_0x4713e1(0x185)['padEnd'](0x8)+_0x4713e1(0x1a3),..._0x1a1ee2['map'](_0x4287b9=>{const _0x4cf97d=_0x4713e1;let _0x22cb2e=_0x4287b9['group']?.[_0x4cf97d(0x18f)]??'-',_0x1ab8a4=_0x4287b9[_0x4cf97d(0x1a4)]?'editable':_0x4cf97d(0x17f),_0x173159=_0x4287b9[_0x4cf97d(0x1ce)][_0x4cf97d(0x1cd)]+'×'+_0x4287b9['intrinsicSize']['height'];return _0x4287b9[_0x4cf97d(0x18b)][_0x4cf97d(0x1ae)](0x32)+'\x20\x20'+_0x4287b9['name'][_0x4cf97d(0x1ae)](0x1c)+'\x20\x20'+_0x22cb2e[_0x4cf97d(0x1ae)](0x12)+'\x20\x20'+_0x1ab8a4[_0x4cf97d(0x1ae)](0x8)+'\x20\x20'+_0x173159;})];return _0x5ade02>_0x1a1ee2[_0x4713e1(0x1a8)]&&_0x490847['push']('…\x20'+(_0x5ade02-_0x1a1ee2[_0x4713e1(0x1a8)])+_0x4713e1(0x1bb)),_0x490847['join']('\x0a');}function p(_0x1bdc27){const _0xa5e77b=_0x4052;return _0x1bdc27<0x400?_0x1bdc27+'\x20B':_0x1bdc27<0x100000?(_0x1bdc27/0x400)[_0xa5e77b(0x1a6)](0x1)+'\x20KB':(_0x1bdc27/0x100000)['toFixed'](0x1)+_0xa5e77b(0x19f);}export{a as createResourcesCommand};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univer-cli/resource-library-command",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"README.zh-CN.md"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@univer-cli/resource-library": "1.0.
|
|
21
|
+
"@univer-cli/resource-library": "1.0.2"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"commander": "^15.0.0"
|