@assinafy/sdk 2.8.0 → 2.9.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/dist/index.d.mts CHANGED
@@ -29,7 +29,7 @@ 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`; the signer must be alone in their signing step. | 0.5 credits + notification |
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. | `method: 'virtual'`; Digital Certificate feature (Standard/Pro); `government_id`; the signer must be alone in their signing step. | 0.5 credits + notification |
33
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. |
34
34
  *
35
35
  * A1 and A3 are certificate *media*, chosen by the signer in their browser at
@@ -310,6 +310,7 @@ type ISignerListResponse = PaginatedResult<ISigner>;
310
310
  type SignerReference = string | {
311
311
  id?: string;
312
312
  signer_id?: string;
313
+ /** `DigitalCertificate` is valid only when the assignment method is `virtual`. */
313
314
  verification_method?: AssignmentVerificationMethod;
314
315
  notification_methods?: AssignmentNotificationMethod[];
315
316
  /**
@@ -381,7 +382,7 @@ interface IAssignmentEntry {
381
382
  display_settings?: IDisplaySettings;
382
383
  }>;
383
384
  }
384
- /** Channel descriptor accepted by assignment cost estimation. */
385
+ /** Channel descriptor accepted by assignment cost estimation. `DigitalCertificate` requires `method: 'virtual'`. */
385
386
  interface IAssignmentCostSigner {
386
387
  verification_method?: AssignmentVerificationMethod;
387
388
  notification_methods?: AssignmentNotificationMethod[];
@@ -445,10 +446,18 @@ interface IAssignmentItem {
445
446
  completed?: boolean;
446
447
  [key: string]: unknown;
447
448
  }
449
+ /** Per-signer browser URL returned with a created assignment. */
450
+ interface ISigningUrl {
451
+ signer_id: string;
452
+ url: string;
453
+ }
448
454
  /** Assignment object as returned by the API. */
449
455
  interface IAssignment {
450
456
  resource?: string;
451
457
  id: string;
458
+ /** The document this assignment belongs to; null only after document deletion. */
459
+ document_id?: string | null;
460
+ created_at?: string;
452
461
  sender_email?: string;
453
462
  method: AssignmentMethod;
454
463
  expires_at?: string | null;
@@ -467,10 +476,7 @@ interface IAssignment {
467
476
  }>;
468
477
  };
469
478
  /** Per-signer signing URLs. Array of `{ signer_id, url }` (not a map). */
470
- signing_urls?: Array<{
471
- signer_id: string;
472
- url: string;
473
- }>;
479
+ signing_urls?: ISigningUrl[];
474
480
  }
475
481
  /** Assignment returned after requesting signatures. */
476
482
  type ICreateAssignmentResponse = IAssignment;
@@ -545,7 +551,7 @@ interface IWebhookPayload {
545
551
  [key: string]: unknown;
546
552
  }
547
553
  /** Known webhook event names. */
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';
554
+ 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' | 'document_contract_updated' | 'document_contract_renewal_notice' | 'document_contract_expiring' | 'document_contract_expired' | 'document_contract_renewed' | 'document_contract_terminated' | 'document_contract_amended' | 'document_contract_amendment_updated';
549
555
  /** Document listing item (paginated). */
550
556
  interface IDocumentListItem {
551
557
  id: string;
@@ -569,6 +575,123 @@ interface IDocumentListItem {
569
575
  }
570
576
  /** Paginated document-list/search response. */
571
577
  type IDocumentListResponse = PaginatedResult<IDocumentListItem>;
578
+ /** Lifecycle state of contract terms tracked on a document. */
579
+ type DocumentContractStatus = 'draft' | 'active' | 'expired' | 'terminated';
580
+ /** How a signed instrument changes its parent contract. */
581
+ type DocumentContractRelationType = 'amendment' | 'renewal' | 'termination';
582
+ /** External-system identifier attached to contract terms. */
583
+ interface IDocumentContractExternalReference {
584
+ system: string;
585
+ id: string;
586
+ }
587
+ /** Contract terms tracked on one workspace document. */
588
+ interface IDocumentContract {
589
+ resource?: 'document_contract' | AnyString;
590
+ document_id: string;
591
+ status: DocumentContractStatus;
592
+ counterparty_name: string | null;
593
+ /** Normalized CPF or CNPJ. */
594
+ counterparty_taxpayer_id: string | null;
595
+ value: number | null;
596
+ /** ISO 4217 currency code, or null when the contract has no value. */
597
+ currency: string | null;
598
+ /** Calendar dates use `YYYY-MM-DD`. */
599
+ start_date: string | null;
600
+ end_date: string | null;
601
+ auto_renew: boolean;
602
+ renewal_term_months: number | null;
603
+ notice_period_days: number | null;
604
+ /** Starts at 1 and increments on every renewal. */
605
+ term: number;
606
+ owner_id: string | null;
607
+ metadata: Record<string, string> | null;
608
+ external_references: IDocumentContractExternalReference[];
609
+ /** Present only when `contracts.list({ expand: 'document' })` is used. */
610
+ document?: IDocumentDetailsResponse;
611
+ /** Present on single-contract and related-family reads. */
612
+ amendments?: IDocumentContractAmendment[];
613
+ created_at: string;
614
+ updated_at: string;
615
+ }
616
+ /** A document linked to amend, renew, or terminate a parent contract. */
617
+ interface IDocumentContractAmendment {
618
+ resource?: 'document_contract_amendment' | AnyString;
619
+ document_id: string;
620
+ document_name: string;
621
+ parent_document_id: string;
622
+ relation_type: DocumentContractRelationType;
623
+ /** Position among applied amendments; null while the instrument is pending. */
624
+ number: number | null;
625
+ status: 'pending' | 'applied';
626
+ document_status: DocumentStatus | AnyString;
627
+ apply_error: string | null;
628
+ currency: string | null;
629
+ /** Only the parent terms this instrument changes. */
630
+ terms: Record<string, unknown> | null;
631
+ /** Parent fields moved by the instrument, as `{ from, to }`. */
632
+ changes: Record<string, {
633
+ from: unknown;
634
+ to: unknown;
635
+ }> | null;
636
+ applied_at: string | null;
637
+ created_at: string;
638
+ updated_at: string;
639
+ }
640
+ /** Partial terms accepted by `contracts.set()`. Null clears the field where documented. */
641
+ interface IDocumentContractInput {
642
+ status?: DocumentContractStatus;
643
+ counterparty_name?: string | null;
644
+ counterparty_taxpayer_id?: string | null;
645
+ value?: number | null;
646
+ currency?: string | null;
647
+ start_date?: string | null;
648
+ end_date?: string | null;
649
+ auto_renew?: boolean;
650
+ renewal_term_months?: number | null;
651
+ notice_period_days?: number | null;
652
+ owner_id?: string | null;
653
+ metadata?: Record<string, string> | null;
654
+ /** Replaces the complete list; an empty array or null clears it. */
655
+ external_references?: IDocumentContractExternalReference[] | null;
656
+ /** Link this document as an instrument, or null to unlink a pending one. */
657
+ parent_document_id?: string | null;
658
+ relation_type?: DocumentContractRelationType;
659
+ /** Optimistic-concurrency value read from the contract or pending amendment. */
660
+ updated_at?: string | null;
661
+ }
662
+ /** Filters accepted by `contracts.list()`. */
663
+ interface IDocumentContractListParams {
664
+ status?: DocumentContractStatus[];
665
+ counterparty?: string;
666
+ search?: string;
667
+ end_date_from?: string;
668
+ end_date_to?: string;
669
+ ending_within_days?: number;
670
+ external_system?: string;
671
+ external_id?: string;
672
+ sort?: 'end_date' | '-end_date' | 'updated_at' | '-updated_at';
673
+ expand?: 'document';
674
+ page?: number;
675
+ per_page?: number;
676
+ 'per-page'?: number;
677
+ }
678
+ /** Body accepted by `contracts.renew()`. */
679
+ interface IRenewDocumentContractPayload {
680
+ end_date?: string | null;
681
+ value?: number | null;
682
+ /** Current contract term; makes a renewal safe to repeat. */
683
+ term?: number;
684
+ /** Optional optimistic-concurrency value read from the contract. */
685
+ updated_at?: string;
686
+ }
687
+ /** Body accepted by `contracts.terminate()`. */
688
+ interface ITerminateDocumentContractPayload {
689
+ reason?: string | null;
690
+ /** Optional optimistic-concurrency value read from the contract. */
691
+ updated_at?: string;
692
+ }
693
+ /** Paginated workspace contract list. */
694
+ type IDocumentContractListResponse = PaginatedResult<IDocumentContract>;
572
695
  /** Query parameters accepted by `documents.list`. */
573
696
  interface IDocumentListParams extends IListParams {
574
697
  /** Free-text term matched against document fields. */
@@ -662,6 +785,10 @@ interface IDocumentDetailsResponse {
662
785
  download_url?: string;
663
786
  download_final_url?: string;
664
787
  signing_url?: string;
788
+ verification_code?: string | null;
789
+ verification_url?: string | null;
790
+ /** Present only on workspace detail reads when contract tracking is available. */
791
+ has_contract?: boolean;
665
792
  artifacts?: {
666
793
  original: string;
667
794
  certificated?: string;
@@ -1039,7 +1166,13 @@ interface ITemplateDetailsResponse {
1039
1166
  updated_at?: string;
1040
1167
  [key: string]: unknown;
1041
1168
  }
1042
- /** Signer assignment for creating a document from a template. */
1169
+ /**
1170
+ * Signer assignment for creating a document from a template.
1171
+ *
1172
+ * The SDK temporarily rejects `DigitalCertificate` because the server derives
1173
+ * the method from template fields and can create an unusable `collect`
1174
+ * assignment. Use a direct `virtual` assignment for certificate signers.
1175
+ */
1043
1176
  interface ITemplateSigner {
1044
1177
  role_id: string;
1045
1178
  id: string;
@@ -1050,7 +1183,9 @@ interface ITemplateSigner {
1050
1183
  }
1051
1184
  /**
1052
1185
  * Role/channel descriptor used only for template cost estimation. The official
1053
- * schema intentionally omits signer `id` and sequential-signing `step`.
1186
+ * schema intentionally omits signer `id` and sequential-signing `step`. The SDK
1187
+ * temporarily rejects `DigitalCertificate`; use direct virtual-assignment cost
1188
+ * estimation instead.
1054
1189
  */
1055
1190
  interface ITemplateCostSigner {
1056
1191
  role_id: string;
@@ -1155,7 +1290,7 @@ interface IAuthenticatedUser {
1155
1290
  }
1156
1291
  /**
1157
1292
  * Owner-facing document e-mail preferences returned by
1158
- * `GET /users/self/notification-preferences`. The API always returns all nine
1293
+ * `GET /users/self/notification-preferences`. The API always returns all thirteen
1159
1294
  * keys; `true` means that notification is enabled.
1160
1295
  */
1161
1296
  interface INotificationPreferences {
@@ -1168,6 +1303,10 @@ interface INotificationPreferences {
1168
1303
  DocumentProcessingFailed: boolean;
1169
1304
  TemplateProcessingFailed: boolean;
1170
1305
  SignerWhatsappFailed: boolean;
1306
+ ContractRenewalNotice: boolean;
1307
+ ContractExpiring: boolean;
1308
+ ContractExpired: boolean;
1309
+ ContractRenewed: boolean;
1171
1310
  }
1172
1311
  /** Partial preference map accepted by `PUT /users/self/notification-preferences`. */
1173
1312
  type IUpdateNotificationPreferences = Partial<INotificationPreferences>;
@@ -2198,7 +2337,10 @@ declare class DocumentResource extends BaseResource {
2198
2337
  * Only one notification method is allowed per signer; when only one of the
2199
2338
  * verification/notification fields is supplied, the API infers the other.
2200
2339
  * `DigitalCertificate` costs 0.5 credits, requires the feature plus a
2201
- * signer `government_id`, and that signer must be alone in its step.
2340
+ * signer `government_id`, and that signer must be alone in its step. The
2341
+ * server derives the assignment method from placed template fields but
2342
+ * does not yet reject unusable certificate/`collect` combinations, so the
2343
+ * SDK temporarily refuses certificate signers on this template route.
2202
2344
  * `IdDocumentFaceMatchBasic` needs the ID Document + Face Match feature
2203
2345
  * and a valid CPF in `government_id`; estimate the per-signer fee first.
2204
2346
  * @param options - Optional `name`, `message`, `expires_at`,
@@ -2229,15 +2371,16 @@ declare class DocumentResource extends BaseResource {
2229
2371
  * "updated_at": "2026-07-15T19:59:33Z"
2230
2372
  * }
2231
2373
  * ```
2232
- * @throws {ValidationError} If `templateId` is missing or no account ID is
2233
- * available.
2374
+ * @throws {ValidationError} If `templateId` is missing, no account ID is
2375
+ * available, or a signer uses `DigitalCertificate`. Certificate refusals
2376
+ * have `errors.code === 'digital_certificate_requires_virtual_method'`.
2234
2377
  * @throws {ApiError} `400` if the signers/roles are invalid or the template
2235
2378
  * is not ready.
2236
2379
  *
2237
2380
  * @example
2238
2381
  * ```ts
2239
2382
  * await client.documents.createFromTemplate('tmpl_id', [
2240
- * { role_id: 'role_id', id: 'signer_id', verification_method: 'DigitalCertificate' },
2383
+ * { role_id: 'role_id', id: 'signer_id', verification_method: 'Email' },
2241
2384
  * ], { name: 'My Contract' });
2242
2385
  * ```
2243
2386
  */
@@ -2248,8 +2391,10 @@ declare class DocumentResource extends BaseResource {
2248
2391
  *
2249
2392
  * A dry run: sends only `{ signers }` and consumes nothing. Use it to check
2250
2393
  * balances before calling {@link DocumentResource.createFromTemplate}.
2251
- * `DigitalCertificate` adds 0.5 credits per signer and has the same feature,
2252
- * `government_id`, and signing-step prerequisites as document creation.
2394
+ * `DigitalCertificate` requires a provably `virtual` assignment. Because
2395
+ * this route leaves method detection to the server, the SDK temporarily
2396
+ * refuses certificate signers instead of returning a price for an
2397
+ * assignment that may charge credits but cannot be completed.
2253
2398
  *
2254
2399
  * Request body (`application/json`):
2255
2400
  * ```jsonc
@@ -2291,14 +2436,15 @@ declare class DocumentResource extends BaseResource {
2291
2436
  * "message": null
2292
2437
  * }
2293
2438
  * ```
2294
- * @throws {ValidationError} If `templateId` is missing or no account ID is
2295
- * available.
2439
+ * @throws {ValidationError} If `templateId` is missing, no account ID is
2440
+ * available, or a signer uses `DigitalCertificate`. Certificate refusals
2441
+ * have `errors.code === 'digital_certificate_requires_virtual_method'`.
2296
2442
  * @throws {ApiError} If the API rejects the request.
2297
2443
  *
2298
2444
  * @example
2299
2445
  * ```ts
2300
2446
  * const estimate = await client.documents.estimateCostFromTemplate('tmpl_id', [
2301
- * { role_id: 'role_id', verification_method: 'DigitalCertificate' },
2447
+ * { role_id: 'role_id', verification_method: 'Email' },
2302
2448
  * ]);
2303
2449
  * if (!estimate.has_sufficient_resources) throw new Error(estimate.blocking_reason ?? 'insufficient');
2304
2450
  * ```
@@ -3069,6 +3215,8 @@ declare class WorkspaceResource extends BaseResource {
3069
3215
  }): Promise<void>;
3070
3216
  }
3071
3217
 
3218
+ /** Stable {@link ValidationError.errors} code for an unusable certificate assignment. */
3219
+ declare const DIGITAL_CERTIFICATE_REQUIRES_VIRTUAL_METHOD = "digital_certificate_requires_virtual_method";
3072
3220
  /**
3073
3221
  * Normalize a public assignment input into the exact create-request body.
3074
3222
  * String IDs and legacy `signer_id` aliases become signer objects, omitted
@@ -3079,7 +3227,9 @@ declare class WorkspaceResource extends BaseResource {
3079
3227
  * @returns A JSON-ready body shaped as
3080
3228
  * `{ method, signers: [{ id, verification_method?, notification_methods?, step? }], message?, expires_at?, copy_receivers?, entries? }`.
3081
3229
  * @throws {ValidationError} If no signer is present, a signer reference is
3082
- * malformed, or a collect assignment has no field-placement entries.
3230
+ * malformed, a collect assignment has no field-placement entries, or a
3231
+ * `DigitalCertificate` signer is combined with `method: 'collect'`. The last
3232
+ * case has `errors.code === 'digital_certificate_requires_virtual_method'`.
3083
3233
  *
3084
3234
  * @example
3085
3235
  * ```ts
@@ -3194,7 +3344,9 @@ declare class AssignmentResource extends BaseResource {
3194
3344
  * `uploaded`, `metadata_processing`, or `metadata_ready` and is promoted
3195
3345
  * automatically; `collect` requires rendered pages at `metadata_ready`.
3196
3346
  * `DigitalCertificate` costs 0.5 credits, requires the feature plus a
3197
- * signer `government_id`, and that signer must be alone in its step.
3347
+ * signer `government_id`, that signer must be alone in its step, and the
3348
+ * assignment must use `method: 'virtual'`. Certificate completion marks a
3349
+ * virtual item complete; it cannot submit placed `collect` fields.
3198
3350
  * `IdDocumentFaceMatchBasic` needs the ID Document + Face Match feature
3199
3351
  * and a valid CPF in the signer's `government_id`; estimate its fee first.
3200
3352
  *
@@ -3294,7 +3446,9 @@ declare class AssignmentResource extends BaseResource {
3294
3446
  * }
3295
3447
  * ```
3296
3448
  * @throws {ValidationError} If `documentId` is missing, no signer is
3297
- * supplied, or a signer reference is invalid.
3449
+ * supplied, a signer reference is invalid, or `DigitalCertificate` is
3450
+ * combined with `collect`. The last case has `errors.code ===
3451
+ * 'digital_certificate_requires_virtual_method'`.
3298
3452
  * @throws {ApiError} `400` for an invalid assignment or unmet verification
3299
3453
  * precondition; otherwise if the API rejects the request.
3300
3454
  *
@@ -3318,7 +3472,9 @@ declare class AssignmentResource extends BaseResource {
3318
3472
  * default Email channel). {@link buildAssignmentEstimatePayload} projects
3319
3473
  * exactly the fields permitted by the estimate schema.
3320
3474
  * `DigitalCertificate` is priced at 0.5 credits per signer and remains
3321
- * subject to the feature, identity, and one-signer-per-step requirements.
3475
+ * subject to the feature and identity requirements. It is valid only with
3476
+ * `method: 'virtual'`; the SDK refuses to quote a certificate/`collect`
3477
+ * request because that assignment cannot be completed.
3322
3478
  * Current documented unit prices are 1 credit for an extra document, 0 for
3323
3479
  * email notification, and 0.45 for WhatsApp notification; a digital
3324
3480
  * certificate charge is added on top of its notification cost.
@@ -3363,7 +3519,9 @@ declare class AssignmentResource extends BaseResource {
3363
3519
  * ```
3364
3520
  * @throws {ValidationError} If `documentId` is missing, a `virtual` request
3365
3521
  * has no signer entry, or a `collect` request has no signer entry or no
3366
- * field-placement entry.
3522
+ * field-placement entry, or combines `DigitalCertificate` with `collect`.
3523
+ * The last case has `errors.code ===
3524
+ * 'digital_certificate_requires_virtual_method'`.
3367
3525
  * @throws {ApiError} If the API rejects the request.
3368
3526
  *
3369
3527
  * @example
@@ -6826,7 +6984,7 @@ declare class UserResource extends BaseResource {
6826
6984
  *
6827
6985
  * Request body: none. Authentication: `X-Api-Key` or Bearer token.
6828
6986
  *
6829
- * @returns The complete nine-key preference map:
6987
+ * @returns The complete thirteen-key preference map:
6830
6988
  * ```json
6831
6989
  * {
6832
6990
  * "DocumentCompleted": true,
@@ -6837,7 +6995,11 @@ declare class UserResource extends BaseResource {
6837
6995
  * "DocumentExpirationReset": true,
6838
6996
  * "DocumentProcessingFailed": true,
6839
6997
  * "TemplateProcessingFailed": true,
6840
- * "SignerWhatsappFailed": true
6998
+ * "SignerWhatsappFailed": true,
6999
+ * "ContractRenewalNotice": true,
7000
+ * "ContractExpiring": true,
7001
+ * "ContractExpired": true,
7002
+ * "ContractRenewed": true
6841
7003
  * }
6842
7004
  * ```
6843
7005
  * @throws {ApiError} `401` when credentials are missing/invalid, or `500`
@@ -6865,16 +7027,33 @@ declare class UserResource extends BaseResource {
6865
7027
  * "DocumentExpirationReset": true,
6866
7028
  * "DocumentProcessingFailed": true,
6867
7029
  * "TemplateProcessingFailed": true,
6868
- * "SignerWhatsappFailed": true
7030
+ * "SignerWhatsappFailed": true,
7031
+ * "ContractRenewalNotice": true,
7032
+ * "ContractExpiring": true,
7033
+ * "ContractExpired": true,
7034
+ * "ContractRenewed": true
6869
7035
  * }
6870
7036
  * ```
6871
7037
  *
6872
- * @param preferences - One or more of the nine documented keys, each with
7038
+ * @param preferences - One or more of the thirteen documented keys, each with
6873
7039
  * a boolean value. Request example:
6874
7040
  * ```json
6875
7041
  * { "DocumentCompleted": true, "SignerDeclined": false }
6876
7042
  * ```
6877
- * @returns The complete updated nine-key preference map:
7043
+ * @param preferences.DocumentCompleted - Notify when a document completes.
7044
+ * @param preferences.SignerDeclined - Notify when a signer declines.
7045
+ * @param preferences.DocumentCancelled - Notify when a document is cancelled.
7046
+ * @param preferences.DocumentAboutToExpire - Notify before signature expiry.
7047
+ * @param preferences.DocumentExpired - Notify after signature expiry.
7048
+ * @param preferences.DocumentExpirationReset - Notify after resetting expiry.
7049
+ * @param preferences.DocumentProcessingFailed - Notify after document processing fails.
7050
+ * @param preferences.TemplateProcessingFailed - Notify after template processing fails.
7051
+ * @param preferences.SignerWhatsappFailed - Notify after WhatsApp delivery fails.
7052
+ * @param preferences.ContractRenewalNotice - Notify when the contract notice period starts.
7053
+ * @param preferences.ContractExpiring - Notify before a tracked contract ends.
7054
+ * @param preferences.ContractExpired - Notify when a tracked contract expires.
7055
+ * @param preferences.ContractRenewed - Notify when a tracked contract renews.
7056
+ * @returns The complete updated thirteen-key preference map:
6878
7057
  * ```json
6879
7058
  * {
6880
7059
  * "DocumentCompleted": true,
@@ -6885,7 +7064,11 @@ declare class UserResource extends BaseResource {
6885
7064
  * "DocumentExpirationReset": true,
6886
7065
  * "DocumentProcessingFailed": true,
6887
7066
  * "TemplateProcessingFailed": true,
6888
- * "SignerWhatsappFailed": true
7067
+ * "SignerWhatsappFailed": true,
7068
+ * "ContractRenewalNotice": true,
7069
+ * "ContractExpiring": true,
7070
+ * "ContractExpired": true,
7071
+ * "ContractRenewed": true
6889
7072
  * }
6890
7073
  * ```
6891
7074
  * @throws {ValidationError} Before requesting when the map is empty, has an
@@ -7045,6 +7228,348 @@ declare class UserResource extends BaseResource {
7045
7228
  }>;
7046
7229
  }
7047
7230
 
7231
+ /** Operations for contract terms tracked on workspace documents. */
7232
+ declare class ContractResource extends BaseResource {
7233
+ /**
7234
+ * List the workspace's tracked contracts (`GET /accounts/{accountId}/contracts`).
7235
+ *
7236
+ * Results are ordered by `-updated_at` unless `sort` is supplied. Use
7237
+ * `updated_at` to catch up after a missed webhook; `ending_within_days` is
7238
+ * evaluated by the API in the Brasília calendar day. OAuth tokens need
7239
+ * `documents:read`.
7240
+ *
7241
+ * @param params - Optional filters, expansion, sorting, and pagination.
7242
+ * @param params.status - Contract states to match; sent comma-separated.
7243
+ * @param params.counterparty - Part of the name, or an exact CPF/CNPJ.
7244
+ * @param params.search - Part of the document name.
7245
+ * @param params.end_date_from - Earliest end date (`YYYY-MM-DD`).
7246
+ * @param params.end_date_to - Latest end date (`YYYY-MM-DD`).
7247
+ * @param params.ending_within_days - Inclusive 0–3650 day window from today.
7248
+ * @param params.external_system - External-reference system.
7249
+ * @param params.external_id - External-reference ID.
7250
+ * @param params.sort - `end_date` / `updated_at`, optionally prefixed by `-`.
7251
+ * @param params.expand - Pass `document` to embed each document.
7252
+ * @param params.page - One-based page number.
7253
+ * @param params.per_page - Alias normalized to the API's `per-page` spelling.
7254
+ * @param params.per-page - Page size; the deployed API returns at most 50.
7255
+ * @param accountId - Override the client's default account ID.
7256
+ * @returns Contract rows and pagination metadata:
7257
+ * ```jsonc
7258
+ * {
7259
+ * "data": [{
7260
+ * "document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
7261
+ * "status": "active",
7262
+ * "counterparty_name": "Example Ltda",
7263
+ * "counterparty_taxpayer_id": "11222333000181",
7264
+ * "value": 120000.5,
7265
+ * "currency": "BRL",
7266
+ * "start_date": "2026-11-01",
7267
+ * "end_date": "2027-10-31",
7268
+ * "auto_renew": true,
7269
+ * "renewal_term_months": 12,
7270
+ * "notice_period_days": 30,
7271
+ * "term": 1,
7272
+ * "owner_id": "d6zqpbyog2v3xvxerwn8la94",
7273
+ * "metadata": { "crm_stage": "won" },
7274
+ * "external_references": [{ "system": "crm", "id": "98765" }],
7275
+ * "created_at": "2026-10-23T12:00:00Z",
7276
+ * "updated_at": "2026-10-23T12:00:00Z"
7277
+ * }],
7278
+ * "meta": { "current_page": 1, "per_page": 20, "total": 1, "last_page": 1 }
7279
+ * }
7280
+ * ```
7281
+ * @throws {ValidationError} If a filter is malformed or no account ID is available.
7282
+ * @throws {ApiError} `400` for invalid filters, `401` for invalid credentials,
7283
+ * or `500` when the API cannot list contracts.
7284
+ *
7285
+ * @example
7286
+ * ```ts
7287
+ * const contracts = await client.contracts.list({
7288
+ * status: ['active'],
7289
+ * ending_within_days: 30,
7290
+ * expand: 'document',
7291
+ * });
7292
+ * ```
7293
+ */
7294
+ list(params?: IDocumentContractListParams, accountId?: string): Promise<IDocumentContractListResponse>;
7295
+ /**
7296
+ * Read a document's contract terms or amendment link
7297
+ * (`GET /accounts/{accountId}/documents/{documentId}/contract`).
7298
+ *
7299
+ * A root contract includes its `amendments`; a document that is itself an
7300
+ * instrument returns the `document_contract_amendment` shape. Reads remain
7301
+ * available if the workspace's plan no longer includes contract tracking.
7302
+ *
7303
+ * @param documentId - Contract or amendment document ID.
7304
+ * @param accountId - Override the client's default account ID.
7305
+ * @returns The root contract or amendment. Root-contract response:
7306
+ * ```jsonc
7307
+ * {
7308
+ * "resource": "document_contract",
7309
+ * "document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
7310
+ * "status": "active",
7311
+ * "counterparty_name": "Example Ltda",
7312
+ * "counterparty_taxpayer_id": "11222333000181",
7313
+ * "value": 130000,
7314
+ * "currency": "BRL",
7315
+ * "start_date": "2026-11-01",
7316
+ * "end_date": "2028-06-30",
7317
+ * "auto_renew": true,
7318
+ * "renewal_term_months": 12,
7319
+ * "notice_period_days": 30,
7320
+ * "term": 2,
7321
+ * "owner_id": null,
7322
+ * "metadata": null,
7323
+ * "external_references": [],
7324
+ * "amendments": [],
7325
+ * "created_at": "2026-10-23T12:00:00Z",
7326
+ * "updated_at": "2027-05-12T18:20:00Z"
7327
+ * }
7328
+ * ```
7329
+ * @throws {ValidationError} If an ID is missing or invalid.
7330
+ * @throws {ApiError} `401` for invalid credentials, `404` when the document
7331
+ * has no tracked terms, or `500` on a server error.
7332
+ *
7333
+ * @example
7334
+ * ```ts
7335
+ * const contract = await client.contracts.get(document.id);
7336
+ * if (contract.resource === 'document_contract_amendment') {
7337
+ * console.log(contract.parent_document_id);
7338
+ * }
7339
+ * ```
7340
+ */
7341
+ get(documentId: string, accountId?: string): Promise<IDocumentContract | IDocumentContractAmendment>;
7342
+ /**
7343
+ * Create or partially update contract terms
7344
+ * (`PUT /accounts/{accountId}/documents/{documentId}/contract`).
7345
+ *
7346
+ * Only supplied fields are sent. `external_references` replaces the list;
7347
+ * `parent_document_id` links this document as an instrument. Pass the
7348
+ * `updated_at` previously read to reject concurrent changes with `409`.
7349
+ * OAuth tokens need `documents:write`; writes require a contract-tracking plan.
7350
+ *
7351
+ * @param documentId - Document whose terms or amendment link will change.
7352
+ * @param payload - At least one contract attribute.
7353
+ * @param payload.status - `draft`, `active`, `expired`, or `terminated`.
7354
+ * @param payload.counterparty_name - Counterparty name; null clears it.
7355
+ * @param payload.counterparty_taxpayer_id - CPF/CNPJ; null clears it.
7356
+ * @param payload.value - Non-negative contract value; null clears it.
7357
+ * @param payload.currency - Three-letter currency; null resets as documented.
7358
+ * @param payload.start_date - Start date (`YYYY-MM-DD`), or null.
7359
+ * @param payload.end_date - End date (`YYYY-MM-DD`), or null.
7360
+ * @param payload.auto_renew - Whether the hourly lifecycle starts a new term.
7361
+ * @param payload.renewal_term_months - 1–600 months, or null for the default.
7362
+ * @param payload.notice_period_days - 0–3650 days, or null to disable notice.
7363
+ * @param payload.owner_id - Active workspace member ID, or null.
7364
+ * @param payload.metadata - Up to 50 string fields, or null.
7365
+ * @param payload.external_references - Up to 20 `{ system, id }` entries; null/[] clears.
7366
+ * @param payload.parent_document_id - Parent contract document, or null to unlink pending.
7367
+ * @param payload.relation_type - `amendment`, `renewal`, or `termination`.
7368
+ * @param payload.updated_at - Optimistic-concurrency timestamp, or null for last-write-wins.
7369
+ * @param accountId - Override the client's default account ID.
7370
+ * @returns The saved contract or amendment link. Amendment response:
7371
+ * ```jsonc
7372
+ * {
7373
+ * "resource": "document_contract_amendment",
7374
+ * "document_id": "7c3d1e2f4a5b6c7d8e9f0a1b",
7375
+ * "document_name": "Amendment 1.pdf",
7376
+ * "parent_document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
7377
+ * "relation_type": "amendment",
7378
+ * "number": null,
7379
+ * "status": "pending",
7380
+ * "document_status": "pending_signature",
7381
+ * "apply_error": null,
7382
+ * "currency": "BRL",
7383
+ * "terms": { "value": 130000, "end_date": "2028-06-30" },
7384
+ * "changes": { "value": { "from": 120000.5, "to": 130000 } },
7385
+ * "applied_at": null,
7386
+ * "created_at": "2027-05-10T15:00:00Z",
7387
+ * "updated_at": "2027-05-10T15:00:00Z"
7388
+ * }
7389
+ * ```
7390
+ * @throws {ValidationError} If the payload or an ID is malformed.
7391
+ * @throws {ApiError} `400` for invalid terms, `403` when the plan does not
7392
+ * include tracking, `404` for an unknown document, `409` after a concurrent
7393
+ * change, or `500` on a server error.
7394
+ *
7395
+ * @example
7396
+ * ```ts
7397
+ * const contract = await client.contracts.set(document.id, {
7398
+ * status: 'active',
7399
+ * counterparty_name: 'Example Ltda',
7400
+ * value: 120000.50,
7401
+ * currency: 'BRL',
7402
+ * start_date: '2026-11-01',
7403
+ * end_date: '2027-10-31',
7404
+ * });
7405
+ * ```
7406
+ */
7407
+ set(documentId: string, payload: IDocumentContractInput, accountId?: string): Promise<IDocumentContract | IDocumentContractAmendment>;
7408
+ /**
7409
+ * Read a document's complete contract family
7410
+ * (`GET /accounts/{accountId}/documents/{documentId}/contract/related`).
7411
+ *
7412
+ * The document may be the root or any linked instrument; the response is
7413
+ * always the root contract with every amendment, renewal, and termination.
7414
+ *
7415
+ * @param documentId - Any document in the contract family.
7416
+ * @param accountId - Override the client's default account ID.
7417
+ * @returns The root contract and ordered instruments:
7418
+ * ```jsonc
7419
+ * {
7420
+ * "resource": "document_contract",
7421
+ * "document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
7422
+ * "status": "active",
7423
+ * "counterparty_name": "Example Ltda",
7424
+ * "counterparty_taxpayer_id": "11222333000181",
7425
+ * "value": 130000,
7426
+ * "currency": "BRL",
7427
+ * "start_date": "2026-11-01",
7428
+ * "end_date": "2028-06-30",
7429
+ * "auto_renew": true,
7430
+ * "renewal_term_months": 12,
7431
+ * "notice_period_days": 30,
7432
+ * "term": 2,
7433
+ * "owner_id": null,
7434
+ * "metadata": null,
7435
+ * "external_references": [],
7436
+ * "amendments": [{
7437
+ * "document_id": "7c3d1e2f4a5b6c7d8e9f0a1b",
7438
+ * "document_name": "Amendment 1.pdf",
7439
+ * "parent_document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
7440
+ * "relation_type": "amendment",
7441
+ * "status": "applied",
7442
+ * "number": 1,
7443
+ * "document_status": "certificated",
7444
+ * "apply_error": null,
7445
+ * "currency": "BRL",
7446
+ * "terms": { "value": 130000, "end_date": "2028-06-30" },
7447
+ * "changes": {
7448
+ * "value": { "from": 120000.5, "to": 130000 },
7449
+ * "end_date": { "from": "2027-10-31", "to": "2028-06-30" }
7450
+ * },
7451
+ * "applied_at": "2027-05-12T18:20:00Z",
7452
+ * "created_at": "2027-05-10T15:00:00Z",
7453
+ * "updated_at": "2027-05-12T18:20:00Z"
7454
+ * }],
7455
+ * "created_at": "2026-10-23T12:00:00Z",
7456
+ * "updated_at": "2027-05-12T18:20:00Z"
7457
+ * }
7458
+ * ```
7459
+ * @throws {ValidationError} If an ID is missing or invalid.
7460
+ * @throws {ApiError} `401` for invalid credentials, `404` when no contract
7461
+ * family exists, or `500` on a server error.
7462
+ *
7463
+ * @example
7464
+ * ```ts
7465
+ * const family = await client.contracts.listRelated(amendmentDocument.id);
7466
+ * ```
7467
+ */
7468
+ listRelated(documentId: string, accountId?: string): Promise<IDocumentContract>;
7469
+ /**
7470
+ * Start a contract's next term
7471
+ * (`POST /accounts/{accountId}/documents/{documentId}/contract/renew`).
7472
+ *
7473
+ * Supply the current `term` to make a by-term renewal safe to repeat, or an
7474
+ * explicit later `end_date`. `updated_at` rejects concurrent changes. A
7475
+ * renewal reopens an expired contract but cannot reopen a terminated one.
7476
+ *
7477
+ * @param documentId - Root contract document ID.
7478
+ * @param payload - Renewal precondition and optional new date/value.
7479
+ * @param payload.end_date - Explicit new end date, or null to renew by term.
7480
+ * @param payload.value - New value; omitted keeps it and null clears it.
7481
+ * @param payload.term - Current term, required by the API when no date is sent.
7482
+ * @param payload.updated_at - Optional optimistic-concurrency timestamp.
7483
+ * @param accountId - Override the client's default account ID.
7484
+ * @returns The renewed contract:
7485
+ * ```jsonc
7486
+ * {
7487
+ * "resource": "document_contract",
7488
+ * "document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
7489
+ * "status": "active",
7490
+ * "counterparty_name": "Example Ltda",
7491
+ * "counterparty_taxpayer_id": "11222333000181",
7492
+ * "value": 130000,
7493
+ * "currency": "BRL",
7494
+ * "start_date": "2026-11-01",
7495
+ * "end_date": "2029-06-30",
7496
+ * "auto_renew": true,
7497
+ * "renewal_term_months": 12,
7498
+ * "notice_period_days": 30,
7499
+ * "term": 2,
7500
+ * "owner_id": null,
7501
+ * "metadata": null,
7502
+ * "external_references": [],
7503
+ * "created_at": "2026-10-23T12:00:00Z",
7504
+ * "updated_at": "2027-10-15T09:30:00Z"
7505
+ * }
7506
+ * ```
7507
+ * @throws {ValidationError} If the payload or an ID is malformed.
7508
+ * @throws {ApiError} `400` for an invalid renewal, `403` when tracking is
7509
+ * unavailable, `404` when terms do not exist, `409` after a concurrent
7510
+ * change, or `500` on a server error.
7511
+ *
7512
+ * @example
7513
+ * ```ts
7514
+ * const renewed = await client.contracts.renew(document.id, {
7515
+ * term: contract.term,
7516
+ * value: 130000,
7517
+ * updated_at: contract.updated_at,
7518
+ * });
7519
+ * ```
7520
+ */
7521
+ renew(documentId: string, payload: IRenewDocumentContractPayload, accountId?: string): Promise<IDocumentContract>;
7522
+ /**
7523
+ * Close a contract (`POST /accounts/{accountId}/documents/{documentId}/contract/terminate`).
7524
+ *
7525
+ * Termination stops lifecycle alerts and records the optional reason in the
7526
+ * document activity. Pass `updated_at` to reject concurrent changes.
7527
+ *
7528
+ * @param documentId - Root contract document ID.
7529
+ * @param payload - Optional reason and concurrency precondition.
7530
+ * @param payload.reason - Activity reason (up to 500 characters), or null.
7531
+ * @param payload.updated_at - Optional optimistic-concurrency timestamp.
7532
+ * @param accountId - Override the client's default account ID.
7533
+ * @returns The terminated contract:
7534
+ * ```jsonc
7535
+ * {
7536
+ * "resource": "document_contract",
7537
+ * "document_id": "66b2f0e1c3a4d5e6f7a8b9c0",
7538
+ * "status": "terminated",
7539
+ * "counterparty_name": "Example Ltda",
7540
+ * "counterparty_taxpayer_id": "11222333000181",
7541
+ * "value": 120000.5,
7542
+ * "currency": "BRL",
7543
+ * "start_date": "2026-11-01",
7544
+ * "end_date": "2027-10-31",
7545
+ * "auto_renew": false,
7546
+ * "renewal_term_months": 12,
7547
+ * "notice_period_days": 30,
7548
+ * "term": 1,
7549
+ * "owner_id": null,
7550
+ * "metadata": null,
7551
+ * "external_references": [],
7552
+ * "created_at": "2026-10-23T12:00:00Z",
7553
+ * "updated_at": "2027-03-02T14:00:00Z"
7554
+ * }
7555
+ * ```
7556
+ * @throws {ValidationError} If the payload or an ID is malformed.
7557
+ * @throws {ApiError} `400` for invalid state/input, `403` when tracking is
7558
+ * unavailable, `404` when terms do not exist, `409` after a concurrent
7559
+ * change, or `500` on a server error.
7560
+ *
7561
+ * @example
7562
+ * ```ts
7563
+ * await client.contracts.terminate(document.id, {
7564
+ * reason: 'Replaced by a new agreement',
7565
+ * updated_at: contract.updated_at,
7566
+ * });
7567
+ * ```
7568
+ */
7569
+ terminate(documentId: string, payload?: ITerminateDocumentContractPayload, accountId?: string): Promise<IDocumentContract>;
7570
+ private contractPath;
7571
+ }
7572
+
7048
7573
  /** Headers read by {@link WebhookVerifier.verifySignature}. */
7049
7574
  type WebhookHeaders = {
7050
7575
  get(name: string): string | null;
@@ -7214,6 +7739,7 @@ declare class AssinafyClient {
7214
7739
  readonly fields: FieldsResource;
7215
7740
  readonly signerDocuments: SignerDocumentsResource;
7216
7741
  readonly users: UserResource;
7742
+ readonly contracts: ContractResource;
7217
7743
  readonly webhookVerifier: WebhookVerifier;
7218
7744
  /**
7219
7745
  * Create a client. Supply `apiKey` (preferred, sent as `X-Api-Key`) or a
@@ -7692,4 +8218,4 @@ declare const MAX_LIST_PAGE_SIZE = 50;
7692
8218
 
7693
8219
  declare const SDK_USER_AGENT: string;
7694
8220
 
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 };
8221
+ export { type AccountLogoUploadSource, type AnyString, ApiError, type AssignmentDisplaySettings, type AssignmentMethod, type AssignmentNotificationMethod, AssignmentResource, type AssignmentVerificationMethod, AssinafyClient, type AssinafyClientOptions, AssinafyError, AuthenticationResource, type ClientConfigInput, ContractResource, DEFAULT_WEBHOOK_EVENTS, DIGITAL_CERTIFICATE_REQUIRES_VIRTUAL_METHOD, type DocumentArtifactName, type DocumentContractRelationType, type DocumentContractStatus, 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 IDocumentContract, type IDocumentContractAmendment, type IDocumentContractExternalReference, type IDocumentContractInput, type IDocumentContractListParams, type IDocumentContractListResponse, 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 IRenewDocumentContractPayload, 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 ISigningUrl, type IStartIdentityVerificationPayload, type ITag, type ITemplateCostSigner, type ITemplateDetailsResponse, type ITemplateFieldPlacement, type ITemplateListItem, type ITemplateListParams, type ITemplateListResponse, type ITemplateRole, type ITemplateSigner, type ITerminateDocumentContractPayload, 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 };