@unotest/viewer 0.31.0 → 0.32.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.
@@ -1,3 +1,5 @@
1
+ import { BoxReadEnvironment } from '@unotest/protocol';
2
+
1
3
  /** What the current viewer session is allowed to do, as told by whoever
2
4
  * fronts the viewer (today: the unotest guard proxy).
3
5
  *
@@ -44,17 +46,12 @@ interface ViewerIdentity {
44
46
  /** One place the fronting proxy can route a session to. Display only,
45
47
  * like {@link ViewerIdentity}: the viewer groups by `project`, shows
46
48
  * `environment` and `note`, and sends `name` back — never derives one
47
- * from another. */
48
- interface ViewerEnvOption {
49
- /** What {@link ViewerIdentity.switchEnvUrl} accepts. */
50
- readonly name: string;
51
- /** Grouping axis. Absent when the proxy has no such notion — the
52
- * switcher then offers environments alone. */
53
- readonly project?: string;
54
- readonly environment: string;
55
- /** What that environment is serving right now (a bundle label). */
56
- readonly note?: string;
57
- }
49
+ * from another.
50
+ *
51
+ * The same list the guard serves to a bearer client asking which
52
+ * environments it may read, so the shape lives in the protocol and this
53
+ * is the viewer's name for it — one definition, not two that drift. */
54
+ type ViewerEnvOption = BoxReadEnvironment;
58
55
  interface ViewerSession {
59
56
  readonly capabilities: ViewerCapabilities;
60
57
  /** null when nothing fronts the viewer — plain localhost usage. */
@@ -1 +1 @@
1
- const _0x3774c0=_0x7b19;(function(_0x18fa57,_0x4b73ef){const _0xb2ca0d={_0x481643:0x1c8,_0x333cca:0x1b8,_0x247929:0x1b4},_0x5668c6=_0x7b19,_0x22c1e0=_0x18fa57();while(!![]){try{const _0x3dcff0=-parseInt(_0x5668c6(_0xb2ca0d._0x481643))/0x1+parseInt(_0x5668c6(0x1cb))/0x2*(-parseInt(_0x5668c6(_0xb2ca0d._0x333cca))/0x3)+parseInt(_0x5668c6(0x1cc))/0x4*(parseInt(_0x5668c6(0x1c7))/0x5)+parseInt(_0x5668c6(0x1bb))/0x6+parseInt(_0x5668c6(_0xb2ca0d._0x247929))/0x7+parseInt(_0x5668c6(0x1c4))/0x8+parseInt(_0x5668c6(0x1b3))/0x9;if(_0x3dcff0===_0x4b73ef)break;else _0x22c1e0['push'](_0x22c1e0['shift']());}catch(_0x434f65){_0x22c1e0['push'](_0x22c1e0['shift']());}}}(_0x1112,0xd8502));var __defProp=Object['defineProperty'],__name=(_0x2c6b5f,_0x26a9dd)=>__defProp(_0x2c6b5f,_0x3774c0(0x1b9),{'value':_0x26a9dd,'configurable':!![]}),FULL_CAPABILITIES={'canRun':!![],'canEditFiles':!![],'canTerminal':!![],'canBrowseFs':!![]},STANDALONE_SESSION={'capabilities':FULL_CAPABILITIES,'identity':null},VIEWER_SESSION_HEADER=_0x3774c0(0x1b5);function encodeViewerSession(_0x1ae3b5){const _0x549b9d={_0x2c4e78:0x1ba},_0x4cae5e=_0x3774c0;return Buffer[_0x4cae5e(0x1cd)](JSON['stringify'](_0x1ae3b5),_0x4cae5e(_0x549b9d._0x2c4e78))[_0x4cae5e(0x1b7)](_0x4cae5e(0x1c2));}__name(encodeViewerSession,_0x3774c0(0x1b6));function _0x7b19(_0x438b05,_0x35a66d){_0x438b05=_0x438b05-0x1b3;const _0x1112b8=_0x1112();let _0x7b191a=_0x1112b8[_0x438b05];if(_0x7b19['xMEVTj']===undefined){var _0x9160b6=function(_0x34f9ac){const _0x3681b6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2c6b5f='',_0x26a9dd='';for(let _0x1ae3b5=0x0,_0x19e7ae,_0x31c9d1,_0x42742a=0x0;_0x31c9d1=_0x34f9ac['charAt'](_0x42742a++);~_0x31c9d1&&(_0x19e7ae=_0x1ae3b5%0x4?_0x19e7ae*0x40+_0x31c9d1:_0x31c9d1,_0x1ae3b5++%0x4)?_0x2c6b5f+=String['fromCharCode'](0xff&_0x19e7ae>>(-0x2*_0x1ae3b5&0x6)):0x0){_0x31c9d1=_0x3681b6['indexOf'](_0x31c9d1);}for(let _0x39b795=0x0,_0x1cc533=_0x2c6b5f['length'];_0x39b795<_0x1cc533;_0x39b795++){_0x26a9dd+='%'+('00'+_0x2c6b5f['charCodeAt'](_0x39b795)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x26a9dd);};_0x7b19['AVNFXm']=_0x9160b6,_0x7b19['EaYFnl']={},_0x7b19['xMEVTj']=!![];}const _0x43733f=_0x1112b8[0x0],_0x2556c1=_0x438b05+_0x43733f,_0x1b2e9c=_0x7b19['EaYFnl'][_0x2556c1];return!_0x1b2e9c?(_0x7b191a=_0x7b19['AVNFXm'](_0x7b191a),_0x7b19['EaYFnl'][_0x2556c1]=_0x7b191a):_0x7b191a=_0x1b2e9c,_0x7b191a;}function decodeViewerSession(_0x19e7ae){const _0x3dd5b3={_0x5599ca:0x1be,_0x6c288b:0x1cd,_0x38443e:0x1c2,_0x71ba03:0x1ba},_0x50cd09=_0x3774c0;if(_0x19e7ae===void 0x0||_0x19e7ae==='')return null;let _0x31c9d1;try{_0x31c9d1=JSON[_0x50cd09(_0x3dd5b3._0x5599ca)](Buffer[_0x50cd09(_0x3dd5b3._0x6c288b)](_0x19e7ae,_0x50cd09(_0x3dd5b3._0x38443e))['toString'](_0x50cd09(_0x3dd5b3._0x71ba03)));}catch{return null;}if(typeof _0x31c9d1!==_0x50cd09(0x1cf)||_0x31c9d1===null)return null;const {capabilities:_0x42742a,identity:_0x39b795}=_0x31c9d1,_0x1cc533=readCapabilities(_0x42742a);if(_0x1cc533===null)return null;return{'capabilities':_0x1cc533,'identity':readIdentity(_0x39b795)};}__name(decodeViewerSession,_0x3774c0(0x1c6));function _0x1112(){const _0x4a8066=['Bg9NB3v0vxjS','C3rYAw5N','CMvHzeLKzw50Axr5','yMfZzty0DxjS','y2fUrwrPDezPBgvZ','nZiZnZmYoeHjugT3tG','y2fUvgvYBwLUywW','zgvJB2rLvMLLD2vYu2vZC2LVBG','mte0nwvKDgfVqG','mty0nJC4nvzivNfyva','C3DPDgnOrw52vxjS','zMXHzW','ntu1nJy2rLb1vK1L','mtqZmJHJy0H2qvC','zNjVBq','CMvHzenHCgfIAwXPDgLLCW','B2jQzwn0','mtm3otyYmJzntxbnEM0','mtu3nde2vxbPt05K','Ec11BM90zxn0lxzPzxDLCI1ZzxnZAw9U','zw5JB2rLvMLLD2vYu2vZC2LVBG','Dg9tDhjPBMC','ouHKDhLHtW','BMfTzq','DxrMoa','nte1nZm2Avr0re5z','zw52AxjVBM1LBNrZvxjS','zw52','CgfYC2u'];_0x1112=function(){return _0x4a8066;};return _0x1112();}function readCapabilities(_0x4349eb){const _0x3b301f={_0x1eb1a4:0x1c5},_0xe4c485=_0x3774c0;if(typeof _0x4349eb!==_0xe4c485(0x1cf)||_0x4349eb===null)return null;const _0xdb540f=_0x4349eb,_0x585dad=__name(_0x2c4ce8=>_0xdb540f[_0x2c4ce8]===!![],_0xe4c485(0x1ca));return{'canRun':_0x585dad('canRun'),'canEditFiles':_0x585dad(_0xe4c485(0x1c3)),'canTerminal':_0x585dad(_0xe4c485(_0x3b301f._0x1eb1a4)),'canBrowseFs':_0x585dad('canBrowseFs')};}__name(readCapabilities,_0x3774c0(0x1ce));function readIdentity(_0x54dac5){const _0x17d954={_0x472f89:0x1cf,_0x3a491b:0x1bd,_0x6243c5:0x1bf},_0x5b1dbf=_0x3774c0;if(typeof _0x54dac5!==_0x5b1dbf(_0x17d954._0x472f89)||_0x54dac5===null)return null;const _0x4085ad=_0x54dac5,{user:_0x29ef6e,role:_0xefccc9}=_0x4085ad;if(typeof _0x29ef6e!=='string'||typeof _0xefccc9!=='string')return null;return{'user':_0x29ef6e,'role':_0xefccc9,...optionalString(_0x4085ad,_0x5b1dbf(_0x17d954._0x3a491b)),...optionalString(_0x4085ad,_0x5b1dbf(_0x17d954._0x6243c5)),...optionalString(_0x4085ad,_0x5b1dbf(0x1bc)),...optionalString(_0x4085ad,_0x5b1dbf(0x1c9))};}__name(readIdentity,_0x3774c0(0x1c1));function optionalString(_0x426af5,_0x7d49d0){const _0x584b4b=_0x3774c0,_0x2a1122=_0x426af5[_0x7d49d0];return typeof _0x2a1122===_0x584b4b(0x1c0)?{[_0x7d49d0]:_0x2a1122}:{};}__name(optionalString,'optionalString');export{FULL_CAPABILITIES,STANDALONE_SESSION,VIEWER_SESSION_HEADER,decodeViewerSession,encodeViewerSession};
1
+ const _0x54f390=_0x3438;(function(_0x2e7116,_0xf9f171){const _0x288a59={_0x257f98:0xee,_0x4238bd:0xf6,_0x418e5f:0xe9},_0x5131c6=_0x3438,_0xad4919=_0x2e7116();while(!![]){try{const _0x115f61=-parseInt(_0x5131c6(0xea))/0x1*(-parseInt(_0x5131c6(0xdf))/0x2)+-parseInt(_0x5131c6(0xde))/0x3*(-parseInt(_0x5131c6(_0x288a59._0x257f98))/0x4)+parseInt(_0x5131c6(0xf8))/0x5+-parseInt(_0x5131c6(0xfa))/0x6*(-parseInt(_0x5131c6(_0x288a59._0x4238bd))/0x7)+-parseInt(_0x5131c6(0xf7))/0x8+-parseInt(_0x5131c6(0xf3))/0x9*(-parseInt(_0x5131c6(_0x288a59._0x418e5f))/0xa)+-parseInt(_0x5131c6(0xe6))/0xb;if(_0x115f61===_0xf9f171)break;else _0xad4919['push'](_0xad4919['shift']());}catch(_0x581d8e){_0xad4919['push'](_0xad4919['shift']());}}}(_0x6e20,0xa11e8));var __defProp=Object[_0x54f390(0xec)],__name=(_0x41ed3c,_0x202808)=>__defProp(_0x41ed3c,_0x54f390(0xe8),{'value':_0x202808,'configurable':!![]}),FULL_CAPABILITIES={'canRun':!![],'canEditFiles':!![],'canTerminal':!![],'canBrowseFs':!![]},STANDALONE_SESSION={'capabilities':FULL_CAPABILITIES,'identity':null},VIEWER_SESSION_HEADER='x-unotest-viewer-session';function _0x6e20(){const _0x4461ce=['mJaZnJiYwuL4yLDb','ndzPvhrfqwe','CMvHzenHCgfIAwXPDgLLCW','zNjVBq','zw5JB2rLvMLLD2vYu2vZC2LVBG','Dg9tDhjPBMC','C3rYAw5NAwz5','y2fUvgvYBwLUywW','mZe1otq4mdvbC09XzNm','C3rYAw5N','BMfTzq','mtC3nteXmezLvhrQzW','mZm5nKXPz3PqCW','C3DPDgnOrw52vxjS','zgvMAw5LuhjVCgvYDhK','zw52','nZjHDhf6DMS','Bg9NB3v0vxjS','y2fUuNvU','DxrMoa','y2fUrwrPDezPBgvZ','ndvxs0jcBNK','CgfYC2u','B2jQzwn0','otiYoty1nhnZvuTVwq','ntq5mte2oefkA2z5vW','mZu2mZm5mhfVve9ArW','yMfZzty0DxjS','nNPez1fcEG'];_0x6e20=function(){return _0x4461ce;};return _0x6e20();}function encodeViewerSession(_0x388f19){const _0xc5b776={_0x41cc98:0xe4,_0x5ce523:0xf9},_0x4f5826=_0x54f390;return Buffer['from'](JSON[_0x4f5826(_0xc5b776._0x41cc98)](_0x388f19),_0x4f5826(0xf1))[_0x4f5826(0xe3)](_0x4f5826(_0xc5b776._0x5ce523));}__name(encodeViewerSession,_0x54f390(0xe2));function decodeViewerSession(_0x742e00){const _0x12128e={_0x412c65:0xf4,_0x40c2dc:0xe3,_0x2e7018:0xf5},_0x227ba3=_0x54f390;if(_0x742e00===void 0x0||_0x742e00==='')return null;let _0x3d6b39;try{_0x3d6b39=JSON[_0x227ba3(_0x12128e._0x412c65)](Buffer[_0x227ba3(0xe1)](_0x742e00,_0x227ba3(0xf9))[_0x227ba3(_0x12128e._0x40c2dc)]('utf8'));}catch{return null;}if(typeof _0x3d6b39!==_0x227ba3(_0x12128e._0x2e7018)||_0x3d6b39===null)return null;const {capabilities:_0x22a485,identity:_0x1fa680}=_0x3d6b39,_0xbb5892=readCapabilities(_0x22a485);if(_0xbb5892===null)return null;return{'capabilities':_0xbb5892,'identity':readIdentity(_0x1fa680)};}__name(decodeViewerSession,'decodeViewerSession');function _0x3438(_0x1aff23,_0x5505c8){_0x1aff23=_0x1aff23-0xde;const _0x6e20d2=_0x6e20();let _0x343802=_0x6e20d2[_0x1aff23];if(_0x3438['xwyscC']===undefined){var _0x380dfb=function(_0x2409b4){const _0x7d4dbb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x41ed3c='',_0x202808='';for(let _0x388f19=0x0,_0x742e00,_0x3d6b39,_0x22a485=0x0;_0x3d6b39=_0x2409b4['charAt'](_0x22a485++);~_0x3d6b39&&(_0x742e00=_0x388f19%0x4?_0x742e00*0x40+_0x3d6b39:_0x3d6b39,_0x388f19++%0x4)?_0x41ed3c+=String['fromCharCode'](0xff&_0x742e00>>(-0x2*_0x388f19&0x6)):0x0){_0x3d6b39=_0x7d4dbb['indexOf'](_0x3d6b39);}for(let _0x1fa680=0x0,_0xbb5892=_0x41ed3c['length'];_0x1fa680<_0xbb5892;_0x1fa680++){_0x202808+='%'+('00'+_0x41ed3c['charCodeAt'](_0x1fa680)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x202808);};_0x3438['lUGEnn']=_0x380dfb,_0x3438['xaMRmr']={},_0x3438['xwyscC']=!![];}const _0x5c3979=_0x6e20d2[0x0],_0x5f0a5f=_0x1aff23+_0x5c3979,_0x3048ff=_0x3438['xaMRmr'][_0x5f0a5f];return!_0x3048ff?(_0x343802=_0x3438['lUGEnn'](_0x343802),_0x3438['xaMRmr'][_0x5f0a5f]=_0x343802):_0x343802=_0x3048ff,_0x343802;}function readCapabilities(_0x48d038){const _0x41ba5f={_0x24e2de:0xf0,_0x3e034a:0xf2,_0x7e519c:0xe5},_0x48dee6=_0x54f390;if(typeof _0x48d038!=='object'||_0x48d038===null)return null;const _0x4523b9=_0x48d038,_0xf37448=__name(_0x1423df=>_0x4523b9[_0x1423df]===!![],'flag');return{'canRun':_0xf37448(_0x48dee6(_0x41ba5f._0x24e2de)),'canEditFiles':_0xf37448(_0x48dee6(_0x41ba5f._0x3e034a)),'canTerminal':_0xf37448(_0x48dee6(_0x41ba5f._0x7e519c)),'canBrowseFs':_0xf37448('canBrowseFs')};}__name(readCapabilities,_0x54f390(0xe0));function readIdentity(_0x19ee00){const _0x4dfa76={_0x44266b:0xe7,_0x5e86bb:0xed,_0x1531db:0xeb},_0x303410=_0x54f390;if(typeof _0x19ee00!=='object'||_0x19ee00===null)return null;const _0x13221c=_0x19ee00,{user:_0x3f3ea3,role:_0x143c37}=_0x13221c;if(typeof _0x3f3ea3!==_0x303410(0xe7)||typeof _0x143c37!==_0x303410(_0x4dfa76._0x44266b))return null;return{'user':_0x3f3ea3,'role':_0x143c37,...optionalString(_0x13221c,_0x303410(_0x4dfa76._0x5e86bb)),...optionalString(_0x13221c,_0x303410(0xef)),...optionalString(_0x13221c,'environmentsUrl'),...optionalString(_0x13221c,_0x303410(_0x4dfa76._0x1531db))};}__name(readIdentity,'readIdentity');function optionalString(_0x2f2da5,_0xef8198){const _0x260e27=_0x54f390,_0x488f19=_0x2f2da5[_0xef8198];return typeof _0x488f19===_0x260e27(0xe7)?{[_0xef8198]:_0x488f19}:{};}__name(optionalString,'optionalString');export{FULL_CAPABILITIES,STANDALONE_SESSION,VIEWER_SESSION_HEADER,decodeViewerSession,encodeViewerSession};
@@ -0,0 +1,8 @@
1
+ /** Raised for a file that is not a readable archive at all. */
2
+ declare class SnapshotZipError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ /** Every entry in the archive: zip path → bytes. */
6
+ declare function readSnapshotEntries(bytes: Uint8Array): Record<string, Uint8Array>;
7
+
8
+ export { SnapshotZipError, readSnapshotEntries };
@@ -0,0 +1 @@
1
+ var _0x1ee50f=_0xb2b0;(function(_0x48995b,_0xc99b84){var _0x4b8a7d={_0x2b723d:0xcb,_0x5ec258:0xbd,_0x4fe384:0xc9,_0x11e612:0xc5},_0x55d6fa=_0xb2b0,_0x44d6f4=_0x48995b();while(!![]){try{var _0x4da5b6=-parseInt(_0x55d6fa(0xc1))/0x1*(parseInt(_0x55d6fa(0xca))/0x2)+parseInt(_0x55d6fa(0xc2))/0x3*(parseInt(_0x55d6fa(0xbe))/0x4)+parseInt(_0x55d6fa(0xc0))/0x5*(parseInt(_0x55d6fa(_0x4b8a7d._0x2b723d))/0x6)+parseInt(_0x55d6fa(_0x4b8a7d._0x5ec258))/0x7*(parseInt(_0x55d6fa(0xc6))/0x8)+parseInt(_0x55d6fa(0xc8))/0x9+parseInt(_0x55d6fa(0xc7))/0xa+parseInt(_0x55d6fa(_0x4b8a7d._0x4fe384))/0xb*(-parseInt(_0x55d6fa(_0x4b8a7d._0x11e612))/0xc);if(_0x4da5b6===_0xc99b84)break;else _0x44d6f4['push'](_0x44d6f4['shift']());}catch(_0x195cae){_0x44d6f4['push'](_0x44d6f4['shift']());}}}(_0x5083,0x69542));var __defProp=Object['defineProperty'],__name=(_0x437a14,_0x29e853)=>__defProp(_0x437a14,_0x1ee50f(0xbf),{'value':_0x29e853,'configurable':!![]});function _0xb2b0(_0x5142af,_0x373ec2){_0x5142af=_0x5142af-0xbd;var _0x508380=_0x5083();var _0xb2b095=_0x508380[_0x5142af];if(_0xb2b0['tSCINi']===undefined){var _0x90da8c=function(_0x4af54e){var _0x3ff9f4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x437a14='',_0x29e853='';for(var _0x4b9646=0x0,_0x3b7d92,_0x23200d,_0xcb4ee7=0x0;_0x23200d=_0x4af54e['charAt'](_0xcb4ee7++);~_0x23200d&&(_0x3b7d92=_0x4b9646%0x4?_0x3b7d92*0x40+_0x23200d:_0x23200d,_0x4b9646++%0x4)?_0x437a14+=String['fromCharCode'](0xff&_0x3b7d92>>(-0x2*_0x4b9646&0x6)):0x0){_0x23200d=_0x3ff9f4['indexOf'](_0x23200d);}for(var _0x3ac871=0x0,_0x3a7115=_0x437a14['length'];_0x3ac871<_0x3a7115;_0x3ac871++){_0x29e853+='%'+('00'+_0x437a14['charCodeAt'](_0x3ac871)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x29e853);};_0xb2b0['MRNMgG']=_0x90da8c,_0xb2b0['iPQTBY']={},_0xb2b0['tSCINi']=!![];}var _0x22a860=_0x508380[0x0],_0x3fcfe9=_0x5142af+_0x22a860,_0x172cdb=_0xb2b0['iPQTBY'][_0x3fcfe9];return!_0x172cdb?(_0xb2b095=_0xb2b0['MRNMgG'](_0xb2b095),_0xb2b0['iPQTBY'][_0x3fcfe9]=_0xb2b095):_0xb2b095=_0x172cdb,_0xb2b095;}import{unzipSync}from'fflate';function _0x5083(){var _0x382e1a=['otCZEvHmEhvN','odaZmte2DxfvBM1b','BMfTzq','otCZmde1BwTjBuDs','m3Phyw9LEq','m3jjvhHIBW','CMvHzfnUyxbZAg90rw50CMLLCW','u25HChnOB3rAAxbfCNjVCG','mtm0otC3mNH4s1rHCG','mtyYnJrPuMfNqNm','nta1odmYmeDbtw1XBG','mtK2mZiZm0Lht1bhrW','mZn6D3fIt2O','ndiYmdq2AufsD1HP','nLDLrLLpCW'];_0x5083=function(){return _0x382e1a;};return _0x5083();}var SnapshotZipError=class extends Error{static{__name(this,'SnapshotZipError');}constructor(_0x4b9646){var _0x3f9be7={_0x1d5947:0xbf,_0xcd0941:0xc4},_0x288aa1=_0x1ee50f;super(_0x4b9646),this[_0x288aa1(_0x3f9be7._0x1d5947)]=_0x288aa1(_0x3f9be7._0xcd0941);}};function readSnapshotEntries(_0x3b7d92){try{return unzipSync(_0x3b7d92);}catch{throw new SnapshotZipError('not\x20a\x20valid\x20.zip\x20(corrupted\x20or\x20wrong\x20file)');}}__name(readSnapshotEntries,_0x1ee50f(0xc3));export{SnapshotZipError,readSnapshotEntries};
@@ -0,0 +1,141 @@
1
+ import { RunMeta, CollectionRunArtifact, RunArtifact, RunSources, QueueSnapshot } from '@unotest/protocol';
2
+
3
+ /** Full snapshot of one run-dir. The event stream is discriminated so the
4
+ * consumer can render per-kind UI without sniffing array contents —
5
+ * `meta.kind` and the union match. Scenario and collection events never
6
+ * mix in a single dir. */
7
+ type RunFullSnapshot = ScenarioRunFullSnapshot | CollectionRunFullSnapshot;
8
+ interface ScenarioRunFullSnapshot {
9
+ meta: RunMeta & {
10
+ kind: "scenario";
11
+ };
12
+ events: RunArtifact[];
13
+ /** Snapshot of the executed sources (entry + helpers) captured at run
14
+ * start. The view renders the overlay against this, never re-reading
15
+ * the on-disk file. `null` for old runs predating the snapshot. */
16
+ sources: RunSources | null;
17
+ }
18
+ interface CollectionRunFullSnapshot {
19
+ meta: RunMeta & {
20
+ kind: "collection";
21
+ };
22
+ events: CollectionRunArtifact[];
23
+ }
24
+
25
+ /** Wire shape of `GET /api/runs`. Lives in `shared/` because it is a
26
+ * contract, not an implementation detail: the controller returns it and
27
+ * the browser store consumes it, and the two drifting apart is exactly
28
+ * the failure this file prevents.
29
+ *
30
+ * History is paged. It used to be "every run there has ever been" in one
31
+ * response, which is the wall the whole runs-history work exists to
32
+ * remove — see `docs/plans/runs-history-scale.md`. */
33
+
34
+ interface RunPage {
35
+ /** Newest first. */
36
+ runs: RunMeta[];
37
+ /** The walk reached the end of retained history, not merely the end of
38
+ * this page. The UI needs the difference to decide whether offering
39
+ * "load more" would be a lie. */
40
+ exhausted: boolean;
41
+ }
42
+ interface RunsListResponse extends RunPage {
43
+ /** False while the background index rebuild is still catching up. The
44
+ * UI says "history is still loading" instead of showing an empty list
45
+ * that looks like "you have no runs". */
46
+ indexReady: boolean;
47
+ }
48
+ interface RunsQuery {
49
+ limit?: number;
50
+ /** Runs started strictly before this timestamp. A cursor rather than an
51
+ * offset: a run finishing mid-scroll cannot shift the page under the
52
+ * reader. */
53
+ before?: number;
54
+ /** Restrict to one scenario, served from that scenario's own index. */
55
+ scenario?: string;
56
+ }
57
+
58
+ interface QueuePayload extends QueueSnapshot {
59
+ /** False when the project turned queueing off (`queue.enabled: false`
60
+ * or `UNOTEST_NO_QUEUE=1`). The UI says so rather than showing an
61
+ * empty queue that will never fill — with queueing off, every
62
+ * producer starts immediately and nothing serialises them. */
63
+ enabled: boolean;
64
+ }
65
+
66
+ /** Bump when the manifest shape changes incompatibly. The importer refuses an
67
+ * unknown major and shows a clear message instead of crashing. */
68
+ declare const SNAPSHOT_FORMAT = "unotest-snapshot@1";
69
+ /** Git identity of the capturing machine (no auth in the product — provenance
70
+ * comes from `git config` at export time). Any field may be "" when the
71
+ * project isn't a git repo. */
72
+ interface SnapshotGit {
73
+ author: string;
74
+ email: string;
75
+ branch: string;
76
+ commit: string;
77
+ }
78
+ interface SnapshotManifest {
79
+ format: string;
80
+ /** The originating run's id — metadata only; never collides with a local
81
+ * run because snapshot tabs are keyed by a generated snapshotId. */
82
+ runId: string;
83
+ /** Scenario ref (e.g. `test/open-first-car-card`). */
84
+ scenario: string;
85
+ /** Run outcome: passed | failed | aborted | … (verbatim from run meta). */
86
+ status: string;
87
+ /** ISO timestamp the bundle was exported. */
88
+ capturedAt: string;
89
+ git: SnapshotGit;
90
+ /** Test target the run belongs to (`web` / `mobile` / …) + artifact suffix. */
91
+ target: string;
92
+ suffix: string;
93
+ /** Logical inspector asset path → file path inside the zip. The single
94
+ * source of truth for what the bundle contains; a missing key = that pane
95
+ * shows its empty state. */
96
+ files: Record<string, string>;
97
+ /** Zip paths of the run's step screenshots, which have no logical key:
98
+ * there is one per capture, named by sequence, and a reader wants them
99
+ * in order rather than by name.
100
+ *
101
+ * Listed here for the same reason {@link files} exists — an importer
102
+ * keeps what the manifest declares and drops everything else, so a
103
+ * frame absent from this list is a frame that does not survive the
104
+ * round trip. Absent on bundles exported before the list existed. */
105
+ screenshots?: readonly string[];
106
+ }
107
+ /** Every zip path this manifest vouches for. The one place that knows a
108
+ * bundle's contents are `files` PLUS `screenshots` — importers walk this
109
+ * instead of each remembering both halves. */
110
+ declare function declaredZipPaths(manifest: SnapshotManifest): string[];
111
+ /** A stored snapshot as the viewer lists it: the locally-assigned id + its
112
+ * manifest. Returned by `GET /api/snapshots` and `POST /api/snapshots/import`. */
113
+ interface SnapshotListEntry {
114
+ snapshotId: string;
115
+ manifest: SnapshotManifest;
116
+ }
117
+ /** The logical asset keys the inspector asks a data source for. Kept as
118
+ * constants so server (export) and client (import + `BundleDataSource`) agree
119
+ * without magic strings. */
120
+ declare const SNAPSHOT_ASSETS: {
121
+ readonly steps: "steps.jsonl";
122
+ readonly runtime: "runtime.json";
123
+ readonly sources: "sources.json";
124
+ readonly failure: "failure.json";
125
+ readonly console: "console.json";
126
+ readonly network: "network.json";
127
+ readonly domSnapshot: "snapshot.json";
128
+ readonly outline: "outline.txt";
129
+ readonly screenshot: "screenshot.png";
130
+ /** The failing page's DOM as captured, next to the outline. */
131
+ readonly page: "page.html";
132
+ readonly stdout: "stdout.log";
133
+ readonly stderr: "stderr.log";
134
+ };
135
+ /** Bundle filename from a scenario ref + runId. Sanitises `/` and other
136
+ * path-hostile characters so the download name is safe on every OS. */
137
+ declare function snapshotFileName(scenario: string, runId: string): string;
138
+ /** True when this viewer understands the bundle's format. */
139
+ declare function isSupportedSnapshotFormat(format: string): boolean;
140
+
141
+ export { type CollectionRunFullSnapshot, type QueuePayload, type RunFullSnapshot, type RunPage, type RunsListResponse, type RunsQuery, SNAPSHOT_ASSETS, SNAPSHOT_FORMAT, type ScenarioRunFullSnapshot, type SnapshotGit, type SnapshotListEntry, type SnapshotManifest, declaredZipPaths, isSupportedSnapshotFormat, snapshotFileName };
@@ -0,0 +1 @@
1
+ var _0x459c38=_0x47e1;(function(_0x2a3f3c,_0x503e50){var _0x38a464={_0xd58a0c:0x191,_0x39dc6e:0x1a0,_0x21d1d3:0x19e,_0x327374:0x1a6},_0x5d8d85=_0x47e1,_0x1599a4=_0x2a3f3c();while(!![]){try{var _0x1a7274=parseInt(_0x5d8d85(_0x38a464._0xd58a0c))/0x1+-parseInt(_0x5d8d85(_0x38a464._0x39dc6e))/0x2+parseInt(_0x5d8d85(_0x38a464._0x21d1d3))/0x3*(parseInt(_0x5d8d85(0x1a7))/0x4)+-parseInt(_0x5d8d85(_0x38a464._0x327374))/0x5+-parseInt(_0x5d8d85(0x1a8))/0x6+parseInt(_0x5d8d85(0x195))/0x7*(parseInt(_0x5d8d85(0x199))/0x8)+parseInt(_0x5d8d85(0x1a4))/0x9;if(_0x1a7274===_0x503e50)break;else _0x1599a4['push'](_0x1599a4['shift']());}catch(_0x591b8c){_0x1599a4['push'](_0x1599a4['shift']());}}}(_0x3287,0xee27b));var __defProp=Object[_0x459c38(0x1a5)],__name=(_0x335262,_0x6f76e5)=>__defProp(_0x335262,_0x459c38(0x19c),{'value':_0x6f76e5,'configurable':!![]}),SNAPSHOT_FORMAT='unotest-snapshot@1';function _0x3287(){var _0x37f135=['zMfPBhvYzs5QC29U','mta3oti2m05HAK5Rwa','C25HChnOB3qUANnVBG','C2nYzwvUC2HVDhm','C3rKzxjYlMXVzW','mJe5nJa0vNnPEfH2','AxntDxbWB3j0zwrtBMfWC2HVDezVCM1HDa','C25HChnOB3q','CgfNzs5ODg1S','mtzACuLRCLe','C3rLChmUANnVBMW','C2fMzq','BMfTzq','C25HChnOB3rgAwXLtMfTzq','mtyZmJiXovbzBgP2ua','y29UC29Szs5QC29U','mJC3nty1nNPxrxjcrG','BMv0D29YAY5QC29U','zgvJBgfYzwrAAxbqyxrOCW','CMvWBgfJzq','mtGXnZuZmtfsDfvnu1K','zgvMAw5LuhjVCgvYDhK','mZa0nZi4mgPqsNrvra','mtjHuvjfDeC','mta5mJu2mJHfy3Hrt2K','C291CMnLCY5QC29U','B3v0BgLUzs50Ehq'];_0x3287=function(){return _0x37f135;};return _0x3287();}function declaredZipPaths(_0x44bd25){var _0x4a67dc={_0x47b432:0x193},_0x18252f=_0x459c38;return[...Object['values'](_0x44bd25['files']??{}),..._0x44bd25[_0x18252f(_0x4a67dc._0x47b432)]??[]];}function _0x47e1(_0x1d36c6,_0x341e79){_0x1d36c6=_0x1d36c6-0x18e;var _0x3287fc=_0x3287();var _0x47e188=_0x3287fc[_0x1d36c6];if(_0x47e1['KxWBEj']===undefined){var _0x3a6819=function(_0x146713){var _0xca5b46='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x335262='',_0x6f76e5='';for(var _0x44bd25=0x0,_0x479f7a,_0x2a1043,_0x2eff9b=0x0;_0x2a1043=_0x146713['charAt'](_0x2eff9b++);~_0x2a1043&&(_0x479f7a=_0x44bd25%0x4?_0x479f7a*0x40+_0x2a1043:_0x2a1043,_0x44bd25++%0x4)?_0x335262+=String['fromCharCode'](0xff&_0x479f7a>>(-0x2*_0x44bd25&0x6)):0x0){_0x2a1043=_0xca5b46['indexOf'](_0x2a1043);}for(var _0x285a30=0x0,_0x5e7398=_0x335262['length'];_0x285a30<_0x5e7398;_0x285a30++){_0x6f76e5+='%'+('00'+_0x335262['charCodeAt'](_0x285a30)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6f76e5);};_0x47e1['UnMdgR']=_0x3a6819,_0x47e1['EbIkqG']={},_0x47e1['KxWBEj']=!![];}var _0x499706=_0x3287fc[0x0],_0x4beb6c=_0x1d36c6+_0x499706,_0x4f22bc=_0x47e1['EbIkqG'][_0x4beb6c];return!_0x4f22bc?(_0x47e188=_0x47e1['UnMdgR'](_0x47e188),_0x47e1['EbIkqG'][_0x4beb6c]=_0x47e188):_0x47e188=_0x4f22bc,_0x47e188;}__name(declaredZipPaths,_0x459c38(0x1a2));var SNAPSHOT_ASSETS={'steps':_0x459c38(0x19a),'runtime':'runtime.json','sources':_0x459c38(0x18e),'failure':_0x459c38(0x190),'console':_0x459c38(0x19f),'network':_0x459c38(0x1a1),'domSnapshot':_0x459c38(0x192),'outline':_0x459c38(0x18f),'screenshot':'screenshot.png','page':_0x459c38(0x198),'stdout':'stdout.log','stderr':_0x459c38(0x194)};function snapshotFileName(_0x479f7a,_0x2a1043){var _0x3863b4={_0x57b4a0:0x19b},_0x3ab185=_0x459c38;const _0x2eff9b=__name(_0x5036fd=>_0x5036fd[_0x3ab185(0x1a3)](/[^a-zA-Z0-9._-]+/g,'-')[_0x3ab185(0x1a3)](/^-+|-+$/g,''),_0x3ab185(_0x3863b4._0x57b4a0)),_0x285a30=_0x2eff9b(_0x479f7a),_0x5e7398=_0x2eff9b(_0x2a1043),_0x2cdb19=!_0x285a30||_0x5e7398['startsWith'](_0x285a30)?_0x5e7398:_0x285a30+'-'+_0x5e7398;return(_0x2cdb19||_0x3ab185(0x197))+'.unotest.zip';}__name(snapshotFileName,_0x459c38(0x19d));function isSupportedSnapshotFormat(_0x28dd75){return _0x28dd75===SNAPSHOT_FORMAT;}__name(isSupportedSnapshotFormat,_0x459c38(0x196));export{SNAPSHOT_ASSETS,SNAPSHOT_FORMAT,declaredZipPaths,isSupportedSnapshotFormat,snapshotFileName};