@assinafy/cli 2.7.0 → 2.7.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.md +78 -419
- package/dist/api.cjs +7 -4
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +7 -4
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +9 -9
- package/dist/types/api/resources/webhooks.d.ts.map +1 -1
- package/docs/api-operations.json +1 -1
- package/docs/api-reference.md +1 -1
- package/docs/releasing.md +38 -12
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -23372,7 +23372,7 @@ var DEFAULT_EVENTS = [
|
|
|
23372
23372
|
"signer_rejected_document",
|
|
23373
23373
|
"document_processing_failed"
|
|
23374
23374
|
];
|
|
23375
|
-
function validateWebhookFields(payload) {
|
|
23375
|
+
function validateWebhookFields(payload, requireHttps = false) {
|
|
23376
23376
|
if (payload.url !== void 0) {
|
|
23377
23377
|
let webhookUrl;
|
|
23378
23378
|
try {
|
|
@@ -23383,6 +23383,9 @@ function validateWebhookFields(payload) {
|
|
|
23383
23383
|
if (webhookUrl.protocol !== "http:" && webhookUrl.protocol !== "https:") {
|
|
23384
23384
|
throw new ValidationError("Webhook URL must be a valid HTTP(S) URL");
|
|
23385
23385
|
}
|
|
23386
|
+
if (requireHttps && webhookUrl.protocol !== "https:") {
|
|
23387
|
+
throw new ValidationError("Webhook URL must use HTTPS");
|
|
23388
|
+
}
|
|
23386
23389
|
}
|
|
23387
23390
|
if (payload.email !== void 0) requireEmail(payload.email);
|
|
23388
23391
|
if (payload.events !== void 0 && (!Array.isArray(payload.events) || payload.events.some((event) => typeof event !== "string" || !event))) {
|
|
@@ -23405,7 +23408,7 @@ var WebhookResource = class extends BaseResource {
|
|
|
23405
23408
|
*/
|
|
23406
23409
|
async register(payload, accountId) {
|
|
23407
23410
|
if (!payload.url) throw new ValidationError("Webhook URL is required");
|
|
23408
|
-
validateWebhookFields({ ...payload, email: payload.email ?? "" });
|
|
23411
|
+
validateWebhookFields({ ...payload, email: payload.email ?? "" }, true);
|
|
23409
23412
|
const id = this.accountId(accountId);
|
|
23410
23413
|
const body = {
|
|
23411
23414
|
url: payload.url,
|
|
@@ -23456,7 +23459,7 @@ var WebhookResource = class extends BaseResource {
|
|
|
23456
23459
|
*/
|
|
23457
23460
|
async createEndpoint(payload, accountId) {
|
|
23458
23461
|
if (!payload.url) throw new ValidationError("Webhook URL is required");
|
|
23459
|
-
validateWebhookFields({ ...payload, email: payload.email ?? "" });
|
|
23462
|
+
validateWebhookFields({ ...payload, email: payload.email ?? "" }, true);
|
|
23460
23463
|
const id = this.accountId(accountId);
|
|
23461
23464
|
const body = { ...payload, events: payload.events ?? DEFAULT_EVENTS };
|
|
23462
23465
|
this.logger.info("Creating webhook endpoint", { eventCount: body.events.length });
|
|
@@ -23486,7 +23489,7 @@ var WebhookResource = class extends BaseResource {
|
|
|
23486
23489
|
if (!payload || typeof payload !== "object" || Object.keys(payload).length === 0) {
|
|
23487
23490
|
throw new ValidationError("At least one webhook endpoint field is required");
|
|
23488
23491
|
}
|
|
23489
|
-
validateWebhookFields(payload);
|
|
23492
|
+
validateWebhookFields(payload, true);
|
|
23490
23493
|
return this.call(
|
|
23491
23494
|
"Failed to update webhook endpoint",
|
|
23492
23495
|
() => this.http.put(`/accounts/${id}/webhooks/endpoints/${eid}`, payload)
|
|
@@ -24564,9 +24567,6 @@ function diffLines(i2, s) {
|
|
|
24564
24567
|
}
|
|
24565
24568
|
var R = globalThis.process.platform.startsWith("win");
|
|
24566
24569
|
var CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
24567
|
-
function isCancel3(e) {
|
|
24568
|
-
return e === CANCEL_SYMBOL;
|
|
24569
|
-
}
|
|
24570
24570
|
function setRawMode(e, r2) {
|
|
24571
24571
|
const o = e;
|
|
24572
24572
|
o.isTTY && o.setRawMode(r2);
|
|
@@ -25333,7 +25333,7 @@ async function confirmDestructive(message, force) {
|
|
|
25333
25333
|
return unwrap(value);
|
|
25334
25334
|
}
|
|
25335
25335
|
function unwrap(value) {
|
|
25336
|
-
if (
|
|
25336
|
+
if (typeof value === "symbol") {
|
|
25337
25337
|
cancel("Cancelled.", { output: process.stderr });
|
|
25338
25338
|
throw new CliError("Cancelled.", { exitCode: 130 });
|
|
25339
25339
|
}
|
|
@@ -28295,7 +28295,7 @@ function handleStreamError(err, fallback, exit = process.exit) {
|
|
|
28295
28295
|
// package.json
|
|
28296
28296
|
var package_default = {
|
|
28297
28297
|
name: "@assinafy/cli",
|
|
28298
|
-
version: "2.7.
|
|
28298
|
+
version: "2.7.1",
|
|
28299
28299
|
description: "The official command-line interface for the Assinafy digital-signature API",
|
|
28300
28300
|
license: "MIT",
|
|
28301
28301
|
type: "module",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/webhooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,0BAA0B,EAC1B,gBAAgB,EAChB,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAEf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/webhooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,0BAA0B,EAC1B,gBAAgB,EAChB,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAEf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,C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AM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAM/F;IAED;;;OAGG;IACG,oBAAoB,CACzB,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,sBAAsB,CAAC,CAOjC;IAED,oDAAoD;IAC9C,cAAc,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAIvD;IAED,oFAAoF;IAC9E,cAAc,CACnB,MAAM,GAAE,0BAA+B,EACvC,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAS5C;IAED,8EAA8E;IACxE,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAMrF;CACD"}
|
package/docs/api-operations.json
CHANGED
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: 118
|
|
10
|
-
- Contract SHA-256: `
|
|
10
|
+
- Contract SHA-256: `38cb1b376546c1db6e9eabb06fbb613a9c17ca7c22f66388de2ffbf4b6931e93`
|
|
11
11
|
|
|
12
12
|
## Accounts
|
|
13
13
|
|
package/docs/releasing.md
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
# Release runbook
|
|
2
2
|
|
|
3
|
-
This repository is hosted directly on GitHub.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
This repository is hosted directly on GitHub. After a push to `main` passes the
|
|
4
|
+
complete CI matrix, `.github/workflows/tag-release.yml` creates an annotated
|
|
5
|
+
`v<package.json version>` tag at that exact tested commit and starts
|
|
6
|
+
`.github/workflows/release.yml`. Release objects, packages and assets are published
|
|
7
|
+
after the release verification job succeeds.
|
|
6
8
|
|
|
7
9
|
## One-time repository setup
|
|
8
10
|
|
|
9
11
|
- Create a protected GitHub environment named `release` for the publish job.
|
|
10
12
|
- Configure npm trusted publishing for this GitHub repository, workflow
|
|
11
13
|
`release.yml`, and environment `release`. No long-lived npm token is used.
|
|
12
|
-
- Allow the repository `GITHUB_TOKEN` to
|
|
14
|
+
- Allow the repository `GITHUB_TOKEN` to create tags, dispatch Actions workflows,
|
|
15
|
+
and write GitHub Releases and Packages. No additional personal access token is
|
|
16
|
+
required; the workflows request these permissions only in the relevant jobs.
|
|
13
17
|
- Enable GitHub immutable releases so published tags and assets cannot be changed.
|
|
14
|
-
- Protect `v*` tags and
|
|
15
|
-
|
|
18
|
+
- Protect `v*` tags against updates and deletion while allowing the tagging
|
|
19
|
+
workflow to create them. Require review on the `release` environment if
|
|
20
|
+
publication needs human approval; without approval rules publication proceeds
|
|
21
|
+
automatically once verification succeeds.
|
|
16
22
|
- If policy requires authenticity independent of GitHub Release hosting, configure
|
|
17
23
|
an organization-approved signature or provenance attestation and publish its
|
|
18
24
|
verification procedure. `SHA256SUMS` alone verifies integrity within the same
|
|
@@ -24,10 +30,28 @@ by `.github/workflows/release.yml` after the verification job succeeds.
|
|
|
24
30
|
`npm run docs:api`, `npm run verify:api-docs`, and `npm run pack:release` on
|
|
25
31
|
the release commit. Commit the generated API reference when the official
|
|
26
32
|
contract changes.
|
|
27
|
-
2.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
2. Use `npm version patch --no-git-tag-version` or
|
|
34
|
+
`npm version minor --no-git-tag-version` to update both package files. Add a
|
|
35
|
+
dated changelog entry for that version and commit the changes to `main` through
|
|
36
|
+
the repository's normal review process. Push `main`; no local release tag is
|
|
37
|
+
needed for new versions.
|
|
38
|
+
3. Confirm `CI` succeeds, `Tag Release` creates the annotated tag and starts
|
|
39
|
+
`Release`, and `Release` verifies that exact tag/commit, uploads its checked
|
|
40
|
+
artifact, publishes both registries, and then publishes the draft release.
|
|
41
|
+
|
|
42
|
+
The automatic tagging job accepts only successful push runs of `CI` on this
|
|
43
|
+
repository's `main`; pull requests, failed CI and manually dispatched CI do not
|
|
44
|
+
release. The package and lockfile versions must agree and have a dated changelog
|
|
45
|
+
entry. A version already tagged on an earlier ancestor is skipped. Re-running
|
|
46
|
+
the successful CI for the same tagged commit resumes publication without moving
|
|
47
|
+
the tag. Conflicting or lightweight tags fail without overwriting them.
|
|
48
|
+
|
|
49
|
+
The tagging job explicitly dispatches `release.yml`, because tags created with
|
|
50
|
+
`GITHUB_TOKEN` do not start another workflow through its `push` trigger. The
|
|
51
|
+
publisher retains tag-push and manual-dispatch support for existing tags and
|
|
52
|
+
recovery. If a release tag was already prepared locally before enabling automatic
|
|
53
|
+
tagging, push `main` and that annotated tag together with
|
|
54
|
+
`git push --atomic origin main vX.Y.Z`; its original target remains unchanged.
|
|
31
55
|
|
|
32
56
|
The `publish` job depends on `verify`, which runs the automated SDK and CLI tests,
|
|
33
57
|
type and lint checks, current public production API contract check, generated-file
|
|
@@ -44,9 +68,11 @@ is published under a version-specific `backfill-*` tag. A failed run is safe to
|
|
|
44
68
|
dispatch again with the same tag: existing packages/assets are verified or skipped,
|
|
45
69
|
and published GitHub Release assets are never overwritten.
|
|
46
70
|
|
|
47
|
-
|
|
71
|
+
Merge one release version at a time and let its workflow finish before the next.
|
|
48
72
|
Same-tag push and recovery runs are serialized. Separate versions do not share a
|
|
49
73
|
GitHub concurrency group because that platform drops older pending runs; the publish
|
|
50
74
|
job instead fails before mutation if any other release workflow is active. Monotonic
|
|
51
75
|
SemVer promotion also prevents a later backfill from moving `latest`/`next` backwards.
|
|
52
|
-
Retry the refused tag afterward
|
|
76
|
+
Retry the refused tag afterward with
|
|
77
|
+
`gh workflow run release.yml --ref main -f tag=vX.Y.Z`. This also resumes a release
|
|
78
|
+
if tag creation succeeded but dispatch or publication failed.
|