@fatehan/tsrp 1.3.8 → 1.3.9
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/dist/api.js +2 -2
- package/dist/tests/api.test.js +6 -4
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -93,7 +93,7 @@ class ApiService {
|
|
|
93
93
|
async IoIndex(request) {
|
|
94
94
|
if (request.deviceId != null) {
|
|
95
95
|
const cachedIo = (0, system_io_1.getDeviceIoCache)(request.deviceId.toString());
|
|
96
|
-
if (cachedIo != null) {
|
|
96
|
+
if (cachedIo != null && cachedIo != undefined) {
|
|
97
97
|
return { cost: 0, ios: cachedIo, records: cachedIo.length };
|
|
98
98
|
}
|
|
99
99
|
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
|
@@ -103,7 +103,7 @@ class ApiService {
|
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
105
|
const cachedIo = (0, system_io_1.getSystemIoCache)();
|
|
106
|
-
if (cachedIo != null) {
|
|
106
|
+
if (cachedIo != null && cachedIo != undefined) {
|
|
107
107
|
return { cost: 0, ios: cachedIo, records: cachedIo.length };
|
|
108
108
|
}
|
|
109
109
|
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
package/dist/tests/api.test.js
CHANGED
|
@@ -10,8 +10,8 @@ global.fetch = vitest_1.vi.fn();
|
|
|
10
10
|
(0, vitest_1.beforeEach)(() => {
|
|
11
11
|
vitest_1.vi.clearAllMocks();
|
|
12
12
|
mockHeaderProvider = vitest_1.vi.fn(() => ({
|
|
13
|
-
authorization: "Bearer
|
|
14
|
-
"organization-id": "
|
|
13
|
+
authorization: "Bearer 258|1Pf5nFVZLvYfQD6BAXVi0PYuYR75ZfP05R8C1PXl314ba8dd",
|
|
14
|
+
"organization-id": "1000001",
|
|
15
15
|
}));
|
|
16
16
|
service = new api_1.ApiService(url, mockHeaderProvider);
|
|
17
17
|
});
|
|
@@ -52,7 +52,9 @@ global.fetch = vitest_1.vi.fn();
|
|
|
52
52
|
(0, vitest_1.expect)(global.fetch).toHaveBeenCalledWith(`${url}/com.fatehan.services.ApiService/DeviceIndex`, vitest_1.expect.any(Object));
|
|
53
53
|
});
|
|
54
54
|
(0, vitest_1.it)("should call IoIndex with correct headers and URL", async () => {
|
|
55
|
-
var x =
|
|
56
|
-
|
|
55
|
+
var x = service.IoIndex({}).then((x) => {
|
|
56
|
+
;
|
|
57
|
+
console.log(x);
|
|
58
|
+
});
|
|
57
59
|
});
|
|
58
60
|
});
|