@smplkit/sdk 3.0.32 → 3.0.33

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.d.ts CHANGED
@@ -981,6 +981,15 @@ interface components {
981
981
  schemas: {
982
982
  /**
983
983
  * Flag
984
+ * @description A feature flag whose value is resolved at runtime from environment
985
+ * rules and a default.
986
+ *
987
+ * A flag has a value type (`BOOLEAN`, `STRING`, `NUMERIC`, or `JSON`)
988
+ * and either a fixed set of allowed values (constrained) or accepts
989
+ * any value matching the type (unconstrained). Each environment can
990
+ * enable or disable the flag, set its own default, and define
991
+ * targeting rules that override the default for specific evaluation
992
+ * contexts.
984
993
  * @example {
985
994
  * "created_at": "2026-03-27T10:00:00Z",
986
995
  * "default": false,
@@ -993,9 +1002,12 @@ interface components {
993
1002
  * {
994
1003
  * "description": "Beta users get dark mode",
995
1004
  * "logic": {
996
- * "attribute": "beta",
997
- * "op": "eq",
998
- * "value": true
1005
+ * "==": [
1006
+ * {
1007
+ * "var": "customer.beta"
1008
+ * },
1009
+ * true
1010
+ * ]
999
1011
  * },
1000
1012
  * "value": true
1001
1013
  * }
@@ -1026,46 +1038,61 @@ interface components {
1026
1038
  Flag: {
1027
1039
  /**
1028
1040
  * Name
1029
- * @description Human-readable display name
1041
+ * @description Human-readable display name for the flag.
1030
1042
  */
1031
1043
  name: string;
1032
- /** Description */
1044
+ /**
1045
+ * Description
1046
+ * @description Human-readable description of the flag's purpose.
1047
+ */
1033
1048
  description?: string | null;
1034
1049
  /**
1035
1050
  * Type
1036
- * @description Value type: STRING, BOOLEAN, NUMERIC, or JSON
1051
+ * @description Value type of the flag. Accepted case-insensitively. Changing the type cascades to `values`, `default`, and every environment's rules and default.
1052
+ * @enum {string}
1037
1053
  */
1038
- type: string;
1054
+ type: "BOOLEAN" | "STRING" | "NUMERIC" | "JSON";
1039
1055
  /**
1040
1056
  * Default
1041
- * @description Default value; must reference a value in the values array (constrained) or match the flag type (unconstrained)
1057
+ * @description Default value returned when no environment rule fires and the environment has no `default`. For constrained flags (non-null `values`), must equal one of the entries in the `values` array. For unconstrained flags, must match `type`.
1042
1058
  */
1043
1059
  default: unknown;
1044
1060
  /**
1045
1061
  * Values
1046
- * @description Ordered set of allowed values (constrained), or null (unconstrained)
1062
+ * @description Ordered set of allowed values for a constrained flag, or `null` for an unconstrained flag. `BOOLEAN` flags, if constrained, must declare exactly two values.
1047
1063
  */
1048
1064
  values?: components["schemas"]["FlagValue"][] | null;
1049
- /** Environments */
1065
+ /**
1066
+ * Environments
1067
+ * @description Per-environment configuration keyed by environment name (`production`, `staging`, etc.). Environments not listed fall back to the flag's global `default`.
1068
+ */
1050
1069
  environments?: {
1051
1070
  [key: string]: components["schemas"]["FlagEnvironment"];
1052
1071
  };
1053
1072
  /**
1054
1073
  * Managed
1055
- * @description True if admin-managed, false if auto-discovered
1074
+ * @description `true` when the flag was created through the API, `false` when it was auto-discovered from a bulk-register call. Auto-discovered flags can be edited and converted to managed by setting this to `true`.
1056
1075
  */
1057
1076
  managed?: boolean | null;
1058
- /** Sources */
1059
- readonly sources?: {
1060
- [key: string]: unknown;
1061
- }[] | null;
1062
- /** Created At */
1077
+ /**
1078
+ * Sources
1079
+ * @description SDK-reported observations of this flag, grouped by service and environment. Populated automatically by the bulk-register endpoint.
1080
+ */
1081
+ readonly sources?: components["schemas"]["FlagSource"][] | null;
1082
+ /**
1083
+ * Created At
1084
+ * @description When the flag was created.
1085
+ */
1063
1086
  readonly created_at?: string | null;
1064
- /** Updated At */
1087
+ /**
1088
+ * Updated At
1089
+ * @description When the flag was last modified.
1090
+ */
1065
1091
  readonly updated_at?: string | null;
1066
1092
  };
1067
1093
  /**
1068
1094
  * FlagBulkItem
1095
+ * @description One flag declaration reported by an SDK during bulk registration.
1069
1096
  * @example {
1070
1097
  * "default": false,
1071
1098
  * "environment": "production",
@@ -1077,32 +1104,34 @@ interface components {
1077
1104
  FlagBulkItem: {
1078
1105
  /**
1079
1106
  * Id
1080
- * @description Flag key as declared in code
1107
+ * @description Flag key as declared in code. URL-safe and stable for the lifetime of the flag.
1081
1108
  */
1082
1109
  id: string;
1083
1110
  /**
1084
1111
  * Type
1085
- * @description Flag type: BOOLEAN, STRING, NUMERIC, or JSON
1112
+ * @description Value type the SDK declared for the flag. Accepted case-insensitively.
1113
+ * @enum {string}
1086
1114
  */
1087
- type: string;
1115
+ type: "BOOLEAN" | "STRING" | "NUMERIC" | "JSON";
1088
1116
  /**
1089
1117
  * Default
1090
- * @description Default value declared in code
1118
+ * @description Default value the SDK declared for the flag. Used to create the flag if it does not already exist.
1091
1119
  */
1092
1120
  default: unknown;
1093
1121
  /**
1094
1122
  * Service
1095
- * @description Service that declared this flag
1123
+ * @description Service reporting the declaration. Defaults to `unknown`.
1096
1124
  */
1097
1125
  service?: string | null;
1098
1126
  /**
1099
1127
  * Environment
1100
- * @description Environment where observed
1128
+ * @description Environment reporting the declaration. Defaults to `unknown`.
1101
1129
  */
1102
1130
  environment?: string | null;
1103
1131
  };
1104
1132
  /**
1105
1133
  * FlagBulkRequest
1134
+ * @description Inputs to the bulk-register-flags action.
1106
1135
  * @example {
1107
1136
  * "flags": [
1108
1137
  * {
@@ -1123,38 +1152,70 @@ interface components {
1123
1152
  * }
1124
1153
  */
1125
1154
  FlagBulkRequest: {
1126
- /** Flags */
1155
+ /**
1156
+ * Flags
1157
+ * @description Flags reported by the SDK in this batch.
1158
+ */
1127
1159
  flags: components["schemas"]["FlagBulkItem"][];
1128
1160
  };
1129
1161
  /**
1130
1162
  * FlagBulkResponse
1163
+ * @description Result of a bulk-register-flags action.
1131
1164
  * @example {
1132
1165
  * "registered": 5
1133
1166
  * }
1134
1167
  */
1135
1168
  FlagBulkResponse: {
1136
- /** Registered */
1169
+ /**
1170
+ * Registered
1171
+ * @description Number of items in the batch that were registered or refreshed.
1172
+ */
1137
1173
  registered: number;
1138
1174
  };
1139
- /** FlagEnvironment */
1175
+ /**
1176
+ * FlagEnvironment
1177
+ * @description Per-environment evaluation configuration for a flag.
1178
+ */
1140
1179
  FlagEnvironment: {
1141
1180
  /**
1142
1181
  * Enabled
1182
+ * @description Whether the flag is active in this environment. When `false`, evaluation skips rules and returns the flag's global `default`.
1143
1183
  * @default true
1144
1184
  */
1145
1185
  enabled: boolean;
1146
- /** Default */
1186
+ /**
1187
+ * Default
1188
+ * @description Environment-level default returned when no rule fires. If `null`, evaluation falls back to the flag's global `default`.
1189
+ */
1147
1190
  default?: unknown | null;
1148
- /** Rules */
1191
+ /**
1192
+ * Rules
1193
+ * @description Targeting rules evaluated top-down. The first rule whose logic returns truthy provides the result.
1194
+ */
1149
1195
  rules?: components["schemas"]["FlagRule"][];
1150
1196
  };
1151
- /** FlagListResponse */
1197
+ /**
1198
+ * FlagListResponse
1199
+ * @description JSON:API collection response envelope for flags.
1200
+ */
1152
1201
  FlagListResponse: {
1153
1202
  /** Data */
1154
1203
  data: components["schemas"]["FlagResource"][];
1155
1204
  };
1205
+ /**
1206
+ * FlagRequest
1207
+ * @description JSON:API request envelope for creating or updating a flag.
1208
+ */
1209
+ FlagRequest: {
1210
+ data: components["schemas"]["FlagResource"];
1211
+ };
1156
1212
  /**
1157
1213
  * FlagResource
1214
+ * @description JSON:API resource envelope for a flag.
1215
+ *
1216
+ * `id` is the flag key. For create requests, `id` is required and is
1217
+ * chosen by the caller. For update requests, `id` may be omitted (the
1218
+ * server reads the key from the URL) or supplied to rename the flag.
1158
1219
  * @example {
1159
1220
  * "attributes": {
1160
1221
  * "created_at": "2026-03-27T10:00:00Z",
@@ -1168,9 +1229,12 @@ interface components {
1168
1229
  * {
1169
1230
  * "description": "Beta users get dark mode",
1170
1231
  * "logic": {
1171
- * "attribute": "beta",
1172
- * "op": "eq",
1173
- * "value": true
1232
+ * "==": [
1233
+ * {
1234
+ * "var": "customer.beta"
1235
+ * },
1236
+ * true
1237
+ * ]
1174
1238
  * },
1175
1239
  * "value": true
1176
1240
  * }
@@ -1206,68 +1270,110 @@ interface components {
1206
1270
  type: "flag";
1207
1271
  attributes: components["schemas"]["Flag"];
1208
1272
  };
1209
- /** FlagResponse */
1273
+ /**
1274
+ * FlagResponse
1275
+ * @description JSON:API single-resource response envelope for a flag.
1276
+ */
1210
1277
  FlagResponse: {
1211
1278
  data: components["schemas"]["FlagResource"];
1212
1279
  };
1213
- /** FlagRule */
1280
+ /**
1281
+ * FlagRule
1282
+ * @description A targeting rule that overrides the default within an environment.
1283
+ */
1214
1284
  FlagRule: {
1215
- /** Description */
1285
+ /**
1286
+ * Description
1287
+ * @description Human-readable description of the rule.
1288
+ */
1216
1289
  description?: string | null;
1217
- /** Logic */
1290
+ /**
1291
+ * Logic
1292
+ * @description JSON Logic expression evaluated against the evaluation context. The rule fires when the expression is truthy.
1293
+ */
1218
1294
  logic: {
1219
1295
  [key: string]: unknown;
1220
1296
  };
1221
- /** Value */
1297
+ /**
1298
+ * Value
1299
+ * @description Value returned when the rule fires. Must reference a value from the flag's `values` array (constrained flags) or match the flag's `type` (unconstrained flags).
1300
+ */
1222
1301
  value: unknown;
1223
1302
  };
1224
1303
  /**
1225
1304
  * FlagSource
1226
- * @example {
1227
- * "created_at": "2026-04-17T10:00:00Z",
1228
- * "data": {
1229
- * "default": true,
1230
- * "type": "BOOLEAN"
1231
- * },
1232
- * "environment": "production",
1233
- * "first_observed": "2026-04-17T10:00:00Z",
1234
- * "last_seen": "2026-04-17T15:30:00Z",
1235
- * "service": "api-gateway",
1236
- * "updated_at": "2026-04-17T15:30:00Z"
1237
- * }
1305
+ * @description A record of an SDK observing a feature flag from a particular
1306
+ * service and environment.
1307
+ *
1308
+ * The flags service auto-registers a source the first time an SDK
1309
+ * reports a flag from a given service/environment pair and refreshes
1310
+ * `last_seen` on every subsequent report. Each source captures the
1311
+ * value type and default value the SDK declared in source code at
1312
+ * that location, which makes it possible to detect when service code
1313
+ * has drifted from the flag's authoritative configuration.
1238
1314
  */
1239
1315
  FlagSource: {
1240
- /** Service */
1241
- readonly service?: string;
1242
- /** Environment */
1243
- readonly environment?: string;
1244
- /** First Observed */
1316
+ /**
1317
+ * Service
1318
+ * @description Service that declared the flag.
1319
+ */
1320
+ readonly service?: string | null;
1321
+ /**
1322
+ * Environment
1323
+ * @description Environment in which the service declared the flag.
1324
+ */
1325
+ readonly environment?: string | null;
1326
+ /**
1327
+ * Declared Type
1328
+ * @description Value type the SDK reported when registering the flag from this service/environment. May differ from the flag's authoritative `type` if the service is running stale code.
1329
+ */
1330
+ readonly declared_type?: ("BOOLEAN" | "STRING" | "NUMERIC" | "JSON") | null;
1331
+ /**
1332
+ * Declared Default
1333
+ * @description Default value the SDK reported when registering the flag from this service/environment. May differ from the flag's authoritative `default` if the service is running stale code.
1334
+ */
1335
+ readonly declared_default?: unknown;
1336
+ /**
1337
+ * First Observed
1338
+ * @description When this source was first observed.
1339
+ */
1245
1340
  readonly first_observed?: string | null;
1246
- /** Last Seen */
1341
+ /**
1342
+ * Last Seen
1343
+ * @description Most recent time the SDK re-registered this source.
1344
+ */
1247
1345
  readonly last_seen?: string | null;
1248
- /** Data */
1249
- readonly data?: {
1250
- [key: string]: unknown;
1251
- } | null;
1252
- /** Created At */
1346
+ /**
1347
+ * Created At
1348
+ * @description When the source record was created.
1349
+ */
1253
1350
  readonly created_at?: string | null;
1254
- /** Updated At */
1351
+ /**
1352
+ * Updated At
1353
+ * @description When the source record was last modified.
1354
+ */
1255
1355
  readonly updated_at?: string | null;
1256
1356
  };
1257
- /** FlagSourceListResponse */
1357
+ /**
1358
+ * FlagSourceListResponse
1359
+ * @description JSON:API collection response envelope for flag sources.
1360
+ */
1258
1361
  FlagSourceListResponse: {
1259
1362
  /** Data */
1260
1363
  data: components["schemas"]["FlagSourceResource"][];
1261
1364
  };
1262
1365
  /**
1263
1366
  * FlagSourceResource
1367
+ * @description JSON:API resource envelope for a flag source.
1368
+ *
1369
+ * `id` is the source record's UUID. Sources are not created or
1370
+ * modified directly — the flags service registers and refreshes them
1371
+ * in response to SDK bulk-register requests.
1264
1372
  * @example {
1265
1373
  * "attributes": {
1266
1374
  * "created_at": "2026-04-17T10:00:00Z",
1267
- * "data": {
1268
- * "default": true,
1269
- * "type": "BOOLEAN"
1270
- * },
1375
+ * "declared_default": true,
1376
+ * "declared_type": "BOOLEAN",
1271
1377
  * "environment": "production",
1272
1378
  * "first_observed": "2026-04-17T10:00:00Z",
1273
1379
  * "last_seen": "2026-04-17T15:30:00Z",
@@ -1288,46 +1394,99 @@ interface components {
1288
1394
  type: "flag_source";
1289
1395
  attributes: components["schemas"]["FlagSource"];
1290
1396
  };
1291
- /** FlagValue */
1397
+ /**
1398
+ * FlagValue
1399
+ * @description A named value in a constrained flag's value set.
1400
+ */
1292
1401
  FlagValue: {
1293
- /** Name */
1402
+ /**
1403
+ * Name
1404
+ * @description Human-readable label for the value.
1405
+ */
1294
1406
  name: string;
1295
- /** Value */
1407
+ /**
1408
+ * Value
1409
+ * @description The value itself. Must match the flag's `type`.
1410
+ */
1296
1411
  value: unknown;
1297
1412
  };
1298
- /** ManualReviewItem */
1413
+ /**
1414
+ * ManualReviewItem
1415
+ * @description A flag rule that could not be safely modified by the bulk
1416
+ * remove-references action.
1417
+ */
1299
1418
  ManualReviewItem: {
1300
- /** Flag */
1419
+ /**
1420
+ * Flag
1421
+ * @description Key of the flag containing the rule.
1422
+ */
1301
1423
  flag: string;
1302
- /** Environment */
1424
+ /**
1425
+ * Environment
1426
+ * @description Environment containing the rule.
1427
+ */
1303
1428
  environment: string;
1304
- /** Rule Index */
1429
+ /**
1430
+ * Rule Index
1431
+ * @description Position of the rule within the environment's `rules` array.
1432
+ */
1305
1433
  rule_index: number;
1306
- /** Reason */
1434
+ /**
1435
+ * Reason
1436
+ * @description Why the rule needs manual review.
1437
+ */
1307
1438
  reason: string;
1308
1439
  };
1309
- /** RemoveReferencesAttributes */
1440
+ /**
1441
+ * RemoveReferencesAttributes
1442
+ * @description Counts and follow-ups returned by the remove-references action.
1443
+ */
1310
1444
  RemoveReferencesAttributes: {
1311
- /** Flags Modified */
1445
+ /**
1446
+ * Flags Modified
1447
+ * @description Keys of flags whose rules were modified.
1448
+ */
1312
1449
  flags_modified: string[];
1313
- /** Rules Removed */
1450
+ /**
1451
+ * Rules Removed
1452
+ * @description Total number of rules removed across all flags.
1453
+ */
1314
1454
  rules_removed: number;
1315
- /** Rules Needing Manual Review */
1455
+ /**
1456
+ * Rules Needing Manual Review
1457
+ * @description Rules that referenced the context but could not be removed automatically (typically because the reference is inside an `and` expression where removal would broaden the rule).
1458
+ */
1316
1459
  rules_needing_manual_review: components["schemas"]["ManualReviewItem"][];
1317
1460
  };
1318
- /** RemoveReferencesRequest */
1461
+ /**
1462
+ * RemoveReferencesRequest
1463
+ * @description Inputs to the remove-references action.
1464
+ *
1465
+ * Exactly one of `context` or `context_type` must be provided.
1466
+ */
1319
1467
  RemoveReferencesRequest: {
1320
- /** Context */
1468
+ /**
1469
+ * Context
1470
+ * @description Identifier of the context instance to remove references to, formatted as `{type}:{key}` (e.g. `customer:c-123`).
1471
+ */
1321
1472
  context?: string | null;
1322
- /** Context Type */
1473
+ /**
1474
+ * Context Type
1475
+ * @description Context type to remove all references to (any attribute of this type).
1476
+ */
1323
1477
  context_type?: string | null;
1324
1478
  };
1325
- /** RemoveReferencesResultEnvelope */
1479
+ /**
1480
+ * RemoveReferencesResultEnvelope
1481
+ * @description JSON:API single-resource response envelope for the
1482
+ * remove-references action.
1483
+ */
1326
1484
  RemoveReferencesResultEnvelope: {
1327
1485
  data: components["schemas"]["RemoveReferencesResultResource"];
1328
1486
  };
1329
1487
  /**
1330
1488
  * RemoveReferencesResultResource
1489
+ * @description JSON:API resource envelope for the remove-references result.
1331
1490
  * @example {
1332
1491
  * "attributes": {
1333
1492
  * "flags_modified": [
@@ -1356,17 +1515,30 @@ interface components {
1356
1515
  type: "remove_references_result";
1357
1516
  attributes: components["schemas"]["RemoveReferencesAttributes"];
1358
1517
  };
1359
- /** UsageAttributes */
1518
+ /**
1519
+ * UsageAttributes
1520
+ * @description Usage counter for a single metered limit.
1521
+ */
1360
1522
  UsageAttributes: {
1361
- /** Limit Key */
1523
+ /**
1524
+ * Limit Key
1525
+ * @description Identifier of the metered limit, e.g. `flags.items`.
1526
+ */
1362
1527
  limit_key: string;
1363
- /** Period */
1528
+ /**
1529
+ * Period
1530
+ * @description Period the counter covers. `current` is the only supported value.
1531
+ */
1364
1532
  period: string;
1365
- /** Value */
1533
+ /**
1534
+ * Value
1535
+ * @description Count for the period.
1536
+ */
1366
1537
  value: number;
1367
1538
  };
1368
1539
  /**
1369
1540
  * UsageListResponse
1541
+ * @description JSON:API collection response envelope for usage counters.
1370
1542
  * @example {
1371
1543
  * "data": [
1372
1544
  * {
@@ -1387,6 +1559,7 @@ interface components {
1387
1559
  };
1388
1560
  /**
1389
1561
  * UsageResource
1562
+ * @description JSON:API resource envelope for a usage counter.
1390
1563
  * @example {
1391
1564
  * "attributes": {
1392
1565
  * "limit_key": "flags.items",