Skip to content

Commit 593deef

Browse files
deps(dev): bump protons from 6.1.3 to 7.0.2 (#1582)
* deps: bump protons-runtime from 4.0.2 to 5.0.0 Bumps [protons-runtime](https://github.com/ipfs/protons) from 4.0.2 to 5.0.0. - [Release notes](https://github.com/ipfs/protons/releases) - [Commits](ipfs/protons@protons-runtime-v4.0.2...protons-runtime-v5.0.0) --- updated-dependencies: - dependency-name: protons-runtime dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * deps(dev): bump protons from 6.1.3 to 7.0.2 Bumps [protons](https://github.com/ipfs/protons) from 6.1.3 to 7.0.2. - [Release notes](https://github.com/ipfs/protons/releases) - [Commits](ipfs/protons@protons-v6.1.3...protons-v7.0.2) --- updated-dependencies: - dependency-name: protons dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: update protobuf definitions --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <[email protected]>
1 parent d605cbe commit 593deef

File tree

5 files changed

+33
-45
lines changed

5 files changed

+33
-45
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"p-fifo": "^1.0.0",
154154
"p-retry": "^5.0.0",
155155
"private-ip": "^3.0.0",
156-
"protons-runtime": "^4.0.1",
156+
"protons-runtime": "^5.0.0",
157157
"rate-limiter-flexible": "^2.3.11",
158158
"retimer": "^3.0.0",
159159
"set-delayed-interval": "^1.0.0",
@@ -198,7 +198,7 @@
198198
"p-event": "^5.0.1",
199199
"p-times": "^4.0.0",
200200
"p-wait-for": "^5.0.0",
201-
"protons": "^6.0.0",
201+
"protons": "^7.0.2",
202202
"sinon": "^15.0.1",
203203
"sinon-ts": "^1.0.0"
204204
},

src/circuit/pb/index.ts

+17-27
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/* eslint-disable @typescript-eslint/no-empty-interface */
66

77
import { enumeration, encodeMessage, decodeMessage, message } from 'protons-runtime'
8-
import type { Uint8ArrayList } from 'uint8arraylist'
98
import type { Codec } from 'protons-runtime'
9+
import type { Uint8ArrayList } from 'uint8arraylist'
1010

1111
export interface HopMessage {
1212
type?: HopMessage.Type
@@ -51,23 +51,17 @@ export namespace HopMessage {
5151

5252
if (obj.peer != null) {
5353
w.uint32(18)
54-
Peer.codec().encode(obj.peer, w, {
55-
writeDefaults: false
56-
})
54+
Peer.codec().encode(obj.peer, w)
5755
}
5856

5957
if (obj.reservation != null) {
6058
w.uint32(26)
61-
Reservation.codec().encode(obj.reservation, w, {
62-
writeDefaults: false
63-
})
59+
Reservation.codec().encode(obj.reservation, w)
6460
}
6561

6662
if (obj.limit != null) {
6763
w.uint32(34)
68-
Limit.codec().encode(obj.limit, w, {
69-
writeDefaults: false
70-
})
64+
Limit.codec().encode(obj.limit, w)
7165
}
7266

7367
if (obj.status != null) {
@@ -115,7 +109,7 @@ export namespace HopMessage {
115109
return _codec
116110
}
117111

118-
export const encode = (obj: HopMessage): Uint8Array => {
112+
export const encode = (obj: Partial<HopMessage>): Uint8Array => {
119113
return encodeMessage(obj, HopMessage.codec())
120114
}
121115

@@ -164,16 +158,12 @@ export namespace StopMessage {
164158

165159
if (obj.peer != null) {
166160
w.uint32(18)
167-
Peer.codec().encode(obj.peer, w, {
168-
writeDefaults: false
169-
})
161+
Peer.codec().encode(obj.peer, w)
170162
}
171163

172164
if (obj.limit != null) {
173165
w.uint32(26)
174-
Limit.codec().encode(obj.limit, w, {
175-
writeDefaults: false
176-
})
166+
Limit.codec().encode(obj.limit, w)
177167
}
178168

179169
if (obj.status != null) {
@@ -218,7 +208,7 @@ export namespace StopMessage {
218208
return _codec
219209
}
220210

221-
export const encode = (obj: StopMessage): Uint8Array => {
211+
export const encode = (obj: Partial<StopMessage>): Uint8Array => {
222212
return encodeMessage(obj, StopMessage.codec())
223213
}
224214

@@ -242,7 +232,7 @@ export namespace Peer {
242232
w.fork()
243233
}
244234

245-
if (opts.writeDefaults === true || (obj.id != null && obj.id.byteLength > 0)) {
235+
if ((obj.id != null && obj.id.byteLength > 0)) {
246236
w.uint32(10)
247237
w.bytes(obj.id)
248238
}
@@ -288,7 +278,7 @@ export namespace Peer {
288278
return _codec
289279
}
290280

291-
export const encode = (obj: Peer): Uint8Array => {
281+
export const encode = (obj: Partial<Peer>): Uint8Array => {
292282
return encodeMessage(obj, Peer.codec())
293283
}
294284

@@ -313,7 +303,7 @@ export namespace Reservation {
313303
w.fork()
314304
}
315305

316-
if (opts.writeDefaults === true || obj.expire !== 0n) {
306+
if ((obj.expire != null && obj.expire !== 0n)) {
317307
w.uint32(8)
318308
w.uint64(obj.expire)
319309
}
@@ -367,7 +357,7 @@ export namespace Reservation {
367357
return _codec
368358
}
369359

370-
export const encode = (obj: Reservation): Uint8Array => {
360+
export const encode = (obj: Partial<Reservation>): Uint8Array => {
371361
return encodeMessage(obj, Reservation.codec())
372362
}
373363

@@ -432,7 +422,7 @@ export namespace Limit {
432422
return _codec
433423
}
434424

435-
export const encode = (obj: Limit): Uint8Array => {
425+
export const encode = (obj: Partial<Limit>): Uint8Array => {
436426
return encodeMessage(obj, Limit.codec())
437427
}
438428

@@ -486,17 +476,17 @@ export namespace ReservationVoucher {
486476
w.fork()
487477
}
488478

489-
if (opts.writeDefaults === true || (obj.relay != null && obj.relay.byteLength > 0)) {
479+
if ((obj.relay != null && obj.relay.byteLength > 0)) {
490480
w.uint32(10)
491481
w.bytes(obj.relay)
492482
}
493483

494-
if (opts.writeDefaults === true || (obj.peer != null && obj.peer.byteLength > 0)) {
484+
if ((obj.peer != null && obj.peer.byteLength > 0)) {
495485
w.uint32(18)
496486
w.bytes(obj.peer)
497487
}
498488

499-
if (opts.writeDefaults === true || obj.expiration !== 0n) {
489+
if ((obj.expiration != null && obj.expiration !== 0n)) {
500490
w.uint32(24)
501491
w.uint64(obj.expiration)
502492
}
@@ -539,7 +529,7 @@ export namespace ReservationVoucher {
539529
return _codec
540530
}
541531

542-
export const encode = (obj: ReservationVoucher): Uint8Array => {
532+
export const encode = (obj: Partial<ReservationVoucher>): Uint8Array => {
543533
return encodeMessage(obj, ReservationVoucher.codec())
544534
}
545535

src/fetch/pb/proto.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/* eslint-disable @typescript-eslint/no-empty-interface */
66

77
import { encodeMessage, decodeMessage, message, enumeration } from 'protons-runtime'
8-
import type { Uint8ArrayList } from 'uint8arraylist'
98
import type { Codec } from 'protons-runtime'
9+
import type { Uint8ArrayList } from 'uint8arraylist'
1010

1111
export interface FetchRequest {
1212
identifier: string
@@ -22,7 +22,7 @@ export namespace FetchRequest {
2222
w.fork()
2323
}
2424

25-
if (opts.writeDefaults === true || obj.identifier !== '') {
25+
if ((obj.identifier != null && obj.identifier !== '')) {
2626
w.uint32(10)
2727
w.string(obj.identifier)
2828
}
@@ -57,7 +57,7 @@ export namespace FetchRequest {
5757
return _codec
5858
}
5959

60-
export const encode = (obj: FetchRequest): Uint8Array => {
60+
export const encode = (obj: Partial<FetchRequest>): Uint8Array => {
6161
return encodeMessage(obj, FetchRequest.codec())
6262
}
6363

@@ -99,12 +99,12 @@ export namespace FetchResponse {
9999
w.fork()
100100
}
101101

102-
if (opts.writeDefaults === true || (obj.status != null && __StatusCodeValues[obj.status] !== 0)) {
102+
if (obj.status != null && __StatusCodeValues[obj.status] !== 0) {
103103
w.uint32(8)
104104
FetchResponse.StatusCode.codec().encode(obj.status, w)
105105
}
106106

107-
if (opts.writeDefaults === true || (obj.data != null && obj.data.byteLength > 0)) {
107+
if ((obj.data != null && obj.data.byteLength > 0)) {
108108
w.uint32(18)
109109
w.bytes(obj.data)
110110
}
@@ -143,7 +143,7 @@ export namespace FetchResponse {
143143
return _codec
144144
}
145145

146-
export const encode = (obj: FetchResponse): Uint8Array => {
146+
export const encode = (obj: Partial<FetchResponse>): Uint8Array => {
147147
return encodeMessage(obj, FetchResponse.codec())
148148
}
149149

src/identify/pb/message.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/* eslint-disable @typescript-eslint/no-empty-interface */
66

77
import { encodeMessage, decodeMessage, message } from 'protons-runtime'
8-
import type { Uint8ArrayList } from 'uint8arraylist'
98
import type { Codec } from 'protons-runtime'
9+
import type { Uint8ArrayList } from 'uint8arraylist'
1010

1111
export interface Identify {
1212
protocolVersion?: string
@@ -116,7 +116,7 @@ export namespace Identify {
116116
return _codec
117117
}
118118

119-
export const encode = (obj: Identify): Uint8Array => {
119+
export const encode = (obj: Partial<Identify>): Uint8Array => {
120120
return encodeMessage(obj, Identify.codec())
121121
}
122122

src/insecure/pb/proto.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/* eslint-disable @typescript-eslint/no-empty-interface */
66

77
import { encodeMessage, decodeMessage, message, enumeration } from 'protons-runtime'
8-
import type { Uint8ArrayList } from 'uint8arraylist'
98
import type { Codec } from 'protons-runtime'
9+
import type { Uint8ArrayList } from 'uint8arraylist'
1010

1111
export interface Exchange {
1212
id?: Uint8Array
@@ -30,9 +30,7 @@ export namespace Exchange {
3030

3131
if (obj.pubkey != null) {
3232
w.uint32(18)
33-
PublicKey.codec().encode(obj.pubkey, w, {
34-
writeDefaults: false
35-
})
33+
PublicKey.codec().encode(obj.pubkey, w)
3634
}
3735

3836
if (opts.lengthDelimited !== false) {
@@ -66,7 +64,7 @@ export namespace Exchange {
6664
return _codec
6765
}
6866

69-
export const encode = (obj: Exchange): Uint8Array => {
67+
export const encode = (obj: Partial<Exchange>): Uint8Array => {
7068
return encodeMessage(obj, Exchange.codec())
7169
}
7270

@@ -109,12 +107,12 @@ export namespace PublicKey {
109107
w.fork()
110108
}
111109

112-
if (opts.writeDefaults === true || (obj.Type != null && __KeyTypeValues[obj.Type] !== 0)) {
110+
if (obj.Type != null && __KeyTypeValues[obj.Type] !== 0) {
113111
w.uint32(8)
114112
KeyType.codec().encode(obj.Type, w)
115113
}
116114

117-
if (opts.writeDefaults === true || (obj.Data != null && obj.Data.byteLength > 0)) {
115+
if ((obj.Data != null && obj.Data.byteLength > 0)) {
118116
w.uint32(18)
119117
w.bytes(obj.Data)
120118
}
@@ -153,7 +151,7 @@ export namespace PublicKey {
153151
return _codec
154152
}
155153

156-
export const encode = (obj: PublicKey): Uint8Array => {
154+
export const encode = (obj: Partial<PublicKey>): Uint8Array => {
157155
return encodeMessage(obj, PublicKey.codec())
158156
}
159157

0 commit comments

Comments
 (0)