@featureflip/mcp 0.3.0 → 0.5.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.
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  "GET /api/v1/orgs/{org}/projects/{project}/flags/removal-candidates": "PublicFlagRemovalCandidatePagedResult",
9
9
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}": "PublicFlagResponse",
10
10
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}": "PublicFlagEnvConfigResponse",
11
+ "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/evaluations": "PublicFlagEvaluationsResponse",
11
12
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/targeting": "PublicTargetingConfigResponse",
12
13
  "POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/rules": "PublicTargetingRuleResponse",
13
14
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/rules/{ruleId}": "PublicTargetingRuleResponse",
@@ -461,9 +462,19 @@ declare const _default: {
461
462
  "string",
462
463
  "null"
463
464
  ]
465
+ },
466
+ "plan_limit": {
467
+ "anyOf": [
468
+ {
469
+ "$ref": "#/$defs/PublicPlanLimit"
470
+ },
471
+ {
472
+ "type": "null"
473
+ }
474
+ ]
464
475
  }
465
476
  },
466
- "description": "The frozen public-API error contract. `error` codes are stable snake_case strings. Wire keys\nare frozen snake_case too (`error`, `message`, `docs_url`, `fields`,\n`retry_after`) — the global camelCase naming policy would otherwise emit\n`docsUrl`/`retryAfter`, breaking the published spec. !:JsonPropertyName\nalways wins over the policy, so these are pinned explicitly rather than relying on the\nproperty names already being lowercase for the single-word ones.\n`did_you_mean`, `next_actions` and `connection_id` are ADDITIVE optional keys\n(null → omitted via the global `DefaultIgnoreCondition = WhenWritingNull`), so\npre-existing error bodies are byte-for-byte unchanged when they're absent.\n\n`connection_id` is present only on the `sso_required` error: the organization\nrequires single sign-on, and this credential didn't come through its identity provider.\n`connection_id` identifies which SSO connection to sign in with."
477
+ "description": "The frozen public-API error contract. `error` codes are stable snake_case strings. Wire keys\nare frozen snake_case too (`error`, `message`, `docs_url`, `fields`,\n`retry_after`) — the global camelCase naming policy would otherwise emit\n`docsUrl`/`retryAfter`, breaking the published spec. !:JsonPropertyName\nalways wins over the policy, so these are pinned explicitly rather than relying on the\nproperty names already being lowercase for the single-word ones.\n`did_you_mean`, `next_actions` and `connection_id` are ADDITIVE optional keys\n(null → omitted via the global `DefaultIgnoreCondition = WhenWritingNull`), so\npre-existing error bodies are byte-for-byte unchanged when they're absent.\n\n`connection_id` is present only on the `sso_required` error: the organization\nrequires single sign-on, and this credential didn't come through its identity provider.\n`connection_id` identifies which SSO connection to sign in with.\n`plan_limit` is present only on the `plan_limit_reached` error: which plan cap the\nrequest would have exceeded, so a client can branch on it without parsing `message`."
467
478
  },
468
479
  "PublicConditionGroupRequest": {
469
480
  "type": [
@@ -609,6 +620,36 @@ declare const _default: {
609
620
  },
610
621
  "description": "A single condition within a PublicConditionGroupResponse. Maps 1:1 onto\nConditionDto. Operator is a bare wire string naming one of the\n`OperatorType` members (e.g. `\"Equals\"`, `\"In\"`)."
611
622
  },
623
+ "PublicConfiguredWeight": {
624
+ "type": [
625
+ "object",
626
+ "null"
627
+ ],
628
+ "properties": {
629
+ "variationKey": {
630
+ "type": [
631
+ "string",
632
+ "null"
633
+ ],
634
+ "description": "The variation's key."
635
+ },
636
+ "name": {
637
+ "type": [
638
+ "string",
639
+ "null"
640
+ ],
641
+ "description": "The variation's name, or null when the key no longer matches one of the flag's variations."
642
+ },
643
+ "weight": {
644
+ "type": [
645
+ "integer",
646
+ "null"
647
+ ],
648
+ "description": "Percent of the rule's traffic."
649
+ }
650
+ },
651
+ "description": "A variation's configured share of a rollout rule."
652
+ },
612
653
  "PublicCreateEnvironmentRequest": {
613
654
  "type": [
614
655
  "object",
@@ -923,6 +964,13 @@ declare const _default: {
923
964
  }
924
965
  ]
925
966
  }
967
+ },
968
+ "bucketBy": {
969
+ "type": [
970
+ "string",
971
+ "null"
972
+ ],
973
+ "description": "Context attribute the rollout hashes on (default `user_id`; `userId` is accepted as an alias). A context without it skips this rule, even at 100%. Changing it reshuffles who is in the rollout. A fixed rule (no `rolloutPercentage`) never hashes and always stores `user_id`. When omitted on `PUT .../targeting`, a rollout keeps the value of the existing rollout it edits: the existing rule with the same targeting, told apart from others with that targeting by its variation, then its description, then its position. Any other rule gets `user_id`. The request is refused with 400 until it sends `bucketBy` for a rollout whose edited rule it can't tell when the answer changes its attribute: the rollout shares only its targeting with several rules that bucket differently, or it matches no existing rule while the request removes a rollout bucketed by another attribute. On create, omitting it gives `user_id`."
926
974
  }
927
975
  },
928
976
  "description": "Request body for `POST .../rules`. The Application-side\n`CreateTargetingRuleDto`/`CreateConditionGroupDto`/`CreateConditionDto` all take\ntheir `Operator` as a bare string, re-parsed CASE-SENSITIVELY inside\n`CreateTargetingRuleCommandHandler` — `FlagTargetingController`'s mapping helpers\nvalidate every operator against the enum's member-name allowlist AND canonicalize the casing\n(e.g. `\"in\"` → `\"In\"`) before building the command DTO, so a valid\ncase-insensitive match never trips the handler's strict re-parse."
@@ -1176,6 +1224,128 @@ declare const _default: {
1176
1224
  },
1177
1225
  "description": "A page of results plus an opaque cursor for the next page, or null when this is the last\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`)."
1178
1226
  },
1227
+ "PublicEvaluationSource": {
1228
+ "type": [
1229
+ "object",
1230
+ "null"
1231
+ ],
1232
+ "properties": {
1233
+ "source": {
1234
+ "type": [
1235
+ "string",
1236
+ "null"
1237
+ ],
1238
+ "description": "One of rule, fallthrough, off, prerequisite, error, notFound or unknown (an SDK that reports no reason, or evaluations recorded before sources were). Allowed values: rule, fallthrough, off, prerequisite, error, notFound, unknown."
1239
+ },
1240
+ "ruleId": {
1241
+ "type": [
1242
+ "string",
1243
+ "null"
1244
+ ],
1245
+ "description": "For a rule, its id (rules have no key). Null otherwise, or when the SDK didn't say which rule."
1246
+ },
1247
+ "ruleLabel": {
1248
+ "type": [
1249
+ "string",
1250
+ "null"
1251
+ ],
1252
+ "description": "For a live rule, its description or a generated label. Null otherwise."
1253
+ },
1254
+ "ruleExists": {
1255
+ "type": [
1256
+ "boolean",
1257
+ "null"
1258
+ ],
1259
+ "description": "False when the rule is no longer in the environment's targeting."
1260
+ },
1261
+ "count": {
1262
+ "type": [
1263
+ "integer",
1264
+ "null"
1265
+ ],
1266
+ "description": "Evaluations this source served."
1267
+ },
1268
+ "share": {
1269
+ "type": [
1270
+ "number",
1271
+ "null"
1272
+ ],
1273
+ "description": "Count as a fraction (0 to 1) of all sources' counts combined."
1274
+ },
1275
+ "variations": {
1276
+ "type": [
1277
+ "array",
1278
+ "null"
1279
+ ],
1280
+ "items": {
1281
+ "anyOf": [
1282
+ {
1283
+ "$ref": "#/$defs/PublicEvaluationVariation"
1284
+ },
1285
+ {
1286
+ "type": "null"
1287
+ }
1288
+ ]
1289
+ },
1290
+ "description": "What this source served, with shares of this source's count."
1291
+ },
1292
+ "rollout": {
1293
+ "anyOf": [
1294
+ {
1295
+ "$ref": "#/$defs/PublicRolloutCheck"
1296
+ },
1297
+ {
1298
+ "type": "null"
1299
+ }
1300
+ ]
1301
+ }
1302
+ },
1303
+ "description": "The evaluations one part of the targeting served."
1304
+ },
1305
+ "PublicEvaluationVariation": {
1306
+ "type": [
1307
+ "object",
1308
+ "null"
1309
+ ],
1310
+ "properties": {
1311
+ "variationKey": {
1312
+ "type": [
1313
+ "string",
1314
+ "null"
1315
+ ],
1316
+ "description": "The variation served, or null for evaluations recorded without one."
1317
+ },
1318
+ "name": {
1319
+ "type": [
1320
+ "string",
1321
+ "null"
1322
+ ],
1323
+ "description": "The variation's name, or null when the key no longer matches one of the flag's variations."
1324
+ },
1325
+ "exists": {
1326
+ "type": [
1327
+ "boolean",
1328
+ "null"
1329
+ ],
1330
+ "description": "False when the key no longer matches one of the flag's variations."
1331
+ },
1332
+ "count": {
1333
+ "type": [
1334
+ "integer",
1335
+ "null"
1336
+ ],
1337
+ "description": "Evaluations that served this variation."
1338
+ },
1339
+ "share": {
1340
+ "type": [
1341
+ "number",
1342
+ "null"
1343
+ ],
1344
+ "description": "Count as a fraction (0 to 1) of the parent total: the window's total, or for a source's variations that source's count. 0 when the parent total is 0."
1345
+ }
1346
+ },
1347
+ "description": "One variation's evaluations."
1348
+ },
1179
1349
  "PublicFlagEnvConfigResponse": {
1180
1350
  "type": [
1181
1351
  "object",
@@ -1249,6 +1419,91 @@ declare const _default: {
1249
1419
  },
1250
1420
  "description": "Public representation of a flag's config within a single environment, returned by\n`GET .../flags/{flag}/environments` and `GET .../flags/{flag}/environments/{env}`.\nDrops internal/dashboard-only fields present on FlagEnvironmentConfigurationDto\n— Id (an internal row id, not part of the public\ncontract; EnvironmentId is the addressable key), `FeatureFlagId` (implicit\nin the route), the environment's name/color/sort-order (dashboard display fields — the public\ncontract only needs the addressable EnvironmentKey), and `Staleness` (an\ninternal analytics signal)."
1251
1421
  },
1422
+ "PublicFlagEvaluationsResponse": {
1423
+ "type": [
1424
+ "object",
1425
+ "null"
1426
+ ],
1427
+ "properties": {
1428
+ "environmentKey": {
1429
+ "type": [
1430
+ "string",
1431
+ "null"
1432
+ ],
1433
+ "description": "The environment's key."
1434
+ },
1435
+ "days": {
1436
+ "type": [
1437
+ "integer",
1438
+ "null"
1439
+ ],
1440
+ "description": "The window requested: 7, 30 or 90."
1441
+ },
1442
+ "fromUtc": {
1443
+ "type": [
1444
+ "string",
1445
+ "null"
1446
+ ],
1447
+ "description": "Start of the window: UTC midnight `days - 1` days ago, or the flag's creation day if later."
1448
+ },
1449
+ "toUtc": {
1450
+ "type": [
1451
+ "string",
1452
+ "null"
1453
+ ],
1454
+ "description": "When the counts were read."
1455
+ },
1456
+ "totalCount": {
1457
+ "type": [
1458
+ "integer",
1459
+ "null"
1460
+ ],
1461
+ "description": "Evaluations in the window. Evaluation counts, not unique users."
1462
+ },
1463
+ "lastEvaluatedAtUtc": {
1464
+ "type": [
1465
+ "string",
1466
+ "null"
1467
+ ],
1468
+ "description": "The last reported evaluation, or null if none was reported."
1469
+ },
1470
+ "variations": {
1471
+ "type": [
1472
+ "array",
1473
+ "null"
1474
+ ],
1475
+ "items": {
1476
+ "anyOf": [
1477
+ {
1478
+ "$ref": "#/$defs/PublicEvaluationVariation"
1479
+ },
1480
+ {
1481
+ "type": "null"
1482
+ }
1483
+ ]
1484
+ },
1485
+ "description": "Evaluations per variation over the window."
1486
+ },
1487
+ "sources": {
1488
+ "type": [
1489
+ "array",
1490
+ "null"
1491
+ ],
1492
+ "items": {
1493
+ "anyOf": [
1494
+ {
1495
+ "$ref": "#/$defs/PublicEvaluationSource"
1496
+ },
1497
+ {
1498
+ "type": "null"
1499
+ }
1500
+ ]
1501
+ },
1502
+ "description": "Evaluations per part of the targeting that served them: live rules in evaluation order, then deleted rules, then fallthrough, off, prerequisite, error, notFound and unknown. A live percentage-rollout rule is always listed, with a count of 0 and no variations when it served nothing in the window, so its rollout check (and rollout.unreached) has a row."
1503
+ }
1504
+ },
1505
+ "description": "What a flag served in one environment over the window, returned by\n`GET .../flags/{flag}/environments/{env}/evaluations` (#4225). These are evaluation\ncounts, not unique users. They come from SDK-reported events, so an environment whose SDKs\nreport none reads zero: no evaluations reported, not necessarily no traffic. The public\ncounterpart of FlagEvaluationAnalyticsDto, keyed by environment key instead of\nid and without the dashboard's daily series."
1506
+ },
1252
1507
  "PublicFlagListItem": {
1253
1508
  "type": [
1254
1509
  "object",
@@ -1659,6 +1914,33 @@ declare const _default: {
1659
1914
  },
1660
1915
  "description": "Public detail representation of a feature flag, returned by\n`GET .../flags/{flag}` and the body of a successful create. Drops internal/dashboard-only\nfields present on FeatureFlagDto — notably `ProjectId` (implicit in the\nroute) and `Staleness` (an internal analytics signal, not part of the public contract).\nEffectiveExpiresAtUtc is when the flag counts as past expiry, from its own ExpiresAtUtc\nor its project's default lifetime; ExpirySource says which (`explicit` / `project-default`),\nboth null when neither applies."
1661
1916
  },
1917
+ "PublicPlanLimit": {
1918
+ "type": [
1919
+ "object",
1920
+ "null"
1921
+ ],
1922
+ "properties": {
1923
+ "resource": {
1924
+ "type": [
1925
+ "string",
1926
+ "null"
1927
+ ]
1928
+ },
1929
+ "plan": {
1930
+ "type": [
1931
+ "string",
1932
+ "null"
1933
+ ]
1934
+ },
1935
+ "max": {
1936
+ "type": [
1937
+ "integer",
1938
+ "null"
1939
+ ]
1940
+ }
1941
+ },
1942
+ "description": "The cap behind a `plan_limit_reached` error. `resource` is the capped collection\n(`projects`, `environments`, `flags`, `webhooks`, `members`);\n`plan` is the plan's wire name, as `GET /api/v1/orgs/{org}` returns it; `max` is\nthe cap. The environment and flag caps are per project."
1943
+ },
1662
1944
  "PublicPrerequisiteDto": {
1663
1945
  "type": [
1664
1946
  "object",
@@ -1726,6 +2008,107 @@ declare const _default: {
1726
2008
  },
1727
2009
  "description": "Request body for `PUT .../rules/reorder`. Must include every existing rule id exactly\nonce — `ReorderTargetingRulesCommandHandler` rejects duplicate, omitted, or unknown rule\nids with `BadRequestException`, surfaced as an HTTP 400 `bad_request` envelope\ncarrying the handler's message."
1728
2010
  },
2011
+ "PublicRolloutCheck": {
2012
+ "type": [
2013
+ "object",
2014
+ "null"
2015
+ ],
2016
+ "properties": {
2017
+ "configured": {
2018
+ "type": [
2019
+ "array",
2020
+ "null"
2021
+ ],
2022
+ "items": {
2023
+ "anyOf": [
2024
+ {
2025
+ "$ref": "#/$defs/PublicConfiguredWeight"
2026
+ },
2027
+ {
2028
+ "type": "null"
2029
+ }
2030
+ ]
2031
+ },
2032
+ "description": "The configured weights, in percent; they sum to 100."
2033
+ },
2034
+ "splitChangedAtUtc": {
2035
+ "type": [
2036
+ "string",
2037
+ "null"
2038
+ ],
2039
+ "description": "The last time the split may have changed (the rule was edited, or a variation was added), or null if it hasn't since the rule was created. A change inside the window mixes two splits."
2040
+ },
2041
+ "evaluable": {
2042
+ "type": [
2043
+ "boolean",
2044
+ "null"
2045
+ ],
2046
+ "description": "Whether the check could run. See NotEvaluableReason when false."
2047
+ },
2048
+ "pValue": {
2049
+ "type": [
2050
+ "number",
2051
+ "null"
2052
+ ],
2053
+ "description": "The sample-ratio test's p-value, or null when not evaluable."
2054
+ },
2055
+ "flagged": {
2056
+ "type": [
2057
+ "boolean",
2058
+ "null"
2059
+ ],
2060
+ "description": "True only when the served split is both unlikely under the configured weights (p < 0.001) and at least 2 percentage points off for some variation."
2061
+ },
2062
+ "notEvaluableReason": {
2063
+ "type": [
2064
+ "string",
2065
+ "null"
2066
+ ],
2067
+ "description": "too-little-traffic or unexpected-variation when the check couldn't run; null otherwise. Allowed values: too-little-traffic, unexpected-variation."
2068
+ },
2069
+ "bucketBy": {
2070
+ "type": [
2071
+ "string",
2072
+ "null"
2073
+ ],
2074
+ "description": "The context attribute the rollout hashes on. A context without it skips the rule, even at 100%."
2075
+ },
2076
+ "unreached": {
2077
+ "anyOf": [
2078
+ {
2079
+ "$ref": "#/$defs/PublicRolloutUnreached"
2080
+ },
2081
+ {
2082
+ "type": "null"
2083
+ }
2084
+ ]
2085
+ }
2086
+ },
2087
+ "description": "A percentage-rollout rule's configured split beside a sample-ratio check of what it served."
2088
+ },
2089
+ "PublicRolloutUnreached": {
2090
+ "type": [
2091
+ "object",
2092
+ "null"
2093
+ ],
2094
+ "properties": {
2095
+ "eligibleEvaluations": {
2096
+ "type": [
2097
+ "integer",
2098
+ "null"
2099
+ ],
2100
+ "description": "Evaluations that reached the flag's rules or fallthrough since SinceUtc, while this rule served none."
2101
+ },
2102
+ "sinceUtc": {
2103
+ "type": [
2104
+ "string",
2105
+ "null"
2106
+ ],
2107
+ "description": "The window start, or the first UTC midnight after the rule last changed when that is later."
2108
+ }
2109
+ },
2110
+ "description": "A live rollout rule that no evaluations reached."
2111
+ },
1729
2112
  "PublicRotateWebhookSecretResponse": {
1730
2113
  "type": [
1731
2114
  "object",
@@ -2192,6 +2575,13 @@ declare const _default: {
2192
2575
  "null"
2193
2576
  ]
2194
2577
  },
2578
+ "bucketBy": {
2579
+ "type": [
2580
+ "string",
2581
+ "null"
2582
+ ],
2583
+ "description": "Context attribute the rollout hashes on (default `user_id`; `userId` is accepted as an alias). A context without it skips this rule, even at 100%. Lookup is exact and case-sensitive, except `user_id`/`userId`, which both read the user id."
2584
+ },
2195
2585
  "userSegmentId": {
2196
2586
  "type": [
2197
2587
  "string",
@@ -2498,6 +2888,13 @@ declare const _default: {
2498
2888
  }
2499
2889
  ]
2500
2890
  }
2891
+ },
2892
+ "bucketBy": {
2893
+ "type": [
2894
+ "string",
2895
+ "null"
2896
+ ],
2897
+ "description": "Context attribute the rollout hashes on (default `user_id`; `userId` is accepted as an alias). Omit to keep the current value. A fixed rule (no `rolloutPercentage`) never hashes and always stores `user_id`, so one made a rollout without `bucketBy` gets `user_id`. A context without it skips this rule, even at 100%. Changing it reshuffles who is in the rollout."
2501
2898
  }
2502
2899
  },
2503
2900
  "description": "Request body for `PUT .../rules/{ruleId}`. Same shape as\nPublicCreateTargetingRuleRequest — see its remarks on operator\nvalidation/canonicalization, which applies identically here."
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { o as ApiError, s as FeatureflipApi, c as PKG_VERSION, a as createServer, r as loadConfig, t as resolveOrg } from "./org-DFNWkYpr.js";
1
+ export { o as ApiError, s as FeatureflipApi, c as PKG_VERSION, a as createServer, r as loadConfig, t as resolveOrg } from "./org-DBlVdsb4.js";