@loadstrike/loadstrike-sdk 1.0.26901 → 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.
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/local.js +3 -1
- package/dist/cjs/runtime.js +109 -1
- package/dist/cjs/transports.js +346 -12
- package/dist/esm/index.js +2 -2
- package/dist/esm/local.js +3 -1
- package/dist/esm/runtime.js +106 -0
- package/dist/esm/transports.js +345 -11
- package/dist/types/contracts.d.ts +18 -0
- package/dist/types/index.d.ts +5 -5
- package/dist/types/runtime.d.ts +53 -0
- package/dist/types/transports.d.ts +80 -2
- package/package.json +1 -1
package/dist/types/runtime.d.ts
CHANGED
|
@@ -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;
|
|
@@ -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