@fatehan/tsrp 1.3.9 → 1.3.11

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 CHANGED
@@ -14,6 +14,6 @@ export declare class ApiService {
14
14
  ConfigIndex(request: import("./fatehan/services/api").ConfigRequest): Promise<import("./fatehan/services/api").ConfigResponse>;
15
15
  UserIndex(request: import("./fatehan/services/api").UserRequest): Promise<import("./fatehan/services/api").UserResponse>;
16
16
  IoIndex(request: import("./fatehan/services/api").IoRequest): Promise<import("./fatehan/services/api").IoResponse>;
17
- SystemIoCast(data: Data): Promise<ShownIo[]>;
17
+ IoCast(data: Data): Promise<ShownIo[]>;
18
18
  }
19
19
  //# sourceMappingURL=api.d.ts.map
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,O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,CACrB,OAAO,EAAE,OAAO,wBAAwB,EAAE,iBAAiB,GAC1D,OAAO,CAAC,OAAO,wBAAwB,EAAE,kBAAkB,CAAC;IAYlD,SAAS,CACpB,OAAO,EAAE,OAAO,wBAAwB,EAAE,gBAAgB,GACzD,OAAO,CAAC,OAAO,wBAAwB,EAAE,iBAAiB,CAAC;IAYjD,WAAW,CACtB,OAAO,EAAE,OAAO,wBAAwB,EAAE,aAAa,GACtD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC;IAO9C,SAAS,CACpB,OAAO,EAAE,OAAO,wBAAwB,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,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAuBpD"}
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,27 +93,41 @@ 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
- async SystemIoCast(data) {
130
+ async IoCast(data) {
116
131
  var _a, _b;
117
132
  var ioData, deviceIo;
118
133
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"system.io.d.ts","sourceRoot":"","sources":["../src/system.io.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EAET,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,QAAA,MAAM,YAAY,GAChB,UAAU,QAAQ,EAAE,EACpB,UAAU,QAAQ,EAAE,EACpB,MAAM,IAAI,KACT,OAAO,EA6DT,CAAC;AAuBF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"system.io.d.ts","sourceRoot":"","sources":["../src/system.io.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EAET,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,QAAA,MAAM,YAAY,GAChB,UAAU,QAAQ,EAAE,EACpB,UAAU,QAAQ,EAAE,EACpB,MAAM,IAAI,KACT,OAAO,EAqET,CAAC;AAuBF,eAAe,YAAY,CAAC"}
package/dist/system.io.js CHANGED
@@ -3,6 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const devices_1 = require("./fatehan/devices/devices");
4
4
  const SystemIoCast = (systemIo, deviceIo, data) => {
5
5
  let list = [];
6
+ if (systemIo == undefined || systemIo == null) {
7
+ systemIo = [];
8
+ }
9
+ if (deviceIo == undefined || deviceIo == null) {
10
+ deviceIo = [];
11
+ }
6
12
  const tempSystemIo = [...systemIo, ...deviceIo].sort((a, b) => a.sord - b.sord);
7
13
  tempSystemIo.forEach((io) => {
8
14
  let items = extractVariables(io.formula);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatehan/tsrp",
3
- "version": "1.3.9",
3
+ "version": "1.3.11",
4
4
  "description": "fatehan main models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",