Skip to content

Commit

Permalink
feat(PublicFunctions): add getExApp method (#326)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
  • Loading branch information
andrey18106 committed Jul 12, 2024
1 parent 5b52b31 commit 6ba18b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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;
}
}

0 comments on commit 6ba18b7

Please sign in to comment.