Skip to content

Commit

Permalink
chore: remove settings from error message
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Jan 4, 2025
1 parent 291e95c commit f1d04db
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 34 deletions.
8 changes: 4 additions & 4 deletions lib/Controller/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct(
* Validate a file returning file data.
*
* @param string $uuid The UUID of the LibreSign file
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{action: int, errors: string[], settings: LibresignSettings, messages?: array{type: string, message: string}[]}, array{}>
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{action: int, errors: string[], messages?: array{type: string, message: string}[]}, array{}>
*
* 200: OK
* 404: Request failed
Expand All @@ -97,7 +97,7 @@ public function validateUuid(string $uuid): DataResponse {
* Validate a file returning file data.
*
* @param int $fileId The identifier value of the LibreSign file
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{action: int, errors: string[], settings: LibresignSettings, messages?: array{type: string, message: string}[]}, array{}>
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{action: int, errors: string[], messages?: array{type: string, message: string}[]}, array{}>
*
* 200: OK
* 404: Request failed
Expand All @@ -117,7 +117,7 @@ public function validateFileId(int $fileId): DataResponse {
* Validate a binary file returning file data.
* Use field 'file' for the file upload
*
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND|Http::STATUS_BAD_REQUEST, array{action: int, errors: string[], settings: LibresignSettings, messages?: array{type: string, message: string}[]}, array{}>
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND|Http::STATUS_BAD_REQUEST, array{action: int, errors: string[], messages?: array{type: string, message: string}[]}, array{}>

Check failure on line 120 in lib/Controller/FileController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

InvalidReturnType

lib/Controller/FileController.php:120:13: InvalidReturnType: The declared return type 'OCP\AppFramework\Http\DataResponse<200|400|404, array{action?: int, created_at?: string, errors?: array<array-key, string>, file?: string, messages?: array<array-key, array{message: string, type: string}>, name?: string, nodeId?: int<0, max>, pdfVersion?: string, requested_by?: array{displayName: string, userId: string}, settings?: array{canRequestSign: bool, canSign: bool, hasSignatureFile?: bool, identificationDocumentsWaitingApproval?: bool, needIdentificationDocuments?: bool, phoneNumber: string, signerFileUuid: null|string}, signers?: array<array-key, array{description: null|string, displayName: string, email?: string, identifyMethods?: array<array-key, array{mandatory: int<0, max>, method: 'account'|'email', value: string}>, me: bool, notify?: array<array-key, array{date: int, method: 'activity'|'mail'|'notify'}>, remote_address?: string, request_sign_date: string, signRequestId: int<0, max>, sign_date?: null|string, sign_uuid?: string, signatureMethods?: array{clickToSign?: array{enabled: bool, label: string, name: string}, emailToken?: array{blurredEmail: string, hasConfirmCode: bool, hashOfEmail: string, identifyMethod: 'account'|'email', label: string, needCode: bool}, password?: array{hasSignatureFile: bool, label: string, name: string}}, signed: null|string, userId?: string, user_agent?: string, visibleElements?: array<array-key, array{coordinates: array{height?: int<0, max>, left?: int<0, max>, llx?: int<0, max>, lly?: int<0, max>, page?: int<0, max>, top?: int<0, max>, urx?: int<0, max>, ury?: int<0, max>, width?: int<0, max>}, elementId: int<0, max>, signRequestId: int<0, max>, type: string}>}>, size?: int<0, max>, status?: 0|1|2|3|4, statusText?: string, totalPages?: int<0, max>, url?: string, uuid?: string, visibleElements?: array<array-key, array{coordinates: array{height?: int<0, max>, left?: int<0, max>, llx?: int<0, max>, lly?: int<0, max>, page?: int<0, max>, top?: int<0, max>, urx?: int<0, max>, ury?: int<0, max>, width?: int<0, max>}, elementId: int<0, max>, signRequestId: int<0, max>, type: string}>}, array<never, never>>' for OCA\Libresign\Controller\FileController::validateBinary is incorrect, got 'OCP\AppFramework\Http\DataResponse<200|400|404, array{action?: 2000, created_at?: string, errors?: list{string}, file?: string, message?: string, messages?: array<array-key, array{message: string, type: 'info'}>, name?: string, nodeId?: int<0, max>, pdfVersion?: string, requested_by?: array{displayName: string, userId: string}, settings?: array{canRequestSign: bool, canSign: bool, hasSignatureFile?: bool, identificationDocumentsWaitingApproval?: bool, needIdentificationDocuments?: bool, phoneNumber: string, signerFileUuid: null|string}, signers?: array<array-key, array{description: null|string, displayName: string, email?: string, identifyMethods?: array<array-key, array{mandatory: int<0, max>, method: 'account'|'email', value: string}>, me: bool, notify?: array<array-key, array{date: int, method: 'activity'|'mail'|'notify'}>, remote_address?: string, request_sign_date: string, signRequestId: int<0, max>, sign_date?: null|string, sign_uuid?: string, signatureMethods?: array{clickToSign?: array{enabled: bool, label: string, name: string}, emailToken?: array{blurredEmail: string, hasConfirmCode: bool, hashOfEmail: string, identifyMethod: 'account'|'email', label: string, needCode: bool}, password?: array{hasSignatureFile: bool, label: string, name: string}}, signed: null|string, userId?: string, user_agent?: string, visibleElements?: array<array-key, array{coordinates: array{height?: int<0, max>, left?: int<0, max>, llx?: int<0, max>, lly?: int<0, max>, page?: int<0, max>, top?: int<0, max>, urx?: int<0, max>, ury?: int<0, max>, width?: int<0, max>}, elementId: int<0, max>, signRequestId: int<0, max>, type: string}>}>, size?: int<0, max>, status?: 0|1|2|3|4, statusText?: string, totalPages?: int<0, max>, url?: string, uuid?: string, visibleElements?: array<array-key, array{coordinates: array{height?: int<0, max>, lef
*
* 200: OK
* 404: Request failed
Expand Down Expand Up @@ -165,7 +165,7 @@ public function validateBinary(): DataResponse {
*
* @param string|null $type The type of identifier could be Uuid or FileId
* @param string|int $identifier The identifier value, could be string or integer, if UUID will be a string, if FileId will be an integer
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{action: int, errors: string[], settings: LibresignSettings, messages?: array{type: string, message: string}[]}, array{}>
* @return DataResponse<Http::STATUS_OK, LibresignValidateFile, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{action: int, errors: string[], messages?: array{type: string, message: string}[]}, array{}>
*
* 200: OK
* 404: Request failed
Expand Down
15 changes: 5 additions & 10 deletions openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -3448,8 +3448,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3601,8 +3600,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3744,8 +3742,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3812,8 +3809,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3978,8 +3974,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down
15 changes: 5 additions & 10 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3352,8 +3352,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3505,8 +3504,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3648,8 +3646,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3716,8 +3713,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down Expand Up @@ -3882,8 +3878,7 @@
"type": "object",
"required": [
"action",
"errors",
"settings"
"errors"
],
"properties": {
"action": {
Expand Down
10 changes: 5 additions & 5 deletions src/types/openapi/openapi-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down Expand Up @@ -2480,7 +2480,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down Expand Up @@ -2538,7 +2538,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down Expand Up @@ -2591,7 +2591,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand All @@ -2614,7 +2614,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down
10 changes: 5 additions & 5 deletions src/types/openapi/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down Expand Up @@ -2334,7 +2334,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down Expand Up @@ -2392,7 +2392,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down Expand Up @@ -2445,7 +2445,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand All @@ -2468,7 +2468,7 @@ export interface operations {
/** Format: int64 */
action: number;
errors: string[];
settings: components["schemas"]["Settings"];
settings?: components["schemas"]["Settings"];
messages?: {
type: string;
message: string;
Expand Down

0 comments on commit f1d04db

Please sign in to comment.