@univer-cli/resource-library-command 1.1.0 → 1.2.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.
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x217002,_0x34823d){const _0x41b068=_0x12d5,_0x44f699=_0x217002();while(!![]){try{const _0x4c1ec6=parseInt(_0x41b068(0x1b9))/0x1*(parseInt(_0x41b068(0x1c2))/0x2)+parseInt(_0x41b068(0x1ca))/0x3*(parseInt(_0x41b068(0x19b))/0x4)+-parseInt(_0x41b068(0x1a5))/0x5*(-parseInt(_0x41b068(0x1a8))/0x6)+parseInt(_0x41b068(0x1d0))/0x7+parseInt(_0x41b068(0x1df))/0x8+-parseInt(_0x41b068(0x1dc))/0x9+-parseInt(_0x41b068(0x193))/0xa;if(_0x4c1ec6===_0x34823d)break;else _0x44f699['push'](_0x44f699['shift']());}catch(_0x5278ba){_0x44f699['push'](_0x44f699['shift']());}}}(_0x59d8,0xef986));import{isResourceLibraryError as _0x157b2a}from'@univer-cli/resource-library';function _0x59d8(){const _0x559c72=['push','\x20could\x20not\x20be\x20exported.','exported','resources','code','addOption','command','error','path','outputHelp','join','EDITABLE','Read\x20one\x20SVG\x20or\x20export\x20resources\x20to\x20a\x20directory','\x20KB','export','17413400aBsfMe','writeErr','failed','resources.export.failed','writeOut','find','resources.invalid-input','listRegistries','68492fKYfmE','padStart','action','configureOutput','groupCount','--json','\x20\x20SIZE','\x20resources\x20(','default','NAME','27255xyKWCW','\x20more;\x20raise\x20--limit\x20or\x20narrow\x20the\x20query.','fixed','78EFuGCO','GROUP','Show\x20the\x20resource\x20cache\x20path','\x20resource','COLOR','handle','Find\x20resources\x20by\x20name,\x20description,\x20group,\x20tag,\x20or\x20keyword','Clear\x20all\x20cached\x20resources','editable','No\x20resources\x20matched;\x20try\x20a\x20shorter\x20substring,\x20a\x20synonym,\x20or\x20another\x20registry.','byteCount','write\x20structured\x20JSON','RESOURCES','toFixed','description','\x20MB','canonical\x20<registryId>/<resourceId>\x20handles','167WnuksZ','<handles...>','Expected\x20a\x20positive\x20integer;\x20received\x20\x22','tagCount','Cleared\x20','read','padEnd','List\x20available\x20resource\x20registries','argument','16790cJVnaB','registries','limit','isInteger','Find\x20and\x20export\x20SVG\x20resources\x20from\x20a\x20multi-registry\x20catalog','cache','option','resources.failed','30EJbaHy','--limit\x20<number>','intrinsicSize','colorEditable','maximum\x20number\x20of\x20results','openLibrary','11491753RSCMQX','resourceCount','clearCache','write\x20flat\x20<registry>--<resource>.svg\x20files','colorEditableCount','Exporting\x20more\x20than\x20one\x20resource\x20requires\x20--out\x20<directory>.','svg','REGISTRY','--registry\x20<id>','registry','json','length','12475917DzxHOd','out','--out\x20<directory>','6585584BQwppY','height'];_0x59d8=function(){return _0x559c72;};return _0x59d8();}import{Command as _0x2ce1c3,InvalidArgumentError as _0x925f88,Option as _0x34e3e5}from'commander';var i=0x1e;function a(_0x47bc74){const _0x3a150d=_0x12d5;let _0x4db446=new _0x2ce1c3(_0x3a150d(0x187))[_0x3a150d(0x1b6)](_0x3a150d(0x1c6))['action'](()=>_0x4db446['outputHelp']());_0x4db446[_0x3a150d(0x18a)](_0x3a150d(0x1c3))['description'](_0x3a150d(0x1c0))[_0x3a150d(0x1c8)](_0x3a150d(0x1a0),_0x3a150d(0x1b3))[_0x3a150d(0x19d)](async _0x4fcc1a=>{const _0x276530=_0x3a150d;let _0x2e2001=await c(_0x4db446,async()=>_0x47bc74[_0x276530(0x1cf)]()[_0x276530(0x19a)]());l(_0x4db446,_0x4fcc1a,{'registries':_0x2e2001},d(_0x2e2001));}),_0x4db446['command'](_0x3a150d(0x198))[_0x3a150d(0x1b6)](_0x3a150d(0x1ae))[_0x3a150d(0x1c1)]('<queries...>','one\x20or\x20more\x20queries,\x20searched\x20independently')[_0x3a150d(0x189)](new _0x34e3e5(_0x3a150d(0x1d8),'restrict\x20results\x20to\x20a\x20registry;\x20repeatable')['argParser'](o)['default']([]))['addOption'](new _0x34e3e5(_0x3a150d(0x1cb),_0x3a150d(0x1ce))['argParser'](s)[_0x3a150d(0x1a3)](i))[_0x3a150d(0x1c8)]('--json',_0x3a150d(0x1b3))[_0x3a150d(0x19d)](async(_0xc83f32,_0x3d20f6)=>{const _0x4490a4=_0x3a150d;let _0x140ce3=await c(_0x4db446,async()=>_0x47bc74[_0x4490a4(0x1cf)]()['find']({'queries':_0xc83f32,'registries':_0x3d20f6['registry'],'limit':_0x3d20f6[_0x4490a4(0x1c4)]}));l(_0x4db446,_0x3d20f6,{'query':{'queries':_0xc83f32,'registries':_0x3d20f6[_0x4490a4(0x1d9)]},'resources':_0x140ce3[_0x4490a4(0x187)],'total':_0x140ce3['total'],'limit':_0x3d20f6[_0x4490a4(0x1c4)]},f(_0x140ce3[_0x4490a4(0x187)],_0x140ce3['total']));}),_0x4db446['command'](_0x3a150d(0x192))[_0x3a150d(0x1b6)](_0x3a150d(0x190))['argument'](_0x3a150d(0x1ba),_0x3a150d(0x1b8))[_0x3a150d(0x1c8)](_0x3a150d(0x1de),_0x3a150d(0x1d3))[_0x3a150d(0x1c8)](_0x3a150d(0x1a0),_0x3a150d(0x1b3))['action'](async(_0xe1dff3,_0x15b484)=>{const _0x4e9d5a=_0x3a150d;if(_0x15b484[_0x4e9d5a(0x1dd)]===void 0x0){_0xe1dff3[_0x4e9d5a(0x1db)]!==0x1&&_0x4db446[_0x4e9d5a(0x18b)](_0x4e9d5a(0x1d5),{'code':_0x4e9d5a(0x199),'exitCode':0x1});let _0x1777cb=await c(_0x4db446,async()=>_0x47bc74[_0x4e9d5a(0x1cf)]()[_0x4e9d5a(0x1be)]({'handle':_0xe1dff3[0x0]}));_0x15b484[_0x4e9d5a(0x1da)]===!0x0?u(_0x4db446,_0x1777cb):_0x4db446['configureOutput']()[_0x4e9d5a(0x197)]?.(_0x1777cb[_0x4e9d5a(0x1d6)]);return;}let _0x5b8e2e=await c(_0x4db446,async()=>_0x47bc74['openLibrary']()['export']({'handles':_0xe1dff3,'destination':_0x15b484['out']}));if(_0x15b484[_0x4e9d5a(0x1da)]===!0x0)u(_0x4db446,_0x5b8e2e);else{let _0xb70050=_0x4db446['configureOutput']();for(let _0x4137a7 of _0x5b8e2e[_0x4e9d5a(0x1e3)])_0xb70050[_0x4e9d5a(0x197)]?.(_0x4137a7['path']+'\x0a');for(let _0x4034c7 of _0x5b8e2e['failed'])_0xb70050[_0x4e9d5a(0x194)]?.(_0x4034c7['handle']+':\x20'+_0x4034c7['code']+':\x20'+_0x4034c7['message']+'\x0a');}_0x5b8e2e[_0x4e9d5a(0x195)][_0x4e9d5a(0x1db)]>0x0&&_0x4db446[_0x4e9d5a(0x18b)](_0x5b8e2e['failed'][_0x4e9d5a(0x1db)]+_0x4e9d5a(0x1ab)+(_0x5b8e2e[_0x4e9d5a(0x195)][_0x4e9d5a(0x1db)]===0x1?'':'s')+_0x4e9d5a(0x1e2),{'code':_0x4e9d5a(0x196),'exitCode':0x1});});let _0x1c4f0b=_0x4db446[_0x3a150d(0x18a)](_0x3a150d(0x1c7))[_0x3a150d(0x1b6)]('Inspect\x20or\x20clear\x20the\x20resource\x20cache');return _0x1c4f0b[_0x3a150d(0x19d)](()=>_0x1c4f0b[_0x3a150d(0x18d)]()),_0x1c4f0b['command'](_0x3a150d(0x18c))['description'](_0x3a150d(0x1aa))[_0x3a150d(0x1c8)](_0x3a150d(0x1a0),'write\x20structured\x20JSON')[_0x3a150d(0x19d)](_0x2baa8f=>{let _0x3b169f=_0x47bc74['openLibrary']()['cacheLocation'];l(_0x4db446,_0x2baa8f,{'path':_0x3b169f},_0x3b169f);}),_0x1c4f0b[_0x3a150d(0x18a)]('clear')[_0x3a150d(0x1b6)](_0x3a150d(0x1af))[_0x3a150d(0x1c8)](_0x3a150d(0x1a0),'write\x20structured\x20JSON')[_0x3a150d(0x19d)](async _0x3e94e3=>{const _0x547933=_0x3a150d;let _0x2fdf35=await c(_0x4db446,async()=>_0x47bc74[_0x547933(0x1cf)]()[_0x547933(0x1d2)]());l(_0x4db446,_0x3e94e3,{'cleared':_0x2fdf35},_0x547933(0x1bd)+_0x2fdf35[_0x547933(0x1d1)]+_0x547933(0x1a2)+p(_0x2fdf35[_0x547933(0x1b2)])+')\x20from\x20'+_0x2fdf35['path']+'.');}),_0x4db446;}function o(_0x160cf0,_0x123d6a){return[..._0x123d6a,_0x160cf0];}function s(_0x3e4aee){const _0x108b73=_0x12d5;let _0x501086=Number(_0x3e4aee);if(!Number[_0x108b73(0x1c5)](_0x501086)||_0x501086<0x1)throw new _0x925f88(_0x108b73(0x1bb)+_0x3e4aee+'\x22.');return _0x501086;}async function c(_0x5da1c2,_0x3dbc86){const _0x3c7894=_0x12d5;try{return await _0x3dbc86();}catch(_0xeebe81){throw _0x157b2a(_0xeebe81)&&_0x5da1c2[_0x3c7894(0x18b)](_0xeebe81[_0x3c7894(0x188)]+':\x20'+_0xeebe81['message'],{'code':_0x3c7894(0x1c9),'exitCode':0x1}),_0xeebe81;}}function l(_0x34e9be,_0x4e4f5f,_0x1beb06,_0x57ec62){const _0x381511=_0x12d5;_0x4e4f5f['json']===!0x0?u(_0x34e9be,_0x1beb06):_0x34e9be['configureOutput']()[_0x381511(0x197)]?.(_0x57ec62+'\x0a');}function u(_0x18cc51,_0x491312){const _0x51045a=_0x12d5;_0x18cc51[_0x51045a(0x19e)]()[_0x51045a(0x197)]?.(JSON['stringify'](_0x491312,null,0x2)+'\x0a');}function d(_0x1c183e){const _0x8afca4=_0x12d5;return[_0x8afca4(0x1d7)['padEnd'](0x22)+'\x20\x20'+_0x8afca4(0x1b4)[_0x8afca4(0x19c)](0x9)+'\x20\x20'+'GROUPS'['padStart'](0x7)+'\x20\x20'+'TAGS'[_0x8afca4(0x19c)](0x6)+'\x20\x20'+_0x8afca4(0x18f)[_0x8afca4(0x19c)](0xa),..._0x1c183e['map'](_0x48efd7=>[_0x48efd7['id']['padEnd'](0x22),String(_0x48efd7['resourceCount'])[_0x8afca4(0x19c)](0x9),String(_0x48efd7[_0x8afca4(0x19f)])['padStart'](0x7),String(_0x48efd7[_0x8afca4(0x1bc)])[_0x8afca4(0x19c)](0x6),(_0x48efd7[_0x8afca4(0x1d4)]+'/'+_0x48efd7[_0x8afca4(0x1d1)])[_0x8afca4(0x19c)](0xa)]['join']('\x20\x20'))][_0x8afca4(0x18e)]('\x0a');}function _0x12d5(_0xe16dba,_0x10a121){_0xe16dba=_0xe16dba-0x187;const _0x59d857=_0x59d8();let _0x12d558=_0x59d857[_0xe16dba];return _0x12d558;}function f(_0x4ce2f1,_0x1c9cf0){const _0x43a5ac=_0x12d5;if(_0x4ce2f1[_0x43a5ac(0x1db)]===0x0)return _0x43a5ac(0x1b1);let _0x788d43=['HANDLE'['padEnd'](0x32)+'\x20\x20'+_0x43a5ac(0x1a4)['padEnd'](0x1c)+'\x20\x20'+_0x43a5ac(0x1a9)['padEnd'](0x12)+'\x20\x20'+_0x43a5ac(0x1ac)[_0x43a5ac(0x1bf)](0x8)+_0x43a5ac(0x1a1),..._0x4ce2f1['map'](_0x424712=>{const _0x561a49=_0x43a5ac;let _0x24b334=_0x424712['group']?.['label']??'-',_0x363b9e=_0x424712[_0x561a49(0x1cd)]?_0x561a49(0x1b0):_0x561a49(0x1a7),_0x124b83=_0x424712[_0x561a49(0x1cc)]['width']+'×'+_0x424712[_0x561a49(0x1cc)][_0x561a49(0x1e0)];return _0x424712[_0x561a49(0x1ad)][_0x561a49(0x1bf)](0x32)+'\x20\x20'+_0x424712['name'][_0x561a49(0x1bf)](0x1c)+'\x20\x20'+_0x24b334[_0x561a49(0x1bf)](0x12)+'\x20\x20'+_0x363b9e[_0x561a49(0x1bf)](0x8)+'\x20\x20'+_0x124b83;})];return _0x1c9cf0>_0x4ce2f1['length']&&_0x788d43[_0x43a5ac(0x1e1)]('…\x20'+(_0x1c9cf0-_0x4ce2f1[_0x43a5ac(0x1db)])+_0x43a5ac(0x1a6)),_0x788d43['join']('\x0a');}function p(_0x1010e8){const _0x50a9ce=_0x12d5;return _0x1010e8<0x400?_0x1010e8+'\x20B':_0x1010e8<0x100000?(_0x1010e8/0x400)[_0x50a9ce(0x1b5)](0x1)+_0x50a9ce(0x191):(_0x1010e8/0x100000)[_0x50a9ce(0x1b5)](0x1)+_0x50a9ce(0x1b7);}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.
|
|
4
|
+
"version": "1.2.0",
|
|
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.
|
|
21
|
+
"@univer-cli/resource-library": "1.2.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"commander": "^15.0.0"
|