Skip to content

Commit

Permalink
deps(dev): bump protons from 6.1.3 to 7.0.2 (#1582)
Browse files Browse the repository at this point in the history
* 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] <support@github.com>

* 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] <support@github.com>

* chore: update protobuf definitions

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <alex@achingbrain.net>
  • Loading branch information
dependabot[bot] and achingbrain authored Mar 2, 2023
1 parent d605cbe commit 593deef
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 45 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
44 changes: 17 additions & 27 deletions src/circuit/pb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -115,7 +109,7 @@ export namespace HopMessage {
return _codec
}

export const encode = (obj: HopMessage): Uint8Array => {
export const encode = (obj: Partial<HopMessage>): Uint8Array => {
return encodeMessage(obj, HopMessage.codec())
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -218,7 +208,7 @@ export namespace StopMessage {
return _codec
}

export const encode = (obj: StopMessage): Uint8Array => {
export const encode = (obj: Partial<StopMessage>): Uint8Array => {
return encodeMessage(obj, StopMessage.codec())
}

Expand All @@ -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)
}
Expand Down Expand Up @@ -288,7 +278,7 @@ export namespace Peer {
return _codec
}

export const encode = (obj: Peer): Uint8Array => {
export const encode = (obj: Partial<Peer>): Uint8Array => {
return encodeMessage(obj, Peer.codec())
}

Expand All @@ -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)
}
Expand Down Expand Up @@ -367,7 +357,7 @@ export namespace Reservation {
return _codec
}

export const encode = (obj: Reservation): Uint8Array => {
export const encode = (obj: Partial<Reservation>): Uint8Array => {
return encodeMessage(obj, Reservation.codec())
}

Expand Down Expand Up @@ -432,7 +422,7 @@ export namespace Limit {
return _codec
}

export const encode = (obj: Limit): Uint8Array => {
export const encode = (obj: Partial<Limit>): Uint8Array => {
return encodeMessage(obj, Limit.codec())
}

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -539,7 +529,7 @@ export namespace ReservationVoucher {
return _codec
}

export const encode = (obj: ReservationVoucher): Uint8Array => {
export const encode = (obj: Partial<ReservationVoucher>): Uint8Array => {
return encodeMessage(obj, ReservationVoucher.codec())
}

Expand Down
12 changes: 6 additions & 6 deletions src/fetch/pb/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down Expand Up @@ -57,7 +57,7 @@ export namespace FetchRequest {
return _codec
}

export const encode = (obj: FetchRequest): Uint8Array => {
export const encode = (obj: Partial<FetchRequest>): Uint8Array => {
return encodeMessage(obj, FetchRequest.codec())
}

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -143,7 +143,7 @@ export namespace FetchResponse {
return _codec
}

export const encode = (obj: FetchResponse): Uint8Array => {
export const encode = (obj: Partial<FetchResponse>): Uint8Array => {
return encodeMessage(obj, FetchResponse.codec())
}

Expand Down
4 changes: 2 additions & 2 deletions src/identify/pb/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -116,7 +116,7 @@ export namespace Identify {
return _codec
}

export const encode = (obj: Identify): Uint8Array => {
export const encode = (obj: Partial<Identify>): Uint8Array => {
return encodeMessage(obj, Identify.codec())
}

Expand Down
14 changes: 6 additions & 8 deletions src/insecure/pb/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -66,7 +64,7 @@ export namespace Exchange {
return _codec
}

export const encode = (obj: Exchange): Uint8Array => {
export const encode = (obj: Partial<Exchange>): Uint8Array => {
return encodeMessage(obj, Exchange.codec())
}

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -153,7 +151,7 @@ export namespace PublicKey {
return _codec
}

export const encode = (obj: PublicKey): Uint8Array => {
export const encode = (obj: Partial<PublicKey>): Uint8Array => {
return encodeMessage(obj, PublicKey.codec())
}

Expand Down

0 comments on commit 593deef

Please sign in to comment.