@web-to-figma/desktop 1.0.1 → 1.0.3

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.
@@ -1 +1 @@
1
- (function(_0x13f8e5,_0x9c39ec){const _0x5ae443=_0x5f22,_0x4f959a=_0x13f8e5();while(!![]){try{const _0x56c7d1=parseInt(_0x5ae443(0x185))/0x1+parseInt(_0x5ae443(0x182))/0x2*(-parseInt(_0x5ae443(0x177))/0x3)+-parseInt(_0x5ae443(0x186))/0x4+-parseInt(_0x5ae443(0x16d))/0x5+parseInt(_0x5ae443(0x180))/0x6*(-parseInt(_0x5ae443(0x178))/0x7)+-parseInt(_0x5ae443(0x187))/0x8*(-parseInt(_0x5ae443(0x162))/0x9)+parseInt(_0x5ae443(0x174))/0xa*(parseInt(_0x5ae443(0x167))/0xb);if(_0x56c7d1===_0x9c39ec)break;else _0x4f959a['push'](_0x4f959a['shift']());}catch(_0x191412){_0x4f959a['push'](_0x4f959a['shift']());}}}(_0x1eeb,0xdd4fb));import _0x3ea14b from'crypto';import _0x1190e3 from'fs';import _0xe27de4 from'path';function _0x5f22(_0x11728,_0x237e97){_0x11728=_0x11728-0x161;const _0x1eeb67=_0x1eeb();let _0x5f221d=_0x1eeb67[_0x11728];if(_0x5f22['LwmaVm']===undefined){var _0x24528b=function(_0x14511c){const _0x241362='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ea14b='',_0x1190e3='';for(let _0xe27de4=0x0,_0x319425,_0x5c4d81,_0x13a48c=0x0;_0x5c4d81=_0x14511c['charAt'](_0x13a48c++);~_0x5c4d81&&(_0x319425=_0xe27de4%0x4?_0x319425*0x40+_0x5c4d81:_0x5c4d81,_0xe27de4++%0x4)?_0x3ea14b+=String['fromCharCode'](0xff&_0x319425>>(-0x2*_0xe27de4&0x6)):0x0){_0x5c4d81=_0x241362['indexOf'](_0x5c4d81);}for(let _0x8b1595=0x0,_0x12ed96=_0x3ea14b['length'];_0x8b1595<_0x12ed96;_0x8b1595++){_0x1190e3+='%'+('00'+_0x3ea14b['charCodeAt'](_0x8b1595)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1190e3);};_0x5f22['rScfnv']=_0x24528b,_0x5f22['KqFnHX']={},_0x5f22['LwmaVm']=!![];}const _0x4c9832=_0x1eeb67[0x0],_0xb5affb=_0x11728+_0x4c9832,_0x8e8cc7=_0x5f22['KqFnHX'][_0xb5affb];return!_0x8e8cc7?(_0x5f221d=_0x5f22['rScfnv'](_0x5f221d),_0x5f22['KqFnHX'][_0xb5affb]=_0x5f221d):_0x5f221d=_0x8e8cc7,_0x5f221d;}import{parseJsonSafe}from'../utils.js';function asChromiumDriver(_0x319425){return _0x319425;}export function cleanupOrphanSessionDirs(_0x5c4d81){const _0x3c35dc=_0x5f22;if(!_0x1190e3[_0x3c35dc(0x166)](_0x5c4d81))return;for(const _0x13a48c of _0x1190e3['readdirSync'](_0x5c4d81,{'withFileTypes':!![]})){if(!_0x13a48c['isDirectory']())continue;removeSessionDir(_0xe27de4[_0x3c35dc(0x171)](_0x5c4d81,_0x13a48c[_0x3c35dc(0x16f)]));}}export function createHeadedSessionDir(_0x8b1595){const _0x5d3a4b=_0x5f22;_0x1190e3[_0x5d3a4b(0x161)](_0x8b1595,{'recursive':!![]});const _0x12ed96=_0xe27de4[_0x5d3a4b(0x171)](_0x8b1595,_0x3ea14b[_0x5d3a4b(0x165)]());return _0x1190e3[_0x5d3a4b(0x161)](_0xe27de4[_0x5d3a4b(0x171)](_0x12ed96,_0x5d3a4b(0x16b)),{'recursive':!![]}),_0x12ed96;}export function seedPinnedExtensionPreferences(_0x3a9d94,_0x54e4c3){const _0x5f46aa=_0x5f22,_0x4272fb=_0xe27de4[_0x5f46aa(0x171)](_0x3a9d94,_0x5f46aa(0x16b),_0x5f46aa(0x163)),_0x555869=parseJsonSafe(_0x1190e3[_0x5f46aa(0x166)](_0x4272fb)?_0x1190e3[_0x5f46aa(0x179)](_0x4272fb,'utf8'):null,{}),_0xc1c43a=parseJsonSafe(typeof _0x555869[_0x5f46aa(0x181)]===_0x5f46aa(0x183)&&_0x555869[_0x5f46aa(0x181)]!==null?JSON[_0x5f46aa(0x173)](_0x555869['extensions']):null,{});_0xc1c43a['pinned_extensions']=[_0x54e4c3],_0x555869[_0x5f46aa(0x181)]=_0xc1c43a,_0x1190e3[_0x5f46aa(0x17a)](_0x4272fb,JSON[_0x5f46aa(0x173)](_0x555869));}export function createInitialPreferencesFile(_0x9f1e19,_0x331088){const _0x49b550=_0x5f22,_0x31f8e3=_0xe27de4[_0x49b550(0x171)](_0x9f1e19,'initial_preferences.json'),_0x26a417={'extensions':{'pinned_extensions':[_0x331088]},'distribution':{'skip_first_run_ui':!![],'show_welcome_page':![]}};return _0x1190e3['writeFileSync'](_0x31f8e3,JSON['stringify'](_0x26a417)),_0x31f8e3;}function _0x1eeb(){const _0x550f41=['nJa2nZKWuuzjz3HJ','tMv0D29YAY5LBMfIBgu','Cgf0Aa','nJGYnty5swHsy1fu','mZvsqwzzuLi','CMvHzezPBgvtEw5J','D3jPDgvgAwXLu3LUyW','C2fTzvnPDgu','zg9TywLU','C2vUzefUzeDLDerLDLrVB2XZq29TBwfUza','CM1tEw5J','y29VA2LLCW','mZq3ngfcB1jntq','zxH0zw5ZAw9UCW','mMHgrgT3Bq','B2jQzwn0','ChjPB3jPDhK','mty2mZm2mur2q1LAAq','mZK3nJe2mefVvwTyvq','mte1ndG1nKfwsLLLBG','C2vUzerLDLrVB2XZq29TBwfUza','zxHWAxjLCW','BwTKAxjtEw5J','mJDpExjvt2O','uhjLzMvYzw5Jzxm','DMfSDwu','CMfUzg9Tvvvjra','zxHPC3rZu3LUyW','mJC1B0Toqvf5','BgvUz3rO','DxrMoa','C2vJDxjL','rgvMyxvSDa','yM9VBgvHBG','nZqXmJi5mgT5ugnmvq','AxnbCNjHEq','BMfTzq','Ahr0Ce9UBhK','AM9PBG','BwfW','C3rYAw5NAwz5'];_0x1eeb=function(){return _0x550f41;};return _0x1eeb();}export function removeSessionDir(_0x198fec){const _0x1a37c4=_0x5f22;try{_0x1190e3[_0x1a37c4(0x17e)](_0x198fec,{'recursive':!![],'force':!![]});}catch{}}function readPersistedCookies(_0x328e59){const _0x561a23=_0x5f22;if(!_0x1190e3[_0x561a23(0x166)](_0x328e59))return[];const _0xb73bdf=parseJsonSafe(_0x1190e3['readFileSync'](_0x328e59,_0x561a23(0x169)),[]);return Array[_0x561a23(0x16e)](_0xb73bdf)?_0xb73bdf:[];}function writePersistedCookies(_0x3e964a,_0x284262){const _0x57fd58=_0x5f22;_0x1190e3[_0x57fd58(0x161)](_0xe27de4['dirname'](_0x3e964a),{'recursive':!![]}),_0x1190e3['writeFileSync'](_0x3e964a,JSON[_0x57fd58(0x173)](_0x284262,null,0x2)+'\x0a');}function toSetCookieParam(_0x23100b){const _0x5691f9=_0x5f22,_0xa6828a={'name':_0x23100b['name'],'value':_0x23100b[_0x5691f9(0x164)],'domain':_0x23100b[_0x5691f9(0x17c)],'path':_0x23100b[_0x5691f9(0x176)]||'/'};return typeof _0x23100b['expires']==='number'&&_0x23100b[_0x5691f9(0x189)]>0x0&&(_0xa6828a[_0x5691f9(0x189)]=_0x23100b['expires']),typeof _0x23100b['httpOnly']===_0x5691f9(0x16c)&&(_0xa6828a['httpOnly']=_0x23100b[_0x5691f9(0x170)]),typeof _0x23100b[_0x5691f9(0x16a)]===_0x5691f9(0x16c)&&(_0xa6828a['secure']=_0x23100b[_0x5691f9(0x16a)]),_0x23100b[_0x5691f9(0x17b)]&&(_0xa6828a[_0x5691f9(0x17b)]=_0x23100b[_0x5691f9(0x17b)]),_0x23100b[_0x5691f9(0x184)]&&(_0xa6828a['priority']=_0x23100b[_0x5691f9(0x184)]),_0xa6828a;}export async function importPersistedCookies(_0x26753b,_0x246577){const _0xa31b39=_0x5f22,_0x23c7f5=readPersistedCookies(_0x246577);if(_0x23c7f5[_0xa31b39(0x168)]===0x0)return;const _0x4bd195=asChromiumDriver(_0x26753b);await _0x4bd195['sendDevToolsCommand'](_0xa31b39(0x175),{}),await _0x4bd195[_0xa31b39(0x188)]('Network.setCookies',{'cookies':_0x23c7f5[_0xa31b39(0x172)](toSetCookieParam)});}export async function exportPersistedCookies(_0x45c53c,_0x856761){const _0x568cba=_0x5f22,_0x4a685c=asChromiumDriver(_0x45c53c);await _0x4a685c[_0x568cba(0x188)](_0x568cba(0x175),{});const _0x305f41=await _0x4a685c[_0x568cba(0x17d)]('Network.getAllCookies',{}),_0x728249=Array[_0x568cba(0x16e)](_0x305f41[_0x568cba(0x17f)])?_0x305f41[_0x568cba(0x17f)]:[];writePersistedCookies(_0x856761,_0x728249);}export function resetHeadedBrowserState(_0x2d787e,_0x3d0eb3){const _0x239fbf=_0x5f22;cleanupOrphanSessionDirs(_0x3d0eb3),_0x1190e3[_0x239fbf(0x166)](_0x2d787e)&&_0x1190e3['rmSync'](_0x2d787e,{'recursive':!![],'force':!![]});}
1
+ function _0x1724(_0x11e508,_0x542f50){_0x11e508=_0x11e508-0x19b;const _0x3dbc58=_0x3dbc();let _0x1724f7=_0x3dbc58[_0x11e508];if(_0x1724['VWIkDe']===undefined){var _0x3deeb4=function(_0x3ee671){const _0x327b4a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x190151='',_0x5391a0='';for(let _0x3d0d25=0x0,_0x3bfb8e,_0x3baac7,_0x55da38=0x0;_0x3baac7=_0x3ee671['charAt'](_0x55da38++);~_0x3baac7&&(_0x3bfb8e=_0x3d0d25%0x4?_0x3bfb8e*0x40+_0x3baac7:_0x3baac7,_0x3d0d25++%0x4)?_0x190151+=String['fromCharCode'](0xff&_0x3bfb8e>>(-0x2*_0x3d0d25&0x6)):0x0){_0x3baac7=_0x327b4a['indexOf'](_0x3baac7);}for(let _0xf20610=0x0,_0xf2f787=_0x190151['length'];_0xf20610<_0xf2f787;_0xf20610++){_0x5391a0+='%'+('00'+_0x190151['charCodeAt'](_0xf20610)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5391a0);};_0x1724['joUgxm']=_0x3deeb4,_0x1724['kAUGzS']={},_0x1724['VWIkDe']=!![];}const _0x523f68=_0x3dbc58[0x0],_0x5f38f1=_0x11e508+_0x523f68,_0x394eca=_0x1724['kAUGzS'][_0x5f38f1];return!_0x394eca?(_0x1724f7=_0x1724['joUgxm'](_0x1724f7),_0x1724['kAUGzS'][_0x5f38f1]=_0x1724f7):_0x1724f7=_0x394eca,_0x1724f7;}(function(_0x382e19,_0x4cc11d){const _0x17a6c1=_0x1724,_0x26251c=_0x382e19();while(!![]){try{const _0x45d085=-parseInt(_0x17a6c1(0x1c4))/0x1+-parseInt(_0x17a6c1(0x1af))/0x2+parseInt(_0x17a6c1(0x1b2))/0x3*(parseInt(_0x17a6c1(0x1ab))/0x4)+parseInt(_0x17a6c1(0x1b6))/0x5+-parseInt(_0x17a6c1(0x1a9))/0x6+-parseInt(_0x17a6c1(0x1bf))/0x7*(parseInt(_0x17a6c1(0x1b7))/0x8)+parseInt(_0x17a6c1(0x1be))/0x9*(parseInt(_0x17a6c1(0x1bd))/0xa);if(_0x45d085===_0x4cc11d)break;else _0x26251c['push'](_0x26251c['shift']());}catch(_0x5c6451){_0x26251c['push'](_0x26251c['shift']());}}}(_0x3dbc,0x373d4));import _0x190151 from'crypto';import _0x5391a0 from'fs';import _0x3d0d25 from'path';import{parseJsonSafe}from'../utils.js';function asChromiumDriver(_0x3bfb8e){return _0x3bfb8e;}export function cleanupOrphanSessionDirs(_0x3baac7){const _0x1586ef=_0x1724;if(!_0x5391a0['existsSync'](_0x3baac7))return;for(const _0x55da38 of _0x5391a0[_0x1586ef(0x1c3)](_0x3baac7,{'withFileTypes':!![]})){if(!_0x55da38['isDirectory']())continue;removeSessionDir(_0x3d0d25[_0x1586ef(0x1c5)](_0x3baac7,_0x55da38[_0x1586ef(0x1a8)]));}}export function createHeadedSessionDir(_0xf20610){const _0x40e000=_0x1724;_0x5391a0[_0x40e000(0x19c)](_0xf20610,{'recursive':!![]});const _0xf2f787=_0x3d0d25[_0x40e000(0x1c5)](_0xf20610,_0x190151[_0x40e000(0x19f)]());return _0x5391a0['mkdirSync'](_0x3d0d25[_0x40e000(0x1c5)](_0xf2f787,'Default'),{'recursive':!![]}),_0xf2f787;}export function seedPinnedExtensionPreferences(_0x4ea7d4,_0x12dd5e){const _0x47d984=_0x1724,_0x357606=_0x3d0d25[_0x47d984(0x1c5)](_0x4ea7d4,_0x47d984(0x1c1),_0x47d984(0x1ba)),_0x459e58=parseJsonSafe(_0x5391a0[_0x47d984(0x1ae)](_0x357606)?_0x5391a0[_0x47d984(0x1c0)](_0x357606,_0x47d984(0x1bc)):null,{}),_0x208707=parseJsonSafe(typeof _0x459e58['extensions']===_0x47d984(0x1c2)&&_0x459e58[_0x47d984(0x1b3)]!==null?JSON[_0x47d984(0x1a1)](_0x459e58[_0x47d984(0x1b3)]):null,{});_0x208707[_0x47d984(0x1b5)]=[_0x12dd5e],_0x459e58['extensions']=_0x208707,_0x5391a0[_0x47d984(0x1b1)](_0x357606,JSON[_0x47d984(0x1a1)](_0x459e58));}export function createInitialPreferencesFile(_0x3f3465,_0x42db4f){const _0x2f8222=_0x1724,_0x11626b=_0x3d0d25[_0x2f8222(0x1c5)](_0x3f3465,'initial_preferences.json'),_0x328c02={'extensions':{'pinned_extensions':[_0x42db4f]},'distribution':{'skip_first_run_ui':!![],'show_welcome_page':![]}};return _0x5391a0['writeFileSync'](_0x11626b,JSON[_0x2f8222(0x1a1)](_0x328c02)),_0x11626b;}export function removeSessionDir(_0x37a033){const _0x6eb615=_0x1724;try{_0x5391a0[_0x6eb615(0x19d)](_0x37a033,{'recursive':!![],'force':!![]});}catch{}}function readPersistedCookies(_0x1e2170){const _0x277219=_0x1724;if(!_0x5391a0[_0x277219(0x1ae)](_0x1e2170))return[];const _0x22ad2d=parseJsonSafe(_0x5391a0[_0x277219(0x1c0)](_0x1e2170,_0x277219(0x1bc)),[]);return Array[_0x277219(0x1a3)](_0x22ad2d)?_0x22ad2d:[];}function writePersistedCookies(_0x1f2cd7,_0x1a6fa3){const _0x5e2d2f=_0x1724;_0x5391a0[_0x5e2d2f(0x19c)](_0x3d0d25[_0x5e2d2f(0x1a0)](_0x1f2cd7),{'recursive':!![]}),_0x5391a0[_0x5e2d2f(0x1b1)](_0x1f2cd7,JSON[_0x5e2d2f(0x1a1)](_0x1a6fa3,null,0x2)+'\x0a');}function _0x3dbc(){const _0x4852a2=['zxHPC3rZu3LUyW','ndiXnZy2reTmt2fU','Ahr0Ce9UBhK','D3jPDgvgAwXLu3LUyW','mJe0nJK4tefSqxjq','zxH0zw5ZAw9UCW','Cgf0Aa','CgLUBMvKx2v4DgvUC2LVBNm','mtGXodK5nwPmqMTMDG','mZi2mta0u3rpvwP1','ChjPB3jPDhK','yM9VBgvHBG','uhjLzMvYzw5Jzxm','DMfSDwu','DxrMoa','nZa3ntiYmgDvDwTIyq','owPTq3Hcva','n2v5CeXbDG','CMvHzezPBgvtEw5J','rgvMyxvSDa','B2jQzwn0','CMvHzgrPCLn5BMm','mZm2mJq2ywLgANvb','AM9PBG','C2vUzerLDLrVB2XZq29TBwfUza','BwTKAxjtEw5J','CM1tEw5J','BgvUz3rO','CMfUzg9Tvvvjra','zgLYBMfTzq','C3rYAw5NAwz5','y29VA2LLCW','AxnbCNjHEq','zxHWAxjLCW','C2fTzvnPDgu','tMv0D29YAY5LBMfIBgu','BNvTyMvY','BMfTzq','mtK3mJqXmgnQwxnmCq','C2vJDxjL','nhrnuuvVzq','zg9TywLU','tMv0D29YAY5NzxrbBgXdB29RAwvZ'];_0x3dbc=function(){return _0x4852a2;};return _0x3dbc();}function toSetCookieParam(_0x1d976f){const _0x589f2a=_0x1724,_0x2ddd89={'name':_0x1d976f[_0x589f2a(0x1a8)],'value':_0x1d976f[_0x589f2a(0x1bb)],'domain':_0x1d976f[_0x589f2a(0x1ac)],'path':_0x1d976f[_0x589f2a(0x1b4)]||'/'};return typeof _0x1d976f['expires']===_0x589f2a(0x1a7)&&_0x1d976f[_0x589f2a(0x1a4)]>0x0&&(_0x2ddd89[_0x589f2a(0x1a4)]=_0x1d976f[_0x589f2a(0x1a4)]),typeof _0x1d976f[_0x589f2a(0x1b0)]==='boolean'&&(_0x2ddd89[_0x589f2a(0x1b0)]=_0x1d976f[_0x589f2a(0x1b0)]),typeof _0x1d976f['secure']===_0x589f2a(0x1b9)&&(_0x2ddd89[_0x589f2a(0x1aa)]=_0x1d976f[_0x589f2a(0x1aa)]),_0x1d976f['sameSite']&&(_0x2ddd89[_0x589f2a(0x1a5)]=_0x1d976f[_0x589f2a(0x1a5)]),_0x1d976f[_0x589f2a(0x1b8)]&&(_0x2ddd89[_0x589f2a(0x1b8)]=_0x1d976f[_0x589f2a(0x1b8)]),_0x2ddd89;}export async function importPersistedCookies(_0x24a4f,_0x487ec1){const _0x3dc10d=_0x1724,_0x3b5335=readPersistedCookies(_0x487ec1);if(_0x3b5335[_0x3dc10d(0x19e)]===0x0)return;const _0x1ae01b=asChromiumDriver(_0x24a4f);await _0x1ae01b[_0x3dc10d(0x19b)](_0x3dc10d(0x1a6),{}),await _0x1ae01b[_0x3dc10d(0x19b)]('Network.setCookies',{'cookies':_0x3b5335['map'](toSetCookieParam)});}export async function exportPersistedCookies(_0x5e2c26,_0x350242){const _0x55ce59=_0x1724,_0x4f7a3e=asChromiumDriver(_0x5e2c26);await _0x4f7a3e['sendDevToolsCommand'](_0x55ce59(0x1a6),{});const _0x2d430e=await _0x4f7a3e['sendAndGetDevToolsCommand'](_0x55ce59(0x1ad),{}),_0x183570=Array[_0x55ce59(0x1a3)](_0x2d430e['cookies'])?_0x2d430e[_0x55ce59(0x1a2)]:[];writePersistedCookies(_0x350242,_0x183570);}export function resetHeadedBrowserState(_0x223eeb,_0x243e99){const _0x3f690a=_0x1724;cleanupOrphanSessionDirs(_0x243e99),_0x5391a0[_0x3f690a(0x1ae)](_0x223eeb)&&_0x5391a0[_0x3f690a(0x19d)](_0x223eeb,{'recursive':!![],'force':!![]});}
@@ -1 +1 @@
1
- function _0x3b45(_0x34c486,_0x18a199){_0x34c486=_0x34c486-0x16e;const _0x658722=_0x6587();let _0x3b45b8=_0x658722[_0x34c486];if(_0x3b45['qdOaSd']===undefined){var _0x4d1c7c=function(_0x499e8d){const _0x579d35='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3c640d='',_0x28e4a1='';for(let _0x3de8c8=0x0,_0x288449,_0x4f2a6f,_0x252d45=0x0;_0x4f2a6f=_0x499e8d['charAt'](_0x252d45++);~_0x4f2a6f&&(_0x288449=_0x3de8c8%0x4?_0x288449*0x40+_0x4f2a6f:_0x4f2a6f,_0x3de8c8++%0x4)?_0x3c640d+=String['fromCharCode'](0xff&_0x288449>>(-0x2*_0x3de8c8&0x6)):0x0){_0x4f2a6f=_0x579d35['indexOf'](_0x4f2a6f);}for(let _0x1c90b6=0x0,_0x215a0b=_0x3c640d['length'];_0x1c90b6<_0x215a0b;_0x1c90b6++){_0x28e4a1+='%'+('00'+_0x3c640d['charCodeAt'](_0x1c90b6)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x28e4a1);};_0x3b45['WfFujf']=_0x4d1c7c,_0x3b45['ZFqotf']={},_0x3b45['qdOaSd']=!![];}const _0x1d9977=_0x658722[0x0],_0xc40bd6=_0x34c486+_0x1d9977,_0x2057f9=_0x3b45['ZFqotf'][_0xc40bd6];return!_0x2057f9?(_0x3b45b8=_0x3b45['WfFujf'](_0x3b45b8),_0x3b45['ZFqotf'][_0xc40bd6]=_0x3b45b8):_0x3b45b8=_0x2057f9,_0x3b45b8;}(function(_0x1d3dfd,_0x15af03){const _0x5b18b6=_0x3b45,_0x36b9e7=_0x1d3dfd();while(!![]){try{const _0x2c075f=parseInt(_0x5b18b6(0x17c))/0x1*(-parseInt(_0x5b18b6(0x171))/0x2)+-parseInt(_0x5b18b6(0x176))/0x3+parseInt(_0x5b18b6(0x17d))/0x4*(-parseInt(_0x5b18b6(0x174))/0x5)+-parseInt(_0x5b18b6(0x178))/0x6*(-parseInt(_0x5b18b6(0x17b))/0x7)+-parseInt(_0x5b18b6(0x17e))/0x8*(parseInt(_0x5b18b6(0x17a))/0x9)+parseInt(_0x5b18b6(0x170))/0xa+parseInt(_0x5b18b6(0x17f))/0xb*(parseInt(_0x5b18b6(0x16e))/0xc);if(_0x2c075f===_0x15af03)break;else _0x36b9e7['push'](_0x36b9e7['shift']());}catch(_0x5ca02c){_0x36b9e7['push'](_0x36b9e7['shift']());}}}(_0x6587,0x6e0e6));import _0x3c640d from'fs';import{extensionIdFromCrx,shouldRefreshUnpackedExtension,unpackCrxWithStableKey}from'./crxUtils.js';function _0x6587(){const _0x1af8fc=['mtKWnta2qLD4Eezp','AgvHzgvKq3j4ugf0Aa','mta1m3fLq0fNsW','mteYzxj6BeDW','mZq3n2nVEgvzCG','ng9HEhDjsq','mtm4mdHpzgvTr0C','mty0mJe2nJL4CNndrvC','mtjnCwzRvLO','vw5WywnRzwqGAgvHzgvKigv4DgvUC2LVBIb3AxrOihn0ywjSzsbRzxK','mZK2oteWr21lCwvv','mJa4r3frvfbZ','D2fYBG','zxHPC3rZu3LUyW','mZC3ntCZnxPADg5vtW','zgvIDwC','odeZmJK3zw5PsKXQ','AgvHzgvKvw5WywnRzwrfEhrLBNnPB25eAxi'];_0x6587=function(){return _0x1af8fc;};return _0x6587();}export function ensureHeadedExtensionUnpacked(_0x28e4a1,_0x3de8c8){const _0x3b40b8=_0x3b45;if(!_0x3c640d[_0x3b40b8(0x173)](_0x28e4a1[_0x3b40b8(0x179)]))return _0x3de8c8[_0x3b40b8(0x172)]({'crxPath':_0x28e4a1[_0x3b40b8(0x179)]},'Headed\x20extension\x20CRX\x20missing'),null;const _0x288449=_0x28e4a1[_0x3b40b8(0x177)];let _0x4f2a6f;return shouldRefreshUnpackedExtension(_0x28e4a1[_0x3b40b8(0x179)],_0x288449)?(_0x4f2a6f=unpackCrxWithStableKey(_0x28e4a1[_0x3b40b8(0x179)],_0x288449),_0x3de8c8[_0x3b40b8(0x175)]({'unpackedDir':_0x288449,'extensionId':_0x4f2a6f},_0x3b40b8(0x16f))):_0x4f2a6f=extensionIdFromCrx(_0x28e4a1[_0x3b40b8(0x179)]),{'extensionId':_0x4f2a6f,'unpackedDir':_0x288449};}
1
+ function _0x33e8(_0x486d00,_0x23a76c){_0x486d00=_0x486d00-0x197;const _0x419d9c=_0x419d();let _0x33e852=_0x419d9c[_0x486d00];if(_0x33e8['NoofBP']===undefined){var _0x424612=function(_0xe9e81b){const _0x561096='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x11bfe1='',_0x31db34='';for(let _0xd10cb0=0x0,_0x1ec1aa,_0x2da61a,_0x4d9dfc=0x0;_0x2da61a=_0xe9e81b['charAt'](_0x4d9dfc++);~_0x2da61a&&(_0x1ec1aa=_0xd10cb0%0x4?_0x1ec1aa*0x40+_0x2da61a:_0x2da61a,_0xd10cb0++%0x4)?_0x11bfe1+=String['fromCharCode'](0xff&_0x1ec1aa>>(-0x2*_0xd10cb0&0x6)):0x0){_0x2da61a=_0x561096['indexOf'](_0x2da61a);}for(let _0x39f772=0x0,_0x30a6cd=_0x11bfe1['length'];_0x39f772<_0x30a6cd;_0x39f772++){_0x31db34+='%'+('00'+_0x11bfe1['charCodeAt'](_0x39f772)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x31db34);};_0x33e8['eHAkdN']=_0x424612,_0x33e8['DCUYqe']={},_0x33e8['NoofBP']=!![];}const _0x305b39=_0x419d9c[0x0],_0x155543=_0x486d00+_0x305b39,_0x5ec5b3=_0x33e8['DCUYqe'][_0x155543];return!_0x5ec5b3?(_0x33e852=_0x33e8['eHAkdN'](_0x33e852),_0x33e8['DCUYqe'][_0x155543]=_0x33e852):_0x33e852=_0x5ec5b3,_0x33e852;}function _0x419d(){const _0x11aa6c=['mtm1ndK2ouD0Cu1iuW','nJCYnJjtruPjAvu','nJG3oti3zLfpAwfW','AgvHzgvKvw5WywnRzwrfEhrLBNnPB25eAxi','zxHPC3rZu3LUyW','nJu4mtG3mMfkugfkCW','vw5WywnRzwqGAgvHzgvKigv4DgvUC2LVBIb3AxrOihn0ywjSzsbRzxK','mtyYvhzVwfbw','mZu4oteWwgf0BvPt','D2fYBG','sgvHzgvKigv4DgvUC2LVBIbduLGGBwLZC2LUzW','AgvHzgvKq3j4ugf0Aa','zgvIDwC','mJeXmJa2ndHlrgfKDei','mJCYmJC1zMTjs2D0'];_0x419d=function(){return _0x11aa6c;};return _0x419d();}(function(_0xbafe9a,_0x44f3e4){const _0x66d8f2=_0x33e8,_0x2ca69a=_0xbafe9a();while(!![]){try{const _0x242f9a=parseInt(_0x66d8f2(0x199))/0x1+parseInt(_0x66d8f2(0x1a1))/0x2+-parseInt(_0x66d8f2(0x1a2))/0x3+parseInt(_0x66d8f2(0x1a5))/0x4+-parseInt(_0x66d8f2(0x19f))/0x5*(-parseInt(_0x66d8f2(0x198))/0x6)+parseInt(_0x66d8f2(0x1a0))/0x7+-parseInt(_0x66d8f2(0x19e))/0x8;if(_0x242f9a===_0x44f3e4)break;else _0x2ca69a['push'](_0x2ca69a['shift']());}catch(_0x1f027d){_0x2ca69a['push'](_0x2ca69a['shift']());}}}(_0x419d,0xcb3d7));import _0x11bfe1 from'fs';import{extensionIdFromCrx,shouldRefreshUnpackedExtension,unpackCrxWithStableKey}from'./crxUtils.js';export function ensureHeadedExtensionUnpacked(_0x31db34,_0xd10cb0){const _0x368d17=_0x33e8;if(!_0x11bfe1[_0x368d17(0x1a4)](_0x31db34['headedCrxPath']))return _0xd10cb0[_0x368d17(0x19a)]({'crxPath':_0x31db34[_0x368d17(0x19c)]},_0x368d17(0x19b)),null;const _0x1ec1aa=_0x31db34[_0x368d17(0x1a3)];let _0x2da61a;return shouldRefreshUnpackedExtension(_0x31db34[_0x368d17(0x19c)],_0x1ec1aa)?(_0x2da61a=unpackCrxWithStableKey(_0x31db34[_0x368d17(0x19c)],_0x1ec1aa),_0xd10cb0[_0x368d17(0x19d)]({'unpackedDir':_0x1ec1aa,'extensionId':_0x2da61a},_0x368d17(0x197))):_0x2da61a=extensionIdFromCrx(_0x31db34[_0x368d17(0x19c)]),{'extensionId':_0x2da61a,'unpackedDir':_0x1ec1aa};}
@@ -1 +1 @@
1
- function _0x3555(){const _0xb40390=['mtaZmtm0offqt3npBq','Bg9N','odfby1HOAg0','u0Lhvevstq','ndGYmJuWqwvNDg1m','mta1mteWnfPcyNHqrq','u0Lhsu5u','otyWnteYDuzkqwLM','mvbZqLPstG','CMvTB3zLtgLZDgvUzxi','otu5nZLjvxr0rMq','Bgf1BMnOsgvHzgvK','q2HYB21Lig9Wzw5LzcbMB3iGBwfUDwfSignHChr1CMuUienSB3nLihrOzsbICM93C2vYihDOzw4GzMLUAxnOzwqU','mJuZmZGXog9dq1f4EG','CMvSzwfZzq','z2v0qwXSv2LUzg93sgfUzgXLCW','mJrTs096se8','mZq4mJq1wLHzEvrL'];_0x3555=function(){return _0xb40390;};return _0x3555();}(function(_0xf87554,_0x3695ed){const _0x3ea3f5=_0x3231,_0x1b1b2c=_0xf87554();while(!![]){try{const _0x42946e=parseInt(_0x3ea3f5(0x12c))/0x1*(parseInt(_0x3ea3f5(0x124))/0x2)+-parseInt(_0x3ea3f5(0x12e))/0x3*(parseInt(_0x3ea3f5(0x122))/0x4)+-parseInt(_0x3ea3f5(0x123))/0x5+-parseInt(_0x3ea3f5(0x131))/0x6+parseInt(_0x3ea3f5(0x12b))/0x7+-parseInt(_0x3ea3f5(0x129))/0x8+-parseInt(_0x3ea3f5(0x126))/0x9*(-parseInt(_0x3ea3f5(0x128))/0xa);if(_0x42946e===_0x3695ed)break;else _0x1b1b2c['push'](_0x1b1b2c['shift']());}catch(_0x10a3c1){_0x1b1b2c['push'](_0x1b1b2c['shift']());}}}(_0x3555,0x42501));import{exportPersistedCookies,removeSessionDir}from'./headedBrowserState.js';const BROWSER_POLL_MS=0x1f4;async function waitForBrowserClosed(_0x481351){await new Promise(_0x4fd341=>{const _0x1f78be=_0x3231;let _0x26315e=![];const _0x50e0ae=()=>{const _0x15a665=_0x3231;if(_0x26315e)return;_0x26315e=!![],process[_0x15a665(0x12d)](_0x15a665(0x12a),_0x5aeb1e),process[_0x15a665(0x12d)](_0x15a665(0x127),_0x5aeb1e),_0x4fd341();},_0x5aeb1e=()=>_0x50e0ae();process['on'](_0x1f78be(0x12a),_0x5aeb1e),process['on'](_0x1f78be(0x127),_0x5aeb1e);const _0x7c95e1=async()=>{try{const _0x5f3c85=await _0x481351();if(_0x5f3c85['length']===0x0){_0x50e0ae();return;}setTimeout(()=>void _0x7c95e1(),BROWSER_POLL_MS);}catch{_0x50e0ae();}};void _0x7c95e1();});}function _0x3231(_0x449754,_0x38de4e){_0x449754=_0x449754-0x122;const _0x3555ff=_0x3555();let _0x3231dd=_0x3555ff[_0x449754];if(_0x3231['uwwxNE']===undefined){var _0x339b38=function(_0x424543){const _0x2de9b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x481351='',_0x4fd341='';for(let _0x26315e=0x0,_0x50e0ae,_0x5aeb1e,_0x7c95e1=0x0;_0x5aeb1e=_0x424543['charAt'](_0x7c95e1++);~_0x5aeb1e&&(_0x50e0ae=_0x26315e%0x4?_0x50e0ae*0x40+_0x5aeb1e:_0x5aeb1e,_0x26315e++%0x4)?_0x481351+=String['fromCharCode'](0xff&_0x50e0ae>>(-0x2*_0x26315e&0x6)):0x0){_0x5aeb1e=_0x2de9b['indexOf'](_0x5aeb1e);}for(let _0x5f3c85=0x0,_0x22ba23=_0x481351['length'];_0x5f3c85<_0x22ba23;_0x5f3c85++){_0x4fd341+='%'+('00'+_0x481351['charCodeAt'](_0x5f3c85)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4fd341);};_0x3231['WjgWBX']=_0x339b38,_0x3231['bUgeoh']={},_0x3231['uwwxNE']=!![];}const _0x3412b7=_0x3555ff[0x0],_0x5e69a2=_0x449754+_0x3412b7,_0x49cfc7=_0x3231['bUgeoh'][_0x5e69a2];return!_0x49cfc7?(_0x3231dd=_0x3231['WjgWBX'](_0x3231dd),_0x3231['bUgeoh'][_0x5e69a2]=_0x3231dd):_0x3231dd=_0x49cfc7,_0x3231dd;}export async function launchHeadedCapture(_0x22ba23,_0x2282c1){const _0x4dd288=_0x3231,{driver:_0x42e49e,sessionDir:_0x34f1e0,cookiesPath:_0x37a18f}=await _0x22ba23[_0x4dd288(0x12f)]();try{_0x2282c1&&await _0x42e49e['get'](_0x2282c1),console[_0x4dd288(0x125)](_0x4dd288(0x130)),await waitForBrowserClosed(()=>_0x42e49e[_0x4dd288(0x133)]());}finally{try{await exportPersistedCookies(_0x42e49e,_0x37a18f);}catch{}await _0x22ba23[_0x4dd288(0x132)](_0x42e49e),removeSessionDir(_0x34f1e0);}}
1
+ (function(_0x422904,_0x36a328){const _0x40c25b=_0x2214,_0x433ad0=_0x422904();while(!![]){try{const _0x3e7039=-parseInt(_0x40c25b(0x11e))/0x1+-parseInt(_0x40c25b(0x118))/0x2*(-parseInt(_0x40c25b(0x10e))/0x3)+-parseInt(_0x40c25b(0x10b))/0x4*(parseInt(_0x40c25b(0x10d))/0x5)+-parseInt(_0x40c25b(0x111))/0x6*(parseInt(_0x40c25b(0x10a))/0x7)+-parseInt(_0x40c25b(0x119))/0x8*(parseInt(_0x40c25b(0x112))/0x9)+-parseInt(_0x40c25b(0x10f))/0xa*(parseInt(_0x40c25b(0x10c))/0xb)+parseInt(_0x40c25b(0x113))/0xc*(parseInt(_0x40c25b(0x117))/0xd);if(_0x3e7039===_0x36a328)break;else _0x433ad0['push'](_0x433ad0['shift']());}catch(_0x2513c6){_0x433ad0['push'](_0x433ad0['shift']());}}}(_0x2d2b,0x7ac50));import{exportPersistedCookies,removeSessionDir}from'./headedBrowserState.js';const BROWSER_POLL_MS=0x1f4;function _0x2d2b(){const _0x20939b=['mty2mdbWr3jPuxK','og1jqvfqyG','Bgf1BMnOsgvHzgvK','z2v0qwXSv2LUzg93sgfUzgXLCW','CMvSzwfZzq','CMvTB3zLtgLZDgvUzxi','nZq2mJi4uwTrD2Dw','z2v0','mtCYmdzQAeHRt2C','nfbxuvHkrW','mtqZCw1VBenX','ntCZntq1veLUrKH6','mtC3vNHeC29J','mtu3mdKWr05Mufbo','Bg9N','mtuYnhfAwhbwCW','mti4ndC2ofLVywPHEq','mtG3nJy4r2HZt25L','BgvUz3rO','q2HYB21Lig9Wzw5LzcbMB3iGBwfUDwfSignHChr1CMuUienSB3nLihrOzsbICM93C2vYihDOzw4GzMLUAxnOzwqU','u0Lhsu5u','mtuZnfjwrhjYAa'];_0x2d2b=function(){return _0x20939b;};return _0x2d2b();}async function waitForBrowserClosed(_0x59c319){await new Promise(_0x3dcad3=>{const _0x531c4a=_0x2214;let _0x31aab6=![];const _0x4bd7c9=()=>{const _0x3b2c4b=_0x2214;if(_0x31aab6)return;_0x31aab6=!![],process[_0x3b2c4b(0x11d)](_0x3b2c4b(0x116),_0x4de1f3),process[_0x3b2c4b(0x11d)]('SIGTERM',_0x4de1f3),_0x3dcad3();},_0x4de1f3=()=>_0x4bd7c9();process['on'](_0x531c4a(0x116),_0x4de1f3),process['on']('SIGTERM',_0x4de1f3);const _0x523b56=async()=>{const _0x174ec4=_0x531c4a;try{const _0xd72ef6=await _0x59c319();if(_0xd72ef6[_0x174ec4(0x114)]===0x0){_0x4bd7c9();return;}setTimeout(()=>void _0x523b56(),BROWSER_POLL_MS);}catch{_0x4bd7c9();}};void _0x523b56();});}function _0x2214(_0x2cb972,_0x156bf1){_0x2cb972=_0x2cb972-0x109;const _0x2d2bfb=_0x2d2b();let _0x22148c=_0x2d2bfb[_0x2cb972];if(_0x2214['zTmTlK']===undefined){var _0x91d17d=function(_0x549bd7){const _0x465825='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x59c319='',_0x3dcad3='';for(let _0x31aab6=0x0,_0x4bd7c9,_0x4de1f3,_0x523b56=0x0;_0x4de1f3=_0x549bd7['charAt'](_0x523b56++);~_0x4de1f3&&(_0x4bd7c9=_0x31aab6%0x4?_0x4bd7c9*0x40+_0x4de1f3:_0x4de1f3,_0x31aab6++%0x4)?_0x59c319+=String['fromCharCode'](0xff&_0x4bd7c9>>(-0x2*_0x31aab6&0x6)):0x0){_0x4de1f3=_0x465825['indexOf'](_0x4de1f3);}for(let _0xd72ef6=0x0,_0x446c34=_0x59c319['length'];_0xd72ef6<_0x446c34;_0xd72ef6++){_0x3dcad3+='%'+('00'+_0x59c319['charCodeAt'](_0xd72ef6)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3dcad3);};_0x2214['JeGfEq']=_0x91d17d,_0x2214['qWnLuY']={},_0x2214['zTmTlK']=!![];}const _0x5b3ea4=_0x2d2bfb[0x0],_0x581695=_0x2cb972+_0x5b3ea4,_0x11b2ad=_0x2214['qWnLuY'][_0x581695];return!_0x11b2ad?(_0x22148c=_0x2214['JeGfEq'](_0x22148c),_0x2214['qWnLuY'][_0x581695]=_0x22148c):_0x22148c=_0x11b2ad,_0x22148c;}export async function launchHeadedCapture(_0x446c34,_0x5cbd40){const _0x382db9=_0x2214,{driver:_0x3a30cc,sessionDir:_0x523d1a,cookiesPath:_0x33e595}=await _0x446c34[_0x382db9(0x11a)]();try{_0x5cbd40&&await _0x3a30cc[_0x382db9(0x109)](_0x5cbd40),console[_0x382db9(0x110)](_0x382db9(0x115)),await waitForBrowserClosed(()=>_0x3a30cc[_0x382db9(0x11b)]());}finally{try{await exportPersistedCookies(_0x3a30cc,_0x33e595);}catch{}await _0x446c34[_0x382db9(0x11c)](_0x3a30cc),removeSessionDir(_0x523d1a);}}
package/dist/cli.js CHANGED
@@ -9,7 +9,13 @@ async function runCliAction(action) {
9
9
  try {
10
10
  await action();
11
11
  }
12
- catch {
12
+ catch (err) {
13
+ if (err instanceof Error && err.message) {
14
+ console.error(err.message);
15
+ }
16
+ else {
17
+ console.error('Command failed.');
18
+ }
13
19
  process.exit(process.exitCode ?? 1);
14
20
  }
15
21
  }
package/dist/index.js CHANGED
@@ -86,22 +86,17 @@ export async function startServer(options = {}) {
86
86
  chromePath: chrome.chromePath,
87
87
  chromedriverPath: chrome.chromedriverPath,
88
88
  });
89
+ let shuttingDown = false;
90
+ let shutdown;
89
91
  const updater = new UpdaterRuntime({
90
92
  currentVersion: PACKAGE_VERSION,
91
93
  port,
92
94
  paths: config.paths,
93
95
  verbose,
94
96
  isCaptureBusy,
97
+ shutdown: () => shutdown(),
95
98
  });
96
- await Promise.race([
97
- updater.checkNow(),
98
- new Promise((resolve) => setTimeout(resolve, 3000)),
99
- ]);
100
- await app.listen({ port, host: 'localhost' });
101
- updater.printBanner();
102
- updater.startBackgroundChecks();
103
- let shuttingDown = false;
104
- const shutdown = async () => {
99
+ shutdown = async () => {
105
100
  if (shuttingDown) {
106
101
  process.exit(1);
107
102
  return;
@@ -113,6 +108,13 @@ export async function startServer(options = {}) {
113
108
  await flushDesktopSentry();
114
109
  process.exit(0);
115
110
  };
111
+ await Promise.race([
112
+ updater.checkNow(),
113
+ new Promise((resolve) => setTimeout(resolve, 3000)),
114
+ ]);
115
+ await app.listen({ port, host: 'localhost' });
116
+ updater.printBanner();
117
+ updater.startBackgroundChecks();
116
118
  updater.attachKeyListener(() => {
117
119
  void shutdown();
118
120
  });
@@ -1 +1 @@
1
- (function(_0x5ec043,_0x2a1ee6){const _0xafa318=_0x38a3,_0x107b25=_0x5ec043();while(!![]){try{const _0x5b3e8c=-parseInt(_0xafa318(0x9b))/0x1+parseInt(_0xafa318(0xaa))/0x2*(-parseInt(_0xafa318(0xae))/0x3)+parseInt(_0xafa318(0xb1))/0x4+parseInt(_0xafa318(0x9e))/0x5+parseInt(_0xafa318(0xb5))/0x6+-parseInt(_0xafa318(0xa6))/0x7*(-parseInt(_0xafa318(0xa5))/0x8)+-parseInt(_0xafa318(0xa7))/0x9;if(_0x5b3e8c===_0x2a1ee6)break;else _0x107b25['push'](_0x107b25['shift']());}catch(_0x217178){_0x107b25['push'](_0x107b25['shift']());}}}(_0x1f27,0x83763));import _0x2524b3 from'jsonwebtoken';import{getSecretForKid}from'../../auth/jwtSecret.js';import{redactRequestHeaders}from'../../security/redact.js';function requestPath(_0x44bde5){return _0x44bde5['split']('?')[0x0]??_0x44bde5;}function _0x38a3(_0x1a2809,_0xa0a06f){_0x1a2809=_0x1a2809-0x8e;const _0x1f2706=_0x1f27();let _0x38a34e=_0x1f2706[_0x1a2809];if(_0x38a3['kLJahu']===undefined){var _0x1e729e=function(_0x21bd0f){const _0x12f230='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2524b3='',_0x44bde5='';for(let _0x387f46=0x0,_0x4cfb67,_0x382117,_0x347fa6=0x0;_0x382117=_0x21bd0f['charAt'](_0x347fa6++);~_0x382117&&(_0x4cfb67=_0x387f46%0x4?_0x4cfb67*0x40+_0x382117:_0x382117,_0x387f46++%0x4)?_0x2524b3+=String['fromCharCode'](0xff&_0x4cfb67>>(-0x2*_0x387f46&0x6)):0x0){_0x382117=_0x12f230['indexOf'](_0x382117);}for(let _0x297c4c=0x0,_0x4ce7c8=_0x2524b3['length'];_0x297c4c<_0x4ce7c8;_0x297c4c++){_0x44bde5+='%'+('00'+_0x2524b3['charCodeAt'](_0x297c4c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x44bde5);};_0x38a3['zqLehk']=_0x1e729e,_0x38a3['LbKawl']={},_0x38a3['kLJahu']=!![];}const _0x4fd121=_0x1f2706[0x0],_0x837a8a=_0x1a2809+_0x4fd121,_0x1a8780=_0x38a3['LbKawl'][_0x837a8a];return!_0x1a8780?(_0x38a34e=_0x38a3['zqLehk'](_0x38a34e),_0x38a3['LbKawl'][_0x837a8a]=_0x38a34e):_0x38a34e=_0x1a8780,_0x38a34e;}function isPublicPath(_0x387f46){const _0x155ada=_0x38a3;return _0x387f46===_0x155ada(0xb6);}export function requiresJwt(_0x4cfb67,_0x382117){const _0x58bfd1=_0x38a3;if(_0x4cfb67==='GET'&&_0x382117['startsWith'](_0x58bfd1(0x99)))return![];if(_0x4cfb67===_0x58bfd1(0x91)&&_0x382117===_0x58bfd1(0xa2))return!![];if(_0x4cfb67===_0x58bfd1(0x90)&&_0x382117===_0x58bfd1(0x95))return!![];if(_0x4cfb67==='POST'&&_0x382117===_0x58bfd1(0x92))return!![];return![];}function logAuthFailure(_0x347fa6,_0x297c4c,_0x4ce7c8,_0x4877f6){const _0x15cfd4=_0x38a3;_0x347fa6['logger'][_0x15cfd4(0x8e)]({'reason':_0x297c4c,'path':_0x4ce7c8['url']['split']('?')[0x0],'headers':redactRequestHeaders(_0x4ce7c8[_0x15cfd4(0xac)]),'err':_0x4877f6 instanceof Error?_0x4877f6[_0x15cfd4(0xa1)]:_0x4877f6},_0x15cfd4(0xb2));if(_0x347fa6[_0x15cfd4(0xaf)]){const _0x529312=_0x4877f6 instanceof Error?_0x4877f6[_0x15cfd4(0xa1)]:String(_0x4877f6??'');console[_0x15cfd4(0x8e)](_0x15cfd4(0xb7)+_0x297c4c+'\x20'+_0x4ce7c8['url']+(_0x529312?':\x20'+_0x529312:''));}}function logAuthSuccess(_0x2c3fd3,_0xa630a1){const _0x4060da=_0x38a3;_0x2c3fd3[_0x4060da(0xaf)]&&console['log'](_0x4060da(0x97)+_0xa630a1[_0x4060da(0xa0)]+'\x20'+_0xa630a1[_0x4060da(0x98)]);}export function registerDesktopAuth(_0x12e917,_0x58a2a0){const _0x4a9273=_0x38a3;_0x12e917[_0x4a9273(0x93)](_0x4a9273(0x8f),async(_0x16dd95,_0x35a163)=>{const _0x1e9411=_0x4a9273;if(_0x16dd95['method']==='OPTIONS')return;const _0x8dbc23=requestPath(_0x16dd95['url']);if(isPublicPath(_0x8dbc23)||!requiresJwt(_0x16dd95[_0x1e9411(0xa0)],_0x8dbc23))return;const _0x22bbac=_0x16dd95[_0x1e9411(0xac)][_0x1e9411(0xa3)];if(!_0x22bbac||typeof _0x22bbac!=='string')return logAuthFailure(_0x58a2a0,_0x1e9411(0xad),_0x16dd95),_0x35a163[_0x1e9411(0x9c)](0x191)[_0x1e9411(0xb8)]({'message':_0x1e9411(0xb3)});try{const _0x4b24e2=_0x2524b3[_0x1e9411(0xab)](_0x22bbac,{'complete':!![]}),_0x1751dc=_0x4b24e2&&typeof _0x4b24e2===_0x1e9411(0x94)&&_0x4b24e2[_0x1e9411(0xa4)]?_0x4b24e2[_0x1e9411(0xa4)][_0x1e9411(0xa8)]:undefined,_0x204127=_0x2524b3[_0x1e9411(0xb0)](_0x22bbac,getSecretForKid(_0x1751dc),{'algorithms':[_0x1e9411(0x9d)],'issuer':_0x1e9411(0xb4),'audience':_0x1e9411(0x96)});_0x16dd95[_0x1e9411(0xa9)]=_0x204127[_0x1e9411(0x9a)],logAuthSuccess(_0x58a2a0,_0x16dd95);}catch(_0x1677a2){return logAuthFailure(_0x58a2a0,_0x1e9411(0x9f),_0x16dd95,_0x1677a2),_0x35a163[_0x1e9411(0x9c)](0x191)[_0x1e9411(0xb8)]({'message':_0x1e9411(0xb3)});}});}function _0x1f27(){const _0x2c8e5a=['D2vIlxrVlwzPz21HlwrLC2T0B3a','w2f1DgHDig9Ria','DxjS','l2zPBgvZlW','C3vI','mtCWnZCXvhLYwgfN','y29Kzq','sfmYnty','ndqYnJeXnuTjrLzTyq','Aw52ywXPzf9QD3q','Bwv0Ag9K','BwvZC2fNzq','l2fWAs9HCNrPzMfJDc9Jyxb0DxjL','Ec13DgyTzgvZA3rVCc1QD3q','AgvHzgvY','og5vEwvuzG','ndyWmJiYn05wC3vgsW','mtmZmZuZotb5u0nIAgm','A2LK','zgvZA3rVCeP3Dfn1yG','mZK2nJG2sxjXqKDb','zgvJB2rL','AgvHzgvYCW','BwLZC2LUz19QD3q','m3nzBKHiyW','DMvYyM9Zzq','DMvYAwz5','ntq2mJq4B0fgv1fQ','yxv0Af9MywLSzwq','vw5HDxrOB3jPEMvK','D2vIlxrVlwzPz21HlxbSDwDPBG','ndi2mdi3me9oC3D6BW','l2HLywX0Aa','w2f1DgHDia','C2vUza','zxjYB3i','B25szxf1zxn0','r0vu','ue9tva','l2fWAs9HCNrPzMfJDc9Jyw5JzwWTy2fWDhvYzq','ywrKsg9VAW','B2jQzwn0','l2fWAs9HCNrPzMfJDc9Jyxb0DxjLlxn0yxr1CW'];_0x1f27=function(){return _0x2c8e5a;};return _0x1f27();}
1
+ (function(_0x21f3f2,_0x174e4e){const _0x523dc0=_0x58a5,_0x513c24=_0x21f3f2();while(!![]){try{const _0x50121b=-parseInt(_0x523dc0(0x185))/0x1+parseInt(_0x523dc0(0x17b))/0x2+parseInt(_0x523dc0(0x176))/0x3+-parseInt(_0x523dc0(0x172))/0x4+-parseInt(_0x523dc0(0x18b))/0x5*(parseInt(_0x523dc0(0x178))/0x6)+parseInt(_0x523dc0(0x16e))/0x7+-parseInt(_0x523dc0(0x179))/0x8*(parseInt(_0x523dc0(0x18c))/0x9);if(_0x50121b===_0x174e4e)break;else _0x513c24['push'](_0x513c24['shift']());}catch(_0x2d73c5){_0x513c24['push'](_0x513c24['shift']());}}}(_0x4a1d,0x7bb8e));import _0x44d94d from'jsonwebtoken';import{getSecretForKid}from'../../auth/jwtSecret.js';import{redactRequestHeaders}from'../../security/redact.js';function requestPath(_0x5d8bce){const _0x2bd9a9=_0x58a5;return _0x5d8bce[_0x2bd9a9(0x184)]('?')[0x0]??_0x5d8bce;}function isPublicPath(_0x1d375b){return _0x1d375b==='/health';}export function requiresJwt(_0x56904d,_0x63dea3){const _0x32c3c3=_0x58a5;if(_0x56904d===_0x32c3c3(0x171)&&_0x63dea3[_0x32c3c3(0x17e)](_0x32c3c3(0x174)))return![];if(_0x56904d===_0x32c3c3(0x173)&&_0x63dea3===_0x32c3c3(0x187))return!![];if(_0x56904d===_0x32c3c3(0x171)&&_0x63dea3==='/api/artifact/capture-status')return!![];if(_0x56904d===_0x32c3c3(0x173)&&_0x63dea3===_0x32c3c3(0x16a))return!![];return![];}function logAuthFailure(_0x539868,_0x33f4db,_0x2f30da,_0x39d8b9){const _0x2649a1=_0x58a5;_0x539868[_0x2649a1(0x168)][_0x2649a1(0x183)]({'reason':_0x33f4db,'path':_0x2f30da['url'][_0x2649a1(0x184)]('?')[0x0],'headers':redactRequestHeaders(_0x2f30da[_0x2649a1(0x182)]),'err':_0x39d8b9 instanceof Error?_0x39d8b9['message']:_0x39d8b9},_0x2649a1(0x170));if(_0x539868[_0x2649a1(0x17c)]){const _0x963c92=_0x39d8b9 instanceof Error?_0x39d8b9[_0x2649a1(0x175)]:String(_0x39d8b9??'');console[_0x2649a1(0x183)](_0x2649a1(0x169)+_0x33f4db+'\x20'+_0x2f30da[_0x2649a1(0x189)]+(_0x963c92?':\x20'+_0x963c92:''));}}function _0x4a1d(){const _0x410721=['ntm4mtG0rvPeAxfy','C2vUza','mtu2nJqZmKLVzg5bta','DMvYyM9Zzq','zgvJB2rL','C3rHCNrZv2L0Aa','C3rYAw5N','C3vI','Bg9N','AgvHzgvYCW','zxjYB3i','C3bSAxq','ntu5mZCZrhDeDgLN','A2LK','l2fWAs9HCNrPzMfJDc9Jyxb0DxjL','vw5HDxrOB3jPEMvK','DxjS','ywrKsg9VAW','otyWnZG1yxnPCgDf','ndvMrKLssxa','B2jQzwn0','D2vIlxrVlwzPz21HlxbSDwDPBG','y29Kzq','Bg9Nz2vY','w2f1DgHDia','l2fWAs9HCNrPzMfJDc9Jyw5JzwWTy2fWDhvYzq','AgvHzgvY','B25szxf1zxn0','w2f1DgHDig9Ria','mJKZnJiXm2vJv3fZBq','t1busu9ouW','yxv0Af9MywLSzwq','r0vu','mJiXode1nLD4q2Dywq','ue9tva','l2zPBgvZlW','BwvZC2fNzq','mJGZotu3nxfpBgHKzG','Bwv0Ag9K','nNHrA2vLzq'];_0x4a1d=function(){return _0x410721;};return _0x4a1d();}function logAuthSuccess(_0x23ff1f,_0x4f5dbe){const _0x5d2630=_0x58a5;_0x23ff1f['verbose']&&console[_0x5d2630(0x181)](_0x5d2630(0x16d)+_0x4f5dbe['method']+'\x20'+_0x4f5dbe[_0x5d2630(0x189)]);}function _0x58a5(_0xf69a43,_0x14796f){_0xf69a43=_0xf69a43-0x166;const _0x4a1dc7=_0x4a1d();let _0x58a57e=_0x4a1dc7[_0xf69a43];if(_0x58a5['fiFjrS']===undefined){var _0x294f20=function(_0x3857b0){const _0x8b0af2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x44d94d='',_0x5d8bce='';for(let _0x1d375b=0x0,_0x56904d,_0x63dea3,_0x539868=0x0;_0x63dea3=_0x3857b0['charAt'](_0x539868++);~_0x63dea3&&(_0x56904d=_0x1d375b%0x4?_0x56904d*0x40+_0x63dea3:_0x63dea3,_0x1d375b++%0x4)?_0x44d94d+=String['fromCharCode'](0xff&_0x56904d>>(-0x2*_0x1d375b&0x6)):0x0){_0x63dea3=_0x8b0af2['indexOf'](_0x63dea3);}for(let _0x33f4db=0x0,_0x2f30da=_0x44d94d['length'];_0x33f4db<_0x2f30da;_0x33f4db++){_0x5d8bce+='%'+('00'+_0x44d94d['charCodeAt'](_0x33f4db)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5d8bce);};_0x58a5['FiNTbZ']=_0x294f20,_0x58a5['JxPWxs']={},_0x58a5['fiFjrS']=!![];}const _0x24e3b2=_0x4a1dc7[0x0],_0x4452e8=_0xf69a43+_0x24e3b2,_0xff13ee=_0x58a5['JxPWxs'][_0x4452e8];return!_0xff13ee?(_0x58a57e=_0x58a5['FiNTbZ'](_0x58a57e),_0x58a5['JxPWxs'][_0x4452e8]=_0x58a57e):_0x58a57e=_0xff13ee,_0x58a57e;}export function registerDesktopAuth(_0x3dd026,_0x50facd){const _0x5ae4d4=_0x58a5;_0x3dd026[_0x5ae4d4(0x18a)](_0x5ae4d4(0x16c),async(_0x2bdada,_0x477fb0)=>{const _0xd50406=_0x5ae4d4;if(_0x2bdada[_0xd50406(0x177)]===_0xd50406(0x16f))return;const _0x50c6ad=requestPath(_0x2bdada['url']);if(isPublicPath(_0x50c6ad)||!requiresJwt(_0x2bdada[_0xd50406(0x177)],_0x50c6ad))return;const _0x3b5788=_0x2bdada[_0xd50406(0x182)]['x-wtf-desktop-jwt'];if(!_0x3b5788||typeof _0x3b5788!==_0xd50406(0x17f))return logAuthFailure(_0x50facd,'missing_jwt',_0x2bdada),_0x477fb0['code'](0x191)[_0xd50406(0x17a)]({'message':_0xd50406(0x188)});try{const _0x217392=_0x44d94d[_0xd50406(0x17d)](_0x3b5788,{'complete':!![]}),_0x12b087=_0x217392&&typeof _0x217392===_0xd50406(0x18d)&&_0x217392['header']?_0x217392[_0xd50406(0x16b)][_0xd50406(0x186)]:undefined,_0x236f2a=_0x44d94d['verify'](_0x3b5788,getSecretForKid(_0x12b087),{'algorithms':['HS256'],'issuer':_0xd50406(0x166),'audience':'web-to-figma-desktop'});_0x2bdada['desktopJwtSub']=_0x236f2a[_0xd50406(0x180)],logAuthSuccess(_0x50facd,_0x2bdada);}catch(_0x5b1e65){return logAuthFailure(_0x50facd,'invalid_jwt',_0x2bdada,_0x5b1e65),_0x477fb0[_0xd50406(0x167)](0x191)[_0xd50406(0x17a)]({'message':'Unauthorized'});}});}
@@ -85,15 +85,15 @@ export function formatServerBanner(options) {
85
85
  ];
86
86
  if (updateAvailable) {
87
87
  const updateTitle = [
88
- c(ANSI.bold + ANSI.brightYellow, '⬆', color),
88
+ brand('⬆', color, true),
89
89
  ' ',
90
- c(ANSI.bold + ANSI.brightYellow, 'Update available:', color),
90
+ brand('Update available:', color, true),
91
91
  ' ',
92
92
  c(ANSI.bold + ANSI.brightGreen, `v${updateAvailable.latest}`, color),
93
93
  ].join('');
94
94
  const updateAction = [
95
95
  c(ANSI.dim + ANSI.gray, 'Press ', color),
96
- c(ANSI.bold + ANSI.brightYellow, updateKey, color),
96
+ brand(updateKey, color, true),
97
97
  c(ANSI.dim + ANSI.gray, ' to update now', color),
98
98
  ].join('');
99
99
  lines.push(emptyRow(color));
@@ -1,7 +1,5 @@
1
- import { execFile, execFileSync, spawn } from 'node:child_process';
2
- import { promisify } from 'node:util';
1
+ import { execFileSync, spawn } from 'node:child_process';
3
2
  import path from 'node:path';
4
- const execFileAsync = promisify(execFile);
5
3
  export function isGloballyInstalled() {
6
4
  try {
7
5
  const scriptPath = process.argv[1];
@@ -36,26 +34,4 @@ export async function installUpdate(latestVersion, verbose) {
36
34
  }
37
35
  });
38
36
  });
39
- respawnFromGlobalBin();
40
- }
41
- function respawnFromGlobalBin() {
42
- const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
43
- let binPath = 'web-to-figma';
44
- try {
45
- const resolved = execFileSync(npmCmd, ['bin', '-g', 'web-to-figma'], { encoding: 'utf8' }).trim();
46
- if (resolved) {
47
- binPath = resolved;
48
- }
49
- }
50
- catch {
51
- // fall back to PATH lookup
52
- }
53
- const args = process.argv.slice(2);
54
- const child = spawn(binPath, args.length > 0 ? args : ['start'], {
55
- stdio: 'inherit',
56
- detached: true,
57
- shell: process.platform === 'win32',
58
- });
59
- child.unref();
60
- process.exit(0);
61
37
  }
@@ -6,6 +6,7 @@ export type UpdaterOptions = {
6
6
  paths: ResolvedPaths;
7
7
  verbose: boolean;
8
8
  isCaptureBusy: () => boolean;
9
+ shutdown: () => Promise<void>;
9
10
  };
10
11
  export declare class UpdaterRuntime {
11
12
  private readonly options;
@@ -1,9 +1,9 @@
1
1
  import readline from 'node:readline';
2
- import os from 'node:os';
3
2
  import { formatServerBanner } from '../terminal/banner.js';
4
3
  import { CHECK_INTERVAL_MS, checkForUpdate } from './versionCheck.js';
5
4
  import { installUpdate, isGloballyInstalled } from './installer.js';
6
5
  import { appendUpdateLog } from './updateLog.js';
6
+ const UPDATE_KEY = 'Ctrl+U';
7
7
  export class UpdaterRuntime {
8
8
  options;
9
9
  updateAvailable = null;
@@ -43,12 +43,11 @@ export class UpdaterRuntime {
43
43
  }
44
44
  printBanner() {
45
45
  const { currentVersion, port } = this.options;
46
- const updateKey = os.platform() === 'darwin' ? 'Cmd+U' : 'Ctrl+U';
47
46
  console.log(formatServerBanner({
48
47
  currentVersion,
49
48
  port,
50
49
  updateAvailable: this.updateAvailable,
51
- updateKey,
50
+ updateKey: UPDATE_KEY,
52
51
  showNpxUpdateHint: !isGloballyInstalled(),
53
52
  }));
54
53
  }
@@ -114,7 +113,16 @@ export class UpdaterRuntime {
114
113
  await installUpdate(latest, this.options.verbose);
115
114
  appendUpdateLog(this.options.paths, { event: 'update_completed', from, to: latest });
116
115
  console.log(`Updated to v${latest} successfully.`);
117
- console.log('Restarting...');
116
+ console.log('');
117
+ console.log('Restart the desktop server to run the new version:');
118
+ if (isGloballyInstalled()) {
119
+ console.log(' web-to-figma start');
120
+ }
121
+ else {
122
+ console.log(' npx @web-to-figma/desktop@latest start');
123
+ }
124
+ console.log('');
125
+ await this.options.shutdown();
118
126
  }
119
127
  catch (err) {
120
128
  const error = err instanceof Error ? err.message : 'Unknown error';
@@ -142,11 +150,10 @@ export class UpdaterRuntime {
142
150
  }
143
151
  }
144
152
  export function printUnsupportedVersionMessage(currentVersion, minSupportedVersion) {
145
- const updateKey = os.platform() === 'darwin' ? 'Cmd+U' : 'Ctrl+U';
146
153
  console.error('');
147
154
  console.error('This version is no longer supported.');
148
155
  console.error(`Installed: v${currentVersion} Minimum: v${minSupportedVersion}`);
149
- console.error(`Press ${updateKey} to update, or run:`);
156
+ console.error(`Press ${UPDATE_KEY} to update, or run:`);
150
157
  console.error(' npm install -g @web-to-figma/desktop@latest');
151
158
  console.error('Web to Figma will not run until updated.');
152
159
  console.error('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-to-figma/desktop",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Web to Figma Desktop - Convert any website or HTML code to design",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",