@trafficwar/node 2.2.2 → 2.2.4

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.ts CHANGED
@@ -4,7 +4,7 @@ type JsonValue = JsonPrimitive | readonly JsonValue[] | {
4
4
  };
5
5
  type SpanKind = "server" | "client" | "producer" | "consumer" | "internal";
6
6
  type OpenString<T extends string> = T | (string & Record<never, never>);
7
- type EventCategory = OpenString<"http" | "database" | "redis" | "s3">;
7
+ type EventCategory = OpenString<"http" | "database" | "redis" | "s3" | "external">;
8
8
  type OperationType = OpenString<"route.handler" | "http.request" | "postgres.select" | "postgres.insert" | "postgres.update" | "postgres.delete" | "redis.get" | "redis.incr" | "s3.get_object" | "s3.put_object" | "s3.head_object">;
9
9
  type KnownS3Provider = "aws-s3" | "ovh-s3" | "minio";
10
10
  /**
@@ -28,9 +28,10 @@ interface TrafficWarEvent {
28
28
  label?: string;
29
29
  ip?: string;
30
30
  /**
31
- * Stable emitter or dependency alias. For S3, use a provider such as
32
- * `ovh-s3`, or `<bucket>.<provider>` such as `assets.ovh-s3` when separate
33
- * bucket stations are useful. Put the S3 action in `operation_type`.
31
+ * Stable emitter or dependency alias. External-service stations are keyed by
32
+ * this value. For S3, use a provider such as `ovh-s3`, or
33
+ * `<bucket>.<provider>` such as `assets.ovh-s3` when separate bucket stations
34
+ * are useful. Put the concrete action in `operation_type`.
34
35
  */
35
36
  source?: string;
36
37
  country?: string;
@@ -44,7 +45,7 @@ interface TrafficWarEvent {
44
45
  exception?: string;
45
46
  error_code?: string;
46
47
  span_kind?: SpanKind;
47
- /** Concrete work performed, such as `route.handler` or `s3.get_object`. */
48
+ /** Concrete work performed, such as `route.handler` or `google.routes.compute`. */
48
49
  operation_type?: OperationType;
49
50
  status_code?: number;
50
51
  }
@@ -64,6 +65,16 @@ interface TrafficWarOptions extends TrafficWarQueueOptions {
64
65
  baseUrl?: string | URL;
65
66
  /** Print batch lifecycle diagnostics without event payloads or credentials. */
66
67
  debug?: boolean;
68
+ /**
69
+ * At startup, statically scan application source for `capture()` calls and
70
+ * print each `event` and `label`. Defaults to `false`.
71
+ */
72
+ verbose?: boolean;
73
+ /**
74
+ * Directory scanned when `verbose` is true. Defaults to the process working
75
+ * directory.
76
+ */
77
+ catalogRoot?: string;
67
78
  timeoutMs?: number;
68
79
  maxRetries?: number;
69
80
  compression?: CompressionMode;
@@ -93,6 +104,7 @@ declare class TrafficWar {
93
104
  #private;
94
105
  readonly baseUrl: string;
95
106
  readonly debug: boolean;
107
+ readonly verbose: boolean;
96
108
  readonly timeoutMs: number;
97
109
  readonly maxRetries: number;
98
110
  readonly compression: CompressionMode;