@fatehan/tsrp 1.3.9 → 1.3.10

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.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AASnD,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6C;IACvE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;gBAEvC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc;YAKzC,KAAK;IAgCN,OAAO,CAChB,OAAO,EAAE,OAAO,wBAAwB,EAAE,SAAS,GACpD,OAAO,CAAC,OAAO,wBAAwB,EAAE,UAAU,CAAC;IAK1C,WAAW,CACpB,OAAO,EAAE,OAAO,wBAAwB,EAAE,aAAa,GACxD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC;IAO9C,UAAU,CACnB,OAAO,EAAE,OAAO,wBAAwB,EAAE,iBAAiB,GAC5D,OAAO,CAAC,OAAO,wBAAwB,EAAE,kBAAkB,CAAC;IAOlD,SAAS,CAClB,OAAO,EAAE,OAAO,wBAAwB,EAAE,gBAAgB,GAC3D,OAAO,CAAC,OAAO,wBAAwB,EAAE,iBAAiB,CAAC;IAYjD,WAAW,CACpB,OAAO,EAAE,OAAO,wBAAwB,EAAE,aAAa,GACxD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC;IAO9C,SAAS,CAClB,OAAO,EAAE,OAAO,wBAAwB,EAAE,WAAW,GACtD,OAAO,CAAC,OAAO,wBAAwB,EAAE,Y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wB,EAAE,WAAW,GACpD,OAAO,CAAC,OAAO,wBAAwB,EAAE,YAAY,CAAC;IAO5C,OAAO,CAClB,OAAO,EAAE,OAAO,wBAAwB,EAAE,SAAS,GAClD,OAAO,CAAC,OAAO,wBAAwB,EAAE,UAAU,CAAC;IAgD1C,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAuB1D"}
package/dist/api.js CHANGED
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.ApiService = void 0;
40
40
  const system_io_1 = require("./store/system.io");
41
41
  const system_io_2 = __importDefault(require("./system.io"));
42
+ const api_1 = require("./fatehan/services/api");
42
43
  class ApiService {
43
44
  constructor(url, headerProvider) {
44
45
  this.namespace = "com.fatehan.services.ApiService";
@@ -92,24 +93,38 @@ class ApiService {
92
93
  }
93
94
  async IoIndex(request) {
94
95
  if (request.deviceId != null) {
95
- const cachedIo = (0, system_io_1.getDeviceIoCache)(request.deviceId.toString());
96
- if (cachedIo != null && cachedIo != undefined) {
97
- return { cost: 0, ios: cachedIo, records: cachedIo.length };
96
+ try {
97
+ const cachedIo = (0, system_io_1.getDeviceIoCache)(request.deviceId.toString());
98
+ if (cachedIo != null && cachedIo != undefined) {
99
+ return { cost: 0, ios: cachedIo, records: cachedIo.length };
100
+ }
101
+ const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
102
+ const response = await this._call("IoIndex", request, IoRequest, IoResponse);
103
+ if (response.records > 0) {
104
+ (0, system_io_1.setDeviceIoCache)(request.deviceId.toString(), response.ios);
105
+ }
106
+ return response;
107
+ }
108
+ catch (ex) {
109
+ console.error("device io exception", ex);
110
+ return api_1.IoResponse.create({ ios: [] });
98
111
  }
99
- const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
100
- const response = await this._call("IoIndex", request, IoRequest, IoResponse);
101
- (0, system_io_1.setDeviceIoCache)(request.deviceId.toString(), response.ios);
102
- return response;
103
112
  }
104
113
  else {
105
- const cachedIo = (0, system_io_1.getSystemIoCache)();
106
- if (cachedIo != null && cachedIo != undefined) {
107
- return { cost: 0, ios: cachedIo, records: cachedIo.length };
114
+ try {
115
+ const cachedIo = (0, system_io_1.getSystemIoCache)();
116
+ if (cachedIo != null && cachedIo != undefined) {
117
+ return { cost: 0, ios: cachedIo, records: cachedIo.length };
118
+ }
119
+ const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
120
+ const response = await this._call("IoIndex", request, IoRequest, IoResponse);
121
+ (0, system_io_1.setSystemIoCache)(response.ios);
122
+ return response;
123
+ }
124
+ catch (ex) {
125
+ console.error("device io exception", ex);
126
+ return api_1.IoResponse.create({ ios: [] });
108
127
  }
109
- const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
110
- const response = await this._call("IoIndex", request, IoRequest, IoResponse);
111
- (0, system_io_1.setSystemIoCache)(response.ios);
112
- return response;
113
128
  }
114
129
  }
115
130
  async SystemIoCast(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatehan/tsrp",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "description": "fatehan main models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",