Move proto wrappers in wire folder

This commit is contained in:
Franck Royer 2021-10-06 10:43:53 +11:00
parent 738609d53f
commit 5d04f731a7
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
7 changed files with 22 additions and 18 deletions

View File

@ -1,6 +1,6 @@
import { ChatMessage, Content } from "./chat_message";
import { chatIdToContentTopic } from "./contentTopic";
import { createSymKeyFromPassword } from "./encryption";
import { ChatMessage, Content } from "./wire/chat_message";
/**
* Represent a chat room. Only public chats are currently supported.

View File

@ -1,17 +1,17 @@
import { expect } from "chai";
import {
AudioMessage_AudioType,
ChatMessage_ContentType,
} from "./proto/communities/v1/chat_message";
import { ImageType } from "./proto/communities/v1/enums";
import {
AudioContent,
ChatMessage,
ContentType,
ImageContent,
StickerContent,
} from "./chat_message";
import {
AudioMessage_AudioType,
ChatMessage_ContentType,
} from "./proto/communities/v1/chat_message";
import { ImageType } from "./proto/communities/v1/enums";
} from "./wire/chat_message";
describe("Chat Message", () => {
it("Encode & decode Image message", () => {

View File

@ -1,3 +1,6 @@
import { Identity } from "./identity";
import { Messenger } from "./messenger";
export { Messenger, Identity };
import { ApplicationMetadataMessage } from "./wire/application_metadata_message";
import { ChatMessage } from "./wire/chat_message";
export { Messenger, Identity, ApplicationMetadataMessage, ChatMessage };

View File

@ -2,10 +2,10 @@ import { expect } from "chai";
import debug from "debug";
import { utils } from "js-waku";
import { ApplicationMetadataMessage } from "./application_metadata_message";
import { ContentType } from "./chat_message";
import { Identity } from "./identity";
import { Messenger } from "./messenger";
import { ApplicationMetadataMessage } from "./wire/application_metadata_message";
import { ContentType } from "./wire/chat_message";
const testChatId = "test-chat-id";

View File

@ -2,11 +2,11 @@ import debug from "debug";
import { Waku, WakuMessage } from "js-waku";
import { CreateOptions as WakuCreateOptions } from "js-waku/build/main/lib/waku";
import { ApplicationMetadataMessage } from "./application_metadata_message";
import { Chat } from "./chat";
import { ChatMessage, Content } from "./chat_message";
import { Identity } from "./identity";
import { ApplicationMetadataMessage_Type } from "./proto/status/v1/application_metadata_message";
import { ApplicationMetadataMessage } from "./wire/application_metadata_message";
import { ChatMessage, Content } from "./wire/chat_message";
const dbg = debug("communities:messenger");

View File

@ -3,10 +3,11 @@ import { utils } from "js-waku";
import { Reader } from "protobufjs";
import secp256k1 from "secp256k1";
import { Identity } from "../identity";
import * as proto from "../proto/status/v1/application_metadata_message";
import { ApplicationMetadataMessage_Type } from "../proto/status/v1/application_metadata_message";
import { ChatMessage } from "./chat_message";
import { Identity } from "./identity";
import * as proto from "./proto/status/v1/application_metadata_message";
import { ApplicationMetadataMessage_Type } from "./proto/status/v1/application_metadata_message";
export class ApplicationMetadataMessage {
private constructor(public proto: proto.ApplicationMetadataMessage) {}

View File

@ -1,14 +1,14 @@
import { Reader } from "protobufjs";
import * as proto from "./proto/communities/v1/chat_message";
import * as proto from "../proto/communities/v1/chat_message";
import {
AudioMessage,
AudioMessage_AudioType,
ChatMessage_ContentType,
ImageMessage,
StickerMessage,
} from "./proto/communities/v1/chat_message";
import { ImageType, MessageType } from "./proto/communities/v1/enums";
} from "../proto/communities/v1/chat_message";
import { ImageType, MessageType } from "../proto/communities/v1/enums";
export type Content =
| TextContent