Skip to content

Commit de9b3a7

Browse files
committed
chore: update documentation
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 6806dee commit de9b3a7

7 files changed

Lines changed: 67 additions & 3 deletions

File tree

lib/Controller/FileElementController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct(
4343
* @param string $uuid UUID of sign request. The signer UUID is what the person receives via email when asked to sign. This is not the file UUID.
4444
* @param integer $signRequestId Id of sign request
4545
* @param integer|null $elementId ID of visible element. Each element has an ID that is returned on validation endpoints.
46+
* @param integer|null $fileId File ID when using node identifier instead of UUID
4647
* @param string $type The type of element to create, sginature, sinitial, date, datetime, text
4748
* @param array{} $metadata Metadata of visible elements to associate with the document
4849
* @param LibresignCoordinate $coordinates Coortinates of a visible element on PDF
@@ -54,14 +55,15 @@ public function __construct(
5455
#[NoAdminRequired]
5556
#[NoCSRFRequired]
5657
#[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/file-element/{uuid}', requirements: ['apiVersion' => '(v1)'])]
57-
public function post(string $uuid, int $signRequestId, ?int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
58+
public function post(string $uuid, int $signRequestId, ?int $elementId = null, ?int $fileId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
5859
$visibleElement = [
5960
'elementId' => $elementId,
6061
'type' => $type,
6162
'signRequestId' => $signRequestId,
6263
'coordinates' => $coordinates,
6364
'metadata' => $metadata,
6465
'fileUuid' => $uuid,
66+
'fileId' => $fileId,
6567
];
6668
try {
6769
$this->validateHelper->validateVisibleElement($visibleElement, ValidateHelper::TYPE_VISIBLE_ELEMENT_PDF);
@@ -92,6 +94,7 @@ public function post(string $uuid, int $signRequestId, ?int $elementId = null, s
9294
* @param string $uuid UUID of sign request. The signer UUID is what the person receives via email when asked to sign. This is not the file UUID.
9395
* @param integer $signRequestId Id of sign request
9496
* @param integer|null $elementId ID of visible element. Each element has an ID that is returned on validation endpoints.
97+
* @param integer|null $fileId File ID when using node identifier instead of UUID
9598
* @param string $type The type of element to create, sginature, sinitial, date, datetime, text
9699
* @param array{} $metadata Metadata of visible elements to associate with the document
97100
* @param LibresignCoordinate $coordinates Coortinates of a visible element on PDF
@@ -103,8 +106,8 @@ public function post(string $uuid, int $signRequestId, ?int $elementId = null, s
103106
#[NoAdminRequired]
104107
#[NoCSRFRequired]
105108
#[ApiRoute(verb: 'PATCH', url: '/api/{apiVersion}/file-element/{uuid}/{elementId}', requirements: ['apiVersion' => '(v1)'])]
106-
public function patch(string $uuid, int $signRequestId, ?int $elementId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
107-
return $this->post($uuid, $signRequestId, $elementId, $type, $metadata, $coordinates);
109+
public function patch(string $uuid, int $signRequestId, ?int $elementId = null, ?int $fileId = null, string $type = '', array $metadata = [], array $coordinates = []): DataResponse {
110+
return $this->post($uuid, $signRequestId, $elementId, $fileId, $type, $metadata, $coordinates);
108111
}
109112

110113
/**

lib/ResponseDefinitions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
* @psalm-type LibresignVisibleElement = array{
135135
* elementId: int,
136136
* signRequestId: int,
137+
* fileId: int,
137138
* type: string,
138139
* coordinates: LibresignCoordinate,
139140
* uuid: string,

openapi-full.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,7 @@
13471347
"required": [
13481348
"elementId",
13491349
"signRequestId",
1350+
"fileId",
13501351
"type",
13511352
"coordinates",
13521353
"uuid"
@@ -1360,6 +1361,10 @@
13601361
"type": "integer",
13611362
"format": "int64"
13621363
},
1364+
"fileId": {
1365+
"type": "integer",
1366+
"format": "int64"
1367+
},
13631368
"type": {
13641369
"type": "string"
13651370
},
@@ -5132,6 +5137,12 @@
51325137
"nullable": true,
51335138
"description": "ID of visible element. Each element has an ID that is returned on validation endpoints."
51345139
},
5140+
"fileId": {
5141+
"type": "integer",
5142+
"format": "int64",
5143+
"nullable": true,
5144+
"description": "File ID when using node identifier instead of UUID"
5145+
},
51355146
"type": {
51365147
"type": "string",
51375148
"default": "",
@@ -5311,6 +5322,12 @@
53115322
"format": "int64",
53125323
"description": "Id of sign request"
53135324
},
5325+
"fileId": {
5326+
"type": "integer",
5327+
"format": "int64",
5328+
"nullable": true,
5329+
"description": "File ID when using node identifier instead of UUID"
5330+
},
53145331
"type": {
53155332
"type": "string",
53165333
"default": "",

openapi.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,7 @@
11971197
"required": [
11981198
"elementId",
11991199
"signRequestId",
1200+
"fileId",
12001201
"type",
12011202
"coordinates",
12021203
"uuid"
@@ -1210,6 +1211,10 @@
12101211
"type": "integer",
12111212
"format": "int64"
12121213
},
1214+
"fileId": {
1215+
"type": "integer",
1216+
"format": "int64"
1217+
},
12131218
"type": {
12141219
"type": "string"
12151220
},
@@ -4982,6 +4987,12 @@
49824987
"nullable": true,
49834988
"description": "ID of visible element. Each element has an ID that is returned on validation endpoints."
49844989
},
4990+
"fileId": {
4991+
"type": "integer",
4992+
"format": "int64",
4993+
"nullable": true,
4994+
"description": "File ID when using node identifier instead of UUID"
4995+
},
49854996
"type": {
49864997
"type": "string",
49874998
"default": "",
@@ -5161,6 +5172,12 @@
51615172
"format": "int64",
51625173
"description": "Id of sign request"
51635174
},
5175+
"fileId": {
5176+
"type": "integer",
5177+
"format": "int64",
5178+
"nullable": true,
5179+
"description": "File ID when using node identifier instead of UUID"
5180+
},
51645181
"type": {
51655182
"type": "string",
51665183
"default": "",

src/types/openapi/openapi-full.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,6 +1854,8 @@ export type components = {
18541854
elementId: number;
18551855
/** Format: int64 */
18561856
signRequestId: number;
1857+
/** Format: int64 */
1858+
fileId: number;
18571859
type: string;
18581860
coordinates: components["schemas"]["Coordinate"];
18591861
uuid: string;
@@ -3499,6 +3501,11 @@ export interface operations {
34993501
* @description ID of visible element. Each element has an ID that is returned on validation endpoints.
35003502
*/
35013503
elementId?: number | null;
3504+
/**
3505+
* Format: int64
3506+
* @description File ID when using node identifier instead of UUID
3507+
*/
3508+
fileId?: number | null;
35023509
/**
35033510
* @description The type of element to create, sginature, sinitial, date, datetime, text
35043511
* @default
@@ -3633,6 +3640,11 @@ export interface operations {
36333640
* @description Id of sign request
36343641
*/
36353642
signRequestId: number;
3643+
/**
3644+
* Format: int64
3645+
* @description File ID when using node identifier instead of UUID
3646+
*/
3647+
fileId?: number | null;
36363648
/**
36373649
* @description The type of element to create, sginature, sinitial, date, datetime, text
36383650
* @default

src/types/openapi/openapi.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,8 @@ export type components = {
13761376
elementId: number;
13771377
/** Format: int64 */
13781378
signRequestId: number;
1379+
/** Format: int64 */
1380+
fileId: number;
13791381
type: string;
13801382
coordinates: components["schemas"]["Coordinate"];
13811383
uuid: string;
@@ -3021,6 +3023,11 @@ export interface operations {
30213023
* @description ID of visible element. Each element has an ID that is returned on validation endpoints.
30223024
*/
30233025
elementId?: number | null;
3026+
/**
3027+
* Format: int64
3028+
* @description File ID when using node identifier instead of UUID
3029+
*/
3030+
fileId?: number | null;
30243031
/**
30253032
* @description The type of element to create, sginature, sinitial, date, datetime, text
30263033
* @default
@@ -3155,6 +3162,11 @@ export interface operations {
31553162
* @description Id of sign request
31563163
*/
31573164
signRequestId: number;
3165+
/**
3166+
* Format: int64
3167+
* @description File ID when using node identifier instead of UUID
3168+
*/
3169+
fileId?: number | null;
31583170
/**
31593171
* @description The type of element to create, sginature, sinitial, date, datetime, text
31603172
* @default

tests/php/Api/Controller/FileElementControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function testPostSuccess():array {
5353
'height' => 90,
5454
'page' => 1,
5555
],
56+
'fileId' => $file->getId(),
5657
'type' => 'signature',
5758
'signRequestId' => $signers[0]->getId(),
5859
]);
@@ -87,6 +88,7 @@ public function testPatchSuccess($params):array {
8788
'height' => 91,
8889
'page' => 1,
8990
],
91+
'fileId' => $file->getId(),
9092
'type' => 'signature',
9193
'signRequestId' => $signers[0]->getId(),
9294
]);

0 commit comments

Comments
 (0)