@instabrain-sdks/api-client 1.0.0 → 2.0.1
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 +237 -22
- package/dist/client/instabrain-client.d.ts +73 -1
- package/dist/client/instabrain-client.d.ts.map +1 -1
- package/dist/client/instabrain-client.js +94 -0
- package/dist/client/instabrain-client.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -11
- package/dist/index.js.map +1 -1
- package/dist/services/application.service.d.ts +10 -2
- package/dist/services/application.service.d.ts.map +1 -1
- package/dist/services/application.service.js +36 -0
- package/dist/services/application.service.js.map +1 -1
- package/dist/services/auth.service.d.ts +1 -1
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/gigdb.service.d.ts +44 -0
- package/dist/services/gigdb.service.d.ts.map +1 -0
- package/dist/services/gigdb.service.js +182 -0
- package/dist/services/gigdb.service.js.map +1 -0
- package/dist/services/quote.service.d.ts +1 -7
- package/dist/services/quote.service.d.ts.map +1 -1
- package/dist/services/quote.service.js +2 -33
- package/dist/services/quote.service.js.map +1 -1
- package/dist/services/reports.service.d.ts +1 -7
- package/dist/services/reports.service.d.ts.map +1 -1
- package/dist/services/reports.service.js +4 -41
- package/dist/services/reports.service.js.map +1 -1
- package/dist/services/secure-sign.service.d.ts +48 -0
- package/dist/services/secure-sign.service.d.ts.map +1 -0
- package/dist/services/secure-sign.service.js +161 -0
- package/dist/services/secure-sign.service.js.map +1 -0
- package/dist/types/application.types.d.ts +4 -0
- package/dist/types/application.types.d.ts.map +1 -1
- package/dist/types/enums.d.ts +23 -1
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +25 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +26 -1
- package/dist/types/errors.js.map +1 -1
- package/dist/types/gigdb.types.d.ts +98 -0
- package/dist/types/gigdb.types.d.ts.map +1 -0
- package/dist/types/gigdb.types.js +3 -0
- package/dist/types/gigdb.types.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/secure-sign.types.d.ts +82 -0
- package/dist/types/secure-sign.types.d.ts.map +1 -0
- package/dist/types/secure-sign.types.js +5 -0
- package/dist/types/secure-sign.types.js.map +1 -0
- package/dist/utils/error-utils.d.ts +13 -0
- package/dist/utils/error-utils.d.ts.map +1 -0
- package/dist/utils/error-utils.js +31 -0
- package/dist/utils/error-utils.js.map +1 -0
- package/package.json +55 -51
package/README.md
CHANGED
|
@@ -14,14 +14,20 @@ npm install @instabrain-sdks/api-client
|
|
|
14
14
|
## Quick Start
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
|
-
import { InstaBrainClient,
|
|
18
|
-
Gender,
|
|
19
|
-
PaymentFrequency,
|
|
20
|
-
RateClass,
|
|
21
|
-
HealthClass,
|
|
22
|
-
ThirdPartyQuoteReq,
|
|
17
|
+
import { InstaBrainClient,
|
|
18
|
+
Gender,
|
|
19
|
+
PaymentFrequency,
|
|
20
|
+
RateClass,
|
|
21
|
+
HealthClass,
|
|
22
|
+
ThirdPartyQuoteReq,
|
|
23
23
|
ThirdPartyStartApplicationReq,
|
|
24
|
-
|
|
24
|
+
ThirdPartyGigdbQuoteRequest,
|
|
25
|
+
ThirdPartyGigdbUpdateQuoteReq,
|
|
26
|
+
ThirdPartyGigdbAppReq,
|
|
27
|
+
ThirdPartyEftPaymentReq,
|
|
28
|
+
ThirdPartySendPinReq,
|
|
29
|
+
ThirdPartyVerifyPinReq,
|
|
30
|
+
AgentPortalReq }
|
|
25
31
|
from '@instabrain-sdks/api-client';
|
|
26
32
|
|
|
27
33
|
// Create a client instance
|
|
@@ -52,6 +58,38 @@ console.log(`Dashboard Summary:`);
|
|
|
52
58
|
console.log(`- Prospects: ${prospects.prospectCount}`);
|
|
53
59
|
console.log(`- Sales: ${sales.applicationCount} ($${sales.totalPremiumAmount})`);
|
|
54
60
|
console.log(`- Applications: ${applications.applicationCount}`);
|
|
61
|
+
|
|
62
|
+
// GIGDB Product (Guaranteed Issue — ages 50-85, $5k-$25k)
|
|
63
|
+
const gigdbQuote = await client.getGigdbQuote(gigdbQuoteReq);
|
|
64
|
+
const gigdbApp = await client.startGigdbApplication(gigdbAppReq);
|
|
65
|
+
const eftPayment = await client.saveEftPayment(eftPaymentReq);
|
|
66
|
+
|
|
67
|
+
// Update GIGDB quote (change face amount or payment frequency)
|
|
68
|
+
const updatedQuote = await client.updateGigdbQuote({
|
|
69
|
+
opportunityId: gigdbApp.opportunityId,
|
|
70
|
+
faceAmount: 20000,
|
|
71
|
+
paymentFreq: PaymentFrequency.Annual
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Get existing GIGDB quote (when isQuoteChanged=true)
|
|
75
|
+
const existingQuote = await client.getExistingGigdbQuote(gigdbApp.opportunityId);
|
|
76
|
+
|
|
77
|
+
// Secure Sign flow (shared across all products)
|
|
78
|
+
const docs = await client.prepareDocsAndGetDeliveryChannels(gigdbApp.opportunityId);
|
|
79
|
+
if (!docs.isSignCompleted) {
|
|
80
|
+
const pin = await client.sendPinAndGetDocumentsLink({
|
|
81
|
+
opportunityId: gigdbApp.opportunityId,
|
|
82
|
+
flagSendSms: docs.isSmsAvailable,
|
|
83
|
+
flagSendEmail: docs.isEmailAvailable
|
|
84
|
+
});
|
|
85
|
+
await client.verifyPin({
|
|
86
|
+
opportunityId: gigdbApp.opportunityId,
|
|
87
|
+
pin: '123456',
|
|
88
|
+
isScriptReadConfirmed: true
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const result = await client.finalSubmit(gigdbApp.opportunityId);
|
|
92
|
+
console.log('Policy Number:', result.policyNumber || 'pending');
|
|
55
93
|
```
|
|
56
94
|
|
|
57
95
|
## Features
|
|
@@ -62,6 +100,9 @@ console.log(`- Applications: ${applications.applicationCount}`);
|
|
|
62
100
|
- ✅ **Error Handling** - Comprehensive error handling with custom error types
|
|
63
101
|
- ✅ **Request Validation** - Built-in validation for API requests
|
|
64
102
|
- ✅ **Comprehensive Testing** - Well-tested with Jest
|
|
103
|
+
- ✅ **GIGDB Product Support** - Guaranteed Issue quotes, applications, and EFT payments
|
|
104
|
+
- ✅ **GIGDB Quote Management** - Update quotes and get existing quotes for GIGDB opportunities
|
|
105
|
+
- ✅ **Secure Sign & Final Submit** - Document signing flow and carrier submission (shared across all products)
|
|
65
106
|
- ✅ **Modern Promise API** - Uses async/await patterns
|
|
66
107
|
|
|
67
108
|
## API Reference
|
|
@@ -76,11 +117,11 @@ Authenticate with the InstaBrain API and obtain a JWT token.
|
|
|
76
117
|
const jwtToken = await client.authenticate(12345, 'uuid-access-token');
|
|
77
118
|
```
|
|
78
119
|
|
|
79
|
-
###
|
|
120
|
+
### IB Term Quote Flow
|
|
80
121
|
|
|
81
122
|
#### `getQuote(request: ThirdPartyQuoteReq): Promise<ThirdPartyQuoteResp>`
|
|
82
123
|
|
|
83
|
-
Get an insurance quote based on the provided parameters.
|
|
124
|
+
Get an IB Term insurance quote based on the provided parameters.
|
|
84
125
|
|
|
85
126
|
```typescript
|
|
86
127
|
const quoteReq : ThirdPartyQuoteReq = {
|
|
@@ -104,11 +145,9 @@ const quoteReq : ThirdPartyQuoteReq = {
|
|
|
104
145
|
const quote = await client.getQuote(quoteReq);
|
|
105
146
|
```
|
|
106
147
|
|
|
107
|
-
### Applications
|
|
108
|
-
|
|
109
148
|
#### `startApplication(request: ThirdPartyStartApplicationReq): Promise<ThirdPartyStartAppResp>`
|
|
110
149
|
|
|
111
|
-
Start an insurance application from a quote.
|
|
150
|
+
Start an IB Term insurance application from a quote.
|
|
112
151
|
|
|
113
152
|
```typescript
|
|
114
153
|
const startApplicationReq : ThirdPartyStartApplicationReq = {
|
|
@@ -125,6 +164,176 @@ console.log('Agent Link:', application.agentLink);
|
|
|
125
164
|
console.log('Applicant Link:', application.applicantLink);
|
|
126
165
|
```
|
|
127
166
|
|
|
167
|
+
### GIGDB (Guaranteed Issue)
|
|
168
|
+
|
|
169
|
+
#### `getGigdbQuote(request: ThirdPartyGigdbQuoteRequest): Promise<ThirdPartyQuoteResp>`
|
|
170
|
+
|
|
171
|
+
Get a Guaranteed Issue quote (ages 50-85, face amount $5k-$25k).
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
const gigdbQuoteReq: ThirdPartyGigdbQuoteRequest = {
|
|
175
|
+
faceAmount: 15000,
|
|
176
|
+
gender: Gender.Female,
|
|
177
|
+
stateCode: 'TX',
|
|
178
|
+
age: 65,
|
|
179
|
+
dateOfBirth: '1961-01-15',
|
|
180
|
+
paymentFreq: PaymentFrequency.Monthly,
|
|
181
|
+
firstName: 'Jane',
|
|
182
|
+
lastName: 'Smith',
|
|
183
|
+
email: 'jane.smith@example.com',
|
|
184
|
+
phoneNum: '555-0123',
|
|
185
|
+
isSmoker: false
|
|
186
|
+
};
|
|
187
|
+
const quote = await client.getGigdbQuote(gigdbQuoteReq);
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### `startGigdbApplication(request: ThirdPartyGigdbAppReq): Promise<ThirdPartyStartAppResp>`
|
|
191
|
+
|
|
192
|
+
Start a GIGDB application. Note: `isDeclined: true` is a valid response (knockout), not an error.
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const gigdbAppReq: ThirdPartyGigdbAppReq = {
|
|
196
|
+
quoteResponseId: quote.selectedQuote.quoteResponseId,
|
|
197
|
+
firstName: 'Jane',
|
|
198
|
+
lastName: 'Smith',
|
|
199
|
+
email: 'jane.smith@example.com',
|
|
200
|
+
phoneNumber: '555-0123',
|
|
201
|
+
isUsCitizen: true,
|
|
202
|
+
isPayerAlsoOwnerAndInsured: true,
|
|
203
|
+
isSmoker: false,
|
|
204
|
+
dateOfBirth: '1961-01-15',
|
|
205
|
+
socialSecurityNumber: '123456789',
|
|
206
|
+
address: {
|
|
207
|
+
addressLine1: '123 Main St',
|
|
208
|
+
city: 'Dallas',
|
|
209
|
+
state: 'TX',
|
|
210
|
+
zipcode: '75001'
|
|
211
|
+
},
|
|
212
|
+
birthJurisdiction: {
|
|
213
|
+
country: 'US',
|
|
214
|
+
state: 'TX'
|
|
215
|
+
},
|
|
216
|
+
hasExistingCoverage: false,
|
|
217
|
+
existingCoverageData: null,
|
|
218
|
+
willOtherCoverageBeReplacedOrFinanced: null,
|
|
219
|
+
beneficiaryDetails: {
|
|
220
|
+
beneficiaryType: 'Person',
|
|
221
|
+
beneficiaryPerson: {
|
|
222
|
+
firstName: 'John',
|
|
223
|
+
lastName: 'Smith',
|
|
224
|
+
relationship: 'Spouse'
|
|
225
|
+
},
|
|
226
|
+
namedEntity: null
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
const app = await client.startGigdbApplication(gigdbAppReq);
|
|
230
|
+
console.log('Opportunity ID:', app.opportunityId);
|
|
231
|
+
console.log('Declined:', app.isDeclined);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### `updateGigdbQuote(request: ThirdPartyGigdbUpdateQuoteReq): Promise<ThirdPartyQuoteResp>`
|
|
235
|
+
|
|
236
|
+
Update a GIGDB quote with a different face amount or payment frequency.
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
const updateReq: ThirdPartyGigdbUpdateQuoteReq = {
|
|
240
|
+
opportunityId: app.opportunityId,
|
|
241
|
+
faceAmount: 20000,
|
|
242
|
+
paymentFreq: PaymentFrequency.Annual
|
|
243
|
+
};
|
|
244
|
+
const updatedQuote = await client.updateGigdbQuote(updateReq);
|
|
245
|
+
console.log('Updated face amount:', updatedQuote.selectedQuote.faceAmount);
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
#### `getExistingGigdbQuote(opportunityId: string): Promise<ThirdPartyQuoteResp>`
|
|
249
|
+
|
|
250
|
+
Get the existing quote for a GIGDB opportunity. Use when `isQuoteChanged=true` after `startGigdbApplication`.
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
const existingQuote = await client.getExistingGigdbQuote(app.opportunityId);
|
|
254
|
+
console.log('Current quote:', existingQuote.selectedQuote.quoteAmount);
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
#### `saveEftPayment(request: ThirdPartyEftPaymentReq): Promise<boolean>`
|
|
258
|
+
|
|
259
|
+
Returns `true` when payment details saved successfully.
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
const eftReq: ThirdPartyEftPaymentReq = {
|
|
263
|
+
opportunityId: app.opportunityId,
|
|
264
|
+
accountHolderName: 'Jane Smith',
|
|
265
|
+
routingNumber: '021000021',
|
|
266
|
+
accountNumber: '123456789'
|
|
267
|
+
};
|
|
268
|
+
const success = await client.saveEftPayment(eftReq);
|
|
269
|
+
console.log('Payment saved:', success);
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Secure Sign (Document Signing)
|
|
273
|
+
|
|
274
|
+
The signing flow is shared across all products. Call after EFT payment has been saved.
|
|
275
|
+
|
|
276
|
+
#### `prepareDocsAndGetDeliveryChannels(opportunityId: string): Promise<ThirdPartyPrepareDocsResp>`
|
|
277
|
+
|
|
278
|
+
Prepare the signing package and check available delivery channels. If `isSignCompleted` is true, skip directly to `finalSubmit()`.
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
const docs = await client.prepareDocsAndGetDeliveryChannels(app.opportunityId);
|
|
282
|
+
console.log('SMS available:', docs.isSmsAvailable);
|
|
283
|
+
console.log('Already signed:', docs.isSignCompleted);
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
#### `sendPinAndGetDocumentsLink(request: ThirdPartySendPinReq): Promise<ThirdPartySendPinResp>`
|
|
287
|
+
|
|
288
|
+
Send a verification PIN via SMS and/or Email and receive the documents link.
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
const pinResp = await client.sendPinAndGetDocumentsLink({
|
|
292
|
+
opportunityId: app.opportunityId,
|
|
293
|
+
flagSendSms: true,
|
|
294
|
+
flagSendEmail: true
|
|
295
|
+
});
|
|
296
|
+
console.log('Documents link:', pinResp.link);
|
|
297
|
+
console.log('Script to read:', pinResp.script);
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
#### `resendPin(request: ThirdPartyResendPinReq): Promise<ThirdPartyResendPinResp>`
|
|
301
|
+
|
|
302
|
+
Resend the verification PIN if the signer did not receive it.
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
const resendResp = await client.resendPin({
|
|
306
|
+
opportunityId: app.opportunityId,
|
|
307
|
+
flagSendSms: true,
|
|
308
|
+
flagSendEmail: false
|
|
309
|
+
});
|
|
310
|
+
console.log('PIN resent:', resendResp.flagPinSent);
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
#### `verifyPin(request: ThirdPartyVerifyPinReq): Promise<ThirdPartyVerifyPinResp>`
|
|
314
|
+
|
|
315
|
+
Verify the PIN entered by the signer to complete document signing.
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
const verifyResp = await client.verifyPin({
|
|
319
|
+
opportunityId: app.opportunityId,
|
|
320
|
+
pin: '123456',
|
|
321
|
+
isScriptReadConfirmed: true
|
|
322
|
+
});
|
|
323
|
+
console.log('Verified:', verifyResp.isVerified);
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Final Submit
|
|
327
|
+
|
|
328
|
+
#### `finalSubmit(opportunityId: string): Promise<ThirdPartyFinalSubmitResp>`
|
|
329
|
+
|
|
330
|
+
Submit the application to the carrier for a final underwriting decision. Call after the signing flow is complete. Note: `policyNumber: null` means the carrier has not yet issued a number (pending decision) — this is not an error.
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
const result = await client.finalSubmit(app.opportunityId);
|
|
334
|
+
console.log('Policy Number:', result.policyNumber || 'pending carrier decision');
|
|
335
|
+
```
|
|
336
|
+
|
|
128
337
|
### Reports
|
|
129
338
|
|
|
130
339
|
#### `getProspects(request?: AgentPortalReq): Promise<ThirdPartyProspectsResp>`
|
|
@@ -196,16 +405,25 @@ const sandboxClient = InstaBrainClient.forEnvironment('sandbox');
|
|
|
196
405
|
The SDK provides specific error types for different scenarios:
|
|
197
406
|
|
|
198
407
|
```typescript
|
|
199
|
-
import {
|
|
200
|
-
InstaBrainError,
|
|
201
|
-
AuthenticationError,
|
|
202
|
-
ValidationError
|
|
203
|
-
|
|
408
|
+
import {
|
|
409
|
+
InstaBrainError,
|
|
410
|
+
AuthenticationError,
|
|
411
|
+
ValidationError,
|
|
412
|
+
APIValidationError,
|
|
413
|
+
APIErrorCode
|
|
414
|
+
} from '@instabrain-sdks/api-client';
|
|
204
415
|
|
|
205
416
|
try {
|
|
206
417
|
await client.authenticate(userId, accessToken);
|
|
207
418
|
} catch (error) {
|
|
208
|
-
if (error instanceof
|
|
419
|
+
if (error instanceof APIValidationError) {
|
|
420
|
+
// Business-logic error with a specific error code
|
|
421
|
+
console.error('API validation error:', error.errorCode);
|
|
422
|
+
console.error('Friendly message:', error.getUserFriendlyMessage());
|
|
423
|
+
if (error.isErrorType(APIErrorCode.SecureSignPinMismatch)) {
|
|
424
|
+
console.error('PIN did not match — please try again');
|
|
425
|
+
}
|
|
426
|
+
} else if (error instanceof AuthenticationError) {
|
|
209
427
|
console.error('Authentication failed:', error.message);
|
|
210
428
|
} else if (error instanceof ValidationError) {
|
|
211
429
|
console.error('Validation error:', error.message);
|
|
@@ -280,12 +498,9 @@ const currentToken = client.getCurrentToken();
|
|
|
280
498
|
client.logout();
|
|
281
499
|
```
|
|
282
500
|
|
|
283
|
-
### Base URL
|
|
501
|
+
### Base URL
|
|
284
502
|
|
|
285
503
|
```typescript
|
|
286
|
-
// Update base URL dynamically
|
|
287
|
-
client.updateBaseUrl('https://api-staging.instabrain.io');
|
|
288
|
-
|
|
289
504
|
// Get current base URL
|
|
290
505
|
const currentUrl = client.getBaseUrl();
|
|
291
506
|
```
|
|
@@ -2,7 +2,9 @@ import { AuthService } from '../services/auth.service';
|
|
|
2
2
|
import { QuoteService } from '../services/quote.service';
|
|
3
3
|
import { ApplicationService } from '../services/application.service';
|
|
4
4
|
import { ReportsService } from '../services/reports.service';
|
|
5
|
-
import {
|
|
5
|
+
import { GigdbService } from '../services/gigdb.service';
|
|
6
|
+
import { SecureSignService } from '../services/secure-sign.service';
|
|
7
|
+
import { InstaBrainConfig, Environment, ThirdPartyQuoteReq, ThirdPartyQuoteResp, ThirdPartyStartApplicationReq, ThirdPartyStartAppResp, AgentPortalReq, ThirdPartyProspectsResp, ThirdPartySalesReportRes, ThirdPartyApplicationReportRes, ThirdPartyGigdbQuoteRequest, ThirdPartyGigdbUpdateQuoteReq, ThirdPartyGigdbAppReq, ThirdPartyEftPaymentReq, ThirdPartySendPinReq, ThirdPartyResendPinReq, ThirdPartyVerifyPinReq, ThirdPartyPrepareDocsResp, ThirdPartySendPinResp, ThirdPartyResendPinResp, ThirdPartyVerifyPinResp, ThirdPartyFinalSubmitResp } from '../types';
|
|
6
8
|
/**
|
|
7
9
|
* Main InstaBrain SDK client
|
|
8
10
|
*/
|
|
@@ -12,6 +14,8 @@ export declare class InstaBrainClient {
|
|
|
12
14
|
readonly quote: QuoteService;
|
|
13
15
|
readonly application: ApplicationService;
|
|
14
16
|
readonly reports: ReportsService;
|
|
17
|
+
readonly gigdb: GigdbService;
|
|
18
|
+
readonly secureSign: SecureSignService;
|
|
15
19
|
constructor(config?: InstaBrainConfig);
|
|
16
20
|
/**
|
|
17
21
|
* Configure the client for different environments
|
|
@@ -55,6 +59,74 @@ export declare class InstaBrainClient {
|
|
|
55
59
|
* @returns Promise with applications data including status and completion info
|
|
56
60
|
*/
|
|
57
61
|
getApplications(request: AgentPortalReq): Promise<ThirdPartyApplicationReportRes>;
|
|
62
|
+
/**
|
|
63
|
+
* Get a GIGDB insurance quote (ages 50-85, $5k-$25k)
|
|
64
|
+
* @param request - The GIGDB quote request parameters
|
|
65
|
+
* @returns Promise with the quote response
|
|
66
|
+
*/
|
|
67
|
+
getGigdbQuote(request: ThirdPartyGigdbQuoteRequest): Promise<ThirdPartyQuoteResp>;
|
|
68
|
+
/**
|
|
69
|
+
* Start a GIGDB application from a quote
|
|
70
|
+
* Note: isDeclined=true is a valid success response (knockout), not an error
|
|
71
|
+
* @param request - The GIGDB application request parameters
|
|
72
|
+
* @returns Promise with the application response
|
|
73
|
+
*/
|
|
74
|
+
startGigdbApplication(request: ThirdPartyGigdbAppReq): Promise<ThirdPartyStartAppResp>;
|
|
75
|
+
/**
|
|
76
|
+
* Save EFT payment details for a GIGDB application
|
|
77
|
+
* @param request - The EFT payment request with account details
|
|
78
|
+
* @returns Promise with payment validation response
|
|
79
|
+
*/
|
|
80
|
+
saveEftPayment(request: ThirdPartyEftPaymentReq): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* Update a GIGDB quote with a different face amount or payment frequency
|
|
83
|
+
* Use after application has been started to re-quote for the same opportunity
|
|
84
|
+
* @param request - The update quote request with opportunityId, faceAmount, and paymentFreq
|
|
85
|
+
* @returns Promise with the updated quote response
|
|
86
|
+
*/
|
|
87
|
+
updateGigdbQuote(request: ThirdPartyGigdbUpdateQuoteReq): Promise<ThirdPartyQuoteResp>;
|
|
88
|
+
/**
|
|
89
|
+
* Get the existing quote for a GIGDB opportunity
|
|
90
|
+
* Use when startGigdbApplication returns isQuoteChanged=true to get the updated quote
|
|
91
|
+
* @param opportunityId - The OpportunityId from the Start Application response
|
|
92
|
+
* @returns Promise with the current quote response
|
|
93
|
+
*/
|
|
94
|
+
getExistingGigdbQuote(opportunityId: string): Promise<ThirdPartyQuoteResp>;
|
|
95
|
+
/**
|
|
96
|
+
* Prepare the signing package and check available delivery channels
|
|
97
|
+
* Always call this first in the signing flow. If isSignCompleted is true, skip to finalSubmit().
|
|
98
|
+
* @param opportunityId - The OpportunityId from the Start Application response
|
|
99
|
+
* @returns Promise with delivery channels and sign completion status
|
|
100
|
+
*/
|
|
101
|
+
prepareDocsAndGetDeliveryChannels(opportunityId: string): Promise<ThirdPartyPrepareDocsResp>;
|
|
102
|
+
/**
|
|
103
|
+
* Send a verification PIN via SMS and/or Email and receive the documents link
|
|
104
|
+
* At least one of flagSendSms or flagSendEmail must be true.
|
|
105
|
+
* @param request - The send PIN request with delivery preferences
|
|
106
|
+
* @returns Promise with documents link and disclosure script
|
|
107
|
+
*/
|
|
108
|
+
sendPinAndGetDocumentsLink(request: ThirdPartySendPinReq): Promise<ThirdPartySendPinResp>;
|
|
109
|
+
/**
|
|
110
|
+
* Resend the verification PIN if the signer did not receive it
|
|
111
|
+
* @param request - The resend PIN request with delivery preferences
|
|
112
|
+
* @returns Promise with PIN sent confirmation
|
|
113
|
+
*/
|
|
114
|
+
resendPin(request: ThirdPartyResendPinReq): Promise<ThirdPartyResendPinResp>;
|
|
115
|
+
/**
|
|
116
|
+
* Verify the PIN entered by the signer to complete document signing
|
|
117
|
+
* The disclosure script must have been read aloud before calling this.
|
|
118
|
+
* @param request - The verify PIN request with PIN and script confirmation
|
|
119
|
+
* @returns Promise with verification result
|
|
120
|
+
*/
|
|
121
|
+
verifyPin(request: ThirdPartyVerifyPinReq): Promise<ThirdPartyVerifyPinResp>;
|
|
122
|
+
/**
|
|
123
|
+
* Submit the application to the carrier for a final underwriting decision
|
|
124
|
+
* Call after the signing flow is complete or when isSignCompleted is true.
|
|
125
|
+
* Note: A null policyNumber means the carrier has not yet issued a number (pending decision) — not an error.
|
|
126
|
+
* @param opportunityId - The OpportunityId from the Start Application response
|
|
127
|
+
* @returns Promise with the final submit response containing policyNumber
|
|
128
|
+
*/
|
|
129
|
+
finalSubmit(opportunityId: string): Promise<ThirdPartyFinalSubmitResp>;
|
|
58
130
|
/**
|
|
59
131
|
* Check if the client is authenticated
|
|
60
132
|
* @returns boolean indicating authentication status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instabrain-client.d.ts","sourceRoot":"","sources":["../../src/client/instabrain-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"instabrain-client.d.ts","sourceRoot":"","sources":["../../src/client/instabrain-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,6BAA6B,EAC7B,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,UAAU,CAAa;IAC/B,SAAgB,IAAI,EAAE,WAAW,CAAC;IAClC,SAAgB,KAAK,EAAE,YAAY,CAA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B,CAAC;IAMhF;;;;;OAKG;IACG,iCAAiC,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAIlG;;;;;OAKG;IACG,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI/F;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAIlF;;;;;OAKG;IACG,SAAS,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAMlF;;;;;;OAMG;IACG,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAI5E;;;OAGG;IACH,eAAe,IAAI,OAAO;IAI1B;;;OAGG;IACH,eAAe,IAAI,MAAM,GAAG,IAAI;IAIhC;;OAEG;IACH,MAAM,IAAI,IAAI;IAId;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B;;;OAGG;IACH,UAAU,IAAI,MAAM;CAGrB"}
|
|
@@ -6,6 +6,8 @@ const auth_service_1 = require("../services/auth.service");
|
|
|
6
6
|
const quote_service_1 = require("../services/quote.service");
|
|
7
7
|
const application_service_1 = require("../services/application.service");
|
|
8
8
|
const reports_service_1 = require("../services/reports.service");
|
|
9
|
+
const gigdb_service_1 = require("../services/gigdb.service");
|
|
10
|
+
const secure_sign_service_1 = require("../services/secure-sign.service");
|
|
9
11
|
/**
|
|
10
12
|
* Main InstaBrain SDK client
|
|
11
13
|
*/
|
|
@@ -16,6 +18,8 @@ class InstaBrainClient {
|
|
|
16
18
|
this.quote = new quote_service_1.QuoteService(this.httpClient);
|
|
17
19
|
this.application = new application_service_1.ApplicationService(this.httpClient);
|
|
18
20
|
this.reports = new reports_service_1.ReportsService(this.httpClient);
|
|
21
|
+
this.gigdb = new gigdb_service_1.GigdbService(this.httpClient);
|
|
22
|
+
this.secureSign = new secure_sign_service_1.SecureSignService(this.httpClient);
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Configure the client for different environments
|
|
@@ -78,6 +82,96 @@ class InstaBrainClient {
|
|
|
78
82
|
async getApplications(request) {
|
|
79
83
|
return this.reports.getApplications(request);
|
|
80
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Get a GIGDB insurance quote (ages 50-85, $5k-$25k)
|
|
87
|
+
* @param request - The GIGDB quote request parameters
|
|
88
|
+
* @returns Promise with the quote response
|
|
89
|
+
*/
|
|
90
|
+
async getGigdbQuote(request) {
|
|
91
|
+
return this.gigdb.getQuote(request);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Start a GIGDB application from a quote
|
|
95
|
+
* Note: isDeclined=true is a valid success response (knockout), not an error
|
|
96
|
+
* @param request - The GIGDB application request parameters
|
|
97
|
+
* @returns Promise with the application response
|
|
98
|
+
*/
|
|
99
|
+
async startGigdbApplication(request) {
|
|
100
|
+
return this.gigdb.startApplication(request);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Save EFT payment details for a GIGDB application
|
|
104
|
+
* @param request - The EFT payment request with account details
|
|
105
|
+
* @returns Promise with payment validation response
|
|
106
|
+
*/
|
|
107
|
+
async saveEftPayment(request) {
|
|
108
|
+
return this.gigdb.saveEftPayment(request);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Update a GIGDB quote with a different face amount or payment frequency
|
|
112
|
+
* Use after application has been started to re-quote for the same opportunity
|
|
113
|
+
* @param request - The update quote request with opportunityId, faceAmount, and paymentFreq
|
|
114
|
+
* @returns Promise with the updated quote response
|
|
115
|
+
*/
|
|
116
|
+
async updateGigdbQuote(request) {
|
|
117
|
+
return this.gigdb.updateQuote(request);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get the existing quote for a GIGDB opportunity
|
|
121
|
+
* Use when startGigdbApplication returns isQuoteChanged=true to get the updated quote
|
|
122
|
+
* @param opportunityId - The OpportunityId from the Start Application response
|
|
123
|
+
* @returns Promise with the current quote response
|
|
124
|
+
*/
|
|
125
|
+
async getExistingGigdbQuote(opportunityId) {
|
|
126
|
+
return this.gigdb.getExistingQuote(opportunityId);
|
|
127
|
+
}
|
|
128
|
+
// ── Secure Sign Methods ─────────────────────────────────────────────
|
|
129
|
+
/**
|
|
130
|
+
* Prepare the signing package and check available delivery channels
|
|
131
|
+
* Always call this first in the signing flow. If isSignCompleted is true, skip to finalSubmit().
|
|
132
|
+
* @param opportunityId - The OpportunityId from the Start Application response
|
|
133
|
+
* @returns Promise with delivery channels and sign completion status
|
|
134
|
+
*/
|
|
135
|
+
async prepareDocsAndGetDeliveryChannels(opportunityId) {
|
|
136
|
+
return this.secureSign.prepareDocsAndGetDeliveryChannels(opportunityId);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Send a verification PIN via SMS and/or Email and receive the documents link
|
|
140
|
+
* At least one of flagSendSms or flagSendEmail must be true.
|
|
141
|
+
* @param request - The send PIN request with delivery preferences
|
|
142
|
+
* @returns Promise with documents link and disclosure script
|
|
143
|
+
*/
|
|
144
|
+
async sendPinAndGetDocumentsLink(request) {
|
|
145
|
+
return this.secureSign.sendPinAndGetDocumentsLink(request);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Resend the verification PIN if the signer did not receive it
|
|
149
|
+
* @param request - The resend PIN request with delivery preferences
|
|
150
|
+
* @returns Promise with PIN sent confirmation
|
|
151
|
+
*/
|
|
152
|
+
async resendPin(request) {
|
|
153
|
+
return this.secureSign.resendPin(request);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Verify the PIN entered by the signer to complete document signing
|
|
157
|
+
* The disclosure script must have been read aloud before calling this.
|
|
158
|
+
* @param request - The verify PIN request with PIN and script confirmation
|
|
159
|
+
* @returns Promise with verification result
|
|
160
|
+
*/
|
|
161
|
+
async verifyPin(request) {
|
|
162
|
+
return this.secureSign.verifyPin(request);
|
|
163
|
+
}
|
|
164
|
+
// ── Final Submit ───────────────────────────────────────────────────
|
|
165
|
+
/**
|
|
166
|
+
* Submit the application to the carrier for a final underwriting decision
|
|
167
|
+
* Call after the signing flow is complete or when isSignCompleted is true.
|
|
168
|
+
* Note: A null policyNumber means the carrier has not yet issued a number (pending decision) — not an error.
|
|
169
|
+
* @param opportunityId - The OpportunityId from the Start Application response
|
|
170
|
+
* @returns Promise with the final submit response containing policyNumber
|
|
171
|
+
*/
|
|
172
|
+
async finalSubmit(opportunityId) {
|
|
173
|
+
return this.application.finalSubmit(opportunityId);
|
|
174
|
+
}
|
|
81
175
|
/**
|
|
82
176
|
* Check if the client is authenticated
|
|
83
177
|
* @returns boolean indicating authentication status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instabrain-client.js","sourceRoot":"","sources":["../../src/client/instabrain-client.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAClD,2DAAuD;AACvD,6DAAyD;AACzD,yEAAqE;AACrE,iEAA6D;
|
|
1
|
+
{"version":3,"file":"instabrain-client.js","sourceRoot":"","sources":["../../src/client/instabrain-client.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAClD,2DAAuD;AACvD,6DAAyD;AACzD,yEAAqE;AACrE,iEAA6D;AAC7D,6DAAyD;AACzD,yEAAoE;AA0BpE;;GAEG;AACH,MAAa,gBAAgB;IAS3B,YAAY,SAA2B,EAAE;QACvC,IAAI,CAAC,UAAU,GAAG,IAAI,wBAAU,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,0BAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,IAAI,wCAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,CAAC,OAAO,GAAG,IAAI,gCAAc,C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AA+B;QAC7C,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,sEAAsE;IAEtE;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CAAC,aAAqB;QACrC,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;IACtC,CAAC;CACF;AApOD,4CAoOC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export { InstaBrainClient } from './client/instabrain-client';
|
|
2
|
-
export { AuthService } from './services/auth.service';
|
|
3
|
-
export { QuoteService } from './services/quote.service';
|
|
4
|
-
export { ApplicationService } from './services/application.service';
|
|
5
2
|
export * from './types';
|
|
6
|
-
export { HttpClient } from './utils/http-client';
|
|
7
3
|
export { InstaBrainClient as default } from './client/instabrain-client';
|
|
8
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,22 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.default = exports.
|
|
17
|
+
exports.default = exports.InstaBrainClient = void 0;
|
|
18
18
|
// Main exports
|
|
19
19
|
var instabrain_client_1 = require("./client/instabrain-client");
|
|
20
20
|
Object.defineProperty(exports, "InstaBrainClient", { enumerable: true, get: function () { return instabrain_client_1.InstaBrainClient; } });
|
|
21
|
-
// Service exports
|
|
22
|
-
var auth_service_1 = require("./services/auth.service");
|
|
23
|
-
Object.defineProperty(exports, "AuthService", { enumerable: true, get: function () { return auth_service_1.AuthService; } });
|
|
24
|
-
var quote_service_1 = require("./services/quote.service");
|
|
25
|
-
Object.defineProperty(exports, "QuoteService", { enumerable: true, get: function () { return quote_service_1.QuoteService; } });
|
|
26
|
-
var application_service_1 = require("./services/application.service");
|
|
27
|
-
Object.defineProperty(exports, "ApplicationService", { enumerable: true, get: function () { return application_service_1.ApplicationService; } });
|
|
28
21
|
// Type exports
|
|
29
22
|
__exportStar(require("./types"), exports);
|
|
30
|
-
// Utility exports
|
|
31
|
-
var http_client_1 = require("./utils/http-client");
|
|
32
|
-
Object.defineProperty(exports, "HttpClient", { enumerable: true, get: function () { return http_client_1.HttpClient; } });
|
|
33
23
|
// Default export
|
|
34
24
|
var instabrain_client_2 = require("./client/instabrain-client");
|
|
35
25
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return instabrain_client_2.InstaBrainClient; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,eAAe;AACf,gEAA8D;AAArD,qHAAA,gBAAgB,OAAA;AAEzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,eAAe;AACf,gEAA8D;AAArD,qHAAA,gBAAgB,OAAA;AAEzB,eAAe;AACf,0CAAwB;AAExB,iBAAiB;AACjB,gEAAyE;AAAhE,4GAAA,gBAAgB,OAAW"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HttpClient } from '../utils/http-client';
|
|
2
|
-
import { ThirdPartyStartApplicationReq, ThirdPartyStartAppResp } from '../types';
|
|
2
|
+
import { ThirdPartyStartApplicationReq, ThirdPartyStartAppResp, ThirdPartyFinalSubmitResp } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Application service for starting insurance applications from quotes
|
|
5
5
|
*/
|
|
6
6
|
export declare class ApplicationService {
|
|
7
|
-
private httpClient;
|
|
7
|
+
private readonly httpClient;
|
|
8
8
|
constructor(httpClient: HttpClient);
|
|
9
9
|
/**
|
|
10
10
|
* Start an insurance application based on a quote response ID
|
|
@@ -12,5 +12,13 @@ export declare class ApplicationService {
|
|
|
12
12
|
* @returns Promise with the application response containing links
|
|
13
13
|
*/
|
|
14
14
|
startApplication(applicationRequest: ThirdPartyStartApplicationReq): Promise<ThirdPartyStartAppResp>;
|
|
15
|
+
/**
|
|
16
|
+
* Submit the application to the carrier for a final underwriting decision
|
|
17
|
+
* Shared across all products. Call after the signing flow is complete.
|
|
18
|
+
* Note: A null policyNumber does not indicate failure — it means the carrier has not yet issued a number (pending decision).
|
|
19
|
+
* @param opportunityId - The OpportunityId from the Start Application response
|
|
20
|
+
* @returns Promise with the final submit response containing policyNumber
|
|
21
|
+
*/
|
|
22
|
+
finalSubmit(opportunityId: string): Promise<ThirdPartyFinalSubmitResp>;
|
|
15
23
|
}
|
|
16
24
|
//# sourceMappingURL=application.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.service.d.ts","sourceRoot":"","sources":["../../src/services/application.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"application.service.d.ts","sourceRoot":"","sources":["../../src/services/application.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,yBAAyB,EAK1B,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEnD;;;;OAIG;IACG,gBAAgB,CAAC,kBAAkB,EAAE,6BAA6B,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA8B1G;;;;;;OAMG;IACG,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAmC7E"}
|