@gewis/sudosos-client 1.37.0 → 2.0.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 +24 -18
- package/dist/api.d.ts +219 -219
- package/dist/api.js +1 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/esm/api.d.ts +19918 -0
- package/dist/esm/api.js +16762 -0
- package/dist/esm/base.d.ts +66 -0
- package/dist/esm/base.js +59 -0
- package/dist/esm/common.d.ts +65 -0
- package/dist/esm/common.js +133 -0
- package/dist/esm/configuration.d.ts +91 -0
- package/dist/esm/configuration.js +39 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/package.json +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Auto-generated TypeScript-Axios client for the SudoSOS API. Published on npm as [`@gewis/sudosos-client`](https://www.npmjs.com/package/@gewis/sudosos-client).
|
|
4
4
|
|
|
5
|
-
This package lives
|
|
5
|
+
This package lives at `packages/sudosos-client/` in the [GEWIS/sudosos](https://github.com/GEWIS/sudosos)
|
|
6
|
+
monorepo and is generated from the backend's Swagger/OpenAPI spec. The frontend apps in this same repo
|
|
7
|
+
consume it directly as a `workspace:*` dependency, not via the npm-published version.
|
|
6
8
|
|
|
7
9
|
---
|
|
8
10
|
|
|
@@ -61,7 +63,7 @@ balanceApi.getBalances().then((res) => {
|
|
|
61
63
|
});
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
For a more complete integration example, see [
|
|
66
|
+
For a more complete integration example, see [`frontend/lib/common`](../../frontend/lib/common) in this repo.
|
|
65
67
|
|
|
66
68
|
---
|
|
67
69
|
|
|
@@ -72,39 +74,43 @@ The client is generated from the OpenAPI spec that the backend emits at build ti
|
|
|
72
74
|
### Prerequisites
|
|
73
75
|
|
|
74
76
|
- Node.js 22+
|
|
75
|
-
- Java runtime (required by `openapi-generator-cli`)
|
|
76
|
-
|
|
77
|
+
- Java 11+ runtime (required by `openapi-generator-cli`) — only needed to *regenerate* the client;
|
|
78
|
+
the generated `src/` is committed, so day-to-day frontend work never needs Java.
|
|
79
|
+
- The backend's Swagger output must exist at `../../backend/out/swagger.json` — run `pnpm backend:swagger`
|
|
80
|
+
from the repo root first (or `pnpm swagger` from `backend/`).
|
|
77
81
|
|
|
78
82
|
### Common commands
|
|
79
83
|
|
|
84
|
+
Run from this directory (`packages/sudosos-client/`) once the monorepo workspace is installed, or via
|
|
85
|
+
`pnpm --filter @gewis/sudosos-client <script>` from anywhere in the repo:
|
|
86
|
+
|
|
80
87
|
| Command | Description |
|
|
81
88
|
|---|---|
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
89
|
+
| `pnpm gen` | Generate TypeScript source from `../../backend/out/swagger.json` into `src/` |
|
|
90
|
+
| `pnpm build` | Compile `src/` to `dist/` (CJS) and `dist/esm/` (ESM, for bundler consumers) |
|
|
91
|
+
| `pnpm genbuild` | Run `gen` then `build` (full regeneration) |
|
|
92
|
+
| `pnpm clean` | Remove `src/` and `dist/` |
|
|
86
93
|
|
|
87
94
|
### Regenerating after a backend change
|
|
88
95
|
|
|
89
|
-
|
|
90
|
-
# From the backend root — generate the OpenAPI spec first
|
|
91
|
-
npm run swagger # produces out/swagger.json
|
|
96
|
+
One-shot, from the repo root:
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
npm run genbuild
|
|
98
|
+
```bash
|
|
99
|
+
pnpm generate:client # runs backend swagger, then this package's genbuild
|
|
96
100
|
```
|
|
97
101
|
|
|
98
|
-
Or
|
|
102
|
+
Or step by step:
|
|
99
103
|
|
|
100
104
|
```bash
|
|
101
|
-
|
|
105
|
+
pnpm backend:swagger # produces backend/out/swagger.json
|
|
106
|
+
pnpm --filter @gewis/sudosos-client run genbuild # regenerate + rebuild the client
|
|
102
107
|
```
|
|
103
108
|
|
|
104
109
|
---
|
|
105
110
|
|
|
106
111
|
## Contributing
|
|
107
112
|
|
|
108
|
-
This package is generated — do not edit files under `src/` by hand; they will be overwritten on the next
|
|
113
|
+
This package is generated — do not edit files under `src/` by hand; they will be overwritten on the next
|
|
114
|
+
`pnpm gen`. To change the client's output, update the backend API and regenerate.
|
|
109
115
|
|
|
110
|
-
Issues and contributions go through the [
|
|
116
|
+
Issues and contributions go through the [GEWIS/sudosos issue tracker](https://github.com/GEWIS/sudosos/issues).
|