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