@instabrain-sdks/api-client 2.7.0 → 2.8.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 +111 -22
- package/dist/client/instabrain-client.d.ts +4 -0
- package/dist/client/instabrain-client.js +4 -0
- package/dist/services/reports.service.d.ts +3 -0
- package/dist/services/reports.service.js +3 -0
- package/dist/types/index.d.ts +0 -7
- package/dist/types/reports.types.d.ts +78 -18
- package/dist/types/reports.types.js +29 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -80,8 +80,10 @@ Credentials (`userId` and `accessToken`) are provisioned during onboarding.
|
|
|
80
80
|
- [Final submit](#final-submit)
|
|
81
81
|
12. [Reporting](#reporting)
|
|
82
82
|
- [Request fields](#request-fields-shared-shape)
|
|
83
|
-
- [Filters (`
|
|
83
|
+
- [Filters (`ReportFilterOperator`)](#filters--reportfilteroperator)
|
|
84
|
+
- [`getSales()` filter and sort fields](#getsales-filter-and-sort-fields)
|
|
84
85
|
- [Response shapes](#response-shapes)
|
|
86
|
+
- [`getSales()` sale fields](#getsales-sale-fields)
|
|
85
87
|
13. [Enums & Constants](#enums--constants)
|
|
86
88
|
14. [Beneficiary Reference](#beneficiary-reference)
|
|
87
89
|
- [No extra fields](#variant-1--no-extra-fields)
|
|
@@ -122,7 +124,7 @@ npm install @instabrain-sdks/api-client
|
|
|
122
124
|
## Requirements
|
|
123
125
|
|
|
124
126
|
- Node.js >= 14.0.0
|
|
125
|
-
- TypeScript >= 4.
|
|
127
|
+
- TypeScript >= 4.5 *(optional — the SDK ships with full type definitions; axios's type definitions do not parse on older versions)*
|
|
126
128
|
|
|
127
129
|
In request field tables, **Type** matches the SDK TypeScript definitions. **Required** values:
|
|
128
130
|
|
|
@@ -3858,34 +3860,74 @@ All three methods accept `AgentPortalReq`.
|
|
|
3858
3860
|
| Field | Type | Required | Description |
|
|
3859
3861
|
|---|---|---|---|
|
|
3860
3862
|
| `pageSize` | `number` | Yes | Items per page — do not pass `0` or `null` |
|
|
3861
|
-
| `pageIndex` | `number` | Yes | Page
|
|
3862
|
-
| `startDate` | `string` (ISO) | Conditional | Start of date range —
|
|
3863
|
+
| `pageIndex` | `number` | Yes | Page to retrieve; the first page is `1` — do not pass `0` or `null` |
|
|
3864
|
+
| `startDate` | `string` (ISO) | Conditional | Start of date range — send together with `endDate`; otherwise use `dayCount` |
|
|
3863
3865
|
| `endDate` | `string` (ISO) | Conditional | End of date range — required with `startDate` |
|
|
3864
|
-
| `dayCount` | `number` | Conditional | Last N days —
|
|
3865
|
-
| `userTimeZone` | `string` | No | IANA
|
|
3866
|
-
| `sort.value` | `string` | No |
|
|
3866
|
+
| `dayCount` | `number` | Conditional | Last N days — use when `startDate`/`endDate` are not sent (for `getSales()`, sending neither returns all sales up to today) |
|
|
3867
|
+
| `userTimeZone` | `string` | No | IANA time zone the dates are read in, e.g. `"America/Chicago"`; defaults to UTC |
|
|
3868
|
+
| `sort.value` | `string` | No | Field to sort by (not case sensitive) — see [`getSales()` sort fields](#getsales-filter-and-sort-fields) |
|
|
3867
3869
|
| `sort.sortDescending` | `boolean` | No | `true` = descending order |
|
|
3868
|
-
| `filters[]` | `object[]` | No | `{ field, operator, value }` — see
|
|
3870
|
+
| `filters[]` | `object[]` | No | `{ field, operator, value }` — see [Filters](#filters--reportfilteroperator) below |
|
|
3869
3871
|
| `searchParam` | `string` | No | Text search across all response fields except `riders` |
|
|
3870
3872
|
|
|
3871
3873
|
|
|
3872
3874
|
***
|
|
3873
3875
|
|
|
3874
|
-
### Filters — `
|
|
3876
|
+
### Filters — `ReportFilterOperator`
|
|
3875
3877
|
|
|
3876
|
-
|
|
3878
|
+
Each `filters[]` item has three required fields: `field`, `operator` and `value`. `value` is always a string. Filters are combined with **AND** — except in `getSales()`, where `agentName` and `agencyName` sent together return sales matching either one.
|
|
3879
|
+
|
|
3880
|
+
The API takes **string** operators. Pass a `ReportFilterOperator` member or the literal string:
|
|
3881
|
+
|
|
3882
|
+
| `ReportFilterOperator` member | Value sent | Meaning | `value` format | Example `value` |
|
|
3883
|
+
|---|---|---|---|---|
|
|
3884
|
+
| `Equal` | `'eq'` | Equals | A single value | `"25000"` |
|
|
3885
|
+
| `GreaterThan` / `GreaterThanOrEqual` | `'gt'` / `'gte'` | Greater than / or equal | A single number | `"1000"` |
|
|
3886
|
+
| `LessThan` / `LessThanOrEqual` | `'lt'` / `'lte'` | Less than / or equal | A single number | `"1000"` |
|
|
3887
|
+
| `Like` | `'like'` | Contains the text | A single text value | `"Jane"` |
|
|
3888
|
+
| `In` | `'IN'` | Matches any of the values | Comma-separated values | `"Preferred, Standard"` |
|
|
3889
|
+
| `Between` | `'between'` | Within a date range (inclusive) | Two comma-separated dates: start, end | `"2026-11-01, 2026-11-03"` |
|
|
3890
|
+
|
|
3891
|
+
For `between`, the dates are read in `userTimeZone` and the end date includes the whole day. The `availableFilters` list in each response uses the same string operators; an entry whose `value` is `null` accepts any value.
|
|
3892
|
+
|
|
3893
|
+
```typescript
|
|
3894
|
+
import { ReportFilterOperator } from '@instabrain-sdks/api-client';
|
|
3895
|
+
|
|
3896
|
+
const sales = await client.getSales({
|
|
3897
|
+
dayCount: 90,
|
|
3898
|
+
pageIndex: 1,
|
|
3899
|
+
pageSize: 20,
|
|
3900
|
+
sort: { value: 'createdOn', sortDescending: true },
|
|
3901
|
+
filters: [
|
|
3902
|
+
{ field: 'proTitle', operator: ReportFilterOperator.In, value: 'InstaBrain Pure Term, InstaBrain Guaranteed Issue' },
|
|
3903
|
+
{ field: 'rateClass', operator: 'IN', value: 'Preferred Plus, Preferred' },
|
|
3904
|
+
],
|
|
3905
|
+
});
|
|
3906
|
+
```
|
|
3907
|
+
|
|
3908
|
+
> **`SQLOperator` is deprecated.** Its numeric values (`SQLOperator.In` = `9`, …) are not what the API accepts: a filter sent with a number is answered with **HTTP 500**. Replace `SQLOperator.X` with `ReportFilterOperator.X` (`Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`, `LessThanOrEqual`, `In`); `Contains` becomes `Like`. `NotEqual`, `StartsWith`, `EndsWith` and `NotIn` have no API equivalent. The enum still compiles and will be removed in the next major version.
|
|
3909
|
+
|
|
3910
|
+
|
|
3911
|
+
***
|
|
3912
|
+
|
|
3913
|
+
### `getSales()` filter and sort fields
|
|
3914
|
+
|
|
3915
|
+
Send a filter only with one of these fields, written exactly as shown. The response's `availableFilters` may list other fields; they are not supported as filters.
|
|
3916
|
+
|
|
3917
|
+
| Field | Operators | Value |
|
|
3877
3918
|
|---|---|---|
|
|
3878
|
-
| `
|
|
3879
|
-
| `
|
|
3880
|
-
| `
|
|
3881
|
-
| `
|
|
3882
|
-
| `
|
|
3883
|
-
| `
|
|
3884
|
-
| `
|
|
3885
|
-
| `
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3919
|
+
| `proTitle` | `IN` | Comma-separated product titles, e.g. `InstaBrain Pure Term, InstaBrain Guaranteed Issue` |
|
|
3920
|
+
| `rateClass` | `IN` | Comma-separated rate classes: `Preferred Plus`, `Preferred`, `Standard Extra`, `Standard`, `Guaranteed`, `Rated C`, `Rated D` |
|
|
3921
|
+
| `paymentMethod` | `eq`, `IN` | Payment method **code**: `302` (Credit Card) or `303` (EFT); with `IN`, e.g. `302, 303`. The response shows the name (`EFT`), but the filter takes only the code. |
|
|
3922
|
+
| `salesDate` | `between` | `start, end` dates, e.g. `2026-11-01, 2026-11-03` |
|
|
3923
|
+
| `targetPremium` | `eq`, `gt`, `gte`, `lt`, `lte` | A number |
|
|
3924
|
+
| `faceAmount` | `eq`, `gt`, `gte`, `lt`, `lte` | A number |
|
|
3925
|
+
| `agentName` | `like`, `IN` | Text contained in the agent's full name; with `IN`, a comma-separated list |
|
|
3926
|
+
| `agencyName` | `like`, `IN` | Text contained in the agency name; with `IN`, a comma-separated list |
|
|
3927
|
+
|
|
3928
|
+
**Sort fields** (`sort.value`, not case sensitive): `createdOn`, `policyNumber`, `proTitle`, `firstName`, `age`, `faceAmount`, `targetPremium`, `paymentAmount`, `paymentCreatedOn`, `userFirstName` (the agent's first name) and `agencyName`. Other fields, such as `applicationStatus` and `rateClass`, cannot be used for sorting.
|
|
3929
|
+
|
|
3930
|
+
For `getProspects()` and `getApplications()`, use the fields and operators returned in the response's `availableFilters`.
|
|
3889
3931
|
|
|
3890
3932
|
|
|
3891
3933
|
***
|
|
@@ -3898,7 +3940,54 @@ All three methods accept `AgentPortalReq`.
|
|
|
3898
3940
|
| `getSales()` | `{ applicationCount: number, salesReport: ThirdPartySalesReport[], totalPremiumAmount: number }` |
|
|
3899
3941
|
| `getApplications()` | `{ applicationCount: number, applications: ThirdPartyApplicationsReport[] }` |
|
|
3900
3942
|
|
|
3901
|
-
> `applicationStatus` format: `"{Status} {RateClass}: {Assessment Factor}"
|
|
3943
|
+
> **`getApplications()`** — `applicationStatus` format: `"{Status} - {RateClass} : {Assessment Factor}"`, e.g. `"InProgress - Preferred : Drug Use"`. The rate class and assessment factor are included only when available. Unlike `getSales()`, `getApplications()` keeps the rate class inside `applicationStatus`.
|
|
3944
|
+
|
|
3945
|
+
|
|
3946
|
+
***
|
|
3947
|
+
|
|
3948
|
+
### `getSales()` sale fields
|
|
3949
|
+
|
|
3950
|
+
> **Changed (backend IBS-185, SDK 2.8.0):** in each `salesReport` item the rate class is **no longer part of `applicationStatus`**. It is returned in the separate `rateClass` field.
|
|
3951
|
+
>
|
|
3952
|
+
> **Migration:** if your integration parses the rate class out of the `getSales()` `applicationStatus`, read `rateClass` instead. If you only display `applicationStatus`, no code change is needed, but the text no longer contains the rate class.
|
|
3953
|
+
|
|
3954
|
+
**`applicationStatus`** — the single current status of the policy: `{Status}`, followed by ` : {Assessment Factor}` (a colon with a space on each side) only when an assessment factor applies.
|
|
3955
|
+
|
|
3956
|
+
| Example | Meaning |
|
|
3957
|
+
|---|---|
|
|
3958
|
+
| `"Approved : Drug Use"` | Status with an assessment factor |
|
|
3959
|
+
| `"Placed (Inforce)"` | Status only (no assessment factor, no separator) |
|
|
3960
|
+
|
|
3961
|
+
- When an **After-Sale status** has been received for the policy, `applicationStatus` returns it: `Submitted`, `Approved`, `Issued`, `Placed (Inforce)`, `Not Taken (Inforce)`, `Declined`, `Closed`, `Terminated`, `Lapsed`.
|
|
3962
|
+
- Otherwise it returns the normal application status (e.g. `Approved`, `Scheduled`), unchanged from before.
|
|
3963
|
+
- `Approved` can come from either source. Treat `applicationStatus` as the single current status and do not assume only `Approved` / `Scheduled` will be returned.
|
|
3964
|
+
- Assessment factors: `Diabetes`, `Health`, `Smoking Cessation Medication`, `ChildRider`, `Weight change`, `Primary Physician`, `Prequalification`, `Beneficiary`, `Other Life Insurance`, `Driving`, `Travel`, `Personal Info`, `Lifestyle`, `Height and Weight`, `Drug Use`, `Medical and/or Lifestyle Factors – 3rd Party + Follow-Ups`, `Employment`, `Medical and/or Lifestyle Factors in 3rd Party Data`, `Medical and/or Lifestyle Factors`.
|
|
3965
|
+
|
|
3966
|
+
Fields on each `ThirdPartySalesReport` added or changed in 2.8.0 (all optional and nullable, response-only):
|
|
3967
|
+
|
|
3968
|
+
| Field | Type | Description |
|
|
3969
|
+
|---|---|---|
|
|
3970
|
+
| `applicationStatus` | `string \| null` | Current status as described above — **without** the rate class. |
|
|
3971
|
+
| `rateClass` | `string \| null` | Rate class of the policy: `Preferred Plus`, `Preferred`, `Standard`, `Standard Extra`, `Guaranteed`, `Rated C`, `Rated D`. `null` when no rate class applies. |
|
|
3972
|
+
| `pivotSourceOpportunityUid` | `string \| null` | Opportunity UID of the first application in a Pivot chain. For Term → Pure Term → Accidental Death Benefit, the ADB sale carries the Term application's UID. `null` when the sale was not pivoted. |
|
|
3973
|
+
| `pivotedFrom` | `string \| null` | Title of the product this application was pivoted from, e.g. `InstaBrain Final Expense`. `null` when not pivoted. |
|
|
3974
|
+
| `pivotReason` | `string \| null` | Why the source application was declined, which started the Pivot flow. `null` when not pivoted. |
|
|
3975
|
+
| `paymentEffectiveDate` | `string \| null` | Effective date of the policy, date only (`yyyy-MM-dd`). `null` when not available. |
|
|
3976
|
+
|
|
3977
|
+
Sorting by `applicationStatus` or `rateClass` is not supported. To list sales of given rate classes, filter on `rateClass` with `IN` — see [`getSales()` filter and sort fields](#getsales-filter-and-sort-fields).
|
|
3978
|
+
|
|
3979
|
+
```typescript
|
|
3980
|
+
const sales = await client.getSales({ dayCount: 30, pageIndex: 1, pageSize: 20 });
|
|
3981
|
+
|
|
3982
|
+
for (const sale of sales.salesReport ?? []) {
|
|
3983
|
+
console.log(sale.policyNumber, sale.applicationStatus, sale.rateClass);
|
|
3984
|
+
// e.g. "IB0000123456" "Approved : Drug Use" "Standard"
|
|
3985
|
+
|
|
3986
|
+
if (sale.pivotedFrom) {
|
|
3987
|
+
console.log(`Pivoted from ${sale.pivotedFrom} (${sale.pivotReason})`);
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
```
|
|
3902
3991
|
|
|
3903
3992
|
---
|
|
3904
3993
|
|
|
@@ -72,6 +72,10 @@ export declare class InstaBrainClient {
|
|
|
72
72
|
getProspects(request: AgentPortalReq): Promise<ThirdPartyProspectsResp>;
|
|
73
73
|
/**
|
|
74
74
|
* Get sales data - completed/sold policies
|
|
75
|
+
*
|
|
76
|
+
* Each sale returns the rate class in its own `rateClass` field; `applicationStatus`
|
|
77
|
+
* holds only the current status (After-Sale status when received) and, when one
|
|
78
|
+
* applies, ` : {Assessment Factor}` - e.g. `"Approved : Drug Use"`.
|
|
75
79
|
* @param request - The agent portal request with filters, pagination, etc.
|
|
76
80
|
* @returns Promise with sales data including total premium amount
|
|
77
81
|
*/
|
|
@@ -91,6 +91,10 @@ class InstaBrainClient {
|
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Get sales data - completed/sold policies
|
|
94
|
+
*
|
|
95
|
+
* Each sale returns the rate class in its own `rateClass` field; `applicationStatus`
|
|
96
|
+
* holds only the current status (After-Sale status when received) and, when one
|
|
97
|
+
* applies, ` : {Assessment Factor}` - e.g. `"Approved : Drug Use"`.
|
|
94
98
|
* @param request - The agent portal request with filters, pagination, etc.
|
|
95
99
|
* @returns Promise with sales data including total premium amount
|
|
96
100
|
*/
|
|
@@ -33,6 +33,9 @@ export declare class ReportsService extends BaseService {
|
|
|
33
33
|
* - Total premium amount calculation
|
|
34
34
|
* - Available filters metadata
|
|
35
35
|
*
|
|
36
|
+
* Each sale carries the rate class in `rateClass`; `applicationStatus` no longer
|
|
37
|
+
* includes it (format: `{Status}` or `{Status} : {Assessment Factor}`).
|
|
38
|
+
*
|
|
36
39
|
* @param request - The agent portal request with filters, pagination, etc.
|
|
37
40
|
* @returns Promise with sales data including total premium amount
|
|
38
41
|
*/
|
|
@@ -38,6 +38,9 @@ class ReportsService extends base_service_1.BaseService {
|
|
|
38
38
|
* - Total premium amount calculation
|
|
39
39
|
* - Available filters metadata
|
|
40
40
|
*
|
|
41
|
+
* Each sale carries the rate class in `rateClass`; `applicationStatus` no longer
|
|
42
|
+
* includes it (format: `{Status}` or `{Status} : {Assessment Factor}`).
|
|
43
|
+
*
|
|
41
44
|
* @param request - The agent portal request with filters, pagination, etc.
|
|
42
45
|
* @returns Promise with sales data including total premium amount
|
|
43
46
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -39,13 +39,6 @@ export interface BaseResponse<T> {
|
|
|
39
39
|
error: string | null;
|
|
40
40
|
errorCode?: string;
|
|
41
41
|
}
|
|
42
|
-
export interface AgentPortalReq {
|
|
43
|
-
startDate?: string;
|
|
44
|
-
endDate?: string;
|
|
45
|
-
dayCount?: number;
|
|
46
|
-
pageSize: number;
|
|
47
|
-
pageIndex: number;
|
|
48
|
-
}
|
|
49
42
|
export interface ThirdPartyQuoterCategory {
|
|
50
43
|
categoryId: string;
|
|
51
44
|
categoryType: string | null;
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
import { RidersList, QuoteParts } from './quote.types';
|
|
2
|
+
/**
|
|
3
|
+
* Filter operators accepted by the reporting APIs (`filters[].operator`), as strings.
|
|
4
|
+
* Use a member (`ReportFilterOperator.In`) or the literal (`'IN'`).
|
|
5
|
+
*
|
|
6
|
+
* | Member | Value | Value format in `filters[].value` |
|
|
7
|
+
* |---|---|---|
|
|
8
|
+
* | `Equal` | `'eq'` | a single value |
|
|
9
|
+
* | `GreaterThan` / `GreaterThanOrEqual` / `LessThan` / `LessThanOrEqual` | `'gt'` / `'gte'` / `'lt'` / `'lte'` | a single number |
|
|
10
|
+
* | `Like` | `'like'` | text the field contains |
|
|
11
|
+
* | `In` | `'IN'` | comma-separated values, e.g. `"Preferred, Standard"` |
|
|
12
|
+
* | `Between` | `'between'` | two comma-separated dates, e.g. `"2026-11-01, 2026-11-03"` |
|
|
13
|
+
*/
|
|
14
|
+
export declare const ReportFilterOperator: {
|
|
15
|
+
readonly Equal: "eq";
|
|
16
|
+
readonly GreaterThan: "gt";
|
|
17
|
+
readonly GreaterThanOrEqual: "gte";
|
|
18
|
+
readonly LessThan: "lt";
|
|
19
|
+
readonly LessThanOrEqual: "lte";
|
|
20
|
+
readonly Like: "like";
|
|
21
|
+
readonly In: "IN";
|
|
22
|
+
readonly Between: "between";
|
|
23
|
+
};
|
|
24
|
+
/** One of the string filter operators listed on {@link ReportFilterOperator}. */
|
|
25
|
+
export type ReportFilterOperator = typeof ReportFilterOperator[keyof typeof ReportFilterOperator];
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated The reporting APIs take **string** operators — use {@link ReportFilterOperator}
|
|
28
|
+
* (`ReportFilterOperator.In` / `'IN'`). These numeric values do not match the API: a filter
|
|
29
|
+
* sent with `SQLOperator.In` (`9`) is answered with HTTP 500. Kept only so existing code
|
|
30
|
+
* still compiles; it will be removed in the next major version.
|
|
31
|
+
*/
|
|
2
32
|
export declare enum SQLOperator {
|
|
3
33
|
Equal = 0,
|
|
4
34
|
NotEqual = 1,
|
|
@@ -13,37 +43,42 @@ export declare enum SQLOperator {
|
|
|
13
43
|
NotIn = 10
|
|
14
44
|
}
|
|
15
45
|
export interface AgentPortalReqSorting {
|
|
16
|
-
/** Field name to sort by */
|
|
46
|
+
/** Field name to sort by (not case sensitive); see each endpoint's supported sort fields */
|
|
17
47
|
value: string | null;
|
|
18
48
|
/** Whether to sort in descending order */
|
|
19
49
|
sortDescending: boolean;
|
|
20
50
|
}
|
|
21
51
|
export interface AgentPortalReqFilters {
|
|
22
|
-
/**
|
|
52
|
+
/** Value to compare with, always a string; its format depends on the operator */
|
|
23
53
|
value: string | null;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Filter operator. The API takes and returns strings ({@link ReportFilterOperator}).
|
|
56
|
+
* The numeric {@link SQLOperator} is still accepted by the type for backward
|
|
57
|
+
* compatibility only — the API rejects it.
|
|
58
|
+
*/
|
|
59
|
+
operator: ReportFilterOperator | SQLOperator;
|
|
60
|
+
/** Field name to filter on, written exactly as documented for the endpoint */
|
|
27
61
|
field: string | null;
|
|
28
62
|
}
|
|
63
|
+
/** Request body shared by getProspects(), getSales() and getApplications() */
|
|
29
64
|
export interface AgentPortalReq {
|
|
30
|
-
/** Start
|
|
31
|
-
startDate?: string
|
|
32
|
-
/** End
|
|
33
|
-
endDate?: string
|
|
34
|
-
/**
|
|
65
|
+
/** Start of the date range, ISO 8601; send together with endDate */
|
|
66
|
+
startDate?: string;
|
|
67
|
+
/** End of the date range, ISO 8601; send together with startDate */
|
|
68
|
+
endDate?: string;
|
|
69
|
+
/** Number of days before today to fetch (alternative to startDate/endDate) */
|
|
70
|
+
dayCount?: number;
|
|
71
|
+
/** Number of items per page; must be greater than 0 */
|
|
72
|
+
pageSize: number;
|
|
73
|
+
/** Page to retrieve; the first page is 1 (0 is rejected) */
|
|
74
|
+
pageIndex: number;
|
|
75
|
+
/** IANA time zone the dates are read in, e.g. `"America/New_York"`; defaults to UTC */
|
|
35
76
|
userTimeZone?: string | null;
|
|
36
|
-
/** Number of days to fetch (alternative to start/end date) */
|
|
37
|
-
dayCount?: number | null;
|
|
38
|
-
/** Number of items per page */
|
|
39
|
-
pageSize?: number | null;
|
|
40
|
-
/** Page index (0-based) */
|
|
41
|
-
pageIndex?: number | null;
|
|
42
77
|
/** Sorting configuration */
|
|
43
78
|
sort?: AgentPortalReqSorting | null;
|
|
44
|
-
/**
|
|
79
|
+
/** Filters to apply, combined with AND */
|
|
45
80
|
filters?: AgentPortalReqFilters[] | null;
|
|
46
|
-
/**
|
|
81
|
+
/** Text search to refine results */
|
|
47
82
|
searchParam?: string | null;
|
|
48
83
|
}
|
|
49
84
|
export interface HierarchyData {
|
|
@@ -118,8 +153,33 @@ export interface ThirdPartySalesReport {
|
|
|
118
153
|
targetPremium?: number | null;
|
|
119
154
|
riders?: RidersList[] | null;
|
|
120
155
|
agentHierarchy?: HierarchyData[] | null;
|
|
156
|
+
/**
|
|
157
|
+
* The single current status of the policy: `{Status}`, followed by ` : {Assessment Factor}`
|
|
158
|
+
* only when an assessment factor applies, e.g. `"Approved : Drug Use"` or `"Placed (Inforce)"`.
|
|
159
|
+
* Does NOT contain the rate class (read {@link ThirdPartySalesReport.rateClass}).
|
|
160
|
+
* When an After-Sale status has been received it is one of `Submitted`, `Approved`, `Issued`,
|
|
161
|
+
* `Placed (Inforce)`, `Not Taken (Inforce)`, `Declined`, `Closed`, `Terminated`, `Lapsed`;
|
|
162
|
+
* otherwise it is the normal application status (e.g. `Approved`, `Scheduled`).
|
|
163
|
+
*/
|
|
121
164
|
applicationStatus?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Rate class of the policy, returned on its own: `Preferred Plus`, `Preferred`, `Standard`,
|
|
167
|
+
* `Standard Extra`, `Guaranteed`, `Rated C` or `Rated D`. `null` when no rate class applies.
|
|
168
|
+
* Response-only; filter on it with the `rateClass` filter field.
|
|
169
|
+
*/
|
|
170
|
+
rateClass?: string | null;
|
|
122
171
|
paymentMethod?: string | null;
|
|
172
|
+
/**
|
|
173
|
+
* Opportunity UID of the first application in a Pivot chain (e.g. Term => Pure Term => ADB:
|
|
174
|
+
* the ADB sale carries the Term application's UID). `null` when the sale was not pivoted.
|
|
175
|
+
*/
|
|
176
|
+
pivotSourceOpportunityUid?: string | null;
|
|
177
|
+
/** Title of the product this application was pivoted from, e.g. `InstaBrain Final Expense`. `null` when not pivoted. */
|
|
178
|
+
pivotedFrom?: string | null;
|
|
179
|
+
/** Why the source application was declined, which started the Pivot flow. `null` when not pivoted. */
|
|
180
|
+
pivotReason?: string | null;
|
|
181
|
+
/** Effective date of the policy, date only (`yyyy-MM-dd`). `null` when not available. */
|
|
182
|
+
paymentEffectiveDate?: string | null;
|
|
123
183
|
}
|
|
124
184
|
export interface ThirdPartySalesReportRes {
|
|
125
185
|
applicationCount: number;
|
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SQLOperator = void 0;
|
|
4
|
-
|
|
3
|
+
exports.SQLOperator = exports.ReportFilterOperator = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Filter operators accepted by the reporting APIs (`filters[].operator`), as strings.
|
|
6
|
+
* Use a member (`ReportFilterOperator.In`) or the literal (`'IN'`).
|
|
7
|
+
*
|
|
8
|
+
* | Member | Value | Value format in `filters[].value` |
|
|
9
|
+
* |---|---|---|
|
|
10
|
+
* | `Equal` | `'eq'` | a single value |
|
|
11
|
+
* | `GreaterThan` / `GreaterThanOrEqual` / `LessThan` / `LessThanOrEqual` | `'gt'` / `'gte'` / `'lt'` / `'lte'` | a single number |
|
|
12
|
+
* | `Like` | `'like'` | text the field contains |
|
|
13
|
+
* | `In` | `'IN'` | comma-separated values, e.g. `"Preferred, Standard"` |
|
|
14
|
+
* | `Between` | `'between'` | two comma-separated dates, e.g. `"2026-11-01, 2026-11-03"` |
|
|
15
|
+
*/
|
|
16
|
+
exports.ReportFilterOperator = {
|
|
17
|
+
Equal: 'eq',
|
|
18
|
+
GreaterThan: 'gt',
|
|
19
|
+
GreaterThanOrEqual: 'gte',
|
|
20
|
+
LessThan: 'lt',
|
|
21
|
+
LessThanOrEqual: 'lte',
|
|
22
|
+
Like: 'like',
|
|
23
|
+
In: 'IN',
|
|
24
|
+
Between: 'between',
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated The reporting APIs take **string** operators — use {@link ReportFilterOperator}
|
|
28
|
+
* (`ReportFilterOperator.In` / `'IN'`). These numeric values do not match the API: a filter
|
|
29
|
+
* sent with `SQLOperator.In` (`9`) is answered with HTTP 500. Kept only so existing code
|
|
30
|
+
* still compiles; it will be removed in the next major version.
|
|
31
|
+
*/
|
|
5
32
|
var SQLOperator;
|
|
6
33
|
(function (SQLOperator) {
|
|
7
34
|
SQLOperator[SQLOperator["Equal"] = 0] = "Equal";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instabrain-sdks/api-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Official Node.js SDK for InstaBrain APIs - Insurance quotes and application processing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"node": ">=14.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"axios": "^1.
|
|
46
|
+
"axios": "^1.21.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "^10.0.1",
|