@assinafy/cli 2.4.2 → 2.5.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.
Files changed (37) hide show
  1. package/.env.example +4 -2
  2. package/README.en.md +46 -21
  3. package/README.md +34 -15
  4. package/dist/api.cjs +295 -55
  5. package/dist/api.cjs.map +1 -1
  6. package/dist/api.js +295 -55
  7. package/dist/api.js.map +1 -1
  8. package/dist/cli.cjs +635 -100
  9. package/dist/types/api/errors.d.ts +9 -0
  10. package/dist/types/api/errors.d.ts.map +1 -1
  11. package/dist/types/api/index.d.ts +1 -1
  12. package/dist/types/api/index.d.ts.map +1 -1
  13. package/dist/types/api/resources/authentication.d.ts +33 -3
  14. package/dist/types/api/resources/authentication.d.ts.map +1 -1
  15. package/dist/types/api/resources/documents.d.ts +4 -3
  16. package/dist/types/api/resources/documents.d.ts.map +1 -1
  17. package/dist/types/api/resources/oauth.d.ts +1 -1
  18. package/dist/types/api/resources/oauth.d.ts.map +1 -1
  19. package/dist/types/api/resources/signer-documents.d.ts +9 -4
  20. package/dist/types/api/resources/signer-documents.d.ts.map +1 -1
  21. package/dist/types/api/resources/webhooks.d.ts +39 -6
  22. package/dist/types/api/resources/webhooks.d.ts.map +1 -1
  23. package/dist/types/api/support/webhook-verifier.d.ts +31 -14
  24. package/dist/types/api/support/webhook-verifier.d.ts.map +1 -1
  25. package/dist/types/api/types.d.ts +110 -21
  26. package/dist/types/api/types.d.ts.map +1 -1
  27. package/dist/types/api/utils.d.ts.map +1 -1
  28. package/docs/README.md +1 -1
  29. package/docs/api-operations.json +105 -1
  30. package/docs/api-reference.md +2380 -2057
  31. package/docs/auth.md +125 -4
  32. package/docs/documents.md +5 -6
  33. package/docs/migration-v2.md +1 -1
  34. package/docs/sdk-reference.md +84 -23
  35. package/docs/signer.md +4 -2
  36. package/docs/webhooks.md +185 -20
  37. package/package.json +2 -2
package/docs/webhooks.md CHANGED
@@ -5,19 +5,164 @@
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
- -h, --help display help for command
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
17
- event-types List supported webhook event types
18
- dispatches [options] List webhook delivery history
19
- retry <dispatchId> Retry delivery of a specific dispatch
20
- help [command] display help for command
14
+ endpoints Manage webhook endpoints and their signing
15
+ secrets
16
+ register [options] Register (or replace) the account's oldest
17
+ webhook endpoint
18
+ get Show the account's oldest webhook endpoint
19
+ inactivate Inactivate the account's oldest webhook endpoint
20
+ without deleting it
21
+ event-types List supported webhook event types
22
+ dispatches [options] List webhook delivery history
23
+ retry <dispatchId> Retry delivery of a specific dispatch
24
+ verify [options] <bodyFile> Verify a signed delivery (Standard Webhooks)
25
+ against ASSINAFY_WEBHOOK_SECRET or the profile
26
+ secret
27
+ help [command] display help for command
28
+ ```
29
+
30
+ ### `assinafy webhooks endpoints`
31
+
32
+ ```text
33
+ Usage: assinafy webhooks endpoints [options] [command]
34
+
35
+ Manage webhook endpoints and their signing secrets
36
+
37
+ Options:
38
+ -h, --help display help for command
39
+
40
+ Commands:
41
+ list|ls List webhook endpoints, oldest first
42
+ create [options] Register a webhook endpoint (1 per
43
+ account, up to 3 on paid plans)
44
+ get <endpointId> Show one webhook endpoint
45
+ update [options] <endpointId> Update the given fields of a webhook
46
+ endpoint
47
+ delete|rm [options] <endpointId> Delete a webhook endpoint and free its
48
+ slot
49
+ secret <endpointId> Print the endpoint signing secret
50
+ (signing must be enabled; not available
51
+ via OAuth)
52
+ rotate-secret [options] <endpointId> Replace the endpoint signing secret; the
53
+ old one stops working immediately
54
+ help [command] display help for command
55
+ ```
56
+
57
+ #### `assinafy webhooks endpoints list`
58
+
59
+ ```text
60
+ Usage: assinafy webhooks endpoints list|ls [options]
61
+
62
+ List webhook endpoints, oldest first
63
+
64
+ Options:
65
+ -h, --help display help for command
66
+ ```
67
+
68
+ #### `assinafy webhooks endpoints create`
69
+
70
+ ```text
71
+ Usage: assinafy webhooks endpoints create [options]
72
+
73
+ Register a webhook endpoint (1 per account, up to 3 on paid plans)
74
+
75
+ Options:
76
+ --url <url> Endpoint URL to receive events
77
+ --email <email> Contact email for delivery problems
78
+ --name <name> Label to tell endpoints apart
79
+ --events <csv> Comma-separated event names
80
+ --active Deliver events to this endpoint
81
+ --inactive Stop delivering events
82
+ --signing Sign deliveries (Standard Webhooks)
83
+ --no-signing Disable signing and discard the secret
84
+ -h, --help display help for command
85
+ ```
86
+
87
+ #### `assinafy webhooks endpoints get`
88
+
89
+ ```text
90
+ Usage: assinafy webhooks endpoints get [options] <endpointId>
91
+
92
+ Show one webhook endpoint
93
+
94
+ Arguments:
95
+ endpointId Endpoint ID
96
+
97
+ Options:
98
+ -h, --help display help for command
99
+ ```
100
+
101
+ #### `assinafy webhooks endpoints update`
102
+
103
+ ```text
104
+ Usage: assinafy webhooks endpoints update [options] <endpointId>
105
+
106
+ Update the given fields of a webhook endpoint
107
+
108
+ Arguments:
109
+ endpointId Endpoint ID
110
+
111
+ Options:
112
+ --url <url> Endpoint URL to receive events
113
+ --email <email> Contact email for delivery problems
114
+ --name <name> Label to tell endpoints apart
115
+ --events <csv> Comma-separated event names
116
+ --active Deliver events to this endpoint
117
+ --inactive Stop delivering events
118
+ --signing Sign deliveries (Standard Webhooks)
119
+ --no-signing Disable signing and discard the secret
120
+ -h, --help display help for command
121
+ ```
122
+
123
+ #### `assinafy webhooks endpoints delete`
124
+
125
+ ```text
126
+ Usage: assinafy webhooks endpoints delete|rm [options] <endpointId>
127
+
128
+ Delete a webhook endpoint and free its slot
129
+
130
+ Arguments:
131
+ endpointId Endpoint ID
132
+
133
+ Options:
134
+ -y, --yes Skip the confirmation prompt
135
+ -h, --help display help for command
136
+ ```
137
+
138
+ #### `assinafy webhooks endpoints secret`
139
+
140
+ ```text
141
+ Usage: assinafy webhooks endpoints secret [options] <endpointId>
142
+
143
+ Print the endpoint signing secret (signing must be enabled; not available via
144
+ OAuth)
145
+
146
+ Arguments:
147
+ endpointId Endpoint ID
148
+
149
+ Options:
150
+ -h, --help display help for command
151
+ ```
152
+
153
+ #### `assinafy webhooks endpoints rotate-secret`
154
+
155
+ ```text
156
+ Usage: assinafy webhooks endpoints rotate-secret [options] <endpointId>
157
+
158
+ Replace the endpoint signing secret; the old one stops working immediately
159
+
160
+ Arguments:
161
+ endpointId Endpoint ID
162
+
163
+ Options:
164
+ -y, --yes Skip the confirmation prompt
165
+ -h, --help display help for command
21
166
  ```
22
167
 
23
168
  ### `assinafy webhooks register`
@@ -25,7 +170,7 @@ Commands:
25
170
  ```text
26
171
  Usage: assinafy webhooks register [options]
27
172
 
28
- Register (or replace) the workspace webhook subscription
173
+ Register (or replace) the account's oldest webhook endpoint
29
174
 
30
175
  Options:
31
176
  --url <url> Endpoint URL to receive events
@@ -40,7 +185,7 @@ Options:
40
185
  ```text
41
186
  Usage: assinafy webhooks get [options]
42
187
 
43
- Show the current webhook subscription
188
+ Show the account's oldest webhook endpoint
44
189
 
45
190
  Options:
46
191
  -h, --help display help for command
@@ -51,7 +196,7 @@ Options:
51
196
  ```text
52
197
  Usage: assinafy webhooks inactivate [options]
53
198
 
54
- Inactivate the webhook subscription without deleting it
199
+ Inactivate the account's oldest webhook endpoint without deleting it
55
200
 
56
201
  Options:
57
202
  -h, --help display help for command
@@ -76,14 +221,15 @@ Usage: assinafy webhooks dispatches [options]
76
221
  List webhook delivery history
77
222
 
78
223
  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
224
+ --endpoint <endpointId> Only deliveries to this webhook endpoint
225
+ --event <event> Filter by event name
226
+ --delivered <bool> Filter by delivery status (true/false)
227
+ --from <unix> Start of time range (unix seconds)
228
+ --to <unix> End of time range (unix seconds)
229
+ --page <n> Page number to fetch
230
+ --per-page <n> Items per page
231
+ --sort <field> Sort by created_at (prefix with - for descending)
232
+ -h, --help display help for command
87
233
  ```
88
234
 
89
235
  ### `assinafy webhooks retry`
@@ -99,3 +245,22 @@ Arguments:
99
245
  Options:
100
246
  -h, --help display help for command
101
247
  ```
248
+
249
+ ### `assinafy webhooks verify`
250
+
251
+ ```text
252
+ Usage: assinafy webhooks verify [options] <bodyFile>
253
+
254
+ Verify a signed delivery (Standard Webhooks) against ASSINAFY_WEBHOOK_SECRET or
255
+ the profile secret
256
+
257
+ Arguments:
258
+ bodyFile Raw request body exactly as received
259
+
260
+ Options:
261
+ --id <value> webhook-id header
262
+ --timestamp <seconds> webhook-timestamp header
263
+ --signature <value> webhook-signature header
264
+ --tolerance <seconds> Accepted clock difference in seconds (default: "300")
265
+ -h, --help display help for command
266
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assinafy/cli",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
4
4
  "description": "The official command-line interface for the Assinafy digital-signature API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -54,7 +54,7 @@
54
54
  "bugs": {
55
55
  "url": "https://github.com/assinafy/assinafy-cli/issues"
56
56
  },
57
- "homepage": "https://github.com/assinafy/assinafy-cli#readme",
57
+ "homepage": "https://www.assinafy.com.br",
58
58
  "scripts": {
59
59
  "dev": "tsx src/cli.ts",
60
60
  "dev:watch": "tsx --watch src/cli.ts",