@smplkit/sdk 1.3.22 → 1.3.23
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 +18 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -50
- package/dist/index.d.ts +33 -50
- package/dist/index.js +18 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -53,7 +53,7 @@ declare class SharedWebSocket {
|
|
|
53
53
|
* A configuration resource managed by the smplkit platform.
|
|
54
54
|
*
|
|
55
55
|
* Management: mutate properties directly and call `save()` to persist.
|
|
56
|
-
*
|
|
56
|
+
* Creates if new, updates if existing.
|
|
57
57
|
*/
|
|
58
58
|
declare class Config {
|
|
59
59
|
/** UUID of the config, or `null` if unsaved. */
|
|
@@ -70,8 +70,7 @@ declare class Config {
|
|
|
70
70
|
items: Record<string, unknown>;
|
|
71
71
|
/**
|
|
72
72
|
* Per-environment overrides.
|
|
73
|
-
*
|
|
74
|
-
* unwrapped from the server's `{ value: raw }` wrapper.
|
|
73
|
+
* Structured as `{ env_name: { values: { key: value } } }`.
|
|
75
74
|
*/
|
|
76
75
|
environments: Record<string, unknown>;
|
|
77
76
|
/** When the config was created, or null if unavailable. */
|
|
@@ -95,7 +94,7 @@ declare class Config {
|
|
|
95
94
|
/**
|
|
96
95
|
* Persist this config to the server.
|
|
97
96
|
*
|
|
98
|
-
*
|
|
97
|
+
* Creates if new, updates if existing.
|
|
99
98
|
* Updates this instance in-place with the server response.
|
|
100
99
|
*/
|
|
101
100
|
save(): Promise<void>;
|
|
@@ -118,17 +117,17 @@ declare class Config {
|
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
/**
|
|
121
|
-
* LiveConfigProxy —
|
|
120
|
+
* LiveConfigProxy — live configuration access.
|
|
122
121
|
*
|
|
123
|
-
* Property reads
|
|
124
|
-
*
|
|
125
|
-
*
|
|
122
|
+
* Property reads always return the latest resolved values. When the
|
|
123
|
+
* underlying config changes, subsequent reads automatically reflect
|
|
124
|
+
* the new values.
|
|
126
125
|
*/
|
|
127
126
|
|
|
128
127
|
/**
|
|
129
128
|
* A live proxy that auto-updates when the underlying config changes.
|
|
130
129
|
*
|
|
131
|
-
* Access properties directly — each read
|
|
130
|
+
* Access properties directly — each read returns the latest resolved value.
|
|
132
131
|
*
|
|
133
132
|
* @example
|
|
134
133
|
* ```typescript
|
|
@@ -208,8 +207,8 @@ declare class ConfigClient {
|
|
|
208
207
|
/**
|
|
209
208
|
* Resolve a config's values for the current environment.
|
|
210
209
|
*
|
|
211
|
-
* Returns a flat dict of resolved key-value pairs
|
|
212
|
-
*
|
|
210
|
+
* Returns a flat dict of resolved key-value pairs with inherited
|
|
211
|
+
* values and environment overrides applied.
|
|
213
212
|
*
|
|
214
213
|
* Optionally pass a model class to map the resolved values.
|
|
215
214
|
*/
|
|
@@ -230,7 +229,7 @@ declare class ConfigClient {
|
|
|
230
229
|
*/
|
|
231
230
|
onChange(callbackOrConfigKey: string | ((event: ConfigChangeEvent) => void), callbackOrItemKey?: string | ((event: ConfigChangeEvent) => void), callback?: (event: ConfigChangeEvent) => void): void;
|
|
232
231
|
/**
|
|
233
|
-
* Re-fetch all configs
|
|
232
|
+
* Re-fetch all configs and re-resolve values.
|
|
234
233
|
* Fires change listeners for any values that differ.
|
|
235
234
|
*/
|
|
236
235
|
refresh(): Promise<void>;
|
|
@@ -529,8 +528,8 @@ declare class Rule {
|
|
|
529
528
|
/**
|
|
530
529
|
* A flag resource that doubles as a runtime handle.
|
|
531
530
|
*
|
|
532
|
-
* Management: call `save()` to persist (
|
|
533
|
-
* Runtime: call `get()`
|
|
531
|
+
* Management: call `save()` to persist (creates if new, updates if existing).
|
|
532
|
+
* Runtime: call `get()` to evaluate the flag locally.
|
|
534
533
|
*/
|
|
535
534
|
declare class Flag {
|
|
536
535
|
/** UUID of the flag, or `null` if unsaved. */
|
|
@@ -577,7 +576,7 @@ declare class Flag {
|
|
|
577
576
|
/**
|
|
578
577
|
* Persist this flag to the server.
|
|
579
578
|
*
|
|
580
|
-
*
|
|
579
|
+
* Creates if new, updates if existing.
|
|
581
580
|
* Updates this instance in-place with the server response.
|
|
582
581
|
*/
|
|
583
582
|
save(): Promise<void>;
|
|
@@ -597,7 +596,7 @@ declare class Flag {
|
|
|
597
596
|
/** Clear all rules for a specific environment (sync local mutation). */
|
|
598
597
|
clearRules(envKey: string): void;
|
|
599
598
|
/**
|
|
600
|
-
* Evaluate the flag locally
|
|
599
|
+
* Evaluate the flag locally.
|
|
601
600
|
*
|
|
602
601
|
* Requires `initialize()` to have been called.
|
|
603
602
|
*/
|
|
@@ -635,10 +634,6 @@ declare class JsonFlag extends Flag {
|
|
|
635
634
|
|
|
636
635
|
/**
|
|
637
636
|
* FlagsClient — management + prescriptive runtime for Smpl Flags.
|
|
638
|
-
*
|
|
639
|
-
* Uses the generated OpenAPI types (`src/generated/flags.d.ts`) via
|
|
640
|
-
* `openapi-fetch` for all flag HTTP calls. Context registration uses
|
|
641
|
-
* the generated app service types (`src/generated/app.d.ts`).
|
|
642
637
|
*/
|
|
643
638
|
|
|
644
639
|
type FlagResource = components["schemas"]["FlagResource"];
|
|
@@ -773,16 +768,18 @@ declare class FlagsClient {
|
|
|
773
768
|
*/
|
|
774
769
|
onChange(callbackOrKey: string | ((event: FlagChangeEvent) => void), callback?: (event: FlagChangeEvent) => void): void;
|
|
775
770
|
/**
|
|
776
|
-
*
|
|
771
|
+
* Register context(s) with the server.
|
|
777
772
|
*
|
|
778
|
-
* Accepts a single Context or an array.
|
|
779
|
-
* blocks. Works before `initialize()` is called.
|
|
773
|
+
* Accepts a single Context or an array. Registration is asynchronous
|
|
774
|
+
* and never blocks. Works before `initialize()` is called.
|
|
780
775
|
*/
|
|
781
776
|
register(context: Context | Context[]): void;
|
|
782
777
|
/** Flush pending context registrations to the server. */
|
|
783
778
|
flushContexts(): Promise<void>;
|
|
784
779
|
/**
|
|
785
|
-
*
|
|
780
|
+
* Evaluate a flag with an explicit environment and context.
|
|
781
|
+
*
|
|
782
|
+
* Stateless — does not use the context provider or cached results.
|
|
786
783
|
*/
|
|
787
784
|
evaluate(key: string, options: {
|
|
788
785
|
environment: string;
|
|
@@ -877,7 +874,7 @@ declare class Logger {
|
|
|
877
874
|
/**
|
|
878
875
|
* Persist this logger to the server.
|
|
879
876
|
*
|
|
880
|
-
*
|
|
877
|
+
* Creates if new, updates if existing.
|
|
881
878
|
*/
|
|
882
879
|
save(): Promise<void>;
|
|
883
880
|
/** Set the base log level (sync local mutation). */
|
|
@@ -932,7 +929,7 @@ declare class LogGroup {
|
|
|
932
929
|
/**
|
|
933
930
|
* Persist this log group to the server.
|
|
934
931
|
*
|
|
935
|
-
*
|
|
932
|
+
* Creates if new, updates if existing.
|
|
936
933
|
*/
|
|
937
934
|
save(): Promise<void>;
|
|
938
935
|
/** Set the base log level (sync local mutation). */
|
|
@@ -953,11 +950,8 @@ declare class LogGroup {
|
|
|
953
950
|
/**
|
|
954
951
|
* Contract for pluggable logging framework integration.
|
|
955
952
|
*
|
|
956
|
-
* Adapters bridge the smplkit logging runtime to a specific logging
|
|
957
|
-
*
|
|
958
|
-
*
|
|
959
|
-
* Adapters are NOT responsible for: key normalization, caching, bulk registration,
|
|
960
|
-
* level resolution, or WebSocket handling. Those remain in the core client.
|
|
953
|
+
* Adapters bridge the smplkit logging runtime to a specific logging
|
|
954
|
+
* framework (e.g., Winston, Pino).
|
|
961
955
|
*/
|
|
962
956
|
interface LoggingAdapter {
|
|
963
957
|
/** Human-readable adapter name for diagnostics (e.g., 'winston'). */
|
|
@@ -988,9 +982,6 @@ interface LoggingAdapter {
|
|
|
988
982
|
|
|
989
983
|
/**
|
|
990
984
|
* LoggingClient — management plane + scaffolded runtime for Smpl Logging.
|
|
991
|
-
*
|
|
992
|
-
* Uses the generated OpenAPI types (`src/generated/logging.d.ts`) via
|
|
993
|
-
* `openapi-fetch` for all HTTP calls.
|
|
994
985
|
*/
|
|
995
986
|
|
|
996
987
|
/**
|
|
@@ -1055,14 +1046,9 @@ declare class LoggingClient {
|
|
|
1055
1046
|
/**
|
|
1056
1047
|
* Start the logging runtime.
|
|
1057
1048
|
*
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
* 3. Install hooks on each adapter for new logger creation
|
|
1062
|
-
* 4. Bulk-register discovered loggers with the server
|
|
1063
|
-
* 5. Fetch all loggers and groups from the server
|
|
1064
|
-
* 6. Resolve levels and apply to adapters
|
|
1065
|
-
* 7. Wire WebSocket for live updates
|
|
1049
|
+
* Discovers loggers from registered adapters, syncs them with the
|
|
1050
|
+
* server, applies server-side log levels, and subscribes to live
|
|
1051
|
+
* level updates.
|
|
1066
1052
|
*
|
|
1067
1053
|
* Idempotent — safe to call multiple times.
|
|
1068
1054
|
* Management methods work without start().
|
|
@@ -1169,10 +1155,9 @@ declare class SmplClient {
|
|
|
1169
1155
|
/**
|
|
1170
1156
|
* Winston logging framework adapter.
|
|
1171
1157
|
*
|
|
1172
|
-
*
|
|
1173
|
-
*
|
|
1174
|
-
*
|
|
1175
|
-
* levels by setting `logger.level` on the winston logger instance.
|
|
1158
|
+
* Integrates the smplkit logging runtime with Winston. Discovers
|
|
1159
|
+
* existing loggers, tracks new logger creation, and applies
|
|
1160
|
+
* server-managed log levels.
|
|
1176
1161
|
*/
|
|
1177
1162
|
|
|
1178
1163
|
interface WinstonAdapterConfig {
|
|
@@ -1199,10 +1184,8 @@ declare class WinstonAdapter implements LoggingAdapter {
|
|
|
1199
1184
|
/**
|
|
1200
1185
|
* Pino logging framework adapter.
|
|
1201
1186
|
*
|
|
1202
|
-
*
|
|
1203
|
-
*
|
|
1204
|
-
* `child()` method on created loggers. Logger instances are tracked via
|
|
1205
|
-
* WeakRef to avoid memory leaks.
|
|
1187
|
+
* Integrates the smplkit logging runtime with Pino. Tracks logger
|
|
1188
|
+
* instances (including child loggers) for discovery and level control.
|
|
1206
1189
|
*/
|
|
1207
1190
|
|
|
1208
1191
|
interface PinoAdapterConfig {
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ declare class SharedWebSocket {
|
|
|
53
53
|
* A configuration resource managed by the smplkit platform.
|
|
54
54
|
*
|
|
55
55
|
* Management: mutate properties directly and call `save()` to persist.
|
|
56
|
-
*
|
|
56
|
+
* Creates if new, updates if existing.
|
|
57
57
|
*/
|
|
58
58
|
declare class Config {
|
|
59
59
|
/** UUID of the config, or `null` if unsaved. */
|
|
@@ -70,8 +70,7 @@ declare class Config {
|
|
|
70
70
|
items: Record<string, unknown>;
|
|
71
71
|
/**
|
|
72
72
|
* Per-environment overrides.
|
|
73
|
-
*
|
|
74
|
-
* unwrapped from the server's `{ value: raw }` wrapper.
|
|
73
|
+
* Structured as `{ env_name: { values: { key: value } } }`.
|
|
75
74
|
*/
|
|
76
75
|
environments: Record<string, unknown>;
|
|
77
76
|
/** When the config was created, or null if unavailable. */
|
|
@@ -95,7 +94,7 @@ declare class Config {
|
|
|
95
94
|
/**
|
|
96
95
|
* Persist this config to the server.
|
|
97
96
|
*
|
|
98
|
-
*
|
|
97
|
+
* Creates if new, updates if existing.
|
|
99
98
|
* Updates this instance in-place with the server response.
|
|
100
99
|
*/
|
|
101
100
|
save(): Promise<void>;
|
|
@@ -118,17 +117,17 @@ declare class Config {
|
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
/**
|
|
121
|
-
* LiveConfigProxy —
|
|
120
|
+
* LiveConfigProxy — live configuration access.
|
|
122
121
|
*
|
|
123
|
-
* Property reads
|
|
124
|
-
*
|
|
125
|
-
*
|
|
122
|
+
* Property reads always return the latest resolved values. When the
|
|
123
|
+
* underlying config changes, subsequent reads automatically reflect
|
|
124
|
+
* the new values.
|
|
126
125
|
*/
|
|
127
126
|
|
|
128
127
|
/**
|
|
129
128
|
* A live proxy that auto-updates when the underlying config changes.
|
|
130
129
|
*
|
|
131
|
-
* Access properties directly — each read
|
|
130
|
+
* Access properties directly — each read returns the latest resolved value.
|
|
132
131
|
*
|
|
133
132
|
* @example
|
|
134
133
|
* ```typescript
|
|
@@ -208,8 +207,8 @@ declare class ConfigClient {
|
|
|
208
207
|
/**
|
|
209
208
|
* Resolve a config's values for the current environment.
|
|
210
209
|
*
|
|
211
|
-
* Returns a flat dict of resolved key-value pairs
|
|
212
|
-
*
|
|
210
|
+
* Returns a flat dict of resolved key-value pairs with inherited
|
|
211
|
+
* values and environment overrides applied.
|
|
213
212
|
*
|
|
214
213
|
* Optionally pass a model class to map the resolved values.
|
|
215
214
|
*/
|
|
@@ -230,7 +229,7 @@ declare class ConfigClient {
|
|
|
230
229
|
*/
|
|
231
230
|
onChange(callbackOrConfigKey: string | ((event: ConfigChangeEvent) => void), callbackOrItemKey?: string | ((event: ConfigChangeEvent) => void), callback?: (event: ConfigChangeEvent) => void): void;
|
|
232
231
|
/**
|
|
233
|
-
* Re-fetch all configs
|
|
232
|
+
* Re-fetch all configs and re-resolve values.
|
|
234
233
|
* Fires change listeners for any values that differ.
|
|
235
234
|
*/
|
|
236
235
|
refresh(): Promise<void>;
|
|
@@ -529,8 +528,8 @@ declare class Rule {
|
|
|
529
528
|
/**
|
|
530
529
|
* A flag resource that doubles as a runtime handle.
|
|
531
530
|
*
|
|
532
|
-
* Management: call `save()` to persist (
|
|
533
|
-
* Runtime: call `get()`
|
|
531
|
+
* Management: call `save()` to persist (creates if new, updates if existing).
|
|
532
|
+
* Runtime: call `get()` to evaluate the flag locally.
|
|
534
533
|
*/
|
|
535
534
|
declare class Flag {
|
|
536
535
|
/** UUID of the flag, or `null` if unsaved. */
|
|
@@ -577,7 +576,7 @@ declare class Flag {
|
|
|
577
576
|
/**
|
|
578
577
|
* Persist this flag to the server.
|
|
579
578
|
*
|
|
580
|
-
*
|
|
579
|
+
* Creates if new, updates if existing.
|
|
581
580
|
* Updates this instance in-place with the server response.
|
|
582
581
|
*/
|
|
583
582
|
save(): Promise<void>;
|
|
@@ -597,7 +596,7 @@ declare class Flag {
|
|
|
597
596
|
/** Clear all rules for a specific environment (sync local mutation). */
|
|
598
597
|
clearRules(envKey: string): void;
|
|
599
598
|
/**
|
|
600
|
-
* Evaluate the flag locally
|
|
599
|
+
* Evaluate the flag locally.
|
|
601
600
|
*
|
|
602
601
|
* Requires `initialize()` to have been called.
|
|
603
602
|
*/
|
|
@@ -635,10 +634,6 @@ declare class JsonFlag extends Flag {
|
|
|
635
634
|
|
|
636
635
|
/**
|
|
637
636
|
* FlagsClient — management + prescriptive runtime for Smpl Flags.
|
|
638
|
-
*
|
|
639
|
-
* Uses the generated OpenAPI types (`src/generated/flags.d.ts`) via
|
|
640
|
-
* `openapi-fetch` for all flag HTTP calls. Context registration uses
|
|
641
|
-
* the generated app service types (`src/generated/app.d.ts`).
|
|
642
637
|
*/
|
|
643
638
|
|
|
644
639
|
type FlagResource = components["schemas"]["FlagResource"];
|
|
@@ -773,16 +768,18 @@ declare class FlagsClient {
|
|
|
773
768
|
*/
|
|
774
769
|
onChange(callbackOrKey: string | ((event: FlagChangeEvent) => void), callback?: (event: FlagChangeEvent) => void): void;
|
|
775
770
|
/**
|
|
776
|
-
*
|
|
771
|
+
* Register context(s) with the server.
|
|
777
772
|
*
|
|
778
|
-
* Accepts a single Context or an array.
|
|
779
|
-
* blocks. Works before `initialize()` is called.
|
|
773
|
+
* Accepts a single Context or an array. Registration is asynchronous
|
|
774
|
+
* and never blocks. Works before `initialize()` is called.
|
|
780
775
|
*/
|
|
781
776
|
register(context: Context | Context[]): void;
|
|
782
777
|
/** Flush pending context registrations to the server. */
|
|
783
778
|
flushContexts(): Promise<void>;
|
|
784
779
|
/**
|
|
785
|
-
*
|
|
780
|
+
* Evaluate a flag with an explicit environment and context.
|
|
781
|
+
*
|
|
782
|
+
* Stateless — does not use the context provider or cached results.
|
|
786
783
|
*/
|
|
787
784
|
evaluate(key: string, options: {
|
|
788
785
|
environment: string;
|
|
@@ -877,7 +874,7 @@ declare class Logger {
|
|
|
877
874
|
/**
|
|
878
875
|
* Persist this logger to the server.
|
|
879
876
|
*
|
|
880
|
-
*
|
|
877
|
+
* Creates if new, updates if existing.
|
|
881
878
|
*/
|
|
882
879
|
save(): Promise<void>;
|
|
883
880
|
/** Set the base log level (sync local mutation). */
|
|
@@ -932,7 +929,7 @@ declare class LogGroup {
|
|
|
932
929
|
/**
|
|
933
930
|
* Persist this log group to the server.
|
|
934
931
|
*
|
|
935
|
-
*
|
|
932
|
+
* Creates if new, updates if existing.
|
|
936
933
|
*/
|
|
937
934
|
save(): Promise<void>;
|
|
938
935
|
/** Set the base log level (sync local mutation). */
|
|
@@ -953,11 +950,8 @@ declare class LogGroup {
|
|
|
953
950
|
/**
|
|
954
951
|
* Contract for pluggable logging framework integration.
|
|
955
952
|
*
|
|
956
|
-
* Adapters bridge the smplkit logging runtime to a specific logging
|
|
957
|
-
*
|
|
958
|
-
*
|
|
959
|
-
* Adapters are NOT responsible for: key normalization, caching, bulk registration,
|
|
960
|
-
* level resolution, or WebSocket handling. Those remain in the core client.
|
|
953
|
+
* Adapters bridge the smplkit logging runtime to a specific logging
|
|
954
|
+
* framework (e.g., Winston, Pino).
|
|
961
955
|
*/
|
|
962
956
|
interface LoggingAdapter {
|
|
963
957
|
/** Human-readable adapter name for diagnostics (e.g., 'winston'). */
|
|
@@ -988,9 +982,6 @@ interface LoggingAdapter {
|
|
|
988
982
|
|
|
989
983
|
/**
|
|
990
984
|
* LoggingClient — management plane + scaffolded runtime for Smpl Logging.
|
|
991
|
-
*
|
|
992
|
-
* Uses the generated OpenAPI types (`src/generated/logging.d.ts`) via
|
|
993
|
-
* `openapi-fetch` for all HTTP calls.
|
|
994
985
|
*/
|
|
995
986
|
|
|
996
987
|
/**
|
|
@@ -1055,14 +1046,9 @@ declare class LoggingClient {
|
|
|
1055
1046
|
/**
|
|
1056
1047
|
* Start the logging runtime.
|
|
1057
1048
|
*
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
* 3. Install hooks on each adapter for new logger creation
|
|
1062
|
-
* 4. Bulk-register discovered loggers with the server
|
|
1063
|
-
* 5. Fetch all loggers and groups from the server
|
|
1064
|
-
* 6. Resolve levels and apply to adapters
|
|
1065
|
-
* 7. Wire WebSocket for live updates
|
|
1049
|
+
* Discovers loggers from registered adapters, syncs them with the
|
|
1050
|
+
* server, applies server-side log levels, and subscribes to live
|
|
1051
|
+
* level updates.
|
|
1066
1052
|
*
|
|
1067
1053
|
* Idempotent — safe to call multiple times.
|
|
1068
1054
|
* Management methods work without start().
|
|
@@ -1169,10 +1155,9 @@ declare class SmplClient {
|
|
|
1169
1155
|
/**
|
|
1170
1156
|
* Winston logging framework adapter.
|
|
1171
1157
|
*
|
|
1172
|
-
*
|
|
1173
|
-
*
|
|
1174
|
-
*
|
|
1175
|
-
* levels by setting `logger.level` on the winston logger instance.
|
|
1158
|
+
* Integrates the smplkit logging runtime with Winston. Discovers
|
|
1159
|
+
* existing loggers, tracks new logger creation, and applies
|
|
1160
|
+
* server-managed log levels.
|
|
1176
1161
|
*/
|
|
1177
1162
|
|
|
1178
1163
|
interface WinstonAdapterConfig {
|
|
@@ -1199,10 +1184,8 @@ declare class WinstonAdapter implements LoggingAdapter {
|
|
|
1199
1184
|
/**
|
|
1200
1185
|
* Pino logging framework adapter.
|
|
1201
1186
|
*
|
|
1202
|
-
*
|
|
1203
|
-
*
|
|
1204
|
-
* `child()` method on created loggers. Logger instances are tracked via
|
|
1205
|
-
* WeakRef to avoid memory leaks.
|
|
1187
|
+
* Integrates the smplkit logging runtime with Pino. Tracks logger
|
|
1188
|
+
* instances (including child loggers) for discovery and level control.
|
|
1206
1189
|
*/
|
|
1207
1190
|
|
|
1208
1191
|
interface PinoAdapterConfig {
|
package/dist/index.js
CHANGED
|
@@ -16770,8 +16770,7 @@ var Config = class {
|
|
|
16770
16770
|
items;
|
|
16771
16771
|
/**
|
|
16772
16772
|
* Per-environment overrides.
|
|
16773
|
-
*
|
|
16774
|
-
* unwrapped from the server's `{ value: raw }` wrapper.
|
|
16773
|
+
* Structured as `{ env_name: { values: { key: value } } }`.
|
|
16775
16774
|
*/
|
|
16776
16775
|
environments;
|
|
16777
16776
|
/** When the config was created, or null if unavailable. */
|
|
@@ -16796,7 +16795,7 @@ var Config = class {
|
|
|
16796
16795
|
/**
|
|
16797
16796
|
* Persist this config to the server.
|
|
16798
16797
|
*
|
|
16799
|
-
*
|
|
16798
|
+
* Creates if new, updates if existing.
|
|
16800
16799
|
* Updates this instance in-place with the server response.
|
|
16801
16800
|
*/
|
|
16802
16801
|
async save() {
|
|
@@ -17174,8 +17173,8 @@ var ConfigClient = class {
|
|
|
17174
17173
|
/**
|
|
17175
17174
|
* Resolve a config's values for the current environment.
|
|
17176
17175
|
*
|
|
17177
|
-
* Returns a flat dict of resolved key-value pairs
|
|
17178
|
-
*
|
|
17176
|
+
* Returns a flat dict of resolved key-value pairs with inherited
|
|
17177
|
+
* values and environment overrides applied.
|
|
17179
17178
|
*
|
|
17180
17179
|
* Optionally pass a model class to map the resolved values.
|
|
17181
17180
|
*/
|
|
@@ -17238,7 +17237,7 @@ var ConfigClient = class {
|
|
|
17238
17237
|
// Runtime: refresh
|
|
17239
17238
|
// ------------------------------------------------------------------
|
|
17240
17239
|
/**
|
|
17241
|
-
* Re-fetch all configs
|
|
17240
|
+
* Re-fetch all configs and re-resolve values.
|
|
17242
17241
|
* Fires change listeners for any values that differ.
|
|
17243
17242
|
*/
|
|
17244
17243
|
async refresh() {
|
|
@@ -17404,7 +17403,7 @@ var Flag = class {
|
|
|
17404
17403
|
/**
|
|
17405
17404
|
* Persist this flag to the server.
|
|
17406
17405
|
*
|
|
17407
|
-
*
|
|
17406
|
+
* Creates if new, updates if existing.
|
|
17408
17407
|
* Updates this instance in-place with the server response.
|
|
17409
17408
|
*/
|
|
17410
17409
|
async save() {
|
|
@@ -17467,7 +17466,7 @@ var Flag = class {
|
|
|
17467
17466
|
}
|
|
17468
17467
|
}
|
|
17469
17468
|
/**
|
|
17470
|
-
* Evaluate the flag locally
|
|
17469
|
+
* Evaluate the flag locally.
|
|
17471
17470
|
*
|
|
17472
17471
|
* Requires `initialize()` to have been called.
|
|
17473
17472
|
*/
|
|
@@ -18083,10 +18082,10 @@ var FlagsClient = class {
|
|
|
18083
18082
|
// Runtime: context registration
|
|
18084
18083
|
// ------------------------------------------------------------------
|
|
18085
18084
|
/**
|
|
18086
|
-
*
|
|
18085
|
+
* Register context(s) with the server.
|
|
18087
18086
|
*
|
|
18088
|
-
* Accepts a single Context or an array.
|
|
18089
|
-
* blocks. Works before `initialize()` is called.
|
|
18087
|
+
* Accepts a single Context or an array. Registration is asynchronous
|
|
18088
|
+
* and never blocks. Works before `initialize()` is called.
|
|
18090
18089
|
*/
|
|
18091
18090
|
register(context) {
|
|
18092
18091
|
if (Array.isArray(context)) {
|
|
@@ -18103,7 +18102,9 @@ var FlagsClient = class {
|
|
|
18103
18102
|
// Runtime: Tier 1 evaluate
|
|
18104
18103
|
// ------------------------------------------------------------------
|
|
18105
18104
|
/**
|
|
18106
|
-
*
|
|
18105
|
+
* Evaluate a flag with an explicit environment and context.
|
|
18106
|
+
*
|
|
18107
|
+
* Stateless — does not use the context provider or cached results.
|
|
18107
18108
|
*/
|
|
18108
18109
|
async evaluate(key, options) {
|
|
18109
18110
|
const evalDict = contextsToEvalDict(options.context);
|
|
@@ -18346,7 +18347,7 @@ var Logger = class {
|
|
|
18346
18347
|
/**
|
|
18347
18348
|
* Persist this logger to the server.
|
|
18348
18349
|
*
|
|
18349
|
-
*
|
|
18350
|
+
* Creates if new, updates if existing.
|
|
18350
18351
|
*/
|
|
18351
18352
|
async save() {
|
|
18352
18353
|
const saved = await this._client._saveLogger(this);
|
|
@@ -18431,7 +18432,7 @@ var LogGroup = class {
|
|
|
18431
18432
|
/**
|
|
18432
18433
|
* Persist this log group to the server.
|
|
18433
18434
|
*
|
|
18434
|
-
*
|
|
18435
|
+
* Creates if new, updates if existing.
|
|
18435
18436
|
*/
|
|
18436
18437
|
async save() {
|
|
18437
18438
|
const saved = await this._client._saveLogGroup(this);
|
|
@@ -18775,14 +18776,9 @@ var LoggingClient = class {
|
|
|
18775
18776
|
/**
|
|
18776
18777
|
* Start the logging runtime.
|
|
18777
18778
|
*
|
|
18778
|
-
*
|
|
18779
|
-
*
|
|
18780
|
-
*
|
|
18781
|
-
* 3. Install hooks on each adapter for new logger creation
|
|
18782
|
-
* 4. Bulk-register discovered loggers with the server
|
|
18783
|
-
* 5. Fetch all loggers and groups from the server
|
|
18784
|
-
* 6. Resolve levels and apply to adapters
|
|
18785
|
-
* 7. Wire WebSocket for live updates
|
|
18779
|
+
* Discovers loggers from registered adapters, syncs them with the
|
|
18780
|
+
* server, applies server-side log levels, and subscribes to live
|
|
18781
|
+
* level updates.
|
|
18786
18782
|
*
|
|
18787
18783
|
* Idempotent — safe to call multiple times.
|
|
18788
18784
|
* Management methods work without start().
|