From 4560786cf6d7b2478311697cbe56a8fd7cb0497b Mon Sep 17 00:00:00 2001 From: ricz2024 Date: Wed, 9 Sep 2026 10:27:35 +0800 Subject: [PATCH] feat: add Organization.SyncFeatureFlags --- openapiv2/apidocs.swagger.json | 52 ++++++++++++++++++++++++++++++++++ org/v1/org.proto | 29 ++++++++++++++++++- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/openapiv2/apidocs.swagger.json b/openapiv2/apidocs.swagger.json index 62a184cd..7210a7ec 100644 --- a/openapiv2/apidocs.swagger.json +++ b/openapiv2/apidocs.swagger.json @@ -2816,6 +2816,29 @@ ] } }, + "/org/v1:syncFeatureFlags": { + "post": { + "summary": "Self-heals the caller's own Wave feature-flag state against the MSP's\nroot Ripple state, correcting any drift caused by a missed or delayed\nsync, and returns the corrected state.", + "operationId": "Organization_SyncFeatureFlags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SyncFeatureFlagsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "Organization" + ] + } + }, "/org/v1:verify": { "post": { "summary": "WORK-IN-PROGRESS: Verifies an organization using the key received from the verification email.\nThe verification key is only valid for a day.", @@ -40664,6 +40687,22 @@ "format" ] }, + "v1FeatureFlagState": { + "type": "object", + "properties": { + "featureName": { + "type": "string" + }, + "featureId": { + "type": "string", + "description": "The Wave feature UUID, as used by Wave's own $flag(feature_id) checks." + }, + "enabled": { + "type": "boolean" + } + }, + "description": "A single Wave feature flag's corrected state." + }, "v1FeatureSetting": { "type": "object", "properties": { @@ -47304,6 +47343,19 @@ } } }, + "v1SyncFeatureFlagsResponse": { + "type": "object", + "properties": { + "flags": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1FeatureFlagState" + } + } + }, + "description": "Response message for the Organization.SyncFeatureFlags rpc." + }, "v1TagSetting": { "type": "object", "properties": { diff --git a/org/v1/org.proto b/org/v1/org.proto index 250aa4a6..a59c9d30 100644 --- a/org/v1/org.proto +++ b/org/v1/org.proto @@ -86,6 +86,15 @@ service Organization { delete: "/org/v1" }; } + + // Self-heals the caller's own Wave feature-flag state against the MSP's + // root Ripple state, correcting any drift caused by a missed or delayed + // sync, and returns the corrected state. + rpc SyncFeatureFlags(SyncFeatureFlagsRequest) returns (SyncFeatureFlagsResponse) { + option (google.api.http) = { + post: "/org/v1:syncFeatureFlags" + }; + } } // Request message for the Organization.CreateOrg rpc. @@ -146,4 +155,22 @@ message UpdatePasswordRequest { } // Request message for the Organization.DeleteOrg rpc. -message DeleteOrgRequest {} \ No newline at end of file +message DeleteOrgRequest {} + +// Request message for the Organization.SyncFeatureFlags rpc. +message SyncFeatureFlagsRequest {} + +// A single Wave feature flag's corrected state. +message FeatureFlagState { + string featureName = 1; + + // The Wave feature UUID, as used by Wave's own $flag(feature_id) checks. + string featureId = 2; + + bool enabled = 3; +} + +// Response message for the Organization.SyncFeatureFlags rpc. +message SyncFeatureFlagsResponse { + repeated FeatureFlagState flags = 1; +} \ No newline at end of file