@univer-cli/resource-library-command 1.0.0-rc.0 → 1.0.1
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
|
-
(function(
|
|
1
|
+
(function(_0x1e486e,_0x5209a6){const _0x1867a3=_0x3e27,_0x534eee=_0x1e486e();while(!![]){try{const _0x3230e1=parseInt(_0x1867a3(0x20d))/0x1+-parseInt(_0x1867a3(0x206))/0x2*(parseInt(_0x1867a3(0x1ff))/0x3)+parseInt(_0x1867a3(0x1c0))/0x4+parseInt(_0x1867a3(0x1f3))/0x5*(parseInt(_0x1867a3(0x203))/0x6)+-parseInt(_0x1867a3(0x210))/0x7+parseInt(_0x1867a3(0x1d4))/0x8*(parseInt(_0x1867a3(0x1f2))/0x9)+parseInt(_0x1867a3(0x1ee))/0xa*(-parseInt(_0x1867a3(0x1f6))/0xb);if(_0x3230e1===_0x5209a6)break;else _0x534eee['push'](_0x534eee['shift']());}catch(_0x32ae4){_0x534eee['push'](_0x534eee['shift']());}}}(_0x4e74,0x80112));import{isResourceLibraryError as _0x3deb28}from'@univer-cli/resource-library';import{Command as _0xbe6711,InvalidArgumentError as _0x5b87d0,Option as _0x31c42f}from'commander';var i=0x1e;function a(_0x522681){const _0x21d141=_0x3e27;let _0x118d87=new _0xbe6711(_0x21d141(0x1c7))[_0x21d141(0x1f5)]('Find\x20and\x20export\x20SVG\x20resources\x20from\x20a\x20multi-registry\x20catalog')['action'](()=>_0x118d87[_0x21d141(0x1d6)]());_0x118d87['command'](_0x21d141(0x21b))[_0x21d141(0x1f5)](_0x21d141(0x217))[_0x21d141(0x202)](_0x21d141(0x1e3),'write\x20structured\x20JSON')[_0x21d141(0x214)](async _0x4452a6=>{const _0xbfed67=_0x21d141;let _0x15c0b3=await c(_0x118d87,async()=>_0x522681[_0xbfed67(0x1c9)]()[_0xbfed67(0x1cc)]());l(_0x118d87,_0x4452a6,{'registries':_0x15c0b3},d(_0x15c0b3));}),_0x118d87[_0x21d141(0x1d9)](_0x21d141(0x204))[_0x21d141(0x1f5)](_0x21d141(0x1de))[_0x21d141(0x1d3)](_0x21d141(0x1ef),_0x21d141(0x20b))[_0x21d141(0x1c6)](new _0x31c42f(_0x21d141(0x1c3),_0x21d141(0x1fc))[_0x21d141(0x215)](o)[_0x21d141(0x1e1)]([]))[_0x21d141(0x1c6)](new _0x31c42f(_0x21d141(0x212),_0x21d141(0x1cd))['argParser'](s)[_0x21d141(0x1e1)](i))['option'](_0x21d141(0x1e3),'write\x20structured\x20JSON')[_0x21d141(0x214)](async(_0xccd051,_0x4c19f3)=>{const _0x1834eb=_0x21d141;let _0x230a0b=await c(_0x118d87,async()=>_0x522681['openLibrary']()['find']({'queries':_0xccd051,'registries':_0x4c19f3[_0x1834eb(0x21a)],'limit':_0x4c19f3['limit']}));l(_0x118d87,_0x4c19f3,{'query':{'queries':_0xccd051,'registries':_0x4c19f3[_0x1834eb(0x21a)]},'resources':_0x230a0b[_0x1834eb(0x1c7)],'total':_0x230a0b[_0x1834eb(0x1fb)],'limit':_0x4c19f3['limit']},f(_0x230a0b['resources'],_0x230a0b[_0x1834eb(0x1fb)]));}),_0x118d87['command'](_0x21d141(0x1e2))[_0x21d141(0x1f5)](_0x21d141(0x1cb))['argument'](_0x21d141(0x1eb),_0x21d141(0x1d7))[_0x21d141(0x202)]('--out\x20<directory>','write\x20flat\x20<registry>--<resource>.svg\x20files')['option'](_0x21d141(0x1e3),_0x21d141(0x1d2))[_0x21d141(0x214)](async(_0x5bdc11,_0x32a8b1)=>{const _0x45bcad=_0x21d141;if(_0x32a8b1[_0x45bcad(0x211)]===void 0x0){_0x5bdc11[_0x45bcad(0x1e0)]!==0x1&&_0x118d87[_0x45bcad(0x216)](_0x45bcad(0x1e4),{'code':'resources.invalid-input','exitCode':0x1});let _0x427902=await c(_0x118d87,async()=>_0x522681[_0x45bcad(0x1c9)]()[_0x45bcad(0x1ca)]({'handle':_0x5bdc11[0x0]}));_0x32a8b1[_0x45bcad(0x1fa)]===!0x0?u(_0x118d87,_0x427902):_0x118d87['configureOutput']()[_0x45bcad(0x1f7)]?.(_0x427902['svg']);return;}let _0x2d88c9=await c(_0x118d87,async()=>_0x522681[_0x45bcad(0x1c9)]()[_0x45bcad(0x1e2)]({'handles':_0x5bdc11,'destination':_0x32a8b1[_0x45bcad(0x211)]}));if(_0x32a8b1[_0x45bcad(0x1fa)]===!0x0)u(_0x118d87,_0x2d88c9);else{let _0x40692c=_0x118d87['configureOutput']();for(let _0x455a7c of _0x2d88c9[_0x45bcad(0x20f)])_0x40692c['writeOut']?.(_0x455a7c[_0x45bcad(0x1ce)]+'\x0a');for(let _0x5e69d6 of _0x2d88c9[_0x45bcad(0x1d0)])_0x40692c['writeErr']?.(_0x5e69d6[_0x45bcad(0x1da)]+':\x20'+_0x5e69d6[_0x45bcad(0x208)]+':\x20'+_0x5e69d6[_0x45bcad(0x1c5)]+'\x0a');}_0x2d88c9[_0x45bcad(0x1d0)][_0x45bcad(0x1e0)]>0x0&&_0x118d87[_0x45bcad(0x216)](_0x2d88c9['failed']['length']+_0x45bcad(0x1c2)+(_0x2d88c9[_0x45bcad(0x1d0)][_0x45bcad(0x1e0)]===0x1?'':'s')+_0x45bcad(0x209),{'code':'resources.export.failed','exitCode':0x1});});let _0x5ccc48=_0x118d87[_0x21d141(0x1d9)](_0x21d141(0x218))[_0x21d141(0x1f5)](_0x21d141(0x1f9));return _0x5ccc48[_0x21d141(0x214)](()=>_0x5ccc48[_0x21d141(0x1d6)]()),_0x5ccc48[_0x21d141(0x1d9)](_0x21d141(0x1ce))['description'](_0x21d141(0x1ec))[_0x21d141(0x202)](_0x21d141(0x1e3),_0x21d141(0x1d2))[_0x21d141(0x214)](_0x762270=>{const _0x43b5ce=_0x21d141;let _0x56118e=_0x522681[_0x43b5ce(0x1c9)]()[_0x43b5ce(0x1bf)];l(_0x118d87,_0x762270,{'path':_0x56118e},_0x56118e);}),_0x5ccc48[_0x21d141(0x1d9)](_0x21d141(0x1d8))['description']('Clear\x20all\x20cached\x20resources')[_0x21d141(0x202)](_0x21d141(0x1e3),'write\x20structured\x20JSON')[_0x21d141(0x214)](async _0x52d895=>{const _0x300fec=_0x21d141;let _0xaee360=await c(_0x118d87,async()=>_0x522681[_0x300fec(0x1c9)]()[_0x300fec(0x1e8)]());l(_0x118d87,_0x52d895,{'cleared':_0xaee360},_0x300fec(0x1db)+_0xaee360[_0x300fec(0x205)]+'\x20resources\x20('+p(_0xaee360[_0x300fec(0x1e5)])+')\x20from\x20'+_0xaee360[_0x300fec(0x1ce)]+'.');}),_0x118d87;}function o(_0x5d2500,_0x32e223){return[..._0x32e223,_0x5d2500];}function s(_0x497eac){const _0x28c2d1=_0x3e27;let _0xc27b76=Number(_0x497eac);if(!Number[_0x28c2d1(0x20a)](_0xc27b76)||_0xc27b76<0x1)throw new _0x5b87d0('Expected\x20a\x20positive\x20integer;\x20received\x20\x22'+_0x497eac+'\x22.');return _0xc27b76;}async function c(_0x3e5ee1,_0x36cb5f){const _0x252b4a=_0x3e27;try{return await _0x36cb5f();}catch(_0x4f7954){throw _0x3deb28(_0x4f7954)&&_0x3e5ee1[_0x252b4a(0x216)](_0x4f7954[_0x252b4a(0x208)]+':\x20'+_0x4f7954[_0x252b4a(0x1c5)],{'code':_0x252b4a(0x1f0),'exitCode':0x1}),_0x4f7954;}}function _0x3e27(_0x1c8444,_0x47120f){_0x1c8444=_0x1c8444-0x1bf;const _0x4e7439=_0x4e74();let _0x3e274c=_0x4e7439[_0x1c8444];return _0x3e274c;}function l(_0x57d276,_0x2c851a,_0xc6e3e,_0x73a7a6){const _0x185cc9=_0x3e27;_0x2c851a[_0x185cc9(0x1fa)]===!0x0?u(_0x57d276,_0xc6e3e):_0x57d276[_0x185cc9(0x219)]()[_0x185cc9(0x1f7)]?.(_0x73a7a6+'\x0a');}function u(_0x3d1df8,_0x1f5df2){const _0x3f23db=_0x3e27;_0x3d1df8[_0x3f23db(0x219)]()['writeOut']?.(JSON[_0x3f23db(0x1ea)](_0x1f5df2,null,0x2)+'\x0a');}function d(_0x2e14b8){const _0x2e798d=_0x3e27;return['REGISTRY'[_0x2e798d(0x1d1)](0x22)+'\x20\x20'+_0x2e798d(0x1e7)[_0x2e798d(0x1c4)](0x9)+'\x20\x20'+_0x2e798d(0x1fd)['padStart'](0x7)+'\x20\x20'+_0x2e798d(0x1c8)[_0x2e798d(0x1c4)](0x6)+'\x20\x20'+_0x2e798d(0x1cf)[_0x2e798d(0x1c4)](0xa),..._0x2e14b8['map'](_0x4d2488=>[_0x4d2488['id'][_0x2e798d(0x1d1)](0x22),String(_0x4d2488[_0x2e798d(0x205)])[_0x2e798d(0x1c4)](0x9),String(_0x4d2488['groupCount'])[_0x2e798d(0x1c4)](0x7),String(_0x4d2488[_0x2e798d(0x1df)])['padStart'](0x6),(_0x4d2488[_0x2e798d(0x1d5)]+'/'+_0x4d2488['resourceCount'])['padStart'](0xa)][_0x2e798d(0x213)]('\x20\x20'))][_0x2e798d(0x213)]('\x0a');}function f(_0x336d6a,_0x15406e){const _0x409a52=_0x3e27;if(_0x336d6a[_0x409a52(0x1e0)]===0x0)return _0x409a52(0x207);let _0x111b45=[_0x409a52(0x1fe)['padEnd'](0x32)+'\x20\x20'+_0x409a52(0x1f1)['padEnd'](0x1c)+'\x20\x20'+_0x409a52(0x20e)[_0x409a52(0x1d1)](0x12)+'\x20\x20'+_0x409a52(0x1dd)[_0x409a52(0x1d1)](0x8)+_0x409a52(0x1e9),..._0x336d6a[_0x409a52(0x1e6)](_0x272ede=>{const _0x39a2a4=_0x409a52;let _0x1088cf=_0x272ede['group']?.[_0x39a2a4(0x1dc)]??'-',_0x1bf7cc=_0x272ede['colorEditable']?_0x39a2a4(0x201):_0x39a2a4(0x1f4),_0x1358be=_0x272ede[_0x39a2a4(0x1c1)]['width']+'×'+_0x272ede[_0x39a2a4(0x1c1)][_0x39a2a4(0x200)];return _0x272ede['handle'][_0x39a2a4(0x1d1)](0x32)+'\x20\x20'+_0x272ede['name'][_0x39a2a4(0x1d1)](0x1c)+'\x20\x20'+_0x1088cf[_0x39a2a4(0x1d1)](0x12)+'\x20\x20'+_0x1bf7cc['padEnd'](0x8)+'\x20\x20'+_0x1358be;})];return _0x15406e>_0x336d6a['length']&&_0x111b45['push']('…\x20'+(_0x15406e-_0x336d6a[_0x409a52(0x1e0)])+_0x409a52(0x20c)),_0x111b45[_0x409a52(0x213)]('\x0a');}function p(_0x170882){const _0x240b4c=_0x3e27;return _0x170882<0x400?_0x170882+'\x20B':_0x170882<0x100000?(_0x170882/0x400)[_0x240b4c(0x1f8)](0x1)+'\x20KB':(_0x170882/0x100000)[_0x240b4c(0x1f8)](0x1)+_0x240b4c(0x1ed);}function _0x4e74(){const _0x37495c=['padStart','message','addOption','resources','TAGS','openLibrary','read','Read\x20one\x20SVG\x20or\x20export\x20resources\x20to\x20a\x20directory','listRegistries','maximum\x20number\x20of\x20results','path','EDITABLE','failed','padEnd','write\x20structured\x20JSON','argument','8wECgmN','colorEditableCount','outputHelp','canonical\x20<registryId>/<resourceId>\x20handles','clear','command','handle','Cleared\x20','label','COLOR','Find\x20resources\x20by\x20name,\x20description,\x20group,\x20tag,\x20or\x20keyword','tagCount','length','default','export','--json','Exporting\x20more\x20than\x20one\x20resource\x20requires\x20--out\x20<directory>.','byteCount','map','RESOURCES','clearCache','\x20\x20SIZE','stringify','<handles...>','Show\x20the\x20resource\x20cache\x20path','\x20MB','16270uOUvPE','<queries...>','resources.failed','NAME','7136487TeHbUK','335oyYzrP','fixed','description','4422LFLNda','writeOut','toFixed','Inspect\x20or\x20clear\x20the\x20resource\x20cache','json','total','restrict\x20results\x20to\x20a\x20registry;\x20repeatable','GROUPS','HANDLE','2574573fvBsUO','height','editable','option','54390oUMOdF','find','resourceCount','2moGbIP','No\x20resources\x20matched;\x20try\x20a\x20shorter\x20substring,\x20a\x20synonym,\x20or\x20another\x20registry.','code','\x20could\x20not\x20be\x20exported.','isInteger','one\x20or\x20more\x20queries,\x20searched\x20independently','\x20more;\x20raise\x20--limit\x20or\x20narrow\x20the\x20query.','333545erKOil','GROUP','exported','1845291WWDcQL','out','--limit\x20<number>','join','action','argParser','error','List\x20available\x20resource\x20registries','cache','configureOutput','registry','registries','cacheLocation','2266308gJavkc','intrinsicSize','\x20resource','--registry\x20<id>'];_0x4e74=function(){return _0x37495c;};return _0x4e74();}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.1",
|
|
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.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"commander": "^15.0.0"
|