@featureflip/mcp 0.6.0 → 0.7.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/dist/cli.mjs +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/generated/api-types.d.ts +395 -38
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/generated/output-schemas.json.d.ts +83 -17
- package/dist/index.mjs +1 -1
- package/dist/{org-euupmplU.js → org-CRuyqCqx.js} +246 -178
- package/dist/tools/environments.d.ts.map +1 -1
- package/dist/tools/flag-environments.d.ts.map +1 -1
- package/dist/tools/flags.d.ts.map +1 -1
- package/dist/tools/params.d.ts +1 -0
- package/dist/tools/params.d.ts.map +1 -1
- package/dist/tools/sdk-keys.d.ts.map +1 -1
- package/dist/tools/segments.d.ts.map +1 -1
- package/dist/tools/targeting.d.ts.map +1 -1
- package/dist/tools/variations.d.ts.map +1 -1
- package/dist/tools/webhooks.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import * as n from "zod/v4";
|
|
|
3
3
|
// src/version.ts
|
|
4
4
|
var r = {
|
|
5
5
|
name: "@featureflip/mcp",
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.7.0",
|
|
7
7
|
mcpName: "io.github.canopy-labs/featureflip",
|
|
8
8
|
description: "MCP server for managing Featureflip feature flags from AI agents and editors",
|
|
9
9
|
keywords: [
|
|
@@ -95,7 +95,7 @@ var s = /* @__PURE__ */ new Set([
|
|
|
95
95
|
Authorization: `Bearer ${this.opts.token}`,
|
|
96
96
|
Accept: "application/json"
|
|
97
97
|
}, u;
|
|
98
|
-
n.body !== void 0 && (o["Content-Type"] = "application/json", u = JSON.stringify(n.body)), n.idempotencyKey && (o["Idempotency-Key"] = n.idempotencyKey), n.ifMatch && (o["If-Match"] = a(n.ifMatch));
|
|
98
|
+
n.body !== void 0 && (o["Content-Type"] = "application/json", u = JSON.stringify(n.body)), n.idempotencyKey && (o["Idempotency-Key"] = n.idempotencyKey), n.ifMatch && (o["If-Match"] = a(n.ifMatch)), n.reason?.trim() && (o["X-Intent-Reason"] = encodeURIComponent(n.reason));
|
|
99
99
|
let d = c.has(e) && !n.ifMatch || n.idempotencyKey !== void 0, f;
|
|
100
100
|
for (let t = 0;; t++) {
|
|
101
101
|
let n = t < l.length;
|
|
@@ -150,7 +150,7 @@ function d(e) {
|
|
|
150
150
|
function f(e) {
|
|
151
151
|
if (e instanceof i) {
|
|
152
152
|
let t = e.envelope, n = [`Featureflip API error ${e.status} (${t.error}): ${t.message}`];
|
|
153
|
-
return t.fields && n.push(`Field errors: ${JSON.stringify(t.fields)}`), t.did_you_mean?.length && n.push(`Did you mean: ${t.did_you_mean.join(", ")}`), t.next_actions?.length && n.push(`Next actions: ${t.next_actions.map((e) => `${e.method} ${e.path}`).join("; ")}`), t.retry_after != null && n.push(`Rate limited — retry after ${t.retry_after}s.`), e.status === 404 && n.push("Note: 404 can also mean the public Management API is not enabled for this organization yet, or a service token does not include this project."), e.status === 412 && n.push("The resource changed since it was read. If you passed ifMatch, re-read it (get_flag / get_targeting / get_segment), re-apply your change to what you read, and retry with the new etag. Otherwise the tool read it itself and lost a race: call it again."), t.docs_url && n.push(`Docs: ${t.docs_url}`), {
|
|
153
|
+
return t.fields && n.push(`Field errors: ${JSON.stringify(t.fields)}`), t.did_you_mean?.length && n.push(`Did you mean: ${t.did_you_mean.join(", ")}`), t.next_actions?.length && n.push(`Next actions: ${t.next_actions.map((e) => `${e.method} ${e.path}`).join("; ")}`), t.retry_after != null && n.push(`Rate limited — retry after ${t.retry_after}s.`), e.status === 404 && n.push("Note: 404 can also mean the public Management API is not enabled for this organization yet, or a service token does not include this project."), e.status === 412 && n.push("The resource changed since it was read. If you passed ifMatch, re-read it (get_flag / get_targeting / get_segment), re-apply your change to what you read, and retry with the new etag. Otherwise the tool read it itself and lost a race: call it again."), t.error === "change_reason_required" && n.push("Retry this tool call with the `reason` argument explaining why you are making the change."), t.docs_url && n.push(`Docs: ${t.docs_url}`), {
|
|
154
154
|
content: [{
|
|
155
155
|
type: "text",
|
|
156
156
|
text: n.join("\n")
|
|
@@ -208,7 +208,7 @@ var m = {
|
|
|
208
208
|
"POST /api/v1/orgs/{org}/webhooks/{id}/test": "PublicTestWebhookSubscriptionResponse",
|
|
209
209
|
"GET /api/v1/orgs/{org}/webhooks/{id}/deliveries": "PublicWebhookDeliveryResponsePagedResult"
|
|
210
210
|
},
|
|
211
|
-
$defs: /* @__PURE__ */ JSON.parse("{\"ActionCapability\":{\"type\":[\"object\",\"null\"],\"properties\":{\"allowed\":{\"type\":[\"boolean\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One entry in a resource's `_actions` block: may the caller perform it, and if not, why.\"},\"MeResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"type\":{\"type\":[\"string\",\"null\"]},\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"emailVerified\":{\"type\":[\"boolean\",\"null\"]},\"organizationId\":{\"type\":[\"string\",\"null\"]},\"role\":{\"type\":[\"string\",\"null\"]},\"projectScope\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"The authenticated caller's identity, returned by `GET /api/v1/me`. The public API\\nauthenticates two kinds of principal, so this is a `type`-discriminated shape.\\nA `\\\"user\\\"` caller (a session/JWT user or a personal access token, `ffp_...`) carries\\n`email` + `emailVerified`. A `\\\"service_token\\\"` caller (`ffs_...`) has no\\nbacking user row, so it carries `organizationId` + `role` + `projectScope` (the\\ntoken's org, its role in that org, and its project allowlist) instead. The type-inapplicable\\nfields are omitted from the response body. `projectScope` is omitted for an unrestricted\\nservice token (access to every project), never an empty list.\"},\"NextAction\":{\"type\":[\"object\",\"null\"],\"properties\":{\"method\":{\"type\":[\"string\",\"null\"]},\"path\":{\"type\":[\"string\",\"null\"]}}},\"OrganizationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"slug\":{\"type\":[\"string\",\"null\"]},\"plan\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Solo, Team, Pro, Business, Enterprise.\"},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public representation of an organization, returned by both `GET /api/v1/orgs` (list) and\\n`GET /api/v1/orgs/{org}` (detail). Drops dashboard-only fields (`BillingEmail` is\\nbilling-contact PII, `UpdatedAt` is dashboard audit trivia) from the dashboard's\\nOrganizationDto/OrganizationListItemDto.\"},\"OrganizationResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/OrganizationResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"ProjectResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"defaultFlagLifetimeDays\":{\"type\":[\"integer\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a project, returned by `GET /api/v1/orgs/{org}/projects` (list),\\n`GET .../projects/{project}` (detail), and the body of a successful create/update. Drops\\nthe dashboard-only nested `Environments` collection from ProjectDto — the\\npublic API surfaces environments via their own endpoint (Task 6), not embedded here.\\nUpdatedAt is only populated from ProjectDto (the detail/create\\nshape); ProjectListItemDto doesn't carry it, so list rows leave it `null`.\\nDefaultFlagLifetimeDays is the project's default flag lifetime in days, or null (#3194).\"},\"ProjectResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/ProjectResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicAddVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations`. Named distinctly\\nfrom the dashboard's own `AddVariationRequest` —\\nsee PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicApiErrorEnvelope\":{\"type\":[\"object\",\"null\"],\"properties\":{\"error\":{\"type\":[\"string\",\"null\"]},\"message\":{\"type\":[\"string\",\"null\"]},\"docs_url\":{\"type\":[\"string\",\"null\"]},\"fields\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"retry_after\":{\"type\":[\"integer\",\"null\"]},\"did_you_mean\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"next_actions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/NextAction\"},{\"type\":\"null\"}]}},\"connection_id\":{\"type\":[\"string\",\"null\"]},\"plan_limit\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPlanLimit\"},{\"type\":\"null\"}]}},\"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`.\"},\"PublicConditionGroupRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request-side condition group, symmetric with PublicConditionGroupResponse.\"},\"PublicConditionGroupResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionResponse\"},{\"type\":\"null\"}]}}},\"description\":\"A condition group within a PublicTargetingRuleResponse. Maps 1:1 onto\\nConditionGroupDto. Operator is a bare wire string naming one of\\nthe `ConditionGroupOperator` members (`\\\"And\\\"`/`\\\"Or\\\"`) —\\ngroups are ANDed together at the rule level; within a group, its conditions combine using\\nthis operator.\"},\"PublicConditionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request-side condition, symmetric with PublicConditionResponse.\"},\"PublicConditionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"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\\\"`).\"},\"PublicConfiguredWeight\":{\"type\":[\"object\",\"null\"],\"properties\":{\"variationKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's key.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's name, or null when the key no longer matches one of the flag's variations.\"},\"weight\":{\"type\":[\"integer\",\"null\"],\"description\":\"Percent of the rule's traffic.\"}},\"description\":\"A variation's configured share of a rollout rule.\"},\"PublicCreateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments`. Named\\ndistinctly from the dashboard's own `CreateEnvironmentRequest`\\n— both controllers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"initialVariations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateVariationDto\"},{\"type\":\"null\"}]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"ownerEmail\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/flags`. Named distinctly\\nfrom the dashboard's own `CreateFeatureFlagRequest`\\n— see PublicCreateEnvironmentRequest for the\\nschemaId-collision rationale (both controllers share one Swagger document). Type\\nis passed through verbatim to Type, which itself takes a\\nbare string (Boolean/String/Number/Json) rather than the domain enum — invalid values surface\\nas the handler's own validation failure, not a controller-level 400. ExpiresAtUtc is\\noptional and advisory; a bare date (`2026-12-01`) means the end of that day in UTC, and a full\\ntimestamp is stored exactly. It must be in the future and requires the flag-expiration feature\\n(400 `EXPIRY_IN_PAST` / `FEATURE_NOT_ENABLED`). OwnerEmail optionally names\\nthe owner (an active member, matched case-insensitively; requires the flag-ownership feature —\\n400 `OWNER_NOT_MEMBER` / `FEATURE_NOT_ENABLED`). Omitted, the owner is the caller when\\nthe caller is a member, so a service token creates an unowned flag. IsPermanent marks\\nthe flag permanent (a kill switch, ops toggle or entitlement that is meant to stay; never reported for\\ncleanup). It requires the flag-permanence feature and can't be combined with ExpiresAtUtc\\n(400 `FEATURE_NOT_ENABLED` / `PERMANENT_FLAG_HAS_EXPIRY`).\"},\"PublicCreateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects`. Named distinctly from the\\ndashboard's own `CreateProjectRequest` — both\\ncontrollers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys`.\\nType is a bare string (\\\"ClientSide\\\" or \\\"ServerSide\\\") — the controller parses it\\nagainst a NAME allowlist (not a bare TryParse``1(ReadOnlySpan{Char},Boolean,``0@), which would\\nsilently accept a numeric string like `\\\"0\\\"`) before dispatching. Named distinctly from\\nthe dashboard's own `CreateSdkKeyRequest` — both\\ncontrollers share one Swagger document, and an identical type name in either namespace throws\\na schemaId collision at `--export-openapi` time.\"},\"PublicCreateSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"name\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Response body for a successful `POST .../sdk-keys`. The ONLY place the plaintext\\nKey is ever returned — PublicSdkKeyResponse (list/get) carries just\\n`LastFourCharacters`. Built directly from CreateSdkKeyResult rather than a\\nre-fetch (unlike `FeatureFlagsController.Create`'s re-fetch pattern) because the\\nplaintext key only ever exists on the create result — a subsequent\\nGetSdkKeyQuery can't recover it.\"},\"PublicCreateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/segments`. Named distinctly\\nfrom the dashboard's own `CreateUserSegmentRequest` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicCreateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"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`.\"}},\"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.\"},\"PublicCreateVariationDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A variation supplied at flag-creation time. Maps 1:1 onto\\nCreateVariationDto.\"},\"PublicCreateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp, Slack.\"},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"Creates a webhook subscription. `provider` is `GenericHttp`. Omit `eventTypes`,\\n`projectIds` or `environmentIds` (or send an empty list) to receive every event,\\nproject or environment. A token restricted to specific projects must list at least one project,\\nall of them within its allowlist.\"},\"PublicCreateWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The created subscription's id and its signing secret. The secret is shown only here.\"},\"PublicDefaultFlagLifetimeImpact\":{\"type\":[\"object\",\"null\"],\"properties\":{\"newlyPastExpiry\":{\"type\":[\"integer\",\"null\"]},\"noLongerPastExpiry\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Response of `GET .../default-flag-lifetime/impact`: how many temporary flags with no expiry\\ndate of their own would newly be past expiry, and how many would stop being past it.\"},\"PublicEnvironmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an environment, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments` (list),\\n`GET .../environments/{env}` (detail), and the body of a successful create/update. Drops\\ninternal fields (e.g. `ProjectId` is implicit in the route) — mirrors\\n`ProjectResponse`'s minimal shape. Named `PublicEnvironmentResponse` rather than\\n`EnvironmentResponse` (unlike the sibling `ProjectResponse`, which didn't collide)\\nbecause the dashboard already has its own\\n`EnvironmentResponse` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale.\"},\"PublicEnvironmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEnvironmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicEvaluationSource\":{\"type\":[\"object\",\"null\"],\"properties\":{\"source\":{\"type\":[\"string\",\"null\"],\"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.\"},\"ruleId\":{\"type\":[\"string\",\"null\"],\"description\":\"For a rule, its id (rules have no key). Null otherwise, or when the SDK didn't say which rule.\"},\"ruleLabel\":{\"type\":[\"string\",\"null\"],\"description\":\"For a live rule, its description or a generated label. Null otherwise.\"},\"ruleExists\":{\"type\":[\"boolean\",\"null\"],\"description\":\"False when the rule is no longer in the environment's targeting.\"},\"count\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations this source served.\"},\"share\":{\"type\":[\"number\",\"null\"],\"description\":\"Count as a fraction (0 to 1) of all sources' counts combined.\"},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationVariation\"},{\"type\":\"null\"}]},\"description\":\"What this source served, with shares of this source's count.\"},\"rollout\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicRolloutCheck\"},{\"type\":\"null\"}]}},\"description\":\"The evaluations one part of the targeting served.\"},\"PublicEvaluationVariation\":{\"type\":[\"object\",\"null\"],\"properties\":{\"variationKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation served, or null for evaluations recorded without one.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's name, or null when the key no longer matches one of the flag's variations.\"},\"exists\":{\"type\":[\"boolean\",\"null\"],\"description\":\"False when the key no longer matches one of the flag's variations.\"},\"count\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations that served this variation.\"},\"share\":{\"type\":[\"number\",\"null\"],\"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.\"}},\"description\":\"One variation's evaluations.\"},\"PublicFlagEnvConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"environmentId\":{\"type\":[\"string\",\"null\"]},\"environmentKey\":{\"type\":[\"string\",\"null\"]},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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).\"},\"PublicFlagEvaluationsResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"environmentKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's key.\"},\"days\":{\"type\":[\"integer\",\"null\"],\"description\":\"The window requested: 7, 30 or 90.\"},\"fromUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"Start of the window: UTC midnight `days - 1` days ago, or the flag's creation day if later.\"},\"toUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"When the counts were read.\"},\"totalCount\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations in the window. Evaluation counts, not unique users.\"},\"lastEvaluatedAtUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"The last reported evaluation, or null if none was reported.\"},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationVariation\"},{\"type\":\"null\"}]},\"description\":\"Evaluations per variation over the window.\"},\"sources\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationSource\"},{\"type\":\"null\"}]},\"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.\"}},\"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.\"},\"PublicFlagListItem\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public list-item representation of a feature flag, returned by\\n`GET .../flags`. Narrower than PublicFlagResponse — drops\\nVariations (a summary-only shape upstream) and\\nStaleness, matching the \\\"list is narrower than detail\\\"\\nsplit already present on the Application-layer DTOs.\\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.\"},\"PublicFlagListItemPagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagListItem\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicFlagOwner\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A flag's owner as returned on flag reads. Null means the flag is unowned.\"},\"PublicFlagRemovalCandidate\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]},\"treatment\":{\"type\":[\"boolean\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"]},\"blockedBy\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"One dead flag the Featureflip Flag Cleanup Action should remove, returned by\\n`GET .../flags/removal-candidates`. `Treatment` is the kill decision: true → keep the\\nflag's on-branch, false → keep the off-branch. `Status` is the flag's staleness tier\\n(`\\\"Stale\\\"` or `\\\"Dead\\\"`, never `\\\"Active\\\"`) — lets a caller distinguish the two when\\n`?staleness=stale` widens the response to include both tiers. This is the ONLY public\\nprojection of staleness — PublicFlagResponse and PublicFlagListItem\\nstill omit it by design. `BlockedBy` names the live flags that still list this one as a\\nprerequisite, sorted by key; while it is non-empty the flag cannot be archived\\n(`FLAG_HAS_DEPENDENTS`), so a caller should remove those dependents first.\"},\"PublicFlagRemovalCandidatePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagRemovalCandidate\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"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`).\"},\"PublicFlagResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicVariationResponse\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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.\"},\"PublicPlanLimit\":{\"type\":[\"object\",\"null\"],\"properties\":{\"resource\":{\"type\":[\"string\",\"null\"]},\"plan\":{\"type\":[\"string\",\"null\"]},\"max\":{\"type\":[\"integer\",\"null\"]}},\"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.\"},\"PublicPrerequisiteDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"prerequisiteFlagKey\":{\"type\":[\"string\",\"null\"]},\"expectedVariationKey\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A single prerequisite entry on a flag's per-environment config. Maps 1:1 onto\\nPrerequisiteDto (read side) and PrerequisiteInput (write side).\"},\"PublicPutTargetingRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateTargetingRuleRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../targeting` — a declarative full replace of the environment's\\nordered targeting rule set. Rules are applied in array order (index = priority, so the array\\norder IS the evaluation order). Rules is nullable so that an OMITTED `rules`\\nfield (a body of `{}`) binds successfully instead of failing ASP.NET Core's implicit\\nrequired-property check on non-nullable reference types — both an omitted `rules` field\\nand an explicit empty list (`{ \\\"rules\\\": [] }`) clear all targeting rules for the\\nenvironment. Each element is a PublicCreateTargetingRuleRequest (identical to the\\n`POST .../rules` body), so `UserSegmentId` is supported — segment-scoped rules can be\\nsubmitted through this endpoint. The replace is atomic (all-or-nothing): the whole rule set is\\nswapped in one transaction, or nothing changes.\"},\"PublicReorderRulesRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"ruleIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"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.\"},\"PublicRolloutCheck\":{\"type\":[\"object\",\"null\"],\"properties\":{\"configured\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConfiguredWeight\"},{\"type\":\"null\"}]},\"description\":\"The configured weights, in percent; they sum to 100.\"},\"splitChangedAtUtc\":{\"type\":[\"string\",\"null\"],\"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.\"},\"evaluable\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Whether the check could run. See NotEvaluableReason when false.\"},\"pValue\":{\"type\":[\"number\",\"null\"],\"description\":\"The sample-ratio test's p-value, or null when not evaluable.\"},\"flagged\":{\"type\":[\"boolean\",\"null\"],\"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.\"},\"notEvaluableReason\":{\"type\":[\"string\",\"null\"],\"description\":\"too-little-traffic or unexpected-variation when the check couldn't run; null otherwise. Allowed values: too-little-traffic, unexpected-variation.\"},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"description\":\"The context attribute the rollout hashes on. A context without it skips the rule, even at 100%.\"},\"unreached\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicRolloutUnreached\"},{\"type\":\"null\"}]}},\"description\":\"A percentage-rollout rule's configured split beside a sample-ratio check of what it served.\"},\"PublicRolloutUnreached\":{\"type\":[\"object\",\"null\"],\"properties\":{\"eligibleEvaluations\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations that reached the flag's rules or fallthrough since SinceUtc, while this rule served none.\"},\"sinceUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"The window start, or the first UTC midnight after the rule last changed when that is later.\"}},\"description\":\"A live rollout rule that no evaluations reached.\"},\"PublicRotateWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"secretId\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A newly added signing secret. The secret is shown only here.\"},\"PublicSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"lastUsedAt\":{\"type\":[\"string\",\"null\"]},\"revokedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an SDK key, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys` (list) and\\n`GET .../sdk-keys/{sdkKey}` (detail). Deliberately narrower than\\nSdkKeyDto — drops `RevokedBy` (an internal user id) and\\n`EnvironmentId` (implicit in the route), and carries no plaintext key field: only\\nLastFourCharacters is ever exposed once the key has been created. The plaintext\\nkey is a one-time value that appears solely in PublicCreateSdkKeyResponse.\"},\"PublicSdkKeyResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSdkKeyResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicSegmentConditionDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"A single targeting condition on a segment, used both as input (create/update) and output\\n(Conditions). Operator is a bare string on\\nboth sides of the wire — on write it's parsed to\\nOperatorType by `SegmentsController` (an unknown\\nvalue fails closed with a 400, never silently dropped or defaulted); on read it's mapped\\nstraight through from Operator, which is already a string.\"},\"PublicSegmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a user segment, returned by `GET .../segments`,\\n`GET .../segments/{segment}`, and the body of a successful create.\"},\"PublicSegmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicSetDefaultFlagLifetimeRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"days\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/default-flag-lifetime`. `days`\\nis 1–3650, or an explicit null to remove the default. `days` is required: a body without it\\n(`{}`, or a misspelled field) is a `validation_failed` 400, never a removal, so a typo\\ncan't silently wipe the setting (#3788). A request with no body is rejected too.\"},\"PublicSetFlagExpiryRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/expiry`. Expiry is a\\ndedicated sub-resource, deliberately NOT a field on PublicUpdateFeatureFlagRequest: that\\nPUT is a full replace, so a new nullable field there would let any client that doesn't know about\\nexpiry (the Terraform provider included) wipe it on every update. A bare date means the end of that\\nUTC day; a full timestamp is stored exactly.\"},\"PublicSetFlagOwnerRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"email\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/owner`. A dedicated\\nsub-resource for the same reason as expiry: the main flag PUT is a full replace, so an owner field\\nthere would let every client that doesn't know about owners wipe one. `email` must belong\\nto an active member of the organization (case-insensitive).\"},\"PublicSetFlagRemovalPrRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"url\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/removal-pr`: the\\npull request that removes this flag from code, as opened by the Featureflip Flag Cleanup Action.\\nA dedicated sub-resource for the same reason as expiry and owner. `url` must be an https\\npull request URL (`https://{host}/{owner}/{repo}/pull/{number}`).\"},\"PublicTargetingConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicTargetingRuleResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"The full targeting configuration for a flag in a single environment, returned by\\n`GET .../targeting`. Maps 1:1 onto TargetingConfigurationDto — including\\nits IsEnabled field, which reflects the parent\\n`FlagEnvironmentConfiguration.IsEnabled` (whether the flag is on in this environment at\\nall), not anything specific to targeting itself.\"},\"PublicTargetingRuleResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"priority\":{\"type\":[\"integer\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"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.\"},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single targeting rule, returned by `GET .../rules/{ruleId}`,\\n`POST .../rules` (201 body), and nested within PublicTargetingConfigResponse.\\nMaps 1:1 onto TargetingRuleDto, dropping nothing — every field on the\\nApplication DTO is part of the public contract.\"},\"PublicTestWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"webhookDeliveryId\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The queued test event and its delivery. Poll the delivery log for the outcome.\"},\"PublicToggleFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"enabled\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST .../flags/{flag}/environments/{env}/toggle`. Named distinctly from\\nthe dashboard's own `ToggleFlagInEnvironmentRequest`\\n(which uses `IsEnabled`) — the public field is named Enabled per the phase-3c\\ncontract. Enabled is a NULLABLE `bool?` deliberately: a non-nullable value\\ntype would bind an omitted/empty body to `false` with no validation error (ASP.NET's\\nimplicit-required only covers non-nullable reference types, not value types), silently disabling\\nthe flag. The controller rejects a null Enabled with a `validation_failed` 400\\nso the intent is never ambiguous (#1806).\"},\"PublicUpdateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}`. See\\nPublicCreateEnvironmentRequest for why this is named distinctly from the\\ndashboard's `UpdateEnvironmentRequest`.\"},\"PublicUpdateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}`. See\\nPublicCreateFeatureFlagRequest for why this is named distinctly from the\\ndashboard's `UpdateFeatureFlagRequest`. The flag's key and type are immutable via this\\nendpoint (mirrors `UpdateFeatureFlagCommand`, which has no `Key`/`Type`).\"},\"PublicUpdateFlagEnvConfigRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../flags/{flag}/environments/{env}`. Named distinctly from the\\ndashboard's own `UpdateFlagEnvironmentConfigurationRequest`\\n— see PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document). Strategy is passed through verbatim to\\nStrategy\\n— the existing command validator name-allowlists it (SingleVariation/PercentageRollout/\\nTargetedRollout or null), so an invalid value surfaces as the handler's own 400, not a\\ncontroller-level guard. A null Prerequisites leaves prerequisites untouched; a\\nnon-null list replaces them wholesale (mirrors UpdateFlagPrerequisitesCommand's\\nreplace-all semantics).\"},\"PublicUpdateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}`. See\\nPublicCreateProjectRequest for why this is named distinctly from the\\ndashboard's `UpdateProjectRequest`.\"},\"PublicUpdateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys/{sdkKey}`.\\nType and key material are immutable via this endpoint (mirrors\\nUpdateSdkKeyCommand, which\\ncarries no `Type`).\"},\"PublicUpdateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/segments/{segment}`. The\\nsegment's key is immutable via this endpoint (mirrors `UpdateUserSegmentCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"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.\"}},\"description\":\"Request body for `PUT .../rules/{ruleId}`. Same shape as\\nPublicCreateTargetingRuleRequest — see its remarks on operator\\nvalidation/canonicalization, which applies identically here.\"},\"PublicUpdateVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations/{variationId}`. The\\nvariation's key is immutable via this endpoint (mirrors\\n`UpdateVariationCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Replaces a subscription's configuration (full replace — omitted lists become empty, meaning\\n\\\"all\\\"). `isEnabled` is required. The provider cannot be changed.\"},\"PublicVariationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single variation on a flag, as returned in Variations.\"},\"PublicWebhookDeliveryResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Pending, Succeeded, DeadLettered.\"},\"attemptCount\":{\"type\":[\"integer\",\"null\"]},\"nextAttemptAt\":{\"type\":[\"string\",\"null\"]},\"lastResponseStatusCode\":{\"type\":[\"integer\",\"null\"]},\"lastError\":{\"type\":[\"string\",\"null\"]},\"completedAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One delivery attempt record. `status` is `Pending` (awaiting its first attempt,\\nbacking off, or in flight), `Succeeded` or `DeadLettered`.\"},\"PublicWebhookDeliveryResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookDeliveryResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"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`).\"},\"PublicWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"retiredAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A signing secret's id and lifecycle. A secret with no `retiredAt` is active and signs every delivery.\"},\"PublicWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp, Slack.\"},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"consecutiveFailureCount\":{\"type\":[\"integer\",\"null\"]},\"autoDisabledAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"secrets\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSecretResponse\"},{\"type\":\"null\"}]}},\"overPlanLimit\":{\"type\":[\"boolean\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A webhook subscription. Never carries secret material: signing secrets are listed by id and\\nlifecycle only — the value itself is returned once, when it is created or rotated.\\n`overPlanLimit` is true when the organization has more subscriptions than its plan\\nallows, which happens after a downgrade. The oldest subscriptions up to the limit keep\\ndelivering. The rest receive nothing and cannot be re-enabled, tested or redelivered to until\\nthe plan is upgraded or older subscriptions are deleted.\"},\"PublicWebhookSubscriptionResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSubscriptionResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"}}")
|
|
211
|
+
$defs: /* @__PURE__ */ JSON.parse("{\"ActionCapability\":{\"type\":[\"object\",\"null\"],\"properties\":{\"allowed\":{\"type\":[\"boolean\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One entry in a resource's `_actions` block: may the caller perform it, and if not, why.\"},\"MeResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"type\":{\"type\":[\"string\",\"null\"]},\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"emailVerified\":{\"type\":[\"boolean\",\"null\"]},\"organizationId\":{\"type\":[\"string\",\"null\"]},\"role\":{\"type\":[\"string\",\"null\"]},\"projectScope\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"The authenticated caller's identity, returned by `GET /api/v1/me`. The public API\\nauthenticates two kinds of principal, so this is a `type`-discriminated shape.\\nA `\\\"user\\\"` caller (a session/JWT user or a personal access token, `ffp_...`) carries\\n`email` + `emailVerified`. A `\\\"service_token\\\"` caller (`ffs_...`) has no\\nbacking user row, so it carries `organizationId` + `role` + `projectScope` (the\\ntoken's org, its role in that org, and its project allowlist) instead. The type-inapplicable\\nfields are omitted from the response body. `projectScope` is omitted for an unrestricted\\nservice token (access to every project), never an empty list.\"},\"NextAction\":{\"type\":[\"object\",\"null\"],\"properties\":{\"method\":{\"type\":[\"string\",\"null\"]},\"path\":{\"type\":[\"string\",\"null\"]}}},\"OrganizationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"slug\":{\"type\":[\"string\",\"null\"]},\"plan\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Solo, Team, Pro, Business, Enterprise.\"},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public representation of an organization, returned by both `GET /api/v1/orgs` (list) and\\n`GET /api/v1/orgs/{org}` (detail). Drops dashboard-only fields (`BillingEmail` is\\nbilling-contact PII, `UpdatedAt` is dashboard audit trivia) from the dashboard's\\nOrganizationDto/OrganizationListItemDto.\"},\"OrganizationResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/OrganizationResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"ProjectResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"defaultFlagLifetimeDays\":{\"type\":[\"integer\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a project, returned by `GET /api/v1/orgs/{org}/projects` (list),\\n`GET .../projects/{project}` (detail), and the body of a successful create/update. Drops\\nthe dashboard-only nested `Environments` collection from ProjectDto — the\\npublic API surfaces environments via their own endpoint (Task 6), not embedded here.\\nUpdatedAt is only populated from ProjectDto (the detail/create\\nshape); ProjectListItemDto doesn't carry it, so list rows leave it `null`.\\nDefaultFlagLifetimeDays is the project's default flag lifetime in days, or null (#3194).\"},\"ProjectResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/ProjectResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicAddVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations`. Named distinctly\\nfrom the dashboard's own `AddVariationRequest` —\\nsee PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicApiErrorEnvelope\":{\"type\":[\"object\",\"null\"],\"properties\":{\"error\":{\"type\":[\"string\",\"null\"]},\"message\":{\"type\":[\"string\",\"null\"]},\"docs_url\":{\"type\":[\"string\",\"null\"]},\"fields\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"retry_after\":{\"type\":[\"integer\",\"null\"]},\"did_you_mean\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"next_actions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/NextAction\"},{\"type\":\"null\"}]}},\"connection_id\":{\"type\":[\"string\",\"null\"]},\"plan_limit\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPlanLimit\"},{\"type\":\"null\"}]}},\"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`.\"},\"PublicConditionGroupRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request-side condition group, symmetric with PublicConditionGroupResponse.\"},\"PublicConditionGroupResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionResponse\"},{\"type\":\"null\"}]}}},\"description\":\"A condition group within a PublicTargetingRuleResponse. Maps 1:1 onto\\nConditionGroupDto. Operator is a bare wire string naming one of\\nthe `ConditionGroupOperator` members (`\\\"And\\\"`/`\\\"Or\\\"`) —\\ngroups are ANDed together at the rule level; within a group, its conditions combine using\\nthis operator.\"},\"PublicConditionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request-side condition, symmetric with PublicConditionResponse.\"},\"PublicConditionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"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\\\"`).\"},\"PublicConfiguredWeight\":{\"type\":[\"object\",\"null\"],\"properties\":{\"variationKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's key.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's name, or null when the key no longer matches one of the flag's variations.\"},\"weight\":{\"type\":[\"integer\",\"null\"],\"description\":\"Percent of the rule's traffic.\"}},\"description\":\"A variation's configured share of a rollout rule.\"},\"PublicCreateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's key.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's display name.\"},\"color\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's display color, or null.\"},\"sortOrder\":{\"type\":[\"integer\",\"null\"],\"description\":\"Position among the project's environments.\"},\"requireChangeReason\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Require a change reason (X-Intent-Reason) on every change to flags in this environment. Business plan and above.\"},\"requireConfirmation\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Ask dashboard users to type the environment key before a change lands. Dashboard only; not enforced by the API.\"}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments`. Named\\ndistinctly from the dashboard's own `CreateEnvironmentRequest`\\n— both controllers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"initialVariations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateVariationDto\"},{\"type\":\"null\"}]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"ownerEmail\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/flags`. Named distinctly\\nfrom the dashboard's own `CreateFeatureFlagRequest`\\n— see PublicCreateEnvironmentRequest for the\\nschemaId-collision rationale (both controllers share one Swagger document). Type\\nis passed through verbatim to Type, which itself takes a\\nbare string (Boolean/String/Number/Json) rather than the domain enum — invalid values surface\\nas the handler's own validation failure, not a controller-level 400. ExpiresAtUtc is\\noptional and advisory; a bare date (`2026-12-01`) means the end of that day in UTC, and a full\\ntimestamp is stored exactly. It must be in the future and requires the flag-expiration feature\\n(400 `EXPIRY_IN_PAST` / `FEATURE_NOT_ENABLED`). OwnerEmail optionally names\\nthe owner (an active member, matched case-insensitively; requires a plan that includes flag owners,\\nPro and above — 400 `OWNER_NOT_MEMBER` / `PLAN_FEATURE_UNAVAILABLE`). Omitted, the owner is the caller when\\nthe caller is a member, so a service token creates an unowned flag. IsPermanent marks\\nthe flag permanent (a kill switch, ops toggle or entitlement that is meant to stay; never reported for\\ncleanup). It requires the flag-permanence feature and can't be combined with ExpiresAtUtc\\n(400 `FEATURE_NOT_ENABLED` / `PERMANENT_FLAG_HAS_EXPIRY`).\"},\"PublicCreateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects`. Named distinctly from the\\ndashboard's own `CreateProjectRequest` — both\\ncontrollers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys`.\\nType is a bare string (\\\"ClientSide\\\" or \\\"ServerSide\\\") — the controller parses it\\nagainst a NAME allowlist (not a bare TryParse``1(ReadOnlySpan{Char},Boolean,``0@), which would\\nsilently accept a numeric string like `\\\"0\\\"`) before dispatching. Named distinctly from\\nthe dashboard's own `CreateSdkKeyRequest` — both\\ncontrollers share one Swagger document, and an identical type name in either namespace throws\\na schemaId collision at `--export-openapi` time.\"},\"PublicCreateSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"name\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Response body for a successful `POST .../sdk-keys`. The ONLY place the plaintext\\nKey is ever returned — PublicSdkKeyResponse (list/get) carries just\\n`LastFourCharacters`. Built directly from CreateSdkKeyResult rather than a\\nre-fetch (unlike `FeatureFlagsController.Create`'s re-fetch pattern) because the\\nplaintext key only ever exists on the create result — a subsequent\\nGetSdkKeyQuery can't recover it.\"},\"PublicCreateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/segments`. Named distinctly\\nfrom the dashboard's own `CreateUserSegmentRequest` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicCreateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"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`.\"}},\"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.\"},\"PublicCreateVariationDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A variation supplied at flag-creation time. Maps 1:1 onto\\nCreateVariationDto.\"},\"PublicCreateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp, Slack, Datadog, Grafana.\"},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"credential\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Creates a webhook subscription. `provider` is `GenericHttp`, `Slack` (an incoming\\nwebhook url), `Datadog` (your site's Events API url) or `Grafana` (your Grafana's\\n`/api/annotations` url). Datadog and Grafana also need `credential`: a Datadog API key\\nor a Grafana service account token. It is stored encrypted and never returned. Omit `eventTypes`,\\n`projectIds` or `environmentIds` (or send an empty list) to receive every event,\\nproject or environment. A token restricted to specific projects must list at least one project,\\nall of them within its allowlist.\"},\"PublicCreateWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The created subscription's id and its signing secret. The secret is shown only here.\"},\"PublicDefaultFlagLifetimeImpact\":{\"type\":[\"object\",\"null\"],\"properties\":{\"newlyPastExpiry\":{\"type\":[\"integer\",\"null\"]},\"noLongerPastExpiry\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Response of `GET .../default-flag-lifetime/impact`: how many temporary flags with no expiry\\ndate of their own would newly be past expiry, and how many would stop being past it.\"},\"PublicEnvironmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's id.\"},\"key\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's key.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's display name.\"},\"color\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's display color, or null.\"},\"sortOrder\":{\"type\":[\"integer\",\"null\"],\"description\":\"Position among the project's environments.\"},\"requireChangeReason\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Require a change reason (X-Intent-Reason) on every change to flags in this environment. Business plan and above.\"},\"requireConfirmation\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Ask dashboard users to type the environment key before a change lands. Dashboard only; not enforced by the API.\"},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an environment, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments` (list),\\n`GET .../environments/{env}` (detail), and the body of a successful create/update. Drops\\ninternal fields (e.g. `ProjectId` is implicit in the route) — mirrors\\n`ProjectResponse`'s minimal shape. Named `PublicEnvironmentResponse` rather than\\n`EnvironmentResponse` (unlike the sibling `ProjectResponse`, which didn't collide)\\nbecause the dashboard already has its own\\n`EnvironmentResponse` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale.\"},\"PublicEnvironmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEnvironmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicEvaluationSource\":{\"type\":[\"object\",\"null\"],\"properties\":{\"source\":{\"type\":[\"string\",\"null\"],\"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.\"},\"ruleId\":{\"type\":[\"string\",\"null\"],\"description\":\"For a rule, its id (rules have no key). Null otherwise, or when the SDK didn't say which rule.\"},\"ruleLabel\":{\"type\":[\"string\",\"null\"],\"description\":\"For a live rule, its description or a generated label. Null otherwise.\"},\"ruleExists\":{\"type\":[\"boolean\",\"null\"],\"description\":\"False when the rule is no longer in the environment's targeting.\"},\"count\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations this source served.\"},\"share\":{\"type\":[\"number\",\"null\"],\"description\":\"Count as a fraction (0 to 1) of all sources' counts combined.\"},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationVariation\"},{\"type\":\"null\"}]},\"description\":\"What this source served, with shares of this source's count.\"},\"rollout\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicRolloutCheck\"},{\"type\":\"null\"}]}},\"description\":\"The evaluations one part of the targeting served.\"},\"PublicEvaluationVariation\":{\"type\":[\"object\",\"null\"],\"properties\":{\"variationKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation served, or null for evaluations recorded without one.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's name, or null when the key no longer matches one of the flag's variations.\"},\"exists\":{\"type\":[\"boolean\",\"null\"],\"description\":\"False when the key no longer matches one of the flag's variations.\"},\"count\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations that served this variation.\"},\"share\":{\"type\":[\"number\",\"null\"],\"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.\"}},\"description\":\"One variation's evaluations.\"},\"PublicFlagEnvConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"environmentId\":{\"type\":[\"string\",\"null\"]},\"environmentKey\":{\"type\":[\"string\",\"null\"]},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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).\"},\"PublicFlagEvaluationsResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"environmentKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's key.\"},\"days\":{\"type\":[\"integer\",\"null\"],\"description\":\"The window requested: 7, 30 or 90.\"},\"fromUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"Start of the window: UTC midnight `days - 1` days ago, or the flag's creation day if later.\"},\"toUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"When the counts were read.\"},\"totalCount\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations in the window. Evaluation counts, not unique users.\"},\"lastEvaluatedAtUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"The last reported evaluation, or null if none was reported.\"},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationVariation\"},{\"type\":\"null\"}]},\"description\":\"Evaluations per variation over the window.\"},\"sources\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationSource\"},{\"type\":\"null\"}]},\"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.\"}},\"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.\"},\"PublicFlagListItem\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public list-item representation of a feature flag, returned by\\n`GET .../flags`. Narrower than PublicFlagResponse — drops\\nVariations (a summary-only shape upstream) and\\nStaleness, matching the \\\"list is narrower than detail\\\"\\nsplit already present on the Application-layer DTOs.\\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.\"},\"PublicFlagListItemPagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagListItem\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicFlagOwner\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A flag's owner as returned on flag reads. Null means the flag is unowned.\"},\"PublicFlagRemovalCandidate\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]},\"treatment\":{\"type\":[\"boolean\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"]},\"blockedBy\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"One dead flag the Featureflip Flag Cleanup Action should remove, returned by\\n`GET .../flags/removal-candidates`. `Treatment` is the kill decision: true → keep the\\nflag's on-branch, false → keep the off-branch. `Status` is the flag's staleness tier\\n(`\\\"Stale\\\"` or `\\\"Dead\\\"`, never `\\\"Active\\\"`) — lets a caller distinguish the two when\\n`?staleness=stale` widens the response to include both tiers. This is the ONLY public\\nprojection of staleness — PublicFlagResponse and PublicFlagListItem\\nstill omit it by design. `BlockedBy` names the live flags that still list this one as a\\nprerequisite, sorted by key; while it is non-empty the flag cannot be archived\\n(`FLAG_HAS_DEPENDENTS`), so a caller should remove those dependents first.\"},\"PublicFlagRemovalCandidatePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagRemovalCandidate\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"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`).\"},\"PublicFlagResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicVariationResponse\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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.\"},\"PublicPlanLimit\":{\"type\":[\"object\",\"null\"],\"properties\":{\"resource\":{\"type\":[\"string\",\"null\"]},\"plan\":{\"type\":[\"string\",\"null\"]},\"max\":{\"type\":[\"integer\",\"null\"]}},\"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.\"},\"PublicPrerequisiteDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"prerequisiteFlagKey\":{\"type\":[\"string\",\"null\"]},\"expectedVariationKey\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A single prerequisite entry on a flag's per-environment config. Maps 1:1 onto\\nPrerequisiteDto (read side) and PrerequisiteInput (write side).\"},\"PublicPutTargetingRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateTargetingRuleRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../targeting` — a declarative full replace of the environment's\\nordered targeting rule set. Rules are applied in array order (index = priority, so the array\\norder IS the evaluation order). Rules is nullable so that an OMITTED `rules`\\nfield (a body of `{}`) binds successfully instead of failing ASP.NET Core's implicit\\nrequired-property check on non-nullable reference types — both an omitted `rules` field\\nand an explicit empty list (`{ \\\"rules\\\": [] }`) clear all targeting rules for the\\nenvironment. Each element is a PublicCreateTargetingRuleRequest (identical to the\\n`POST .../rules` body), so `UserSegmentId` is supported — segment-scoped rules can be\\nsubmitted through this endpoint. The replace is atomic (all-or-nothing): the whole rule set is\\nswapped in one transaction, or nothing changes.\"},\"PublicReorderRulesRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"ruleIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"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.\"},\"PublicRolloutCheck\":{\"type\":[\"object\",\"null\"],\"properties\":{\"configured\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConfiguredWeight\"},{\"type\":\"null\"}]},\"description\":\"The configured weights, in percent; they sum to 100.\"},\"splitChangedAtUtc\":{\"type\":[\"string\",\"null\"],\"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.\"},\"evaluable\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Whether the check could run. See NotEvaluableReason when false.\"},\"pValue\":{\"type\":[\"number\",\"null\"],\"description\":\"The sample-ratio test's p-value, or null when not evaluable.\"},\"flagged\":{\"type\":[\"boolean\",\"null\"],\"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.\"},\"notEvaluableReason\":{\"type\":[\"string\",\"null\"],\"description\":\"too-little-traffic or unexpected-variation when the check couldn't run; null otherwise. Allowed values: too-little-traffic, unexpected-variation.\"},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"description\":\"The context attribute the rollout hashes on. A context without it skips the rule, even at 100%.\"},\"unreached\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicRolloutUnreached\"},{\"type\":\"null\"}]}},\"description\":\"A percentage-rollout rule's configured split beside a sample-ratio check of what it served.\"},\"PublicRolloutUnreached\":{\"type\":[\"object\",\"null\"],\"properties\":{\"eligibleEvaluations\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations that reached the flag's rules or fallthrough since SinceUtc, while this rule served none.\"},\"sinceUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"The window start, or the first UTC midnight after the rule last changed when that is later.\"}},\"description\":\"A live rollout rule that no evaluations reached.\"},\"PublicRotateWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"secretId\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A newly added signing secret. The secret is shown only here.\"},\"PublicSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"lastUsedAt\":{\"type\":[\"string\",\"null\"]},\"revokedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an SDK key, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys` (list) and\\n`GET .../sdk-keys/{sdkKey}` (detail). Deliberately narrower than\\nSdkKeyDto — drops `RevokedBy` (an internal user id) and\\n`EnvironmentId` (implicit in the route), and carries no plaintext key field: only\\nLastFourCharacters is ever exposed once the key has been created. The plaintext\\nkey is a one-time value that appears solely in PublicCreateSdkKeyResponse.\"},\"PublicSdkKeyResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSdkKeyResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicSegmentConditionDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"A single targeting condition on a segment, used both as input (create/update) and output\\n(Conditions). Operator is a bare string on\\nboth sides of the wire — on write it's parsed to\\nOperatorType by `SegmentsController` (an unknown\\nvalue fails closed with a 400, never silently dropped or defaulted); on read it's mapped\\nstraight through from Operator, which is already a string.\"},\"PublicSegmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a user segment, returned by `GET .../segments`,\\n`GET .../segments/{segment}`, and the body of a successful create.\"},\"PublicSegmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"},\"PublicSetDefaultFlagLifetimeRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"days\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/default-flag-lifetime`. `days`\\nis 1–3650, or an explicit null to remove the default. `days` is required: a body without it\\n(`{}`, or a misspelled field) is a `validation_failed` 400, never a removal, so a typo\\ncan't silently wipe the setting (#3788). A request with no body is rejected too.\"},\"PublicSetFlagExpiryRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/expiry`. Expiry is a\\ndedicated sub-resource, deliberately NOT a field on PublicUpdateFeatureFlagRequest: that\\nPUT is a full replace, so a new nullable field there would let any client that doesn't know about\\nexpiry (the Terraform provider included) wipe it on every update. A bare date means the end of that\\nUTC day; a full timestamp is stored exactly.\"},\"PublicSetFlagOwnerRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"email\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/owner`. A dedicated\\nsub-resource for the same reason as expiry: the main flag PUT is a full replace, so an owner field\\nthere would let every client that doesn't know about owners wipe one. `email` must belong\\nto an active member of the organization (case-insensitive).\"},\"PublicSetFlagRemovalPrRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"url\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/removal-pr`: the\\npull request that removes this flag from code, as opened by the Featureflip Flag Cleanup Action.\\nA dedicated sub-resource for the same reason as expiry and owner. `url` must be an https\\npull request URL (`https://{host}/{owner}/{repo}/pull/{number}`).\"},\"PublicTargetingConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicTargetingRuleResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"The full targeting configuration for a flag in a single environment, returned by\\n`GET .../targeting`. Maps 1:1 onto TargetingConfigurationDto — including\\nits IsEnabled field, which reflects the parent\\n`FlagEnvironmentConfiguration.IsEnabled` (whether the flag is on in this environment at\\nall), not anything specific to targeting itself.\"},\"PublicTargetingRuleResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"priority\":{\"type\":[\"integer\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"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.\"},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single targeting rule, returned by `GET .../rules/{ruleId}`,\\n`POST .../rules` (201 body), and nested within PublicTargetingConfigResponse.\\nMaps 1:1 onto TargetingRuleDto, dropping nothing — every field on the\\nApplication DTO is part of the public contract.\"},\"PublicTestWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"webhookDeliveryId\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The queued test event and its delivery. Poll the delivery log for the outcome.\"},\"PublicToggleFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"enabled\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST .../flags/{flag}/environments/{env}/toggle`. Named distinctly from\\nthe dashboard's own `ToggleFlagInEnvironmentRequest`\\n(which uses `IsEnabled`) — the public field is named Enabled per the phase-3c\\ncontract. Enabled is a NULLABLE `bool?` deliberately: a non-nullable value\\ntype would bind an omitted/empty body to `false` with no validation error (ASP.NET's\\nimplicit-required only covers non-nullable reference types, not value types), silently disabling\\nthe flag. The controller rejects a null Enabled with a `validation_failed` 400\\nso the intent is never ambiguous (#1806).\"},\"PublicUpdateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's display name.\"},\"color\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's display color, or null.\"},\"sortOrder\":{\"type\":[\"integer\",\"null\"],\"description\":\"Position among the project's environments.\"},\"requireChangeReason\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Require a change reason (X-Intent-Reason) on every change to flags in this environment. Business plan and above. Omit on update to leave unchanged. Turning it off needs Admin or Owner and an X-Intent-Reason.\"},\"requireConfirmation\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Ask dashboard users to type the environment key before a change lands. Dashboard only; not enforced by the API. Omit on update to leave unchanged. Turning it off needs Admin or Owner and an X-Intent-Reason.\"}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}`. See\\nPublicCreateEnvironmentRequest for why this is named distinctly from the\\ndashboard's `UpdateEnvironmentRequest`.\"},\"PublicUpdateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}`. See\\nPublicCreateFeatureFlagRequest for why this is named distinctly from the\\ndashboard's `UpdateFeatureFlagRequest`. The flag's key and type are immutable via this\\nendpoint (mirrors `UpdateFeatureFlagCommand`, which has no `Key`/`Type`).\"},\"PublicUpdateFlagEnvConfigRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../flags/{flag}/environments/{env}`. Named distinctly from the\\ndashboard's own `UpdateFlagEnvironmentConfigurationRequest`\\n— see PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document). Strategy is passed through verbatim to\\nStrategy\\n— the existing command validator name-allowlists it (SingleVariation/PercentageRollout/\\nTargetedRollout or null), so an invalid value surfaces as the handler's own 400, not a\\ncontroller-level guard. A null Prerequisites leaves prerequisites untouched; a\\nnon-null list replaces them wholesale (mirrors UpdateFlagPrerequisitesCommand's\\nreplace-all semantics).\"},\"PublicUpdateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}`. See\\nPublicCreateProjectRequest for why this is named distinctly from the\\ndashboard's `UpdateProjectRequest`.\"},\"PublicUpdateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys/{sdkKey}`.\\nType and key material are immutable via this endpoint (mirrors\\nUpdateSdkKeyCommand, which\\ncarries no `Type`).\"},\"PublicUpdateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/segments/{segment}`. The\\nsegment's key is immutable via this endpoint (mirrors `UpdateUserSegmentCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}},\"bucketBy\":{\"type\":[\"string\",\"null\"],\"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.\"}},\"description\":\"Request body for `PUT .../rules/{ruleId}`. Same shape as\\nPublicCreateTargetingRuleRequest — see its remarks on operator\\nvalidation/canonicalization, which applies identically here.\"},\"PublicUpdateVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations/{variationId}`. The\\nvariation's key is immutable via this endpoint (mirrors\\n`UpdateVariationCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"credential\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Replaces a subscription's configuration (full replace — omitted lists become empty, meaning\\n\\\"all\\\"). `isEnabled` is required. The provider cannot be changed. `credential`\\nreplaces a Datadog or Grafana subscription's stored credential; omit it to keep the current\\none, unless the `url` changes, which needs the credential sent again.\"},\"PublicVariationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single variation on a flag, as returned in Variations.\"},\"PublicWebhookDeliveryResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Pending, Succeeded, DeadLettered.\"},\"attemptCount\":{\"type\":[\"integer\",\"null\"]},\"nextAttemptAt\":{\"type\":[\"string\",\"null\"]},\"lastResponseStatusCode\":{\"type\":[\"integer\",\"null\"]},\"lastError\":{\"type\":[\"string\",\"null\"]},\"completedAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One delivery attempt record. `status` is `Pending` (awaiting its first attempt,\\nbacking off, or in flight), `Succeeded` or `DeadLettered`.\"},\"PublicWebhookDeliveryResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookDeliveryResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"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`).\"},\"PublicWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"retiredAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A signing secret's id and lifecycle. A secret with no `retiredAt` is active and signs every delivery.\"},\"PublicWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp, Slack, Datadog, Grafana.\"},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"consecutiveFailureCount\":{\"type\":[\"integer\",\"null\"]},\"autoDisabledAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"secrets\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSecretResponse\"},{\"type\":\"null\"}]}},\"overPlanLimit\":{\"type\":[\"boolean\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A webhook subscription. Never carries secret material: signing secrets are listed by id and\\nlifecycle only — the value itself is returned once, when it is created or rotated.\\n`overPlanLimit` is true when the organization has more subscriptions than its plan\\nallows, which happens after a downgrade. The oldest subscriptions up to the limit keep\\ndelivering. The rest receive nothing and cannot be re-enabled, tested or redelivered to until\\nthe plan is upgraded or older subscriptions are deleted.\"},\"PublicWebhookSubscriptionResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSubscriptionResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"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`).\"}}")
|
|
212
212
|
}, h = m.$defs, g = m.endpoints, _ = (e) => ({ type: [e, "null"] });
|
|
213
213
|
function v(e) {
|
|
214
214
|
if (!h[e]) throw Error(`no API schema named ${e}`);
|
|
@@ -272,16 +272,16 @@ function E(e, t = []) {
|
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
// src/tools/params.ts
|
|
275
|
-
var D = n.string().describe("Project key"), O = n.string().describe("Flag key or id"), k = n.string().describe("Environment key, e.g. production"), A = {
|
|
275
|
+
var D = n.string().describe("Project key"), O = n.string().describe("Flag key or id"), k = n.string().describe("Environment key, e.g. production"), A = n.string().optional().describe("Why you are making this change. Recorded in the audit log, and required when the environment (or, for project-wide changes, any environment in the project) is marked critical."), j = {
|
|
276
276
|
limit: n.number().int().min(1).max(100).optional().describe("Page size (default 20)"),
|
|
277
277
|
cursor: n.string().optional().describe("next_cursor from a previous response")
|
|
278
278
|
};
|
|
279
279
|
// src/tools/projects.ts
|
|
280
|
-
function
|
|
280
|
+
function M(e, t) {
|
|
281
281
|
e.registerTool("list_projects", {
|
|
282
282
|
title: "List projects",
|
|
283
283
|
description: "List projects in the Featureflip organization. Paginated: pass cursor from next_cursor to continue.",
|
|
284
|
-
inputSchema: n.object({ ...
|
|
284
|
+
inputSchema: n.object({ ...j }),
|
|
285
285
|
outputSchema: S("GET /api/v1/orgs/{org}/projects"),
|
|
286
286
|
annotations: { readOnlyHint: !0 }
|
|
287
287
|
}, async ({ limit: e, cursor: n }) => p(async () => d(await t.api.request("GET", `/api/v1/orgs/${o(t.org)}/projects`, { query: {
|
|
@@ -368,13 +368,13 @@ function ee(e, t) {
|
|
|
368
368
|
}));
|
|
369
369
|
}
|
|
370
370
|
// src/tools/environments.ts
|
|
371
|
-
function
|
|
371
|
+
function N(e, t) {
|
|
372
372
|
e.registerTool("list_environments", {
|
|
373
373
|
title: "List environments",
|
|
374
374
|
description: "List the environments of a project (e.g. development, staging, production).",
|
|
375
375
|
inputSchema: n.object({
|
|
376
376
|
project: D,
|
|
377
|
-
...
|
|
377
|
+
...j
|
|
378
378
|
}),
|
|
379
379
|
outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/environments"),
|
|
380
380
|
annotations: { readOnlyHint: !0 }
|
|
@@ -383,7 +383,7 @@ function j(e, t) {
|
|
|
383
383
|
cursor: r
|
|
384
384
|
} })))), e.registerTool("manage_environment", {
|
|
385
385
|
title: "Create or update an environment",
|
|
386
|
-
description: "Create an environment in a project, or change its name, color or sort order. action=create needs key + name; action=update needs environment and changes only the fields you pass. The key is immutable. Environments cannot be deleted from here. A new environment needs an SDK key before apps can use it (manage_sdk_key).",
|
|
386
|
+
description: "Create an environment in a project, or change its name, color or sort order. action=create needs key + name; action=update needs environment and changes only the fields you pass. The key is immutable. Environments cannot be deleted from here. require_change_reason makes every write to the environment need a reason, and require_confirmation makes the dashboard ask for confirmation first; omit either on update to leave it unchanged. Turning either off needs an Admin or Owner token and a reason. A new environment needs an SDK key before apps can use it (manage_sdk_key).",
|
|
387
387
|
inputSchema: n.object({
|
|
388
388
|
action: n.enum(["create", "update"]).describe("create needs key + name; update needs environment"),
|
|
389
389
|
project: D,
|
|
@@ -391,43 +391,57 @@ function j(e, t) {
|
|
|
391
391
|
key: n.string().optional().describe("New environment key, required for create; immutable afterwards"),
|
|
392
392
|
name: n.string().optional().describe("Display name; required for create"),
|
|
393
393
|
color: n.string().optional().describe("Hex color shown in the dashboard, e.g. #22c55e"),
|
|
394
|
-
sortOrder: n.number().int().optional().describe("Position in environment lists, lowest first")
|
|
394
|
+
sortOrder: n.number().int().optional().describe("Position in environment lists, lowest first"),
|
|
395
|
+
require_change_reason: n.boolean().optional().describe("Mark the environment critical: every change to it must carry a reason. Omit on update to leave unchanged"),
|
|
396
|
+
require_confirmation: n.boolean().optional().describe("Require explicit confirmation in the dashboard before changes to this environment. Omit on update to leave unchanged"),
|
|
397
|
+
reason: A
|
|
395
398
|
}),
|
|
396
399
|
outputSchema: T(y("POST /api/v1/orgs/{org}/projects/{project}/environments"), E({
|
|
397
400
|
environment: { type: "string" },
|
|
398
401
|
updated: { type: "boolean" },
|
|
399
402
|
name: _("string"),
|
|
400
403
|
color: _("string"),
|
|
401
|
-
sortOrder: _("integer")
|
|
404
|
+
sortOrder: _("integer"),
|
|
405
|
+
requireChangeReason: { type: "boolean" },
|
|
406
|
+
requireConfirmation: { type: "boolean" }
|
|
402
407
|
}, ["environment", "updated"])),
|
|
403
408
|
annotations: { destructiveHint: !0 }
|
|
404
|
-
}, async ({ action: e, project: n, environment: r, key: i, name: a, color: s, sortOrder: c }) => p(async () => {
|
|
405
|
-
let
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
409
|
+
}, async ({ action: e, project: n, environment: r, key: i, name: a, color: s, sortOrder: c, require_change_reason: l, require_confirmation: u, reason: m }) => p(async () => {
|
|
410
|
+
let p = {
|
|
411
|
+
requireChangeReason: l,
|
|
412
|
+
requireConfirmation: u
|
|
413
|
+
}, h = `/api/v1/orgs/${o(t.org)}/projects/${o(n)}/environments`;
|
|
414
|
+
if (e === "create") return !i || !a ? f(/* @__PURE__ */ Error("action=create requires key and name")) : d(await t.api.request("POST", h, {
|
|
415
|
+
body: {
|
|
416
|
+
key: i,
|
|
417
|
+
name: a,
|
|
418
|
+
color: s,
|
|
419
|
+
sortOrder: c,
|
|
420
|
+
...p
|
|
421
|
+
},
|
|
422
|
+
reason: m
|
|
423
|
+
}));
|
|
412
424
|
if (!r) return f(/* @__PURE__ */ Error("action=update requires environment (see list_environments)"));
|
|
413
|
-
let
|
|
414
|
-
name: a ??
|
|
415
|
-
color: s ??
|
|
416
|
-
sortOrder: c ??
|
|
425
|
+
let g = `${h}/${o(r)}`, { data: _, etag: v } = await t.api.requestWithEtag("GET", g), y = {
|
|
426
|
+
name: a ?? _.name,
|
|
427
|
+
color: s ?? _.color,
|
|
428
|
+
sortOrder: c ?? _.sortOrder,
|
|
429
|
+
...p
|
|
417
430
|
};
|
|
418
|
-
return await t.api.request("PUT",
|
|
419
|
-
body:
|
|
420
|
-
ifMatch:
|
|
431
|
+
return await t.api.request("PUT", g, {
|
|
432
|
+
body: y,
|
|
433
|
+
ifMatch: v,
|
|
434
|
+
reason: m
|
|
421
435
|
}), d({
|
|
422
436
|
environment: r,
|
|
423
437
|
updated: !0,
|
|
424
|
-
...
|
|
438
|
+
...y
|
|
425
439
|
});
|
|
426
440
|
}));
|
|
427
441
|
}
|
|
428
442
|
// src/tools/sdk-keys.ts
|
|
429
|
-
var
|
|
430
|
-
function
|
|
443
|
+
var P = "This is the only time the full key is returned; it cannot be shown again. Store it in a secret or an untracked .env file, never in source control or a chat log.";
|
|
444
|
+
function ee(e, t) {
|
|
431
445
|
let r = (e, n) => `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/environments/${o(n)}/sdk-keys`;
|
|
432
446
|
e.registerTool("list_sdk_keys", {
|
|
433
447
|
title: "List SDK keys",
|
|
@@ -435,7 +449,7 @@ function N(e, t) {
|
|
|
435
449
|
inputSchema: n.object({
|
|
436
450
|
project: D,
|
|
437
451
|
environment: k,
|
|
438
|
-
...
|
|
452
|
+
...j
|
|
439
453
|
}),
|
|
440
454
|
outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys"),
|
|
441
455
|
annotations: { readOnlyHint: !0 }
|
|
@@ -444,7 +458,7 @@ function N(e, t) {
|
|
|
444
458
|
cursor: a
|
|
445
459
|
} })))), e.registerTool("manage_sdk_key", {
|
|
446
460
|
title: "Create, rename, or revoke an SDK key",
|
|
447
|
-
description: "Manage an environment's SDK keys. action=create needs name + type and returns the full key ONCE (ServerSide for backend SDKs, ClientSide for browser/mobile). action=rename needs sdkKey and changes only the fields you pass. action=revoke needs sdkKey and stops the key working immediately; apps still using it lose flag updates. To rotate: create a new key, deploy it, then revoke the old one.",
|
|
461
|
+
description: "Manage an environment's SDK keys. action=create needs name + type and returns the full key ONCE (ServerSide for backend SDKs, ClientSide for browser/mobile). action=rename needs sdkKey and changes only the fields you pass. action=revoke needs sdkKey and stops the key working immediately; apps still using it lose flag updates; revoking a critical environment's key needs a reason. To rotate: create a new key, deploy it, then revoke the old one.",
|
|
448
462
|
inputSchema: n.object({
|
|
449
463
|
action: n.enum([
|
|
450
464
|
"create",
|
|
@@ -456,7 +470,8 @@ function N(e, t) {
|
|
|
456
470
|
sdkKey: n.string().optional().describe("SDK key id (see list_sdk_keys); required for rename and revoke"),
|
|
457
471
|
name: n.string().optional().describe("Key name; required for create"),
|
|
458
472
|
description: n.string().optional().describe("What the key is used for; \"\" clears it"),
|
|
459
|
-
type: n.enum(["ServerSide", "ClientSide"]).optional().describe("Required for create: ServerSide for backend SDKs, ClientSide for browser/mobile SDKs")
|
|
473
|
+
type: n.enum(["ServerSide", "ClientSide"]).optional().describe("Required for create: ServerSide for backend SDKs, ClientSide for browser/mobile SDKs"),
|
|
474
|
+
reason: A
|
|
460
475
|
}),
|
|
461
476
|
outputSchema: T(E({
|
|
462
477
|
id: { type: "string" },
|
|
@@ -469,48 +484,48 @@ function N(e, t) {
|
|
|
469
484
|
description: _("string")
|
|
470
485
|
}, ["sdkKey", "renamed"]), E({ revoked: { type: "string" } }, ["revoked"])),
|
|
471
486
|
annotations: { destructiveHint: !0 }
|
|
472
|
-
}, async ({ action: e, project: n, environment: i, sdkKey: a, name: s, description: c, type: l }) => p(async () => {
|
|
473
|
-
let
|
|
487
|
+
}, async ({ action: e, project: n, environment: i, sdkKey: a, name: s, description: c, type: l, reason: u }) => p(async () => {
|
|
488
|
+
let p = r(n, i);
|
|
474
489
|
if (e === "create") {
|
|
475
490
|
if (!s || !l) return f(/* @__PURE__ */ Error("action=create requires name and type"));
|
|
476
|
-
let e = await t.api.request("POST",
|
|
491
|
+
let e = await t.api.request("POST", p, { body: {
|
|
477
492
|
name: s,
|
|
478
493
|
description: c,
|
|
479
494
|
type: l
|
|
480
495
|
} });
|
|
481
496
|
return d({
|
|
482
497
|
...e,
|
|
483
|
-
warning: e.warning ? `${e.warning} ${
|
|
498
|
+
warning: e.warning ? `${e.warning} ${P}` : P
|
|
484
499
|
});
|
|
485
500
|
}
|
|
486
501
|
if (!a) return f(/* @__PURE__ */ Error(`action=${e} requires sdkKey (see list_sdk_keys)`));
|
|
487
|
-
let
|
|
502
|
+
let m = `${p}/${o(a)}`;
|
|
488
503
|
if (e === "rename") {
|
|
489
|
-
let e = await t.api.request("GET",
|
|
504
|
+
let e = await t.api.request("GET", m), n = {
|
|
490
505
|
name: s ?? e.name,
|
|
491
506
|
description: c ?? e.description
|
|
492
507
|
};
|
|
493
|
-
return await t.api.request("PUT",
|
|
508
|
+
return await t.api.request("PUT", m, { body: n }), d({
|
|
494
509
|
sdkKey: a,
|
|
495
510
|
renamed: !0,
|
|
496
511
|
...n
|
|
497
512
|
});
|
|
498
513
|
}
|
|
499
|
-
return await t.api.request("POST", `${
|
|
514
|
+
return await t.api.request("POST", `${m}/revoke`, { reason: u }), d({ revoked: a });
|
|
500
515
|
}));
|
|
501
516
|
}
|
|
502
517
|
// src/tools/etag.ts
|
|
503
|
-
var
|
|
518
|
+
var F = {
|
|
504
519
|
type: "string",
|
|
505
520
|
description: "ETag of what was read. Pass it as ifMatch on the matching update so the write is refused (412) instead of overwriting a change made since."
|
|
506
|
-
},
|
|
521
|
+
}, I = {
|
|
507
522
|
type: "string",
|
|
508
523
|
description: "ETag of what this write left behind. Pass it as ifMatch on the next update to chain writes without re-reading. Absent when the API sent none; read the resource again before the next conditional write."
|
|
509
524
|
};
|
|
510
|
-
function
|
|
525
|
+
function L(e) {
|
|
511
526
|
return n.string().optional().describe(`etag from ${e}. The write is refused with 412 if the resource changed since that read; re-read and re-apply. Omit to write unconditionally.`);
|
|
512
527
|
}
|
|
513
|
-
function
|
|
528
|
+
function R({ data: e, etag: t }) {
|
|
514
529
|
return t ? {
|
|
515
530
|
...e,
|
|
516
531
|
etag: t
|
|
@@ -523,7 +538,7 @@ function te(e, t) {
|
|
|
523
538
|
description: "List reusable user segments in a project. Segments are referenced from targeting rules via userSegmentId.",
|
|
524
539
|
inputSchema: n.object({
|
|
525
540
|
project: n.string().describe("Project key"),
|
|
526
|
-
...
|
|
541
|
+
...j
|
|
527
542
|
}),
|
|
528
543
|
outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/segments"),
|
|
529
544
|
annotations: { readOnlyHint: !0 }
|
|
@@ -537,9 +552,9 @@ function te(e, t) {
|
|
|
537
552
|
project: n.string().describe("Project key"),
|
|
538
553
|
segment: n.string().describe("Segment key or id")
|
|
539
554
|
}),
|
|
540
|
-
outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/segments/{segment}", { etag:
|
|
555
|
+
outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/segments/{segment}", { etag: F }),
|
|
541
556
|
annotations: { readOnlyHint: !0 }
|
|
542
|
-
}, async ({ project: e, segment: n }) => p(async () => d(
|
|
557
|
+
}, async ({ project: e, segment: n }) => p(async () => d(R(await t.api.requestWithEtag("GET", `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/segments/${o(n)}`)))));
|
|
543
558
|
let r = n.object({
|
|
544
559
|
attribute: n.string().describe("Context attribute name, e.g. plan, country, user_id"),
|
|
545
560
|
operator: n.string().describe("Case-sensitive: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual"),
|
|
@@ -566,7 +581,8 @@ function te(e, t) {
|
|
|
566
581
|
name: n.string().optional().describe("Display name; required for create"),
|
|
567
582
|
description: n.string().optional().describe("What the segment means; \"\" clears it"),
|
|
568
583
|
conditions: n.array(r).optional().describe("Conditions a user must match to be in the segment; on update, replaces the whole list"),
|
|
569
|
-
ifMatch:
|
|
584
|
+
ifMatch: L("get_segment"),
|
|
585
|
+
reason: A
|
|
570
586
|
}),
|
|
571
587
|
outputSchema: T(y("POST /api/v1/orgs/{org}/projects/{project}/segments"), E({
|
|
572
588
|
segment: { type: "string" },
|
|
@@ -577,30 +593,34 @@ function te(e, t) {
|
|
|
577
593
|
type: ["array", "null"],
|
|
578
594
|
items: { type: "object" }
|
|
579
595
|
},
|
|
580
|
-
etag:
|
|
596
|
+
etag: I
|
|
581
597
|
}, ["segment", "updated"]), E({ deleted: { type: "string" } }, ["deleted"])),
|
|
582
598
|
annotations: { destructiveHint: !0 }
|
|
583
|
-
}, async ({ action: e, project: n, segment: r, key: a, name: s, description: c, conditions: l, ifMatch: u }) => p(async () => {
|
|
599
|
+
}, async ({ action: e, project: n, segment: r, key: a, name: s, description: c, conditions: l, ifMatch: u, reason: m }) => p(async () => {
|
|
584
600
|
let p = `/api/v1/orgs/${o(t.org)}/projects/${o(n)}/segments`;
|
|
585
601
|
if (u !== void 0 && e !== "update") return f(/* @__PURE__ */ Error(`ifMatch is only supported on action=update; action=${e} cannot be made conditional`));
|
|
586
|
-
if (e === "create") return !a || !s ? f(/* @__PURE__ */ Error("action=create requires key and name")) : d(await t.api.request("POST", p, {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
602
|
+
if (e === "create") return !a || !s ? f(/* @__PURE__ */ Error("action=create requires key and name")) : d(await t.api.request("POST", p, {
|
|
603
|
+
body: {
|
|
604
|
+
key: a,
|
|
605
|
+
name: s,
|
|
606
|
+
description: c,
|
|
607
|
+
conditions: l ?? []
|
|
608
|
+
},
|
|
609
|
+
reason: m
|
|
610
|
+
}));
|
|
592
611
|
if (!r) return f(/* @__PURE__ */ Error(`action=${e} requires segment (see list_segments)`));
|
|
593
|
-
let
|
|
612
|
+
let h = `${p}/${o(r)}`;
|
|
594
613
|
if (e === "update") {
|
|
595
|
-
let { data: e, etag: n } = await t.api.requestWithEtag("GET",
|
|
614
|
+
let { data: e, etag: n } = await t.api.requestWithEtag("GET", h), a = {
|
|
596
615
|
name: s ?? e.name,
|
|
597
616
|
description: c ?? e.description,
|
|
598
617
|
conditions: l ?? (e.conditions ?? []).map(i)
|
|
599
|
-
}, { etag: o } = await t.api.requestWithEtag("PUT",
|
|
618
|
+
}, { etag: o } = await t.api.requestWithEtag("PUT", h, {
|
|
600
619
|
body: a,
|
|
601
|
-
ifMatch: u ?? n
|
|
620
|
+
ifMatch: u ?? n,
|
|
621
|
+
reason: m
|
|
602
622
|
});
|
|
603
|
-
return d(
|
|
623
|
+
return d(R({
|
|
604
624
|
data: {
|
|
605
625
|
segment: r,
|
|
606
626
|
updated: !0,
|
|
@@ -609,12 +629,12 @@ function te(e, t) {
|
|
|
609
629
|
etag: o
|
|
610
630
|
}));
|
|
611
631
|
}
|
|
612
|
-
return await t.api.request("DELETE", m), d({ deleted: r });
|
|
632
|
+
return await t.api.request("DELETE", h, { reason: m }), d({ deleted: r });
|
|
613
633
|
}));
|
|
614
634
|
}
|
|
615
635
|
// src/tools/owner.ts
|
|
616
|
-
var
|
|
617
|
-
async function
|
|
636
|
+
var z = n.string().optional().describe("Only flags with this owner: an email, \"me\" for the token's own user, or \"none\" for unowned flags");
|
|
637
|
+
async function B(e, t) {
|
|
618
638
|
let n = t?.trim();
|
|
619
639
|
if (!n) return;
|
|
620
640
|
if (n.toLowerCase() !== "me") return n;
|
|
@@ -623,13 +643,13 @@ async function z(e, t) {
|
|
|
623
643
|
return r.email;
|
|
624
644
|
}
|
|
625
645
|
// src/tools/flags.ts
|
|
626
|
-
var
|
|
646
|
+
var V = n.enum([
|
|
627
647
|
"Boolean",
|
|
628
648
|
"String",
|
|
629
649
|
"Number",
|
|
630
650
|
"Json"
|
|
631
651
|
]);
|
|
632
|
-
function
|
|
652
|
+
function H(e, t) {
|
|
633
653
|
let r = (e) => `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags`;
|
|
634
654
|
e.registerTool("list_flags", {
|
|
635
655
|
title: "List feature flags",
|
|
@@ -638,16 +658,16 @@ function V(e, t) {
|
|
|
638
658
|
project: D,
|
|
639
659
|
search: n.string().optional().describe("Substring of the flag key or name"),
|
|
640
660
|
tag: n.string().optional().describe("Only flags carrying this tag"),
|
|
641
|
-
type:
|
|
661
|
+
type: V.optional().describe("Only flags of this type"),
|
|
642
662
|
archived: n.boolean().optional().describe("true = only archived, false = only active"),
|
|
643
|
-
owner:
|
|
644
|
-
...
|
|
663
|
+
owner: z,
|
|
664
|
+
...j
|
|
645
665
|
}),
|
|
646
666
|
outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/flags"),
|
|
647
667
|
annotations: { readOnlyHint: !0 }
|
|
648
668
|
}, async ({ project: e, owner: n, ...i }) => p(async () => d(await t.api.request("GET", r(e), { query: {
|
|
649
669
|
...i,
|
|
650
|
-
owner: await
|
|
670
|
+
owner: await B(t, n)
|
|
651
671
|
} })))), e.registerTool("get_flag", {
|
|
652
672
|
title: "Get feature flag",
|
|
653
673
|
description: "Get one feature flag with its variations and metadata, including its owner (null when unowned). Address by flag key or id.",
|
|
@@ -655,16 +675,16 @@ function V(e, t) {
|
|
|
655
675
|
project: D,
|
|
656
676
|
flag: O
|
|
657
677
|
}),
|
|
658
|
-
outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}", { etag:
|
|
678
|
+
outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}", { etag: F }),
|
|
659
679
|
annotations: { readOnlyHint: !0 }
|
|
660
|
-
}, async ({ project: e, flag: n }) => p(async () => d(
|
|
680
|
+
}, async ({ project: e, flag: n }) => p(async () => d(R(await t.api.requestWithEtag("GET", `${r(e)}/${o(n)}`))))), e.registerTool("create_flag", {
|
|
661
681
|
title: "Create feature flag",
|
|
662
682
|
description: "Create a feature flag. type is one of Boolean|String|Number|Json. Boolean flags get true/false variations automatically; for other types pass initialVariations. The flag is created in every environment of the project (disabled).",
|
|
663
683
|
inputSchema: n.object({
|
|
664
684
|
project: D,
|
|
665
685
|
key: n.string().describe("Unique flag key, e.g. checkout-v2"),
|
|
666
686
|
name: n.string().describe("Display name"),
|
|
667
|
-
type:
|
|
687
|
+
type: V.describe("Value type; Boolean gets true/false variations automatically"),
|
|
668
688
|
description: n.string().optional().describe("What the flag controls"),
|
|
669
689
|
tags: n.array(n.string()).optional().describe("Tags for filtering, e.g. team or area"),
|
|
670
690
|
clientSideVisible: n.boolean().optional().describe("Expose to client-side SDKs (browser/mobile)"),
|
|
@@ -686,7 +706,7 @@ function V(e, t) {
|
|
|
686
706
|
idempotencyKey: n
|
|
687
707
|
})))), e.registerTool("update_flag", {
|
|
688
708
|
title: "Update feature flag metadata",
|
|
689
|
-
description: "Update flag name/description/tags/clientSideVisible. Changes only the fields you pass and keeps the rest; pass description: \"\" to clear it. Key and type are immutable. Use toggle_flag / update_targeting for behavior changes. Pass ifMatch (the etag from get_flag) to refuse the write if the flag changed since you read it.",
|
|
709
|
+
description: "Update flag name/description/tags/clientSideVisible. Changes only the fields you pass and keeps the rest; changing clientSideVisible needs a reason when any environment of the project is critical. pass description: \"\" to clear it. Key and type are immutable. Use toggle_flag / update_targeting for behavior changes. Pass ifMatch (the etag from get_flag) to refuse the write if the flag changed since you read it.",
|
|
690
710
|
inputSchema: n.object({
|
|
691
711
|
project: D,
|
|
692
712
|
flag: O,
|
|
@@ -694,36 +714,38 @@ function V(e, t) {
|
|
|
694
714
|
description: n.string().optional().describe("New description; \"\" clears it"),
|
|
695
715
|
tags: n.array(n.string()).optional().describe("Replaces the whole tag list"),
|
|
696
716
|
clientSideVisible: n.boolean().optional().describe("Expose to client-side SDKs (browser/mobile); false hides the flag from them entirely"),
|
|
697
|
-
ifMatch:
|
|
717
|
+
ifMatch: L("get_flag"),
|
|
718
|
+
reason: A
|
|
698
719
|
}),
|
|
699
720
|
outputSchema: w({
|
|
700
721
|
project: { type: "string" },
|
|
701
722
|
flag: { type: "string" },
|
|
702
723
|
updated: { type: "boolean" },
|
|
703
|
-
etag:
|
|
724
|
+
etag: I
|
|
704
725
|
}, [
|
|
705
726
|
"project",
|
|
706
727
|
"flag",
|
|
707
728
|
"updated"
|
|
708
729
|
]),
|
|
709
730
|
annotations: { destructiveHint: !0 }
|
|
710
|
-
}, async ({ project: e, flag: n, name: i, description: a, tags: s, clientSideVisible: c, ifMatch: l }) => p(async () => {
|
|
711
|
-
let
|
|
712
|
-
name: i ??
|
|
713
|
-
description: a ??
|
|
731
|
+
}, async ({ project: e, flag: n, name: i, description: a, tags: s, clientSideVisible: c, ifMatch: l, reason: u }) => p(async () => {
|
|
732
|
+
let f = `${r(e)}/${o(n)}`, p = i === void 0 || a === void 0 ? await t.api.requestWithEtag("GET", f) : void 0, m = p?.data, h = {
|
|
733
|
+
name: i ?? m?.name,
|
|
734
|
+
description: a ?? m?.description,
|
|
714
735
|
tags: s,
|
|
715
736
|
clientSideVisible: c
|
|
716
|
-
}, { etag:
|
|
717
|
-
body:
|
|
718
|
-
ifMatch: l ??
|
|
737
|
+
}, { etag: g } = await t.api.requestWithEtag("PUT", f, {
|
|
738
|
+
body: h,
|
|
739
|
+
ifMatch: l ?? p?.etag,
|
|
740
|
+
reason: u
|
|
719
741
|
});
|
|
720
|
-
return d(
|
|
742
|
+
return d(R({
|
|
721
743
|
data: {
|
|
722
744
|
project: e,
|
|
723
745
|
flag: n,
|
|
724
746
|
updated: !0
|
|
725
747
|
},
|
|
726
|
-
etag:
|
|
748
|
+
etag: g
|
|
727
749
|
}));
|
|
728
750
|
})), e.registerTool("set_flag_expiry", {
|
|
729
751
|
title: "Set or clear flag expiry",
|
|
@@ -806,7 +828,7 @@ function V(e, t) {
|
|
|
806
828
|
idempotentHint: !0
|
|
807
829
|
}
|
|
808
830
|
}, async ({ project: e, flag: n, owner: i }) => p(async () => {
|
|
809
|
-
let a = `${r(e)}/${o(n)}/owner`, s = i?.trim().toLowerCase() === "none" ? void 0 : await
|
|
831
|
+
let a = `${r(e)}/${o(n)}/owner`, s = i?.trim().toLowerCase() === "none" ? void 0 : await B(t, i ?? void 0);
|
|
810
832
|
return s === void 0 ? await t.api.request("DELETE", a) : await t.api.request("PUT", a, { body: { email: s } }), d({
|
|
811
833
|
project: e,
|
|
812
834
|
flag: n,
|
|
@@ -817,24 +839,29 @@ function V(e, t) {
|
|
|
817
839
|
description: "PERMANENTLY delete a flag across all environments. Fails with FLAG_HAS_DEPENDENTS if other flags use it as a prerequisite. Prefer archive_flag unless the flag must be fully removed.",
|
|
818
840
|
inputSchema: n.object({
|
|
819
841
|
project: D,
|
|
820
|
-
flag: O
|
|
842
|
+
flag: O,
|
|
843
|
+
reason: A
|
|
821
844
|
}),
|
|
822
845
|
outputSchema: w({ deleted: { type: "string" } }, ["deleted"]),
|
|
823
846
|
annotations: { destructiveHint: !0 }
|
|
824
|
-
}, async ({ project: e, flag: n }) => p(async () => (await t.api.request("DELETE", `${r(e)}/${o(n)}
|
|
847
|
+
}, async ({ project: e, flag: n, reason: i }) => p(async () => (await t.api.request("DELETE", `${r(e)}/${o(n)}`, { reason: i }), d({ deleted: n })))), e.registerTool("archive_flag", {
|
|
825
848
|
title: "Archive feature flag",
|
|
826
849
|
description: "Archive a flag (soft-hide, evaluation stops serving it). Reversible with restore_flag. Archive dependents first: refused with FLAG_HAS_DEPENDENTS while another live flag lists this one as a prerequisite, so archive those flags (blockedBy in find_stale_flags / list_removal_candidates) first. Refused with FLAG_RECENTLY_EVALUATED while live traffic is still evaluating the flag, because archiving makes every caller fall back to its own hardcoded default — normally that means the code removal has merged but not deployed yet, and the refusal clears itself once it has.",
|
|
827
850
|
inputSchema: n.object({
|
|
828
851
|
project: D,
|
|
829
852
|
flag: O,
|
|
830
|
-
force: n.boolean().optional().describe("Archive even though traffic is still evaluating the flag. Only for clients that can never be updated (old mobile app versions), where traffic will never drain on its own.")
|
|
853
|
+
force: n.boolean().optional().describe("Archive even though traffic is still evaluating the flag. Only for clients that can never be updated (old mobile app versions), where traffic will never drain on its own."),
|
|
854
|
+
reason: A
|
|
831
855
|
}),
|
|
832
856
|
outputSchema: w({
|
|
833
857
|
flag: { type: "string" },
|
|
834
858
|
archived: { type: "boolean" }
|
|
835
859
|
}, ["flag", "archived"]),
|
|
836
860
|
annotations: { destructiveHint: !0 }
|
|
837
|
-
}, async ({ project: e, flag: n, force: i }) => p(async () => (await t.api.request("POST", `${r(e)}/${o(n)}/archive`, {
|
|
861
|
+
}, async ({ project: e, flag: n, force: i, reason: a }) => p(async () => (await t.api.request("POST", `${r(e)}/${o(n)}/archive`, {
|
|
862
|
+
query: i ? { force: !0 } : {},
|
|
863
|
+
reason: a
|
|
864
|
+
}), d({
|
|
838
865
|
flag: n,
|
|
839
866
|
archived: !0
|
|
840
867
|
})))), e.registerTool("restore_flag", {
|
|
@@ -842,14 +869,15 @@ function V(e, t) {
|
|
|
842
869
|
description: "Restore a previously archived flag.",
|
|
843
870
|
inputSchema: n.object({
|
|
844
871
|
project: D,
|
|
845
|
-
flag: O
|
|
872
|
+
flag: O,
|
|
873
|
+
reason: A
|
|
846
874
|
}),
|
|
847
875
|
outputSchema: w({
|
|
848
876
|
flag: { type: "string" },
|
|
849
877
|
archived: { type: "boolean" }
|
|
850
878
|
}, ["flag", "archived"]),
|
|
851
879
|
annotations: { destructiveHint: !1 }
|
|
852
|
-
}, async ({ project: e, flag: n }) => p(async () => (await t.api.request("POST", `${r(e)}/${o(n)}/restore
|
|
880
|
+
}, async ({ project: e, flag: n, reason: i }) => p(async () => (await t.api.request("POST", `${r(e)}/${o(n)}/restore`, { reason: i }), d({
|
|
853
881
|
flag: n,
|
|
854
882
|
archived: !1
|
|
855
883
|
}))));
|
|
@@ -869,7 +897,8 @@ function re(e, t) {
|
|
|
869
897
|
project: D,
|
|
870
898
|
flag: O,
|
|
871
899
|
environment: k,
|
|
872
|
-
enabled: n.boolean().describe("true to turn the flag on in this environment, false to turn it off")
|
|
900
|
+
enabled: n.boolean().describe("true to turn the flag on in this environment, false to turn it off"),
|
|
901
|
+
reason: A
|
|
873
902
|
}),
|
|
874
903
|
outputSchema: w({
|
|
875
904
|
project: { type: "string" },
|
|
@@ -883,7 +912,10 @@ function re(e, t) {
|
|
|
883
912
|
"enabled"
|
|
884
913
|
]),
|
|
885
914
|
annotations: { destructiveHint: !0 }
|
|
886
|
-
}, async ({ project: e, flag: n, environment: i, enabled: a }) => p(async () => (await t.api.request("POST", `${r(e, n)}/environments/${o(i)}/toggle`, {
|
|
915
|
+
}, async ({ project: e, flag: n, environment: i, enabled: a, reason: s }) => p(async () => (await t.api.request("POST", `${r(e, n)}/environments/${o(i)}/toggle`, {
|
|
916
|
+
body: { enabled: a },
|
|
917
|
+
reason: s
|
|
918
|
+
}), d({
|
|
887
919
|
project: e,
|
|
888
920
|
flag: n,
|
|
889
921
|
environment: i,
|
|
@@ -900,7 +932,8 @@ function re(e, t) {
|
|
|
900
932
|
prerequisites: n.array(n.object({
|
|
901
933
|
prerequisiteFlagKey: n.string(),
|
|
902
934
|
expectedVariationKey: n.string()
|
|
903
|
-
})).optional().describe("Flags that must evaluate to the expected variation before this flag serves. Omit to leave existing prerequisites untouched; pass a list (possibly empty) to replace them wholesale.")
|
|
935
|
+
})).optional().describe("Flags that must evaluate to the expected variation before this flag serves. Omit to leave existing prerequisites untouched; pass a list (possibly empty) to replace them wholesale."),
|
|
936
|
+
reason: A
|
|
904
937
|
}),
|
|
905
938
|
outputSchema: w({
|
|
906
939
|
project: { type: "string" },
|
|
@@ -922,11 +955,14 @@ function re(e, t) {
|
|
|
922
955
|
"defaultVariationId"
|
|
923
956
|
]),
|
|
924
957
|
annotations: { destructiveHint: !0 }
|
|
925
|
-
}, async ({ project: e, flag: n, environment: i,
|
|
958
|
+
}, async ({ project: e, flag: n, environment: i, reason: a, ...s }) => p(async () => (await t.api.request("PUT", `${r(e, n)}/environments/${o(i)}`, {
|
|
959
|
+
body: s,
|
|
960
|
+
reason: a
|
|
961
|
+
}), d({
|
|
926
962
|
project: e,
|
|
927
963
|
flag: n,
|
|
928
964
|
environment: i,
|
|
929
|
-
...
|
|
965
|
+
...s
|
|
930
966
|
})))), e.registerTool("flag_status", {
|
|
931
967
|
title: "Flag status across environments",
|
|
932
968
|
description: "Compact cross-environment view of one flag: enabled state, strategy, default variation, and prerequisites per environment.",
|
|
@@ -1001,7 +1037,7 @@ var ie = n.object({
|
|
|
1001
1037
|
operator: n.string().describe("OperatorType member name, case-sensitive — e.g. Equals, NotEquals, Contains, In, GreaterThan"),
|
|
1002
1038
|
values: n.array(n.string()),
|
|
1003
1039
|
negate: n.boolean().optional().default(!1)
|
|
1004
|
-
}),
|
|
1040
|
+
}), U = n.object({
|
|
1005
1041
|
description: n.string().optional(),
|
|
1006
1042
|
variationId: n.string().optional().describe("Variation served when the rule matches"),
|
|
1007
1043
|
rolloutPercentage: n.number().int().min(0).max(100).optional().describe("Percentage rollout for this rule"),
|
|
@@ -1011,7 +1047,7 @@ var ie = n.object({
|
|
|
1011
1047
|
operator: n.enum(["And", "Or"]).describe("How conditions inside this group combine"),
|
|
1012
1048
|
conditions: n.array(ie)
|
|
1013
1049
|
})).optional().describe("Groups are ANDed together; conditions inside a group use the group operator")
|
|
1014
|
-
}),
|
|
1050
|
+
}), W = (e) => ({
|
|
1015
1051
|
...e,
|
|
1016
1052
|
conditionGroups: e.conditionGroups ?? []
|
|
1017
1053
|
});
|
|
@@ -1025,24 +1061,25 @@ function ae(e, t) {
|
|
|
1025
1061
|
flag: O,
|
|
1026
1062
|
environment: k
|
|
1027
1063
|
}),
|
|
1028
|
-
outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/targeting", { etag:
|
|
1064
|
+
outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/targeting", { etag: F }),
|
|
1029
1065
|
annotations: { readOnlyHint: !0 }
|
|
1030
|
-
}, async ({ project: e, flag: n, environment: i }) => p(async () => d(
|
|
1066
|
+
}, async ({ project: e, flag: n, environment: i }) => p(async () => d(R(await t.api.requestWithEtag("GET", r(e, n, i)))))), e.registerTool("update_targeting", {
|
|
1031
1067
|
title: "Replace targeting rules",
|
|
1032
1068
|
description: "REPLACE all targeting rules of a flag in one environment (full PUT — rules not included are removed). Rules are evaluated in order. Get the current rules first with get_targeting. Pass ifMatch (the etag from get_targeting) so rules someone else changed meanwhile are not overwritten.",
|
|
1033
1069
|
inputSchema: n.object({
|
|
1034
1070
|
project: D,
|
|
1035
1071
|
flag: O,
|
|
1036
1072
|
environment: k,
|
|
1037
|
-
rules: n.array(
|
|
1038
|
-
ifMatch:
|
|
1073
|
+
rules: n.array(U).describe("The complete ordered rule list; rules left out are deleted"),
|
|
1074
|
+
ifMatch: L("get_targeting"),
|
|
1075
|
+
reason: A
|
|
1039
1076
|
}),
|
|
1040
1077
|
outputSchema: w({
|
|
1041
1078
|
project: { type: "string" },
|
|
1042
1079
|
flag: { type: "string" },
|
|
1043
1080
|
environment: { type: "string" },
|
|
1044
1081
|
rulesReplaced: { type: "integer" },
|
|
1045
|
-
etag:
|
|
1082
|
+
etag: I
|
|
1046
1083
|
}, [
|
|
1047
1084
|
"project",
|
|
1048
1085
|
"flag",
|
|
@@ -1050,19 +1087,20 @@ function ae(e, t) {
|
|
|
1050
1087
|
"rulesReplaced"
|
|
1051
1088
|
]),
|
|
1052
1089
|
annotations: { destructiveHint: !0 }
|
|
1053
|
-
}, async ({ project: e, flag: n, environment: i, rules: a, ifMatch: o }) => p(async () => {
|
|
1054
|
-
let { etag:
|
|
1055
|
-
body: { rules: a.map(
|
|
1056
|
-
ifMatch: o
|
|
1090
|
+
}, async ({ project: e, flag: n, environment: i, rules: a, ifMatch: o, reason: s }) => p(async () => {
|
|
1091
|
+
let { etag: c } = await t.api.requestWithEtag("PUT", r(e, n, i), {
|
|
1092
|
+
body: { rules: a.map(W) },
|
|
1093
|
+
ifMatch: o,
|
|
1094
|
+
reason: s
|
|
1057
1095
|
});
|
|
1058
|
-
return d(
|
|
1096
|
+
return d(R({
|
|
1059
1097
|
data: {
|
|
1060
1098
|
project: e,
|
|
1061
1099
|
flag: n,
|
|
1062
1100
|
environment: i,
|
|
1063
1101
|
rulesReplaced: a.length
|
|
1064
1102
|
},
|
|
1065
|
-
etag:
|
|
1103
|
+
etag: c
|
|
1066
1104
|
}));
|
|
1067
1105
|
})), e.registerTool("manage_targeting_rule", {
|
|
1068
1106
|
title: "Add, update, remove, or reorder one targeting rule",
|
|
@@ -1078,8 +1116,9 @@ function ae(e, t) {
|
|
|
1078
1116
|
flag: O,
|
|
1079
1117
|
environment: k,
|
|
1080
1118
|
ruleId: n.string().optional().describe("Rule id from get_targeting; required for update and remove"),
|
|
1081
|
-
rule:
|
|
1082
|
-
ruleIds: n.array(n.string()).optional().describe("Every rule id exactly once, in evaluation order; required for reorder")
|
|
1119
|
+
rule: U.optional().describe("Rule fields; required for add and update"),
|
|
1120
|
+
ruleIds: n.array(n.string()).optional().describe("Every rule id exactly once, in evaluation order; required for reorder"),
|
|
1121
|
+
reason: A
|
|
1083
1122
|
}),
|
|
1084
1123
|
outputSchema: T(y("POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/rules"), E({
|
|
1085
1124
|
ruleId: { type: "string" },
|
|
@@ -1089,15 +1128,21 @@ function ae(e, t) {
|
|
|
1089
1128
|
items: { type: "string" }
|
|
1090
1129
|
} }, ["reordered"])),
|
|
1091
1130
|
annotations: { destructiveHint: !0 }
|
|
1092
|
-
}, async ({ action: e, project: n, flag: r, environment: i, ruleId: a, rule: s, ruleIds: c }) => p(async () => {
|
|
1093
|
-
let
|
|
1094
|
-
if (e === "add") return s ? d(await t.api.request("POST",
|
|
1095
|
-
|
|
1131
|
+
}, async ({ action: e, project: n, flag: r, environment: i, ruleId: a, rule: s, ruleIds: c, reason: l }) => p(async () => {
|
|
1132
|
+
let u = `/api/v1/orgs/${o(t.org)}/projects/${o(n)}/flags/${o(r)}/environments/${o(i)}/rules`;
|
|
1133
|
+
if (e === "add") return s ? d(await t.api.request("POST", u, {
|
|
1134
|
+
body: W(s),
|
|
1135
|
+
reason: l
|
|
1136
|
+
})) : f(/* @__PURE__ */ Error("action=add requires rule"));
|
|
1137
|
+
if (e === "reorder") return c ? (await t.api.request("PUT", `${u}/reorder`, {
|
|
1138
|
+
body: { ruleIds: c },
|
|
1139
|
+
reason: l
|
|
1140
|
+
}), d({ reordered: c })) : f(/* @__PURE__ */ Error("action=reorder requires ruleIds (see get_targeting)"));
|
|
1096
1141
|
if (!a) return f(/* @__PURE__ */ Error(`action=${e} requires ruleId (see get_targeting)`));
|
|
1097
|
-
let
|
|
1142
|
+
let p = `${u}/${o(a)}`;
|
|
1098
1143
|
if (e === "update") {
|
|
1099
1144
|
if (!s) return f(/* @__PURE__ */ Error("action=update requires rule"));
|
|
1100
|
-
let { data: e, etag: n } = await t.api.requestWithEtag("GET",
|
|
1145
|
+
let { data: e, etag: n } = await t.api.requestWithEtag("GET", p), r = s.bucketBy ?? (e.rolloutPercentage == null ? void 0 : e.bucketBy), i = {
|
|
1101
1146
|
description: s.description ?? e.description,
|
|
1102
1147
|
variationId: s.variationId ?? e.variationId,
|
|
1103
1148
|
rolloutPercentage: s.rolloutPercentage ?? e.rolloutPercentage,
|
|
@@ -1113,15 +1158,16 @@ function ae(e, t) {
|
|
|
1113
1158
|
}))
|
|
1114
1159
|
}))
|
|
1115
1160
|
};
|
|
1116
|
-
return await t.api.request("PUT",
|
|
1161
|
+
return await t.api.request("PUT", p, {
|
|
1117
1162
|
body: i,
|
|
1118
|
-
ifMatch: n
|
|
1163
|
+
ifMatch: n,
|
|
1164
|
+
reason: l
|
|
1119
1165
|
}), d({
|
|
1120
1166
|
ruleId: a,
|
|
1121
1167
|
updated: !0
|
|
1122
1168
|
});
|
|
1123
1169
|
}
|
|
1124
|
-
return await t.api.request("DELETE",
|
|
1170
|
+
return await t.api.request("DELETE", p, { reason: l }), d({ removed: a });
|
|
1125
1171
|
}));
|
|
1126
1172
|
}
|
|
1127
1173
|
// src/tools/variations.ts
|
|
@@ -1141,7 +1187,8 @@ function oe(e, t) {
|
|
|
1141
1187
|
key: n.string().optional().describe("Required for add; immutable afterwards"),
|
|
1142
1188
|
name: n.string().optional().describe("Display name"),
|
|
1143
1189
|
value: n.string().optional().describe("Variation value serialized as a string; required for add"),
|
|
1144
|
-
description: n.string().optional().describe("What this variation means")
|
|
1190
|
+
description: n.string().optional().describe("What this variation means"),
|
|
1191
|
+
reason: A
|
|
1145
1192
|
}),
|
|
1146
1193
|
outputSchema: T(y("POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations"), E({ updated: {
|
|
1147
1194
|
type: "string",
|
|
@@ -1151,23 +1198,29 @@ function oe(e, t) {
|
|
|
1151
1198
|
description: "Id of the removed variation"
|
|
1152
1199
|
} }, ["removed"])),
|
|
1153
1200
|
annotations: { destructiveHint: !0 }
|
|
1154
|
-
}, async ({ project: e, flag: n, action: r, variationId: i, key: a, name: s, value: c, description: l }) => p(async () => {
|
|
1155
|
-
let
|
|
1156
|
-
return r === "add" ? !a || c === void 0 ? f(/* @__PURE__ */ Error("action=add requires key and value")) : d(await t.api.request("POST",
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1201
|
+
}, async ({ project: e, flag: n, action: r, variationId: i, key: a, name: s, value: c, description: l, reason: u }) => p(async () => {
|
|
1202
|
+
let p = `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags/${o(n)}/variations`;
|
|
1203
|
+
return r === "add" ? !a || c === void 0 ? f(/* @__PURE__ */ Error("action=add requires key and value")) : d(await t.api.request("POST", p, {
|
|
1204
|
+
body: {
|
|
1205
|
+
key: a,
|
|
1206
|
+
name: s,
|
|
1207
|
+
value: c,
|
|
1208
|
+
description: l
|
|
1209
|
+
},
|
|
1210
|
+
reason: u
|
|
1211
|
+
})) : i ? r === "update" ? (await t.api.request("PUT", `${p}/${o(i)}`, {
|
|
1212
|
+
body: {
|
|
1213
|
+
name: s,
|
|
1214
|
+
value: c,
|
|
1215
|
+
description: l
|
|
1216
|
+
},
|
|
1217
|
+
reason: u
|
|
1218
|
+
}), d({ updated: i })) : (await t.api.request("DELETE", `${p}/${o(i)}`, { reason: u }), d({ removed: i })) : f(/* @__PURE__ */ Error(`action=${r} requires variationId (see get_flag for ids)`));
|
|
1166
1219
|
}));
|
|
1167
1220
|
}
|
|
1168
1221
|
// src/tools/webhooks.ts
|
|
1169
|
-
var
|
|
1170
|
-
function
|
|
1222
|
+
var G = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, K = "Requires an Admin token. A 404 on every webhook call means webhooks are not enabled for the organization.";
|
|
1223
|
+
function q(e) {
|
|
1171
1224
|
let t;
|
|
1172
1225
|
try {
|
|
1173
1226
|
t = new URL(e);
|
|
@@ -1176,13 +1229,13 @@ function K(e) {
|
|
|
1176
1229
|
}
|
|
1177
1230
|
return t.protocol === "https:" && t.port === "" && !t.username && !t.password && t.hostname === "hooks.slack.com" && t.pathname.startsWith("/services/");
|
|
1178
1231
|
}
|
|
1179
|
-
var
|
|
1232
|
+
var J = "url is a Slack incoming webhook URL. Slack rejects the generic JSON payload, so every delivery would fail. Create the subscription with provider: \"Slack\" instead.";
|
|
1180
1233
|
function se(e, t) {
|
|
1181
1234
|
let r = `/api/v1/orgs/${o(t.org)}/webhooks`, i = (e) => `${r}/${o(e)}`;
|
|
1182
1235
|
async function a(e) {
|
|
1183
1236
|
let n = [];
|
|
1184
1237
|
for (let r of e) {
|
|
1185
|
-
if (
|
|
1238
|
+
if (G.test(r)) {
|
|
1186
1239
|
n.push(r);
|
|
1187
1240
|
continue;
|
|
1188
1241
|
}
|
|
@@ -1194,7 +1247,7 @@ function se(e, t) {
|
|
|
1194
1247
|
}
|
|
1195
1248
|
async function s(e) {
|
|
1196
1249
|
let n = e.map((e) => {
|
|
1197
|
-
if (
|
|
1250
|
+
if (G.test(e)) return { id: e };
|
|
1198
1251
|
let t = e.indexOf("/"), n = e.slice(0, t), r = e.slice(t + 1);
|
|
1199
1252
|
if (t < 0 || !n || !r) throw Error(`Environment "${e}" needs its project: pass "<project>/<environment>", e.g. "web/production", or the environment's id.`);
|
|
1200
1253
|
return {
|
|
@@ -1215,8 +1268,8 @@ function se(e, t) {
|
|
|
1215
1268
|
}
|
|
1216
1269
|
e.registerTool("list_webhooks", {
|
|
1217
1270
|
title: "List webhook subscriptions",
|
|
1218
|
-
description: "List the organization's outbound webhook subscriptions (url, event/project/environment filters, enabled state, failure count, signing secret ids — never secret values), plus availableEventTypes: the event types a subscription can filter on. Empty filter lists mean \"all\". Paginated via cursor. " +
|
|
1219
|
-
inputSchema: n.object({ ...
|
|
1271
|
+
description: "List the organization's outbound webhook subscriptions (url, event/project/environment filters, enabled state, failure count, signing secret ids — never secret values), plus availableEventTypes: the event types a subscription can filter on. Empty filter lists mean \"all\". Paginated via cursor. " + K,
|
|
1272
|
+
inputSchema: n.object({ ...j }),
|
|
1220
1273
|
outputSchema: C("GET /api/v1/orgs/{org}/webhooks", { availableEventTypes: {
|
|
1221
1274
|
type: "array",
|
|
1222
1275
|
items: { type: "string" },
|
|
@@ -1234,10 +1287,10 @@ function se(e, t) {
|
|
|
1234
1287
|
});
|
|
1235
1288
|
})), e.registerTool("list_webhook_deliveries", {
|
|
1236
1289
|
title: "List webhook deliveries",
|
|
1237
|
-
description: "List one subscription's delivery attempts, most recent first. status is Pending (awaiting an attempt, backing off, or in flight), Succeeded or DeadLettered; lastResponseStatusCode and lastError explain a failure. Paginated via cursor. " +
|
|
1290
|
+
description: "List one subscription's delivery attempts, most recent first. status is Pending (awaiting an attempt, backing off, or in flight), Succeeded or DeadLettered; lastResponseStatusCode and lastError explain a failure. Paginated via cursor. " + K,
|
|
1238
1291
|
inputSchema: n.object({
|
|
1239
1292
|
id: n.string().describe("Subscription id (from list_webhooks)"),
|
|
1240
|
-
...
|
|
1293
|
+
...j
|
|
1241
1294
|
}),
|
|
1242
1295
|
outputSchema: S("GET /api/v1/orgs/{org}/webhooks/{id}/deliveries"),
|
|
1243
1296
|
annotations: { readOnlyHint: !0 }
|
|
@@ -1246,7 +1299,7 @@ function se(e, t) {
|
|
|
1246
1299
|
cursor: r
|
|
1247
1300
|
} })))), e.registerTool("manage_webhook", {
|
|
1248
1301
|
title: "Create, update, or delete a webhook subscription, or rotate its secret",
|
|
1249
|
-
description: "action=create requires name + url and returns the signing secret. action=update/delete/rotate_secret/retire_secret require id. provider (create only, default GenericHttp) is the destination type: a Slack incoming webhook URL (https://hooks.slack.com/services/...) needs provider: \"Slack\", which posts readable channel messages; a subscription's provider can never change. update changes only the fields you pass and keeps the rest; pass an empty list to widen that filter back to \"all\". projects take project keys or ids; environments take \"<project>/<environment>\" keys (e.g. \"web/production\") or ids. eventTypes come from list_webhooks → availableEventTypes. create and rotate_secret return a secret that is NEVER shown again: relay it to the user verbatim so they can store it. Slack doesn't verify signatures, so a Slack subscription's secret is unused and rotate_secret is refused for one. rotate_secret adds a new active secret while the old one keeps signing; retire_secret (secretId from list_webhooks) removes one and is refused for the last active secret. A project-restricted service token must list at least one project, all in its scope. " +
|
|
1302
|
+
description: "action=create requires name + url and returns the signing secret. action=update/delete/rotate_secret/retire_secret require id. provider (create only, default GenericHttp) is the destination type: a Slack incoming webhook URL (https://hooks.slack.com/services/...) needs provider: \"Slack\", which posts readable channel messages; provider: \"Datadog\" sends Events API change events (url is your site's https://event-management-intake.<site>/api/v2/events) and provider: \"Grafana\" creates annotations (url is https://<your grafana>/api/annotations). Datadog and Grafana require credential (a Datadog API key, or a Grafana service account token that can create annotations, e.g. Editor); GenericHttp and Slack refuse it. credential is write-only: stored encrypted, never returned, and never echoed in this tool's output. A subscription's provider can never change. update changes only the fields you pass and keeps the rest; pass an empty list to widen that filter back to \"all\". projects take project keys or ids; environments take \"<project>/<environment>\" keys (e.g. \"web/production\") or ids. eventTypes come from list_webhooks → availableEventTypes. create and rotate_secret return a secret that is NEVER shown again: relay it to the user verbatim so they can store it (for a GenericHttp subscription only: Slack, Datadog and Grafana never check it, so skip it there). Slack doesn't verify signatures, so a Slack subscription's secret is unused and rotate_secret is refused for one, and so are Datadog and Grafana ones, which authenticate with credential instead. On update, omit credential to keep the stored one; changing the url of a Datadog or Grafana subscription requires sending credential again. rotate_secret adds a new active secret while the old one keeps signing; retire_secret (secretId from list_webhooks) removes one and is refused for the last active secret. A project-restricted service token must list at least one project, all in its scope. " + K,
|
|
1250
1303
|
inputSchema: n.object({
|
|
1251
1304
|
action: n.enum([
|
|
1252
1305
|
"create",
|
|
@@ -1258,7 +1311,13 @@ function se(e, t) {
|
|
|
1258
1311
|
id: n.string().optional().describe("Subscription id; required for everything except create"),
|
|
1259
1312
|
name: n.string().optional().describe("Required for create"),
|
|
1260
1313
|
url: n.string().optional().describe("Receiver URL; required for create"),
|
|
1261
|
-
provider: n.enum([
|
|
1314
|
+
provider: n.enum([
|
|
1315
|
+
"GenericHttp",
|
|
1316
|
+
"Slack",
|
|
1317
|
+
"Datadog",
|
|
1318
|
+
"Grafana"
|
|
1319
|
+
]).optional().describe("create only. Slack for a hooks.slack.com/services/ URL; Datadog or Grafana for those destinations (credential required); GenericHttp (default) for your own endpoint"),
|
|
1320
|
+
credential: n.string().optional().describe("Write-only. Datadog API key or Grafana service account token (permission to create annotations). Required on create for Datadog and Grafana, refused for GenericHttp and Slack. On update, omit to keep the stored one; required again when changing url on a Datadog or Grafana subscription. Never returned."),
|
|
1262
1321
|
eventTypes: n.array(n.string()).optional().describe("Event types to send; empty or omitted = all"),
|
|
1263
1322
|
projects: n.array(n.string()).optional().describe("Project keys or ids to cover; empty or omitted on create = all"),
|
|
1264
1323
|
environments: n.array(n.string()).optional().describe("\"<project>/<environment>\" keys or environment ids; empty or omitted on create = all"),
|
|
@@ -1289,39 +1348,43 @@ function se(e, t) {
|
|
|
1289
1348
|
retiredSecretId: { type: "string" }
|
|
1290
1349
|
}, ["id", "retiredSecretId"])),
|
|
1291
1350
|
annotations: { destructiveHint: !0 }
|
|
1292
|
-
}, async ({ action: e, id: n, name: c, url: l, provider: u,
|
|
1351
|
+
}, async ({ action: e, id: n, name: c, url: l, provider: u, credential: m, eventTypes: h, projects: g, environments: _, enabled: v, secretId: y, idempotency_key: b }) => p(async () => {
|
|
1293
1352
|
if (u && e !== "create") return f(/* @__PURE__ */ Error("provider applies only to action=create: a subscription's provider can't change. To switch destination type, create a new subscription and delete this one."));
|
|
1294
1353
|
if (e === "create") {
|
|
1295
1354
|
if (!c || !l) return f(/* @__PURE__ */ Error("action=create requires name and url"));
|
|
1296
1355
|
let e = u ?? "GenericHttp";
|
|
1297
|
-
if (e === "GenericHttp" &&
|
|
1298
|
-
let n =
|
|
1356
|
+
if (e === "GenericHttp" && q(l)) return f(/* @__PURE__ */ Error(J));
|
|
1357
|
+
let n = _ && await s(_), i = g && await a(g);
|
|
1299
1358
|
return d(await t.api.request("POST", r, {
|
|
1300
1359
|
body: {
|
|
1301
1360
|
name: c,
|
|
1302
1361
|
url: l,
|
|
1303
1362
|
provider: e,
|
|
1304
|
-
|
|
1363
|
+
credential: m,
|
|
1364
|
+
eventTypes: h,
|
|
1305
1365
|
projectIds: i,
|
|
1306
1366
|
environmentIds: n
|
|
1307
1367
|
},
|
|
1308
|
-
idempotencyKey:
|
|
1368
|
+
idempotencyKey: b
|
|
1309
1369
|
}));
|
|
1310
1370
|
}
|
|
1311
1371
|
if (!n) return f(/* @__PURE__ */ Error(`action=${e} requires id (see list_webhooks)`));
|
|
1312
1372
|
if (e === "update") {
|
|
1313
|
-
let e =
|
|
1314
|
-
if (l && o.provider === "GenericHttp" &&
|
|
1373
|
+
let e = _ && await s(_), r = g && await a(g), { data: o, etag: u } = await t.api.requestWithEtag("GET", i(n));
|
|
1374
|
+
if (l && o.provider === "GenericHttp" && q(l)) return f(/* @__PURE__ */ Error(`${J} This subscription is GenericHttp, and a provider can't change.`));
|
|
1315
1375
|
let p = {
|
|
1316
1376
|
name: c ?? o.name,
|
|
1317
1377
|
url: l ?? o.url,
|
|
1318
|
-
eventTypes:
|
|
1378
|
+
eventTypes: h ?? o.eventTypes,
|
|
1319
1379
|
projectIds: r ?? o.projectIds,
|
|
1320
1380
|
environmentIds: e ?? o.environmentIds,
|
|
1321
|
-
isEnabled:
|
|
1381
|
+
isEnabled: v ?? o.isEnabled
|
|
1322
1382
|
};
|
|
1323
1383
|
return await t.api.request("PUT", i(n), {
|
|
1324
|
-
body:
|
|
1384
|
+
body: m ? {
|
|
1385
|
+
...p,
|
|
1386
|
+
credential: m
|
|
1387
|
+
} : p,
|
|
1325
1388
|
ifMatch: u
|
|
1326
1389
|
}), d({
|
|
1327
1390
|
id: n,
|
|
@@ -1329,13 +1392,18 @@ function se(e, t) {
|
|
|
1329
1392
|
...p
|
|
1330
1393
|
});
|
|
1331
1394
|
}
|
|
1332
|
-
|
|
1395
|
+
if (e === "delete") return await t.api.request("DELETE", i(n)), d({ deleted: n });
|
|
1396
|
+
if (e === "rotate_secret") {
|
|
1397
|
+
let e = await t.api.request("GET", i(n));
|
|
1398
|
+
return e.provider === "Datadog" || e.provider === "Grafana" ? f(/* @__PURE__ */ Error(`This is a ${e.provider} subscription. It authenticates with its credential, not a signing secret, so rotating a secret changes nothing. To replace the credential, update the subscription and pass credential.`)) : e.provider === "Slack" ? f(/* @__PURE__ */ Error("This is a Slack subscription. Slack doesn't verify signatures, so its signing secret is unused and rotating it changes nothing. If the Slack webhook URL leaked, create a new incoming webhook in Slack, update this subscription to the new url, and delete the old webhook in Slack.")) : d(await t.api.request("POST", `${i(n)}/secrets`, { idempotencyKey: b }));
|
|
1399
|
+
}
|
|
1400
|
+
return y ? (await t.api.request("DELETE", `${i(n)}/secrets/${o(y)}`), d({
|
|
1333
1401
|
id: n,
|
|
1334
|
-
retiredSecretId:
|
|
1402
|
+
retiredSecretId: y
|
|
1335
1403
|
})) : f(/* @__PURE__ */ Error("action=retire_secret requires secretId (see list_webhooks)"));
|
|
1336
1404
|
})), e.registerTool("deliver_webhook", {
|
|
1337
1405
|
title: "Send a test event or redeliver",
|
|
1338
|
-
description: "action=test queues one synthetic flag.toggled event to this subscription alone; action=redeliver (deliveryId from list_webhook_deliveries) re-sends a finished delivery, restarting its retry schedule. Delivery is asynchronous: read list_webhook_deliveries for the outcome. Both are refused for a disabled subscription, and redeliver for a delivery that is still Pending. " +
|
|
1406
|
+
description: "action=test queues one synthetic flag.toggled event to this subscription alone; action=redeliver (deliveryId from list_webhook_deliveries) re-sends a finished delivery, restarting its retry schedule. Delivery is asynchronous: read list_webhook_deliveries for the outcome. Both are refused for a disabled subscription, and redeliver for a delivery that is still Pending. " + K,
|
|
1339
1407
|
inputSchema: n.object({
|
|
1340
1408
|
action: n.enum(["test", "redeliver"]).describe("test sends a synthetic event; redeliver re-sends deliveryId"),
|
|
1341
1409
|
id: n.string().describe("Subscription id (from list_webhooks)"),
|
|
@@ -1355,15 +1423,15 @@ function se(e, t) {
|
|
|
1355
1423
|
})) : f(/* @__PURE__ */ Error("action=redeliver requires deliveryId (see list_webhook_deliveries)"))));
|
|
1356
1424
|
}
|
|
1357
1425
|
// src/tools/workflows/stale-flags.ts
|
|
1358
|
-
var ce = n.enum(["dead", "stale"]),
|
|
1426
|
+
var ce = n.enum(["dead", "stale"]), Y = 50;
|
|
1359
1427
|
function le(e, t) {
|
|
1360
1428
|
e.registerTool("find_stale_flags", {
|
|
1361
1429
|
title: "Find stale flags",
|
|
1362
|
-
description: `Find flags that look ready for code cleanup: not updated in N days AND either enabled in every environment (verify rollout is complete before removing — per-rule percentage ramps are not inspected) or disabled in every environment (dead — remove flag and code path). A flag whose expiry date (set_flag_expiry) has passed is always a candidate, however recently it was edited; if it is on in some environments and off in others its reason is past-expiry, meaning the owner has to decide which way to fold it. A project can give its temporary flags a default lifetime, so a flag with no date of its own can still be past expiry. Every result carries expiresAtUtc (the date set on the flag), effectiveExpiresAtUtc (the date in effect, from the flag or its project default), expirySource (explicit, project-default, or null), expired and owner (null when unowned). Flags marked permanent (kill switches, ops toggles) are never listed. Pass owner to see one person's stale flags ("me" for your own) or "none" for the unowned ones. Every result also carries blockedBy: the live flags that still list it as a prerequisite, which have to be removed and archived before it ([] when none). blockedBy is null when the server did not classify the flag as a removal candidate, which means unknown, not unblocked. A flag that other live flags list as a prerequisite has to be removed LAST, dependents first: archiving it while a dependent still names it makes that dependent fail its prerequisite check and serve its off variation, so archive_flag refuses it with FLAG_HAS_DEPENDENTS. Checks at most ${
|
|
1430
|
+
description: `Find flags that look ready for code cleanup: not updated in N days AND either enabled in every environment (verify rollout is complete before removing — per-rule percentage ramps are not inspected) or disabled in every environment (dead — remove flag and code path). A flag whose expiry date (set_flag_expiry) has passed is always a candidate, however recently it was edited; if it is on in some environments and off in others its reason is past-expiry, meaning the owner has to decide which way to fold it. A project can give its temporary flags a default lifetime, so a flag with no date of its own can still be past expiry. Every result carries expiresAtUtc (the date set on the flag), effectiveExpiresAtUtc (the date in effect, from the flag or its project default), expirySource (explicit, project-default, or null), expired and owner (null when unowned). Flags marked permanent (kill switches, ops toggles) are never listed. Pass owner to see one person's stale flags ("me" for your own) or "none" for the unowned ones. Every result also carries blockedBy: the live flags that still list it as a prerequisite, which have to be removed and archived before it ([] when none). blockedBy is null when the server did not classify the flag as a removal candidate, which means unknown, not unblocked. A flag that other live flags list as a prerequisite has to be removed LAST, dependents first: archiving it while a dependent still names it makes that dependent fail its prerequisite check and serve its off variation, so archive_flag refuses it with FLAG_HAS_DEPENDENTS. Checks at most ${Y} candidates per call, expired flags first.`,
|
|
1363
1431
|
inputSchema: n.object({
|
|
1364
1432
|
project: D,
|
|
1365
1433
|
days: n.number().int().min(1).optional().default(30).describe("Minimum age in days since last update"),
|
|
1366
|
-
owner:
|
|
1434
|
+
owner: z
|
|
1367
1435
|
}),
|
|
1368
1436
|
outputSchema: w({
|
|
1369
1437
|
project: { type: "string" },
|
|
@@ -1408,7 +1476,7 @@ function le(e, t) {
|
|
|
1408
1476
|
]),
|
|
1409
1477
|
annotations: { readOnlyHint: !0 }
|
|
1410
1478
|
}, async ({ project: e, days: n, owner: r }) => p(async () => {
|
|
1411
|
-
let a = await
|
|
1479
|
+
let a = await B(t, r), s = `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags`, c = Date.now(), l = c - n * 24 * 60 * 60 * 1e3, u = (e) => e.effectiveExpiresAtUtc ?? e.expiresAtUtc ?? null, f = (e) => e.expirySource ?? (e.expiresAtUtc ? "explicit" : null), p = (e) => {
|
|
1412
1480
|
let t = u(e);
|
|
1413
1481
|
return !!t && new Date(t).getTime() <= c;
|
|
1414
1482
|
}, m = [], h;
|
|
@@ -1423,7 +1491,7 @@ function le(e, t) {
|
|
|
1423
1491
|
m.push(...(e.items ?? []).filter((e) => !!e.key && !!e.name && !!e.updatedAt && (new Date(e.updatedAt).getTime() < l || p(e)))), h = e.next_cursor ?? void 0;
|
|
1424
1492
|
} while (h);
|
|
1425
1493
|
m.sort((e, t) => Number(p(t)) - Number(p(e)));
|
|
1426
|
-
let g = m.length >
|
|
1494
|
+
let g = m.length > Y, _ = m.slice(0, Y), v = [];
|
|
1427
1495
|
for (let e of _) {
|
|
1428
1496
|
let n = await t.api.request("GET", `${s}/${o(e.key)}/environments`);
|
|
1429
1497
|
if (n.length === 0) continue;
|
|
@@ -1465,7 +1533,7 @@ function le(e, t) {
|
|
|
1465
1533
|
...a ? { owner: a } : {},
|
|
1466
1534
|
checked: _.length,
|
|
1467
1535
|
truncated: g,
|
|
1468
|
-
...g ? { note: `Only the first ${
|
|
1536
|
+
...g ? { note: `Only the first ${Y} of ${m.length} candidates were checked.` } : {},
|
|
1469
1537
|
...y ? { blockedByNote: y } : {},
|
|
1470
1538
|
stale: v
|
|
1471
1539
|
});
|
|
@@ -1475,7 +1543,7 @@ function le(e, t) {
|
|
|
1475
1543
|
inputSchema: n.object({
|
|
1476
1544
|
project: D,
|
|
1477
1545
|
staleness: ce.optional().describe("Minimum staleness tier: dead (default) or stale"),
|
|
1478
|
-
...
|
|
1546
|
+
...j
|
|
1479
1547
|
}),
|
|
1480
1548
|
outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/flags/removal-candidates"),
|
|
1481
1549
|
annotations: { readOnlyHint: !0 }
|
|
@@ -1494,16 +1562,16 @@ var ue = [
|
|
|
1494
1562
|
"php",
|
|
1495
1563
|
"ruby",
|
|
1496
1564
|
"swift"
|
|
1497
|
-
],
|
|
1565
|
+
], de = [
|
|
1498
1566
|
"browser",
|
|
1499
1567
|
"react",
|
|
1500
1568
|
"swift"
|
|
1501
1569
|
];
|
|
1502
|
-
function
|
|
1503
|
-
return
|
|
1570
|
+
function fe(e) {
|
|
1571
|
+
return de.includes(e);
|
|
1504
1572
|
}
|
|
1505
1573
|
var X = "Uses a SERVER-side SDK key (Featureflip dashboard → environment → SDK keys).", Z = "Uses a CLIENT-side SDK key (safe to ship to browsers/apps).";
|
|
1506
|
-
function
|
|
1574
|
+
function pe(e, t) {
|
|
1507
1575
|
switch (e) {
|
|
1508
1576
|
case "js": return {
|
|
1509
1577
|
install: "npm install @featureflip/js",
|
|
@@ -1652,7 +1720,7 @@ if enabled {
|
|
|
1652
1720
|
}
|
|
1653
1721
|
}
|
|
1654
1722
|
// src/tools/workflows/wrap-feature.ts
|
|
1655
|
-
function
|
|
1723
|
+
function me(e, t) {
|
|
1656
1724
|
e.registerTool("wrap_feature", {
|
|
1657
1725
|
title: "Wrap a feature in a new flag",
|
|
1658
1726
|
description: "Create a Boolean feature flag and get back the SDK code snippet to guard the new code path with it. Returns the snippet only — apply the edit yourself. The flag starts DISABLED in every environment; enable it with toggle_flag when ready.",
|
|
@@ -1691,10 +1759,10 @@ function pe(e, t) {
|
|
|
1691
1759
|
type: "Boolean",
|
|
1692
1760
|
description: i,
|
|
1693
1761
|
tags: a,
|
|
1694
|
-
...
|
|
1762
|
+
...fe(s) ? { clientSideVisible: !0 } : {}
|
|
1695
1763
|
},
|
|
1696
1764
|
idempotencyKey: c
|
|
1697
|
-
}), u =
|
|
1765
|
+
}), u = pe(s, n);
|
|
1698
1766
|
return d({
|
|
1699
1767
|
flag: l,
|
|
1700
1768
|
integration: {
|
|
@@ -1712,12 +1780,12 @@ function pe(e, t) {
|
|
|
1712
1780
|
}));
|
|
1713
1781
|
}
|
|
1714
1782
|
// src/server.ts
|
|
1715
|
-
function
|
|
1783
|
+
function he(t) {
|
|
1716
1784
|
let n = new e({
|
|
1717
1785
|
name: "featureflip",
|
|
1718
1786
|
version: r
|
|
1719
1787
|
});
|
|
1720
|
-
return
|
|
1788
|
+
return M(n, t), N(n, t), ee(n, t), te(n, t), H(n, t), re(n, t), ae(n, t), oe(n, t), se(n, t), le(n, t), me(n, t), n;
|
|
1721
1789
|
}
|
|
1722
1790
|
// src/config.ts
|
|
1723
1791
|
var Q = "FEATUREFLIP_TOKEN is required. Create one in the Featureflip dashboard — Settings → API Tokens (personal token, ffp_...) or Organization Settings → Service Tokens (ffs_...) — and set it in your MCP client config.";
|
|
@@ -1729,13 +1797,13 @@ function $(e = process.env) {
|
|
|
1729
1797
|
org: e.FEATUREFLIP_ORG?.trim() || void 0
|
|
1730
1798
|
} : null;
|
|
1731
1799
|
}
|
|
1732
|
-
function
|
|
1800
|
+
function ge(e = process.env) {
|
|
1733
1801
|
let t = $(e);
|
|
1734
1802
|
if (!t) throw Error(Q);
|
|
1735
1803
|
return t;
|
|
1736
1804
|
}
|
|
1737
1805
|
// src/org.ts
|
|
1738
|
-
async function
|
|
1806
|
+
async function _e(e, t) {
|
|
1739
1807
|
if (t) return t;
|
|
1740
1808
|
let n = (await e.request("GET", "/api/v1/orgs", { query: { limit: 100 } })).items ?? [];
|
|
1741
1809
|
if (n.length === 1) {
|
|
@@ -1745,4 +1813,4 @@ async function ge(e, t) {
|
|
|
1745
1813
|
}
|
|
1746
1814
|
throw n.length === 0 ? Error("The token can see no organizations. Check the token in the Featureflip dashboard.") : Error(`The token can see ${n.length} organizations — set FEATUREFLIP_ORG to one of: ` + n.map((e) => e.slug ?? "?").join(", "));
|
|
1747
1815
|
}
|
|
1748
|
-
export {
|
|
1816
|
+
export { he as a, r as c, $ as i, Q as n, i as o, ge as r, u as s, _e as t };
|