@instabrain-sdks/api-client 1.0.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 +318 -0
- package/dist/client/instabrain-client.d.ts +83 -0
- package/dist/client/instabrain-client.d.ts.map +1 -0
- package/dist/client/instabrain-client.js +117 -0
- package/dist/client/instabrain-client.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/services/application.service.d.ts +16 -0
- package/dist/services/application.service.d.ts.map +1 -0
- package/dist/services/application.service.js +42 -0
- package/dist/services/application.service.js.map +1 -0
- package/dist/services/auth.service.d.ts +35 -0
- package/dist/services/auth.service.d.ts.map +1 -0
- package/dist/services/auth.service.js +74 -0
- package/dist/services/auth.service.js.map +1 -0
- package/dist/services/quote.service.d.ts +32 -0
- package/dist/services/quote.service.d.ts.map +1 -0
- package/dist/services/quote.service.js +93 -0
- package/dist/services/quote.service.js.map +1 -0
- package/dist/services/reports.service.d.ts +64 -0
- package/dist/services/reports.service.d.ts.map +1 -0
- package/dist/services/reports.service.js +184 -0
- package/dist/services/reports.service.js.map +1 -0
- package/dist/types/application.types.d.ts +14 -0
- package/dist/types/application.types.d.ts.map +1 -0
- package/dist/types/application.types.js +3 -0
- package/dist/types/application.types.js.map +1 -0
- package/dist/types/auth.types.d.ts +8 -0
- package/dist/types/auth.types.d.ts.map +1 -0
- package/dist/types/auth.types.js +3 -0
- package/dist/types/auth.types.js.map +1 -0
- package/dist/types/constants.d.ts +66 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/constants.js +55 -0
- package/dist/types/constants.js.map +1 -0
- package/dist/types/enums.d.ts +40 -0
- package/dist/types/enums.d.ts.map +1 -0
- package/dist/types/enums.js +55 -0
- package/dist/types/enums.js.map +1 -0
- package/dist/types/errors.d.ts +30 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +69 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +43 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/quote.types.d.ts +187 -0
- package/dist/types/quote.types.d.ts.map +1 -0
- package/dist/types/quote.types.js +3 -0
- package/dist/types/quote.types.js.map +1 -0
- package/dist/types/reports.types.d.ts +194 -0
- package/dist/types/reports.types.d.ts.map +1 -0
- package/dist/types/reports.types.js +22 -0
- package/dist/types/reports.types.js.map +1 -0
- package/dist/utils/http-client.d.ts +62 -0
- package/dist/utils/http-client.d.ts.map +1 -0
- package/dist/utils/http-client.js +176 -0
- package/dist/utils/http-client.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HttpClient } from '../utils/http-client';
|
|
2
|
+
/**
|
|
3
|
+
* Authentication service for managing JWT tokens and authorization
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuthService {
|
|
6
|
+
private httpClient;
|
|
7
|
+
constructor(httpClient: HttpClient);
|
|
8
|
+
/**
|
|
9
|
+
* Authenticate with the InstaBrain API and obtain a JWT token
|
|
10
|
+
* @param userId - The user ID for authentication
|
|
11
|
+
* @param accessToken - The access token for authentication
|
|
12
|
+
* @returns Promise with the JWT token
|
|
13
|
+
*/
|
|
14
|
+
authenticate(userId: number, accessToken: string): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Check if the client is currently authenticated
|
|
17
|
+
* @returns boolean indicating authentication status
|
|
18
|
+
*/
|
|
19
|
+
isAuthenticated(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get the current JWT token
|
|
22
|
+
* @returns the current JWT token or null if not authenticated
|
|
23
|
+
*/
|
|
24
|
+
getCurrentToken(): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Logout by clearing the JWT token
|
|
27
|
+
*/
|
|
28
|
+
logout(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Set a JWT token manually (useful if you have a token from elsewhere)
|
|
31
|
+
* @param token - The JWT token to set
|
|
32
|
+
*/
|
|
33
|
+
setToken(token: string): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=auth.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../src/services/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAQlD;;GAEG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmCxE;;;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;CAG9B"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthService = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
/**
|
|
6
|
+
* Authentication service for managing JWT tokens and authorization
|
|
7
|
+
*/
|
|
8
|
+
class AuthService {
|
|
9
|
+
constructor(httpClient) {
|
|
10
|
+
this.httpClient = httpClient;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Authenticate with the InstaBrain API and obtain a JWT token
|
|
14
|
+
* @param userId - The user ID for authentication
|
|
15
|
+
* @param accessToken - The access token for authentication
|
|
16
|
+
* @returns Promise with the JWT token
|
|
17
|
+
*/
|
|
18
|
+
async authenticate(userId, accessToken) {
|
|
19
|
+
var _a;
|
|
20
|
+
try {
|
|
21
|
+
const request = {
|
|
22
|
+
userId,
|
|
23
|
+
accessToken
|
|
24
|
+
};
|
|
25
|
+
const response = await this.httpClient.post('/api/ThirdParty/auth', request);
|
|
26
|
+
// Check if the response was successful
|
|
27
|
+
if (!response.flagStatus) {
|
|
28
|
+
throw new types_1.AuthenticationError(response.error || 'Authentication failed');
|
|
29
|
+
}
|
|
30
|
+
const jwtToken = (_a = response.value) === null || _a === void 0 ? void 0 : _a.jwtToken;
|
|
31
|
+
if (!jwtToken) {
|
|
32
|
+
throw new types_1.AuthenticationError('No JWT token received from server');
|
|
33
|
+
}
|
|
34
|
+
// Store the JWT token and credentials in the HTTP client for future requests and auto-refresh
|
|
35
|
+
this.httpClient.setJwtToken(jwtToken);
|
|
36
|
+
this.httpClient.setAuthCredentials(userId, accessToken);
|
|
37
|
+
return jwtToken;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
// Clear any existing token on authentication failure
|
|
41
|
+
this.httpClient.setJwtToken(null);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if the client is currently authenticated
|
|
47
|
+
* @returns boolean indicating authentication status
|
|
48
|
+
*/
|
|
49
|
+
isAuthenticated() {
|
|
50
|
+
return this.httpClient.isAuthenticated();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get the current JWT token
|
|
54
|
+
* @returns the current JWT token or null if not authenticated
|
|
55
|
+
*/
|
|
56
|
+
getCurrentToken() {
|
|
57
|
+
return this.httpClient.getJwtToken();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Logout by clearing the JWT token
|
|
61
|
+
*/
|
|
62
|
+
logout() {
|
|
63
|
+
this.httpClient.setJwtToken(null);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Set a JWT token manually (useful if you have a token from elsewhere)
|
|
67
|
+
* @param token - The JWT token to set
|
|
68
|
+
*/
|
|
69
|
+
setToken(token) {
|
|
70
|
+
this.httpClient.setJwtToken(token);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.AuthService = AuthService;
|
|
74
|
+
//# sourceMappingURL=auth.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/services/auth.service.ts"],"names":[],"mappings":";;;AACA,oCAKkB;AAElB;;GAEG;AACH,MAAa,WAAW;IACtB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,WAAmB;;QACpD,IAAI,CAAC;YACH,MAAM,OAAO,GAAyB;gBACpC,MAAM;gBACN,WAAW;aACZ,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,sBAAsB,EACtB,OAAO,CACR,CAAC;YAEF,uCAAuC;YACvC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACzB,MAAM,IAAI,2BAAmB,CAAC,QAAQ,CAAC,KAAK,IAAI,uBAAuB,CAAC,CAAC;YAC3E,CAAC;YAED,MAAM,QAAQ,GAAG,MAAA,QAAQ,CAAC,KAAK,0CAAE,QAAQ,CAAC;YAE1C,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,2BAAmB,CAAC,mCAAmC,CAAC,CAAC;YACrE,CAAC;YAED,8FAA8F;YAC9F,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAExD,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qDAAqD;YACrD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACF;AA1ED,kCA0EC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HttpClient } from '../utils/http-client';
|
|
2
|
+
import { ThirdPartyQuoteReq, ThirdPartyQuoteResp } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Quote service for getting insurance quotes from the InstaBrain API
|
|
5
|
+
*/
|
|
6
|
+
export declare class QuoteService {
|
|
7
|
+
private httpClient;
|
|
8
|
+
constructor(httpClient: HttpClient);
|
|
9
|
+
/**
|
|
10
|
+
* Get an insurance quote based on the provided parameters
|
|
11
|
+
*
|
|
12
|
+
* Important API constraints (handled by API, not SDK):
|
|
13
|
+
* - Age: 18-60 years
|
|
14
|
+
* - Face Amount: Age-based limits (50k-1M for younger ages, decreasing with age)
|
|
15
|
+
* - Benefit Period: Age and tobacco dependent (10,20,30 for younger, 10,20 for older)
|
|
16
|
+
* - State restrictions: Not available in WY and NY
|
|
17
|
+
* - Either stateCode or zipCode required (zipCode takes priority)
|
|
18
|
+
* - Height/weight, rateClass, or healthClass required for rating
|
|
19
|
+
* - Rider availability varies by state and age
|
|
20
|
+
*
|
|
21
|
+
* @param quoteRequest - The quote request parameters
|
|
22
|
+
* @returns Promise with the quote response
|
|
23
|
+
*/
|
|
24
|
+
getQuote(quoteRequest: ThirdPartyQuoteReq): Promise<ThirdPartyQuoteResp>;
|
|
25
|
+
/**
|
|
26
|
+
* Extract error code from API response
|
|
27
|
+
* @param response - The API response
|
|
28
|
+
* @returns The error code if found, null otherwise
|
|
29
|
+
*/
|
|
30
|
+
private extractErrorCode;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=quote.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.service.d.ts","sourceRoot":"","sources":["../../src/services/quote.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EAKpB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C;;;;;;;;;;;;;;OAcG;IACG,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAwC9E;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;CA+BzB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuoteService = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
/**
|
|
6
|
+
* Quote service for getting insurance quotes from the InstaBrain API
|
|
7
|
+
*/
|
|
8
|
+
class QuoteService {
|
|
9
|
+
constructor(httpClient) {
|
|
10
|
+
this.httpClient = httpClient;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get an insurance quote based on the provided parameters
|
|
14
|
+
*
|
|
15
|
+
* Important API constraints (handled by API, not SDK):
|
|
16
|
+
* - Age: 18-60 years
|
|
17
|
+
* - Face Amount: Age-based limits (50k-1M for younger ages, decreasing with age)
|
|
18
|
+
* - Benefit Period: Age and tobacco dependent (10,20,30 for younger, 10,20 for older)
|
|
19
|
+
* - State restrictions: Not available in WY and NY
|
|
20
|
+
* - Either stateCode or zipCode required (zipCode takes priority)
|
|
21
|
+
* - Height/weight, rateClass, or healthClass required for rating
|
|
22
|
+
* - Rider availability varies by state and age
|
|
23
|
+
*
|
|
24
|
+
* @param quoteRequest - The quote request parameters
|
|
25
|
+
* @returns Promise with the quote response
|
|
26
|
+
*/
|
|
27
|
+
async getQuote(quoteRequest) {
|
|
28
|
+
// Check if authenticated
|
|
29
|
+
if (!this.httpClient.isAuthenticated()) {
|
|
30
|
+
throw new types_1.AuthenticationError('Must be authenticated to get quotes. Call authenticate() first.');
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const response = await this.httpClient.post('/api/ThirdPartyIbTermQuote/get', quoteRequest);
|
|
34
|
+
// Check if the response was successful
|
|
35
|
+
if (!response.flagStatus) {
|
|
36
|
+
// Handle API validation errors with specific error codes
|
|
37
|
+
const errorMessage = response.error || 'Failed to get quote';
|
|
38
|
+
// Try to extract error code from response
|
|
39
|
+
const errorCode = this.extractErrorCode(response);
|
|
40
|
+
if (errorCode) {
|
|
41
|
+
throw new types_1.APIValidationError(errorMessage, errorCode, response);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
throw new types_1.InstaBrainError(errorMessage, 400, response);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!response.value) {
|
|
48
|
+
throw new types_1.InstaBrainError('No quote data received from server');
|
|
49
|
+
}
|
|
50
|
+
return response.value;
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error instanceof types_1.InstaBrainError) {
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
throw new types_1.InstaBrainError('Failed to get quote: ' + error.message);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Extract error code from API response
|
|
61
|
+
* @param response - The API response
|
|
62
|
+
* @returns The error code if found, null otherwise
|
|
63
|
+
*/
|
|
64
|
+
extractErrorCode(response) {
|
|
65
|
+
// The API documentation indicates that error codes are returned
|
|
66
|
+
// when flagStatus is false. The exact format may vary.
|
|
67
|
+
// Common patterns to check:
|
|
68
|
+
// Check if error code is directly in the response
|
|
69
|
+
if (response.errorCode) {
|
|
70
|
+
return response.errorCode;
|
|
71
|
+
}
|
|
72
|
+
// Check if error code is in error message or nested structure
|
|
73
|
+
if (response.error && typeof response.error === 'string') {
|
|
74
|
+
// Known API error codes from documentation
|
|
75
|
+
const knownErrorCodes = [
|
|
76
|
+
'stateNotFound', 'RateClassNotFound', 'RiderNotAvailable',
|
|
77
|
+
'HeightNotValid', 'InvalidRateclass', 'InvalidHealthClass',
|
|
78
|
+
'ZipCodeNotFound', 'outsideBuildChart', 'QuoteNotEligibleForGivenConditions',
|
|
79
|
+
'NotAvailableForState', 'BenefitPeriodNotAvailable', 'CoverageNotAvailable',
|
|
80
|
+
'RiderFaceAmountNotValid'
|
|
81
|
+
];
|
|
82
|
+
// Try to find error code in the error message
|
|
83
|
+
for (const errorCode of knownErrorCodes) {
|
|
84
|
+
if (response.error.includes(errorCode)) {
|
|
85
|
+
return errorCode;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.QuoteService = QuoteService;
|
|
93
|
+
//# sourceMappingURL=quote.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.service.js","sourceRoot":"","sources":["../../src/services/quote.service.ts"],"names":[],"mappings":";;;AACA,oCAOkB;AAElB;;GAEG;AACH,MAAa,YAAY;IACvB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,QAAQ,CAAC,YAAgC;QAC7C,yBAAyB;QACzB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,EAAE,CAAC;YACvC,MAAM,IAAI,2BAAmB,CAAC,iEAAiE,CAAC,CAAC;QACnG,CAAC;QAED,IAAI,CAAC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2CAA2C;YAC3C,MAAM,eAAe,GAAG;gBACtB,eAAe,EAAE,mBAAmB,EAAE,mBAAmB;gBACzD,gBAAgB,EAAE,kBAAkB,EAAE,oBAAoB;gBAC1D,iBAAiB,EAAE,mBAAmB,EAAE,oCAAoC;gBAC5E,sBAAsB,EAAE,2BAA2B,EAAE,sBAAsB;gBAC3E,yBAAyB;aAC1B,CAAC;YAEF,8CAA8C;YAC9C,KAAK,MAAM,SAAS,IAAI,eAAe,EAAE,CAAC;gBACxC,IAAI,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBACvC,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA9FD,oCA8FC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { HttpClient } from '../utils/http-client';
|
|
2
|
+
import { AgentPortalReq, ThirdPartyProspectsResp, ThirdPartySalesReportRes, ThirdPartyApplicationReportRes } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Reports service for getting prospects, sales, and applications data from InstaBrain API
|
|
5
|
+
* These APIs provide dashboard-ready data for agent portals and reporting systems
|
|
6
|
+
*/
|
|
7
|
+
export declare class ReportsService {
|
|
8
|
+
private httpClient;
|
|
9
|
+
constructor(httpClient: HttpClient);
|
|
10
|
+
/**
|
|
11
|
+
* Get prospects data - quotes that haven't been converted to applications yet
|
|
12
|
+
*
|
|
13
|
+
* This API supports:
|
|
14
|
+
* - Date range filtering (startDate/endDate or dayCount)
|
|
15
|
+
* - Pagination (pageSize/pageIndex)
|
|
16
|
+
* - Sorting by any field
|
|
17
|
+
* - Filtering with various SQL operators
|
|
18
|
+
* - Text search across fields
|
|
19
|
+
*
|
|
20
|
+
* @param request - The agent portal request with filters, pagination, etc.
|
|
21
|
+
* @returns Promise with prospects data including count and details
|
|
22
|
+
*/
|
|
23
|
+
getProspects(request: AgentPortalReq): Promise<ThirdPartyProspectsResp>;
|
|
24
|
+
/**
|
|
25
|
+
* Get sales data - completed/sold policies
|
|
26
|
+
*
|
|
27
|
+
* This API supports:
|
|
28
|
+
* - Date range filtering (startDate/endDate or dayCount)
|
|
29
|
+
* - Pagination (pageSize/pageIndex)
|
|
30
|
+
* - Sorting by any field
|
|
31
|
+
* - Filtering with various SQL operators
|
|
32
|
+
* - Text search across fields
|
|
33
|
+
* - Total premium amount calculation
|
|
34
|
+
* - Available filters metadata
|
|
35
|
+
*
|
|
36
|
+
* @param request - The agent portal request with filters, pagination, etc.
|
|
37
|
+
* @returns Promise with sales data including total premium amount
|
|
38
|
+
*/
|
|
39
|
+
getSales(request: AgentPortalReq): Promise<ThirdPartySalesReportRes>;
|
|
40
|
+
/**
|
|
41
|
+
* Get applications data - applications in progress
|
|
42
|
+
*
|
|
43
|
+
* This API supports:
|
|
44
|
+
* - Date range filtering (startDate/endDate or dayCount)
|
|
45
|
+
* - Pagination (pageSize/pageIndex)
|
|
46
|
+
* - Sorting by any field
|
|
47
|
+
* - Filtering with various SQL operators
|
|
48
|
+
* - Text search across fields
|
|
49
|
+
* - Application status information
|
|
50
|
+
* - Application completion percentage
|
|
51
|
+
* - Expiration tracking
|
|
52
|
+
*
|
|
53
|
+
* @param request - The agent portal request with filters, pagination, etc.
|
|
54
|
+
* @returns Promise with applications data including status and completion info
|
|
55
|
+
*/
|
|
56
|
+
getApplications(request: AgentPortalReq): Promise<ThirdPartyApplicationReportRes>;
|
|
57
|
+
/**
|
|
58
|
+
* Extract error code from API response
|
|
59
|
+
* @param response - The API response
|
|
60
|
+
* @returns The error code if found, null otherwise
|
|
61
|
+
*/
|
|
62
|
+
private extractErrorCode;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=reports.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.service.d.ts","sourceRoot":"","sources":["../../src/services/reports.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAK/B,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C;;;;;;;;;;;;OAYG;IACG,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAwC7E;;;;;;;;;;;;;;OAcG;IACG,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAwC1E;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAwCvF;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;CA2BzB"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportsService = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
/**
|
|
6
|
+
* Reports service for getting prospects, sales, and applications data from InstaBrain API
|
|
7
|
+
* These APIs provide dashboard-ready data for agent portals and reporting systems
|
|
8
|
+
*/
|
|
9
|
+
class ReportsService {
|
|
10
|
+
constructor(httpClient) {
|
|
11
|
+
this.httpClient = httpClient;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get prospects data - quotes that haven't been converted to applications yet
|
|
15
|
+
*
|
|
16
|
+
* This API supports:
|
|
17
|
+
* - Date range filtering (startDate/endDate or dayCount)
|
|
18
|
+
* - Pagination (pageSize/pageIndex)
|
|
19
|
+
* - Sorting by any field
|
|
20
|
+
* - Filtering with various SQL operators
|
|
21
|
+
* - Text search across fields
|
|
22
|
+
*
|
|
23
|
+
* @param request - The agent portal request with filters, pagination, etc.
|
|
24
|
+
* @returns Promise with prospects data including count and details
|
|
25
|
+
*/
|
|
26
|
+
async getProspects(request) {
|
|
27
|
+
// Check if authenticated
|
|
28
|
+
if (!this.httpClient.isAuthenticated()) {
|
|
29
|
+
throw new types_1.AuthenticationError('Must be authenticated to get prospects. Call authenticate() first.');
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const response = await this.httpClient.post('/api/ThirdParty/get-prospects', request);
|
|
33
|
+
// Check if the response was successful
|
|
34
|
+
if (!response.flagStatus) {
|
|
35
|
+
// Handle API validation errors with specific error codes
|
|
36
|
+
const errorMessage = response.error || 'Failed to get prospects';
|
|
37
|
+
// Try to extract error code from response
|
|
38
|
+
const errorCode = this.extractErrorCode(response);
|
|
39
|
+
if (errorCode) {
|
|
40
|
+
throw new types_1.APIValidationError(errorMessage, errorCode, response);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw new types_1.InstaBrainError(errorMessage, 400, response);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!response.value) {
|
|
47
|
+
throw new types_1.InstaBrainError('No prospects data received from server');
|
|
48
|
+
}
|
|
49
|
+
return response.value;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (error instanceof types_1.InstaBrainError) {
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
throw new types_1.InstaBrainError('Failed to get prospects: ' + error.message);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get sales data - completed/sold policies
|
|
60
|
+
*
|
|
61
|
+
* This API supports:
|
|
62
|
+
* - Date range filtering (startDate/endDate or dayCount)
|
|
63
|
+
* - Pagination (pageSize/pageIndex)
|
|
64
|
+
* - Sorting by any field
|
|
65
|
+
* - Filtering with various SQL operators
|
|
66
|
+
* - Text search across fields
|
|
67
|
+
* - Total premium amount calculation
|
|
68
|
+
* - Available filters metadata
|
|
69
|
+
*
|
|
70
|
+
* @param request - The agent portal request with filters, pagination, etc.
|
|
71
|
+
* @returns Promise with sales data including total premium amount
|
|
72
|
+
*/
|
|
73
|
+
async getSales(request) {
|
|
74
|
+
// Check if authenticated
|
|
75
|
+
if (!this.httpClient.isAuthenticated()) {
|
|
76
|
+
throw new types_1.AuthenticationError('Must be authenticated to get sales. Call authenticate() first.');
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const response = await this.httpClient.post('/api/ThirdParty/get-sales', request);
|
|
80
|
+
// Check if the response was successful
|
|
81
|
+
if (!response.flagStatus) {
|
|
82
|
+
// Handle API validation errors with specific error codes
|
|
83
|
+
const errorMessage = response.error || 'Failed to get sales';
|
|
84
|
+
// Try to extract error code from response
|
|
85
|
+
const errorCode = this.extractErrorCode(response);
|
|
86
|
+
if (errorCode) {
|
|
87
|
+
throw new types_1.APIValidationError(errorMessage, errorCode, response);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
throw new types_1.InstaBrainError(errorMessage, 400, response);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (!response.value) {
|
|
94
|
+
throw new types_1.InstaBrainError('No sales data received from server');
|
|
95
|
+
}
|
|
96
|
+
return response.value;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
if (error instanceof types_1.InstaBrainError) {
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
throw new types_1.InstaBrainError('Failed to get sales: ' + error.message);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get applications data - applications in progress
|
|
107
|
+
*
|
|
108
|
+
* This API supports:
|
|
109
|
+
* - Date range filtering (startDate/endDate or dayCount)
|
|
110
|
+
* - Pagination (pageSize/pageIndex)
|
|
111
|
+
* - Sorting by any field
|
|
112
|
+
* - Filtering with various SQL operators
|
|
113
|
+
* - Text search across fields
|
|
114
|
+
* - Application status information
|
|
115
|
+
* - Application completion percentage
|
|
116
|
+
* - Expiration tracking
|
|
117
|
+
*
|
|
118
|
+
* @param request - The agent portal request with filters, pagination, etc.
|
|
119
|
+
* @returns Promise with applications data including status and completion info
|
|
120
|
+
*/
|
|
121
|
+
async getApplications(request) {
|
|
122
|
+
// Check if authenticated
|
|
123
|
+
if (!this.httpClient.isAuthenticated()) {
|
|
124
|
+
throw new types_1.AuthenticationError('Must be authenticated to get applications. Call authenticate() first.');
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
const response = await this.httpClient.post('/api/ThirdParty/get-application', request);
|
|
128
|
+
// Check if the response was successful
|
|
129
|
+
if (!response.flagStatus) {
|
|
130
|
+
// Handle API validation errors with specific error codes
|
|
131
|
+
const errorMessage = response.error || 'Failed to get applications';
|
|
132
|
+
// Try to extract error code from response
|
|
133
|
+
const errorCode = this.extractErrorCode(response);
|
|
134
|
+
if (errorCode) {
|
|
135
|
+
throw new types_1.APIValidationError(errorMessage, errorCode, response);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
throw new types_1.InstaBrainError(errorMessage, 400, response);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (!response.value) {
|
|
142
|
+
throw new types_1.InstaBrainError('No applications data received from server');
|
|
143
|
+
}
|
|
144
|
+
return response.value;
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
if (error instanceof types_1.InstaBrainError) {
|
|
148
|
+
throw error;
|
|
149
|
+
}
|
|
150
|
+
throw new types_1.InstaBrainError('Failed to get applications: ' + error.message);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Extract error code from API response
|
|
155
|
+
* @param response - The API response
|
|
156
|
+
* @returns The error code if found, null otherwise
|
|
157
|
+
*/
|
|
158
|
+
extractErrorCode(response) {
|
|
159
|
+
// Check if error code is directly in the response
|
|
160
|
+
if (response.errorCode) {
|
|
161
|
+
return response.errorCode;
|
|
162
|
+
}
|
|
163
|
+
// Check if error code is in error message or nested structure
|
|
164
|
+
if (response.error && typeof response.error === 'string') {
|
|
165
|
+
// Known API error codes from documentation
|
|
166
|
+
const knownErrorCodes = [
|
|
167
|
+
'stateNotFound', 'RateClassNotFound', 'RiderNotAvailable',
|
|
168
|
+
'HeightNotValid', 'InvalidRateclass', 'InvalidHealthClass',
|
|
169
|
+
'ZipCodeNotFound', 'outsideBuildChart', 'QuoteNotEligibleForGivenConditions',
|
|
170
|
+
'NotAvailableForState', 'BenefitPeriodNotAvailable', 'CoverageNotAvailable',
|
|
171
|
+
'RiderFaceAmountNotValid'
|
|
172
|
+
];
|
|
173
|
+
// Try to find error code in the error message
|
|
174
|
+
for (const errorCode of knownErrorCodes) {
|
|
175
|
+
if (response.error.includes(errorCode)) {
|
|
176
|
+
return errorCode;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.ReportsService = ReportsService;
|
|
184
|
+
//# sourceMappingURL=reports.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.service.js","sourceRoot":"","sources":["../../src/services/reports.service.ts"],"names":[],"mappings":";;;AACA,oCASkB;AAElB;;;GAGG;AACH,MAAa,cAAc;IACzB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,YAAY,CAAC,OAAuB;QACxC,yBAAyB;QACzB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,EAAE,CAAC;YACvC,MAAM,IAAI,2BAAmB,CAAC,oEAAoE,CAAC,CAAC;QACtG,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,+BAA+B,EAC/B,OAAO,CACR,CAAC;YAEF,uCAAuC;YACvC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACzB,yDAAyD;gBACzD,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,IAAI,yBAAyB,CAAC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CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvMD,wCAuMC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ThirdPartyStartApplicationReq {
|
|
2
|
+
quoteResponseId: string;
|
|
3
|
+
firstName: string | null;
|
|
4
|
+
lastName: string | null;
|
|
5
|
+
email: string | null;
|
|
6
|
+
phoneNumber: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ThirdPartyStartAppResp {
|
|
9
|
+
opportunityId: string;
|
|
10
|
+
agentLink: string | null;
|
|
11
|
+
eAppAgentLink: string | null;
|
|
12
|
+
applicantLink: string | null;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=application.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.types.d.ts","sourceRoot":"","sources":["../../src/types/application.types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.types.js","sourceRoot":"","sources":["../../src/types/application.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.types.d.ts","sourceRoot":"","sources":["../../src/types/auth.types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.types.js","sourceRoot":"","sources":["../../src/types/auth.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State and Rider Availability Reference
|
|
3
|
+
* This information is provided for developer reference only.
|
|
4
|
+
* All validation is handled by the API.
|
|
5
|
+
*/
|
|
6
|
+
/** States where the product is not available */
|
|
7
|
+
export declare const UNAVAILABLE_STATES: readonly ["WY", "NY"];
|
|
8
|
+
/** States where ADB Rider is available */
|
|
9
|
+
export declare const ADB_RIDER_AVAILABLE_STATES: readonly ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WV", "WI"];
|
|
10
|
+
/** States where Child Rider is available */
|
|
11
|
+
export declare const CHILD_RIDER_AVAILABLE_STATES: readonly ["AL", "AK", "AZ", "AR", "CO", "CT", "DC", "DE", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NC", "OH", "OK", "OR", "PA", "RI", "SC", "TN", "TX", "UT", "VA", "WV", "WI"];
|
|
12
|
+
/** States where Child Rider is NOT available */
|
|
13
|
+
export declare const CHILD_RIDER_UNAVAILABLE_STATES: readonly ["CA", "FL", "ME", "ND", "SD", "VT", "WA"];
|
|
14
|
+
/** States where NO riders are available */
|
|
15
|
+
export declare const NO_RIDERS_AVAILABLE_STATES: readonly ["WA"];
|
|
16
|
+
/** Coverage limits for riders */
|
|
17
|
+
export declare const RIDER_LIMITS: {
|
|
18
|
+
readonly ADB_RIDER: {
|
|
19
|
+
readonly MIN: 25000;
|
|
20
|
+
readonly MAX: 250000;
|
|
21
|
+
};
|
|
22
|
+
readonly DEPENDENT_CHILD_RIDER: {
|
|
23
|
+
readonly MIN: 5000;
|
|
24
|
+
readonly MAX: 25000;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/** Age limits for the product */
|
|
28
|
+
export declare const AGE_LIMITS: {
|
|
29
|
+
readonly MIN: 18;
|
|
30
|
+
readonly MAX: 60;
|
|
31
|
+
};
|
|
32
|
+
/** Face amount limits by age */
|
|
33
|
+
export declare const FACE_AMOUNT_LIMITS_BY_AGE: {
|
|
34
|
+
readonly UP_TO_55: {
|
|
35
|
+
readonly MIN: 50000;
|
|
36
|
+
readonly MAX: 1000000;
|
|
37
|
+
};
|
|
38
|
+
readonly AGE_56: {
|
|
39
|
+
readonly MIN: 50000;
|
|
40
|
+
readonly MAX: 900000;
|
|
41
|
+
};
|
|
42
|
+
readonly AGE_57: {
|
|
43
|
+
readonly MIN: 50000;
|
|
44
|
+
readonly MAX: 800000;
|
|
45
|
+
};
|
|
46
|
+
readonly AGE_58: {
|
|
47
|
+
readonly MIN: 50000;
|
|
48
|
+
readonly MAX: 700000;
|
|
49
|
+
};
|
|
50
|
+
readonly AGE_59: {
|
|
51
|
+
readonly MIN: 50000;
|
|
52
|
+
readonly MAX: 600000;
|
|
53
|
+
};
|
|
54
|
+
readonly AGE_60: {
|
|
55
|
+
readonly MIN: 50000;
|
|
56
|
+
readonly MAX: 500000;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/** Benefit period availability by age and tobacco use */
|
|
60
|
+
export declare const BENEFIT_PERIOD_AVAILABILITY: {
|
|
61
|
+
readonly UP_TO_45: readonly [10, 20, 30];
|
|
62
|
+
readonly AGE_45_50_NON_TOBACCO: readonly [10, 20, 30];
|
|
63
|
+
readonly AGE_45_50_TOBACCO: readonly [10, 20];
|
|
64
|
+
readonly AGE_51_60: readonly [10, 20];
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/types/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,uBAAwB,CAAC;AAExD,0CAA0C;AAC1C,eAAO,MAAM,0BAA0B,2SAE7B,CAAC;AAEX,4CAA4C;AAC5C,eAAO,MAAM,4BAA4B,uQAE/B,CAAC;AAEX,gDAAgD;AAChD,eAAO,MAAM,8BAA8B,qDAAsD,CAAC;AAElG,2CAA2C;AAC3C,eAAO,MAAM,0BAA0B,iBAAkB,CAAC;AAE1D,iCAAiC;AACjC,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAC;AAEX,iCAAiC;AACjC,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,gCAAgC;AAChC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;CAO5B,CAAC;AAEX,yDAAyD;AACzD,eAAO,MAAM,2BAA2B;;;;;CAK9B,CAAC"}
|