@unotest/viewer 0.32.0 → 0.33.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/CHANGELOG.md +258 -0
- package/dist/server/main.d.ts +21 -1
- package/dist/server/main.js +1 -1
- package/dist/server/session.d.ts +11 -2
- package/dist/server/session.js +1 -1
- package/dist/server/snapshot.js +1 -1
- package/dist/server/wire.js +1 -1
- package/dist/web/assets/{DslEditor-BB9-Z11q.js → DslEditor-BwlDSmCC.js} +2 -2
- package/dist/web/assets/index-GKCJW6UH.js +55 -0
- package/dist/web/index.html +1 -1
- package/package.json +7 -7
- package/dist/web/assets/index-CQ4nrsPU.js +0 -55
package/dist/server/session.d.ts
CHANGED
|
@@ -12,7 +12,13 @@ import { BoxReadEnvironment } from '@unotest/protocol';
|
|
|
12
12
|
*
|
|
13
13
|
* Capabilities are coarse and role-free on purpose. A proxy that invents
|
|
14
14
|
* new roles maps them onto these flags; the viewer never learns the word
|
|
15
|
-
* "admin" and needs no change when the role set grows (OCP).
|
|
15
|
+
* "admin" and needs no change when the role set grows (OCP).
|
|
16
|
+
*
|
|
17
|
+
* One more use, and the only one that touches data: a caller who may not
|
|
18
|
+
* edit variables is not shown credential-shaped values or the project's
|
|
19
|
+
* absolute path ({@link CREDENTIAL_NAME}). That is display-masking by
|
|
20
|
+
* capability, not authorization — the proxy still refuses every write,
|
|
21
|
+
* and a forged header can only hide more. */
|
|
16
22
|
interface ViewerCapabilities {
|
|
17
23
|
/** Start / abort runs, drive the debugger, control the app-under-test. */
|
|
18
24
|
readonly canRun: boolean;
|
|
@@ -74,5 +80,8 @@ declare function encodeViewerSession(session: ViewerSession): string;
|
|
|
74
80
|
* truncated, forged. The caller then falls back to standalone defaults:
|
|
75
81
|
* a broken header must not lock a local user out of their own viewer. */
|
|
76
82
|
declare function decodeViewerSession(raw: string | undefined): ViewerSession | null;
|
|
83
|
+
/** What the caller of this request may do: the proxy's word when it
|
|
84
|
+
* stamped one, everything when nothing fronts the viewer. */
|
|
85
|
+
declare function capabilitiesOf(raw: string | undefined): ViewerCapabilities;
|
|
77
86
|
|
|
78
|
-
export { FULL_CAPABILITIES, STANDALONE_SESSION, VIEWER_SESSION_HEADER, type ViewerCapabilities, type ViewerEnvOption, type ViewerIdentity, type ViewerSession, decodeViewerSession, encodeViewerSession };
|
|
87
|
+
export { FULL_CAPABILITIES, STANDALONE_SESSION, VIEWER_SESSION_HEADER, type ViewerCapabilities, type ViewerEnvOption, type ViewerIdentity, type ViewerSession, capabilitiesOf, decodeViewerSession, encodeViewerSession };
|
package/dist/server/session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x23116c=_0x5ebd;function _0x5ebd(_0x15ac29,_0xa8b31c){_0x15ac29=_0x15ac29-0x198;const _0x576d3a=_0x576d();let _0x5ebdfc=_0x576d3a[_0x15ac29];if(_0x5ebd['fxrOoM']===undefined){var _0x42bf16=function(_0x46c169){const _0x831250='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5d1e5a='',_0x38ce73='';for(let _0x404ac3=0x0,_0x1be4bf,_0x253ac2,_0x23258b=0x0;_0x253ac2=_0x46c169['charAt'](_0x23258b++);~_0x253ac2&&(_0x1be4bf=_0x404ac3%0x4?_0x1be4bf*0x40+_0x253ac2:_0x253ac2,_0x404ac3++%0x4)?_0x5d1e5a+=String['fromCharCode'](0xff&_0x1be4bf>>(-0x2*_0x404ac3&0x6)):0x0){_0x253ac2=_0x831250['indexOf'](_0x253ac2);}for(let _0x3cb501=0x0,_0xef5a7c=_0x5d1e5a['length'];_0x3cb501<_0xef5a7c;_0x3cb501++){_0x38ce73+='%'+('00'+_0x5d1e5a['charCodeAt'](_0x3cb501)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x38ce73);};_0x5ebd['IMCVDP']=_0x42bf16,_0x5ebd['zsaXft']={},_0x5ebd['fxrOoM']=!![];}const _0x3375ca=_0x576d3a[0x0],_0x328b1f=_0x15ac29+_0x3375ca,_0x370a05=_0x5ebd['zsaXft'][_0x328b1f];return!_0x370a05?(_0x5ebdfc=_0x5ebd['IMCVDP'](_0x5ebdfc),_0x5ebd['zsaXft'][_0x328b1f]=_0x5ebdfc):_0x5ebdfc=_0x370a05,_0x5ebdfc;}(function(_0x2629d7,_0x8adc1){const _0x4c3c5b={_0x592259:0x1ae,_0x5d347a:0x1b6,_0x4445c7:0x1b7,_0x2e42ca:0x1a4},_0x3ca6ae=_0x5ebd,_0x3ca564=_0x2629d7();while(!![]){try{const _0x3e8d10=-parseInt(_0x3ca6ae(0x1b1))/0x1+-parseInt(_0x3ca6ae(0x1b5))/0x2+-parseInt(_0x3ca6ae(_0x4c3c5b._0x592259))/0x3*(-parseInt(_0x3ca6ae(0x19e))/0x4)+parseInt(_0x3ca6ae(0x19d))/0x5+-parseInt(_0x3ca6ae(0x1a3))/0x6*(-parseInt(_0x3ca6ae(_0x4c3c5b._0x5d347a))/0x7)+-parseInt(_0x3ca6ae(_0x4c3c5b._0x4445c7))/0x8*(-parseInt(_0x3ca6ae(0x19f))/0x9)+-parseInt(_0x3ca6ae(_0x4c3c5b._0x2e42ca))/0xa*(-parseInt(_0x3ca6ae(0x1af))/0xb);if(_0x3e8d10===_0x8adc1)break;else _0x3ca564['push'](_0x3ca564['shift']());}catch(_0x29d2dd){_0x3ca564['push'](_0x3ca564['shift']());}}}(_0x576d,0x9fb6c));var __defProp=Object[_0x23116c(0x1b3)],__name=(_0x5d1e5a,_0x38ce73)=>__defProp(_0x5d1e5a,_0x23116c(0x1b4),{'value':_0x38ce73,'configurable':!![]}),FULL_CAPABILITIES={'canRun':!![],'canEditFiles':!![],'canTerminal':!![],'canBrowseFs':!![]},STANDALONE_SESSION={'capabilities':FULL_CAPABILITIES,'identity':null},VIEWER_SESSION_HEADER=_0x23116c(0x1aa);function encodeViewerSession(_0x404ac3){const _0x3d44b5={_0x2d6f5e:0x1a5,_0x482d50:0x199,_0x22a492:0x19a},_0x457bcd=_0x23116c;return Buffer[_0x457bcd(_0x3d44b5._0x2d6f5e)](JSON[_0x457bcd(_0x3d44b5._0x482d50)](_0x404ac3),'utf8')[_0x457bcd(_0x3d44b5._0x22a492)]('base64url');}__name(encodeViewerSession,_0x23116c(0x1a7));function decodeViewerSession(_0x1be4bf){const _0x4d26f1={_0x411d87:0x1a5,_0x31713b:0x198,_0x179946:0x19a,_0x45cfd9:0x1a1},_0x2a9368=_0x23116c;if(_0x1be4bf===void 0x0||_0x1be4bf==='')return null;let _0x253ac2;try{_0x253ac2=JSON['parse'](Buffer[_0x2a9368(_0x4d26f1._0x411d87)](_0x1be4bf,_0x2a9368(_0x4d26f1._0x31713b))[_0x2a9368(_0x4d26f1._0x179946)](_0x2a9368(0x19c)));}catch{return null;}if(typeof _0x253ac2!==_0x2a9368(_0x4d26f1._0x45cfd9)||_0x253ac2===null)return null;const {capabilities:_0x23258b,identity:_0x3cb501}=_0x253ac2,_0xef5a7c=readCapabilities(_0x23258b);if(_0xef5a7c===null)return null;return{'capabilities':_0xef5a7c,'identity':readIdentity(_0x3cb501)};}__name(decodeViewerSession,_0x23116c(0x1a8));function readCapabilities(_0x1ef77d){const _0x592b76={_0xd23d2d:0x1ab,_0x518fda:0x1a9},_0x1b6ddf=_0x23116c;if(typeof _0x1ef77d!==_0x1b6ddf(0x1a1)||_0x1ef77d===null)return null;const _0xe9397a=_0x1ef77d,_0x3306d2=__name(_0x45a05b=>_0xe9397a[_0x45a05b]===!![],_0x1b6ddf(_0x592b76._0xd23d2d));return{'canRun':_0x3306d2('canRun'),'canEditFiles':_0x3306d2(_0x1b6ddf(0x1a0)),'canTerminal':_0x3306d2(_0x1b6ddf(_0x592b76._0x518fda)),'canBrowseFs':_0x3306d2(_0x1b6ddf(0x1a2))};}__name(readCapabilities,_0x23116c(0x19b));function readIdentity(_0x321f08){const _0x1605f6={_0x59d1a9:0x1b2,_0x5e2071:0x1ac,_0x5aecc9:0x1b0},_0x1eda63=_0x23116c;if(typeof _0x321f08!=='object'||_0x321f08===null)return null;const _0x4f2396=_0x321f08,{user:_0x3ccc93,role:_0x4471db}=_0x4f2396;if(typeof _0x3ccc93!==_0x1eda63(_0x1605f6._0x59d1a9)||typeof _0x4471db!==_0x1eda63(0x1b2))return null;return{'user':_0x3ccc93,'role':_0x4471db,...optionalString(_0x4f2396,_0x1eda63(_0x1605f6._0x5e2071)),...optionalString(_0x4f2396,'logoutUrl'),...optionalString(_0x4f2396,'environmentsUrl'),...optionalString(_0x4f2396,_0x1eda63(_0x1605f6._0x5aecc9))};}__name(readIdentity,_0x23116c(0x1ad));function optionalString(_0x499533,_0x4b3284){const _0x9985b7=_0x23116c,_0x177d7e=_0x499533[_0x4b3284];return typeof _0x177d7e===_0x9985b7(0x1b2)?{[_0x4b3284]:_0x177d7e}:{};}__name(optionalString,_0x23116c(0x1a6));function capabilitiesOf(_0x4d16d1){return decodeViewerSession(_0x4d16d1)?.['capabilities']??FULL_CAPABILITIES;}__name(capabilitiesOf,'capabilitiesOf');function _0x576d(){const _0x2e7165=['DxrMoa','mtGWmZu1mhPuExvKsW','mtjSsuPXDMi','nJG0ouzdDfDiua','y2fUrwrPDezPBgvZ','B2jQzwn0','y2fUqNjVD3nLrNm','mJKYmJe4zNnXy1nv','mti0nJm0mZbrv2rLq3y','zNjVBq','B3b0Aw9UywXtDhjPBMC','zw5JB2rLvMLLD2vYu2vZC2LVBG','zgvJB2rLvMLLD2vYu2vZC2LVBG','y2fUvgvYBwLUywW','Ec11BM90zxn0lxzPzxDLCI1ZzxnZAw9U','zMXHzW','zw52','CMvHzeLKzw50Axr5','odu2ndC5swDhsgDx','mtfXAvDjAwK','C3DPDgnOrw52vxjS','mte3ndqZm3H6uhPssG','C3rYAw5N','zgvMAw5LuhjVCgvYDhK','BMfTzq','mJiZnJi4ofruyvjtvW','mtr1vMHjBhy','nda1nKXXC2PbEG','yMfZzty0DxjS','C3rYAw5NAwz5','Dg9tDhjPBMC','CMvHzenHCgfIAwXPDgLLCW'];_0x576d=function(){return _0x2e7165;};return _0x576d();}export{FULL_CAPABILITIES,STANDALONE_SESSION,VIEWER_SESSION_HEADER,capabilitiesOf,decodeViewerSession,encodeViewerSession};
|
package/dist/server/snapshot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _0x125c44=_0x428d;(function(_0x2a938a,_0x480de2){var _0x4e14a5={_0x29c0bf:0x1aa,_0x25dcf6:0x1a4,_0x39da12:0x1ae,_0x5b8bde:0x1b1,_0x54529c:0x1a8},_0x44bb23=_0x428d,_0x4e5d79=_0x2a938a();while(!![]){try{var _0x2cc890=-parseInt(_0x44bb23(_0x4e14a5._0x29c0bf))/0x1+parseInt(_0x44bb23(0x1ad))/0x2+parseInt(_0x44bb23(_0x4e14a5._0x25dcf6))/0x3*(parseInt(_0x44bb23(_0x4e14a5._0x39da12))/0x4)+-parseInt(_0x44bb23(_0x4e14a5._0x5b8bde))/0x5*(-parseInt(_0x44bb23(0x1a9))/0x6)+-parseInt(_0x44bb23(0x1b0))/0x7*(parseInt(_0x44bb23(0x1a5))/0x8)+-parseInt(_0x44bb23(0x1a7))/0x9*(-parseInt(_0x44bb23(_0x4e14a5._0x54529c))/0xa)+-parseInt(_0x44bb23(0x1af))/0xb;if(_0x2cc890===_0x480de2)break;else _0x4e5d79['push'](_0x4e5d79['shift']());}catch(_0x2dbf7d){_0x4e5d79['push'](_0x4e5d79['shift']());}}}(_0x5308,0x6160b));var __defProp=Object[_0x125c44(0x1a6)],__name=(_0x238bb,_0xc5b364)=>__defProp(_0x238bb,_0x125c44(0x1b2),{'value':_0xc5b364,'configurable':!![]});import{unzipSync}from'fflate';var SnapshotZipError=class extends Error{static{__name(this,_0x125c44(0x1ac));}constructor(_0x5dca6b){var _0x1dfcf0={_0x12c417:0x1b2},_0x4843ec=_0x125c44;super(_0x5dca6b),this[_0x4843ec(_0x1dfcf0._0x12c417)]=_0x4843ec(0x1ac);}};function readSnapshotEntries(_0x5228dd){var _0x25507c={_0x1cd85f:0x1ab},_0x4d55a0=_0x125c44;try{return unzipSync(_0x5228dd);}catch{throw new SnapshotZipError(_0x4d55a0(_0x25507c._0x1cd85f));}}__name(readSnapshotEntries,'readSnapshotEntries');function _0x428d(_0x4284d7,_0x2aebed){_0x4284d7=_0x4284d7-0x1a4;var _0x5308e0=_0x5308();var _0x428dd0=_0x5308e0[_0x4284d7];if(_0x428d['EmSyFq']===undefined){var _0x322a05=function(_0x49aa21){var _0x112f9a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x238bb='',_0xc5b364='';for(var _0x5dca6b=0x0,_0x5228dd,_0x1facb3,_0x1f009e=0x0;_0x1facb3=_0x49aa21['charAt'](_0x1f009e++);~_0x1facb3&&(_0x5228dd=_0x5dca6b%0x4?_0x5228dd*0x40+_0x1facb3:_0x1facb3,_0x5dca6b++%0x4)?_0x238bb+=String['fromCharCode'](0xff&_0x5228dd>>(-0x2*_0x5dca6b&0x6)):0x0){_0x1facb3=_0x112f9a['indexOf'](_0x1facb3);}for(var _0x41017b=0x0,_0x4e8370=_0x238bb['length'];_0x41017b<_0x4e8370;_0x41017b++){_0xc5b364+='%'+('00'+_0x238bb['charCodeAt'](_0x41017b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xc5b364);};_0x428d['GmsxAH']=_0x322a05,_0x428d['sbfxus']={},_0x428d['EmSyFq']=!![];}var _0x2ca569=_0x5308e0[0x0],_0x44a978=_0x4284d7+_0x2ca569,_0xc54081=_0x428d['sbfxus'][_0x44a978];return!_0xc54081?(_0x428dd0=_0x428d['GmsxAH'](_0x428dd0),_0x428d['sbfxus'][_0x44a978]=_0x428dd0):_0x428dd0=_0xc54081,_0x428dd0;}function _0x5308(){var _0x369027=['ntC5ndC0wg5PCMHY','mJa2mJKZnLLzqwPVwG','mZe3nZCYnffIv0vNuq','mJGYmdy4nvjuquL0vW','mtu0ntvnuwjZAeG','BMfTzq','m2LRCeTdqG','ohbnA3vetq','zgvMAw5LuhjVCgvYDhK','ow5qrLHeza','mZi5ndG2mg9TBxz6uW','ndu2DgnXrurQ','mJC5mtC1rMfwA3bK','BM90igeGDMfSAwqGlNPPCcaOy29YCNvWDgvKig9YihDYB25NigzPBguP','u25HChnOB3rAAxbfCNjVCG'];_0x5308=function(){return _0x369027;};return _0x5308();}export{SnapshotZipError,readSnapshotEntries};
|
package/dist/server/wire.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x3712(_0x33fff1,_0x8bcfd6){_0x33fff1=_0x33fff1-0x15b;var _0x108543=_0x1085();var _0x3712ec=_0x108543[_0x33fff1];if(_0x3712['jeXXNU']===undefined){var _0x7cec4=function(_0xeae353){var _0x21f1d9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x10f0f6='',_0x5e2b59='';for(var _0x524c3f=0x0,_0x2ca950,_0x15d473,_0x13eca2=0x0;_0x15d473=_0xeae353['charAt'](_0x13eca2++);~_0x15d473&&(_0x2ca950=_0x524c3f%0x4?_0x2ca950*0x40+_0x15d473:_0x15d473,_0x524c3f++%0x4)?_0x10f0f6+=String['fromCharCode'](0xff&_0x2ca950>>(-0x2*_0x524c3f&0x6)):0x0){_0x15d473=_0x21f1d9['indexOf'](_0x15d473);}for(var _0x565b46=0x0,_0x46c6d7=_0x10f0f6['length'];_0x565b46<_0x46c6d7;_0x565b46++){_0x5e2b59+='%'+('00'+_0x10f0f6['charCodeAt'](_0x565b46)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5e2b59);};_0x3712['gKUopz']=_0x7cec4,_0x3712['cLysgz']={},_0x3712['jeXXNU']=!![];}var _0x4b56de=_0x108543[0x0],_0x438889=_0x33fff1+_0x4b56de,_0x3f9739=_0x3712['cLysgz'][_0x438889];return!_0x3f9739?(_0x3712ec=_0x3712['gKUopz'](_0x3712ec),_0x3712['cLysgz'][_0x438889]=_0x3712ec):_0x3712ec=_0x3f9739,_0x3712ec;}var _0x482ee9=_0x3712;(function(_0x587979,_0x58c551){var _0x378370={_0x10ee34:0x16d,_0x301b37:0x172,_0x475f31:0x16f,_0x580747:0x15e,_0x151b15:0x167,_0x3532f6:0x161},_0xdadb54=_0x3712,_0x577116=_0x587979();while(!![]){try{var _0x506237=-parseInt(_0xdadb54(_0x378370._0x10ee34))/0x1+parseInt(_0xdadb54(_0x378370._0x301b37))/0x2+-parseInt(_0xdadb54(_0x378370._0x475f31))/0x3+parseInt(_0xdadb54(_0x378370._0x580747))/0x4+parseInt(_0xdadb54(_0x378370._0x151b15))/0x5+parseInt(_0xdadb54(_0x378370._0x3532f6))/0x6*(-parseInt(_0xdadb54(0x16a))/0x7)+parseInt(_0xdadb54(0x15f))/0x8*(parseInt(_0xdadb54(0x16b))/0x9);if(_0x506237===_0x58c551)break;else _0x577116['push'](_0x577116['shift']());}catch(_0x54814a){_0x577116['push'](_0x577116['shift']());}}}(_0x1085,0x2d8bd));var __defProp=Object[_0x482ee9(0x164)],__name=(_0x10f0f6,_0x5e2b59)=>__defProp(_0x10f0f6,_0x482ee9(0x15b),{'value':_0x5e2b59,'configurable':!![]}),SNAPSHOT_FORMAT=_0x482ee9(0x15d);function declaredZipPaths(_0x524c3f){var _0x32ca09=_0x482ee9;return[...Object['values'](_0x524c3f['files']??{}),..._0x524c3f[_0x32ca09(0x174)]??[]];}__name(declaredZipPaths,_0x482ee9(0x16c));var SNAPSHOT_ASSETS={'steps':'steps.jsonl','runtime':'runtime.json','sources':_0x482ee9(0x160),'failure':_0x482ee9(0x173),'console':_0x482ee9(0x163),'network':_0x482ee9(0x16e),'domSnapshot':_0x482ee9(0x168),'outline':_0x482ee9(0x170),'screenshot':_0x482ee9(0x166),'page':'page.html','stdout':_0x482ee9(0x171),'stderr':'stderr.log'};function snapshotFileName(_0x2ca950,_0x15d473){var _0x1aa717={_0x504ec1:0x175,_0x219106:0x15c},_0x379226=_0x482ee9;const _0x13eca2=__name(_0x56b605=>_0x56b605[_0x379226(0x169)](/[^a-zA-Z0-9._-]+/g,'-')['replace'](/^-+|-+$/g,''),_0x379226(_0x1aa717._0x504ec1)),_0x565b46=_0x13eca2(_0x2ca950),_0x46c6d7=_0x13eca2(_0x15d473),_0x5d6619=!_0x565b46||_0x46c6d7[_0x379226(_0x1aa717._0x219106)](_0x565b46)?_0x46c6d7:_0x565b46+'-'+_0x46c6d7;return(_0x5d6619||'snapshot')+'.unotest.zip';}__name(snapshotFileName,_0x482ee9(0x165));function isSupportedSnapshotFormat(_0x1e59a3){return _0x1e59a3===SNAPSHOT_FORMAT;}__name(isSupportedSnapshotFormat,_0x482ee9(0x162));function _0x1085(){var _0x5b025f=['zgvMAw5LuhjVCgvYDhK','C25HChnOB3rgAwXLtMfTzq','C2nYzwvUC2HVDc5WBMC','nJuYntm1Bwz6EvHy','C25HChnOB3qUANnVBG','CMvWBgfJzq','mZvwuw1RAgm','mtqYnZe5m2fmt0Tcyq','zgvJBgfYzwrAAxbqyxrOCW','mJK4mtK0u3HhEK5u','BMv0D29YAY5QC29U','mZiXoteYqK5zAM5s','B3v0BgLUzs50Ehq','C3rKB3v0lMXVzW','ndi1otmYufzHCwzI','zMfPBhvYzs5QC29U','C2nYzwvUC2HVDhm','C2fMzq','BMfTzq','C3rHCNrZv2L0Aa','Dw5VDgvZDc1ZBMfWC2HVDeaX','mtiWody5mNzwDgrWCq','mtzTuxbqBMy','C291CMnLCY5QC29U','ndq0odK0shLVDKzg','AxntDxbWB3j0zwrtBMfWC2HVDezVCM1HDa','y29UC29Szs5QC29U'];_0x1085=function(){return _0x5b025f;};return _0x1085();}export{SNAPSHOT_ASSETS,SNAPSHOT_FORMAT,declaredZipPaths,isSupportedSnapshotFormat,snapshotFileName};
|