@insurance-broker/api-client 1.0.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/README.md +46 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.d.ts +7337 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @insurance-broker/api-client
|
|
2
|
+
|
|
3
|
+
TypeScript types for the Insurance Broker Platform API, generated from that platform's OpenAPI
|
|
4
|
+
document. It is published for the platform's own web and mobile applications; it is not a
|
|
5
|
+
general-purpose library, and it carries no runtime code beyond one constant.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @insurance-broker/api-client openapi-fetch
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import createClient from 'openapi-fetch';
|
|
13
|
+
import type { paths } from '@insurance-broker/api-client';
|
|
14
|
+
|
|
15
|
+
const api = createClient<paths>({ baseUrl: process.env.API_BASE_URL });
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`openapi-fetch` is a peer dependency: the transport is the consumer's choice of version, and this
|
|
19
|
+
package only describes the shapes it carries.
|
|
20
|
+
|
|
21
|
+
## What is in it
|
|
22
|
+
|
|
23
|
+
- `paths`, `components`, `operations`, `webhooks` — the generated contract types.
|
|
24
|
+
- `apiVersion` — the API version the package was generated from, for asserting against during a
|
|
25
|
+
compatibility window.
|
|
26
|
+
|
|
27
|
+
Nothing here is written by hand except the entry point. The types come from the backend's committed
|
|
28
|
+
`docs/api/openapi.json`, and the backend's own CI fails if the two drift apart.
|
|
29
|
+
|
|
30
|
+
## Versioning
|
|
31
|
+
|
|
32
|
+
Semantic versioning against the **contract**, not against this file:
|
|
33
|
+
|
|
34
|
+
- **major** — a breaking contract change (a route or field removed, renamed, or narrowed).
|
|
35
|
+
- **minor** — an additive contract change (a new route, an optional field).
|
|
36
|
+
- **patch** — packaging only; the contract is unchanged.
|
|
37
|
+
|
|
38
|
+
Pin with a caret. A breaking change gets a compatibility window, because older mobile builds stay
|
|
39
|
+
installed on customers' phones after a backend release.
|
|
40
|
+
|
|
41
|
+
## Licence and source
|
|
42
|
+
|
|
43
|
+
Published publicly so that installing it needs no registry credentials. That is a distribution
|
|
44
|
+
decision, not a licence grant: this package is `UNLICENSED` and its source repository is private.
|
|
45
|
+
The API shape being readable is not a weakening of anything — backend validation and authorization
|
|
46
|
+
are authoritative regardless of what a client believes.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated TypeScript client for the Insurance Broker Platform API.
|
|
3
|
+
*
|
|
4
|
+
* The types in `schema.d.ts` are generated from `docs/api/openapi.json` and must not be edited
|
|
5
|
+
* by hand — run `scripts/update-api-contract` instead. This file is the stable public surface of
|
|
6
|
+
* the package and is hand-written, so regenerating the schema never rewrites the entry point.
|
|
7
|
+
*
|
|
8
|
+
* Consumers should not duplicate these request and response shapes (architecture doc section 9.4);
|
|
9
|
+
* the backend contract is the single source of truth, and backend validation and authorization
|
|
10
|
+
* remain authoritative regardless of what the client believes.
|
|
11
|
+
*/
|
|
12
|
+
export type { paths, components, operations, webhooks } from './schema.js';
|
|
13
|
+
/**
|
|
14
|
+
* The API version this package was generated from. Consumers can assert against it when a
|
|
15
|
+
* compatibility window is in effect during a breaking change.
|
|
16
|
+
*/
|
|
17
|
+
export declare const apiVersion: "v1";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAG,IAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated TypeScript client for the Insurance Broker Platform API.
|
|
3
|
+
*
|
|
4
|
+
* The types in `schema.d.ts` are generated from `docs/api/openapi.json` and must not be edited
|
|
5
|
+
* by hand — run `scripts/update-api-contract` instead. This file is the stable public surface of
|
|
6
|
+
* the package and is hand-written, so regenerating the schema never rewrites the entry point.
|
|
7
|
+
*
|
|
8
|
+
* Consumers should not duplicate these request and response shapes (architecture doc section 9.4);
|
|
9
|
+
* the backend contract is the single source of truth, and backend validation and authorization
|
|
10
|
+
* remain authoritative regardless of what the client believes.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The API version this package was generated from. Consumers can assert against it when a
|
|
14
|
+
* compatibility window is in effect during a breaking change.
|
|
15
|
+
*/
|
|
16
|
+
export const apiVersion = 'v1';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAa,CAAC"}
|