@assinafy/cli 2.8.0 → 2.9.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/README.en.md +61 -59
- package/README.md +29 -23
- package/THIRD_PARTY_NOTICES.md +8 -8
- package/dist/api.cjs +199 -47
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +197 -47
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +1388 -532
- 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/documents.d.ts +5 -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 +35 -1
- 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 +2 -0
- package/docs/api-operations-staging.json +1262 -0
- package/docs/api-operations.json +1 -1
- package/docs/api-reference-staging.md +18466 -0
- package/docs/api-reference.md +34 -7
- package/docs/assignments.md +46 -0
- package/docs/documents.md +31 -0
- package/docs/envelopes.md +29 -0
- package/docs/scheduled-sends.md +63 -0
- package/docs/sdk-reference.md +64 -2
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/package.json +4 -4
package/docs/api-reference.md
CHANGED
|
@@ -7,7 +7,7 @@ The renderer reuses a generic 400 envelope for several non-400 errors; top-level
|
|
|
7
7
|
- OpenAPI: 3.1.0
|
|
8
8
|
- API document version: 1.0.0
|
|
9
9
|
- Operations: 147
|
|
10
|
-
- Contract SHA-256: `
|
|
10
|
+
- Contract SHA-256: `bd1c42d8293167ea95fc5ffcd26730960e37c219dc9a67f224295e6012c3d115`
|
|
11
11
|
|
|
12
12
|
## Accounts
|
|
13
13
|
|
|
@@ -1567,7 +1567,7 @@ List documents of the workspace, most recently updated first. Every row includes
|
|
|
1567
1567
|
|
|
1568
1568
|
`POST /v1/accounts/{accountId}/documents`
|
|
1569
1569
|
|
|
1570
|
-
Create a document from an uploaded file. Maximum file size 25MB; maximum 2000 pages.
|
|
1570
|
+
Create a document from an uploaded file: PDF, or a Word or OpenDocument text file (`.doc`, `.docx`, `.odt`), which is converted to PDF. Maximum file size 25MB; maximum 2000 pages.
|
|
1571
1571
|
|
|
1572
1572
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
1573
1573
|
|
|
@@ -1581,7 +1581,7 @@ Create a document from an uploaded file. Maximum file size 25MB; maximum 2000 pa
|
|
|
1581
1581
|
|
|
1582
1582
|
Fields (`multipart/form-data`):
|
|
1583
1583
|
|
|
1584
|
-
- `file` (string, required) — The
|
|
1584
|
+
- `file` (string, required) — The file to upload: PDF, DOC, DOCX or ODT.
|
|
1585
1585
|
|
|
1586
1586
|
Example:
|
|
1587
1587
|
|
|
@@ -4278,10 +4278,19 @@ Per-unit costs (in credits) used to build the estimate:
|
|
|
4278
4278
|
|------|------|
|
|
4279
4279
|
| Extra document | 1 credit |
|
|
4280
4280
|
| Email notification | 0 credits |
|
|
4281
|
-
| WhatsApp notification |
|
|
4282
|
-
| Digital certificate signature (per signer) | 0.
|
|
4281
|
+
| WhatsApp notification | depends on the plan, see the table below |
|
|
4282
|
+
| Digital certificate signature (per signer) | 0.45 credits |
|
|
4283
4283
|
| Identity document verification (per signer) | depends on the plan, see the table below |
|
|
4284
4284
|
|
|
4285
|
+
WhatsApp notification, per plan:
|
|
4286
|
+
|
|
4287
|
+
| Plan | Price per signer |
|
|
4288
|
+
|------|------------------|
|
|
4289
|
+
| Pro | 0.4 credits |
|
|
4290
|
+
| Other plans and enterprise contracts | 0.45 credits |
|
|
4291
|
+
|
|
4292
|
+
Identity document verification, per plan:
|
|
4293
|
+
|
|
4285
4294
|
| Plan | Price per signer |
|
|
4286
4295
|
|------|------------------|
|
|
4287
4296
|
| Free | 1.5 credits |
|
|
@@ -5361,7 +5370,7 @@ Example:
|
|
|
5361
5370
|
|
|
5362
5371
|
`PUT /v1/authentication/request-password-reset`
|
|
5363
5372
|
|
|
5364
|
-
Send the user an email with instructions to reset their password. Used when the password was forgotten or never set.
|
|
5373
|
+
Send the user an email with instructions to reset their password. Used when the password was forgotten or never set. An address with no account gets the same `200` and no email, so the answer never tells whether an address has an account. An `email` that is not text answers `400`.
|
|
5365
5374
|
|
|
5366
5375
|
**Authentication:** none (public endpoint).
|
|
5367
5376
|
|
|
@@ -5393,6 +5402,24 @@ Example:
|
|
|
5393
5402
|
}
|
|
5394
5403
|
```
|
|
5395
5404
|
|
|
5405
|
+
##### 400 — One or more fields failed validation.
|
|
5406
|
+
|
|
5407
|
+
```json
|
|
5408
|
+
{
|
|
5409
|
+
"status": 400,
|
|
5410
|
+
"message": "Bad request.",
|
|
5411
|
+
"data": null,
|
|
5412
|
+
"code": "PlanRestricted",
|
|
5413
|
+
"errors": [
|
|
5414
|
+
{
|
|
5415
|
+
"field": "full_name",
|
|
5416
|
+
"code": "Required",
|
|
5417
|
+
"message": "Full Name cannot be blank."
|
|
5418
|
+
}
|
|
5419
|
+
]
|
|
5420
|
+
}
|
|
5421
|
+
```
|
|
5422
|
+
|
|
5396
5423
|
##### 500 — Unexpected server error.
|
|
5397
5424
|
|
|
5398
5425
|
```json
|
|
@@ -5415,7 +5442,7 @@ Example:
|
|
|
5415
5442
|
|
|
5416
5443
|
`PUT /v1/authentication/reset-password`
|
|
5417
5444
|
|
|
5418
|
-
Reset the user's password using the token received by email.
|
|
5445
|
+
Reset the user's password using the token received by email. A wrong, expired or non-text token, and an address with no account, answer `400`. The new password needs at least 6 characters. A reset ends every session of the user (login tokens issued before it answer `401`) and revokes every connected OAuth app; the user's API key keeps working.
|
|
5419
5446
|
|
|
5420
5447
|
**Authentication:** none (public endpoint).
|
|
5421
5448
|
|
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 (staging)
|
|
25
|
+
signer-capacities <documentId> Read the capacities signers were assigned (staging)
|
|
26
|
+
notification-history <documentId> Read notification delivery/open times (staging)
|
|
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 (staging)
|
|
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 (staging)
|
|
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 (staging)
|
|
247
|
+
|
|
248
|
+
Arguments:
|
|
249
|
+
documentId Document ID
|
|
250
|
+
|
|
251
|
+
Options:
|
|
252
|
+
-h, --help display help for command
|
|
253
|
+
```
|
package/docs/documents.md
CHANGED
|
@@ -33,6 +33,8 @@ Commands:
|
|
|
33
33
|
send-token [options] <id> Email a one-time access token to a signer of a pending document
|
|
34
34
|
progress <id> Show signing progress for a document
|
|
35
35
|
wait [options] <id> Poll a document until it is ready (or fails / times out)
|
|
36
|
+
watchers <documentId> List document watchers (staging; owner credentials required)
|
|
37
|
+
set-watchers [options] <documentId> Replace contacts notified when the document ends (staging)
|
|
36
38
|
help [command] display help for command
|
|
37
39
|
```
|
|
38
40
|
|
|
@@ -400,3 +402,32 @@ Options:
|
|
|
400
402
|
--interval <ms> Poll interval in milliseconds (default: "2000")
|
|
401
403
|
-h, --help display help for command
|
|
402
404
|
```
|
|
405
|
+
|
|
406
|
+
### `assinafy documents watchers`
|
|
407
|
+
|
|
408
|
+
```text
|
|
409
|
+
Usage: assinafy documents watchers [options] <documentId>
|
|
410
|
+
|
|
411
|
+
List document watchers (staging; owner credentials required)
|
|
412
|
+
|
|
413
|
+
Arguments:
|
|
414
|
+
documentId Document ID
|
|
415
|
+
|
|
416
|
+
Options:
|
|
417
|
+
-h, --help display help for command
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### `assinafy documents set-watchers`
|
|
421
|
+
|
|
422
|
+
```text
|
|
423
|
+
Usage: assinafy documents set-watchers [options] <documentId>
|
|
424
|
+
|
|
425
|
+
Replace contacts notified when the document ends (staging)
|
|
426
|
+
|
|
427
|
+
Arguments:
|
|
428
|
+
documentId Document ID
|
|
429
|
+
|
|
430
|
+
Options:
|
|
431
|
+
--watcher-ids <json> JSON array of contact IDs; [] removes all watchers
|
|
432
|
+
-h, --help display help for command
|
|
433
|
+
```
|
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 (staging)
|
|
27
|
+
estimate-resend-cost <envelopeId> <signerId> Estimate one envelope reminder without sending or charging (staging)
|
|
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 (staging)
|
|
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 (staging)
|
|
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 (staging)
|
|
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` (staging) | `ISigner[]` |
|
|
117
|
+
| `setWatchers(documentId, watcherIds)` | `PUT /documents/{documentId}/watchers` (staging); `{ 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` |
|
|
@@ -139,6 +141,8 @@ try {
|
|
|
139
141
|
| `isFullySigned(documentId)` | SDK helper over `details` | `boolean` |
|
|
140
142
|
| `getSigningProgress(documentId)` | SDK helper over `details` | `{ signed; total; pending; percentage }` |
|
|
141
143
|
|
|
144
|
+
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 [staging request and response contracts](./api-reference-staging.md#documents). CLI: `documents watchers` and `documents set-watchers --watcher-ids '["example_signer"]'`.
|
|
145
|
+
|
|
142
146
|
Upload input and options:
|
|
143
147
|
|
|
144
148
|
```ts
|
|
@@ -175,6 +179,8 @@ An envelope groups up to 20 processed documents and 20 existing workspace signer
|
|
|
175
179
|
| --- | --- | --- |
|
|
176
180
|
| `list(params?, accountId?)` | `GET /accounts/{accountId}/envelopes`; `{ page?, per_page?, search?, status?: "open" | "closed" }` | `PaginatedResult<IDocumentEnvelope>` |
|
|
177
181
|
| `create(payload, options?)` | `POST /accounts/{accountId}/envelopes`; `ICreateEnvelopePayload` | `IDocumentEnvelope` |
|
|
182
|
+
| `schedule(payload, accountId?)` | `POST /accounts/{accountId}/scheduled-sends` (staging); creation body plus `send_at` | `IScheduledSend` |
|
|
183
|
+
| `estimateResendCost(envelopeId, signerId, accountId?)` | `POST …/{envelopeId}/signers/{signerId}/estimate-resend-cost` (staging); no body | `IResendCostEstimate` |
|
|
178
184
|
| `estimateCost(payload, accountId?)` | `POST /accounts/{accountId}/envelopes/estimate-cost`; same creation body, no changes or charges | `IEstimateCostResponse` |
|
|
179
185
|
| `get(envelopeId, accountId?)` | `GET /accounts/{accountId}/envelopes/{envelopeId}` | `IDocumentEnvelope` |
|
|
180
186
|
| `update(envelopeId, payload, accountId?)` | `PATCH /accounts/{accountId}/envelopes/{envelopeId}`; `{ name?, message?: string | null, document_ids?: string[] }` | `IDocumentEnvelope` |
|
|
@@ -280,6 +286,8 @@ Creation options are `{ accountId?, idempotencyKey? }`. The case-sensitive key b
|
|
|
280
286
|
|
|
281
287
|
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
288
|
|
|
289
|
+
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).
|
|
290
|
+
|
|
283
291
|
## Embedded signing (`client.embed`)
|
|
284
292
|
|
|
285
293
|
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 +466,9 @@ The hourly lifecycle uses Brasília calendar days: notice-period alerts, warning
|
|
|
458
466
|
| SDK method | HTTP operation | Resolves to |
|
|
459
467
|
| --- | --- | --- |
|
|
460
468
|
| `list(params?, accountId?)` | [`GET /assignments?accountId=…`](./api-reference.md#list-assignments) | `PaginatedResult<IAssignment>` |
|
|
469
|
+
| `schedule(documentId, payload)` | `POST /documents/{documentId}/scheduled-sends` (staging); assignment body plus `send_at` | `IScheduledSend` |
|
|
470
|
+
| `signerCapacities(documentId)` | `GET /documents/{documentId}/signer-capacities` (staging) | `ISignerCapacity[]` (`{ signer_id, sign_as }`) |
|
|
471
|
+
| `notificationHistory(documentId)` | `GET /documents/{documentId}/notification-history` (staging) | `ISignerNotificationHistory[]` |
|
|
461
472
|
| `create(documentId, payload)` | [`POST /documents/{documentId}/assignments`](./api-reference.md#create-assignment-request-signatures) | `IAssignment` |
|
|
462
473
|
| `estimateCost(documentId, payload)` | [`POST /documents/{documentId}/assignments/estimate-cost`](./api-reference.md#estimate-assignment-cost) | `IEstimateCostResponse` |
|
|
463
474
|
| `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 +487,7 @@ Assignment payload:
|
|
|
476
487
|
signers?: Array<string | {
|
|
477
488
|
id?: string;
|
|
478
489
|
signer_id?: string;
|
|
490
|
+
sign_as?: SignerCapacity | null; // staging
|
|
479
491
|
verification_method?: 'Email' | 'Whatsapp' | 'DigitalCertificate' | 'IdDocumentFaceMatchBasic';
|
|
480
492
|
notification_methods?: Array<'Email' | 'Whatsapp'>;
|
|
481
493
|
step?: number;
|
|
@@ -484,7 +496,7 @@ Assignment payload:
|
|
|
484
496
|
signer_ids?: string[]; // compatibility alias
|
|
485
497
|
signerIds?: string[]; // compatibility alias
|
|
486
498
|
message?: string;
|
|
487
|
-
expires_at?: string;
|
|
499
|
+
expires_at?: string | number | null;
|
|
488
500
|
copy_receivers?: string[];
|
|
489
501
|
max_total_credits?: number;
|
|
490
502
|
entries?: ICollectAssignmentEntry[];
|
|
@@ -510,6 +522,56 @@ Production defaults `notification_methods: []` to `['Email']` and sends an invit
|
|
|
510
522
|
|
|
511
523
|
`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
524
|
|
|
525
|
+
On staging, `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 `[]`.
|
|
526
|
+
|
|
527
|
+
`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`.
|
|
528
|
+
|
|
529
|
+
## Scheduled sends (`client.scheduledSends`)
|
|
530
|
+
|
|
531
|
+
These routes are published on [staging](https://api.angry-pisco.stage.assinafy.com.br/v1/docs). Configure that deployment explicitly; production may return 404 until rollout. Full HTTP parameters, payloads, responses and errors are in [the staging API reference](./api-reference-staging.md).
|
|
532
|
+
|
|
533
|
+
| SDK method | HTTP operation | Resolves to |
|
|
534
|
+
| --- | --- | --- |
|
|
535
|
+
| `list(params?, accountId?)` | `GET /accounts/{accountId}/scheduled-sends`; `{ page?, per_page?, document_id? }` | `PaginatedResult<IScheduledSend>` |
|
|
536
|
+
| `cancel(scheduledSendId, accountId?)` | `PUT /accounts/{accountId}/scheduled-sends/{scheduledSendId}/cancel`; no body | `IScheduledSend` |
|
|
537
|
+
| `send(scheduledSendId, accountId?)` | `PUT /accounts/{accountId}/scheduled-sends/{scheduledSendId}/send`; no body | `IScheduledSend` |
|
|
538
|
+
|
|
539
|
+
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.
|
|
540
|
+
|
|
541
|
+
```ts
|
|
542
|
+
const pending = await client.assignments.schedule('example_document', {
|
|
543
|
+
method: 'virtual',
|
|
544
|
+
signers: [{ id: 'example_signer', sign_as: 'Witness' }],
|
|
545
|
+
send_at: new Date(Date.now() + 3 * 60 * 60 * 1000).toISOString(),
|
|
546
|
+
expires_at: null,
|
|
547
|
+
max_total_credits: 0,
|
|
548
|
+
});
|
|
549
|
+
await client.scheduledSends.list({ document_id: 'example_document' });
|
|
550
|
+
await client.scheduledSends.cancel(pending.id);
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
Every mutation returns this unwrapped shape (IDs and timestamps shown are synthetic):
|
|
554
|
+
|
|
555
|
+
```json
|
|
556
|
+
{
|
|
557
|
+
"resource": "scheduled_send",
|
|
558
|
+
"id": "example_schedule",
|
|
559
|
+
"type": "assignment",
|
|
560
|
+
"document_ids": ["example_document"],
|
|
561
|
+
"status": "pending",
|
|
562
|
+
"send_at": "2027-01-01T12:00:00Z",
|
|
563
|
+
"assignment_id": null,
|
|
564
|
+
"envelope_id": null,
|
|
565
|
+
"failure_reason": null,
|
|
566
|
+
"created_at": "2027-01-01T09:00:00Z",
|
|
567
|
+
"processed_at": null
|
|
568
|
+
}
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
`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.
|
|
572
|
+
|
|
573
|
+
`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`.
|
|
574
|
+
|
|
513
575
|
## Signers (`client.signers`)
|
|
514
576
|
|
|
515
577
|
| SDK method | HTTP operation | Resolves to |
|
|
@@ -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
|
|
1078
|
+
- Production OpenAPI publishes 147 operations; staging publishes 157, all exposed by the SDK. Watchers, scheduled sends, signer capacities, notification delivery times and envelope reminder estimates require staging until their production rollout. Some sandbox deployments lag it; account/user statistics and user notification-preference routes may return route-level 404s even though production documentation includes them.
|
|
1017
1079
|
- Certificate start/complete are deployed production extensions, exposed by `startCertificate` and `completeCertificate` with the signing application's payloads. They supplement the 147 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.9.1",
|
|
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"
|