@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/CHANGELOG.md +41 -1
- package/README.en.md +133 -15
- package/README.md +125 -13
- package/dist/index.d.mts +557 -31
- package/dist/index.d.ts +557 -31
- package/dist/index.js +687 -35
- package/dist/index.mjs +685 -35
- package/docs/API_COVERAGE.md +15 -4
- package/docs/COMPATIBILITY.md +39 -5
- package/docs/RELEASING.md +1 -1
- package/package.json +11 -8
package/docs/API_COVERAGE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This ledger maps the official
|
|
4
4
|
[`GET /v1/docs/openapi.json`](https://api.assinafy.com.br/v1/docs/openapi.json)
|
|
5
|
-
contract to the public SDK API:
|
|
5
|
+
contract to the public SDK API: 90 paths, 118 HTTP operations, and 49 component
|
|
6
6
|
schemas.
|
|
7
7
|
|
|
8
8
|
All paths below include the `/v1` prefix shown by the OpenAPI document, except
|
|
@@ -14,7 +14,7 @@ Status meanings:
|
|
|
14
14
|
|
|
15
15
|
- **Covered** — a public, typed SDK method sends the operation.
|
|
16
16
|
- **Compatibility extension** — route retained for existing integrations but
|
|
17
|
-
absent from the current OpenAPI path set and excluded from the
|
|
17
|
+
absent from the current OpenAPI path set and excluded from the 118-operation
|
|
18
18
|
total.
|
|
19
19
|
|
|
20
20
|
## Accounts — 10/10
|
|
@@ -62,6 +62,17 @@ Status meanings:
|
|
|
62
62
|
| `POST` | `/v1/users/api-keys` | `client.auth.createApiKey(password)` | Covered |
|
|
63
63
|
| `DELETE` | `/v1/users/api-keys` | `client.auth.deleteApiKey()` | Covered |
|
|
64
64
|
|
|
65
|
+
## Contract lifecycle management (CLM) — 6/6
|
|
66
|
+
|
|
67
|
+
| Method | Path | SDK method | Status |
|
|
68
|
+
| --- | --- | --- | --- |
|
|
69
|
+
| `GET` | `/v1/accounts/{accountId}/contracts` | `client.contracts.list(params?, accountId?)` | Covered |
|
|
70
|
+
| `GET` | `/v1/accounts/{accountId}/documents/{documentId}/contract` | `client.contracts.get(documentId, accountId?)` | Covered |
|
|
71
|
+
| `PUT` | `/v1/accounts/{accountId}/documents/{documentId}/contract` | `client.contracts.set(documentId, payload, accountId?)` | Covered |
|
|
72
|
+
| `GET` | `/v1/accounts/{accountId}/documents/{documentId}/contract/related` | `client.contracts.listRelated(documentId, accountId?)` | Covered |
|
|
73
|
+
| `POST` | `/v1/accounts/{accountId}/documents/{documentId}/contract/renew` | `client.contracts.renew(documentId, payload, accountId?)` | Covered |
|
|
74
|
+
| `POST` | `/v1/accounts/{accountId}/documents/{documentId}/contract/terminate` | `client.contracts.terminate(documentId, payload?, accountId?)` | Covered |
|
|
75
|
+
|
|
65
76
|
## Documents — 18/18
|
|
66
77
|
|
|
67
78
|
| Method | Path | SDK method | Status |
|
|
@@ -210,7 +221,7 @@ Five additional routes are documented separately under
|
|
|
210
221
|
## Template compatibility routes
|
|
211
222
|
|
|
212
223
|
These routes are available to existing integrations but do not appear in the
|
|
213
|
-
current OpenAPI path set. They are excluded from the official
|
|
224
|
+
current OpenAPI path set. They are excluded from the official 118-operation
|
|
214
225
|
coverage count.
|
|
215
226
|
|
|
216
227
|
| Method | Path | SDK method | Status |
|
|
@@ -225,7 +236,7 @@ coverage count.
|
|
|
225
236
|
|
|
226
237
|
Two browser URL helpers used by older deployments are live but absent from the
|
|
227
238
|
current OpenAPI path set, so they are likewise excluded from the official
|
|
228
|
-
|
|
239
|
+
118-operation coverage count.
|
|
229
240
|
|
|
230
241
|
| Method | Path | SDK method | Status |
|
|
231
242
|
| --- | --- | --- | --- |
|
package/docs/COMPATIBILITY.md
CHANGED
|
@@ -38,13 +38,14 @@ GET /v1/login-callback
|
|
|
38
38
|
|
|
39
39
|
They map to `auth.getSocialLoginUrl()` and
|
|
40
40
|
`auth.getSocialLoginCallbackUrl()` and are not part of the official
|
|
41
|
-
|
|
41
|
+
118-operation total.
|
|
42
42
|
|
|
43
43
|
The SDK also includes the production contract additions for:
|
|
44
44
|
|
|
45
45
|
- the `pades` document artifact;
|
|
46
|
-
- `DigitalCertificate` verification on assignment and
|
|
47
|
-
|
|
46
|
+
- `DigitalCertificate` verification on virtual assignment creation and cost
|
|
47
|
+
estimation (template calls remain typed but are temporarily rejected because
|
|
48
|
+
the server derives their method);
|
|
48
49
|
- typed `display_settings` for collect fields;
|
|
49
50
|
- signer `government_id` updates;
|
|
50
51
|
- signature-image `reuse`;
|
|
@@ -55,6 +56,30 @@ Older signer-self responses can omit `has_signature`, `has_initial`, and
|
|
|
55
56
|
`is_signature_reusable`; assignment signers can omit `notification_history`.
|
|
56
57
|
Those fields are optional in the SDK response types.
|
|
57
58
|
|
|
59
|
+
## Contract lifecycle management (CLM)
|
|
60
|
+
|
|
61
|
+
Production exposes the six contract lifecycle operations under
|
|
62
|
+
`/v1/accounts/{accountId}` through `client.contracts`. They track terms on an
|
|
63
|
+
existing document, link signed amendment/renewal/termination instruments, run
|
|
64
|
+
the hourly renewal and expiration lifecycle, and expose portfolio filters.
|
|
65
|
+
OAuth reads require `documents:read`; writes require `documents:write` plus a
|
|
66
|
+
workspace plan with contract tracking.
|
|
67
|
+
|
|
68
|
+
A sandbox may return the generic `404` while these routes are not deployed, or
|
|
69
|
+
`403` while its workspace plan does not include contract tracking. The SDK does
|
|
70
|
+
not reinterpret either response or route a sandbox request to production.
|
|
71
|
+
Read operations remain available after a production plan lapses; writes are
|
|
72
|
+
plan-gated. Signed amendments wait and the lifecycle catches up after the plan
|
|
73
|
+
returns, as defined by the production integration guide.
|
|
74
|
+
|
|
75
|
+
`documents.details()` can expose `has_contract` only in a workspace context and
|
|
76
|
+
only when contract tracking is available. A missing key means unknown, not
|
|
77
|
+
false. The thirteen notification preferences include
|
|
78
|
+
`ContractRenewalNotice`, `ContractExpiring`, `ContractExpired`, and
|
|
79
|
+
`ContractRenewed`. Contract changes also use the typed
|
|
80
|
+
`document_contract_*` webhook event names; obtain the current subscribable
|
|
81
|
+
catalog with `webhooks.listEventTypes()`.
|
|
82
|
+
|
|
58
83
|
`DocumentStatsRow` separates notification-channel counters from verification
|
|
59
84
|
method counters. Notification counters are not mutually exclusive.
|
|
60
85
|
`signature_requests_verification_{email,whatsapp,bypass,digital_certificate}`
|
|
@@ -281,11 +306,20 @@ responses do not return it.
|
|
|
281
306
|
`DigitalCertificate` requires the account feature, a CPF or CNPJ stored in the
|
|
282
307
|
signer's `government_id`, and exactly one certificate signer in that signing
|
|
283
308
|
step. It costs 0.5 credits per signer in addition to the selected notification
|
|
284
|
-
cost. Notification methods remain `Email` and `Whatsapp`.
|
|
309
|
+
cost. Notification methods remain `Email` and `Whatsapp`. It also requires
|
|
310
|
+
`method: virtual`: certificate completion completes a virtual item, while the
|
|
311
|
+
ordinary field-signing endpoint refuses certificate signers. The SDK rejects a
|
|
312
|
+
certificate/`collect` combination before assignment creation or cost
|
|
313
|
+
estimation with `ValidationError.errors.code` set to
|
|
314
|
+
`digital_certificate_requires_virtual_method`.
|
|
285
315
|
|
|
286
316
|
Template role IDs do not reveal which entries are signers, editors or copy
|
|
287
317
|
receivers. The SDK validates each entry's channel and positive `step`, then
|
|
288
|
-
lets the API enforce role-aware signing order
|
|
318
|
+
lets the API enforce role-aware signing order. The server also derives the
|
|
319
|
+
assignment method from placed template fields but does not yet reject an
|
|
320
|
+
unusable certificate/`collect` result. Until it does, the SDK refuses
|
|
321
|
+
`DigitalCertificate` on both template-document creation and cost estimation
|
|
322
|
+
with the same stable code; use a direct virtual assignment instead.
|
|
289
323
|
|
|
290
324
|
## Identity document and face verification
|
|
291
325
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -9,7 +9,7 @@ event, and the workflow intentionally does not depend on one.
|
|
|
9
9
|
|
|
10
10
|
| Runtime | Release responsibility |
|
|
11
11
|
| --- | --- |
|
|
12
|
-
| Bun 1.4.
|
|
12
|
+
| Bun 1.4.4 | Locked install, tests, build, contract checks, and packaging |
|
|
13
13
|
| Node.js 22 | Minimum supported consumer runtime |
|
|
14
14
|
| Node.js 24 LTS | Packaging and registry publishing runtime |
|
|
15
15
|
| Node.js 26 Current | Forward-compatibility consumer test |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assinafy/sdk",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"packageManager": "bun@1.4.
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"packageManager": "bun@1.4.4",
|
|
5
5
|
"description": "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
"digital-signature",
|
|
45
45
|
"electronic-signature",
|
|
46
46
|
"signature",
|
|
47
|
+
"contract-lifecycle-management",
|
|
48
|
+
"gestao-de-contratos",
|
|
47
49
|
"pdf",
|
|
48
50
|
"webhook",
|
|
49
51
|
"sdk",
|
|
@@ -67,20 +69,21 @@
|
|
|
67
69
|
"devDependencies": {
|
|
68
70
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
69
71
|
"@eslint/js": "^10.0.1",
|
|
70
|
-
"@types/bun": "^1.4.
|
|
71
|
-
"@types/node": "^22.20.
|
|
72
|
+
"@types/bun": "^1.4.4",
|
|
73
|
+
"@types/node": "^22.20.5",
|
|
72
74
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
73
|
-
"eslint": "^10.
|
|
74
|
-
"publint": "^0.3.
|
|
75
|
+
"eslint": "^10.13.0",
|
|
76
|
+
"publint": "^0.3.25",
|
|
75
77
|
"tsup": "^8.5.1",
|
|
76
78
|
"typescript": "^6.0.3",
|
|
77
|
-
"typescript-eslint": "^8.
|
|
79
|
+
"typescript-eslint": "^8.72.1"
|
|
78
80
|
},
|
|
79
81
|
"dependencies": {
|
|
80
|
-
"axios": "^1.
|
|
82
|
+
"axios": "^1.21.0"
|
|
81
83
|
},
|
|
82
84
|
"overrides": {
|
|
83
85
|
"esbuild": "0.28.2",
|
|
86
|
+
"follow-redirects": "1.16.2",
|
|
84
87
|
"brace-expansion": "5.0.12"
|
|
85
88
|
},
|
|
86
89
|
"files": [
|