autotel-playwright 0.5.7 → 0.5.8

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/dist/index.d.cts CHANGED
@@ -2,13 +2,13 @@ import { APIRequestContext, Page, TestInfo, expect } from "@playwright/test";
2
2
  import { AutotelConfig, OtelTraceContext, enrichWithTraceContext, getTraceContext, isTracing, resolveTraceUrl } from "autotel";
3
3
  //#region src/index.d.ts
4
4
  /** Annotation type for custom span attributes: description should be "key=value" or "key=value1;key2=value2". */
5
- declare const AUTOTEL_ATTRIBUTE_ANNOTATION = "autotel.attribute";
5
+ export declare const AUTOTEL_ATTRIBUTE_ANNOTATION = "autotel.attribute";
6
6
  type OtelTestSpan = {
7
7
  carrier: Record<string, string>;
8
8
  apiBaseUrls: string[];
9
9
  testInfo: TestInfo;
10
10
  };
11
- declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
11
+ export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
12
12
  page: Page;
13
13
  requestWithTrace: APIRequestContext;
14
14
  _otelTestSpan: OtelTestSpan;
@@ -27,18 +27,18 @@ declare const test: import("@playwright/test").TestType<import("@playwright/test
27
27
  * });
28
28
  * });
29
29
  */
30
- declare function step<T>(name: string, fn: () => Promise<T>): Promise<T>;
30
+ export declare function step<T>(name: string, fn: () => Promise<T>): Promise<T>;
31
31
  /**
32
32
  * Returns a function suitable for Playwright globalSetup that inits autotel.
33
33
  * Call autotel.init() with the given options (or defaults) so test spans are exported.
34
34
  */
35
- declare function createGlobalSetup(initOptions?: AutotelConfig): () => Promise<void>;
35
+ export declare function createGlobalSetup(initOptions?: AutotelConfig): () => Promise<void>;
36
36
  /**
37
37
  * Serialized span returned by the test-spans endpoint (matches autotel-tanstack/testing SerializedSpan).
38
38
  */
39
39
  /** Span attributes as they survive JSON: OpenTelemetry's value types. */
40
- type SerializedAttributes = Record<string, string | number | boolean | Array<string | number | boolean | null>>;
41
- interface SerializedSpan {
40
+ export type SerializedAttributes = Record<string, string | number | boolean | Array<string | number | boolean | null>>;
41
+ export interface SerializedSpan {
42
42
  name: string;
43
43
  spanId: string;
44
44
  traceId: string;
@@ -72,12 +72,12 @@ interface SerializedSpan {
72
72
  * ```
73
73
  */
74
74
  /** Reads and clears the spans a test server collected. */
75
- interface TestSpansClient {
75
+ export interface TestSpansClient {
76
76
  getSpans(request: APIRequestContext): Promise<SerializedSpan[]>;
77
77
  clearSpans(request: APIRequestContext): Promise<void>;
78
78
  }
79
- declare function createTestSpansClient(baseUrl: string, options?: {
79
+ export declare function createTestSpansClient(baseUrl: string, options?: {
80
80
  path?: string;
81
81
  }): TestSpansClient;
82
82
  //#endregion
83
- export { AUTOTEL_ATTRIBUTE_ANNOTATION, type OtelTraceContext, SerializedAttributes, SerializedSpan, TestSpansClient, createGlobalSetup, createTestSpansClient, enrichWithTraceContext, expect, getTraceContext, isTracing, resolveTraceUrl, step, test };
83
+ export { type OtelTraceContext, enrichWithTraceContext, expect, getTraceContext, isTracing, resolveTraceUrl };
package/dist/index.d.ts CHANGED
@@ -2,13 +2,13 @@ import { APIRequestContext, Page, TestInfo, expect } from "@playwright/test";
2
2
  import { AutotelConfig, OtelTraceContext, enrichWithTraceContext, getTraceContext, isTracing, resolveTraceUrl } from "autotel";
3
3
  //#region src/index.d.ts
4
4
  /** Annotation type for custom span attributes: description should be "key=value" or "key=value1;key2=value2". */
5
- declare const AUTOTEL_ATTRIBUTE_ANNOTATION = "autotel.attribute";
5
+ export declare const AUTOTEL_ATTRIBUTE_ANNOTATION = "autotel.attribute";
6
6
  type OtelTestSpan = {
7
7
  carrier: Record<string, string>;
8
8
  apiBaseUrls: string[];
9
9
  testInfo: TestInfo;
10
10
  };
11
- declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
11
+ export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
12
12
  page: Page;
13
13
  requestWithTrace: APIRequestContext;
14
14
  _otelTestSpan: OtelTestSpan;
@@ -27,18 +27,18 @@ declare const test: import("@playwright/test").TestType<import("@playwright/test
27
27
  * });
28
28
  * });
29
29
  */
30
- declare function step<T>(name: string, fn: () => Promise<T>): Promise<T>;
30
+ export declare function step<T>(name: string, fn: () => Promise<T>): Promise<T>;
31
31
  /**
32
32
  * Returns a function suitable for Playwright globalSetup that inits autotel.
33
33
  * Call autotel.init() with the given options (or defaults) so test spans are exported.
34
34
  */
35
- declare function createGlobalSetup(initOptions?: AutotelConfig): () => Promise<void>;
35
+ export declare function createGlobalSetup(initOptions?: AutotelConfig): () => Promise<void>;
36
36
  /**
37
37
  * Serialized span returned by the test-spans endpoint (matches autotel-tanstack/testing SerializedSpan).
38
38
  */
39
39
  /** Span attributes as they survive JSON: OpenTelemetry's value types. */
40
- type SerializedAttributes = Record<string, string | number | boolean | Array<string | number | boolean | null>>;
41
- interface SerializedSpan {
40
+ export type SerializedAttributes = Record<string, string | number | boolean | Array<string | number | boolean | null>>;
41
+ export interface SerializedSpan {
42
42
  name: string;
43
43
  spanId: string;
44
44
  traceId: string;
@@ -72,12 +72,12 @@ interface SerializedSpan {
72
72
  * ```
73
73
  */
74
74
  /** Reads and clears the spans a test server collected. */
75
- interface TestSpansClient {
75
+ export interface TestSpansClient {
76
76
  getSpans(request: APIRequestContext): Promise<SerializedSpan[]>;
77
77
  clearSpans(request: APIRequestContext): Promise<void>;
78
78
  }
79
- declare function createTestSpansClient(baseUrl: string, options?: {
79
+ export declare function createTestSpansClient(baseUrl: string, options?: {
80
80
  path?: string;
81
81
  }): TestSpansClient;
82
82
  //#endregion
83
- export { AUTOTEL_ATTRIBUTE_ANNOTATION, type OtelTraceContext, SerializedAttributes, SerializedSpan, TestSpansClient, createGlobalSetup, createTestSpansClient, enrichWithTraceContext, expect, getTraceContext, isTracing, resolveTraceUrl, step, test };
83
+ export { type OtelTraceContext, enrichWithTraceContext, expect, getTraceContext, isTracing, resolveTraceUrl };
@@ -4,20 +4,20 @@ import { BrowserContext } from "@playwright/test";
4
4
  * Session totals. `session.id` is canonical; the rest extend `browser.*`,
5
5
  * which OpenTelemetry defines for the browser but not for the driver.
6
6
  */
7
- declare const BROWSER_SESSION_ATTRIBUTES: {
8
- readonly SESSION_ID: "session.id";
7
+ export declare const BROWSER_SESSION_ATTRIBUTES: {
8
+ readonly SESSION_ID: 'session.id';
9
9
  /** Seconds of browser CPU, summed over the session's pages. */
10
- readonly CPU_TIME: "browser.session.cpu.time";
10
+ readonly CPU_TIME: 'browser.session.cpu.time';
11
11
  /** Peak JS heap in bytes across the session's pages. */
12
- readonly MEMORY_USAGE: "browser.session.memory.usage";
12
+ readonly MEMORY_USAGE: 'browser.session.memory.usage';
13
13
  /** Bytes on the wire, request and response, headers and bodies. */
14
- readonly NETWORK_IO: "browser.session.network.io";
15
- readonly PAGES: "browser.session.pages";
16
- readonly CONSOLE_ERRORS: "browser.session.console.errors";
17
- readonly CONSOLE_LEVEL: "browser.console.level";
18
- readonly CONSOLE_MESSAGE: "browser.console.message";
14
+ readonly NETWORK_IO: 'browser.session.network.io';
15
+ readonly PAGES: 'browser.session.pages';
16
+ readonly CONSOLE_ERRORS: 'browser.session.console.errors';
17
+ readonly CONSOLE_LEVEL: 'browser.console.level';
18
+ readonly CONSOLE_MESSAGE: 'browser.console.message';
19
19
  };
20
- interface BrowserSessionOptions {
20
+ export interface BrowserSessionOptions {
21
21
  /** Your own session identifier. Defaults to the session span's id. */
22
22
  sessionId?: string;
23
23
  /** Playwright console levels kept as span events. Default: error, warning. */
@@ -30,8 +30,7 @@ interface BrowserSessionOptions {
30
30
  * The span is active for the callback, so any instrumented work started inside
31
31
  * it - including an agent whose RPC propagates trace context - joins the trace.
32
32
  */
33
- declare function withBrowserSession<T>(browserContext: BrowserContext, run: (session: {
33
+ export declare function withBrowserSession<T>(browserContext: BrowserContext, run: (session: {
34
34
  sessionId: string;
35
35
  }) => Promise<T>, options?: BrowserSessionOptions): Promise<T>;
36
- //#endregion
37
- export { BROWSER_SESSION_ATTRIBUTES, BrowserSessionOptions, withBrowserSession };
36
+ //#endregion
package/dist/session.d.ts CHANGED
@@ -4,20 +4,20 @@ import { BrowserContext } from "@playwright/test";
4
4
  * Session totals. `session.id` is canonical; the rest extend `browser.*`,
5
5
  * which OpenTelemetry defines for the browser but not for the driver.
6
6
  */
7
- declare const BROWSER_SESSION_ATTRIBUTES: {
8
- readonly SESSION_ID: "session.id";
7
+ export declare const BROWSER_SESSION_ATTRIBUTES: {
8
+ readonly SESSION_ID: 'session.id';
9
9
  /** Seconds of browser CPU, summed over the session's pages. */
10
- readonly CPU_TIME: "browser.session.cpu.time";
10
+ readonly CPU_TIME: 'browser.session.cpu.time';
11
11
  /** Peak JS heap in bytes across the session's pages. */
12
- readonly MEMORY_USAGE: "browser.session.memory.usage";
12
+ readonly MEMORY_USAGE: 'browser.session.memory.usage';
13
13
  /** Bytes on the wire, request and response, headers and bodies. */
14
- readonly NETWORK_IO: "browser.session.network.io";
15
- readonly PAGES: "browser.session.pages";
16
- readonly CONSOLE_ERRORS: "browser.session.console.errors";
17
- readonly CONSOLE_LEVEL: "browser.console.level";
18
- readonly CONSOLE_MESSAGE: "browser.console.message";
14
+ readonly NETWORK_IO: 'browser.session.network.io';
15
+ readonly PAGES: 'browser.session.pages';
16
+ readonly CONSOLE_ERRORS: 'browser.session.console.errors';
17
+ readonly CONSOLE_LEVEL: 'browser.console.level';
18
+ readonly CONSOLE_MESSAGE: 'browser.console.message';
19
19
  };
20
- interface BrowserSessionOptions {
20
+ export interface BrowserSessionOptions {
21
21
  /** Your own session identifier. Defaults to the session span's id. */
22
22
  sessionId?: string;
23
23
  /** Playwright console levels kept as span events. Default: error, warning. */
@@ -30,8 +30,7 @@ interface BrowserSessionOptions {
30
30
  * The span is active for the callback, so any instrumented work started inside
31
31
  * it - including an agent whose RPC propagates trace context - joins the trace.
32
32
  */
33
- declare function withBrowserSession<T>(browserContext: BrowserContext, run: (session: {
33
+ export declare function withBrowserSession<T>(browserContext: BrowserContext, run: (session: {
34
34
  sessionId: string;
35
35
  }) => Promise<T>, options?: BrowserSessionOptions): Promise<T>;
36
- //#endregion
37
- export { BROWSER_SESSION_ATTRIBUTES, BrowserSessionOptions, withBrowserSession };
36
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel-playwright",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "Playwright fixture for OpenTelemetry: one span per test and trace context injected into API requests",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -31,10 +31,10 @@
31
31
  "NOTICE"
32
32
  ],
33
33
  "dependencies": {
34
- "autotel": "7.9.0"
34
+ "autotel": "7.10.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@playwright/test": ">=1.62.0"
37
+ "@playwright/test": ">=1.63.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@playwright/test": {
@@ -42,11 +42,11 @@
42
42
  }
43
43
  },
44
44
  "devDependencies": {
45
- "@playwright/test": "^1.62.0",
46
- "@types/node": "^26.1.2",
47
- "tsdown": "^0.22.14",
48
- "typescript": "^6.0.3",
49
- "vitest": "^4.1.10"
45
+ "@playwright/test": "^1.63.0",
46
+ "@types/node": "^26.6.3",
47
+ "tsdown": "^0.23.0",
48
+ "typescript": "^7.0.2",
49
+ "vitest": "^5.0.2"
50
50
  },
51
51
  "repository": {
52
52
  "type": "git",
@@ -59,7 +59,7 @@
59
59
  "type-check": "tsc --noEmit",
60
60
  "test": "vitest run",
61
61
  "test:watch": "vitest",
62
- "lint": "eslint src",
62
+ "lint": "oxlint -c oxlint.json --disable-nested-config src",
63
63
  "clean": "rimraf dist"
64
64
  }
65
65
  }