@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.
@@ -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 };
@@ -1 +1 @@
1
- const _0xc4b24c=_0x107d;function _0x107d(_0x72fab,_0x501b1d){_0x72fab=_0x72fab-0x95;const _0x2d9e02=_0x2d9e();let _0x107dff=_0x2d9e02[_0x72fab];if(_0x107d['GLvRXj']===undefined){var _0x16dfd3=function(_0x23c3d4){const _0x214c8f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x422fb4='',_0x103a66='';for(let _0x4a0f1b=0x0,_0x2a41a5,_0xb5d257,_0x3841b2=0x0;_0xb5d257=_0x23c3d4['charAt'](_0x3841b2++);~_0xb5d257&&(_0x2a41a5=_0x4a0f1b%0x4?_0x2a41a5*0x40+_0xb5d257:_0xb5d257,_0x4a0f1b++%0x4)?_0x422fb4+=String['fromCharCode'](0xff&_0x2a41a5>>(-0x2*_0x4a0f1b&0x6)):0x0){_0xb5d257=_0x214c8f['indexOf'](_0xb5d257);}for(let _0x2dcbe2=0x0,_0x5a4766=_0x422fb4['length'];_0x2dcbe2<_0x5a4766;_0x2dcbe2++){_0x103a66+='%'+('00'+_0x422fb4['charCodeAt'](_0x2dcbe2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x103a66);};_0x107d['dlnzdJ']=_0x16dfd3,_0x107d['uKxACL']={},_0x107d['GLvRXj']=!![];}const _0x2bf7e0=_0x2d9e02[0x0],_0x618550=_0x72fab+_0x2bf7e0,_0x43d2a5=_0x107d['uKxACL'][_0x618550];return!_0x43d2a5?(_0x107dff=_0x107d['dlnzdJ'](_0x107dff),_0x107d['uKxACL'][_0x618550]=_0x107dff):_0x107dff=_0x43d2a5,_0x107dff;}(function(_0x622b49,_0x54997f){const _0x1ea63c={_0x2f8031:0x9b,_0x268377:0x9a,_0xf9a971:0x96},_0xd6eab5=_0x107d,_0x350e87=_0x622b49();while(!![]){try{const _0x50c043=parseInt(_0xd6eab5(0xa3))/0x1*(parseInt(_0xd6eab5(_0x1ea63c._0x2f8031))/0x2)+parseInt(_0xd6eab5(_0x1ea63c._0x268377))/0x3*(-parseInt(_0xd6eab5(0x97))/0x4)+-parseInt(_0xd6eab5(0xab))/0x5+parseInt(_0xd6eab5(0xad))/0x6+-parseInt(_0xd6eab5(0xac))/0x7*(-parseInt(_0xd6eab5(0xa9))/0x8)+-parseInt(_0xd6eab5(_0x1ea63c._0xf9a971))/0x9+-parseInt(_0xd6eab5(0xaa))/0xa;if(_0x50c043===_0x54997f)break;else _0x350e87['push'](_0x350e87['shift']());}catch(_0x5468a6){_0x350e87['push'](_0x350e87['shift']());}}}(_0x2d9e,0x94a48));var __defProp=Object['defineProperty'],__name=(_0x422fb4,_0x103a66)=>__defProp(_0x422fb4,_0xc4b24c(0xb0),{'value':_0x103a66,'configurable':!![]}),FULL_CAPABILITIES={'canRun':!![],'canEditFiles':!![],'canTerminal':!![],'canBrowseFs':!![]},STANDALONE_SESSION={'capabilities':FULL_CAPABILITIES,'identity':null},VIEWER_SESSION_HEADER=_0xc4b24c(0xa8);function encodeViewerSession(_0x4a0f1b){const _0x699cff={_0x3dcd85:0xa6},_0x4fa275=_0xc4b24c;return Buffer['from'](JSON['stringify'](_0x4a0f1b),'utf8')['toString'](_0x4fa275(_0x699cff._0x3dcd85));}__name(encodeViewerSession,'encodeViewerSession');function decodeViewerSession(_0x2a41a5){const _0x1175d2={_0x24154f:0x9d,_0x2cd880:0x9e,_0x50b545:0x95},_0xf06e69=_0xc4b24c;if(_0x2a41a5===void 0x0||_0x2a41a5==='')return null;let _0xb5d257;try{_0xb5d257=JSON[_0xf06e69(0x98)](Buffer[_0xf06e69(_0x1175d2._0x24154f)](_0x2a41a5,_0xf06e69(0xa6))[_0xf06e69(0xa0)](_0xf06e69(_0x1175d2._0x2cd880)));}catch{return null;}if(typeof _0xb5d257!==_0xf06e69(_0x1175d2._0x50b545)||_0xb5d257===null)return null;const {capabilities:_0x3841b2,identity:_0x2dcbe2}=_0xb5d257,_0x5a4766=readCapabilities(_0x3841b2);if(_0x5a4766===null)return null;return{'capabilities':_0x5a4766,'identity':readIdentity(_0x2dcbe2)};}__name(decodeViewerSession,_0xc4b24c(0xa5));function _0x2d9e(){const _0x139f20=['y2fUrwrPDezPBgvZ','BMfTzq','B2jQzwn0','mZK1nZC5nwTWDg5Juq','mZC4nJbMC1LksgS','CgfYC2u','zw52','mtvguK1Hvxe','mJu3mNzMzhHZra','Bg9NB3v0vxjS','zNjVBq','DxrMoa','zMXHzW','Dg9tDhjPBMC','y2fUqNjVD3nLrNm','CMvHzeLKzw50Axr5','nZi3EujoCK1Y','C3rYAw5N','zgvJB2rLvMLLD2vYu2vZC2LVBG','yMfZzty0DxjS','CMvHzenHCgfIAwXPDgLLCW','Ec11BM90zxn0lxzPzxDLCI1ZzxnZAw9U','mtuYqwjYvM5q','ndG3ntyYmeLYt0HhyW','mtu2ntC3mgDTuxzuqq','mZe4mty0qwvqv2f4','ntG4nZu2wLvfBMD3','y2fUuNvU'];_0x2d9e=function(){return _0x139f20;};return _0x2d9e();}function readCapabilities(_0x52da01){const _0x40d937={_0x3c96fb:0x95,_0xc534ed:0x9f,_0x3689c4:0xae,_0x5f2b63:0xaf},_0x2d18cd=_0xc4b24c;if(typeof _0x52da01!==_0x2d18cd(_0x40d937._0x3c96fb)||_0x52da01===null)return null;const _0x631287=_0x52da01,_0x5f0e0d=__name(_0x3e3302=>_0x631287[_0x3e3302]===!![],_0x2d18cd(_0x40d937._0xc534ed));return{'canRun':_0x5f0e0d(_0x2d18cd(_0x40d937._0x3689c4)),'canEditFiles':_0x5f0e0d(_0x2d18cd(_0x40d937._0x5f2b63)),'canTerminal':_0x5f0e0d('canTerminal'),'canBrowseFs':_0x5f0e0d(_0x2d18cd(0xa1))};}__name(readCapabilities,_0xc4b24c(0xa7));function readIdentity(_0x3a3472){const _0x574314={_0xab20e7:0x95,_0x4086b8:0x99,_0x5cd21b:0xa4},_0x229e56=_0xc4b24c;if(typeof _0x3a3472!==_0x229e56(_0x574314._0xab20e7)||_0x3a3472===null)return null;const _0x3ea4b5=_0x3a3472,{user:_0x1dd862,role:_0x6ebffd}=_0x3ea4b5;if(typeof _0x1dd862!==_0x229e56(0xa4)||typeof _0x6ebffd!==_0x229e56(0xa4))return null;return{'user':_0x1dd862,'role':_0x6ebffd,...typeof _0x3ea4b5[_0x229e56(_0x574314._0x4086b8)]===_0x229e56(_0x574314._0x5cd21b)?{'env':_0x3ea4b5['env']}:{},...typeof _0x3ea4b5['logoutUrl']===_0x229e56(_0x574314._0x5cd21b)?{'logoutUrl':_0x3ea4b5[_0x229e56(0x9c)]}:{}};}__name(readIdentity,_0xc4b24c(0xa2));export{FULL_CAPABILITIES,STANDALONE_SESSION,VIEWER_SESSION_HEADER,decodeViewerSession,encodeViewerSession};
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};