@fatehan/tsrp 1.0.11 → 1.0.13
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/fatehan/models/fusion.d.ts +28 -0
- package/dist/fatehan/models/fusion.d.ts.map +1 -1
- package/dist/fatehan/models/fusion.js +427 -1
- package/dist/fatehan/models/models.d.ts +52 -1
- package/dist/fatehan/models/models.d.ts.map +1 -1
- package/dist/fatehan/models/models.js +807 -16
- package/dist/fatehan/models/operation.js +2 -2
- package/dist/fatehan/packets/dataModel.d.ts +23 -7
- package/dist/fatehan/packets/dataModel.d.ts.map +1 -1
- package/dist/fatehan/packets/dataModel.js +353 -96
- package/dist/fatehan/packets/messages.d.ts +22 -24
- package/dist/fatehan/packets/messages.d.ts.map +1 -1
- package/dist/fatehan/packets/messages.js +167 -218
- package/dist/fatehan/reports/report.d.ts +77 -60
- package/dist/fatehan/reports/report.d.ts.map +1 -1
- package/dist/fatehan/reports/report.js +760 -499
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.test.js +4 -3
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/fatehan/packets/messages.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,oBAAY,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/fatehan/packets/messages.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,oBAAY,aAAa;IACvB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,KAAK,IAAI;IACT,IAAI,IAAI;IACR,YAAY,KAAK;C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Module", { value: true });
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
8
|
+
exports.Command = exports.CommandAkn = exports.CommandContent = exports.CommandStatus = exports.protobufPackage = void 0;
|
|
9
|
+
exports.commandStatusFromJSON = commandStatusFromJSON;
|
|
10
|
+
exports.commandStatusToJSON = commandStatusToJSON;
|
|
11
11
|
/* eslint-disable */
|
|
12
12
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
13
13
|
exports.protobufPackage = "com.fatehan.packets";
|
|
14
|
-
var
|
|
15
|
-
(function (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})(
|
|
22
|
-
function
|
|
14
|
+
var CommandStatus;
|
|
15
|
+
(function (CommandStatus) {
|
|
16
|
+
CommandStatus[CommandStatus["PENDING"] = 0] = "PENDING";
|
|
17
|
+
CommandStatus[CommandStatus["OFFLINE"] = 1] = "OFFLINE";
|
|
18
|
+
CommandStatus[CommandStatus["ERROR"] = 2] = "ERROR";
|
|
19
|
+
CommandStatus[CommandStatus["SENT"] = 3] = "SENT";
|
|
20
|
+
CommandStatus[CommandStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
21
|
+
})(CommandStatus || (exports.CommandStatus = CommandStatus = {}));
|
|
22
|
+
function commandStatusFromJSON(object) {
|
|
23
23
|
switch (object) {
|
|
24
24
|
case 0:
|
|
25
|
-
case "
|
|
26
|
-
return
|
|
25
|
+
case "PENDING":
|
|
26
|
+
return CommandStatus.PENDING;
|
|
27
27
|
case 1:
|
|
28
|
-
case "
|
|
29
|
-
return
|
|
28
|
+
case "OFFLINE":
|
|
29
|
+
return CommandStatus.OFFLINE;
|
|
30
30
|
case 2:
|
|
31
|
-
case "
|
|
32
|
-
return
|
|
31
|
+
case "ERROR":
|
|
32
|
+
return CommandStatus.ERROR;
|
|
33
33
|
case 3:
|
|
34
|
-
case "
|
|
35
|
-
return
|
|
34
|
+
case "SENT":
|
|
35
|
+
return CommandStatus.SENT;
|
|
36
36
|
case -1:
|
|
37
37
|
case "UNRECOGNIZED":
|
|
38
38
|
default:
|
|
39
|
-
return
|
|
39
|
+
return CommandStatus.UNRECOGNIZED;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function commandStatusToJSON(object) {
|
|
43
43
|
switch (object) {
|
|
44
|
-
case
|
|
45
|
-
return "
|
|
46
|
-
case
|
|
47
|
-
return "
|
|
48
|
-
case
|
|
49
|
-
return "
|
|
50
|
-
case
|
|
51
|
-
return "
|
|
52
|
-
case
|
|
44
|
+
case CommandStatus.PENDING:
|
|
45
|
+
return "PENDING";
|
|
46
|
+
case CommandStatus.OFFLINE:
|
|
47
|
+
return "OFFLINE";
|
|
48
|
+
case CommandStatus.ERROR:
|
|
49
|
+
return "ERROR";
|
|
50
|
+
case CommandStatus.SENT:
|
|
51
|
+
return "SENT";
|
|
52
|
+
case CommandStatus.UNRECOGNIZED:
|
|
53
53
|
default:
|
|
54
54
|
return "UNRECOGNIZED";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return {
|
|
57
|
+
function createBaseCommandContent() {
|
|
58
|
+
return { message: "" };
|
|
59
59
|
}
|
|
60
|
-
exports.
|
|
60
|
+
exports.CommandContent = {
|
|
61
61
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
62
|
-
if (message.
|
|
63
|
-
writer.uint32(
|
|
64
|
-
}
|
|
65
|
-
if (message.command !== "") {
|
|
66
|
-
writer.uint32(18).string(message.command);
|
|
67
|
-
}
|
|
68
|
-
if (message.commandId !== 0) {
|
|
69
|
-
writer.uint32(24).uint64(message.commandId);
|
|
62
|
+
if (message.message !== "") {
|
|
63
|
+
writer.uint32(10).string(message.message);
|
|
70
64
|
}
|
|
71
65
|
return writer;
|
|
72
66
|
},
|
|
73
67
|
decode(input, length) {
|
|
74
68
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
75
69
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
76
|
-
const message =
|
|
70
|
+
const message = createBaseCommandContent();
|
|
77
71
|
while (reader.pos < end) {
|
|
78
72
|
const tag = reader.uint32();
|
|
79
73
|
switch (tag >>> 3) {
|
|
80
74
|
case 1: {
|
|
81
|
-
if (tag !==
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
message.deviceId = longToNumber(reader.uint64());
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
case 2: {
|
|
88
|
-
if (tag !== 18) {
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
message.command = reader.string();
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
case 3: {
|
|
95
|
-
if (tag !== 24) {
|
|
75
|
+
if (tag !== 10) {
|
|
96
76
|
break;
|
|
97
77
|
}
|
|
98
|
-
message.
|
|
78
|
+
message.message = reader.string();
|
|
99
79
|
continue;
|
|
100
80
|
}
|
|
101
81
|
}
|
|
@@ -107,76 +87,54 @@ exports.DeviceCommand = {
|
|
|
107
87
|
return message;
|
|
108
88
|
},
|
|
109
89
|
fromJSON(object) {
|
|
110
|
-
return {
|
|
111
|
-
deviceId: isSet(object.device_id) ? globalThis.Number(object.device_id) : 0,
|
|
112
|
-
command: isSet(object.command) ? globalThis.String(object.command) : "",
|
|
113
|
-
commandId: isSet(object.command_id) ? globalThis.Number(object.command_id) : 0,
|
|
114
|
-
};
|
|
90
|
+
return { message: isSet(object.message) ? globalThis.String(object.message) : "" };
|
|
115
91
|
},
|
|
116
92
|
toJSON(message) {
|
|
117
93
|
const obj = {};
|
|
118
|
-
if (message.
|
|
119
|
-
obj.
|
|
120
|
-
}
|
|
121
|
-
if (message.command !== "") {
|
|
122
|
-
obj.command = message.command;
|
|
123
|
-
}
|
|
124
|
-
if (message.commandId !== 0) {
|
|
125
|
-
obj.command_id = Math.round(message.commandId);
|
|
94
|
+
if (message.message !== "") {
|
|
95
|
+
obj.message = message.message;
|
|
126
96
|
}
|
|
127
97
|
return obj;
|
|
128
98
|
},
|
|
129
99
|
create(base) {
|
|
130
|
-
return exports.
|
|
100
|
+
return exports.CommandContent.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
131
101
|
},
|
|
132
102
|
fromPartial(object) {
|
|
133
|
-
var _a
|
|
134
|
-
const message =
|
|
135
|
-
message.
|
|
136
|
-
message.command = (_b = object.command) !== null && _b !== void 0 ? _b : "";
|
|
137
|
-
message.commandId = (_c = object.commandId) !== null && _c !== void 0 ? _c : 0;
|
|
103
|
+
var _a;
|
|
104
|
+
const message = createBaseCommandContent();
|
|
105
|
+
message.message = (_a = object.message) !== null && _a !== void 0 ? _a : "";
|
|
138
106
|
return message;
|
|
139
107
|
},
|
|
140
108
|
};
|
|
141
|
-
function
|
|
142
|
-
return {
|
|
109
|
+
function createBaseCommandAkn() {
|
|
110
|
+
return { code: 0, message: "" };
|
|
143
111
|
}
|
|
144
|
-
exports.
|
|
112
|
+
exports.CommandAkn = {
|
|
145
113
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
146
|
-
if (message.
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
if (message.status !== 0) {
|
|
150
|
-
writer.uint32(16).uint32(message.status);
|
|
114
|
+
if (message.code !== 0) {
|
|
115
|
+
writer.uint32(8).sint32(message.code);
|
|
151
116
|
}
|
|
152
117
|
if (message.message !== "") {
|
|
153
|
-
writer.uint32(
|
|
118
|
+
writer.uint32(18).string(message.message);
|
|
154
119
|
}
|
|
155
120
|
return writer;
|
|
156
121
|
},
|
|
157
122
|
decode(input, length) {
|
|
158
123
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
159
124
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
160
|
-
const message =
|
|
125
|
+
const message = createBaseCommandAkn();
|
|
161
126
|
while (reader.pos < end) {
|
|
162
127
|
const tag = reader.uint32();
|
|
163
128
|
switch (tag >>> 3) {
|
|
164
129
|
case 1: {
|
|
165
|
-
if (tag !==
|
|
130
|
+
if (tag !== 8) {
|
|
166
131
|
break;
|
|
167
132
|
}
|
|
168
|
-
message.
|
|
133
|
+
message.code = reader.sint32();
|
|
169
134
|
continue;
|
|
170
135
|
}
|
|
171
136
|
case 2: {
|
|
172
|
-
if (tag !==
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
message.status = reader.uint32();
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
case 3: {
|
|
179
|
-
if (tag !== 26) {
|
|
137
|
+
if (tag !== 18) {
|
|
180
138
|
break;
|
|
181
139
|
}
|
|
182
140
|
message.message = reader.string();
|
|
@@ -192,18 +150,14 @@ exports.DeviceCommandAkn = {
|
|
|
192
150
|
},
|
|
193
151
|
fromJSON(object) {
|
|
194
152
|
return {
|
|
195
|
-
|
|
196
|
-
status: isSet(object.status) ? globalThis.Number(object.status) : 0,
|
|
153
|
+
code: isSet(object.code) ? globalThis.Number(object.code) : 0,
|
|
197
154
|
message: isSet(object.message) ? globalThis.String(object.message) : "",
|
|
198
155
|
};
|
|
199
156
|
},
|
|
200
157
|
toJSON(message) {
|
|
201
158
|
const obj = {};
|
|
202
|
-
if (message.
|
|
203
|
-
obj.
|
|
204
|
-
}
|
|
205
|
-
if (message.status !== 0) {
|
|
206
|
-
obj.status = Math.round(message.status);
|
|
159
|
+
if (message.code !== 0) {
|
|
160
|
+
obj.code = Math.round(message.code);
|
|
207
161
|
}
|
|
208
162
|
if (message.message !== "") {
|
|
209
163
|
obj.message = message.message;
|
|
@@ -211,36 +165,51 @@ exports.DeviceCommandAkn = {
|
|
|
211
165
|
return obj;
|
|
212
166
|
},
|
|
213
167
|
create(base) {
|
|
214
|
-
return exports.
|
|
168
|
+
return exports.CommandAkn.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
215
169
|
},
|
|
216
170
|
fromPartial(object) {
|
|
217
171
|
var _a, _b;
|
|
218
|
-
const message =
|
|
219
|
-
message.
|
|
220
|
-
? exports.DeviceCommand.fromPartial(object.command)
|
|
221
|
-
: undefined;
|
|
222
|
-
message.status = (_a = object.status) !== null && _a !== void 0 ? _a : 0;
|
|
172
|
+
const message = createBaseCommandAkn();
|
|
173
|
+
message.code = (_a = object.code) !== null && _a !== void 0 ? _a : 0;
|
|
223
174
|
message.message = (_b = object.message) !== null && _b !== void 0 ? _b : "";
|
|
224
175
|
return message;
|
|
225
176
|
},
|
|
226
177
|
};
|
|
227
|
-
function
|
|
228
|
-
return { deviceId: 0,
|
|
178
|
+
function createBaseCommand() {
|
|
179
|
+
return { id: 0, deviceId: 0, userId: 0, commandId: 0, replyId: 0, status: 0, command: undefined, akn: undefined };
|
|
229
180
|
}
|
|
230
|
-
exports.
|
|
181
|
+
exports.Command = {
|
|
231
182
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
183
|
+
if (message.id !== 0) {
|
|
184
|
+
writer.uint32(8).uint64(message.id);
|
|
185
|
+
}
|
|
232
186
|
if (message.deviceId !== 0) {
|
|
233
|
-
writer.uint32(
|
|
187
|
+
writer.uint32(16).uint64(message.deviceId);
|
|
188
|
+
}
|
|
189
|
+
if (message.userId !== 0) {
|
|
190
|
+
writer.uint32(24).uint64(message.userId);
|
|
191
|
+
}
|
|
192
|
+
if (message.commandId !== 0) {
|
|
193
|
+
writer.uint32(32).uint64(message.commandId);
|
|
194
|
+
}
|
|
195
|
+
if (message.replyId !== 0) {
|
|
196
|
+
writer.uint32(40).uint64(message.replyId);
|
|
197
|
+
}
|
|
198
|
+
if (message.status !== 0) {
|
|
199
|
+
writer.uint32(48).int32(message.status);
|
|
200
|
+
}
|
|
201
|
+
if (message.command !== undefined) {
|
|
202
|
+
exports.CommandContent.encode(message.command, writer.uint32(58).fork()).join();
|
|
234
203
|
}
|
|
235
|
-
if (message.
|
|
236
|
-
writer.uint32(
|
|
204
|
+
if (message.akn !== undefined) {
|
|
205
|
+
exports.CommandAkn.encode(message.akn, writer.uint32(66).fork()).join();
|
|
237
206
|
}
|
|
238
207
|
return writer;
|
|
239
208
|
},
|
|
240
209
|
decode(input, length) {
|
|
241
210
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
242
211
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
243
|
-
const message =
|
|
212
|
+
const message = createBaseCommand();
|
|
244
213
|
while (reader.pos < end) {
|
|
245
214
|
const tag = reader.uint32();
|
|
246
215
|
switch (tag >>> 3) {
|
|
@@ -248,83 +217,56 @@ exports.DeviceAnswer = {
|
|
|
248
217
|
if (tag !== 8) {
|
|
249
218
|
break;
|
|
250
219
|
}
|
|
251
|
-
message.
|
|
220
|
+
message.id = longToNumber(reader.uint64());
|
|
252
221
|
continue;
|
|
253
222
|
}
|
|
254
223
|
case 2: {
|
|
255
|
-
if (tag !==
|
|
224
|
+
if (tag !== 16) {
|
|
256
225
|
break;
|
|
257
226
|
}
|
|
258
|
-
message.
|
|
227
|
+
message.deviceId = longToNumber(reader.uint64());
|
|
259
228
|
continue;
|
|
260
229
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
265
|
-
reader.skip(tag & 7);
|
|
266
|
-
}
|
|
267
|
-
return message;
|
|
268
|
-
},
|
|
269
|
-
fromJSON(object) {
|
|
270
|
-
return {
|
|
271
|
-
deviceId: isSet(object.device_id) ? globalThis.Number(object.device_id) : 0,
|
|
272
|
-
answer: isSet(object.answer) ? globalThis.String(object.answer) : "",
|
|
273
|
-
};
|
|
274
|
-
},
|
|
275
|
-
toJSON(message) {
|
|
276
|
-
const obj = {};
|
|
277
|
-
if (message.deviceId !== 0) {
|
|
278
|
-
obj.device_id = Math.round(message.deviceId);
|
|
279
|
-
}
|
|
280
|
-
if (message.answer !== "") {
|
|
281
|
-
obj.answer = message.answer;
|
|
282
|
-
}
|
|
283
|
-
return obj;
|
|
284
|
-
},
|
|
285
|
-
create(base) {
|
|
286
|
-
return exports.DeviceAnswer.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
287
|
-
},
|
|
288
|
-
fromPartial(object) {
|
|
289
|
-
var _a, _b;
|
|
290
|
-
const message = createBaseDeviceAnswer();
|
|
291
|
-
message.deviceId = (_a = object.deviceId) !== null && _a !== void 0 ? _a : 0;
|
|
292
|
-
message.answer = (_b = object.answer) !== null && _b !== void 0 ? _b : "";
|
|
293
|
-
return message;
|
|
294
|
-
},
|
|
295
|
-
};
|
|
296
|
-
function createBaseBrokerMessage() {
|
|
297
|
-
return { type: 0, message: new Uint8Array(0) };
|
|
298
|
-
}
|
|
299
|
-
exports.BrokerMessage = {
|
|
300
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
301
|
-
if (message.type !== 0) {
|
|
302
|
-
writer.uint32(8).int32(message.type);
|
|
303
|
-
}
|
|
304
|
-
if (message.message.length !== 0) {
|
|
305
|
-
writer.uint32(18).bytes(message.message);
|
|
306
|
-
}
|
|
307
|
-
return writer;
|
|
308
|
-
},
|
|
309
|
-
decode(input, length) {
|
|
310
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
311
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
312
|
-
const message = createBaseBrokerMessage();
|
|
313
|
-
while (reader.pos < end) {
|
|
314
|
-
const tag = reader.uint32();
|
|
315
|
-
switch (tag >>> 3) {
|
|
316
|
-
case 1: {
|
|
317
|
-
if (tag !== 8) {
|
|
230
|
+
case 3: {
|
|
231
|
+
if (tag !== 24) {
|
|
318
232
|
break;
|
|
319
233
|
}
|
|
320
|
-
message.
|
|
234
|
+
message.userId = longToNumber(reader.uint64());
|
|
321
235
|
continue;
|
|
322
236
|
}
|
|
323
|
-
case
|
|
324
|
-
if (tag !==
|
|
237
|
+
case 4: {
|
|
238
|
+
if (tag !== 32) {
|
|
325
239
|
break;
|
|
326
240
|
}
|
|
327
|
-
message.
|
|
241
|
+
message.commandId = longToNumber(reader.uint64());
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
case 5: {
|
|
245
|
+
if (tag !== 40) {
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
message.replyId = longToNumber(reader.uint64());
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
case 6: {
|
|
252
|
+
if (tag !== 48) {
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
message.status = reader.int32();
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
case 7: {
|
|
259
|
+
if (tag !== 58) {
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
message.command = exports.CommandContent.decode(reader, reader.uint32());
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
case 8: {
|
|
266
|
+
if (tag !== 66) {
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
message.akn = exports.CommandAkn.decode(reader, reader.uint32());
|
|
328
270
|
continue;
|
|
329
271
|
}
|
|
330
272
|
}
|
|
@@ -337,56 +279,63 @@ exports.BrokerMessage = {
|
|
|
337
279
|
},
|
|
338
280
|
fromJSON(object) {
|
|
339
281
|
return {
|
|
340
|
-
|
|
341
|
-
|
|
282
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
283
|
+
deviceId: isSet(object.device_id) ? globalThis.Number(object.device_id) : 0,
|
|
284
|
+
userId: isSet(object.user_id) ? globalThis.Number(object.user_id) : 0,
|
|
285
|
+
commandId: isSet(object.command_id) ? globalThis.Number(object.command_id) : 0,
|
|
286
|
+
replyId: isSet(object.reply_id) ? globalThis.Number(object.reply_id) : 0,
|
|
287
|
+
status: isSet(object.status) ? commandStatusFromJSON(object.status) : 0,
|
|
288
|
+
command: isSet(object.command) ? exports.CommandContent.fromJSON(object.command) : undefined,
|
|
289
|
+
akn: isSet(object.akn) ? exports.CommandAkn.fromJSON(object.akn) : undefined,
|
|
342
290
|
};
|
|
343
291
|
},
|
|
344
292
|
toJSON(message) {
|
|
345
293
|
const obj = {};
|
|
346
|
-
if (message.
|
|
347
|
-
obj.
|
|
294
|
+
if (message.id !== 0) {
|
|
295
|
+
obj.id = Math.round(message.id);
|
|
348
296
|
}
|
|
349
|
-
if (message.
|
|
350
|
-
obj.
|
|
297
|
+
if (message.deviceId !== 0) {
|
|
298
|
+
obj.device_id = Math.round(message.deviceId);
|
|
299
|
+
}
|
|
300
|
+
if (message.userId !== 0) {
|
|
301
|
+
obj.user_id = Math.round(message.userId);
|
|
302
|
+
}
|
|
303
|
+
if (message.commandId !== 0) {
|
|
304
|
+
obj.command_id = Math.round(message.commandId);
|
|
305
|
+
}
|
|
306
|
+
if (message.replyId !== 0) {
|
|
307
|
+
obj.reply_id = Math.round(message.replyId);
|
|
308
|
+
}
|
|
309
|
+
if (message.status !== 0) {
|
|
310
|
+
obj.status = commandStatusToJSON(message.status);
|
|
311
|
+
}
|
|
312
|
+
if (message.command !== undefined) {
|
|
313
|
+
obj.command = exports.CommandContent.toJSON(message.command);
|
|
314
|
+
}
|
|
315
|
+
if (message.akn !== undefined) {
|
|
316
|
+
obj.akn = exports.CommandAkn.toJSON(message.akn);
|
|
351
317
|
}
|
|
352
318
|
return obj;
|
|
353
319
|
},
|
|
354
320
|
create(base) {
|
|
355
|
-
return exports.
|
|
321
|
+
return exports.Command.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
356
322
|
},
|
|
357
323
|
fromPartial(object) {
|
|
358
|
-
var _a, _b;
|
|
359
|
-
const message =
|
|
360
|
-
message.
|
|
361
|
-
message.
|
|
324
|
+
var _a, _b, _c, _d, _e, _f;
|
|
325
|
+
const message = createBaseCommand();
|
|
326
|
+
message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
|
|
327
|
+
message.deviceId = (_b = object.deviceId) !== null && _b !== void 0 ? _b : 0;
|
|
328
|
+
message.userId = (_c = object.userId) !== null && _c !== void 0 ? _c : 0;
|
|
329
|
+
message.commandId = (_d = object.commandId) !== null && _d !== void 0 ? _d : 0;
|
|
330
|
+
message.replyId = (_e = object.replyId) !== null && _e !== void 0 ? _e : 0;
|
|
331
|
+
message.status = (_f = object.status) !== null && _f !== void 0 ? _f : 0;
|
|
332
|
+
message.command = (object.command !== undefined && object.command !== null)
|
|
333
|
+
? exports.CommandContent.fromPartial(object.command)
|
|
334
|
+
: undefined;
|
|
335
|
+
message.akn = (object.akn !== undefined && object.akn !== null) ? exports.CommandAkn.fromPartial(object.akn) : undefined;
|
|
362
336
|
return message;
|
|
363
337
|
},
|
|
364
338
|
};
|
|
365
|
-
function bytesFromBase64(b64) {
|
|
366
|
-
if (globalThis.Buffer) {
|
|
367
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
const bin = globalThis.atob(b64);
|
|
371
|
-
const arr = new Uint8Array(bin.length);
|
|
372
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
373
|
-
arr[i] = bin.charCodeAt(i);
|
|
374
|
-
}
|
|
375
|
-
return arr;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
function base64FromBytes(arr) {
|
|
379
|
-
if (globalThis.Buffer) {
|
|
380
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
const bin = [];
|
|
384
|
-
arr.forEach((byte) => {
|
|
385
|
-
bin.push(globalThis.String.fromCharCode(byte));
|
|
386
|
-
});
|
|
387
|
-
return globalThis.btoa(bin.join(""));
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
339
|
function longToNumber(int64) {
|
|
391
340
|
const num = globalThis.Number(int64.toString());
|
|
392
341
|
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|