@vitrinka/web 0.1.0 → 0.1.2

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.
@@ -2,18 +2,23 @@
2
2
  * The device link, wired to the recorder: start a code, poll for approval,
3
3
  * store the token; forget it on Unlink or when a session door answers 401.
4
4
  */
5
- import { pollLink, startLink } from '@vitrinka/link';
5
+ import { linkWorkspace, pollLink, startLink } from '@vitrinka/link';
6
6
  import { onUnauthorized } from './api';
7
7
  import { clearLink, defaultLinkLabel, recorderConfig, storeLink } from './config';
8
8
  import { getState, resetQueues, setState } from './queue';
9
9
  import { notify } from './state';
10
10
  export { LinkExpired } from '@vitrinka/link';
11
- /** Ask for a code and poll until approved. The token is stored on success. */
11
+ /**
12
+ * Ask for a code and poll until approved. The token is stored on success.
13
+ * A `url` addressing `/w/<slug>` preselects that workspace on the approve
14
+ * page, and a token approved into any other one is discarded unstored.
15
+ */
12
16
  export async function linkDevice() {
13
17
  const { url } = recorderConfig();
14
- const start = await startLink(url, { label: defaultLinkLabel() });
18
+ const workspace = linkWorkspace(url);
19
+ const start = await startLink(url, { label: defaultLinkLabel(), workspace });
15
20
  const ac = new AbortController();
16
- const linked = pollLink(url, start.device_code, { interval: start.interval, signal: ac.signal }).then((l) => {
21
+ const linked = pollLink(url, start.device_code, { interval: start.interval, workspace, signal: ac.signal }).then((l) => {
17
22
  storeLink(l);
18
23
  return l;
19
24
  });
@@ -17,8 +17,8 @@ import { type SessionState } from './queue';
17
17
  export { currentRoute, notify, subscribe } from './state';
18
18
  export type { SessionDone } from '../protocol';
19
19
  /** Sent as `meta.recorder`; bumped with the package version. */
20
- export declare const RECORDER_VERSION = "0.1.0";
21
- export declare const RECORDER_ID = "web/0.1.0";
20
+ export declare const RECORDER_VERSION = "0.1.2";
21
+ export declare const RECORDER_ID = "web/0.1.2";
22
22
  /** What `POST /api/v1/sessions` answers (the fields this recorder keeps). */
23
23
  export interface SessionOut {
24
24
  id: string;
@@ -5,7 +5,7 @@ import { armReconcile, capturesSettled, disarmReconcile, drainBuffer, getState,
5
5
  import { currentRoute, notify } from './state';
6
6
  export { currentRoute, notify, subscribe } from './state';
7
7
  /** Sent as `meta.recorder`; bumped with the package version. */
8
- export const RECORDER_VERSION = '0.1.0';
8
+ export const RECORDER_VERSION = '0.1.2';
9
9
  export const RECORDER_ID = `web/${RECORDER_VERSION}`;
10
10
  /**
11
11
  * Re-apply a RECOVERED session's redaction policy after a reload — and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrinka/web",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "vitrinka toolkit for React DOM apps — the journey recorder: capture manual-testing sessions (rrweb DOM stream, clicks, navigation, network, console, notes) straight into vitrinka boards.",
5
5
  "license": "Elastic-2.0",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "prepublishOnly": "tsc -p tsconfig.build.json"
46
46
  },
47
47
  "dependencies": {
48
- "@vitrinka/link": "^0.1.0",
48
+ "@vitrinka/link": "^0.1.2",
49
49
  "@vitrinka/redact": "^0.1.0"
50
50
  },
51
51
  "peerDependencies": {