diff --git a/appinfo/routes.php b/appinfo/routes.php index dc2edb6b3..f7362f963 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -10,25 +10,9 @@ $requirements = [ 'path' => '.+', ]; -$routes = [ +return [ 'routes' => [ // API ['name' => 'api#preflighted_cors', 'url' => '/api/{apiVersion}/{path}', 'verb' => 'OPTIONS', 'requirements' => $requirements], ], ]; - -return array_merge_recursive( - $routes, - include(__DIR__ . '/routes/routesAccountController.php'), - include(__DIR__ . '/routes/routesAdminController.php'), - include(__DIR__ . '/routes/routesDevelopController.php'), - include(__DIR__ . '/routes/routesFileController.php'), - include(__DIR__ . '/routes/routesFileElementsController.php'), - include(__DIR__ . '/routes/routesIdentifyAccountController.php'), - include(__DIR__ . '/routes/routesNotifyController.php'), - include(__DIR__ . '/routes/routesPageController.php'), - include(__DIR__ . '/routes/routesRequestSignatureController.php'), - include(__DIR__ . '/routes/routesSettingsController.php'), - include(__DIR__ . '/routes/routesSignatureElementsController.php'), - include(__DIR__ . '/routes/routesSignFileController.php'), -); diff --git a/appinfo/routes/routesAccountController.php b/appinfo/routes/routesAccountController.php deleted file mode 100644 index e707d95d2..000000000 --- a/appinfo/routes/routesAccountController.php +++ /dev/null @@ -1,27 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'account#createToSign', 'url' => '/api/{apiVersion}/account/create/{uuid}', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'account#me', 'url' => '/api/{apiVersion}/account/me', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'account#uploadPfx', 'url' => '/api/{apiVersion}/account/pfx', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'account#readPfxData', 'url' => '/api/{apiVersion}/account/pfx/read', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'account#updatePfxPassword', 'url' => '/api/{apiVersion}/account/pfx', 'verb' => 'PATCH', 'requirements' => $requirements], - ['name' => 'account#deletePfx', 'url' => '/api/{apiVersion}/account/pfx', 'verb' => 'DELETE', 'requirements' => $requirements], - ['name' => 'account#updateSettings', 'url' => '/api/{apiVersion}/account/settings', 'verb' => 'PATCH', 'requirements' => $requirements], - ['name' => 'account#signatureGenerate', 'url' => '/api/{apiVersion}/account/signature', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'account#addFiles', 'url' => '/api/{apiVersion}/account/files', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'account#deleteFile', 'url' => '/api/{apiVersion}/account/files', 'verb' => 'DELETE', 'requirements' => $requirements], - ['name' => 'account#accountFileListToOwner', 'url' => '/api/{apiVersion}/account/files', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'account#accountFileListToApproval', 'url' => '/api/{apiVersion}/account/files/approval/list', 'verb' => 'GET', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesAdminController.php b/appinfo/routes/routesAdminController.php deleted file mode 100644 index 75b2fb849..000000000 --- a/appinfo/routes/routesAdminController.php +++ /dev/null @@ -1,20 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'admin#installAndValidate', 'url' => '/api/{apiVersion}/admin/install-and-validate', 'verb' => 'GET'], - ['name' => 'admin#generateCertificateCfssl', 'url' => '/api/{apiVersion}/admin/certificate/cfssl', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'admin#generateCertificateOpenSsl', 'url' => '/api/{apiVersion}/admin/certificate/openssl', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'admin#loadCertificate', 'url' => '/api/{apiVersion}/admin/certificate', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'admin#configureCheck', 'url' => '/api/{apiVersion}/admin/configure-check', 'verb' => 'GET', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesDevelopController.php b/appinfo/routes/routesDevelopController.php deleted file mode 100644 index af3295c6d..000000000 --- a/appinfo/routes/routesDevelopController.php +++ /dev/null @@ -1,12 +0,0 @@ - [ - ['name' => 'develop#pdf', 'url' => '/develop/pdf', 'verb' => 'GET'], - ], -]; diff --git a/appinfo/routes/routesFileController.php b/appinfo/routes/routesFileController.php deleted file mode 100644 index 23d3671fb..000000000 --- a/appinfo/routes/routesFileController.php +++ /dev/null @@ -1,21 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'File#save', 'url' => '/api/{apiVersion}/file', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'File#list', 'url' => '/api/{apiVersion}/file/list', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'File#getThumbnail', 'url' => '/api/{apiVersion}/file/thumbnail/{nodeId}', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'File#validate', 'url' => '/api/{apiVersion}/file/validate/', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'File#validateUuid', 'url' => '/api/{apiVersion}/file/validate/uuid/{uuid}', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'File#validateFileId', 'url' => '/api/{apiVersion}/file/validate/file_id/{fileId}', 'verb' => 'GET', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesFileElementsController.php b/appinfo/routes/routesFileElementsController.php deleted file mode 100644 index 1d0ac8329..000000000 --- a/appinfo/routes/routesFileElementsController.php +++ /dev/null @@ -1,18 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'FileElement#post', 'url' => '/api/{apiVersion}/file-element/{uuid}', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'FileElement#patch', 'url' => '/api/{apiVersion}/file-element/{uuid}/{elementId}', 'verb' => 'PATCH', 'requirements' => $requirements], - ['name' => 'FileElement#delete', 'url' => '/api/{apiVersion}/file-element/{uuid}/{elementId}', 'verb' => 'DELETE', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesIdentifyAccountController.php b/appinfo/routes/routesIdentifyAccountController.php deleted file mode 100644 index 34fa8449a..000000000 --- a/appinfo/routes/routesIdentifyAccountController.php +++ /dev/null @@ -1,16 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'IdentifyAccount#search', 'url' => '/api/{apiVersion}/identify-account/search', 'verb' => 'GET', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesNotifyController.php b/appinfo/routes/routesNotifyController.php deleted file mode 100644 index e55257b76..000000000 --- a/appinfo/routes/routesNotifyController.php +++ /dev/null @@ -1,18 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'notify#signer', 'url' => '/api/{apiVersion}/notify/signer', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'notify#signers', 'url' => '/api/{apiVersion}/notify/signers', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'notify#notificationDismiss', 'url' => '/api/{apiVersion}/notif/notification', 'verb' => 'DELETE', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesPageController.php b/appinfo/routes/routesPageController.php deleted file mode 100644 index 31deeda84..000000000 --- a/appinfo/routes/routesPageController.php +++ /dev/null @@ -1,34 +0,0 @@ - '(v1)', -]; - -return [ - 'routes' => [ - // Pages - restricted - ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], - ['name' => 'page#indexF', 'url' => '/f/', 'verb' => 'GET'], - ['name' => 'page#incomplete', 'url' => '/f/incomplete', 'verb' => 'GET'], - ['name' => 'page#signFPath', 'url' => '/f/sign/{uuid}/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'postfix' => 'extra'], - ['name' => 'page#signF', 'url' => '/f/sign/{uuid}', 'verb' => 'GET'], - ['name' => 'page#indexFPath', 'url' => '/f/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'postfix' => 'front'], - ['name' => 'page#getPdfFile', 'url' => '/pdf/{uuid}', 'verb' => 'GET'], - ['name' => 'page#resetPassword', 'url' => '/reset-password', 'verb' => 'GET'], - // Pages - public - ['name' => 'page#incompleteP', 'url' => '/p/incomplete', 'verb' => 'GET'], - ['name' => 'page#sign', 'url' => '/p/sign/{uuid}', 'verb' => 'GET'], - ['name' => 'page#sign', 'url' => '/p/sign/{uuid}/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'postfix' => 'extra'], - ['name' => 'page#signAccountFile', 'url' => '/p/account/files/approve/{uuid}', 'verb' => 'GET'], - ['name' => 'page#signAccountFile', 'url' => '/p/account/files/approve/{uuid}/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'postfix' => 'extra'], - ['name' => 'page#validation', 'url' => '/p/validation', 'verb' => 'GET'], - ['name' => 'page#validationFileWithShortUrl', 'url' => '/validation/{uuid}', 'verb' => 'GET'], - ['name' => 'page#validationFile', 'url' => '/p/validation/{uuid}', 'verb' => 'GET'], - ['name' => 'page#getPdf', 'url' => '/p/pdf/{uuid}', 'verb' => 'GET'] - ], -]; diff --git a/appinfo/routes/routesRequestSignatureController.php b/appinfo/routes/routesRequestSignatureController.php deleted file mode 100644 index 5965caf30..000000000 --- a/appinfo/routes/routesRequestSignatureController.php +++ /dev/null @@ -1,19 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'RequestSignature#request', 'url' => '/api/{apiVersion}/request-signature', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'RequestSignature#updateSign', 'url' => '/api/{apiVersion}/request-signature', 'verb' => 'PATCH', 'requirements' => $requirements], - ['name' => 'RequestSignature#deleteAllRequestSignatureUsingFileId', 'url' => '/api/{apiVersion}/sign/file_id/{fileId}', 'verb' => 'DELETE', 'requirements' => $requirements], - ['name' => 'RequestSignature#deleteOneRequestSignatureUsingFileId', 'url' => '/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}', 'verb' => 'DELETE', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesSettingsController.php b/appinfo/routes/routesSettingsController.php deleted file mode 100644 index 32949bc8b..000000000 --- a/appinfo/routes/routesSettingsController.php +++ /dev/null @@ -1,16 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'setting#hasRootCert', 'url' => '/api/{apiVersion}/setting/has-root-cert', 'verb' => 'GET', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesSignFileController.php b/appinfo/routes/routesSignFileController.php deleted file mode 100644 index ea1b3bd3f..000000000 --- a/appinfo/routes/routesSignFileController.php +++ /dev/null @@ -1,20 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'signFile#signUsingUuid', 'url' => '/api/{apiVersion}/sign/uuid/{uuid}', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'signFile#signUsingFileId', 'url' => '/api/{apiVersion}/sign/file_id/{fileId}', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'signFile#signRenew', 'url' => '/api/{apiVersion}/sign/uuid/{uuid}/renew/{method}', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'signFile#getCodeUsingUuid', 'url' => '/api/{apiVersion}/sign/uuid/{uuid}/code', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'signFile#getCodeUsingFileId', 'url' => '/api/{apiVersion}/sign/file_id/{fileId}/code', 'verb' => 'POST', 'requirements' => $requirements], - ], -]; diff --git a/appinfo/routes/routesSignatureElementsController.php b/appinfo/routes/routesSignatureElementsController.php deleted file mode 100644 index fb9a2b1b6..000000000 --- a/appinfo/routes/routesSignatureElementsController.php +++ /dev/null @@ -1,21 +0,0 @@ - '(v1)', -]; - -return [ - 'ocs' => [ - ['name' => 'SignatureElements#createSignatureElement', 'url' => '/api/{apiVersion}/signature/elements', 'verb' => 'POST', 'requirements' => $requirements], - ['name' => 'SignatureElements#getSignatureElements', 'url' => '/api/{apiVersion}/signature/elements', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'SignatureElements#getSignatureElementPreview','url' => '/api/{apiVersion}/signature/elements/preview/{nodeId}', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'SignatureElements#getSignatureElement', 'url' => '/api/{apiVersion}/signature/elements/{nodeId}', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'SignatureElements#patchSignatureElement', 'url' => '/api/{apiVersion}/signature/elements/{nodeId}', 'verb' => 'PATCH', 'requirements' => $requirements], - ['name' => 'SignatureElements#deleteSignatureElement', 'url' => '/api/{apiVersion}/signature/elements/{nodeId}', 'verb' => 'DELETE', 'requirements' => $requirements], - ], -]; diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 6b4a62850..9aca5c528 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -25,6 +25,7 @@ use OCA\Libresign\Service\SignerElementsService; use OCA\Libresign\Service\SignFileService; use OCP\Accounts\IAccountManager; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\CORS; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; @@ -84,6 +85,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur #[NoCSRFRequired] #[PublicPage] #[UseSession] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/account/create/{uuid}', requirements: ['apiVersion' => '(v1)'])] public function createToSign(string $uuid, string $email, string $password, ?string $signPassword): DataResponse { try { $data = [ @@ -145,6 +147,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/account/signature', requirements: ['apiVersion' => '(v1)'])] public function signatureGenerate( string $signPassword ): DataResponse { @@ -194,6 +197,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/account/files', requirements: ['apiVersion' => '(v1)'])] public function addFiles(array $files): DataResponse { try { $this->accountService->addFilesToAccount($files, $this->userSession->getUser()); @@ -232,6 +236,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'DELETE', url: '/api/{apiVersion}/account/files', requirements: ['apiVersion' => '(v1)'])] public function deleteFile(int $nodeId): DataResponse { try { $this->accountService->deleteFileFromAccount($nodeId, $this->userSession->getUser()); @@ -262,6 +267,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur #[CORS] #[NoCSRFRequired] #[PublicPage] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/account/me', requirements: ['apiVersion' => '(v1)'])] public function me(): DataResponse { $user = $this->userSession->getUser(); if (!$user) { @@ -299,6 +305,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/account/files', requirements: ['apiVersion' => '(v1)'])] public function accountFileListToOwner(array $filter = [], ?int $page = null, ?int $length = null): DataResponse { try { $filter['userId'] = $this->userSession->getUser()->getUID(); @@ -327,6 +334,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/account/files/approval/list', requirements: ['apiVersion' => '(v1)'])] public function accountFileListToApproval(array $filter = [], ?int $page = null, ?int $length = null): DataResponse { try { $this->validateHelper->userCanApproveValidationDocuments($this->userSession->getUser()); @@ -354,6 +362,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'PATCH', url: '/api/{apiVersion}/account/settings', requirements: ['apiVersion' => '(v1)'])] public function updateSettings(?string $phone = null): DataResponse { try { $user = $this->userSession->getUser(); @@ -398,6 +407,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'delete', url: '/api/{apiVersion}/account/pfx', requirements: ['apiVersion' => '(v1)'])] public function deletePfx(): DataResponse { $this->accountService->deletePfx($this->userSession->getUser()); return new DataResponse( @@ -419,6 +429,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/account/pfx', requirements: ['apiVersion' => '(v1)'])] public function uploadPfx(): DataResponse { $file = $this->request->getUploadedFile('file'); try { @@ -458,6 +469,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'PATCH', url: '/api/{apiVersion}/account/pfx', requirements: ['apiVersion' => '(v1)'])] public function updatePfxPassword($current, $new): DataResponse { try { $this->accountService->updatePfxPassword($this->userSession->getUser(), $current, $new); @@ -490,6 +502,7 @@ class AccountController extends AEnvironmentAwareController implements ISignatur */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/account/pfx/read', requirements: ['apiVersion' => '(v1)'])] public function readPfxData(string $password): DataResponse { try { $data = $this->accountService->readPfxData($this->userSession->getUser(), $password); diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 73e531e32..f2025f8a7 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -17,6 +17,7 @@ use OCA\Libresign\ResponseDefinitions; use OCA\Libresign\Service\Install\ConfigureCheckService; use OCA\Libresign\Service\Install\InstallService; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Services\IAppConfig; @@ -58,6 +59,7 @@ class AdminController extends AEnvironmentAwareController { * 401: Account not found */ #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/admin/certificate/cfssl', requirements: ['apiVersion' => '(v1)'])] public function generateCertificateCfssl( array $rootCert, string $cfsslUri = '', @@ -93,6 +95,7 @@ class AdminController extends AEnvironmentAwareController { * 401: Account not found */ #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/admin/certificate/openssl', requirements: ['apiVersion' => '(v1)'])] public function generateCertificateOpenSsl( array $rootCert, string $configPath = '' @@ -142,6 +145,7 @@ class AdminController extends AEnvironmentAwareController { * 200: OK */ #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/admin/certificate', requirements: ['apiVersion' => '(v1)'])] public function loadCertificate(): DataResponse { $engine = $this->certificateEngineHandler->getEngine(); /** @var LibresignEngineHandler */ @@ -175,6 +179,7 @@ class AdminController extends AEnvironmentAwareController { * 200: OK */ #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/admin/configure-check', requirements: ['apiVersion' => '(v1)'])] public function configureCheck(): DataResponse { /** @var LibresignConfigureCheck[] */ $configureCheckList = $this->configureCheckService->checkAll(); @@ -187,6 +192,7 @@ class AdminController extends AEnvironmentAwareController { * @IgnoreOpenAPI */ #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/admin/install-and-validate', requirements: ['apiVersion' => '(v1)'])] public function installAndValidate(): void { try { $async = \function_exists('proc_open'); diff --git a/lib/Controller/DevelopController.php b/lib/Controller/DevelopController.php index ae4a34b95..7080a12a1 100644 --- a/lib/Controller/DevelopController.php +++ b/lib/Controller/DevelopController.php @@ -11,6 +11,7 @@ namespace OCA\Libresign\Controller; use OCA\Libresign\AppInfo\Application; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\FrontpageRoute; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\Attribute\PublicPage; use OCP\AppFramework\Http\DataResponse; @@ -42,6 +43,7 @@ class DevelopController extends Controller { */ #[NoCSRFRequired] #[PublicPage] + #[FrontpageRoute(verb: 'GET', url: '/develop/pdf')] public function pdf(): FileDisplayResponse|Response { if (!$this->isDebugMode()) { return new DataResponse([], Http::STATUS_NOT_FOUND); diff --git a/lib/Controller/FileController.php b/lib/Controller/FileController.php index 22ff0684f..84ed5aa99 100644 --- a/lib/Controller/FileController.php +++ b/lib/Controller/FileController.php @@ -22,6 +22,7 @@ use OCA\Libresign\Service\IdentifyMethodService; use OCA\Libresign\Service\SessionService; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\Attribute\PublicPage; @@ -83,6 +84,7 @@ class FileController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[PublicPage] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/file/validate/uuid/{uuid}', requirements: ['apiVersion' => '(v1)'])] public function validateUuid(string $uuid): DataResponse { return $this->validate('Uuid', $uuid); } @@ -102,6 +104,7 @@ class FileController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[PublicPage] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/file/validate/file_id/{fileId}', requirements: ['apiVersion' => '(v1)'])] public function validateFileId(int $fileId): DataResponse { return $this->validate('FileId', $fileId); } @@ -122,6 +125,7 @@ class FileController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[PublicPage] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/file/validate/', requirements: ['apiVersion' => '(v1)'])] public function validate(?string $type = null, $identifier = null): DataResponse { try { if ($type === 'Uuid' && !empty($identifier)) { @@ -195,6 +199,7 @@ class FileController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/file/list', requirements: ['apiVersion' => '(v1)'])] public function list($page = null, $length = null, ?array $filter = []): DataResponse { $return = $this->fileService ->setMe($this->userSession->getUser()) @@ -222,6 +227,7 @@ class FileController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/file/thumbnail/{nodeId}', requirements: ['apiVersion' => '(v1)'])] public function getThumbnail( int $nodeId = -1, int $x = 32, @@ -313,6 +319,7 @@ class FileController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireManager] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/file', requirements: ['apiVersion' => '(v1)'])] public function save(array $file, string $name = '', array $settings = []): DataResponse { try { if (empty($name)) { diff --git a/lib/Controller/FileElementController.php b/lib/Controller/FileElementController.php index bcf8f04e1..fc4bc5275 100644 --- a/lib/Controller/FileElementController.php +++ b/lib/Controller/FileElementController.php @@ -13,6 +13,7 @@ use OCA\Libresign\Helper\ValidateHelper; use OCA\Libresign\ResponseDefinitions; use OCA\Libresign\Service\FileElementService; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\DataResponse; @@ -52,6 +53,7 @@ class FileElementController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/file-element/{uuid}', requirements: ['apiVersion' => '(v1)'])] public function post(string $uuid, int $signRequestId, int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse { $visibleElement = [ 'elementId' => $elementId, @@ -101,6 +103,7 @@ class FileElementController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'PATCH', url: '/api/{apiVersion}/file-element/{uuid}/{elementId}', requirements: ['apiVersion' => '(v1)'])] public function patch(string $uuid, int $signRequestId, int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse { return $this->post($uuid, $signRequestId, $elementId, $type, $metadata, $coordinates); } @@ -119,6 +122,7 @@ class FileElementController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'DELETE', url: '/api/{apiVersion}/file-element/{uuid}/{elementId}', requirements: ['apiVersion' => '(v1)'])] public function delete(string $uuid, int $elementId): DataResponse { try { $this->validateHelper->validateExistingFile([ diff --git a/lib/Controller/IdentifyAccountController.php b/lib/Controller/IdentifyAccountController.php index be6e6feb6..1b2bb0d8e 100644 --- a/lib/Controller/IdentifyAccountController.php +++ b/lib/Controller/IdentifyAccountController.php @@ -14,6 +14,7 @@ use OCA\Libresign\ResponseDefinitions; use OCA\Libresign\Service\IdentifyMethod\Account; use OCA\Libresign\Service\IdentifyMethod\Email; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\DataResponse; use OCP\Collaboration\Collaborators\ISearch; @@ -53,6 +54,7 @@ class IdentifyAccountController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[RequireManager] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/identify-account/search', requirements: ['apiVersion' => '(v1)'])] public function search(string $search = '', int $page = 1, int $limit = 25): DataResponse { $shareTypes = $this->getShareTypes(); $lookup = false; diff --git a/lib/Controller/NotifyController.php b/lib/Controller/NotifyController.php index 011b0e042..f0ce8b1ab 100644 --- a/lib/Controller/NotifyController.php +++ b/lib/Controller/NotifyController.php @@ -12,6 +12,7 @@ use OCA\Libresign\AppInfo\Application; use OCA\Libresign\Exception\LibresignException; use OCA\Libresign\Service\NotifyService; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\DataResponse; @@ -41,6 +42,7 @@ class NotifyController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/notify/signers', requirements: ['apiVersion' => '(v1)'])] public function signers(int $fileId, array $signers): DataResponse { try { $this->notifyService->signers($fileId, $signers); @@ -74,6 +76,7 @@ class NotifyController extends AEnvironmentAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/notify/signer', requirements: ['apiVersion' => '(v1)'])] public function signer(int $fileId, int $signRequestId): DataResponse { try { $this->notifyService->signer($fileId, $signRequestId); @@ -107,6 +110,7 @@ class NotifyController extends AEnvironmentAwareController { * 200: OK */ #[NoAdminRequired] + #[ApiRoute(verb: 'DELETE', url: '/api/{apiVersion}/notify/notification', requirements: ['apiVersion' => '(v1)'])] public function notificationDismiss(int $signRequestId, int $timestamp): DataResponse { $this->notifyService->notificationDismiss( $signRequestId, diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 7a7f5ee24..eb4eb84f6 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -26,6 +26,7 @@ use OCA\Libresign\Service\SignFileService; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AnonRateLimit; +use OCP\AppFramework\Http\Attribute\FrontpageRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\Attribute\PublicPage; @@ -77,6 +78,7 @@ class PageController extends AEnvironmentPageAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireSetupOk(template: 'main')] + #[FrontpageRoute(verb: 'GET', url: '/')] public function index(): TemplateResponse { $this->initialState->provideInitialState('config', $this->accountService->getConfig($this->userSession->getUser())); $this->initialState->provideInitialState('certificate_engine', $this->accountService->getCertificateEngineName()); @@ -118,6 +120,7 @@ class PageController extends AEnvironmentPageAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireSetupOk(template: 'main')] + #[FrontpageRoute(verb: 'GET', url: '/f/')] public function indexF(): TemplateResponse { return $this->index(); } @@ -131,6 +134,7 @@ class PageController extends AEnvironmentPageAwareController { */ #[NoAdminRequired] #[NoCSRFRequired] + #[FrontpageRoute(verb: 'GET', url: '/f/incomplete')] public function incomplete(): TemplateResponse { Util::addScript(Application::APP_ID, 'libresign-main'); $response = new TemplateResponse(Application::APP_ID, 'main'); @@ -146,6 +150,7 @@ class PageController extends AEnvironmentPageAwareController { */ #[PublicPage] #[NoCSRFRequired] + #[FrontpageRoute(verb: 'GET', url: '/p/incomplete')] public function incompleteP(): TemplateResponse { Util::addScript(Application::APP_ID, 'libresign-main'); $response = new TemplateResponse(Application::APP_ID, 'main', [], TemplateResponse::RENDER_AS_BASE); @@ -165,6 +170,7 @@ class PageController extends AEnvironmentPageAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireSetupOk(template: 'main')] + #[FrontpageRoute(verb: 'GET', url: '/f/{path}', requirements: ['path' => '.+'])] public function indexFPath(): TemplateResponse { return $this->index(); } @@ -183,6 +189,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk] #[PublicPage] #[RequireSignRequestUuid] + #[FrontpageRoute(verb: 'GET', url: '/f/sign/{uuid}')] public function signF(string $uuid): TemplateResponse { $this->initialState->provideInitialState('action', JSActions::ACTION_SIGN_INTERNAL); return $this->index(); @@ -203,6 +210,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk] #[PublicPage] #[RequireSignRequestUuid] + #[FrontpageRoute(verb: 'GET', url: '/f/sign/{uuid}/{path}', requirements: ['path' => '.+'])] public function signFPath(string $uuid): TemplateResponse { $this->initialState->provideInitialState('action', JSActions::ACTION_SIGN_INTERNAL); return $this->index(); @@ -223,6 +231,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk] #[PublicPage] #[RequireSignRequestUuid] + #[FrontpageRoute(verb: 'GET', url: '/p/sign/{uuid}')] public function sign(string $uuid): TemplateResponse { $this->initialState->provideInitialState('action', JSActions::ACTION_SIGN); $this->initialState->provideInitialState('config', @@ -281,6 +290,8 @@ class PageController extends AEnvironmentPageAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireSetupOk] + #[FrontpageRoute(verb: 'GET', url: '/p/account/files/approve/{uuid}')] + #[FrontpageRoute(verb: 'GET', url: '/p/account/files/approve/{uuid}/{path}', requirements: ['path' => '.+'], postfix: 'private')] public function signAccountFile($uuid): TemplateResponse { try { $fileEntity = $this->signFileService->getFileByUuid($uuid); @@ -351,6 +362,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk] #[PublicPage] #[AnonRateLimit(limit: 30, period: 60)] + #[FrontpageRoute(verb: 'GET', url: '/p/pdf/{uuid}')] public function getPdf($uuid) { $this->throwIfValidationPageNotAccessible(); try { @@ -377,6 +389,7 @@ class PageController extends AEnvironmentPageAwareController { #[PublicPage] #[RequireSetupOk] #[AnonRateLimit(limit: 30, period: 60)] + #[FrontpageRoute(verb: 'GET', url: '/pdf/{uuid}')] public function getPdfFile($uuid): FileDisplayResponse { $this->throwIfValidationPageNotAccessible(); $file = $this->getNextcloudFile(); @@ -396,6 +409,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk(template: 'validation')] #[PublicPage] #[AnonRateLimit(limit: 30, period: 60)] + #[FrontpageRoute(verb: 'GET', url: '/p/validation')] public function validation(): TemplateResponse { $this->throwIfValidationPageNotAccessible(); if ($this->getFileEntity()) { @@ -440,6 +454,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk] #[PublicPage] #[AnonRateLimit(limit: 30, period: 60)] + #[FrontpageRoute(verb: 'GET', url: '/validation/{uuid}')] public function validationFileWithShortUrl(): RedirectResponse { $this->throwIfValidationPageNotAccessible(); return new RedirectResponse($this->url->linkToRoute('libresign.page.validationFile', ['uuid' => $this->request->getParam('uuid')])); @@ -458,6 +473,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk(template: 'main')] #[PublicPage] #[RequireSignRequestUuid] + #[FrontpageRoute(verb: 'GET', url: '/reset-password')] public function resetPassword(): TemplateResponse { $this->initialState->provideInitialState('config', $this->accountService->getConfig($this->userSession->getUser()) @@ -483,6 +499,7 @@ class PageController extends AEnvironmentPageAwareController { #[RequireSetupOk(template: 'validation')] #[PublicPage] #[AnonRateLimit(limit: 30, period: 60)] + #[FrontpageRoute(verb: 'GET', url: '/p/validation/{uuid}')] public function validationFile(string $uuid): TemplateResponse { $this->throwIfValidationPageNotAccessible(); try { diff --git a/lib/Controller/RequestSignatureController.php b/lib/Controller/RequestSignatureController.php index d32a8f826..09e305ccc 100644 --- a/lib/Controller/RequestSignatureController.php +++ b/lib/Controller/RequestSignatureController.php @@ -15,6 +15,7 @@ use OCA\Libresign\ResponseDefinitions; use OCA\Libresign\Service\FileService; use OCA\Libresign\Service\RequestSignatureService; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\DataResponse; @@ -60,6 +61,7 @@ class RequestSignatureController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireManager] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/request-signature', requirements: ['apiVersion' => '(v1)'])] public function request(array $file, array $users, string $name, ?string $callback = null, ?int $status = 1): DataResponse { $user = $this->userSession->getUser(); $data = [ @@ -116,6 +118,7 @@ class RequestSignatureController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireManager] + #[ApiRoute(verb: 'PATCH', url: '/api/{apiVersion}/request-signature', requirements: ['apiVersion' => '(v1)'])] public function updateSign(?array $users = [], ?string $uuid = null, ?array $visibleElements = null, ?array $file = [], ?int $status = null): DataResponse { $user = $this->userSession->getUser(); $data = [ @@ -174,6 +177,7 @@ class RequestSignatureController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireManager] + #[ApiRoute(verb: 'DELETE', url: '/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}', requirements: ['apiVersion' => '(v1)'])] public function deleteOneRequestSignatureUsingFileId(int $fileId, int $signRequestId): DataResponse { try { $data = [ @@ -216,6 +220,7 @@ class RequestSignatureController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[RequireManager] + #[ApiRoute(verb: 'DELETE', url: '/api/{apiVersion}/sign/file_id/{fileId}', requirements: ['apiVersion' => '(v1)'])] public function deleteAllRequestSignatureUsingFileId(int $fileId): DataResponse { try { $data = [ diff --git a/lib/Controller/SettingController.php b/lib/Controller/SettingController.php index cde1966f9..dcdc55480 100644 --- a/lib/Controller/SettingController.php +++ b/lib/Controller/SettingController.php @@ -11,6 +11,7 @@ namespace OCA\Libresign\Controller; use OCA\Libresign\AppInfo\Application; use OCA\Libresign\Handler\CertificateEngine\Handler as CertificateEngineHandler; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\Attribute\OpenAPI; @@ -37,6 +38,7 @@ class SettingController extends AEnvironmentAwareController { #[NoAdminRequired] #[NoCSRFRequired] #[OpenAPI(scope: OpenAPI::SCOPE_ADMINISTRATION)] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/setting/has-root-cert', requirements: ['apiVersion' => '(v1)'])] public function hasRootCert(): DataResponse { $checkData = [ 'hasRootCert' => $this->certificateEngineHandler->getEngine()->isSetupOk() diff --git a/lib/Controller/SignFileController.php b/lib/Controller/SignFileController.php index 2ecc2068e..4d0704da1 100644 --- a/lib/Controller/SignFileController.php +++ b/lib/Controller/SignFileController.php @@ -22,6 +22,7 @@ use OCA\Libresign\Service\FileService; use OCA\Libresign\Service\IdentifyMethodService; use OCA\Libresign\Service\SignFileService; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\Attribute\PublicPage; @@ -66,6 +67,7 @@ class SignFileController extends AEnvironmentAwareController implements ISignatu #[NoCSRFRequired] #[RequireManager] #[PublicPage] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/sign/file_id/{fileId}', requirements: ['apiVersion' => '(v1)'])] public function signUsingFileId(int $fileId, string $method, array $elements = [], string $identifyValue = '', string $token = ''): DataResponse { return $this->sign($fileId, null, $method, $elements, $identifyValue, $token); } @@ -88,6 +90,7 @@ class SignFileController extends AEnvironmentAwareController implements ISignatu #[NoCSRFRequired] #[RequireSigner] #[PublicPage] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/sign/uuid/{uuid}', requirements: ['apiVersion' => '(v1)'])] public function signUsingUuid(string $uuid, string $method, array $elements = [], string $identifyValue = '', string $token = ''): DataResponse { return $this->sign(null, $uuid, $method, $elements, $identifyValue, $token); } @@ -182,6 +185,7 @@ class SignFileController extends AEnvironmentAwareController implements ISignatu #[NoCSRFRequired] #[PublicPage] #[CanSignRequestUuid] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/sign/uuid/{uuid}/renew/{method}', requirements: ['apiVersion' => '(v1)'])] public function signRenew(string $method): DataResponse { $this->signFileService->renew( $this->getSignRequestEntity(), @@ -208,6 +212,7 @@ class SignFileController extends AEnvironmentAwareController implements ISignatu #[NoCSRFRequired] #[RequireSigner] #[PublicPage] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/sign/uuid/{uuid}/code', requirements: ['apiVersion' => '(v1)'])] public function getCodeUsingUuid(string $uuid): DataResponse { try { $signRequest = $this->signRequestMapper->getBySignerUuidAndUserId($uuid); @@ -233,6 +238,7 @@ class SignFileController extends AEnvironmentAwareController implements ISignatu #[NoCSRFRequired] #[RequireSigner] #[PublicPage] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/sign/file_id/{fileId}/code', requirements: ['apiVersion' => '(v1)'])] public function getCodeUsingFileId(int $fileId, ?string $identifyMethod, ?string $signMethod, ?string $identify): DataResponse { try { $signRequest = $this->signRequestMapper->getByFileIdAndUserId($fileId); diff --git a/lib/Controller/SignatureElementsController.php b/lib/Controller/SignatureElementsController.php index ac248708c..458c3f93e 100644 --- a/lib/Controller/SignatureElementsController.php +++ b/lib/Controller/SignatureElementsController.php @@ -19,6 +19,7 @@ use OCA\Libresign\Service\SignerElementsService; use OCA\Libresign\Service\SignFileService; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\ApiRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\Attribute\PublicPage; @@ -63,6 +64,7 @@ class SignatureElementsController extends AEnvironmentAwareController implements #[NoCSRFRequired] #[PublicPage] #[RequireSignRequestUuid(skipIfAuthenticated: true)] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/signature/elements', requirements: ['apiVersion' => '(v1)'])] public function createSignatureElement(array $elements): DataResponse { try { $this->validateHelper->validateVisibleElements($elements, $this->validateHelper::TYPE_VISIBLE_ELEMENT_USER); @@ -109,6 +111,7 @@ class SignatureElementsController extends AEnvironmentAwareController implements #[NoCSRFRequired] #[PublicPage] #[RequireSignRequestUuid(skipIfAuthenticated: true)] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/signature/elements', requirements: ['apiVersion' => '(v1)'])] public function getSignatureElements(): DataResponse { $userId = $this->userSession->getUser()?->getUID(); try { @@ -146,6 +149,7 @@ class SignatureElementsController extends AEnvironmentAwareController implements #[PublicPage] #[NoCSRFRequired] #[RequireSignRequestUuid(skipIfAuthenticated: true)] + #[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/signature/elements/preview/{nodeId}', requirements: ['apiVersion' => '(v1)'])] public function getSignatureElementPreview(int $nodeId) { try { $node = $this->accountService->getFileByNodeIdAndSessionId( @@ -177,6 +181,7 @@ class SignatureElementsController extends AEnvironmentAwareController implements */ #[NoAdminRequired] #[NoCSRFRequired] + #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/signature/elements/preview/{nodeId}', requirements: ['apiVersion' => '(v1)'])] public function getSignatureElement(int $nodeId): DataResponse { $userId = $this->userSession->getUser()->getUID(); try { @@ -209,6 +214,7 @@ class SignatureElementsController extends AEnvironmentAwareController implements #[PublicPage] #[NoCSRFRequired] #[RequireSignRequestUuid(skipIfAuthenticated: true)] + #[ApiRoute(verb: 'PATCH', url: '/api/{apiVersion}/signature/elements/preview/{nodeId}', requirements: ['apiVersion' => '(v1)'])] public function patchSignatureElement(int $nodeId, string $type = '', array $file = []): DataResponse { try { $element['nodeId'] = $nodeId; @@ -264,6 +270,7 @@ class SignatureElementsController extends AEnvironmentAwareController implements #[NoCSRFRequired] #[PublicPage] #[RequireSignRequestUuid(skipIfAuthenticated: true)] + #[ApiRoute(verb: 'DELETE', url: '/api/{apiVersion}/signature/elements/{nodeId}', requirements: ['apiVersion' => '(v1)'])] public function deleteSignatureElement(int $nodeId): DataResponse { try { $this->accountService->deleteSignatureElement( diff --git a/openapi-full.json b/openapi-full.json index e16522c16..2033ffdd7 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -962,11 +962,10 @@ } } }, - "/index.php/apps/libresign/f/sign/{uuid}/{path}": { + "/index.php/apps/libresign/p/incomplete": { "get": { - "operationId": "page-signf-path-extra", - "summary": "Sign page to authenticated signer with the path of file", - "description": "The path is used only by frontend", + "operationId": "page-incompletep", + "summary": "Incomplete page in full screen", "tags": [ "page" ], @@ -979,16 +978,37 @@ "basic_auth": [] } ], - "parameters": [ - { - "name": "uuid", - "in": "path", - "description": "Sign request uuid", - "required": true, - "schema": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": { + "schema": { + "type": "string" + } + } } + } + } + } + }, + "/index.php/apps/libresign/f/{path}": { + "get": { + "operationId": "page-indexf-path", + "summary": "Main page to authenticated signer with a path", + "description": "The path is used only by frontend", + "tags": [ + "page" + ], + "security": [ + { + "bearer_auth": [] }, + { + "basic_auth": [] + } + ], + "parameters": [ { "name": "path", "in": "path", @@ -1054,54 +1074,14 @@ } } }, - "/index.php/apps/libresign/f/{path}": { + "/index.php/apps/libresign/f/sign/{uuid}/{path}": { "get": { - "operationId": "page-indexf-path-front", - "summary": "Main page to authenticated signer with a path", + "operationId": "page-signf-path", + "summary": "Sign page to authenticated signer with the path of file", "description": "The path is used only by frontend", "tags": [ "page" ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string", - "pattern": "^.+$" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "text/html": { - "schema": { - "type": "string" - } - } - } - } - } - } - }, - "/index.php/apps/libresign/pdf/{uuid}": { - "get": { - "operationId": "page-get-pdf-file", - "summary": "Use UUID of user to get PDF", - "tags": [ - "page" - ], "security": [ {}, { @@ -1120,68 +1100,16 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - } - } - } - }, - "/index.php/apps/libresign/reset-password": { - "get": { - "operationId": "page-reset-password", - "summary": "Show validation page", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] }, { - "basic_auth": [] - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "text/html": { - "schema": { - "type": "string" - } - } + "name": "path", + "in": "path", + "required": true, + "schema": { + "type": "string", + "pattern": "^.+$" } } - } - } - }, - "/index.php/apps/libresign/p/incomplete": { - "get": { - "operationId": "page-incompletep", - "summary": "Incomplete page in full screen", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } ], "responses": { "200": { @@ -1239,57 +1167,6 @@ } } }, - "/index.php/apps/libresign/p/sign/{uuid}/{path}": { - "get": { - "operationId": "page-sign-extra", - "summary": "Sign page to authenticated signer", - "description": "The path is used only by frontend", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "uuid", - "in": "path", - "description": "Sign request uuid", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string", - "pattern": "^.+$" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "text/html": { - "schema": { - "type": "string" - } - } - } - } - } - } - }, "/index.php/apps/libresign/p/account/files/approve/{uuid}": { "get": { "operationId": "page-sign-account-file", @@ -1332,7 +1209,7 @@ }, "/index.php/apps/libresign/p/account/files/approve/{uuid}/{path}": { "get": { - "operationId": "page-sign-account-file-extra", + "operationId": "page-sign-account-file-private", "summary": "Show signature page", "tags": [ "page" @@ -1379,6 +1256,98 @@ } } }, + "/index.php/apps/libresign/p/pdf/{uuid}": { + "get": { + "operationId": "page-get-pdf", + "summary": "Use UUID of file to get PDF", + "tags": [ + "page" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "File uuid", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "File not found", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/index.php/apps/libresign/pdf/{uuid}": { + "get": { + "operationId": "page-get-pdf-file", + "summary": "Use UUID of user to get PDF", + "tags": [ + "page" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Sign request uuid", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, "/index.php/apps/libresign/p/validation": { "get": { "operationId": "page-validation", @@ -1450,6 +1419,36 @@ } } }, + "/index.php/apps/libresign/reset-password": { + "get": { + "operationId": "page-reset-password", + "summary": "Show validation page", + "tags": [ + "page" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/index.php/apps/libresign/p/validation/{uuid}": { "get": { "operationId": "page-validation-file", @@ -1491,56 +1490,6 @@ } } }, - "/index.php/apps/libresign/p/pdf/{uuid}": { - "get": { - "operationId": "page-get-pdf", - "summary": "Use UUID of file to get PDF", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "uuid", - "in": "path", - "description": "File uuid", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "File not found", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/create/{uuid}": { "post": { "operationId": "account-create-to-sign", @@ -1726,778 +1675,6 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/me": { - "get": { - "operationId": "account-me", - "summary": "Who am I", - "description": "Validates API access data and returns the authenticated user's data.", - "tags": [ - "account" - ], - "security": [ - {}, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "account", - "settings" - ], - "properties": { - "account": { - "type": "object", - "required": [ - "uid", - "emailAddress", - "displayName" - ], - "properties": { - "uid": { - "type": "string" - }, - "emailAddress": { - "type": "string" - }, - "displayName": { - "type": "string" - } - } - }, - "settings": { - "type": "object", - "required": [ - "canRequestSign", - "hasSignatureFile" - ], - "properties": { - "canRequestSign": { - "type": "boolean" - }, - "hasSignatureFile": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid user or password", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx": { - "post": { - "operationId": "account-upload-pfx", - "summary": "Upload PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate saved with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "400": { - "description": "No file provided or other problem with provided file", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "patch": { - "operationId": "account-update-pfx-password", - "summary": "Update PFX file", - "description": "Used to change the password of PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "current", - "new" - ], - "properties": { - "current": { - "type": "string", - "description": "Current password" - }, - "new": { - "type": "string", - "description": "New password" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate saved with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "400": { - "description": "No file provided or other problem with provided file", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "account-delete-pfx", - "summary": "Delete PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate deleted with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx/read": { - "post": { - "operationId": "account-read-pfx-data", - "summary": "Read content of PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "password" - ], - "properties": { - "password": { - "type": "string", - "description": "password of PFX file to decrypt the file and return his content" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate saved with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/CertificatePfxData" - } - } - } - } - } - } - } - }, - "400": { - "description": "No file provided or other problem with provided file", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { - "patch": { - "operationId": "account-update-settings", - "summary": "Update the account phone number", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "phone": { - "type": "string", - "nullable": true, - "description": "the phone number to be defined. If null will remove the phone number" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "Settings saved", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "userId", - "phone", - "message" - ], - "properties": { - "userId": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid data to update phone number", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/signature": { "post": { "operationId": "account-signature-generate", @@ -3066,6 +2243,156 @@ } } }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/me": { + "get": { + "operationId": "account-me", + "summary": "Who am I", + "description": "Validates API access data and returns the authenticated user's data.", + "tags": [ + "account" + ], + "security": [ + {}, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "account", + "settings" + ], + "properties": { + "account": { + "type": "object", + "required": [ + "uid", + "emailAddress", + "displayName" + ], + "properties": { + "uid": { + "type": "string" + }, + "emailAddress": { + "type": "string" + }, + "displayName": { + "type": "string" + } + } + }, + "settings": { + "type": "object", + "required": [ + "canRequestSign", + "hasSignatureFile" + ], + "properties": { + "canRequestSign": { + "type": "boolean" + }, + "hasSignatureFile": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid user or password", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files/approval/list": { "get": { "operationId": "account-account-file-list-to-approval", @@ -3231,13 +2558,361 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { - "post": { - "operationId": "file-save", - "summary": "Send a file", - "description": "Send a new file to Nextcloud and return the fileId to request to sign usign fileId", + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { + "patch": { + "operationId": "account-update-settings", + "summary": "Update the account phone number", "tags": [ - "file" + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "nullable": true, + "description": "the phone number to be defined. If null will remove the phone number" + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Settings saved", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "userId", + "phone", + "message" + ], + "properties": { + "userId": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid data to update phone number", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx": { + "delete": { + "operationId": "account-delete-pfx", + "summary": "Delete PFX file", + "tags": [ + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "202": { + "description": "Certificate deleted with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "account-upload-pfx", + "summary": "Upload PFX file", + "tags": [ + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "202": { + "description": "Certificate saved with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "No file provided or other problem with provided file", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "account-update-pfx-password", + "summary": "Update PFX file", + "description": "Used to change the password of PFX file", + "tags": [ + "account" ], "security": [ { @@ -3254,22 +2929,17 @@ "schema": { "type": "object", "required": [ - "file" + "current", + "new" ], "properties": { - "file": { - "$ref": "#/components/schemas/NewFile", - "description": "File to save" - }, - "name": { + "current": { "type": "string", - "default": "", - "description": "The name of file to sign" + "description": "Current password" }, - "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method." + "new": { + "type": "string", + "description": "New password" } } } @@ -3300,6 +2970,587 @@ } } ], + "responses": { + "202": { + "description": "Certificate saved with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "No file provided or other problem with provided file", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx/read": { + "post": { + "operationId": "account-read-pfx-data", + "summary": "Read content of PFX file", + "tags": [ + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "password" + ], + "properties": { + "password": { + "type": "string", + "description": "password of PFX file to decrypt the file and return his content" + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "202": { + "description": "Certificate saved with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/CertificatePfxData" + } + } + } + } + } + } + } + }, + "400": { + "description": "No file provided or other problem with provided file", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/uuid/{uuid}": { + "get": { + "operationId": "file-validate-uuid", + "summary": "Validate a file using Uuid", + "description": "Validate a file returning file data.", + "tags": [ + "file" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "uuid", + "in": "path", + "description": "The UUID of the LibreSign file", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/ValidateFile" + } + } + } + } + } + } + } + }, + "404": { + "description": "Request failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "action", + "errors", + "settings" + ], + "properties": { + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "settings": { + "$ref": "#/components/schemas/Settings" + }, + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/file_id/{fileId}": { + "get": { + "operationId": "file-validate-file-id", + "summary": "Validate a file using FileId", + "description": "Validate a file returning file data.", + "tags": [ + "file" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "fileId", + "in": "path", + "description": "The identifier value of the LibreSign file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/ValidateFile" + } + } + } + } + } + } + } + }, + "404": { + "description": "Request failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "action", + "errors", + "settings" + ], + "properties": { + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "settings": { + "$ref": "#/components/schemas/Settings" + }, + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { + "get": { + "operationId": "file-validate", + "summary": "Validate a file", + "description": "Validate a file returning file data.", + "tags": [ + "file" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "type", + "in": "query", + "description": "The type of identifier could be Uuid or FileId", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "identifier", + "in": "query", + "description": "The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], "responses": { "200": { "description": "OK", @@ -3322,7 +3573,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/NextcloudFile" + "$ref": "#/components/schemas/ValidateFile" } } } @@ -3331,8 +3582,8 @@ } } }, - "422": { - "description": "Failed to save data", + "404": { + "description": "Request failed", "content": { "application/json": { "schema": { @@ -3354,11 +3605,41 @@ "data": { "type": "object", "required": [ - "message" + "action", + "errors", + "settings" ], "properties": { - "message": { - "type": "string" + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "settings": { + "$ref": "#/components/schemas/Settings" + }, + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } } } } @@ -3714,16 +3995,15 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { - "get": { - "operationId": "file-validate", - "summary": "Validate a file", - "description": "Validate a file returning file data.", + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { + "post": { + "operationId": "file-save", + "summary": "Send a file", + "description": "Send a new file to Nextcloud and return the fileId to request to sign usign fileId", "tags": [ "file" ], "security": [ - {}, { "bearer_auth": [] }, @@ -3731,32 +4011,36 @@ "basic_auth": [] } ], - "parameters": [ - { - "name": "type", - "in": "query", - "description": "The type of identifier could be Uuid or FileId", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "identifier", - "in": "query", - "description": "The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer", - "schema": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "file" + ], + "properties": { + "file": { + "$ref": "#/components/schemas/NewFile", + "description": "File to save" + }, + "name": { + "type": "string", + "default": "", + "description": "The name of file to sign" + }, + "settings": { + "$ref": "#/components/schemas/FolderSettings", + "default": [], + "description": "Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method." + } } - ] + } } - }, + } + }, + "parameters": [ { "name": "apiVersion", "in": "path", @@ -3802,7 +4086,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/ValidateFile" + "$ref": "#/components/schemas/NextcloudFile" } } } @@ -3811,8 +4095,8 @@ } } }, - "404": { - "description": "Request failed", + "422": { + "description": "Failed to save data", "content": { "application/json": { "schema": { @@ -3834,346 +4118,11 @@ "data": { "type": "object", "required": [ - "action", - "errors", - "settings" + "message" ], "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/components/schemas/Settings" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/uuid/{uuid}": { - "get": { - "operationId": "file-validate-uuid", - "summary": "Validate a file using Uuid", - "description": "Validate a file returning file data.", - "tags": [ - "file" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "uuid", - "in": "path", - "description": "The UUID of the LibreSign file", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/ValidateFile" - } - } - } - } - } - } - } - }, - "404": { - "description": "Request failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "action", - "errors", - "settings" - ], - "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/components/schemas/Settings" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/file_id/{fileId}": { - "get": { - "operationId": "file-validate-file-id", - "summary": "Validate a file using FileId", - "description": "Validate a file returning file data.", - "tags": [ - "file" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "fileId", - "in": "path", - "description": "The identifier value of the LibreSign file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/ValidateFile" - } - } - } - } - } - } - } - }, - "404": { - "description": "Request failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "action", - "errors", - "settings" - ], - "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/components/schemas/Settings" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } + "message": { + "type": "string" } } } @@ -4776,169 +4725,6 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { - "post": { - "operationId": "notify-signer", - "summary": "Notify a signer of a file", - "tags": [ - "notify" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "fileId", - "signRequestId" - ], - "properties": { - "fileId": { - "type": "integer", - "format": "int64", - "description": "The identifier value of LibreSign file" - }, - "signRequestId": { - "type": "integer", - "format": "int64", - "description": "The sign request id" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "danger" - ] - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signers": { "post": { "operationId": "notify-signers", @@ -5112,7 +4898,170 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notif/notification": { + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { + "post": { + "operationId": "notify-signer", + "summary": "Notify a signer of a file", + "tags": [ + "notify" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "fileId", + "signRequestId" + ], + "properties": { + "fileId": { + "type": "integer", + "format": "int64", + "description": "The identifier value of LibreSign file" + }, + "signRequestId": { + "type": "integer", + "format": "int64", + "description": "The sign request id" + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "danger" + ] + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/notification": { "delete": { "operationId": "notify-notification-dismiss", "summary": "Dismiss a specific notification", @@ -5569,6 +5518,192 @@ } } }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { + "delete": { + "operationId": "request_signature-delete-one-request-signature-using-file-id", + "summary": "Delete sign request", + "description": "You can only request exclusion as any sign", + "tags": [ + "request_signature" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "fileId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "signRequestId", + "in": "path", + "description": "The sign request id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "422": { + "description": "Failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "action", + "errors" + ], + "properties": { + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}": { "delete": { "operationId": "request_signature-delete-all-request-signature-using-file-id", @@ -5938,966 +6073,6 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { - "delete": { - "operationId": "request_signature-delete-one-request-signature-using-file-id", - "summary": "Delete sign request", - "description": "You can only request exclusion as any sign", - "tags": [ - "request_signature" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "fileId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "signRequestId", - "in": "path", - "description": "The sign request id", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "action", - "errors" - ], - "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { - "post": { - "operationId": "signature_elements-create-signature-element", - "summary": "Create signature element", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "elements" - ], - "properties": { - "elements": { - "type": "object", - "description": "Element object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "elements", - "message" - ], - "properties": { - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserElement" - } - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "get": { - "operationId": "signature_elements-get-signature-elements", - "summary": "Get signature elements", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "elements" - ], - "properties": { - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserElement" - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { - "get": { - "operationId": "signature_elements-get-signature-element-preview", - "summary": "Get preview of signature elements of", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { - "get": { - "operationId": "signature_elements-get-signature-element", - "summary": "Get signature element of signer", - "tags": [ - "signature_elements" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/UserElement" - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "patch": { - "operationId": "signature_elements-patch-signature-element", - "summary": "Update signature element", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "default": "", - "description": "The type of signature element" - }, - "file": { - "type": "object", - "default": [], - "description": "Element object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "elements", - "message" - ], - "properties": { - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserElement" - } - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "signature_elements-delete-signature-element", - "summary": "Delete signature element", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/uuid/{uuid}": { "post": { "operationId": "sign_file-sign-using-uuid", @@ -7481,6 +6656,780 @@ } } }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { + "post": { + "operationId": "signature_elements-create-signature-element", + "summary": "Create signature element", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "elements" + ], + "properties": { + "elements": { + "type": "object", + "description": "Element object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "elements", + "message" + ], + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserElement" + } + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "422": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "get": { + "operationId": "signature_elements-get-signature-elements", + "summary": "Get signature elements", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "elements" + ], + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserElement" + } + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { + "post": { + "operationId": "signature_elements-get-signature-element-preview", + "summary": "Get preview of signature elements of", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "get": { + "operationId": "signature_elements-get-signature-element", + "summary": "Get signature element of signer", + "tags": [ + "signature_elements" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UserElement" + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "signature_elements-patch-signature-element", + "summary": "Update signature element", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "", + "description": "The type of signature element" + }, + "file": { + "type": "object", + "default": [], + "description": "Element object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "elements", + "message" + ], + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserElement" + } + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "422": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { + "delete": { + "operationId": "signature_elements-delete-signature-element", + "summary": "Delete signature element", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/admin/certificate/cfssl": { "post": { "operationId": "admin-generate-certificate-cfssl", diff --git a/openapi.json b/openapi.json index 5fdd2196e..ab29371f4 100644 --- a/openapi.json +++ b/openapi.json @@ -792,11 +792,10 @@ } } }, - "/index.php/apps/libresign/f/sign/{uuid}/{path}": { + "/index.php/apps/libresign/p/incomplete": { "get": { - "operationId": "page-signf-path-extra", - "summary": "Sign page to authenticated signer with the path of file", - "description": "The path is used only by frontend", + "operationId": "page-incompletep", + "summary": "Incomplete page in full screen", "tags": [ "page" ], @@ -809,16 +808,37 @@ "basic_auth": [] } ], - "parameters": [ - { - "name": "uuid", - "in": "path", - "description": "Sign request uuid", - "required": true, - "schema": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": { + "schema": { + "type": "string" + } + } } + } + } + } + }, + "/index.php/apps/libresign/f/{path}": { + "get": { + "operationId": "page-indexf-path", + "summary": "Main page to authenticated signer with a path", + "description": "The path is used only by frontend", + "tags": [ + "page" + ], + "security": [ + { + "bearer_auth": [] }, + { + "basic_auth": [] + } + ], + "parameters": [ { "name": "path", "in": "path", @@ -884,54 +904,14 @@ } } }, - "/index.php/apps/libresign/f/{path}": { + "/index.php/apps/libresign/f/sign/{uuid}/{path}": { "get": { - "operationId": "page-indexf-path-front", - "summary": "Main page to authenticated signer with a path", + "operationId": "page-signf-path", + "summary": "Sign page to authenticated signer with the path of file", "description": "The path is used only by frontend", "tags": [ "page" ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string", - "pattern": "^.+$" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "text/html": { - "schema": { - "type": "string" - } - } - } - } - } - } - }, - "/index.php/apps/libresign/pdf/{uuid}": { - "get": { - "operationId": "page-get-pdf-file", - "summary": "Use UUID of user to get PDF", - "tags": [ - "page" - ], "security": [ {}, { @@ -950,68 +930,16 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - } - } - } - }, - "/index.php/apps/libresign/reset-password": { - "get": { - "operationId": "page-reset-password", - "summary": "Show validation page", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] }, { - "basic_auth": [] - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "text/html": { - "schema": { - "type": "string" - } - } + "name": "path", + "in": "path", + "required": true, + "schema": { + "type": "string", + "pattern": "^.+$" } } - } - } - }, - "/index.php/apps/libresign/p/incomplete": { - "get": { - "operationId": "page-incompletep", - "summary": "Incomplete page in full screen", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } ], "responses": { "200": { @@ -1069,57 +997,6 @@ } } }, - "/index.php/apps/libresign/p/sign/{uuid}/{path}": { - "get": { - "operationId": "page-sign-extra", - "summary": "Sign page to authenticated signer", - "description": "The path is used only by frontend", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "uuid", - "in": "path", - "description": "Sign request uuid", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string", - "pattern": "^.+$" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "text/html": { - "schema": { - "type": "string" - } - } - } - } - } - } - }, "/index.php/apps/libresign/p/account/files/approve/{uuid}": { "get": { "operationId": "page-sign-account-file", @@ -1162,7 +1039,7 @@ }, "/index.php/apps/libresign/p/account/files/approve/{uuid}/{path}": { "get": { - "operationId": "page-sign-account-file-extra", + "operationId": "page-sign-account-file-private", "summary": "Show signature page", "tags": [ "page" @@ -1209,6 +1086,98 @@ } } }, + "/index.php/apps/libresign/p/pdf/{uuid}": { + "get": { + "operationId": "page-get-pdf", + "summary": "Use UUID of file to get PDF", + "tags": [ + "page" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "File uuid", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "File not found", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/index.php/apps/libresign/pdf/{uuid}": { + "get": { + "operationId": "page-get-pdf-file", + "summary": "Use UUID of user to get PDF", + "tags": [ + "page" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Sign request uuid", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, "/index.php/apps/libresign/p/validation": { "get": { "operationId": "page-validation", @@ -1280,6 +1249,36 @@ } } }, + "/index.php/apps/libresign/reset-password": { + "get": { + "operationId": "page-reset-password", + "summary": "Show validation page", + "tags": [ + "page" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/index.php/apps/libresign/p/validation/{uuid}": { "get": { "operationId": "page-validation-file", @@ -1321,56 +1320,6 @@ } } }, - "/index.php/apps/libresign/p/pdf/{uuid}": { - "get": { - "operationId": "page-get-pdf", - "summary": "Use UUID of file to get PDF", - "tags": [ - "page" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "uuid", - "in": "path", - "description": "File uuid", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "File not found", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/create/{uuid}": { "post": { "operationId": "account-create-to-sign", @@ -1556,778 +1505,6 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/me": { - "get": { - "operationId": "account-me", - "summary": "Who am I", - "description": "Validates API access data and returns the authenticated user's data.", - "tags": [ - "account" - ], - "security": [ - {}, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "account", - "settings" - ], - "properties": { - "account": { - "type": "object", - "required": [ - "uid", - "emailAddress", - "displayName" - ], - "properties": { - "uid": { - "type": "string" - }, - "emailAddress": { - "type": "string" - }, - "displayName": { - "type": "string" - } - } - }, - "settings": { - "type": "object", - "required": [ - "canRequestSign", - "hasSignatureFile" - ], - "properties": { - "canRequestSign": { - "type": "boolean" - }, - "hasSignatureFile": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid user or password", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx": { - "post": { - "operationId": "account-upload-pfx", - "summary": "Upload PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate saved with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "400": { - "description": "No file provided or other problem with provided file", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "patch": { - "operationId": "account-update-pfx-password", - "summary": "Update PFX file", - "description": "Used to change the password of PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "current", - "new" - ], - "properties": { - "current": { - "type": "string", - "description": "Current password" - }, - "new": { - "type": "string", - "description": "New password" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate saved with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "400": { - "description": "No file provided or other problem with provided file", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "account-delete-pfx", - "summary": "Delete PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate deleted with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx/read": { - "post": { - "operationId": "account-read-pfx-data", - "summary": "Read content of PFX file", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "password" - ], - "properties": { - "password": { - "type": "string", - "description": "password of PFX file to decrypt the file and return his content" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "202": { - "description": "Certificate saved with success", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/CertificatePfxData" - } - } - } - } - } - } - } - }, - "400": { - "description": "No file provided or other problem with provided file", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { - "patch": { - "operationId": "account-update-settings", - "summary": "Update the account phone number", - "tags": [ - "account" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "phone": { - "type": "string", - "nullable": true, - "description": "the phone number to be defined. If null will remove the phone number" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "Settings saved", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "userId", - "phone", - "message" - ], - "properties": { - "userId": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid data to update phone number", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/signature": { "post": { "operationId": "account-signature-generate", @@ -2896,6 +2073,156 @@ } } }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/me": { + "get": { + "operationId": "account-me", + "summary": "Who am I", + "description": "Validates API access data and returns the authenticated user's data.", + "tags": [ + "account" + ], + "security": [ + {}, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "account", + "settings" + ], + "properties": { + "account": { + "type": "object", + "required": [ + "uid", + "emailAddress", + "displayName" + ], + "properties": { + "uid": { + "type": "string" + }, + "emailAddress": { + "type": "string" + }, + "displayName": { + "type": "string" + } + } + }, + "settings": { + "type": "object", + "required": [ + "canRequestSign", + "hasSignatureFile" + ], + "properties": { + "canRequestSign": { + "type": "boolean" + }, + "hasSignatureFile": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid user or password", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files/approval/list": { "get": { "operationId": "account-account-file-list-to-approval", @@ -3061,13 +2388,361 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { - "post": { - "operationId": "file-save", - "summary": "Send a file", - "description": "Send a new file to Nextcloud and return the fileId to request to sign usign fileId", + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { + "patch": { + "operationId": "account-update-settings", + "summary": "Update the account phone number", "tags": [ - "file" + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "nullable": true, + "description": "the phone number to be defined. If null will remove the phone number" + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Settings saved", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "userId", + "phone", + "message" + ], + "properties": { + "userId": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid data to update phone number", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx": { + "delete": { + "operationId": "account-delete-pfx", + "summary": "Delete PFX file", + "tags": [ + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "202": { + "description": "Certificate deleted with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "account-upload-pfx", + "summary": "Upload PFX file", + "tags": [ + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "202": { + "description": "Certificate saved with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "No file provided or other problem with provided file", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "account-update-pfx-password", + "summary": "Update PFX file", + "description": "Used to change the password of PFX file", + "tags": [ + "account" ], "security": [ { @@ -3084,22 +2759,17 @@ "schema": { "type": "object", "required": [ - "file" + "current", + "new" ], "properties": { - "file": { - "$ref": "#/components/schemas/NewFile", - "description": "File to save" - }, - "name": { + "current": { "type": "string", - "default": "", - "description": "The name of file to sign" + "description": "Current password" }, - "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method." + "new": { + "type": "string", + "description": "New password" } } } @@ -3130,6 +2800,587 @@ } } ], + "responses": { + "202": { + "description": "Certificate saved with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "No file provided or other problem with provided file", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx/read": { + "post": { + "operationId": "account-read-pfx-data", + "summary": "Read content of PFX file", + "tags": [ + "account" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "password" + ], + "properties": { + "password": { + "type": "string", + "description": "password of PFX file to decrypt the file and return his content" + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "202": { + "description": "Certificate saved with success", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/CertificatePfxData" + } + } + } + } + } + } + } + }, + "400": { + "description": "No file provided or other problem with provided file", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/uuid/{uuid}": { + "get": { + "operationId": "file-validate-uuid", + "summary": "Validate a file using Uuid", + "description": "Validate a file returning file data.", + "tags": [ + "file" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "uuid", + "in": "path", + "description": "The UUID of the LibreSign file", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/ValidateFile" + } + } + } + } + } + } + } + }, + "404": { + "description": "Request failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "action", + "errors", + "settings" + ], + "properties": { + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "settings": { + "$ref": "#/components/schemas/Settings" + }, + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/file_id/{fileId}": { + "get": { + "operationId": "file-validate-file-id", + "summary": "Validate a file using FileId", + "description": "Validate a file returning file data.", + "tags": [ + "file" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "fileId", + "in": "path", + "description": "The identifier value of the LibreSign file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/ValidateFile" + } + } + } + } + } + } + } + }, + "404": { + "description": "Request failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "action", + "errors", + "settings" + ], + "properties": { + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "settings": { + "$ref": "#/components/schemas/Settings" + }, + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { + "get": { + "operationId": "file-validate", + "summary": "Validate a file", + "description": "Validate a file returning file data.", + "tags": [ + "file" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "type", + "in": "query", + "description": "The type of identifier could be Uuid or FileId", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "identifier", + "in": "query", + "description": "The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], "responses": { "200": { "description": "OK", @@ -3152,7 +3403,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/NextcloudFile" + "$ref": "#/components/schemas/ValidateFile" } } } @@ -3161,8 +3412,8 @@ } } }, - "422": { - "description": "Failed to save data", + "404": { + "description": "Request failed", "content": { "application/json": { "schema": { @@ -3184,11 +3435,41 @@ "data": { "type": "object", "required": [ - "message" + "action", + "errors", + "settings" ], "properties": { - "message": { - "type": "string" + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "settings": { + "$ref": "#/components/schemas/Settings" + }, + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } } } } @@ -3544,16 +3825,15 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { - "get": { - "operationId": "file-validate", - "summary": "Validate a file", - "description": "Validate a file returning file data.", + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { + "post": { + "operationId": "file-save", + "summary": "Send a file", + "description": "Send a new file to Nextcloud and return the fileId to request to sign usign fileId", "tags": [ "file" ], "security": [ - {}, { "bearer_auth": [] }, @@ -3561,32 +3841,36 @@ "basic_auth": [] } ], - "parameters": [ - { - "name": "type", - "in": "query", - "description": "The type of identifier could be Uuid or FileId", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "identifier", - "in": "query", - "description": "The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer", - "schema": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "file" + ], + "properties": { + "file": { + "$ref": "#/components/schemas/NewFile", + "description": "File to save" + }, + "name": { + "type": "string", + "default": "", + "description": "The name of file to sign" + }, + "settings": { + "$ref": "#/components/schemas/FolderSettings", + "default": [], + "description": "Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method." + } } - ] + } } - }, + } + }, + "parameters": [ { "name": "apiVersion", "in": "path", @@ -3632,7 +3916,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/ValidateFile" + "$ref": "#/components/schemas/NextcloudFile" } } } @@ -3641,8 +3925,8 @@ } } }, - "404": { - "description": "Request failed", + "422": { + "description": "Failed to save data", "content": { "application/json": { "schema": { @@ -3664,346 +3948,11 @@ "data": { "type": "object", "required": [ - "action", - "errors", - "settings" + "message" ], "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/components/schemas/Settings" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/uuid/{uuid}": { - "get": { - "operationId": "file-validate-uuid", - "summary": "Validate a file using Uuid", - "description": "Validate a file returning file data.", - "tags": [ - "file" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "uuid", - "in": "path", - "description": "The UUID of the LibreSign file", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/ValidateFile" - } - } - } - } - } - } - } - }, - "404": { - "description": "Request failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "action", - "errors", - "settings" - ], - "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/components/schemas/Settings" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/file_id/{fileId}": { - "get": { - "operationId": "file-validate-file-id", - "summary": "Validate a file using FileId", - "description": "Validate a file returning file data.", - "tags": [ - "file" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "fileId", - "in": "path", - "description": "The identifier value of the LibreSign file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/ValidateFile" - } - } - } - } - } - } - } - }, - "404": { - "description": "Request failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "action", - "errors", - "settings" - ], - "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/components/schemas/Settings" - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - } - } + "message": { + "type": "string" } } } @@ -4606,169 +4555,6 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { - "post": { - "operationId": "notify-signer", - "summary": "Notify a signer of a file", - "tags": [ - "notify" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "fileId", - "signRequestId" - ], - "properties": { - "fileId": { - "type": "integer", - "format": "int64", - "description": "The identifier value of LibreSign file" - }, - "signRequestId": { - "type": "integer", - "format": "int64", - "description": "The sign request id" - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "message" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "danger" - ] - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signers": { "post": { "operationId": "notify-signers", @@ -4942,7 +4728,170 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notif/notification": { + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { + "post": { + "operationId": "notify-signer", + "summary": "Notify a signer of a file", + "tags": [ + "notify" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "fileId", + "signRequestId" + ], + "properties": { + "fileId": { + "type": "integer", + "format": "int64", + "description": "The identifier value of LibreSign file" + }, + "signRequestId": { + "type": "integer", + "format": "int64", + "description": "The sign request id" + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "danger" + ] + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/notification": { "delete": { "operationId": "notify-notification-dismiss", "summary": "Dismiss a specific notification", @@ -5399,6 +5348,192 @@ } } }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { + "delete": { + "operationId": "request_signature-delete-one-request-signature-using-file-id", + "summary": "Delete sign request", + "description": "You can only request exclusion as any sign", + "tags": [ + "request_signature" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "fileId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "signRequestId", + "in": "path", + "description": "The sign request id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "422": { + "description": "Failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "action", + "errors" + ], + "properties": { + "action": { + "type": "integer", + "format": "int64" + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}": { "delete": { "operationId": "request_signature-delete-all-request-signature-using-file-id", @@ -5768,966 +5903,6 @@ } } }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { - "delete": { - "operationId": "request_signature-delete-one-request-signature-using-file-id", - "summary": "Delete sign request", - "description": "You can only request exclusion as any sign", - "tags": [ - "request_signature" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "fileId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "signRequestId", - "in": "path", - "description": "The sign request id", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Failed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "action", - "errors" - ], - "properties": { - "action": { - "type": "integer", - "format": "int64" - }, - "errors": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { - "post": { - "operationId": "signature_elements-create-signature-element", - "summary": "Create signature element", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "elements" - ], - "properties": { - "elements": { - "type": "object", - "description": "Element object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "elements", - "message" - ], - "properties": { - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserElement" - } - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "get": { - "operationId": "signature_elements-get-signature-elements", - "summary": "Get signature elements", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "elements" - ], - "properties": { - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserElement" - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { - "get": { - "operationId": "signature_elements-get-signature-element-preview", - "summary": "Get preview of signature elements of", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { - "get": { - "operationId": "signature_elements-get-signature-element", - "summary": "Get signature element of signer", - "tags": [ - "signature_elements" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "$ref": "#/components/schemas/UserElement" - } - } - } - } - } - } - } - }, - "404": { - "description": "Invalid data", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "patch": { - "operationId": "signature_elements-patch-signature-element", - "summary": "Update signature element", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "default": "", - "description": "The type of signature element" - }, - "file": { - "type": "object", - "default": [], - "description": "Element object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - }, - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "elements", - "message" - ], - "properties": { - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserElement" - } - }, - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "signature_elements-delete-signature-element", - "summary": "Delete signature element", - "tags": [ - "signature_elements" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "apiVersion", - "in": "path", - "required": true, - "schema": { - "type": "string", - "enum": [ - "v1" - ], - "default": "v1" - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node id of a Nextcloud file", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "OCS-APIRequest", - "in": "header", - "description": "Required to be true for the API request to pass", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ocs" - ], - "properties": { - "ocs": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/uuid/{uuid}": { "post": { "operationId": "sign_file-sign-using-uuid", @@ -7310,6 +6485,780 @@ } } } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { + "post": { + "operationId": "signature_elements-create-signature-element", + "summary": "Create signature element", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "elements" + ], + "properties": { + "elements": { + "type": "object", + "description": "Element object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "elements", + "message" + ], + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserElement" + } + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "422": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "get": { + "operationId": "signature_elements-get-signature-elements", + "summary": "Get signature elements", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "elements" + ], + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserElement" + } + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { + "post": { + "operationId": "signature_elements-get-signature-element-preview", + "summary": "Get preview of signature elements of", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "get": { + "operationId": "signature_elements-get-signature-element", + "summary": "Get signature element of signer", + "tags": [ + "signature_elements" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UserElement" + } + } + } + } + } + } + } + }, + "404": { + "description": "Invalid data", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "signature_elements-patch-signature-element", + "summary": "Update signature element", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "", + "description": "The type of signature element" + }, + "file": { + "type": "object", + "default": [], + "description": "Element object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "elements", + "message" + ], + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserElement" + } + }, + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "422": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { + "delete": { + "operationId": "signature_elements-delete-signature-element", + "summary": "Delete signature element", + "tags": [ + "signature_elements" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "nodeId", + "in": "path", + "description": "Node id of a Nextcloud file", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } } }, "tags": [] diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 6fd1fb7b9..8d04b8cb4 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -28,35 +28,27 @@ export type paths = { /** Incomplete page */ get: operations["page-incomplete"]; }; - "/index.php/apps/libresign/f/sign/{uuid}/{path}": { - /** - * Sign page to authenticated signer with the path of file - * @description The path is used only by frontend - */ - get: operations["page-signf-path-extra"]; - }; - "/index.php/apps/libresign/f/sign/{uuid}": { - /** Sign page to authenticated signer */ - get: operations["page-signf"]; + "/index.php/apps/libresign/p/incomplete": { + /** Incomplete page in full screen */ + get: operations["page-incompletep"]; }; "/index.php/apps/libresign/f/{path}": { /** * Main page to authenticated signer with a path * @description The path is used only by frontend */ - get: operations["page-indexf-path-front"]; + get: operations["page-indexf-path"]; }; - "/index.php/apps/libresign/pdf/{uuid}": { - /** Use UUID of user to get PDF */ - get: operations["page-get-pdf-file"]; + "/index.php/apps/libresign/f/sign/{uuid}": { + /** Sign page to authenticated signer */ + get: operations["page-signf"]; }; - "/index.php/apps/libresign/reset-password": { - /** Show validation page */ - get: operations["page-reset-password"]; - }; - "/index.php/apps/libresign/p/incomplete": { - /** Incomplete page in full screen */ - get: operations["page-incompletep"]; + "/index.php/apps/libresign/f/sign/{uuid}/{path}": { + /** + * Sign page to authenticated signer with the path of file + * @description The path is used only by frontend + */ + get: operations["page-signf-path"]; }; "/index.php/apps/libresign/p/sign/{uuid}": { /** @@ -65,20 +57,21 @@ export type paths = { */ get: operations["page-sign"]; }; - "/index.php/apps/libresign/p/sign/{uuid}/{path}": { - /** - * Sign page to authenticated signer - * @description The path is used only by frontend - */ - get: operations["page-sign-extra"]; - }; "/index.php/apps/libresign/p/account/files/approve/{uuid}": { /** Show signature page */ get: operations["page-sign-account-file"]; }; "/index.php/apps/libresign/p/account/files/approve/{uuid}/{path}": { /** Show signature page */ - get: operations["page-sign-account-file-extra"]; + get: operations["page-sign-account-file-private"]; + }; + "/index.php/apps/libresign/p/pdf/{uuid}": { + /** Use UUID of file to get PDF */ + get: operations["page-get-pdf"]; + }; + "/index.php/apps/libresign/pdf/{uuid}": { + /** Use UUID of user to get PDF */ + get: operations["page-get-pdf-file"]; }; "/index.php/apps/libresign/p/validation": { /** Show validation page */ @@ -91,18 +84,30 @@ export type paths = { */ get: operations["page-validation-file-with-short-url"]; }; + "/index.php/apps/libresign/reset-password": { + /** Show validation page */ + get: operations["page-reset-password"]; + }; "/index.php/apps/libresign/p/validation/{uuid}": { /** Show validation page for a specific file UUID */ get: operations["page-validation-file"]; }; - "/index.php/apps/libresign/p/pdf/{uuid}": { - /** Use UUID of file to get PDF */ - get: operations["page-get-pdf"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/create/{uuid}": { /** Create account to sign a document */ post: operations["account-create-to-sign"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/signature": { + /** Create PFX file using self-signed certificate */ + post: operations["account-signature-generate"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files": { + /** List account files of authenticated account */ + get: operations["account-account-file-list-to-owner"]; + /** Add files to account profile */ + post: operations["account-add-files"]; + /** Delete file from account */ + delete: operations["account-delete-file"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/me": { /** * Who am I @@ -110,6 +115,14 @@ export type paths = { */ get: operations["account-me"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files/approval/list": { + /** List account files that need to be approved */ + get: operations["account-account-file-list-to-approval"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { + /** Update the account phone number */ + patch: operations["account-update-settings"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx": { /** Upload PFX file */ post: operations["account-upload-pfx"]; @@ -125,48 +138,6 @@ export type paths = { /** Read content of PFX file */ post: operations["account-read-pfx-data"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { - /** Update the account phone number */ - patch: operations["account-update-settings"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/signature": { - /** Create PFX file using self-signed certificate */ - post: operations["account-signature-generate"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files": { - /** List account files of authenticated account */ - get: operations["account-account-file-list-to-owner"]; - /** Add files to account profile */ - post: operations["account-add-files"]; - /** Delete file from account */ - delete: operations["account-delete-file"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files/approval/list": { - /** List account files that need to be approved */ - get: operations["account-account-file-list-to-approval"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { - /** - * Send a file - * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId - */ - post: operations["file-save"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/list": { - /** List account files that need to be approved */ - get: operations["file-list"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/thumbnail/{nodeId}": { - /** Return the thumbnail of a LibreSign file */ - get: operations["file-get-thumbnail"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { - /** - * Validate a file - * @description Validate a file returning file data. - */ - get: operations["file-validate"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/uuid/{uuid}": { /** * Validate a file using Uuid @@ -181,6 +152,28 @@ export type paths = { */ get: operations["file-validate-file-id"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { + /** + * Validate a file + * @description Validate a file returning file data. + */ + get: operations["file-validate"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/list": { + /** List account files that need to be approved */ + get: operations["file-list"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/thumbnail/{nodeId}": { + /** Return the thumbnail of a LibreSign file */ + get: operations["file-get-thumbnail"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { + /** + * Send a file + * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId + */ + post: operations["file-save"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/file-element/{uuid}": { /** * Create visible element @@ -207,15 +200,15 @@ export type paths = { */ get: operations["identify_account-search"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { - /** Notify a signer of a file */ - post: operations["notify-signer"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signers": { /** Notify signers of a file */ post: operations["notify-signers"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notif/notification": { + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { + /** Notify a signer of a file */ + post: operations["notify-signer"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/notification": { /** Dismiss a specific notification */ delete: operations["notify-notification-dismiss"]; }; @@ -231,6 +224,13 @@ export type paths = { */ patch: operations["request_signature-update-sign"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { + /** + * Delete sign request + * @description You can only request exclusion as any sign + */ + delete: operations["request_signature-delete-one-request-signature-using-file-id"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}": { /** Sign a file using file Id */ post: operations["sign_file-sign-using-file-id"]; @@ -240,31 +240,6 @@ export type paths = { */ delete: operations["request_signature-delete-all-request-signature-using-file-id"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { - /** - * Delete sign request - * @description You can only request exclusion as any sign - */ - delete: operations["request_signature-delete-one-request-signature-using-file-id"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { - /** Get signature elements */ - get: operations["signature_elements-get-signature-elements"]; - /** Create signature element */ - post: operations["signature_elements-create-signature-element"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { - /** Get preview of signature elements of */ - get: operations["signature_elements-get-signature-element-preview"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { - /** Get signature element of signer */ - get: operations["signature_elements-get-signature-element"]; - /** Delete signature element */ - delete: operations["signature_elements-delete-signature-element"]; - /** Update signature element */ - patch: operations["signature_elements-patch-signature-element"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/uuid/{uuid}": { /** Sign a file using file UUID */ post: operations["sign_file-sign-using-uuid"]; @@ -281,6 +256,24 @@ export type paths = { /** Get code to sign the document using FileID */ post: operations["sign_file-get-code-using-file-id"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { + /** Get signature elements */ + get: operations["signature_elements-get-signature-elements"]; + /** Create signature element */ + post: operations["signature_elements-create-signature-element"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { + /** Get signature element of signer */ + get: operations["signature_elements-get-signature-element"]; + /** Get preview of signature elements of */ + post: operations["signature_elements-get-signature-element-preview"]; + /** Update signature element */ + patch: operations["signature_elements-patch-signature-element"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { + /** Delete signature element */ + delete: operations["signature_elements-delete-signature-element"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/admin/certificate/cfssl": { /** * Generate certificate using CFSSL engine @@ -627,15 +620,24 @@ export type operations = { }; }; }; + /** Incomplete page in full screen */ + "page-incompletep": { + responses: { + /** @description OK */ + 200: { + content: { + "text/html": string; + }; + }; + }; + }; /** - * Sign page to authenticated signer with the path of file + * Main page to authenticated signer with a path * @description The path is used only by frontend */ - "page-signf-path-extra": { + "page-indexf-path": { parameters: { path: { - /** @description Sign request uuid */ - uuid: string; path: string; }; }; @@ -666,54 +668,17 @@ export type operations = { }; }; /** - * Main page to authenticated signer with a path + * Sign page to authenticated signer with the path of file * @description The path is used only by frontend */ - "page-indexf-path-front": { - parameters: { - path: { - path: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "text/html": string; - }; - }; - }; - }; - /** Use UUID of user to get PDF */ - "page-get-pdf-file": { + "page-signf-path": { parameters: { path: { /** @description Sign request uuid */ uuid: string; + path: string; }; }; - responses: { - /** @description OK */ - 200: { - content: { - "*/*": string; - }; - }; - }; - }; - /** Show validation page */ - "page-reset-password": { - responses: { - /** @description OK */ - 200: { - content: { - "text/html": string; - }; - }; - }; - }; - /** Incomplete page in full screen */ - "page-incompletep": { responses: { /** @description OK */ 200: { @@ -743,27 +708,6 @@ export type operations = { }; }; }; - /** - * Sign page to authenticated signer - * @description The path is used only by frontend - */ - "page-sign-extra": { - parameters: { - path: { - /** @description Sign request uuid */ - uuid: string; - path: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "text/html": string; - }; - }; - }; - }; /** Show signature page */ "page-sign-account-file": { parameters: { @@ -782,7 +726,7 @@ export type operations = { }; }; /** Show signature page */ - "page-sign-account-file-extra": { + "page-sign-account-file-private": { parameters: { path: { /** @description Sign request uuid */ @@ -799,6 +743,46 @@ export type operations = { }; }; }; + /** Use UUID of file to get PDF */ + "page-get-pdf": { + parameters: { + path: { + /** @description File uuid */ + uuid: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "*/*": string; + }; + }; + /** @description File not found */ + 404: { + content: { + "application/json": unknown; + }; + }; + }; + }; + /** Use UUID of user to get PDF */ + "page-get-pdf-file": { + parameters: { + path: { + /** @description Sign request uuid */ + uuid: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "*/*": string; + }; + }; + }; + }; /** Show validation page */ "page-validation": { responses: { @@ -830,6 +814,17 @@ export type operations = { }; }; }; + /** Show validation page */ + "page-reset-password": { + responses: { + /** @description OK */ + 200: { + content: { + "text/html": string; + }; + }; + }; + }; /** Show validation page for a specific file UUID */ "page-validation-file": { parameters: { @@ -847,29 +842,6 @@ export type operations = { }; }; }; - /** Use UUID of file to get PDF */ - "page-get-pdf": { - parameters: { - path: { - /** @description File uuid */ - uuid: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "*/*": string; - }; - }; - /** @description File not found */ - 404: { - content: { - "application/json": unknown; - }; - }; - }; - }; /** Create account to sign a document */ "account-create-to-sign": { parameters: { @@ -933,275 +905,6 @@ export type operations = { }; }; }; - /** - * Who am I - * @description Validates API access data and returns the authenticated user's data. - */ - "account-me": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - account: { - uid: string; - emailAddress: string; - displayName: string; - }; - settings: { - canRequestSign: boolean; - hasSignatureFile: boolean; - }; - }; - }; - }; - }; - }; - /** @description Invalid user or password */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Upload PFX file */ - "account-upload-pfx": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description Certificate saved with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description No file provided or other problem with provided file */ - 400: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Delete PFX file */ - "account-delete-pfx": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description Certificate deleted with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** - * Update PFX file - * @description Used to change the password of PFX file - */ - "account-update-pfx-password": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody: { - content: { - "application/json": { - /** @description Current password */ - current: string; - /** @description New password */ - new: string; - }; - }; - }; - responses: { - /** @description Certificate saved with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description No file provided or other problem with provided file */ - 400: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Read content of PFX file */ - "account-read-pfx-data": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody: { - content: { - "application/json": { - /** @description password of PFX file to decrypt the file and return his content */ - password: string; - }; - }; - }; - responses: { - /** @description Certificate saved with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["CertificatePfxData"]; - }; - }; - }; - }; - /** @description No file provided or other problem with provided file */ - 400: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Update the account phone number */ - "account-update-settings": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody?: { - content: { - "application/json": { - /** @description the phone number to be defined. If null will remove the phone number */ - phone?: string | null; - }; - }; - }; - responses: { - /** @description Settings saved */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - data: { - userId: string; - phone: string; - message: string; - }; - }; - }; - }; - }; - }; - /** @description Invalid data to update phone number */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; /** Create PFX file using self-signed certificate */ "account-signature-generate": { parameters: { @@ -1399,6 +1102,57 @@ export type operations = { }; }; }; + /** + * Who am I + * @description Validates API access data and returns the authenticated user's data. + */ + "account-me": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + account: { + uid: string; + emailAddress: string; + displayName: string; + }; + settings: { + canRequestSign: boolean; + hasSignatureFile: boolean; + }; + }; + }; + }; + }; + }; + /** @description Invalid user or password */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; /** List account files that need to be approved */ "account-account-file-list-to-approval": { parameters: { @@ -1451,11 +1205,130 @@ export type operations = { }; }; }; + /** Update the account phone number */ + "account-update-settings": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + requestBody?: { + content: { + "application/json": { + /** @description the phone number to be defined. If null will remove the phone number */ + phone?: string | null; + }; + }; + }; + responses: { + /** @description Settings saved */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + data: { + userId: string; + phone: string; + message: string; + }; + }; + }; + }; + }; + }; + /** @description Invalid data to update phone number */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Upload PFX file */ + "account-upload-pfx": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description Certificate saved with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description No file provided or other problem with provided file */ + 400: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Delete PFX file */ + "account-delete-pfx": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description Certificate deleted with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; /** - * Send a file - * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId + * Update PFX file + * @description Used to change the password of PFX file */ - "file-save": { + "account-update-pfx-password": { parameters: { header: { /** @description Required to be true for the API request to pass */ @@ -1468,21 +1341,104 @@ export type operations = { requestBody: { content: { "application/json": { - /** @description File to save */ - file: components["schemas"]["NewFile"]; - /** - * @description The name of file to sign - * @default - */ - name?: string; - /** - * @description Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method. - * @default [] - */ - settings?: components["schemas"]["FolderSettings"]; + /** @description Current password */ + current: string; + /** @description New password */ + new: string; }; }; }; + responses: { + /** @description Certificate saved with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description No file provided or other problem with provided file */ + 400: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Read content of PFX file */ + "account-read-pfx-data": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + requestBody: { + content: { + "application/json": { + /** @description password of PFX file to decrypt the file and return his content */ + password: string; + }; + }; + }; + responses: { + /** @description Certificate saved with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["CertificatePfxData"]; + }; + }; + }; + }; + /** @description No file provided or other problem with provided file */ + 400: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** + * Validate a file using Uuid + * @description Validate a file returning file data. + */ + "file-validate-uuid": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description The UUID of the LibreSign file */ + uuid: string; + }; + }; responses: { /** @description OK */ 200: { @@ -1490,19 +1446,130 @@ export type operations = { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["NextcloudFile"]; + data: components["schemas"]["ValidateFile"]; }; }; }; }; - /** @description Failed to save data */ - 422: { + /** @description Request failed */ + 404: { content: { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; data: { - message: string; + /** Format: int64 */ + action: number; + errors: string[]; + settings: components["schemas"]["Settings"]; + messages?: { + type: string; + message: string; + }[]; + }; + }; + }; + }; + }; + }; + }; + /** + * Validate a file using FileId + * @description Validate a file returning file data. + */ + "file-validate-file-id": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description The identifier value of the LibreSign file */ + fileId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["ValidateFile"]; + }; + }; + }; + }; + /** @description Request failed */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + action: number; + errors: string[]; + settings: components["schemas"]["Settings"]; + messages?: { + type: string; + message: string; + }[]; + }; + }; + }; + }; + }; + }; + }; + /** + * Validate a file + * @description Validate a file returning file data. + */ + "file-validate": { + parameters: { + query?: { + /** @description The type of identifier could be Uuid or FileId */ + type?: string | null; + /** @description The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer */ + identifier?: string | number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["ValidateFile"]; + }; + }; + }; + }; + /** @description Request failed */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + action: number; + errors: string[]; + settings: components["schemas"]["Settings"]; + messages?: { + type: string; + message: string; + }[]; }; }; }; @@ -1626,17 +1693,11 @@ export type operations = { }; }; /** - * Validate a file - * @description Validate a file returning file data. + * Send a file + * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId */ - "file-validate": { + "file-save": { parameters: { - query?: { - /** @description The type of identifier could be Uuid or FileId */ - type?: string | null; - /** @description The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer */ - identifier?: string | number; - }; header: { /** @description Required to be true for the API request to pass */ "OCS-APIRequest": boolean; @@ -1645,6 +1706,24 @@ export type operations = { apiVersion: "v1"; }; }; + requestBody: { + content: { + "application/json": { + /** @description File to save */ + file: components["schemas"]["NewFile"]; + /** + * @description The name of file to sign + * @default + */ + name?: string; + /** + * @description Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method. + * @default [] + */ + settings?: components["schemas"]["FolderSettings"]; + }; + }; + }; responses: { /** @description OK */ 200: { @@ -1652,126 +1731,19 @@ export type operations = { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["ValidateFile"]; + data: components["schemas"]["NextcloudFile"]; }; }; }; }; - /** @description Request failed */ - 404: { + /** @description Failed to save data */ + 422: { content: { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; data: { - /** Format: int64 */ - action: number; - errors: string[]; - settings: components["schemas"]["Settings"]; - messages?: { - type: string; - message: string; - }[]; - }; - }; - }; - }; - }; - }; - }; - /** - * Validate a file using Uuid - * @description Validate a file returning file data. - */ - "file-validate-uuid": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description The UUID of the LibreSign file */ - uuid: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["ValidateFile"]; - }; - }; - }; - }; - /** @description Request failed */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - /** Format: int64 */ - action: number; - errors: string[]; - settings: components["schemas"]["Settings"]; - messages?: { - type: string; - message: string; - }[]; - }; - }; - }; - }; - }; - }; - }; - /** - * Validate a file using FileId - * @description Validate a file returning file data. - */ - "file-validate-file-id": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description The identifier value of the LibreSign file */ - fileId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["ValidateFile"]; - }; - }; - }; - }; - /** @description Request failed */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - /** Format: int64 */ - action: number; - errors: string[]; - settings: components["schemas"]["Settings"]; - messages?: { - type: string; - message: string; - }[]; + message: string; }; }; }; @@ -2011,8 +1983,8 @@ export type operations = { }; }; }; - /** Notify a signer of a file */ - "notify-signer": { + /** Notify signers of a file */ + "notify-signers": { parameters: { header: { /** @description Required to be true for the API request to pass */ @@ -2030,11 +2002,10 @@ export type operations = { * @description The identifier value of LibreSign file */ fileId: number; - /** - * Format: int64 - * @description The sign request id - */ - signRequestId: number; + /** @description Signers data */ + signers: { + email: string; + }[]; }; }; }; @@ -2071,8 +2042,8 @@ export type operations = { }; }; }; - /** Notify signers of a file */ - "notify-signers": { + /** Notify a signer of a file */ + "notify-signer": { parameters: { header: { /** @description Required to be true for the API request to pass */ @@ -2090,10 +2061,11 @@ export type operations = { * @description The identifier value of LibreSign file */ fileId: number; - /** @description Signers data */ - signers: { - email: string; - }[]; + /** + * Format: int64 + * @description The sign request id + */ + signRequestId: number; }; }; }; @@ -2310,6 +2282,68 @@ export type operations = { }; }; }; + /** + * Delete sign request + * @description You can only request exclusion as any sign + */ + "request_signature-delete-one-request-signature-using-file-id": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + fileId: number; + /** @description The sign request id */ + signRequestId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Failed */ + 401: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Failed */ + 422: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + action: number; + errors: string[]; + }; + }; + }; + }; + }; + }; + }; /** Sign a file using file Id */ "sign_file-sign-using-file-id": { parameters: { @@ -2445,335 +2479,6 @@ export type operations = { }; }; }; - /** - * Delete sign request - * @description You can only request exclusion as any sign - */ - "request_signature-delete-one-request-signature-using-file-id": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - fileId: number; - /** @description The sign request id */ - signRequestId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description Failed */ - 401: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description Failed */ - 422: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - /** Format: int64 */ - action: number; - errors: string[]; - }; - }; - }; - }; - }; - }; - }; - /** Get signature elements */ - "signature_elements-get-signature-elements": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - elements: components["schemas"]["UserElement"][]; - }; - }; - }; - }; - }; - /** @description Invalid data */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Create signature element */ - "signature_elements-create-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody: { - content: { - "application/json": { - /** @description Element object */ - elements: { - [key: string]: Record; - }; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - elements: components["schemas"]["UserElement"][]; - message: string; - }; - }; - }; - }; - }; - /** @description Invalid data */ - 422: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Get preview of signature elements of */ - "signature_elements-get-signature-element-preview": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "*/*": string; - }; - }; - /** @description Invalid data */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: Record; - }; - }; - }; - }; - }; - }; - /** Get signature element of signer */ - "signature_elements-get-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["UserElement"]; - }; - }; - }; - }; - /** @description Invalid data */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Delete signature element */ - "signature_elements-delete-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description Not found */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Update signature element */ - "signature_elements-patch-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - requestBody?: { - content: { - "application/json": { - /** - * @description The type of signature element - * @default - */ - type?: string; - /** - * @description Element object - * @default [] - */ - file?: { - [key: string]: Record; - }; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - elements: components["schemas"]["UserElement"][]; - message: string; - }; - }; - }; - }; - }; - /** @description Error */ - 422: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; /** Sign a file using file UUID */ "sign_file-sign-using-uuid": { parameters: { @@ -2978,6 +2683,273 @@ export type operations = { }; }; }; + /** Get signature elements */ + "signature_elements-get-signature-elements": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + elements: components["schemas"]["UserElement"][]; + }; + }; + }; + }; + }; + /** @description Invalid data */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Create signature element */ + "signature_elements-create-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + requestBody: { + content: { + "application/json": { + /** @description Element object */ + elements: { + [key: string]: Record; + }; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + elements: components["schemas"]["UserElement"][]; + message: string; + }; + }; + }; + }; + }; + /** @description Invalid data */ + 422: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Get signature element of signer */ + "signature_elements-get-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["UserElement"]; + }; + }; + }; + }; + /** @description Invalid data */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Get preview of signature elements of */ + "signature_elements-get-signature-element-preview": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "*/*": string; + }; + }; + /** @description Invalid data */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: Record; + }; + }; + }; + }; + }; + }; + /** Update signature element */ + "signature_elements-patch-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + requestBody?: { + content: { + "application/json": { + /** + * @description The type of signature element + * @default + */ + type?: string; + /** + * @description Element object + * @default [] + */ + file?: { + [key: string]: Record; + }; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + elements: components["schemas"]["UserElement"][]; + message: string; + }; + }; + }; + }; + }; + /** @description Error */ + 422: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Delete signature element */ + "signature_elements-delete-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; /** * Generate certificate using CFSSL engine * @description This endpoint requires admin access diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index aeb2d4686..6ad0d7c85 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -28,35 +28,27 @@ export type paths = { /** Incomplete page */ get: operations["page-incomplete"]; }; - "/index.php/apps/libresign/f/sign/{uuid}/{path}": { - /** - * Sign page to authenticated signer with the path of file - * @description The path is used only by frontend - */ - get: operations["page-signf-path-extra"]; - }; - "/index.php/apps/libresign/f/sign/{uuid}": { - /** Sign page to authenticated signer */ - get: operations["page-signf"]; + "/index.php/apps/libresign/p/incomplete": { + /** Incomplete page in full screen */ + get: operations["page-incompletep"]; }; "/index.php/apps/libresign/f/{path}": { /** * Main page to authenticated signer with a path * @description The path is used only by frontend */ - get: operations["page-indexf-path-front"]; + get: operations["page-indexf-path"]; }; - "/index.php/apps/libresign/pdf/{uuid}": { - /** Use UUID of user to get PDF */ - get: operations["page-get-pdf-file"]; + "/index.php/apps/libresign/f/sign/{uuid}": { + /** Sign page to authenticated signer */ + get: operations["page-signf"]; }; - "/index.php/apps/libresign/reset-password": { - /** Show validation page */ - get: operations["page-reset-password"]; - }; - "/index.php/apps/libresign/p/incomplete": { - /** Incomplete page in full screen */ - get: operations["page-incompletep"]; + "/index.php/apps/libresign/f/sign/{uuid}/{path}": { + /** + * Sign page to authenticated signer with the path of file + * @description The path is used only by frontend + */ + get: operations["page-signf-path"]; }; "/index.php/apps/libresign/p/sign/{uuid}": { /** @@ -65,20 +57,21 @@ export type paths = { */ get: operations["page-sign"]; }; - "/index.php/apps/libresign/p/sign/{uuid}/{path}": { - /** - * Sign page to authenticated signer - * @description The path is used only by frontend - */ - get: operations["page-sign-extra"]; - }; "/index.php/apps/libresign/p/account/files/approve/{uuid}": { /** Show signature page */ get: operations["page-sign-account-file"]; }; "/index.php/apps/libresign/p/account/files/approve/{uuid}/{path}": { /** Show signature page */ - get: operations["page-sign-account-file-extra"]; + get: operations["page-sign-account-file-private"]; + }; + "/index.php/apps/libresign/p/pdf/{uuid}": { + /** Use UUID of file to get PDF */ + get: operations["page-get-pdf"]; + }; + "/index.php/apps/libresign/pdf/{uuid}": { + /** Use UUID of user to get PDF */ + get: operations["page-get-pdf-file"]; }; "/index.php/apps/libresign/p/validation": { /** Show validation page */ @@ -91,18 +84,30 @@ export type paths = { */ get: operations["page-validation-file-with-short-url"]; }; + "/index.php/apps/libresign/reset-password": { + /** Show validation page */ + get: operations["page-reset-password"]; + }; "/index.php/apps/libresign/p/validation/{uuid}": { /** Show validation page for a specific file UUID */ get: operations["page-validation-file"]; }; - "/index.php/apps/libresign/p/pdf/{uuid}": { - /** Use UUID of file to get PDF */ - get: operations["page-get-pdf"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/create/{uuid}": { /** Create account to sign a document */ post: operations["account-create-to-sign"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/signature": { + /** Create PFX file using self-signed certificate */ + post: operations["account-signature-generate"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files": { + /** List account files of authenticated account */ + get: operations["account-account-file-list-to-owner"]; + /** Add files to account profile */ + post: operations["account-add-files"]; + /** Delete file from account */ + delete: operations["account-delete-file"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/me": { /** * Who am I @@ -110,6 +115,14 @@ export type paths = { */ get: operations["account-me"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files/approval/list": { + /** List account files that need to be approved */ + get: operations["account-account-file-list-to-approval"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { + /** Update the account phone number */ + patch: operations["account-update-settings"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/pfx": { /** Upload PFX file */ post: operations["account-upload-pfx"]; @@ -125,48 +138,6 @@ export type paths = { /** Read content of PFX file */ post: operations["account-read-pfx-data"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/settings": { - /** Update the account phone number */ - patch: operations["account-update-settings"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/signature": { - /** Create PFX file using self-signed certificate */ - post: operations["account-signature-generate"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files": { - /** List account files of authenticated account */ - get: operations["account-account-file-list-to-owner"]; - /** Add files to account profile */ - post: operations["account-add-files"]; - /** Delete file from account */ - delete: operations["account-delete-file"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/account/files/approval/list": { - /** List account files that need to be approved */ - get: operations["account-account-file-list-to-approval"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { - /** - * Send a file - * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId - */ - post: operations["file-save"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/list": { - /** List account files that need to be approved */ - get: operations["file-list"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/thumbnail/{nodeId}": { - /** Return the thumbnail of a LibreSign file */ - get: operations["file-get-thumbnail"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { - /** - * Validate a file - * @description Validate a file returning file data. - */ - get: operations["file-validate"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate/uuid/{uuid}": { /** * Validate a file using Uuid @@ -181,6 +152,28 @@ export type paths = { */ get: operations["file-validate-file-id"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/validate": { + /** + * Validate a file + * @description Validate a file returning file data. + */ + get: operations["file-validate"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/list": { + /** List account files that need to be approved */ + get: operations["file-list"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file/thumbnail/{nodeId}": { + /** Return the thumbnail of a LibreSign file */ + get: operations["file-get-thumbnail"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/file": { + /** + * Send a file + * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId + */ + post: operations["file-save"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/file-element/{uuid}": { /** * Create visible element @@ -207,15 +200,15 @@ export type paths = { */ get: operations["identify_account-search"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { - /** Notify a signer of a file */ - post: operations["notify-signer"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signers": { /** Notify signers of a file */ post: operations["notify-signers"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/notif/notification": { + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/signer": { + /** Notify a signer of a file */ + post: operations["notify-signer"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/notify/notification": { /** Dismiss a specific notification */ delete: operations["notify-notification-dismiss"]; }; @@ -231,6 +224,13 @@ export type paths = { */ patch: operations["request_signature-update-sign"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { + /** + * Delete sign request + * @description You can only request exclusion as any sign + */ + delete: operations["request_signature-delete-one-request-signature-using-file-id"]; + }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}": { /** Sign a file using file Id */ post: operations["sign_file-sign-using-file-id"]; @@ -240,31 +240,6 @@ export type paths = { */ delete: operations["request_signature-delete-all-request-signature-using-file-id"]; }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/file_id/{fileId}/{signRequestId}": { - /** - * Delete sign request - * @description You can only request exclusion as any sign - */ - delete: operations["request_signature-delete-one-request-signature-using-file-id"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { - /** Get signature elements */ - get: operations["signature_elements-get-signature-elements"]; - /** Create signature element */ - post: operations["signature_elements-create-signature-element"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { - /** Get preview of signature elements of */ - get: operations["signature_elements-get-signature-element-preview"]; - }; - "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { - /** Get signature element of signer */ - get: operations["signature_elements-get-signature-element"]; - /** Delete signature element */ - delete: operations["signature_elements-delete-signature-element"]; - /** Update signature element */ - patch: operations["signature_elements-patch-signature-element"]; - }; "/ocs/v2.php/apps/libresign/api/{apiVersion}/sign/uuid/{uuid}": { /** Sign a file using file UUID */ post: operations["sign_file-sign-using-uuid"]; @@ -281,6 +256,24 @@ export type paths = { /** Get code to sign the document using FileID */ post: operations["sign_file-get-code-using-file-id"]; }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements": { + /** Get signature elements */ + get: operations["signature_elements-get-signature-elements"]; + /** Create signature element */ + post: operations["signature_elements-create-signature-element"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/preview/{nodeId}": { + /** Get signature element of signer */ + get: operations["signature_elements-get-signature-element"]; + /** Get preview of signature elements of */ + post: operations["signature_elements-get-signature-element-preview"]; + /** Update signature element */ + patch: operations["signature_elements-patch-signature-element"]; + }; + "/ocs/v2.php/apps/libresign/api/{apiVersion}/signature/elements/{nodeId}": { + /** Delete signature element */ + delete: operations["signature_elements-delete-signature-element"]; + }; }; export type webhooks = Record; @@ -543,15 +536,24 @@ export type operations = { }; }; }; + /** Incomplete page in full screen */ + "page-incompletep": { + responses: { + /** @description OK */ + 200: { + content: { + "text/html": string; + }; + }; + }; + }; /** - * Sign page to authenticated signer with the path of file + * Main page to authenticated signer with a path * @description The path is used only by frontend */ - "page-signf-path-extra": { + "page-indexf-path": { parameters: { path: { - /** @description Sign request uuid */ - uuid: string; path: string; }; }; @@ -582,54 +584,17 @@ export type operations = { }; }; /** - * Main page to authenticated signer with a path + * Sign page to authenticated signer with the path of file * @description The path is used only by frontend */ - "page-indexf-path-front": { - parameters: { - path: { - path: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "text/html": string; - }; - }; - }; - }; - /** Use UUID of user to get PDF */ - "page-get-pdf-file": { + "page-signf-path": { parameters: { path: { /** @description Sign request uuid */ uuid: string; + path: string; }; }; - responses: { - /** @description OK */ - 200: { - content: { - "*/*": string; - }; - }; - }; - }; - /** Show validation page */ - "page-reset-password": { - responses: { - /** @description OK */ - 200: { - content: { - "text/html": string; - }; - }; - }; - }; - /** Incomplete page in full screen */ - "page-incompletep": { responses: { /** @description OK */ 200: { @@ -659,27 +624,6 @@ export type operations = { }; }; }; - /** - * Sign page to authenticated signer - * @description The path is used only by frontend - */ - "page-sign-extra": { - parameters: { - path: { - /** @description Sign request uuid */ - uuid: string; - path: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "text/html": string; - }; - }; - }; - }; /** Show signature page */ "page-sign-account-file": { parameters: { @@ -698,7 +642,7 @@ export type operations = { }; }; /** Show signature page */ - "page-sign-account-file-extra": { + "page-sign-account-file-private": { parameters: { path: { /** @description Sign request uuid */ @@ -715,6 +659,46 @@ export type operations = { }; }; }; + /** Use UUID of file to get PDF */ + "page-get-pdf": { + parameters: { + path: { + /** @description File uuid */ + uuid: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "*/*": string; + }; + }; + /** @description File not found */ + 404: { + content: { + "application/json": unknown; + }; + }; + }; + }; + /** Use UUID of user to get PDF */ + "page-get-pdf-file": { + parameters: { + path: { + /** @description Sign request uuid */ + uuid: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "*/*": string; + }; + }; + }; + }; /** Show validation page */ "page-validation": { responses: { @@ -746,6 +730,17 @@ export type operations = { }; }; }; + /** Show validation page */ + "page-reset-password": { + responses: { + /** @description OK */ + 200: { + content: { + "text/html": string; + }; + }; + }; + }; /** Show validation page for a specific file UUID */ "page-validation-file": { parameters: { @@ -763,29 +758,6 @@ export type operations = { }; }; }; - /** Use UUID of file to get PDF */ - "page-get-pdf": { - parameters: { - path: { - /** @description File uuid */ - uuid: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "*/*": string; - }; - }; - /** @description File not found */ - 404: { - content: { - "application/json": unknown; - }; - }; - }; - }; /** Create account to sign a document */ "account-create-to-sign": { parameters: { @@ -849,275 +821,6 @@ export type operations = { }; }; }; - /** - * Who am I - * @description Validates API access data and returns the authenticated user's data. - */ - "account-me": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - account: { - uid: string; - emailAddress: string; - displayName: string; - }; - settings: { - canRequestSign: boolean; - hasSignatureFile: boolean; - }; - }; - }; - }; - }; - }; - /** @description Invalid user or password */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Upload PFX file */ - "account-upload-pfx": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description Certificate saved with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description No file provided or other problem with provided file */ - 400: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Delete PFX file */ - "account-delete-pfx": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description Certificate deleted with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** - * Update PFX file - * @description Used to change the password of PFX file - */ - "account-update-pfx-password": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody: { - content: { - "application/json": { - /** @description Current password */ - current: string; - /** @description New password */ - new: string; - }; - }; - }; - responses: { - /** @description Certificate saved with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description No file provided or other problem with provided file */ - 400: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Read content of PFX file */ - "account-read-pfx-data": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody: { - content: { - "application/json": { - /** @description password of PFX file to decrypt the file and return his content */ - password: string; - }; - }; - }; - responses: { - /** @description Certificate saved with success */ - 202: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["CertificatePfxData"]; - }; - }; - }; - }; - /** @description No file provided or other problem with provided file */ - 400: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Update the account phone number */ - "account-update-settings": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody?: { - content: { - "application/json": { - /** @description the phone number to be defined. If null will remove the phone number */ - phone?: string | null; - }; - }; - }; - responses: { - /** @description Settings saved */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - data: { - userId: string; - phone: string; - message: string; - }; - }; - }; - }; - }; - }; - /** @description Invalid data to update phone number */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; /** Create PFX file using self-signed certificate */ "account-signature-generate": { parameters: { @@ -1315,6 +1018,57 @@ export type operations = { }; }; }; + /** + * Who am I + * @description Validates API access data and returns the authenticated user's data. + */ + "account-me": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + account: { + uid: string; + emailAddress: string; + displayName: string; + }; + settings: { + canRequestSign: boolean; + hasSignatureFile: boolean; + }; + }; + }; + }; + }; + }; + /** @description Invalid user or password */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; /** List account files that need to be approved */ "account-account-file-list-to-approval": { parameters: { @@ -1367,11 +1121,130 @@ export type operations = { }; }; }; + /** Update the account phone number */ + "account-update-settings": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + requestBody?: { + content: { + "application/json": { + /** @description the phone number to be defined. If null will remove the phone number */ + phone?: string | null; + }; + }; + }; + responses: { + /** @description Settings saved */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + data: { + userId: string; + phone: string; + message: string; + }; + }; + }; + }; + }; + }; + /** @description Invalid data to update phone number */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Upload PFX file */ + "account-upload-pfx": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description Certificate saved with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description No file provided or other problem with provided file */ + 400: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Delete PFX file */ + "account-delete-pfx": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description Certificate deleted with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; /** - * Send a file - * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId + * Update PFX file + * @description Used to change the password of PFX file */ - "file-save": { + "account-update-pfx-password": { parameters: { header: { /** @description Required to be true for the API request to pass */ @@ -1384,21 +1257,104 @@ export type operations = { requestBody: { content: { "application/json": { - /** @description File to save */ - file: components["schemas"]["NewFile"]; - /** - * @description The name of file to sign - * @default - */ - name?: string; - /** - * @description Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method. - * @default [] - */ - settings?: components["schemas"]["FolderSettings"]; + /** @description Current password */ + current: string; + /** @description New password */ + new: string; }; }; }; + responses: { + /** @description Certificate saved with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description No file provided or other problem with provided file */ + 400: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Read content of PFX file */ + "account-read-pfx-data": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + requestBody: { + content: { + "application/json": { + /** @description password of PFX file to decrypt the file and return his content */ + password: string; + }; + }; + }; + responses: { + /** @description Certificate saved with success */ + 202: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["CertificatePfxData"]; + }; + }; + }; + }; + /** @description No file provided or other problem with provided file */ + 400: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** + * Validate a file using Uuid + * @description Validate a file returning file data. + */ + "file-validate-uuid": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description The UUID of the LibreSign file */ + uuid: string; + }; + }; responses: { /** @description OK */ 200: { @@ -1406,19 +1362,130 @@ export type operations = { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["NextcloudFile"]; + data: components["schemas"]["ValidateFile"]; }; }; }; }; - /** @description Failed to save data */ - 422: { + /** @description Request failed */ + 404: { content: { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; data: { - message: string; + /** Format: int64 */ + action: number; + errors: string[]; + settings: components["schemas"]["Settings"]; + messages?: { + type: string; + message: string; + }[]; + }; + }; + }; + }; + }; + }; + }; + /** + * Validate a file using FileId + * @description Validate a file returning file data. + */ + "file-validate-file-id": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description The identifier value of the LibreSign file */ + fileId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["ValidateFile"]; + }; + }; + }; + }; + /** @description Request failed */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + action: number; + errors: string[]; + settings: components["schemas"]["Settings"]; + messages?: { + type: string; + message: string; + }[]; + }; + }; + }; + }; + }; + }; + }; + /** + * Validate a file + * @description Validate a file returning file data. + */ + "file-validate": { + parameters: { + query?: { + /** @description The type of identifier could be Uuid or FileId */ + type?: string | null; + /** @description The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer */ + identifier?: string | number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["ValidateFile"]; + }; + }; + }; + }; + /** @description Request failed */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + action: number; + errors: string[]; + settings: components["schemas"]["Settings"]; + messages?: { + type: string; + message: string; + }[]; }; }; }; @@ -1542,17 +1609,11 @@ export type operations = { }; }; /** - * Validate a file - * @description Validate a file returning file data. + * Send a file + * @description Send a new file to Nextcloud and return the fileId to request to sign usign fileId */ - "file-validate": { + "file-save": { parameters: { - query?: { - /** @description The type of identifier could be Uuid or FileId */ - type?: string | null; - /** @description The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer */ - identifier?: string | number; - }; header: { /** @description Required to be true for the API request to pass */ "OCS-APIRequest": boolean; @@ -1561,6 +1622,24 @@ export type operations = { apiVersion: "v1"; }; }; + requestBody: { + content: { + "application/json": { + /** @description File to save */ + file: components["schemas"]["NewFile"]; + /** + * @description The name of file to sign + * @default + */ + name?: string; + /** + * @description Settings to define the pattern to store the file. See more informations at FolderService::getFolderName method. + * @default [] + */ + settings?: components["schemas"]["FolderSettings"]; + }; + }; + }; responses: { /** @description OK */ 200: { @@ -1568,126 +1647,19 @@ export type operations = { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["ValidateFile"]; + data: components["schemas"]["NextcloudFile"]; }; }; }; }; - /** @description Request failed */ - 404: { + /** @description Failed to save data */ + 422: { content: { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; data: { - /** Format: int64 */ - action: number; - errors: string[]; - settings: components["schemas"]["Settings"]; - messages?: { - type: string; - message: string; - }[]; - }; - }; - }; - }; - }; - }; - }; - /** - * Validate a file using Uuid - * @description Validate a file returning file data. - */ - "file-validate-uuid": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description The UUID of the LibreSign file */ - uuid: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["ValidateFile"]; - }; - }; - }; - }; - /** @description Request failed */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - /** Format: int64 */ - action: number; - errors: string[]; - settings: components["schemas"]["Settings"]; - messages?: { - type: string; - message: string; - }[]; - }; - }; - }; - }; - }; - }; - }; - /** - * Validate a file using FileId - * @description Validate a file returning file data. - */ - "file-validate-file-id": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description The identifier value of the LibreSign file */ - fileId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["ValidateFile"]; - }; - }; - }; - }; - /** @description Request failed */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - /** Format: int64 */ - action: number; - errors: string[]; - settings: components["schemas"]["Settings"]; - messages?: { - type: string; - message: string; - }[]; + message: string; }; }; }; @@ -1927,8 +1899,8 @@ export type operations = { }; }; }; - /** Notify a signer of a file */ - "notify-signer": { + /** Notify signers of a file */ + "notify-signers": { parameters: { header: { /** @description Required to be true for the API request to pass */ @@ -1946,11 +1918,10 @@ export type operations = { * @description The identifier value of LibreSign file */ fileId: number; - /** - * Format: int64 - * @description The sign request id - */ - signRequestId: number; + /** @description Signers data */ + signers: { + email: string; + }[]; }; }; }; @@ -1987,8 +1958,8 @@ export type operations = { }; }; }; - /** Notify signers of a file */ - "notify-signers": { + /** Notify a signer of a file */ + "notify-signer": { parameters: { header: { /** @description Required to be true for the API request to pass */ @@ -2006,10 +1977,11 @@ export type operations = { * @description The identifier value of LibreSign file */ fileId: number; - /** @description Signers data */ - signers: { - email: string; - }[]; + /** + * Format: int64 + * @description The sign request id + */ + signRequestId: number; }; }; }; @@ -2226,6 +2198,68 @@ export type operations = { }; }; }; + /** + * Delete sign request + * @description You can only request exclusion as any sign + */ + "request_signature-delete-one-request-signature-using-file-id": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + fileId: number; + /** @description The sign request id */ + signRequestId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Failed */ + 401: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Failed */ + 422: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + action: number; + errors: string[]; + }; + }; + }; + }; + }; + }; + }; /** Sign a file using file Id */ "sign_file-sign-using-file-id": { parameters: { @@ -2361,335 +2395,6 @@ export type operations = { }; }; }; - /** - * Delete sign request - * @description You can only request exclusion as any sign - */ - "request_signature-delete-one-request-signature-using-file-id": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - fileId: number; - /** @description The sign request id */ - signRequestId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description Failed */ - 401: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description Failed */ - 422: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - /** Format: int64 */ - action: number; - errors: string[]; - }; - }; - }; - }; - }; - }; - }; - /** Get signature elements */ - "signature_elements-get-signature-elements": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - elements: components["schemas"]["UserElement"][]; - }; - }; - }; - }; - }; - /** @description Invalid data */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Create signature element */ - "signature_elements-create-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - }; - }; - requestBody: { - content: { - "application/json": { - /** @description Element object */ - elements: { - [key: string]: Record; - }; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - elements: components["schemas"]["UserElement"][]; - message: string; - }; - }; - }; - }; - }; - /** @description Invalid data */ - 422: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Get preview of signature elements of */ - "signature_elements-get-signature-element-preview": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "*/*": string; - }; - }; - /** @description Invalid data */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: Record; - }; - }; - }; - }; - }; - }; - /** Get signature element of signer */ - "signature_elements-get-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: components["schemas"]["UserElement"]; - }; - }; - }; - }; - /** @description Invalid data */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Delete signature element */ - "signature_elements-delete-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - /** @description Not found */ - 404: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; - /** Update signature element */ - "signature_elements-patch-signature-element": { - parameters: { - header: { - /** @description Required to be true for the API request to pass */ - "OCS-APIRequest": boolean; - }; - path: { - apiVersion: "v1"; - /** @description Node id of a Nextcloud file */ - nodeId: number; - }; - }; - requestBody?: { - content: { - "application/json": { - /** - * @description The type of signature element - * @default - */ - type?: string; - /** - * @description Element object - * @default [] - */ - file?: { - [key: string]: Record; - }; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - elements: components["schemas"]["UserElement"][]; - message: string; - }; - }; - }; - }; - }; - /** @description Error */ - 422: { - content: { - "application/json": { - ocs: { - meta: components["schemas"]["OCSMeta"]; - data: { - message: string; - }; - }; - }; - }; - }; - }; - }; /** Sign a file using file UUID */ "sign_file-sign-using-uuid": { parameters: { @@ -2894,4 +2599,271 @@ export type operations = { }; }; }; + /** Get signature elements */ + "signature_elements-get-signature-elements": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + elements: components["schemas"]["UserElement"][]; + }; + }; + }; + }; + }; + /** @description Invalid data */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Create signature element */ + "signature_elements-create-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + }; + }; + requestBody: { + content: { + "application/json": { + /** @description Element object */ + elements: { + [key: string]: Record; + }; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + elements: components["schemas"]["UserElement"][]; + message: string; + }; + }; + }; + }; + }; + /** @description Invalid data */ + 422: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Get signature element of signer */ + "signature_elements-get-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["UserElement"]; + }; + }; + }; + }; + /** @description Invalid data */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Get preview of signature elements of */ + "signature_elements-get-signature-element-preview": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "*/*": string; + }; + }; + /** @description Invalid data */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: Record; + }; + }; + }; + }; + }; + }; + /** Update signature element */ + "signature_elements-patch-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + requestBody?: { + content: { + "application/json": { + /** + * @description The type of signature element + * @default + */ + type?: string; + /** + * @description Element object + * @default [] + */ + file?: { + [key: string]: Record; + }; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + elements: components["schemas"]["UserElement"][]; + message: string; + }; + }; + }; + }; + }; + /** @description Error */ + 422: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + /** Delete signature element */ + "signature_elements-delete-signature-element": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + /** @description Node id of a Nextcloud file */ + nodeId: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; };