@loadstrike/loadstrike-sdk 0.1.0
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 +73 -0
- package/dist/cjs/cluster.js +410 -0
- package/dist/cjs/contracts.js +2 -0
- package/dist/cjs/correlation.js +1009 -0
- package/dist/cjs/index.js +71 -0
- package/dist/cjs/local.js +1884 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/reporting.js +1250 -0
- package/dist/cjs/runtime.js +7013 -0
- package/dist/cjs/sinks.js +2675 -0
- package/dist/cjs/transports.js +3695 -0
- package/dist/esm/cluster.js +403 -0
- package/dist/esm/contracts.js +1 -0
- package/dist/esm/correlation.js +999 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/local.js +1844 -0
- package/dist/esm/reporting.js +1241 -0
- package/dist/esm/runtime.js +6992 -0
- package/dist/esm/sinks.js +2657 -0
- package/dist/esm/transports.js +3658 -0
- package/dist/types/cluster.d.ts +112 -0
- package/dist/types/contracts.d.ts +439 -0
- package/dist/types/correlation.d.ts +234 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/local.d.ts +30 -0
- package/dist/types/reporting.d.ts +6 -0
- package/dist/types/runtime.d.ts +1052 -0
- package/dist/types/sinks.d.ts +497 -0
- package/dist/types/transports.d.ts +745 -0
- package/package.json +110 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
export type TrackingFieldLocation = "Header" | "Json";
|
|
2
|
+
export type CorrelationStoreKind = "InMemory" | "Redis";
|
|
3
|
+
export interface TrackingPayload {
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
body?: unknown;
|
|
6
|
+
producedUtc?: string;
|
|
7
|
+
consumedUtc?: string;
|
|
8
|
+
contentType?: string;
|
|
9
|
+
messagePayloadType?: string;
|
|
10
|
+
jsonSettings?: Record<string, unknown>;
|
|
11
|
+
jsonConvertSettings?: Record<string, unknown>;
|
|
12
|
+
getBodyAsUtf8?: () => string;
|
|
13
|
+
}
|
|
14
|
+
export declare class TrackingPayloadBuilder {
|
|
15
|
+
readonly Headers: Record<string, string>;
|
|
16
|
+
ContentType?: string;
|
|
17
|
+
MessagePayloadType?: string;
|
|
18
|
+
JsonSettings?: Record<string, unknown>;
|
|
19
|
+
JsonConvertSettings?: Record<string, unknown>;
|
|
20
|
+
private body;
|
|
21
|
+
constructor();
|
|
22
|
+
get Body(): Uint8Array;
|
|
23
|
+
setBody(body: string | Uint8Array): void;
|
|
24
|
+
SetBody(body: string | Uint8Array): void;
|
|
25
|
+
build(): TrackingPayload;
|
|
26
|
+
Build(): TrackingPayload;
|
|
27
|
+
}
|
|
28
|
+
export declare class RedisCorrelationStoreOptions {
|
|
29
|
+
ConnectionString: string;
|
|
30
|
+
Database: number;
|
|
31
|
+
KeyPrefix: string;
|
|
32
|
+
EntryTtlSeconds: number;
|
|
33
|
+
get EntryTtl(): number;
|
|
34
|
+
set EntryTtl(value: number);
|
|
35
|
+
validate(): void;
|
|
36
|
+
Validate(): void;
|
|
37
|
+
}
|
|
38
|
+
export declare class CorrelationStoreConfiguration {
|
|
39
|
+
Kind: CorrelationStoreKind;
|
|
40
|
+
Redis?: RedisCorrelationStoreOptions;
|
|
41
|
+
static inMemory(): CorrelationStoreConfiguration;
|
|
42
|
+
static InMemory(): CorrelationStoreConfiguration;
|
|
43
|
+
static redisStore(options: RedisCorrelationStoreOptions): CorrelationStoreConfiguration;
|
|
44
|
+
static RedisStore(options: RedisCorrelationStoreOptions): CorrelationStoreConfiguration;
|
|
45
|
+
validate(): void;
|
|
46
|
+
Validate(): void;
|
|
47
|
+
}
|
|
48
|
+
export interface CorrelationEntry {
|
|
49
|
+
trackingId: string;
|
|
50
|
+
eventId?: string;
|
|
51
|
+
sourceTimestampUtc?: number;
|
|
52
|
+
destinationTimestampUtc?: number | null;
|
|
53
|
+
producedUtc: number;
|
|
54
|
+
payload: TrackingPayload;
|
|
55
|
+
}
|
|
56
|
+
export interface GatheredRow {
|
|
57
|
+
total: number;
|
|
58
|
+
matched: number;
|
|
59
|
+
timedOut: number;
|
|
60
|
+
}
|
|
61
|
+
export interface SourceProduceResult {
|
|
62
|
+
trackingId: string;
|
|
63
|
+
eventId: string;
|
|
64
|
+
sourceTimestampUtc: number;
|
|
65
|
+
duplicateSource: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface DestinationConsumeResult {
|
|
68
|
+
trackingId: string;
|
|
69
|
+
eventId: string;
|
|
70
|
+
sourceTimestampUtc: number;
|
|
71
|
+
destinationTimestampUtc: number;
|
|
72
|
+
gatherKey: string;
|
|
73
|
+
matched: boolean;
|
|
74
|
+
duplicateDestination: boolean;
|
|
75
|
+
latencyMs: number;
|
|
76
|
+
message: string;
|
|
77
|
+
}
|
|
78
|
+
export interface CorrelationStore {
|
|
79
|
+
set(entry: CorrelationEntry): Promise<void> | void;
|
|
80
|
+
get(trackingId: string): Promise<CorrelationEntry | null> | CorrelationEntry | null;
|
|
81
|
+
delete(trackingId: string): Promise<void> | void;
|
|
82
|
+
all(): Promise<CorrelationEntry[]> | CorrelationEntry[];
|
|
83
|
+
collectExpired(nowMs?: number, maxCount?: number): Promise<CorrelationEntry[]> | CorrelationEntry[];
|
|
84
|
+
incrementSourceOccurrences(trackingId: string): Promise<number> | number;
|
|
85
|
+
incrementDestinationOccurrences(trackingId: string): Promise<number> | number;
|
|
86
|
+
registerSource(trackingId: string, sourceTimestampUtc: number): Promise<CorrelationEntry> | CorrelationEntry;
|
|
87
|
+
tryMatchDestination(trackingId: string, destinationTimestampUtc: number): Promise<CorrelationEntry | null> | CorrelationEntry | null;
|
|
88
|
+
tryExpire(eventId: string): Promise<boolean> | boolean;
|
|
89
|
+
close?(): Promise<void> | void;
|
|
90
|
+
}
|
|
91
|
+
export declare class InMemoryCorrelationStore implements CorrelationStore {
|
|
92
|
+
private readonly pendingByTrackingId;
|
|
93
|
+
private readonly pendingByEventId;
|
|
94
|
+
private readonly sourceOccurrences;
|
|
95
|
+
private readonly destinationOccurrences;
|
|
96
|
+
set(entry: CorrelationEntry): void;
|
|
97
|
+
get(trackingId: string): CorrelationEntry | null;
|
|
98
|
+
delete(trackingId: string): void;
|
|
99
|
+
all(): CorrelationEntry[];
|
|
100
|
+
collectExpired(nowMs?: number, maxCount?: number): CorrelationEntry[];
|
|
101
|
+
incrementSourceOccurrences(trackingId: string): number;
|
|
102
|
+
incrementDestinationOccurrences(trackingId: string): number;
|
|
103
|
+
registerSource(trackingId: string, sourceTimestampUtc: number): CorrelationEntry;
|
|
104
|
+
tryMatchDestination(trackingId: string, destinationTimestampUtc: number): CorrelationEntry | null;
|
|
105
|
+
tryExpire(eventId: string): boolean;
|
|
106
|
+
}
|
|
107
|
+
type RedisLikeCorrelationClient = {
|
|
108
|
+
set?: (key: string, value: string) => Promise<unknown>;
|
|
109
|
+
get?: (key: string) => Promise<string | null>;
|
|
110
|
+
del?: (key: string) => Promise<unknown>;
|
|
111
|
+
keys?: (pattern: string) => Promise<string[]>;
|
|
112
|
+
close?: () => Promise<void>;
|
|
113
|
+
};
|
|
114
|
+
export declare class RedisCorrelationStore implements CorrelationStore {
|
|
115
|
+
private readonly fallback;
|
|
116
|
+
private readonly prefix;
|
|
117
|
+
private readonly pendingIndexKey;
|
|
118
|
+
private readonly entryTtlMs;
|
|
119
|
+
private readonly now;
|
|
120
|
+
private readonly fallbackExpiry;
|
|
121
|
+
private readonly client;
|
|
122
|
+
constructor(client?: RedisLikeCorrelationClient | null, prefix?: string, options?: {
|
|
123
|
+
entryTtlMs?: number;
|
|
124
|
+
now?: () => number;
|
|
125
|
+
});
|
|
126
|
+
static fromOptions(options: RedisCorrelationStoreOptions, runNamespace: string): RedisCorrelationStore;
|
|
127
|
+
set(entry: CorrelationEntry): Promise<void>;
|
|
128
|
+
get(trackingId: string): Promise<CorrelationEntry | null>;
|
|
129
|
+
delete(trackingId: string): Promise<void>;
|
|
130
|
+
all(): Promise<CorrelationEntry[]>;
|
|
131
|
+
collectExpired(nowMs?: number, maxCount?: number): Promise<CorrelationEntry[]>;
|
|
132
|
+
incrementSourceOccurrences(trackingId: string): Promise<number>;
|
|
133
|
+
incrementDestinationOccurrences(trackingId: string): Promise<number>;
|
|
134
|
+
registerSource(trackingId: string, sourceTimestampUtc: number): Promise<CorrelationEntry>;
|
|
135
|
+
tryMatchDestination(trackingId: string, destinationTimestampUtc: number): Promise<CorrelationEntry | null>;
|
|
136
|
+
tryExpire(eventId: string): Promise<boolean>;
|
|
137
|
+
close(): Promise<void>;
|
|
138
|
+
private trackFallbackExpiry;
|
|
139
|
+
private incrementCounter;
|
|
140
|
+
private readPendingIndexIds;
|
|
141
|
+
private writePendingIndexIds;
|
|
142
|
+
private appendPendingIndexId;
|
|
143
|
+
private removePendingIndexId;
|
|
144
|
+
private readQueue;
|
|
145
|
+
private writeQueue;
|
|
146
|
+
private enqueuePendingId;
|
|
147
|
+
private removePendingQueueId;
|
|
148
|
+
private readEntry;
|
|
149
|
+
private writeEntry;
|
|
150
|
+
private deleteEventKey;
|
|
151
|
+
private getQueueKey;
|
|
152
|
+
private getEventKey;
|
|
153
|
+
private getSourceOccurrencesKey;
|
|
154
|
+
private getDestinationOccurrencesKey;
|
|
155
|
+
}
|
|
156
|
+
export declare class TrackingFieldSelector {
|
|
157
|
+
readonly kind: "header" | "json";
|
|
158
|
+
readonly path: string;
|
|
159
|
+
constructor(location: TrackingFieldLocation | "header" | "json", path: string);
|
|
160
|
+
static parse(value: string): TrackingFieldSelector;
|
|
161
|
+
static Parse(value: string): TrackingFieldSelector;
|
|
162
|
+
static tryParse(value: string): {
|
|
163
|
+
success: true;
|
|
164
|
+
selector: TrackingFieldSelector;
|
|
165
|
+
} | {
|
|
166
|
+
success: false;
|
|
167
|
+
selector: null;
|
|
168
|
+
};
|
|
169
|
+
static TryParse(value: string): {
|
|
170
|
+
success: true;
|
|
171
|
+
selector: TrackingFieldSelector;
|
|
172
|
+
} | {
|
|
173
|
+
success: false;
|
|
174
|
+
selector: null;
|
|
175
|
+
};
|
|
176
|
+
get Location(): "Header" | "Json";
|
|
177
|
+
get Path(): string;
|
|
178
|
+
extract(payload: TrackingPayload): string | null;
|
|
179
|
+
toString(): string;
|
|
180
|
+
ToString(): string;
|
|
181
|
+
}
|
|
182
|
+
export interface CorrelationRuntimePlugin {
|
|
183
|
+
onProduced?: (trackingId: string, payload: TrackingPayload) => void | Promise<void>;
|
|
184
|
+
onMatched?: (trackingId: string, source: TrackingPayload, destination: TrackingPayload, latencyMs: number) => void | Promise<void>;
|
|
185
|
+
onTimeout?: (trackingId: string, source: TrackingPayload) => void | Promise<void>;
|
|
186
|
+
}
|
|
187
|
+
export interface CorrelationRuntimeOptions {
|
|
188
|
+
sourceTrackingField: string;
|
|
189
|
+
destinationTrackingField?: string;
|
|
190
|
+
destinationGatherByField?: string;
|
|
191
|
+
correlationTimeoutMs?: number;
|
|
192
|
+
timeoutCountsAsFailure?: boolean;
|
|
193
|
+
store?: CorrelationStore;
|
|
194
|
+
plugins?: CorrelationRuntimePlugin[];
|
|
195
|
+
}
|
|
196
|
+
export interface CorrelationRuntimeStats {
|
|
197
|
+
producedCount: number;
|
|
198
|
+
consumedCount: number;
|
|
199
|
+
matchedCount: number;
|
|
200
|
+
timeoutCount: number;
|
|
201
|
+
duplicateSourceCount: number;
|
|
202
|
+
duplicateDestinationCount: number;
|
|
203
|
+
inflightCount: number;
|
|
204
|
+
averageLatencyMs: number;
|
|
205
|
+
gathered: Record<string, GatheredRow>;
|
|
206
|
+
}
|
|
207
|
+
export declare class CrossPlatformTrackingRuntime {
|
|
208
|
+
private readonly sourceSelector;
|
|
209
|
+
private readonly destinationSelector;
|
|
210
|
+
private readonly gatherSelector;
|
|
211
|
+
private readonly timeoutMs;
|
|
212
|
+
private readonly timeoutCountsAsFailure;
|
|
213
|
+
private readonly store;
|
|
214
|
+
private readonly plugins;
|
|
215
|
+
private producedCount;
|
|
216
|
+
private consumedCount;
|
|
217
|
+
private matchedCount;
|
|
218
|
+
private timeoutCount;
|
|
219
|
+
private duplicateSourceCount;
|
|
220
|
+
private duplicateDestinationCount;
|
|
221
|
+
private totalLatencyMs;
|
|
222
|
+
private readonly gathered;
|
|
223
|
+
constructor(options: CorrelationRuntimeOptions);
|
|
224
|
+
onSourceProduced(payload: TrackingPayload, nowMs?: number): Promise<string | null>;
|
|
225
|
+
onSourceProducedDetailed(payload: TrackingPayload, nowMs?: number): Promise<SourceProduceResult>;
|
|
226
|
+
onDestinationConsumed(payload: TrackingPayload, nowMs?: number): Promise<boolean>;
|
|
227
|
+
onDestinationConsumedDetailed(payload: TrackingPayload, nowMs?: number): Promise<DestinationConsumeResult>;
|
|
228
|
+
sweepTimeouts(nowMs?: number, batchSize?: number): Promise<number>;
|
|
229
|
+
sweepTimeoutEntries(nowMs?: number, batchSize?: number): Promise<CorrelationEntry[]>;
|
|
230
|
+
getStats(): Promise<CorrelationRuntimeStats>;
|
|
231
|
+
private resolveGatherKey;
|
|
232
|
+
isTimeoutCountedAsFailure(): boolean;
|
|
233
|
+
}
|
|
234
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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, LoadStrikeWebhookSinkOptions, LoadStrikeWorkerPluginSpec, LoadStrikeRunRequest, LoadStrikeRunResponse, LoadStrikeNodeStatsDto, LoadStrikeNodeInfoDto, LoadStrikeTestInfoDto, LoadStrikeScenarioStatsDto, LoadStrikeStepStatsDto, LoadStrikeMeasurementStatsDto, LoadStrikeRequestStatsDto, LoadStrikeLatencyStatsDto, LoadStrikeDataTransferStatsDto, LoadStrikeStatusCodeStatsDto, LoadStrikeMetricStatsDto, LoadStrikeCounterStatsDto, LoadStrikeGaugeStatsDto, LoadStrikeThresholdResultDto, LoadStrikePluginDataDto, LoadStrikePluginDataTableDto, LoadStrikePayloadDto, LoadStrikeProducedMessageRequestDto, LoadStrikeProducedMessageResultDto, LoadStrikeConsumedMessageDto, LoadStrikeWebhookEnvelope, LoadStrikePluginCallbackResponse } from "./contracts.js";
|
|
2
|
+
export { DEFAULT_LICENSING_API_BASE_URL, LoadStrikeLocalClient } from "./local.js";
|
|
3
|
+
export type { LicenseValidationSession, LoadStrikeLocalClientOptions } from "./local.js";
|
|
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";
|
|
6
|
+
export { CorrelationStoreConfiguration, CrossPlatformTrackingRuntime, InMemoryCorrelationStore, RedisCorrelationStoreOptions, RedisCorrelationStore, TrackingPayloadBuilder, TrackingFieldSelector } from "./correlation.js";
|
|
7
|
+
export type { CorrelationEntry, DestinationConsumeResult, GatheredRow, CorrelationStoreKind, CorrelationRuntimeOptions, CorrelationRuntimePlugin, CorrelationRuntimeStats, CorrelationStore, SourceProduceResult, TrackingFieldLocation, TrackingPayload } from "./correlation.js";
|
|
8
|
+
export { EndpointAdapterFactory, TrafficEndpointDefinition, HttpEndpointDefinition, KafkaEndpointDefinition, KafkaSaslOptions, RabbitMqEndpointDefinition, NatsEndpointDefinition, RedisStreamsEndpointDefinition, AzureEventHubsEndpointDefinition, DelegateStreamEndpointDefinition, PushDiffusionEndpointDefinition, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
|
|
9
|
+
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 { DistributedClusterAgent, DistributedClusterCoordinator, LocalClusterCoordinator, planAgentScenarioAssignments } from "./cluster.js";
|
|
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";
|
|
13
|
+
export type { DatadogSinkOptions, GrafanaLokiSinkOptions, InfluxDbSinkOptions, OtelCollectorSinkOptions, SplunkSinkOptions, TimescaleDbSinkOptions } from "./sinks.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { LoadStrikeRunRequest, LoadStrikeRunResponse } from "./contracts.js";
|
|
2
|
+
export interface LoadStrikeLocalClientOptions {
|
|
3
|
+
licensingApiBaseUrl?: string;
|
|
4
|
+
licenseValidationTimeoutMs?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface LicenseValidationSession {
|
|
7
|
+
runToken?: string;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
deviceHash?: string;
|
|
10
|
+
machineName?: string;
|
|
11
|
+
environmentClassification?: number;
|
|
12
|
+
heartbeatTimer?: ReturnType<typeof setInterval>;
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_LICENSING_API_BASE_URL = "https://licensing.loadstrike.com";
|
|
15
|
+
export declare class LoadStrikeLocalClient {
|
|
16
|
+
private readonly licensingApiBaseUrl;
|
|
17
|
+
private readonly licenseValidationTimeoutMs;
|
|
18
|
+
private readonly signingKeyCache;
|
|
19
|
+
constructor(options?: LoadStrikeLocalClientOptions);
|
|
20
|
+
run(request: LoadStrikeRunRequest): Promise<LoadStrikeRunResponse>;
|
|
21
|
+
acquireLicenseLease(request: LoadStrikeRunRequest): Promise<LicenseValidationSession>;
|
|
22
|
+
releaseLicenseLease(session: LicenseValidationSession, request: LoadStrikeRunRequest): Promise<void>;
|
|
23
|
+
private validateLicenseIfRequired;
|
|
24
|
+
private verifySignedRunToken;
|
|
25
|
+
private getSigningKey;
|
|
26
|
+
private sendRunTokenHeartbeat;
|
|
27
|
+
private stopLicenseLeaseIfRequired;
|
|
28
|
+
private postLicensingRequest;
|
|
29
|
+
private getLicensingRequest;
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type ReportRecord = Record<string, any>;
|
|
2
|
+
export declare function buildDotnetTxtReport(nodeStats: ReportRecord): string;
|
|
3
|
+
export declare function buildDotnetCsvReport(nodeStats: ReportRecord): string;
|
|
4
|
+
export declare function buildDotnetMarkdownReport(nodeStats: ReportRecord): string;
|
|
5
|
+
export declare function buildDotnetHtmlReport(nodeStats: ReportRecord): string;
|
|
6
|
+
export {};
|