@assinafy/sdk 2.1.1 → 2.2.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/RELEASING.md CHANGED
@@ -9,7 +9,7 @@ event, and the workflow intentionally does not depend on one.
9
9
 
10
10
  | Runtime | Release responsibility |
11
11
  | --- | --- |
12
- | Bun 1.3.14 | Locked install, tests, build, audit, and packaging |
12
+ | Bun 1.4.0 | Locked install, tests, build, contract checks, and packaging |
13
13
  | Node.js 22 | Minimum supported consumer runtime |
14
14
  | Node.js 24 LTS | Packaging and registry publishing runtime |
15
15
  | Node.js 26 Current | Forward-compatibility consumer test |
@@ -29,12 +29,16 @@ publisher using these repository coordinates:
29
29
  | Organization or user | `assinafy` |
30
30
  | Repository | `typescript-sdk` |
31
31
  | Workflow filename | `release.yml` |
32
- | Environment | Leave unset unless the workflow is updated to use one |
32
+ | Environment | `release` |
33
+ | Allowed actions | `npm publish` |
33
34
 
34
35
  The `publish-npm` job grants only `contents: read` and `id-token: write`.
35
36
  Modern npm exchanges GitHub's short-lived OIDC identity for publish credentials;
36
37
  no long-lived `NPM_TOKEN` is required. Test trusted publishing before deleting a
37
38
  legacy token, then remove that token from repository and organization secrets.
39
+ Keep package access **public** and select npm's most restrictive publishing
40
+ access option: **Require two-factor authentication and disallow bypass 2FA
41
+ tokens**. Trusted-publisher OIDC remains compatible with that setting.
38
42
 
39
43
  ### GitHub Packages
40
44
 
@@ -43,11 +47,33 @@ The `publish-gh` job uses the workflow-scoped `GITHUB_TOKEN` with
43
47
  the `@assinafy` scope and that the package remains linked to this repository.
44
48
  No separate personal access token should be stored.
45
49
 
50
+ ### Sandbox integration environment
51
+
52
+ Create a protected GitHub environment named `sandbox`. Restrict deployments to
53
+ the mirrored `main` branch, require reviewer approval, and store these required
54
+ environment secrets:
55
+
56
+ - `ASSINAFY_API_KEY`
57
+ - `ASSINAFY_ACCOUNT_ID`
58
+
59
+ The `disposable-full` mode also requires `ASSINAFY_TEST_EMAIL_PRIMARY` and
60
+ `ASSINAFY_TEST_EMAIL_SECONDARY`. Optional coverage uses
61
+ `ASSINAFY_TEST_WEBHOOK_URL`, `ASSINAFY_TEST_LOGIN_EMAIL`,
62
+ `ASSINAFY_TEST_LOGIN_PASSWORD`, `ASSINAFY_SIGNER_ACCESS_CODE`,
63
+ `ASSINAFY_SIGNER_OTP`, and `ASSINAFY_PUBLIC_DOCUMENT_ID`.
64
+
65
+ Keep secret values out of repository variables, files, and logs. Run the manual
66
+ **Sandbox integration** workflow from mirrored `main`; use `read-only` first
67
+ and select `disposable-full` only for a deliberate reversible test run.
68
+
46
69
  ### Mirror and tag protection
47
70
 
48
71
  The GitLab push mirror must include tags and be able to update the GitHub
49
- repository. Protect release tags in GitLab so only release maintainers can
50
- create patterns matching `v*`. GitHub Actions must be enabled on the mirror.
72
+ repository. Protect `v*` tags in GitLab so only release maintainers can create
73
+ them, and add a GitHub tag ruleset that restricts creating, updating, and
74
+ deleting the same pattern to the mirror/release maintainers. Protect the GitHub
75
+ `release` environment with required reviewers and a deployment tag rule for
76
+ `v*`. GitHub Actions must be enabled on the mirror.
51
77
 
52
78
  ## Preparing a release
53
79
 
@@ -66,8 +92,8 @@ create patterns matching `v*`. GitHub Actions must be enabled on the mirror.
66
92
  bun run audit:api
67
93
  ```
68
94
 
69
- 5. For API changes, run the live audit against a dedicated sandbox. Start
70
- read-only:
95
+ 5. For API changes, run the sandbox smoke script against a dedicated account.
96
+ Start read-only:
71
97
 
72
98
  ```sh
73
99
  ASSINAFY_API_KEY='...' \
@@ -105,9 +131,10 @@ create patterns matching `v*`. GitHub Actions must be enabled on the mirror.
105
131
  The workflow serializes releases repository-wide and performs these steps:
106
132
 
107
133
  1. verify that the tag and `package.json` versions match;
108
- 2. install from `bun.lock`, run `verify` and `audit`, and build once;
134
+ 2. install from `bun.lock`, run `verify`, dependency and API-contract checks,
135
+ and build once;
109
136
  3. create one `.tgz` with lifecycle scripts disabled and record its SHA-256;
110
- 4. upload that archive and checksum as a one-day workflow artifact;
137
+ 4. upload that archive and checksum as a seven-day workflow artifact;
111
138
  5. verify and publish the archive to npm through trusted-publisher OIDC; and
112
139
  6. verify and publish the **same bytes** to GitHub Packages using
113
140
  `GITHUB_TOKEN`.
@@ -120,15 +147,19 @@ contract and must be preserved when editing the workflow.
120
147
  ## Verification and recovery
121
148
 
122
149
  After publishing, confirm that the expected version appears on npm and GitHub
123
- Packages and that a clean Node.js consumer can import both the ESM and CommonJS
124
- entrypoints. Compare the downloaded artifacts when registry tooling permits.
150
+ Packages, that a clean Node.js consumer can import both the ESM and CommonJS
151
+ entrypoints, and that registry downloads have the expected checksum.
125
152
 
126
153
  If packaging or npm publishing fails, fix the source, increment or retain the
127
154
  version as registry state allows, and create a new tag only after review. Never
128
155
  move a tag that has published a package.
129
156
 
157
+ Do not rerun an old release after changing its workflow or trusted-publisher
158
+ coordinates: GitHub reruns use the original commit and ref. Merge the fix and
159
+ create a reviewed new version and tag instead.
160
+
130
161
  If npm succeeds and GitHub Packages fails, rerun only the failed job while the
131
- original one-day workflow artifact is retained. This preserves the exact
162
+ original seven-day workflow artifact is retained. This preserves the exact
132
163
  archive already published to npm. Do not repack an approximation or unpublish a
133
164
  released npm version. If the artifact has expired, stop and review recovery with
134
165
  the maintainers before changing workflow dependencies or registry state.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@assinafy/sdk",
3
- "version": "2.1.1",
4
- "packageManager": "bun@1.3.14",
3
+ "version": "2.2.0",
4
+ "packageManager": "bun@1.4.0",
5
5
  "description": "TypeScript SDK for Assinafy API - Digital signature platform",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
@@ -32,7 +32,7 @@
32
32
  "audit:api": "bun scripts/api-contract-audit.ts",
33
33
  "prepack": "bun run build",
34
34
  "prepublishOnly": "bun run verify && bun run audit",
35
- "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.scripts.json && tsc --noEmit -p tsconfig.tests.json",
35
+ "typecheck": "bun ./node_modules/@typescript/native/bin/tsc --noEmit && bun ./node_modules/@typescript/native/bin/tsc --noEmit -p tsconfig.scripts.json && bun ./node_modules/@typescript/native/bin/tsc --noEmit -p tsconfig.tests.json",
36
36
  "verify": "bun run typecheck && bun run lint && bun run test:coverage && bun run build && bun run lint:pkg"
37
37
  },
38
38
  "keywords": [
@@ -67,19 +67,20 @@
67
67
  "devDependencies": {
68
68
  "@arethetypeswrong/cli": "^0.18.5",
69
69
  "@eslint/js": "^10.0.1",
70
- "@types/bun": "^1.3.14",
70
+ "@types/bun": "^1.4.0",
71
71
  "@types/node": "^22.20.1",
72
- "eslint": "^10.8.0",
73
- "publint": "^0.3.23",
72
+ "@typescript/native": "npm:typescript@^7.0.2",
73
+ "eslint": "^10.9.1",
74
+ "publint": "^0.3.24",
74
75
  "tsup": "^8.5.1",
75
76
  "typescript": "^6.0.3",
76
- "typescript-eslint": "^8.66.0"
77
+ "typescript-eslint": "^8.68.0"
77
78
  },
78
79
  "dependencies": {
79
- "axios": "^1.19.0"
80
+ "axios": "^1.20.0"
80
81
  },
81
82
  "overrides": {
82
- "esbuild": "0.28.1",
83
+ "esbuild": "0.28.2",
83
84
  "brace-expansion": "5.0.9"
84
85
  },
85
86
  "files": [