@assinafy/cli 2.9.1 → 2.10.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 CHANGED
@@ -4,7 +4,7 @@ _[Leia em português](README.md) · English_
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 147 published API operations.
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`; the HTTP reference covers all 147 published production 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
 
@@ -86,11 +86,11 @@ Use an API key for direct owner integrations, OAuth for customer-consented marke
86
86
  | OAuth access token | `Authorization: Bearer <token>` | Marketplace connections, limited to granted scopes and one workspace. |
87
87
  | User JWT | `Authorization: Bearer <jwt>` | User sessions and permitted account operations. |
88
88
 
89
- Generate an API key from the Assinafy dashboard, or from the CLI with an existing session:
89
+ Generate an API key from the Assinafy dashboard. The CLI can inspect or revoke an existing key with a permitted user session:
90
90
 
91
91
  ```bash
92
- assinafy auth login you@example.com # returns a JWT
93
- assinafy auth api-keys create --token <jwt> # generates (and rotates) the key
92
+ assinafy auth login user@example.com # returns a JWT
93
+ assinafy auth api-keys get --token <jwt> # shows the masked key
94
94
  ```
95
95
 
96
96
  When two-factor authentication is enabled, `auth login` asks for an authenticator or recovery code (or reads `--mfa-code` / `ASSINAFY_MFA_CODE`); the challenge is single-use and expires after 5 minutes. `auth mfa enroll`, `confirm`, `list`, `recovery-codes`, and `remove` manage the authenticator and recovery codes.
@@ -480,6 +480,7 @@ assinafy send contract.pdf \
480
480
  | `documents thumbnail <id> [-o] [--force]` | Download the thumbnail (JPEG) |
481
481
  | `documents download-page <id> <pageId> [-o] [--force]` | Download one page (JPEG) |
482
482
  | `documents activities <id>` | Activity log |
483
+ | `documents cancel <id> [-y]` | Cancel an open document and retain its files and history |
483
484
  | `documents delete <id> [-y]` | Delete a document |
484
485
  | `documents tags <id>` | List attached tags |
485
486
  | `documents tags-set <id> [tags...]` | Replace the tag set by name (none detaches all) |
@@ -559,7 +560,7 @@ Field definitions are what `--method collect` assignments gather. Run `fields ty
559
560
 
560
561
  ### `auth`
561
562
 
562
- `login <email> [--mfa-code]` · `social-login` · `link-social-login` · `change-password` · `request-password-reset <email>` · `reset-password --reset-token` · `api-keys create|get|delete` · `mfa verify --mfa-token [--mfa-code]` · `mfa list` · `mfa enroll [--label]` · `mfa confirm <methodId> [--code] [--password|--reauth-code]` · `mfa recovery-codes [--password|--mfa-code]` · `mfa remove <methodId> [--password|--mfa-code] [-y]`
563
+ `login <email> [--mfa-code]` · `social-login` · `link-social-login` · `change-password` · `request-password-reset <email>` · `reset-password --reset-token` · `api-keys get|delete` · `mfa verify --mfa-token [--mfa-code]` · `mfa list` · `mfa enroll [--label]` · `mfa confirm <methodId> [--code] [--password|--reauth-code]` · `mfa recovery-codes [--password|--mfa-code]` · `mfa remove <methodId> [--password|--mfa-code] [-y]`
563
564
 
564
565
  For server-to-server use, prefer an API key (`assinafy login` or `--api-key`) and skip this group. `auth login`, `auth mfa verify`, `auth social-login`, `auth request-password-reset`, and `auth reset-password` run without stored credentials; the rest accept the API key or JWT documented for their endpoint.
565
566
 
@@ -653,7 +654,7 @@ The [release runbook](./docs/releasing.md) covers tags, trusted publishing, and
653
654
 
654
655
  ## Contract boundaries
655
656
 
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.
657
+ - The production OpenAPI publishes 147 operations. Personal API-key creation is intentionally absent from the SDK; create keys in the Assinafy dashboard. Masked lookup and revocation remain available as compatibility methods.
657
658
  - 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.
658
659
  - 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.
659
660
  - `send-token` sends the email-only body `{ "channel": "email", "recipient": "..." }`; WhatsApp and the older `{ "email" }` body are rejected by the API with `400`.
@@ -664,4 +665,4 @@ The [release runbook](./docs/releasing.md) covers tags, trusted publishing, and
664
665
 
665
666
  MIT © Assinafy
666
667
 
667
- Staging publishes additional scheduled-send, watcher, signer-capacity, delivery-history and envelope-reminder-estimate operations. Set `ASSINAFY_BASE_URL=https://api.angry-pisco.stage.assinafy.com.br/v1` with staging credentials. See [SDK flows](docs/sdk-reference.md#scheduled-sends-clientscheduledsends) and [complete staging HTTP contracts](docs/api-reference-staging.md).
668
+ Scheduled sends, document watchers, signer capacities, notification history and envelope reminder estimates are published production operations. See their [SDK flows](docs/sdk-reference.md#scheduled-sends-clientscheduledsends) and [HTTP contracts](docs/api-reference.md).
package/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  _Português · [Read in English](README.en.md)_
4
4
 
5
- CLI e SDK TypeScript para as 147 operações de produção e 157 de staging publicadas da [API Assinafy](https://api.assinafy.com.br/v1/docs): documentos, signatários, assinaturas, templates, contratos, envelopes, assinatura incorporada, OAuth e webhooks.
6
-
7
- Staging também oferece envios agendados, observadores, capacidades dos signatários e histórico de entrega: [fluxos e contratos](docs/sdk-reference.md#scheduled-sends-clientscheduledsends). Configure `ASSINAFY_BASE_URL=https://api.angry-pisco.stage.assinafy.com.br/v1` com credenciais próprias.
5
+ CLI e SDK TypeScript para a [API Assinafy](https://api.assinafy.com.br/v1/docs): documentos, signatários, assinaturas, templates, contratos, envelopes, assinatura incorporada, OAuth, envios agendados e webhooks. A referência HTTP inclui as 158 operações de produção publicadas.
8
6
 
9
7
  ## Instalação
10
8
 
@@ -178,7 +176,7 @@ Respostas envelopadas resolvem para `data`; listas paginadas retornam `{ data, m
178
176
 
179
177
  ## Referências e desenvolvimento
180
178
 
181
- - [Referência HTTP](docs/api-reference.md): parâmetros e requisições/respostas de todas as 147 operações publicadas.
179
+ - [Referência HTTP](docs/api-reference.md): parâmetros e requisições/respostas de todas as 158 operações publicadas.
182
180
  - [Referência do SDK](docs/sdk-reference.md): métodos, helpers, compatibilidade e fluxos adicionais.
183
181
  - [Comandos](docs/README.md): documentos, signatários, assignments, signer, OAuth, auth, workspaces, usuários, templates, contratos, tags, fields, webhooks e configuração.
184
182
  - [Segurança](SECURITY.md), [contribuição](CONTRIBUTING.md) e [releases](docs/releasing.md).
@@ -62,7 +62,7 @@ Source: git+https://github.com/commander-js/extra-typings.git
62
62
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
63
63
  SOFTWARE.
64
64
 
65
- ## @types/node 26.6.6
65
+ ## @types/node 26.6.11
66
66
 
67
67
  License: MIT
68
68
 
@@ -124,7 +124,7 @@ Source: git+https://github.com/alexindigo/asynckit.git
124
124
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
125
125
  SOFTWARE.
126
126
 
127
- ## axios 1.21.0
127
+ ## axios 1.22.0
128
128
 
129
129
  License: MIT
130
130
 
@@ -499,7 +499,7 @@ Source: git+https://github.com/43081j/fast-wrap-ansi.git
499
499
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
500
500
  SOFTWARE.
501
501
 
502
- ## follow-redirects 1.16.2
502
+ ## follow-redirects 1.16.3
503
503
 
504
504
  License: MIT
505
505
 
@@ -888,33 +888,6 @@ Source: alexeyraspopov/picocolors
888
888
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
889
889
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
890
890
 
891
- ## proxy-from-env 2.1.0
892
-
893
- License: MIT
894
-
895
- Source: git+https://github.com/Rob--W/proxy-from-env.git
896
-
897
- The MIT License
898
-
899
- Copyright (C) 2016-2018 Rob Wu <rob@robwu.nl>
900
-
901
- Permission is hereby granted, free of charge, to any person obtaining a copy of
902
- this software and associated documentation files (the "Software"), to deal in
903
- the Software without restriction, including without limitation the rights to
904
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
905
- of the Software, and to permit persons to whom the Software is furnished to do
906
- so, subject to the following conditions:
907
-
908
- The above copyright notice and this permission notice shall be included in all
909
- copies or substantial portions of the Software.
910
-
911
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
912
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
913
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
914
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
915
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
916
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
917
-
918
891
  ## sisteransi 2.0.0
919
892
 
920
893
  License: MIT
package/dist/api.cjs CHANGED
@@ -650,7 +650,7 @@ function normaliseSignerRef(ref, options) {
650
650
  throw new ValidationError("Invalid signer reference", { ref });
651
651
  }
652
652
  var AssignmentResource = class extends BaseResource {
653
- /** Keep a request for later; no invitation or charge until the server sends it (staging). */
653
+ /** Keep a request for later; no invitation or charge until the server sends it. */
654
654
  async schedule(documentId, payload) {
655
655
  const id = this.requireId(documentId, "Document ID");
656
656
  requireScheduledTime(payload?.send_at);
@@ -915,14 +915,6 @@ var AuthenticationResource = class extends BaseResource {
915
915
  () => this.http.post("/auth/link-social-login", payload)
916
916
  );
917
917
  }
918
- /** `POST /users/api-keys` — generate (and rotate) the current user's API key. */
919
- async createApiKey(password) {
920
- if (!password) throw new ValidationError("password is required");
921
- return this.call(
922
- "Failed to create API key",
923
- () => this.http.post("/users/api-keys", { password })
924
- );
925
- }
926
918
  /**
927
919
  * `GET /users/api-keys` — fetch a masked version of the current API key, or
928
920
  * `null` if no key has been generated yet.
@@ -1137,7 +1129,7 @@ var FAILED_STATUSES = /* @__PURE__ */ new Set([
1137
1129
  "expired"
1138
1130
  ]);
1139
1131
  var DocumentResource = class extends BaseResource {
1140
- /** Read contacts who receive a completion email without document access (staging). */
1132
+ /** Read contacts who receive a completion email without document access. */
1141
1133
  async listWatchers(documentId) {
1142
1134
  const id = this.requireId(documentId, "Document ID");
1143
1135
  return this.call(
@@ -1145,7 +1137,7 @@ var DocumentResource = class extends BaseResource {
1145
1137
  () => this.http.get(`/documents/${id}/watchers`)
1146
1138
  );
1147
1139
  }
1148
- /** Replace all watchers; an empty list clears them. Owner credentials required (staging). */
1140
+ /** Replace all watchers; an empty list clears them. Owner credentials required. */
1149
1141
  async setWatchers(documentId, watcherIds) {
1150
1142
  const id = this.requireId(documentId, "Document ID");
1151
1143
  if (!Array.isArray(watcherIds) || new Set(watcherIds).size > 10 || watcherIds.some((value) => typeof value !== "string" || !value.trim())) {
@@ -1360,6 +1352,11 @@ var DocumentResource = class extends BaseResource {
1360
1352
  const id = this.requireId(documentId, "Document ID");
1361
1353
  return this.call("Failed to delete document", () => this.http.delete(`/documents/${id}`));
1362
1354
  }
1355
+ /** Cancel an open document while retaining its files and history. */
1356
+ async cancel(documentId) {
1357
+ const id = this.requireId(documentId, "Document ID");
1358
+ return this.call("Failed to cancel document", () => this.http.put(`/documents/${id}/cancel`));
1359
+ }
1363
1360
  /** List the tags attached to a document. */
1364
1361
  async listTags(documentId, accountId) {
1365
1362
  const accId = this.accountId(accountId);
@@ -1686,7 +1683,7 @@ function validateOrigin(value) {
1686
1683
 
1687
1684
  // src/api/resources/envelopes.ts
1688
1685
  var EnvelopeResource = class extends BaseResource {
1689
- /** Schedule one envelope request; idempotency headers are not supported here (staging). */
1686
+ /** Schedule one envelope request; idempotency headers are not supported here. */
1690
1687
  async schedule(payload, accountId) {
1691
1688
  const id = this.accountId(accountId);
1692
1689
  validateCreate(payload);
@@ -1696,7 +1693,7 @@ var EnvelopeResource = class extends BaseResource {
1696
1693
  () => this.http.post(`/accounts/${id}/scheduled-sends`, payload)
1697
1694
  );
1698
1695
  }
1699
- /** Estimate one reminder for the whole envelope without sending or charging (staging). */
1696
+ /** Estimate one reminder for the whole envelope without sending or charging. */
1700
1697
  async estimateResendCost(envelopeId, signerId, accountId) {
1701
1698
  const id = this.accountId(accountId);
1702
1699
  const eid = this.requireId(envelopeId, "Envelope ID");