@assinafy/sdk 3.1.0 → 4.0.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 +133 -30
- package/README.en.md +16 -17
- package/README.md +16 -19
- package/SECURITY.md +10 -10
- package/dist/index.d.mts +1086 -1303
- package/dist/index.d.ts +1086 -1303
- package/dist/index.js +1282 -1590
- package/dist/index.mjs +1282 -1589
- package/docs/API_COVERAGE.md +49 -56
- package/docs/COMPATIBILITY.md +46 -266
- package/docs/README.en.md +143 -156
- package/docs/README.md +130 -152
- package/docs/RELEASING.md +25 -28
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,14 +7,119 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.0.1] - 2026-12-01
|
|
11
|
+
|
|
12
|
+
### Breaking changes
|
|
13
|
+
|
|
14
|
+
- `client.auth` (`AuthenticationResource`) is removed: login, two-factor
|
|
15
|
+
login, social login, password change and reset, and API key reading,
|
|
16
|
+
creation and deletion belong to the Assinafy app. So are the two-factor
|
|
17
|
+
methods of `client.users` (`getMfa()`, `startTotpEnrollment()`,
|
|
18
|
+
`confirmTotpEnrollment()`, `regenerateRecoveryCodes()`, `deleteMfaMethod()`)
|
|
19
|
+
and their types (`ILoginResponse`, `IApiKeyResponse`,
|
|
20
|
+
`IMaskedApiKeyResponse`, `IMfaStatus`, `IMfaMethod`, `ITotpEnrollment`,
|
|
21
|
+
`IMfaRecoveryCodes`, `IMfaReauth`, `IConfirmTotpPayload`). Authenticate with
|
|
22
|
+
an API key, which the user creates in the app, or an OAuth access token from
|
|
23
|
+
`client.oauth`.
|
|
24
|
+
- `documents.sendToken()` takes no `channel` argument and `SendTokenChannel` is
|
|
25
|
+
removed: the API accepts only e-mail, which the SDK always sends.
|
|
26
|
+
- `webhooks.get()` returns `IWebhookSubscription` and never `null`: a workspace
|
|
27
|
+
without an endpoint answers a blank subscription with `url: null`, and a
|
|
28
|
+
`404` (an unknown workspace) is thrown as an `ApiError`.
|
|
29
|
+
- `IWebhookEndpoint.url` and `email` are `string | null`.
|
|
30
|
+
- The `metadata` option of `documents.upload()` and
|
|
31
|
+
`uploadAndRequestSignatures()`, and signer `metadata` on `signers.create()`,
|
|
32
|
+
`ICreateSignerPayload`, `ISigner` and `IUploadAndRequestSignaturesSigner`, are
|
|
33
|
+
removed: the API never stored them.
|
|
34
|
+
- `signerDocuments.uploadSignature()` accepts only `contentType: 'image/png'` or
|
|
35
|
+
`'image/jpeg'`; the free-form overload and `ILegacyUploadSignatureOptions` are
|
|
36
|
+
removed (the API refuses any other image with `400 SignatureImageInvalid`).
|
|
37
|
+
- `IResendCostEstimate` is the compact `{ total, breakdown, credit_balance,
|
|
38
|
+
has_sufficient_credits }` the API returns; `ILegacyResendCostEstimate` is
|
|
39
|
+
removed.
|
|
40
|
+
- The aliases `ILegacyConfirmSignerDataPayload` (use
|
|
41
|
+
`IConfirmSignerDataPayload`), `IPaginatedResponse` (use `PaginatedResult`)
|
|
42
|
+
and the `IFieldValidationResult` base (use `IFieldValidationResponse` /
|
|
43
|
+
`IFieldValidationMultipleResult`) are removed.
|
|
44
|
+
- `IScheduledSend.next_attempt_at` and `IOAuthAuthorizationCallback.issuer` are
|
|
45
|
+
required, as the API always returns them.
|
|
46
|
+
- `signers.create()` recovers a concurrent duplicate only from the API's `400`
|
|
47
|
+
(it never answers `409` for one).
|
|
48
|
+
- `workspaces.uploadLogo()` labels only PNG, JPEG and WebP files with their
|
|
49
|
+
media type; the API detects the format from the bytes.
|
|
50
|
+
- Several `ValidationError` messages changed wording.
|
|
51
|
+
- Only a `POST` opts into `429` replay with an `Idempotency-Key`; a `PUT` or
|
|
52
|
+
`PATCH` never is, and a
|
|
53
|
+
`429` whose `Retry-After` exceeds the 30-second retry cap is thrown at once
|
|
54
|
+
instead of retried early.
|
|
55
|
+
- `documents.createFromTemplate()` requires a non-blank `name` with each
|
|
56
|
+
`email` signer entry, and `documents.setWatchers()` counts duplicate entries
|
|
57
|
+
toward its limit of 10, as the API does.
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
- `documents.cancel()` (`PUT /v1/documents/{documentId}/cancel`) cancels a
|
|
62
|
+
document out for signature and keeps it, its files and its history.
|
|
63
|
+
- Document and template uploads accept DOC, DOCX and ODT besides PDF, checked
|
|
64
|
+
by extension and leading bytes; the file keeps its real extension.
|
|
65
|
+
- Webhook events `signature_reminder_sent`, `signature_request_delivery_failed`,
|
|
66
|
+
`document_expiring` and `document_expired`.
|
|
67
|
+
- `IScheduledSend.next_attempt_at`, set while the free plan's daily signer
|
|
68
|
+
e-mail limit postpones a pending send.
|
|
69
|
+
- `IAuthenticatedUser.is_mfa_enabled` and
|
|
70
|
+
`IDocumentUploadResponse.verification_code` / `verification_url`.
|
|
71
|
+
- `tags.list()` forwards `page` and `per-page`.
|
|
72
|
+
- Envelope and scheduled-envelope document `expires_at` accepts Unix seconds.
|
|
73
|
+
- `webhooks.updateEndpoint()` accepts `name: null` to clear the label.
|
|
74
|
+
- JSDoc lists the refusal codes `FreePlanSignerLimit`, `FreePlanEmailLimit`,
|
|
75
|
+
`FreeWorkspaceLimit`, `DocumentClosed`, `EmailVerificationRequired`,
|
|
76
|
+
`WhatsappVerificationRequired`, `IdentityVerificationRequired`,
|
|
77
|
+
`TermsNotAccepted`, `SignatureImageInvalid`, `SignatureImageBlank` and
|
|
78
|
+
`InvalidEmail` on the methods that return them.
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
|
|
82
|
+
- Assignment copy receivers (`copy_receivers`, `uploadAndRequestSignatures()`'s
|
|
83
|
+
`copyReceivers` and scheduled assignments) are sent as `copy_receiver_ids`,
|
|
84
|
+
the field the API reads, so they are no longer dropped.
|
|
85
|
+
- A redirect hook passed to the SDK's transports gets only plain values and a
|
|
86
|
+
copy of the headers, never a live routing object: only the path and ordinary
|
|
87
|
+
headers carry over, and a change to the next hop's destination is refused. A
|
|
88
|
+
per-request `beforeRedirect` (even `null`) or `sensitiveHeaders` can no longer
|
|
89
|
+
remove the redirect guard or the stripping of `Authorization` and `X-Api-Key`;
|
|
90
|
+
only axios's `http` adapter (resolved as axios resolves it) follows redirects
|
|
91
|
+
automatically, so the `fetch` adapter or any other adapter gets
|
|
92
|
+
`maxRedirects: 0`; and a request configured for axios's non-legacy
|
|
93
|
+
interceptor ordering is refused, so the SDK's checks always run after caller
|
|
94
|
+
interceptors.
|
|
95
|
+
- Credentialed requests refuse `socketPath`, `transport`, `lookup` and a `Host`
|
|
96
|
+
or `:authority` header, which would send them to another socket behind the
|
|
97
|
+
configured API origin.
|
|
98
|
+
- A file-path upload rechecks the 25 MB limit on the bytes actually read.
|
|
99
|
+
- `signerDocuments.sign()` accepts `[]` for a virtual assignment.
|
|
100
|
+
- WhatsApp numbers accept the Brazilian forms the API normalizes, such as
|
|
101
|
+
`(48) 99999-0000`, besides E.164.
|
|
102
|
+
- `users.updateNotificationPreferences()` leaves unknown keys to the API, so
|
|
103
|
+
keys the API adds later can be set.
|
|
104
|
+
- OAuth authorization requests refuse a `state` over 2048 or a `nonce` over 255
|
|
105
|
+
characters before the authorization server would strand the user.
|
|
106
|
+
- Scheduled sends, watchers, signer capacities, notification history and
|
|
107
|
+
envelope reminder estimates are documented as part of the published API.
|
|
108
|
+
- The build embeds only the package version for the `User-Agent`.
|
|
109
|
+
|
|
110
|
+
### Changed
|
|
111
|
+
|
|
112
|
+
- `@types/bun` 1.4.5, `@types/node` 22.20.7 and ESLint 10.16; the ESLint
|
|
113
|
+
config uses `defineConfig`. ESLint's `cross-spawn` is pinned to 7.1.2.
|
|
114
|
+
|
|
10
115
|
## [3.1.0] - 2026-11-24
|
|
11
116
|
|
|
12
117
|
### Added
|
|
13
118
|
|
|
14
119
|
- Scheduled assignments and envelopes through `client.scheduledSends`, including
|
|
15
|
-
listing, cancellation and immediate dispatch
|
|
120
|
+
listing, cancellation and immediate dispatch.
|
|
16
121
|
- Document watchers, signer capacities, notification delivery/open history and
|
|
17
|
-
envelope reminder cost estimates
|
|
122
|
+
envelope reminder cost estimates.
|
|
18
123
|
- Typed PNG/JPEG signature-image upload options.
|
|
19
124
|
|
|
20
125
|
### Fixed
|
|
@@ -72,7 +177,7 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
72
177
|
`assignment` has no `signers`, `signing_urls`, `copy_receivers` or `summary`,
|
|
73
178
|
which signer reads never return.
|
|
74
179
|
- `signerDocuments.acceptTerms()` returns `IAcceptTermsResult | null` instead of
|
|
75
|
-
`void` (`null` from
|
|
180
|
+
`void` (`null` from API versions that acknowledge without data).
|
|
76
181
|
- `ISigningUrl.url` is `string | null`: `null` for embedded and WhatsApp-only
|
|
77
182
|
signers.
|
|
78
183
|
- `IWhatsAppNotification.sent_at` is an ISO-8601 string instead of a number.
|
|
@@ -180,14 +285,14 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
180
285
|
|
|
181
286
|
- `documents.listActivities(documentId, params?)` returns activity entries
|
|
182
287
|
with pagination metadata from the response headers. Use it to read the full
|
|
183
|
-
|
|
288
|
+
history; an unpaged response has no metadata.
|
|
184
289
|
|
|
185
290
|
### Fixed
|
|
186
291
|
|
|
187
292
|
- `documents.activities(documentId, params?)` accepts `page`, `per-page`
|
|
188
|
-
(or `per_page`), and `sort`, allowing callers to fetch beyond
|
|
189
|
-
default 20 activity entries. Existing calls still return an array
|
|
190
|
-
|
|
293
|
+
(or `per_page`), and `sort`, allowing callers to fetch beyond the
|
|
294
|
+
default 20 activity entries. Existing calls still return an array, and an
|
|
295
|
+
unpaged activity log remains compatible.
|
|
191
296
|
|
|
192
297
|
## [2.9.1] - 2026-10-28
|
|
193
298
|
|
|
@@ -372,8 +477,8 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
372
477
|
- API errors preserve authentication challenges and decoded binary error bodies
|
|
373
478
|
when a custom transport resolves a non-success response. OAuth errors retain
|
|
374
479
|
the authentication challenge when converted to `OAuthError`.
|
|
375
|
-
-
|
|
376
|
-
|
|
480
|
+
- OAuth setup uses discovery and keeps client registration, issuer and API
|
|
481
|
+
requests in the same environment.
|
|
377
482
|
- Resource reference documentation includes JSON request payloads alongside
|
|
378
483
|
response examples; upload examples describe filename handling accurately.
|
|
379
484
|
|
|
@@ -392,14 +497,14 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
392
497
|
and stale `@throws` clauses corrected on `documents.details()` and
|
|
393
498
|
`signerDocuments.getCurrent()`. No behavior changes.
|
|
394
499
|
- `README.en.md` reaches parity with the pt-BR README: the Environments
|
|
395
|
-
section (
|
|
500
|
+
section (base URL and explicit `issuer`/`authorizationEndpoint`
|
|
396
501
|
configuration), the verification/notification channel table with per-signer
|
|
397
502
|
costs, and the A1/A3 certificate-media note.
|
|
398
503
|
- The two browser URL helpers (`auth.getSocialLoginUrl()`,
|
|
399
504
|
`auth.getSocialLoginCallbackUrl()`) are listed in the coverage ledger's
|
|
400
505
|
compatibility extensions.
|
|
401
506
|
- OAuth callback examples use reserved example domains, and the CONTRIBUTING
|
|
402
|
-
live-test examples point at
|
|
507
|
+
live-test examples point at a dedicated test workspace.
|
|
403
508
|
|
|
404
509
|
## [2.5.0] - 2026-09-25
|
|
405
510
|
|
|
@@ -417,7 +522,7 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
417
522
|
- `oauth.readAuthorizationCallback()` always checks `iss`. When the stored
|
|
418
523
|
request carries no `issuer`, the callback must come from
|
|
419
524
|
`https://auth.assinafy.com.br`; pass the stored request for any other
|
|
420
|
-
authorization server
|
|
525
|
+
authorization server.
|
|
421
526
|
|
|
422
527
|
### Security
|
|
423
528
|
|
|
@@ -441,7 +546,7 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
441
546
|
### Changed
|
|
442
547
|
|
|
443
548
|
- The manual live suite requires `--confirm-production` for `--all` on every configured host.
|
|
444
|
-
- Public examples use production URLs
|
|
549
|
+
- Public examples use production URLs.
|
|
445
550
|
|
|
446
551
|
## [2.4.1] - 2026-09-23
|
|
447
552
|
|
|
@@ -591,9 +696,9 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
591
696
|
- `decodeBinaryErrorBody()` returns a non-JSON binary body as a string instead
|
|
592
697
|
of wrapping it in `{ message }`, so both unstructured-body paths converge on
|
|
593
698
|
the single rule in `ApiError.fromResponse()`.
|
|
594
|
-
-
|
|
595
|
-
instead of repeating the literal,
|
|
596
|
-
|
|
699
|
+
- CI reads the Bun version from `package.json`'s `packageManager` field
|
|
700
|
+
instead of repeating the literal, so every CI workflow moves together when
|
|
701
|
+
that field is bumped.
|
|
597
702
|
- README gained a contents map linking the setup, end-to-end workflow, and
|
|
598
703
|
per-resource sections; list examples use the `per-page` spelling the API
|
|
599
704
|
reads and document the page-size clamp.
|
|
@@ -607,7 +712,7 @@ These follow what the API now accepts and returns; code that compiled against
|
|
|
607
712
|
- `scripts/node-consumer-smoke.mjs`, exercised by CI and the release workflow:
|
|
608
713
|
it installs the packed tarball into an isolated consumer and drives the real
|
|
609
714
|
Node HTTP, auth, and multipart paths through both CJS and ESM entrypoints.
|
|
610
|
-
- A manual
|
|
715
|
+
- A manual integration workflow with `read-only` and
|
|
611
716
|
`disposable-full` modes, gated on a protected environment.
|
|
612
717
|
|
|
613
718
|
### Security
|
|
@@ -670,9 +775,9 @@ type, or API surface changed.
|
|
|
670
775
|
- Strict test-source typechecking and enforced Bun coverage floors. The suite
|
|
671
776
|
now executes every public HTTP wrapper and covers the production source at
|
|
672
777
|
more than 95% of functions and 98% of lines.
|
|
673
|
-
-
|
|
674
|
-
|
|
675
|
-
|
|
778
|
+
- SHA-pinned CI workflows. Release tags now build one immutable tarball,
|
|
779
|
+
verify its checksum, and publish that same file to npm (OIDC trusted
|
|
780
|
+
publishing) and GitHub Packages.
|
|
676
781
|
|
|
677
782
|
### Fixed
|
|
678
783
|
|
|
@@ -695,9 +800,7 @@ type, or API surface changed.
|
|
|
695
800
|
request credentials or user payloads.
|
|
696
801
|
- Restored the official name-only signer request and account
|
|
697
802
|
`notification_sender_type` field. Both are now represented exactly as the
|
|
698
|
-
OpenAPI defines them
|
|
699
|
-
`notification_sender_type` is recorded as a known deployment divergence
|
|
700
|
-
without blocking unrelated endpoint tests.
|
|
803
|
+
OpenAPI defines them.
|
|
701
804
|
- Restored the official public, code-free signer artifact download while
|
|
702
805
|
retaining an optional access-code argument for legacy deployments, and made
|
|
703
806
|
owner-only assignment-signer fields optional in signer-context responses.
|
|
@@ -761,9 +864,8 @@ type, or API surface changed.
|
|
|
761
864
|
|
|
762
865
|
#### Compatibility notes
|
|
763
866
|
|
|
764
|
-
- The
|
|
765
|
-
|
|
766
|
-
that sandbox lag explicitly instead of deleting documented functionality.
|
|
867
|
+
- The SDK exposes the official `notification_sender_type` account field on
|
|
868
|
+
both creation and update.
|
|
767
869
|
- The live list API clamps `per-page` to **50**. `sendToken` uses the current
|
|
768
870
|
official `{ email }` body first and retains the older `{ recipient, channel }`
|
|
769
871
|
form as an explicit, narrowly scoped compatibility path.
|
|
@@ -886,7 +988,7 @@ type, or API surface changed.
|
|
|
886
988
|
not return either field, so the old type promised a required `pages` array
|
|
887
989
|
that was `undefined` at runtime.
|
|
888
990
|
- **`ICreateAssignmentPayload.copy_receivers` is documented as unreliable.** On
|
|
889
|
-
|
|
991
|
+
some plans the API accepts it and persists nothing — `[]` from
|
|
890
992
|
`create`, `list` and `details().assignment`, for both emails and signer IDs.
|
|
891
993
|
Kept (it may be plan-gated) but do not assume a CC was delivered.
|
|
892
994
|
|
|
@@ -945,8 +1047,8 @@ Adds template management, aligns types with response payloads, and updates the t
|
|
|
945
1047
|
- Multipart upload helpers (`loadSource` / `validateUpload` / `buildUploadForm`)
|
|
946
1048
|
were extracted into `src/resources/upload.ts` and shared by document and
|
|
947
1049
|
template uploads (DRY).
|
|
948
|
-
- `scripts/live-smoke.ts` honors `ASSINAFY_BASE_URL` (so it can target
|
|
949
|
-
|
|
1050
|
+
- `scripts/live-smoke.ts` honors `ASSINAFY_BASE_URL` (so it can target a
|
|
1051
|
+
configured API URL) and now exercises the template lifecycle in `--upload` mode.
|
|
950
1052
|
|
|
951
1053
|
### Tooling
|
|
952
1054
|
|
|
@@ -1062,7 +1164,8 @@ signer fields with `cpf` and `whatsapp_phone_number`.
|
|
|
1062
1164
|
- High-level `uploadAndRequestSignatures` helper on `AssinafyClient`.
|
|
1063
1165
|
- `PaginatedResult<T>` with parsed `X-Pagination-*` header meta.
|
|
1064
1166
|
|
|
1065
|
-
[Unreleased]: https://github.com/assinafy/typescript-sdk/compare/
|
|
1167
|
+
[Unreleased]: https://github.com/assinafy/typescript-sdk/compare/v4.0.1...HEAD
|
|
1168
|
+
[4.0.1]: https://github.com/assinafy/typescript-sdk/releases/tag/v4.0.1
|
|
1066
1169
|
[3.1.0]: https://github.com/assinafy/typescript-sdk/releases/tag/v3.1.0
|
|
1067
1170
|
[3.0.2]: https://github.com/assinafy/typescript-sdk/compare/v3.0.1...v3.0.2
|
|
1068
1171
|
[3.0.1]: https://github.com/assinafy/typescript-sdk/compare/v3.0.0...v3.0.1
|
package/README.en.md
CHANGED
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
Official TypeScript SDK for the [Assinafy API](https://api.assinafy.com.br/v1/docs), with Node.js
|
|
6
6
|
and Bun support, complete types, and ESM/CJS builds.
|
|
7
7
|
|
|
8
|
-
The SDK maps all
|
|
9
|
-
session exchange
|
|
8
|
+
The SDK maps all 158 operations in the published OpenAPI document (142 with methods; the embed
|
|
9
|
+
session exchange and the login, password, two-factor and API key routes belong to the Assinafy
|
|
10
|
+
app), plus compatibility extensions
|
|
10
11
|
maintained by the API. The complete reference, including payloads, responses, errors, and examples
|
|
11
12
|
for every resource, is in the **[English manual](docs/README.en.md)**.
|
|
12
13
|
|
|
13
|
-
Staging also exposes ten additional operations for scheduled sends, watchers, capacities,
|
|
14
|
-
notification history and envelope reminder estimates; see the [coverage map](docs/API_COVERAGE.md).
|
|
15
|
-
|
|
16
14
|
## Requirements
|
|
17
15
|
|
|
18
16
|
- Node.js 22+ or Bun 1.4.4
|
|
@@ -57,9 +55,9 @@ control each step independently, follow the [complete document flow](docs/README
|
|
|
57
55
|
|
|
58
56
|
| Credential | Use |
|
|
59
57
|
| --- | --- |
|
|
60
|
-
| `apiKey` | Server-to-server automation in your own workspace |
|
|
61
|
-
| `token` |
|
|
62
|
-
| No credential |
|
|
58
|
+
| `apiKey` | Server-to-server automation in your own workspace; the user creates it in the Assinafy app |
|
|
59
|
+
| `token` | OAuth access token for a workspace connected to your application |
|
|
60
|
+
| No credential | Public reads, signer access codes, and OAuth endpoints |
|
|
63
61
|
|
|
64
62
|
```ts
|
|
65
63
|
const withApiKey = new AssinafyClient({
|
|
@@ -84,7 +82,7 @@ validation, refresh-token rotation, and revocation.
|
|
|
84
82
|
| `apiKey` | — | `X-Api-Key` credential |
|
|
85
83
|
| `token` | — | `Authorization: Bearer` credential |
|
|
86
84
|
| `accountId` | — | Default workspace |
|
|
87
|
-
| `baseUrl` | `https://api.assinafy.com.br/v1` | API
|
|
85
|
+
| `baseUrl` | `https://api.assinafy.com.br/v1` | API URL |
|
|
88
86
|
| `webhookSecret` | — | Standard Webhooks signature verification |
|
|
89
87
|
| `timeout` | `30000` | Timeout in milliseconds |
|
|
90
88
|
| `maxRetries` | `2` | Safe retries for HTTP 429 |
|
|
@@ -95,7 +93,7 @@ factories.
|
|
|
95
93
|
|
|
96
94
|
## Integration flow
|
|
97
95
|
|
|
98
|
-
1. Configure the client with an API key or complete
|
|
96
|
+
1. Configure the client with an API key or complete the OAuth flow.
|
|
99
97
|
2. Create or find the signers.
|
|
100
98
|
3. Upload the PDF and wait for metadata processing.
|
|
101
99
|
4. Estimate the cost and create the assignment with the required verification and notification,
|
|
@@ -103,8 +101,9 @@ factories.
|
|
|
103
101
|
5. Deliver the signing URL, or show the signing screen inside your app with `client.embed`, and
|
|
104
102
|
authenticate webhooks before processing events.
|
|
105
103
|
6. Observe completion and download the signed document or certificate.
|
|
106
|
-
7. Track contract terms with `client.contracts`;
|
|
107
|
-
|
|
104
|
+
7. Track contract terms with `client.contracts`; defer a request with `client.scheduledSends`
|
|
105
|
+
and monitor its `pending`, `sent` or `failed` state; cancel a document and keep it with
|
|
106
|
+
`client.documents.cancel()`.
|
|
108
107
|
|
|
109
108
|
WhatsApp, ID-document and face biometrics, ICP-Brasil digital certificates, and per-account
|
|
110
109
|
`Bypass` verification have specific prerequisites; `workspaces.get(id, { expand:
|
|
@@ -115,16 +114,16 @@ in their browser. See the [signing branches](docs/README.en.md#paid-signing-bran
|
|
|
115
114
|
|
|
116
115
|
| Resource | Area |
|
|
117
116
|
| --- | --- |
|
|
118
|
-
| `client.documents` | Uploads, reads, artifacts, tags, and template creation |
|
|
117
|
+
| `client.documents` | Uploads, reads, artifacts, tags, watchers, cancellation, and template creation |
|
|
119
118
|
| `client.signers` | Signer registration, lookup, and updates |
|
|
120
119
|
| `client.assignments` | Requests, costs, notifications, and identity review |
|
|
121
120
|
| `client.envelopes` | Several documents to the same signers, one invitation and one charge |
|
|
122
121
|
| `client.embed` | Embed origins and single-use sessions for in-app signing |
|
|
123
|
-
| `client.scheduledSends` | Deferred assignments and envelopes
|
|
122
|
+
| `client.scheduledSends` | Deferred assignments and envelopes |
|
|
124
123
|
| `client.contracts` | Terms, families, renewals, and contract termination |
|
|
125
124
|
| `client.templates`, `client.tags`, `client.fields` | Reusable content and fields |
|
|
126
|
-
| `client.workspaces`, `client.users` | Workspace, branding, usage, notification policy,
|
|
127
|
-
| `client.
|
|
125
|
+
| `client.workspaces`, `client.users` | Workspace, branding, usage, notification policy, and preferences |
|
|
126
|
+
| `client.oauth` | OAuth 2.1 authorization, tokens, and user info |
|
|
128
127
|
| `client.webhooks`, `client.webhookVerifier` | Endpoints, deliveries, and event authentication |
|
|
129
128
|
| `client.signerDocuments` | Public and authenticated signer flows |
|
|
130
129
|
|
|
@@ -137,7 +136,7 @@ with the package document the complete payloads.
|
|
|
137
136
|
- [Manual completo em português](docs/README.md)
|
|
138
137
|
- [Complete manual in English](docs/README.en.md)
|
|
139
138
|
- [API coverage](docs/API_COVERAGE.md)
|
|
140
|
-
- [
|
|
139
|
+
- [Compatibility notes](docs/COMPATIBILITY.md)
|
|
141
140
|
- [Release process](docs/RELEASING.md)
|
|
142
141
|
- [Official API documentation](https://api.assinafy.com.br/v1/docs)
|
|
143
142
|
|
package/README.md
CHANGED
|
@@ -5,15 +5,12 @@
|
|
|
5
5
|
SDK oficial em TypeScript para a [API Assinafy](https://api.assinafy.com.br/v1/docs), com suporte
|
|
6
6
|
a Node.js e Bun, tipos completos e builds ESM/CJS.
|
|
7
7
|
|
|
8
|
-
O SDK mapeia as
|
|
9
|
-
|
|
8
|
+
O SDK mapeia as 158 operações do OpenAPI publicado (142 com métodos; a troca da sessão incorporada
|
|
9
|
+
e as rotas de login, senha, dois fatores e chave de API pertencem ao app da Assinafy), além das
|
|
10
|
+
extensões de compatibilidade mantidas
|
|
10
11
|
pela API. A referência completa, com payloads, respostas, erros e exemplos de cada recurso, está no
|
|
11
12
|
**[manual em português](docs/README.md)**.
|
|
12
13
|
|
|
13
|
-
Staging também oferece dez operações adicionais para agendamentos, observadores, qualificação
|
|
14
|
-
dos signatários, histórico de notificações e estimativa de lembretes de envelopes; veja o
|
|
15
|
-
[mapa de cobertura](docs/API_COVERAGE.md).
|
|
16
|
-
|
|
17
14
|
## Requisitos
|
|
18
15
|
|
|
19
16
|
- Node.js 22+ ou Bun 1.4.4
|
|
@@ -58,9 +55,9 @@ cada etapa separadamente, siga o [fluxo completo do documento](docs/README.md#ci
|
|
|
58
55
|
|
|
59
56
|
| Credencial | Uso |
|
|
60
57
|
| --- | --- |
|
|
61
|
-
| `apiKey` | Automação servidor a servidor no seu próprio workspace |
|
|
62
|
-
| `token` |
|
|
63
|
-
| Sem credencial |
|
|
58
|
+
| `apiKey` | Automação servidor a servidor no seu próprio workspace; o usuário a cria no app da Assinafy |
|
|
59
|
+
| `token` | Token de acesso OAuth de um workspace conectado ao seu aplicativo |
|
|
60
|
+
| Sem credencial | Leituras públicas, código do signatário e endpoints OAuth |
|
|
64
61
|
|
|
65
62
|
```ts
|
|
66
63
|
const comChave = new AssinafyClient({
|
|
@@ -85,7 +82,7 @@ refresh token e revogação.
|
|
|
85
82
|
| `apiKey` | — | Credencial `X-Api-Key` |
|
|
86
83
|
| `token` | — | Credencial `Authorization: Bearer` |
|
|
87
84
|
| `accountId` | — | Workspace padrão |
|
|
88
|
-
| `baseUrl` | `https://api.assinafy.com.br/v1` |
|
|
85
|
+
| `baseUrl` | `https://api.assinafy.com.br/v1` | URL da API |
|
|
89
86
|
| `webhookSecret` | — | Verificação de assinatura Standard Webhooks |
|
|
90
87
|
| `timeout` | `30000` | Timeout em milissegundos |
|
|
91
88
|
| `maxRetries` | `2` | Retentativas seguras para HTTP 429 |
|
|
@@ -95,8 +92,7 @@ O [manual de configuração](docs/README.md#configuração) explica retentativas
|
|
|
95
92
|
|
|
96
93
|
## Fluxo de integração
|
|
97
94
|
|
|
98
|
-
1. Configure o cliente com uma chave de API ou conclua o fluxo OAuth
|
|
99
|
-
workspace.
|
|
95
|
+
1. Configure o cliente com uma chave de API ou conclua o fluxo OAuth.
|
|
100
96
|
2. Crie ou localize os signatários.
|
|
101
97
|
3. Envie o PDF e aguarde o processamento dos metadados.
|
|
102
98
|
4. Estime o custo e crie o assignment com a verificação e a notificação desejadas, ou envie vários
|
|
@@ -104,8 +100,9 @@ O [manual de configuração](docs/README.md#configuração) explica retentativas
|
|
|
104
100
|
5. Entregue a URL de assinatura, ou exiba a tela de assinatura dentro do seu app com
|
|
105
101
|
`client.embed`, e valide os webhooks antes de processar eventos.
|
|
106
102
|
6. Acompanhe a conclusão e baixe o documento assinado ou o certificado.
|
|
107
|
-
7. Gerencie termos com `client.contracts`;
|
|
108
|
-
|
|
103
|
+
7. Gerencie termos com `client.contracts`; agende com `client.scheduledSends` e acompanhe o
|
|
104
|
+
estado `pending`, `sent` ou `failed`; cancele um documento e mantenha-o com
|
|
105
|
+
`client.documents.cancel()`.
|
|
109
106
|
|
|
110
107
|
WhatsApp, biometria com documento e face, certificado digital ICP-Brasil e a verificação `Bypass`
|
|
111
108
|
(habilitada por conta) têm pré-requisitos específicos; `workspaces.get(id, { expand:
|
|
@@ -116,16 +113,16 @@ signatário no navegador. Consulte os [ramos de assinatura](docs/README.md#ramos
|
|
|
116
113
|
|
|
117
114
|
| Recurso | Área |
|
|
118
115
|
| --- | --- |
|
|
119
|
-
| `client.documents` | Upload, consulta, artefatos, tags e criação por template |
|
|
116
|
+
| `client.documents` | Upload, consulta, artefatos, tags, observadores, cancelamento e criação por template |
|
|
120
117
|
| `client.signers` | Cadastro, busca e atualização de signatários |
|
|
121
118
|
| `client.assignments` | Solicitações, custos, notificações e revisão de identidade |
|
|
122
119
|
| `client.envelopes` | Vários documentos aos mesmos signatários, um convite e uma cobrança |
|
|
123
120
|
| `client.embed` | Origens e sessões de uso único para assinar dentro do seu app |
|
|
124
|
-
| `client.scheduledSends` | Assignments e envelopes agendados
|
|
121
|
+
| `client.scheduledSends` | Assignments e envelopes agendados |
|
|
125
122
|
| `client.contracts` | Termos, famílias, renovação e encerramento de contratos |
|
|
126
123
|
| `client.templates`, `client.tags`, `client.fields` | Conteúdo reutilizável e campos |
|
|
127
|
-
| `client.workspaces`, `client.users` | Workspace, tema, uso do plano, política de notificações
|
|
128
|
-
| `client.
|
|
124
|
+
| `client.workspaces`, `client.users` | Workspace, tema, uso do plano, política de notificações e preferências |
|
|
125
|
+
| `client.oauth` | Autorização OAuth 2.1, tokens e dados do usuário |
|
|
129
126
|
| `client.webhooks`, `client.webhookVerifier` | Endpoints, entregas e autenticação de eventos |
|
|
130
127
|
| `client.signerDocuments` | Fluxo público e autenticado do signatário |
|
|
131
128
|
|
|
@@ -138,7 +135,7 @@ com o pacote documentam os payloads completos.
|
|
|
138
135
|
- [Manual completo em português](docs/README.md)
|
|
139
136
|
- [Complete manual in English](docs/README.en.md)
|
|
140
137
|
- [Cobertura da API](docs/API_COVERAGE.md)
|
|
141
|
-
- [
|
|
138
|
+
- [Notas de compatibilidade](docs/COMPATIBILITY.md)
|
|
142
139
|
- [Processo de release](docs/RELEASING.md)
|
|
143
140
|
- [Documentação oficial da API](https://api.assinafy.com.br/v1/docs)
|
|
144
141
|
|
package/SECURITY.md
CHANGED
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Supported releases
|
|
4
4
|
|
|
5
|
-
Security fixes are developed on the
|
|
5
|
+
Security fixes are developed on the default branch and released on
|
|
6
6
|
the current supported major. Unless a separate support agreement states
|
|
7
7
|
otherwise, users should run the latest published patch. Older majors and
|
|
8
8
|
superseded minor releases may not receive fixes.
|
|
9
9
|
|
|
10
10
|
## Reporting a vulnerability
|
|
11
11
|
|
|
12
|
-
Do not disclose a suspected vulnerability in a public issue, discussion,
|
|
12
|
+
Do not disclose a suspected vulnerability in a public issue, discussion, pull
|
|
13
13
|
request, commit message, or CI log.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
details.
|
|
15
|
+
Report it through the repository's private vulnerability reporting: on GitHub,
|
|
16
|
+
**Security → Report a vulnerability**. Verify that the report is private before
|
|
17
|
+
adding sensitive details. If private reporting is not available, open a public
|
|
18
|
+
issue that asks maintainers for a private contact method and include no
|
|
19
|
+
vulnerability details.
|
|
21
20
|
|
|
22
21
|
Provide:
|
|
23
22
|
|
|
@@ -76,7 +75,8 @@ opportunity to upgrade.
|
|
|
76
75
|
- Dependency changes must keep `bun.lock` synchronized and pass `bun run audit`.
|
|
77
76
|
GitHub Actions are pinned to immutable commit SHAs and updated through
|
|
78
77
|
Dependabot review.
|
|
79
|
-
-
|
|
80
|
-
mutation tests belong only in dedicated, disposable
|
|
78
|
+
- Test credentials and fixtures must never be reused for a customer workspace.
|
|
79
|
+
Live mutation tests belong only in a dedicated, disposable test workspace and
|
|
80
|
+
never use real customer data.
|
|
81
81
|
|
|
82
82
|
For general defects without a security impact, use the normal issue tracker.
|