@teslemetry/tesla-protocol 0.1.1

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.
Files changed (150) hide show
  1. package/README.md +20 -0
  2. package/dist/command/car_server.cjs +11126 -0
  3. package/dist/command/car_server.d.cts +1281 -0
  4. package/dist/command/car_server.d.mts +1281 -0
  5. package/dist/command/car_server.mjs +10880 -0
  6. package/dist/command/common.cjs +1536 -0
  7. package/dist/command/common.d.cts +327 -0
  8. package/dist/command/common.d.mts +327 -0
  9. package/dist/command/common.mjs +1488 -0
  10. package/dist/command/errors.cjs +107 -0
  11. package/dist/command/errors.d.cts +40 -0
  12. package/dist/command/errors.d.mts +40 -0
  13. package/dist/command/errors.mjs +102 -0
  14. package/dist/command/google/protobuf/timestamp.cjs +71 -0
  15. package/dist/command/google/protobuf/timestamp.d.cts +124 -0
  16. package/dist/command/google/protobuf/timestamp.d.mts +124 -0
  17. package/dist/command/google/protobuf/timestamp.mjs +69 -0
  18. package/dist/command/google/protobuf/wrappers.cjs +421 -0
  19. package/dist/command/google/protobuf/wrappers.d.cts +134 -0
  20. package/dist/command/google/protobuf/wrappers.d.mts +134 -0
  21. package/dist/command/google/protobuf/wrappers.mjs +411 -0
  22. package/dist/command/keys.cjs +60 -0
  23. package/dist/command/keys.d.cts +23 -0
  24. package/dist/command/keys.d.mts +23 -0
  25. package/dist/command/keys.mjs +56 -0
  26. package/dist/command/managed_charging.cjs +435 -0
  27. package/dist/command/managed_charging.d.cts +86 -0
  28. package/dist/command/managed_charging.d.mts +86 -0
  29. package/dist/command/managed_charging.mjs +421 -0
  30. package/dist/command/session.cjs +119 -0
  31. package/dist/command/session.d.cts +28 -0
  32. package/dist/command/session.d.mts +28 -0
  33. package/dist/command/session.mjs +117 -0
  34. package/dist/command/signatures.cjs +696 -0
  35. package/dist/command/signatures.d.cts +107 -0
  36. package/dist/command/signatures.d.mts +107 -0
  37. package/dist/command/signatures.mjs +678 -0
  38. package/dist/command/universal_message.cjs +588 -0
  39. package/dist/command/universal_message.d.cts +141 -0
  40. package/dist/command/universal_message.d.mts +141 -0
  41. package/dist/command/universal_message.mjs +571 -0
  42. package/dist/command/vcsec.cjs +2281 -0
  43. package/dist/command/vcsec.d.cts +404 -0
  44. package/dist/command/vcsec.d.mts +404 -0
  45. package/dist/command/vcsec.mjs +2218 -0
  46. package/dist/command/vehicle.cjs +10332 -0
  47. package/dist/command/vehicle.d.cts +1429 -0
  48. package/dist/command/vehicle.d.mts +1429 -0
  49. package/dist/command/vehicle.mjs +10168 -0
  50. package/dist/energy_command/identifier_type.cjs +47 -0
  51. package/dist/energy_command/identifier_type.d.cts +19 -0
  52. package/dist/energy_command/identifier_type.d.mts +19 -0
  53. package/dist/energy_command/identifier_type.mjs +43 -0
  54. package/dist/energy_device/authorization_api.cjs +815 -0
  55. package/dist/energy_device/authorization_api.d.cts +92 -0
  56. package/dist/energy_device/authorization_api.d.mts +92 -0
  57. package/dist/energy_device/authorization_api.mjs +801 -0
  58. package/dist/energy_device/authorization_types.cjs +348 -0
  59. package/dist/energy_device/authorization_types.d.cts +79 -0
  60. package/dist/energy_device/authorization_types.d.mts +79 -0
  61. package/dist/energy_device/authorization_types.mjs +331 -0
  62. package/dist/energy_device/common_api.cjs +2104 -0
  63. package/dist/energy_device/common_api.d.cts +211 -0
  64. package/dist/energy_device/common_api.d.mts +211 -0
  65. package/dist/energy_device/common_api.mjs +2064 -0
  66. package/dist/energy_device/device.cjs +485 -0
  67. package/dist/energy_device/device.d.cts +102 -0
  68. package/dist/energy_device/device.d.mts +102 -0
  69. package/dist/energy_device/device.mjs +462 -0
  70. package/dist/energy_device/energy.cjs +442 -0
  71. package/dist/energy_device/energy.d.cts +82 -0
  72. package/dist/energy_device/energy.d.mts +82 -0
  73. package/dist/energy_device/energy.mjs +429 -0
  74. package/dist/energy_device/energy_site_net.cjs +235 -0
  75. package/dist/energy_device/energy_site_net.d.cts +69 -0
  76. package/dist/energy_device/energy_site_net.d.mts +69 -0
  77. package/dist/energy_device/energy_site_net.mjs +219 -0
  78. package/dist/energy_device/error.cjs +53 -0
  79. package/dist/energy_device/error.d.cts +27 -0
  80. package/dist/energy_device/error.d.mts +27 -0
  81. package/dist/energy_device/error.mjs +51 -0
  82. package/dist/energy_device/google/protobuf/timestamp.cjs +71 -0
  83. package/dist/energy_device/google/protobuf/timestamp.d.cts +124 -0
  84. package/dist/energy_device/google/protobuf/timestamp.d.mts +124 -0
  85. package/dist/energy_device/google/protobuf/timestamp.mjs +69 -0
  86. package/dist/energy_device/google/protobuf/wrappers.cjs +421 -0
  87. package/dist/energy_device/google/protobuf/wrappers.d.cts +134 -0
  88. package/dist/energy_device/google/protobuf/wrappers.d.mts +134 -0
  89. package/dist/energy_device/google/protobuf/wrappers.mjs +411 -0
  90. package/dist/energy_device/google/rpc/status.cjs +65 -0
  91. package/dist/energy_device/google/rpc/status.d.cts +26 -0
  92. package/dist/energy_device/google/rpc/status.d.mts +26 -0
  93. package/dist/energy_device/google/rpc/status.mjs +63 -0
  94. package/dist/energy_device/networking.cjs +834 -0
  95. package/dist/energy_device/networking.d.cts +141 -0
  96. package/dist/energy_device/networking.d.mts +141 -0
  97. package/dist/energy_device/networking.mjs +810 -0
  98. package/dist/energy_device/teg_api.cjs +594 -0
  99. package/dist/energy_device/teg_api.d.cts +140 -0
  100. package/dist/energy_device/teg_api.d.mts +140 -0
  101. package/dist/energy_device/teg_api.mjs +581 -0
  102. package/dist/energy_device/transport.cjs +478 -0
  103. package/dist/energy_device/transport.d.cts +95 -0
  104. package/dist/energy_device/transport.d.mts +95 -0
  105. package/dist/energy_device/transport.mjs +460 -0
  106. package/dist/energy_device/update.cjs +521 -0
  107. package/dist/energy_device/update.d.cts +86 -0
  108. package/dist/energy_device/update.d.mts +86 -0
  109. package/dist/energy_device/update.mjs +506 -0
  110. package/dist/energy_device/wall_connector.cjs +634 -0
  111. package/dist/energy_device/wall_connector.d.cts +182 -0
  112. package/dist/energy_device/wall_connector.d.mts +182 -0
  113. package/dist/energy_device/wall_connector.mjs +590 -0
  114. package/dist/telemetry/google/protobuf/timestamp.cjs +71 -0
  115. package/dist/telemetry/google/protobuf/timestamp.d.cts +124 -0
  116. package/dist/telemetry/google/protobuf/timestamp.d.mts +124 -0
  117. package/dist/telemetry/google/protobuf/timestamp.mjs +69 -0
  118. package/dist/telemetry/vehicle_alert.cjs +214 -0
  119. package/dist/telemetry/vehicle_alert.d.cts +48 -0
  120. package/dist/telemetry/vehicle_alert.d.mts +48 -0
  121. package/dist/telemetry/vehicle_alert.mjs +208 -0
  122. package/dist/telemetry/vehicle_connectivity.cjs +145 -0
  123. package/dist/telemetry/vehicle_connectivity.d.cts +41 -0
  124. package/dist/telemetry/vehicle_connectivity.d.mts +41 -0
  125. package/dist/telemetry/vehicle_connectivity.mjs +140 -0
  126. package/dist/telemetry/vehicle_data.cjs +3792 -0
  127. package/dist/telemetry/vehicle_data.d.cts +872 -0
  128. package/dist/telemetry/vehicle_data.d.mts +872 -0
  129. package/dist/telemetry/vehicle_data.mjs +3655 -0
  130. package/dist/telemetry/vehicle_error.cjs +245 -0
  131. package/dist/telemetry/vehicle_error.d.cts +45 -0
  132. package/dist/telemetry/vehicle_error.d.mts +45 -0
  133. package/dist/telemetry/vehicle_error.mjs +241 -0
  134. package/dist/telemetry/vehicle_metric.cjs +236 -0
  135. package/dist/telemetry/vehicle_metric.d.cts +44 -0
  136. package/dist/telemetry/vehicle_metric.d.mts +44 -0
  137. package/dist/telemetry/vehicle_metric.mjs +232 -0
  138. package/dist/teslapower/google/protobuf/any.cjs +84 -0
  139. package/dist/teslapower/google/protobuf/any.d.cts +140 -0
  140. package/dist/teslapower/google/protobuf/any.d.mts +140 -0
  141. package/dist/teslapower/google/protobuf/any.mjs +82 -0
  142. package/dist/teslapower/google/protobuf/timestamp.cjs +71 -0
  143. package/dist/teslapower/google/protobuf/timestamp.d.cts +124 -0
  144. package/dist/teslapower/google/protobuf/timestamp.d.mts +124 -0
  145. package/dist/teslapower/google/protobuf/timestamp.mjs +69 -0
  146. package/dist/teslapower/teslapower.cjs +5486 -0
  147. package/dist/teslapower/teslapower.d.cts +518 -0
  148. package/dist/teslapower/teslapower.d.mts +518 -0
  149. package/dist/teslapower/teslapower.mjs +5381 -0
  150. package/package.json +53 -0
@@ -0,0 +1,594 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_energy_device_google_protobuf_timestamp = require("./google/protobuf/timestamp.cjs");
3
+ let _bufbuild_protobuf_wire = require("@bufbuild/protobuf/wire");
4
+ //#region src/energy_device/teg_api.ts
5
+ const protobufPackage = "tesla.proto.energy_device.v1";
6
+ function createBaseControlEventSchedulingInfo() {
7
+ return {
8
+ startTime: void 0,
9
+ durationSeconds: 0,
10
+ priority: 0
11
+ };
12
+ }
13
+ const ControlEventSchedulingInfo = {
14
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
15
+ if (message.startTime !== void 0) require_energy_device_google_protobuf_timestamp.Timestamp.encode(toTimestamp(message.startTime), writer.uint32(10).fork()).join();
16
+ if (message.durationSeconds !== 0) writer.uint32(16).uint32(message.durationSeconds);
17
+ if (message.priority !== 0) writer.uint32(24).uint64(message.priority);
18
+ return writer;
19
+ },
20
+ decode(input, length) {
21
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
22
+ const end = length === void 0 ? reader.len : reader.pos + length;
23
+ const message = createBaseControlEventSchedulingInfo();
24
+ while (reader.pos < end) {
25
+ const tag = reader.uint32();
26
+ switch (tag >>> 3) {
27
+ case 1:
28
+ if (tag !== 10) break;
29
+ message.startTime = fromTimestamp(require_energy_device_google_protobuf_timestamp.Timestamp.decode(reader, reader.uint32()));
30
+ continue;
31
+ case 2:
32
+ if (tag !== 16) break;
33
+ message.durationSeconds = reader.uint32();
34
+ continue;
35
+ case 3:
36
+ if (tag !== 24) break;
37
+ message.priority = longToNumber(reader.uint64());
38
+ continue;
39
+ }
40
+ if ((tag & 7) === 4 || tag === 0) break;
41
+ reader.skip(tag & 7);
42
+ }
43
+ return message;
44
+ },
45
+ fromJSON(object) {
46
+ return {
47
+ startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : void 0,
48
+ durationSeconds: isSet(object.durationSeconds) ? globalThis.Number(object.durationSeconds) : 0,
49
+ priority: isSet(object.priority) ? globalThis.Number(object.priority) : 0
50
+ };
51
+ },
52
+ toJSON(message) {
53
+ const obj = {};
54
+ if (message.startTime !== void 0) obj.startTime = message.startTime.toISOString();
55
+ if (message.durationSeconds !== void 0) obj.durationSeconds = Math.round(message.durationSeconds);
56
+ if (message.priority !== void 0) obj.priority = Math.round(message.priority);
57
+ return obj;
58
+ },
59
+ create(base) {
60
+ return ControlEventSchedulingInfo.fromPartial(base ?? {});
61
+ },
62
+ fromPartial(object) {
63
+ const message = createBaseControlEventSchedulingInfo();
64
+ message.startTime = object.startTime ?? void 0;
65
+ message.durationSeconds = object.durationSeconds ?? 0;
66
+ message.priority = object.priority ?? 0;
67
+ return message;
68
+ }
69
+ };
70
+ function createBaseBackupEvent() {
71
+ return {
72
+ id: "",
73
+ name: "",
74
+ shedulingInfo: void 0
75
+ };
76
+ }
77
+ const BackupEvent = {
78
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
79
+ if (message.id !== "") writer.uint32(10).string(message.id);
80
+ if (message.name !== "") writer.uint32(18).string(message.name);
81
+ if (message.shedulingInfo !== void 0) ControlEventSchedulingInfo.encode(message.shedulingInfo, writer.uint32(26).fork()).join();
82
+ return writer;
83
+ },
84
+ decode(input, length) {
85
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
86
+ const end = length === void 0 ? reader.len : reader.pos + length;
87
+ const message = createBaseBackupEvent();
88
+ while (reader.pos < end) {
89
+ const tag = reader.uint32();
90
+ switch (tag >>> 3) {
91
+ case 1:
92
+ if (tag !== 10) break;
93
+ message.id = reader.string();
94
+ continue;
95
+ case 2:
96
+ if (tag !== 18) break;
97
+ message.name = reader.string();
98
+ continue;
99
+ case 3:
100
+ if (tag !== 26) break;
101
+ message.shedulingInfo = ControlEventSchedulingInfo.decode(reader, reader.uint32());
102
+ continue;
103
+ }
104
+ if ((tag & 7) === 4 || tag === 0) break;
105
+ reader.skip(tag & 7);
106
+ }
107
+ return message;
108
+ },
109
+ fromJSON(object) {
110
+ return {
111
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
112
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
113
+ shedulingInfo: isSet(object.shedulingInfo) ? ControlEventSchedulingInfo.fromJSON(object.shedulingInfo) : void 0
114
+ };
115
+ },
116
+ toJSON(message) {
117
+ const obj = {};
118
+ if (message.id !== void 0) obj.id = message.id;
119
+ if (message.name !== void 0) obj.name = message.name;
120
+ if (message.shedulingInfo !== void 0) obj.shedulingInfo = ControlEventSchedulingInfo.toJSON(message.shedulingInfo);
121
+ return obj;
122
+ },
123
+ create(base) {
124
+ return BackupEvent.fromPartial(base ?? {});
125
+ },
126
+ fromPartial(object) {
127
+ const message = createBaseBackupEvent();
128
+ message.id = object.id ?? "";
129
+ message.name = object.name ?? "";
130
+ message.shedulingInfo = object.shedulingInfo !== void 0 && object.shedulingInfo !== null ? ControlEventSchedulingInfo.fromPartial(object.shedulingInfo) : void 0;
131
+ return message;
132
+ }
133
+ };
134
+ function createBaseManualBackupEvent() {
135
+ return { schedulingInfo: void 0 };
136
+ }
137
+ const ManualBackupEvent = {
138
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
139
+ if (message.schedulingInfo !== void 0) ControlEventSchedulingInfo.encode(message.schedulingInfo, writer.uint32(10).fork()).join();
140
+ return writer;
141
+ },
142
+ decode(input, length) {
143
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
144
+ const end = length === void 0 ? reader.len : reader.pos + length;
145
+ const message = createBaseManualBackupEvent();
146
+ while (reader.pos < end) {
147
+ const tag = reader.uint32();
148
+ switch (tag >>> 3) {
149
+ case 1:
150
+ if (tag !== 10) break;
151
+ message.schedulingInfo = ControlEventSchedulingInfo.decode(reader, reader.uint32());
152
+ continue;
153
+ }
154
+ if ((tag & 7) === 4 || tag === 0) break;
155
+ reader.skip(tag & 7);
156
+ }
157
+ return message;
158
+ },
159
+ fromJSON(object) {
160
+ return { schedulingInfo: isSet(object.schedulingInfo) ? ControlEventSchedulingInfo.fromJSON(object.schedulingInfo) : void 0 };
161
+ },
162
+ toJSON(message) {
163
+ const obj = {};
164
+ if (message.schedulingInfo !== void 0) obj.schedulingInfo = ControlEventSchedulingInfo.toJSON(message.schedulingInfo);
165
+ return obj;
166
+ },
167
+ create(base) {
168
+ return ManualBackupEvent.fromPartial(base ?? {});
169
+ },
170
+ fromPartial(object) {
171
+ const message = createBaseManualBackupEvent();
172
+ message.schedulingInfo = object.schedulingInfo !== void 0 && object.schedulingInfo !== null ? ControlEventSchedulingInfo.fromPartial(object.schedulingInfo) : void 0;
173
+ return message;
174
+ }
175
+ };
176
+ function createBaseTEGAPIScheduleManualBackupEventRequest() {
177
+ return { schedulingInfo: void 0 };
178
+ }
179
+ const TEGAPIScheduleManualBackupEventRequest = {
180
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
181
+ if (message.schedulingInfo !== void 0) ControlEventSchedulingInfo.encode(message.schedulingInfo, writer.uint32(10).fork()).join();
182
+ return writer;
183
+ },
184
+ decode(input, length) {
185
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
186
+ const end = length === void 0 ? reader.len : reader.pos + length;
187
+ const message = createBaseTEGAPIScheduleManualBackupEventRequest();
188
+ while (reader.pos < end) {
189
+ const tag = reader.uint32();
190
+ switch (tag >>> 3) {
191
+ case 1:
192
+ if (tag !== 10) break;
193
+ message.schedulingInfo = ControlEventSchedulingInfo.decode(reader, reader.uint32());
194
+ continue;
195
+ }
196
+ if ((tag & 7) === 4 || tag === 0) break;
197
+ reader.skip(tag & 7);
198
+ }
199
+ return message;
200
+ },
201
+ fromJSON(object) {
202
+ return { schedulingInfo: isSet(object.schedulingInfo) ? ControlEventSchedulingInfo.fromJSON(object.schedulingInfo) : void 0 };
203
+ },
204
+ toJSON(message) {
205
+ const obj = {};
206
+ if (message.schedulingInfo !== void 0) obj.schedulingInfo = ControlEventSchedulingInfo.toJSON(message.schedulingInfo);
207
+ return obj;
208
+ },
209
+ create(base) {
210
+ return TEGAPIScheduleManualBackupEventRequest.fromPartial(base ?? {});
211
+ },
212
+ fromPartial(object) {
213
+ const message = createBaseTEGAPIScheduleManualBackupEventRequest();
214
+ message.schedulingInfo = object.schedulingInfo !== void 0 && object.schedulingInfo !== null ? ControlEventSchedulingInfo.fromPartial(object.schedulingInfo) : void 0;
215
+ return message;
216
+ }
217
+ };
218
+ function createBaseTEGAPIScheduleManualBackupEventResponse() {
219
+ return {};
220
+ }
221
+ const TEGAPIScheduleManualBackupEventResponse = {
222
+ encode(_, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
223
+ return writer;
224
+ },
225
+ decode(input, length) {
226
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
227
+ const end = length === void 0 ? reader.len : reader.pos + length;
228
+ const message = createBaseTEGAPIScheduleManualBackupEventResponse();
229
+ while (reader.pos < end) {
230
+ const tag = reader.uint32();
231
+ switch (tag >>> 3) {}
232
+ if ((tag & 7) === 4 || tag === 0) break;
233
+ reader.skip(tag & 7);
234
+ }
235
+ return message;
236
+ },
237
+ fromJSON(_) {
238
+ return {};
239
+ },
240
+ toJSON(_) {
241
+ return {};
242
+ },
243
+ create(base) {
244
+ return TEGAPIScheduleManualBackupEventResponse.fromPartial(base ?? {});
245
+ },
246
+ fromPartial(_) {
247
+ return createBaseTEGAPIScheduleManualBackupEventResponse();
248
+ }
249
+ };
250
+ function createBaseTEGAPICancelManualBackupEventRequest() {
251
+ return {};
252
+ }
253
+ const TEGAPICancelManualBackupEventRequest = {
254
+ encode(_, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
255
+ return writer;
256
+ },
257
+ decode(input, length) {
258
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
259
+ const end = length === void 0 ? reader.len : reader.pos + length;
260
+ const message = createBaseTEGAPICancelManualBackupEventRequest();
261
+ while (reader.pos < end) {
262
+ const tag = reader.uint32();
263
+ switch (tag >>> 3) {}
264
+ if ((tag & 7) === 4 || tag === 0) break;
265
+ reader.skip(tag & 7);
266
+ }
267
+ return message;
268
+ },
269
+ fromJSON(_) {
270
+ return {};
271
+ },
272
+ toJSON(_) {
273
+ return {};
274
+ },
275
+ create(base) {
276
+ return TEGAPICancelManualBackupEventRequest.fromPartial(base ?? {});
277
+ },
278
+ fromPartial(_) {
279
+ return createBaseTEGAPICancelManualBackupEventRequest();
280
+ }
281
+ };
282
+ function createBaseTEGAPICancelManualBackupEventResponse() {
283
+ return {};
284
+ }
285
+ const TEGAPICancelManualBackupEventResponse = {
286
+ encode(_, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
287
+ return writer;
288
+ },
289
+ decode(input, length) {
290
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
291
+ const end = length === void 0 ? reader.len : reader.pos + length;
292
+ const message = createBaseTEGAPICancelManualBackupEventResponse();
293
+ while (reader.pos < end) {
294
+ const tag = reader.uint32();
295
+ switch (tag >>> 3) {}
296
+ if ((tag & 7) === 4 || tag === 0) break;
297
+ reader.skip(tag & 7);
298
+ }
299
+ return message;
300
+ },
301
+ fromJSON(_) {
302
+ return {};
303
+ },
304
+ toJSON(_) {
305
+ return {};
306
+ },
307
+ create(base) {
308
+ return TEGAPICancelManualBackupEventResponse.fromPartial(base ?? {});
309
+ },
310
+ fromPartial(_) {
311
+ return createBaseTEGAPICancelManualBackupEventResponse();
312
+ }
313
+ };
314
+ function createBaseTEGAPIGetBackupEventsRequest() {
315
+ return {};
316
+ }
317
+ const TEGAPIGetBackupEventsRequest = {
318
+ encode(_, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
319
+ return writer;
320
+ },
321
+ decode(input, length) {
322
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
323
+ const end = length === void 0 ? reader.len : reader.pos + length;
324
+ const message = createBaseTEGAPIGetBackupEventsRequest();
325
+ while (reader.pos < end) {
326
+ const tag = reader.uint32();
327
+ switch (tag >>> 3) {}
328
+ if ((tag & 7) === 4 || tag === 0) break;
329
+ reader.skip(tag & 7);
330
+ }
331
+ return message;
332
+ },
333
+ fromJSON(_) {
334
+ return {};
335
+ },
336
+ toJSON(_) {
337
+ return {};
338
+ },
339
+ create(base) {
340
+ return TEGAPIGetBackupEventsRequest.fromPartial(base ?? {});
341
+ },
342
+ fromPartial(_) {
343
+ return createBaseTEGAPIGetBackupEventsRequest();
344
+ }
345
+ };
346
+ function createBaseTEGAPIGetBackupEventsResponse() {
347
+ return {
348
+ manualBackupEvent: void 0,
349
+ backupEvents: []
350
+ };
351
+ }
352
+ const TEGAPIGetBackupEventsResponse = {
353
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
354
+ if (message.manualBackupEvent !== void 0) ManualBackupEvent.encode(message.manualBackupEvent, writer.uint32(10).fork()).join();
355
+ for (const v of message.backupEvents) BackupEvent.encode(v, writer.uint32(18).fork()).join();
356
+ return writer;
357
+ },
358
+ decode(input, length) {
359
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
360
+ const end = length === void 0 ? reader.len : reader.pos + length;
361
+ const message = createBaseTEGAPIGetBackupEventsResponse();
362
+ while (reader.pos < end) {
363
+ const tag = reader.uint32();
364
+ switch (tag >>> 3) {
365
+ case 1:
366
+ if (tag !== 10) break;
367
+ message.manualBackupEvent = ManualBackupEvent.decode(reader, reader.uint32());
368
+ continue;
369
+ case 2:
370
+ if (tag !== 18) break;
371
+ message.backupEvents.push(BackupEvent.decode(reader, reader.uint32()));
372
+ continue;
373
+ }
374
+ if ((tag & 7) === 4 || tag === 0) break;
375
+ reader.skip(tag & 7);
376
+ }
377
+ return message;
378
+ },
379
+ fromJSON(object) {
380
+ return {
381
+ manualBackupEvent: isSet(object.manualBackupEvent) ? ManualBackupEvent.fromJSON(object.manualBackupEvent) : void 0,
382
+ backupEvents: globalThis.Array.isArray(object?.backupEvents) ? object.backupEvents.map((e) => BackupEvent.fromJSON(e)) : []
383
+ };
384
+ },
385
+ toJSON(message) {
386
+ const obj = {};
387
+ if (message.manualBackupEvent !== void 0) obj.manualBackupEvent = ManualBackupEvent.toJSON(message.manualBackupEvent);
388
+ if (message.backupEvents?.length) obj.backupEvents = message.backupEvents.map((e) => BackupEvent.toJSON(e));
389
+ return obj;
390
+ },
391
+ create(base) {
392
+ return TEGAPIGetBackupEventsResponse.fromPartial(base ?? {});
393
+ },
394
+ fromPartial(object) {
395
+ const message = createBaseTEGAPIGetBackupEventsResponse();
396
+ message.manualBackupEvent = object.manualBackupEvent !== void 0 && object.manualBackupEvent !== null ? ManualBackupEvent.fromPartial(object.manualBackupEvent) : void 0;
397
+ message.backupEvents = object.backupEvents?.map((e) => BackupEvent.fromPartial(e)) || [];
398
+ return message;
399
+ }
400
+ };
401
+ function createBaseTEGAPIRegisterRequest() {
402
+ return {};
403
+ }
404
+ const TEGAPIRegisterRequest = {
405
+ encode(_, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
406
+ return writer;
407
+ },
408
+ decode(input, length) {
409
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
410
+ const end = length === void 0 ? reader.len : reader.pos + length;
411
+ const message = createBaseTEGAPIRegisterRequest();
412
+ while (reader.pos < end) {
413
+ const tag = reader.uint32();
414
+ switch (tag >>> 3) {}
415
+ if ((tag & 7) === 4 || tag === 0) break;
416
+ reader.skip(tag & 7);
417
+ }
418
+ return message;
419
+ },
420
+ fromJSON(_) {
421
+ return {};
422
+ },
423
+ toJSON(_) {
424
+ return {};
425
+ },
426
+ create(base) {
427
+ return TEGAPIRegisterRequest.fromPartial(base ?? {});
428
+ },
429
+ fromPartial(_) {
430
+ return createBaseTEGAPIRegisterRequest();
431
+ }
432
+ };
433
+ function createBaseTEGAPIRegisterResponse() {
434
+ return {};
435
+ }
436
+ const TEGAPIRegisterResponse = {
437
+ encode(_, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
438
+ return writer;
439
+ },
440
+ decode(input, length) {
441
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
442
+ const end = length === void 0 ? reader.len : reader.pos + length;
443
+ const message = createBaseTEGAPIRegisterResponse();
444
+ while (reader.pos < end) {
445
+ const tag = reader.uint32();
446
+ switch (tag >>> 3) {}
447
+ if ((tag & 7) === 4 || tag === 0) break;
448
+ reader.skip(tag & 7);
449
+ }
450
+ return message;
451
+ },
452
+ fromJSON(_) {
453
+ return {};
454
+ },
455
+ toJSON(_) {
456
+ return {};
457
+ },
458
+ create(base) {
459
+ return TEGAPIRegisterResponse.fromPartial(base ?? {});
460
+ },
461
+ fromPartial(_) {
462
+ return createBaseTEGAPIRegisterResponse();
463
+ }
464
+ };
465
+ function createBaseTEGMessages() {
466
+ return {
467
+ scheduleManualBackupEventRequest: void 0,
468
+ scheduleManualBackupEventResponse: void 0,
469
+ cancelManualBackupEventRequest: void 0,
470
+ cancelManualBackupEventResponse: void 0,
471
+ getBackupEventsRequest: void 0,
472
+ getBackupEventsResponse: void 0
473
+ };
474
+ }
475
+ const TEGMessages = {
476
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
477
+ if (message.scheduleManualBackupEventRequest !== void 0) TEGAPIScheduleManualBackupEventRequest.encode(message.scheduleManualBackupEventRequest, writer.uint32(362).fork()).join();
478
+ if (message.scheduleManualBackupEventResponse !== void 0) TEGAPIScheduleManualBackupEventResponse.encode(message.scheduleManualBackupEventResponse, writer.uint32(370).fork()).join();
479
+ if (message.cancelManualBackupEventRequest !== void 0) TEGAPICancelManualBackupEventRequest.encode(message.cancelManualBackupEventRequest, writer.uint32(378).fork()).join();
480
+ if (message.cancelManualBackupEventResponse !== void 0) TEGAPICancelManualBackupEventResponse.encode(message.cancelManualBackupEventResponse, writer.uint32(386).fork()).join();
481
+ if (message.getBackupEventsRequest !== void 0) TEGAPIGetBackupEventsRequest.encode(message.getBackupEventsRequest, writer.uint32(394).fork()).join();
482
+ if (message.getBackupEventsResponse !== void 0) TEGAPIGetBackupEventsResponse.encode(message.getBackupEventsResponse, writer.uint32(402).fork()).join();
483
+ return writer;
484
+ },
485
+ decode(input, length) {
486
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
487
+ const end = length === void 0 ? reader.len : reader.pos + length;
488
+ const message = createBaseTEGMessages();
489
+ while (reader.pos < end) {
490
+ const tag = reader.uint32();
491
+ switch (tag >>> 3) {
492
+ case 45:
493
+ if (tag !== 362) break;
494
+ message.scheduleManualBackupEventRequest = TEGAPIScheduleManualBackupEventRequest.decode(reader, reader.uint32());
495
+ continue;
496
+ case 46:
497
+ if (tag !== 370) break;
498
+ message.scheduleManualBackupEventResponse = TEGAPIScheduleManualBackupEventResponse.decode(reader, reader.uint32());
499
+ continue;
500
+ case 47:
501
+ if (tag !== 378) break;
502
+ message.cancelManualBackupEventRequest = TEGAPICancelManualBackupEventRequest.decode(reader, reader.uint32());
503
+ continue;
504
+ case 48:
505
+ if (tag !== 386) break;
506
+ message.cancelManualBackupEventResponse = TEGAPICancelManualBackupEventResponse.decode(reader, reader.uint32());
507
+ continue;
508
+ case 49:
509
+ if (tag !== 394) break;
510
+ message.getBackupEventsRequest = TEGAPIGetBackupEventsRequest.decode(reader, reader.uint32());
511
+ continue;
512
+ case 50:
513
+ if (tag !== 402) break;
514
+ message.getBackupEventsResponse = TEGAPIGetBackupEventsResponse.decode(reader, reader.uint32());
515
+ continue;
516
+ }
517
+ if ((tag & 7) === 4 || tag === 0) break;
518
+ reader.skip(tag & 7);
519
+ }
520
+ return message;
521
+ },
522
+ fromJSON(object) {
523
+ return {
524
+ scheduleManualBackupEventRequest: isSet(object.scheduleManualBackupEventRequest) ? TEGAPIScheduleManualBackupEventRequest.fromJSON(object.scheduleManualBackupEventRequest) : void 0,
525
+ scheduleManualBackupEventResponse: isSet(object.scheduleManualBackupEventResponse) ? TEGAPIScheduleManualBackupEventResponse.fromJSON(object.scheduleManualBackupEventResponse) : void 0,
526
+ cancelManualBackupEventRequest: isSet(object.cancelManualBackupEventRequest) ? TEGAPICancelManualBackupEventRequest.fromJSON(object.cancelManualBackupEventRequest) : void 0,
527
+ cancelManualBackupEventResponse: isSet(object.cancelManualBackupEventResponse) ? TEGAPICancelManualBackupEventResponse.fromJSON(object.cancelManualBackupEventResponse) : void 0,
528
+ getBackupEventsRequest: isSet(object.getBackupEventsRequest) ? TEGAPIGetBackupEventsRequest.fromJSON(object.getBackupEventsRequest) : void 0,
529
+ getBackupEventsResponse: isSet(object.getBackupEventsResponse) ? TEGAPIGetBackupEventsResponse.fromJSON(object.getBackupEventsResponse) : void 0
530
+ };
531
+ },
532
+ toJSON(message) {
533
+ const obj = {};
534
+ if (message.scheduleManualBackupEventRequest !== void 0) obj.scheduleManualBackupEventRequest = TEGAPIScheduleManualBackupEventRequest.toJSON(message.scheduleManualBackupEventRequest);
535
+ if (message.scheduleManualBackupEventResponse !== void 0) obj.scheduleManualBackupEventResponse = TEGAPIScheduleManualBackupEventResponse.toJSON(message.scheduleManualBackupEventResponse);
536
+ if (message.cancelManualBackupEventRequest !== void 0) obj.cancelManualBackupEventRequest = TEGAPICancelManualBackupEventRequest.toJSON(message.cancelManualBackupEventRequest);
537
+ if (message.cancelManualBackupEventResponse !== void 0) obj.cancelManualBackupEventResponse = TEGAPICancelManualBackupEventResponse.toJSON(message.cancelManualBackupEventResponse);
538
+ if (message.getBackupEventsRequest !== void 0) obj.getBackupEventsRequest = TEGAPIGetBackupEventsRequest.toJSON(message.getBackupEventsRequest);
539
+ if (message.getBackupEventsResponse !== void 0) obj.getBackupEventsResponse = TEGAPIGetBackupEventsResponse.toJSON(message.getBackupEventsResponse);
540
+ return obj;
541
+ },
542
+ create(base) {
543
+ return TEGMessages.fromPartial(base ?? {});
544
+ },
545
+ fromPartial(object) {
546
+ const message = createBaseTEGMessages();
547
+ message.scheduleManualBackupEventRequest = object.scheduleManualBackupEventRequest !== void 0 && object.scheduleManualBackupEventRequest !== null ? TEGAPIScheduleManualBackupEventRequest.fromPartial(object.scheduleManualBackupEventRequest) : void 0;
548
+ message.scheduleManualBackupEventResponse = object.scheduleManualBackupEventResponse !== void 0 && object.scheduleManualBackupEventResponse !== null ? TEGAPIScheduleManualBackupEventResponse.fromPartial(object.scheduleManualBackupEventResponse) : void 0;
549
+ message.cancelManualBackupEventRequest = object.cancelManualBackupEventRequest !== void 0 && object.cancelManualBackupEventRequest !== null ? TEGAPICancelManualBackupEventRequest.fromPartial(object.cancelManualBackupEventRequest) : void 0;
550
+ message.cancelManualBackupEventResponse = object.cancelManualBackupEventResponse !== void 0 && object.cancelManualBackupEventResponse !== null ? TEGAPICancelManualBackupEventResponse.fromPartial(object.cancelManualBackupEventResponse) : void 0;
551
+ message.getBackupEventsRequest = object.getBackupEventsRequest !== void 0 && object.getBackupEventsRequest !== null ? TEGAPIGetBackupEventsRequest.fromPartial(object.getBackupEventsRequest) : void 0;
552
+ message.getBackupEventsResponse = object.getBackupEventsResponse !== void 0 && object.getBackupEventsResponse !== null ? TEGAPIGetBackupEventsResponse.fromPartial(object.getBackupEventsResponse) : void 0;
553
+ return message;
554
+ }
555
+ };
556
+ function toTimestamp(date) {
557
+ return {
558
+ seconds: Math.trunc(date.getTime() / 1e3),
559
+ nanos: date.getTime() % 1e3 * 1e6
560
+ };
561
+ }
562
+ function fromTimestamp(t) {
563
+ let millis = (t.seconds || 0) * 1e3;
564
+ millis += (t.nanos || 0) / 1e6;
565
+ return new globalThis.Date(millis);
566
+ }
567
+ function fromJsonTimestamp(o) {
568
+ if (o instanceof globalThis.Date) return o;
569
+ else if (typeof o === "string") return new globalThis.Date(o);
570
+ else return fromTimestamp(require_energy_device_google_protobuf_timestamp.Timestamp.fromJSON(o));
571
+ }
572
+ function longToNumber(int64) {
573
+ const num = globalThis.Number(int64.toString());
574
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
575
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
576
+ return num;
577
+ }
578
+ function isSet(value) {
579
+ return value !== null && value !== void 0;
580
+ }
581
+ //#endregion
582
+ exports.BackupEvent = BackupEvent;
583
+ exports.ControlEventSchedulingInfo = ControlEventSchedulingInfo;
584
+ exports.ManualBackupEvent = ManualBackupEvent;
585
+ exports.TEGAPICancelManualBackupEventRequest = TEGAPICancelManualBackupEventRequest;
586
+ exports.TEGAPICancelManualBackupEventResponse = TEGAPICancelManualBackupEventResponse;
587
+ exports.TEGAPIGetBackupEventsRequest = TEGAPIGetBackupEventsRequest;
588
+ exports.TEGAPIGetBackupEventsResponse = TEGAPIGetBackupEventsResponse;
589
+ exports.TEGAPIRegisterRequest = TEGAPIRegisterRequest;
590
+ exports.TEGAPIRegisterResponse = TEGAPIRegisterResponse;
591
+ exports.TEGAPIScheduleManualBackupEventRequest = TEGAPIScheduleManualBackupEventRequest;
592
+ exports.TEGAPIScheduleManualBackupEventResponse = TEGAPIScheduleManualBackupEventResponse;
593
+ exports.TEGMessages = TEGMessages;
594
+ exports.protobufPackage = protobufPackage;