@assinafy/sdk 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -1
- package/README.en.md +71 -11
- package/README.md +72 -11
- package/dist/index.d.mts +355 -26
- package/dist/index.d.ts +355 -26
- package/dist/index.js +340 -30
- package/dist/index.mjs +340 -30
- package/docs/API_COVERAGE.md +14 -8
- package/docs/COMPATIBILITY.md +54 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
2
|
|
|
3
3
|
/** Document lifecycle states emitted by the API. */
|
|
4
|
-
type DocumentStatus = 'uploading' | 'uploaded' | 'metadata_processing' | 'metadata_ready' | 'pending_signature' | 'expired' | 'certificating' | 'certificated' | 'rejected_by_signer' | 'rejected_by_user' | 'failed';
|
|
4
|
+
type DocumentStatus = 'uploading' | 'uploaded' | 'metadata_processing' | 'metadata_ready' | 'pending_signature' | 'pending_identity_review' | 'expired' | 'certificating' | 'certificated' | 'rejected_by_signer' | 'rejected_by_user' | 'failed';
|
|
5
5
|
/** Artifact names available for document download. */
|
|
6
6
|
type DocumentArtifactName = 'original' | 'certificated' | 'certificate-page' | 'pades' | 'bundle';
|
|
7
7
|
/** Server-defined signature image category, with known values suggested. */
|
|
@@ -29,7 +29,8 @@ type AssignmentMethod = 'virtual' | 'collect';
|
|
|
29
29
|
* | --- | --- | --- | --- |
|
|
30
30
|
* | `Email` | One-time code sent by e-mail (the default). | An `email`. | 0 credits |
|
|
31
31
|
* | `Whatsapp` | One-time code sent over WhatsApp. | A `whatsapp_phone_number`; paid plan. | 0.45 credits |
|
|
32
|
-
* | `DigitalCertificate` | The signer signs with their own ICP-Brasil certificate — **A1** (software, a file on the machine) or **A3** (hardware, a token or smartcard) — through the Web PKI browser extension, producing a qualified PAdES signature. | Digital Certificate feature (Standard/Pro); `government_id
|
|
32
|
+
* | `DigitalCertificate` | The signer signs with their own ICP-Brasil certificate — **A1** (software, a file on the machine) or **A3** (hardware, a token or smartcard) — through the Web PKI browser extension, producing a qualified PAdES signature. | Digital Certificate feature (Standard/Pro); `government_id`; the signer must be alone in their signing step. | 0.5 credits + notification |
|
|
33
|
+
* | `IdDocumentFaceMatchBasic` | Hosted identity-document and face verification, with explicit biometric consent. | ID Document + Face Match feature; valid CPF in `government_id`; account approval for any `InReview` result before certification. | Use cost estimation for current pricing. |
|
|
33
34
|
*
|
|
34
35
|
* A1 and A3 are certificate *media*, chosen by the signer in their browser at
|
|
35
36
|
* signing time. The API models both as the single `DigitalCertificate` value —
|
|
@@ -39,13 +40,89 @@ type AssignmentMethod = 'virtual' | 'collect';
|
|
|
39
40
|
* Verification is coupled to {@link AssignmentNotificationMethod}: the
|
|
40
41
|
* verification code travels on the notification channel, so `Email` pairs only
|
|
41
42
|
* with `Email` and `Whatsapp` only with `Whatsapp`. `DigitalCertificate`
|
|
42
|
-
*
|
|
43
|
+
* and `IdDocumentFaceMatchBasic` carry no OTP and may be announced over either
|
|
44
|
+
* channel. The SDK rejects an
|
|
43
45
|
* invalid pairing before the request; the API answers `400`.
|
|
44
46
|
*
|
|
45
47
|
* Send neither field to get `Email`/`Email`; send one and the other is
|
|
46
48
|
* inferred from it.
|
|
47
49
|
*/
|
|
48
|
-
type AssignmentVerificationMethod = 'Email' | 'Whatsapp' | 'DigitalCertificate';
|
|
50
|
+
type AssignmentVerificationMethod = 'Email' | 'Whatsapp' | 'DigitalCertificate' | 'IdDocumentFaceMatchBasic';
|
|
51
|
+
/** Provider session state; `InReview` permits signing but holds certification. */
|
|
52
|
+
type IdentityVerificationStatus = 'Pending' | 'InReview' | 'Approved' | 'Declined' | 'Expired' | 'Abandoned';
|
|
53
|
+
/** Evidence names accepted by the account review image endpoint. */
|
|
54
|
+
type IdentityVerificationImageName = 'document_front' | 'document_back' | 'document_pdf' | 'face';
|
|
55
|
+
/** Signer-facing identity verification state, including an optional live capture link. */
|
|
56
|
+
interface ISignerIdentityVerification {
|
|
57
|
+
/** True before a session exists or when the last session is Expired. */
|
|
58
|
+
can_start: boolean;
|
|
59
|
+
status: IdentityVerificationStatus | AnyString | null;
|
|
60
|
+
/** Bearer link: preserve its fragment, never log it or persist it in browser storage. */
|
|
61
|
+
url: string | null;
|
|
62
|
+
/** Capture-link expiry, not a deadline for processing or account review. */
|
|
63
|
+
expires_at: string | null;
|
|
64
|
+
completed_at: string | null;
|
|
65
|
+
}
|
|
66
|
+
/** Explicit biometric-processing consent; never infer it from another action. */
|
|
67
|
+
interface IStartIdentityVerificationPayload {
|
|
68
|
+
consent: true;
|
|
69
|
+
}
|
|
70
|
+
/** A newly opened identity verification provider session. */
|
|
71
|
+
interface ISignerIdentityVerificationSession {
|
|
72
|
+
id: string;
|
|
73
|
+
/** Open as-is, including any fragment; treat it as a credential. */
|
|
74
|
+
url: string;
|
|
75
|
+
expires_at: string | null;
|
|
76
|
+
}
|
|
77
|
+
/** Account review decision. Rejection cancels the document and notifies its recipients. */
|
|
78
|
+
interface IReviewIdentityVerificationPayload {
|
|
79
|
+
decision: 'Approved' | 'Rejected';
|
|
80
|
+
/** Up to 2000 characters; recorded in activity and sent to the provider, hidden from signers. */
|
|
81
|
+
note?: string | null;
|
|
82
|
+
}
|
|
83
|
+
/** Account-visible identity review summary; contains no image bytes or biometrics. */
|
|
84
|
+
interface ISignerIdentityReview {
|
|
85
|
+
id: string;
|
|
86
|
+
status: IdentityVerificationStatus | AnyString;
|
|
87
|
+
provider: 'AssinafyVerify' | AnyString;
|
|
88
|
+
verification_method: 'IdDocumentFaceMatchBasic' | AnyString;
|
|
89
|
+
reason_codes: Array<{
|
|
90
|
+
code: string;
|
|
91
|
+
description: string;
|
|
92
|
+
}>;
|
|
93
|
+
evidence_available: boolean;
|
|
94
|
+
expected: {
|
|
95
|
+
name: string | null;
|
|
96
|
+
cpf: string | null;
|
|
97
|
+
} | null;
|
|
98
|
+
document: {
|
|
99
|
+
type: string | null;
|
|
100
|
+
name: string | null;
|
|
101
|
+
cpf: string | null;
|
|
102
|
+
} | null;
|
|
103
|
+
matches: {
|
|
104
|
+
cpf: boolean | null;
|
|
105
|
+
name: number | null;
|
|
106
|
+
birth_date: boolean | null;
|
|
107
|
+
} | null;
|
|
108
|
+
checks: Array<{
|
|
109
|
+
name: string;
|
|
110
|
+
result: string;
|
|
111
|
+
score: number | null;
|
|
112
|
+
reasons: string[];
|
|
113
|
+
}>;
|
|
114
|
+
/** Evidence available only while `InReview`; empty after the decision. */
|
|
115
|
+
images: IdentityVerificationImageName[];
|
|
116
|
+
ruleset_version: string | null;
|
|
117
|
+
evidence_sha256: string | null;
|
|
118
|
+
reviewed_by: {
|
|
119
|
+
id: string;
|
|
120
|
+
name: string;
|
|
121
|
+
} | null;
|
|
122
|
+
reviewed_at: string | null;
|
|
123
|
+
review_note: string | null;
|
|
124
|
+
completed_at: string | null;
|
|
125
|
+
}
|
|
49
126
|
/**
|
|
50
127
|
* How the signing invitation reaches the signer. Exactly one per signer.
|
|
51
128
|
*
|
|
@@ -163,6 +240,8 @@ interface ISigner {
|
|
|
163
240
|
}
|
|
164
241
|
/** Signer profile returned by the signer-code-authenticated `GET /signers/self`. */
|
|
165
242
|
interface ISignerSelf extends ISigner {
|
|
243
|
+
/** Available before verification so the signing UI can select OTP, certificate or identity capture. */
|
|
244
|
+
verification_method?: AssignmentVerificationMethod | AnyString;
|
|
166
245
|
/** Optional for compatibility with deployments that omit this field. */
|
|
167
246
|
has_signature?: boolean;
|
|
168
247
|
/** Optional for compatibility with deployments that omit this field. */
|
|
@@ -324,6 +403,8 @@ interface IEstimateAssignmentCostPayload {
|
|
|
324
403
|
}
|
|
325
404
|
/** A signer as embedded inside an assignment (richer than the bare {@link ISigner}). */
|
|
326
405
|
interface IAssignmentSigner extends ISigner {
|
|
406
|
+
/** `InReview` requires an account decision before document certification. */
|
|
407
|
+
identity_verification_status?: IdentityVerificationStatus | AnyString | null;
|
|
327
408
|
/** Only present in account-owner contexts; omitted from signer-code responses. */
|
|
328
409
|
completed?: boolean | null;
|
|
329
410
|
/** Optional because some deployments omit notification history. */
|
|
@@ -464,7 +545,7 @@ interface IWebhookPayload {
|
|
|
464
545
|
[key: string]: unknown;
|
|
465
546
|
}
|
|
466
547
|
/** Known webhook event names. */
|
|
467
|
-
type WebhookEventType = 'document_uploaded' | 'document_metadata_ready' | 'document_prepared' | 'assignment_created' | 'document_ready' | 'signature_requested' | 'signer_created' | 'signer_email_verified' | 'signer_whatsapp_verified' | 'signer_data_confirmed' | 'signer_viewed_document' | 'signer_signed_document' | 'signer_rejected_document' | 'user_rejected_document' | 'document_processing_failed' | 'template_created' | 'template_processed' | 'template_processing_failed';
|
|
548
|
+
type WebhookEventType = 'document_uploaded' | 'document_metadata_ready' | 'document_prepared' | 'assignment_created' | 'document_ready' | 'signature_requested' | 'signer_created' | 'signer_email_verified' | 'signer_whatsapp_verified' | 'signer_data_confirmed' | 'signer_viewed_document' | 'signer_identity_verified' | 'signer_identity_verification_failed' | 'signer_identity_review_required' | 'signer_identity_review_approved' | 'signer_identity_review_rejected' | 'signer_signed_document' | 'signer_rejected_document' | 'user_rejected_document' | 'document_processing_failed' | 'template_created' | 'template_processed' | 'template_processing_failed';
|
|
468
549
|
/** Document listing item (paginated). */
|
|
469
550
|
interface IDocumentListItem {
|
|
470
551
|
id: string;
|
|
@@ -786,6 +867,11 @@ interface IWebhookEndpoint {
|
|
|
786
867
|
/** ISO-8601 UTC timestamp. */
|
|
787
868
|
updated_at: string;
|
|
788
869
|
}
|
|
870
|
+
/** Endpoint creation also returns the signing secret when signing is enabled. */
|
|
871
|
+
interface IWebhookEndpointCreateResponse extends IWebhookEndpoint {
|
|
872
|
+
/** Store securely at creation: OAuth applications cannot read or rotate this later. */
|
|
873
|
+
secret?: string;
|
|
874
|
+
}
|
|
789
875
|
/** An endpoint's Standard Webhooks signing secret. */
|
|
790
876
|
interface IWebhookEndpointSecret {
|
|
791
877
|
/** `whsec_` followed by the base64-encoded key. */
|
|
@@ -1512,6 +1598,9 @@ declare class DocumentResource extends BaseResource {
|
|
|
1512
1598
|
*
|
|
1513
1599
|
* @param source - The PDF to upload, as a file path or an in-memory buffer.
|
|
1514
1600
|
* @param options - Display name, metadata, and account override.
|
|
1601
|
+
* @param options.name - Multipart filename override; the API derives the display name from it.
|
|
1602
|
+
* @param options.metadata - JSON metadata (compatibility multipart part).
|
|
1603
|
+
* @param options.accountId - Override the client's default workspace.
|
|
1515
1604
|
* @returns The created document, freshly uploaded (`status: 'uploaded'`,
|
|
1516
1605
|
* empty `pages` until `metadata_ready`). Response shape:
|
|
1517
1606
|
* ```jsonc
|
|
@@ -1605,7 +1694,7 @@ declare class DocumentResource extends BaseResource {
|
|
|
1605
1694
|
* method: 'virtual',
|
|
1606
1695
|
* 'per-page': 50,
|
|
1607
1696
|
* });
|
|
1608
|
-
* console.log(data[0]?.pages
|
|
1697
|
+
* console.log(data[0]?.pages?.length, meta?.total);
|
|
1609
1698
|
* ```
|
|
1610
1699
|
*/
|
|
1611
1700
|
list(params?: IDocumentListParams, accountId?: string): Promise<IDocumentListResponse>;
|
|
@@ -1776,7 +1865,8 @@ declare class DocumentResource extends BaseResource {
|
|
|
1776
1865
|
get(documentId: string): Promise<IDocumentDetailsResponse>;
|
|
1777
1866
|
/**
|
|
1778
1867
|
* Poll {@link DocumentResource.details} until the document reaches a ready
|
|
1779
|
-
* status (`metadata_ready`, `pending_signature`,
|
|
1868
|
+
* status (`metadata_ready`, `pending_signature`, `pending_identity_review`,
|
|
1869
|
+
* or `certificated`),
|
|
1780
1870
|
* throwing on a terminal failure status or timeout.
|
|
1781
1871
|
*
|
|
1782
1872
|
* Transient errors are tolerated — a `5xx` or `429` is retried on the next
|
|
@@ -1786,6 +1876,8 @@ declare class DocumentResource extends BaseResource {
|
|
|
1786
1876
|
* @param documentId - The document to wait on.
|
|
1787
1877
|
* @param options - `maxWaitMs` (default `30_000`) and `pollIntervalMs`
|
|
1788
1878
|
* (default `2_000`).
|
|
1879
|
+
* @param options.maxWaitMs - Finite non-negative wait budget in milliseconds; default `30_000`.
|
|
1880
|
+
* @param options.pollIntervalMs - Finite positive polling interval in milliseconds; default `2_000`.
|
|
1789
1881
|
* @returns The document details once it reaches a ready status (see
|
|
1790
1882
|
* {@link DocumentResource.details} for the shape).
|
|
1791
1883
|
* @throws {ValidationError} If `documentId` is missing, the document enters
|
|
@@ -1966,6 +2058,9 @@ declare class DocumentResource extends BaseResource {
|
|
|
1966
2058
|
* names are not portable identifiers and should not be used here. This
|
|
1967
2059
|
* overwrites the existing set — use
|
|
1968
2060
|
* {@link DocumentResource.addTags} to append.
|
|
2061
|
+
* Older sandbox deployments interpret these strings as names and create
|
|
2062
|
+
* ID-named tags for ID inputs; pass existing names intentionally there.
|
|
2063
|
+
* Strings are sent unchanged. See `docs/COMPATIBILITY.md` for this variant.
|
|
1969
2064
|
*
|
|
1970
2065
|
* Request body (`application/json`):
|
|
1971
2066
|
* ```jsonc
|
|
@@ -2004,6 +2099,8 @@ declare class DocumentResource extends BaseResource {
|
|
|
2004
2099
|
* `tags` is a non-empty array of tag **IDs**. Attaching an ID already
|
|
2005
2100
|
* present is a no-op. To replace the whole set instead, use
|
|
2006
2101
|
* {@link DocumentResource.replaceTags}.
|
|
2102
|
+
* On older name-based sandbox deployments, pass existing tag names
|
|
2103
|
+
* intentionally; ID inputs create ID-named tags. No automatic remapping occurs.
|
|
2007
2104
|
*
|
|
2008
2105
|
* Request body (`application/json`):
|
|
2009
2106
|
* ```jsonc
|
|
@@ -2100,10 +2197,17 @@ declare class DocumentResource extends BaseResource {
|
|
|
2100
2197
|
* plus optional `verification_method`, `notification_methods`, `step`).
|
|
2101
2198
|
* Only one notification method is allowed per signer; when only one of the
|
|
2102
2199
|
* verification/notification fields is supplied, the API infers the other.
|
|
2103
|
-
* `DigitalCertificate` costs
|
|
2200
|
+
* `DigitalCertificate` costs 0.5 credits, requires the feature plus a
|
|
2104
2201
|
* signer `government_id`, and that signer must be alone in its step.
|
|
2202
|
+
* `IdDocumentFaceMatchBasic` needs the ID Document + Face Match feature
|
|
2203
|
+
* and a valid CPF in `government_id`; estimate the per-signer fee first.
|
|
2105
2204
|
* @param options - Optional `name`, `message`, `expires_at`,
|
|
2106
2205
|
* `editor_fields`, `tags`.
|
|
2206
|
+
* @param options.name - Generated document display name.
|
|
2207
|
+
* @param options.message - Signing invitation message.
|
|
2208
|
+
* @param options.expires_at - ISO-8601 signature deadline.
|
|
2209
|
+
* @param options.editor_fields - Template editor values as `{ field_id, value }` entries.
|
|
2210
|
+
* @param options.tags - Tag names attached to the generated document.
|
|
2107
2211
|
* @param accountId - Override the client's default account ID.
|
|
2108
2212
|
* @returns The created document (an {@link IDocumentDetailsResponse} with
|
|
2109
2213
|
* `template_id` set and its `assignment` populated):
|
|
@@ -2144,7 +2248,7 @@ declare class DocumentResource extends BaseResource {
|
|
|
2144
2248
|
*
|
|
2145
2249
|
* A dry run: sends only `{ signers }` and consumes nothing. Use it to check
|
|
2146
2250
|
* balances before calling {@link DocumentResource.createFromTemplate}.
|
|
2147
|
-
* `DigitalCertificate` adds
|
|
2251
|
+
* `DigitalCertificate` adds 0.5 credits per signer and has the same feature,
|
|
2148
2252
|
* `government_id`, and signing-step prerequisites as document creation.
|
|
2149
2253
|
*
|
|
2150
2254
|
* Request body (`application/json`):
|
|
@@ -2596,9 +2700,8 @@ declare class SignerResource extends BaseResource {
|
|
|
2596
2700
|
* re-filtered here for an exact, case-insensitive email match.
|
|
2597
2701
|
*
|
|
2598
2702
|
* Page size is pinned to {@link MAX_LIST_PAGE_SIZE}, the largest page the
|
|
2599
|
-
* server actually returns.
|
|
2600
|
-
*
|
|
2601
|
-
* miss one — the API exposes no exact-email filter to rule that out.
|
|
2703
|
+
* server actually returns. Pages are searched until an exact match is found
|
|
2704
|
+
* or the result set ends, so substring matches cannot hide an existing signer.
|
|
2602
2705
|
*
|
|
2603
2706
|
* A `404` from the underlying list is treated as "no match" and mapped to
|
|
2604
2707
|
* `null`; any other {@link ApiError} propagates.
|
|
@@ -2847,6 +2950,8 @@ declare class WorkspaceResource extends BaseResource {
|
|
|
2847
2950
|
* @param accountId - Account to aggregate.
|
|
2848
2951
|
* @param params - Omit for 12 monthly rows, or request daily rows with
|
|
2849
2952
|
* `{ granularity: 'daily', month: '2026-06' }`.
|
|
2953
|
+
* @param params.granularity - `monthly` (default) or `daily`.
|
|
2954
|
+
* @param params.month - Month in `YYYY-MM` format; required for daily rows.
|
|
2850
2955
|
* @returns Zero-filled KPI rows:
|
|
2851
2956
|
* ```jsonc
|
|
2852
2957
|
* [{
|
|
@@ -2946,6 +3051,7 @@ declare class WorkspaceResource extends BaseResource {
|
|
|
2946
3051
|
* @param accountId - The workspace to delete.
|
|
2947
3052
|
* @param options - Set `force: true` to cancel an active paid subscription
|
|
2948
3053
|
* and proceed with deletion.
|
|
3054
|
+
* @param options.force - Cancel an active subscription and bypass deletion restrictions.
|
|
2949
3055
|
* @returns Nothing on success (`200` with no meaningful body).
|
|
2950
3056
|
* @throws {ValidationError} If `accountId` is missing.
|
|
2951
3057
|
* @throws {ApiError} `400` (with a `restrictions` list) when the workspace
|
|
@@ -3087,8 +3193,10 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3087
3193
|
* {@link buildAssignmentPayload}. A `virtual` assignment may be created at
|
|
3088
3194
|
* `uploaded`, `metadata_processing`, or `metadata_ready` and is promoted
|
|
3089
3195
|
* automatically; `collect` requires rendered pages at `metadata_ready`.
|
|
3090
|
-
* `DigitalCertificate` costs
|
|
3196
|
+
* `DigitalCertificate` costs 0.5 credits, requires the feature plus a
|
|
3091
3197
|
* signer `government_id`, and that signer must be alone in its step.
|
|
3198
|
+
* `IdDocumentFaceMatchBasic` needs the ID Document + Face Match feature
|
|
3199
|
+
* and a valid CPF in the signer's `government_id`; estimate its fee first.
|
|
3092
3200
|
*
|
|
3093
3201
|
* Request body (`application/json`):
|
|
3094
3202
|
* ```jsonc
|
|
@@ -3209,7 +3317,7 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3209
3317
|
* only `verification_method` / `notification_methods` (or `{}` for the
|
|
3210
3318
|
* default Email channel). {@link buildAssignmentEstimatePayload} projects
|
|
3211
3319
|
* exactly the fields permitted by the estimate schema.
|
|
3212
|
-
* `DigitalCertificate` is priced at
|
|
3320
|
+
* `DigitalCertificate` is priced at 0.5 credits per signer and remains
|
|
3213
3321
|
* subject to the feature, identity, and one-signer-per-step requirements.
|
|
3214
3322
|
* Current documented unit prices are 1 credit for an extra document, 0 for
|
|
3215
3323
|
* email notification, and 0.45 for WhatsApp notification; a digital
|
|
@@ -3436,6 +3544,116 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3436
3544
|
* ```
|
|
3437
3545
|
*/
|
|
3438
3546
|
listWhatsAppNotifications(documentId: string, assignmentId: string): Promise<IWhatsAppNotification[]>;
|
|
3547
|
+
/**
|
|
3548
|
+
* Read the account's signer identity review
|
|
3549
|
+
* (`GET /documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/identity-verification`).
|
|
3550
|
+
*
|
|
3551
|
+
* No request body. `InReview` lets the signer continue signing but holds
|
|
3552
|
+
* certification. Evidence is a summary without images or biometrics; a
|
|
3553
|
+
* directly approved verification exposes evidence on its activity instead.
|
|
3554
|
+
*
|
|
3555
|
+
* @param documentId - Document owning the assignment.
|
|
3556
|
+
* @param assignmentId - Assignment containing the signer.
|
|
3557
|
+
* @param signerId - Signer whose identity is under review.
|
|
3558
|
+
* @returns The complete review summary:
|
|
3559
|
+
* ```jsonc
|
|
3560
|
+
* {
|
|
3561
|
+
* "id": "verification_example", "status": "InReview",
|
|
3562
|
+
* "provider": "AssinafyVerify", "verification_method": "IdDocumentFaceMatchBasic",
|
|
3563
|
+
* "reason_codes": [{ "code": "NAME_MISMATCH", "description": "Name differs" }],
|
|
3564
|
+
* "evidence_available": true,
|
|
3565
|
+
* "expected": { "name": "Example Signer", "cpf": null },
|
|
3566
|
+
* "document": { "type": "CNH", "name": "EXAMPLE SIGNER", "cpf": null },
|
|
3567
|
+
* "matches": { "cpf": null, "name": 0.52, "birth_date": null },
|
|
3568
|
+
* "checks": [{ "name": "name", "result": "review", "score": 0.52, "reasons": ["NAME_MISMATCH"] }],
|
|
3569
|
+
* "images": ["document_front", "face"], // available only while InReview
|
|
3570
|
+
* "ruleset_version": "2026-10-12.2", "evidence_sha256": null,
|
|
3571
|
+
* "reviewed_by": null, "reviewed_at": null, "review_note": null, "completed_at": null
|
|
3572
|
+
* }
|
|
3573
|
+
* ```
|
|
3574
|
+
* @throws {ValidationError} If any ID is blank or invalid for a URL.
|
|
3575
|
+
* @throws {ApiError} `401` for invalid credentials; `404` for an unknown
|
|
3576
|
+
* assignment, signer or verification; `500` for a server failure.
|
|
3577
|
+
* @example
|
|
3578
|
+
* ```ts
|
|
3579
|
+
* const review = await client.assignments.getIdentityVerification('doc-1', 'asg-1', 'signer-1');
|
|
3580
|
+
* console.log(review.status, review.images.length);
|
|
3581
|
+
* ```
|
|
3582
|
+
*/
|
|
3583
|
+
getIdentityVerification(documentId: string, assignmentId: string, signerId: string): Promise<ISignerIdentityReview>;
|
|
3584
|
+
/**
|
|
3585
|
+
* Download identity review evidence
|
|
3586
|
+
* (`GET /documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/identity-verification/images/{name}`).
|
|
3587
|
+
*
|
|
3588
|
+
* No request body. The provider supplies the bytes on each request; Assinafy
|
|
3589
|
+
* never stores them. Available only while the review is open. Keep these
|
|
3590
|
+
* sensitive bytes out of caches and logs (`Cache-Control: no-store`).
|
|
3591
|
+
*
|
|
3592
|
+
* @param documentId - Document owning the assignment.
|
|
3593
|
+
* @param assignmentId - Assignment containing the signer.
|
|
3594
|
+
* @param signerId - Signer whose evidence to view.
|
|
3595
|
+
* @param name - One of the review's `images`: `document_front`,
|
|
3596
|
+
* `document_back`, `document_pdf`, or `face`.
|
|
3597
|
+
* @returns Raw JPEG, PNG or PDF bytes as a `Buffer`.
|
|
3598
|
+
* @throws {ValidationError} If an ID or image name is invalid.
|
|
3599
|
+
* @throws {ApiError} `401` for invalid credentials; `404` for absent evidence
|
|
3600
|
+
* or a decided review; `500` for a provider/server failure.
|
|
3601
|
+
* @example
|
|
3602
|
+
* ```ts
|
|
3603
|
+
* const bytes = await client.assignments.downloadIdentityVerificationImage('doc-1', 'asg-1', 'signer-1', 'face');
|
|
3604
|
+
* ```
|
|
3605
|
+
*/
|
|
3606
|
+
downloadIdentityVerificationImage(documentId: string, assignmentId: string, signerId: string, name: IdentityVerificationImageName): Promise<Buffer>;
|
|
3607
|
+
/**
|
|
3608
|
+
* Decide a signer identity review
|
|
3609
|
+
* (`POST /documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/identity-verification/review`).
|
|
3610
|
+
*
|
|
3611
|
+
* Requires `InReview` and a document at `pending_signature` or
|
|
3612
|
+
* `pending_identity_review`. Approval allows certification once all signers
|
|
3613
|
+
* sign and every review is approved. Rejection cancels the document as
|
|
3614
|
+
* `rejected_by_user` and sends cancellation notices to signers and copy
|
|
3615
|
+
* receivers. The note is hidden from them; the provider receives the decision.
|
|
3616
|
+
*
|
|
3617
|
+
* Request body (`application/json`):
|
|
3618
|
+
* ```jsonc
|
|
3619
|
+
* { "decision": "Approved", "note": "Verified independently." }
|
|
3620
|
+
* ```
|
|
3621
|
+
* @param documentId - Document owning the assignment.
|
|
3622
|
+
* @param assignmentId - Assignment containing the signer.
|
|
3623
|
+
* @param signerId - Signer whose review to decide.
|
|
3624
|
+
* @param payload - Explicit account review decision.
|
|
3625
|
+
* @param payload.decision - `Approved` or `Rejected`.
|
|
3626
|
+
* @param payload.note - Optional nullable note, at most 2000 characters.
|
|
3627
|
+
* @returns The updated review, in the full
|
|
3628
|
+
* {@link AssignmentResource.getIdentityVerification} shape:
|
|
3629
|
+
* ```jsonc
|
|
3630
|
+
* {
|
|
3631
|
+
* "id": "verification_example", "status": "Approved",
|
|
3632
|
+
* "provider": "AssinafyVerify", "verification_method": "IdDocumentFaceMatchBasic",
|
|
3633
|
+
* "reason_codes": [{ "code": "NAME_MISMATCH", "description": "Name differs" }],
|
|
3634
|
+
* "evidence_available": true,
|
|
3635
|
+
* "expected": { "name": "Example Signer", "cpf": null },
|
|
3636
|
+
* "document": { "type": "CNH", "name": "EXAMPLE SIGNER", "cpf": null },
|
|
3637
|
+
* "matches": { "cpf": null, "name": 0.52, "birth_date": null },
|
|
3638
|
+
* "checks": [{ "name": "name", "result": "review", "score": 0.52, "reasons": ["NAME_MISMATCH"] }],
|
|
3639
|
+
* "images": [], "ruleset_version": "2026-10-12.2", "evidence_sha256": null,
|
|
3640
|
+
* "reviewed_by": { "id": "user_example", "name": "Example Reviewer" },
|
|
3641
|
+
* "reviewed_at": "2026-10-16T12:00:00Z", "review_note": "Verified independently.",
|
|
3642
|
+
* "completed_at": "2026-10-16T12:00:00Z"
|
|
3643
|
+
* }
|
|
3644
|
+
* ```
|
|
3645
|
+
* @throws {ValidationError} If IDs, decision or note are invalid.
|
|
3646
|
+
* @throws {ApiError} `400` for a closed review or invalid document state;
|
|
3647
|
+
* `401` for invalid credentials; `404` if absent; `500` for a server failure.
|
|
3648
|
+
* @example
|
|
3649
|
+
* ```ts
|
|
3650
|
+
* await client.assignments.reviewIdentityVerification('doc-1', 'asg-1', 'signer-1', {
|
|
3651
|
+
* decision: 'Approved', note: 'Verified independently.',
|
|
3652
|
+
* });
|
|
3653
|
+
* ```
|
|
3654
|
+
*/
|
|
3655
|
+
reviewIdentityVerification(documentId: string, assignmentId: string, signerId: string, payload: IReviewIdentityVerificationPayload): Promise<ISignerIdentityReview>;
|
|
3656
|
+
private identityVerificationPath;
|
|
3439
3657
|
}
|
|
3440
3658
|
|
|
3441
3659
|
/**
|
|
@@ -3716,6 +3934,8 @@ declare class WebhookResource extends BaseResource {
|
|
|
3716
3934
|
* `account:read` scope.
|
|
3717
3935
|
*
|
|
3718
3936
|
* @param accountId - Override the client's default account ID.
|
|
3937
|
+
* @param params - Optional endpoint filters.
|
|
3938
|
+
* @param params.url - Match the exact registered endpoint URL.
|
|
3719
3939
|
* @returns Every endpoint (1 on free plans, up to 3 on paid plans):
|
|
3720
3940
|
* ```jsonc
|
|
3721
3941
|
* [
|
|
@@ -3741,15 +3961,18 @@ declare class WebhookResource extends BaseResource {
|
|
|
3741
3961
|
* const signed = endpoints.filter((endpoint) => endpoint.signing_enabled);
|
|
3742
3962
|
* ```
|
|
3743
3963
|
*/
|
|
3744
|
-
listEndpoints(accountId?: string
|
|
3964
|
+
listEndpoints(accountId?: string, params?: {
|
|
3965
|
+
url?: string;
|
|
3966
|
+
}): Promise<IWebhookEndpoint[]>;
|
|
3745
3967
|
/**
|
|
3746
3968
|
* Register a URL to receive the account's webhook events
|
|
3747
3969
|
* (`POST /accounts/{accountId}/webhooks/endpoints`).
|
|
3748
3970
|
*
|
|
3749
3971
|
* An account can have 1 endpoint, or up to 3 on paid plans. Each endpoint
|
|
3750
3972
|
* of a workspace needs a different `url`. With `signing_enabled: true` the
|
|
3751
|
-
* API
|
|
3752
|
-
* {@link WebhookResource.getEndpointSecret}
|
|
3973
|
+
* API returns a signing `secret` in this creation response. Store it now:
|
|
3974
|
+
* OAuth applications cannot call {@link WebhookResource.getEndpointSecret}
|
|
3975
|
+
* or rotate it later. When `events` is omitted or
|
|
3753
3976
|
* empty, {@link DEFAULT_WEBHOOK_EVENTS} is sent. OAuth tokens need the
|
|
3754
3977
|
* `webhooks:write` scope.
|
|
3755
3978
|
*
|
|
@@ -3779,6 +4002,7 @@ declare class WebhookResource extends BaseResource {
|
|
|
3779
4002
|
* "events": ["document_ready", "signer_signed_document"],
|
|
3780
4003
|
* "is_active": true,
|
|
3781
4004
|
* "signing_enabled": true, // deliveries carry a `webhook-signature` header
|
|
4005
|
+
* "secret": "whsec_c2VjcmV0", // only in this response when signing is enabled
|
|
3782
4006
|
* "created_at": "2026-10-01T12:00:00Z",
|
|
3783
4007
|
* "updated_at": "2026-10-01T12:00:00Z"
|
|
3784
4008
|
* }
|
|
@@ -3798,10 +4022,10 @@ declare class WebhookResource extends BaseResource {
|
|
|
3798
4022
|
* events: ['document_ready', 'signer_signed_document'],
|
|
3799
4023
|
* signing_enabled: true,
|
|
3800
4024
|
* });
|
|
3801
|
-
*
|
|
4025
|
+
* if (endpoint.secret) await secretStore.save(endpoint.id, endpoint.secret);
|
|
3802
4026
|
* ```
|
|
3803
4027
|
*/
|
|
3804
|
-
createEndpoint(payload: IWebhookEndpointCreatePayload, accountId?: string): Promise<
|
|
4028
|
+
createEndpoint(payload: IWebhookEndpointCreatePayload, accountId?: string): Promise<IWebhookEndpointCreateResponse>;
|
|
3805
4029
|
/**
|
|
3806
4030
|
* Retrieve one webhook endpoint
|
|
3807
4031
|
* (`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}`). OAuth
|
|
@@ -3903,6 +4127,25 @@ declare class WebhookResource extends BaseResource {
|
|
|
3903
4127
|
* ```
|
|
3904
4128
|
*/
|
|
3905
4129
|
deleteEndpoint(endpointId: string, accountId?: string): Promise<void>;
|
|
4130
|
+
/**
|
|
4131
|
+
* Delete a webhook endpoint using its registered URL
|
|
4132
|
+
* (`DELETE /accounts/{accountId}/webhooks/endpoints?url=…`).
|
|
4133
|
+
*
|
|
4134
|
+
* No request body. The query URL must match the registered value exactly.
|
|
4135
|
+
* Frees its plan slot; OAuth applications need `webhooks:write`.
|
|
4136
|
+
*
|
|
4137
|
+
* @param url - Exact registered HTTP(S) endpoint URL, including its query.
|
|
4138
|
+
* @param accountId - Override the client's default workspace.
|
|
4139
|
+
* @returns Resolves on acknowledgement (`{ "status": 200, "data": [] }`).
|
|
4140
|
+
* @throws {ValidationError} If the URL is invalid or the account is missing.
|
|
4141
|
+
* @throws {ApiError} `400` for a missing URL; `401` for invalid credentials;
|
|
4142
|
+
* `403` for missing scope; `404` if no endpoint uses the URL; `500` on failure.
|
|
4143
|
+
* @example
|
|
4144
|
+
* ```ts
|
|
4145
|
+
* await client.webhooks.deleteEndpointByUrl('https://example.com/webhooks/assinafy');
|
|
4146
|
+
* ```
|
|
4147
|
+
*/
|
|
4148
|
+
deleteEndpointByUrl(url: string, accountId?: string): Promise<void>;
|
|
3906
4149
|
/**
|
|
3907
4150
|
* Return the secret that signs deliveries to an endpoint
|
|
3908
4151
|
* (`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret`).
|
|
@@ -3979,6 +4222,8 @@ declare class TemplateResource extends BaseResource {
|
|
|
3979
4222
|
*
|
|
3980
4223
|
* @param source - The PDF to upload, as a file path or an in-memory buffer.
|
|
3981
4224
|
* @param options - `name` (display name) and an optional `accountId` override.
|
|
4225
|
+
* @param options.name - Multipart filename override, with a `.pdf` extension.
|
|
4226
|
+
* @param options.accountId - Override the client's default workspace.
|
|
3982
4227
|
* @returns The created template (envelope unwrapped). Response shape:
|
|
3983
4228
|
* ```jsonc
|
|
3984
4229
|
* {
|
|
@@ -4122,7 +4367,7 @@ declare class TemplateResource extends BaseResource {
|
|
|
4122
4367
|
* @example
|
|
4123
4368
|
* ```ts
|
|
4124
4369
|
* const tmpl = await client.templates.get('103ad2171db7979468c3e97eb067');
|
|
4125
|
-
* if (tmpl.status === 'Ready') console.log(tmpl.pages
|
|
4370
|
+
* if (tmpl.status === 'Ready') console.log(tmpl.pages?.length ?? 0);
|
|
4126
4371
|
* ```
|
|
4127
4372
|
*/
|
|
4128
4373
|
get(templateId: string, accountId?: string): Promise<ITemplateDetailsResponse>;
|
|
@@ -4247,6 +4492,7 @@ declare class TagResource extends BaseResource {
|
|
|
4247
4492
|
*
|
|
4248
4493
|
* @param params - Optional filters. `search` matches tag names
|
|
4249
4494
|
* case-insensitively (substring).
|
|
4495
|
+
* @param params.search - Optional case-insensitive tag-name substring.
|
|
4250
4496
|
* @param accountId - Override the client's default account ID.
|
|
4251
4497
|
* @returns The matching tags (list items carry no `resource` field):
|
|
4252
4498
|
* ```jsonc
|
|
@@ -4380,6 +4626,8 @@ declare class TagResource extends BaseResource {
|
|
|
4380
4626
|
* @param tagId - The tag to delete.
|
|
4381
4627
|
* @param options - `force` to detach-and-delete when the tag is still in
|
|
4382
4628
|
* use, and `accountId` to override the client's default account ID.
|
|
4629
|
+
* @param options.force - Detach the tag from documents before deletion.
|
|
4630
|
+
* @param options.accountId - Override the client's default workspace.
|
|
4383
4631
|
* @returns `{ deleted: true }` when the tag was deleted.
|
|
4384
4632
|
* @throws {ValidationError} If `tagId` is missing, or no account ID is available.
|
|
4385
4633
|
* @throws {ApiError} `404` if the tag does not exist; `409` if the tag is
|
|
@@ -5595,6 +5843,8 @@ declare class FieldsResource extends BaseResource {
|
|
|
5595
5843
|
* @param value - The value to check (validated against the field's
|
|
5596
5844
|
* type/regex). Sent as `{ value }` in the request body.
|
|
5597
5845
|
* @param options - Account override and optional legacy `signerAccessCode`.
|
|
5846
|
+
* @param options.accountId - Override the client's default workspace.
|
|
5847
|
+
* @param options.signerAccessCode - Legacy signer code sent as a query parameter.
|
|
5598
5848
|
* @returns The validation result. Response shape:
|
|
5599
5849
|
* ```jsonc
|
|
5600
5850
|
* {
|
|
@@ -5641,6 +5891,8 @@ declare class FieldsResource extends BaseResource {
|
|
|
5641
5891
|
*
|
|
5642
5892
|
* @param entries - Non-empty array of `{ field_id, value }` pairs.
|
|
5643
5893
|
* @param options - Account override and optional legacy `signerAccessCode`.
|
|
5894
|
+
* @param options.accountId - Override the client's default workspace.
|
|
5895
|
+
* @param options.signerAccessCode - Legacy signer code sent as a query parameter.
|
|
5644
5896
|
* @returns One validation result per entry. Response shape:
|
|
5645
5897
|
* ```jsonc
|
|
5646
5898
|
* [
|
|
@@ -6032,7 +6284,8 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6032
6284
|
* "has_accepted_terms": false,
|
|
6033
6285
|
* "has_signature": false,
|
|
6034
6286
|
* "has_initial": false,
|
|
6035
|
-
* "is_signature_reusable": false
|
|
6287
|
+
* "is_signature_reusable": false,
|
|
6288
|
+
* "verification_method": "IdDocumentFaceMatchBasic"
|
|
6036
6289
|
* }
|
|
6037
6290
|
* ```
|
|
6038
6291
|
* @throws {ValidationError} If `signerAccessCode` is missing.
|
|
@@ -6047,6 +6300,74 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6047
6300
|
* ```
|
|
6048
6301
|
*/
|
|
6049
6302
|
self(signerAccessCode: string): Promise<ISignerSelf>;
|
|
6303
|
+
/**
|
|
6304
|
+
* Read the signer's identity verification state
|
|
6305
|
+
* (`GET /signers/identity-verification?signer-access-code=…`).
|
|
6306
|
+
*
|
|
6307
|
+
* No request body or workspace credentials. Reads a pending provider
|
|
6308
|
+
* decision when available. A new session can start before the first capture
|
|
6309
|
+
* or after `Expired`; `Declined` and `Abandoned` require a new document and
|
|
6310
|
+
* assignment. `InReview` lets the signer continue; account approval gates
|
|
6311
|
+
* certification, with `pending_identity_review` after everyone signs.
|
|
6312
|
+
*
|
|
6313
|
+
* @param signerAccessCode - Access code from the signer's signing link.
|
|
6314
|
+
* @returns Provider state, with nullable fields before a session exists:
|
|
6315
|
+
* ```jsonc
|
|
6316
|
+
* {
|
|
6317
|
+
* "can_start": false, "status": "Pending",
|
|
6318
|
+
* "url": "https://verify.example.com/c/session#t=opaque",
|
|
6319
|
+
* "expires_at": "2026-10-16T12:30:00Z", "completed_at": null
|
|
6320
|
+
* }
|
|
6321
|
+
* ```
|
|
6322
|
+
* `url` exists only while Pending. It is a bearer link: open it intact,
|
|
6323
|
+
* including its fragment, and keep it out of logs and browser storage.
|
|
6324
|
+
* @throws {ValidationError} If the access code is blank.
|
|
6325
|
+
* @throws {ApiError} `401` for an invalid/expired code; `500` for a server failure.
|
|
6326
|
+
* @example
|
|
6327
|
+
* ```ts
|
|
6328
|
+
* const state = await client.signerDocuments.getIdentityVerification(accessCode);
|
|
6329
|
+
* console.log(state.status, state.can_start);
|
|
6330
|
+
* ```
|
|
6331
|
+
*/
|
|
6332
|
+
getIdentityVerification(signerAccessCode: string): Promise<ISignerIdentityVerification>;
|
|
6333
|
+
/**
|
|
6334
|
+
* Record biometric consent and open an identity verification session
|
|
6335
|
+
* (`POST /signers/identity-verification?signer-access-code=…`).
|
|
6336
|
+
*
|
|
6337
|
+
* Send only after the signer explicitly consents. Starts a session when
|
|
6338
|
+
* none exists or replaces an Expired session. Other states return `400`;
|
|
6339
|
+
* resending a notification never replaces a live session. The account is
|
|
6340
|
+
* billed at assignment creation, with no new charge for a restart.
|
|
6341
|
+
*
|
|
6342
|
+
* Request body (`application/json`):
|
|
6343
|
+
* ```jsonc
|
|
6344
|
+
* { "consent": true }
|
|
6345
|
+
* ```
|
|
6346
|
+
* @param signerAccessCode - Access code from the signer's signing link.
|
|
6347
|
+
* @param payload - Explicit consent from the signer.
|
|
6348
|
+
* @param payload.consent - Must be `true`; never default or infer consent.
|
|
6349
|
+
* @returns The newly opened provider session:
|
|
6350
|
+
* ```jsonc
|
|
6351
|
+
* {
|
|
6352
|
+
* "id": "verification_example",
|
|
6353
|
+
* "url": "https://verify.example.com/c/session#t=opaque",
|
|
6354
|
+
* "expires_at": "2026-10-16T12:30:00Z"
|
|
6355
|
+
* }
|
|
6356
|
+
* ```
|
|
6357
|
+
* `expires_at` can be null. Open the URL as-is; it is a bearer credential
|
|
6358
|
+
* and its fragment must survive navigation. Do not log or persist it in
|
|
6359
|
+
* browser storage. No workspace credential is attached to this call.
|
|
6360
|
+
* @throws {ValidationError} If the code is blank or consent is not `true`.
|
|
6361
|
+
* @throws {ApiError} `400` when a non-expired session already exists;
|
|
6362
|
+
* `401` for an invalid/expired code; `500` for a provider/server failure.
|
|
6363
|
+
* @example
|
|
6364
|
+
* ```ts
|
|
6365
|
+
* // Inside the handler for the signer's explicit consent action:
|
|
6366
|
+
* const session = await client.signerDocuments.startIdentityVerification(accessCode, { consent: true });
|
|
6367
|
+
* response.redirect(session.url);
|
|
6368
|
+
* ```
|
|
6369
|
+
*/
|
|
6370
|
+
startIdentityVerification(signerAccessCode: string, payload: IStartIdentityVerificationPayload): Promise<ISignerIdentityVerificationSession>;
|
|
6050
6371
|
/**
|
|
6051
6372
|
* Accept the platform terms of use as the signer
|
|
6052
6373
|
* (`PUT /signers/accept-terms?signer-access-code=…`).
|
|
@@ -6072,10 +6393,10 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6072
6393
|
*/
|
|
6073
6394
|
acceptTerms(signerAccessCode: string): Promise<void>;
|
|
6074
6395
|
/**
|
|
6075
|
-
* Verify the signer's email one-time password
|
|
6396
|
+
* Verify the signer's email or WhatsApp one-time password
|
|
6076
6397
|
* (`POST /verify?signer-access-code=…`).
|
|
6077
6398
|
*
|
|
6078
|
-
* Confirms the 6-digit OTP
|
|
6399
|
+
* Confirms the 6-digit OTP sent through the selected channel. The access code
|
|
6079
6400
|
* authenticates via the `signer-access-code` **query param**; the request
|
|
6080
6401
|
* **body carries only `verification-code`** (putting the access code in the
|
|
6081
6402
|
* body leaves the request unauthenticated → `401`).
|
|
@@ -6089,6 +6410,8 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6089
6410
|
*
|
|
6090
6411
|
* @param payload - `signerAccessCode` (the signing-link code) and
|
|
6091
6412
|
* `verificationCode` (the OTP the signer received).
|
|
6413
|
+
* @param payload.signerAccessCode - Signing-link code sent only in the query.
|
|
6414
|
+
* @param payload.verificationCode - Email or WhatsApp OTP sent as `verification-code`.
|
|
6092
6415
|
* @returns Resolves when the API acknowledges the operation. The response
|
|
6093
6416
|
* envelope has no `data` field and is intentionally discarded.
|
|
6094
6417
|
* @throws {ValidationError} If `signerAccessCode` or `verificationCode` is
|
|
@@ -6197,6 +6520,8 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6197
6520
|
* @param image - The image bytes as a non-empty `Buffer`.
|
|
6198
6521
|
* @param options - `imageType` (`'signature'` default, or `'initial'`) and
|
|
6199
6522
|
* `reuse` (persist for reuse). The official request content type is PNG.
|
|
6523
|
+
* @param options.imageType - Signature image category; defaults to `signature`.
|
|
6524
|
+
* @param options.reuse - Persist the image for future signing requests.
|
|
6200
6525
|
* @returns Resolves when the API acknowledges the upload. The response
|
|
6201
6526
|
* envelope has no `data` field and is intentionally discarded.
|
|
6202
6527
|
* @throws {ValidationError} If `signerAccessCode` is missing or `image` is not
|
|
@@ -6222,6 +6547,9 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6222
6547
|
* @param signerAccessCode - Access code sent in the query string.
|
|
6223
6548
|
* @param image - Non-empty raw image bytes, without a JSON envelope.
|
|
6224
6549
|
* @param options - Image type, reuse preference and compatibility content type.
|
|
6550
|
+
* @param options.imageType - Signature image category; defaults to `signature`.
|
|
6551
|
+
* @param options.reuse - Persist the image for future signing requests.
|
|
6552
|
+
* @param options.contentType - Compatibility media type; the official type is `image/png`.
|
|
6225
6553
|
* @returns Nothing; the acknowledgement body is discarded.
|
|
6226
6554
|
* @throws {ValidationError} If the code, image or options are invalid.
|
|
6227
6555
|
* @throws {ApiError} If the API rejects the upload.
|
|
@@ -6305,7 +6633,7 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6305
6633
|
* "expires_at": null,
|
|
6306
6634
|
* "signers": [
|
|
6307
6635
|
* { "id": "19e6b92e7895332ed9708535d8c", "step": 1, "email": "signer@example.com",
|
|
6308
|
-
* "full_name": "Example Signer", "notified": true
|
|
6636
|
+
* "full_name": "Example Signer", "notified": true }
|
|
6309
6637
|
* ],
|
|
6310
6638
|
* "items": [
|
|
6311
6639
|
* { "id": "item-1", "page": { "id": "page-1", "number": 1, "height": 1651, "width": 1275,
|
|
@@ -6756,7 +7084,8 @@ declare class WebhookVerifier {
|
|
|
6756
7084
|
* @param toleranceSeconds - Accepted clock distance. Defaults to `300`.
|
|
6757
7085
|
* @returns `true` only when a signature entry matches (constant-time) and
|
|
6758
7086
|
* the timestamp is fresh; `false` when verification is disabled, a header
|
|
6759
|
-
* is missing,
|
|
7087
|
+
* is missing, the tolerance is not finite and non-negative, or anything
|
|
7088
|
+
* does not match.
|
|
6760
7089
|
*
|
|
6761
7090
|
* @example
|
|
6762
7091
|
* ```ts
|
|
@@ -7363,4 +7692,4 @@ declare const MAX_LIST_PAGE_SIZE = 50;
|
|
|
7363
7692
|
|
|
7364
7693
|
declare const SDK_USER_AGENT: string;
|
|
7365
7694
|
|
|
7366
|
-
export { type AccountLogoUploadSource, type AnyString, ApiError, type AssignmentDisplaySettings, type AssignmentMethod, type AssignmentNotificationMethod, AssignmentResource, type AssignmentVerificationMethod, AssinafyClient, type AssinafyClientOptions, AssinafyError, AuthenticationResource, type ClientConfigInput, DEFAULT_WEBHOOK_EVENTS, type DocumentArtifactName, DocumentResource, type DocumentStatsGranularity, type DocumentStatus, type DocumentUploadSource, FieldsResource, type IAccountTheme, type IApiKeyResponse, type IAssignment, type IAssignmentCostSigner, type IAssignmentEntry, type IAssignmentItem, type IAssignmentListParams, type IAssignmentListResponse, type IAssignmentSigner, type IAuthenticateChallenge, type IAuthenticatedUser, type IConfirmSignerDataPayload, type IConfirmTotpPayload, type ICostEstimate, type ICreateAssignmentPayload, type ICreateAssignmentResponse, type ICreateDocumentFromTemplateOptions, type ICreateFieldPayload, type ICreateSignerPayload, type ICreateSignerResponse, type ICreateTagPayload, type ICreateWorkspacePayload, type IDeleteTagResponse, type IDetachDocumentTagResponse, type IDisplaySettings, type IDocumentActivity, type IDocumentDetailsResponse, type IDocumentListItem, type IDocumentListParams, type IDocumentListResponse, type IDocumentSearchParams, type IDocumentStatsParams, type IDocumentStatsRow, type IDocumentStatusInfo, type IDocumentUploadOptions, type IDocumentUploadResponse, type IDocumentVerification, type IEstimateAssignmentCostPayload, type IFieldDefinition, type IFieldType, type IFieldValidateMultipleEntry, type IFieldValidationMultipleResult, type IFieldValidationResponse, type IFieldValidationResult, type IInlineTag, type ILegacyConfirmSignerDataPayload, type ILegacyResendCostEstimate, type ILegacyUploadSignatureOptions, type IListParams, type ILoginResponse, type IMaskedApiKeyResponse, type IMfaMethod, type IMfaReauth, type IMfaRecoveryCodes, type IMfaStatus, type INotificationHistoryEntry, type INotificationPreferences, type IOAuthAuthorizationCallback, type IOAuthAuthorizationRequest, type IOAuthAuthorizationServerMetadata, type IOAuthProtectedResourceMetadata, type IOAuthTokenResponse, type IOAuthUserInfo, type IPage, type IPaginatedResponse, type IPublicDocumentInfo, type IRateLimitInfo, type IRenameDocumentResponse, type IResendCostEstimate, type IResendEmailResponse, type ISendTokenResult, type ISignFieldEntry, type ISigner, type ISignerListParams, type ISignerListResponse, type ISignerSelf, type ISigningProgress, type ITag, type ITemplateCostSigner, type ITemplateDetailsResponse, type ITemplateFieldPlacement, type ITemplateListItem, type ITemplateListParams, type ITemplateListResponse, type ITemplateRole, type ITemplateSigner, type ITotpEnrollment, type IUpdateFieldPayload, type IUpdateNotificationPreferences, type IUpdateSignerPayload, type IUpdateTagPayload, type IUpdateTemplatePayload, type IUpdateWorkspacePayload, type IUploadAndRequestSignaturesResult, type IUploadAndRequestSignaturesSigner, type IUploadSignatureOptions, type IWebhookDispatch, type IWebhookDispatchListParams, type IWebhookEndpoint, type IWebhookEndpointCreatePayload, type IWebhookEndpointSecret, type IWebhookEndpointUpdatePayload, type IWebhookEventTypeInfo, type IWebhookPayload, type IWebhookRegisterPayload, type IWebhookSubscription, type IWhatsAppNotification, type IWorkspaceListItem, type IWorkspaceListResponse, type IWorkspaceResponse, type Logger, MAX_LIST_PAGE_SIZE, MAX_UPLOAD_BYTES, NetworkError, type NotificationSenderType, OAuthError, OAuthResource, type OAuthScope, type PaginatedResult, type PaginationMeta, SDK_USER_AGENT, type SendTokenChannel, type SignatureImageType, SignerDocumentsResource, type SignerReference, SignerResource, TagResource, TemplateResource, UserResource, ValidationError, type WebhookEventType, type WebhookHeaders, WebhookResource, WebhookVerifier, WorkspaceResource, buildAssignmentPayload, parseWwwAuthenticate };
|
|
7695
|
+
export { type AccountLogoUploadSource, type AnyString, ApiError, type AssignmentDisplaySettings, type AssignmentMethod, type AssignmentNotificationMethod, AssignmentResource, type AssignmentVerificationMethod, AssinafyClient, type AssinafyClientOptions, AssinafyError, AuthenticationResource, type ClientConfigInput, DEFAULT_WEBHOOK_EVENTS, type DocumentArtifactName, DocumentResource, type DocumentStatsGranularity, type DocumentStatus, type DocumentUploadSource, FieldsResource, type IAccountTheme, type IApiKeyResponse, type IAssignment, type IAssignmentCostSigner, type IAssignmentEntry, type IAssignmentItem, type IAssignmentListParams, type IAssignmentListResponse, type IAssignmentSigner, type IAuthenticateChallenge, type IAuthenticatedUser, type IConfirmSignerDataPayload, type IConfirmTotpPayload, type ICostEstimate, type ICreateAssignmentPayload, type ICreateAssignmentResponse, type ICreateDocumentFromTemplateOptions, type ICreateFieldPayload, type ICreateSignerPayload, type ICreateSignerResponse, type ICreateTagPayload, type ICreateWorkspacePayload, type IDeleteTagResponse, type IDetachDocumentTagResponse, type IDisplaySettings, type IDocumentActivity, type IDocumentDetailsResponse, type IDocumentListItem, type IDocumentListParams, type IDocumentListResponse, type IDocumentSearchParams, type IDocumentStatsParams, type IDocumentStatsRow, type IDocumentStatusInfo, type IDocumentUploadOptions, type IDocumentUploadResponse, type IDocumentVerification, type IEstimateAssignmentCostPayload, type IFieldDefinition, type IFieldType, type IFieldValidateMultipleEntry, type IFieldValidationMultipleResult, type IFieldValidationResponse, type IFieldValidationResult, type IInlineTag, type ILegacyConfirmSignerDataPayload, type ILegacyResendCostEstimate, type ILegacyUploadSignatureOptions, type IListParams, type ILoginResponse, type IMaskedApiKeyResponse, type IMfaMethod, type IMfaReauth, type IMfaRecoveryCodes, type IMfaStatus, type INotificationHistoryEntry, type INotificationPreferences, type IOAuthAuthorizationCallback, type IOAuthAuthorizationRequest, type IOAuthAuthorizationServerMetadata, type IOAuthProtectedResourceMetadata, type IOAuthTokenResponse, type IOAuthUserInfo, type IPage, type IPaginatedResponse, type IPublicDocumentInfo, type IRateLimitInfo, type IRenameDocumentResponse, type IResendCostEstimate, type IResendEmailResponse, type IReviewIdentityVerificationPayload, type ISendTokenResult, type ISignFieldEntry, type ISigner, type ISignerIdentityReview, type ISignerIdentityVerification, type ISignerIdentityVerificationSession, type ISignerListParams, type ISignerListResponse, type ISignerSelf, type ISigningProgress, type IStartIdentityVerificationPayload, type ITag, type ITemplateCostSigner, type ITemplateDetailsResponse, type ITemplateFieldPlacement, type ITemplateListItem, type ITemplateListParams, type ITemplateListResponse, type ITemplateRole, type ITemplateSigner, type ITotpEnrollment, type IUpdateFieldPayload, type IUpdateNotificationPreferences, type IUpdateSignerPayload, type IUpdateTagPayload, type IUpdateTemplatePayload, type IUpdateWorkspacePayload, type IUploadAndRequestSignaturesResult, type IUploadAndRequestSignaturesSigner, type IUploadSignatureOptions, type IWebhookDispatch, type IWebhookDispatchListParams, type IWebhookEndpoint, type IWebhookEndpointCreatePayload, type IWebhookEndpointCreateResponse, type IWebhookEndpointSecret, type IWebhookEndpointUpdatePayload, type IWebhookEventTypeInfo, type IWebhookPayload, type IWebhookRegisterPayload, type IWebhookSubscription, type IWhatsAppNotification, type IWorkspaceListItem, type IWorkspaceListResponse, type IWorkspaceResponse, type IdentityVerificationImageName, type IdentityVerificationStatus, type Logger, MAX_LIST_PAGE_SIZE, MAX_UPLOAD_BYTES, NetworkError, type NotificationSenderType, OAuthError, OAuthResource, type OAuthScope, type PaginatedResult, type PaginationMeta, SDK_USER_AGENT, type SendTokenChannel, type SignatureImageType, SignerDocumentsResource, type SignerReference, SignerResource, TagResource, TemplateResource, UserResource, ValidationError, type WebhookEventType, type WebhookHeaders, WebhookResource, WebhookVerifier, WorkspaceResource, buildAssignmentPayload, parseWwwAuthenticate };
|