bpjs-bridge 1.0.3 → 1.0.6
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 +9 -0
- package/dist/__test__/pcare.service.test.js +1 -1
- package/dist/services/antrean/fktpBPJS.service.d.ts +1 -2
- package/dist/services/antrean/fktpBPJS.service.js +2 -3
- package/dist/services/base.service.d.ts +1 -1
- package/dist/services/base.service.js +7 -5
- package/dist/services/i-care/icare.service.d.ts +1 -2
- package/dist/services/i-care/icare.service.js +2 -3
- package/dist/services/pcare/pcare.service.d.ts +1 -2
- package/dist/services/pcare/pcare.service.js +2 -3
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
Repository resmi: <a href="https://github.com/NewusTech/bpjs-bridge">NewusTech/bpjs-bridge</a>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
|
+
<div align="center">
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
13
22
|
## Installation
|
|
14
23
|
|
|
15
24
|
```bash
|
|
@@ -4,7 +4,7 @@ const redis_1 = require("../lib/redis");
|
|
|
4
4
|
const pcare_service_1 = require("../services/pcare/pcare.service");
|
|
5
5
|
const config_1 = require("./config");
|
|
6
6
|
// Setup PcareService
|
|
7
|
-
const pcareService = new pcare_service_1.PcareService(config_1.PcareConfig, redis_1.redis
|
|
7
|
+
const pcareService = new pcare_service_1.PcareService(config_1.PcareConfig, redis_1.redis);
|
|
8
8
|
describe("PcareService", () => {
|
|
9
9
|
afterAll(() => {
|
|
10
10
|
redis_1.redis.disconnect();
|
|
@@ -11,9 +11,8 @@ export declare class AntreanFktpService extends BaseService {
|
|
|
11
11
|
* Constructor AntreanFktpService
|
|
12
12
|
* @param config konfigurasi BPJS
|
|
13
13
|
* @param redisClient instance Redis (opsional)
|
|
14
|
-
* @param chachePrefix prefix untuk cache Redis (opsional)
|
|
15
14
|
*/
|
|
16
|
-
constructor(config: configType, redisClient?: Redis
|
|
15
|
+
constructor(config: configType, redisClient?: Redis);
|
|
17
16
|
/**
|
|
18
17
|
*
|
|
19
18
|
* @param tanggal
|
|
@@ -11,11 +11,10 @@ class AntreanFktpService extends base_service_1.BaseService {
|
|
|
11
11
|
* Constructor AntreanFktpService
|
|
12
12
|
* @param config konfigurasi BPJS
|
|
13
13
|
* @param redisClient instance Redis (opsional)
|
|
14
|
-
* @param chachePrefix prefix untuk cache Redis (opsional)
|
|
15
14
|
*/
|
|
16
|
-
constructor(config, redisClient
|
|
15
|
+
constructor(config, redisClient) {
|
|
17
16
|
const getBaseUrl = enpoints_1.BaseUrl[config.mode].url_antrean_fktp;
|
|
18
|
-
super({ ...config, baseUrl: getBaseUrl }, redisClient
|
|
17
|
+
super({ ...config, baseUrl: getBaseUrl }, redisClient);
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
*
|
|
@@ -6,7 +6,7 @@ export declare class BaseService {
|
|
|
6
6
|
private client;
|
|
7
7
|
private redisClient;
|
|
8
8
|
private defaultRedisKeyPrefix;
|
|
9
|
-
constructor(config: BpjsCLient, redisClient?: Redis
|
|
9
|
+
constructor(config: BpjsCLient, redisClient?: Redis);
|
|
10
10
|
/**
|
|
11
11
|
* Menyimpan data ke Redis dengan TTL (time-to-live)
|
|
12
12
|
* @param key - Kunci data
|
|
@@ -5,7 +5,7 @@ const enpoints_1 = require("../config/enpoints");
|
|
|
5
5
|
const httpClient_1 = require("../core/httpClient");
|
|
6
6
|
const globalErroModule_1 = require("../types/globalErroModule");
|
|
7
7
|
class BaseService {
|
|
8
|
-
constructor(config, redisClient
|
|
8
|
+
constructor(config, redisClient) {
|
|
9
9
|
this.redisClient = null;
|
|
10
10
|
this.defaultRedisKeyPrefix = "bpjs_bridge_fktp";
|
|
11
11
|
this.client = (0, httpClient_1.createBpjsClient)(config); // client dari axios yang sudah disiapkan
|
|
@@ -17,10 +17,12 @@ class BaseService {
|
|
|
17
17
|
this.redisClient.on("error", (err) => {
|
|
18
18
|
console.error("[BRIDGE FKTP BPJS] => ❌ Redis error:", err);
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
this.defaultRedisKeyPrefix
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
this.defaultRedisKeyPrefix =
|
|
21
|
+
this.defaultRedisKeyPrefix +
|
|
22
|
+
"_" +
|
|
23
|
+
config.consId +
|
|
24
|
+
config.username +
|
|
25
|
+
":";
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
@@ -10,9 +10,8 @@ export declare class IcareService extends BaseService {
|
|
|
10
10
|
* Constructor AntreanFktpService
|
|
11
11
|
* @param config konfigurasi BPJS
|
|
12
12
|
* @param redisClient instance Redis (opsional)
|
|
13
|
-
* @param chachePrefix prefix untuk cache Redis (opsional)
|
|
14
13
|
*/
|
|
15
|
-
constructor(config: configType, redisClient?: Redis
|
|
14
|
+
constructor(config: configType, redisClient?: Redis);
|
|
16
15
|
/**
|
|
17
16
|
*
|
|
18
17
|
* @param body
|
|
@@ -11,11 +11,10 @@ class IcareService extends base_service_1.BaseService {
|
|
|
11
11
|
* Constructor AntreanFktpService
|
|
12
12
|
* @param config konfigurasi BPJS
|
|
13
13
|
* @param redisClient instance Redis (opsional)
|
|
14
|
-
* @param chachePrefix prefix untuk cache Redis (opsional)
|
|
15
14
|
*/
|
|
16
|
-
constructor(config, redisClient
|
|
15
|
+
constructor(config, redisClient) {
|
|
17
16
|
const getBaseUrl = enpoints_1.BaseUrl[config.mode].url_antrean_fktp;
|
|
18
|
-
super({ ...config, baseUrl: getBaseUrl }, redisClient
|
|
17
|
+
super({ ...config, baseUrl: getBaseUrl }, redisClient);
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
*
|
|
@@ -39,7 +39,6 @@ export declare class PcareService extends BaseService {
|
|
|
39
39
|
* Constructor PcareService
|
|
40
40
|
* @param config konfigurasi BPJS
|
|
41
41
|
* @param redisClient instance Redis (opsional)
|
|
42
|
-
* @param chachePrefix prefix untuk cache Redis (opsional)
|
|
43
42
|
*/
|
|
44
|
-
constructor(config: configType, redisClient?: Redis
|
|
43
|
+
constructor(config: configType, redisClient?: Redis);
|
|
45
44
|
}
|
|
@@ -26,11 +26,10 @@ class PcareService extends base_service_1.BaseService {
|
|
|
26
26
|
* Constructor PcareService
|
|
27
27
|
* @param config konfigurasi BPJS
|
|
28
28
|
* @param redisClient instance Redis (opsional)
|
|
29
|
-
* @param chachePrefix prefix untuk cache Redis (opsional)
|
|
30
29
|
*/
|
|
31
|
-
constructor(config, redisClient
|
|
30
|
+
constructor(config, redisClient) {
|
|
32
31
|
const getBaseUrl = enpoints_1.BaseUrl[config.mode].url_pcare;
|
|
33
|
-
super({ ...config, baseUrl: getBaseUrl }, redisClient
|
|
32
|
+
super({ ...config, baseUrl: getBaseUrl }, redisClient);
|
|
34
33
|
this.diagnosa = new diagnosa_module_1.DiagnosaModule(this);
|
|
35
34
|
this.obat = new obat_module_1.ObatModule(this);
|
|
36
35
|
this.dokter = new dokter_module_1.DokterModule(this);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpjs-bridge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Integrasi BPJS PCare, Antrean FKTP, VClaim, dan iCare dengan dukungan Redis Cache, Logging, dan Modular Service Architecture. ",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"icare",
|
|
15
15
|
"bpjs-kesehatan"
|
|
16
16
|
],
|
|
17
|
+
"repository": "https://github.com/newustechnology/bpjs-bridge.git",
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
17
21
|
"files": [
|
|
18
22
|
"dist/**/*"
|
|
19
23
|
],
|
|
@@ -22,7 +26,8 @@
|
|
|
22
26
|
"scripts": {
|
|
23
27
|
"build": "tsc -p tsconfig.json",
|
|
24
28
|
"test": "npx jest --detectOpenHandles",
|
|
25
|
-
"prepare": "npm run build"
|
|
29
|
+
"prepare": "npm run build",
|
|
30
|
+
"release": "npm version patch && git push && git push --tags"
|
|
26
31
|
},
|
|
27
32
|
"dependencies": {
|
|
28
33
|
"axios": "^1.13.2",
|