@smplkit/sdk 3.0.14 → 3.0.17
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/index.cjs +300 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +168 -3
- package/dist/index.d.ts +168 -3
- package/dist/index.js +300 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -18,6 +18,7 @@ interface AuditEvent {
|
|
|
18
18
|
snapshot: Record<string, unknown> | null;
|
|
19
19
|
data: Record<string, unknown>;
|
|
20
20
|
idempotencyKey: string;
|
|
21
|
+
doNotForward: boolean;
|
|
21
22
|
}
|
|
22
23
|
interface CreateEventInput {
|
|
23
24
|
action: string;
|
|
@@ -29,6 +30,13 @@ interface CreateEventInput {
|
|
|
29
30
|
data?: Record<string, unknown>;
|
|
30
31
|
/** Optional caller-supplied idempotency key. Server derives one from event content if absent. */
|
|
31
32
|
idempotencyKey?: string;
|
|
33
|
+
/**
|
|
34
|
+
* When true, the audit service records the event normally but does NOT POST
|
|
35
|
+
* it through any configured SIEM forwarder. A `skipped_do_not_forward`
|
|
36
|
+
* delivery row is recorded for each enabled forwarder so the skip is
|
|
37
|
+
* visible in the forwarder delivery log.
|
|
38
|
+
*/
|
|
39
|
+
doNotForward?: boolean;
|
|
32
40
|
}
|
|
33
41
|
interface ListEventsParams {
|
|
34
42
|
action?: string;
|
|
@@ -46,6 +54,105 @@ interface ListEventsPage {
|
|
|
46
54
|
/** Opaque cursor for the next page, or null if this is the last page. */
|
|
47
55
|
nextCursor: string | null;
|
|
48
56
|
}
|
|
57
|
+
interface HttpHeader {
|
|
58
|
+
name: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}
|
|
61
|
+
interface ForwarderHttp {
|
|
62
|
+
method: string;
|
|
63
|
+
url: string;
|
|
64
|
+
headers: HttpHeader[];
|
|
65
|
+
body: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* 3-character string: an exact HTTP code (e.g. `"200"`, `"204"`) or a
|
|
68
|
+
* class (`"2xx"`, `"3xx"`, `"4xx"`, `"5xx"`).
|
|
69
|
+
*/
|
|
70
|
+
successStatus: string;
|
|
71
|
+
}
|
|
72
|
+
interface Forwarder {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
slug: string;
|
|
76
|
+
forwarderType: string;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
filter: Record<string, unknown> | null;
|
|
79
|
+
transform: string | null;
|
|
80
|
+
/** Header values are returned redacted on reads. */
|
|
81
|
+
http: ForwarderHttp;
|
|
82
|
+
data: Record<string, unknown>;
|
|
83
|
+
createdAt: string | null;
|
|
84
|
+
updatedAt: string | null;
|
|
85
|
+
deletedAt: string | null;
|
|
86
|
+
version: number | null;
|
|
87
|
+
}
|
|
88
|
+
interface CreateForwarderInput {
|
|
89
|
+
name: string;
|
|
90
|
+
forwarderType: string;
|
|
91
|
+
http: ForwarderHttp;
|
|
92
|
+
enabled?: boolean;
|
|
93
|
+
filter?: Record<string, unknown>;
|
|
94
|
+
transform?: string;
|
|
95
|
+
data?: Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
interface UpdateForwarderInput extends CreateForwarderInput {
|
|
98
|
+
}
|
|
99
|
+
interface ListForwardersParams {
|
|
100
|
+
forwarderType?: string;
|
|
101
|
+
enabled?: boolean;
|
|
102
|
+
pageSize?: number;
|
|
103
|
+
pageAfter?: string;
|
|
104
|
+
}
|
|
105
|
+
interface ListForwardersPage {
|
|
106
|
+
forwarders: Forwarder[];
|
|
107
|
+
nextCursor: string | null;
|
|
108
|
+
}
|
|
109
|
+
type ForwarderDeliveryStatus = "succeeded" | "failed" | "filtered_out" | "skipped_do_not_forward";
|
|
110
|
+
interface ForwarderDelivery {
|
|
111
|
+
id: string;
|
|
112
|
+
forwarderId: string;
|
|
113
|
+
eventId: string;
|
|
114
|
+
attemptNumber: number;
|
|
115
|
+
status: ForwarderDeliveryStatus;
|
|
116
|
+
request: Record<string, unknown> | null;
|
|
117
|
+
responseStatus: number | null;
|
|
118
|
+
responseBody: string | null;
|
|
119
|
+
latencyMs: number | null;
|
|
120
|
+
error: string | null;
|
|
121
|
+
createdAt: string | null;
|
|
122
|
+
}
|
|
123
|
+
interface ListDeliveriesParams {
|
|
124
|
+
status?: ForwarderDeliveryStatus;
|
|
125
|
+
/** Range notation per ADR-014, e.g. `[2026-01-01T00:00:00Z,*)`. */
|
|
126
|
+
createdAtRange?: string;
|
|
127
|
+
pageSize?: number;
|
|
128
|
+
pageAfter?: string;
|
|
129
|
+
}
|
|
130
|
+
interface ListDeliveriesPage {
|
|
131
|
+
deliveries: ForwarderDelivery[];
|
|
132
|
+
nextCursor: string | null;
|
|
133
|
+
}
|
|
134
|
+
interface RetryFailedDeliveriesSummary {
|
|
135
|
+
attempted: number;
|
|
136
|
+
succeeded: number;
|
|
137
|
+
failed: number;
|
|
138
|
+
}
|
|
139
|
+
interface TestForwarderRequest {
|
|
140
|
+
url: string;
|
|
141
|
+
method?: string;
|
|
142
|
+
headers?: HttpHeader[];
|
|
143
|
+
body?: string | null;
|
|
144
|
+
successStatus?: string;
|
|
145
|
+
/** Capped at 30s server-side. */
|
|
146
|
+
timeoutMs?: number;
|
|
147
|
+
}
|
|
148
|
+
interface TestForwarderResult {
|
|
149
|
+
succeeded: boolean;
|
|
150
|
+
responseStatus: number | null;
|
|
151
|
+
responseHeaders: Record<string, string>;
|
|
152
|
+
responseBody: string;
|
|
153
|
+
latencyMs: number | null;
|
|
154
|
+
error: string | null;
|
|
155
|
+
}
|
|
49
156
|
|
|
50
157
|
/**
|
|
51
158
|
* Audit namespace — `client.audit.events.{record,list,get}`.
|
|
@@ -71,6 +178,7 @@ declare class EventsClient {
|
|
|
71
178
|
baseUrl: string;
|
|
72
179
|
timeoutMs?: number;
|
|
73
180
|
fetch?: typeof fetch;
|
|
181
|
+
extraHeaders?: Record<string, string>;
|
|
74
182
|
});
|
|
75
183
|
/**
|
|
76
184
|
* Enqueue an audit event for asynchronous delivery.
|
|
@@ -88,13 +196,62 @@ declare class EventsClient {
|
|
|
88
196
|
/** @internal */
|
|
89
197
|
_close(): Promise<void>;
|
|
90
198
|
}
|
|
199
|
+
declare class DeliveryActionsClient {
|
|
200
|
+
private readonly _http;
|
|
201
|
+
constructor(_http: AuditHttp);
|
|
202
|
+
/** Retry a single failed delivery. Records a new attempt row with
|
|
203
|
+
* attempt_number = prior + 1; the prior row is unchanged. */
|
|
204
|
+
retry(forwarderId: string, deliveryId: string): Promise<ForwarderDelivery>;
|
|
205
|
+
}
|
|
206
|
+
declare class DeliveriesClient {
|
|
207
|
+
private readonly _http;
|
|
208
|
+
readonly actions: DeliveryActionsClient;
|
|
209
|
+
constructor(_http: AuditHttp);
|
|
210
|
+
list(forwarderId: string, params?: ListDeliveriesParams): Promise<ListDeliveriesPage>;
|
|
211
|
+
}
|
|
212
|
+
declare class ForwarderActionsClient {
|
|
213
|
+
private readonly _http;
|
|
214
|
+
constructor(_http: AuditHttp);
|
|
215
|
+
/** Retry every failed delivery for a forwarder. Returns a count summary. */
|
|
216
|
+
retryFailedDeliveries(forwarderId: string): Promise<RetryFailedDeliveriesSummary>;
|
|
217
|
+
}
|
|
218
|
+
declare class ForwardersClient {
|
|
219
|
+
private readonly _http;
|
|
220
|
+
readonly deliveries: DeliveriesClient;
|
|
221
|
+
readonly actions: ForwarderActionsClient;
|
|
222
|
+
constructor(_http: AuditHttp);
|
|
223
|
+
create(input: CreateForwarderInput): Promise<Forwarder>;
|
|
224
|
+
list(params?: ListForwardersParams): Promise<ListForwardersPage>;
|
|
225
|
+
get(forwarderId: string): Promise<Forwarder>;
|
|
226
|
+
update(forwarderId: string, input: UpdateForwarderInput): Promise<Forwarder>;
|
|
227
|
+
delete(forwarderId: string): Promise<void>;
|
|
228
|
+
}
|
|
229
|
+
declare class TestForwarderActionsClient {
|
|
230
|
+
private readonly _http;
|
|
231
|
+
constructor(_http: AuditHttp);
|
|
232
|
+
/** Server-side proxy to a customer-supplied URL. SSRF-guarded; the
|
|
233
|
+
* audit service rejects private/loopback/link-local addresses (incl.
|
|
234
|
+
* the EC2 IMDS at 169.254.169.254) and ports outside the allowlist. */
|
|
235
|
+
execute(input: TestForwarderRequest): Promise<TestForwarderResult>;
|
|
236
|
+
}
|
|
237
|
+
declare class TestForwarderClient {
|
|
238
|
+
readonly actions: TestForwarderActionsClient;
|
|
239
|
+
constructor(http: AuditHttp);
|
|
240
|
+
}
|
|
241
|
+
declare class FunctionsClient {
|
|
242
|
+
readonly test_forwarder: TestForwarderClient;
|
|
243
|
+
constructor(http: AuditHttp);
|
|
244
|
+
}
|
|
91
245
|
declare class AuditClient {
|
|
92
246
|
readonly events: EventsClient;
|
|
247
|
+
readonly forwarders: ForwardersClient;
|
|
248
|
+
readonly functions: FunctionsClient;
|
|
93
249
|
constructor(opts: {
|
|
94
250
|
apiKey: string;
|
|
95
251
|
baseUrl: string;
|
|
96
252
|
timeoutMs?: number;
|
|
97
253
|
fetch?: typeof fetch;
|
|
254
|
+
extraHeaders?: Record<string, string>;
|
|
98
255
|
});
|
|
99
256
|
/** @internal */
|
|
100
257
|
_close(): Promise<void>;
|
|
@@ -1623,7 +1780,7 @@ declare class FlagsClient {
|
|
|
1623
1780
|
readonly _metrics: MetricsReporter | null;
|
|
1624
1781
|
} | null;
|
|
1625
1782
|
/** @internal */
|
|
1626
|
-
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, flagsBaseUrl?: string, appBaseUrl?: string, contextBuffer?: ContextRegistrationBuffer);
|
|
1783
|
+
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, flagsBaseUrl?: string, appBaseUrl?: string, contextBuffer?: ContextRegistrationBuffer, extraHeaders?: Record<string, string>);
|
|
1627
1784
|
/** Declare a boolean flag handle for runtime evaluation. */
|
|
1628
1785
|
booleanFlag(id: string, defaultValue: boolean): BooleanFlag;
|
|
1629
1786
|
/** Declare a string flag handle for runtime evaluation. */
|
|
@@ -2532,7 +2689,7 @@ declare class ConfigClient {
|
|
|
2532
2689
|
private _initialized;
|
|
2533
2690
|
private _listeners;
|
|
2534
2691
|
/** @internal */
|
|
2535
|
-
constructor(apiKey: string, timeout?: number, baseUrl?: string);
|
|
2692
|
+
constructor(apiKey: string, timeout?: number, baseUrl?: string, extraHeaders?: Record<string, string>);
|
|
2536
2693
|
/**
|
|
2537
2694
|
* Return a live, dict-like view of the resolved values for *id*.
|
|
2538
2695
|
*
|
|
@@ -2656,7 +2813,7 @@ declare class LoggingClient {
|
|
|
2656
2813
|
private _loggerStore;
|
|
2657
2814
|
private _groupStore;
|
|
2658
2815
|
/** @internal */
|
|
2659
|
-
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, baseUrl?: string);
|
|
2816
|
+
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, baseUrl?: string, extraHeaders?: Record<string, string>);
|
|
2660
2817
|
/**
|
|
2661
2818
|
* Register a logging framework adapter.
|
|
2662
2819
|
*
|
|
@@ -2818,6 +2975,14 @@ interface SmplClientOptions {
|
|
|
2818
2975
|
* falling back to `false`.
|
|
2819
2976
|
*/
|
|
2820
2977
|
debug?: boolean;
|
|
2978
|
+
/**
|
|
2979
|
+
* Additional HTTP headers to include on every request made by this client
|
|
2980
|
+
* and all sub-clients (audit, config, flags, logging).
|
|
2981
|
+
*
|
|
2982
|
+
* SDK-owned headers (`Authorization`, `Accept`) take precedence over any
|
|
2983
|
+
* key supplied here — callers cannot override them.
|
|
2984
|
+
*/
|
|
2985
|
+
extraHeaders?: Record<string, string>;
|
|
2821
2986
|
}
|
|
2822
2987
|
/**
|
|
2823
2988
|
* Entry point for the smplkit TypeScript SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ interface AuditEvent {
|
|
|
18
18
|
snapshot: Record<string, unknown> | null;
|
|
19
19
|
data: Record<string, unknown>;
|
|
20
20
|
idempotencyKey: string;
|
|
21
|
+
doNotForward: boolean;
|
|
21
22
|
}
|
|
22
23
|
interface CreateEventInput {
|
|
23
24
|
action: string;
|
|
@@ -29,6 +30,13 @@ interface CreateEventInput {
|
|
|
29
30
|
data?: Record<string, unknown>;
|
|
30
31
|
/** Optional caller-supplied idempotency key. Server derives one from event content if absent. */
|
|
31
32
|
idempotencyKey?: string;
|
|
33
|
+
/**
|
|
34
|
+
* When true, the audit service records the event normally but does NOT POST
|
|
35
|
+
* it through any configured SIEM forwarder. A `skipped_do_not_forward`
|
|
36
|
+
* delivery row is recorded for each enabled forwarder so the skip is
|
|
37
|
+
* visible in the forwarder delivery log.
|
|
38
|
+
*/
|
|
39
|
+
doNotForward?: boolean;
|
|
32
40
|
}
|
|
33
41
|
interface ListEventsParams {
|
|
34
42
|
action?: string;
|
|
@@ -46,6 +54,105 @@ interface ListEventsPage {
|
|
|
46
54
|
/** Opaque cursor for the next page, or null if this is the last page. */
|
|
47
55
|
nextCursor: string | null;
|
|
48
56
|
}
|
|
57
|
+
interface HttpHeader {
|
|
58
|
+
name: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}
|
|
61
|
+
interface ForwarderHttp {
|
|
62
|
+
method: string;
|
|
63
|
+
url: string;
|
|
64
|
+
headers: HttpHeader[];
|
|
65
|
+
body: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* 3-character string: an exact HTTP code (e.g. `"200"`, `"204"`) or a
|
|
68
|
+
* class (`"2xx"`, `"3xx"`, `"4xx"`, `"5xx"`).
|
|
69
|
+
*/
|
|
70
|
+
successStatus: string;
|
|
71
|
+
}
|
|
72
|
+
interface Forwarder {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
slug: string;
|
|
76
|
+
forwarderType: string;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
filter: Record<string, unknown> | null;
|
|
79
|
+
transform: string | null;
|
|
80
|
+
/** Header values are returned redacted on reads. */
|
|
81
|
+
http: ForwarderHttp;
|
|
82
|
+
data: Record<string, unknown>;
|
|
83
|
+
createdAt: string | null;
|
|
84
|
+
updatedAt: string | null;
|
|
85
|
+
deletedAt: string | null;
|
|
86
|
+
version: number | null;
|
|
87
|
+
}
|
|
88
|
+
interface CreateForwarderInput {
|
|
89
|
+
name: string;
|
|
90
|
+
forwarderType: string;
|
|
91
|
+
http: ForwarderHttp;
|
|
92
|
+
enabled?: boolean;
|
|
93
|
+
filter?: Record<string, unknown>;
|
|
94
|
+
transform?: string;
|
|
95
|
+
data?: Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
interface UpdateForwarderInput extends CreateForwarderInput {
|
|
98
|
+
}
|
|
99
|
+
interface ListForwardersParams {
|
|
100
|
+
forwarderType?: string;
|
|
101
|
+
enabled?: boolean;
|
|
102
|
+
pageSize?: number;
|
|
103
|
+
pageAfter?: string;
|
|
104
|
+
}
|
|
105
|
+
interface ListForwardersPage {
|
|
106
|
+
forwarders: Forwarder[];
|
|
107
|
+
nextCursor: string | null;
|
|
108
|
+
}
|
|
109
|
+
type ForwarderDeliveryStatus = "succeeded" | "failed" | "filtered_out" | "skipped_do_not_forward";
|
|
110
|
+
interface ForwarderDelivery {
|
|
111
|
+
id: string;
|
|
112
|
+
forwarderId: string;
|
|
113
|
+
eventId: string;
|
|
114
|
+
attemptNumber: number;
|
|
115
|
+
status: ForwarderDeliveryStatus;
|
|
116
|
+
request: Record<string, unknown> | null;
|
|
117
|
+
responseStatus: number | null;
|
|
118
|
+
responseBody: string | null;
|
|
119
|
+
latencyMs: number | null;
|
|
120
|
+
error: string | null;
|
|
121
|
+
createdAt: string | null;
|
|
122
|
+
}
|
|
123
|
+
interface ListDeliveriesParams {
|
|
124
|
+
status?: ForwarderDeliveryStatus;
|
|
125
|
+
/** Range notation per ADR-014, e.g. `[2026-01-01T00:00:00Z,*)`. */
|
|
126
|
+
createdAtRange?: string;
|
|
127
|
+
pageSize?: number;
|
|
128
|
+
pageAfter?: string;
|
|
129
|
+
}
|
|
130
|
+
interface ListDeliveriesPage {
|
|
131
|
+
deliveries: ForwarderDelivery[];
|
|
132
|
+
nextCursor: string | null;
|
|
133
|
+
}
|
|
134
|
+
interface RetryFailedDeliveriesSummary {
|
|
135
|
+
attempted: number;
|
|
136
|
+
succeeded: number;
|
|
137
|
+
failed: number;
|
|
138
|
+
}
|
|
139
|
+
interface TestForwarderRequest {
|
|
140
|
+
url: string;
|
|
141
|
+
method?: string;
|
|
142
|
+
headers?: HttpHeader[];
|
|
143
|
+
body?: string | null;
|
|
144
|
+
successStatus?: string;
|
|
145
|
+
/** Capped at 30s server-side. */
|
|
146
|
+
timeoutMs?: number;
|
|
147
|
+
}
|
|
148
|
+
interface TestForwarderResult {
|
|
149
|
+
succeeded: boolean;
|
|
150
|
+
responseStatus: number | null;
|
|
151
|
+
responseHeaders: Record<string, string>;
|
|
152
|
+
responseBody: string;
|
|
153
|
+
latencyMs: number | null;
|
|
154
|
+
error: string | null;
|
|
155
|
+
}
|
|
49
156
|
|
|
50
157
|
/**
|
|
51
158
|
* Audit namespace — `client.audit.events.{record,list,get}`.
|
|
@@ -71,6 +178,7 @@ declare class EventsClient {
|
|
|
71
178
|
baseUrl: string;
|
|
72
179
|
timeoutMs?: number;
|
|
73
180
|
fetch?: typeof fetch;
|
|
181
|
+
extraHeaders?: Record<string, string>;
|
|
74
182
|
});
|
|
75
183
|
/**
|
|
76
184
|
* Enqueue an audit event for asynchronous delivery.
|
|
@@ -88,13 +196,62 @@ declare class EventsClient {
|
|
|
88
196
|
/** @internal */
|
|
89
197
|
_close(): Promise<void>;
|
|
90
198
|
}
|
|
199
|
+
declare class DeliveryActionsClient {
|
|
200
|
+
private readonly _http;
|
|
201
|
+
constructor(_http: AuditHttp);
|
|
202
|
+
/** Retry a single failed delivery. Records a new attempt row with
|
|
203
|
+
* attempt_number = prior + 1; the prior row is unchanged. */
|
|
204
|
+
retry(forwarderId: string, deliveryId: string): Promise<ForwarderDelivery>;
|
|
205
|
+
}
|
|
206
|
+
declare class DeliveriesClient {
|
|
207
|
+
private readonly _http;
|
|
208
|
+
readonly actions: DeliveryActionsClient;
|
|
209
|
+
constructor(_http: AuditHttp);
|
|
210
|
+
list(forwarderId: string, params?: ListDeliveriesParams): Promise<ListDeliveriesPage>;
|
|
211
|
+
}
|
|
212
|
+
declare class ForwarderActionsClient {
|
|
213
|
+
private readonly _http;
|
|
214
|
+
constructor(_http: AuditHttp);
|
|
215
|
+
/** Retry every failed delivery for a forwarder. Returns a count summary. */
|
|
216
|
+
retryFailedDeliveries(forwarderId: string): Promise<RetryFailedDeliveriesSummary>;
|
|
217
|
+
}
|
|
218
|
+
declare class ForwardersClient {
|
|
219
|
+
private readonly _http;
|
|
220
|
+
readonly deliveries: DeliveriesClient;
|
|
221
|
+
readonly actions: ForwarderActionsClient;
|
|
222
|
+
constructor(_http: AuditHttp);
|
|
223
|
+
create(input: CreateForwarderInput): Promise<Forwarder>;
|
|
224
|
+
list(params?: ListForwardersParams): Promise<ListForwardersPage>;
|
|
225
|
+
get(forwarderId: string): Promise<Forwarder>;
|
|
226
|
+
update(forwarderId: string, input: UpdateForwarderInput): Promise<Forwarder>;
|
|
227
|
+
delete(forwarderId: string): Promise<void>;
|
|
228
|
+
}
|
|
229
|
+
declare class TestForwarderActionsClient {
|
|
230
|
+
private readonly _http;
|
|
231
|
+
constructor(_http: AuditHttp);
|
|
232
|
+
/** Server-side proxy to a customer-supplied URL. SSRF-guarded; the
|
|
233
|
+
* audit service rejects private/loopback/link-local addresses (incl.
|
|
234
|
+
* the EC2 IMDS at 169.254.169.254) and ports outside the allowlist. */
|
|
235
|
+
execute(input: TestForwarderRequest): Promise<TestForwarderResult>;
|
|
236
|
+
}
|
|
237
|
+
declare class TestForwarderClient {
|
|
238
|
+
readonly actions: TestForwarderActionsClient;
|
|
239
|
+
constructor(http: AuditHttp);
|
|
240
|
+
}
|
|
241
|
+
declare class FunctionsClient {
|
|
242
|
+
readonly test_forwarder: TestForwarderClient;
|
|
243
|
+
constructor(http: AuditHttp);
|
|
244
|
+
}
|
|
91
245
|
declare class AuditClient {
|
|
92
246
|
readonly events: EventsClient;
|
|
247
|
+
readonly forwarders: ForwardersClient;
|
|
248
|
+
readonly functions: FunctionsClient;
|
|
93
249
|
constructor(opts: {
|
|
94
250
|
apiKey: string;
|
|
95
251
|
baseUrl: string;
|
|
96
252
|
timeoutMs?: number;
|
|
97
253
|
fetch?: typeof fetch;
|
|
254
|
+
extraHeaders?: Record<string, string>;
|
|
98
255
|
});
|
|
99
256
|
/** @internal */
|
|
100
257
|
_close(): Promise<void>;
|
|
@@ -1623,7 +1780,7 @@ declare class FlagsClient {
|
|
|
1623
1780
|
readonly _metrics: MetricsReporter | null;
|
|
1624
1781
|
} | null;
|
|
1625
1782
|
/** @internal */
|
|
1626
|
-
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, flagsBaseUrl?: string, appBaseUrl?: string, contextBuffer?: ContextRegistrationBuffer);
|
|
1783
|
+
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, flagsBaseUrl?: string, appBaseUrl?: string, contextBuffer?: ContextRegistrationBuffer, extraHeaders?: Record<string, string>);
|
|
1627
1784
|
/** Declare a boolean flag handle for runtime evaluation. */
|
|
1628
1785
|
booleanFlag(id: string, defaultValue: boolean): BooleanFlag;
|
|
1629
1786
|
/** Declare a string flag handle for runtime evaluation. */
|
|
@@ -2532,7 +2689,7 @@ declare class ConfigClient {
|
|
|
2532
2689
|
private _initialized;
|
|
2533
2690
|
private _listeners;
|
|
2534
2691
|
/** @internal */
|
|
2535
|
-
constructor(apiKey: string, timeout?: number, baseUrl?: string);
|
|
2692
|
+
constructor(apiKey: string, timeout?: number, baseUrl?: string, extraHeaders?: Record<string, string>);
|
|
2536
2693
|
/**
|
|
2537
2694
|
* Return a live, dict-like view of the resolved values for *id*.
|
|
2538
2695
|
*
|
|
@@ -2656,7 +2813,7 @@ declare class LoggingClient {
|
|
|
2656
2813
|
private _loggerStore;
|
|
2657
2814
|
private _groupStore;
|
|
2658
2815
|
/** @internal */
|
|
2659
|
-
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, baseUrl?: string);
|
|
2816
|
+
constructor(apiKey: string, ensureWs: () => SharedWebSocket, timeout?: number, baseUrl?: string, extraHeaders?: Record<string, string>);
|
|
2660
2817
|
/**
|
|
2661
2818
|
* Register a logging framework adapter.
|
|
2662
2819
|
*
|
|
@@ -2818,6 +2975,14 @@ interface SmplClientOptions {
|
|
|
2818
2975
|
* falling back to `false`.
|
|
2819
2976
|
*/
|
|
2820
2977
|
debug?: boolean;
|
|
2978
|
+
/**
|
|
2979
|
+
* Additional HTTP headers to include on every request made by this client
|
|
2980
|
+
* and all sub-clients (audit, config, flags, logging).
|
|
2981
|
+
*
|
|
2982
|
+
* SDK-owned headers (`Authorization`, `Accept`) take precedence over any
|
|
2983
|
+
* key supplied here — callers cannot override them.
|
|
2984
|
+
*/
|
|
2985
|
+
extraHeaders?: Record<string, string>;
|
|
2821
2986
|
}
|
|
2822
2987
|
/**
|
|
2823
2988
|
* Entry point for the smplkit TypeScript SDK.
|