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

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Marco Hefti
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -53,6 +53,17 @@ npm run verify
53
53
 
54
54
  The `verify` script sanity-checks file sizes and presence before committing updates across both packages.
55
55
 
56
+ ### Local schema drift patching
57
+
58
+ `prepare:spec` now applies a local compatibility patch before regeneration to cover known upstream schema drift (for example `fees[].amount = null` and `fees[].type = "protocol"` in runtime payloads). Reapply the patch without refetching via:
59
+
60
+ ```bash
61
+ cd ../request-network-api-client-ts
62
+ pnpm patch:openapi
63
+ ```
64
+
65
+ This keeps contracts as the source of truth inside this workspace while upstream OpenAPI catches up.
66
+
56
67
  ## Future work
57
68
 
58
69
  - [ ] Publish webhook fixture guidelines and add validation to ensure both SDKs reference the same payload set.
@@ -9,9 +9,14 @@ Use this checklist whenever the Request Network API publishes contract changes.
9
9
  regenerate the generated types. That tooling is responsible for writing
10
10
  `specs/openapi/request-network-openapi.json` and the corresponding
11
11
  `.meta.json` file into this package.
12
+ - `prepare:spec` also applies local schema-drift patches before generation
13
+ (currently fee-shape compatibility for runtime payloads that return
14
+ `type: "protocol"` and nullable fee amounts).
12
15
  - If you are only using this repository, fetch the OpenAPI document directly
13
16
  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/`.
17
+ and update both the JSON and `.meta.json` files under `specs/openapi/`, then
18
+ run `pnpm --filter "./packages/request-network-api-client-ts" patch:openapi`
19
+ from the workspace root before regenerating client artifacts.
15
20
 
16
21
  ## 2. Update webhook schema (if needed)
17
22
 
package/docs/UPDATES.md CHANGED
@@ -12,4 +12,14 @@ 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 the TypeScript client’s `pnpm run prepare:spec` tooling on 2025-11-06.
15
+ - **Date:** 2026-02-24
16
+ - **Spec Version:** 2026-02-24 (local drift patch over upstream OpenAPI payload mismatch)
17
+ - **Change Summary:** Added compatibility patch for fee payload drift (`fees[].type` includes `protocol`, `fees[].amount` / `amountInUSD` nullable) and updated update workflow docs.
18
+ - **Source:** https://api.request.network/open-api/openapi.json
19
+ - **Notes:** Keeps contracts package as source of truth for generated clients while upstream schema catches up.
20
+
21
+ - **Date:** 2026-02-20
22
+ - **Spec Version:** 2026-02-20 (`fetchedAt` from `request-network-openapi.meta.json`)
23
+ - **Change Summary:** Synced upstream Request API OpenAPI spec; includes new `v2/payee-destination` operations and schema refinements consumed by TS/PHP clients.
24
+ - **Source:** https://api.request.network/open-api/openapi.json
25
+ - **Notes:** Requires regenerated SDK artifacts and parity checks in both `request-network-api-client-ts` and `request-network-api-client-php`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcohefti/request-network-api-contracts",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "private": false,
5
5
  "description": "Shared contracts for Request Network API clients (OpenAPI spec, webhook fixtures).",
6
6
  "license": "MIT",