@loadstrike/loadstrike-sdk 1.0.22601 → 1.0.23001
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/README.md +1 -1
- package/dist/cjs/autopilot.js +56 -2
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/local.js +166 -155
- package/dist/cjs/runtime.js +127 -3
- package/dist/cjs/transports.js +295 -1
- package/dist/esm/autopilot.js +55 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/local.js +166 -155
- package/dist/esm/runtime.js +126 -2
- package/dist/esm/transports.js +294 -0
- package/dist/types/autopilot-contracts.d.ts +2 -0
- package/dist/types/autopilot.d.ts +5 -2
- package/dist/types/contracts.d.ts +14 -0
- package/dist/types/index.d.ts +5 -5
- package/dist/types/runtime.d.ts +9 -0
- package/dist/types/transports.d.ts +97 -2
- package/package.json +2 -7
package/dist/types/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export type { LoadStrikeDateValue, LoadStrikeObject, LoadStrikeRunContext as LoadStrikeContractRunContext, LoadStrikeScenarioSpec, LoadStrikeLoadSimulationSpec, LoadStrikeThresholdSpec, LoadStrikeTrackingConfigurationSpec, LoadStrikeCorrelationStoreSpec, LoadStrikeRedisCorrelationStoreSpec, LoadStrikeEndpointSpec, LoadStrikeHttpEndpointOptions, LoadStrikeHttpAuthOptions, LoadStrikeHttpOAuth2ClientCredentialsOptions, LoadStrikeKafkaEndpointOptions, LoadStrikeKafkaSaslOptions, LoadStrikeRabbitMqEndpointOptions, LoadStrikeNatsEndpointOptions, LoadStrikeRedisStreamsEndpointOptions, LoadStrikeAzureEventHubsEndpointOptions, LoadStrikeDelegateEndpointOptions, LoadStrikePushDiffusionEndpointOptions, LoadStrikeReportingSinkSpec, LoadStrikeInfluxDbSinkOptions, LoadStrikeTimescaleDbSinkOptions, LoadStrikeGrafanaLokiSinkOptions, LoadStrikeDatadogSinkOptions, LoadStrikeSplunkSinkOptions, LoadStrikeOtelCollectorSinkOptions, LoadStrikeWorkerPluginSpec, LoadStrikeRunRequest, LoadStrikeRunResponse, LoadStrikeNodeStatsDto, LoadStrikeNodeInfoDto, LoadStrikeTestInfoDto, LoadStrikeScenarioStatsDto, LoadStrikeStepStatsDto, LoadStrikeMeasurementStatsDto, LoadStrikeRequestStatsDto, LoadStrikeLatencyStatsDto, LoadStrikeDataTransferStatsDto, LoadStrikeStatusCodeStatsDto, LoadStrikeMetricStatsDto, LoadStrikeCounterStatsDto, LoadStrikeGaugeStatsDto, LoadStrikeThresholdResultDto, LoadStrikePluginDataDto, LoadStrikePluginDataTableDto, LoadStrikePayloadDto, LoadStrikeProducedMessageRequestDto, LoadStrikeProducedMessageResultDto, LoadStrikeConsumedMessageDto } from "./contracts.js";
|
|
1
|
+
export type { LoadStrikeDateValue, LoadStrikeObject, LoadStrikeRunContext as LoadStrikeContractRunContext, LoadStrikeScenarioSpec, LoadStrikeLoadSimulationSpec, LoadStrikeThresholdSpec, LoadStrikeTrackingConfigurationSpec, LoadStrikeCorrelationStoreSpec, LoadStrikeRedisCorrelationStoreSpec, LoadStrikeEndpointSpec, LoadStrikeHttpEndpointOptions, LoadStrikeHttpAuthOptions, LoadStrikeHttpOAuth2ClientCredentialsOptions, LoadStrikeKafkaEndpointOptions, LoadStrikeKafkaSaslOptions, LoadStrikeRabbitMqEndpointOptions, LoadStrikeNatsEndpointOptions, LoadStrikeRedisStreamsEndpointOptions, LoadStrikeAzureEventHubsEndpointOptions, LoadStrikeSqsEndpointOptions, LoadStrikeDelegateEndpointOptions, LoadStrikePushDiffusionEndpointOptions, LoadStrikeReportingSinkSpec, LoadStrikeInfluxDbSinkOptions, LoadStrikeTimescaleDbSinkOptions, LoadStrikeGrafanaLokiSinkOptions, LoadStrikeDatadogSinkOptions, LoadStrikeSplunkSinkOptions, LoadStrikeOtelCollectorSinkOptions, LoadStrikeWorkerPluginSpec, LoadStrikeRunRequest, LoadStrikeRunResponse, LoadStrikeNodeStatsDto, LoadStrikeNodeInfoDto, LoadStrikeTestInfoDto, LoadStrikeScenarioStatsDto, LoadStrikeStepStatsDto, LoadStrikeMeasurementStatsDto, LoadStrikeRequestStatsDto, LoadStrikeLatencyStatsDto, LoadStrikeDataTransferStatsDto, LoadStrikeStatusCodeStatsDto, LoadStrikeMetricStatsDto, LoadStrikeCounterStatsDto, LoadStrikeGaugeStatsDto, LoadStrikeThresholdResultDto, LoadStrikePluginDataDto, LoadStrikePluginDataTableDto, LoadStrikePayloadDto, LoadStrikeProducedMessageRequestDto, LoadStrikeProducedMessageResultDto, LoadStrikeConsumedMessageDto } from "./contracts.js";
|
|
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, LoadStrikePluginData, LoadStrikePluginDataTable, LoadStrikeNodeType, LoadStrikeReportFormat, LoadStrikeResponse, LoadStrikeLogLevel, LoadStrikeScenarioOperation, LoadStrikeOperationType, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeSimulation, LoadStrikeMetric, LoadStrikeCounter, LoadStrikeGauge, LoadStrikeStep, LoadStrikeThreshold } from "./runtime.js";
|
|
6
|
-
export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeReportingSink, LoadStrikeRuntimePolicy, LoadStrikeRunnerOptions, LoadStrikeRunContext as LoadStrikeRuntimeContext, LoadStrikeRunContext, 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,
|
|
5
|
+
export { CrossPlatformScenarioConfigurator, ScenarioTrackingExtensions, LoadStrikeContext, LoadStrikePluginData, LoadStrikePluginDataTable, LoadStrikeNodeType, LoadStrikeReportFormat, LoadStrikeResponse, LoadStrikeLogLevel, LoadStrikeScenarioOperation, LoadStrikeOperationType, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeSimulation, CrossPlatformTrackingConfiguration, LoadStrikeMetric, LoadStrikeCounter, LoadStrikeGauge, LoadStrikeStep, LoadStrikeThreshold } from "./runtime.js";
|
|
6
|
+
export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeReportingSink, LoadStrikeRuntimePolicy, LoadStrikeRunnerOptions, LoadStrikeRunContext as LoadStrikeRuntimeContext, LoadStrikeRunContext, 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 {
|
|
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, PushDiffusionEndpointOptions, TrackingFieldSelectorInput, TrackingRunMode, TrafficEndpointKind, TrafficEndpointMode, ProducedMessageRequest, ProducedMessageResult, ConsumedMessage, DelegateConsumeAsync, DelegateConsumeStreamHandler, DelegateEndpointOptions } 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, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
|
|
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, TrackingFieldSelectorInput, TrackingRunMode, TrafficEndpointKind, TrafficEndpointMode, ProducedMessageRequest, ProducedMessageResult, ConsumedMessage, DelegateConsumeAsync, DelegateConsumeStreamHandler, DelegateEndpointOptions } from "./transports.js";
|
|
11
11
|
export { DatadogReportingSink, DatadogReportingSinkOptions, GrafanaLokiReportingSink, GrafanaLokiReportingSinkOptions, InfluxDbReportingSink, InfluxDbReportingSinkOptions, OtelCollectorReportingSink, OtelCollectorReportingSinkOptions, SplunkReportingSink, SplunkReportingSinkOptions, TimescaleDbReportingSink, TimescaleDbReportingSinkOptions } from "./sinks.js";
|
|
12
12
|
export type { DatadogSinkOptions, GrafanaLokiSinkOptions, InfluxDbSinkOptions, OtelCollectorSinkOptions, SplunkSinkOptions, TimescaleDbSinkOptions } from "./sinks.js";
|
package/dist/types/runtime.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ export declare const LoadStrikeOperationType: {
|
|
|
43
43
|
export type LoadStrikeOperationType = typeof LoadStrikeOperationType[keyof typeof LoadStrikeOperationType];
|
|
44
44
|
export type LoadStrikeLoadSimulation = Record<string, unknown>;
|
|
45
45
|
export type CrossPlatformTrackingConfiguration = Record<string, unknown>;
|
|
46
|
+
export declare const CrossPlatformTrackingConfiguration: {
|
|
47
|
+
readonly forDuration: (configuration: Record<string, unknown>, durationSeconds: number, cancellationSignal?: AbortSignal) => CrossPlatformTrackingConfiguration;
|
|
48
|
+
readonly ForDuration: (configuration: Record<string, unknown>, durationSeconds: number, cancellationSignal?: AbortSignal) => CrossPlatformTrackingConfiguration;
|
|
49
|
+
};
|
|
46
50
|
export interface LoadStrikeRandom {
|
|
47
51
|
next(): number;
|
|
48
52
|
next(maxValue: number): number;
|
|
@@ -2056,6 +2060,8 @@ declare class ManagedScenarioTrackingRuntime {
|
|
|
2056
2060
|
private readonly sourceOnlyMode;
|
|
2057
2061
|
private readonly executeOriginalScenarioRun;
|
|
2058
2062
|
private readonly correlationTimeoutMs;
|
|
2063
|
+
private readonly observationDurationMs;
|
|
2064
|
+
private readonly observationCancellationSignal?;
|
|
2059
2065
|
private readonly timeoutSweepIntervalMs;
|
|
2060
2066
|
private readonly timeoutBatchSize;
|
|
2061
2067
|
private readonly timeoutCountsAsFailure;
|
|
@@ -2078,6 +2084,7 @@ declare class ManagedScenarioTrackingRuntime {
|
|
|
2078
2084
|
executeIteration(context: InternalScenarioContext, originalRun: () => Promise<LoadStrikeStepReply>, _operation: "WarmUp" | "Bombing"): Promise<LoadStrikeStepReply>;
|
|
2079
2085
|
dispose(): Promise<void>;
|
|
2080
2086
|
private executeSourceOnly;
|
|
2087
|
+
private observeExistingTraffic;
|
|
2081
2088
|
private consumeSourceLoop;
|
|
2082
2089
|
private consumeDestinationLoop;
|
|
2083
2090
|
private runTimeoutSweepLoop;
|
|
@@ -2090,6 +2097,8 @@ declare class ManagedScenarioTrackingRuntime {
|
|
|
2090
2097
|
private resolveTrackingWaiter;
|
|
2091
2098
|
private pushOutcome;
|
|
2092
2099
|
private waitForOutcome;
|
|
2100
|
+
private waitForOutcomeUntil;
|
|
2101
|
+
private isFailedObservationOutcome;
|
|
2093
2102
|
private rejectOutstandingWaiters;
|
|
2094
2103
|
}
|
|
2095
2104
|
declare function buildTrackingLeaseKey(sessionId: string, scenarioName: string, tracking: Record<string, unknown>): string;
|
|
@@ -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" | "PushDiffusion" | "DelegateStream";
|
|
4
|
+
export type EndpointKind = "Http" | "Kafka" | "RabbitMq" | "Nats" | "RedisStreams" | "AzureEventHubs" | "Sqs" | "PushDiffusion" | "DelegateStream";
|
|
5
5
|
export type EndpointMode = "Produce" | "Consume";
|
|
6
6
|
export type HttpAuthMode = "None" | "Basic" | "Bearer" | "OAuth2ClientCredentials";
|
|
7
7
|
export type HttpAuthType = HttpAuthMode;
|
|
@@ -228,6 +228,29 @@ export interface AzureEventHubsEndpointOptions {
|
|
|
228
228
|
startFromEarliest?: boolean;
|
|
229
229
|
[key: string]: unknown;
|
|
230
230
|
}
|
|
231
|
+
export interface SqsEndpointOptions {
|
|
232
|
+
QueueUrl?: string;
|
|
233
|
+
queueUrl?: string;
|
|
234
|
+
Region?: string;
|
|
235
|
+
region?: string;
|
|
236
|
+
ServiceUrl?: string;
|
|
237
|
+
serviceUrl?: string;
|
|
238
|
+
AccessKeyId?: string;
|
|
239
|
+
accessKeyId?: string;
|
|
240
|
+
SecretAccessKey?: string;
|
|
241
|
+
secretAccessKey?: string;
|
|
242
|
+
SessionToken?: string;
|
|
243
|
+
sessionToken?: string;
|
|
244
|
+
WaitTimeSeconds?: number;
|
|
245
|
+
waitTimeSeconds?: number;
|
|
246
|
+
MaxNumberOfMessages?: number;
|
|
247
|
+
maxNumberOfMessages?: number;
|
|
248
|
+
VisibilityTimeoutSeconds?: number;
|
|
249
|
+
visibilityTimeoutSeconds?: number;
|
|
250
|
+
DeleteAfterConsume?: boolean;
|
|
251
|
+
deleteAfterConsume?: boolean;
|
|
252
|
+
[key: string]: unknown;
|
|
253
|
+
}
|
|
231
254
|
export interface PushDiffusionEndpointOptions {
|
|
232
255
|
ServerUrl?: string;
|
|
233
256
|
serverUrl?: string;
|
|
@@ -322,6 +345,8 @@ export interface EndpointDefinition {
|
|
|
322
345
|
redisStreams?: RedisStreamsEndpointOptions;
|
|
323
346
|
AzureEventHubs?: AzureEventHubsEndpointOptions;
|
|
324
347
|
azureEventHubs?: AzureEventHubsEndpointOptions;
|
|
348
|
+
Sqs?: SqsEndpointOptions;
|
|
349
|
+
sqs?: SqsEndpointOptions;
|
|
325
350
|
PushDiffusion?: PushDiffusionEndpointOptions;
|
|
326
351
|
pushDiffusion?: PushDiffusionEndpointOptions;
|
|
327
352
|
Delegate?: DelegateEndpointOptions;
|
|
@@ -394,6 +419,7 @@ export interface DotNetEndpointDefinition {
|
|
|
394
419
|
Nats?: NatsEndpointOptions;
|
|
395
420
|
RedisStreams?: RedisStreamsEndpointOptions;
|
|
396
421
|
AzureEventHubs?: AzureEventHubsEndpointOptions;
|
|
422
|
+
Sqs?: SqsEndpointOptions;
|
|
397
423
|
PushDiffusion?: PushDiffusionEndpointOptions;
|
|
398
424
|
Delegate?: DotNetDelegateEndpointOptions;
|
|
399
425
|
DelegateStream?: DotNetDelegateEndpointOptions;
|
|
@@ -528,6 +554,30 @@ export interface AzureEventHubsEndpointDefinition extends TrafficEndpointDefinit
|
|
|
528
554
|
StartFromEarliest?: boolean;
|
|
529
555
|
startFromEarliest?: boolean;
|
|
530
556
|
}
|
|
557
|
+
export interface SqsEndpointDefinition extends TrafficEndpointDefinition {
|
|
558
|
+
Kind?: "Sqs";
|
|
559
|
+
kind?: "Sqs";
|
|
560
|
+
QueueUrl?: string;
|
|
561
|
+
queueUrl?: string;
|
|
562
|
+
Region?: string;
|
|
563
|
+
region?: string;
|
|
564
|
+
ServiceUrl?: string;
|
|
565
|
+
serviceUrl?: string;
|
|
566
|
+
AccessKeyId?: string;
|
|
567
|
+
accessKeyId?: string;
|
|
568
|
+
SecretAccessKey?: string;
|
|
569
|
+
secretAccessKey?: string;
|
|
570
|
+
SessionToken?: string;
|
|
571
|
+
sessionToken?: string;
|
|
572
|
+
WaitTimeSeconds?: number;
|
|
573
|
+
waitTimeSeconds?: number;
|
|
574
|
+
MaxNumberOfMessages?: number;
|
|
575
|
+
maxNumberOfMessages?: number;
|
|
576
|
+
VisibilityTimeoutSeconds?: number;
|
|
577
|
+
visibilityTimeoutSeconds?: number;
|
|
578
|
+
DeleteAfterConsume?: boolean;
|
|
579
|
+
deleteAfterConsume?: boolean;
|
|
580
|
+
}
|
|
531
581
|
export interface DelegateStreamEndpointDefinition extends TrafficEndpointDefinition {
|
|
532
582
|
Kind?: "DelegateStream";
|
|
533
583
|
kind?: "DelegateStream";
|
|
@@ -570,6 +620,7 @@ type RabbitMqEndpointDefinitionInit = Partial<RabbitMqEndpointDefinition>;
|
|
|
570
620
|
type NatsEndpointDefinitionInit = Partial<NatsEndpointDefinition>;
|
|
571
621
|
type RedisStreamsEndpointDefinitionInit = Partial<RedisStreamsEndpointDefinition>;
|
|
572
622
|
type AzureEventHubsEndpointDefinitionInit = Partial<AzureEventHubsEndpointDefinition>;
|
|
623
|
+
type SqsEndpointDefinitionInit = Partial<SqsEndpointDefinition>;
|
|
573
624
|
type DelegateStreamEndpointDefinitionInit = Partial<DelegateStreamEndpointDefinition>;
|
|
574
625
|
type PushDiffusionEndpointDefinitionInit = Partial<PushDiffusionEndpointDefinition>;
|
|
575
626
|
declare abstract class TrafficEndpointDefinitionModel {
|
|
@@ -711,6 +762,21 @@ declare class AzureEventHubsEndpointDefinitionModel extends TrafficEndpointDefin
|
|
|
711
762
|
constructor(initial?: AzureEventHubsEndpointDefinitionInit);
|
|
712
763
|
Validate(): void;
|
|
713
764
|
}
|
|
765
|
+
declare class SqsEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
|
|
766
|
+
readonly Kind: "Sqs";
|
|
767
|
+
QueueUrl: string;
|
|
768
|
+
Region: string;
|
|
769
|
+
ServiceUrl?: string;
|
|
770
|
+
AccessKeyId?: string;
|
|
771
|
+
SecretAccessKey?: string;
|
|
772
|
+
SessionToken?: string;
|
|
773
|
+
WaitTimeSeconds: number;
|
|
774
|
+
MaxNumberOfMessages: number;
|
|
775
|
+
VisibilityTimeoutSeconds?: number;
|
|
776
|
+
DeleteAfterConsume: boolean;
|
|
777
|
+
constructor(initial?: SqsEndpointDefinitionInit);
|
|
778
|
+
Validate(): void;
|
|
779
|
+
}
|
|
714
780
|
declare class DelegateStreamEndpointDefinitionModel extends TrafficEndpointDefinitionModel {
|
|
715
781
|
readonly Kind: "DelegateStream";
|
|
716
782
|
Produce?: (payload: TrackingPayload) => Promise<TrackingPayload | null> | TrackingPayload | null;
|
|
@@ -740,12 +806,13 @@ export declare const RabbitMqEndpointDefinition: typeof RabbitMqEndpointDefiniti
|
|
|
740
806
|
export declare const NatsEndpointDefinition: typeof NatsEndpointDefinitionModel;
|
|
741
807
|
export declare const RedisStreamsEndpointDefinition: typeof RedisStreamsEndpointDefinitionModel;
|
|
742
808
|
export declare const AzureEventHubsEndpointDefinition: typeof AzureEventHubsEndpointDefinitionModel;
|
|
809
|
+
export declare const SqsEndpointDefinition: typeof SqsEndpointDefinitionModel;
|
|
743
810
|
export declare const DelegateStreamEndpointDefinition: typeof DelegateStreamEndpointDefinitionModel;
|
|
744
811
|
export declare const PushDiffusionEndpointDefinition: typeof PushDiffusionEndpointDefinitionModel;
|
|
745
812
|
export declare const HttpOAuth2ClientCredentialsOptions: typeof HttpOAuth2ClientCredentialsOptionsModel;
|
|
746
813
|
export declare const HttpAuthOptions: typeof HttpAuthOptionsModel;
|
|
747
814
|
export declare const KafkaSaslOptions: typeof KafkaSaslOptionsModel;
|
|
748
|
-
export type EndpointDefinitionInput = EndpointDefinition | DotNetEndpointDefinition | HttpEndpointDefinition | KafkaEndpointDefinition | RabbitMqEndpointDefinition | NatsEndpointDefinition | RedisStreamsEndpointDefinition | AzureEventHubsEndpointDefinition | DelegateStreamEndpointDefinition | PushDiffusionEndpointDefinition;
|
|
815
|
+
export type EndpointDefinitionInput = EndpointDefinition | DotNetEndpointDefinition | HttpEndpointDefinition | KafkaEndpointDefinition | RabbitMqEndpointDefinition | NatsEndpointDefinition | RedisStreamsEndpointDefinition | AzureEventHubsEndpointDefinition | SqsEndpointDefinition | DelegateStreamEndpointDefinition | PushDiffusionEndpointDefinition;
|
|
749
816
|
export interface EndpointAdapter {
|
|
750
817
|
initialize?(): Promise<void>;
|
|
751
818
|
produce(payload?: TrackingPayload): Promise<TrackingPayload | null>;
|
|
@@ -794,6 +861,18 @@ declare class AzureEventHubsEndpointAdapter extends CallbackAdapter {
|
|
|
794
861
|
private getConsumer;
|
|
795
862
|
private ensureSubscriptionStarted;
|
|
796
863
|
}
|
|
864
|
+
type SqsClientLike = {
|
|
865
|
+
send(command: unknown): Promise<unknown>;
|
|
866
|
+
destroy?: () => void;
|
|
867
|
+
};
|
|
868
|
+
declare let sqsClientFactoryForTests: ((endpoint: EndpointDefinition) => SqsClientLike | Promise<SqsClientLike>) | null;
|
|
869
|
+
declare class SqsEndpointAdapter extends CallbackAdapter {
|
|
870
|
+
private clientPromise;
|
|
871
|
+
produce(payload?: TrackingPayload): Promise<TrackingPayload | null>;
|
|
872
|
+
consume(): Promise<TrackingPayload | null>;
|
|
873
|
+
dispose(): Promise<void>;
|
|
874
|
+
private getClient;
|
|
875
|
+
}
|
|
797
876
|
export declare class EndpointAdapterFactory {
|
|
798
877
|
static create(endpoint: EndpointDefinitionInput): EndpointAdapter;
|
|
799
878
|
}
|
|
@@ -834,6 +913,16 @@ declare function readFirstRedisStreamEntry(value: unknown): {
|
|
|
834
913
|
fields: Record<string, Uint8Array>;
|
|
835
914
|
} | null;
|
|
836
915
|
declare function createRedisStreamPayload(fields: Record<string, Uint8Array>, endpoint: EndpointDefinition): TrackingPayload;
|
|
916
|
+
declare function toSqsMessageAttributes(headers: Record<string, string>, contentType?: string): Record<string, {
|
|
917
|
+
DataType: string;
|
|
918
|
+
StringValue: string;
|
|
919
|
+
}>;
|
|
920
|
+
declare function fromSqsMessageAttributes(attributes: Record<string, {
|
|
921
|
+
StringValue?: string;
|
|
922
|
+
} | undefined> | undefined): {
|
|
923
|
+
headers: Record<string, string>;
|
|
924
|
+
contentType?: string;
|
|
925
|
+
};
|
|
837
926
|
declare function payloadBodyAsUtf8(body: unknown): string;
|
|
838
927
|
export declare const __loadstrikeTestExports: {
|
|
839
928
|
AzureEventHubsEndpointAdapter: typeof AzureEventHubsEndpointAdapter;
|
|
@@ -852,6 +941,9 @@ export declare const __loadstrikeTestExports: {
|
|
|
852
941
|
RedisStreamsEndpointAdapter: typeof RedisStreamsEndpointAdapter;
|
|
853
942
|
RedisStreamsEndpointDefinition: typeof RedisStreamsEndpointDefinitionModel;
|
|
854
943
|
RedisStreamsEndpointDefinitionModel: typeof RedisStreamsEndpointDefinitionModel;
|
|
944
|
+
SqsEndpointAdapter: typeof SqsEndpointAdapter;
|
|
945
|
+
SqsEndpointDefinition: typeof SqsEndpointDefinitionModel;
|
|
946
|
+
SqsEndpointDefinitionModel: typeof SqsEndpointDefinitionModel;
|
|
855
947
|
bufferToUint8Array: typeof bufferToUint8Array;
|
|
856
948
|
applyHttpAuthHeaders: typeof applyHttpAuthHeaders;
|
|
857
949
|
buildHttpRequestBody: typeof buildHttpRequestBody;
|
|
@@ -886,6 +978,9 @@ export declare const __loadstrikeTestExports: {
|
|
|
886
978
|
shouldUseConfluentKafkaClient: typeof shouldUseConfluentKafkaClient;
|
|
887
979
|
toHeaderRecord: typeof toHeaderRecord;
|
|
888
980
|
toKafkaHeadersWithContentType: typeof toKafkaHeadersWithContentType;
|
|
981
|
+
toSqsMessageAttributes: typeof toSqsMessageAttributes;
|
|
982
|
+
fromSqsMessageAttributes: typeof fromSqsMessageAttributes;
|
|
983
|
+
setSqsClientFactoryForTests: (factory: typeof sqsClientFactoryForTests) => void;
|
|
889
984
|
validateHttpEndpoint: typeof validateHttpEndpoint;
|
|
890
985
|
validateTrackingSelectorPath: typeof validateTrackingSelectorPath;
|
|
891
986
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loadstrike/loadstrike-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23001",
|
|
4
4
|
"description": "TypeScript and JavaScript SDK for in-process load execution, traffic correlation, and reporting.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"load-testing",
|
|
@@ -37,12 +37,6 @@
|
|
|
37
37
|
"import": "./dist/esm/correlation.js",
|
|
38
38
|
"require": "./dist/cjs/correlation.js",
|
|
39
39
|
"default": "./dist/esm/correlation.js"
|
|
40
|
-
},
|
|
41
|
-
"./transports": {
|
|
42
|
-
"types": "./dist/types/transports.d.ts",
|
|
43
|
-
"import": "./dist/esm/transports.js",
|
|
44
|
-
"require": "./dist/cjs/transports.js",
|
|
45
|
-
"default": "./dist/esm/transports.js"
|
|
46
40
|
}
|
|
47
41
|
},
|
|
48
42
|
"files": [
|
|
@@ -67,6 +61,7 @@
|
|
|
67
61
|
"test:broker": "node --test --test-concurrency=1 tests/broker-integration.test.mjs tests/broker-distributed.test.mjs"
|
|
68
62
|
},
|
|
69
63
|
"dependencies": {
|
|
64
|
+
"@aws-sdk/client-sqs": "^3.1045.0",
|
|
70
65
|
"@azure/event-hubs": "^5.12.2",
|
|
71
66
|
"@confluentinc/kafka-javascript": "^1.8.2",
|
|
72
67
|
"@types/pg": "^8.18.0",
|