@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 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")));
@@ -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 test-token-from-mock",
14
- "organization-id": "test-org-from-mock",
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 = await service.IoIndex({});
56
- console.log(x);
55
+ var x = service.IoIndex({}).then((x) => {
56
+ ;
57
+ console.log(x);
58
+ });
57
59
  });
58
60
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatehan/tsrp",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "fatehan main models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",