Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| ResponseDefinitions | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | /** |
| 5 | * SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors |
| 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
| 7 | */ |
| 8 | |
| 9 | namespace OCA\Libresign; |
| 10 | |
| 11 | /** |
| 12 | * Base contracts |
| 13 | * |
| 14 | * @psalm-type LibresignPagination = array{ |
| 15 | * total: non-negative-int, |
| 16 | * current: ?string, |
| 17 | * next: ?string, |
| 18 | * prev: ?string, |
| 19 | * last: ?string, |
| 20 | * first: ?string, |
| 21 | * } |
| 22 | * @psalm-type LibresignSettings = array{ |
| 23 | * canSign: bool, |
| 24 | * canRequestSign: bool, |
| 25 | * phoneNumber: string, |
| 26 | * hasSignatureFile: bool, |
| 27 | * isApprover?: bool, |
| 28 | * needIdentificationDocuments: bool, |
| 29 | * identificationDocumentsWaitingApproval: bool, |
| 30 | * } |
| 31 | * @psalm-type LibresignAccountCapabilitySettings = array{ |
| 32 | * canRequestSign: bool, |
| 33 | * hasSignatureFile: bool, |
| 34 | * isApprover: bool, |
| 35 | * } |
| 36 | * @psalm-type LibresignIdentifyMethodRequirement = 'required'|'optional' |
| 37 | * |
| 38 | * Request input contracts |
| 39 | * |
| 40 | * @psalm-type LibresignFolderSettings = array{ |
| 41 | * folderName?: string, |
| 42 | * path?: string, |
| 43 | * separator?: string, |
| 44 | * folderPatterns?: array{ |
| 45 | * name: string, |
| 46 | * setting?: string, |
| 47 | * }, |
| 48 | * envelopeFolderId?: int, |
| 49 | * } |
| 50 | * @psalm-type LibresignParticipantRole = 'signer'|'observer' |
| 51 | * @psalm-type LibresignGeolocationCollectionStatus = 'collected'|'denied'|'unavailable'|'skipped' |
| 52 | * @psalm-type LibresignSignerGeolocationPolicyMode = 'disabled'|'optional'|'required' |
| 53 | * @psalm-type LibresignSignerIpGeolocationPolicyMode = 'disabled'|'enabled' |
| 54 | * @psalm-type LibresignGeolocationRequirement = 'disabled'|'required' |
| 55 | * @psalm-type LibresignSignerIpGeolocationStatus = 'resolved'|'not_found'|'unavailable' |
| 56 | * @psalm-type LibresignSignerIpGeolocationUnavailableReason = 'database_not_ready'|'address_unavailable'|'lookup_failed' |
| 57 | * @psalm-type LibresignGeoIpDatabaseStatus = 'not_configured'|'not_found'|'not_readable'|'invalid_database'|'unsupported_database'|'ready' |
| 58 | * @psalm-type LibresignSignerDeviceGeolocation = array{ |
| 59 | * status: LibresignGeolocationCollectionStatus, |
| 60 | * latitude?: float, |
| 61 | * longitude?: float, |
| 62 | * accuracy?: float, |
| 63 | * timestamp?: int, |
| 64 | * } |
| 65 | * @psalm-type LibresignSignerIpGeolocation = array{ |
| 66 | * status: LibresignSignerIpGeolocationStatus, |
| 67 | * sourceIp?: string, |
| 68 | * countryCode?: string, |
| 69 | * country?: string, |
| 70 | * regionCode?: string, |
| 71 | * region?: string, |
| 72 | * city?: string, |
| 73 | * latitude?: float, |
| 74 | * longitude?: float, |
| 75 | * accuracyRadius?: int, |
| 76 | * reason?: LibresignSignerIpGeolocationUnavailableReason, |
| 77 | * } |
| 78 | * @psalm-type LibresignSignerGeolocation = array{ |
| 79 | * device?: LibresignSignerDeviceGeolocation, |
| 80 | * ip?: LibresignSignerIpGeolocation, |
| 81 | * } |
| 82 | * @psalm-type LibresignGeoIpConfig = array{ |
| 83 | * path: ?string, |
| 84 | * status: LibresignGeoIpDatabaseStatus, |
| 85 | * databaseType?: string, |
| 86 | * buildEpoch?: int, |
| 87 | * modifiedAt?: string, |
| 88 | * } |
| 89 | * @psalm-type LibresignNewSigner = array{ |
| 90 | * identifyMethods: list<array{ |
| 91 | * method: string, |
| 92 | * value: string, |
| 93 | * requirement: LibresignIdentifyMethodRequirement, |
| 94 | * }>, |
| 95 | * displayName?: string, |
| 96 | * description?: string, |
| 97 | * notify?: non-negative-int, |
| 98 | * signingOrder?: non-negative-int, |
| 99 | * status?: int, |
| 100 | * participantRole?: LibresignParticipantRole, |
| 101 | * deviceGeolocationRequired?: bool, |
| 102 | * } |
| 103 | * @psalm-type LibresignNewFile = array{ |
| 104 | * base64?: string, |
| 105 | * nodeId?: non-negative-int|numeric-string, |
| 106 | * path?: string, |
| 107 | * url?: string, |
| 108 | * name?: string, |
| 109 | * } |
| 110 | * @psalm-type LibresignIdDocs = array{ |
| 111 | * file: LibresignNewFile, |
| 112 | * name?: string, |
| 113 | * type?: string, |
| 114 | * } |
| 115 | * |
| 116 | * Identity and signer contracts |
| 117 | * |
| 118 | * @psalm-type LibresignIdentifyMethod = array{ |
| 119 | * method: 'account'|'email'|'signal'|'sms'|'telegram'|'whatsapp'|'whatsappbusiness'|'xmpp', |
| 120 | * value: string, |
| 121 | * requirement: LibresignIdentifyMethodRequirement, |
| 122 | * } |
| 123 | * @psalm-type LibresignCoordinate = array{ |
| 124 | * page?: int, |
| 125 | * urx?: int, |
| 126 | * ury?: int, |
| 127 | * llx?: int, |
| 128 | * lly?: int, |
| 129 | * top?: int, |
| 130 | * left?: int, |
| 131 | * width?: int, |
| 132 | * height?: int, |
| 133 | * } |
| 134 | * @psalm-type LibresignVisibleElement = array{ |
| 135 | * elementId: int, |
| 136 | * signRequestId: int, |
| 137 | * fileId: int, |
| 138 | * type: string, |
| 139 | * coordinates: LibresignCoordinate, |
| 140 | * } |
| 141 | * @psalm-type LibresignSignatureMethod = array{ |
| 142 | * enabled: bool, |
| 143 | * label: string, |
| 144 | * name: string, |
| 145 | * } |
| 146 | * @psalm-type LibresignSignatureMethodEmailToken = array{ |
| 147 | * label: string, |
| 148 | * identifyMethod: "email"|"account", |
| 149 | * needCode: bool, |
| 150 | * hasConfirmCode: bool, |
| 151 | * blurredEmail: string, |
| 152 | * hashOfEmail: string, |
| 153 | * } |
| 154 | * @psalm-type LibresignSignatureMethodPassword = array{ |
| 155 | * label: string, |
| 156 | * name: string, |
| 157 | * hasSignatureFile: bool, |
| 158 | * } |
| 159 | * @psalm-type LibresignAdminSignatureMethodSetting = array{ |
| 160 | * enabled: bool, |
| 161 | * label: string, |
| 162 | * name: string, |
| 163 | * } |
| 164 | * @psalm-type LibresignPolicySnapshotSignatureMethodSetting = LibresignAdminSignatureMethodSetting&array{ |
| 165 | * identifyMethod?: string|null, |
| 166 | * needCode?: bool, |
| 167 | * hasConfirmCode?: bool, |
| 168 | * blurredEmail?: string, |
| 169 | * hashOfEmail?: string, |
| 170 | * blurredIdentifier?: string, |
| 171 | * hashOfIdentifier?: string, |
| 172 | * hasSignatureFile?: bool, |
| 173 | * } |
| 174 | * @psalm-type LibresignSignatureMethods = array{ |
| 175 | * clickToSign?: LibresignSignatureMethod, |
| 176 | * emailToken?: LibresignSignatureMethodEmailToken, |
| 177 | * password?: LibresignSignatureMethodPassword, |
| 178 | * } |
| 179 | * @psalm-type LibresignIdentifyMethodAdminSetting = array{ |
| 180 | * name: string, |
| 181 | * friendly_name: string, |
| 182 | * enabled: bool, |
| 183 | * requirement: LibresignIdentifyMethodRequirement, |
| 184 | * minimumTotalVerifiedFactors?: positive-int, |
| 185 | * can_create_account?: bool, |
| 186 | * test_url?: string, |
| 187 | * signatureMethods?: array<string, LibresignAdminSignatureMethodSetting>, |
| 188 | * } |
| 189 | * @psalm-type LibresignIdentifyMethodSetting = array{ |
| 190 | * name: string, |
| 191 | * friendly_name: string, |
| 192 | * enabled: bool, |
| 193 | * requirement: LibresignIdentifyMethodRequirement, |
| 194 | * minimumTotalVerifiedFactors?: positive-int, |
| 195 | * signatureMethods?: LibresignSignatureMethods, |
| 196 | * } |
| 197 | * @psalm-type LibresignIdentifyAccount = array{ |
| 198 | * identify: string, |
| 199 | * isNoUser: boolean, |
| 200 | * displayName: string, |
| 201 | * subname: string, |
| 202 | * shareType: 0|4, |
| 203 | * method?: 'account'|'email'|'signal'|'sms'|'telegram'|'whatsapp'|'whatsappbusiness'|'xmpp', |
| 204 | * iconName?: 'account'|'email'|'signal'|'sms'|'telegram'|'whatsapp'|'xmpp', |
| 205 | * acceptsEmailNotifications?: boolean, |
| 206 | * } |
| 207 | * @psalm-type LibresignIdentifyAccountsResponse = list<LibresignIdentifyAccount> |
| 208 | * @psalm-type LibresignNotify = array{ |
| 209 | * date: non-negative-int, |
| 210 | * method: "activity"|"notify"|"mail", |
| 211 | * description?: string, |
| 212 | * } |
| 213 | * @psalm-type LibresignRequestedBy = array{ |
| 214 | * userId: string, |
| 215 | * displayName: ?string, |
| 216 | * } |
| 217 | * @psalm-type LibresignDynamicMetadataScalar = string|int|float|bool|null |
| 218 | * @psalm-type LibresignDynamicMetadataRecord = array<string, mixed> |
| 219 | * @psalm-type LibresignDynamicMetadataValue = mixed |
| 220 | * @psalm-type LibresignSignerCertificateInfo = array{ |
| 221 | * serialNumber?: string, |
| 222 | * serialNumberHex?: string, |
| 223 | * hash?: string, |
| 224 | * subject?: LibresignDynamicMetadataValue, |
| 225 | * } |
| 226 | * @psalm-type LibresignSignerMetadata = array{ |
| 227 | * remote-address?: string, |
| 228 | * user-agent?: string, |
| 229 | * deviceGeolocationRequirement?: LibresignGeolocationRequirement, |
| 230 | * geolocation?: LibresignSignerGeolocation, |
| 231 | * notify?: LibresignNotify[], |
| 232 | * certificate_info?: LibresignSignerCertificateInfo, |
| 233 | * } |
| 234 | * @psalm-type LibresignSignerDisplayStatus = 'draft'|'ready_to_sign'|'signed'|'rejected'|'observing'|'not_signed' |
| 235 | * @psalm-type LibresignSignerSummary = array{ |
| 236 | * signRequestId: int, |
| 237 | * displayName: string, |
| 238 | * email?: ?string, |
| 239 | * identifyMethods?: LibresignIdentifyMethod[], |
| 240 | * signed: ?string, |
| 241 | * displayStatus: LibresignSignerDisplayStatus, |
| 242 | * status?: 0|1|2|3|4, |
| 243 | * statusText: string, |
| 244 | * participantRole?: LibresignParticipantRole, |
| 245 | * } |
| 246 | * @psalm-type LibresignSignerRejection = array{ |
| 247 | * rejectedAt: string, |
| 248 | * comment?: string, |
| 249 | * commentPrivate?: bool, |
| 250 | * } |
| 251 | * @psalm-type LibresignSignerDetail = LibresignSignerSummary&array{ |
| 252 | * description: ?string, |
| 253 | * subject?: string, |
| 254 | * request_sign_date: string, |
| 255 | * valid_from?: non-negative-int, |
| 256 | * valid_to?: non-negative-int, |
| 257 | * remote_address?: string, |
| 258 | * user_agent?: string, |
| 259 | * notify?: LibresignNotify[], |
| 260 | * userId?: string, |
| 261 | * sign_date?: ?string, |
| 262 | * sign_request_uuid?: string, |
| 263 | * hash_algorithm?: string, |
| 264 | * covers_entire_document?: bool, |
| 265 | * document_modification_state?: 'unchanged'|'unsigned_content'|'trailing_data'|'invalid_byte_range'|'invalid_eof_boundary', |
| 266 | * me: bool, |
| 267 | * signingOrder?: non-negative-int, |
| 268 | * visibleElements: LibresignVisibleElement[], |
| 269 | * signatureMethods?: LibresignSignatureMethods, |
| 270 | * uid?: string, |
| 271 | * metadata?: LibresignSignerMetadata, |
| 272 | * rejection?: LibresignSignerRejection, |
| 273 | * } |
| 274 | * |
| 275 | * Notification delivery status |
| 276 | * |
| 277 | * @psalm-type LibresignNotificationStatusResponse = array{ |
| 278 | * status: 'processing'|'completed'|'attention_required'|'not_found', |
| 279 | * complete: bool, |
| 280 | * channels: list<array{ |
| 281 | * channel: string, |
| 282 | * state: string, |
| 283 | * }>, |
| 284 | * } |
| 285 | * |
| 286 | * Shared feedback and action contracts |
| 287 | * |
| 288 | * @psalm-type LibresignInfoMessage = array{ |
| 289 | * type: 'info', |
| 290 | * message: string, |
| 291 | * } |
| 292 | * @psalm-type LibresignErrorItem = array{ |
| 293 | * message: string, |
| 294 | * title?: string, |
| 295 | * } |
| 296 | * @psalm-type LibresignErrorsResponse = array{ |
| 297 | * errors: list<LibresignErrorItem>, |
| 298 | * } |
| 299 | * @psalm-type LibresignMessageResponse = array{ |
| 300 | * message: string, |
| 301 | * } |
| 302 | * @psalm-type LibresignMessagesResponse = array{ |
| 303 | * messages: list<string>, |
| 304 | * } |
| 305 | * @psalm-type LibresignErrorResponse = array{ |
| 306 | * error: string, |
| 307 | * } |
| 308 | * @psalm-type LibresignDangerMessage = array{ |
| 309 | * type: 'danger', |
| 310 | * message: string, |
| 311 | * } |
| 312 | * @psalm-type LibresignDangerMessagesResponse = array{ |
| 313 | * messages: list<LibresignDangerMessage>, |
| 314 | * } |
| 315 | * @psalm-type LibresignActionErrorWithCode = LibresignErrorItem&array{ |
| 316 | * code?: int, |
| 317 | * } |
| 318 | * @psalm-type LibresignStatusMessageResponse = array{ |
| 319 | * message: string, |
| 320 | * status: string, |
| 321 | * } |
| 322 | * @psalm-type LibresignSuccessStatusResponse = array{ |
| 323 | * status: 'success', |
| 324 | * } |
| 325 | * @psalm-type LibresignFailureStatusResponse = array{ |
| 326 | * status: 'failure', |
| 327 | * message: string, |
| 328 | * } |
| 329 | * @psalm-type LibresignErrorStatusResponse = array{ |
| 330 | * status: 'error', |
| 331 | * message: string, |
| 332 | * } |
| 333 | * @psalm-type LibresignActionErrorResponse = array{ |
| 334 | * action: int, |
| 335 | * errors: list<LibresignErrorItem>, |
| 336 | * messages?: list<LibresignInfoMessage>, |
| 337 | * message?: string, |
| 338 | * } |
| 339 | * @psalm-type LibresignActionMessageResponse = array{ |
| 340 | * action: int, |
| 341 | * message: string, |
| 342 | * } |
| 343 | * @psalm-type LibresignFileUuidReference = array{ |
| 344 | * uuid: string, |
| 345 | * } |
| 346 | * @psalm-type LibresignSigningJob = array{ |
| 347 | * status: 'SIGNING_IN_PROGRESS', |
| 348 | * file: LibresignFileUuidReference, |
| 349 | * } |
| 350 | * @psalm-type LibresignSignActionResponse = array{ |
| 351 | * action: int, |
| 352 | * message?: string, |
| 353 | * file?: LibresignFileUuidReference, |
| 354 | * job?: LibresignSigningJob, |
| 355 | * signatureSaveStatus?: 'saved'|'failed', |
| 356 | * } |
| 357 | * @psalm-type LibresignSignActionErrorResponse = array{ |
| 358 | * action: int, |
| 359 | * errors: list<LibresignActionErrorWithCode>, |
| 360 | * redirect?: string, |
| 361 | * } |
| 362 | * @psalm-type LibresignSignatureRejectionResponse = array{ |
| 363 | * message: string, |
| 364 | * signRequestId: int, |
| 365 | * status: int, |
| 366 | * statusText: string, |
| 367 | * rejectedAt: string, |
| 368 | * workflowCanceled: bool, |
| 369 | * } |
| 370 | * |
| 371 | * Certificate and admin contracts |
| 372 | * |
| 373 | * @psalm-type LibresignConfigureCheck = array{ |
| 374 | * message: string, |
| 375 | * resource: string, |
| 376 | * status: "error"|"info"|"success", |
| 377 | * tip: string, |
| 378 | * } |
| 379 | * @psalm-type LibresignConfigureChecksResponse = list<LibresignConfigureCheck> |
| 380 | * @psalm-type LibresignCertificatePfxData = array{ |
| 381 | * name: string, |
| 382 | * subject: string, |
| 383 | * issuer: string, |
| 384 | * extensions: string, |
| 385 | * serialNumber: string, |
| 386 | * serialNumberHex: string, |
| 387 | * validate: array{ |
| 388 | * from: string, |
| 389 | * to: string, |
| 390 | * }, |
| 391 | * } |
| 392 | * @psalm-type LibresignRootCertificateName = array{ |
| 393 | * id: string, |
| 394 | * value: string|list<string>|null, |
| 395 | * } |
| 396 | * @psalm-type LibresignRootCertificate = array{ |
| 397 | * commonName: string, |
| 398 | * names: LibresignRootCertificateName[], |
| 399 | * } |
| 400 | * @psalm-type LibresignPolicySection = array{ |
| 401 | * OID: string, |
| 402 | * CPS: string, |
| 403 | * } |
| 404 | * @psalm-type LibresignEngineHandler = array{ |
| 405 | * configPath: string, |
| 406 | * cfsslUri?: string, |
| 407 | * policySection: LibresignPolicySection[], |
| 408 | * rootCert: LibresignRootCertificate, |
| 409 | * } |
| 410 | * @psalm-type LibresignCertificateDataGenerated = LibresignEngineHandler&array{ |
| 411 | * generated: boolean, |
| 412 | * } |
| 413 | * @psalm-type LibresignEngineHandlerResponse = array{ |
| 414 | * data: LibresignEngineHandler, |
| 415 | * } |
| 416 | * @psalm-type LibresignCertificateEngineConfigResponse = array{ |
| 417 | * engine: 'cfssl'|'none'|'openssl', |
| 418 | * identify_methods: list<LibresignIdentifyMethodAdminSetting>, |
| 419 | * } |
| 420 | * @psalm-type LibresignHasRootCertResponse = array{ |
| 421 | * hasRootCert: bool, |
| 422 | * } |
| 423 | * @psalm-type LibresignReminderSettings = array{ |
| 424 | * days_before: non-negative-int, |
| 425 | * days_between: non-negative-int, |
| 426 | * max: non-negative-int, |
| 427 | * send_timer: string, |
| 428 | * next_run?: string, |
| 429 | * } |
| 430 | * @psalm-type LibresignAdminSignatureEngine = 'JSignPdf'|'PhpNative' |
| 431 | * @psalm-type LibresignDocMdpLevelOption = array{ |
| 432 | * value: int, |
| 433 | * label: string, |
| 434 | * description: string, |
| 435 | * } |
| 436 | * @psalm-type LibresignDocMdpConfig = array{ |
| 437 | * enabled: bool, |
| 438 | * defaultLevel: int, |
| 439 | * availableLevels: list<LibresignDocMdpLevelOption>, |
| 440 | * } |
| 441 | * @psalm-type LibresignCertificatePolicyResponse = array{ |
| 442 | * status: 'success', |
| 443 | * CPS: string, |
| 444 | * } |
| 445 | * @psalm-type LibresignFooterTemplateResponse = array{ |
| 446 | * template: string, |
| 447 | * isDefault: bool, |
| 448 | * template_variables: array<string, array{ |
| 449 | * description?: string, |
| 450 | * type?: string, |
| 451 | * example?: string, |
| 452 | * default?: string, |
| 453 | * }>, |
| 454 | * preview_width: int, |
| 455 | * preview_height: int, |
| 456 | * preview_zoom: int, |
| 457 | * } |
| 458 | * @psalm-type LibresignActiveSigningItem = array{ |
| 459 | * id: int, |
| 460 | * uuid: string, |
| 461 | * name: string, |
| 462 | * signerEmail: string, |
| 463 | * signerDisplayName: string, |
| 464 | * updatedAt: int, |
| 465 | * } |
| 466 | * @psalm-type LibresignActiveSigningsResponse = array{ |
| 467 | * data: list<LibresignActiveSigningItem>, |
| 468 | * } |
| 469 | * |
| 470 | * Validation and progress contracts |
| 471 | * |
| 472 | * @psalm-type LibresignPolicyScope = 'system'|'group'|'user' |
| 473 | * @psalm-type LibresignEffectivePolicyValue = null|bool|int|float|string|array<string, mixed> |
| 474 | * @psalm-type LibresignEffectivePolicyMeta = array{ |
| 475 | * defaultSystemValue?: LibresignEffectivePolicyValue, |
| 476 | * appConfigKey?: string, |
| 477 | * userPreferenceKey?: string, |
| 478 | * resolutionMode?: string, |
| 479 | * supportsGroupAdminDelegation?: bool, |
| 480 | * canCreateDescendantRules?: bool, |
| 481 | * supportsUserPreference?: bool, |
| 482 | * supportedScopes?: list<LibresignPolicyScope>, |
| 483 | * backendOnly?: bool, |
| 484 | * helper?: bool, |
| 485 | * parentPolicyKey?: string, |
| 486 | * compositeChildren?: list<string>, |
| 487 | * mailProviderAvailable?: bool, |
| 488 | * validationUrlIsPrivate?: bool, |
| 489 | * observerProfileEnabled?: bool, |
| 490 | * } |
| 491 | * @psalm-type LibresignEffectivePolicyState = array{ |
| 492 | * policyKey: string, |
| 493 | * effectiveValue: LibresignEffectivePolicyValue, |
| 494 | * meta?: LibresignEffectivePolicyMeta, |
| 495 | * sourceScope: string, |
| 496 | * visible: bool, |
| 497 | * editableByCurrentActor: bool, |
| 498 | * allowedValues: list<LibresignEffectivePolicyValue>, |
| 499 | * canSaveAsUserDefault: bool, |
| 500 | * canUseAsRequestOverride: bool, |
| 501 | * preferenceWasCleared: bool, |
| 502 | * blockedBy: ?string, |
| 503 | * groupCount: non-negative-int, |
| 504 | * userCount: non-negative-int, |
| 505 | * everyoneCount: non-negative-int, |
| 506 | * } |
| 507 | * @psalm-type LibresignEffectivePolicyResponse = array{ |
| 508 | * policy: LibresignEffectivePolicyState, |
| 509 | * } |
| 510 | * @psalm-type LibresignEffectivePoliciesResponse = array{ |
| 511 | * policies: array<string, LibresignEffectivePolicyState>, |
| 512 | * } |
| 513 | * @psalm-type LibresignSystemPolicyWriteRequest = array{ |
| 514 | * value: LibresignEffectivePolicyValue, |
| 515 | * } |
| 516 | * @psalm-type LibresignGroupPolicyState = array{ |
| 517 | * policyKey: string, |
| 518 | * scope: 'group', |
| 519 | * targetId: string, |
| 520 | * value: null|LibresignEffectivePolicyValue, |
| 521 | * effectiveValue?: null|LibresignEffectivePolicyValue, |
| 522 | * allowChildOverride: bool, |
| 523 | * visibleToChild: bool, |
| 524 | * allowedValues: list<LibresignEffectivePolicyValue>, |
| 525 | * deletableByCurrentActor: bool, |
| 526 | * } |
| 527 | * @psalm-type LibresignGroupPolicyResponse = array{ |
| 528 | * policy: LibresignGroupPolicyState, |
| 529 | * } |
| 530 | * @psalm-type LibresignGroupPolicyWriteRequest = array{ |
| 531 | * value: LibresignEffectivePolicyValue, |
| 532 | * allowChildOverride: bool, |
| 533 | * } |
| 534 | * @psalm-type LibresignSystemPolicyState = array{ |
| 535 | * policyKey: string, |
| 536 | * scope: 'system'|'global', |
| 537 | * value: null|LibresignEffectivePolicyValue, |
| 538 | * allowChildOverride: bool, |
| 539 | * visibleToChild: bool, |
| 540 | * allowedValues: list<LibresignEffectivePolicyValue>, |
| 541 | * } |
| 542 | * @psalm-type LibresignSystemPolicyResponse = array{ |
| 543 | * policy: LibresignSystemPolicyState, |
| 544 | * } |
| 545 | * @psalm-type LibresignUserPolicyState = array{ |
| 546 | * policyKey: string, |
| 547 | * scope: 'user_policy', |
| 548 | * targetId: string, |
| 549 | * value: null|LibresignEffectivePolicyValue, |
| 550 | * allowChildOverride: bool, |
| 551 | * } |
| 552 | * @psalm-type LibresignUserPolicyResponse = array{ |
| 553 | * policy: LibresignUserPolicyState, |
| 554 | * } |
| 555 | * @psalm-type LibresignEffectiveCompoundPolicyWriteResponse = LibresignMessageResponse&array{ |
| 556 | * policies: array<string, LibresignEffectivePolicyState>, |
| 557 | * } |
| 558 | * @psalm-type LibresignGroupCompoundPolicyWriteResponse = LibresignMessageResponse&array{ |
| 559 | * policies: array<string, LibresignGroupPolicyState>, |
| 560 | * } |
| 561 | * @psalm-type LibresignUserCompoundPolicyWriteResponse = LibresignMessageResponse&array{ |
| 562 | * policies: array<string, LibresignUserPolicyState>, |
| 563 | * } |
| 564 | * @psalm-type LibresignGroupPolicyWriteResponse = LibresignMessageResponse&LibresignGroupPolicyResponse |
| 565 | * @psalm-type LibresignSystemPolicyWriteResponse = LibresignMessageResponse&LibresignEffectivePolicyResponse |
| 566 | * @psalm-type LibresignUserPolicyWriteResponse = LibresignMessageResponse&LibresignUserPolicyResponse |
| 567 | * @psalm-type LibresignPolicySnapshotEntry = array{ |
| 568 | * effectiveValue: string, |
| 569 | * sourceScope: string, |
| 570 | * } |
| 571 | * @psalm-type LibresignPolicySnapshotLegalInformationEntry = array{ |
| 572 | * effectiveValue: string, |
| 573 | * sourceScope: string, |
| 574 | * } |
| 575 | * @psalm-type LibresignPolicySnapshotNumericEntry = array{ |
| 576 | * effectiveValue: int, |
| 577 | * sourceScope: string, |
| 578 | * } |
| 579 | * @psalm-type LibresignPolicySnapshotBooleanEntry = array{ |
| 580 | * effectiveValue: bool, |
| 581 | * sourceScope: string, |
| 582 | * } |
| 583 | * @psalm-type LibresignPolicySnapshotIdentificationDocumentsValue = array{ |
| 584 | * enabled: bool, |
| 585 | * approvers: list<string>, |
| 586 | * } |
| 587 | * @psalm-type LibresignPolicySnapshotIdentificationDocumentsEntry = array{ |
| 588 | * effectiveValue: LibresignPolicySnapshotIdentificationDocumentsValue, |
| 589 | * sourceScope: string, |
| 590 | * } |
| 591 | * @psalm-type LibresignPolicySnapshotIdentifyMethodFactor = array{ |
| 592 | * name: string, |
| 593 | * enabled: bool, |
| 594 | * signatureMethods?: array<string, LibresignPolicySnapshotSignatureMethodSetting>, |
| 595 | * signatureMethodEnabled?: string, |
| 596 | * requirement?: LibresignIdentifyMethodRequirement, |
| 597 | * minimumTotalVerifiedFactors?: positive-int, |
| 598 | * friendly_name?: string, |
| 599 | * } |
| 600 | * @psalm-type LibresignPolicySnapshotIdentifyMethodsEntry = array{ |
| 601 | * effectiveValue: list<LibresignPolicySnapshotIdentifyMethodFactor>, |
| 602 | * sourceScope: string, |
| 603 | * } |
| 604 | * @psalm-type LibresignPolicySnapshotSignerGeolocationValue = array{ |
| 605 | * mode: LibresignSignerGeolocationPolicyMode, |
| 606 | * } |
| 607 | * @psalm-type LibresignPolicySnapshotSignerGeolocationEntry = array{ |
| 608 | * effectiveValue: LibresignPolicySnapshotSignerGeolocationValue, |
| 609 | * sourceScope: string, |
| 610 | * } |
| 611 | * @psalm-type LibresignPolicySnapshotSignerIpGeolocationValue = array{ |
| 612 | * mode: LibresignSignerIpGeolocationPolicyMode, |
| 613 | * } |
| 614 | * @psalm-type LibresignPolicySnapshotSignerIpGeolocationEntry = array{ |
| 615 | * effectiveValue: LibresignPolicySnapshotSignerIpGeolocationValue, |
| 616 | * sourceScope: string, |
| 617 | * } |
| 618 | * @psalm-type LibresignSignatureRejectionCommentMode = 'disabled'|'optional'|'required' |
| 619 | * @psalm-type LibresignSignatureRejectionBehavior = 'cancel'|'continue' |
| 620 | * @psalm-type LibresignSignatureRejectionVisibility = 'requester'|'participants'|'public' |
| 621 | * @psalm-type LibresignPolicySnapshotSignatureRejectionBehaviorEntry = array{ |
| 622 | * effectiveValue: LibresignSignatureRejectionBehavior, |
| 623 | * sourceScope: string, |
| 624 | * } |
| 625 | * @psalm-type LibresignPolicySnapshotSignatureRejectionCommentModeEntry = array{ |
| 626 | * effectiveValue: LibresignSignatureRejectionCommentMode, |
| 627 | * sourceScope: string, |
| 628 | * } |
| 629 | * @psalm-type LibresignPolicySnapshotSignatureRejectionVisibilityEntry = array{ |
| 630 | * effectiveValue: LibresignSignatureRejectionVisibility, |
| 631 | * sourceScope: string, |
| 632 | * } |
| 633 | * @psalm-type LibresignValidatePolicySnapshot = array{ |
| 634 | * docmdp?: LibresignPolicySnapshotNumericEntry, |
| 635 | * signature_flow?: LibresignPolicySnapshotEntry, |
| 636 | * add_footer?: LibresignPolicySnapshotEntry, |
| 637 | * legal_information?: LibresignPolicySnapshotLegalInformationEntry, |
| 638 | * identification_documents?: LibresignPolicySnapshotIdentificationDocumentsEntry, |
| 639 | * identify_methods?: LibresignPolicySnapshotIdentifyMethodsEntry, |
| 640 | * signer_device_geolocation?: LibresignPolicySnapshotSignerGeolocationEntry, |
| 641 | * signer_ip_geolocation?: LibresignPolicySnapshotSignerIpGeolocationEntry, |
| 642 | * enable_observer_profile?: LibresignPolicySnapshotBooleanEntry, |
| 643 | * rejection_enabled?: LibresignPolicySnapshotBooleanEntry, |
| 644 | * rejection_behavior?: LibresignPolicySnapshotSignatureRejectionBehaviorEntry, |
| 645 | * rejection_comment_mode?: LibresignPolicySnapshotSignatureRejectionCommentModeEntry, |
| 646 | * rejection_visibility?: LibresignPolicySnapshotSignatureRejectionVisibilityEntry, |
| 647 | * rejection_comment_visibility?: LibresignPolicySnapshotSignatureRejectionVisibilityEntry, |
| 648 | * } |
| 649 | * @psalm-type LibresignValidateMetadata = array{ |
| 650 | * extension: string, |
| 651 | * p: int, |
| 652 | * d?: list<array{w: float, h: float}>, |
| 653 | * original_file_deleted?: bool, |
| 654 | * policy_snapshot?: LibresignValidatePolicySnapshot, |
| 655 | * pdfVersion?: string, |
| 656 | * status_changed_at?: string, |
| 657 | * } |
| 658 | * @psalm-type LibresignFileRuntimeMetadata = LibresignValidateMetadata|array<string, LibresignDynamicMetadataValue> |
| 659 | * @psalm-type LibresignValidationPageResolution = array{ |
| 660 | * w: float, |
| 661 | * h: float, |
| 662 | * } |
| 663 | * @psalm-type LibresignValidationPage = array{ |
| 664 | * number: int, |
| 665 | * url: string, |
| 666 | * resolution: LibresignValidationPageResolution, |
| 667 | * } |
| 668 | * @psalm-type LibresignValidatedChildSigner = LibresignSignerSummary&array{ |
| 669 | * visibleElements?: LibresignVisibleElement[], |
| 670 | * } |
| 671 | * @psalm-type LibresignValidatedChildFile = array{ |
| 672 | * id: int, |
| 673 | * uuid: string, |
| 674 | * name: string, |
| 675 | * status: int, |
| 676 | * statusText: string, |
| 677 | * nodeId: int, |
| 678 | * totalPages?: non-negative-int, |
| 679 | * size: non-negative-int, |
| 680 | * pdfVersion?: string, |
| 681 | * signers: list<LibresignValidatedChildSigner>, |
| 682 | * file?: string, |
| 683 | * metadata: LibresignValidateMetadata, |
| 684 | * } |
| 685 | * @psalm-type LibresignValidatedFile = array{ |
| 686 | * id: int, |
| 687 | * uuid: string, |
| 688 | * name: string, |
| 689 | * status: 0|1|2|3|4|6, |
| 690 | * statusText: string, |
| 691 | * nodeId: non-negative-int, |
| 692 | * nodeType: 'file'|'envelope', |
| 693 | * signatureFlow: 'none'|'parallel'|'ordered_numeric', |
| 694 | * policySnapshotFrozen?: bool, |
| 695 | * docmdpLevel: int, |
| 696 | * filesCount: int<0, max>, |
| 697 | * files: list<LibresignValidatedChildFile>, |
| 698 | * totalPages: non-negative-int, |
| 699 | * size: non-negative-int, |
| 700 | * pdfVersion: string, |
| 701 | * created_at: string, |
| 702 | * requested_by: LibresignRequestedBy, |
| 703 | * file?: string, |
| 704 | * url?: string, |
| 705 | * mime?: string, |
| 706 | * pages?: list<LibresignValidationPage>, |
| 707 | * metadata?: LibresignValidateMetadata, |
| 708 | * signers?: LibresignSignerDetail[], |
| 709 | * signersCount?: int<0, max>, |
| 710 | * settings?: LibresignSettings, |
| 711 | * messages?: list<LibresignInfoMessage>, |
| 712 | * visibleElements?: LibresignVisibleElement[], |
| 713 | * } |
| 714 | * @psalm-type LibresignValidatedFileResponse = LibresignValidatedFile&array{ |
| 715 | * effective_policies?: LibresignEffectivePoliciesResponse, |
| 716 | * } |
| 717 | * @psalm-type LibresignProgressError = array{ |
| 718 | * message: string, |
| 719 | * code?: int, |
| 720 | * timestamp?: string, |
| 721 | * fileId?: int, |
| 722 | * signRequestId?: int, |
| 723 | * signRequestUuid?: string, |
| 724 | * } |
| 725 | * @psalm-type LibresignProgressFile = array{ |
| 726 | * id: int, |
| 727 | * name: string, |
| 728 | * status: int, |
| 729 | * statusText: string, |
| 730 | * error?: LibresignProgressError, |
| 731 | * } |
| 732 | * @psalm-type LibresignProgressSigner = array{ |
| 733 | * id: int, |
| 734 | * displayName: string, |
| 735 | * signed: ?string, |
| 736 | * status: int, |
| 737 | * } |
| 738 | * @psalm-type LibresignProgressPayload = array{ |
| 739 | * total: int, |
| 740 | * signed: int, |
| 741 | * inProgress: int, |
| 742 | * pending: int, |
| 743 | * errors?: int, |
| 744 | * files?: list<LibresignProgressFile>, |
| 745 | * signers?: list<LibresignProgressSigner>, |
| 746 | * } |
| 747 | * @psalm-type LibresignProgressResponse = array{ |
| 748 | * status: 'NOT_LIBRESIGN_FILE'|'DRAFT'|'ABLE_TO_SIGN'|'PARTIAL_SIGNED'|'SIGNED'|'DELETED'|'SIGNING_IN_PROGRESS'|'ERROR'|'UNKNOWN', |
| 749 | * statusCode: int, |
| 750 | * statusText: string, |
| 751 | * fileId: int, |
| 752 | * progress: LibresignProgressPayload, |
| 753 | * file?: LibresignValidatedFile, |
| 754 | * error?: LibresignProgressError, |
| 755 | * } |
| 756 | * |
| 757 | * File and listing contracts |
| 758 | * |
| 759 | * @psalm-type LibresignFileSummary = array{ |
| 760 | * id: int, |
| 761 | * nodeId: ?int, |
| 762 | * uuid: string, |
| 763 | * name: non-falsy-string, |
| 764 | * status: int, |
| 765 | * statusText: string, |
| 766 | * nodeType: 'file'|'envelope', |
| 767 | * created_at: string, |
| 768 | * metadata: LibresignFileRuntimeMetadata, |
| 769 | * docmdpLevel: int, |
| 770 | * signatureFlow: 'none'|'parallel'|'ordered_numeric', |
| 771 | * policySnapshotFrozen: bool, |
| 772 | * signersCount: int, |
| 773 | * signers: list<LibresignSignerSummary>, |
| 774 | * requested_by: LibresignRequestedBy, |
| 775 | * filesCount: int<0, max>, |
| 776 | * canSign: bool, |
| 777 | * } |
| 778 | * @psalm-type LibresignFileListItem = array{ |
| 779 | * fileId: int, |
| 780 | * id: int, |
| 781 | * nodeId: ?int, |
| 782 | * uuid: string, |
| 783 | * name: non-falsy-string, |
| 784 | * status: int, |
| 785 | * statusText: string, |
| 786 | * docmdpLevel: int, |
| 787 | * signersCount: int, |
| 788 | * file: string, |
| 789 | * metadata: LibresignFileRuntimeMetadata, |
| 790 | * size: non-negative-int, |
| 791 | * signers: list<LibresignSignerSummary>, |
| 792 | * } |
| 793 | * @psalm-type LibresignDetailedFile = array{ |
| 794 | * created_at: string, |
| 795 | * files: list<LibresignFileListItem>, |
| 796 | * filesCount: int<0, max>, |
| 797 | * id: int, |
| 798 | * nodeId: int, |
| 799 | * uuid: string, |
| 800 | * name: non-falsy-string, |
| 801 | * status: int, |
| 802 | * statusText: string, |
| 803 | * nodeType: 'file'|'envelope', |
| 804 | * metadata: LibresignFileRuntimeMetadata, |
| 805 | * size: non-negative-int, |
| 806 | * docmdpLevel: int, |
| 807 | * signatureFlow: 'none'|'parallel'|'ordered_numeric', |
| 808 | * policySnapshotFrozen: bool, |
| 809 | * visibleElements: LibresignVisibleElement[], |
| 810 | * signers: LibresignSignerDetail[], |
| 811 | * signersCount: int, |
| 812 | * requested_by: LibresignRequestedBy, |
| 813 | * } |
| 814 | * @psalm-type LibresignDetailedFileResponse = LibresignDetailedFile&array{ |
| 815 | * message: string, |
| 816 | * } |
| 817 | * @psalm-type LibresignFileListResponse = array{ |
| 818 | * pagination: LibresignPagination, |
| 819 | * data: list<LibresignFileSummary|LibresignDetailedFile>, |
| 820 | * settings?: LibresignSettings, |
| 821 | * } |
| 822 | * |
| 823 | * Account, elements, and ID document contracts |
| 824 | * |
| 825 | * @psalm-type LibresignFile = array{ |
| 826 | * account: array{ |
| 827 | * userId: string, |
| 828 | * displayName: string, |
| 829 | * }, |
| 830 | * file_type: array{ |
| 831 | * type: string, |
| 832 | * name: string, |
| 833 | * description: ?string, |
| 834 | * }, |
| 835 | * created_at: string, |
| 836 | * file: array{ |
| 837 | * name: string, |
| 838 | * status: 0|1|2|3|4|6, |
| 839 | * statusText: string, |
| 840 | * created_at: string, |
| 841 | * file: array{ |
| 842 | * type: string, |
| 843 | * nodeId: non-negative-int, |
| 844 | * signedNodeId: non-negative-int, |
| 845 | * url: string, |
| 846 | * }, |
| 847 | * callback: ?string, |
| 848 | * uuid: string, |
| 849 | * signers: LibresignSignerDetail[], |
| 850 | * }, |
| 851 | * } |
| 852 | * @psalm-type LibresignFileElementIdResponse = array{ |
| 853 | * fileElementId: int, |
| 854 | * } |
| 855 | * @psalm-type LibresignUserElement = array{ |
| 856 | * id: int, |
| 857 | * type: string, |
| 858 | * file: array{ |
| 859 | * url: string, |
| 860 | * nodeId: int, |
| 861 | * }, |
| 862 | * userId: string, |
| 863 | * starred: bool, |
| 864 | * createdAt: string, |
| 865 | * } |
| 866 | * @psalm-type LibresignUserElementsResponse = array{ |
| 867 | * elements: LibresignUserElement[], |
| 868 | * } |
| 869 | * @psalm-type LibresignUserElementsMessageResponse = array{ |
| 870 | * elements: LibresignUserElement[], |
| 871 | * message: string, |
| 872 | * } |
| 873 | * @psalm-type LibresignAccountMeResponse = array{ |
| 874 | * account: array{ |
| 875 | * uid: string, |
| 876 | * emailAddress: string, |
| 877 | * displayName: string, |
| 878 | * }, |
| 879 | * settings: array{ |
| 880 | * canRequestSign: bool, |
| 881 | * hasSignatureFile: bool, |
| 882 | * phoneNumber: string, |
| 883 | * }, |
| 884 | * } |
| 885 | * @psalm-type LibresignAccountSettingsUpdateResponse = array{ |
| 886 | * data: array{ |
| 887 | * userId: string, |
| 888 | * phone: string, |
| 889 | * message: string, |
| 890 | * }, |
| 891 | * } |
| 892 | * @psalm-type LibresignConfigValueResponse = array{ |
| 893 | * key: string, |
| 894 | * value: ?string, |
| 895 | * } |
| 896 | * @psalm-type LibresignIdDocsUploadErrorResponse = array{ |
| 897 | * file: ?int, |
| 898 | * type: 'info'|'warning'|'danger'|null, |
| 899 | * message: string, |
| 900 | * } |
| 901 | * @psalm-type LibresignIdDocsListResponse = array{ |
| 902 | * pagination: LibresignPagination, |
| 903 | * data: list<LibresignFile>, |
| 904 | * } |
| 905 | * @psalm-type LibresignIdDocsApprovalListResponse = array{ |
| 906 | * pagination: LibresignPagination, |
| 907 | * data: list<LibresignFile>, |
| 908 | * } |
| 909 | * @psalm-type LibresignCreateToSignPdfReference = array{ |
| 910 | * url: string, |
| 911 | * } |
| 912 | * @psalm-type LibresignCreateToSignResponse = array{ |
| 913 | * action: 2000|2500, |
| 914 | * message: string, |
| 915 | * description?: null|string, |
| 916 | * filename?: string, |
| 917 | * pdf?: LibresignCreateToSignPdfReference, |
| 918 | * } |
| 919 | * |
| 920 | * CRL contracts |
| 921 | * |
| 922 | * @psalm-type LibresignCrlErrorResponse = array{ |
| 923 | * error: string, |
| 924 | * message: string, |
| 925 | * } |
| 926 | * @psalm-type LibresignCrlCertificateStatusResponse = array{ |
| 927 | * serial_number: string, |
| 928 | * status: 'valid'|'revoked'|'expired'|'unknown', |
| 929 | * checked_at: string, |
| 930 | * reason_code?: null|int, |
| 931 | * revoked_at?: string, |
| 932 | * valid_to?: string, |
| 933 | * } |
| 934 | * @psalm-type LibresignCrlListItem = array{ |
| 935 | * id: int, |
| 936 | * serial_number: string, |
| 937 | * owner: string, |
| 938 | * status: 'issued'|'revoked', |
| 939 | * certificate_type: string, |
| 940 | * engine: string, |
| 941 | * instance_id: ?string, |
| 942 | * generation: ?int, |
| 943 | * issued_at: ?string, |
| 944 | * valid_to: ?string, |
| 945 | * revoked_at: ?string, |
| 946 | * reason_code: ?int, |
| 947 | * comment: ?string, |
| 948 | * revoked_by: ?string, |
| 949 | * invalidity_date: ?string, |
| 950 | * crl_number: ?int, |
| 951 | * } |
| 952 | * @psalm-type LibresignCrlListResponse = array{ |
| 953 | * data: list<LibresignCrlListItem>, |
| 954 | * total: int, |
| 955 | * page: int, |
| 956 | * length: int, |
| 957 | * } |
| 958 | * @psalm-type LibresignCrlRevokeResponse = array{ |
| 959 | * success: bool, |
| 960 | * message: string, |
| 961 | * } |
| 962 | * |
| 963 | * Capabilities contracts |
| 964 | * |
| 965 | * @psalm-type LibresignCapabilities = array{ |
| 966 | * features: list<string>, |
| 967 | * config: array{ |
| 968 | * show-confetti: bool, |
| 969 | * sign-elements: array{ |
| 970 | * is-available: bool, |
| 971 | * can-create-signature: bool, |
| 972 | * full-signature-width: float, |
| 973 | * full-signature-height: float, |
| 974 | * signature-width: float, |
| 975 | * signature-height: float, |
| 976 | * }, |
| 977 | * envelope: array{ |
| 978 | * is-available: bool, |
| 979 | * }, |
| 980 | * upload: array{ |
| 981 | * max-file-uploads: int, |
| 982 | * }, |
| 983 | * }, |
| 984 | * version: string, |
| 985 | * } |
| 986 | */ |
| 987 | class ResponseDefinitions { |
| 988 | } |