update proto

This commit is contained in:
Adhiraj Singh
2021-07-29 20:33:19 +05:30
parent 5c4a317213
commit b5ee036ae9
13 changed files with 6164 additions and 29547 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -23,7 +23,7 @@
"build:docs": "typedoc",
"build:tsc": "tsc",
"example": "node --inspect -r ts-node/register Example/example.ts",
"gen-protobuf": "bash src/Binary/GenerateStatics.sh",
"gen-protobuf": "bash src/BinaryNode/GenerateStatics.sh",
"browser-decode": "yarn ts-node src/BrowserMessageDecoding.ts"
},
"author": "Adhiraj Singh",
+2 -2
View File
@@ -1,4 +1,4 @@
yarn pbjs -t static-module -w commonjs -o ./WAMessage/WAMessage.js ./src/Binary/WAMessage.proto;
yarn pbts -o ./WAMessage/WAMessage.d.ts ./WAMessage/WAMessage.js;
yarn pbjs -t static-module -w commonjs -o ./WAMessage/index.js ./src/BinaryNode/WAMessage.proto;
yarn pbts -o ./WAMessage/index.d.ts ./WAMessage/index.js;
#protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=env=node,useOptionals=true,forceLong=long --ts_proto_out=. ./src/Binary/WAMessage.proto;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
import { proto } from '../../WAMessage/WAMessage'
import { proto } from '../../WAMessage'
import { BinaryNode, DoubleByteTokens, SingleByteTokens, Tags } from './types'
function decode<T extends BinaryNode>(buffer: Buffer, makeNode: () => T, indexRef: { index: number }) {
+1 -1
View File
@@ -1,4 +1,4 @@
import { proto } from "../../WAMessage/WAMessage";
import { proto } from "../../WAMessage";
import { BinaryNode, SingleByteTokens, Tags } from "./types";
const encode = ({ header, attributes, data }: BinaryNode, buffer: number[] = []) => {
+1 -1
View File
@@ -1,4 +1,4 @@
import { proto } from "../../WAMessage/WAMessage"
import { proto } from "../../WAMessage"
export type Attributes = { [key: string]: string }
export type BinaryNodeData = BinaryNode[] | string | Buffer | proto.IWebMessageInfo | undefined
+1 -3
View File
@@ -5,7 +5,6 @@ import { Chat, Presence, WAMessageCursor, SocketConfig, WAMessage, WAMessageKey,
import { isGroupID, toNumber, whatsappID, generateWAMessage, decryptMediaMessageBuffer } from "../Utils";
import makeChatsSocket from "./chats";
import { WA_DEFAULT_EPHEMERAL } from "../Defaults";
import { Attributes } from "../BinaryNode/types";
const STATUS_MAP = {
read: WAMessageStatus.READ,
@@ -19,8 +18,7 @@ const makeMessagesSocket = (config: SocketConfig) => {
const {
ev,
socketEvents,
query,
sendMessage,
query,
generateMessageTag,
currentEpoch,
setQuery,
+1 -1
View File
@@ -1,7 +1,7 @@
import { deepStrictEqual, strictEqual } from 'assert'
import { createWriteStream } from 'fs'
import { readFile } from 'fs/promises'
import { proto } from '../../WAMessage/WAMessage'
import { proto } from '../../WAMessage'
import { MessageType } from '../WAConnection'
import { aesEncrypWithIV, decryptMediaMessageBuffer, encryptedStream, getMediaKeys, getStream, hmacSign, sha256 } from '../WAConnection/Utils'
import { WAConnectionTest } from './Common'
+1 -1
View File
@@ -1,7 +1,7 @@
import type { Agent } from "https"
import type { Logger } from "pino"
import type { URL } from "url"
import { proto } from '../../WAMessage/WAMessage'
import { proto } from '../../WAMessage'
// export the WAMessage Prototypes
export { proto as WAMessageProto }
+1 -1
View File
@@ -17,7 +17,7 @@ import { ConnectionState } from './Store'
import { GroupMetadata, ParticipantAction } from './GroupMetadata'
import { MessageInfo, MessageInfoUpdate, MessageUpdateType, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
import { proto } from '../../WAMessage/WAMessage'
import { proto } from '../../WAMessage'
/** used for binary messages */
export enum WAMetric {
+1 -1
View File
@@ -1,6 +1,6 @@
import makeConnection from './Connection'
export * from '../WAMessage/WAMessage'
export * from '../WAMessage'
export * from './Utils'
export * from './Types'
export * from './Store'