@unotest/viewer 0.29.0 → 0.30.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 +28 -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-B1VKaBDd.js} +2 -2
- package/dist/web/assets/index-CBlBZ0xa.css +32 -0
- package/dist/web/assets/index-feeefcEd.js +55 -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 _0x40d5f6=_0x5076;(function(_0x290f38,_0x48c93c){const _0x36771a={_0x5da1a6:0x89,_0x2ed8ec:0x8e,_0x433cc4:0x9f,_0x583718:0x88,_0x13b0c3:0xa1,_0x3ae5b6:0x96,_0x2f1656:0x8c,_0x468b59:0x92,_0x456f48:0x94,_0x34e58e:0xa7},_0x4a7a85=_0x5076,_0x3cde15=_0x290f38();while(!![]){try{const _0x5b8c62=-parseInt(_0x4a7a85(_0x36771a._0x5da1a6))/0x1*(parseInt(_0x4a7a85(0x9a))/0x2)+parseInt(_0x4a7a85(0x8d))/0x3*(parseInt(_0x4a7a85(_0x36771a._0x2ed8ec))/0x4)+parseInt(_0x4a7a85(_0x36771a._0x433cc4))/0x5*(parseInt(_0x4a7a85(_0x36771a._0x583718))/0x6)+-parseInt(_0x4a7a85(_0x36771a._0x13b0c3))/0x7*(parseInt(_0x4a7a85(_0x36771a._0x3ae5b6))/0x8)+parseInt(_0x4a7a85(_0x36771a._0x2f1656))/0x9*(parseInt(_0x4a7a85(_0x36771a._0x468b59))/0xa)+-parseInt(_0x4a7a85(0x9d))/0xb*(-parseInt(_0x4a7a85(_0x36771a._0x456f48))/0xc)+-parseInt(_0x4a7a85(_0x36771a._0x34e58e))/0xd;if(_0x5b8c62===_0x48c93c)break;else _0x3cde15['push'](_0x3cde15['shift']());}catch(_0xd3dfdf){_0x3cde15['push'](_0x3cde15['shift']());}}}(_0x1a23,0x2d492));function _0x5076(_0xdc7c00,_0x3f12e5){_0xdc7c00=_0xdc7c00-0x86;const _0x1a2392=_0x1a23();let _0x5076b0=_0x1a2392[_0xdc7c00];if(_0x5076['IgBFfX']===undefined){var _0x3c493c=function(_0x335a89){const _0x19202c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1da52b='',_0x4c7e9e='';for(let _0x1bd25e=0x0,_0x53a09a,_0x375f95,_0x37877d=0x0;_0x375f95=_0x335a89['charAt'](_0x37877d++);~_0x375f95&&(_0x53a09a=_0x1bd25e%0x4?_0x53a09a*0x40+_0x375f95:_0x375f95,_0x1bd25e++%0x4)?_0x1da52b+=String['fromCharCode'](0xff&_0x53a09a>>(-0x2*_0x1bd25e&0x6)):0x0){_0x375f95=_0x19202c['indexOf'](_0x375f95);}for(let _0x3decbd=0x0,_0x3f901e=_0x1da52b['length'];_0x3decbd<_0x3f901e;_0x3decbd++){_0x4c7e9e+='%'+('00'+_0x1da52b['charCodeAt'](_0x3decbd)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4c7e9e);};_0x5076['eDfFxn']=_0x3c493c,_0x5076['lVFliv']={},_0x5076['IgBFfX']=!![];}const _0x3c548e=_0x1a2392[0x0],_0x543b25=_0xdc7c00+_0x3c548e,_0x5da220=_0x5076['lVFliv'][_0x543b25];return!_0x5da220?(_0x5076b0=_0x5076['eDfFxn'](_0x5076b0),_0x5076['lVFliv'][_0x543b25]=_0x5076b0):_0x5076b0=_0x5da220,_0x5076b0;}var __defProp=Object[_0x40d5f6(0x91)],__name=(_0x1da52b,_0x4c7e9e)=>__defProp(_0x1da52b,_0x40d5f6(0xa6),{'value':_0x4c7e9e,'configurable':!![]}),FULL_CAPABILITIES={'canRun':!![],'canEditFiles':!![],'canTerminal':!![],'canBrowseFs':!![]},STANDALONE_SESSION={'capabilities':FULL_CAPABILITIES,'identity':null},VIEWER_SESSION_HEADER=_0x40d5f6(0x9b);function _0x1a23(){const _0x4aefec=['n3HuBfDOtG','C3rYAw5N','CgfYC2u','B2jQzwn0','CMvHzenHCgfIAwXPDgLLCW','BMfTzq','ntK3nta0n3Htq2vrsW','DxrMoa','y2fUqNjVD3nLrNm','mZi0zxnXtNfn','ndm3nZDOt2TUwwC','C3rYAw5NAwz5','yMfZzty0DxjS','ntCXnw53Dg5wvW','nJnkq3rOBhC','ntC4mJHMAePPEKu','y2fUuNvU','zw5JB2rLvMLLD2vYu2vZC2LVBG','zgvMAw5LuhjVCgvYDhK','ntiZmgngB3zota','zNjVBq','mtjwuMDbv2q','zw52AxjVBM1LBNrZvxjS','nZaYnZyWvNrTqvrV','zMXHzW','zw52','y2fUrwrPDezPBgvZ','nK5fAejRDq','Ec11BM90zxn0lxzPzxDLCI1ZzxnZAw9U','Dg9tDhjPBMC','mJmZmZi0m1zJs25ACW','C3DPDgnOrw52vxjS','mtuYnwPNtMnSBW','zgvJB2rLvMLLD2vYu2vZC2LVBG'];_0x1a23=function(){return _0x4aefec;};return _0x1a23();}function encodeViewerSession(_0x1bd25e){const _0x1cb434={_0x38ba16:0x86,_0x2d6fcd:0x9c},_0xe19321=_0x40d5f6;return Buffer['from'](JSON[_0xe19321(0x8a)](_0x1bd25e),_0xe19321(_0x1cb434._0x38ba16))[_0xe19321(_0x1cb434._0x2d6fcd)](_0xe19321(0x8b));}__name(encodeViewerSession,_0x40d5f6(0x90));function decodeViewerSession(_0x53a09a){const _0x36719a={_0x4d3104:0xa3,_0x410198:0x93},_0x1fa95b=_0x40d5f6;if(_0x53a09a===void 0x0||_0x53a09a==='')return null;let _0x375f95;try{_0x375f95=JSON[_0x1fa95b(_0x36719a._0x4d3104)](Buffer[_0x1fa95b(_0x36719a._0x410198)](_0x53a09a,_0x1fa95b(0x8b))[_0x1fa95b(0x9c)]('utf8'));}catch{return null;}if(typeof _0x375f95!=='object'||_0x375f95===null)return null;const {capabilities:_0x37877d,identity:_0x3decbd}=_0x375f95,_0x3f901e=readCapabilities(_0x37877d);if(_0x3f901e===null)return null;return{'capabilities':_0x3f901e,'identity':readIdentity(_0x3decbd)};}__name(decodeViewerSession,_0x40d5f6(0xa0));function readCapabilities(_0x1bb94e){const _0x17d521={_0x35c196:0x97},_0x406c24=_0x40d5f6;if(typeof _0x1bb94e!==_0x406c24(0xa4)||_0x1bb94e===null)return null;const _0x84cdda=_0x1bb94e,_0x3951fe=__name(_0x24adba=>_0x84cdda[_0x24adba]===!![],_0x406c24(_0x17d521._0x35c196));return{'canRun':_0x3951fe(_0x406c24(0x8f)),'canEditFiles':_0x3951fe(_0x406c24(0x99)),'canTerminal':_0x3951fe('canTerminal'),'canBrowseFs':_0x3951fe(_0x406c24(0x87))};}__name(readCapabilities,_0x40d5f6(0xa5));function readIdentity(_0x30323c){const _0x2bb2e7=_0x40d5f6;if(typeof _0x30323c!=='object'||_0x30323c===null)return null;const _0x14040d=_0x30323c,{user:_0x1ade98,role:_0x3e5d8d}=_0x14040d;if(typeof _0x1ade98!==_0x2bb2e7(0xa2)||typeof _0x3e5d8d!==_0x2bb2e7(0xa2))return null;return{'user':_0x1ade98,'role':_0x3e5d8d,...optionalString(_0x14040d,_0x2bb2e7(0x98)),...optionalString(_0x14040d,'logoutUrl'),...optionalString(_0x14040d,_0x2bb2e7(0x95)),...optionalString(_0x14040d,_0x2bb2e7(0x9e))};}__name(readIdentity,'readIdentity');function optionalString(_0x45b110,_0x37a7a8){const _0x13eadb=_0x40d5f6,_0x5565e8=_0x45b110[_0x37a7a8];return typeof _0x5565e8===_0x13eadb(0xa2)?{[_0x37a7a8]:_0x5565e8}:{};}__name(optionalString,'optionalString');export{FULL_CAPABILITIES,STANDALONE_SESSION,VIEWER_SESSION_HEADER,decodeViewerSession,encodeViewerSession};
|