@unotest/viewer 0.29.0 → 0.31.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 +131 -0
- package/dist/server/main.js +1 -1
- package/dist/server/session.d.ts +23 -1
- package/dist/server/session.js +1 -1
- package/dist/web/assets/{DslEditor-BVscgjf5.js → DslEditor-v0x2qlN8.js} +3 -3
- package/dist/web/assets/index-COpZ6sQr.js +55 -0
- package/dist/web/assets/index-Fjo2H4WW.css +32 -0
- package/dist/web/index.html +2 -2
- package/package.json +6 -6
- package/dist/web/assets/index-2rS3AwTq.js +0 -55
- package/dist/web/assets/index-RCE6y6j4.css +0 -32
package/dist/server/session.d.ts
CHANGED
|
@@ -32,6 +32,28 @@ interface ViewerIdentity {
|
|
|
32
32
|
readonly env?: string;
|
|
33
33
|
/** Where to POST to end the session. Absent → no log-out affordance. */
|
|
34
34
|
readonly logoutUrl?: string;
|
|
35
|
+
/** Where to GET the environments the proxy can route this session to
|
|
36
|
+
* ({@link ViewerEnvOption}[]). Absent → no switcher: the proxy has one
|
|
37
|
+
* place to send us, or does not want it picked from here. */
|
|
38
|
+
readonly environmentsUrl?: string;
|
|
39
|
+
/** Where to POST `env=<name>` to be routed elsewhere. The answer is a
|
|
40
|
+
* redirect — the viewer behind the proxy changes, so it is a top-level
|
|
41
|
+
* form submit, never a fetch. */
|
|
42
|
+
readonly switchEnvUrl?: string;
|
|
43
|
+
}
|
|
44
|
+
/** One place the fronting proxy can route a session to. Display only,
|
|
45
|
+
* like {@link ViewerIdentity}: the viewer groups by `project`, shows
|
|
46
|
+
* `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;
|
|
35
57
|
}
|
|
36
58
|
interface ViewerSession {
|
|
37
59
|
readonly capabilities: ViewerCapabilities;
|
|
@@ -56,4 +78,4 @@ declare function encodeViewerSession(session: ViewerSession): string;
|
|
|
56
78
|
* a broken header must not lock a local user out of their own viewer. */
|
|
57
79
|
declare function decodeViewerSession(raw: string | undefined): ViewerSession | null;
|
|
58
80
|
|
|
59
|
-
export { FULL_CAPABILITIES, STANDALONE_SESSION, VIEWER_SESSION_HEADER, type ViewerCapabilities, type ViewerIdentity, type ViewerSession, decodeViewerSession, encodeViewerSession };
|
|
81
|
+
export { FULL_CAPABILITIES, STANDALONE_SESSION, VIEWER_SESSION_HEADER, type ViewerCapabilities, type ViewerEnvOption, type ViewerIdentity, type ViewerSession, decodeViewerSession, encodeViewerSession };
|
package/dist/server/session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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};
|