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 { chatIdToContentTopic } from "./contentTopic";
import { createSymKeyFromPassword } from "./encryption"; import { createSymKeyFromPassword } from "./encryption";
import { ChatMessage, Content } from "./wire/chat_message";
/** /**
* Represent a chat room. Only public chats are currently supported. * Represent a chat room. Only public chats are currently supported.

View File

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

View File

@ -1,3 +1,6 @@
import { Identity } from "./identity"; import { Identity } from "./identity";
import { Messenger } from "./messenger"; 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 debug from "debug";
import { utils } from "js-waku"; import { utils } from "js-waku";
import { ApplicationMetadataMessage } from "./application_metadata_message";
import { ContentType } from "./chat_message";
import { Identity } from "./identity"; import { Identity } from "./identity";
import { Messenger } from "./messenger"; import { Messenger } from "./messenger";
import { ApplicationMetadataMessage } from "./wire/application_metadata_message";
import { ContentType } from "./wire/chat_message";
const testChatId = "test-chat-id"; const testChatId = "test-chat-id";

View File

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

View File

@ -3,10 +3,11 @@ import { utils } from "js-waku";
import { Reader } from "protobufjs"; import { Reader } from "protobufjs";
import secp256k1 from "secp256k1"; 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 { 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 { export class ApplicationMetadataMessage {
private constructor(public proto: proto.ApplicationMetadataMessage) {} private constructor(public proto: proto.ApplicationMetadataMessage) {}

View File

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