@loadstrike/loadstrike-sdk 1.0.26701 → 1.0.27101

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.
@@ -677,6 +677,51 @@ export interface LoadStrikeThresholdOptions {
677
677
  abortWhenErrorCount?: number;
678
678
  startCheckAfterSeconds?: number;
679
679
  }
680
+ export interface LoadStrikeAccessibilityOptions {
681
+ url: string;
682
+ standard?: string;
683
+ maxViolations?: number;
684
+ maxCriticalViolations?: number;
685
+ maxSeriousViolations?: number;
686
+ tags?: string[];
687
+ includeSelectors?: string[];
688
+ excludeSelectors?: string[];
689
+ }
690
+ export interface LoadStrikeAccessibilityViolation {
691
+ ruleId?: string;
692
+ impact?: string;
693
+ description?: string;
694
+ helpUrl?: string;
695
+ targets?: string[];
696
+ }
697
+ export interface LoadStrikeAccessibilityResult {
698
+ url?: string;
699
+ violations?: LoadStrikeAccessibilityViolation[];
700
+ }
701
+ export interface LoadStrikeAccessibilityCheckContext {
702
+ options: LoadStrikeAccessibilityOptions;
703
+ scenarioContext: LoadStrikeScenarioContext;
704
+ }
705
+ export interface LoadStrikeBrowserWebVitalsOptions {
706
+ url: string;
707
+ maxLargestContentfulPaintMs?: number;
708
+ maxInteractionToNextPaintMs?: number;
709
+ maxCumulativeLayoutShift?: number;
710
+ maxFirstContentfulPaintMs?: number;
711
+ maxTimeToFirstByteMs?: number;
712
+ }
713
+ export interface LoadStrikeBrowserWebVitalsResult {
714
+ url?: string;
715
+ largestContentfulPaintMs?: number;
716
+ interactionToNextPaintMs?: number;
717
+ cumulativeLayoutShift?: number;
718
+ firstContentfulPaintMs?: number;
719
+ timeToFirstByteMs?: number;
720
+ }
721
+ export interface LoadStrikeBrowserWebVitalsContext {
722
+ options: LoadStrikeBrowserWebVitalsOptions;
723
+ scenarioContext: LoadStrikeScenarioContext;
724
+ }
680
725
  export interface LoadStrikeThresholdPredicateContext {
681
726
  scenarioName: string;
682
727
  scope: "scenario" | "step" | "metric";
@@ -1478,6 +1523,14 @@ export declare class LoadStrikeContext {
1478
1523
  */
1479
1524
  withRegisteredScenarios(...scenarios: LoadStrikeScenario[]): LoadStrikeContext;
1480
1525
  }
1526
+ export declare class LoadStrikeAccessibility {
1527
+ static createScenario(name: string, options: LoadStrikeAccessibilityOptions, check: (context: LoadStrikeAccessibilityCheckContext) => Promise<LoadStrikeAccessibilityResult> | LoadStrikeAccessibilityResult): LoadStrikeScenario;
1528
+ static CreateScenario(name: string, options: LoadStrikeAccessibilityOptions, check: (context: LoadStrikeAccessibilityCheckContext) => Promise<LoadStrikeAccessibilityResult> | LoadStrikeAccessibilityResult): LoadStrikeScenario;
1529
+ }
1530
+ export declare class LoadStrikeBrowserWebVitals {
1531
+ static createScenario(name: string, options: LoadStrikeBrowserWebVitalsOptions, measure: (context: LoadStrikeBrowserWebVitalsContext) => Promise<LoadStrikeBrowserWebVitalsResult> | LoadStrikeBrowserWebVitalsResult): LoadStrikeScenario;
1532
+ static CreateScenario(name: string, options: LoadStrikeBrowserWebVitalsOptions, measure: (context: LoadStrikeBrowserWebVitalsContext) => Promise<LoadStrikeBrowserWebVitalsResult> | LoadStrikeBrowserWebVitalsResult): LoadStrikeScenario;
1533
+ }
1481
1534
  export declare class LoadStrikeScenario {
1482
1535
  readonly name: string;
1483
1536
  private readonly runHandler;
@@ -1674,6 +1727,61 @@ export declare class LoadStrikeScenario {
1674
1727
  */
1675
1728
  WithWeight(weight: number): LoadStrikeScenario;
1676
1729
  }
1730
+ export declare class LoadStrikeScenarioShare {
1731
+ readonly scenario: LoadStrikeScenario;
1732
+ readonly weight: number;
1733
+ private constructor();
1734
+ /**
1735
+ * Creates a weighted scenario lane for a traffic mix.
1736
+ * Use this when a total workload should be distributed across several scenarios.
1737
+ */
1738
+ static create(scenario: LoadStrikeScenario, weight: number): LoadStrikeScenarioShare;
1739
+ /**
1740
+ * Creates a weighted scenario lane for a traffic mix.
1741
+ * Use this when a total workload should be distributed across several scenarios.
1742
+ */
1743
+ static Create(scenario: LoadStrikeScenario, weight: number): LoadStrikeScenarioShare;
1744
+ }
1745
+ export declare class LoadStrikeTrafficMix {
1746
+ readonly name: string;
1747
+ private readonly totalLoad;
1748
+ private readonly scenarioMix;
1749
+ private constructor();
1750
+ /**
1751
+ * Creates a traffic mix definition.
1752
+ * Use this when one total load profile should be split across multiple scenario lanes.
1753
+ */
1754
+ static create(name: string): LoadStrikeTrafficMix;
1755
+ /**
1756
+ * Creates a traffic mix definition.
1757
+ * Use this when one total load profile should be split across multiple scenario lanes.
1758
+ */
1759
+ static Create(name: string): LoadStrikeTrafficMix;
1760
+ /**
1761
+ * Sets the total workload shape for the mix.
1762
+ * Use this when the same high-level load profile should be distributed by scenario weights.
1763
+ */
1764
+ withTotalLoad(...totalLoad: Array<Record<string, unknown>>): LoadStrikeTrafficMix;
1765
+ /**
1766
+ * Sets the total workload shape for the mix.
1767
+ * Use this when the same high-level load profile should be distributed by scenario weights.
1768
+ */
1769
+ WithTotalLoad(...totalLoad: Array<Record<string, unknown>>): LoadStrikeTrafficMix;
1770
+ /**
1771
+ * Sets the weighted scenario lanes for the mix.
1772
+ * Use this when each operation should receive a fixed proportion of the total workload.
1773
+ */
1774
+ withScenarioMix(...scenarioMix: LoadStrikeScenarioShare[]): LoadStrikeTrafficMix;
1775
+ /**
1776
+ * Sets the weighted scenario lanes for the mix.
1777
+ * Use this when each operation should receive a fixed proportion of the total workload.
1778
+ */
1779
+ WithScenarioMix(...scenarioMix: LoadStrikeScenarioShare[]): LoadStrikeTrafficMix;
1780
+ expandScenarios(): LoadStrikeScenario[];
1781
+ ExpandScenarios(): LoadStrikeScenario[];
1782
+ __loadStrikeTotalLoad(): Array<Record<string, unknown>>;
1783
+ __loadStrikeScenarioMix(): LoadStrikeScenarioShare[];
1784
+ }
1677
1785
  export declare class LoadStrikeRunner {
1678
1786
  private scenarios;
1679
1787
  private options;
@@ -1699,6 +1807,16 @@ export declare class LoadStrikeRunner {
1699
1807
  * Use this when you want a context immediately without composing a runner first.
1700
1808
  */
1701
1809
  static RegisterScenarios(...scenarios: LoadStrikeScenario[]): LoadStrikeContext;
1810
+ /**
1811
+ * Registers a traffic mix on a fresh runnable context.
1812
+ * Use this when one total load profile should be split across weighted scenario lanes.
1813
+ */
1814
+ static registerTrafficMix(trafficMix: LoadStrikeTrafficMix): LoadStrikeContext;
1815
+ /**
1816
+ * Registers a traffic mix on a fresh runnable context.
1817
+ * Use this when one total load profile should be split across weighted scenario lanes.
1818
+ */
1819
+ static RegisterTrafficMix(trafficMix: LoadStrikeTrafficMix): LoadStrikeContext;
1702
1820
  /**
1703
1821
  * Toggles realtime console metric output.
1704
1822
  * Use this when a local run or CI log should stream live throughput and latency updates.
@@ -1868,6 +1986,16 @@ export declare class LoadStrikeRunner {
1868
1986
  * Use this when the run should execute a batch of scenario definitions together.
1869
1987
  */
1870
1988
  AddScenarios(...scenarios: LoadStrikeScenario[]): LoadStrikeRunner;
1989
+ /**
1990
+ * Adds a traffic mix to the current runner.
1991
+ * Use this when one total load profile should be split across weighted scenario lanes.
1992
+ */
1993
+ addTrafficMix(trafficMix: LoadStrikeTrafficMix): LoadStrikeRunner;
1994
+ /**
1995
+ * Adds a traffic mix to the current runner.
1996
+ * Use this when one total load profile should be split across weighted scenario lanes.
1997
+ */
1998
+ AddTrafficMix(trafficMix: LoadStrikeTrafficMix): LoadStrikeRunner;
1871
1999
  /**
1872
2000
  * Applies a grouped configuration change to the current builder or context.
1873
2001
  * Use this when several related settings should be supplied in one step.
@@ -2010,6 +2138,7 @@ declare function combineAbortSignals(...signals: AbortSignal[]): AbortSignal;
2010
2138
  declare function delayWithAbort(durationMs: number, signal: AbortSignal): Promise<void>;
2011
2139
  declare function createRuntimeRandom(): LoadStrikeRandom;
2012
2140
  declare function parseAliasDate(value: string | Date | null | undefined): Date | undefined;
2141
+ declare function expandTrafficMixScenarios(trafficMix: LoadStrikeTrafficMix): LoadStrikeScenario[];
2013
2142
  declare function attachScenarioStatsAliases(scenario: Omit<LoadStrikeScenarioStats, "FindStepStats" | "GetStepStats"> & Partial<Pick<LoadStrikeScenarioStats, "FindStepStats" | "GetStepStats">>): LoadStrikeScenarioStats;
2014
2143
  declare function attachNodeStatsAliases(stats: Omit<LoadStrikeNodeStats, "FindScenarioStats" | "GetScenarioStats"> & Partial<Pick<LoadStrikeNodeStats, "FindScenarioStats" | "GetScenarioStats">>): LoadStrikeNodeStats;
2015
2144
  declare function attachRunResultAliases(result: LoadStrikeRunResult): LoadStrikeRunResult;
@@ -2255,6 +2384,7 @@ export declare const __loadstrikeTestExports: {
2255
2384
  detailedToNodeStats: typeof detailedToNodeStats;
2256
2385
  evaluateThresholdsForScenarios: typeof evaluateThresholdsForScenarios;
2257
2386
  executeTrackedScenarioInvocation: typeof executeTrackedScenarioInvocation;
2387
+ expandTrafficMixScenarios: typeof expandTrafficMixScenarios;
2258
2388
  extractContextOverridesFromArgs: typeof extractContextOverridesFromArgs;
2259
2389
  extractContextOverridesFromConfig: typeof extractContextOverridesFromConfig;
2260
2390
  findCaseInsensitiveKey: typeof findCaseInsensitiveKey;
@@ -1,7 +1,7 @@
1
1
  import { TrackingFieldSelector, type TrackingPayload } from "./correlation.js";
2
2
  export declare const LOADSTRIKE_TRACE_ID_HEADER = "loadstrike-trace-id";
3
3
  export declare const LOADSTRIKE_TRACE_ID_TRACKING_FIELD = "header:loadstrike-trace-id";
4
- export type EndpointKind = "Http" | "Kafka" | "RabbitMq" | "Nats" | "RedisStreams" | "AzureEventHubs" | "Sqs" | "PushDiffusion" | "DelegateStream";
4
+ export type EndpointKind = "Http" | "Kafka" | "RabbitMq" | "Nats" | "RedisStreams" | "AzureEventHubs" | "Sqs" | "PushDiffusion" | "DelegateStream" | "Grpc" | "WebSocket";
5
5
  export type EndpointMode = "Produce" | "Consume";
6
6
  export type HttpAuthMode = "None" | "Basic" | "Bearer" | "OAuth2ClientCredentials";
7
7
  export type HttpAuthType = HttpAuthMode;
@@ -352,6 +352,10 @@ export interface EndpointDefinition {
352
352
  Delegate?: DelegateEndpointOptions;
353
353
  DelegateStream?: DelegateEndpointOptions;
354
354
  delegate?: DelegateEndpointOptions;
355
+ Grpc?: GrpcEndpointOptions;
356
+ grpc?: GrpcEndpointOptions;
357
+ WebSocket?: WebSocketEndpointOptions;
358
+ webSocket?: WebSocketEndpointOptions;
355
359
  }
356
360
  export interface DotNetHttpOAuth2ClientCredentialsOptions {
357
361
  TokenEndpoint?: string;
@@ -423,6 +427,8 @@ export interface DotNetEndpointDefinition {
423
427
  PushDiffusion?: PushDiffusionEndpointOptions;
424
428
  Delegate?: DotNetDelegateEndpointOptions;
425
429
  DelegateStream?: DotNetDelegateEndpointOptions;
430
+ Grpc?: GrpcEndpointOptions;
431
+ WebSocket?: WebSocketEndpointOptions;
426
432
  }
427
433
  export interface HttpEndpointDefinition extends TrafficEndpointDefinition {
428
434
  Kind?: "Http";
@@ -610,6 +616,44 @@ export interface PushDiffusionEndpointDefinition extends TrafficEndpointDefiniti
610
616
  SubscribeAsync?: DelegateConsumeAsync;
611
617
  subscribeAsync?: DelegateConsumeAsync;
612
618
  }
619
+ export interface GrpcEndpointOptions extends DelegateEndpointOptions {
620
+ Target?: string;
621
+ target?: string;
622
+ ServiceName?: string;
623
+ serviceName?: string;
624
+ MethodName?: string;
625
+ methodName?: string;
626
+ MethodType?: string;
627
+ methodType?: string;
628
+ DeadlineSeconds?: number;
629
+ deadlineSeconds?: number;
630
+ DeadlineMs?: number;
631
+ deadlineMs?: number;
632
+ Metadata?: Record<string, string>;
633
+ metadata?: Record<string, string>;
634
+ }
635
+ export interface GrpcEndpointDefinition extends TrafficEndpointDefinition, GrpcEndpointOptions {
636
+ Kind?: "Grpc";
637
+ kind?: "Grpc";
638
+ }
639
+ export interface WebSocketEndpointOptions extends DelegateEndpointOptions {
640
+ Url?: string;
641
+ url?: string;
642
+ Subprotocols?: string[];
643
+ subprotocols?: string[];
644
+ ConnectTimeoutSeconds?: number;
645
+ connectTimeoutSeconds?: number;
646
+ ConnectTimeoutMs?: number;
647
+ connectTimeoutMs?: number;
648
+ CloseTimeoutSeconds?: number;
649
+ closeTimeoutSeconds?: number;
650
+ CloseTimeoutMs?: number;
651
+ closeTimeoutMs?: number;
652
+ }
653
+ export interface WebSocketEndpointDefinition extends TrafficEndpointDefinition, WebSocketEndpointOptions {
654
+ Kind?: "WebSocket";
655
+ kind?: "WebSocket";
656
+ }
613
657
  type HttpOAuth2ClientCredentialsOptionsInit = Partial<DotNetHttpOAuth2ClientCredentialsOptions & HttpOAuth2ClientCredentialsOptions>;
614
658
  type HttpAuthOptionsInit = Partial<DotNetHttpAuthOptions & HttpAuthOptions>;
615
659
  type KafkaSaslOptionsInit = Partial<KafkaSaslOptions>;
@@ -623,6 +667,8 @@ type AzureEventHubsEndpointDefinitionInit = Partial<AzureEventHubsEndpointDefini
623
667
  type SqsEndpointDefinitionInit = Partial<SqsEndpointDefinition>;
624
668
  type DelegateStreamEndpointDefinitionInit = Partial<DelegateStreamEndpointDefinition>;
625
669
  type PushDiffusionEndpointDefinitionInit = Partial<PushDiffusionEndpointDefinition>;
670
+ type GrpcEndpointDefinitionInit = Partial<GrpcEndpointDefinition>;
671
+ type WebSocketEndpointDefinitionInit = Partial<WebSocketEndpointDefinition>;
626
672
  declare abstract class TrafficEndpointDefinitionModel {
627
673
  abstract readonly Kind: EndpointKind;
628
674
  Mode: EndpointMode;
@@ -799,6 +845,36 @@ declare class PushDiffusionEndpointDefinitionModel extends TrafficEndpointDefini
799
845
  constructor(initial?: PushDiffusionEndpointDefinitionInit);
800
846
  Validate(): void;
801
847
  }
848
+ declare class GrpcEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
849
+ readonly Kind: "Grpc";
850
+ Target: string;
851
+ ServiceName: string;
852
+ MethodName: string;
853
+ MethodType: string;
854
+ DeadlineSeconds: number;
855
+ Produce?: (payload: TrackingPayload) => Promise<TrackingPayload | null> | TrackingPayload | null;
856
+ Consume?: () => Promise<TrackingPayload | null> | TrackingPayload | null;
857
+ ProduceAsync?: (request: ProducedMessageRequest) => Promise<ProducedMessageResult | TrackingPayload | null> | ProducedMessageResult | TrackingPayload | null;
858
+ ConsumeAsync?: DelegateConsumeAsync;
859
+ ConnectionMetadata: Record<string, string>;
860
+ Metadata: Record<string, string>;
861
+ constructor(initial?: GrpcEndpointDefinitionInit);
862
+ Validate(): void;
863
+ }
864
+ declare class WebSocketEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
865
+ readonly Kind: "WebSocket";
866
+ Url: string;
867
+ Subprotocols: string[];
868
+ ConnectTimeoutSeconds: number;
869
+ CloseTimeoutSeconds: number;
870
+ Produce?: (payload: TrackingPayload) => Promise<TrackingPayload | null> | TrackingPayload | null;
871
+ Consume?: () => Promise<TrackingPayload | null> | TrackingPayload | null;
872
+ ProduceAsync?: (request: ProducedMessageRequest) => Promise<ProducedMessageResult | TrackingPayload | null> | ProducedMessageResult | TrackingPayload | null;
873
+ ConsumeAsync?: DelegateConsumeAsync;
874
+ ConnectionMetadata: Record<string, string>;
875
+ constructor(initial?: WebSocketEndpointDefinitionInit);
876
+ Validate(): void;
877
+ }
802
878
  export declare const TrafficEndpointDefinition: typeof TrafficEndpointDefinitionModel;
803
879
  export declare const HttpEndpointDefinition: typeof HttpEndpointDefinitionModel;
804
880
  export declare const KafkaEndpointDefinition: typeof KafkaEndpointDefinitionModel;
@@ -809,10 +885,12 @@ export declare const AzureEventHubsEndpointDefinition: typeof AzureEventHubsEndp
809
885
  export declare const SqsEndpointDefinition: typeof SqsEndpointDefinitionModel;
810
886
  export declare const DelegateStreamEndpointDefinition: typeof DelegateStreamEndpointDefinitionModel;
811
887
  export declare const PushDiffusionEndpointDefinition: typeof PushDiffusionEndpointDefinitionModel;
888
+ export declare const GrpcEndpointDefinition: typeof GrpcEndpointDefinitionModel;
889
+ export declare const WebSocketEndpointDefinition: typeof WebSocketEndpointDefinitionModel;
812
890
  export declare const HttpOAuth2ClientCredentialsOptions: typeof HttpOAuth2ClientCredentialsOptionsModel;
813
891
  export declare const HttpAuthOptions: typeof HttpAuthOptionsModel;
814
892
  export declare const KafkaSaslOptions: typeof KafkaSaslOptionsModel;
815
- export type EndpointDefinitionInput = EndpointDefinition | DotNetEndpointDefinition | HttpEndpointDefinition | KafkaEndpointDefinition | RabbitMqEndpointDefinition | NatsEndpointDefinition | RedisStreamsEndpointDefinition | AzureEventHubsEndpointDefinition | SqsEndpointDefinition | DelegateStreamEndpointDefinition | PushDiffusionEndpointDefinition;
893
+ export type EndpointDefinitionInput = EndpointDefinition | DotNetEndpointDefinition | HttpEndpointDefinition | KafkaEndpointDefinition | RabbitMqEndpointDefinition | NatsEndpointDefinition | RedisStreamsEndpointDefinition | AzureEventHubsEndpointDefinition | SqsEndpointDefinition | DelegateStreamEndpointDefinition | PushDiffusionEndpointDefinition | GrpcEndpointDefinition | WebSocketEndpointDefinition;
816
894
  export interface EndpointAdapter {
817
895
  initialize?(): Promise<void>;
818
896
  produce(payload?: TrackingPayload): Promise<TrackingPayload | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loadstrike/loadstrike-sdk",
3
- "version": "1.0.26701",
3
+ "version": "1.0.27101",
4
4
  "description": "TypeScript and JavaScript SDK for in-process load execution, traffic correlation, and reporting.",
5
5
  "keywords": [
6
6
  "load-testing",
@@ -82,6 +82,7 @@
82
82
  "typescript": "^5.9.2"
83
83
  },
84
84
  "overrides": {
85
- "brace-expansion": "5.0.5"
85
+ "brace-expansion": "5.0.6",
86
+ "tar": "7.5.16"
86
87
  }
87
88
  }