@marcohefti/request-network-api-contracts 0.5.0 → 0.5.2

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 CHANGED
@@ -38,14 +38,20 @@ pnpm add -D @marcohefti/request-network-api-contracts
38
38
 
39
39
  ## Updating the spec
40
40
 
41
- Use the TypeScript client's tooling to refresh the contracts in-place:
41
+ Use the TypeScript client's tooling to refresh the contracts in-place. From the TypeScript client repository, run:
42
42
 
43
43
  ```bash
44
- pnpm --filter "./packages/request-api-client" prepare:spec
45
- pnpm --filter "./packages/request-client-contracts" verify
44
+ pnpm prepare:spec
46
45
  ```
47
46
 
48
- `prepare:spec` downloads the latest OpenAPI document into `specs/openapi/`, refreshes metadata, and regenerates the TypeScript/Zod outputs in the client package. Follow with `verify` to sanity-check file sizes and presence before committing updates across both packages.
47
+ This downloads the latest OpenAPI document into the contracts package's `specs/openapi/`, refreshes metadata, and regenerates the TypeScript/Zod outputs. Then verify the contracts package:
48
+
49
+ ```bash
50
+ cd ../request-network-api-contracts
51
+ npm run verify
52
+ ```
53
+
54
+ The `verify` script sanity-checks file sizes and presence before committing updates across both packages.
49
55
 
50
56
  ## Future work
51
57
 
package/docs/OVERVIEW.md CHANGED
@@ -19,9 +19,9 @@ Git dependency.
19
19
  ## Directory Structure
20
20
 
21
21
  ```
22
- packages/request-client-contracts/
22
+ .
23
23
  ├── README.md
24
- ├── package.json # workspace metadata (private)
24
+ ├── package.json # package metadata
25
25
  ├── specs/
26
26
  │ ├── README.md # explains generated vs manual assets
27
27
  │ ├── openapi/
@@ -41,20 +41,29 @@ packages/request-client-contracts/
41
41
 
42
42
  ## Consumption Strategy
43
43
 
44
- - **Monorepo:** SDK packages reference files via the workspace package name
45
- (`@marcohefti/request-network-api-contracts/specs/...`). Build/validation scripts run from
46
- the monorepo root can read from this package without additional tooling.
47
- - **Post-split:** Each SDK repository will include this repo via Git submodule
48
- (or shallow git dependency) so the same files are available without copying.
49
- Documentation here will outline the update workflow.
44
+ - **Node / TypeScript SDKs:** Reference files via the published package name
45
+ (`@marcohefti/request-network-api-contracts/specs/...`) in your build and validation scripts.
46
+ - **Multi-package workspaces:** When this repo is part of a larger workspace,
47
+ scripts running from the workspace root can still read from the package path above without any special wiring.
48
+ - **Other SDKs:** Non-Node clients can vendor the `specs/**` and `fixtures/**`
49
+ directories or use this repository as a Git submodule / subtree so the same
50
+ files are available without copying them by hand.
50
51
 
51
52
  ## Update Workflow
52
53
 
53
- 1. Run `pnpm --filter "./packages/request-api-client" prepare:spec` to download the latest OpenAPI spec and metadata into `specs/openapi/` and regenerate the TypeScript/Zod outputs in the client package.
54
- 2. Update webhook fixtures in `fixtures/webhooks/` when Request publishes new payloads. Pair every new fixture with test coverage in each SDK.
55
- 3. Execute `pnpm --filter "./packages/request-client-contracts" verify` to confirm the expected files are present and within size bounds.
56
- 4. Commit the contract changes (`specs/**`, `fixtures/**`, docs) together with any regenerated client artefacts so consumers can diff the update in one review.
57
- 5. Append an entry to `docs/UPDATES.md` capturing the date, upstream reference, and required SDK follow-up.
54
+ 1. Refresh the OpenAPI spec (see `docs/UPDATE-WORKFLOW.md` for details). When
55
+ you maintain the TypeScript client alongside this package, that typically
56
+ means running its `pnpm run prepare:spec` task so the latest OpenAPI
57
+ document and metadata land in `specs/openapi/`.
58
+ 2. Update webhook fixtures in `fixtures/webhooks/` when Request publishes new
59
+ payloads. Pair every new fixture with test coverage in each SDK.
60
+ 3. Run `npm run verify` from this repository to confirm the expected files are
61
+ present and within size bounds.
62
+ 4. Commit the contract changes (`specs/**`, `fixtures/**`, docs) together with
63
+ any regenerated client artefacts so consumers can diff the update in one
64
+ review.
65
+ 5. Append an entry to `docs/UPDATES.md` capturing the date, upstream
66
+ reference, and required SDK follow-up.
58
67
 
59
68
  ## Related Backlog Tasks
60
69
 
@@ -0,0 +1,81 @@
1
+ # Publishing `@marcohefti/request-network-api-contracts`
2
+
3
+ This package publishes the shared Request Network REST API contracts to npm so
4
+ SDKs can consume the OpenAPI spec, metadata, and webhook fixtures without
5
+ vendoring files.
6
+
7
+ Use this checklist when preparing a release.
8
+
9
+ ## Preflight
10
+
11
+ - [x] `package.json` metadata is correct:
12
+ - `name: "@marcohefti/request-network-api-contracts"`
13
+ - `version` bumped according to the changes (0.5.x for the initial public line).
14
+ - `"private": false` and `"license": "MIT"`.
15
+ - `"files"` includes `specs`, `fixtures`, `docs`, and `README.md`.
16
+ - [x] `README.md` and `docs/OVERVIEW.md` describe the current contents (OpenAPI,
17
+ webhooks, fixtures) and how SDKs should consume them.
18
+ - [x] OpenAPI spec and metadata are refreshed via the TypeScript client’s tooling
19
+ (see `docs/UPDATE-WORKFLOW.md` step 1).
20
+ - [x] Webhook schema (`specs/webhooks/request-network-webhooks.json`) and
21
+ fixtures under `fixtures/webhooks/**` reflect the latest published webhook
22
+ events.
23
+ - [x] `node scripts/verify.js` passes to confirm the expected assets exist and
24
+ are non-empty.
25
+
26
+ ## Release Metadata
27
+
28
+ - [x] `docs/UPDATES.md` records the latest contract update (date, summary,
29
+ upstream source, required SDK follow-up).
30
+ - [ ] Tag strategy documented (e.g., `v0.x.y` for contract updates, semantic
31
+ version bumps when contracts introduce breaking changes for SDKs).
32
+
33
+ ## Publishing Steps (Automated via GitHub Actions)
34
+
35
+ Publishing is fully automated using GitHub Actions and OIDC trusted publishers. No npm tokens required.
36
+
37
+ **To publish a new version:**
38
+
39
+ 1. Bump the version using npm:
40
+ ```bash
41
+ npm version patch # for bug fixes (0.5.1 -> 0.5.2)
42
+ npm version minor # for new features (0.5.1 -> 0.6.0)
43
+ npm version major # for breaking changes (0.5.1 -> 1.0.0)
44
+ ```
45
+
46
+ 2. Push the tag to GitHub:
47
+ ```bash
48
+ git push --follow-tags
49
+ ```
50
+
51
+ 3. GitHub Actions automatically:
52
+ - Verifies spec files exist (`node scripts/verify.js`)
53
+ - Publishes to npm using OIDC authentication
54
+ - Generates provenance attestations
55
+
56
+ 4. Verify the publish succeeded:
57
+ - Check GitHub Actions: https://github.com/marcohefti/request-network-api-contracts/actions
58
+ - Check npm: https://www.npmjs.com/package/@marcohefti/request-network-api-contracts
59
+
60
+ **Prerequisites:**
61
+ - Trusted publisher configured on npmjs.com (already set up)
62
+ - Workflow file exists: `.github/workflows/publish.yml`
63
+ - Repository uses npm 11.5.1+ in CI
64
+
65
+ **Manual publish (emergency only):**
66
+ If GitHub Actions is unavailable, you can publish manually:
67
+ ```bash
68
+ npm login
69
+ npm publish --access public
70
+ ```
71
+
72
+ ## Post-Release
73
+
74
+ - [ ] Update TypeScript and PHP clients (and any other SDKs) to depend on the
75
+ new version.
76
+ - [ ] Run their spec/fixture sync scripts and parity guards:
77
+ - TS: `pnpm run prepare:spec` + tests.
78
+ - PHP: `composer update:spec`, `composer parity:openapi`, `composer parity:webhooks`.
79
+ - [ ] Record any required client follow-up work in the relevant SDK
80
+ repositories or your own release notes so consumers know which client
81
+ versions pick up the new contracts.
@@ -4,11 +4,14 @@ Use this checklist whenever the Request Network API publishes contract changes.
4
4
 
5
5
  ## 1. Refresh the OpenAPI spec
6
6
 
7
- ```bash
8
- pnpm --filter "./packages/request-api-client" prepare:spec
9
- ```
10
-
11
- `prepare:spec` downloads the latest OpenAPI document into `specs/openapi/` (updating both the JSON and `.meta.json`) and regenerates the TypeScript + Zod outputs referenced by the client.
7
+ - If you maintain the official TypeScript client alongside this package, run its
8
+ `pnpm run prepare:spec` task to download the latest OpenAPI document and
9
+ regenerate the generated types. That tooling is responsible for writing
10
+ `specs/openapi/request-network-openapi.json` and the corresponding
11
+ `.meta.json` file into this package.
12
+ - If you are only using this repository, fetch the OpenAPI document directly
13
+ from the upstream Request API (`https://api.request.network/open-api/openapi.json`)
14
+ and update both the JSON and `.meta.json` files under `specs/openapi/`.
12
15
 
13
16
  ## 2. Update webhook schema (if needed)
14
17
 
@@ -22,11 +25,14 @@ pnpm --filter "./packages/request-api-client" prepare:spec
22
25
 
23
26
  ## 4. Verify assets
24
27
 
28
+ From this repository, run:
29
+
25
30
  ```bash
26
- pnpm --filter "./packages/request-client-contracts" verify
31
+ npm run verify
27
32
  ```
28
33
 
29
- The verification script asserts that the expected files exist and logs their sizes for a quick sanity check.
34
+ The verification script asserts that the expected files exist and logs their
35
+ sizes for a quick sanity check.
30
36
 
31
37
  ## 5. Document and commit
32
38
 
package/docs/UPDATES.md CHANGED
@@ -12,4 +12,4 @@ change so SDK maintainers know when to regenerate code.
12
12
  - **Notes:** Regeneration impact, required SDK updates, new fixtures
13
13
 
14
14
  ## History
15
- - *No entries yet* - initial import seeded via `pnpm --filter "./packages/request-api-client" prepare:spec` on 2025-11-06.
15
+ - *No entries yet* - initial import seeded via the TypeScript client’s `pnpm run prepare:spec` tooling on 2025-11-06.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcohefti/request-network-api-contracts",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "description": "Shared contracts for Request Network API clients (OpenAPI spec, webhook fixtures).",
6
6
  "license": "MIT",
package/specs/README.md CHANGED
@@ -13,7 +13,10 @@ webhooks/ # manually curated webhook schema
13
13
  - `request-network-openapi.meta.json` – metadata captured during fetch (e.g.
14
14
  etag, timestamp, source URL).
15
15
 
16
- These files should only change through the regeneration script (`pnpm --filter "./packages/request-api-client" fetch:openapi` or the broader `prepare:spec`). Avoid manual edits. Rerun the fetch command when upstream changes land and commit the updated JSON + metadata.
16
+ These files should only change through the regeneration tooling in your SDKs
17
+ (for example, the TypeScript client’s `pnpm run fetch:openapi` or broader
18
+ `pnpm run prepare:spec` commands). Avoid manual edits. Rerun the fetch command
19
+ when upstream changes land and commit the updated JSON + metadata.
17
20
 
18
21
  ## `webhooks/`
19
22
  - `request-network-webhooks.json` – maintained manually. Update it when webhook
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "url": "https://api.request.network/open-api/openapi.json",
3
- "fetchedAt": "2025-12-11T02:53:19.867Z",
3
+ "fetchedAt": "2025-12-11T03:04:31.072Z",
4
4
  "etag": null,
5
5
  "lastModified": null
6
6
  }