@assinafy/sdk 2.6.0 → 2.7.1
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 +61 -1
- package/README.en.md +69 -26
- package/README.md +54 -24
- package/SECURITY.md +9 -4
- package/dist/index.d.mts +173 -64
- package/dist/index.d.ts +173 -64
- package/dist/index.js +199 -76
- package/dist/index.mjs +199 -76
- package/docs/API_COVERAGE.md +9 -7
- package/docs/COMPATIBILITY.md +7 -17
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -868,6 +868,8 @@ interface IUpdateTemplatePayload {
|
|
|
868
868
|
}
|
|
869
869
|
/** Template list item (paginated). */
|
|
870
870
|
interface ITemplateListItem {
|
|
871
|
+
/** Always `template`. */
|
|
872
|
+
resource?: string;
|
|
871
873
|
id: string;
|
|
872
874
|
name: string;
|
|
873
875
|
document_name?: string | null;
|
|
@@ -1024,8 +1026,33 @@ interface IDocumentVerification {
|
|
|
1024
1026
|
is_valid: boolean;
|
|
1025
1027
|
message: string;
|
|
1026
1028
|
}
|
|
1027
|
-
/** Channel accepted by the `send-token` endpoint
|
|
1028
|
-
type SendTokenChannel = 'email'
|
|
1029
|
+
/** Channel accepted by the `send-token` endpoint; the contract allows only `email`. */
|
|
1030
|
+
type SendTokenChannel = 'email';
|
|
1031
|
+
/**
|
|
1032
|
+
* `data` returned by `PUT /public/documents/{documentId}/send-token`.
|
|
1033
|
+
*
|
|
1034
|
+
* ```jsonc
|
|
1035
|
+
* {
|
|
1036
|
+
* "document": { "resource": "document", "id": "a1b2…", "name": "Contract.pdf", "page_count": 3, "created_by": "Jane Doe" },
|
|
1037
|
+
* "channel": "email",
|
|
1038
|
+
* "recipient": "signer@example.com"
|
|
1039
|
+
* }
|
|
1040
|
+
* ```
|
|
1041
|
+
*/
|
|
1042
|
+
interface ISendTokenResult {
|
|
1043
|
+
/** Summary of the document the token unlocks. */
|
|
1044
|
+
document: {
|
|
1045
|
+
resource: string;
|
|
1046
|
+
id: string;
|
|
1047
|
+
name: string;
|
|
1048
|
+
page_count: number;
|
|
1049
|
+
created_by: string;
|
|
1050
|
+
};
|
|
1051
|
+
/** Channel the token was sent through. */
|
|
1052
|
+
channel: string;
|
|
1053
|
+
/** Address the token was sent to. */
|
|
1054
|
+
recipient: string;
|
|
1055
|
+
}
|
|
1029
1056
|
/** Authenticated user profile returned by login and `users.getCurrent()`. */
|
|
1030
1057
|
interface IAuthenticatedUser {
|
|
1031
1058
|
id: string;
|
|
@@ -1365,6 +1392,12 @@ interface IOAuthTokenResponse {
|
|
|
1365
1392
|
scope?: string;
|
|
1366
1393
|
/** Signed OIDC identity token (RS256). Present only when `openid` was granted. */
|
|
1367
1394
|
id_token?: string | null;
|
|
1395
|
+
/**
|
|
1396
|
+
* RFC 8693 token type. Returned only by the token-exchange grant, which is
|
|
1397
|
+
* reserved for Assinafy's own services; absent from the two grants the SDK
|
|
1398
|
+
* sends.
|
|
1399
|
+
*/
|
|
1400
|
+
issued_token_type?: string;
|
|
1368
1401
|
}
|
|
1369
1402
|
/** OpenID Connect claims returned by `GET /oauth/userinfo`. */
|
|
1370
1403
|
interface IOAuthUserInfo {
|
|
@@ -2274,59 +2307,48 @@ declare class DocumentResource extends BaseResource {
|
|
|
2274
2307
|
*/
|
|
2275
2308
|
getPublic(documentId: string): Promise<IPublicDocumentInfo>;
|
|
2276
2309
|
/**
|
|
2277
|
-
*
|
|
2310
|
+
* Email the signer the verification token that unlocks a document
|
|
2278
2311
|
* (`PUT /public/documents/{documentId}/send-token`).
|
|
2279
2312
|
*
|
|
2280
2313
|
* Part of the public signing flow: dispatches the 6-digit verification
|
|
2281
|
-
* token the signer enters to view the document.
|
|
2282
|
-
*
|
|
2283
|
-
*
|
|
2284
|
-
* `{ recipient, channel }`; the two-argument documented call also retries
|
|
2285
|
-
* that legacy shape only when the server explicitly reports that
|
|
2286
|
-
* `channel`/`recipient` is required.
|
|
2314
|
+
* token the signer enters to view the document. Runs on the
|
|
2315
|
+
* credential-free transport. The contract accepts only the `email`
|
|
2316
|
+
* channel, and both body fields are required.
|
|
2287
2317
|
*
|
|
2288
2318
|
* Request body (`application/json`):
|
|
2289
2319
|
* ```jsonc
|
|
2290
|
-
* { "email": "signer@example.com" }
|
|
2291
|
-
* ```
|
|
2292
|
-
* Compatibility fallback or explicit-channel body:
|
|
2293
|
-
* ```jsonc
|
|
2294
|
-
* { "recipient": "signer@example.com", "channel": "email" }
|
|
2320
|
+
* { "channel": "email", "recipient": "signer@example.com" }
|
|
2295
2321
|
* ```
|
|
2296
2322
|
*
|
|
2297
2323
|
* @param documentId - The document to send the token for.
|
|
2298
|
-
* @param recipient - The signer's email address
|
|
2299
|
-
*
|
|
2300
|
-
* @
|
|
2301
|
-
*
|
|
2302
|
-
*
|
|
2303
|
-
*
|
|
2304
|
-
*
|
|
2305
|
-
*
|
|
2306
|
-
*
|
|
2307
|
-
*
|
|
2308
|
-
*
|
|
2309
|
-
*
|
|
2310
|
-
*
|
|
2324
|
+
* @param recipient - The signer's email address.
|
|
2325
|
+
* @param channel - Delivery channel; only `email` is accepted (default).
|
|
2326
|
+
* @returns The delivery confirmation (`data` of the envelope):
|
|
2327
|
+
* ```jsonc
|
|
2328
|
+
* {
|
|
2329
|
+
* "document": {
|
|
2330
|
+
* "resource": "document",
|
|
2331
|
+
* "id": "a1b2c3d4e5f6a7b8c9d0",
|
|
2332
|
+
* "name": "Contract.pdf",
|
|
2333
|
+
* "page_count": 3,
|
|
2334
|
+
* "created_by": "Jane Doe"
|
|
2335
|
+
* },
|
|
2336
|
+
* "channel": "email",
|
|
2337
|
+
* "recipient": "signer@example.com"
|
|
2338
|
+
* }
|
|
2311
2339
|
* ```
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
*
|
|
2316
|
-
*
|
|
2317
|
-
* Sends JSON `{ "recipient": "+5511999998888", "channel": "whatsapp" }`.
|
|
2318
|
-
* @param documentId - Document identifier.
|
|
2319
|
-
* @param recipient - Controlled email address or WhatsApp number.
|
|
2320
|
-
* @param channel - Delivery channel, `email` or `whatsapp`.
|
|
2321
|
-
* @returns Nothing; the acknowledgement body is discarded.
|
|
2322
|
-
* @throws {ValidationError} If an argument is empty.
|
|
2323
|
-
* @throws {ApiError} If delivery is rejected.
|
|
2340
|
+
* @throws {ValidationError} If `documentId` is missing, `recipient` is not
|
|
2341
|
+
* a valid email address, or `channel` is not `email`.
|
|
2342
|
+
* @throws {ApiError} `400` if validation fails; `404` if the document does
|
|
2343
|
+
* not exist.
|
|
2344
|
+
*
|
|
2324
2345
|
* @example
|
|
2325
2346
|
* ```ts
|
|
2326
|
-
* await client.documents.sendToken('doc-1', 'signer@example.com'
|
|
2347
|
+
* const sent = await client.documents.sendToken('doc-1', 'signer@example.com');
|
|
2348
|
+
* console.log(sent.recipient);
|
|
2327
2349
|
* ```
|
|
2328
2350
|
*/
|
|
2329
|
-
sendToken(documentId: string, recipient: string, channel
|
|
2351
|
+
sendToken(documentId: string, recipient: string, channel?: SendTokenChannel): Promise<ISendTokenResult>;
|
|
2330
2352
|
/**
|
|
2331
2353
|
* Quick boolean check (`GET /documents/{documentId}`): has every signer
|
|
2332
2354
|
* completed their assignment?
|
|
@@ -2957,10 +2979,10 @@ declare class WorkspaceResource extends BaseResource {
|
|
|
2957
2979
|
* ```ts
|
|
2958
2980
|
* const body = buildAssignmentPayload({
|
|
2959
2981
|
* method: 'virtual',
|
|
2960
|
-
* signers: ['signer-1', { signer_id: 'signer-2', step: 2 }],
|
|
2982
|
+
* signers: [{ signer_id: 'signer-1', step: 1 }, { signer_id: 'signer-2', step: 2 }],
|
|
2961
2983
|
* message: 'Please sign',
|
|
2962
2984
|
* });
|
|
2963
|
-
* // body.signers → [{ id: 'signer-1' }, { id: 'signer-2', step: 2 }]
|
|
2985
|
+
* // body.signers → [{ id: 'signer-1', step: 1 }, { id: 'signer-2', step: 2 }]
|
|
2964
2986
|
* ```
|
|
2965
2987
|
*/
|
|
2966
2988
|
declare function buildAssignmentPayload(payload: ICreateAssignmentPayload): Record<string, unknown>;
|
|
@@ -3250,9 +3272,10 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3250
3272
|
* Update the expiration date of an existing assignment
|
|
3251
3273
|
* (`PUT /documents/{documentId}/assignments/{assignmentId}/reset-expiration`).
|
|
3252
3274
|
*
|
|
3253
|
-
* Sends `{ expires_at }` verbatim
|
|
3254
|
-
*
|
|
3255
|
-
*
|
|
3275
|
+
* Sends `{ expires_at }` verbatim; the key itself is required by the
|
|
3276
|
+
* contract. Use an ISO-8601 date/time string, or `null` to remove the
|
|
3277
|
+
* expiration — `null` is the documented clear mechanism and, unlike
|
|
3278
|
+
* ordinary nullable inputs, is intentionally not stripped from the body.
|
|
3256
3279
|
*
|
|
3257
3280
|
* Request body (`application/json`):
|
|
3258
3281
|
* ```jsonc
|
|
@@ -3263,8 +3286,8 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3263
3286
|
*
|
|
3264
3287
|
* @param documentId - The document the assignment belongs to.
|
|
3265
3288
|
* @param assignmentId - The assignment to update.
|
|
3266
|
-
* @param expiresAt - New expiry as an ISO-8601 date/time string
|
|
3267
|
-
*
|
|
3289
|
+
* @param expiresAt - New expiry as an ISO-8601 date/time string, or `null`
|
|
3290
|
+
* to remove the expiration.
|
|
3268
3291
|
* @returns The updated {@link IAssignment} — the same full shape
|
|
3269
3292
|
* {@link AssignmentResource.create} returns (`signers`, `items`, `summary`,
|
|
3270
3293
|
* `signing_urls`), with `expires_at` reflecting the new value:
|
|
@@ -4197,7 +4220,7 @@ declare class TemplateResource extends BaseResource {
|
|
|
4197
4220
|
* ```ts
|
|
4198
4221
|
* const tmpl = await client.templates.get('103ad2171db7979468c3e97eb067');
|
|
4199
4222
|
* const jpeg = await client.templates.downloadPage(tmpl.id, tmpl.pages[0].id);
|
|
4200
|
-
* await fs.writeFile('page-1.jpg', jpeg);
|
|
4223
|
+
* await fs.promises.writeFile('page-1.jpg', jpeg);
|
|
4201
4224
|
* ```
|
|
4202
4225
|
*/
|
|
4203
4226
|
downloadPage(templateId: string, pageId: string, accountId?: string): Promise<Buffer>;
|
|
@@ -4472,10 +4495,10 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
4472
4495
|
* ]
|
|
4473
4496
|
* }
|
|
4474
4497
|
* ```
|
|
4475
|
-
* @throws {ValidationError} If `email` or `password` is missing.
|
|
4476
4498
|
* When the user has two-factor authentication enabled the response carries
|
|
4477
4499
|
* an `mfa_token` instead of a usable session; finish with
|
|
4478
4500
|
* {@link AuthenticationResource.verifyMfa}.
|
|
4501
|
+
* @throws {ValidationError} If `email` or `password` is missing.
|
|
4479
4502
|
* @throws {ApiError} `400` if the credentials are rejected.
|
|
4480
4503
|
*
|
|
4481
4504
|
* @example
|
|
@@ -4597,13 +4620,6 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
4597
4620
|
* Link a Google identity to the authenticated user
|
|
4598
4621
|
* (`POST /auth/link-social-login`).
|
|
4599
4622
|
*
|
|
4600
|
-
* Request body:
|
|
4601
|
-
* ```jsonc
|
|
4602
|
-
* { "provider": "google", "token": "provider-issued-token" }
|
|
4603
|
-
* ```
|
|
4604
|
-
* The response is the standard status/message acknowledgement with no data,
|
|
4605
|
-
* so this method resolves to `void`.
|
|
4606
|
-
*
|
|
4607
4623
|
* Request body (`application/json`):
|
|
4608
4624
|
* ```jsonc
|
|
4609
4625
|
* {
|
|
@@ -4611,6 +4627,8 @@ declare class AuthenticationResource extends BaseResource {
|
|
|
4611
4627
|
* "token": "provider_token_example"
|
|
4612
4628
|
* }
|
|
4613
4629
|
* ```
|
|
4630
|
+
* The response is the standard status/message acknowledgement with no data,
|
|
4631
|
+
* so this method resolves to `void`.
|
|
4614
4632
|
*
|
|
4615
4633
|
* @param payload - Social provider and provider-issued access/ID token.
|
|
4616
4634
|
* @returns Resolves when the API acknowledges that the identity was linked.
|
|
@@ -5269,6 +5287,11 @@ declare class OAuthResource extends BaseResource {
|
|
|
5269
5287
|
* already-revoked included — so the endpoint cannot be used to probe
|
|
5270
5288
|
* whether a token exists. Only failed client authentication returns `401`.
|
|
5271
5289
|
*
|
|
5290
|
+
* Request body (`application/x-www-form-urlencoded`):
|
|
5291
|
+
* ```text
|
|
5292
|
+
* token=def50200f1e2…&token_type_hint=refresh_token&client_id=cli_1a2b3c&client_secret=…
|
|
5293
|
+
* ```
|
|
5294
|
+
*
|
|
5272
5295
|
* @param options - Revocation options.
|
|
5273
5296
|
* @param options.token - The access or refresh token to revoke.
|
|
5274
5297
|
* @param options.clientId - The application's `client_id`.
|
|
@@ -5277,10 +5300,6 @@ declare class OAuthResource extends BaseResource {
|
|
|
5277
5300
|
* @param options.tokenTypeHint - Optional `access_token` or
|
|
5278
5301
|
* `refresh_token` hint that lets the server skip a lookup.
|
|
5279
5302
|
* @returns Nothing; resolves once the API acknowledges the request.
|
|
5280
|
-
* Request body (`application/x-www-form-urlencoded`):
|
|
5281
|
-
* ```text
|
|
5282
|
-
* token=def50200f1e2…&token_type_hint=refresh_token&client_id=cli_1a2b3c&client_secret=…
|
|
5283
|
-
* ```
|
|
5284
5303
|
* @throws {ValidationError} If `token` or `clientId` is missing, or
|
|
5285
5304
|
* `tokenTypeHint` is not one of the two documented values.
|
|
5286
5305
|
* @throws {OAuthError} `invalid_client` when client authentication fails.
|
|
@@ -5681,6 +5700,12 @@ declare class FieldsResource extends BaseResource {
|
|
|
5681
5700
|
*/
|
|
5682
5701
|
declare class SignerDocumentsResource extends BaseResource {
|
|
5683
5702
|
constructor(http: AxiosInstance, defaultAccountId?: string, logger?: Logger, publicHttp?: AxiosInstance);
|
|
5703
|
+
/**
|
|
5704
|
+
* Credentialed transport used only by the explicit `*AsWorkspace` methods.
|
|
5705
|
+
* Every access-code method stays on the credential-free `http`, so a
|
|
5706
|
+
* signer code and the API key or bearer token never share a request.
|
|
5707
|
+
*/
|
|
5708
|
+
private readonly workspaceHttp;
|
|
5684
5709
|
/**
|
|
5685
5710
|
* Fetch the document currently awaiting a given signer
|
|
5686
5711
|
* (`GET /signers/{signer_id}/document?signer-access-code=…`).
|
|
@@ -5823,6 +5848,54 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5823
5848
|
* ```
|
|
5824
5849
|
*/
|
|
5825
5850
|
search(signerId: string, signerAccessCode: string, search?: string): Promise<IDocumentListResponse>;
|
|
5851
|
+
/**
|
|
5852
|
+
* List a signer's documents with the workspace credentials
|
|
5853
|
+
* (`GET /signers/{signer_id}/documents`).
|
|
5854
|
+
*
|
|
5855
|
+
* The same operation as {@link SignerDocumentsResource.list}, authorised by
|
|
5856
|
+
* the client's API key or OAuth bearer token instead of a signer access
|
|
5857
|
+
* code. No `signer-access-code` is sent.
|
|
5858
|
+
*
|
|
5859
|
+
* @param signerId - The signer whose documents are listed.
|
|
5860
|
+
* @param params - Pagination: `page`, `per-page` (also accepts `per_page`).
|
|
5861
|
+
* @returns Documents in the compact {@link IDocumentListItem} shape, with
|
|
5862
|
+
* pagination in `meta` (same shape as {@link SignerDocumentsResource.list}):
|
|
5863
|
+
* ```jsonc
|
|
5864
|
+
* {
|
|
5865
|
+
* "data": [{ "id": "103acccd24234c07858ffddf6d84", "name": "Service agreement.pdf", "status": "pending_signature" }],
|
|
5866
|
+
* "meta": { "current_page": 1, "per_page": 20, "total": 1, "last_page": 1 }
|
|
5867
|
+
* }
|
|
5868
|
+
* ```
|
|
5869
|
+
* @throws {ValidationError} If `signerId` is missing.
|
|
5870
|
+
* @throws {ApiError} `401` if the workspace credentials are rejected.
|
|
5871
|
+
*
|
|
5872
|
+
* @example
|
|
5873
|
+
* ```ts
|
|
5874
|
+
* const { data } = await client.signerDocuments.listAsWorkspace(signerId, { page: 1 });
|
|
5875
|
+
* ```
|
|
5876
|
+
*/
|
|
5877
|
+
listAsWorkspace(signerId: string, params?: IListParams): Promise<IDocumentListResponse>;
|
|
5878
|
+
/**
|
|
5879
|
+
* Search a signer's documents with the workspace credentials
|
|
5880
|
+
* (`GET /signers/{signer_id}/documents/search`).
|
|
5881
|
+
*
|
|
5882
|
+
* The same operation as {@link SignerDocumentsResource.search}, authorised
|
|
5883
|
+
* by the client's API key or OAuth bearer token instead of a signer access
|
|
5884
|
+
* code. No `signer-access-code` is sent.
|
|
5885
|
+
*
|
|
5886
|
+
* @param signerId - The signer whose documents are searched.
|
|
5887
|
+
* @param search - Free-text term matched against the document name.
|
|
5888
|
+
* @returns Matching documents with pagination in `meta`, as
|
|
5889
|
+
* {@link SignerDocumentsResource.listAsWorkspace} returns.
|
|
5890
|
+
* @throws {ValidationError} If `signerId` is missing or `search` is not a string.
|
|
5891
|
+
* @throws {ApiError} `401` if the workspace credentials are rejected.
|
|
5892
|
+
*
|
|
5893
|
+
* @example
|
|
5894
|
+
* ```ts
|
|
5895
|
+
* const { data } = await client.signerDocuments.searchAsWorkspace(signerId, 'agreement');
|
|
5896
|
+
* ```
|
|
5897
|
+
*/
|
|
5898
|
+
searchAsWorkspace(signerId: string, search?: string): Promise<IDocumentListResponse>;
|
|
5826
5899
|
/**
|
|
5827
5900
|
* Download one of a signer's document artifacts as raw bytes
|
|
5828
5901
|
* (`GET /signers/{signer_id}/documents/{document_id}/download/{artifact}`).
|
|
@@ -5856,7 +5929,7 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
5856
5929
|
* documentId,
|
|
5857
5930
|
* 'original',
|
|
5858
5931
|
* );
|
|
5859
|
-
* await fs.writeFile('to-sign.pdf', pdf);
|
|
5932
|
+
* await fs.promises.writeFile('to-sign.pdf', pdf);
|
|
5860
5933
|
* ```
|
|
5861
5934
|
*/
|
|
5862
5935
|
download(signerId: string, documentId: string, artifactName: DocumentArtifactName, signerAccessCode?: string): Promise<Buffer>;
|
|
@@ -6179,7 +6252,7 @@ declare class SignerDocumentsResource extends BaseResource {
|
|
|
6179
6252
|
* @example
|
|
6180
6253
|
* ```ts
|
|
6181
6254
|
* const png = await client.signerDocuments.downloadSignature(accessCode, 'signature');
|
|
6182
|
-
* await fs.writeFile('signature.png', png);
|
|
6255
|
+
* await fs.promises.writeFile('signature.png', png);
|
|
6183
6256
|
* ```
|
|
6184
6257
|
*/
|
|
6185
6258
|
downloadSignature(signerAccessCode: string, imageType?: SignatureImageType): Promise<Buffer>;
|
|
@@ -7071,6 +7144,23 @@ interface IAuthenticateChallenge {
|
|
|
7071
7144
|
* ```
|
|
7072
7145
|
*/
|
|
7073
7146
|
declare function parseWwwAuthenticate(value: string | undefined): IAuthenticateChallenge | undefined;
|
|
7147
|
+
/**
|
|
7148
|
+
* Rate-limit state reported by the API's response headers.
|
|
7149
|
+
*
|
|
7150
|
+
* Every rate-limited response carries the `X-Rate-Limit-*` trio; a `429 Too
|
|
7151
|
+
* Many Requests` adds `Retry-After`. Absent or non-numeric headers are left
|
|
7152
|
+
* out rather than guessed.
|
|
7153
|
+
*/
|
|
7154
|
+
interface IRateLimitInfo {
|
|
7155
|
+
/** `X-Rate-Limit-Limit` — requests allowed in the current window. */
|
|
7156
|
+
limit?: number;
|
|
7157
|
+
/** `X-Rate-Limit-Remaining` — requests left in the current window. */
|
|
7158
|
+
remaining?: number;
|
|
7159
|
+
/** `X-Rate-Limit-Reset` — seconds until the window resets. */
|
|
7160
|
+
reset?: number;
|
|
7161
|
+
/** `Retry-After` — seconds to wait before retrying (sent on `429`). */
|
|
7162
|
+
retryAfter?: number;
|
|
7163
|
+
}
|
|
7074
7164
|
|
|
7075
7165
|
/** Base class for all Assinafy SDK errors. */
|
|
7076
7166
|
declare class AssinafyError extends Error {
|
|
@@ -7116,6 +7206,25 @@ declare class ApiError extends AssinafyError {
|
|
|
7116
7206
|
* ```
|
|
7117
7207
|
*/
|
|
7118
7208
|
challenge?: IAuthenticateChallenge;
|
|
7209
|
+
/**
|
|
7210
|
+
* Rate-limit headers carried by the failed response: `X-Rate-Limit-Limit`,
|
|
7211
|
+
* `X-Rate-Limit-Remaining`, `X-Rate-Limit-Reset` and, on `429`,
|
|
7212
|
+
* `Retry-After` (all in requests or seconds). `undefined` when the response
|
|
7213
|
+
* carried none of them. The client already retries a `429` up to
|
|
7214
|
+
* `maxRetries` times; this is what remains once those retries are spent.
|
|
7215
|
+
*
|
|
7216
|
+
* @example
|
|
7217
|
+
* ```ts
|
|
7218
|
+
* try {
|
|
7219
|
+
* await client.documents.list();
|
|
7220
|
+
* } catch (error) {
|
|
7221
|
+
* if (error instanceof ApiError && error.statusCode === 429) {
|
|
7222
|
+
* await sleep((error.rateLimit?.retryAfter ?? 60) * 1000);
|
|
7223
|
+
* }
|
|
7224
|
+
* }
|
|
7225
|
+
* ```
|
|
7226
|
+
*/
|
|
7227
|
+
rateLimit?: IRateLimitInfo;
|
|
7119
7228
|
/**
|
|
7120
7229
|
* Create an error representing a non-success API response.
|
|
7121
7230
|
*
|
|
@@ -7254,4 +7363,4 @@ declare const MAX_LIST_PAGE_SIZE = 50;
|
|
|
7254
7363
|
|
|
7255
7364
|
declare const SDK_USER_AGENT: string;
|
|
7256
7365
|
|
|
7257
|
-
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 IRenameDocumentResponse, type IResendCostEstimate, type IResendEmailResponse, 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 };
|
|
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 };
|