@insurance-broker/api-client 5.24.0 → 5.26.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 (2) hide show
  1. package/dist/schema.d.ts +442 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -4635,6 +4635,115 @@ export interface paths {
4635
4635
  patch?: never;
4636
4636
  trace?: never;
4637
4637
  };
4638
+ "/api/v1/policies/imports": {
4639
+ parameters: {
4640
+ query?: never;
4641
+ header?: never;
4642
+ path?: never;
4643
+ cookie?: never;
4644
+ };
4645
+ /**
4646
+ * This broker's policy import runs, newest first
4647
+ * @description Paged by cursor, newest first (ADR-0031): pass `nextCursor` back as `cursor` until it is null. A cursor this list did not issue is a `400`.
4648
+ */
4649
+ get: operations["ListPolicyImports"];
4650
+ put?: never;
4651
+ /**
4652
+ * Uploads a file of policies to validate and import
4653
+ * @description Reads a CSV file of policies carried across from a previous system and stages every row as a new import run, answering `202` with the run in status `Staged`. Nothing is written to the policy records: each row is validated against the rules `POST /policies/imported` applies, and the whole file is committed later, all of it or none (ADR-0051).
4654
+ *
4655
+ * **The file.** One `multipart/form-data` file part. UTF-8 (a leading byte-order mark is tolerated), comma-delimited, RFC 4180 quoting, a header row naming `legacy_source`, `legacy_reference`, `customer_legacy_source`, `customer_legacy_reference`, `product_key`, `insurer_code` and `status`, and optionally `cover_start`, `cover_end`, `premium_amount`, `premium_currency`, `insurer_reference`, `insurer_confirmed_on` and `import_notes`, each at most once. Up to 50 further columns named `legacy.` followed by the previous system's own field name become the row's legacy metadata. Nothing else. Dates are `yyyy-MM-dd`; the premium is a plain decimal with a `.` point. The customer is named by the legacy pair it was imported under, the product by its key and the insurer by its code. At most 10,000 data rows and 5 MiB by default.
4656
+ *
4657
+ * **Refusals.** `413` when the file is larger than this broker accepts. `400` when the body is not multipart, and `400` with problem type `urn:brokerplatform:problem:import-file-refused` when the file cannot be read — invalid UTF-8, a NUL or other control character, a duplicate, unknown or missing header, more than 50 `legacy.` columns, a record whose field count differs from the header's, a misplaced or unclosed quote, more rows than allowed, no rows, or an unusable file name. That problem carries `fault` (`invalid-encoding`, `control-character`, `no-header`, `duplicate-header`, `unknown-column`, `missing-column`, `too-many-legacy-columns`, `field-count`, `misplaced-quote`, `unterminated-quote`, `too-many-rows`, `no-rows`, `no-file-part` or `file-name`) and, when the fault is on a line, `line`; its message names the line and never repeats the file's content. **A refused file creates no run.** `409` with problem type `urn:brokerplatform:problem:import-run-in-progress` when this broker already has a policy import staged, validated or committing — one at a time. `429` when this broker has used its policy upload budget: every admitted upload counts, including refused ones.
4658
+ */
4659
+ post: operations["UploadPolicyImport"];
4660
+ delete?: never;
4661
+ options?: never;
4662
+ head?: never;
4663
+ patch?: never;
4664
+ trace?: never;
4665
+ };
4666
+ "/api/v1/policies/imports/{id}": {
4667
+ parameters: {
4668
+ query?: never;
4669
+ header?: never;
4670
+ path?: never;
4671
+ cookie?: never;
4672
+ };
4673
+ /** One policy import run: its status, counts and who did what when */
4674
+ get: operations["GetPolicyImport"];
4675
+ put?: never;
4676
+ post?: never;
4677
+ delete?: never;
4678
+ options?: never;
4679
+ head?: never;
4680
+ patch?: never;
4681
+ trace?: never;
4682
+ };
4683
+ "/api/v1/policies/imports/{id}/rows": {
4684
+ parameters: {
4685
+ query?: never;
4686
+ header?: never;
4687
+ path?: never;
4688
+ cookie?: never;
4689
+ };
4690
+ /**
4691
+ * A policy import run's rows, in file order
4692
+ * @description Each row's line number in the file, its outcome, the policy it created once committed, and every reason it was refused — a column (`legacy.*` for the legacy columns taken together), a stable code and a fixed sentence, never a value from the file. The codes are those of `POST /policies/imported` (`required`, `too-long`, `invalid-format`, `premium-incomplete`, `premium-negative`, `cover-period-inverted`, `status-not-importable`, `evidence-required`, `evidence-not-allowed`, `legacy-metadata-too-large`, `unknown-customer`, `unknown-product`, `unknown-insurer`, `already-imported`) and two of a file's own: `invalid-character` and `duplicate-in-file`. Filter with `outcome` (`Pending`, `Accepted` or `Refused`). Paged by cursor in file order (ADR-0031). `404` when the run is not this broker's.
4693
+ */
4694
+ get: operations["ListPolicyImportRows"];
4695
+ put?: never;
4696
+ post?: never;
4697
+ delete?: never;
4698
+ options?: never;
4699
+ head?: never;
4700
+ patch?: never;
4701
+ trace?: never;
4702
+ };
4703
+ "/api/v1/policies/imports/{id}/commitment": {
4704
+ parameters: {
4705
+ query?: never;
4706
+ header?: never;
4707
+ path?: never;
4708
+ cookie?: never;
4709
+ };
4710
+ get?: never;
4711
+ put?: never;
4712
+ /**
4713
+ * Asks for a validated policy import to be committed, every row or none
4714
+ * @description Accepted only from `Validated`. Moves the run to `Committing` and answers `202` with it; the commit then runs in the background and ends `Committed` (one policy per row, each exactly as `POST /policies/imported` would record it, with the run as its import batch), `CommitRefused` (nothing written; `commitRefusalReason` says why, and a row that failed the commit's re-check is `Refused` with its reasons), or `CommitFailed` (nothing written, after the commit stalled). Read the run to follow it.
4715
+ *
4716
+ * **Requires `If-Match`** with the run's `concurrencyToken`. Without it, or with `*`, `428`; a token that is no longer current is `409` with problem type `urn:brokerplatform:problem:concurrency-conflict` — read the run again. `409` with problem type `urn:brokerplatform:problem:import-run-state-conflict` when the run is not `Validated`; its `runStatus` says what it is. `404` when the run is not this broker's.
4717
+ */
4718
+ post: operations["CommitPolicyImport"];
4719
+ delete?: never;
4720
+ options?: never;
4721
+ head?: never;
4722
+ patch?: never;
4723
+ trace?: never;
4724
+ };
4725
+ "/api/v1/policies/imports/{id}/abandonment": {
4726
+ parameters: {
4727
+ query?: never;
4728
+ header?: never;
4729
+ path?: never;
4730
+ cookie?: never;
4731
+ };
4732
+ get?: never;
4733
+ put?: never;
4734
+ /**
4735
+ * Abandons a policy import that has not been committed
4736
+ * @description Accepted only from `Staged` or `Validated`. Ends the run `Abandoned`, removes every value the file held, and frees this broker's policy import slot; the report (line numbers, outcomes and reasons) stays readable. Answers `200` with the run.
4737
+ *
4738
+ * **Requires `If-Match`** with the run's `concurrencyToken`. Without it, or with `*`, `428`; a token that is no longer current is `409` with problem type `urn:brokerplatform:problem:concurrency-conflict`. `409` with problem type `urn:brokerplatform:problem:import-run-state-conflict` when the run has already ended — including `Refused`, which is already ended and purged — or is committing; its `runStatus` says what it is. `404` when the run is not this broker's.
4739
+ */
4740
+ post: operations["AbandonPolicyImport"];
4741
+ delete?: never;
4742
+ options?: never;
4743
+ head?: never;
4744
+ patch?: never;
4745
+ trace?: never;
4746
+ };
4638
4747
  "/api/v1/policies/payment-gates": {
4639
4748
  parameters: {
4640
4749
  query?: never;
@@ -9000,6 +9109,56 @@ export interface components {
9000
9109
  PolicyDocumentUpload: {
9001
9110
  file: components["schemas"]["IFormFile"];
9002
9111
  };
9112
+ PolicyImportRowPage: {
9113
+ items: components["schemas"]["PolicyImportRowResponse"][];
9114
+ nextCursor: null | string;
9115
+ };
9116
+ PolicyImportRowReason: {
9117
+ column: string;
9118
+ code: string;
9119
+ message: string;
9120
+ };
9121
+ PolicyImportRowResponse: {
9122
+ /** Format: int32 */
9123
+ lineNumber: number;
9124
+ outcome: string;
9125
+ /** Format: uuid */
9126
+ policyId: null | string;
9127
+ reasons: components["schemas"]["PolicyImportRowReason"][];
9128
+ };
9129
+ PolicyImportRunPage: {
9130
+ items: components["schemas"]["PolicyImportRunResponse"][];
9131
+ nextCursor: null | string;
9132
+ };
9133
+ PolicyImportRunResponse: {
9134
+ /** Format: uuid */
9135
+ id: string;
9136
+ status: string;
9137
+ fileName: string;
9138
+ /** Format: int32 */
9139
+ rowCount: number;
9140
+ /** Format: int32 */
9141
+ acceptedCount: null | number;
9142
+ /** Format: int32 */
9143
+ refusedCount: null | number;
9144
+ /** Format: int32 */
9145
+ committedCount: null | number;
9146
+ submittedBySubjectId: string;
9147
+ /** Format: date-time */
9148
+ stagedAtUtc: string;
9149
+ /** Format: date-time */
9150
+ validatedAtUtc: null | string;
9151
+ commitRequestedBySubjectId: null | string;
9152
+ /** Format: date-time */
9153
+ commitRequestedAtUtc: null | string;
9154
+ /** Format: date-time */
9155
+ concludedAtUtc: null | string;
9156
+ commitRefusalReason: null | string;
9157
+ concurrencyToken: string;
9158
+ };
9159
+ PolicyImportUpload: {
9160
+ file: components["schemas"]["IFormFile"];
9161
+ };
9003
9162
  PolicyPage: {
9004
9163
  items: components["schemas"]["PolicyResponse"][];
9005
9164
  nextCursor: null | string;
@@ -21250,6 +21409,289 @@ export interface operations {
21250
21409
  };
21251
21410
  };
21252
21411
  };
21412
+ ListPolicyImports: {
21413
+ parameters: {
21414
+ query?: {
21415
+ cursor?: string;
21416
+ limit?: number | string;
21417
+ };
21418
+ header?: never;
21419
+ path?: never;
21420
+ cookie?: never;
21421
+ };
21422
+ requestBody?: never;
21423
+ responses: {
21424
+ /** @description OK */
21425
+ 200: {
21426
+ headers: {
21427
+ [name: string]: unknown;
21428
+ };
21429
+ content: {
21430
+ "application/json": components["schemas"]["PolicyImportRunPage"];
21431
+ };
21432
+ };
21433
+ /** @description Bad Request */
21434
+ 400: {
21435
+ headers: {
21436
+ [name: string]: unknown;
21437
+ };
21438
+ content: {
21439
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
21440
+ };
21441
+ };
21442
+ };
21443
+ };
21444
+ UploadPolicyImport: {
21445
+ parameters: {
21446
+ query?: never;
21447
+ header?: never;
21448
+ path?: never;
21449
+ cookie?: never;
21450
+ };
21451
+ requestBody: {
21452
+ content: {
21453
+ "multipart/form-data": components["schemas"]["PolicyImportUpload"];
21454
+ };
21455
+ };
21456
+ responses: {
21457
+ /** @description Accepted */
21458
+ 202: {
21459
+ headers: {
21460
+ [name: string]: unknown;
21461
+ };
21462
+ content: {
21463
+ "application/json": components["schemas"]["PolicyImportRunResponse"];
21464
+ };
21465
+ };
21466
+ /** @description Bad Request */
21467
+ 400: {
21468
+ headers: {
21469
+ [name: string]: unknown;
21470
+ };
21471
+ content: {
21472
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
21473
+ };
21474
+ };
21475
+ /** @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. */
21476
+ 409: {
21477
+ headers: {
21478
+ [name: string]: unknown;
21479
+ };
21480
+ content: {
21481
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
21482
+ };
21483
+ };
21484
+ /** @description Payload Too Large */
21485
+ 413: {
21486
+ headers: {
21487
+ [name: string]: unknown;
21488
+ };
21489
+ content: {
21490
+ "application/problem+json": components["schemas"]["ProblemDetails"];
21491
+ };
21492
+ };
21493
+ /** @description Too Many Requests (ADR-0051). Your organisation has used its budget of import uploads for this kind of record in the last day; every admitted upload counts, including ones refused because the file could not be read. Nothing was read and no import was started. budget is always tenant. Wait the number of seconds in Retry-After (also in retryAfterSeconds) before trying again. */
21494
+ 429: {
21495
+ headers: {
21496
+ /** @description Whole seconds to wait before retrying; at least 1. */
21497
+ "Retry-After": number;
21498
+ [name: string]: unknown;
21499
+ };
21500
+ content: {
21501
+ "application/problem+json": components["schemas"]["RateLimitedProblem"];
21502
+ };
21503
+ };
21504
+ };
21505
+ };
21506
+ GetPolicyImport: {
21507
+ parameters: {
21508
+ query?: never;
21509
+ header?: never;
21510
+ path: {
21511
+ id: string;
21512
+ };
21513
+ cookie?: never;
21514
+ };
21515
+ requestBody?: never;
21516
+ responses: {
21517
+ /** @description OK */
21518
+ 200: {
21519
+ headers: {
21520
+ [name: string]: unknown;
21521
+ };
21522
+ content: {
21523
+ "application/json": components["schemas"]["PolicyImportRunResponse"];
21524
+ };
21525
+ };
21526
+ /** @description Not Found */
21527
+ 404: {
21528
+ headers: {
21529
+ [name: string]: unknown;
21530
+ };
21531
+ content?: never;
21532
+ };
21533
+ };
21534
+ };
21535
+ ListPolicyImportRows: {
21536
+ parameters: {
21537
+ query?: {
21538
+ outcome?: string;
21539
+ cursor?: string;
21540
+ limit?: number | string;
21541
+ };
21542
+ header?: never;
21543
+ path: {
21544
+ id: string;
21545
+ };
21546
+ cookie?: never;
21547
+ };
21548
+ requestBody?: never;
21549
+ responses: {
21550
+ /** @description OK */
21551
+ 200: {
21552
+ headers: {
21553
+ [name: string]: unknown;
21554
+ };
21555
+ content: {
21556
+ "application/json": components["schemas"]["PolicyImportRowPage"];
21557
+ };
21558
+ };
21559
+ /** @description Bad Request */
21560
+ 400: {
21561
+ headers: {
21562
+ [name: string]: unknown;
21563
+ };
21564
+ content: {
21565
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
21566
+ };
21567
+ };
21568
+ /** @description Not Found */
21569
+ 404: {
21570
+ headers: {
21571
+ [name: string]: unknown;
21572
+ };
21573
+ content?: never;
21574
+ };
21575
+ };
21576
+ };
21577
+ CommitPolicyImport: {
21578
+ parameters: {
21579
+ query?: never;
21580
+ header: {
21581
+ /** @description Required. The concurrencyToken of the record as it was read, sent back unchanged. A write without it, or with *, is refused with 428; a token that is no longer current is refused with 409 (issue #517, client 5.0.0). */
21582
+ "If-Match": string;
21583
+ };
21584
+ path: {
21585
+ id: string;
21586
+ };
21587
+ cookie?: never;
21588
+ };
21589
+ requestBody?: never;
21590
+ responses: {
21591
+ /** @description Accepted */
21592
+ 202: {
21593
+ headers: {
21594
+ [name: string]: unknown;
21595
+ };
21596
+ content: {
21597
+ "application/json": components["schemas"]["PolicyImportRunResponse"];
21598
+ };
21599
+ };
21600
+ /** @description Bad Request */
21601
+ 400: {
21602
+ headers: {
21603
+ [name: string]: unknown;
21604
+ };
21605
+ content: {
21606
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
21607
+ };
21608
+ };
21609
+ /** @description Not Found */
21610
+ 404: {
21611
+ headers: {
21612
+ [name: string]: unknown;
21613
+ };
21614
+ content?: never;
21615
+ };
21616
+ /** @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. */
21617
+ 409: {
21618
+ headers: {
21619
+ [name: string]: unknown;
21620
+ };
21621
+ content: {
21622
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
21623
+ };
21624
+ };
21625
+ /** @description Precondition Required (RFC 6585). The request carried no If-Match, or carried If-Match: *, which protects nothing. Nothing was read or written. Read the record, then send its concurrencyToken as If-Match. */
21626
+ 428: {
21627
+ headers: {
21628
+ [name: string]: unknown;
21629
+ };
21630
+ content: {
21631
+ "application/problem+json": components["schemas"]["PreconditionRequiredProblem"];
21632
+ };
21633
+ };
21634
+ };
21635
+ };
21636
+ AbandonPolicyImport: {
21637
+ parameters: {
21638
+ query?: never;
21639
+ header: {
21640
+ /** @description Required. The concurrencyToken of the record as it was read, sent back unchanged. A write without it, or with *, is refused with 428; a token that is no longer current is refused with 409 (issue #517, client 5.0.0). */
21641
+ "If-Match": string;
21642
+ };
21643
+ path: {
21644
+ id: string;
21645
+ };
21646
+ cookie?: never;
21647
+ };
21648
+ requestBody?: never;
21649
+ responses: {
21650
+ /** @description OK */
21651
+ 200: {
21652
+ headers: {
21653
+ [name: string]: unknown;
21654
+ };
21655
+ content: {
21656
+ "application/json": components["schemas"]["PolicyImportRunResponse"];
21657
+ };
21658
+ };
21659
+ /** @description Bad Request */
21660
+ 400: {
21661
+ headers: {
21662
+ [name: string]: unknown;
21663
+ };
21664
+ content: {
21665
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
21666
+ };
21667
+ };
21668
+ /** @description Not Found */
21669
+ 404: {
21670
+ headers: {
21671
+ [name: string]: unknown;
21672
+ };
21673
+ content?: never;
21674
+ };
21675
+ /** @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. */
21676
+ 409: {
21677
+ headers: {
21678
+ [name: string]: unknown;
21679
+ };
21680
+ content: {
21681
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
21682
+ };
21683
+ };
21684
+ /** @description Precondition Required (RFC 6585). The request carried no If-Match, or carried If-Match: *, which protects nothing. Nothing was read or written. Read the record, then send its concurrencyToken as If-Match. */
21685
+ 428: {
21686
+ headers: {
21687
+ [name: string]: unknown;
21688
+ };
21689
+ content: {
21690
+ "application/problem+json": components["schemas"]["PreconditionRequiredProblem"];
21691
+ };
21692
+ };
21693
+ };
21694
+ };
21253
21695
  ReadPaymentGates: {
21254
21696
  parameters: {
21255
21697
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.24.0",
3
+ "version": "5.26.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,