@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.
- package/README.md +20 -0
- package/dist/command/car_server.cjs +11126 -0
- package/dist/command/car_server.d.cts +1281 -0
- package/dist/command/car_server.d.mts +1281 -0
- package/dist/command/car_server.mjs +10880 -0
- package/dist/command/common.cjs +1536 -0
- package/dist/command/common.d.cts +327 -0
- package/dist/command/common.d.mts +327 -0
- package/dist/command/common.mjs +1488 -0
- package/dist/command/errors.cjs +107 -0
- package/dist/command/errors.d.cts +40 -0
- package/dist/command/errors.d.mts +40 -0
- package/dist/command/errors.mjs +102 -0
- package/dist/command/google/protobuf/timestamp.cjs +71 -0
- package/dist/command/google/protobuf/timestamp.d.cts +124 -0
- package/dist/command/google/protobuf/timestamp.d.mts +124 -0
- package/dist/command/google/protobuf/timestamp.mjs +69 -0
- package/dist/command/google/protobuf/wrappers.cjs +421 -0
- package/dist/command/google/protobuf/wrappers.d.cts +134 -0
- package/dist/command/google/protobuf/wrappers.d.mts +134 -0
- package/dist/command/google/protobuf/wrappers.mjs +411 -0
- package/dist/command/keys.cjs +60 -0
- package/dist/command/keys.d.cts +23 -0
- package/dist/command/keys.d.mts +23 -0
- package/dist/command/keys.mjs +56 -0
- package/dist/command/managed_charging.cjs +435 -0
- package/dist/command/managed_charging.d.cts +86 -0
- package/dist/command/managed_charging.d.mts +86 -0
- package/dist/command/managed_charging.mjs +421 -0
- package/dist/command/session.cjs +119 -0
- package/dist/command/session.d.cts +28 -0
- package/dist/command/session.d.mts +28 -0
- package/dist/command/session.mjs +117 -0
- package/dist/command/signatures.cjs +696 -0
- package/dist/command/signatures.d.cts +107 -0
- package/dist/command/signatures.d.mts +107 -0
- package/dist/command/signatures.mjs +678 -0
- package/dist/command/universal_message.cjs +588 -0
- package/dist/command/universal_message.d.cts +141 -0
- package/dist/command/universal_message.d.mts +141 -0
- package/dist/command/universal_message.mjs +571 -0
- package/dist/command/vcsec.cjs +2281 -0
- package/dist/command/vcsec.d.cts +404 -0
- package/dist/command/vcsec.d.mts +404 -0
- package/dist/command/vcsec.mjs +2218 -0
- package/dist/command/vehicle.cjs +10332 -0
- package/dist/command/vehicle.d.cts +1429 -0
- package/dist/command/vehicle.d.mts +1429 -0
- package/dist/command/vehicle.mjs +10168 -0
- package/dist/energy_command/identifier_type.cjs +47 -0
- package/dist/energy_command/identifier_type.d.cts +19 -0
- package/dist/energy_command/identifier_type.d.mts +19 -0
- package/dist/energy_command/identifier_type.mjs +43 -0
- package/dist/energy_device/authorization_api.cjs +815 -0
- package/dist/energy_device/authorization_api.d.cts +92 -0
- package/dist/energy_device/authorization_api.d.mts +92 -0
- package/dist/energy_device/authorization_api.mjs +801 -0
- package/dist/energy_device/authorization_types.cjs +348 -0
- package/dist/energy_device/authorization_types.d.cts +79 -0
- package/dist/energy_device/authorization_types.d.mts +79 -0
- package/dist/energy_device/authorization_types.mjs +331 -0
- package/dist/energy_device/common_api.cjs +2104 -0
- package/dist/energy_device/common_api.d.cts +211 -0
- package/dist/energy_device/common_api.d.mts +211 -0
- package/dist/energy_device/common_api.mjs +2064 -0
- package/dist/energy_device/device.cjs +485 -0
- package/dist/energy_device/device.d.cts +102 -0
- package/dist/energy_device/device.d.mts +102 -0
- package/dist/energy_device/device.mjs +462 -0
- package/dist/energy_device/energy.cjs +442 -0
- package/dist/energy_device/energy.d.cts +82 -0
- package/dist/energy_device/energy.d.mts +82 -0
- package/dist/energy_device/energy.mjs +429 -0
- package/dist/energy_device/energy_site_net.cjs +235 -0
- package/dist/energy_device/energy_site_net.d.cts +69 -0
- package/dist/energy_device/energy_site_net.d.mts +69 -0
- package/dist/energy_device/energy_site_net.mjs +219 -0
- package/dist/energy_device/error.cjs +53 -0
- package/dist/energy_device/error.d.cts +27 -0
- package/dist/energy_device/error.d.mts +27 -0
- package/dist/energy_device/error.mjs +51 -0
- package/dist/energy_device/google/protobuf/timestamp.cjs +71 -0
- package/dist/energy_device/google/protobuf/timestamp.d.cts +124 -0
- package/dist/energy_device/google/protobuf/timestamp.d.mts +124 -0
- package/dist/energy_device/google/protobuf/timestamp.mjs +69 -0
- package/dist/energy_device/google/protobuf/wrappers.cjs +421 -0
- package/dist/energy_device/google/protobuf/wrappers.d.cts +134 -0
- package/dist/energy_device/google/protobuf/wrappers.d.mts +134 -0
- package/dist/energy_device/google/protobuf/wrappers.mjs +411 -0
- package/dist/energy_device/google/rpc/status.cjs +65 -0
- package/dist/energy_device/google/rpc/status.d.cts +26 -0
- package/dist/energy_device/google/rpc/status.d.mts +26 -0
- package/dist/energy_device/google/rpc/status.mjs +63 -0
- package/dist/energy_device/networking.cjs +834 -0
- package/dist/energy_device/networking.d.cts +141 -0
- package/dist/energy_device/networking.d.mts +141 -0
- package/dist/energy_device/networking.mjs +810 -0
- package/dist/energy_device/teg_api.cjs +594 -0
- package/dist/energy_device/teg_api.d.cts +140 -0
- package/dist/energy_device/teg_api.d.mts +140 -0
- package/dist/energy_device/teg_api.mjs +581 -0
- package/dist/energy_device/transport.cjs +478 -0
- package/dist/energy_device/transport.d.cts +95 -0
- package/dist/energy_device/transport.d.mts +95 -0
- package/dist/energy_device/transport.mjs +460 -0
- package/dist/energy_device/update.cjs +521 -0
- package/dist/energy_device/update.d.cts +86 -0
- package/dist/energy_device/update.d.mts +86 -0
- package/dist/energy_device/update.mjs +506 -0
- package/dist/energy_device/wall_connector.cjs +634 -0
- package/dist/energy_device/wall_connector.d.cts +182 -0
- package/dist/energy_device/wall_connector.d.mts +182 -0
- package/dist/energy_device/wall_connector.mjs +590 -0
- package/dist/telemetry/google/protobuf/timestamp.cjs +71 -0
- package/dist/telemetry/google/protobuf/timestamp.d.cts +124 -0
- package/dist/telemetry/google/protobuf/timestamp.d.mts +124 -0
- package/dist/telemetry/google/protobuf/timestamp.mjs +69 -0
- package/dist/telemetry/vehicle_alert.cjs +214 -0
- package/dist/telemetry/vehicle_alert.d.cts +48 -0
- package/dist/telemetry/vehicle_alert.d.mts +48 -0
- package/dist/telemetry/vehicle_alert.mjs +208 -0
- package/dist/telemetry/vehicle_connectivity.cjs +145 -0
- package/dist/telemetry/vehicle_connectivity.d.cts +41 -0
- package/dist/telemetry/vehicle_connectivity.d.mts +41 -0
- package/dist/telemetry/vehicle_connectivity.mjs +140 -0
- package/dist/telemetry/vehicle_data.cjs +3792 -0
- package/dist/telemetry/vehicle_data.d.cts +872 -0
- package/dist/telemetry/vehicle_data.d.mts +872 -0
- package/dist/telemetry/vehicle_data.mjs +3655 -0
- package/dist/telemetry/vehicle_error.cjs +245 -0
- package/dist/telemetry/vehicle_error.d.cts +45 -0
- package/dist/telemetry/vehicle_error.d.mts +45 -0
- package/dist/telemetry/vehicle_error.mjs +241 -0
- package/dist/telemetry/vehicle_metric.cjs +236 -0
- package/dist/telemetry/vehicle_metric.d.cts +44 -0
- package/dist/telemetry/vehicle_metric.d.mts +44 -0
- package/dist/telemetry/vehicle_metric.mjs +232 -0
- package/dist/teslapower/google/protobuf/any.cjs +84 -0
- package/dist/teslapower/google/protobuf/any.d.cts +140 -0
- package/dist/teslapower/google/protobuf/any.d.mts +140 -0
- package/dist/teslapower/google/protobuf/any.mjs +82 -0
- package/dist/teslapower/google/protobuf/timestamp.cjs +71 -0
- package/dist/teslapower/google/protobuf/timestamp.d.cts +124 -0
- package/dist/teslapower/google/protobuf/timestamp.d.mts +124 -0
- package/dist/teslapower/google/protobuf/timestamp.mjs +69 -0
- package/dist/teslapower/teslapower.cjs +5486 -0
- package/dist/teslapower/teslapower.d.cts +518 -0
- package/dist/teslapower/teslapower.d.mts +518 -0
- package/dist/teslapower/teslapower.mjs +5381 -0
- package/package.json +53 -0
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _bufbuild_protobuf_wire = require("@bufbuild/protobuf/wire");
|
|
3
|
+
//#region src/command/signatures.ts
|
|
4
|
+
const protobufPackage = "Signatures";
|
|
5
|
+
/**
|
|
6
|
+
* UPSTREAM-SOURCE: teslamotors/vehicle-command
|
|
7
|
+
* UPSTREAM-PATH: pkg/protocol/protobuf/signatures.proto
|
|
8
|
+
* UPSTREAM-COMMIT: see upstream.json
|
|
9
|
+
* This file = upstream base + Teslemetry extensions marked TESLEMETRY-EXT.
|
|
10
|
+
*/
|
|
11
|
+
let Tag = /* @__PURE__ */ function(Tag) {
|
|
12
|
+
Tag[Tag["TAG_SIGNATURE_TYPE"] = 0] = "TAG_SIGNATURE_TYPE";
|
|
13
|
+
Tag[Tag["TAG_DOMAIN"] = 1] = "TAG_DOMAIN";
|
|
14
|
+
Tag[Tag["TAG_PERSONALIZATION"] = 2] = "TAG_PERSONALIZATION";
|
|
15
|
+
Tag[Tag["TAG_EPOCH"] = 3] = "TAG_EPOCH";
|
|
16
|
+
Tag[Tag["TAG_EXPIRES_AT"] = 4] = "TAG_EXPIRES_AT";
|
|
17
|
+
Tag[Tag["TAG_COUNTER"] = 5] = "TAG_COUNTER";
|
|
18
|
+
Tag[Tag["TAG_CHALLENGE"] = 6] = "TAG_CHALLENGE";
|
|
19
|
+
Tag[Tag["TAG_FLAGS"] = 7] = "TAG_FLAGS";
|
|
20
|
+
Tag[Tag["TAG_REQUEST_HASH"] = 8] = "TAG_REQUEST_HASH";
|
|
21
|
+
Tag[Tag["TAG_FAULT"] = 9] = "TAG_FAULT";
|
|
22
|
+
Tag[Tag["TAG_END"] = 255] = "TAG_END";
|
|
23
|
+
Tag[Tag["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
24
|
+
return Tag;
|
|
25
|
+
}({});
|
|
26
|
+
function tagFromJSON(object) {
|
|
27
|
+
switch (object) {
|
|
28
|
+
case 0:
|
|
29
|
+
case "TAG_SIGNATURE_TYPE": return 0;
|
|
30
|
+
case 1:
|
|
31
|
+
case "TAG_DOMAIN": return 1;
|
|
32
|
+
case 2:
|
|
33
|
+
case "TAG_PERSONALIZATION": return 2;
|
|
34
|
+
case 3:
|
|
35
|
+
case "TAG_EPOCH": return 3;
|
|
36
|
+
case 4:
|
|
37
|
+
case "TAG_EXPIRES_AT": return 4;
|
|
38
|
+
case 5:
|
|
39
|
+
case "TAG_COUNTER": return 5;
|
|
40
|
+
case 6:
|
|
41
|
+
case "TAG_CHALLENGE": return 6;
|
|
42
|
+
case 7:
|
|
43
|
+
case "TAG_FLAGS": return 7;
|
|
44
|
+
case 8:
|
|
45
|
+
case "TAG_REQUEST_HASH": return 8;
|
|
46
|
+
case 9:
|
|
47
|
+
case "TAG_FAULT": return 9;
|
|
48
|
+
case 255:
|
|
49
|
+
case "TAG_END": return 255;
|
|
50
|
+
default: return -1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function tagToJSON(object) {
|
|
54
|
+
switch (object) {
|
|
55
|
+
case 0: return "TAG_SIGNATURE_TYPE";
|
|
56
|
+
case 1: return "TAG_DOMAIN";
|
|
57
|
+
case 2: return "TAG_PERSONALIZATION";
|
|
58
|
+
case 3: return "TAG_EPOCH";
|
|
59
|
+
case 4: return "TAG_EXPIRES_AT";
|
|
60
|
+
case 5: return "TAG_COUNTER";
|
|
61
|
+
case 6: return "TAG_CHALLENGE";
|
|
62
|
+
case 7: return "TAG_FLAGS";
|
|
63
|
+
case 8: return "TAG_REQUEST_HASH";
|
|
64
|
+
case 9: return "TAG_FAULT";
|
|
65
|
+
case 255: return "TAG_END";
|
|
66
|
+
default: return "UNRECOGNIZED";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
let SignatureType = /* @__PURE__ */ function(SignatureType) {
|
|
70
|
+
SignatureType[SignatureType["SIGNATURE_TYPE_AES_GCM"] = 0] = "SIGNATURE_TYPE_AES_GCM";
|
|
71
|
+
SignatureType[SignatureType["SIGNATURE_TYPE_AES_GCM_PERSONALIZED"] = 5] = "SIGNATURE_TYPE_AES_GCM_PERSONALIZED";
|
|
72
|
+
SignatureType[SignatureType["SIGNATURE_TYPE_HMAC"] = 6] = "SIGNATURE_TYPE_HMAC";
|
|
73
|
+
SignatureType[SignatureType["SIGNATURE_TYPE_HMAC_PERSONALIZED"] = 8] = "SIGNATURE_TYPE_HMAC_PERSONALIZED";
|
|
74
|
+
SignatureType[SignatureType["SIGNATURE_TYPE_AES_GCM_RESPONSE"] = 9] = "SIGNATURE_TYPE_AES_GCM_RESPONSE";
|
|
75
|
+
SignatureType[SignatureType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
76
|
+
return SignatureType;
|
|
77
|
+
}({});
|
|
78
|
+
function signatureTypeFromJSON(object) {
|
|
79
|
+
switch (object) {
|
|
80
|
+
case 0:
|
|
81
|
+
case "SIGNATURE_TYPE_AES_GCM": return 0;
|
|
82
|
+
case 5:
|
|
83
|
+
case "SIGNATURE_TYPE_AES_GCM_PERSONALIZED": return 5;
|
|
84
|
+
case 6:
|
|
85
|
+
case "SIGNATURE_TYPE_HMAC": return 6;
|
|
86
|
+
case 8:
|
|
87
|
+
case "SIGNATURE_TYPE_HMAC_PERSONALIZED": return 8;
|
|
88
|
+
case 9:
|
|
89
|
+
case "SIGNATURE_TYPE_AES_GCM_RESPONSE": return 9;
|
|
90
|
+
default: return -1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function signatureTypeToJSON(object) {
|
|
94
|
+
switch (object) {
|
|
95
|
+
case 0: return "SIGNATURE_TYPE_AES_GCM";
|
|
96
|
+
case 5: return "SIGNATURE_TYPE_AES_GCM_PERSONALIZED";
|
|
97
|
+
case 6: return "SIGNATURE_TYPE_HMAC";
|
|
98
|
+
case 8: return "SIGNATURE_TYPE_HMAC_PERSONALIZED";
|
|
99
|
+
case 9: return "SIGNATURE_TYPE_AES_GCM_RESPONSE";
|
|
100
|
+
default: return "UNRECOGNIZED";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
let SessionInfoStatus = /* @__PURE__ */ function(SessionInfoStatus) {
|
|
104
|
+
SessionInfoStatus[SessionInfoStatus["SESSION_INFO_STATUS_OK"] = 0] = "SESSION_INFO_STATUS_OK";
|
|
105
|
+
SessionInfoStatus[SessionInfoStatus["SESSION_INFO_STATUS_KEY_NOT_ON_WHITELIST"] = 1] = "SESSION_INFO_STATUS_KEY_NOT_ON_WHITELIST";
|
|
106
|
+
SessionInfoStatus[SessionInfoStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
107
|
+
return SessionInfoStatus;
|
|
108
|
+
}({});
|
|
109
|
+
function sessionInfoStatusFromJSON(object) {
|
|
110
|
+
switch (object) {
|
|
111
|
+
case 0:
|
|
112
|
+
case "SESSION_INFO_STATUS_OK": return 0;
|
|
113
|
+
case 1:
|
|
114
|
+
case "SESSION_INFO_STATUS_KEY_NOT_ON_WHITELIST": return 1;
|
|
115
|
+
default: return -1;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function sessionInfoStatusToJSON(object) {
|
|
119
|
+
switch (object) {
|
|
120
|
+
case 0: return "SESSION_INFO_STATUS_OK";
|
|
121
|
+
case 1: return "SESSION_INFO_STATUS_KEY_NOT_ON_WHITELIST";
|
|
122
|
+
default: return "UNRECOGNIZED";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function createBaseKeyIdentity() {
|
|
126
|
+
return {
|
|
127
|
+
publicKey: void 0,
|
|
128
|
+
handle: void 0
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const KeyIdentity = {
|
|
132
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
133
|
+
if (message.publicKey !== void 0) writer.uint32(10).bytes(message.publicKey);
|
|
134
|
+
if (message.handle !== void 0) writer.uint32(24).uint32(message.handle);
|
|
135
|
+
return writer;
|
|
136
|
+
},
|
|
137
|
+
decode(input, length) {
|
|
138
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
139
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
140
|
+
const message = createBaseKeyIdentity();
|
|
141
|
+
while (reader.pos < end) {
|
|
142
|
+
const tag = reader.uint32();
|
|
143
|
+
switch (tag >>> 3) {
|
|
144
|
+
case 1:
|
|
145
|
+
if (tag !== 10) break;
|
|
146
|
+
message.publicKey = reader.bytes();
|
|
147
|
+
continue;
|
|
148
|
+
case 3:
|
|
149
|
+
if (tag !== 24) break;
|
|
150
|
+
message.handle = reader.uint32();
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
154
|
+
reader.skip(tag & 7);
|
|
155
|
+
}
|
|
156
|
+
return message;
|
|
157
|
+
},
|
|
158
|
+
fromJSON(object) {
|
|
159
|
+
return {
|
|
160
|
+
publicKey: isSet(object.publicKey) ? bytesFromBase64(object.publicKey) : void 0,
|
|
161
|
+
handle: isSet(object.handle) ? globalThis.Number(object.handle) : void 0
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
toJSON(message) {
|
|
165
|
+
const obj = {};
|
|
166
|
+
if (message.publicKey !== void 0) obj.publicKey = base64FromBytes(message.publicKey);
|
|
167
|
+
if (message.handle !== void 0) obj.handle = Math.round(message.handle);
|
|
168
|
+
return obj;
|
|
169
|
+
},
|
|
170
|
+
create(base) {
|
|
171
|
+
return KeyIdentity.fromPartial(base ?? {});
|
|
172
|
+
},
|
|
173
|
+
fromPartial(object) {
|
|
174
|
+
const message = createBaseKeyIdentity();
|
|
175
|
+
message.publicKey = object.publicKey ?? void 0;
|
|
176
|
+
message.handle = object.handle ?? void 0;
|
|
177
|
+
return message;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
function createBaseAESGCMPersonalizedSignatureData() {
|
|
181
|
+
return {
|
|
182
|
+
epoch: /* @__PURE__ */ new Uint8Array(0),
|
|
183
|
+
nonce: /* @__PURE__ */ new Uint8Array(0),
|
|
184
|
+
counter: 0,
|
|
185
|
+
expiresAt: 0,
|
|
186
|
+
tag: /* @__PURE__ */ new Uint8Array(0)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
const AESGCMPersonalizedSignatureData = {
|
|
190
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
191
|
+
if (message.epoch.length !== 0) writer.uint32(10).bytes(message.epoch);
|
|
192
|
+
if (message.nonce.length !== 0) writer.uint32(18).bytes(message.nonce);
|
|
193
|
+
if (message.counter !== 0) writer.uint32(24).uint32(message.counter);
|
|
194
|
+
if (message.expiresAt !== 0) writer.uint32(37).fixed32(message.expiresAt);
|
|
195
|
+
if (message.tag.length !== 0) writer.uint32(42).bytes(message.tag);
|
|
196
|
+
return writer;
|
|
197
|
+
},
|
|
198
|
+
decode(input, length) {
|
|
199
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
200
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
201
|
+
const message = createBaseAESGCMPersonalizedSignatureData();
|
|
202
|
+
while (reader.pos < end) {
|
|
203
|
+
const tag = reader.uint32();
|
|
204
|
+
switch (tag >>> 3) {
|
|
205
|
+
case 1:
|
|
206
|
+
if (tag !== 10) break;
|
|
207
|
+
message.epoch = reader.bytes();
|
|
208
|
+
continue;
|
|
209
|
+
case 2:
|
|
210
|
+
if (tag !== 18) break;
|
|
211
|
+
message.nonce = reader.bytes();
|
|
212
|
+
continue;
|
|
213
|
+
case 3:
|
|
214
|
+
if (tag !== 24) break;
|
|
215
|
+
message.counter = reader.uint32();
|
|
216
|
+
continue;
|
|
217
|
+
case 4:
|
|
218
|
+
if (tag !== 37) break;
|
|
219
|
+
message.expiresAt = reader.fixed32();
|
|
220
|
+
continue;
|
|
221
|
+
case 5:
|
|
222
|
+
if (tag !== 42) break;
|
|
223
|
+
message.tag = reader.bytes();
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
227
|
+
reader.skip(tag & 7);
|
|
228
|
+
}
|
|
229
|
+
return message;
|
|
230
|
+
},
|
|
231
|
+
fromJSON(object) {
|
|
232
|
+
return {
|
|
233
|
+
epoch: isSet(object.epoch) ? bytesFromBase64(object.epoch) : /* @__PURE__ */ new Uint8Array(0),
|
|
234
|
+
nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : /* @__PURE__ */ new Uint8Array(0),
|
|
235
|
+
counter: isSet(object.counter) ? globalThis.Number(object.counter) : 0,
|
|
236
|
+
expiresAt: isSet(object.expiresAt) ? globalThis.Number(object.expiresAt) : 0,
|
|
237
|
+
tag: isSet(object.tag) ? bytesFromBase64(object.tag) : /* @__PURE__ */ new Uint8Array(0)
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
toJSON(message) {
|
|
241
|
+
const obj = {};
|
|
242
|
+
if (message.epoch !== void 0) obj.epoch = base64FromBytes(message.epoch);
|
|
243
|
+
if (message.nonce !== void 0) obj.nonce = base64FromBytes(message.nonce);
|
|
244
|
+
if (message.counter !== void 0) obj.counter = Math.round(message.counter);
|
|
245
|
+
if (message.expiresAt !== void 0) obj.expiresAt = Math.round(message.expiresAt);
|
|
246
|
+
if (message.tag !== void 0) obj.tag = base64FromBytes(message.tag);
|
|
247
|
+
return obj;
|
|
248
|
+
},
|
|
249
|
+
create(base) {
|
|
250
|
+
return AESGCMPersonalizedSignatureData.fromPartial(base ?? {});
|
|
251
|
+
},
|
|
252
|
+
fromPartial(object) {
|
|
253
|
+
const message = createBaseAESGCMPersonalizedSignatureData();
|
|
254
|
+
message.epoch = object.epoch ?? /* @__PURE__ */ new Uint8Array(0);
|
|
255
|
+
message.nonce = object.nonce ?? /* @__PURE__ */ new Uint8Array(0);
|
|
256
|
+
message.counter = object.counter ?? 0;
|
|
257
|
+
message.expiresAt = object.expiresAt ?? 0;
|
|
258
|
+
message.tag = object.tag ?? /* @__PURE__ */ new Uint8Array(0);
|
|
259
|
+
return message;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
function createBaseAESGCMResponseSignatureData() {
|
|
263
|
+
return {
|
|
264
|
+
nonce: /* @__PURE__ */ new Uint8Array(0),
|
|
265
|
+
counter: 0,
|
|
266
|
+
tag: /* @__PURE__ */ new Uint8Array(0)
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
const AESGCMResponseSignatureData = {
|
|
270
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
271
|
+
if (message.nonce.length !== 0) writer.uint32(10).bytes(message.nonce);
|
|
272
|
+
if (message.counter !== 0) writer.uint32(16).uint32(message.counter);
|
|
273
|
+
if (message.tag.length !== 0) writer.uint32(26).bytes(message.tag);
|
|
274
|
+
return writer;
|
|
275
|
+
},
|
|
276
|
+
decode(input, length) {
|
|
277
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
278
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
279
|
+
const message = createBaseAESGCMResponseSignatureData();
|
|
280
|
+
while (reader.pos < end) {
|
|
281
|
+
const tag = reader.uint32();
|
|
282
|
+
switch (tag >>> 3) {
|
|
283
|
+
case 1:
|
|
284
|
+
if (tag !== 10) break;
|
|
285
|
+
message.nonce = reader.bytes();
|
|
286
|
+
continue;
|
|
287
|
+
case 2:
|
|
288
|
+
if (tag !== 16) break;
|
|
289
|
+
message.counter = reader.uint32();
|
|
290
|
+
continue;
|
|
291
|
+
case 3:
|
|
292
|
+
if (tag !== 26) break;
|
|
293
|
+
message.tag = reader.bytes();
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
297
|
+
reader.skip(tag & 7);
|
|
298
|
+
}
|
|
299
|
+
return message;
|
|
300
|
+
},
|
|
301
|
+
fromJSON(object) {
|
|
302
|
+
return {
|
|
303
|
+
nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : /* @__PURE__ */ new Uint8Array(0),
|
|
304
|
+
counter: isSet(object.counter) ? globalThis.Number(object.counter) : 0,
|
|
305
|
+
tag: isSet(object.tag) ? bytesFromBase64(object.tag) : /* @__PURE__ */ new Uint8Array(0)
|
|
306
|
+
};
|
|
307
|
+
},
|
|
308
|
+
toJSON(message) {
|
|
309
|
+
const obj = {};
|
|
310
|
+
if (message.nonce !== void 0) obj.nonce = base64FromBytes(message.nonce);
|
|
311
|
+
if (message.counter !== void 0) obj.counter = Math.round(message.counter);
|
|
312
|
+
if (message.tag !== void 0) obj.tag = base64FromBytes(message.tag);
|
|
313
|
+
return obj;
|
|
314
|
+
},
|
|
315
|
+
create(base) {
|
|
316
|
+
return AESGCMResponseSignatureData.fromPartial(base ?? {});
|
|
317
|
+
},
|
|
318
|
+
fromPartial(object) {
|
|
319
|
+
const message = createBaseAESGCMResponseSignatureData();
|
|
320
|
+
message.nonce = object.nonce ?? /* @__PURE__ */ new Uint8Array(0);
|
|
321
|
+
message.counter = object.counter ?? 0;
|
|
322
|
+
message.tag = object.tag ?? /* @__PURE__ */ new Uint8Array(0);
|
|
323
|
+
return message;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
function createBaseHMACSignatureData() {
|
|
327
|
+
return { tag: /* @__PURE__ */ new Uint8Array(0) };
|
|
328
|
+
}
|
|
329
|
+
const HMACSignatureData = {
|
|
330
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
331
|
+
if (message.tag.length !== 0) writer.uint32(10).bytes(message.tag);
|
|
332
|
+
return writer;
|
|
333
|
+
},
|
|
334
|
+
decode(input, length) {
|
|
335
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
336
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
337
|
+
const message = createBaseHMACSignatureData();
|
|
338
|
+
while (reader.pos < end) {
|
|
339
|
+
const tag = reader.uint32();
|
|
340
|
+
switch (tag >>> 3) {
|
|
341
|
+
case 1:
|
|
342
|
+
if (tag !== 10) break;
|
|
343
|
+
message.tag = reader.bytes();
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
347
|
+
reader.skip(tag & 7);
|
|
348
|
+
}
|
|
349
|
+
return message;
|
|
350
|
+
},
|
|
351
|
+
fromJSON(object) {
|
|
352
|
+
return { tag: isSet(object.tag) ? bytesFromBase64(object.tag) : /* @__PURE__ */ new Uint8Array(0) };
|
|
353
|
+
},
|
|
354
|
+
toJSON(message) {
|
|
355
|
+
const obj = {};
|
|
356
|
+
if (message.tag !== void 0) obj.tag = base64FromBytes(message.tag);
|
|
357
|
+
return obj;
|
|
358
|
+
},
|
|
359
|
+
create(base) {
|
|
360
|
+
return HMACSignatureData.fromPartial(base ?? {});
|
|
361
|
+
},
|
|
362
|
+
fromPartial(object) {
|
|
363
|
+
const message = createBaseHMACSignatureData();
|
|
364
|
+
message.tag = object.tag ?? /* @__PURE__ */ new Uint8Array(0);
|
|
365
|
+
return message;
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
function createBaseHMACPersonalizedSignatureData() {
|
|
369
|
+
return {
|
|
370
|
+
epoch: /* @__PURE__ */ new Uint8Array(0),
|
|
371
|
+
counter: 0,
|
|
372
|
+
expiresAt: 0,
|
|
373
|
+
tag: /* @__PURE__ */ new Uint8Array(0)
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
const HMACPersonalizedSignatureData = {
|
|
377
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
378
|
+
if (message.epoch.length !== 0) writer.uint32(10).bytes(message.epoch);
|
|
379
|
+
if (message.counter !== 0) writer.uint32(16).uint32(message.counter);
|
|
380
|
+
if (message.expiresAt !== 0) writer.uint32(29).fixed32(message.expiresAt);
|
|
381
|
+
if (message.tag.length !== 0) writer.uint32(34).bytes(message.tag);
|
|
382
|
+
return writer;
|
|
383
|
+
},
|
|
384
|
+
decode(input, length) {
|
|
385
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
386
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
387
|
+
const message = createBaseHMACPersonalizedSignatureData();
|
|
388
|
+
while (reader.pos < end) {
|
|
389
|
+
const tag = reader.uint32();
|
|
390
|
+
switch (tag >>> 3) {
|
|
391
|
+
case 1:
|
|
392
|
+
if (tag !== 10) break;
|
|
393
|
+
message.epoch = reader.bytes();
|
|
394
|
+
continue;
|
|
395
|
+
case 2:
|
|
396
|
+
if (tag !== 16) break;
|
|
397
|
+
message.counter = reader.uint32();
|
|
398
|
+
continue;
|
|
399
|
+
case 3:
|
|
400
|
+
if (tag !== 29) break;
|
|
401
|
+
message.expiresAt = reader.fixed32();
|
|
402
|
+
continue;
|
|
403
|
+
case 4:
|
|
404
|
+
if (tag !== 34) break;
|
|
405
|
+
message.tag = reader.bytes();
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
409
|
+
reader.skip(tag & 7);
|
|
410
|
+
}
|
|
411
|
+
return message;
|
|
412
|
+
},
|
|
413
|
+
fromJSON(object) {
|
|
414
|
+
return {
|
|
415
|
+
epoch: isSet(object.epoch) ? bytesFromBase64(object.epoch) : /* @__PURE__ */ new Uint8Array(0),
|
|
416
|
+
counter: isSet(object.counter) ? globalThis.Number(object.counter) : 0,
|
|
417
|
+
expiresAt: isSet(object.expiresAt) ? globalThis.Number(object.expiresAt) : 0,
|
|
418
|
+
tag: isSet(object.tag) ? bytesFromBase64(object.tag) : /* @__PURE__ */ new Uint8Array(0)
|
|
419
|
+
};
|
|
420
|
+
},
|
|
421
|
+
toJSON(message) {
|
|
422
|
+
const obj = {};
|
|
423
|
+
if (message.epoch !== void 0) obj.epoch = base64FromBytes(message.epoch);
|
|
424
|
+
if (message.counter !== void 0) obj.counter = Math.round(message.counter);
|
|
425
|
+
if (message.expiresAt !== void 0) obj.expiresAt = Math.round(message.expiresAt);
|
|
426
|
+
if (message.tag !== void 0) obj.tag = base64FromBytes(message.tag);
|
|
427
|
+
return obj;
|
|
428
|
+
},
|
|
429
|
+
create(base) {
|
|
430
|
+
return HMACPersonalizedSignatureData.fromPartial(base ?? {});
|
|
431
|
+
},
|
|
432
|
+
fromPartial(object) {
|
|
433
|
+
const message = createBaseHMACPersonalizedSignatureData();
|
|
434
|
+
message.epoch = object.epoch ?? /* @__PURE__ */ new Uint8Array(0);
|
|
435
|
+
message.counter = object.counter ?? 0;
|
|
436
|
+
message.expiresAt = object.expiresAt ?? 0;
|
|
437
|
+
message.tag = object.tag ?? /* @__PURE__ */ new Uint8Array(0);
|
|
438
|
+
return message;
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
function createBaseSignatureData() {
|
|
442
|
+
return {
|
|
443
|
+
signerIdentity: void 0,
|
|
444
|
+
AESGCMPersonalizedData: void 0,
|
|
445
|
+
sessionInfoTag: void 0,
|
|
446
|
+
HMACPersonalizedData: void 0,
|
|
447
|
+
AESGCMResponseData: void 0
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
const SignatureData = {
|
|
451
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
452
|
+
if (message.signerIdentity !== void 0) KeyIdentity.encode(message.signerIdentity, writer.uint32(10).fork()).join();
|
|
453
|
+
if (message.AESGCMPersonalizedData !== void 0) AESGCMPersonalizedSignatureData.encode(message.AESGCMPersonalizedData, writer.uint32(42).fork()).join();
|
|
454
|
+
if (message.sessionInfoTag !== void 0) HMACSignatureData.encode(message.sessionInfoTag, writer.uint32(50).fork()).join();
|
|
455
|
+
if (message.HMACPersonalizedData !== void 0) HMACPersonalizedSignatureData.encode(message.HMACPersonalizedData, writer.uint32(66).fork()).join();
|
|
456
|
+
if (message.AESGCMResponseData !== void 0) AESGCMResponseSignatureData.encode(message.AESGCMResponseData, writer.uint32(74).fork()).join();
|
|
457
|
+
return writer;
|
|
458
|
+
},
|
|
459
|
+
decode(input, length) {
|
|
460
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
461
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
462
|
+
const message = createBaseSignatureData();
|
|
463
|
+
while (reader.pos < end) {
|
|
464
|
+
const tag = reader.uint32();
|
|
465
|
+
switch (tag >>> 3) {
|
|
466
|
+
case 1:
|
|
467
|
+
if (tag !== 10) break;
|
|
468
|
+
message.signerIdentity = KeyIdentity.decode(reader, reader.uint32());
|
|
469
|
+
continue;
|
|
470
|
+
case 5:
|
|
471
|
+
if (tag !== 42) break;
|
|
472
|
+
message.AESGCMPersonalizedData = AESGCMPersonalizedSignatureData.decode(reader, reader.uint32());
|
|
473
|
+
continue;
|
|
474
|
+
case 6:
|
|
475
|
+
if (tag !== 50) break;
|
|
476
|
+
message.sessionInfoTag = HMACSignatureData.decode(reader, reader.uint32());
|
|
477
|
+
continue;
|
|
478
|
+
case 8:
|
|
479
|
+
if (tag !== 66) break;
|
|
480
|
+
message.HMACPersonalizedData = HMACPersonalizedSignatureData.decode(reader, reader.uint32());
|
|
481
|
+
continue;
|
|
482
|
+
case 9:
|
|
483
|
+
if (tag !== 74) break;
|
|
484
|
+
message.AESGCMResponseData = AESGCMResponseSignatureData.decode(reader, reader.uint32());
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
488
|
+
reader.skip(tag & 7);
|
|
489
|
+
}
|
|
490
|
+
return message;
|
|
491
|
+
},
|
|
492
|
+
fromJSON(object) {
|
|
493
|
+
return {
|
|
494
|
+
signerIdentity: isSet(object.signerIdentity) ? KeyIdentity.fromJSON(object.signerIdentity) : void 0,
|
|
495
|
+
AESGCMPersonalizedData: isSet(object.AESGCMPersonalizedData) ? AESGCMPersonalizedSignatureData.fromJSON(object.AESGCMPersonalizedData) : void 0,
|
|
496
|
+
sessionInfoTag: isSet(object.sessionInfoTag) ? HMACSignatureData.fromJSON(object.sessionInfoTag) : void 0,
|
|
497
|
+
HMACPersonalizedData: isSet(object.HMACPersonalizedData) ? HMACPersonalizedSignatureData.fromJSON(object.HMACPersonalizedData) : void 0,
|
|
498
|
+
AESGCMResponseData: isSet(object.AESGCMResponseData) ? AESGCMResponseSignatureData.fromJSON(object.AESGCMResponseData) : void 0
|
|
499
|
+
};
|
|
500
|
+
},
|
|
501
|
+
toJSON(message) {
|
|
502
|
+
const obj = {};
|
|
503
|
+
if (message.signerIdentity !== void 0) obj.signerIdentity = KeyIdentity.toJSON(message.signerIdentity);
|
|
504
|
+
if (message.AESGCMPersonalizedData !== void 0) obj.AESGCMPersonalizedData = AESGCMPersonalizedSignatureData.toJSON(message.AESGCMPersonalizedData);
|
|
505
|
+
if (message.sessionInfoTag !== void 0) obj.sessionInfoTag = HMACSignatureData.toJSON(message.sessionInfoTag);
|
|
506
|
+
if (message.HMACPersonalizedData !== void 0) obj.HMACPersonalizedData = HMACPersonalizedSignatureData.toJSON(message.HMACPersonalizedData);
|
|
507
|
+
if (message.AESGCMResponseData !== void 0) obj.AESGCMResponseData = AESGCMResponseSignatureData.toJSON(message.AESGCMResponseData);
|
|
508
|
+
return obj;
|
|
509
|
+
},
|
|
510
|
+
create(base) {
|
|
511
|
+
return SignatureData.fromPartial(base ?? {});
|
|
512
|
+
},
|
|
513
|
+
fromPartial(object) {
|
|
514
|
+
const message = createBaseSignatureData();
|
|
515
|
+
message.signerIdentity = object.signerIdentity !== void 0 && object.signerIdentity !== null ? KeyIdentity.fromPartial(object.signerIdentity) : void 0;
|
|
516
|
+
message.AESGCMPersonalizedData = object.AESGCMPersonalizedData !== void 0 && object.AESGCMPersonalizedData !== null ? AESGCMPersonalizedSignatureData.fromPartial(object.AESGCMPersonalizedData) : void 0;
|
|
517
|
+
message.sessionInfoTag = object.sessionInfoTag !== void 0 && object.sessionInfoTag !== null ? HMACSignatureData.fromPartial(object.sessionInfoTag) : void 0;
|
|
518
|
+
message.HMACPersonalizedData = object.HMACPersonalizedData !== void 0 && object.HMACPersonalizedData !== null ? HMACPersonalizedSignatureData.fromPartial(object.HMACPersonalizedData) : void 0;
|
|
519
|
+
message.AESGCMResponseData = object.AESGCMResponseData !== void 0 && object.AESGCMResponseData !== null ? AESGCMResponseSignatureData.fromPartial(object.AESGCMResponseData) : void 0;
|
|
520
|
+
return message;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
function createBaseGetSessionInfoRequest() {
|
|
524
|
+
return { keyIdentity: void 0 };
|
|
525
|
+
}
|
|
526
|
+
const GetSessionInfoRequest = {
|
|
527
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
528
|
+
if (message.keyIdentity !== void 0) KeyIdentity.encode(message.keyIdentity, writer.uint32(10).fork()).join();
|
|
529
|
+
return writer;
|
|
530
|
+
},
|
|
531
|
+
decode(input, length) {
|
|
532
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
533
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
534
|
+
const message = createBaseGetSessionInfoRequest();
|
|
535
|
+
while (reader.pos < end) {
|
|
536
|
+
const tag = reader.uint32();
|
|
537
|
+
switch (tag >>> 3) {
|
|
538
|
+
case 1:
|
|
539
|
+
if (tag !== 10) break;
|
|
540
|
+
message.keyIdentity = KeyIdentity.decode(reader, reader.uint32());
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
544
|
+
reader.skip(tag & 7);
|
|
545
|
+
}
|
|
546
|
+
return message;
|
|
547
|
+
},
|
|
548
|
+
fromJSON(object) {
|
|
549
|
+
return { keyIdentity: isSet(object.keyIdentity) ? KeyIdentity.fromJSON(object.keyIdentity) : void 0 };
|
|
550
|
+
},
|
|
551
|
+
toJSON(message) {
|
|
552
|
+
const obj = {};
|
|
553
|
+
if (message.keyIdentity !== void 0) obj.keyIdentity = KeyIdentity.toJSON(message.keyIdentity);
|
|
554
|
+
return obj;
|
|
555
|
+
},
|
|
556
|
+
create(base) {
|
|
557
|
+
return GetSessionInfoRequest.fromPartial(base ?? {});
|
|
558
|
+
},
|
|
559
|
+
fromPartial(object) {
|
|
560
|
+
const message = createBaseGetSessionInfoRequest();
|
|
561
|
+
message.keyIdentity = object.keyIdentity !== void 0 && object.keyIdentity !== null ? KeyIdentity.fromPartial(object.keyIdentity) : void 0;
|
|
562
|
+
return message;
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
function createBaseSessionInfo() {
|
|
566
|
+
return {
|
|
567
|
+
counter: 0,
|
|
568
|
+
publicKey: /* @__PURE__ */ new Uint8Array(0),
|
|
569
|
+
epoch: /* @__PURE__ */ new Uint8Array(0),
|
|
570
|
+
clockTime: 0,
|
|
571
|
+
status: 0,
|
|
572
|
+
handle: 0
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
const SessionInfo = {
|
|
576
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
577
|
+
if (message.counter !== 0) writer.uint32(8).uint32(message.counter);
|
|
578
|
+
if (message.publicKey.length !== 0) writer.uint32(18).bytes(message.publicKey);
|
|
579
|
+
if (message.epoch.length !== 0) writer.uint32(26).bytes(message.epoch);
|
|
580
|
+
if (message.clockTime !== 0) writer.uint32(37).fixed32(message.clockTime);
|
|
581
|
+
if (message.status !== 0) writer.uint32(40).int32(message.status);
|
|
582
|
+
if (message.handle !== 0) writer.uint32(48).uint32(message.handle);
|
|
583
|
+
return writer;
|
|
584
|
+
},
|
|
585
|
+
decode(input, length) {
|
|
586
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
587
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
588
|
+
const message = createBaseSessionInfo();
|
|
589
|
+
while (reader.pos < end) {
|
|
590
|
+
const tag = reader.uint32();
|
|
591
|
+
switch (tag >>> 3) {
|
|
592
|
+
case 1:
|
|
593
|
+
if (tag !== 8) break;
|
|
594
|
+
message.counter = reader.uint32();
|
|
595
|
+
continue;
|
|
596
|
+
case 2:
|
|
597
|
+
if (tag !== 18) break;
|
|
598
|
+
message.publicKey = reader.bytes();
|
|
599
|
+
continue;
|
|
600
|
+
case 3:
|
|
601
|
+
if (tag !== 26) break;
|
|
602
|
+
message.epoch = reader.bytes();
|
|
603
|
+
continue;
|
|
604
|
+
case 4:
|
|
605
|
+
if (tag !== 37) break;
|
|
606
|
+
message.clockTime = reader.fixed32();
|
|
607
|
+
continue;
|
|
608
|
+
case 5:
|
|
609
|
+
if (tag !== 40) break;
|
|
610
|
+
message.status = reader.int32();
|
|
611
|
+
continue;
|
|
612
|
+
case 6:
|
|
613
|
+
if (tag !== 48) break;
|
|
614
|
+
message.handle = reader.uint32();
|
|
615
|
+
continue;
|
|
616
|
+
}
|
|
617
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
618
|
+
reader.skip(tag & 7);
|
|
619
|
+
}
|
|
620
|
+
return message;
|
|
621
|
+
},
|
|
622
|
+
fromJSON(object) {
|
|
623
|
+
return {
|
|
624
|
+
counter: isSet(object.counter) ? globalThis.Number(object.counter) : 0,
|
|
625
|
+
publicKey: isSet(object.publicKey) ? bytesFromBase64(object.publicKey) : /* @__PURE__ */ new Uint8Array(0),
|
|
626
|
+
epoch: isSet(object.epoch) ? bytesFromBase64(object.epoch) : /* @__PURE__ */ new Uint8Array(0),
|
|
627
|
+
clockTime: isSet(object.clockTime) ? globalThis.Number(object.clockTime) : 0,
|
|
628
|
+
status: isSet(object.status) ? sessionInfoStatusFromJSON(object.status) : 0,
|
|
629
|
+
handle: isSet(object.handle) ? globalThis.Number(object.handle) : 0
|
|
630
|
+
};
|
|
631
|
+
},
|
|
632
|
+
toJSON(message) {
|
|
633
|
+
const obj = {};
|
|
634
|
+
if (message.counter !== void 0) obj.counter = Math.round(message.counter);
|
|
635
|
+
if (message.publicKey !== void 0) obj.publicKey = base64FromBytes(message.publicKey);
|
|
636
|
+
if (message.epoch !== void 0) obj.epoch = base64FromBytes(message.epoch);
|
|
637
|
+
if (message.clockTime !== void 0) obj.clockTime = Math.round(message.clockTime);
|
|
638
|
+
if (message.status !== void 0) obj.status = sessionInfoStatusToJSON(message.status);
|
|
639
|
+
if (message.handle !== void 0) obj.handle = Math.round(message.handle);
|
|
640
|
+
return obj;
|
|
641
|
+
},
|
|
642
|
+
create(base) {
|
|
643
|
+
return SessionInfo.fromPartial(base ?? {});
|
|
644
|
+
},
|
|
645
|
+
fromPartial(object) {
|
|
646
|
+
const message = createBaseSessionInfo();
|
|
647
|
+
message.counter = object.counter ?? 0;
|
|
648
|
+
message.publicKey = object.publicKey ?? /* @__PURE__ */ new Uint8Array(0);
|
|
649
|
+
message.epoch = object.epoch ?? /* @__PURE__ */ new Uint8Array(0);
|
|
650
|
+
message.clockTime = object.clockTime ?? 0;
|
|
651
|
+
message.status = object.status ?? 0;
|
|
652
|
+
message.handle = object.handle ?? 0;
|
|
653
|
+
return message;
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
function bytesFromBase64(b64) {
|
|
657
|
+
if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
658
|
+
else {
|
|
659
|
+
const bin = globalThis.atob(b64);
|
|
660
|
+
const arr = new Uint8Array(bin.length);
|
|
661
|
+
for (let i = 0; i < bin.length; ++i) arr[i] = bin.charCodeAt(i);
|
|
662
|
+
return arr;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
function base64FromBytes(arr) {
|
|
666
|
+
if (globalThis.Buffer) return globalThis.Buffer.from(arr).toString("base64");
|
|
667
|
+
else {
|
|
668
|
+
const bin = [];
|
|
669
|
+
arr.forEach((byte) => {
|
|
670
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
671
|
+
});
|
|
672
|
+
return globalThis.btoa(bin.join(""));
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
function isSet(value) {
|
|
676
|
+
return value !== null && value !== void 0;
|
|
677
|
+
}
|
|
678
|
+
//#endregion
|
|
679
|
+
exports.AESGCMPersonalizedSignatureData = AESGCMPersonalizedSignatureData;
|
|
680
|
+
exports.AESGCMResponseSignatureData = AESGCMResponseSignatureData;
|
|
681
|
+
exports.GetSessionInfoRequest = GetSessionInfoRequest;
|
|
682
|
+
exports.HMACPersonalizedSignatureData = HMACPersonalizedSignatureData;
|
|
683
|
+
exports.HMACSignatureData = HMACSignatureData;
|
|
684
|
+
exports.KeyIdentity = KeyIdentity;
|
|
685
|
+
exports.SessionInfo = SessionInfo;
|
|
686
|
+
exports.SessionInfoStatus = SessionInfoStatus;
|
|
687
|
+
exports.SignatureData = SignatureData;
|
|
688
|
+
exports.SignatureType = SignatureType;
|
|
689
|
+
exports.Tag = Tag;
|
|
690
|
+
exports.protobufPackage = protobufPackage;
|
|
691
|
+
exports.sessionInfoStatusFromJSON = sessionInfoStatusFromJSON;
|
|
692
|
+
exports.sessionInfoStatusToJSON = sessionInfoStatusToJSON;
|
|
693
|
+
exports.signatureTypeFromJSON = signatureTypeFromJSON;
|
|
694
|
+
exports.signatureTypeToJSON = signatureTypeToJSON;
|
|
695
|
+
exports.tagFromJSON = tagFromJSON;
|
|
696
|
+
exports.tagToJSON = tagToJSON;
|