@assinafy/sdk 2.7.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 +30 -1
- package/README.en.md +7 -7
- package/README.md +6 -7
- package/dist/index.d.mts +154 -38
- package/dist/index.d.ts +154 -38
- package/dist/index.js +174 -49
- package/dist/index.mjs +174 -49
- package/docs/API_COVERAGE.md +8 -6
- package/docs/COMPATIBILITY.md +4 -15
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -55,6 +55,25 @@ var ApiError = class _ApiError extends AssinafyError {
|
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
57
|
challenge;
|
|
58
|
+
/**
|
|
59
|
+
* Rate-limit headers carried by the failed response: `X-Rate-Limit-Limit`,
|
|
60
|
+
* `X-Rate-Limit-Remaining`, `X-Rate-Limit-Reset` and, on `429`,
|
|
61
|
+
* `Retry-After` (all in requests or seconds). `undefined` when the response
|
|
62
|
+
* carried none of them. The client already retries a `429` up to
|
|
63
|
+
* `maxRetries` times; this is what remains once those retries are spent.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* try {
|
|
68
|
+
* await client.documents.list();
|
|
69
|
+
* } catch (error) {
|
|
70
|
+
* if (error instanceof ApiError && error.statusCode === 429) {
|
|
71
|
+
* await sleep((error.rateLimit?.retryAfter ?? 60) * 1000);
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
rateLimit;
|
|
58
77
|
/**
|
|
59
78
|
* Create an error representing a non-success API response.
|
|
60
79
|
*
|
|
@@ -160,6 +179,7 @@ var OAuthError = class _OAuthError extends ApiError {
|
|
|
160
179
|
body
|
|
161
180
|
);
|
|
162
181
|
if (error.challenge !== void 0) upgraded.challenge = error.challenge;
|
|
182
|
+
if (error.rateLimit !== void 0) upgraded.rateLimit = error.rateLimit;
|
|
163
183
|
return upgraded;
|
|
164
184
|
}
|
|
165
185
|
};
|
|
@@ -237,6 +257,20 @@ function parseWwwAuthenticate(value) {
|
|
|
237
257
|
}
|
|
238
258
|
return challenge;
|
|
239
259
|
}
|
|
260
|
+
var RATE_LIMIT_HEADERS = [
|
|
261
|
+
["limit", "x-rate-limit-limit"],
|
|
262
|
+
["remaining", "x-rate-limit-remaining"],
|
|
263
|
+
["reset", "x-rate-limit-reset"],
|
|
264
|
+
["retryAfter", "retry-after"]
|
|
265
|
+
];
|
|
266
|
+
function parseRateLimit(headers) {
|
|
267
|
+
const info = {};
|
|
268
|
+
for (const [key, header2] of RATE_LIMIT_HEADERS) {
|
|
269
|
+
const value = readHeader(headers, header2)?.trim();
|
|
270
|
+
if (value !== void 0 && /^\d+$/u.test(value)) info[key] = Number(value);
|
|
271
|
+
}
|
|
272
|
+
return Object.keys(info).length > 0 ? info : void 0;
|
|
273
|
+
}
|
|
240
274
|
|
|
241
275
|
// src/utils.ts
|
|
242
276
|
var SAFE_LOG_NUMBER_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -283,10 +317,11 @@ function toSdkError(error, fallbackMessage) {
|
|
|
283
317
|
if (status) {
|
|
284
318
|
const body = decodeBinaryErrorBody(error.response?.data ?? null);
|
|
285
319
|
const apiError = ApiError.fromResponse(status, body ?? null);
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
);
|
|
320
|
+
const headers = error.response?.headers;
|
|
321
|
+
const challenge = parseWwwAuthenticate(readHeader(headers, "www-authenticate"));
|
|
289
322
|
if (challenge) apiError.challenge = challenge;
|
|
323
|
+
const rateLimit = parseRateLimit(headers);
|
|
324
|
+
if (rateLimit) apiError.rateLimit = rateLimit;
|
|
290
325
|
return apiError;
|
|
291
326
|
}
|
|
292
327
|
const cause = sanitiseNetworkCause(error);
|
|
@@ -592,7 +627,7 @@ import axios2 from "axios";
|
|
|
592
627
|
// package.json
|
|
593
628
|
var package_default = {
|
|
594
629
|
name: "@assinafy/sdk",
|
|
595
|
-
version: "2.7.
|
|
630
|
+
version: "2.7.1",
|
|
596
631
|
packageManager: "bun@1.4.0",
|
|
597
632
|
description: "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
598
633
|
type: "commonjs",
|
|
@@ -655,7 +690,7 @@ var package_default = {
|
|
|
655
690
|
bugs: {
|
|
656
691
|
url: "https://github.com/assinafy/typescript-sdk/issues"
|
|
657
692
|
},
|
|
658
|
-
homepage: "https://
|
|
693
|
+
homepage: "https://www.assinafy.com.br",
|
|
659
694
|
devDependencies: {
|
|
660
695
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
661
696
|
"@eslint/js": "^10.0.1",
|
|
@@ -2764,32 +2799,63 @@ var DocumentResource = class extends BaseResource {
|
|
|
2764
2799
|
() => this.publicHttp.get(`/public/documents/${this.pathSegment(id, "Document ID")}`)
|
|
2765
2800
|
);
|
|
2766
2801
|
}
|
|
2767
|
-
|
|
2802
|
+
/**
|
|
2803
|
+
* Email the signer the verification token that unlocks a document
|
|
2804
|
+
* (`PUT /public/documents/{documentId}/send-token`).
|
|
2805
|
+
*
|
|
2806
|
+
* Part of the public signing flow: dispatches the 6-digit verification
|
|
2807
|
+
* token the signer enters to view the document. Runs on the
|
|
2808
|
+
* credential-free transport. The contract accepts only the `email`
|
|
2809
|
+
* channel, and both body fields are required.
|
|
2810
|
+
*
|
|
2811
|
+
* Request body (`application/json`):
|
|
2812
|
+
* ```jsonc
|
|
2813
|
+
* { "channel": "email", "recipient": "signer@example.com" }
|
|
2814
|
+
* ```
|
|
2815
|
+
*
|
|
2816
|
+
* @param documentId - The document to send the token for.
|
|
2817
|
+
* @param recipient - The signer's email address.
|
|
2818
|
+
* @param channel - Delivery channel; only `email` is accepted (default).
|
|
2819
|
+
* @returns The delivery confirmation (`data` of the envelope):
|
|
2820
|
+
* ```jsonc
|
|
2821
|
+
* {
|
|
2822
|
+
* "document": {
|
|
2823
|
+
* "resource": "document",
|
|
2824
|
+
* "id": "a1b2c3d4e5f6a7b8c9d0",
|
|
2825
|
+
* "name": "Contract.pdf",
|
|
2826
|
+
* "page_count": 3,
|
|
2827
|
+
* "created_by": "Jane Doe"
|
|
2828
|
+
* },
|
|
2829
|
+
* "channel": "email",
|
|
2830
|
+
* "recipient": "signer@example.com"
|
|
2831
|
+
* }
|
|
2832
|
+
* ```
|
|
2833
|
+
* @throws {ValidationError} If `documentId` is missing, `recipient` is not
|
|
2834
|
+
* a valid email address, or `channel` is not `email`.
|
|
2835
|
+
* @throws {ApiError} `400` if validation fails; `404` if the document does
|
|
2836
|
+
* not exist.
|
|
2837
|
+
*
|
|
2838
|
+
* @example
|
|
2839
|
+
* ```ts
|
|
2840
|
+
* const sent = await client.documents.sendToken('doc-1', 'signer@example.com');
|
|
2841
|
+
* console.log(sent.recipient);
|
|
2842
|
+
* ```
|
|
2843
|
+
*/
|
|
2844
|
+
async sendToken(documentId, recipient, channel = "email") {
|
|
2768
2845
|
const id = this.requireId(documentId, "Document ID");
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
if (channel === void 0 && !isEmail(recipient)) {
|
|
2772
|
-
throw new ValidationError("recipient must be a valid email address");
|
|
2773
|
-
}
|
|
2774
|
-
const path2 = `/public/documents/${this.pathSegment(id, "Document ID")}/send-token`;
|
|
2775
|
-
if (channel !== void 0) {
|
|
2776
|
-
return this.callVoid(
|
|
2777
|
-
"Failed to send signing token",
|
|
2778
|
-
() => this.publicHttp.put(path2, { recipient, channel })
|
|
2779
|
-
);
|
|
2846
|
+
if (channel !== "email") {
|
|
2847
|
+
throw new ValidationError('channel must be "email"', { channel });
|
|
2780
2848
|
}
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
"Failed to send signing token",
|
|
2784
|
-
() => this.publicHttp.put(path2, { email: recipient })
|
|
2785
|
-
);
|
|
2786
|
-
} catch (error) {
|
|
2787
|
-
if (!isLegacySendTokenValidation(error)) throw error;
|
|
2788
|
-
return this.callVoid(
|
|
2789
|
-
"Failed to send signing token",
|
|
2790
|
-
() => this.publicHttp.put(path2, { recipient, channel: "email" })
|
|
2791
|
-
);
|
|
2849
|
+
if (!isEmail(recipient)) {
|
|
2850
|
+
throw new ValidationError("recipient must be a valid email address");
|
|
2792
2851
|
}
|
|
2852
|
+
return this.call(
|
|
2853
|
+
"Failed to send signing token",
|
|
2854
|
+
() => this.publicHttp.put(
|
|
2855
|
+
`/public/documents/${this.pathSegment(id, "Document ID")}/send-token`,
|
|
2856
|
+
{ channel, recipient }
|
|
2857
|
+
)
|
|
2858
|
+
);
|
|
2793
2859
|
}
|
|
2794
2860
|
/**
|
|
2795
2861
|
* Quick boolean check (`GET /documents/{documentId}`): has every signer
|
|
@@ -2935,23 +3001,6 @@ function validateWaitOption(value, name) {
|
|
|
2935
3001
|
function sleep(ms) {
|
|
2936
3002
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
2937
3003
|
}
|
|
2938
|
-
function isLegacySendTokenValidation(error) {
|
|
2939
|
-
if (!(error instanceof ApiError) || error.statusCode !== 400 && error.statusCode !== 422) {
|
|
2940
|
-
return false;
|
|
2941
|
-
}
|
|
2942
|
-
const namesLegacyField = /\b(?:channel|recipient)\b/iu.test(error.message);
|
|
2943
|
-
const saysRequired = /\b(?:required|obrigat[oó]ri[oa])\b/iu.test(error.message);
|
|
2944
|
-
if (namesLegacyField && saysRequired) return true;
|
|
2945
|
-
const response = error.responseData;
|
|
2946
|
-
if (!response || typeof response !== "object" || Array.isArray(response)) return false;
|
|
2947
|
-
const errors = response["errors"];
|
|
2948
|
-
if (!errors || typeof errors !== "object" || Array.isArray(errors)) return false;
|
|
2949
|
-
return ["channel", "recipient"].some((field) => {
|
|
2950
|
-
if (!Object.hasOwn(errors, field)) return false;
|
|
2951
|
-
const detail = JSON.stringify(errors[field]);
|
|
2952
|
-
return /required|obrigat[oó]ri[oa]/iu.test(detail);
|
|
2953
|
-
});
|
|
2954
|
-
}
|
|
2955
3004
|
|
|
2956
3005
|
// src/resources/signers.ts
|
|
2957
3006
|
var SignerResource = class extends BaseResource {
|
|
@@ -6664,7 +6713,14 @@ function validateSignerAccessCode(value) {
|
|
|
6664
6713
|
var SignerDocumentsResource = class extends BaseResource {
|
|
6665
6714
|
constructor(http, defaultAccountId, logger, publicHttp) {
|
|
6666
6715
|
super(withoutCredentials(publicHttp ?? http), defaultAccountId, logger);
|
|
6716
|
+
this.workspaceHttp = http;
|
|
6667
6717
|
}
|
|
6718
|
+
/**
|
|
6719
|
+
* Credentialed transport used only by the explicit `*AsWorkspace` methods.
|
|
6720
|
+
* Every access-code method stays on the credential-free `http`, so a
|
|
6721
|
+
* signer code and the API key or bearer token never share a request.
|
|
6722
|
+
*/
|
|
6723
|
+
workspaceHttp;
|
|
6668
6724
|
/**
|
|
6669
6725
|
* Fetch the document currently awaiting a given signer
|
|
6670
6726
|
* (`GET /signers/{signer_id}/document?signer-access-code=…`).
|
|
@@ -6837,6 +6893,73 @@ var SignerDocumentsResource = class extends BaseResource {
|
|
|
6837
6893
|
})
|
|
6838
6894
|
);
|
|
6839
6895
|
}
|
|
6896
|
+
/**
|
|
6897
|
+
* List a signer's documents with the workspace credentials
|
|
6898
|
+
* (`GET /signers/{signer_id}/documents`).
|
|
6899
|
+
*
|
|
6900
|
+
* The same operation as {@link SignerDocumentsResource.list}, authorised by
|
|
6901
|
+
* the client's API key or OAuth bearer token instead of a signer access
|
|
6902
|
+
* code. No `signer-access-code` is sent.
|
|
6903
|
+
*
|
|
6904
|
+
* @param signerId - The signer whose documents are listed.
|
|
6905
|
+
* @param params - Pagination: `page`, `per-page` (also accepts `per_page`).
|
|
6906
|
+
* @returns Documents in the compact {@link IDocumentListItem} shape, with
|
|
6907
|
+
* pagination in `meta` (same shape as {@link SignerDocumentsResource.list}):
|
|
6908
|
+
* ```jsonc
|
|
6909
|
+
* {
|
|
6910
|
+
* "data": [{ "id": "103acccd24234c07858ffddf6d84", "name": "Service agreement.pdf", "status": "pending_signature" }],
|
|
6911
|
+
* "meta": { "current_page": 1, "per_page": 20, "total": 1, "last_page": 1 }
|
|
6912
|
+
* }
|
|
6913
|
+
* ```
|
|
6914
|
+
* @throws {ValidationError} If `signerId` is missing.
|
|
6915
|
+
* @throws {ApiError} `401` if the workspace credentials are rejected.
|
|
6916
|
+
*
|
|
6917
|
+
* @example
|
|
6918
|
+
* ```ts
|
|
6919
|
+
* const { data } = await client.signerDocuments.listAsWorkspace(signerId, { page: 1 });
|
|
6920
|
+
* ```
|
|
6921
|
+
*/
|
|
6922
|
+
async listAsWorkspace(signerId, params = {}) {
|
|
6923
|
+
const sid = this.pathSegment(signerId, "Signer ID");
|
|
6924
|
+
return this.callList(
|
|
6925
|
+
"Failed to list signer documents",
|
|
6926
|
+
() => this.workspaceHttp.get(`/signers/${sid}/documents`, {
|
|
6927
|
+
params: cleanListParams(params)
|
|
6928
|
+
})
|
|
6929
|
+
);
|
|
6930
|
+
}
|
|
6931
|
+
/**
|
|
6932
|
+
* Search a signer's documents with the workspace credentials
|
|
6933
|
+
* (`GET /signers/{signer_id}/documents/search`).
|
|
6934
|
+
*
|
|
6935
|
+
* The same operation as {@link SignerDocumentsResource.search}, authorised
|
|
6936
|
+
* by the client's API key or OAuth bearer token instead of a signer access
|
|
6937
|
+
* code. No `signer-access-code` is sent.
|
|
6938
|
+
*
|
|
6939
|
+
* @param signerId - The signer whose documents are searched.
|
|
6940
|
+
* @param search - Free-text term matched against the document name.
|
|
6941
|
+
* @returns Matching documents with pagination in `meta`, as
|
|
6942
|
+
* {@link SignerDocumentsResource.listAsWorkspace} returns.
|
|
6943
|
+
* @throws {ValidationError} If `signerId` is missing or `search` is not a string.
|
|
6944
|
+
* @throws {ApiError} `401` if the workspace credentials are rejected.
|
|
6945
|
+
*
|
|
6946
|
+
* @example
|
|
6947
|
+
* ```ts
|
|
6948
|
+
* const { data } = await client.signerDocuments.searchAsWorkspace(signerId, 'agreement');
|
|
6949
|
+
* ```
|
|
6950
|
+
*/
|
|
6951
|
+
async searchAsWorkspace(signerId, search) {
|
|
6952
|
+
const sid = this.pathSegment(signerId, "Signer ID");
|
|
6953
|
+
if (search !== void 0 && typeof search !== "string") {
|
|
6954
|
+
throw new ValidationError("search must be a string");
|
|
6955
|
+
}
|
|
6956
|
+
return this.callList(
|
|
6957
|
+
"Failed to search signer documents",
|
|
6958
|
+
() => this.workspaceHttp.get(`/signers/${sid}/documents/search`, {
|
|
6959
|
+
params: cleanParams({ search })
|
|
6960
|
+
})
|
|
6961
|
+
);
|
|
6962
|
+
}
|
|
6840
6963
|
/**
|
|
6841
6964
|
* Download one of a signer's document artifacts as raw bytes
|
|
6842
6965
|
* (`GET /signers/{signer_id}/documents/{document_id}/download/{artifact}`).
|
|
@@ -7419,6 +7542,9 @@ function assertDeclineReason(declineReason) {
|
|
|
7419
7542
|
if (typeof declineReason !== "string" || !declineReason.trim()) {
|
|
7420
7543
|
throw new ValidationError("declineReason is required");
|
|
7421
7544
|
}
|
|
7545
|
+
if (declineReason.length > 2e3) {
|
|
7546
|
+
throw new ValidationError("declineReason must be at most 2000 characters");
|
|
7547
|
+
}
|
|
7422
7548
|
}
|
|
7423
7549
|
function validateConfirmDataPayload(payload) {
|
|
7424
7550
|
for (const key of ["full_name", "government_id"]) {
|
|
@@ -7984,9 +8110,8 @@ function decodeSecret(secret) {
|
|
|
7984
8110
|
return key.length > 0 ? key : null;
|
|
7985
8111
|
}
|
|
7986
8112
|
function header(headers, name) {
|
|
7987
|
-
const value = typeof headers.get === "function" ? headers.get(name) : headers
|
|
7988
|
-
|
|
7989
|
-
return typeof first === "string" ? first.trim() : void 0;
|
|
8113
|
+
const value = typeof headers.get === "function" ? headers.get(name) ?? void 0 : readHeader(headers, name);
|
|
8114
|
+
return typeof value === "string" ? value.trim() : void 0;
|
|
7990
8115
|
}
|
|
7991
8116
|
function isRecord(value) {
|
|
7992
8117
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -8123,7 +8248,7 @@ var AssinafyClient = class _AssinafyClient {
|
|
|
8123
8248
|
);
|
|
8124
8249
|
this.fields = new FieldsResource(this.axiosInstance, this.defaultAccountId, this.logger);
|
|
8125
8250
|
this.signerDocuments = new SignerDocumentsResource(
|
|
8126
|
-
this.
|
|
8251
|
+
this.axiosInstance,
|
|
8127
8252
|
this.defaultAccountId,
|
|
8128
8253
|
this.logger,
|
|
8129
8254
|
this.publicAxiosInstance
|
package/docs/API_COVERAGE.md
CHANGED
|
@@ -124,15 +124,17 @@ ordinary OAuth applications use the two SDK methods listed below.
|
|
|
124
124
|
|
|
125
125
|
## Signing and public flows — 17/17
|
|
126
126
|
|
|
127
|
-
All methods in this section use the auth-free transport
|
|
128
|
-
authenticate with the `signer-access-code` query
|
|
129
|
-
OpenAPI security scheme. The
|
|
127
|
+
All access-code methods in this section use the auth-free transport and reject
|
|
128
|
+
a missing or blank code; they authenticate with the `signer-access-code` query
|
|
129
|
+
parameter required by the OpenAPI security scheme. The signer document list and
|
|
130
|
+
search also accept workspace credentials; only the explicit `listAsWorkspace` /
|
|
131
|
+
`searchAsWorkspace` methods send them, and never with an access code. The artifact download is explicitly public and accepts
|
|
130
132
|
an optional fourth access-code argument only for legacy compatibility.
|
|
131
133
|
|
|
132
134
|
| Method | Path | SDK method | Status |
|
|
133
135
|
| --- | --- | --- | --- |
|
|
134
136
|
| `GET` | `/v1/public/documents/{documentId}` | `client.documents.getPublic(documentId)` | Covered |
|
|
135
|
-
| `PUT` | `/v1/public/documents/{documentId}/send-token` | `client.documents.sendToken(documentId,
|
|
137
|
+
| `PUT` | `/v1/public/documents/{documentId}/send-token` | `client.documents.sendToken(documentId, recipient, channel?)` | Covered |
|
|
136
138
|
| `GET` | `/v1/signers/self` | `client.signerDocuments.self(accessCode)` | Covered |
|
|
137
139
|
| `GET` | `/v1/signers/{signerId}/document` | `client.signerDocuments.getCurrent(signerId, accessCode)` | Covered |
|
|
138
140
|
| `GET` | `/v1/sign` | `client.signerDocuments.getAssignment(accessCode, hasAcceptedTerms?)` | Covered |
|
|
@@ -145,8 +147,8 @@ an optional fourth access-code argument only for legacy compatibility.
|
|
|
145
147
|
| `PUT` | `/v1/signers/accept-terms` | `client.signerDocuments.acceptTerms(accessCode)` | Covered |
|
|
146
148
|
| `POST` | `/v1/signature` | `client.signerDocuments.uploadSignature(accessCode, image, options?)` | Covered |
|
|
147
149
|
| `GET` | `/v1/signature/{signatureType}` | `client.signerDocuments.downloadSignature(accessCode, signatureType)` | Covered |
|
|
148
|
-
| `GET` | `/v1/signers/{signerId}/documents` | `client.signerDocuments.list(signerId, accessCode, params?)` | Covered |
|
|
149
|
-
| `GET` | `/v1/signers/{signerId}/documents/search` | `client.signerDocuments.search(signerId, accessCode, search)` | Covered |
|
|
150
|
+
| `GET` | `/v1/signers/{signerId}/documents` | `client.signerDocuments.list(signerId, accessCode, params?)` / `client.signerDocuments.listAsWorkspace(signerId, params?)` | Covered |
|
|
151
|
+
| `GET` | `/v1/signers/{signerId}/documents/search` | `client.signerDocuments.search(signerId, accessCode, search)` / `client.signerDocuments.searchAsWorkspace(signerId, search?)` | Covered |
|
|
150
152
|
| `GET` | `/v1/signers/{signerId}/documents/{documentId}/download/{artifactName}` | `client.signerDocuments.download(signerId, documentId, artifactName)` | Covered |
|
|
151
153
|
|
|
152
154
|
## Tags — 4/4
|
package/docs/COMPATIBILITY.md
CHANGED
|
@@ -194,31 +194,20 @@ and returns the JPEG bytes as a `Buffer`.
|
|
|
194
194
|
|
|
195
195
|
## Public send-token request
|
|
196
196
|
|
|
197
|
-
The
|
|
198
|
-
|
|
197
|
+
The operation requires both `channel` and `recipient`; `email` is the only
|
|
198
|
+
channel, and the response `data` is `{ document, channel, recipient }`:
|
|
199
199
|
|
|
200
200
|
```http
|
|
201
201
|
PUT /v1/public/documents/{documentId}/send-token
|
|
202
202
|
Content-Type: application/json
|
|
203
203
|
|
|
204
|
-
{ "
|
|
204
|
+
{ "channel": "email", "recipient": "signer@example.com" }
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
```ts
|
|
208
|
-
await client.documents.sendToken(documentId, 'signer@example.com'
|
|
208
|
+
const { recipient } = await client.documents.sendToken(documentId, 'signer@example.com');
|
|
209
209
|
```
|
|
210
210
|
|
|
211
|
-
The two-argument overload sends the legacy `{ email }` shape, which current
|
|
212
|
-
deployments still accept:
|
|
213
|
-
|
|
214
|
-
```ts
|
|
215
|
-
await client.documents.sendToken(documentId, 'signer@example.com');
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
When a deployment rejects `{ email }` with a validation response naming
|
|
219
|
-
`recipient` or `channel` as required, the SDK retries the documented shape
|
|
220
|
-
automatically. Other errors are returned unchanged.
|
|
221
|
-
|
|
222
211
|
## Document tags
|
|
223
212
|
|
|
224
213
|
Replace and attach requests require existing tag IDs:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assinafy/sdk",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"packageManager": "bun@1.4.0",
|
|
5
5
|
"description": "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"bugs": {
|
|
64
64
|
"url": "https://github.com/assinafy/typescript-sdk/issues"
|
|
65
65
|
},
|
|
66
|
-
"homepage": "https://
|
|
66
|
+
"homepage": "https://www.assinafy.com.br",
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
69
69
|
"@eslint/js": "^10.0.1",
|