@loadstrike/loadstrike-sdk 1.0.10101 → 1.0.10801
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 +8 -8
- package/dist/cjs/cluster.js +18 -1
- package/dist/cjs/correlation.js +69 -11
- package/dist/cjs/index.js +2 -14
- package/dist/cjs/local.js +88 -18
- package/dist/cjs/reporting.js +19 -5
- package/dist/cjs/runtime.js +526 -264
- package/dist/cjs/sinks.js +200 -106
- package/dist/cjs/transports.js +104 -18
- package/dist/esm/cluster.js +17 -0
- package/dist/esm/correlation.js +68 -10
- package/dist/esm/index.js +2 -4
- package/dist/esm/local.js +86 -16
- package/dist/esm/reporting.js +18 -2
- package/dist/esm/runtime.js +527 -264
- package/dist/esm/sinks.js +199 -105
- package/dist/esm/transports.js +103 -17
- package/dist/types/cluster.d.ts +30 -0
- package/dist/types/contracts.d.ts +15 -15
- package/dist/types/correlation.d.ts +41 -1
- package/dist/types/index.d.ts +4 -8
- package/dist/types/local.d.ts +146 -2
- package/dist/types/reporting.d.ts +33 -0
- package/dist/types/runtime.d.ts +464 -77
- package/dist/types/sinks.d.ts +212 -21
- package/dist/types/transports.d.ts +142 -0
- package/package.json +8 -19
|
@@ -16,7 +16,6 @@ export interface LoadStrikeRunContext {
|
|
|
16
16
|
ClusterId?: string;
|
|
17
17
|
CoordinatorTargetScenarios?: string[];
|
|
18
18
|
RunnerKey?: string;
|
|
19
|
-
LicenseValidationServerUrl?: string;
|
|
20
19
|
LicenseValidationTimeoutSeconds?: number;
|
|
21
20
|
MinimumLogLevel?: string;
|
|
22
21
|
NatsServerUrl?: string;
|
|
@@ -74,6 +73,8 @@ export interface LoadStrikeTrackingConfigurationSpec {
|
|
|
74
73
|
TimeoutSweepIntervalSeconds?: number;
|
|
75
74
|
TimeoutBatchSize?: number;
|
|
76
75
|
TimeoutCountsAsFailure?: boolean;
|
|
76
|
+
TrackingFieldValueCaseSensitive?: boolean;
|
|
77
|
+
GatherByFieldValueCaseSensitive?: boolean;
|
|
77
78
|
ExecuteOriginalScenarioRun?: boolean;
|
|
78
79
|
MetricPrefix?: string;
|
|
79
80
|
CorrelationStore?: LoadStrikeCorrelationStoreSpec;
|
|
@@ -113,8 +114,11 @@ export interface LoadStrikeHttpEndpointOptions {
|
|
|
113
114
|
Method?: string;
|
|
114
115
|
BodyType?: string;
|
|
115
116
|
RequestTimeoutSeconds?: number;
|
|
117
|
+
ResponseSource?: string;
|
|
116
118
|
TrackingPayloadSource?: string;
|
|
119
|
+
ConsumeArrayPath?: string;
|
|
117
120
|
ConsumeJsonArrayResponse?: boolean;
|
|
121
|
+
TokenRequestHeaders?: Record<string, string>;
|
|
118
122
|
Auth?: LoadStrikeHttpAuthOptions;
|
|
119
123
|
}
|
|
120
124
|
export interface LoadStrikeHttpAuthOptions {
|
|
@@ -122,6 +126,14 @@ export interface LoadStrikeHttpAuthOptions {
|
|
|
122
126
|
Username?: string;
|
|
123
127
|
Password?: string;
|
|
124
128
|
BearerToken?: string;
|
|
129
|
+
TokenUrl?: string;
|
|
130
|
+
ClientId?: string;
|
|
131
|
+
ClientSecret?: string;
|
|
132
|
+
Scope?: string;
|
|
133
|
+
Scopes?: string[];
|
|
134
|
+
Audience?: string;
|
|
135
|
+
AdditionalFormFields?: Record<string, string>;
|
|
136
|
+
TokenHeaderName?: string;
|
|
125
137
|
OAuth2ClientCredentials?: LoadStrikeHttpOAuth2ClientCredentialsOptions;
|
|
126
138
|
}
|
|
127
139
|
export interface LoadStrikeHttpOAuth2ClientCredentialsOptions {
|
|
@@ -186,6 +198,8 @@ export interface LoadStrikeAzureEventHubsEndpointOptions {
|
|
|
186
198
|
ConsumerGroup?: string;
|
|
187
199
|
StartFromEarliest?: boolean;
|
|
188
200
|
PartitionId?: string;
|
|
201
|
+
PartitionKey?: string;
|
|
202
|
+
PartitionCount?: number;
|
|
189
203
|
}
|
|
190
204
|
export interface LoadStrikeDelegateEndpointOptions {
|
|
191
205
|
ProduceCallbackUrl?: string;
|
|
@@ -209,7 +223,6 @@ export interface LoadStrikeReportingSinkSpec {
|
|
|
209
223
|
Datadog?: LoadStrikeDatadogSinkOptions;
|
|
210
224
|
Splunk?: LoadStrikeSplunkSinkOptions;
|
|
211
225
|
OtelCollector?: LoadStrikeOtelCollectorSinkOptions;
|
|
212
|
-
Webhook?: LoadStrikeWebhookSinkOptions;
|
|
213
226
|
}
|
|
214
227
|
export interface LoadStrikeInfluxDbSinkOptions {
|
|
215
228
|
BaseUrl?: string;
|
|
@@ -271,10 +284,6 @@ export interface LoadStrikeOtelCollectorSinkOptions {
|
|
|
271
284
|
Headers?: Record<string, string>;
|
|
272
285
|
StaticResourceAttributes?: Record<string, string>;
|
|
273
286
|
}
|
|
274
|
-
export interface LoadStrikeWebhookSinkOptions {
|
|
275
|
-
SinkName?: string;
|
|
276
|
-
CallbackUrl?: string;
|
|
277
|
-
}
|
|
278
287
|
export interface LoadStrikeWorkerPluginSpec {
|
|
279
288
|
PluginName: string;
|
|
280
289
|
CallbackUrl: string;
|
|
@@ -428,12 +437,3 @@ export interface LoadStrikeConsumedMessageDto {
|
|
|
428
437
|
TimestampUtc?: string;
|
|
429
438
|
Payload?: LoadStrikePayloadDto;
|
|
430
439
|
}
|
|
431
|
-
export interface LoadStrikeWebhookEnvelope {
|
|
432
|
-
EventType: string;
|
|
433
|
-
Payload?: unknown;
|
|
434
|
-
}
|
|
435
|
-
export interface LoadStrikePluginCallbackResponse {
|
|
436
|
-
PluginName?: string;
|
|
437
|
-
Hints?: string[];
|
|
438
|
-
Tables?: LoadStrikePluginDataTableDto[];
|
|
439
|
-
}
|
|
@@ -181,13 +181,15 @@ export declare class TrackingFieldSelector {
|
|
|
181
181
|
}
|
|
182
182
|
export interface CorrelationRuntimePlugin {
|
|
183
183
|
onProduced?: (trackingId: string, payload: TrackingPayload) => void | Promise<void>;
|
|
184
|
-
onMatched?: (trackingId: string, source: TrackingPayload, destination: TrackingPayload, latencyMs: number) => void | Promise<void>;
|
|
184
|
+
onMatched?: (trackingId: string, source: TrackingPayload, destination: TrackingPayload, latencyMs: number, gatherKey?: string) => void | Promise<void>;
|
|
185
185
|
onTimeout?: (trackingId: string, source: TrackingPayload) => void | Promise<void>;
|
|
186
186
|
}
|
|
187
187
|
export interface CorrelationRuntimeOptions {
|
|
188
188
|
sourceTrackingField: string;
|
|
189
189
|
destinationTrackingField?: string;
|
|
190
190
|
destinationGatherByField?: string;
|
|
191
|
+
trackingFieldValueCaseSensitive?: boolean;
|
|
192
|
+
gatherByFieldValueCaseSensitive?: boolean;
|
|
191
193
|
correlationTimeoutMs?: number;
|
|
192
194
|
timeoutCountsAsFailure?: boolean;
|
|
193
195
|
store?: CorrelationStore;
|
|
@@ -208,10 +210,14 @@ export declare class CrossPlatformTrackingRuntime {
|
|
|
208
210
|
private readonly sourceSelector;
|
|
209
211
|
private readonly destinationSelector;
|
|
210
212
|
private readonly gatherSelector;
|
|
213
|
+
private readonly trackingFieldValueCaseSensitive;
|
|
214
|
+
private readonly gatherByFieldValueCaseSensitive;
|
|
211
215
|
private readonly timeoutMs;
|
|
212
216
|
private readonly timeoutCountsAsFailure;
|
|
213
217
|
private readonly store;
|
|
214
218
|
private readonly plugins;
|
|
219
|
+
private readonly trackingIdDisplayByEventId;
|
|
220
|
+
private readonly gatherByDisplayByComparisonKey;
|
|
215
221
|
private producedCount;
|
|
216
222
|
private consumedCount;
|
|
217
223
|
private matchedCount;
|
|
@@ -230,5 +236,39 @@ export declare class CrossPlatformTrackingRuntime {
|
|
|
230
236
|
getStats(): Promise<CorrelationRuntimeStats>;
|
|
231
237
|
private resolveGatherKey;
|
|
232
238
|
isTimeoutCountedAsFailure(): boolean;
|
|
239
|
+
private resolveTrackingIdDisplay;
|
|
233
240
|
}
|
|
241
|
+
declare function normalizeCorrelationEntry(entry: CorrelationEntry, expiresUtc?: number | null): CorrelationEntry & {
|
|
242
|
+
expiresUtc?: number | null;
|
|
243
|
+
};
|
|
244
|
+
declare function hydrateCorrelationEntry(entry: CorrelationEntry & {
|
|
245
|
+
expiresUtc?: number | null;
|
|
246
|
+
}): CorrelationEntry;
|
|
247
|
+
declare function parseStringList(raw: string): string[];
|
|
248
|
+
declare function uniqueStringList(values: string[]): string[];
|
|
249
|
+
declare function createRedisStoreClient(connectionString: string, database: number): {
|
|
250
|
+
set: (key: string, value: string) => Promise<unknown>;
|
|
251
|
+
get: (key: string) => Promise<string | null>;
|
|
252
|
+
del: (key: string) => Promise<unknown>;
|
|
253
|
+
keys: (pattern: string) => Promise<string[]>;
|
|
254
|
+
close: () => Promise<void>;
|
|
255
|
+
};
|
|
256
|
+
declare function tryParseObject(value: string): Record<string, unknown> | null;
|
|
257
|
+
declare function sanitizeLooseJson(value: string): string;
|
|
258
|
+
declare function readJsonPathSegment(current: unknown, segment: string): unknown;
|
|
259
|
+
export declare const __loadstrikeTestExports: {
|
|
260
|
+
CorrelationStoreConfiguration: typeof CorrelationStoreConfiguration;
|
|
261
|
+
InMemoryCorrelationStore: typeof InMemoryCorrelationStore;
|
|
262
|
+
RedisCorrelationStore: typeof RedisCorrelationStore;
|
|
263
|
+
RedisCorrelationStoreOptions: typeof RedisCorrelationStoreOptions;
|
|
264
|
+
TrackingFieldSelector: typeof TrackingFieldSelector;
|
|
265
|
+
createRedisStoreClient: typeof createRedisStoreClient;
|
|
266
|
+
hydrateCorrelationEntry: typeof hydrateCorrelationEntry;
|
|
267
|
+
normalizeCorrelationEntry: typeof normalizeCorrelationEntry;
|
|
268
|
+
parseStringList: typeof parseStringList;
|
|
269
|
+
readJsonPathSegment: typeof readJsonPathSegment;
|
|
270
|
+
sanitizeLooseJson: typeof sanitizeLooseJson;
|
|
271
|
+
tryParseObject: typeof tryParseObject;
|
|
272
|
+
uniqueStringList: typeof uniqueStringList;
|
|
273
|
+
};
|
|
234
274
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
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,
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
4
|
-
export { CrossPlatformScenarioConfigurator, ScenarioTrackingExtensions, LoadStrikeContext, LoadStrikePluginData, LoadStrikePluginDataTable, LoadStrikeReportData, LoadStrikeNodeType, LoadStrikeReportFormat, LoadStrikeResponse, LoadStrikeLogLevel, LoadStrikeScenarioOperation, LoadStrikeOperationType, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeSimulation, LoadStrikeMetric, LoadStrikeCounter, LoadStrikeGauge, LoadStrikeStep, LoadStrikeThreshold } from "./runtime.js";
|
|
5
|
-
export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeNodeStats, 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, CrossPlatformTrackingConfiguration, LoadStrikeStepReply, LoadStrikeStepStats, LoadStrikeStepRuntime, LoadStrikeThresholdOptions, LoadStrikeRequestStats, LoadStrikeWorkerPlugin } from "./runtime.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, 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
|
+
export { CrossPlatformScenarioConfigurator, ScenarioTrackingExtensions, LoadStrikeContext, LoadStrikePluginData, LoadStrikePluginDataTable, LoadStrikeNodeType, LoadStrikeReportFormat, LoadStrikeResponse, LoadStrikeLogLevel, LoadStrikeScenarioOperation, LoadStrikeOperationType, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeSimulation, LoadStrikeMetric, LoadStrikeCounter, LoadStrikeGauge, LoadStrikeStep, LoadStrikeThreshold } from "./runtime.js";
|
|
3
|
+
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, CrossPlatformTrackingConfiguration, LoadStrikeStepReply, LoadStrikeStepStats, LoadStrikeStepRuntime, LoadStrikeThresholdOptions, LoadStrikeRequestStats, LoadStrikeWorkerPlugin } from "./runtime.js";
|
|
6
4
|
export { CorrelationStoreConfiguration, CrossPlatformTrackingRuntime, InMemoryCorrelationStore, RedisCorrelationStoreOptions, RedisCorrelationStore, TrackingPayloadBuilder, TrackingFieldSelector } from "./correlation.js";
|
|
7
5
|
export type { CorrelationEntry, DestinationConsumeResult, GatheredRow, CorrelationStoreKind, CorrelationRuntimeOptions, CorrelationRuntimePlugin, CorrelationRuntimeStats, CorrelationStore, SourceProduceResult, TrackingFieldLocation, TrackingPayload } from "./correlation.js";
|
|
8
6
|
export { EndpointAdapterFactory, TrafficEndpointDefinition, HttpEndpointDefinition, KafkaEndpointDefinition, KafkaSaslOptions, RabbitMqEndpointDefinition, NatsEndpointDefinition, RedisStreamsEndpointDefinition, AzureEventHubsEndpointDefinition, DelegateStreamEndpointDefinition, PushDiffusionEndpointDefinition, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
|
|
9
7
|
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";
|
|
10
|
-
export {
|
|
11
|
-
export type { ClusterAgent, ClusterNodeResult, ClusterNodeStatsPayload, ClusterAssignmentOptions, ClusterRunCommandMessage, ClusterRunResultMessage, ClusterScenarioDispatch, DistributedClusterAgentOptions, DistributedClusterCoordinatorOptions, DistributedClusterDispatchResult } from "./cluster.js";
|
|
12
|
-
export { CompositeReportingSink, ConsoleReportingSink, DatadogReportingSink, DatadogReportingSinkOptions, GrafanaLokiReportingSink, GrafanaLokiReportingSinkOptions, InfluxDbReportingSink, InfluxDbReportingSinkOptions, MemoryReportingSink, OtelCollectorReportingSink, OtelCollectorReportingSinkOptions, SplunkReportingSink, SplunkReportingSinkOptions, TimescaleDbReportingSink, TimescaleDbReportingSinkOptions } from "./sinks.js";
|
|
8
|
+
export { DatadogReportingSink, DatadogReportingSinkOptions, GrafanaLokiReportingSink, GrafanaLokiReportingSinkOptions, InfluxDbReportingSink, InfluxDbReportingSinkOptions, OtelCollectorReportingSink, OtelCollectorReportingSinkOptions, SplunkReportingSink, SplunkReportingSinkOptions, TimescaleDbReportingSink, TimescaleDbReportingSinkOptions } from "./sinks.js";
|
|
13
9
|
export type { DatadogSinkOptions, GrafanaLokiSinkOptions, InfluxDbSinkOptions, OtelCollectorSinkOptions, SplunkSinkOptions, TimescaleDbSinkOptions } from "./sinks.js";
|
package/dist/types/local.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import { RedisCorrelationStoreOptions, RedisCorrelationStore, type TrackingPayload } from "./correlation.js";
|
|
2
|
+
import { type EndpointDefinition } from "./transports.js";
|
|
1
3
|
import type { LoadStrikeRunRequest, LoadStrikeRunResponse } from "./contracts.js";
|
|
2
4
|
export interface LoadStrikeLocalClientOptions {
|
|
3
|
-
licensingApiBaseUrl?: string;
|
|
4
5
|
licenseValidationTimeoutMs?: number;
|
|
5
6
|
}
|
|
7
|
+
interface LicenseKeyRecord {
|
|
8
|
+
keyId: string;
|
|
9
|
+
algorithm: string;
|
|
10
|
+
issuer?: string;
|
|
11
|
+
audience?: string;
|
|
12
|
+
publicKeyPem?: string;
|
|
13
|
+
expiresAtUtc: number;
|
|
14
|
+
}
|
|
6
15
|
export interface LicenseValidationSession {
|
|
7
16
|
runToken?: string;
|
|
8
17
|
sessionId?: string;
|
|
@@ -11,7 +20,6 @@ export interface LicenseValidationSession {
|
|
|
11
20
|
environmentClassification?: number;
|
|
12
21
|
heartbeatTimer?: ReturnType<typeof setInterval>;
|
|
13
22
|
}
|
|
14
|
-
export declare const DEFAULT_LICENSING_API_BASE_URL = "https://licensing.loadstrike.com";
|
|
15
23
|
export declare class LoadStrikeLocalClient {
|
|
16
24
|
private readonly licensingApiBaseUrl;
|
|
17
25
|
private readonly licenseValidationTimeoutMs;
|
|
@@ -28,3 +36,139 @@ export declare class LoadStrikeLocalClient {
|
|
|
28
36
|
private postLicensingRequest;
|
|
29
37
|
private getLicensingRequest;
|
|
30
38
|
}
|
|
39
|
+
declare function sanitizeRequest(request: LoadStrikeRunRequest): LoadStrikeRunRequest;
|
|
40
|
+
declare function normalizeLicensingApiBaseUrl(value: string | undefined): string;
|
|
41
|
+
declare function resolveLicensingApiBaseUrl(): string;
|
|
42
|
+
declare function setDevelopmentLicensingApiBaseUrlOverride(value: string | undefined): void;
|
|
43
|
+
declare function normalizeTimeoutMs(value: number | undefined): number;
|
|
44
|
+
declare function collectRequestedFeatures(request: LoadStrikeRunRequest): string[];
|
|
45
|
+
declare function mapEnvironmentClassification(value: string): number;
|
|
46
|
+
declare function isLocalHost(): boolean;
|
|
47
|
+
declare function isLinuxLocalHost(): boolean;
|
|
48
|
+
declare function isContainerHost(): boolean;
|
|
49
|
+
declare function hasLinuxDesktopSession(): boolean;
|
|
50
|
+
declare function hasTruthyEnv(name: string): boolean;
|
|
51
|
+
declare function fileContains(path: string, markers: string[]): boolean;
|
|
52
|
+
declare function deviceHash(): string;
|
|
53
|
+
declare function addIfNotBlank(values: string[], value: string | undefined | null): void;
|
|
54
|
+
declare function readWindowsMachineGuid(): string;
|
|
55
|
+
declare function readLinuxMachineId(): string;
|
|
56
|
+
declare function readMacPlatformUuid(): string;
|
|
57
|
+
declare function evaluateScenarioOutcome(scenario: Record<string, unknown>, requestCount: number, context: Record<string, unknown>): Promise<{
|
|
58
|
+
requestCount: number;
|
|
59
|
+
okCount: number;
|
|
60
|
+
failCount: number;
|
|
61
|
+
}>;
|
|
62
|
+
declare function validateTrackingConfiguration(tracking: Record<string, unknown>, sourceEndpoint: EndpointDefinition, destinationEndpoint: EndpointDefinition | null): void;
|
|
63
|
+
declare function inferLegacyHttpResponseSourceValue(value: string | undefined): "ResponseBody" | "ResponseHeaders" | "ResponseStatusCode" | undefined;
|
|
64
|
+
declare function mapEndpointSpec(spec: Record<string, unknown>): EndpointDefinition;
|
|
65
|
+
declare function normalizePayload(payload: TrackingPayload | null, endpoint: EndpointDefinition, index: number): TrackingPayload;
|
|
66
|
+
declare function readTrackingId(payload: TrackingPayload, selector: string): string | null;
|
|
67
|
+
declare function readOptionalTrackingSelectorValue(value: unknown): string | undefined;
|
|
68
|
+
declare function setJsonPathValue(body: unknown, path: string, value: string): unknown;
|
|
69
|
+
declare function mapCorrelationStore(tracking: Record<string, unknown>, runNamespace: string): RedisCorrelationStore | null;
|
|
70
|
+
declare function validateRedisCorrelationStoreConfiguration(tracking: Record<string, unknown>): void;
|
|
71
|
+
declare function readRedisCorrelationStoreOptions(redisSpec: Record<string, unknown>): RedisCorrelationStoreOptions;
|
|
72
|
+
declare function normalizeEndpointPayloadValue(value: unknown, payloadType: string | undefined, serializerSettings?: Record<string, unknown>, convertSettings?: Record<string, unknown>): unknown;
|
|
73
|
+
declare function parseBodyAsObject(body: unknown): Record<string, unknown> | null;
|
|
74
|
+
declare function tryParseJson(value: string): unknown | undefined;
|
|
75
|
+
declare function sanitizeLooseJson(value: string): string;
|
|
76
|
+
declare function sleep(ms: number): Promise<void>;
|
|
77
|
+
declare function computeScenarioRequestCount(scenario: Record<string, unknown>): number;
|
|
78
|
+
declare function evaluateScenarioThresholds(scenario: Record<string, unknown>, values: {
|
|
79
|
+
scenarioName: string;
|
|
80
|
+
requestCount: number;
|
|
81
|
+
okCount: number;
|
|
82
|
+
failCount: number;
|
|
83
|
+
durationMs: number;
|
|
84
|
+
}): Array<Record<string, unknown>>;
|
|
85
|
+
declare function buildThresholdExpression(scope: string, stepName: string): string;
|
|
86
|
+
declare function isRuntimeReportingSink(value: unknown): boolean;
|
|
87
|
+
declare function toStringMap(value: unknown): Record<string, string>;
|
|
88
|
+
declare function stringOrDefault(value: unknown, fallback: string): string;
|
|
89
|
+
declare function asNullableInt(value: unknown): number | undefined;
|
|
90
|
+
declare function asNumber(value: unknown): number;
|
|
91
|
+
declare function toBoolean(value: unknown, fallback: boolean): boolean;
|
|
92
|
+
declare function parseJwt(token: string): {
|
|
93
|
+
header: Record<string, unknown>;
|
|
94
|
+
payload: Record<string, unknown>;
|
|
95
|
+
signingInput: string;
|
|
96
|
+
signature: Buffer;
|
|
97
|
+
};
|
|
98
|
+
declare function decodeJwtJsonSegment(segment: string): Record<string, unknown>;
|
|
99
|
+
declare function decodeBase64Url(value: string): Buffer;
|
|
100
|
+
declare function verifyJwtSignature(token: string, keyRecord: LicenseKeyRecord, algorithm: string): boolean;
|
|
101
|
+
declare function enforceJwtLifetime(payload: Record<string, unknown>): void;
|
|
102
|
+
declare function readEpochClaim(payload: Record<string, unknown>, ...keys: string[]): number | null;
|
|
103
|
+
declare function enforceEntitlementClaims(payload: Record<string, unknown>, requestedFeatures: string[]): void;
|
|
104
|
+
declare function enforceRuntimePolicyClaims(payload: Record<string, unknown>, request: LoadStrikeRunRequest): void;
|
|
105
|
+
declare function normalizeStringArray(value: unknown): string[];
|
|
106
|
+
declare function collectClaimStrings(payload: Record<string, unknown>, ...keys: string[]): string[];
|
|
107
|
+
declare function resolveRuntimePolicy(payload: Record<string, unknown>): Record<string, unknown>;
|
|
108
|
+
declare function normalizeNodeType(value: unknown): string;
|
|
109
|
+
declare function toContractNodeType(value: unknown): string;
|
|
110
|
+
declare function countTargetedScenarios(context: Record<string, unknown>): number;
|
|
111
|
+
declare function countCustomWorkerPlugins(context: Record<string, unknown>): number;
|
|
112
|
+
declare function resolveTimeoutSeconds(context: Record<string, unknown>, secondsKey: string, secondsAlias: string, millisecondsKey: string, millisecondsAlias: string, defaultSeconds?: number): number;
|
|
113
|
+
export declare const __loadstrikeTestExports: {
|
|
114
|
+
addIfNotBlank: typeof addIfNotBlank;
|
|
115
|
+
asNullableInt: typeof asNullableInt;
|
|
116
|
+
asNumber: typeof asNumber;
|
|
117
|
+
buildThresholdExpression: typeof buildThresholdExpression;
|
|
118
|
+
collectClaimStrings: typeof collectClaimStrings;
|
|
119
|
+
collectRequestedFeatures: typeof collectRequestedFeatures;
|
|
120
|
+
computeScenarioRequestCount: typeof computeScenarioRequestCount;
|
|
121
|
+
countCustomWorkerPlugins: typeof countCustomWorkerPlugins;
|
|
122
|
+
countTargetedScenarios: typeof countTargetedScenarios;
|
|
123
|
+
decodeBase64Url: typeof decodeBase64Url;
|
|
124
|
+
decodeJwtJsonSegment: typeof decodeJwtJsonSegment;
|
|
125
|
+
deviceHash: typeof deviceHash;
|
|
126
|
+
enforceEntitlementClaims: typeof enforceEntitlementClaims;
|
|
127
|
+
enforceJwtLifetime: typeof enforceJwtLifetime;
|
|
128
|
+
enforceRuntimePolicyClaims: typeof enforceRuntimePolicyClaims;
|
|
129
|
+
evaluateScenarioOutcome: typeof evaluateScenarioOutcome;
|
|
130
|
+
evaluateScenarioThresholds: typeof evaluateScenarioThresholds;
|
|
131
|
+
fileContains: typeof fileContains;
|
|
132
|
+
hasLinuxDesktopSession: typeof hasLinuxDesktopSession;
|
|
133
|
+
hasTruthyEnv: typeof hasTruthyEnv;
|
|
134
|
+
inferLegacyHttpResponseSourceValue: typeof inferLegacyHttpResponseSourceValue;
|
|
135
|
+
isContainerHost: typeof isContainerHost;
|
|
136
|
+
isLinuxLocalHost: typeof isLinuxLocalHost;
|
|
137
|
+
isLocalHost: typeof isLocalHost;
|
|
138
|
+
isRuntimeReportingSink: typeof isRuntimeReportingSink;
|
|
139
|
+
mapCorrelationStore: typeof mapCorrelationStore;
|
|
140
|
+
mapEnvironmentClassification: typeof mapEnvironmentClassification;
|
|
141
|
+
mapEndpointSpec: typeof mapEndpointSpec;
|
|
142
|
+
normalizeEndpointPayloadValue: typeof normalizeEndpointPayloadValue;
|
|
143
|
+
normalizeLicensingApiBaseUrl: typeof normalizeLicensingApiBaseUrl;
|
|
144
|
+
resolveLicensingApiBaseUrl: typeof resolveLicensingApiBaseUrl;
|
|
145
|
+
normalizeNodeType: typeof normalizeNodeType;
|
|
146
|
+
normalizePayload: typeof normalizePayload;
|
|
147
|
+
normalizeStringArray: typeof normalizeStringArray;
|
|
148
|
+
normalizeTimeoutMs: typeof normalizeTimeoutMs;
|
|
149
|
+
parseBodyAsObject: typeof parseBodyAsObject;
|
|
150
|
+
parseJwt: typeof parseJwt;
|
|
151
|
+
readEpochClaim: typeof readEpochClaim;
|
|
152
|
+
readLinuxMachineId: typeof readLinuxMachineId;
|
|
153
|
+
readMacPlatformUuid: typeof readMacPlatformUuid;
|
|
154
|
+
readOptionalTrackingSelectorValue: typeof readOptionalTrackingSelectorValue;
|
|
155
|
+
readRedisCorrelationStoreOptions: typeof readRedisCorrelationStoreOptions;
|
|
156
|
+
readTrackingId: typeof readTrackingId;
|
|
157
|
+
readWindowsMachineGuid: typeof readWindowsMachineGuid;
|
|
158
|
+
resolveRuntimePolicy: typeof resolveRuntimePolicy;
|
|
159
|
+
resolveTimeoutSeconds: typeof resolveTimeoutSeconds;
|
|
160
|
+
sanitizeLooseJson: typeof sanitizeLooseJson;
|
|
161
|
+
sanitizeRequest: typeof sanitizeRequest;
|
|
162
|
+
setJsonPathValue: typeof setJsonPathValue;
|
|
163
|
+
setDevelopmentLicensingApiBaseUrlOverride: typeof setDevelopmentLicensingApiBaseUrlOverride;
|
|
164
|
+
sleep: typeof sleep;
|
|
165
|
+
stringOrDefault: typeof stringOrDefault;
|
|
166
|
+
toBoolean: typeof toBoolean;
|
|
167
|
+
toContractNodeType: typeof toContractNodeType;
|
|
168
|
+
toStringMap: typeof toStringMap;
|
|
169
|
+
tryParseJson: typeof tryParseJson;
|
|
170
|
+
validateRedisCorrelationStoreConfiguration: typeof validateRedisCorrelationStoreConfiguration;
|
|
171
|
+
validateTrackingConfiguration: typeof validateTrackingConfiguration;
|
|
172
|
+
verifyJwtSignature: typeof verifyJwtSignature;
|
|
173
|
+
};
|
|
174
|
+
export {};
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
type ReportRecord = Record<string, any>;
|
|
2
|
+
type ReportTab = [string, string, string];
|
|
3
|
+
declare function buildUngroupedCorrelationChartPayload(rows: ReportRecord[]): ReportRecord;
|
|
4
|
+
declare function classifyStatusCodeBucket(statusCode: unknown): string;
|
|
5
|
+
declare function buildDotnetScenarioHtml(nodeStats: ReportRecord): string;
|
|
6
|
+
declare function buildDotnetStepHtml(nodeStats: ReportRecord): string;
|
|
7
|
+
declare function buildDotnetScenarioMeasurementHtml(nodeStats: ReportRecord): string;
|
|
8
|
+
declare function buildDotnetStepMeasurementHtml(nodeStats: ReportRecord): string;
|
|
9
|
+
declare function buildDotnetStatusCodeHtml(nodeStats: ReportRecord): string;
|
|
10
|
+
declare function buildDotnetFailedResponseHtml(nodeStats: ReportRecord): string;
|
|
11
|
+
declare function buildDotnetFailedResponseContent(failedStatusRows: ReportRecord[], failedEventRows: ReportRecord[]): string;
|
|
12
|
+
declare function buildDotnetThresholdHtml(nodeStats: ReportRecord): string;
|
|
13
|
+
declare function buildDotnetMetricHtml(nodeStats: ReportRecord): string;
|
|
14
|
+
declare function buildDotnetGroupedCorrelationSummaryHtml(rows: ReportRecord[], groupedChartKey: string): string;
|
|
15
|
+
declare function buildDotnetUngroupedCorrelationSummaryHtml(rows: ReportRecord[], groupedChartKey: string): string;
|
|
16
|
+
declare function buildDotnetPluginHints(plugin: ReportRecord): string;
|
|
17
|
+
declare function buildDotnetHtmlTabs(nodeStats: ReportRecord): ReportTab[];
|
|
2
18
|
export declare function buildDotnetTxtReport(nodeStats: ReportRecord): string;
|
|
3
19
|
export declare function buildDotnetCsvReport(nodeStats: ReportRecord): string;
|
|
4
20
|
export declare function buildDotnetMarkdownReport(nodeStats: ReportRecord): string;
|
|
5
21
|
export declare function buildDotnetHtmlReport(nodeStats: ReportRecord): string;
|
|
22
|
+
export declare const __loadstrikeTestExports: {
|
|
23
|
+
buildDotnetFailedResponseContent: typeof buildDotnetFailedResponseContent;
|
|
24
|
+
buildDotnetFailedResponseHtml: typeof buildDotnetFailedResponseHtml;
|
|
25
|
+
buildDotnetGroupedCorrelationSummaryHtml: typeof buildDotnetGroupedCorrelationSummaryHtml;
|
|
26
|
+
buildDotnetHtmlTabs: typeof buildDotnetHtmlTabs;
|
|
27
|
+
buildDotnetMetricHtml: typeof buildDotnetMetricHtml;
|
|
28
|
+
buildDotnetPluginHints: typeof buildDotnetPluginHints;
|
|
29
|
+
buildDotnetScenarioHtml: typeof buildDotnetScenarioHtml;
|
|
30
|
+
buildDotnetScenarioMeasurementHtml: typeof buildDotnetScenarioMeasurementHtml;
|
|
31
|
+
buildDotnetStatusCodeHtml: typeof buildDotnetStatusCodeHtml;
|
|
32
|
+
buildDotnetStepHtml: typeof buildDotnetStepHtml;
|
|
33
|
+
buildDotnetStepMeasurementHtml: typeof buildDotnetStepMeasurementHtml;
|
|
34
|
+
buildDotnetThresholdHtml: typeof buildDotnetThresholdHtml;
|
|
35
|
+
buildDotnetUngroupedCorrelationSummaryHtml: typeof buildDotnetUngroupedCorrelationSummaryHtml;
|
|
36
|
+
buildUngroupedCorrelationChartPayload: typeof buildUngroupedCorrelationChartPayload;
|
|
37
|
+
classifyStatusCodeBucket: typeof classifyStatusCodeBucket;
|
|
38
|
+
};
|
|
6
39
|
export {};
|