@assinafy/sdk 2.5.1 → 2.5.2
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 +26 -45
- package/README.en.md +28 -27
- package/README.md +25 -25
- package/dist/index.d.mts +447 -18
- package/dist/index.d.ts +447 -18
- package/dist/index.js +402 -22
- package/dist/index.mjs +398 -18
- package/docs/API_COVERAGE.md +1 -1
- package/docs/COMPATIBILITY.md +15 -21
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1529,6 +1529,13 @@ declare class DocumentResource extends BaseResource {
|
|
|
1529
1529
|
* {@link DocumentResource.upload} — that avoids the extra round-trip and
|
|
1530
1530
|
* the processing race entirely.
|
|
1531
1531
|
*
|
|
1532
|
+
* Request body (`application/json`):
|
|
1533
|
+
* ```jsonc
|
|
1534
|
+
* {
|
|
1535
|
+
* "name": "Service agreement.pdf"
|
|
1536
|
+
* }
|
|
1537
|
+
* ```
|
|
1538
|
+
*
|
|
1532
1539
|
* @param documentId - The document to rename.
|
|
1533
1540
|
* @param name - The new display name (max 255 chars), e.g.
|
|
1534
1541
|
* `'Service agreement.pdf'`. The API removes diacritics and replaces
|
|
@@ -1826,6 +1833,15 @@ declare class DocumentResource extends BaseResource {
|
|
|
1826
1833
|
* overwrites the existing set — use
|
|
1827
1834
|
* {@link DocumentResource.addTags} to append.
|
|
1828
1835
|
*
|
|
1836
|
+
* Request body (`application/json`):
|
|
1837
|
+
* ```jsonc
|
|
1838
|
+
* {
|
|
1839
|
+
* "tags": [
|
|
1840
|
+
* "tag_example"
|
|
1841
|
+
* ]
|
|
1842
|
+
* }
|
|
1843
|
+
* ```
|
|
1844
|
+
*
|
|
1829
1845
|
* @param documentId - The document to retag.
|
|
1830
1846
|
* @param tags - The complete desired set of tag IDs (`[]` clears all).
|
|
1831
1847
|
* @param accountId - Override the client's default account ID.
|
|
@@ -1855,6 +1871,15 @@ declare class DocumentResource extends BaseResource {
|
|
|
1855
1871
|
* present is a no-op. To replace the whole set instead, use
|
|
1856
1872
|
* {@link DocumentResource.replaceTags}.
|
|
1857
1873
|
*
|
|
1874
|
+
* Request body (`application/json`):
|
|
1875
|
+
* ```jsonc
|
|
1876
|
+
* {
|
|
1877
|
+
* "tags": [
|
|
1878
|
+
* "tag_example"
|
|
1879
|
+
* ]
|
|
1880
|
+
* }
|
|
1881
|
+
* ```
|
|
1882
|
+
*
|
|
1858
1883
|
* @param documentId - The document to tag.
|
|
1859
1884
|
* @param tags - Tag IDs to attach (must be non-empty).
|
|
1860
1885
|
* @param accountId - Override the client's default account ID.
|
|
@@ -1907,6 +1932,35 @@ declare class DocumentResource extends BaseResource {
|
|
|
1907
1932
|
* `options` may add `name`, `message`, `expires_at`, `editor_fields`, and
|
|
1908
1933
|
* tag names in `tags` (unknown names are created automatically).
|
|
1909
1934
|
*
|
|
1935
|
+
* Request body (`application/json`):
|
|
1936
|
+
* ```jsonc
|
|
1937
|
+
* {
|
|
1938
|
+
* "signers": [
|
|
1939
|
+
* {
|
|
1940
|
+
* "role_id": "signing_role_example",
|
|
1941
|
+
* "id": "signer_example",
|
|
1942
|
+
* "verification_method": "Email",
|
|
1943
|
+
* "notification_methods": [
|
|
1944
|
+
* "Email"
|
|
1945
|
+
* ],
|
|
1946
|
+
* "step": 1
|
|
1947
|
+
* }
|
|
1948
|
+
* ],
|
|
1949
|
+
* "name": "Service agreement.pdf",
|
|
1950
|
+
* "message": "Please sign this document.",
|
|
1951
|
+
* "expires_at": "2027-12-31T23:59:59Z",
|
|
1952
|
+
* "editor_fields": [
|
|
1953
|
+
* {
|
|
1954
|
+
* "field_id": "editor_field_example",
|
|
1955
|
+
* "value": "Example Company"
|
|
1956
|
+
* }
|
|
1957
|
+
* ],
|
|
1958
|
+
* "tags": [
|
|
1959
|
+
* "Contracts"
|
|
1960
|
+
* ]
|
|
1961
|
+
* }
|
|
1962
|
+
* ```
|
|
1963
|
+
*
|
|
1910
1964
|
* @param templateId - The template to instantiate.
|
|
1911
1965
|
* @param signers - Role-to-signer bindings (each with `role_id` and `id`,
|
|
1912
1966
|
* plus optional `verification_method`, `notification_methods`, `step`).
|
|
@@ -1959,6 +2013,21 @@ declare class DocumentResource extends BaseResource {
|
|
|
1959
2013
|
* `DigitalCertificate` adds two credits per signer and has the same feature,
|
|
1960
2014
|
* `government_id`, and signing-step prerequisites as document creation.
|
|
1961
2015
|
*
|
|
2016
|
+
* Request body (`application/json`):
|
|
2017
|
+
* ```jsonc
|
|
2018
|
+
* {
|
|
2019
|
+
* "signers": [
|
|
2020
|
+
* {
|
|
2021
|
+
* "role_id": "signing_role_example",
|
|
2022
|
+
* "verification_method": "Email",
|
|
2023
|
+
* "notification_methods": [
|
|
2024
|
+
* "Email"
|
|
2025
|
+
* ]
|
|
2026
|
+
* }
|
|
2027
|
+
* ]
|
|
2028
|
+
* }
|
|
2029
|
+
* ```
|
|
2030
|
+
*
|
|
1962
2031
|
* @param templateId - The template that would be instantiated.
|
|
1963
2032
|
* @param signers - One channel descriptor per template role. Cost requests
|
|
1964
2033
|
* use only `role_id`, `verification_method`, and `notification_methods`;
|
|
@@ -2115,6 +2184,15 @@ declare class DocumentResource extends BaseResource {
|
|
|
2115
2184
|
* that legacy shape only when the server explicitly reports that
|
|
2116
2185
|
* `channel`/`recipient` is required.
|
|
2117
2186
|
*
|
|
2187
|
+
* Request body (`application/json`):
|
|
2188
|
+
* ```jsonc
|
|
2189
|
+
* { "email": "signer@example.com" }
|
|
2190
|
+
* ```
|
|
2191
|
+
* Compatibility fallback or explicit-channel body:
|
|
2192
|
+
* ```jsonc
|
|
2193
|
+
* { "recipient": "signer@example.com", "channel": "email" }
|
|
2194
|
+
* ```
|
|
2195
|
+
*
|
|
2118
2196
|
* @param documentId - The document to send the token for.
|
|
2119
2197
|
* @param recipient - The signer's email address (or WhatsApp number when an
|
|
2120
2198
|
* explicit channel is supplied).
|
|
@@ -2132,6 +2210,21 @@ declare class DocumentResource extends BaseResource {
|
|
|
2132
2210
|
* ```
|
|
2133
2211
|
*/
|
|
2134
2212
|
sendToken(documentId: string, email: string): Promise<void>;
|
|
2213
|
+
/**
|
|
2214
|
+
* Send a signing token through an explicit channel
|
|
2215
|
+
* (`PUT /public/documents/{documentId}/send-token`).
|
|
2216
|
+
* Sends JSON `{ "recipient": "+5511999998888", "channel": "whatsapp" }`.
|
|
2217
|
+
* @param documentId - Document identifier.
|
|
2218
|
+
* @param recipient - Controlled email address or WhatsApp number.
|
|
2219
|
+
* @param channel - Delivery channel, `email` or `whatsapp`.
|
|
2220
|
+
* @returns Nothing; the acknowledgement body is discarded.
|
|
2221
|
+
* @throws {ValidationError} If an argument is empty.
|
|
2222
|
+
* @throws {ApiError} If delivery is rejected.
|
|
2223
|
+
* @example
|
|
2224
|
+
* ```ts
|
|
2225
|
+
* await client.documents.sendToken('doc-1', 'signer@example.com', 'email');
|
|
2226
|
+
* ```
|
|
2227
|
+
*/
|
|
2135
2228
|
sendToken(documentId: string, recipient: string, channel: SendTokenChannel): Promise<void>;
|
|
2136
2229
|
/**
|
|
2137
2230
|
* Quick boolean check (`GET /documents/{documentId}`): has every signer
|
|
@@ -2197,6 +2290,19 @@ declare class SignerResource extends BaseResource {
|
|
|
2197
2290
|
* A reused signer is returned unchanged; this method does not overwrite its
|
|
2198
2291
|
* existing name, phone, CPF, or metadata with the create payload.
|
|
2199
2292
|
*
|
|
2293
|
+
* Request body (`application/json`):
|
|
2294
|
+
* ```jsonc
|
|
2295
|
+
* {
|
|
2296
|
+
* "full_name": "Example Signer",
|
|
2297
|
+
* "email": "signer@example.com",
|
|
2298
|
+
* "whatsapp_phone_number": "+5548999990000",
|
|
2299
|
+
* "cpf": "39053344705",
|
|
2300
|
+
* "metadata": {
|
|
2301
|
+
* "reference": "customer_example"
|
|
2302
|
+
* }
|
|
2303
|
+
* }
|
|
2304
|
+
* ```
|
|
2305
|
+
*
|
|
2200
2306
|
* @param payload - The signer to create. The official fields are required
|
|
2201
2307
|
* `full_name` plus optional `email` and E.164 `whatsapp_phone_number`.
|
|
2202
2308
|
* `phone`, `cpf`, and `metadata` are compatibility extensions; the SDK
|
|
@@ -2299,6 +2405,16 @@ declare class SignerResource extends BaseResource {
|
|
|
2299
2405
|
* while it belongs to an in-flight document; changing an unverified channel
|
|
2300
2406
|
* rotates its access/verification codes, so resend the notification.
|
|
2301
2407
|
*
|
|
2408
|
+
* Request body (`application/json`):
|
|
2409
|
+
* ```jsonc
|
|
2410
|
+
* {
|
|
2411
|
+
* "full_name": "Example Signer",
|
|
2412
|
+
* "email": "signer@example.com",
|
|
2413
|
+
* "whatsapp_phone_number": "+5548999990000",
|
|
2414
|
+
* "government_id": "39053344705"
|
|
2415
|
+
* }
|
|
2416
|
+
* ```
|
|
2417
|
+
*
|
|
2302
2418
|
* @param signerId - The signer to update.
|
|
2303
2419
|
* @param payload - Fields to change. The official `government_id` field and
|
|
2304
2420
|
* legacy `cpf` extension are stripped to digits before sending.
|
|
@@ -2414,6 +2530,16 @@ declare class WorkspaceResource extends BaseResource {
|
|
|
2414
2530
|
/**
|
|
2415
2531
|
* Create a new workspace (`POST /accounts`).
|
|
2416
2532
|
*
|
|
2533
|
+
* Request body (`application/json`):
|
|
2534
|
+
* ```jsonc
|
|
2535
|
+
* {
|
|
2536
|
+
* "name": "Example Workspace",
|
|
2537
|
+
* "notification_sender_type": "Account",
|
|
2538
|
+
* "primary_color": "336699",
|
|
2539
|
+
* "secondary_color": "ffffff"
|
|
2540
|
+
* }
|
|
2541
|
+
* ```
|
|
2542
|
+
*
|
|
2417
2543
|
* @param payload - Official fields are workspace `name` (required) and
|
|
2418
2544
|
* optional `notification_sender_type` (`User` or `Account`). Optional brand
|
|
2419
2545
|
* colours use six hex characters without
|
|
@@ -2630,6 +2756,16 @@ declare class WorkspaceResource extends BaseResource {
|
|
|
2630
2756
|
/**
|
|
2631
2757
|
* Update a workspace (`PUT /accounts/{accountId}`).
|
|
2632
2758
|
*
|
|
2759
|
+
* Request body (`application/json`):
|
|
2760
|
+
* ```jsonc
|
|
2761
|
+
* {
|
|
2762
|
+
* "name": "Example Workspace",
|
|
2763
|
+
* "notification_sender_type": "Account",
|
|
2764
|
+
* "primary_color": "336699",
|
|
2765
|
+
* "secondary_color": null
|
|
2766
|
+
* }
|
|
2767
|
+
* ```
|
|
2768
|
+
*
|
|
2633
2769
|
* @param accountId - The workspace to update.
|
|
2634
2770
|
* @param payload - Official fields are `name` and
|
|
2635
2771
|
* `notification_sender_type` (`User` or `Account`). Brand colours use six
|
|
@@ -2672,6 +2808,13 @@ declare class WorkspaceResource extends BaseResource {
|
|
|
2672
2808
|
* proceeds with deletion; it is not documented as a blanket override for
|
|
2673
2809
|
* unrelated restrictions. The flag is sent in the request body.
|
|
2674
2810
|
*
|
|
2811
|
+
* Request body (`application/json`):
|
|
2812
|
+
* ```jsonc
|
|
2813
|
+
* {
|
|
2814
|
+
* "force": true
|
|
2815
|
+
* }
|
|
2816
|
+
* ```
|
|
2817
|
+
*
|
|
2675
2818
|
* @param accountId - The workspace to delete.
|
|
2676
2819
|
* @param options - Set `force: true` to cancel an active paid subscription
|
|
2677
2820
|
* and proceed with deletion.
|
|
@@ -2819,6 +2962,28 @@ declare class AssignmentResource extends BaseResource {
|
|
|
2819
2962
|
* `DigitalCertificate` costs two credits, requires the feature plus a
|
|
2820
2963
|
* signer `government_id`, and that signer must be alone in its step.
|
|
2821
2964
|
*
|
|
2965
|
+
* Request body (`application/json`):
|
|
2966
|
+
* ```jsonc
|
|
2967
|
+
* {
|
|
2968
|
+
* "method": "virtual",
|
|
2969
|
+
* "signers": [
|
|
2970
|
+
* {
|
|
2971
|
+
* "id": "signer_example",
|
|
2972
|
+
* "verification_method": "Email",
|
|
2973
|
+
* "notification_methods": [
|
|
2974
|
+
* "Email"
|
|
2975
|
+
* ],
|
|
2976
|
+
* "step": 1
|
|
2977
|
+
* }
|
|
2978
|
+
* ],
|
|
2979
|
+
* "message": "Please sign this document.",
|
|
2980
|
+
* "expires_at": "2027-12-31T23:59:59Z",
|
|
2981
|
+
* "copy_receivers": [
|
|
2982
|
+
* "copy_signer_example"
|
|
2983
|
+
* ]
|
|
2984
|
+
* }
|
|
2985
|
+
* ```
|
|
2986
|
+
*
|
|
2822
2987
|
* @param documentId - The document to request signatures on.
|
|
2823
2988
|
* @param payload - Signers plus optional `method` (defaults to `virtual`),
|
|
2824
2989
|
* `message`, `expires_at`, `copy_receivers` (existing signer IDs, not
|
|
@@ -2922,6 +3087,21 @@ declare class AssignmentResource extends BaseResource {
|
|
|
2922
3087
|
* email notification, and 0.45 for WhatsApp notification; a digital
|
|
2923
3088
|
* certificate charge is added on top of its notification cost.
|
|
2924
3089
|
*
|
|
3090
|
+
* Request body (`application/json`):
|
|
3091
|
+
* ```jsonc
|
|
3092
|
+
* {
|
|
3093
|
+
* "method": "virtual",
|
|
3094
|
+
* "signers": [
|
|
3095
|
+
* {
|
|
3096
|
+
* "verification_method": "Email",
|
|
3097
|
+
* "notification_methods": [
|
|
3098
|
+
* "Email"
|
|
3099
|
+
* ]
|
|
3100
|
+
* }
|
|
3101
|
+
* ]
|
|
3102
|
+
* }
|
|
3103
|
+
* ```
|
|
3104
|
+
*
|
|
2925
3105
|
* @param documentId - The document the assignment would be created on.
|
|
2926
3106
|
* @param payload - `method` plus channel-only signer descriptors and/or
|
|
2927
3107
|
* `collect`-mode `entries`. Create-only fields and signer IDs are not part
|
|
@@ -2968,6 +3148,13 @@ declare class AssignmentResource extends BaseResource {
|
|
|
2968
3148
|
* is retained as a compatibility value and, unlike ordinary nullable
|
|
2969
3149
|
* inputs, is intentionally not stripped from the body.
|
|
2970
3150
|
*
|
|
3151
|
+
* Request body (`application/json`):
|
|
3152
|
+
* ```jsonc
|
|
3153
|
+
* {
|
|
3154
|
+
* "expires_at": "2027-12-31T23:59:59Z"
|
|
3155
|
+
* }
|
|
3156
|
+
* ```
|
|
3157
|
+
*
|
|
2971
3158
|
* @param documentId - The document the assignment belongs to.
|
|
2972
3159
|
* @param assignmentId - The assignment to update.
|
|
2973
3160
|
* @param expiresAt - New expiry as an ISO-8601 date/time string. `null` is
|
|
@@ -3138,6 +3325,19 @@ declare class WebhookResource extends BaseResource {
|
|
|
3138
3325
|
* `signer_rejected_document`, `document_processing_failed`).
|
|
3139
3326
|
* OAuth tokens need the `webhooks:write` scope.
|
|
3140
3327
|
*
|
|
3328
|
+
* Request body (`application/json`):
|
|
3329
|
+
* ```jsonc
|
|
3330
|
+
* {
|
|
3331
|
+
* "events": [
|
|
3332
|
+
* "document_ready",
|
|
3333
|
+
* "document_prepared"
|
|
3334
|
+
* ],
|
|
3335
|
+
* "is_active": true,
|
|
3336
|
+
* "url": "https://myapp.example.com/webhooks/assinafy",
|
|
3337
|
+
* "email": "operations@example.com"
|
|
3338
|
+
* }
|
|
3339
|
+
* ```
|
|
3340
|
+
*
|
|
3141
3341
|
* @param payload - Subscription details. `url` and `email` are required;
|
|
3142
3342
|
* `events` defaults to {@link DEFAULT_WEBHOOK_EVENTS} and `is_active`
|
|
3143
3343
|
* defaults to `true`.
|
|
@@ -3557,6 +3757,14 @@ declare class TemplateResource extends BaseResource {
|
|
|
3557
3757
|
* `undefined` keys before sending. Unlike uploads, `name` here is a plain
|
|
3558
3758
|
* display name and is **not** forced to end in `.pdf`.
|
|
3559
3759
|
*
|
|
3760
|
+
* Request body (`application/json`):
|
|
3761
|
+
* ```jsonc
|
|
3762
|
+
* {
|
|
3763
|
+
* "name": "Service agreement.pdf",
|
|
3764
|
+
* "message": "Please sign this document."
|
|
3765
|
+
* }
|
|
3766
|
+
* ```
|
|
3767
|
+
*
|
|
3560
3768
|
* @param templateId - The template to update.
|
|
3561
3769
|
* @param payload - `name` and/or `message`; both optional.
|
|
3562
3770
|
* @param accountId - Override the client's default account ID.
|
|
@@ -3699,6 +3907,14 @@ declare class TagResource extends BaseResource {
|
|
|
3699
3907
|
* and `'ff8800'` both persist as `'ff8800'`. Omit `color`
|
|
3700
3908
|
* (or pass `null`) for no color.
|
|
3701
3909
|
*
|
|
3910
|
+
* Request body (`application/json`):
|
|
3911
|
+
* ```jsonc
|
|
3912
|
+
* {
|
|
3913
|
+
* "name": "Contracts",
|
|
3914
|
+
* "color": "ff8800"
|
|
3915
|
+
* }
|
|
3916
|
+
* ```
|
|
3917
|
+
*
|
|
3702
3918
|
* @param payload - `name` (required, max 64 characters; trimmed with
|
|
3703
3919
|
* internal whitespace collapsed) and optional `color`.
|
|
3704
3920
|
* @param accountId - Override the client's default account ID.
|
|
@@ -3734,6 +3950,14 @@ declare class TagResource extends BaseResource {
|
|
|
3734
3950
|
* leading `#` on `color` is accepted and stripped by the API
|
|
3735
3951
|
* (`'#112233'` → `'112233'`).
|
|
3736
3952
|
*
|
|
3953
|
+
* Request body (`application/json`):
|
|
3954
|
+
* ```jsonc
|
|
3955
|
+
* {
|
|
3956
|
+
* "name": "Signed contracts",
|
|
3957
|
+
* "color": null
|
|
3958
|
+
* }
|
|
3959
|
+
* ```
|
|
3960
|
+
*
|
|
3737
3961
|
* @param tagId - The tag to update.
|
|
3738
3962
|
* @param payload - `name` and/or `color`. `color: null` clears the color;
|
|
3739
3963
|
* omit a field to leave it unchanged.
|
|
@@ -3854,6 +4078,14 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
3854
4078
|
* `X-Api-Key` (see {@link AuthenticationResource.createApiKey}) instead of
|
|
3855
4079
|
* storing a password.
|
|
3856
4080
|
*
|
|
4081
|
+
* Request body (`application/json`):
|
|
4082
|
+
* ```jsonc
|
|
4083
|
+
* {
|
|
4084
|
+
* "email": "user@example.com",
|
|
4085
|
+
* "password": "example-password"
|
|
4086
|
+
* }
|
|
4087
|
+
* ```
|
|
4088
|
+
*
|
|
3857
4089
|
* @param email - The user's email address, e.g. `'user@example.com'`.
|
|
3858
4090
|
* @param password - The user's password.
|
|
3859
4091
|
* @returns An {@link ILoginResponse} with the access token, user, and
|
|
@@ -3902,6 +4134,15 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
3902
4134
|
* Assinafy JWT. Returns the same {@link ILoginResponse} shape as
|
|
3903
4135
|
* {@link AuthenticationResource.login}.
|
|
3904
4136
|
*
|
|
4137
|
+
* Request body (`application/json`):
|
|
4138
|
+
* ```jsonc
|
|
4139
|
+
* {
|
|
4140
|
+
* "provider": "google",
|
|
4141
|
+
* "token": "provider_token_example",
|
|
4142
|
+
* "has_accepted_terms": true
|
|
4143
|
+
* }
|
|
4144
|
+
* ```
|
|
4145
|
+
*
|
|
3905
4146
|
* @param payload - The social-login body.
|
|
3906
4147
|
* @param payload.provider - OAuth provider; currently exactly `'google'`.
|
|
3907
4148
|
* @param payload.token - The provider-issued OAuth/ID token.
|
|
@@ -3964,6 +4205,14 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
3964
4205
|
* The response is the standard status/message acknowledgement with no data,
|
|
3965
4206
|
* so this method resolves to `void`.
|
|
3966
4207
|
*
|
|
4208
|
+
* Request body (`application/json`):
|
|
4209
|
+
* ```jsonc
|
|
4210
|
+
* {
|
|
4211
|
+
* "provider": "google",
|
|
4212
|
+
* "token": "provider_token_example"
|
|
4213
|
+
* }
|
|
4214
|
+
* ```
|
|
4215
|
+
*
|
|
3967
4216
|
* @param payload - Social provider and provider-issued access/ID token.
|
|
3968
4217
|
* @returns Resolves when the API acknowledges that the identity was linked.
|
|
3969
4218
|
* @throws {ValidationError} If `provider` is not `google` or `token` is empty.
|
|
@@ -3990,6 +4239,13 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
3990
4239
|
* a masked value. Calling this again rotates the key, invalidating the
|
|
3991
4240
|
* previous one.
|
|
3992
4241
|
*
|
|
4242
|
+
* Request body (`application/json`):
|
|
4243
|
+
* ```jsonc
|
|
4244
|
+
* {
|
|
4245
|
+
* "password": "example-password"
|
|
4246
|
+
* }
|
|
4247
|
+
* ```
|
|
4248
|
+
*
|
|
3993
4249
|
* @param password - The current user's password, required to authorize
|
|
3994
4250
|
* key generation.
|
|
3995
4251
|
* @returns An {@link IApiKeyResponse} containing the new key. Response
|
|
@@ -4060,6 +4316,15 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
4060
4316
|
* Requires the current password as a confirmation. On success the API
|
|
4061
4317
|
* echoes back the affected `email`.
|
|
4062
4318
|
*
|
|
4319
|
+
* Request body (`application/json`):
|
|
4320
|
+
* ```jsonc
|
|
4321
|
+
* {
|
|
4322
|
+
* "email": "user@example.com",
|
|
4323
|
+
* "password": "example-password",
|
|
4324
|
+
* "new_password": "new-example-password"
|
|
4325
|
+
* }
|
|
4326
|
+
* ```
|
|
4327
|
+
*
|
|
4063
4328
|
* @param payload - The change-password body.
|
|
4064
4329
|
* @param payload.email - The user's email address.
|
|
4065
4330
|
* @param payload.password - The current password.
|
|
@@ -4099,6 +4364,13 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
4099
4364
|
* Triggers Assinafy to email a reset link/token to the given address.
|
|
4100
4365
|
* Complete the flow with {@link AuthenticationResource.resetPassword}.
|
|
4101
4366
|
*
|
|
4367
|
+
* Request body (`application/json`):
|
|
4368
|
+
* ```jsonc
|
|
4369
|
+
* {
|
|
4370
|
+
* "email": "user@example.com"
|
|
4371
|
+
* }
|
|
4372
|
+
* ```
|
|
4373
|
+
*
|
|
4102
4374
|
* @param email - The email address to send the reset link to.
|
|
4103
4375
|
* @returns `{ email }` — the address the reset link was sent to. Response
|
|
4104
4376
|
* shape:
|
|
@@ -4126,6 +4398,15 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
4126
4398
|
* {@link AuthenticationResource.requestPasswordReset} and sets the new
|
|
4127
4399
|
* password. On success the API echoes back the affected `email`.
|
|
4128
4400
|
*
|
|
4401
|
+
* Request body (`application/json`):
|
|
4402
|
+
* ```jsonc
|
|
4403
|
+
* {
|
|
4404
|
+
* "email": "user@example.com",
|
|
4405
|
+
* "token": "reset_token_example",
|
|
4406
|
+
* "new_password": "new-example-password"
|
|
4407
|
+
* }
|
|
4408
|
+
* ```
|
|
4409
|
+
*
|
|
4129
4410
|
* @param payload - The reset-password body.
|
|
4130
4411
|
* @param payload.email - The user's email address.
|
|
4131
4412
|
* @param payload.token - The reset token from the emailed link. The current
|
|
@@ -4218,20 +4499,20 @@ type TokenEndpointAuthOptions = {
|
|
|
4218
4499
|
* // Step 1 — before redirecting the user
|
|
4219
4500
|
* const request = await client.oauth.createAuthorizationUrl({
|
|
4220
4501
|
* clientId: process.env.ASSINAFY_CLIENT_ID!,
|
|
4221
|
-
* redirectUri: 'https://myapp.com/oauth/callback',
|
|
4222
|
-
* scopes: ['documents:read', 'documents:write', 'offline_access'],
|
|
4502
|
+
* redirectUri: 'https://myapp.example.com/oauth/callback',
|
|
4503
|
+
* scopes: ['documents:read', 'documents:write', 'account:read', 'offline_access'],
|
|
4223
4504
|
* });
|
|
4224
4505
|
* session.oauth = request; // state + codeVerifier + issuer
|
|
4225
4506
|
* response.redirect(request.url);
|
|
4226
4507
|
*
|
|
4227
|
-
* // Step 3/4 — on https://myapp.com/oauth/callback
|
|
4508
|
+
* // Step 3/4 — on https://myapp.example.com/oauth/callback
|
|
4228
4509
|
* const { code } = client.oauth.readAuthorizationCallback(query, session.oauth);
|
|
4229
4510
|
* const tokens = await client.oauth.exchangeCode({
|
|
4230
4511
|
* code,
|
|
4231
4512
|
* codeVerifier: session.oauth.codeVerifier,
|
|
4232
|
-
* redirectUri: 'https://myapp.com/oauth/callback',
|
|
4513
|
+
* redirectUri: 'https://myapp.example.com/oauth/callback',
|
|
4233
4514
|
* clientId: process.env.ASSINAFY_CLIENT_ID!,
|
|
4234
|
-
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET
|
|
4515
|
+
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET!,
|
|
4235
4516
|
* });
|
|
4236
4517
|
* ```
|
|
4237
4518
|
*/
|
|
@@ -4377,8 +4658,8 @@ declare class OAuthResource extends BaseResource {
|
|
|
4377
4658
|
* ```ts
|
|
4378
4659
|
* const request = await client.oauth.createAuthorizationUrl({
|
|
4379
4660
|
* clientId: process.env.ASSINAFY_CLIENT_ID!,
|
|
4380
|
-
* redirectUri: 'https://myapp.com/oauth/callback',
|
|
4381
|
-
* scopes: ['documents:read', 'documents:write', 'offline_access'],
|
|
4661
|
+
* redirectUri: 'https://myapp.example.com/oauth/callback',
|
|
4662
|
+
* scopes: ['documents:read', 'documents:write', 'account:read', 'offline_access'],
|
|
4382
4663
|
* });
|
|
4383
4664
|
* session.oauth = request;
|
|
4384
4665
|
* response.redirect(request.url);
|
|
@@ -4429,8 +4710,8 @@ declare class OAuthResource extends BaseResource {
|
|
|
4429
4710
|
* ```
|
|
4430
4711
|
* @throws {ValidationError} If `state` is missing or does not match, `iss`
|
|
4431
4712
|
* is absent or disagrees with the expected issuer, or a successful response
|
|
4432
|
-
* carries no `code
|
|
4433
|
-
*
|
|
4713
|
+
* carries no `code`, or a protocol parameter appears more than once.
|
|
4714
|
+
* Reject such responses without exchanging the code.
|
|
4434
4715
|
* @throws {OAuthError} If the server returned `error` (e.g.
|
|
4435
4716
|
* `access_denied`, `invalid_scope`, `invalid_request`,
|
|
4436
4717
|
* `unsupported_response_type`, `invalid_target`).
|
|
@@ -4443,9 +4724,9 @@ declare class OAuthResource extends BaseResource {
|
|
|
4443
4724
|
* const tokens = await client.oauth.exchangeCode({
|
|
4444
4725
|
* code,
|
|
4445
4726
|
* codeVerifier: stored.codeVerifier,
|
|
4446
|
-
* redirectUri: 'https://myapp.com/oauth/callback',
|
|
4727
|
+
* redirectUri: 'https://myapp.example.com/oauth/callback',
|
|
4447
4728
|
* clientId: process.env.ASSINAFY_CLIENT_ID!,
|
|
4448
|
-
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET
|
|
4729
|
+
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET!,
|
|
4449
4730
|
* });
|
|
4450
4731
|
* });
|
|
4451
4732
|
* ```
|
|
@@ -4463,6 +4744,12 @@ declare class OAuthResource extends BaseResource {
|
|
|
4463
4744
|
* a browser. Every value must match the authorization request exactly, or
|
|
4464
4745
|
* the API answers `invalid_grant`.
|
|
4465
4746
|
*
|
|
4747
|
+
* Request body (`application/x-www-form-urlencoded`; omit `client_secret`
|
|
4748
|
+
* for public applications):
|
|
4749
|
+
* ```text
|
|
4750
|
+
* grant_type=authorization_code&code=code_example&redirect_uri=https%3A%2F%2Fmyapp.example.com%2Foauth%2Fcallback&client_id=client_example&client_secret=secret_example&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk&resource=https%3A%2F%2Fapi.assinafy.com.br
|
|
4751
|
+
* ```
|
|
4752
|
+
*
|
|
4466
4753
|
* @param options - Exchange options.
|
|
4467
4754
|
* @param options.code - The code from
|
|
4468
4755
|
* {@link OAuthResource.readAuthorizationCallback}.
|
|
@@ -4498,9 +4785,9 @@ declare class OAuthResource extends BaseResource {
|
|
|
4498
4785
|
* const tokens = await client.oauth.exchangeCode({
|
|
4499
4786
|
* code,
|
|
4500
4787
|
* codeVerifier: session.oauth.codeVerifier,
|
|
4501
|
-
* redirectUri: 'https://myapp.com/oauth/callback',
|
|
4788
|
+
* redirectUri: 'https://myapp.example.com/oauth/callback',
|
|
4502
4789
|
* clientId: process.env.ASSINAFY_CLIENT_ID!,
|
|
4503
|
-
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET
|
|
4790
|
+
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET!,
|
|
4504
4791
|
* });
|
|
4505
4792
|
* ```
|
|
4506
4793
|
*/
|
|
@@ -4528,6 +4815,12 @@ declare class OAuthResource extends BaseResource {
|
|
|
4528
4815
|
* only expires if it goes 30 days without a refresh; after that the user
|
|
4529
4816
|
* has to reconnect.
|
|
4530
4817
|
*
|
|
4818
|
+
* Request body (`application/x-www-form-urlencoded`; omit `client_secret`
|
|
4819
|
+
* for public applications):
|
|
4820
|
+
* ```text
|
|
4821
|
+
* grant_type=refresh_token&refresh_token=refresh_token_example&client_id=client_example&client_secret=secret_example&resource=https%3A%2F%2Fapi.assinafy.com.br
|
|
4822
|
+
* ```
|
|
4823
|
+
*
|
|
4531
4824
|
* @param options - Refresh options.
|
|
4532
4825
|
* @param options.refreshToken - The current refresh token.
|
|
4533
4826
|
* @param options.clientId - The application's `client_id`.
|
|
@@ -4558,7 +4851,7 @@ declare class OAuthResource extends BaseResource {
|
|
|
4558
4851
|
* const tokens = await client.oauth.refreshToken({
|
|
4559
4852
|
* refreshToken: connection.refreshToken,
|
|
4560
4853
|
* clientId: process.env.ASSINAFY_CLIENT_ID!,
|
|
4561
|
-
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET
|
|
4854
|
+
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET!,
|
|
4562
4855
|
* });
|
|
4563
4856
|
* await connection.save({ refreshToken: tokens.refresh_token });
|
|
4564
4857
|
* ```
|
|
@@ -4599,7 +4892,7 @@ declare class OAuthResource extends BaseResource {
|
|
|
4599
4892
|
* token: connection.refreshToken,
|
|
4600
4893
|
* tokenTypeHint: 'refresh_token',
|
|
4601
4894
|
* clientId: process.env.ASSINAFY_CLIENT_ID!,
|
|
4602
|
-
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET
|
|
4895
|
+
* clientSecret: process.env.ASSINAFY_CLIENT_SECRET!,
|
|
4603
4896
|
* });
|
|
4604
4897
|
* ```
|
|
4605
4898
|
*/
|
|
@@ -4626,8 +4919,8 @@ declare class OAuthResource extends BaseResource {
|
|
|
4626
4919
|
* "email_verified": true
|
|
4627
4920
|
* }
|
|
4628
4921
|
* ```
|
|
4629
|
-
* `sub` is the stable user identifier;
|
|
4630
|
-
* was not granted.
|
|
4922
|
+
* `sub` is the stable user identifier; other claims may be omitted or
|
|
4923
|
+
* `null` when their scope was not granted.
|
|
4631
4924
|
* @throws {ValidationError} If `accessToken` is supplied but empty.
|
|
4632
4925
|
* @throws {ApiError} `401` when the token is missing, expired or revoked;
|
|
4633
4926
|
* `403` when the `openid` scope was not granted — its `WWW-Authenticate`
|
|
@@ -4687,6 +4980,17 @@ declare class FieldsResource extends BaseResource {
|
|
|
4687
4980
|
/**
|
|
4688
4981
|
* Create a field definition (`POST /accounts/{accountId}/fields`).
|
|
4689
4982
|
*
|
|
4983
|
+
* Request body (`application/json`):
|
|
4984
|
+
* ```jsonc
|
|
4985
|
+
* {
|
|
4986
|
+
* "type": "text",
|
|
4987
|
+
* "name": "Reference",
|
|
4988
|
+
* "regex": null,
|
|
4989
|
+
* "is_required": true,
|
|
4990
|
+
* "is_active": true
|
|
4991
|
+
* }
|
|
4992
|
+
* ```
|
|
4993
|
+
*
|
|
4690
4994
|
* @param payload - The field to create. `type` and `name` are required;
|
|
4691
4995
|
* `type` must be one of the platform field types (see
|
|
4692
4996
|
* {@link FieldsResource.listTypes}); `regex` may be a string or `null`,
|
|
@@ -4794,6 +5098,15 @@ declare class FieldsResource extends BaseResource {
|
|
|
4794
5098
|
* Update a field definition
|
|
4795
5099
|
* (`PUT /accounts/{accountId}/fields/{fieldId}`).
|
|
4796
5100
|
*
|
|
5101
|
+
* Request body (`application/json`):
|
|
5102
|
+
* ```jsonc
|
|
5103
|
+
* {
|
|
5104
|
+
* "name": "Customer reference",
|
|
5105
|
+
* "regex": null,
|
|
5106
|
+
* "is_active": true
|
|
5107
|
+
* }
|
|
5108
|
+
* ```
|
|
5109
|
+
*
|
|
4797
5110
|
* @param fieldId - The field definition to update.
|
|
4798
5111
|
* @param payload - Fields are `name`, nullable `regex`, and `is_active`;
|
|
4799
5112
|
* `type` and `is_required` are compatibility extensions.
|
|
@@ -4853,6 +5166,13 @@ declare class FieldsResource extends BaseResource {
|
|
|
4853
5166
|
* `signerAccessCode` is a compatibility query and is sent as
|
|
4854
5167
|
* `signer-access-code` when supplied.
|
|
4855
5168
|
*
|
|
5169
|
+
* Request body (`application/json`):
|
|
5170
|
+
* ```jsonc
|
|
5171
|
+
* {
|
|
5172
|
+
* "value": "Example value"
|
|
5173
|
+
* }
|
|
5174
|
+
* ```
|
|
5175
|
+
*
|
|
4856
5176
|
* @param fieldId - The field definition to validate against.
|
|
4857
5177
|
* @param value - The value to check (validated against the field's
|
|
4858
5178
|
* type/regex). Sent as `{ value }` in the request body.
|
|
@@ -4891,6 +5211,16 @@ declare class FieldsResource extends BaseResource {
|
|
|
4891
5211
|
* same compatibility extension described on
|
|
4892
5212
|
* {@link FieldsResource.validate}.
|
|
4893
5213
|
*
|
|
5214
|
+
* Request body (`application/json`):
|
|
5215
|
+
* ```jsonc
|
|
5216
|
+
* [
|
|
5217
|
+
* {
|
|
5218
|
+
* "field_id": "field_example",
|
|
5219
|
+
* "value": "Example value"
|
|
5220
|
+
* }
|
|
5221
|
+
* ]
|
|
5222
|
+
* ```
|
|
5223
|
+
*
|
|
4894
5224
|
* @param entries - Non-empty array of `{ field_id, value }` pairs.
|
|
4895
5225
|
* @param options - Account override and optional legacy `signerAccessCode`.
|
|
4896
5226
|
* @returns One validation result per entry. Response shape:
|
|
@@ -5142,6 +5472,15 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5142
5472
|
* The `document_ids` array goes in the request body; the access code
|
|
5143
5473
|
* authenticates via the `signer-access-code` query param.
|
|
5144
5474
|
*
|
|
5475
|
+
* Request body (`application/json`):
|
|
5476
|
+
* ```jsonc
|
|
5477
|
+
* {
|
|
5478
|
+
* "document_ids": [
|
|
5479
|
+
* "document_example"
|
|
5480
|
+
* ]
|
|
5481
|
+
* }
|
|
5482
|
+
* ```
|
|
5483
|
+
*
|
|
5145
5484
|
* @param documentIds - Non-empty array of document IDs to sign.
|
|
5146
5485
|
* @param signerAccessCode - The signer's access code, from their signing link.
|
|
5147
5486
|
* @returns Resolves when the API acknowledges the operation. The documented
|
|
@@ -5170,6 +5509,16 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5170
5509
|
* Both `document_ids` and `decline_reason` go in the request body; the access
|
|
5171
5510
|
* code authenticates via the `signer-access-code` query param.
|
|
5172
5511
|
*
|
|
5512
|
+
* Request body (`application/json`):
|
|
5513
|
+
* ```jsonc
|
|
5514
|
+
* {
|
|
5515
|
+
* "document_ids": [
|
|
5516
|
+
* "document_example"
|
|
5517
|
+
* ],
|
|
5518
|
+
* "decline_reason": "The document needs a correction."
|
|
5519
|
+
* }
|
|
5520
|
+
* ```
|
|
5521
|
+
*
|
|
5173
5522
|
* @param documentIds - Non-empty array of document IDs to decline.
|
|
5174
5523
|
* @param declineReason - Free-text reason shown to the sender (required).
|
|
5175
5524
|
* @param signerAccessCode - The signer's access code, from their signing link.
|
|
@@ -5259,6 +5608,13 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5259
5608
|
* **body carries only `verification-code`** (putting the access code in the
|
|
5260
5609
|
* body leaves the request unauthenticated → `401`).
|
|
5261
5610
|
*
|
|
5611
|
+
* Request body (`application/json`):
|
|
5612
|
+
* ```jsonc
|
|
5613
|
+
* {
|
|
5614
|
+
* "verification-code": "123456"
|
|
5615
|
+
* }
|
|
5616
|
+
* ```
|
|
5617
|
+
*
|
|
5262
5618
|
* @param payload - `signerAccessCode` (the signing-link code) and
|
|
5263
5619
|
* `verificationCode` (the OTP the signer received).
|
|
5264
5620
|
* @returns Resolves when the API acknowledges the operation. The response
|
|
@@ -5293,6 +5649,16 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5293
5649
|
* `has_accepted_terms: true` here or call
|
|
5294
5650
|
* {@link SignerDocumentsResource.acceptTerms} before fetching the assignment.
|
|
5295
5651
|
*
|
|
5652
|
+
* Request body (`application/json`):
|
|
5653
|
+
* ```jsonc
|
|
5654
|
+
* {
|
|
5655
|
+
* "full_name": "Example Signer",
|
|
5656
|
+
* "email": "signer@example.com",
|
|
5657
|
+
* "government_id": "39053344705",
|
|
5658
|
+
* "has_accepted_terms": true
|
|
5659
|
+
* }
|
|
5660
|
+
* ```
|
|
5661
|
+
*
|
|
5296
5662
|
* @param documentId - The document the signer is confirming data for.
|
|
5297
5663
|
* @param signerAccessCode - The signer's access code, from their signing link.
|
|
5298
5664
|
* @param payload - Any of the official `full_name`, `email`, or
|
|
@@ -5326,8 +5692,23 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5326
5692
|
*/
|
|
5327
5693
|
confirmData(documentId: string, signerAccessCode: string, payload: IConfirmSignerDataPayload): Promise<ISigner>;
|
|
5328
5694
|
/**
|
|
5695
|
+
* Confirm signer data with the compatibility phone field
|
|
5696
|
+
* (`PUT /documents/{documentId}/signers/confirm-data`).
|
|
5329
5697
|
* @deprecated Compatibility overload preserving the previous wire shape.
|
|
5330
5698
|
* `whatsapp_phone_number` is a compatibility pass-through field.
|
|
5699
|
+
* @param documentId - Document identifier.
|
|
5700
|
+
* @param signerAccessCode - Access code sent in the query string.
|
|
5701
|
+
* @param payload - Identity fields, including `whatsapp_phone_number`.
|
|
5702
|
+
* @returns The signer; see the primary overload for its response payload.
|
|
5703
|
+
* @throws {ValidationError} If identity fields or identifiers are invalid.
|
|
5704
|
+
* @throws {ApiError} If the API rejects the confirmation.
|
|
5705
|
+
* @example
|
|
5706
|
+
* ```ts
|
|
5707
|
+
* // JSON body: { "whatsapp_phone_number": "+5511999998888" }
|
|
5708
|
+
* await client.signerDocuments.confirmData(documentId, accessCode, {
|
|
5709
|
+
* whatsapp_phone_number: '+5511999998888',
|
|
5710
|
+
* });
|
|
5711
|
+
* ```
|
|
5331
5712
|
*/
|
|
5332
5713
|
confirmData(documentId: string, signerAccessCode: string, payload: ILegacyConfirmSignerDataPayload): Promise<ISigner>;
|
|
5333
5714
|
/**
|
|
@@ -5362,8 +5743,22 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5362
5743
|
*/
|
|
5363
5744
|
uploadSignature(signerAccessCode: string, image: Buffer, options?: IUploadSignatureOptions): Promise<void>;
|
|
5364
5745
|
/**
|
|
5746
|
+
* Upload a signature image using a compatibility content type
|
|
5747
|
+
* (`POST /signature?signer-access-code=…&type=…`).
|
|
5365
5748
|
* @deprecated Compatibility overload for non-PNG media types. The current
|
|
5366
5749
|
* OpenAPI contract specifies only `image/png`; other values are not certified.
|
|
5750
|
+
* @param signerAccessCode - Access code sent in the query string.
|
|
5751
|
+
* @param image - Non-empty raw image bytes, without a JSON envelope.
|
|
5752
|
+
* @param options - Image type, reuse preference and compatibility content type.
|
|
5753
|
+
* @returns Nothing; the acknowledgement body is discarded.
|
|
5754
|
+
* @throws {ValidationError} If the code, image or options are invalid.
|
|
5755
|
+
* @throws {ApiError} If the API rejects the upload.
|
|
5756
|
+
* @example
|
|
5757
|
+
* ```ts
|
|
5758
|
+
* await client.signerDocuments.uploadSignature(accessCode, image, {
|
|
5759
|
+
* imageType: 'signature', reuse: false, contentType: 'image/jpeg',
|
|
5760
|
+
* });
|
|
5761
|
+
* ```
|
|
5367
5762
|
*/
|
|
5368
5763
|
uploadSignature(signerAccessCode: string, image: Buffer, options: ILegacyUploadSignatureOptions): Promise<void>;
|
|
5369
5764
|
/**
|
|
@@ -5480,6 +5875,18 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5480
5875
|
* first. Digital Certificate signers cannot use this endpoint; use the
|
|
5481
5876
|
* certificate start/complete API flow instead.
|
|
5482
5877
|
*
|
|
5878
|
+
* Request body (`application/json`):
|
|
5879
|
+
* ```jsonc
|
|
5880
|
+
* [
|
|
5881
|
+
* {
|
|
5882
|
+
* "itemId": "item_example",
|
|
5883
|
+
* "fieldId": "field_example",
|
|
5884
|
+
* "pageId": "page_example",
|
|
5885
|
+
* "value": "Example Signer"
|
|
5886
|
+
* }
|
|
5887
|
+
* ]
|
|
5888
|
+
* ```
|
|
5889
|
+
*
|
|
5483
5890
|
* @param documentId - The document being signed.
|
|
5484
5891
|
* @param assignmentId - The assignment within that document.
|
|
5485
5892
|
* @param signerAccessCode - The signer's access code, from their signing link.
|
|
@@ -5512,6 +5919,13 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5512
5919
|
* delete the document via `documents.delete`; there is no workspace "cancel"
|
|
5513
5920
|
* endpoint.)
|
|
5514
5921
|
*
|
|
5922
|
+
* Request body (`application/json`):
|
|
5923
|
+
* ```jsonc
|
|
5924
|
+
* {
|
|
5925
|
+
* "decline_reason": "The document needs a correction."
|
|
5926
|
+
* }
|
|
5927
|
+
* ```
|
|
5928
|
+
*
|
|
5515
5929
|
* @param documentId - The document being declined.
|
|
5516
5930
|
* @param assignmentId - The assignment within that document.
|
|
5517
5931
|
* @param signerAccessCode - The signer's access code, from their signing link.
|
|
@@ -5640,6 +6054,21 @@ declare class UserResource extends BaseResource {
|
|
|
5640
6054
|
* (`PUT /users/self/notification-preferences`). Omitted keys retain their
|
|
5641
6055
|
* current values; account/security e-mails are not configurable here.
|
|
5642
6056
|
*
|
|
6057
|
+
* Request body (`application/json`):
|
|
6058
|
+
* ```jsonc
|
|
6059
|
+
* {
|
|
6060
|
+
* "DocumentCompleted": true,
|
|
6061
|
+
* "SignerDeclined": true,
|
|
6062
|
+
* "DocumentCancelled": true,
|
|
6063
|
+
* "DocumentAboutToExpire": true,
|
|
6064
|
+
* "DocumentExpired": true,
|
|
6065
|
+
* "DocumentExpirationReset": true,
|
|
6066
|
+
* "DocumentProcessingFailed": true,
|
|
6067
|
+
* "TemplateProcessingFailed": true,
|
|
6068
|
+
* "SignerWhatsappFailed": true
|
|
6069
|
+
* }
|
|
6070
|
+
* ```
|
|
6071
|
+
*
|
|
5643
6072
|
* @param preferences - One or more of the nine documented keys, each with
|
|
5644
6073
|
* a boolean value. Request example:
|
|
5645
6074
|
* ```json
|
|
@@ -5784,7 +6213,7 @@ interface ClientConfigInput {
|
|
|
5784
6213
|
* const client = new AssinafyClient({
|
|
5785
6214
|
* apiKey: process.env.ASSINAFY_API_KEY!,
|
|
5786
6215
|
* accountId: process.env.ASSINAFY_ACCOUNT_ID!,
|
|
5787
|
-
* webhookSecret: process.env.ASSINAFY_WEBHOOK_SECRET
|
|
6216
|
+
* webhookSecret: process.env.ASSINAFY_WEBHOOK_SECRET!,
|
|
5788
6217
|
* });
|
|
5789
6218
|
*
|
|
5790
6219
|
* const document = await client.documents.upload({ filePath: './contract.pdf' });
|