@insurance-broker/api-client 5.19.0 → 5.21.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.
Files changed (3) hide show
  1. package/README.md +20 -0
  2. package/dist/schema.d.ts +241 -42
  3. package/package.json +1 -1
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;
@@ -3026,6 +3052,69 @@ export interface paths {
3026
3052
  patch?: never;
3027
3053
  trace?: never;
3028
3054
  };
3055
+ "/api/v1/customer-verification-methods": {
3056
+ parameters: {
3057
+ query?: never;
3058
+ header?: never;
3059
+ path?: never;
3060
+ cookie?: never;
3061
+ };
3062
+ /**
3063
+ * The ways this broker's staff may verify a customer before signing them out, in the broker's order.
3064
+ * @description The broker's closed set of verification methods (ADR-0049). A member of staff signing a customer out of every session picks one of these keys and the choice is recorded in the audit entry. The set is configuration, never empty once configured; an empty list means this broker has not configured one yet, and staff-assisted sign-out is refused until it does.
3065
+ */
3066
+ get: operations["ListCustomerVerificationMethods"];
3067
+ put?: never;
3068
+ post?: never;
3069
+ delete?: never;
3070
+ options?: never;
3071
+ head?: never;
3072
+ patch?: never;
3073
+ trace?: never;
3074
+ };
3075
+ "/api/v1/customers/{id}/sessions/revocation": {
3076
+ parameters: {
3077
+ query?: never;
3078
+ header?: never;
3079
+ path?: never;
3080
+ cookie?: never;
3081
+ };
3082
+ get?: never;
3083
+ put?: never;
3084
+ /**
3085
+ * Signs a customer out of every session they have established, after a member of staff has verified them.
3086
+ * @description **Every sign-in this customer established up to now stops working against this API on its next request** — the same effect as the customer's own `POST /api/v1/customer-account/sessions/revocation`, for a customer who rings in because a device was lost or stolen (SEC-012). The customer signs in again afterwards on the device they hold.
3087
+ *
3088
+ * **Verify the customer first, then say how.** `verificationMethod` is a key from `GET /api/v1/customer-verification-methods`, this broker's closed set; `reason` is required, at most 500 characters, and is recorded with the method and the member of staff in the audit entry on the customer record (action `crm.customer.sessions-revoked-by-staff`). Tell the customer to change their password and secure their email account: signing out does not stop somebody who knows the password.
3089
+ *
3090
+ * **Refusals.** `400` when either field is missing or the reason is too long. `404` when the customer is not this broker's. `409` with problem type `urn:brokerplatform:problem:verification-method-not-offered` when the method is not in this broker's set (or the broker has configured none) — read the set and choose from it. `409` with no type when the customer has never attached a sign-in account, so has no session to end.
3091
+ *
3092
+ * **What it does not do yet.** It does not end the sessions at the identity provider or list them; those need the isolated identity-management component ADR-0049 describes.
3093
+ */
3094
+ post: operations["RevokeCustomerSessions"];
3095
+ delete?: never;
3096
+ options?: never;
3097
+ head?: never;
3098
+ patch?: never;
3099
+ trace?: never;
3100
+ };
3101
+ "/api/v1/customer/contexts": {
3102
+ parameters: {
3103
+ query?: never;
3104
+ header?: never;
3105
+ path?: never;
3106
+ cookie?: never;
3107
+ };
3108
+ /** The parties the signed-in customer may act as: themselves, and every organisation they hold an active membership of. The identifier of each is what X-Broker-Acting-For takes. */
3109
+ get: operations["ListActingContexts"];
3110
+ put?: never;
3111
+ post?: never;
3112
+ delete?: never;
3113
+ options?: never;
3114
+ head?: never;
3115
+ patch?: never;
3116
+ trace?: never;
3117
+ };
3029
3118
  "/api/v1/organisations": {
3030
3119
  parameters: {
3031
3120
  query?: never;
@@ -3164,23 +3253,6 @@ export interface paths {
3164
3253
  patch?: never;
3165
3254
  trace?: never;
3166
3255
  };
3167
- "/api/v1/customer/contexts": {
3168
- parameters: {
3169
- query?: never;
3170
- header?: never;
3171
- path?: never;
3172
- cookie?: never;
3173
- };
3174
- /** The parties the signed-in customer may act as: themselves, and every organisation they hold an active membership of. The identifier of each is what X-Broker-Acting-For takes. */
3175
- get: operations["ListActingContexts"];
3176
- put?: never;
3177
- post?: never;
3178
- delete?: never;
3179
- options?: never;
3180
- head?: never;
3181
- patch?: never;
3182
- trace?: never;
3183
- };
3184
3256
  "/api/v1/customer/organisations/{id}/membership/acceptance": {
3185
3257
  parameters: {
3186
3258
  query?: never;
@@ -7240,6 +7312,10 @@ export interface components {
7240
7312
  /** Format: double */
7241
7313
  distanceKm: null | number | string;
7242
7314
  };
7315
+ CustomerSessionRevocationResponse: {
7316
+ /** Format: date-time */
7317
+ revokedAtUtc: string;
7318
+ };
7243
7319
  CustomerSubmissionAttachmentResponse: {
7244
7320
  /** Format: uuid */
7245
7321
  id: string;
@@ -7271,6 +7347,11 @@ export interface components {
7271
7347
  help: null | string;
7272
7348
  section: null | string;
7273
7349
  };
7350
+ CustomerVerificationMethodResponse: {
7351
+ key: string;
7352
+ name: string;
7353
+ description: null | string;
7354
+ };
7274
7355
  DataClassificationResponse: {
7275
7356
  key: string;
7276
7357
  name: string;
@@ -9559,6 +9640,17 @@ export interface components {
9559
9640
  /** Format: uuid */
9560
9641
  conflictingPaymentId: string;
9561
9642
  };
9643
+ StaffCustomerSessionRevocationRequest: {
9644
+ verificationMethod: null | string;
9645
+ reason: null | string;
9646
+ };
9647
+ StaffCustomerSessionRevocationResponse: {
9648
+ /** Format: uuid */
9649
+ customerId: string;
9650
+ /** Format: date-time */
9651
+ revokedAtUtc: string;
9652
+ verificationMethod: string;
9653
+ };
9562
9654
  StaffNameResponse: {
9563
9655
  subjectId: string;
9564
9656
  displayName: string;
@@ -16668,6 +16760,42 @@ export interface operations {
16668
16760
  };
16669
16761
  };
16670
16762
  };
16763
+ RevokeOwnCustomerSessions: {
16764
+ parameters: {
16765
+ query?: never;
16766
+ header?: {
16767
+ /** @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. */
16768
+ "X-Broker-Acting-For"?: components["parameters"]["ActingFor"];
16769
+ };
16770
+ path?: never;
16771
+ cookie?: never;
16772
+ };
16773
+ requestBody?: never;
16774
+ responses: {
16775
+ /** @description OK */
16776
+ 200: {
16777
+ headers: {
16778
+ /** @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. */
16779
+ "X-Broker-Acting-For"?: string;
16780
+ [name: string]: unknown;
16781
+ };
16782
+ content: {
16783
+ "application/json": components["schemas"]["CustomerSessionRevocationResponse"];
16784
+ };
16785
+ };
16786
+ /** @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. */
16787
+ 409: {
16788
+ headers: {
16789
+ /** @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. */
16790
+ "X-Broker-Acting-For"?: string;
16791
+ [name: string]: unknown;
16792
+ };
16793
+ content: {
16794
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
16795
+ };
16796
+ };
16797
+ };
16798
+ };
16671
16799
  RedeemCustomerInvitation: {
16672
16800
  parameters: {
16673
16801
  query?: never;
@@ -16697,6 +16825,102 @@ export interface operations {
16697
16825
  };
16698
16826
  };
16699
16827
  };
16828
+ ListCustomerVerificationMethods: {
16829
+ parameters: {
16830
+ query?: never;
16831
+ header?: never;
16832
+ path?: never;
16833
+ cookie?: never;
16834
+ };
16835
+ requestBody?: never;
16836
+ responses: {
16837
+ /** @description OK */
16838
+ 200: {
16839
+ headers: {
16840
+ [name: string]: unknown;
16841
+ };
16842
+ content: {
16843
+ "application/json": components["schemas"]["CustomerVerificationMethodResponse"][];
16844
+ };
16845
+ };
16846
+ };
16847
+ };
16848
+ RevokeCustomerSessions: {
16849
+ parameters: {
16850
+ query?: never;
16851
+ header?: never;
16852
+ path: {
16853
+ id: string;
16854
+ };
16855
+ cookie?: never;
16856
+ };
16857
+ requestBody: {
16858
+ content: {
16859
+ "application/json": components["schemas"]["StaffCustomerSessionRevocationRequest"];
16860
+ };
16861
+ };
16862
+ responses: {
16863
+ /** @description OK */
16864
+ 200: {
16865
+ headers: {
16866
+ [name: string]: unknown;
16867
+ };
16868
+ content: {
16869
+ "application/json": components["schemas"]["StaffCustomerSessionRevocationResponse"];
16870
+ };
16871
+ };
16872
+ /** @description Bad Request */
16873
+ 400: {
16874
+ headers: {
16875
+ [name: string]: unknown;
16876
+ };
16877
+ content: {
16878
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
16879
+ };
16880
+ };
16881
+ /** @description Not Found */
16882
+ 404: {
16883
+ headers: {
16884
+ [name: string]: unknown;
16885
+ };
16886
+ content?: never;
16887
+ };
16888
+ /** @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. */
16889
+ 409: {
16890
+ headers: {
16891
+ [name: string]: unknown;
16892
+ };
16893
+ content: {
16894
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
16895
+ };
16896
+ };
16897
+ };
16898
+ };
16899
+ ListActingContexts: {
16900
+ parameters: {
16901
+ query?: never;
16902
+ header?: {
16903
+ /** @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. */
16904
+ "X-Broker-Acting-For"?: components["parameters"]["ActingFor"];
16905
+ };
16906
+ path?: never;
16907
+ cookie?: never;
16908
+ };
16909
+ requestBody?: never;
16910
+ responses: {
16911
+ /** @description OK */
16912
+ 200: {
16913
+ headers: {
16914
+ /** @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. */
16915
+ "X-Broker-Acting-For"?: string;
16916
+ [name: string]: unknown;
16917
+ };
16918
+ content: {
16919
+ "application/json": components["schemas"]["ActingContextResponse"][];
16920
+ };
16921
+ };
16922
+ };
16923
+ };
16700
16924
  ListOrganisations: {
16701
16925
  parameters: {
16702
16926
  query?: {
@@ -17076,31 +17300,6 @@ export interface operations {
17076
17300
  };
17077
17301
  };
17078
17302
  };
17079
- ListActingContexts: {
17080
- parameters: {
17081
- query?: never;
17082
- header?: {
17083
- /** @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. */
17084
- "X-Broker-Acting-For"?: components["parameters"]["ActingFor"];
17085
- };
17086
- path?: never;
17087
- cookie?: never;
17088
- };
17089
- requestBody?: never;
17090
- responses: {
17091
- /** @description OK */
17092
- 200: {
17093
- headers: {
17094
- /** @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. */
17095
- "X-Broker-Acting-For"?: string;
17096
- [name: string]: unknown;
17097
- };
17098
- content: {
17099
- "application/json": components["schemas"]["ActingContextResponse"][];
17100
- };
17101
- };
17102
- };
17103
- };
17104
17303
  AcceptOrganisationMembership: {
17105
17304
  parameters: {
17106
17305
  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.21.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,