@teslemetry/tesla-protocol 0.5.0 → 0.6.0

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 (81) hide show
  1. package/dist/charging/charging.cjs +550 -0
  2. package/dist/charging/charging.d.cts +75 -0
  3. package/dist/charging/charging.d.mts +75 -0
  4. package/dist/charging/charging.mjs +543 -0
  5. package/dist/command/universal_message.cjs +5 -0
  6. package/dist/command/universal_message.d.cts +2 -0
  7. package/dist/command/universal_message.d.mts +2 -0
  8. package/dist/command/universal_message.mjs +5 -0
  9. package/dist/command/vcsec.cjs +87 -2
  10. package/dist/command/vcsec.d.cts +11 -1
  11. package/dist/command/vcsec.d.mts +11 -1
  12. package/dist/command/vcsec.mjs +86 -3
  13. package/dist/command/vehicle.cjs +27 -0
  14. package/dist/command/vehicle.d.cts +4 -0
  15. package/dist/command/vehicle.d.mts +4 -0
  16. package/dist/command/vehicle.mjs +27 -0
  17. package/dist/dashcam/dashcam_sei.cjs +263 -0
  18. package/dist/dashcam/dashcam_sei.d.cts +60 -0
  19. package/dist/dashcam/dashcam_sei.d.mts +60 -0
  20. package/dist/dashcam/dashcam_sei.mjs +255 -0
  21. package/dist/energy_device/common_api.cjs +604 -11
  22. package/dist/energy_device/common_api.d.cts +60 -3
  23. package/dist/energy_device/common_api.d.mts +60 -3
  24. package/dist/energy_device/common_api.mjs +596 -12
  25. package/dist/energy_device/device.cjs +129 -0
  26. package/dist/energy_device/device.d.cts +13 -1
  27. package/dist/energy_device/device.d.mts +13 -1
  28. package/dist/energy_device/device.mjs +127 -1
  29. package/dist/energy_device/energy_site_net.cjs +747 -0
  30. package/dist/energy_device/energy_site_net.d.cts +84 -1
  31. package/dist/energy_device/energy_site_net.d.mts +84 -1
  32. package/dist/energy_device/energy_site_net.mjs +736 -1
  33. package/dist/energy_device/filestore_api.cjs +575 -0
  34. package/dist/energy_device/filestore_api.d.cts +81 -0
  35. package/dist/energy_device/filestore_api.d.mts +81 -0
  36. package/dist/energy_device/filestore_api.mjs +563 -0
  37. package/dist/energy_device/google/protobuf/duration.cjs +71 -0
  38. package/dist/energy_device/google/protobuf/duration.d.cts +95 -0
  39. package/dist/energy_device/google/protobuf/duration.d.mts +95 -0
  40. package/dist/energy_device/google/protobuf/duration.mjs +69 -0
  41. package/dist/energy_device/graphql_api.cjs +449 -0
  42. package/dist/energy_device/graphql_api.d.cts +78 -0
  43. package/dist/energy_device/graphql_api.d.mts +78 -0
  44. package/dist/energy_device/graphql_api.mjs +434 -0
  45. package/dist/energy_device/intra_site_api.cjs +1698 -0
  46. package/dist/energy_device/intra_site_api.d.cts +227 -0
  47. package/dist/energy_device/intra_site_api.d.mts +227 -0
  48. package/dist/energy_device/intra_site_api.mjs +1644 -0
  49. package/dist/energy_device/local_auth_api.cjs +505 -0
  50. package/dist/energy_device/local_auth_api.d.cts +73 -0
  51. package/dist/energy_device/local_auth_api.d.mts +73 -0
  52. package/dist/energy_device/local_auth_api.mjs +492 -0
  53. package/dist/energy_device/networking.cjs +20 -2
  54. package/dist/energy_device/networking.d.cts +2 -0
  55. package/dist/energy_device/networking.d.mts +2 -0
  56. package/dist/energy_device/networking.mjs +20 -2
  57. package/dist/energy_device/neurio_meter_api.cjs +1442 -0
  58. package/dist/energy_device/neurio_meter_api.d.cts +202 -0
  59. package/dist/energy_device/neurio_meter_api.d.mts +202 -0
  60. package/dist/energy_device/neurio_meter_api.mjs +1401 -0
  61. package/dist/energy_device/pvi_api.cjs +2954 -0
  62. package/dist/energy_device/pvi_api.d.cts +319 -0
  63. package/dist/energy_device/pvi_api.d.mts +319 -0
  64. package/dist/energy_device/pvi_api.mjs +2892 -0
  65. package/dist/energy_device/teg_api.cjs +5184 -147
  66. package/dist/energy_device/teg_api.d.cts +492 -77
  67. package/dist/energy_device/teg_api.d.mts +492 -77
  68. package/dist/energy_device/teg_api.mjs +5064 -148
  69. package/dist/energy_device/transport.cjs +82 -2
  70. package/dist/energy_device/transport.d.cts +16 -5
  71. package/dist/energy_device/transport.d.mts +16 -5
  72. package/dist/energy_device/transport.mjs +82 -2
  73. package/dist/energy_device/update.cjs +33 -6
  74. package/dist/energy_device/update.d.cts +3 -0
  75. package/dist/energy_device/update.d.mts +3 -0
  76. package/dist/energy_device/update.mjs +33 -6
  77. package/dist/energy_device/wall_connector.cjs +6729 -5
  78. package/dist/energy_device/wall_connector.d.cts +696 -2
  79. package/dist/energy_device/wall_connector.d.mts +696 -2
  80. package/dist/energy_device/wall_connector.mjs +6591 -6
  81. package/package.json +1 -1
@@ -0,0 +1,575 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _bufbuild_protobuf_wire = require("@bufbuild/protobuf/wire");
3
+ //#region src/energy_device/filestore_api.ts
4
+ const protobufPackage = "tesla.proto.energy_device.v1";
5
+ /**
6
+ * TESLEMETRY SOURCE-OF-RECORD - no upstream.
7
+ * Provenance: Tesla Energy gateway (TEG) local API, from our own
8
+ * observations and contributions from the community
9
+ */
10
+ let FileStoreAPIDomain = /* @__PURE__ */ function(FileStoreAPIDomain) {
11
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_INVALID"] = 0] = "FILE_STORE_API_DOMAIN_INVALID";
12
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_CONFIG_JSON"] = 1] = "FILE_STORE_API_DOMAIN_CONFIG_JSON";
13
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_GRID_CODE_REGIONS_CSV"] = 2] = "FILE_STORE_API_DOMAIN_GRID_CODE_REGIONS_CSV";
14
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_CERTIFIED_INSTALLERS_CSV"] = 3] = "FILE_STORE_API_DOMAIN_CERTIFIED_INSTALLERS_CSV";
15
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_SUPERCHARGER_FILES"] = 4] = "FILE_STORE_API_DOMAIN_SUPERCHARGER_FILES";
16
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_OPTICASTER_FILES"] = 5] = "FILE_STORE_API_DOMAIN_OPTICASTER_FILES";
17
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_WALLBOX_CONFIG"] = 6] = "FILE_STORE_API_DOMAIN_WALLBOX_CONFIG";
18
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_OCPP_CSMS_ROOT_CA"] = 7] = "FILE_STORE_API_DOMAIN_OCPP_CSMS_ROOT_CA";
19
+ FileStoreAPIDomain[FileStoreAPIDomain["FILE_STORE_API_DOMAIN_OPTIMUS_CHARGER_CONFIG"] = 9] = "FILE_STORE_API_DOMAIN_OPTIMUS_CHARGER_CONFIG";
20
+ FileStoreAPIDomain[FileStoreAPIDomain["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
21
+ return FileStoreAPIDomain;
22
+ }({});
23
+ function fileStoreAPIDomainFromJSON(object) {
24
+ switch (object) {
25
+ case 0:
26
+ case "FILE_STORE_API_DOMAIN_INVALID": return 0;
27
+ case 1:
28
+ case "FILE_STORE_API_DOMAIN_CONFIG_JSON": return 1;
29
+ case 2:
30
+ case "FILE_STORE_API_DOMAIN_GRID_CODE_REGIONS_CSV": return 2;
31
+ case 3:
32
+ case "FILE_STORE_API_DOMAIN_CERTIFIED_INSTALLERS_CSV": return 3;
33
+ case 4:
34
+ case "FILE_STORE_API_DOMAIN_SUPERCHARGER_FILES": return 4;
35
+ case 5:
36
+ case "FILE_STORE_API_DOMAIN_OPTICASTER_FILES": return 5;
37
+ case 6:
38
+ case "FILE_STORE_API_DOMAIN_WALLBOX_CONFIG": return 6;
39
+ case 7:
40
+ case "FILE_STORE_API_DOMAIN_OCPP_CSMS_ROOT_CA": return 7;
41
+ case 9:
42
+ case "FILE_STORE_API_DOMAIN_OPTIMUS_CHARGER_CONFIG": return 9;
43
+ default: return -1;
44
+ }
45
+ }
46
+ function fileStoreAPIDomainToJSON(object) {
47
+ switch (object) {
48
+ case 0: return "FILE_STORE_API_DOMAIN_INVALID";
49
+ case 1: return "FILE_STORE_API_DOMAIN_CONFIG_JSON";
50
+ case 2: return "FILE_STORE_API_DOMAIN_GRID_CODE_REGIONS_CSV";
51
+ case 3: return "FILE_STORE_API_DOMAIN_CERTIFIED_INSTALLERS_CSV";
52
+ case 4: return "FILE_STORE_API_DOMAIN_SUPERCHARGER_FILES";
53
+ case 5: return "FILE_STORE_API_DOMAIN_OPTICASTER_FILES";
54
+ case 6: return "FILE_STORE_API_DOMAIN_WALLBOX_CONFIG";
55
+ case 7: return "FILE_STORE_API_DOMAIN_OCPP_CSMS_ROOT_CA";
56
+ case 9: return "FILE_STORE_API_DOMAIN_OPTIMUS_CHARGER_CONFIG";
57
+ default: return "UNRECOGNIZED";
58
+ }
59
+ }
60
+ function createBaseFileStoreAPIFile() {
61
+ return {
62
+ name: "",
63
+ blob: /* @__PURE__ */ new Uint8Array(0)
64
+ };
65
+ }
66
+ const FileStoreAPIFile = {
67
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
68
+ if (message.name !== "") writer.uint32(10).string(message.name);
69
+ if (message.blob.length !== 0) writer.uint32(802).bytes(message.blob);
70
+ return writer;
71
+ },
72
+ decode(input, length) {
73
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
74
+ const end = length === void 0 ? reader.len : reader.pos + length;
75
+ const message = createBaseFileStoreAPIFile();
76
+ while (reader.pos < end) {
77
+ const tag = reader.uint32();
78
+ switch (tag >>> 3) {
79
+ case 1:
80
+ if (tag !== 10) break;
81
+ message.name = reader.string();
82
+ continue;
83
+ case 100:
84
+ if (tag !== 802) break;
85
+ message.blob = reader.bytes();
86
+ continue;
87
+ }
88
+ if ((tag & 7) === 4 || tag === 0) break;
89
+ reader.skip(tag & 7);
90
+ }
91
+ return message;
92
+ },
93
+ fromJSON(object) {
94
+ return {
95
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
96
+ blob: isSet(object.blob) ? bytesFromBase64(object.blob) : /* @__PURE__ */ new Uint8Array(0)
97
+ };
98
+ },
99
+ toJSON(message) {
100
+ const obj = {};
101
+ if (message.name !== void 0) obj.name = message.name;
102
+ if (message.blob !== void 0) obj.blob = base64FromBytes(message.blob);
103
+ return obj;
104
+ },
105
+ create(base) {
106
+ return FileStoreAPIFile.fromPartial(base ?? {});
107
+ },
108
+ fromPartial(object) {
109
+ const message = createBaseFileStoreAPIFile();
110
+ message.name = object.name ?? "";
111
+ message.blob = object.blob ?? /* @__PURE__ */ new Uint8Array(0);
112
+ return message;
113
+ }
114
+ };
115
+ function createBaseFileStoreAPIForceWriteFileRequest() {
116
+ return {
117
+ domain: 0,
118
+ file: void 0
119
+ };
120
+ }
121
+ const FileStoreAPIForceWriteFileRequest = {
122
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
123
+ if (message.domain !== 0) writer.uint32(8).int32(message.domain);
124
+ if (message.file !== void 0) FileStoreAPIFile.encode(message.file, writer.uint32(18).fork()).join();
125
+ return writer;
126
+ },
127
+ decode(input, length) {
128
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
129
+ const end = length === void 0 ? reader.len : reader.pos + length;
130
+ const message = createBaseFileStoreAPIForceWriteFileRequest();
131
+ while (reader.pos < end) {
132
+ const tag = reader.uint32();
133
+ switch (tag >>> 3) {
134
+ case 1:
135
+ if (tag !== 8) break;
136
+ message.domain = reader.int32();
137
+ continue;
138
+ case 2:
139
+ if (tag !== 18) break;
140
+ message.file = FileStoreAPIFile.decode(reader, reader.uint32());
141
+ continue;
142
+ }
143
+ if ((tag & 7) === 4 || tag === 0) break;
144
+ reader.skip(tag & 7);
145
+ }
146
+ return message;
147
+ },
148
+ fromJSON(object) {
149
+ return {
150
+ domain: isSet(object.domain) ? fileStoreAPIDomainFromJSON(object.domain) : 0,
151
+ file: isSet(object.file) ? FileStoreAPIFile.fromJSON(object.file) : void 0
152
+ };
153
+ },
154
+ toJSON(message) {
155
+ const obj = {};
156
+ if (message.domain !== void 0) obj.domain = fileStoreAPIDomainToJSON(message.domain);
157
+ if (message.file !== void 0) obj.file = FileStoreAPIFile.toJSON(message.file);
158
+ return obj;
159
+ },
160
+ create(base) {
161
+ return FileStoreAPIForceWriteFileRequest.fromPartial(base ?? {});
162
+ },
163
+ fromPartial(object) {
164
+ const message = createBaseFileStoreAPIForceWriteFileRequest();
165
+ message.domain = object.domain ?? 0;
166
+ message.file = object.file !== void 0 && object.file !== null ? FileStoreAPIFile.fromPartial(object.file) : void 0;
167
+ return message;
168
+ }
169
+ };
170
+ function createBaseFileStoreAPIForceWriteFileResponse() {
171
+ return { hash: /* @__PURE__ */ new Uint8Array(0) };
172
+ }
173
+ const FileStoreAPIForceWriteFileResponse = {
174
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
175
+ if (message.hash.length !== 0) writer.uint32(10).bytes(message.hash);
176
+ return writer;
177
+ },
178
+ decode(input, length) {
179
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
180
+ const end = length === void 0 ? reader.len : reader.pos + length;
181
+ const message = createBaseFileStoreAPIForceWriteFileResponse();
182
+ while (reader.pos < end) {
183
+ const tag = reader.uint32();
184
+ switch (tag >>> 3) {
185
+ case 1:
186
+ if (tag !== 10) break;
187
+ message.hash = reader.bytes();
188
+ continue;
189
+ }
190
+ if ((tag & 7) === 4 || tag === 0) break;
191
+ reader.skip(tag & 7);
192
+ }
193
+ return message;
194
+ },
195
+ fromJSON(object) {
196
+ return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : /* @__PURE__ */ new Uint8Array(0) };
197
+ },
198
+ toJSON(message) {
199
+ const obj = {};
200
+ if (message.hash !== void 0) obj.hash = base64FromBytes(message.hash);
201
+ return obj;
202
+ },
203
+ create(base) {
204
+ return FileStoreAPIForceWriteFileResponse.fromPartial(base ?? {});
205
+ },
206
+ fromPartial(object) {
207
+ const message = createBaseFileStoreAPIForceWriteFileResponse();
208
+ message.hash = object.hash ?? /* @__PURE__ */ new Uint8Array(0);
209
+ return message;
210
+ }
211
+ };
212
+ function createBaseFileStoreAPIUpdateFileRequest() {
213
+ return {
214
+ domain: 0,
215
+ file: void 0,
216
+ hash: /* @__PURE__ */ new Uint8Array(0)
217
+ };
218
+ }
219
+ const FileStoreAPIUpdateFileRequest = {
220
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
221
+ if (message.domain !== 0) writer.uint32(8).int32(message.domain);
222
+ if (message.file !== void 0) FileStoreAPIFile.encode(message.file, writer.uint32(18).fork()).join();
223
+ if (message.hash.length !== 0) writer.uint32(26).bytes(message.hash);
224
+ return writer;
225
+ },
226
+ decode(input, length) {
227
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
228
+ const end = length === void 0 ? reader.len : reader.pos + length;
229
+ const message = createBaseFileStoreAPIUpdateFileRequest();
230
+ while (reader.pos < end) {
231
+ const tag = reader.uint32();
232
+ switch (tag >>> 3) {
233
+ case 1:
234
+ if (tag !== 8) break;
235
+ message.domain = reader.int32();
236
+ continue;
237
+ case 2:
238
+ if (tag !== 18) break;
239
+ message.file = FileStoreAPIFile.decode(reader, reader.uint32());
240
+ continue;
241
+ case 3:
242
+ if (tag !== 26) break;
243
+ message.hash = reader.bytes();
244
+ continue;
245
+ }
246
+ if ((tag & 7) === 4 || tag === 0) break;
247
+ reader.skip(tag & 7);
248
+ }
249
+ return message;
250
+ },
251
+ fromJSON(object) {
252
+ return {
253
+ domain: isSet(object.domain) ? fileStoreAPIDomainFromJSON(object.domain) : 0,
254
+ file: isSet(object.file) ? FileStoreAPIFile.fromJSON(object.file) : void 0,
255
+ hash: isSet(object.hash) ? bytesFromBase64(object.hash) : /* @__PURE__ */ new Uint8Array(0)
256
+ };
257
+ },
258
+ toJSON(message) {
259
+ const obj = {};
260
+ if (message.domain !== void 0) obj.domain = fileStoreAPIDomainToJSON(message.domain);
261
+ if (message.file !== void 0) obj.file = FileStoreAPIFile.toJSON(message.file);
262
+ if (message.hash !== void 0) obj.hash = base64FromBytes(message.hash);
263
+ return obj;
264
+ },
265
+ create(base) {
266
+ return FileStoreAPIUpdateFileRequest.fromPartial(base ?? {});
267
+ },
268
+ fromPartial(object) {
269
+ const message = createBaseFileStoreAPIUpdateFileRequest();
270
+ message.domain = object.domain ?? 0;
271
+ message.file = object.file !== void 0 && object.file !== null ? FileStoreAPIFile.fromPartial(object.file) : void 0;
272
+ message.hash = object.hash ?? /* @__PURE__ */ new Uint8Array(0);
273
+ return message;
274
+ }
275
+ };
276
+ function createBaseFileStoreAPIUpdateFileResponse() {
277
+ return {
278
+ file: void 0,
279
+ hash: /* @__PURE__ */ new Uint8Array(0)
280
+ };
281
+ }
282
+ const FileStoreAPIUpdateFileResponse = {
283
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
284
+ if (message.file !== void 0) FileStoreAPIFile.encode(message.file, writer.uint32(10).fork()).join();
285
+ if (message.hash.length !== 0) writer.uint32(18).bytes(message.hash);
286
+ return writer;
287
+ },
288
+ decode(input, length) {
289
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
290
+ const end = length === void 0 ? reader.len : reader.pos + length;
291
+ const message = createBaseFileStoreAPIUpdateFileResponse();
292
+ while (reader.pos < end) {
293
+ const tag = reader.uint32();
294
+ switch (tag >>> 3) {
295
+ case 1:
296
+ if (tag !== 10) break;
297
+ message.file = FileStoreAPIFile.decode(reader, reader.uint32());
298
+ continue;
299
+ case 2:
300
+ if (tag !== 18) break;
301
+ message.hash = reader.bytes();
302
+ continue;
303
+ }
304
+ if ((tag & 7) === 4 || tag === 0) break;
305
+ reader.skip(tag & 7);
306
+ }
307
+ return message;
308
+ },
309
+ fromJSON(object) {
310
+ return {
311
+ file: isSet(object.file) ? FileStoreAPIFile.fromJSON(object.file) : void 0,
312
+ hash: isSet(object.hash) ? bytesFromBase64(object.hash) : /* @__PURE__ */ new Uint8Array(0)
313
+ };
314
+ },
315
+ toJSON(message) {
316
+ const obj = {};
317
+ if (message.file !== void 0) obj.file = FileStoreAPIFile.toJSON(message.file);
318
+ if (message.hash !== void 0) obj.hash = base64FromBytes(message.hash);
319
+ return obj;
320
+ },
321
+ create(base) {
322
+ return FileStoreAPIUpdateFileResponse.fromPartial(base ?? {});
323
+ },
324
+ fromPartial(object) {
325
+ const message = createBaseFileStoreAPIUpdateFileResponse();
326
+ message.file = object.file !== void 0 && object.file !== null ? FileStoreAPIFile.fromPartial(object.file) : void 0;
327
+ message.hash = object.hash ?? /* @__PURE__ */ new Uint8Array(0);
328
+ return message;
329
+ }
330
+ };
331
+ function createBaseFileStoreAPIReadFileRequest() {
332
+ return {
333
+ domain: 0,
334
+ name: "",
335
+ ifDifferentHash: /* @__PURE__ */ new Uint8Array(0)
336
+ };
337
+ }
338
+ const FileStoreAPIReadFileRequest = {
339
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
340
+ if (message.domain !== 0) writer.uint32(8).int32(message.domain);
341
+ if (message.name !== "") writer.uint32(18).string(message.name);
342
+ if (message.ifDifferentHash.length !== 0) writer.uint32(26).bytes(message.ifDifferentHash);
343
+ return writer;
344
+ },
345
+ decode(input, length) {
346
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
347
+ const end = length === void 0 ? reader.len : reader.pos + length;
348
+ const message = createBaseFileStoreAPIReadFileRequest();
349
+ while (reader.pos < end) {
350
+ const tag = reader.uint32();
351
+ switch (tag >>> 3) {
352
+ case 1:
353
+ if (tag !== 8) break;
354
+ message.domain = reader.int32();
355
+ continue;
356
+ case 2:
357
+ if (tag !== 18) break;
358
+ message.name = reader.string();
359
+ continue;
360
+ case 3:
361
+ if (tag !== 26) break;
362
+ message.ifDifferentHash = reader.bytes();
363
+ continue;
364
+ }
365
+ if ((tag & 7) === 4 || tag === 0) break;
366
+ reader.skip(tag & 7);
367
+ }
368
+ return message;
369
+ },
370
+ fromJSON(object) {
371
+ return {
372
+ domain: isSet(object.domain) ? fileStoreAPIDomainFromJSON(object.domain) : 0,
373
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
374
+ ifDifferentHash: isSet(object.ifDifferentHash) ? bytesFromBase64(object.ifDifferentHash) : /* @__PURE__ */ new Uint8Array(0)
375
+ };
376
+ },
377
+ toJSON(message) {
378
+ const obj = {};
379
+ if (message.domain !== void 0) obj.domain = fileStoreAPIDomainToJSON(message.domain);
380
+ if (message.name !== void 0) obj.name = message.name;
381
+ if (message.ifDifferentHash !== void 0) obj.ifDifferentHash = base64FromBytes(message.ifDifferentHash);
382
+ return obj;
383
+ },
384
+ create(base) {
385
+ return FileStoreAPIReadFileRequest.fromPartial(base ?? {});
386
+ },
387
+ fromPartial(object) {
388
+ const message = createBaseFileStoreAPIReadFileRequest();
389
+ message.domain = object.domain ?? 0;
390
+ message.name = object.name ?? "";
391
+ message.ifDifferentHash = object.ifDifferentHash ?? /* @__PURE__ */ new Uint8Array(0);
392
+ return message;
393
+ }
394
+ };
395
+ function createBaseFileStoreAPIReadFileResponse() {
396
+ return {
397
+ file: void 0,
398
+ hash: /* @__PURE__ */ new Uint8Array(0)
399
+ };
400
+ }
401
+ const FileStoreAPIReadFileResponse = {
402
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
403
+ if (message.file !== void 0) FileStoreAPIFile.encode(message.file, writer.uint32(10).fork()).join();
404
+ if (message.hash.length !== 0) writer.uint32(18).bytes(message.hash);
405
+ return writer;
406
+ },
407
+ decode(input, length) {
408
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
409
+ const end = length === void 0 ? reader.len : reader.pos + length;
410
+ const message = createBaseFileStoreAPIReadFileResponse();
411
+ while (reader.pos < end) {
412
+ const tag = reader.uint32();
413
+ switch (tag >>> 3) {
414
+ case 1:
415
+ if (tag !== 10) break;
416
+ message.file = FileStoreAPIFile.decode(reader, reader.uint32());
417
+ continue;
418
+ case 2:
419
+ if (tag !== 18) break;
420
+ message.hash = reader.bytes();
421
+ continue;
422
+ }
423
+ if ((tag & 7) === 4 || tag === 0) break;
424
+ reader.skip(tag & 7);
425
+ }
426
+ return message;
427
+ },
428
+ fromJSON(object) {
429
+ return {
430
+ file: isSet(object.file) ? FileStoreAPIFile.fromJSON(object.file) : void 0,
431
+ hash: isSet(object.hash) ? bytesFromBase64(object.hash) : /* @__PURE__ */ new Uint8Array(0)
432
+ };
433
+ },
434
+ toJSON(message) {
435
+ const obj = {};
436
+ if (message.file !== void 0) obj.file = FileStoreAPIFile.toJSON(message.file);
437
+ if (message.hash !== void 0) obj.hash = base64FromBytes(message.hash);
438
+ return obj;
439
+ },
440
+ create(base) {
441
+ return FileStoreAPIReadFileResponse.fromPartial(base ?? {});
442
+ },
443
+ fromPartial(object) {
444
+ const message = createBaseFileStoreAPIReadFileResponse();
445
+ message.file = object.file !== void 0 && object.file !== null ? FileStoreAPIFile.fromPartial(object.file) : void 0;
446
+ message.hash = object.hash ?? /* @__PURE__ */ new Uint8Array(0);
447
+ return message;
448
+ }
449
+ };
450
+ function createBaseFileStoreMessages() {
451
+ return {
452
+ readFileRequest: void 0,
453
+ readFileResponse: void 0,
454
+ forceWriteFileRequest: void 0,
455
+ forceWriteFileResponse: void 0,
456
+ updateFileRequest: void 0,
457
+ updateFileResponse: void 0
458
+ };
459
+ }
460
+ const FileStoreMessages = {
461
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
462
+ if (message.readFileRequest !== void 0) FileStoreAPIReadFileRequest.encode(message.readFileRequest, writer.uint32(10).fork()).join();
463
+ if (message.readFileResponse !== void 0) FileStoreAPIReadFileResponse.encode(message.readFileResponse, writer.uint32(18).fork()).join();
464
+ if (message.forceWriteFileRequest !== void 0) FileStoreAPIForceWriteFileRequest.encode(message.forceWriteFileRequest, writer.uint32(26).fork()).join();
465
+ if (message.forceWriteFileResponse !== void 0) FileStoreAPIForceWriteFileResponse.encode(message.forceWriteFileResponse, writer.uint32(34).fork()).join();
466
+ if (message.updateFileRequest !== void 0) FileStoreAPIUpdateFileRequest.encode(message.updateFileRequest, writer.uint32(42).fork()).join();
467
+ if (message.updateFileResponse !== void 0) FileStoreAPIUpdateFileResponse.encode(message.updateFileResponse, writer.uint32(50).fork()).join();
468
+ return writer;
469
+ },
470
+ decode(input, length) {
471
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
472
+ const end = length === void 0 ? reader.len : reader.pos + length;
473
+ const message = createBaseFileStoreMessages();
474
+ while (reader.pos < end) {
475
+ const tag = reader.uint32();
476
+ switch (tag >>> 3) {
477
+ case 1:
478
+ if (tag !== 10) break;
479
+ message.readFileRequest = FileStoreAPIReadFileRequest.decode(reader, reader.uint32());
480
+ continue;
481
+ case 2:
482
+ if (tag !== 18) break;
483
+ message.readFileResponse = FileStoreAPIReadFileResponse.decode(reader, reader.uint32());
484
+ continue;
485
+ case 3:
486
+ if (tag !== 26) break;
487
+ message.forceWriteFileRequest = FileStoreAPIForceWriteFileRequest.decode(reader, reader.uint32());
488
+ continue;
489
+ case 4:
490
+ if (tag !== 34) break;
491
+ message.forceWriteFileResponse = FileStoreAPIForceWriteFileResponse.decode(reader, reader.uint32());
492
+ continue;
493
+ case 5:
494
+ if (tag !== 42) break;
495
+ message.updateFileRequest = FileStoreAPIUpdateFileRequest.decode(reader, reader.uint32());
496
+ continue;
497
+ case 6:
498
+ if (tag !== 50) break;
499
+ message.updateFileResponse = FileStoreAPIUpdateFileResponse.decode(reader, reader.uint32());
500
+ continue;
501
+ }
502
+ if ((tag & 7) === 4 || tag === 0) break;
503
+ reader.skip(tag & 7);
504
+ }
505
+ return message;
506
+ },
507
+ fromJSON(object) {
508
+ return {
509
+ readFileRequest: isSet(object.readFileRequest) ? FileStoreAPIReadFileRequest.fromJSON(object.readFileRequest) : void 0,
510
+ readFileResponse: isSet(object.readFileResponse) ? FileStoreAPIReadFileResponse.fromJSON(object.readFileResponse) : void 0,
511
+ forceWriteFileRequest: isSet(object.forceWriteFileRequest) ? FileStoreAPIForceWriteFileRequest.fromJSON(object.forceWriteFileRequest) : void 0,
512
+ forceWriteFileResponse: isSet(object.forceWriteFileResponse) ? FileStoreAPIForceWriteFileResponse.fromJSON(object.forceWriteFileResponse) : void 0,
513
+ updateFileRequest: isSet(object.updateFileRequest) ? FileStoreAPIUpdateFileRequest.fromJSON(object.updateFileRequest) : void 0,
514
+ updateFileResponse: isSet(object.updateFileResponse) ? FileStoreAPIUpdateFileResponse.fromJSON(object.updateFileResponse) : void 0
515
+ };
516
+ },
517
+ toJSON(message) {
518
+ const obj = {};
519
+ if (message.readFileRequest !== void 0) obj.readFileRequest = FileStoreAPIReadFileRequest.toJSON(message.readFileRequest);
520
+ if (message.readFileResponse !== void 0) obj.readFileResponse = FileStoreAPIReadFileResponse.toJSON(message.readFileResponse);
521
+ if (message.forceWriteFileRequest !== void 0) obj.forceWriteFileRequest = FileStoreAPIForceWriteFileRequest.toJSON(message.forceWriteFileRequest);
522
+ if (message.forceWriteFileResponse !== void 0) obj.forceWriteFileResponse = FileStoreAPIForceWriteFileResponse.toJSON(message.forceWriteFileResponse);
523
+ if (message.updateFileRequest !== void 0) obj.updateFileRequest = FileStoreAPIUpdateFileRequest.toJSON(message.updateFileRequest);
524
+ if (message.updateFileResponse !== void 0) obj.updateFileResponse = FileStoreAPIUpdateFileResponse.toJSON(message.updateFileResponse);
525
+ return obj;
526
+ },
527
+ create(base) {
528
+ return FileStoreMessages.fromPartial(base ?? {});
529
+ },
530
+ fromPartial(object) {
531
+ const message = createBaseFileStoreMessages();
532
+ message.readFileRequest = object.readFileRequest !== void 0 && object.readFileRequest !== null ? FileStoreAPIReadFileRequest.fromPartial(object.readFileRequest) : void 0;
533
+ message.readFileResponse = object.readFileResponse !== void 0 && object.readFileResponse !== null ? FileStoreAPIReadFileResponse.fromPartial(object.readFileResponse) : void 0;
534
+ message.forceWriteFileRequest = object.forceWriteFileRequest !== void 0 && object.forceWriteFileRequest !== null ? FileStoreAPIForceWriteFileRequest.fromPartial(object.forceWriteFileRequest) : void 0;
535
+ message.forceWriteFileResponse = object.forceWriteFileResponse !== void 0 && object.forceWriteFileResponse !== null ? FileStoreAPIForceWriteFileResponse.fromPartial(object.forceWriteFileResponse) : void 0;
536
+ message.updateFileRequest = object.updateFileRequest !== void 0 && object.updateFileRequest !== null ? FileStoreAPIUpdateFileRequest.fromPartial(object.updateFileRequest) : void 0;
537
+ message.updateFileResponse = object.updateFileResponse !== void 0 && object.updateFileResponse !== null ? FileStoreAPIUpdateFileResponse.fromPartial(object.updateFileResponse) : void 0;
538
+ return message;
539
+ }
540
+ };
541
+ function bytesFromBase64(b64) {
542
+ if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
543
+ else {
544
+ const bin = globalThis.atob(b64);
545
+ const arr = new Uint8Array(bin.length);
546
+ for (let i = 0; i < bin.length; ++i) arr[i] = bin.charCodeAt(i);
547
+ return arr;
548
+ }
549
+ }
550
+ function base64FromBytes(arr) {
551
+ if (globalThis.Buffer) return globalThis.Buffer.from(arr).toString("base64");
552
+ else {
553
+ const bin = [];
554
+ arr.forEach((byte) => {
555
+ bin.push(globalThis.String.fromCharCode(byte));
556
+ });
557
+ return globalThis.btoa(bin.join(""));
558
+ }
559
+ }
560
+ function isSet(value) {
561
+ return value !== null && value !== void 0;
562
+ }
563
+ //#endregion
564
+ exports.FileStoreAPIDomain = FileStoreAPIDomain;
565
+ exports.FileStoreAPIFile = FileStoreAPIFile;
566
+ exports.FileStoreAPIForceWriteFileRequest = FileStoreAPIForceWriteFileRequest;
567
+ exports.FileStoreAPIForceWriteFileResponse = FileStoreAPIForceWriteFileResponse;
568
+ exports.FileStoreAPIReadFileRequest = FileStoreAPIReadFileRequest;
569
+ exports.FileStoreAPIReadFileResponse = FileStoreAPIReadFileResponse;
570
+ exports.FileStoreAPIUpdateFileRequest = FileStoreAPIUpdateFileRequest;
571
+ exports.FileStoreAPIUpdateFileResponse = FileStoreAPIUpdateFileResponse;
572
+ exports.FileStoreMessages = FileStoreMessages;
573
+ exports.fileStoreAPIDomainFromJSON = fileStoreAPIDomainFromJSON;
574
+ exports.fileStoreAPIDomainToJSON = fileStoreAPIDomainToJSON;
575
+ exports.protobufPackage = protobufPackage;
@@ -0,0 +1,81 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ //#region src/energy_device/filestore_api.d.ts
3
+ declare const protobufPackage = "tesla.proto.energy_device.v1";
4
+ /**
5
+ * TESLEMETRY SOURCE-OF-RECORD - no upstream.
6
+ * Provenance: Tesla Energy gateway (TEG) local API, from our own
7
+ * observations and contributions from the community
8
+ */
9
+ declare enum FileStoreAPIDomain {
10
+ FILE_STORE_API_DOMAIN_INVALID = 0,
11
+ FILE_STORE_API_DOMAIN_CONFIG_JSON = 1,
12
+ FILE_STORE_API_DOMAIN_GRID_CODE_REGIONS_CSV = 2,
13
+ FILE_STORE_API_DOMAIN_CERTIFIED_INSTALLERS_CSV = 3,
14
+ FILE_STORE_API_DOMAIN_SUPERCHARGER_FILES = 4,
15
+ FILE_STORE_API_DOMAIN_OPTICASTER_FILES = 5,
16
+ FILE_STORE_API_DOMAIN_WALLBOX_CONFIG = 6,
17
+ FILE_STORE_API_DOMAIN_OCPP_CSMS_ROOT_CA = 7,
18
+ FILE_STORE_API_DOMAIN_OPTIMUS_CHARGER_CONFIG = 9,
19
+ UNRECOGNIZED = -1
20
+ }
21
+ declare function fileStoreAPIDomainFromJSON(object: any): FileStoreAPIDomain;
22
+ declare function fileStoreAPIDomainToJSON(object: FileStoreAPIDomain): string;
23
+ interface FileStoreAPIFile {
24
+ name: string;
25
+ blob: Uint8Array;
26
+ }
27
+ interface FileStoreAPIForceWriteFileRequest {
28
+ domain: FileStoreAPIDomain;
29
+ file: FileStoreAPIFile | undefined;
30
+ }
31
+ interface FileStoreAPIForceWriteFileResponse {
32
+ hash: Uint8Array;
33
+ }
34
+ interface FileStoreAPIUpdateFileRequest {
35
+ domain: FileStoreAPIDomain;
36
+ file: FileStoreAPIFile | undefined;
37
+ hash: Uint8Array;
38
+ }
39
+ interface FileStoreAPIUpdateFileResponse {
40
+ file: FileStoreAPIFile | undefined;
41
+ hash: Uint8Array;
42
+ }
43
+ interface FileStoreAPIReadFileRequest {
44
+ domain: FileStoreAPIDomain;
45
+ name: string;
46
+ ifDifferentHash: Uint8Array;
47
+ }
48
+ interface FileStoreAPIReadFileResponse {
49
+ file: FileStoreAPIFile | undefined;
50
+ hash: Uint8Array;
51
+ }
52
+ interface FileStoreMessages {
53
+ readFileRequest?: FileStoreAPIReadFileRequest | undefined;
54
+ readFileResponse?: FileStoreAPIReadFileResponse | undefined;
55
+ forceWriteFileRequest?: FileStoreAPIForceWriteFileRequest | undefined;
56
+ forceWriteFileResponse?: FileStoreAPIForceWriteFileResponse | undefined;
57
+ updateFileRequest?: FileStoreAPIUpdateFileRequest | undefined;
58
+ updateFileResponse?: FileStoreAPIUpdateFileResponse | undefined;
59
+ }
60
+ declare const FileStoreAPIFile: MessageFns<FileStoreAPIFile>;
61
+ declare const FileStoreAPIForceWriteFileRequest: MessageFns<FileStoreAPIForceWriteFileRequest>;
62
+ declare const FileStoreAPIForceWriteFileResponse: MessageFns<FileStoreAPIForceWriteFileResponse>;
63
+ declare const FileStoreAPIUpdateFileRequest: MessageFns<FileStoreAPIUpdateFileRequest>;
64
+ declare const FileStoreAPIUpdateFileResponse: MessageFns<FileStoreAPIUpdateFileResponse>;
65
+ declare const FileStoreAPIReadFileRequest: MessageFns<FileStoreAPIReadFileRequest>;
66
+ declare const FileStoreAPIReadFileResponse: MessageFns<FileStoreAPIReadFileResponse>;
67
+ declare const FileStoreMessages: MessageFns<FileStoreMessages>;
68
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
69
+ type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]>; } : Partial<T>;
70
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
71
+ type Exact<P, I extends P> = P extends Builtin ? P : P & { [K in keyof P]: Exact<P[K], I[K]>; } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never; };
72
+ interface MessageFns<T> {
73
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
74
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
75
+ fromJSON(object: any): T;
76
+ toJSON(message: T): unknown;
77
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
78
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
79
+ }
80
+ //#endregion
81
+ export { DeepPartial, Exact, FileStoreAPIDomain, FileStoreAPIFile, FileStoreAPIForceWriteFileRequest, FileStoreAPIForceWriteFileResponse, FileStoreAPIReadFileRequest, FileStoreAPIReadFileResponse, FileStoreAPIUpdateFileRequest, FileStoreAPIUpdateFileResponse, FileStoreMessages, MessageFns, fileStoreAPIDomainFromJSON, fileStoreAPIDomainToJSON, protobufPackage };