@assinafy/cli 2.4.2 → 2.5.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/docs/auth.md CHANGED
@@ -11,8 +11,9 @@ Options:
11
11
  -h, --help display help for command
12
12
 
13
13
  Commands:
14
- login [options] <email> Exchange email + password for a JWT access
15
- token (no existing credentials required)
14
+ login [options] <email> Exchange email + password (and a two-factor
15
+ code when enabled) for a JWT access token (no
16
+ existing credentials required)
16
17
  social-login [options] Exchange a provider token for an Assinafy JWT
17
18
  (no existing credentials required)
18
19
  link-social-login [options] Link a Google identity to the authenticated
@@ -23,6 +24,8 @@ Commands:
23
24
  reset-password [options] Complete a password reset with the emailed
24
25
  token (no existing credentials required)
25
26
  api-keys Manage the current user personal API key
27
+ mfa Two-factor authentication: login verification,
28
+ enrollment, and recovery codes
26
29
  help [command] display help for command
27
30
  ```
28
31
 
@@ -31,14 +34,16 @@ Commands:
31
34
  ```text
32
35
  Usage: assinafy auth login [options] <email>
33
36
 
34
- Exchange email + password for a JWT access token (no existing credentials
35
- required)
37
+ Exchange email + password (and a two-factor code when enabled) for a JWT access
38
+ token (no existing credentials required)
36
39
 
37
40
  Arguments:
38
41
  email Account email
39
42
 
40
43
  Options:
41
44
  --password <password> Password (prompted if omitted) (env: ASSINAFY_PASSWORD)
45
+ --mfa-code <code> Authenticator or recovery code (prompted if required
46
+ and omitted) (env: ASSINAFY_MFA_CODE)
42
47
  -h, --help display help for command
43
48
  ```
44
49
 
@@ -167,3 +172,119 @@ Options:
167
172
  -y, --yes Skip the confirmation prompt
168
173
  -h, --help display help for command
169
174
  ```
175
+
176
+ ### `assinafy auth mfa`
177
+
178
+ ```text
179
+ Usage: assinafy auth mfa [options] [command]
180
+
181
+ Two-factor authentication: login verification, enrollment, and recovery codes
182
+
183
+ Options:
184
+ -h, --help display help for command
185
+
186
+ Commands:
187
+ verify [options] Complete a two-factor login with the mfa_token
188
+ from login (no existing credentials required)
189
+ list|ls List enrolled two-factor methods and remaining
190
+ recovery codes
191
+ enroll [options] Start authenticator enrollment; prints the
192
+ one-time secret and provisioning URI
193
+ confirm [options] <methodId> Activate an enrolled authenticator and print
194
+ the one-time recovery codes
195
+ recovery-codes [options] Issue ten new recovery codes and invalidate
196
+ the previous set
197
+ remove|rm [options] <methodId> Remove a two-factor method (the last one also
198
+ discards recovery codes)
199
+ help [command] display help for command
200
+ ```
201
+
202
+ #### `assinafy auth mfa verify`
203
+
204
+ ```text
205
+ Usage: assinafy auth mfa verify [options]
206
+
207
+ Complete a two-factor login with the mfa_token from login (no existing
208
+ credentials required)
209
+
210
+ Options:
211
+ --mfa-token <token> Challenge token returned by login (env:
212
+ ASSINAFY_MFA_TOKEN)
213
+ --mfa-code <code> Authenticator or recovery code (prompted if required and
214
+ omitted) (env: ASSINAFY_MFA_CODE)
215
+ -h, --help display help for command
216
+ ```
217
+
218
+ #### `assinafy auth mfa list`
219
+
220
+ ```text
221
+ Usage: assinafy auth mfa list|ls [options]
222
+
223
+ List enrolled two-factor methods and remaining recovery codes
224
+
225
+ Options:
226
+ -h, --help display help for command
227
+ ```
228
+
229
+ #### `assinafy auth mfa enroll`
230
+
231
+ ```text
232
+ Usage: assinafy auth mfa enroll [options]
233
+
234
+ Start authenticator enrollment; prints the one-time secret and provisioning URI
235
+
236
+ Options:
237
+ --label <label> Name for the authenticator
238
+ -h, --help display help for command
239
+ ```
240
+
241
+ #### `assinafy auth mfa confirm`
242
+
243
+ ```text
244
+ Usage: assinafy auth mfa confirm [options] <methodId>
245
+
246
+ Activate an enrolled authenticator and print the one-time recovery codes
247
+
248
+ Arguments:
249
+ methodId Method ID returned by enroll
250
+
251
+ Options:
252
+ --code <code> Live code from the new authenticator
253
+ --password <password> Current password (only when replacing a confirmed
254
+ method) (env: ASSINAFY_PASSWORD)
255
+ --reauth-code <code> Code from the current authenticator or a recovery code
256
+ (only when replacing)
257
+ -h, --help display help for command
258
+ ```
259
+
260
+ #### `assinafy auth mfa recovery-codes`
261
+
262
+ ```text
263
+ Usage: assinafy auth mfa recovery-codes [options]
264
+
265
+ Issue ten new recovery codes and invalidate the previous set
266
+
267
+ Options:
268
+ --password <password> Current password (env: ASSINAFY_PASSWORD)
269
+ --mfa-code <code> Authenticator or recovery code (prompted if required
270
+ and omitted) (env: ASSINAFY_MFA_CODE)
271
+ -h, --help display help for command
272
+ ```
273
+
274
+ #### `assinafy auth mfa remove`
275
+
276
+ ```text
277
+ Usage: assinafy auth mfa remove|rm [options] <methodId>
278
+
279
+ Remove a two-factor method (the last one also discards recovery codes)
280
+
281
+ Arguments:
282
+ methodId Method ID
283
+
284
+ Options:
285
+ --password <password> Current password (env: ASSINAFY_PASSWORD)
286
+ --mfa-code <code> Authenticator or recovery code (prompted if required
287
+ and omitted) (env: ASSINAFY_MFA_CODE)
288
+ -y, --yes Skip the confirmation prompt
289
+ -h, --help display help for command
290
+ ```
@@ -52,7 +52,7 @@ const publicClient = new AssinafyClient({ allowUnauthenticated: true });
52
52
  | `timeout` | `number` | Request timeout in milliseconds; default `30_000`. |
53
53
  | `logger` | `Logger` | Optional `debug`/`info`/`warn`/`error` functions; otherwise no-op. |
54
54
  | `allowUnauthenticated` | `boolean` | Permit construction without `apiKey`/`token`; use only for public, OAuth bootstrap, and signer-code flows. |
55
- | `webhookSecret` | `string` | Used only by the experimental `webhookVerifier`; see [Webhook verification](#webhook-verification-experimental). |
55
+ | `webhookSecret` | `string` | Endpoint `whsec_` signing secret used by `client.webhookVerifier`; see [Webhook verification](#webhook-verification). |
56
56
 
57
57
  | API | Result |
58
58
  | --- | --- |
@@ -412,8 +412,27 @@ Notification counters can overlap when a request uses multiple delivery channels
412
412
  | `createApiKey(password)` | [`POST /users/api-keys`](./api-reference.md#create-api-key) | `IApiKeyResponse` |
413
413
  | `getApiKey()` | [`GET /users/api-keys`](./api-reference.md#get-api-key) | `IMaskedApiKeyResponse`; 404 means no key |
414
414
  | `deleteApiKey()` | [`DELETE /users/api-keys`](./api-reference.md#delete-api-key) | `IEmptyResult` (`unknown[]`) |
415
+ | `verifyMfa({ mfa_token, code })` | [`POST /authentication/mfa/verify`](./api-reference.md#complete-a-two-factor-login) | `IMfaVerifyPayload` → `ILoginResponse` |
416
+ | `listMfaMethods()` | [`GET /users/self/mfa`](./api-reference.md#list-two-factor-methods) | `IMfaStatus` (`{ methods, recovery_codes_remaining }`) |
417
+ | `startTotpEnrollment(label?)` | [`POST /users/self/mfa/totp`](./api-reference.md#start-authenticator-enrollment) | `{ label? }` → `ITotpEnrollment` (`{ id, secret, provisioning_uri }`) |
418
+ | `confirmTotpEnrollment({ id, code, password?, reauth_code? })` | [`PUT /users/self/mfa/totp/confirm`](./api-reference.md#confirm-authenticator-enrollment) | `ITotpConfirmPayload` → `IMfaRecoveryCodes` |
419
+ | `regenerateRecoveryCodes({ password?, code? })` | [`POST /users/self/mfa/recovery-codes`](./api-reference.md#regenerate-recovery-codes) | `IMfaReauthPayload` → `IMfaRecoveryCodes` |
420
+ | `removeMfaMethod(methodId, { password?, code? })` | [`DELETE /users/self/mfa/{methodId}`](./api-reference.md#remove-a-two-factor-method) | JSON body `IMfaReauthPayload` → `{ is_mfa_enabled }` |
415
421
 
416
- Login/social/reset bootstrap calls can use an unauthenticated client. The published authenticated user endpoints permit either a bearer JWT or `X-Api-Key`; use the credential type appropriate to the account and endpoint policy.
422
+ ### Two-factor authentication
423
+
424
+ When the user has a confirmed authenticator, `login` returns an `mfa_token` challenge instead of a session. Exchange it within 5 minutes, once, with a 6-digit authenticator code or a recovery code:
425
+
426
+ ```ts
427
+ let session = await client.auth.login('user@example.com', password);
428
+ if (!session.access_token && session.mfa_token) {
429
+ session = await client.auth.verifyMfa({ mfa_token: session.mfa_token, code: '123456' });
430
+ }
431
+ ```
432
+
433
+ Enrollment is `startTotpEnrollment` (show `provisioning_uri` as a QR code; the secret is returned only once) followed by `confirmTotpEnrollment({ id, code })`, which returns ten one-time recovery codes. Replacing a confirmed method also needs `password` or `reauth_code`. `regenerateRecoveryCodes` and `removeMfaMethod` require the current password or a live/recovery `code`; the SDK rejects a payload with neither before sending. `verifyMfa` strips owner credentials.
434
+
435
+ Login/social/reset/two-factor-verify bootstrap calls can use an unauthenticated client. The published authenticated user endpoints permit either a bearer JWT or `X-Api-Key`; use the credential type appropriate to the account and endpoint policy.
417
436
 
418
437
  ## OAuth (`client.oauth`)
419
438
 
@@ -504,16 +523,39 @@ Template list params support pagination, published `search`, and compatible `sor
504
523
 
505
524
  ## Webhooks (`client.webhooks`)
506
525
 
526
+ An account can register 1 webhook endpoint, or up to 3 on paid plans. Each endpoint has its own URL, events, active flag, and signing setting; every active endpoint subscribed to an event receives it independently. The `subscriptions` operations remain and act on the account's oldest endpoint.
527
+
507
528
  | SDK method | HTTP operation | Resolves to |
508
529
  | --- | --- | --- |
509
- | `register(payload, accountId?)` | [`PUT /accounts/{accountId}/webhooks/subscriptions`](./api-reference.md#update-webhook-subscription) | `IWebhookSubscription` |
530
+ | `listEndpoints(accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints`](./api-reference.md#list-webhook-endpoints) | `IWebhookEndpoint[]`, oldest first |
531
+ | `createEndpoint(payload, accountId?)` | [`POST /accounts/{accountId}/webhooks/endpoints`](./api-reference.md#create-webhook-endpoint) | `IWebhookEndpointCreatePayload` → `IWebhookEndpoint` |
532
+ | `getEndpoint(endpointId, accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#get-webhook-endpoint) | `IWebhookEndpoint` |
533
+ | `updateEndpoint(endpointId, payload, accountId?)` | [`PUT /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#update-webhook-endpoint) | `IWebhookEndpointUpdatePayload` → `IWebhookEndpoint` |
534
+ | `deleteEndpoint(endpointId, accountId?)` | [`DELETE /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#delete-webhook-endpoint) | `IEmptyResult` (`[]`) |
535
+ | `getEndpointSecret(endpointId, accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret`](./api-reference.md#get-webhook-endpoint-signing-secret) | `IWebhookEndpointSecret` (`{ secret }`) |
536
+ | `rotateEndpointSecret(endpointId, accountId?)` | [`POST /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret/rotate`](./api-reference.md#rotate-webhook-endpoint-signing-secret) | `IWebhookEndpointSecret` |
537
+ | `register(payload, accountId?)` | [`PUT /accounts/{accountId}/webhooks/subscriptions`](./api-reference.md#update-webhook-subscription) | `IWebhookSubscription` (oldest endpoint) |
510
538
  | `get(accountId?)` | [`GET /accounts/{accountId}/webhooks/subscriptions`](./api-reference.md#get-webhook-subscription) | `IWebhookSubscription | null` |
511
539
  | `inactivate(accountId?)` | [`PUT /accounts/{accountId}/webhooks/inactivate`](./api-reference.md#inactivate-webhook-subscription) | `IWebhookSubscription` |
512
540
  | `listEventTypes()` | [`GET /webhooks/event-types`](./api-reference.md#list-webhook-event-types) | `IWebhookEventTypeInfo[]` |
513
541
  | `listDispatches(params?, accountId?)` | [`GET /accounts/{accountId}/webhooks`](./api-reference.md#list-webhook-deliveries) | `PaginatedResult<IWebhookDispatch>` |
514
542
  | `retryDispatch(dispatchId, accountId?)` | [`POST /accounts/{accountId}/webhooks/{dispatchId}/retry`](./api-reference.md#retry-webhook-delivery) | `IWebhookDispatch` |
515
543
 
516
- Registration payload: `{ url: string; email: string; events?: string[]; is_active?: boolean }`. When `events` is omitted the SDK uses `document_ready`, `document_prepared`, `signer_signed_document`, `signer_rejected_document`, and `document_processing_failed`; pass `[]` deliberately for none. Dispatch filters extend pagination with `{ event?, delivered?, from?, to?, sort?: 'created_at' | '-created_at' }`; sort is a compatibility extension. Dispatch `search` is unsupported and rejected locally. The API does not expose a delete-subscription operation; use `inactivate`.
544
+ Endpoint payload: `{ url: string; email: string; events?: string[]; name?: string; is_active?: boolean; signing_enabled?: boolean }`. Update sends only the given fields and requires at least one. URLs must be HTTP(S) and unique within the workspace (`400`); creating past the plan limit returns `403`. Enabling signing creates a `whsec_` secret if none exists; disabling it discards the secret. Secret read and rotation return `400` when signing is disabled and are not available to OAuth applications; rotation invalidates the previous secret immediately.
545
+
546
+ ```ts
547
+ const endpoint = await client.webhooks.createEndpoint({
548
+ url: 'https://example.com/assinafy/webhooks',
549
+ email: 'ops@example.com',
550
+ name: 'ERP',
551
+ events: ['document_ready', 'signer_signed_document'],
552
+ signing_enabled: true,
553
+ });
554
+ const { secret } = await client.webhooks.getEndpointSecret(endpoint.id);
555
+ // Store `secret` in your receiver's secret manager.
556
+ ```
557
+
558
+ Registration payload: `{ url: string; email: string; events?: string[]; is_active?: boolean }`. When `events` is omitted on `register` or `createEndpoint`, the SDK uses `document_ready`, `document_prepared`, `signer_signed_document`, `signer_rejected_document`, and `document_processing_failed`; pass `[]` deliberately for none. Dispatch filters extend pagination with `{ endpoint_id?, event?, delivered?, from?, to?, sort?: 'created_at' | '-created_at' }`; sort is a compatibility extension. Dispatch records include `endpoint_id`. Dispatch `search` is unsupported and rejected locally. Retrying re-sends only to that entry's endpoint and requires the endpoint to be active. There is no delete-subscription operation; delete a specific endpoint with `deleteEndpoint` or deactivate the oldest with `inactivate`.
517
559
 
518
560
  Decline operations require a non-empty reason of at most 2,000 Unicode characters. `signers.findByEmail` follows pagination metadata until an exact case-insensitive email match is found or the search is exhausted; when a response carries no pagination metadata a partial page ends the search, and the scan is bounded at 100 pages.
519
561
 
@@ -536,21 +578,41 @@ try {
536
578
  }
537
579
  ```
538
580
 
539
- ## Webhook verification (experimental)
581
+ ## Webhook verification
582
+
583
+ Deliveries are `POST` requests with `Content-Type: application/json`, a `webhook-id` (stable across retries of the same event to the same endpoint; use it to deduplicate), a `webhook-timestamp` (Unix seconds), and, when the endpoint has `signing_enabled`, a `webhook-signature` following [Standard Webhooks](https://www.standardwebhooks.com). Any `2xx` is success; a failed delivery is retried once after 3 seconds. After 10 consecutive failed events the endpoint's delivery is paused and probed until one succeeds; use `retryDispatch` to force redelivery.
540
584
 
541
585
  | API | Result |
542
586
  | --- | --- |
543
- | `new WebhookVerifier(secret?, { algorithm?, encoding? }?)` | Compatibility verifier; defaults to `sha256` and `hex`. |
544
- | `verify(rawBody, signature)` | `boolean`; HMAC verification under the configured, assumed scheme. |
587
+ | `new WebhookVerifier(secret?, { algorithm?, encoding? }?)` | Verifier keyed with an endpoint's `whsec_` secret. The options apply only to the deprecated `verify`. |
588
+ | `verifyDelivery(rawBody, headers, { toleranceSeconds?, now? }?)` | `boolean`. Checks `v1` HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{rawBody}` with the base64-decoded secret, constant-time, against every space-separated signature entry, and rejects timestamps more than `toleranceSeconds` (default 300) from `now` (ms, default `Date.now()`). `headers` may be Node `IncomingHttpHeaders`, a plain record (case-insensitive), or Fetch `Headers`; repeated headers are rejected. |
589
+ | `verify(rawBody, signature)` | Deprecated body-only HMAC kept for existing callers; Assinafy deliveries do not use it. |
545
590
  | `extractEvent(rawBody)` | Parsed `IWebhookPayload`, or `null` for invalid JSON/non-object data. |
546
591
  | `getEventType(event)` | `event`/`type` string, or `null`. |
547
592
  | `getEventData(event)` | First object found at `payload`, `data`, or `object`; otherwise `{}`. |
548
593
 
549
- Assinafy's published API does **not** define a signature header, algorithm, digest encoding, timestamp, or replay-protection scheme. Therefore this helper is experimental and unverified; do not use it as a production trust boundary until Assinafy publishes the scheme or you validate every detail against real deliveries. Preserve the exact raw request bytes for any future verification.
594
+ `client.webhookVerifier` uses the `webhookSecret` client option. Each endpoint has its own secret, so construct one verifier per signed endpoint.
595
+
596
+ ```ts
597
+ import express from 'express';
598
+ import { WebhookVerifier } from '@assinafy/cli/api';
599
+
600
+ const verifier = new WebhookVerifier(process.env.ASSINAFY_WEBHOOK_SECRET);
601
+ const app = express();
602
+
603
+ app.post('/assinafy/webhooks', express.raw({ type: 'application/json' }), (req, res) => {
604
+ if (!verifier.verifyDelivery(req.body, req.headers)) return res.sendStatus(401);
605
+ const event = verifier.extractEvent(req.body);
606
+ // Deduplicate by req.headers['webhook-id'], enqueue the work, and answer quickly.
607
+ res.sendStatus(204);
608
+ });
609
+ ```
610
+
611
+ Verify the raw bytes before parsing; re-serialized JSON does not match. The envelope is `{ id, event, message, payload, origin, created_at, subject, object, account_id }`; `subject` and `object` carry a `type` of `User`, `Signer`, `Account`, `Document`, or `Template`. Unknown fields are forward-compatible additions. Confirm business state (for example a document's status) through the API before irreversible actions.
550
612
 
551
613
  ## Contract boundaries
552
614
 
553
- - Production OpenAPI currently publishes 93 operations. Some sandbox deployments lag it; account/user statistics and user notification-preference routes may return route-level 404s even though production documentation includes them.
554
- - Certificate start/complete are deployed production extensions, exposed by `startCertificate` and `completeCertificate` with the signing application's payloads. They supplement the 93 OpenAPI operations; the API manifest contains only published paths.
615
+ - Production OpenAPI currently publishes 106 operations. Some sandbox deployments lag it; account/user statistics and user notification-preference routes may return route-level 404s even though production documentation includes them.
616
+ - Certificate start/complete are deployed production extensions, exposed by `startCertificate` and `completeCertificate` with the signing application's payloads. They supplement the 106 OpenAPI operations; the API manifest contains only published paths.
555
617
  - The SDK retains the two template compatibility routes above and both published/legacy public `sendToken` payloads for compatible deployments.
556
618
  - Signer artifact downloads are public in the published contract. Supplying a signer access code opts into an SDK identity preflight; it does not change the server route into a private endpoint.
package/docs/webhooks.md CHANGED
@@ -5,27 +5,168 @@
5
5
  ```text
6
6
  Usage: assinafy webhooks [options] [command]
7
7
 
8
- Manage webhook subscriptions and delivery history
8
+ Manage webhook endpoints, the primary subscription, and delivery history
9
9
 
10
10
  Options:
11
11
  -h, --help display help for command
12
12
 
13
13
  Commands:
14
- register [options] Register (or replace) the workspace webhook subscription
15
- get Show the current webhook subscription
16
- inactivate Inactivate the webhook subscription without deleting it
14
+ endpoints Manage webhook endpoints and their signing secrets
15
+ register [options] Register (or replace) the account's oldest webhook
16
+ endpoint
17
+ get Show the account's oldest webhook endpoint
18
+ inactivate Inactivate the account's oldest webhook endpoint without
19
+ deleting it
17
20
  event-types List supported webhook event types
18
21
  dispatches [options] List webhook delivery history
19
22
  retry <dispatchId> Retry delivery of a specific dispatch
20
23
  help [command] display help for command
21
24
  ```
22
25
 
26
+ ### `assinafy webhooks endpoints`
27
+
28
+ ```text
29
+ Usage: assinafy webhooks endpoints [options] [command]
30
+
31
+ Manage webhook endpoints and their signing secrets
32
+
33
+ Options:
34
+ -h, --help display help for command
35
+
36
+ Commands:
37
+ list|ls List webhook endpoints, oldest first
38
+ create [options] Register a webhook endpoint (1 per
39
+ account, up to 3 on paid plans)
40
+ get <endpointId> Show one webhook endpoint
41
+ update [options] <endpointId> Update the given fields of a webhook
42
+ endpoint
43
+ delete|rm [options] <endpointId> Delete a webhook endpoint and free its
44
+ slot
45
+ secret <endpointId> Print the endpoint signing secret
46
+ (signing must be enabled; not available
47
+ via OAuth)
48
+ rotate-secret [options] <endpointId> Replace the endpoint signing secret; the
49
+ old one stops working immediately
50
+ help [command] display help for command
51
+ ```
52
+
53
+ #### `assinafy webhooks endpoints list`
54
+
55
+ ```text
56
+ Usage: assinafy webhooks endpoints list|ls [options]
57
+
58
+ List webhook endpoints, oldest first
59
+
60
+ Options:
61
+ -h, --help display help for command
62
+ ```
63
+
64
+ #### `assinafy webhooks endpoints create`
65
+
66
+ ```text
67
+ Usage: assinafy webhooks endpoints create [options]
68
+
69
+ Register a webhook endpoint (1 per account, up to 3 on paid plans)
70
+
71
+ Options:
72
+ --url <url> Endpoint URL to receive events
73
+ --email <email> Contact email for delivery problems
74
+ --name <name> Label to tell endpoints apart
75
+ --events <csv> Comma-separated event names
76
+ --active Deliver events to this endpoint
77
+ --inactive Stop delivering events
78
+ --signing Sign deliveries (Standard Webhooks)
79
+ --no-signing Disable signing and discard the secret
80
+ -h, --help display help for command
81
+ ```
82
+
83
+ #### `assinafy webhooks endpoints get`
84
+
85
+ ```text
86
+ Usage: assinafy webhooks endpoints get [options] <endpointId>
87
+
88
+ Show one webhook endpoint
89
+
90
+ Arguments:
91
+ endpointId Endpoint ID
92
+
93
+ Options:
94
+ -h, --help display help for command
95
+ ```
96
+
97
+ #### `assinafy webhooks endpoints update`
98
+
99
+ ```text
100
+ Usage: assinafy webhooks endpoints update [options] <endpointId>
101
+
102
+ Update the given fields of a webhook endpoint
103
+
104
+ Arguments:
105
+ endpointId Endpoint ID
106
+
107
+ Options:
108
+ --url <url> Endpoint URL to receive events
109
+ --email <email> Contact email for delivery problems
110
+ --name <name> Label to tell endpoints apart
111
+ --events <csv> Comma-separated event names
112
+ --active Deliver events to this endpoint
113
+ --inactive Stop delivering events
114
+ --signing Sign deliveries (Standard Webhooks)
115
+ --no-signing Disable signing and discard the secret
116
+ -h, --help display help for command
117
+ ```
118
+
119
+ #### `assinafy webhooks endpoints delete`
120
+
121
+ ```text
122
+ Usage: assinafy webhooks endpoints delete|rm [options] <endpointId>
123
+
124
+ Delete a webhook endpoint and free its slot
125
+
126
+ Arguments:
127
+ endpointId Endpoint ID
128
+
129
+ Options:
130
+ -y, --yes Skip the confirmation prompt
131
+ -h, --help display help for command
132
+ ```
133
+
134
+ #### `assinafy webhooks endpoints secret`
135
+
136
+ ```text
137
+ Usage: assinafy webhooks endpoints secret [options] <endpointId>
138
+
139
+ Print the endpoint signing secret (signing must be enabled; not available via
140
+ OAuth)
141
+
142
+ Arguments:
143
+ endpointId Endpoint ID
144
+
145
+ Options:
146
+ -h, --help display help for command
147
+ ```
148
+
149
+ #### `assinafy webhooks endpoints rotate-secret`
150
+
151
+ ```text
152
+ Usage: assinafy webhooks endpoints rotate-secret [options] <endpointId>
153
+
154
+ Replace the endpoint signing secret; the old one stops working immediately
155
+
156
+ Arguments:
157
+ endpointId Endpoint ID
158
+
159
+ Options:
160
+ -y, --yes Skip the confirmation prompt
161
+ -h, --help display help for command
162
+ ```
163
+
23
164
  ### `assinafy webhooks register`
24
165
 
25
166
  ```text
26
167
  Usage: assinafy webhooks register [options]
27
168
 
28
- Register (or replace) the workspace webhook subscription
169
+ Register (or replace) the account's oldest webhook endpoint
29
170
 
30
171
  Options:
31
172
  --url <url> Endpoint URL to receive events
@@ -40,7 +181,7 @@ Options:
40
181
  ```text
41
182
  Usage: assinafy webhooks get [options]
42
183
 
43
- Show the current webhook subscription
184
+ Show the account's oldest webhook endpoint
44
185
 
45
186
  Options:
46
187
  -h, --help display help for command
@@ -51,7 +192,7 @@ Options:
51
192
  ```text
52
193
  Usage: assinafy webhooks inactivate [options]
53
194
 
54
- Inactivate the webhook subscription without deleting it
195
+ Inactivate the account's oldest webhook endpoint without deleting it
55
196
 
56
197
  Options:
57
198
  -h, --help display help for command
@@ -76,14 +217,15 @@ Usage: assinafy webhooks dispatches [options]
76
217
  List webhook delivery history
77
218
 
78
219
  Options:
79
- --event <event> Filter by event name
80
- --delivered <bool> Filter by delivery status (true/false)
81
- --from <unix> Start of time range (unix seconds)
82
- --to <unix> End of time range (unix seconds)
83
- --page <n> Page number to fetch
84
- --per-page <n> Items per page
85
- --sort <field> Sort by created_at (prefix with - for descending)
86
- -h, --help display help for command
220
+ --endpoint <endpointId> Only deliveries to this webhook endpoint
221
+ --event <event> Filter by event name
222
+ --delivered <bool> Filter by delivery status (true/false)
223
+ --from <unix> Start of time range (unix seconds)
224
+ --to <unix> End of time range (unix seconds)
225
+ --page <n> Page number to fetch
226
+ --per-page <n> Items per page
227
+ --sort <field> Sort by created_at (prefix with - for descending)
228
+ -h, --help display help for command
87
229
  ```
88
230
 
89
231
  ### `assinafy webhooks retry`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assinafy/cli",
3
- "version": "2.4.2",
3
+ "version": "2.5.0",
4
4
  "description": "The official command-line interface for the Assinafy digital-signature API",
5
5
  "license": "MIT",
6
6
  "type": "module",