@loadstrike/loadstrike-sdk 1.0.27101 → 1.0.29201

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.
@@ -285,6 +285,127 @@ class PushDiffusionEndpointDefinitionModel extends TrafficEndpointDefinitionMode
285
285
  }
286
286
  }
287
287
  }
288
+ export const GrpcMethodTypes = {
289
+ Unary: "Unary",
290
+ ServerStreaming: "ServerStreaming",
291
+ ClientStreaming: "ClientStreaming",
292
+ BidirectionalStreaming: "BidirectionalStreaming"
293
+ };
294
+ export class GrpcNativeClientOptions {
295
+ constructor(initial = {}) {
296
+ this.UseReflection = false;
297
+ this.UseTls = true;
298
+ this.AllowUntrustedCertificates = false;
299
+ this.DeadlineSeconds = 30;
300
+ this.Metadata = {};
301
+ this.RequestPayloadJsonStream = [];
302
+ const raw = asRecordOrEmpty(initial);
303
+ this.ProtoFilePath = pickOptionalEndpointString(raw, "ProtoFilePath", "protoFilePath");
304
+ this.DescriptorSetPath = pickOptionalEndpointString(raw, "DescriptorSetPath", "descriptorSetPath");
305
+ this.UseReflection = pickEndpointBoolean(raw, "UseReflection", "useReflection") ?? false;
306
+ this.UseTls = pickEndpointBoolean(raw, "UseTls", "useTls") ?? true;
307
+ this.AllowUntrustedCertificates = pickEndpointBoolean(raw, "AllowUntrustedCertificates", "allowUntrustedCertificates") ?? false;
308
+ const deadlineMs = pickOptionalEndpointNumber(raw, "DeadlineMs", "deadlineMs");
309
+ const deadlineSeconds = pickOptionalEndpointNumber(raw, "DeadlineSeconds", "deadlineSeconds", "Deadline", "deadline");
310
+ this.DeadlineSeconds = deadlineMs != null ? deadlineMs / 1000 : (deadlineSeconds ?? 30);
311
+ this.Metadata = pickEndpointStringRecord(raw, "Metadata", "metadata");
312
+ this.RequestPayloadJson = pickOptionalEndpointString(raw, "RequestPayloadJson", "requestPayloadJson");
313
+ this.RequestPayloadJsonStream = pickEndpointStringArray(raw, "RequestPayloadJsonStream", "requestPayloadJsonStream") ?? [];
314
+ }
315
+ Validate() {
316
+ this.validate();
317
+ }
318
+ validate() {
319
+ if (this.DeadlineSeconds <= 0) {
320
+ throw new RangeError("Deadline must be greater than zero.");
321
+ }
322
+ }
323
+ }
324
+ export const GrpcStatusMapper = {
325
+ fromStatusCode(statusCode) {
326
+ const names = {
327
+ 0: "OK",
328
+ 1: "CANCELLED",
329
+ 2: "UNKNOWN",
330
+ 3: "INVALID_ARGUMENT",
331
+ 4: "DEADLINE_EXCEEDED",
332
+ 5: "NOT_FOUND",
333
+ 6: "ALREADY_EXISTS",
334
+ 7: "PERMISSION_DENIED",
335
+ 8: "RESOURCE_EXHAUSTED",
336
+ 9: "FAILED_PRECONDITION",
337
+ 10: "ABORTED",
338
+ 11: "OUT_OF_RANGE",
339
+ 12: "UNIMPLEMENTED",
340
+ 13: "INTERNAL",
341
+ 14: "UNAVAILABLE",
342
+ 15: "DATA_LOSS",
343
+ 16: "UNAUTHENTICATED"
344
+ };
345
+ const normalized = Number.isFinite(statusCode) ? Math.trunc(statusCode) : 2;
346
+ const statusName = names[normalized] ?? "UNKNOWN";
347
+ return {
348
+ statusCode: normalized,
349
+ StatusCode: normalized,
350
+ statusName,
351
+ StatusName: statusName,
352
+ isSuccess: normalized === 0,
353
+ IsSuccess: normalized === 0
354
+ };
355
+ },
356
+ FromStatusCode(statusCode) {
357
+ return this.fromStatusCode(statusCode);
358
+ }
359
+ };
360
+ export class ProtocolMetricSnapshot {
361
+ constructor(initial = {}) {
362
+ this.protocol = "";
363
+ this.Protocol = "";
364
+ this.requests = 0;
365
+ this.Requests = 0;
366
+ this.messagesSent = 0;
367
+ this.MessagesSent = 0;
368
+ this.messagesReceived = 0;
369
+ this.MessagesReceived = 0;
370
+ this.latencyMs = 0;
371
+ this.LatencyMs = 0;
372
+ this.streamDurationMs = 0;
373
+ this.StreamDurationMs = 0;
374
+ this.bytesSent = 0;
375
+ this.BytesSent = 0;
376
+ this.bytesReceived = 0;
377
+ this.BytesReceived = 0;
378
+ this.reconnects = 0;
379
+ this.Reconnects = 0;
380
+ this.errors = 0;
381
+ this.Errors = 0;
382
+ this.status = "";
383
+ this.Status = "";
384
+ const raw = asRecordOrEmpty(initial);
385
+ this.protocol = pickOptionalEndpointString(raw, "protocol", "Protocol") ?? "";
386
+ this.Protocol = this.protocol;
387
+ this.requests = pickOptionalEndpointNumber(raw, "requests", "Requests") ?? 0;
388
+ this.Requests = this.requests;
389
+ this.messagesSent = pickOptionalEndpointNumber(raw, "messagesSent", "MessagesSent") ?? 0;
390
+ this.MessagesSent = this.messagesSent;
391
+ this.messagesReceived = pickOptionalEndpointNumber(raw, "messagesReceived", "MessagesReceived") ?? 0;
392
+ this.MessagesReceived = this.messagesReceived;
393
+ this.latencyMs = pickOptionalEndpointNumber(raw, "latencyMs", "LatencyMs") ?? 0;
394
+ this.LatencyMs = this.latencyMs;
395
+ this.streamDurationMs = pickOptionalEndpointNumber(raw, "streamDurationMs", "StreamDurationMs") ?? 0;
396
+ this.StreamDurationMs = this.streamDurationMs;
397
+ this.bytesSent = pickOptionalEndpointNumber(raw, "bytesSent", "BytesSent") ?? 0;
398
+ this.BytesSent = this.bytesSent;
399
+ this.bytesReceived = pickOptionalEndpointNumber(raw, "bytesReceived", "BytesReceived") ?? 0;
400
+ this.BytesReceived = this.bytesReceived;
401
+ this.reconnects = pickOptionalEndpointNumber(raw, "reconnects", "Reconnects") ?? 0;
402
+ this.Reconnects = this.reconnects;
403
+ this.errors = pickOptionalEndpointNumber(raw, "errors", "Errors") ?? 0;
404
+ this.Errors = this.errors;
405
+ this.status = pickOptionalEndpointString(raw, "status", "Status") ?? "";
406
+ this.Status = this.status;
407
+ }
408
+ }
288
409
  class GrpcEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
289
410
  constructor(initial) {
290
411
  super(initial);
@@ -307,14 +428,155 @@ class GrpcEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
307
428
  if (this.DeadlineSeconds <= 0) {
308
429
  throw new RangeError("Deadline must be greater than zero.");
309
430
  }
310
- if (this.Mode === "Produce" && typeof this.ProduceAsync !== "function") {
431
+ this.NativeClient?.validate();
432
+ if (this.Mode === "Produce" && typeof this.ProduceAsync !== "function" && !this.NativeClient) {
311
433
  throw new Error("ProduceAsync delegate must be provided when endpoint mode is Produce.");
312
434
  }
313
- if (this.Mode === "Consume" && typeof this.ConsumeAsync !== "function") {
435
+ if (this.Mode === "Consume" && typeof this.ConsumeAsync !== "function" && !this.NativeClient) {
314
436
  throw new Error("ConsumeAsync delegate must be provided when endpoint mode is Consume.");
315
437
  }
316
438
  }
317
439
  }
440
+ export class WebSocketReconnectPolicy {
441
+ constructor(initial = {}) {
442
+ this.MaxAttempts = 0;
443
+ this.maxAttempts = 0;
444
+ this.DelaySeconds = 1;
445
+ this.delaySeconds = 1;
446
+ const raw = asRecordOrEmpty(initial);
447
+ this.MaxAttempts = Math.trunc(pickOptionalEndpointNumber(raw, "MaxAttempts", "maxAttempts") ?? 0);
448
+ this.maxAttempts = this.MaxAttempts;
449
+ const delayMs = pickOptionalEndpointNumber(raw, "DelayMs", "delayMs");
450
+ this.DelaySeconds = delayMs != null
451
+ ? delayMs / 1000
452
+ : (pickOptionalEndpointNumber(raw, "DelaySeconds", "delaySeconds", "Delay", "delay") ?? 1);
453
+ this.delaySeconds = this.DelaySeconds;
454
+ }
455
+ Validate() {
456
+ this.validate();
457
+ }
458
+ validate() {
459
+ if (this.MaxAttempts < 0) {
460
+ throw new RangeError("MaxAttempts cannot be negative.");
461
+ }
462
+ if (this.DelaySeconds < 0) {
463
+ throw new RangeError("Delay cannot be negative.");
464
+ }
465
+ }
466
+ }
467
+ export class WebSocketMessageSpec {
468
+ constructor(initial = {}) {
469
+ this.Kind = "Text";
470
+ this.kind = "Text";
471
+ const raw = asRecordOrEmpty(initial);
472
+ this.Kind = pickOptionalEndpointString(raw, "Kind", "kind") ?? "Text";
473
+ this.kind = this.Kind;
474
+ this.TextPayload = pickOptionalEndpointString(raw, "TextPayload", "textPayload");
475
+ this.textPayload = this.TextPayload;
476
+ const binary = pickEndpointValue(raw, "BinaryPayload", "binaryPayload");
477
+ if (binary instanceof Uint8Array) {
478
+ this.BinaryPayload = binary;
479
+ }
480
+ else if (Array.isArray(binary)) {
481
+ this.BinaryPayload = Uint8Array.from(binary.map((value) => Number(value) & 0xff));
482
+ }
483
+ this.binaryPayload = this.BinaryPayload;
484
+ }
485
+ static Text(payload) {
486
+ return new WebSocketMessageSpec({ Kind: "Text", TextPayload: payload });
487
+ }
488
+ static Binary(payload) {
489
+ return new WebSocketMessageSpec({ Kind: "Binary", BinaryPayload: payload });
490
+ }
491
+ Validate() {
492
+ this.validate();
493
+ }
494
+ validate() {
495
+ if (this.Kind.toLowerCase() === "text" && this.TextPayload == null) {
496
+ throw new Error("Text WebSocket messages require TextPayload.");
497
+ }
498
+ if (this.Kind.toLowerCase() === "binary" && this.BinaryPayload == null) {
499
+ throw new Error("Binary WebSocket messages require BinaryPayload.");
500
+ }
501
+ }
502
+ }
503
+ export class WebSocketExpectedMessage {
504
+ constructor(initial = {}) {
505
+ this.TimeoutSeconds = 30;
506
+ this.timeoutSeconds = 30;
507
+ const raw = asRecordOrEmpty(initial);
508
+ this.ContainsText = pickOptionalEndpointString(raw, "ContainsText", "containsText");
509
+ this.containsText = this.ContainsText;
510
+ const bytes = pickEndpointValue(raw, "ContainsBytes", "containsBytes");
511
+ if (bytes instanceof Uint8Array) {
512
+ this.ContainsBytes = bytes;
513
+ }
514
+ else if (Array.isArray(bytes)) {
515
+ this.ContainsBytes = Uint8Array.from(bytes.map((value) => Number(value) & 0xff));
516
+ }
517
+ this.containsBytes = this.ContainsBytes;
518
+ const timeoutMs = pickOptionalEndpointNumber(raw, "TimeoutMs", "timeoutMs");
519
+ this.TimeoutSeconds = timeoutMs != null
520
+ ? timeoutMs / 1000
521
+ : (pickOptionalEndpointNumber(raw, "TimeoutSeconds", "timeoutSeconds", "Timeout", "timeout") ?? 30);
522
+ this.timeoutSeconds = this.TimeoutSeconds;
523
+ }
524
+ Validate() {
525
+ this.validate();
526
+ }
527
+ validate() {
528
+ if (this.TimeoutSeconds <= 0) {
529
+ throw new RangeError("Timeout must be greater than zero.");
530
+ }
531
+ }
532
+ }
533
+ export class WebSocketNativeClientOptions {
534
+ constructor(initial = {}) {
535
+ this.Headers = {};
536
+ this.headers = {};
537
+ this.Cookies = [];
538
+ this.cookies = [];
539
+ this.Reconnect = new WebSocketReconnectPolicy();
540
+ this.reconnect = this.Reconnect;
541
+ this.Messages = [];
542
+ this.messages = [];
543
+ this.ExpectedMessages = [];
544
+ this.expectedMessages = [];
545
+ const raw = asRecordOrEmpty(initial);
546
+ this.Headers = pickEndpointStringRecord(raw, "Headers", "headers");
547
+ this.headers = this.Headers;
548
+ this.Cookies = pickEndpointStringArray(raw, "Cookies", "cookies") ?? [];
549
+ this.cookies = this.Cookies;
550
+ const pingMs = pickOptionalEndpointNumber(raw, "PingIntervalMs", "pingIntervalMs");
551
+ const pingSeconds = pickOptionalEndpointNumber(raw, "PingIntervalSeconds", "pingIntervalSeconds", "PingInterval", "pingInterval");
552
+ this.PingIntervalSeconds = pingMs != null ? pingMs / 1000 : pingSeconds;
553
+ this.pingIntervalSeconds = this.PingIntervalSeconds;
554
+ const reconnect = pickEndpointValue(raw, "Reconnect", "reconnect");
555
+ this.Reconnect = reconnect instanceof WebSocketReconnectPolicy
556
+ ? reconnect
557
+ : new WebSocketReconnectPolicy(asRecordOrEmpty(reconnect));
558
+ this.reconnect = this.Reconnect;
559
+ this.Messages = normalizeWebSocketMessages(pickEndpointValue(raw, "Messages", "messages"));
560
+ this.messages = this.Messages;
561
+ this.ExpectedMessages = normalizeWebSocketExpectedMessages(pickEndpointValue(raw, "ExpectedMessages", "expectedMessages"));
562
+ this.expectedMessages = this.ExpectedMessages;
563
+ }
564
+ Validate() {
565
+ this.validate();
566
+ }
567
+ validate() {
568
+ if (this.PingIntervalSeconds != null && this.PingIntervalSeconds <= 0) {
569
+ throw new RangeError("PingInterval must be greater than zero.");
570
+ }
571
+ this.Reconnect.validate();
572
+ for (const message of this.Messages) {
573
+ message.validate();
574
+ }
575
+ for (const expected of this.ExpectedMessages) {
576
+ expected.validate();
577
+ }
578
+ }
579
+ }
318
580
  class WebSocketEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
319
581
  constructor(initial) {
320
582
  super(initial);
@@ -345,10 +607,11 @@ class WebSocketEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
345
607
  if (this.CloseTimeoutSeconds <= 0) {
346
608
  throw new RangeError("CloseTimeout must be greater than zero.");
347
609
  }
348
- if (this.Mode === "Produce" && typeof this.ProduceAsync !== "function") {
610
+ this.NativeClient?.validate();
611
+ if (this.Mode === "Produce" && typeof this.ProduceAsync !== "function" && !this.NativeClient) {
349
612
  throw new Error("ProduceAsync delegate must be provided when endpoint mode is Produce.");
350
613
  }
351
- if (this.Mode === "Consume" && typeof this.ConsumeAsync !== "function") {
614
+ if (this.Mode === "Consume" && typeof this.ConsumeAsync !== "function" && !this.NativeClient) {
352
615
  throw new Error("ConsumeAsync delegate must be provided when endpoint mode is Consume.");
353
616
  }
354
617
  }
@@ -862,6 +1125,12 @@ function initializeGrpcEndpointDefinitionModel(target, initial) {
862
1125
  if (hasAnyEndpointField(raw, ["Metadata", "metadata"])) {
863
1126
  target.Metadata = pickEndpointStringRecord(raw, "Metadata", "metadata");
864
1127
  }
1128
+ if (hasAnyEndpointField(raw, ["NativeClient", "nativeClient"])) {
1129
+ const nativeClient = pickEndpointValue(raw, "NativeClient", "nativeClient");
1130
+ target.NativeClient = nativeClient instanceof GrpcNativeClientOptions
1131
+ ? nativeClient
1132
+ : new GrpcNativeClientOptions(asRecordOrEmpty(nativeClient));
1133
+ }
865
1134
  }
866
1135
  function initializeWebSocketEndpointDefinitionModel(target, initial) {
867
1136
  const raw = asRecordOrEmpty(initial);
@@ -908,6 +1177,12 @@ function initializeWebSocketEndpointDefinitionModel(target, initial) {
908
1177
  if (hasAnyEndpointField(raw, ["ConnectionMetadata", "connectionMetadata"])) {
909
1178
  target.ConnectionMetadata = pickEndpointStringRecord(raw, "ConnectionMetadata", "connectionMetadata");
910
1179
  }
1180
+ if (hasAnyEndpointField(raw, ["NativeClient", "nativeClient"])) {
1181
+ const nativeClient = pickEndpointValue(raw, "NativeClient", "nativeClient");
1182
+ target.NativeClient = nativeClient instanceof WebSocketNativeClientOptions
1183
+ ? nativeClient
1184
+ : new WebSocketNativeClientOptions(asRecordOrEmpty(nativeClient));
1185
+ }
911
1186
  }
912
1187
  function validateTrafficEndpointDefinitionModel(target) {
913
1188
  requireNonEmptyString(target.Name, "Endpoint name must be provided.");
@@ -2248,7 +2523,9 @@ const DELEGATE_STREAM_ENDPOINT_FLAT_KEYS = [
2248
2523
  "ConsumeAsync",
2249
2524
  "consumeAsync",
2250
2525
  "ConnectionMetadata",
2251
- "connectionMetadata"
2526
+ "connectionMetadata",
2527
+ "NativeClient",
2528
+ "nativeClient"
2252
2529
  ];
2253
2530
  const GRPC_ENDPOINT_FLAT_KEYS = [
2254
2531
  "Target",
@@ -2276,7 +2553,9 @@ const GRPC_ENDPOINT_FLAT_KEYS = [
2276
2553
  "ConsumeAsync",
2277
2554
  "consumeAsync",
2278
2555
  "ConnectionMetadata",
2279
- "connectionMetadata"
2556
+ "connectionMetadata",
2557
+ "NativeClient",
2558
+ "nativeClient"
2280
2559
  ];
2281
2560
  const WEB_SOCKET_ENDPOINT_FLAT_KEYS = [
2282
2561
  "Url",
@@ -2436,7 +2715,9 @@ function resolveEndpointKind(raw) {
2436
2715
  "MethodName",
2437
2716
  "methodName",
2438
2717
  "MethodType",
2439
- "methodType"
2718
+ "methodType",
2719
+ "NativeClient",
2720
+ "nativeClient"
2440
2721
  ])) {
2441
2722
  return "Grpc";
2442
2723
  }
@@ -2446,7 +2727,9 @@ function resolveEndpointKind(raw) {
2446
2727
  "ConnectTimeoutSeconds",
2447
2728
  "connectTimeoutSeconds",
2448
2729
  "CloseTimeoutSeconds",
2449
- "closeTimeoutSeconds"
2730
+ "closeTimeoutSeconds",
2731
+ "NativeClient",
2732
+ "nativeClient"
2450
2733
  ])) {
2451
2734
  return "WebSocket";
2452
2735
  }
@@ -2580,6 +2863,22 @@ function normalizeDelegateEndpointOptions(options) {
2580
2863
  function normalizeProtocolOptions(options) {
2581
2864
  return Object.keys(options).length ? options : undefined;
2582
2865
  }
2866
+ function normalizeWebSocketMessages(value) {
2867
+ if (!Array.isArray(value)) {
2868
+ return [];
2869
+ }
2870
+ return value.map((entry) => entry instanceof WebSocketMessageSpec
2871
+ ? entry
2872
+ : new WebSocketMessageSpec(asRecordOrEmpty(entry)));
2873
+ }
2874
+ function normalizeWebSocketExpectedMessages(value) {
2875
+ if (!Array.isArray(value)) {
2876
+ return [];
2877
+ }
2878
+ return value.map((entry) => entry instanceof WebSocketExpectedMessage
2879
+ ? entry
2880
+ : new WebSocketExpectedMessage(asRecordOrEmpty(entry)));
2881
+ }
2583
2882
  function pickEndpointValue(record, ...keys) {
2584
2883
  return pickProtocolValue(record, ...keys);
2585
2884
  }
@@ -2817,10 +3116,14 @@ function validateGrpcEndpoint(endpoint, mode) {
2817
3116
  || (hasOptionValue(options, "DeadlineSeconds", "deadlineSeconds", "Deadline", "deadline") && deadlineSeconds <= 0)) {
2818
3117
  throw new RangeError("Deadline must be greater than zero.");
2819
3118
  }
2820
- if (mode === "Produce" && !resolveStructuredProduceDelegate(endpoint) && !resolveProduceDelegate(endpoint)) {
3119
+ const nativeClient = pickEndpointValue(options, "NativeClient", "nativeClient");
3120
+ if (nativeClient != null) {
3121
+ new GrpcNativeClientOptions(asRecordOrEmpty(nativeClient)).validate();
3122
+ }
3123
+ if (mode === "Produce" && !resolveStructuredProduceDelegate(endpoint) && !resolveProduceDelegate(endpoint) && nativeClient == null) {
2821
3124
  throw new Error("ProduceAsync delegate must be provided when endpoint mode is Produce.");
2822
3125
  }
2823
- if (mode === "Consume" && !resolveStructuredConsumeDelegate(endpoint) && !resolveStructuredConsumeStreamDelegate(endpoint) && !resolveConsumeDelegate(endpoint)) {
3126
+ if (mode === "Consume" && !resolveStructuredConsumeDelegate(endpoint) && !resolveStructuredConsumeStreamDelegate(endpoint) && !resolveConsumeDelegate(endpoint) && nativeClient == null) {
2824
3127
  throw new Error("ConsumeAsync delegate must be provided when endpoint mode is Consume.");
2825
3128
  }
2826
3129
  }
@@ -2849,10 +3152,14 @@ function validateWebSocketEndpoint(endpoint, mode) {
2849
3152
  || (hasOptionValue(options, "CloseTimeoutSeconds", "closeTimeoutSeconds", "CloseTimeout", "closeTimeout") && closeSeconds <= 0)) {
2850
3153
  throw new RangeError("CloseTimeout must be greater than zero.");
2851
3154
  }
2852
- if (mode === "Produce" && !resolveStructuredProduceDelegate(endpoint) && !resolveProduceDelegate(endpoint)) {
3155
+ const nativeClient = pickEndpointValue(options, "NativeClient", "nativeClient");
3156
+ if (nativeClient != null) {
3157
+ new WebSocketNativeClientOptions(asRecordOrEmpty(nativeClient)).validate();
3158
+ }
3159
+ if (mode === "Produce" && !resolveStructuredProduceDelegate(endpoint) && !resolveProduceDelegate(endpoint) && nativeClient == null) {
2853
3160
  throw new Error("ProduceAsync delegate must be provided when endpoint mode is Produce.");
2854
3161
  }
2855
- if (mode === "Consume" && !resolveStructuredConsumeDelegate(endpoint) && !resolveStructuredConsumeStreamDelegate(endpoint) && !resolveConsumeDelegate(endpoint)) {
3162
+ if (mode === "Consume" && !resolveStructuredConsumeDelegate(endpoint) && !resolveStructuredConsumeStreamDelegate(endpoint) && !resolveConsumeDelegate(endpoint) && nativeClient == null) {
2856
3163
  throw new Error("ConsumeAsync delegate must be provided when endpoint mode is Consume.");
2857
3164
  }
2858
3165
  }
@@ -3,6 +3,7 @@ export type LoadStrikeDateValue = string | Date;
3
3
  export interface LoadStrikeRunRequest {
4
4
  Context?: LoadStrikeRunContext | Record<string, unknown>;
5
5
  Scenarios?: Array<LoadStrikeScenarioSpec | Record<string, unknown>>;
6
+ ScenarioSourceAnalysis?: Array<LoadStrikeScenarioSourceAnalysisSpec | Record<string, unknown>>;
6
7
  RunArgs?: string[];
7
8
  }
8
9
  export interface LoadStrikeRunContext {
@@ -45,6 +46,17 @@ export interface LoadStrikeScenarioSpec {
45
46
  LoadSimulations?: LoadStrikeLoadSimulationSpec[];
46
47
  Thresholds?: Array<LoadStrikeThresholdSpec | Record<string, unknown>>;
47
48
  Tracking?: LoadStrikeTrackingConfigurationSpec | Record<string, unknown>;
49
+ ScenarioSourceAnalysis?: LoadStrikeScenarioSourceAnalysisSpec | Record<string, unknown>;
50
+ }
51
+ export interface LoadStrikeScenarioSourceAnalysisSpec {
52
+ ScenarioName: string;
53
+ Language: string;
54
+ AnalyzerVersion: string;
55
+ ScenarioBlockLineCount: number;
56
+ LocalMethodLineCount: number;
57
+ TotalCountedLineCount: number;
58
+ IgnoredExternalCallCount: number;
59
+ Warnings?: string[];
48
60
  }
49
61
  export interface LoadStrikeLoadSimulationSpec {
50
62
  Kind: string;
@@ -2,11 +2,11 @@ export type { LoadStrikeDateValue, LoadStrikeObject, LoadStrikeRunContext as Loa
2
2
  export { LoadStrikeAutopilot, LoadStrikeAutopilotResult } from "./autopilot.js";
3
3
  export type { LoadStrikeAutopilotEndpoint, LoadStrikeAutopilotEndpointBinding, LoadStrikeAutopilotLoadSimulationSuggestion, LoadStrikeAutopilotMessageSample, LoadStrikeAutopilotOptions, LoadStrikeAutopilotPlan, LoadStrikeAutopilotPreviewReport, LoadStrikeAutopilotReadinessFailure, LoadStrikeAutopilotRedaction, LoadStrikeAutopilotRequest, LoadStrikeAutopilotResultShape, LoadStrikeAutopilotScenarioPlan, LoadStrikeAutopilotSecretBinding, LoadStrikeAutopilotThresholdSuggestion, LoadStrikeAutopilotTrackingSelectorSuggestion } from "./autopilot-contracts.js";
4
4
  export { LoadStrikeAutopilotReadiness } from "./autopilot-contracts.js";
5
- export { CrossPlatformScenarioConfigurator, ScenarioTrackingExtensions, LoadStrikeContext, LoadStrikeAccessibility, LoadStrikeBrowserWebVitals, LoadStrikePluginData, LoadStrikePluginDataTable, LoadStrikeNodeType, LoadStrikeReportFormat, LoadStrikeResponse, LoadStrikeLogLevel, LoadStrikeScenarioOperation, LoadStrikeOperationType, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeScenarioShare, LoadStrikeSimulation, LoadStrikeTrafficMix, CrossPlatformTrackingConfiguration, LoadStrikeMetric, LoadStrikeCounter, LoadStrikeGauge, LoadStrikeStep, LoadStrikeThreshold } from "./runtime.js";
6
- export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeReportingSink, LoadStrikeRuntimePolicy, LoadStrikeRunnerOptions, LoadStrikeRunContext as LoadStrikeRuntimeContext, LoadStrikeRunContext, LoadStrikeAccessibilityOptions, LoadStrikeAccessibilityViolation, LoadStrikeAccessibilityResult, LoadStrikeAccessibilityCheckContext, LoadStrikeBrowserWebVitalsOptions, LoadStrikeBrowserWebVitalsResult, LoadStrikeBrowserWebVitalsContext, LoadStrikeBaseContext, LoadStrikeCounterStats, LoadStrikeDataTransferStats, LoadStrikeGaugeStats, LoadStrikeLogger, LoadStrikeLoadSimulationStats, LoadStrikeMeasurementStats, LoadStrikeMetricStats, LoadStrikeNodeInfo, LoadStrikeMetricValue, LoadStrikeRandom, LoadStrikeReply, LoadStrikeLatencyCount, LoadStrikeLatencyStats, LoadStrikeLoadSimulation, LoadStrikeScenarioInfo, LoadStrikeScenarioInitContext, LoadStrikeScenarioPartition, LoadStrikeScenarioStartInfo, LoadStrikeScenarioContext, LoadStrikeScenarioStats, LoadStrikeTestInfo, LoadStrikeScenarioRuntime, LoadStrikeSessionStartInfo, LoadStrikeSinkSession, LoadStrikeSinkError, LoadStrikeStatusCodeStats, LoadStrikeThresholdResult, LoadStrikeThresholdPredicateContext, LoadStrikeStepReply, LoadStrikeStepStats, LoadStrikeStepRuntime, LoadStrikeThresholdOptions, LoadStrikeRequestStats, LoadStrikeWorkerPlugin } from "./runtime.js";
5
+ export { CrossPlatformScenarioConfigurator, ScenarioTrackingExtensions, LoadStrikeContext, LoadStrikeAccessibility, LoadStrikeAccessibilityAdapters, LoadStrikeAccessibilityBaseline, LoadStrikeAccessibilityCiGate, LoadStrikeAccessibilityScanner, LoadStrikeBrowserWebVitals, LoadStrikeBrowserWebVitalsCollector, LoadStrikePluginData, LoadStrikePluginDataTable, LoadStrikeNodeType, LoadStrikeReportFormat, LoadStrikeResponse, LoadStrikeLogLevel, LoadStrikeScenarioOperation, LoadStrikeOperationType, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeScenarioShare, LoadStrikeSimulation, LoadStrikeTrafficMix, CrossPlatformTrackingConfiguration, LoadStrikeMetric, LoadStrikeCounter, LoadStrikeGauge, LoadStrikeStep, LoadStrikeThreshold } from "./runtime.js";
6
+ export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeReportingSink, LoadStrikeRuntimePolicy, LoadStrikeRunnerOptions, LoadStrikeRunContext as LoadStrikeRuntimeContext, LoadStrikeRunContext, LoadStrikeAccessibilityOptions, LoadStrikeAccessibilityBaselineOutcome, LoadStrikeAccessibilityCiGateOutcome, LoadStrikeAccessibilityViolation, LoadStrikeKeyboardFocusResult, LoadStrikeAccessibilityResult, LoadStrikeAccessibilityCheckContext, LoadStrikeBrowserWebVitalsOptions, LoadStrikeBrowserWebVitalsResult, LoadStrikeBrowserWebVitalsContext, LoadStrikeBaseContext, LoadStrikeCounterStats, LoadStrikeDataTransferStats, LoadStrikeGaugeStats, LoadStrikeLogger, LoadStrikeLoadSimulationStats, LoadStrikeMeasurementStats, LoadStrikeMetricStats, LoadStrikeNodeInfo, LoadStrikeMetricValue, LoadStrikeRandom, LoadStrikeReply, LoadStrikeLatencyCount, LoadStrikeLatencyStats, LoadStrikeLoadSimulation, LoadStrikeScenarioInfo, LoadStrikeScenarioInitContext, LoadStrikeScenarioPartition, LoadStrikeScenarioStartInfo, LoadStrikeScenarioContext, LoadStrikeScenarioStats, LoadStrikeTestInfo, LoadStrikeScenarioRuntime, LoadStrikeSessionStartInfo, LoadStrikeSinkSession, LoadStrikeSinkError, LoadStrikeStatusCodeStats, LoadStrikeThresholdResult, LoadStrikeThresholdPredicateContext, LoadStrikeStepReply, LoadStrikeStepStats, LoadStrikeStepRuntime, LoadStrikeThresholdOptions, LoadStrikeRequestStats, LoadStrikeWorkerPlugin } from "./runtime.js";
7
7
  export { CorrelationStoreConfiguration, CrossPlatformTrackingRuntime, InMemoryCorrelationStore, RedisCorrelationStoreOptions, RedisCorrelationStore, TrackingPayloadBuilder, TrackingFieldSelector } from "./correlation.js";
8
8
  export type { CorrelationEntry, DestinationConsumeResult, GatheredRow, CorrelationStoreKind, CorrelationRuntimeOptions, CorrelationRuntimePlugin, CorrelationRuntimeStats, CorrelationStore, SourceProduceResult, TrackingFieldLocation, TrackingPayload } from "./correlation.js";
9
- export { LOADSTRIKE_TRACE_ID_HEADER, LOADSTRIKE_TRACE_ID_TRACKING_FIELD, TrafficEndpointDefinition, HttpEndpointDefinition, KafkaEndpointDefinition, KafkaSaslOptions, RabbitMqEndpointDefinition, NatsEndpointDefinition, RedisStreamsEndpointDefinition, AzureEventHubsEndpointDefinition, SqsEndpointDefinition, DelegateStreamEndpointDefinition, PushDiffusionEndpointDefinition, GrpcEndpointDefinition, WebSocketEndpointDefinition, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
9
+ export { LOADSTRIKE_TRACE_ID_HEADER, LOADSTRIKE_TRACE_ID_TRACKING_FIELD, TrafficEndpointDefinition, HttpEndpointDefinition, KafkaEndpointDefinition, KafkaSaslOptions, RabbitMqEndpointDefinition, NatsEndpointDefinition, RedisStreamsEndpointDefinition, AzureEventHubsEndpointDefinition, SqsEndpointDefinition, DelegateStreamEndpointDefinition, PushDiffusionEndpointDefinition, GrpcEndpointDefinition, GrpcMethodTypes, GrpcNativeClientOptions, GrpcStatusMapper, ProtocolMetricSnapshot, WebSocketEndpointDefinition, WebSocketExpectedMessage, WebSocketMessageSpec, WebSocketNativeClientOptions, WebSocketReconnectPolicy, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
10
10
  export type { EndpointAdapter, EndpointDefinition, EndpointDefinitionInput, EndpointKind, EndpointMode, DotNetDelegateEndpointOptions, DotNetEndpointDefinition, DotNetHttpAuthOptions, DotNetHttpEndpointOptions, DotNetHttpOAuth2ClientCredentialsOptions, HttpAuthMode, HttpAuthType, HttpRequestBodyType, HttpResponseSource, HttpTrackingPayloadSource, KafkaSaslMechanismType, KafkaSecurityProtocolType, HttpEndpointOptions, KafkaEndpointOptions, RabbitMqEndpointOptions, NatsEndpointOptions, RedisStreamsEndpointOptions, AzureEventHubsEndpointOptions, SqsEndpointOptions, PushDiffusionEndpointOptions, GrpcEndpointOptions, WebSocketEndpointOptions, GrpcEndpointDefinition as GrpcEndpointDefinitionShape, WebSocketEndpointDefinition as WebSocketEndpointDefinitionShape, TrackingFieldSelectorInput, TrackingRunMode, TrafficEndpointKind, TrafficEndpointMode, ProducedMessageRequest, ProducedMessageResult, ConsumedMessage, DelegateConsumeAsync, DelegateConsumeStreamHandler, DelegateEndpointOptions } from "./transports.js";
11
- export { DatadogReportingSink, DatadogReportingSinkOptions, GrafanaLokiReportingSink, GrafanaLokiReportingSinkOptions, InfluxDbReportingSink, InfluxDbReportingSinkOptions, OtelCollectorReportingSink, OtelCollectorReportingSinkOptions, PortalReportingSink, SplunkReportingSink, SplunkReportingSinkOptions, TimescaleDbReportingSink, TimescaleDbReportingSinkOptions } from "./sinks.js";
12
- export type { DatadogSinkOptions, GrafanaLokiSinkOptions, InfluxDbSinkOptions, OtelCollectorSinkOptions, PortalReportingSinkOptionsInput, SplunkSinkOptions, TimescaleDbSinkOptions } from "./sinks.js";
11
+ export { DatadogReportingSink, DatadogReportingSinkOptions, DogStatsDReportingSink, CloudWatchReportingSink, DynatraceReportingSink, ElasticsearchReportingSink, GrafanaLokiReportingSink, GrafanaLokiReportingSinkOptions, GenericWebhookReportingSink, InfluxDbReportingSink, InfluxDbReportingSinkOptions, JsonlFileReportingSink, KafkaReportingSink, NetdataStatsDReportingSink, NewRelicReportingSink, OtelCollectorReportingSink, OtelCollectorReportingSinkOptions, OpenSearchReportingSink, PortalReportingSink, PrometheusRemoteWriteReportingSink, SplunkReportingSink, SplunkReportingSinkOptions, StatsDReportingSink, TimescaleDbReportingSink, TimescaleDbReportingSinkOptions } from "./sinks.js";
12
+ export type { DatadogSinkOptions, ExpandedSinkOptionsInput, GrafanaLokiSinkOptions, InfluxDbSinkOptions, JsonlFileReportingSinkOptionsInput, KafkaReportingSinkOptionsInput, OtelCollectorSinkOptions, PortalReportingSinkOptionsInput, SplunkSinkOptions, StatsDReportingSinkOptionsInput, TimescaleDbSinkOptions } from "./sinks.js";
@@ -697,6 +697,18 @@ export interface LoadStrikeAccessibilityViolation {
697
697
  export interface LoadStrikeAccessibilityResult {
698
698
  url?: string;
699
699
  violations?: LoadStrikeAccessibilityViolation[];
700
+ keyboardFocus?: LoadStrikeKeyboardFocusResult;
701
+ totalViolations?: number;
702
+ criticalViolations?: number;
703
+ seriousViolations?: number;
704
+ moderateViolations?: number;
705
+ minorViolations?: number;
706
+ }
707
+ export interface LoadStrikeKeyboardFocusResult {
708
+ tabbableElementCount?: number;
709
+ visibleFocusFailures?: number;
710
+ missingSkipLinkCount?: number;
711
+ focusOrder?: string[];
700
712
  }
701
713
  export interface LoadStrikeAccessibilityCheckContext {
702
714
  options: LoadStrikeAccessibilityOptions;
@@ -1523,6 +1535,60 @@ export declare class LoadStrikeContext {
1523
1535
  */
1524
1536
  withRegisteredScenarios(...scenarios: LoadStrikeScenario[]): LoadStrikeContext;
1525
1537
  }
1538
+ export declare class LoadStrikeAccessibilityBaseline {
1539
+ readonly allowedRuleIds: string[];
1540
+ readonly AllowedRuleIds: string[];
1541
+ readonly maxNewViolations: number;
1542
+ readonly MaxNewViolations: number;
1543
+ constructor(initial?: Record<string, unknown>);
1544
+ compare(result: LoadStrikeAccessibilityResult): LoadStrikeAccessibilityBaselineOutcome;
1545
+ Compare(result: LoadStrikeAccessibilityResult): LoadStrikeAccessibilityBaselineOutcome;
1546
+ }
1547
+ export interface LoadStrikeAccessibilityBaselineOutcome {
1548
+ passed: boolean;
1549
+ Passed: boolean;
1550
+ newViolationCount: number;
1551
+ NewViolationCount: number;
1552
+ newRuleIds: string[];
1553
+ NewRuleIds: string[];
1554
+ }
1555
+ export declare class LoadStrikeAccessibilityCiGate {
1556
+ readonly maxViolations?: number;
1557
+ readonly MaxViolations?: number;
1558
+ readonly maxCriticalViolations?: number;
1559
+ readonly MaxCriticalViolations?: number;
1560
+ readonly maxSeriousViolations?: number;
1561
+ readonly MaxSeriousViolations?: number;
1562
+ readonly baseline?: LoadStrikeAccessibilityBaseline;
1563
+ readonly Baseline?: LoadStrikeAccessibilityBaseline;
1564
+ constructor(initial?: Record<string, unknown>);
1565
+ evaluate(result: LoadStrikeAccessibilityResult): LoadStrikeAccessibilityCiGateOutcome;
1566
+ Evaluate(result: LoadStrikeAccessibilityResult): LoadStrikeAccessibilityCiGateOutcome;
1567
+ }
1568
+ export interface LoadStrikeAccessibilityCiGateOutcome {
1569
+ passed: boolean;
1570
+ Passed: boolean;
1571
+ reasons: string[];
1572
+ Reasons: string[];
1573
+ }
1574
+ export declare class LoadStrikeAccessibilityScanner {
1575
+ static scanHtml(options: LoadStrikeAccessibilityOptions, html: string): LoadStrikeAccessibilityResult;
1576
+ static ScanHtml(options: LoadStrikeAccessibilityOptions, html: string): LoadStrikeAccessibilityResult;
1577
+ }
1578
+ export declare class LoadStrikeAccessibilityAdapters {
1579
+ static fromPlaywrightPageAsync(options: LoadStrikeAccessibilityOptions, page: unknown): Promise<LoadStrikeAccessibilityResult>;
1580
+ static FromPlaywrightPageAsync(options: LoadStrikeAccessibilityOptions, page: unknown): Promise<LoadStrikeAccessibilityResult>;
1581
+ static fromSeleniumDriver(options: LoadStrikeAccessibilityOptions, driver: unknown): LoadStrikeAccessibilityResult;
1582
+ static FromSeleniumDriver(options: LoadStrikeAccessibilityOptions, driver: unknown): LoadStrikeAccessibilityResult;
1583
+ }
1584
+ export declare class LoadStrikeBrowserWebVitalsCollector {
1585
+ static fromPerformanceSnapshot(options: LoadStrikeBrowserWebVitalsOptions, snapshot: unknown): LoadStrikeBrowserWebVitalsResult;
1586
+ static FromPerformanceSnapshot(options: LoadStrikeBrowserWebVitalsOptions, snapshot: unknown): LoadStrikeBrowserWebVitalsResult;
1587
+ static fromPlaywrightPageAsync(options: LoadStrikeBrowserWebVitalsOptions, page: unknown): Promise<LoadStrikeBrowserWebVitalsResult>;
1588
+ static FromPlaywrightPageAsync(options: LoadStrikeBrowserWebVitalsOptions, page: unknown): Promise<LoadStrikeBrowserWebVitalsResult>;
1589
+ static fromSeleniumDriver(options: LoadStrikeBrowserWebVitalsOptions, driver: unknown): LoadStrikeBrowserWebVitalsResult;
1590
+ static FromSeleniumDriver(options: LoadStrikeBrowserWebVitalsOptions, driver: unknown): LoadStrikeBrowserWebVitalsResult;
1591
+ }
1526
1592
  export declare class LoadStrikeAccessibility {
1527
1593
  static createScenario(name: string, options: LoadStrikeAccessibilityOptions, check: (context: LoadStrikeAccessibilityCheckContext) => Promise<LoadStrikeAccessibilityResult> | LoadStrikeAccessibilityResult): LoadStrikeScenario;
1528
1594
  static CreateScenario(name: string, options: LoadStrikeAccessibilityOptions, check: (context: LoadStrikeAccessibilityCheckContext) => Promise<LoadStrikeAccessibilityResult> | LoadStrikeAccessibilityResult): LoadStrikeScenario;
@@ -1662,6 +1728,7 @@ export declare class LoadStrikeScenario {
1662
1728
  */
1663
1729
  shouldRestartIterationOnFail(): boolean;
1664
1730
  __loadStrikeInternalLicenseFeatures(): string[];
1731
+ __loadStrikeScenarioSourceAnalysis(): Record<string, unknown>;
1665
1732
  __loadStrikeWithInternalLicenseFeatures(...features: string[]): LoadStrikeScenario;
1666
1733
  invokeInit(context: LoadStrikeScenarioInitContext): Promise<void>;
1667
1734
  invokeClean(context: LoadStrikeScenarioInitContext): Promise<void>;