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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Note: Nextcloud 27 is no longer supported since this version.

- New OCS API endpoint to setAppInitProgress. The old one is marked as deprecated. #319
- Added default timeout for requestToExApp function set to 3s. #277
- Added new PublicFunction method `getExApp`. #326

### Changed

Expand Down
21 changes: 21 additions & 0 deletions lib/PublicFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,25 @@ public function asyncExAppRequestWithUserInit(
}
return $this->service->requestToExAppAsync($exApp, $route, $userId, $method, $params, $options, $request);
}

/**
* Get basic ExApp info by appid
*
* @param string $appId
*
* @return array ExApp info (appid, version, name, enabled) or null if no ExApp found
*/
public function getExApp(string $appId): ?array {
$exApp = $this->exAppService->getExApp($appId);
if ($exApp !== null) {
$info = $exApp->jsonSerialize();
return [
'appid' => $info['appid'],
'version' => $info['version'],
'name' => $info['name'],
'enabled' => $info['enabled'],
];
}
return null;
}
}