@cemiar/cemiarlink-sdk 1.0.63 → 1.0.65
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/TransactionV2.d.ts +503 -0
- package/dist/models/epic/TransactionV2.js +60 -0
- package/dist/models/epic/index.d.ts +1 -0
- package/dist/models/epic/index.js +1 -0
- package/dist/models/index.js +7 -17
- package/dist/services/Admin.d.ts +3 -0
- package/dist/services/Admin.js +7 -0
- package/dist/services/epic/EpicService.d.ts +2 -0
- package/dist/services/epic/EpicService.js +2 -0
- package/dist/services/epic/TransactionV2EpicService.d.ts +22 -0
- package/dist/services/epic/TransactionV2EpicService.js +52 -0
- package/dist/utils/Excel.js +1 -2
- package/package.json +42 -42
package/dist/services/Admin.d.ts
CHANGED
|
@@ -22,6 +22,9 @@ export declare class AdminService {
|
|
|
22
22
|
extractVehicles(payload: object): Promise<any>;
|
|
23
23
|
azureOCRExtraction(payload: object): Promise<AzureOCRResponse[]>;
|
|
24
24
|
getPdfText(fileContentBase64: string, engine?: string, page?: string): Promise<string[]>;
|
|
25
|
+
authenticatePdf(fileContentBase64: string, password: string): Promise<{
|
|
26
|
+
base64: string;
|
|
27
|
+
}>;
|
|
25
28
|
sendTextMessage(message: string, phoneNumber: string, name: string, enterprise: string | undefined): Promise<void>;
|
|
26
29
|
getModuleConfig(): Promise<any>;
|
|
27
30
|
getReportData<T>(date: string, fileName: string, sheetNumber: number): Promise<T[]>;
|
package/dist/services/Admin.js
CHANGED
|
@@ -77,6 +77,13 @@ class AdminService {
|
|
|
77
77
|
});
|
|
78
78
|
return response.data;
|
|
79
79
|
}
|
|
80
|
+
async authenticatePdf(fileContentBase64, password) {
|
|
81
|
+
const response = await this.axiosInstance.post(`pdfReader/authenticatePdf`, {
|
|
82
|
+
base64: fileContentBase64,
|
|
83
|
+
password: password,
|
|
84
|
+
});
|
|
85
|
+
return response.data;
|
|
86
|
+
}
|
|
80
87
|
async sendTextMessage(message, phoneNumber, name, enterprise) {
|
|
81
88
|
var _a;
|
|
82
89
|
try {
|
|
@@ -26,10 +26,12 @@ import { BaseEpicService } from './BaseEpicService';
|
|
|
26
26
|
import { CertificateEpicService } from './CertificateEpicService';
|
|
27
27
|
import { DirectBillCommissionEpicService } from './DirectBillCommissionEpicService';
|
|
28
28
|
import { MultiCarrierScheduleEpicService } from './MultiCarrierScheduleEpicService';
|
|
29
|
+
import { TransactionV2EpicService } from './TransactionV2EpicService';
|
|
29
30
|
export declare class EpicService extends BaseEpicService {
|
|
30
31
|
multiCarrierSchedule: MultiCarrierScheduleEpicService;
|
|
31
32
|
directBillCommission: DirectBillCommissionEpicService;
|
|
32
33
|
certificate: CertificateEpicService;
|
|
34
|
+
transactionV2: TransactionV2EpicService;
|
|
33
35
|
constructor(epicUrl: string | undefined, headers: any);
|
|
34
36
|
getActivity(activityId: string): Promise<Activity>;
|
|
35
37
|
getActivities(queryParams: object): Promise<Activity[]>;
|
|
@@ -6,12 +6,14 @@ const BaseEpicService_1 = require("./BaseEpicService");
|
|
|
6
6
|
const CertificateEpicService_1 = require("./CertificateEpicService");
|
|
7
7
|
const DirectBillCommissionEpicService_1 = require("./DirectBillCommissionEpicService");
|
|
8
8
|
const MultiCarrierScheduleEpicService_1 = require("./MultiCarrierScheduleEpicService");
|
|
9
|
+
const TransactionV2EpicService_1 = require("./TransactionV2EpicService");
|
|
9
10
|
class EpicService extends BaseEpicService_1.BaseEpicService {
|
|
10
11
|
constructor(epicUrl, headers) {
|
|
11
12
|
super(epicUrl, headers);
|
|
12
13
|
this.multiCarrierSchedule = new MultiCarrierScheduleEpicService_1.MultiCarrierScheduleEpicService(epicUrl, headers);
|
|
13
14
|
this.directBillCommission = new DirectBillCommissionEpicService_1.DirectBillCommissionEpicService(epicUrl, headers);
|
|
14
15
|
this.certificate = new CertificateEpicService_1.CertificateEpicService(epicUrl, headers);
|
|
16
|
+
this.transactionV2 = new TransactionV2EpicService_1.TransactionV2EpicService(epicUrl, headers);
|
|
15
17
|
}
|
|
16
18
|
async getActivity(activityId) {
|
|
17
19
|
return this.getOne('activity', activityId);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TransactionV2Model } from '../../models/epic/TransactionV2';
|
|
2
|
+
import { BaseEpicService } from './BaseEpicService';
|
|
3
|
+
/**
|
|
4
|
+
* TransactionV2EpicService provides methods for transaction V2 Epic API operations.
|
|
5
|
+
* It extends BaseEpicService for common API functionality.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TransactionV2EpicService extends BaseEpicService {
|
|
8
|
+
readonly baseUrl = "transactionV2";
|
|
9
|
+
getTransactions(queryParams: TransactionV2Model.TransactionFilter): Promise<TransactionV2Model.Transaction[]>;
|
|
10
|
+
getTransaction(id: number): Promise<TransactionV2Model.Transaction | undefined>;
|
|
11
|
+
createTransaction(payload: TransactionV2Model.CreateTransaction): Promise<number[]>;
|
|
12
|
+
updateTransaction(id: number, payload: TransactionV2Model.UpdateTransaction): Promise<string>;
|
|
13
|
+
/** Retrieve defaults before submitting an adjustCommission action. */
|
|
14
|
+
getDefaultAdjustCommission(id: number): Promise<TransactionV2Model.AdjustCommission[]>;
|
|
15
|
+
/** Retrieve defaults before submitting a revisePremium action. */
|
|
16
|
+
getDefaultRevisePremium(id: number): Promise<TransactionV2Model.RevisePremium[]>;
|
|
17
|
+
/** Retrieve defaults before submitting a reverseTransaction action. */
|
|
18
|
+
getDefaultReverse(id: number): Promise<TransactionV2Model.ReverseTransaction[]>;
|
|
19
|
+
adjustCommission(payload: TransactionV2Model.AdjustCommission): Promise<void>;
|
|
20
|
+
revisePremium(payload: TransactionV2Model.RevisePremium): Promise<void>;
|
|
21
|
+
reverseTransaction(payload: TransactionV2Model.ReverseTransaction): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionV2EpicService = void 0;
|
|
4
|
+
const BaseEpicService_1 = require("./BaseEpicService");
|
|
5
|
+
/**
|
|
6
|
+
* TransactionV2EpicService provides methods for transaction V2 Epic API operations.
|
|
7
|
+
* It extends BaseEpicService for common API functionality.
|
|
8
|
+
*/
|
|
9
|
+
class TransactionV2EpicService extends BaseEpicService_1.BaseEpicService {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.baseUrl = 'transactionV2';
|
|
13
|
+
}
|
|
14
|
+
async getTransactions(queryParams) {
|
|
15
|
+
return this.get(this.baseUrl, queryParams);
|
|
16
|
+
}
|
|
17
|
+
async getTransaction(id) {
|
|
18
|
+
const transactions = await this.getTransactions({ TransactionID: id });
|
|
19
|
+
return transactions && transactions.length > 0 ? transactions[0] : undefined;
|
|
20
|
+
}
|
|
21
|
+
async createTransaction(payload) {
|
|
22
|
+
const result = await this.post(this.baseUrl, payload);
|
|
23
|
+
// The HTTP helper returns string IDs; the SDK result is always a numeric array.
|
|
24
|
+
const ids = Array.isArray(result) ? result : [result];
|
|
25
|
+
return ids.map(Number);
|
|
26
|
+
}
|
|
27
|
+
async updateTransaction(id, payload) {
|
|
28
|
+
return await this.put(`${this.baseUrl}/${id}`, payload);
|
|
29
|
+
}
|
|
30
|
+
/** Retrieve defaults before submitting an adjustCommission action. */
|
|
31
|
+
async getDefaultAdjustCommission(id) {
|
|
32
|
+
return this.getOne(`${this.baseUrl}/defaultAdjustCommission`, id);
|
|
33
|
+
}
|
|
34
|
+
/** Retrieve defaults before submitting a revisePremium action. */
|
|
35
|
+
async getDefaultRevisePremium(id) {
|
|
36
|
+
return this.getOne(`${this.baseUrl}/defaultRevisePremium`, id);
|
|
37
|
+
}
|
|
38
|
+
/** Retrieve defaults before submitting a reverseTransaction action. */
|
|
39
|
+
async getDefaultReverse(id) {
|
|
40
|
+
return this.getOne(`${this.baseUrl}/reverse`, id);
|
|
41
|
+
}
|
|
42
|
+
async adjustCommission(payload) {
|
|
43
|
+
await this.put(`${this.baseUrl}/adjustCommission`, payload);
|
|
44
|
+
}
|
|
45
|
+
async revisePremium(payload) {
|
|
46
|
+
await this.put(`${this.baseUrl}/revisePremium`, payload);
|
|
47
|
+
}
|
|
48
|
+
async reverseTransaction(payload) {
|
|
49
|
+
await this.put(`${this.baseUrl}/reverse`, payload);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.TransactionV2EpicService = TransactionV2EpicService;
|
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.20.0",
|
|
19
|
-
"nodemailer": "^9.1.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.65",
|
|
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.20.0",
|
|
19
|
+
"nodemailer": "^9.1.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
|
+
}
|