@fatehan/tsrp 1.3.10 → 1.3.12
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 +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +30 -48
- package/dist/system.io.d.ts.map +1 -1
- package/dist/system.io.js +6 -0
- package/package.json +1 -1
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
|
-
|
|
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;AAUnD,qBAAa,UAAU;IACrB,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,CAClB,OAAO,EAAE,OAAO,wBAAwB,EAAE,SAAS,GAClD,OAAO,CAAC,OAAO,wBAAwB,EAAE,UAAU,CAAC;IAK1C,WAAW,C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,wBAAwB,EAAE,aAAa,GACtD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC;IAO9C,UAAU,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;IAwC1C,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAgBpD"}
|
package/dist/api.js
CHANGED
|
@@ -93,64 +93,46 @@ class ApiService {
|
|
|
93
93
|
}
|
|
94
94
|
async IoIndex(request) {
|
|
95
95
|
if (request.deviceId != null) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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;
|
|
96
|
+
// trying to fetch from cache
|
|
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 };
|
|
107
100
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
// trying to fetch from server
|
|
102
|
+
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
|
103
|
+
const response = await this._call("IoIndex", request, IoRequest, IoResponse);
|
|
104
|
+
if (response.records > 0) {
|
|
105
|
+
(0, system_io_1.setDeviceIoCache)(request.deviceId.toString(), response.ios);
|
|
111
106
|
}
|
|
107
|
+
return response;
|
|
112
108
|
}
|
|
113
109
|
else {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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;
|
|
110
|
+
// trying to fetch from cache
|
|
111
|
+
const cachedIo = (0, system_io_1.getSystemIoCache)();
|
|
112
|
+
if (cachedIo != null && cachedIo != undefined) {
|
|
113
|
+
return { cost: 0, ios: cachedIo, records: cachedIo.length };
|
|
123
114
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
115
|
+
// trying to fetch from server
|
|
116
|
+
const { IoRequest, IoResponse } = await Promise.resolve().then(() => __importStar(require("./fatehan/services/api")));
|
|
117
|
+
const response = await this._call("IoIndex", request, IoRequest, IoResponse);
|
|
118
|
+
if (response.records > 0) {
|
|
119
|
+
(0, system_io_1.setSystemIoCache)(response.ios);
|
|
127
120
|
}
|
|
121
|
+
return response;
|
|
128
122
|
}
|
|
129
123
|
}
|
|
130
|
-
async
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return [];
|
|
137
|
-
ioData = result.ios;
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
console.error("Failed to fetch SystemIoReport in SystemIoCast:", error);
|
|
141
|
-
return [];
|
|
142
|
-
}
|
|
143
|
-
try {
|
|
144
|
-
const result = await this.IoIndex({ deviceId: data.deviceId });
|
|
145
|
-
if (!((_b = result === null || result === void 0 ? void 0 : result.ios) === null || _b === void 0 ? void 0 : _b.length))
|
|
146
|
-
return [];
|
|
147
|
-
deviceIo = result.ios;
|
|
124
|
+
async IoCast(data) {
|
|
125
|
+
var ioData = api_1.IoResponse.create({ ios: [] });
|
|
126
|
+
var deviceIo = api_1.IoResponse.create({ ios: [] });
|
|
127
|
+
const systemIoResult = await this.IoIndex({});
|
|
128
|
+
if (systemIoResult != undefined && systemIoResult != null) {
|
|
129
|
+
ioData = systemIoResult;
|
|
148
130
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
131
|
+
const deviceIoResult = await this.IoIndex({ deviceId: data.deviceId });
|
|
132
|
+
if (deviceIoResult != undefined && deviceIoResult != null) {
|
|
133
|
+
deviceIo = deviceIoResult;
|
|
152
134
|
}
|
|
153
|
-
return (0, system_io_2.default)(ioData, deviceIo, data);
|
|
135
|
+
return (0, system_io_2.default)(ioData.ios, deviceIo.ios, data);
|
|
154
136
|
}
|
|
155
137
|
}
|
|
156
138
|
exports.ApiService = ApiService;
|
package/dist/system.io.d.ts.map
CHANGED
|
@@ -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,
|
|
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);
|