Skip to content

Commit

Permalink
chore: update deps and specify root for pbjs
Browse files Browse the repository at this point in the history
- Updates all deps to pull in the latest buffer and bl modules
- Specifies a root name for pbjs code gen - message names for pbjs
  generated code are global so specifying a root name scopes them
  to prevent two modules accidentally trampling over each other's
  protobuf code by giving their messages the same name

Refs: ipfs/js-ipfs-bitswap#323

BREAKING CHANGE: buffer@6 dropped support for IE and Safari < 10
  • Loading branch information
achingbrain committed Apr 23, 2021
1 parent 522d28c commit 4d31d12
Show file tree
Hide file tree
Showing 4 changed files with 1,946 additions and 1,740 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,26 @@
"test:node": "aegir test -t node",
"test:browser": "aegir test -t browser",
"docs": "aegir docs",
"proto:gen": "pbjs -t static-module -o ./src/proto/payload.js ./src/proto/payload.proto && pbts -o ./src/proto/payload.d.ts ./src/proto/payload.js && yarn run lint --fix"
"proto:gen": "pbjs -t static-module -r libp2p-noise -o ./src/proto/payload.js ./src/proto/payload.proto && pbts -o ./src/proto/payload.d.ts ./src/proto/payload.js && yarn run lint --fix"
},
"browser": {
"util": false
},
"devDependencies": {
"@types/bl": "^2.1.0",
"aegir": "^31.0.0",
"aegir": "^33.1.0",
"benchmark": "^2.1.4",
"buffer": "^5.7.1",
"buffer": "^6.0.3",
"chai": "^4.2.0",
"events": "^3.2.0",
"microtime": "^3.0.0",
"mocha": "^8.2.1",
"sinon": "^9.2.4"
"sinon": "^10.0.0"
},
"dependencies": {
"bcrypto": "^5.4.0",
"debug": "^4.3.1",
"it-buffer": "^0.1.1",
"it-length-prefixed": "^3.0.0",
"it-length-prefixed": "^5.0.2",
"it-pair": "^1.0.0",
"it-pb-rpc": "^0.1.9",
"it-pipe": "^1.1.0",
Expand Down
76 changes: 38 additions & 38 deletions src/proto/payload.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,105 +2,105 @@ import * as $protobuf from "protobufjs";
/** Namespace pb. */
export namespace pb {

/** Properties of a NoiseHandshakePayload. */
interface INoiseHandshakePayload {
/** Properties of a NoiseHandshakePayload. */
interface INoiseHandshakePayload {

/** NoiseHandshakePayload identityKey */
identityKey?: (Uint8Array|null);
/** NoiseHandshakePayload identityKey */
identityKey?: (Uint8Array|null);

/** NoiseHandshakePayload identitySig */
identitySig?: (Uint8Array|null);
/** NoiseHandshakePayload identitySig */
identitySig?: (Uint8Array|null);

/** NoiseHandshakePayload data */
data?: (Uint8Array|null);
}
/** NoiseHandshakePayload data */
data?: (Uint8Array|null);
}

/** Represents a NoiseHandshakePayload. */
class NoiseHandshakePayload implements INoiseHandshakePayload {
/** Represents a NoiseHandshakePayload. */
class NoiseHandshakePayload implements INoiseHandshakePayload {

/**
/**
* Constructs a new NoiseHandshakePayload.
* @param [properties] Properties to set
*/
constructor(properties?: pb.INoiseHandshakePayload);
constructor(properties?: pb.INoiseHandshakePayload);

/** NoiseHandshakePayload identityKey. */
public identityKey: Uint8Array;
/** NoiseHandshakePayload identityKey. */
public identityKey: Uint8Array;

/** NoiseHandshakePayload identitySig. */
public identitySig: Uint8Array;
/** NoiseHandshakePayload identitySig. */
public identitySig: Uint8Array;

/** NoiseHandshakePayload data. */
public data: Uint8Array;
/** NoiseHandshakePayload data. */
public data: Uint8Array;

/**
/**
* Creates a new NoiseHandshakePayload instance using the specified properties.
* @param [properties] Properties to set
* @returns NoiseHandshakePayload instance
*/
public static create(properties?: pb.INoiseHandshakePayload): pb.NoiseHandshakePayload;
public static create(properties?: pb.INoiseHandshakePayload): pb.NoiseHandshakePayload;

/**
/**
* Encodes the specified NoiseHandshakePayload message. Does not implicitly {@link pb.NoiseHandshakePayload.verify|verify} messages.
* @param message NoiseHandshakePayload message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: pb.INoiseHandshakePayload, writer?: $protobuf.Writer): $protobuf.Writer;
public static encode(message: pb.INoiseHandshakePayload, writer?: $protobuf.Writer): $protobuf.Writer;

/**
/**
* Encodes the specified NoiseHandshakePayload message, length delimited. Does not implicitly {@link pb.NoiseHandshakePayload.verify|verify} messages.
* @param message NoiseHandshakePayload message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: pb.INoiseHandshakePayload, writer?: $protobuf.Writer): $protobuf.Writer;
public static encodeDelimited(message: pb.INoiseHandshakePayload, writer?: $protobuf.Writer): $protobuf.Writer;

/**
/**
* Decodes a NoiseHandshakePayload message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns NoiseHandshakePayload
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): pb.NoiseHandshakePayload;
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): pb.NoiseHandshakePayload;

/**
/**
* Decodes a NoiseHandshakePayload message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns NoiseHandshakePayload
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): pb.NoiseHandshakePayload;
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): pb.NoiseHandshakePayload;

/**
/**
* Verifies a NoiseHandshakePayload message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
public static verify(message: { [k: string]: any }): (string|null);

/**
/**
* Creates a NoiseHandshakePayload message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns NoiseHandshakePayload
*/
public static fromObject(object: { [k: string]: any }): pb.NoiseHandshakePayload;
public static fromObject(object: { [k: string]: any }): pb.NoiseHandshakePayload;

/**
/**
* Creates a plain object from a NoiseHandshakePayload message. Also converts values to other types if specified.
* @param message NoiseHandshakePayload
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: pb.NoiseHandshakePayload, options?: $protobuf.IConversionOptions): { [k: string]: any };
public static toObject(message: pb.NoiseHandshakePayload, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
/**
* Converts this NoiseHandshakePayload to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
public toJSON(): { [k: string]: any };
}
}
Loading

0 comments on commit 4d31d12

Please sign in to comment.