@insurance-broker/api-client 5.19.0 → 5.20.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 CHANGED
@@ -27,6 +27,26 @@ package only describes the shapes it carries.
27
27
  Nothing here is written by hand except the entry point. The types come from the backend's committed
28
28
  `docs/api/openapi.json`, and the backend's own CI fails if the two drift apart.
29
29
 
30
+ ## Responses the per-route types do not list
31
+
32
+ **Any customer-realm route can answer `401` with problem type
33
+ `urn:brokerplatform:problem:session-revoked`**, not only the routes whose description mentions it.
34
+ The platform's tenant resolution produces this answer before a route runs, so the generated types do
35
+ not list it on each operation. It means the customer signed out every session
36
+ (`POST /api/v1/customer-account/sessions/revocation`) after this session was authenticated.
37
+
38
+ - Do **not** answer it by refreshing. The identity provider will issue a new token, and the API will
39
+ refuse it in the same way.
40
+ - Do **not** answer it with a `prompt=login` sign-in on its own. On a device that still holds the
41
+ identity provider's session cookie, that re-authenticates the *same* session and re-admits every
42
+ refresh token copied from it.
43
+ - Do this instead:
44
+ 1. End the identity provider's session with RP-initiated logout and `id_token_hint`.
45
+ 2. Discard the stored tokens.
46
+ 3. Sign in again.
47
+
48
+ The backend's ADR-0049 has the reasoning, including the 2026-10-11 amendment.
49
+
30
50
  ## Versioning
31
51
 
32
52
  Semantic versioning against the **contract**, not against this file:
package/dist/schema.d.ts CHANGED
@@ -3009,6 +3009,32 @@ export interface paths {
3009
3009
  patch?: never;
3010
3010
  trace?: never;
3011
3011
  };
3012
+ "/api/v1/customer-account/sessions/revocation": {
3013
+ parameters: {
3014
+ query?: never;
3015
+ header?: never;
3016
+ path?: never;
3017
+ cookie?: never;
3018
+ };
3019
+ get?: never;
3020
+ put?: never;
3021
+ /**
3022
+ * Signs the customer out of every session they have established, including this one.
3023
+ * @description **Every sign-in this customer established up to now stops working against this API on its next request — including the one making this call.** That is the stolen-device remedy (SEC-012): a phone that is lost keeps a session the customer cannot reach, and this ends what that session can do here without needing the phone.
3024
+ *
3025
+ * **What a client must do afterwards.** Every request from a session established before the returned `revokedAtUtc` (plus a few seconds' clock allowance) is answered `401` with problem type `urn:brokerplatform:problem:session-revoked` — on any customer route, not only this one. **Do not refresh in answer to it**: the identity provider will issue a new token and that token will be refused the same way, because it belongs to the same sign-in. **Do not answer it with a `prompt=login` sign-in alone either**: on a device that still holds the identity provider's session cookie, that re-authenticates the *same* session and re-admits every refresh token copied from it. End the identity provider's session first (RP-initiated logout with `id_token_hint`), discard the stored tokens, then sign in.
3026
+ *
3027
+ * **Tell the customer to change their password, and to secure their email account.** Signing out does not stop somebody who knows the password from signing in again, and a password can be reset through the email address.
3028
+ *
3029
+ * **What it does not do yet.** It does not end the sessions at the identity provider, list them, or end one and keep the others; those need the isolated identity-management component ADR-0049 describes. A `409` means the caller is acting for an organisation: sessions belong to the person, so act personally to revoke them.
3030
+ */
3031
+ post: operations["RevokeOwnCustomerSessions"];
3032
+ delete?: never;
3033
+ options?: never;
3034
+ head?: never;
3035
+ patch?: never;
3036
+ trace?: never;
3037
+ };
3012
3038
  "/api/v1/customer-account/redemption": {
3013
3039
  parameters: {
3014
3040
  query?: never;
@@ -7240,6 +7266,10 @@ export interface components {
7240
7266
  /** Format: double */
7241
7267
  distanceKm: null | number | string;
7242
7268
  };
7269
+ CustomerSessionRevocationResponse: {
7270
+ /** Format: date-time */
7271
+ revokedAtUtc: string;
7272
+ };
7243
7273
  CustomerSubmissionAttachmentResponse: {
7244
7274
  /** Format: uuid */
7245
7275
  id: string;
@@ -16668,6 +16698,42 @@ export interface operations {
16668
16698
  };
16669
16699
  };
16670
16700
  };
16701
+ RevokeOwnCustomerSessions: {
16702
+ parameters: {
16703
+ query?: never;
16704
+ header?: {
16705
+ /** @description The organisation to act for: one of the identifiers GET /api/v1/customer/contexts lists. Omit it, or send it empty, to act for your own account; there is no mode in which it becomes mandatory. A value you hold no active membership of, or one that is not an organisation identifier, is refused with 403 naming nothing, and never quietly treated as your own account. */
16706
+ "X-Broker-Acting-For"?: components["parameters"]["ActingFor"];
16707
+ };
16708
+ path?: never;
16709
+ cookie?: never;
16710
+ };
16711
+ requestBody?: never;
16712
+ responses: {
16713
+ /** @description OK */
16714
+ 200: {
16715
+ headers: {
16716
+ /** @description The party this request actually acted for. Present, carrying the organisation identifier, when it acted for an organisation; absent when it acted for your own account. It mirrors the request header, so it can be sent back unchanged. Compare it with what you meant to send: it is the only way to see that a request you meant for an organisation was made personally. */
16717
+ "X-Broker-Acting-For"?: string;
16718
+ [name: string]: unknown;
16719
+ };
16720
+ content: {
16721
+ "application/json": components["schemas"]["CustomerSessionRevocationResponse"];
16722
+ };
16723
+ };
16724
+ /** @description Conflict. A type of urn:brokerplatform:problem:concurrency-conflict means someone else changed the record first and nothing was written: read it again and decide again. Any other type is a conflict this operation decided itself, and retrying it unchanged will not help. */
16725
+ 409: {
16726
+ headers: {
16727
+ /** @description The party this request actually acted for. Present, carrying the organisation identifier, when it acted for an organisation; absent when it acted for your own account. It mirrors the request header, so it can be sent back unchanged. Compare it with what you meant to send: it is the only way to see that a request you meant for an organisation was made personally. */
16728
+ "X-Broker-Acting-For"?: string;
16729
+ [name: string]: unknown;
16730
+ };
16731
+ content: {
16732
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
16733
+ };
16734
+ };
16735
+ };
16736
+ };
16671
16737
  RedeemCustomerInvitation: {
16672
16738
  parameters: {
16673
16739
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.19.0",
3
+ "version": "5.20.0",
4
4
  "description": "Generated TypeScript client for the Insurance Broker Platform API. Do not edit by hand: regenerate with scripts/update-api-contract.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,