@instabrain-sdks/api-client 2.3.2 → 2.4.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 +773 -17
- package/dist/client/instabrain-client.d.ts +81 -3
- package/dist/client/instabrain-client.js +96 -2
- package/dist/services/application.service.d.ts +14 -3
- package/dist/services/application.service.js +15 -4
- package/dist/services/finalexpense.service.d.ts +129 -0
- package/dist/services/finalexpense.service.js +210 -0
- package/dist/services/pureterm.service.d.ts +31 -0
- package/dist/services/pureterm.service.js +36 -0
- package/dist/types/application.types.d.ts +15 -0
- package/dist/types/application.types.js +1 -0
- package/dist/types/enums.d.ts +11 -1
- package/dist/types/enums.js +15 -3
- package/dist/types/errors.js +1 -0
- package/dist/types/finalexpense.types.d.ts +459 -0
- package/dist/types/finalexpense.types.js +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/pureterm.types.d.ts +59 -0
- package/dist/types/pureterm.types.js +2 -0
- package/dist/types/secure-sign.types.d.ts +25 -3
- package/package.json +1 -1
package/dist/types/index.js
CHANGED
|
@@ -26,4 +26,6 @@ __exportStar(require("./beneficiary.types"), exports);
|
|
|
26
26
|
__exportStar(require("./gigdb.types"), exports);
|
|
27
27
|
__exportStar(require("./adb.types"), exports);
|
|
28
28
|
__exportStar(require("./ibterm.types"), exports);
|
|
29
|
+
__exportStar(require("./pureterm.types"), exports);
|
|
30
|
+
__exportStar(require("./finalexpense.types"), exports);
|
|
29
31
|
__exportStar(require("./secure-sign.types"), exports);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Gender, PaymentFrequency, PureTermRateClass, HealthClass } from './enums';
|
|
2
|
+
import { ThirdPartyQuoteReqHeight, ThirdPartyQuoteReqRider } from './quote.types';
|
|
3
|
+
/**
|
|
4
|
+
* Request body for `POST /api/ThirdPartyIbPureTermQuote/get`.
|
|
5
|
+
*
|
|
6
|
+
* Source of truth: ThirdPartyTermQuoteRequest.cs (InstaPureTerm product).
|
|
7
|
+
*
|
|
8
|
+
* **Validation rules (enforced server-side):**
|
|
9
|
+
* - `benefitPeriod` is required.
|
|
10
|
+
* - **One rating input group is required** — supply ONE of:
|
|
11
|
+
* (a) `rateClass`, OR
|
|
12
|
+
* (b) `healthClass`, OR
|
|
13
|
+
* (c) `height` + `weightInLbs` (both together).
|
|
14
|
+
* - `age` OR `dateOfBirth` required; resolved age must be 18–60. When both
|
|
15
|
+
* are provided, `dateOfBirth` takes priority.
|
|
16
|
+
* - `stateCode` required.
|
|
17
|
+
*/
|
|
18
|
+
export interface ThirdPartyPureTermQuoteReq {
|
|
19
|
+
/**
|
|
20
|
+
* Coverage amount in dollars.
|
|
21
|
+
* Age-based limits apply — same schedule as IB Term.
|
|
22
|
+
*/
|
|
23
|
+
faceAmount?: number | null;
|
|
24
|
+
/** Term length in years. **Required.** Available: 10, 20, 30 (state/age/tobacco dependent). */
|
|
25
|
+
benefitPeriod?: number | null;
|
|
26
|
+
/** Whether the applicant uses tobacco or nicotine. */
|
|
27
|
+
flagTobaccoUse: boolean;
|
|
28
|
+
/** Applicant gender. */
|
|
29
|
+
gender?: Gender | null;
|
|
30
|
+
/** 2-letter US state code. Required. */
|
|
31
|
+
stateCode?: string | null;
|
|
32
|
+
/** Rate class — one of the three rating groups (†). */
|
|
33
|
+
rateClass?: PureTermRateClass | null;
|
|
34
|
+
/** Health class — one of the three rating groups (†). */
|
|
35
|
+
healthClass?: HealthClass | null;
|
|
36
|
+
/**
|
|
37
|
+
* Applicant height. Required together with `weightInLbs` when using the
|
|
38
|
+
* height/weight rating path. Omit when rating via `rateClass` or `healthClass`.
|
|
39
|
+
*/
|
|
40
|
+
height?: ThirdPartyQuoteReqHeight | null;
|
|
41
|
+
/** Applicant weight in lbs. Required together with `height`. */
|
|
42
|
+
weightInLbs?: number | null;
|
|
43
|
+
/** Applicant age (18–60). Provide `age` OR `dateOfBirth`. */
|
|
44
|
+
age?: number | null;
|
|
45
|
+
/** Applicant date of birth (ISO 8601). Takes priority over `age` when both are provided. */
|
|
46
|
+
dateOfBirth?: string | null;
|
|
47
|
+
/** Riders to include. Use `riderCode` values returned by the rider lookup endpoint. */
|
|
48
|
+
riders?: ThirdPartyQuoteReqRider[] | null;
|
|
49
|
+
/** Payment frequency. */
|
|
50
|
+
paymentFreq?: PaymentFrequency | null;
|
|
51
|
+
/** First name — alphabetic only. Lead capture. */
|
|
52
|
+
firstName?: string | null;
|
|
53
|
+
/** Last name — alphabetic only. Lead capture. */
|
|
54
|
+
lastName?: string | null;
|
|
55
|
+
/** Email address. Lead capture. */
|
|
56
|
+
email?: string | null;
|
|
57
|
+
/** Phone number — 10-digit local or E.164 format. Lead capture. */
|
|
58
|
+
phoneNum?: string | null;
|
|
59
|
+
}
|
|
@@ -71,11 +71,33 @@ export interface ThirdPartyVerifyPinResp {
|
|
|
71
71
|
/** true when the PIN matched and documents are now signed */
|
|
72
72
|
isVerified: boolean;
|
|
73
73
|
}
|
|
74
|
+
import { FinalSubmitApplicationStatus } from './finalexpense.types';
|
|
74
75
|
/**
|
|
75
|
-
* Response from final application submit
|
|
76
|
-
*
|
|
76
|
+
* Response from final application submit.
|
|
77
|
+
*
|
|
78
|
+
* Behavior differs by product:
|
|
79
|
+
* - **Synchronous (ADB, GIGDB):** a successful (`flagStatus: true`) response
|
|
80
|
+
* **guarantees a non-null `policyNumber`**, and `applicationStatus` is absent
|
|
81
|
+
* from the JSON.
|
|
82
|
+
* - **Asynchronous (Final Expense):** `policyNumber` is `null` on the first call
|
|
83
|
+
* and `applicationStatus` is `'InProgress'`. Poll
|
|
84
|
+
* `pollFinalExpenseUnderwritingStatus()` for the terminal decision; the
|
|
85
|
+
* `policyNumber` is issued there once the status is `'Approved'`.
|
|
86
|
+
*
|
|
87
|
+
* Note: a `null` policyNumber is only expected for Final Expense (pending async
|
|
88
|
+
* underwriting) — it is NOT an error.
|
|
77
89
|
*/
|
|
78
90
|
export interface ThirdPartyFinalSubmitResp {
|
|
79
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* The policy number issued by the carrier. **Non-null** for ADB/GIGDB on a
|
|
93
|
+
* successful submit. `null` only for Final Expense on the async first call
|
|
94
|
+
* (the number is issued later via `pollFinalExpenseUnderwritingStatus()`).
|
|
95
|
+
*/
|
|
80
96
|
policyNumber: string | null;
|
|
97
|
+
/**
|
|
98
|
+
* Present only for asynchronous-underwriting products (Final Expense), where
|
|
99
|
+
* it is `'InProgress'` on the first call. Absent for ADB/GIGDB. When
|
|
100
|
+
* `'InProgress'`, call `pollFinalExpenseUnderwritingStatus()`.
|
|
101
|
+
*/
|
|
102
|
+
applicationStatus?: FinalSubmitApplicationStatus;
|
|
81
103
|
}
|
package/package.json
CHANGED