From 593deefe1268e0019354964b87b49fac1a3981ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:37:56 +0000 Subject: [PATCH] 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](https://github.com/ipfs/protons/compare/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] * 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](https://github.com/ipfs/protons/compare/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] * chore: update protobuf definitions --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain --- package.json | 4 ++-- src/circuit/pb/index.ts | 44 +++++++++++++++----------------------- src/fetch/pb/proto.ts | 12 +++++------ src/identify/pb/message.ts | 4 ++-- src/insecure/pb/proto.ts | 14 ++++++------ 5 files changed, 33 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index 304988af69..c3486ef908 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "p-fifo": "^1.0.0", "p-retry": "^5.0.0", "private-ip": "^3.0.0", - "protons-runtime": "^4.0.1", + "protons-runtime": "^5.0.0", "rate-limiter-flexible": "^2.3.11", "retimer": "^3.0.0", "set-delayed-interval": "^1.0.0", @@ -198,7 +198,7 @@ "p-event": "^5.0.1", "p-times": "^4.0.0", "p-wait-for": "^5.0.0", - "protons": "^6.0.0", + "protons": "^7.0.2", "sinon": "^15.0.1", "sinon-ts": "^1.0.0" }, diff --git a/src/circuit/pb/index.ts b/src/circuit/pb/index.ts index e14b653842..be6d4dbf33 100644 --- a/src/circuit/pb/index.ts +++ b/src/circuit/pb/index.ts @@ -5,8 +5,8 @@ /* eslint-disable @typescript-eslint/no-empty-interface */ import { enumeration, encodeMessage, decodeMessage, message } from 'protons-runtime' -import type { Uint8ArrayList } from 'uint8arraylist' import type { Codec } from 'protons-runtime' +import type { Uint8ArrayList } from 'uint8arraylist' export interface HopMessage { type?: HopMessage.Type @@ -51,23 +51,17 @@ export namespace HopMessage { if (obj.peer != null) { w.uint32(18) - Peer.codec().encode(obj.peer, w, { - writeDefaults: false - }) + Peer.codec().encode(obj.peer, w) } if (obj.reservation != null) { w.uint32(26) - Reservation.codec().encode(obj.reservation, w, { - writeDefaults: false - }) + Reservation.codec().encode(obj.reservation, w) } if (obj.limit != null) { w.uint32(34) - Limit.codec().encode(obj.limit, w, { - writeDefaults: false - }) + Limit.codec().encode(obj.limit, w) } if (obj.status != null) { @@ -115,7 +109,7 @@ export namespace HopMessage { return _codec } - export const encode = (obj: HopMessage): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, HopMessage.codec()) } @@ -164,16 +158,12 @@ export namespace StopMessage { if (obj.peer != null) { w.uint32(18) - Peer.codec().encode(obj.peer, w, { - writeDefaults: false - }) + Peer.codec().encode(obj.peer, w) } if (obj.limit != null) { w.uint32(26) - Limit.codec().encode(obj.limit, w, { - writeDefaults: false - }) + Limit.codec().encode(obj.limit, w) } if (obj.status != null) { @@ -218,7 +208,7 @@ export namespace StopMessage { return _codec } - export const encode = (obj: StopMessage): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, StopMessage.codec()) } @@ -242,7 +232,7 @@ export namespace Peer { w.fork() } - if (opts.writeDefaults === true || (obj.id != null && obj.id.byteLength > 0)) { + if ((obj.id != null && obj.id.byteLength > 0)) { w.uint32(10) w.bytes(obj.id) } @@ -288,7 +278,7 @@ export namespace Peer { return _codec } - export const encode = (obj: Peer): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, Peer.codec()) } @@ -313,7 +303,7 @@ export namespace Reservation { w.fork() } - if (opts.writeDefaults === true || obj.expire !== 0n) { + if ((obj.expire != null && obj.expire !== 0n)) { w.uint32(8) w.uint64(obj.expire) } @@ -367,7 +357,7 @@ export namespace Reservation { return _codec } - export const encode = (obj: Reservation): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, Reservation.codec()) } @@ -432,7 +422,7 @@ export namespace Limit { return _codec } - export const encode = (obj: Limit): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, Limit.codec()) } @@ -486,17 +476,17 @@ export namespace ReservationVoucher { w.fork() } - if (opts.writeDefaults === true || (obj.relay != null && obj.relay.byteLength > 0)) { + if ((obj.relay != null && obj.relay.byteLength > 0)) { w.uint32(10) w.bytes(obj.relay) } - if (opts.writeDefaults === true || (obj.peer != null && obj.peer.byteLength > 0)) { + if ((obj.peer != null && obj.peer.byteLength > 0)) { w.uint32(18) w.bytes(obj.peer) } - if (opts.writeDefaults === true || obj.expiration !== 0n) { + if ((obj.expiration != null && obj.expiration !== 0n)) { w.uint32(24) w.uint64(obj.expiration) } @@ -539,7 +529,7 @@ export namespace ReservationVoucher { return _codec } - export const encode = (obj: ReservationVoucher): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, ReservationVoucher.codec()) } diff --git a/src/fetch/pb/proto.ts b/src/fetch/pb/proto.ts index c607724c95..4eae212dcd 100644 --- a/src/fetch/pb/proto.ts +++ b/src/fetch/pb/proto.ts @@ -5,8 +5,8 @@ /* eslint-disable @typescript-eslint/no-empty-interface */ import { encodeMessage, decodeMessage, message, enumeration } from 'protons-runtime' -import type { Uint8ArrayList } from 'uint8arraylist' import type { Codec } from 'protons-runtime' +import type { Uint8ArrayList } from 'uint8arraylist' export interface FetchRequest { identifier: string @@ -22,7 +22,7 @@ export namespace FetchRequest { w.fork() } - if (opts.writeDefaults === true || obj.identifier !== '') { + if ((obj.identifier != null && obj.identifier !== '')) { w.uint32(10) w.string(obj.identifier) } @@ -57,7 +57,7 @@ export namespace FetchRequest { return _codec } - export const encode = (obj: FetchRequest): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, FetchRequest.codec()) } @@ -99,12 +99,12 @@ export namespace FetchResponse { w.fork() } - if (opts.writeDefaults === true || (obj.status != null && __StatusCodeValues[obj.status] !== 0)) { + if (obj.status != null && __StatusCodeValues[obj.status] !== 0) { w.uint32(8) FetchResponse.StatusCode.codec().encode(obj.status, w) } - if (opts.writeDefaults === true || (obj.data != null && obj.data.byteLength > 0)) { + if ((obj.data != null && obj.data.byteLength > 0)) { w.uint32(18) w.bytes(obj.data) } @@ -143,7 +143,7 @@ export namespace FetchResponse { return _codec } - export const encode = (obj: FetchResponse): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, FetchResponse.codec()) } diff --git a/src/identify/pb/message.ts b/src/identify/pb/message.ts index a78e23255d..2f6c2b276b 100644 --- a/src/identify/pb/message.ts +++ b/src/identify/pb/message.ts @@ -5,8 +5,8 @@ /* eslint-disable @typescript-eslint/no-empty-interface */ import { encodeMessage, decodeMessage, message } from 'protons-runtime' -import type { Uint8ArrayList } from 'uint8arraylist' import type { Codec } from 'protons-runtime' +import type { Uint8ArrayList } from 'uint8arraylist' export interface Identify { protocolVersion?: string @@ -116,7 +116,7 @@ export namespace Identify { return _codec } - export const encode = (obj: Identify): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, Identify.codec()) } diff --git a/src/insecure/pb/proto.ts b/src/insecure/pb/proto.ts index 6098e23eed..d1ebbd510c 100644 --- a/src/insecure/pb/proto.ts +++ b/src/insecure/pb/proto.ts @@ -5,8 +5,8 @@ /* eslint-disable @typescript-eslint/no-empty-interface */ import { encodeMessage, decodeMessage, message, enumeration } from 'protons-runtime' -import type { Uint8ArrayList } from 'uint8arraylist' import type { Codec } from 'protons-runtime' +import type { Uint8ArrayList } from 'uint8arraylist' export interface Exchange { id?: Uint8Array @@ -30,9 +30,7 @@ export namespace Exchange { if (obj.pubkey != null) { w.uint32(18) - PublicKey.codec().encode(obj.pubkey, w, { - writeDefaults: false - }) + PublicKey.codec().encode(obj.pubkey, w) } if (opts.lengthDelimited !== false) { @@ -66,7 +64,7 @@ export namespace Exchange { return _codec } - export const encode = (obj: Exchange): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, Exchange.codec()) } @@ -109,12 +107,12 @@ export namespace PublicKey { w.fork() } - if (opts.writeDefaults === true || (obj.Type != null && __KeyTypeValues[obj.Type] !== 0)) { + if (obj.Type != null && __KeyTypeValues[obj.Type] !== 0) { w.uint32(8) KeyType.codec().encode(obj.Type, w) } - if (opts.writeDefaults === true || (obj.Data != null && obj.Data.byteLength > 0)) { + if ((obj.Data != null && obj.Data.byteLength > 0)) { w.uint32(18) w.bytes(obj.Data) } @@ -153,7 +151,7 @@ export namespace PublicKey { return _codec } - export const encode = (obj: PublicKey): Uint8Array => { + export const encode = (obj: Partial): Uint8Array => { return encodeMessage(obj, PublicKey.codec()) }