@assinafy/cli 2.8.0 → 2.10.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/README.en.md +70 -67
- package/README.md +28 -24
- package/THIRD_PARTY_NOTICES.md +9 -9
- package/dist/api.cjs +204 -55
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +202 -55
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +1413 -559
- package/dist/types/api/client.d.ts +2 -0
- package/dist/types/api/client.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/resources/assignments.d.ts +7 -1
- package/dist/types/api/resources/assignments.d.ts.map +1 -1
- package/dist/types/api/resources/authentication.d.ts +1 -3
- package/dist/types/api/resources/authentication.d.ts.map +1 -1
- package/dist/types/api/resources/documents.d.ts +7 -1
- package/dist/types/api/resources/documents.d.ts.map +1 -1
- package/dist/types/api/resources/envelopes.d.ts +7 -1
- package/dist/types/api/resources/envelopes.d.ts.map +1 -1
- package/dist/types/api/resources/scheduled-sends.d.ts +11 -0
- package/dist/types/api/resources/scheduled-sends.d.ts.map +1 -0
- package/dist/types/api/types.d.ts +36 -2
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/api/utils.d.ts +3 -0
- package/dist/types/api/utils.d.ts.map +1 -1
- package/docs/README.md +3 -1
- package/docs/api-operations-staging.json +1262 -0
- package/docs/api-operations.json +89 -1
- package/docs/api-reference-staging.md +18466 -0
- package/docs/api-reference.md +1830 -323
- package/docs/assignments.md +46 -0
- package/docs/auth.md +3 -16
- package/docs/documents.md +47 -0
- package/docs/envelopes.md +29 -0
- package/docs/scheduled-sends.md +63 -0
- package/docs/sdk-reference.md +66 -4
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/package.json +4 -4
package/docs/assignments.md
CHANGED
|
@@ -21,6 +21,9 @@ Commands:
|
|
|
21
21
|
identity-verification <documentId> <assignmentId> <signerId> Fetch a signer identity review and its evidence summary
|
|
22
22
|
identity-image [options] <documentId> <assignmentId> <signerId> Download identity review evidence while the review is open
|
|
23
23
|
review-identity [options] <documentId> <assignmentId> <signerId> Approve certification or reject and cancel the document after identity review
|
|
24
|
+
schedule [options] <documentId> Schedule an assignment without sending or charging now
|
|
25
|
+
signer-capacities <documentId> Read the capacities signers were assigned
|
|
26
|
+
notification-history <documentId> Read notification delivery/open times
|
|
24
27
|
help [command] display help for command
|
|
25
28
|
```
|
|
26
29
|
|
|
@@ -205,3 +208,46 @@ Options:
|
|
|
205
208
|
-y, --yes Skip the confirmation prompt
|
|
206
209
|
-h, --help display help for command
|
|
207
210
|
```
|
|
211
|
+
|
|
212
|
+
### `assinafy assignments schedule`
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
Usage: assinafy assignments schedule [options] <documentId>
|
|
216
|
+
|
|
217
|
+
Schedule an assignment without sending or charging now
|
|
218
|
+
|
|
219
|
+
Arguments:
|
|
220
|
+
documentId Document ID
|
|
221
|
+
|
|
222
|
+
Options:
|
|
223
|
+
--data <json> Assignment JSON with send_at (ISO 8601 or Unix seconds)
|
|
224
|
+
-h, --help display help for command
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### `assinafy assignments signer-capacities`
|
|
228
|
+
|
|
229
|
+
```text
|
|
230
|
+
Usage: assinafy assignments signer-capacities [options] <documentId>
|
|
231
|
+
|
|
232
|
+
Read the capacities signers were assigned
|
|
233
|
+
|
|
234
|
+
Arguments:
|
|
235
|
+
documentId Document ID
|
|
236
|
+
|
|
237
|
+
Options:
|
|
238
|
+
-h, --help display help for command
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### `assinafy assignments notification-history`
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
Usage: assinafy assignments notification-history [options] <documentId>
|
|
245
|
+
|
|
246
|
+
Read notification delivery/open times
|
|
247
|
+
|
|
248
|
+
Arguments:
|
|
249
|
+
documentId Document ID
|
|
250
|
+
|
|
251
|
+
Options:
|
|
252
|
+
-h, --help display help for command
|
|
253
|
+
```
|
package/docs/auth.md
CHANGED
|
@@ -23,7 +23,8 @@ Commands:
|
|
|
23
23
|
existing credentials required)
|
|
24
24
|
reset-password [options] Complete a password reset with the emailed
|
|
25
25
|
token (no existing credentials required)
|
|
26
|
-
api-keys
|
|
26
|
+
api-keys Inspect or revoke the current user personal
|
|
27
|
+
API key
|
|
27
28
|
mfa Two-factor authentication: login verification,
|
|
28
29
|
enrollment, and recovery codes
|
|
29
30
|
help [command] display help for command
|
|
@@ -125,31 +126,17 @@ Options:
|
|
|
125
126
|
```text
|
|
126
127
|
Usage: assinafy auth api-keys [options] [command]
|
|
127
128
|
|
|
128
|
-
|
|
129
|
+
Inspect or revoke the current user personal API key
|
|
129
130
|
|
|
130
131
|
Options:
|
|
131
132
|
-h, --help display help for command
|
|
132
133
|
|
|
133
134
|
Commands:
|
|
134
|
-
create [options] Generate (and rotate) the current user API key
|
|
135
135
|
get Show the masked current API key
|
|
136
136
|
delete|rm [options] Revoke the current API key
|
|
137
137
|
help [command] display help for command
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
#### `assinafy auth api-keys create`
|
|
141
|
-
|
|
142
|
-
```text
|
|
143
|
-
Usage: assinafy auth api-keys create [options]
|
|
144
|
-
|
|
145
|
-
Generate (and rotate) the current user API key
|
|
146
|
-
|
|
147
|
-
Options:
|
|
148
|
-
--password <password> Account password (prompted if omitted) (env:
|
|
149
|
-
ASSINAFY_PASSWORD)
|
|
150
|
-
-h, --help display help for command
|
|
151
|
-
```
|
|
152
|
-
|
|
153
140
|
#### `assinafy auth api-keys get`
|
|
154
141
|
|
|
155
142
|
```text
|
package/docs/documents.md
CHANGED
|
@@ -20,6 +20,7 @@ Commands:
|
|
|
20
20
|
thumbnail [options] <id> Download the document thumbnail (JPEG)
|
|
21
21
|
download-page [options] <id> <pageId> Download a single document page (JPEG)
|
|
22
22
|
activities [options] <id> Show one page of the activity log for a document
|
|
23
|
+
cancel [options] <id> Cancel an open document while retaining its files and history
|
|
23
24
|
delete|rm [options] <id> Delete a document
|
|
24
25
|
tags <id> List the tags attached to a document
|
|
25
26
|
tags-set <id> [tags...] Replace a document tag set by name
|
|
@@ -33,6 +34,8 @@ Commands:
|
|
|
33
34
|
send-token [options] <id> Email a one-time access token to a signer of a pending document
|
|
34
35
|
progress <id> Show signing progress for a document
|
|
35
36
|
wait [options] <id> Poll a document until it is ready (or fails / times out)
|
|
37
|
+
watchers <documentId> List document watchers (owner credentials required)
|
|
38
|
+
set-watchers [options] <documentId> Replace contacts notified when the document ends
|
|
36
39
|
help [command] display help for command
|
|
37
40
|
```
|
|
38
41
|
|
|
@@ -202,6 +205,21 @@ Options:
|
|
|
202
205
|
-h, --help display help for command
|
|
203
206
|
```
|
|
204
207
|
|
|
208
|
+
### `assinafy documents cancel`
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
Usage: assinafy documents cancel [options] <id>
|
|
212
|
+
|
|
213
|
+
Cancel an open document while retaining its files and history
|
|
214
|
+
|
|
215
|
+
Arguments:
|
|
216
|
+
id Document ID
|
|
217
|
+
|
|
218
|
+
Options:
|
|
219
|
+
-y, --yes Skip the confirmation prompt
|
|
220
|
+
-h, --help display help for command
|
|
221
|
+
```
|
|
222
|
+
|
|
205
223
|
### `assinafy documents delete`
|
|
206
224
|
|
|
207
225
|
```text
|
|
@@ -400,3 +418,32 @@ Options:
|
|
|
400
418
|
--interval <ms> Poll interval in milliseconds (default: "2000")
|
|
401
419
|
-h, --help display help for command
|
|
402
420
|
```
|
|
421
|
+
|
|
422
|
+
### `assinafy documents watchers`
|
|
423
|
+
|
|
424
|
+
```text
|
|
425
|
+
Usage: assinafy documents watchers [options] <documentId>
|
|
426
|
+
|
|
427
|
+
List document watchers (owner credentials required)
|
|
428
|
+
|
|
429
|
+
Arguments:
|
|
430
|
+
documentId Document ID
|
|
431
|
+
|
|
432
|
+
Options:
|
|
433
|
+
-h, --help display help for command
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### `assinafy documents set-watchers`
|
|
437
|
+
|
|
438
|
+
```text
|
|
439
|
+
Usage: assinafy documents set-watchers [options] <documentId>
|
|
440
|
+
|
|
441
|
+
Replace contacts notified when the document ends
|
|
442
|
+
|
|
443
|
+
Arguments:
|
|
444
|
+
documentId Document ID
|
|
445
|
+
|
|
446
|
+
Options:
|
|
447
|
+
--watcher-ids <json> JSON array of contact IDs; [] removes all watchers
|
|
448
|
+
-h, --help display help for command
|
|
449
|
+
```
|
package/docs/envelopes.md
CHANGED
|
@@ -23,6 +23,8 @@ Commands:
|
|
|
23
23
|
resend <envelopeId> <signerId> Resend one signer’s envelope invitation; paid channels cost credits
|
|
24
24
|
add-document [options] <envelopeId> Add a processed document and notify its envelope signers
|
|
25
25
|
remove-document [options] <envelopeId> <documentId> Cancel and remove an open document, notifying its recipients
|
|
26
|
+
schedule [options] Schedule an envelope without sending or charging now
|
|
27
|
+
estimate-resend-cost <envelopeId> <signerId> Estimate one envelope reminder without sending or charging
|
|
26
28
|
help [command] display help for command
|
|
27
29
|
```
|
|
28
30
|
|
|
@@ -208,3 +210,30 @@ Options:
|
|
|
208
210
|
-y, --yes Skip confirmation
|
|
209
211
|
-h, --help display help for command
|
|
210
212
|
```
|
|
213
|
+
|
|
214
|
+
### `assinafy envelopes schedule`
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
Usage: assinafy envelopes schedule [options]
|
|
218
|
+
|
|
219
|
+
Schedule an envelope without sending or charging now
|
|
220
|
+
|
|
221
|
+
Options:
|
|
222
|
+
--data <json> Envelope JSON with send_at (ISO 8601 or Unix seconds)
|
|
223
|
+
-h, --help display help for command
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### `assinafy envelopes estimate-resend-cost`
|
|
227
|
+
|
|
228
|
+
```text
|
|
229
|
+
Usage: assinafy envelopes estimate-resend-cost [options] <envelopeId> <signerId>
|
|
230
|
+
|
|
231
|
+
Estimate one envelope reminder without sending or charging
|
|
232
|
+
|
|
233
|
+
Arguments:
|
|
234
|
+
envelopeId Envelope ID
|
|
235
|
+
signerId Signer ID
|
|
236
|
+
|
|
237
|
+
Options:
|
|
238
|
+
-h, --help display help for command
|
|
239
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# `assinafy scheduled-sends`
|
|
2
|
+
|
|
3
|
+
## `assinafy scheduled-sends`
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
Usage: assinafy scheduled-sends [options] [command]
|
|
7
|
+
|
|
8
|
+
List, cancel or send queued requests
|
|
9
|
+
|
|
10
|
+
Options:
|
|
11
|
+
-h, --help display help for command
|
|
12
|
+
|
|
13
|
+
Commands:
|
|
14
|
+
list [options] List queued assignments and envelopes
|
|
15
|
+
cancel [options] <scheduledSendId> Cancel a pending request without sending
|
|
16
|
+
send [options] <scheduledSendId> Send now, charging the current cost and
|
|
17
|
+
notifying signers
|
|
18
|
+
help [command] display help for command
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### `assinafy scheduled-sends list`
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
Usage: assinafy scheduled-sends list [options]
|
|
25
|
+
|
|
26
|
+
List queued assignments and envelopes
|
|
27
|
+
|
|
28
|
+
Options:
|
|
29
|
+
--page <n> Page number to fetch
|
|
30
|
+
--per-page <n> Items per page
|
|
31
|
+
--document <id> Filter by document ID
|
|
32
|
+
-h, --help display help for command
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `assinafy scheduled-sends cancel`
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Usage: assinafy scheduled-sends cancel [options] <scheduledSendId>
|
|
39
|
+
|
|
40
|
+
Cancel a pending request without sending
|
|
41
|
+
|
|
42
|
+
Arguments:
|
|
43
|
+
scheduledSendId Scheduled send ID
|
|
44
|
+
|
|
45
|
+
Options:
|
|
46
|
+
-y, --yes Skip confirmation
|
|
47
|
+
-h, --help display help for command
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### `assinafy scheduled-sends send`
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
Usage: assinafy scheduled-sends send [options] <scheduledSendId>
|
|
54
|
+
|
|
55
|
+
Send now, charging the current cost and notifying signers
|
|
56
|
+
|
|
57
|
+
Arguments:
|
|
58
|
+
scheduledSendId Scheduled send ID
|
|
59
|
+
|
|
60
|
+
Options:
|
|
61
|
+
-y, --yes Skip confirmation
|
|
62
|
+
-h, --help display help for command
|
|
63
|
+
```
|
package/docs/sdk-reference.md
CHANGED
|
@@ -113,6 +113,8 @@ try {
|
|
|
113
113
|
|
|
114
114
|
| SDK method | HTTP operation | Resolves to |
|
|
115
115
|
| --- | --- | --- |
|
|
116
|
+
| `listWatchers(documentId)` | `GET /documents/{documentId}/watchers` | `ISigner[]` |
|
|
117
|
+
| `setWatchers(documentId, watcherIds)` | `PUT /documents/{documentId}/watchers`; `{ watcher_ids: string[] }` | `ISigner[]` |
|
|
116
118
|
| `upload(source, options?)` | [`POST /accounts/{accountId}/documents`](./api-reference.md#upload-and-create-document) | `IDocumentUploadResponse` |
|
|
117
119
|
| `list(params?, accountId?)` | [`GET /accounts/{accountId}/documents`](./api-reference.md#list-documents) | `IDocumentListResponse` |
|
|
118
120
|
| `search(params?, accountId?)` | [`GET /accounts/{accountId}/documents/search`](./api-reference.md#search-documents-lightweight) | `IDocumentListResponse` |
|
|
@@ -125,6 +127,7 @@ try {
|
|
|
125
127
|
| `thumbnail(documentId, options?)` | [`GET /documents/{documentId}/thumbnail`](./api-reference.md#download-document-thumbnail) | JPEG `Buffer` |
|
|
126
128
|
| `downloadPage(documentId, pageId, options?)` | [`GET /documents/{documentId}/pages/{pageId}/download`](./api-reference.md#download-document-page) | JPEG `Buffer` |
|
|
127
129
|
| `activities(documentId, params?)` | [`GET /documents/{documentId}/activities`](./api-reference.md#list-document-activities) | `IDocumentActivity[]` |
|
|
130
|
+
| `cancel(documentId)` | [`PUT /documents/{documentId}/cancel`](./api-reference.md#cancel-document) | `IDocumentDetailsResponse` |
|
|
128
131
|
| `delete(documentId)` | [`DELETE /documents/{documentId}`](./api-reference.md#delete-document) | `IEmptyResult` (`unknown[]`) |
|
|
129
132
|
| `listTags(documentId, accountId?)` | [`GET /accounts/{accountId}/documents/{documentId}/tags`](./api-reference.md#list-document-tags) | `ITag[]` |
|
|
130
133
|
| `replaceTags(documentId, tags, accountId?)` | [`PUT /accounts/{accountId}/documents/{documentId}/tags`](./api-reference.md#replace-document-tags) | `ITag[]` |
|
|
@@ -139,6 +142,8 @@ try {
|
|
|
139
142
|
| `isFullySigned(documentId)` | SDK helper over `details` | `boolean` |
|
|
140
143
|
| `getSigningProgress(documentId)` | SDK helper over `details` | `{ signed; total; pending; percentage }` |
|
|
141
144
|
|
|
145
|
+
Watchers require owner credentials; OAuth application tokens cannot manage them. Up to ten workspace contacts with email addresses receive an email when the document is signed by all, declined or expired. The email has no document link or attachment. Setting watchers replaces the whole list, duplicates count once, and `[]` clears it. Changes stop once the document ends. See the complete [request and response contracts](./api-reference.md#documents). CLI: `documents watchers` and `documents set-watchers --watcher-ids '["example_signer"]'`.
|
|
146
|
+
|
|
142
147
|
Upload input and options:
|
|
143
148
|
|
|
144
149
|
```ts
|
|
@@ -175,6 +180,8 @@ An envelope groups up to 20 processed documents and 20 existing workspace signer
|
|
|
175
180
|
| --- | --- | --- |
|
|
176
181
|
| `list(params?, accountId?)` | `GET /accounts/{accountId}/envelopes`; `{ page?, per_page?, search?, status?: "open" | "closed" }` | `PaginatedResult<IDocumentEnvelope>` |
|
|
177
182
|
| `create(payload, options?)` | `POST /accounts/{accountId}/envelopes`; `ICreateEnvelopePayload` | `IDocumentEnvelope` |
|
|
183
|
+
| `schedule(payload, accountId?)` | `POST /accounts/{accountId}/scheduled-sends`; creation body plus `send_at` | `IScheduledSend` |
|
|
184
|
+
| `estimateResendCost(envelopeId, signerId, accountId?)` | `POST …/{envelopeId}/signers/{signerId}/estimate-resend-cost`; no body | `IResendCostEstimate` |
|
|
178
185
|
| `estimateCost(payload, accountId?)` | `POST /accounts/{accountId}/envelopes/estimate-cost`; same creation body, no changes or charges | `IEstimateCostResponse` |
|
|
179
186
|
| `get(envelopeId, accountId?)` | `GET /accounts/{accountId}/envelopes/{envelopeId}` | `IDocumentEnvelope` |
|
|
180
187
|
| `update(envelopeId, payload, accountId?)` | `PATCH /accounts/{accountId}/envelopes/{envelopeId}`; `{ name?, message?: string | null, document_ids?: string[] }` | `IDocumentEnvelope` |
|
|
@@ -280,6 +287,8 @@ Creation options are `{ accountId?, idempotencyKey? }`. The case-sensitive key b
|
|
|
280
287
|
|
|
281
288
|
Adding a document uses existing envelope signers, sends updated invitations, and can charge certificate credits. Removing an open document cancels it and notifies recipients; links from it continue to open the rest. Cancel affects only cancellable documents; completed certificates stay valid. Deleting requires every document closed and leaves the documents intact. Document deletion is refused while its envelope remains open, including documents removed from it. CLI cancel/delete/remove-document confirm unless `--yes`.
|
|
282
289
|
|
|
290
|
+
Envelope reminder estimates send and charge nothing. They price one reminder for the whole envelope, independent of document count, and do not check current reminder eligibility. Scheduled envelopes accept the same creation payload plus `send_at`, but do not accept an idempotency key. See [scheduled sends](#scheduled-sends-clientscheduledsends).
|
|
291
|
+
|
|
283
292
|
## Embedded signing (`client.embed`)
|
|
284
293
|
|
|
285
294
|
The Embed feature and an owner API key or first-party user token are required to mint sessions; OAuth application tokens cannot mint them. Keep that credential on your backend. The Node SDK is not shipped in the browser or a native mobile app; the frontend displays the hosted iframe. See the [official Embedded Signing Guide](https://api.assinafy.com.br/v1/docs) for the frontend message protocol and event payloads.
|
|
@@ -458,6 +467,9 @@ The hourly lifecycle uses Brasília calendar days: notice-period alerts, warning
|
|
|
458
467
|
| SDK method | HTTP operation | Resolves to |
|
|
459
468
|
| --- | --- | --- |
|
|
460
469
|
| `list(params?, accountId?)` | [`GET /assignments?accountId=…`](./api-reference.md#list-assignments) | `PaginatedResult<IAssignment>` |
|
|
470
|
+
| `schedule(documentId, payload)` | `POST /documents/{documentId}/scheduled-sends`; assignment body plus `send_at` | `IScheduledSend` |
|
|
471
|
+
| `signerCapacities(documentId)` | `GET /documents/{documentId}/signer-capacities` | `ISignerCapacity[]` (`{ signer_id, sign_as }`) |
|
|
472
|
+
| `notificationHistory(documentId)` | `GET /documents/{documentId}/notification-history` | `ISignerNotificationHistory[]` |
|
|
461
473
|
| `create(documentId, payload)` | [`POST /documents/{documentId}/assignments`](./api-reference.md#create-assignment-request-signatures) | `IAssignment` |
|
|
462
474
|
| `estimateCost(documentId, payload)` | [`POST /documents/{documentId}/assignments/estimate-cost`](./api-reference.md#estimate-assignment-cost) | `IEstimateCostResponse` |
|
|
463
475
|
| `resetExpiration(documentId, assignmentId, expiresAt)` | [`PUT …/reset-expiration`](./api-reference.md#reset-assignment-expiration) | `IAssignment`; accepts a date, datetime or `null` to clear the deadline |
|
|
@@ -476,6 +488,7 @@ Assignment payload:
|
|
|
476
488
|
signers?: Array<string | {
|
|
477
489
|
id?: string;
|
|
478
490
|
signer_id?: string;
|
|
491
|
+
sign_as?: SignerCapacity | null;
|
|
479
492
|
verification_method?: 'Email' | 'Whatsapp' | 'DigitalCertificate' | 'IdDocumentFaceMatchBasic';
|
|
480
493
|
notification_methods?: Array<'Email' | 'Whatsapp'>;
|
|
481
494
|
step?: number;
|
|
@@ -484,7 +497,7 @@ Assignment payload:
|
|
|
484
497
|
signer_ids?: string[]; // compatibility alias
|
|
485
498
|
signerIds?: string[]; // compatibility alias
|
|
486
499
|
message?: string;
|
|
487
|
-
expires_at?: string;
|
|
500
|
+
expires_at?: string | number | null;
|
|
488
501
|
copy_receivers?: string[];
|
|
489
502
|
max_total_credits?: number;
|
|
490
503
|
entries?: ICollectAssignmentEntry[];
|
|
@@ -510,6 +523,56 @@ Production defaults `notification_methods: []` to `['Email']` and sends an invit
|
|
|
510
523
|
|
|
511
524
|
`credit_balance` can be null for unlimited plans. `IResendCostEstimate` also accepts the published `IEstimateCostResponse` shape. Check `'total' in estimate` to select the production shape; use its `has_sufficient_credits` before resending. The published shape uses `total_credits` and `has_sufficient_resources`.
|
|
512
525
|
|
|
526
|
+
`sign_as` records the capacity the sender assigns, printed on the certificate page. Omission or null means `Sign`. Values are exported as `SIGNER_CAPACITIES` and `SignerCapacity`: `Sign`, `Approve`, `Acknowledge`, `Party`, `Witness`, `Intervening`, `Receipt`, `IssuerEndorserGuarantor`, `IssuerEndorserGuarantorSurety`, `Surety`, `PartySurety`, `JointDebtor`, `PartyJointDebtor`, `ContractingParty`, `ContractedParty`, `Landlord`, `Tenant`, `Buyer`, `Seller`, `AttorneyInFact`, `LegalRepresentative`, `Employer`, `Employee`. The SDK preserves it through creation, estimates, scheduling and `uploadAndRequestSignatures`; CLI `assignments create --signers` and `send --signers` accept it in signer JSON. It is fixed on creation and read through `signerCapacities`; invitations, the signing page and webhooks do not carry it. An unsent document returns `[]`.
|
|
527
|
+
|
|
528
|
+
`notificationHistory(documentId)` returns an array of `{ signer_id, notification_history }`, in assignment signer order. Each history entry extends `IAssignmentSignerNotification` with required nullable `delivered_at` and `opened_at`. It retains `event` and `status`, plus optional `error_code`, `error_message`, `sent_at` and `failed_at`. Status is `sent | delivered | opened | failed`; timestamps and error fields are nullable. `error_code` is `MailboxFull | AddressNotFound | AddressSuppressed | ContentRejected | MarkedAsSpam | NotOnWhatsapp | RecipientRestricted | NotSent | Unknown | null`. Delivery and open times are hints: scanners may open email, and blocked images or disabled read receipts may hide opens. An unsent document returns `[]`. Both history and capacities accept OAuth `documents:read`. CLI: `assignments signer-capacities` and `assignments notification-history`.
|
|
529
|
+
|
|
530
|
+
## Scheduled sends (`client.scheduledSends`)
|
|
531
|
+
|
|
532
|
+
Full HTTP parameters, payloads, responses and errors are in the [production API reference](./api-reference.md).
|
|
533
|
+
|
|
534
|
+
| SDK method | HTTP operation | Resolves to |
|
|
535
|
+
| --- | --- | --- |
|
|
536
|
+
| `list(params?, accountId?)` | `GET /accounts/{accountId}/scheduled-sends`; `{ page?, per_page?, document_id? }` | `PaginatedResult<IScheduledSend>` |
|
|
537
|
+
| `cancel(scheduledSendId, accountId?)` | `PUT /accounts/{accountId}/scheduled-sends/{scheduledSendId}/cancel`; no body | `IScheduledSend` |
|
|
538
|
+
| `send(scheduledSendId, accountId?)` | `PUT /accounts/{accountId}/scheduled-sends/{scheduledSendId}/send`; no body | `IScheduledSend` |
|
|
539
|
+
|
|
540
|
+
Create with `assignments.schedule(documentId, { ...assignment, send_at })` or `envelopes.schedule({ ...envelope, send_at }, accountId?)`. `send_at` accepts an ISO 8601 timestamp (offsetless means UTC) or integer Unix seconds, from one hour to 90 days ahead according to the server clock. Each non-null expiration must be at least two hours after `send_at`. Scheduling validates methods, plan features and workspace signer membership, but charges and sends nothing. A document can have one pending/processing scheduled send. Sending it separately causes the queued request to fail later.
|
|
541
|
+
|
|
542
|
+
```ts
|
|
543
|
+
const pending = await client.assignments.schedule('example_document', {
|
|
544
|
+
method: 'virtual',
|
|
545
|
+
signers: [{ id: 'example_signer', sign_as: 'Witness' }],
|
|
546
|
+
send_at: new Date(Date.now() + 3 * 60 * 60 * 1000).toISOString(),
|
|
547
|
+
expires_at: null,
|
|
548
|
+
max_total_credits: 0,
|
|
549
|
+
});
|
|
550
|
+
await client.scheduledSends.list({ document_id: 'example_document' });
|
|
551
|
+
await client.scheduledSends.cancel(pending.id);
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
Every mutation returns this unwrapped shape (IDs and timestamps shown are synthetic):
|
|
555
|
+
|
|
556
|
+
```json
|
|
557
|
+
{
|
|
558
|
+
"resource": "scheduled_send",
|
|
559
|
+
"id": "example_schedule",
|
|
560
|
+
"type": "assignment",
|
|
561
|
+
"document_ids": ["example_document"],
|
|
562
|
+
"status": "pending",
|
|
563
|
+
"send_at": "2027-01-01T12:00:00Z",
|
|
564
|
+
"assignment_id": null,
|
|
565
|
+
"envelope_id": null,
|
|
566
|
+
"failure_reason": null,
|
|
567
|
+
"created_at": "2027-01-01T09:00:00Z",
|
|
568
|
+
"processed_at": null
|
|
569
|
+
}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
`type` is `assignment | envelope`; `status` is `pending | processing | sent | cancelled | failed`. `assignment_id`/`envelope_id` identify the successful result. Deleted documents leave `document_ids`; deleting an envelope clears `envelope_id`. `failure_reason` contains the Portuguese refusal when failed; `processed_at` marks sending, failure or cancellation. The worker checks due sends every five minutes, using the original member's permissions and current balance; failures notify that member, or active owners if the member left. No retry is performed by the SDK.
|
|
573
|
+
|
|
574
|
+
`cancel` and `send` require pending status, otherwise 409. Sending now rechecks the create operation's rules and credit ceiling, sends invitations and can charge credits. A refusal leaves the request pending without a failure email; inspect it before retrying. OAuth requires `documents:write` even to list, because failure details can reveal billing or membership state. CLI: `assignments schedule <documentId> --data <json>`, `envelopes schedule --data <json>`, and `scheduled-sends list|cancel|send`; cancel/send confirm unless `--yes`.
|
|
575
|
+
|
|
513
576
|
## Signers (`client.signers`)
|
|
514
577
|
|
|
515
578
|
| SDK method | HTTP operation | Resolves to |
|
|
@@ -804,7 +867,6 @@ Push reads/writes return all eight booleans. Update accepts a non-empty partial
|
|
|
804
867
|
| `changePassword({ email, password, new_password })` | [`PUT /authentication/change-password`](./api-reference.md#change-password) | `{ email }` |
|
|
805
868
|
| `requestPasswordReset(email)` | [`PUT /authentication/request-password-reset`](./api-reference.md#request-password-reset) | `{ email }` |
|
|
806
869
|
| `resetPassword({ email, token?, new_password })` | [`PUT /authentication/reset-password`](./api-reference.md#reset-password) | `{ email }` |
|
|
807
|
-
| `createApiKey(password)` | [`POST /users/api-keys`](./api-reference.md#create-api-key) | `IApiKeyResponse` |
|
|
808
870
|
| `getApiKey()` | [`GET /users/api-keys`](./api-reference.md#get-api-key) | `IMaskedApiKeyResponse`; 404 means no key |
|
|
809
871
|
| `deleteApiKey()` | [`DELETE /users/api-keys`](./api-reference.md#delete-api-key) | `IEmptyResult` (`unknown[]`) |
|
|
810
872
|
| `verifyMfa({ mfa_token, code })` | [`POST /authentication/mfa/verify`](./api-reference.md#complete-a-two-factor-login) | `IMfaVerifyPayload` → `ILoginResponse` |
|
|
@@ -1013,7 +1075,7 @@ Verify the raw bytes before parsing; re-serialized JSON does not match. The enve
|
|
|
1013
1075
|
|
|
1014
1076
|
## Contract boundaries
|
|
1015
1077
|
|
|
1016
|
-
- Production OpenAPI
|
|
1017
|
-
- Certificate start/complete are deployed production extensions, exposed by `startCertificate` and `completeCertificate` with the signing application's payloads. They supplement the
|
|
1078
|
+
- Production OpenAPI publishes 158 operations. Personal API-key creation is intentionally absent from the SDK; masked lookup and revocation remain available.
|
|
1079
|
+
- Certificate start/complete are deployed production extensions, exposed by `startCertificate` and `completeCertificate` with the signing application's payloads. They supplement the 158 OpenAPI operations; the API manifest contains only published paths.
|
|
1018
1080
|
- The SDK retains the two template compatibility routes above. Both `sendToken` call forms send the email-only production body.
|
|
1019
1081
|
- Original signer artifacts require a signer code. Completed copies use private expiring download tokens. Older download call forms remain callable for compatibility; server authorization and lifecycle rules apply.
|
package/install.ps1
CHANGED
|
@@ -66,7 +66,7 @@ function Test-ArchiveLayout([string]$Archive, [string]$Target) {
|
|
|
66
66
|
}
|
|
67
67
|
$allowed = $expectedExecutables -ccontains $entry -or
|
|
68
68
|
$entry -cin @("VERSION", "README.md", "README.en.md", "CONTRIBUTING.md", "SECURITY.md", ".env.example", "LICENSE", "THIRD_PARTY_NOTICES.md") -or
|
|
69
|
-
$entry -cmatch '^docs/[^/]+\.md$' -or $entry -
|
|
69
|
+
$entry -cmatch '^docs/[^/]+\.md$' -or $entry -cin @("docs/api-operations.json", "docs/api-operations-staging.json")
|
|
70
70
|
if (-not $allowed) {
|
|
71
71
|
Fail "Release archive contained an unexpected path: $entry"
|
|
72
72
|
}
|
package/install.sh
CHANGED
|
@@ -268,7 +268,7 @@ validate_archive() {
|
|
|
268
268
|
fi
|
|
269
269
|
;;
|
|
270
270
|
VERSION) version_count=$((version_count + 1)) ;;
|
|
271
|
-
README.md | README.en.md | CONTRIBUTING.md | SECURITY.md | .env.example | LICENSE | THIRD_PARTY_NOTICES.md | docs/*.md | docs/api-operations.json) ;;
|
|
271
|
+
README.md | README.en.md | CONTRIBUTING.md | SECURITY.md | .env.example | LICENSE | THIRD_PARTY_NOTICES.md | docs/*.md | docs/api-operations.json | docs/api-operations-staging.json) ;;
|
|
272
272
|
*) fail "Release archive contained an unexpected path: $entry" ;;
|
|
273
273
|
esac
|
|
274
274
|
done < <(tar -tzf "$archive")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assinafy/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "The official command-line interface for the Assinafy digital-signature API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"prepublishOnly": "npm run typecheck && npm run lint && npm run test && npm run build && npm run verify:bundle"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@types/node": "^
|
|
77
|
+
"@types/node": "^26.6.6",
|
|
78
78
|
"axios": "^1.20.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
"@commander-js/extra-typings": "^15.0.0",
|
|
84
84
|
"commander": "^15.0.0",
|
|
85
85
|
"picocolors": "^1.1.1",
|
|
86
|
-
"tsup": "^
|
|
86
|
+
"tsup": "^9.0.0",
|
|
87
87
|
"tsx": "^4.23.12",
|
|
88
88
|
"typescript": "^7.0.2",
|
|
89
|
-
"vitest": "^
|
|
89
|
+
"vitest": "^5.1.0"
|
|
90
90
|
},
|
|
91
91
|
"overrides": {
|
|
92
92
|
"esbuild": "^0.28.2"
|