Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Controller/SignalingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private function getFederationSettings(?Room $room): ?array {
*
* @param int $serverId ID of the signaling server
* @psalm-param non-negative-int $serverId
* @return DataResponse<Http::STATUS_OK, array<string, mixed>, array{}>|DataResponse<Http::STATUS_NOT_FOUND, null, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{error: string, version?: string}, array{}>
* @return DataResponse<Http::STATUS_OK, array{version: string, warning?: string, features?: non-empty-list<string>}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, null, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{error: string, version?: string}, array{}>
*
* 200: Welcome message returned
* 404: Signaling server not found
Expand Down
6 changes: 3 additions & 3 deletions lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@
* }
*
* @psalm-type TalkCapabilities = array{
* features: list<string>,
* features-local: list<string>,
* features: non-empty-list<string>,
* features-local: non-empty-list<string>,
* config: array{
* attachments: array{
* allowed: bool,
Expand Down Expand Up @@ -502,7 +502,7 @@
* hello-v2-token-key?: string,
* },
* },
* config-local: array<string, list<string>>,
* config-local: array<string, non-empty-list<string>>,
* version: string,
* }
*/
Expand Down
9 changes: 7 additions & 2 deletions lib/Signaling/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(

/**
* @param int $serverId
* @return array{status: Http::STATUS_OK, data: array<string, mixed>}|array{status: Http::STATUS_INTERNAL_SERVER_ERROR, data: array{error: string, version?: string}}
* @return array{status: Http::STATUS_OK, data: array{version: string, warning?: string, features?: non-empty-list<string>}}|array{status: Http::STATUS_INTERNAL_SERVER_ERROR, data: array{error: string, version?: string}}
* @throws \OutOfBoundsException When the serverId is not found
*/
public function checkServerCompatibility(int $serverId): array {
Expand Down Expand Up @@ -144,7 +144,9 @@ public function checkServerCompatibility(int $serverId): array {

return [
'status' => Http::STATUS_OK,
'data' => $data,
'data' => [
'version' => $data['version'],
],
];
} catch (ConnectException) {
return [
Expand Down Expand Up @@ -175,6 +177,9 @@ public function isCompatibleSignalingServer(IResponse $response): bool {
&& in_array('switchto', $features, true);
}

/**
* @return list<string>
*/
public function getSignalingServerMissingFeatures(IResponse $response): array {
$featureHeader = $response->getHeader(self::FEATURE_HEADER);
$features = explode(',', $featureHeader);
Expand Down
28 changes: 23 additions & 5 deletions openapi-administration.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -356,7 +358,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down Expand Up @@ -1494,8 +1497,23 @@
},
"data": {
"type": "object",
"additionalProperties": {
"type": "object"
"required": [
"version"
],
"properties": {
"version": {
"type": "string"
},
"warning": {
"type": "string"
},
"features": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions openapi-backend-recording.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -289,7 +291,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down
9 changes: 6 additions & 3 deletions openapi-backend-signaling.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -289,7 +291,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down
9 changes: 6 additions & 3 deletions openapi-backend-sipbridge.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -332,7 +334,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down
9 changes: 6 additions & 3 deletions openapi-bots.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -289,7 +291,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down
9 changes: 6 additions & 3 deletions openapi-federation.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -332,7 +334,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down
28 changes: 23 additions & 5 deletions openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -490,7 +492,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down Expand Up @@ -23185,8 +23188,23 @@
},
"data": {
"type": "object",
"additionalProperties": {
"type": "object"
"required": [
"version"
],
"properties": {
"version": {
"type": "string"
},
"warning": {
"type": "string"
},
"features": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,15 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"features-local": {
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
},
"config": {
"type": "object",
Expand Down Expand Up @@ -449,7 +451,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"minItems": 1
}
},
"version": {
Expand Down
4 changes: 3 additions & 1 deletion src/types/openapi/openapi-administration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,9 @@ export interface operations {
ocs: {
meta: components["schemas"]["OCSMeta"];
data: {
[key: string]: Record<string, never>;
version: string;
warning?: string;
features?: string[];
};
};
};
Expand Down
4 changes: 3 additions & 1 deletion src/types/openapi/openapi-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11164,7 +11164,9 @@ export interface operations {
ocs: {
meta: components["schemas"]["OCSMeta"];
data: {
[key: string]: Record<string, never>;
version: string;
warning?: string;
features?: string[];
};
};
};
Expand Down
Loading