@cemiar/cemiarlink-sdk 1.0.59 → 1.0.60
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 +651 -651
- package/dist/epic-api/services/EpicApiService.js +5 -6
- package/dist/index.js +7 -17
- package/dist/models/epic/PolicyV2.d.ts +5 -0
- package/dist/models/index.js +7 -17
- package/dist/services/epic/EpicService.d.ts +1 -0
- package/dist/services/epic/EpicService.js +4 -0
- package/dist/utils/Excel.js +1 -2
- package/package.json +42 -42
|
@@ -18,8 +18,7 @@ const PROD_URLS = {
|
|
|
18
18
|
};
|
|
19
19
|
class EpicApiService {
|
|
20
20
|
constructor(clientId, clientSecret, accountId, options) {
|
|
21
|
-
var _a, _b, _c;
|
|
22
|
-
var _d, _e;
|
|
21
|
+
var _a, _b, _c, _d, _e;
|
|
23
22
|
this.epicApiToken = null;
|
|
24
23
|
this.cemiarAuthToken = null;
|
|
25
24
|
this.epicApiTokenPromise = null;
|
|
@@ -27,8 +26,8 @@ class EpicApiService {
|
|
|
27
26
|
this.clientId = clientId;
|
|
28
27
|
this.clientSecret = clientSecret;
|
|
29
28
|
this.accountId = accountId;
|
|
30
|
-
this.language = (
|
|
31
|
-
this.apiEnv = (
|
|
29
|
+
this.language = (_a = options.language) !== null && _a !== void 0 ? _a : 'en-US';
|
|
30
|
+
this.apiEnv = (_b = options.apiEnv) !== null && _b !== void 0 ? _b : 'dev';
|
|
32
31
|
const urls = this.getEnvUrls(options.cemiarLink);
|
|
33
32
|
this.cemiarAuthClient = axios_1.default.create({
|
|
34
33
|
baseURL: urls.cemiarAuth,
|
|
@@ -36,8 +35,8 @@ class EpicApiService {
|
|
|
36
35
|
'Content-Type': 'application/json',
|
|
37
36
|
},
|
|
38
37
|
});
|
|
39
|
-
const cemiarLinkBaseURL = ((
|
|
40
|
-
const taskId = ((
|
|
38
|
+
const cemiarLinkBaseURL = ((_c = options.cemiarLink) === null || _c === void 0 ? void 0 : _c.env) === 'local' ? options.cemiarLink.baseURL : urls.cemiarLink;
|
|
39
|
+
const taskId = ((_d = options.cemiarLink) === null || _d === void 0 ? void 0 : _d.env) !== 'local' ? (_e = options.cemiarLink) === null || _e === void 0 ? void 0 : _e.taskId : undefined;
|
|
41
40
|
this.cemiarLinkClient = axios_1.default.create({
|
|
42
41
|
baseURL: cemiarLinkBaseURL,
|
|
43
42
|
headers: {
|
package/dist/index.js
CHANGED
|
@@ -18,23 +18,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
20
|
};
|
|
21
|
-
var __importStar = (this && this.__importStar) ||
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
38
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
29
|
exports.Utils = exports.Exceptions = exports.Services = exports.Models = void 0;
|
|
40
30
|
// Services
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OptionType } from './OptionType';
|
|
2
|
+
import { RenewalStage } from './RenewalStage';
|
|
2
3
|
export interface PolicyV2 {
|
|
3
4
|
AccountID: number;
|
|
4
5
|
AgencyCode: string;
|
|
@@ -182,4 +183,8 @@ export declare namespace PolicyV2Model {
|
|
|
182
183
|
IncludeRemarks: boolean;
|
|
183
184
|
IvansProductCode: string;
|
|
184
185
|
}
|
|
186
|
+
interface UpdateRenewalStages {
|
|
187
|
+
UpdateRenewalStageList: RenewalStage[];
|
|
188
|
+
ChangeStageToCode: number;
|
|
189
|
+
}
|
|
185
190
|
}
|
package/dist/models/index.js
CHANGED
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
27
|
};
|
|
@@ -61,6 +61,7 @@ export declare class EpicService extends BaseEpicService {
|
|
|
61
61
|
issueEndorsementPolicyV2(payload: PolicyV2Model.IssueEndorsement): Promise<void>;
|
|
62
62
|
issueCancellationPolicyV2(payload: PolicyV2Model.IssueCancellation): Promise<void>;
|
|
63
63
|
getPolicyV2RenewalStages(ids: number[]): Promise<RenewalStage[]>;
|
|
64
|
+
updatePolicyV2RenewalStages(payload: PolicyV2Model.UpdateRenewalStages): Promise<void>;
|
|
64
65
|
getPolicyLineType(lineTypeCode: string): Promise<PolicyV2Model.PolicyLineType>;
|
|
65
66
|
getEmployee(id: string): Promise<Broker>;
|
|
66
67
|
getEmployees(queryParams: object): Promise<Broker[]>;
|
|
@@ -110,6 +110,10 @@ class EpicService extends BaseEpicService_1.BaseEpicService {
|
|
|
110
110
|
ids: ids.join(','),
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
+
async updatePolicyV2RenewalStages(payload) {
|
|
114
|
+
await this.put('policyV2/renewalStage', payload);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
113
117
|
async getPolicyLineType(lineTypeCode) {
|
|
114
118
|
return this.getOne('policyV2/lineType', lineTypeCode);
|
|
115
119
|
}
|
package/dist/utils/Excel.js
CHANGED
|
@@ -7,8 +7,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
7
7
|
const xlsx_1 = __importDefault(require("xlsx"));
|
|
8
8
|
class readXlsx {
|
|
9
9
|
static async getFromXLSX(path, sheetNumber) {
|
|
10
|
-
var _a;
|
|
11
|
-
var _b;
|
|
10
|
+
var _a, _b;
|
|
12
11
|
const file = xlsx_1.default.readFile(path);
|
|
13
12
|
const worksheet = file.Sheets[file.SheetNames[sheetNumber]];
|
|
14
13
|
if (!worksheet) {
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cemiar/cemiarlink-sdk",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "CemiarLink SDK to access CemiarLink API services",
|
|
5
|
-
"engines": {
|
|
6
|
-
"npm": ">=9.5.1",
|
|
7
|
-
"node": ">=18.16.0"
|
|
8
|
-
},
|
|
9
|
-
"author": "Cemiar",
|
|
10
|
-
"license": "ISC",
|
|
11
|
-
"main": "dist/index.js",
|
|
12
|
-
"module": "./dist/index.mjs",
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
14
|
-
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"axios": "^1.18.0",
|
|
19
|
-
"nodemailer": "^9.0.1",
|
|
20
|
-
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/node": "^18.19.0",
|
|
24
|
-
"@types/nodemailer": "^8.0.1"
|
|
25
|
-
},
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "rm -rf dist/ && tsc -p tsconfig.json",
|
|
28
|
-
"buildWindows": "rmdir /s /q dist & tsc -p tsconfig.json"
|
|
29
|
-
},
|
|
30
|
-
"exports": {
|
|
31
|
-
".": {
|
|
32
|
-
"types": "./dist/index.d.ts",
|
|
33
|
-
"import": "./dist/index.js",
|
|
34
|
-
"default": "./dist/index.js"
|
|
35
|
-
},
|
|
36
|
-
"./epic-api": {
|
|
37
|
-
"types": "./dist/epic-api/index.d.ts",
|
|
38
|
-
"import": "./dist/epic-api/index.js",
|
|
39
|
-
"default": "./dist/epic-api/index.js"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cemiar/cemiarlink-sdk",
|
|
3
|
+
"version": "1.0.60",
|
|
4
|
+
"description": "CemiarLink SDK to access CemiarLink API services",
|
|
5
|
+
"engines": {
|
|
6
|
+
"npm": ">=9.5.1",
|
|
7
|
+
"node": ">=18.16.0"
|
|
8
|
+
},
|
|
9
|
+
"author": "Cemiar",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"module": "./dist/index.mjs",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"axios": "^1.18.0",
|
|
19
|
+
"nodemailer": "^9.0.1",
|
|
20
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^18.19.0",
|
|
24
|
+
"@types/nodemailer": "^8.0.1"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "rm -rf dist/ && tsc -p tsconfig.json",
|
|
28
|
+
"buildWindows": "rmdir /s /q dist & tsc -p tsconfig.json"
|
|
29
|
+
},
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./epic-api": {
|
|
37
|
+
"types": "./dist/epic-api/index.d.ts",
|
|
38
|
+
"import": "./dist/epic-api/index.js",
|
|
39
|
+
"default": "./dist/epic-api/index.js"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|