@assinafy/cli 2.7.0 → 2.8.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/.env.example +2 -0
- package/README.en.md +14 -8
- package/README.md +82 -415
- package/dist/api.cjs +524 -65
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +521 -65
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +1017 -177
- package/dist/types/api/client.d.ts +5 -0
- package/dist/types/api/client.d.ts.map +1 -1
- package/dist/types/api/envelope-types.d.ts +73 -0
- package/dist/types/api/envelope-types.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +3 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/resources/assignments.d.ts.map +1 -1
- package/dist/types/api/resources/contracts.d.ts +3 -1
- package/dist/types/api/resources/contracts.d.ts.map +1 -1
- package/dist/types/api/resources/documents.d.ts +21 -6
- package/dist/types/api/resources/documents.d.ts.map +1 -1
- package/dist/types/api/resources/embed.d.ts +14 -0
- package/dist/types/api/resources/embed.d.ts.map +1 -0
- package/dist/types/api/resources/envelopes.d.ts +31 -0
- package/dist/types/api/resources/envelopes.d.ts.map +1 -0
- package/dist/types/api/resources/signer-documents.d.ts +23 -11
- package/dist/types/api/resources/signer-documents.d.ts.map +1 -1
- package/dist/types/api/resources/signers.d.ts +1 -1
- package/dist/types/api/resources/signers.d.ts.map +1 -1
- package/dist/types/api/resources/users.d.ts +3 -1
- package/dist/types/api/resources/users.d.ts.map +1 -1
- package/dist/types/api/resources/webhooks.d.ts +6 -2
- package/dist/types/api/resources/webhooks.d.ts.map +1 -1
- package/dist/types/api/resources/workspaces.d.ts +9 -2
- package/dist/types/api/resources/workspaces.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +103 -7
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/api/utils.d.ts +6 -0
- package/dist/types/api/utils.d.ts.map +1 -1
- package/docs/README.md +3 -1
- package/docs/api-operations.json +234 -2
- package/docs/api-reference.md +11533 -3716
- package/docs/assignments.md +16 -14
- package/docs/contracts.md +4 -3
- package/docs/documents.md +44 -27
- package/docs/embed.md +119 -0
- package/docs/envelopes.md +210 -0
- package/docs/releasing.md +38 -12
- package/docs/sdk-reference.md +215 -29
- package/docs/send.md +15 -11
- package/docs/signer.md +84 -3
- package/docs/users.md +41 -0
- package/docs/webhooks.md +22 -6
- package/docs/workspaces.md +66 -3
- package/package.json +1 -1
package/.env.example
CHANGED
package/README.en.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The official command-line interface and Node.js SDK for the [Assinafy API](https://api.assinafy.com.br/v1/docs), a Brazilian digital-signature platform. Upload PDFs, manage signers, request signatures, track activity history, and download certified documents — from a terminal, a shell script, or an application.
|
|
6
6
|
|
|
7
|
-
The CLI is a single self-contained executable. It prints human-readable tables by default and structured JSON with `--json`, so the same commands serve both interactive use and automation. The same package exposes a fully typed SDK at `@assinafy/cli/api` covering all
|
|
7
|
+
The CLI is a single self-contained executable. It prints human-readable tables by default and structured JSON with `--json`, so the same commands serve both interactive use and automation. The same package exposes a fully typed SDK at `@assinafy/cli/api` covering all 147 published API operations.
|
|
8
8
|
|
|
9
9
|
This document reads top to bottom: install, authenticate, send your first signature request, then understand the model well enough to automate it. The [command reference](#command-reference) and [SDK](#nodejs-sdk) sections near the end are lookup tables you can jump to once the flow makes sense.
|
|
10
10
|
|
|
@@ -281,11 +281,17 @@ assinafy signer sign <documentId> <assignmentId> --entries '[]'
|
|
|
281
281
|
|
|
282
282
|
Single-document confirmation, signing, and decline commands verify that the access code matches the requested document and assignment before writing.
|
|
283
283
|
|
|
284
|
-
Owner API credentials are stripped from every public and signer-side request, so an access-code flow can never leak your workspace key.
|
|
284
|
+
Owner API credentials are stripped from every public and signer-side request, so an access-code flow can never leak your workspace key. Original signer downloads require `--access-code`; completed copies use `signer download-copy` with `ASSINAFY_DOWNLOAD_TOKEN`. Legacy artifact call forms remain available, subject to server restrictions.
|
|
285
|
+
|
|
286
|
+
## Envelopes and embedded signing
|
|
287
|
+
|
|
288
|
+
Use `envelopes estimate-cost|create` after uploading and processing up to 20 documents. Creation accepts an idempotency key and credit ceiling. Documents retain their own assignments and certificates. `embed origins` manages exact application origins, and `embed session` mints a private single-use iframe URL for an embedded Email/Whatsapp signer. Owner credentials stay on the backend. See [complete envelope and iframe flows](docs/sdk-reference.md#envelopes-clientenvelopes).
|
|
289
|
+
|
|
290
|
+
`workspaces usage` reads plan/balances, `workspaces notification-policy` controls workspace alerts, and `users push-preferences` controls mobile push preferences. `signer certified-copy` sends a fresh certified-copy link to the original signing contact. All request/response contracts are in the [SDK reference](docs/sdk-reference.md).
|
|
285
291
|
|
|
286
292
|
## Contract tracking (CLM)
|
|
287
293
|
|
|
288
|
-
Contract tracking records counterparty, value, dates, renewal settings and signed amendments on an existing document. Upload and signing remain separate.
|
|
294
|
+
Contract tracking records counterparty, value, dates, renewal settings and signed amendments on an existing document. Upload and signing remain separate. Contract tracking is included in every standard plan, including Free; writes require the feature to be active; reads remain available when that plan lapses. OAuth uses `documents:read` and `documents:write`.
|
|
289
295
|
|
|
290
296
|
Upload the document and persist its ID first. Set draft terms, activate them when lifecycle tracking should begin, and use separate uploaded documents for signed amendments. An amendment's delta applies after certification, in signing order.
|
|
291
297
|
|
|
@@ -330,7 +336,7 @@ assinafy webhooks retry <dispatchId> # redeliver one event
|
|
|
330
336
|
assinafy webhooks verify body.json --id <webhook-id> --timestamp <webhook-timestamp> --signature <webhook-signature>
|
|
331
337
|
```
|
|
332
338
|
|
|
333
|
-
Omitting `--events` subscribes to `document_ready`, `document_prepared`, `signer_signed_document`, `signer_rejected_document`, and `document_processing_failed`. `endpoints update` changes only the flags given (`--active`/`--inactive`, `--signing`/`--no-signing`, `--url`, `--email`, `--name`, `--events`); disabling signing discards the secret. `rotate-secret` invalidates the previous secret immediately. A duplicate URL within the workspace returns `400`; creating past the plan limit returns `403`. OAuth applications cannot read an existing signing secret; `webhooks:write` permits rotation and returns the new secret. Enabling signing on an existing endpoint also returns the new secret once. New or changed webhook URLs require HTTPS. `retry` re-sends only to that delivery's endpoint, and only while it is active.
|
|
339
|
+
Omitting `--events` subscribes to `document_ready`, `document_prepared`, `signer_signed_document`, `signer_rejected_document`, and `document_processing_failed`. `endpoints update` changes only the flags given (`--active`/`--inactive`, `--signing`/`--no-signing`, `--url`, `--email`, `--name`, `--events`); disabling signing discards the secret. `rotate-secret` invalidates the previous secret immediately unless `--keep-previous` requests a 24-hour overlap. A duplicate URL within the workspace returns `400`; creating past the plan limit returns `403`. OAuth applications cannot read an existing signing secret; `webhooks:write` permits rotation and returns the new secret. Enabling signing on an existing endpoint also returns the new secret once. New or changed webhook URLs require HTTPS. `retry` re-sends only to that delivery's endpoint, and only while it is active.
|
|
334
340
|
|
|
335
341
|
Creating a signed endpoint returns `secret` once, including through OAuth; store it securely. The CLI prints it in human and JSON output. OAuth applications that lose it can rotate the secret with `webhooks:write` and store the new value. `endpoints list --url <url>` filters by the exact registered URL; `endpoints delete-by-url --url <url>` deletes by that URL and requires confirmation or `--yes`.
|
|
336
342
|
|
|
@@ -444,7 +450,7 @@ Assinafy runs a **separate sandbox** at `https://sandbox.assinafy.com.br/v1`. It
|
|
|
444
450
|
|
|
445
451
|
## Command reference
|
|
446
452
|
|
|
447
|
-
Run `assinafy <command> --help` for the full flags of any command. Every command's help output is mirrored under [`docs/`](./docs), the [API reference](./docs/api-reference.md) holds the official request/response payloads for all
|
|
453
|
+
Run `assinafy <command> --help` for the full flags of any command. Every command's help output is mirrored under [`docs/`](./docs), the [API reference](./docs/api-reference.md) holds the official request/response payloads for all 147 published operations, and the [SDK reference](./docs/sdk-reference.md) maps each SDK method to its operation.
|
|
448
454
|
|
|
449
455
|
Global flags accepted by every command: `--api-key`, `--token`, `--account-id`, `--base-url`, `-p, --profile`, `--json`, `-q, --quiet`. `assinafy -v` prints the version.
|
|
450
456
|
|
|
@@ -549,7 +555,7 @@ Field definitions are what `--method collect` assignments gather. Run `fields ty
|
|
|
549
555
|
|
|
550
556
|
`document <signerId>` · `documents <signerId>` · `search <signerId> <query>` · `download <signerId> <documentId> <artifact>` · `self` · `accept-terms` · `verify-code --code` (alias `verify-email`) · `certificate-start` · `certificate-complete --certificate-token` · `confirm-data <documentId>` · `upload-signature --file` · `download-signature` · `assignment` · `sign <documentId> <assignmentId> --entries` · `decline <documentId> <assignmentId> --reason` · `sign-multiple --document-ids` · `decline-multiple --document-ids --reason`
|
|
551
557
|
|
|
552
|
-
`documents` and `search` use owner authentication when `--access-code` is omitted. The
|
|
558
|
+
`documents` and `search` use owner authentication when `--access-code` is omitted. The original-artifact `download` requires it on the current API, although the optional CLI flag remains for compatibility. Certified copies use `download-copy` and a private download token. Other signer commands require `--access-code <code>`. Use `ASSINAFY_SIGNER_ACCESS_CODE` to keep the code out of process arguments.
|
|
553
559
|
|
|
554
560
|
### `auth`
|
|
555
561
|
|
|
@@ -647,9 +653,9 @@ The [release runbook](./docs/releasing.md) covers tags, trusted publishing, and
|
|
|
647
653
|
|
|
648
654
|
## Contract boundaries
|
|
649
655
|
|
|
650
|
-
- The production OpenAPI publishes
|
|
656
|
+
- The production OpenAPI publishes 147 operations and the SDK implements all of them. Sandbox deployments can lag individual routes — account/user statistics and user notification preferences may return route-level 404s there despite being documented in production.
|
|
651
657
|
- The SDK keeps two platform-compatible template routes (`GET /accounts/{id}/templates/{id}` and its page download) that are absent from the published OpenAPI paths.
|
|
652
|
-
- Certificate start/complete are deployed production extensions of the public signing frontend, exposed as `signerDocuments.startCertificate(accessCode)` and `signerDocuments.completeCertificate(accessCode, token)`. Start posts `{ "signer-access-code": code }` and returns `{ token }`; complete posts `{ "signer-access-code": code, token }` and returns `{ signerName }`. Both also carry the access code in the query string and strip owner credentials. They supplement, but are not part of, the
|
|
658
|
+
- Certificate start/complete are deployed production extensions of the public signing frontend, exposed as `signerDocuments.startCertificate(accessCode)` and `signerDocuments.completeCertificate(accessCode, token)`. Start posts `{ "signer-access-code": code }` and returns `{ token }`; complete posts `{ "signer-access-code": code, token }` and returns `{ signerName }`. Both also carry the access code in the query string and strip owner credentials. They supplement, but are not part of, the 147 OpenAPI operations.
|
|
653
659
|
- `send-token` sends the email-only body `{ "channel": "email", "recipient": "..." }`; WhatsApp and the older `{ "email" }` body are rejected by the API with `400`.
|
|
654
660
|
- `signer documents` and `signer search` accept the workspace API key or token when `--access-code` is omitted.
|
|
655
661
|
- Webhook signatures follow Standard Webhooks; `WebhookVerifier.verifyDelivery` implements the published scheme. The older `verify(body, signature)` method is deprecated and does not match Assinafy deliveries.
|