@unotest/viewer 0.31.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 +286 -0
- package/dist/server/main.d.ts +21 -1
- package/dist/server/main.js +1 -1
- package/dist/server/session.d.ts +19 -13
- package/dist/server/session.js +1 -1
- package/dist/server/snapshot.d.ts +8 -0
- package/dist/server/snapshot.js +1 -0
- package/dist/server/wire.d.ts +141 -0
- package/dist/server/wire.js +1 -0
- package/dist/web/assets/{DslEditor-v0x2qlN8.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 +15 -7
- package/dist/web/assets/index-COpZ6sQr.js +0 -55
package/dist/server/session.d.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -10,7 +12,13 @@
|
|
|
10
12
|
*
|
|
11
13
|
* Capabilities are coarse and role-free on purpose. A proxy that invents
|
|
12
14
|
* new roles maps them onto these flags; the viewer never learns the word
|
|
13
|
-
* "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. */
|
|
14
22
|
interface ViewerCapabilities {
|
|
15
23
|
/** Start / abort runs, drive the debugger, control the app-under-test. */
|
|
16
24
|
readonly canRun: boolean;
|
|
@@ -44,17 +52,12 @@ interface ViewerIdentity {
|
|
|
44
52
|
/** One place the fronting proxy can route a session to. Display only,
|
|
45
53
|
* like {@link ViewerIdentity}: the viewer groups by `project`, shows
|
|
46
54
|
* `environment` and `note`, and sends `name` back — never derives one
|
|
47
|
-
* from another.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
readonly project?: string;
|
|
54
|
-
readonly environment: string;
|
|
55
|
-
/** What that environment is serving right now (a bundle label). */
|
|
56
|
-
readonly note?: string;
|
|
57
|
-
}
|
|
55
|
+
* from another.
|
|
56
|
+
*
|
|
57
|
+
* The same list the guard serves to a bearer client asking which
|
|
58
|
+
* environments it may read, so the shape lives in the protocol and this
|
|
59
|
+
* is the viewer's name for it — one definition, not two that drift. */
|
|
60
|
+
type ViewerEnvOption = BoxReadEnvironment;
|
|
58
61
|
interface ViewerSession {
|
|
59
62
|
readonly capabilities: ViewerCapabilities;
|
|
60
63
|
/** null when nothing fronts the viewer — plain localhost usage. */
|
|
@@ -77,5 +80,8 @@ declare function encodeViewerSession(session: ViewerSession): string;
|
|
|
77
80
|
* truncated, forged. The caller then falls back to standalone defaults:
|
|
78
81
|
* a broken header must not lock a local user out of their own viewer. */
|
|
79
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;
|
|
80
86
|
|
|
81
|
-
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};
|
|
@@ -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 _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};
|
|
@@ -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
|
+
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};
|