diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1120236e..8a3b601d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go 1.17 uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 id: go - name: Install Protoc uses: arduino/setup-protoc@v1 @@ -52,7 +52,7 @@ jobs: - name: Set up Go 1.17 uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: Install Protoc uses: arduino/setup-protoc@v1 - name: Check out code into the Go module directory diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 4498c303..432969e5 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: Install Protoc uses: arduino/setup-protoc@v1 @@ -54,7 +54,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: Install Protoc uses: arduino/setup-protoc@v1 @@ -86,7 +86,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: Install Protoc uses: arduino/setup-protoc@v1 - name: Install Protoc 3rd party protos diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8d1b6b4e..a5202757 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -53,7 +53,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 id: go - name: Install Dependencies run: | diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ec73a148..edf0632a 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - uses: actions/cache@master with: path: ~/.cache/pip @@ -62,7 +62,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - uses: actions/cache@master with: @@ -103,7 +103,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - uses: actions/cache@master with: diff --git a/package.json b/package.json index 9bbdd589..3d7e5d40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechaty-grpc", - "version": "1.5.3", + "version": "1.5.4", "description": "gRPC for Wechaty", "type": "module", "exports": { diff --git a/polyglot/csharp/Wechaty.Grpc/proto/protoc-gen-openapiv2/options/annotations.proto b/polyglot/csharp/Wechaty.Grpc/proto/google/api/annotations.proto similarity index 100% rename from polyglot/csharp/Wechaty.Grpc/proto/protoc-gen-openapiv2/options/annotations.proto rename to polyglot/csharp/Wechaty.Grpc/proto/google/api/annotations.proto diff --git a/polyglot/csharp/Wechaty.Grpc/proto/protoc-gen-openapiv2/options/openapiv2.proto b/polyglot/csharp/Wechaty.Grpc/proto/google/api/openapiv2.proto similarity index 100% rename from polyglot/csharp/Wechaty.Grpc/proto/protoc-gen-openapiv2/options/openapiv2.proto rename to polyglot/csharp/Wechaty.Grpc/proto/google/api/openapiv2.proto diff --git a/proto/wechaty/puppet.proto b/proto/wechaty/puppet.proto index 50fca097..49801960 100644 --- a/proto/wechaty/puppet.proto +++ b/proto/wechaty/puppet.proto @@ -29,6 +29,7 @@ import "wechaty/puppet/room-member.proto"; import "wechaty/puppet/room.proto"; import "wechaty/puppet/tag.proto"; import "wechaty/puppet/post.proto"; +import "wechaty/puppet/conversation.proto"; option java_package="io.github.wechaty.grpc"; option go_package="github.com/wechaty/go-grpc/wechaty"; @@ -359,6 +360,18 @@ service Puppet { }; } + /** + * + * Conversation + * + */ + rpc ConversationRead (puppet.ConversationReadRequest) returns (puppet.ConversationReadResponse) { + option (google.api.http) = { + put: "/conversation/{conversation_id}/read" + body: "*" + }; + } + /** * * Room diff --git a/proto/wechaty/puppet/conversation.proto b/proto/wechaty/puppet/conversation.proto new file mode 100644 index 00000000..05283616 --- /dev/null +++ b/proto/wechaty/puppet/conversation.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package wechaty.puppet; + +option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.grpc.puppet"; +option csharp_namespace = "github.wechaty.grpc.puppet"; + +message ConversationReadRequest { + string conversation_id = 1; + bool has_read = 2; +} + +message ConversationReadResponse { + bool has_read = 1; +} diff --git a/proto/wechaty/puppet/event.proto b/proto/wechaty/puppet/event.proto index ff66e7a0..0541358a 100644 --- a/proto/wechaty/puppet/event.proto +++ b/proto/wechaty/puppet/event.proto @@ -27,6 +27,8 @@ enum EventType { EVENT_TYPE_LOGIN = 25; EVENT_TYPE_LOGOUT = 26; EVENT_TYPE_DIRTY = 27; + + EVENT_TYPE_ROOM_ANNOUNCE = 32; } message EventRequest {} diff --git a/proto/wechaty/puppet/message.proto b/proto/wechaty/puppet/message.proto index 8b7785aa..2ef2266b 100644 --- a/proto/wechaty/puppet/message.proto +++ b/proto/wechaty/puppet/message.proto @@ -36,6 +36,10 @@ enum MessageType { MESSAGE_TYPE_RED_ENVELOPE = 12; MESSAGE_TYPE_RECALLED = 13; MESSAGE_TYPE_URL = 14; + MESSAGE_TYPE_GROUP_NOTE = 15; + MESSAGE_TYPE_POST = 16; + + MESSAGE_TYPE_SYSTEM = 18; } message MessagePayloadRequest { diff --git a/proto/wechaty/puppet/room.proto b/proto/wechaty/puppet/room.proto index 084e1d7f..66bb8cb3 100644 --- a/proto/wechaty/puppet/room.proto +++ b/proto/wechaty/puppet/room.proto @@ -27,8 +27,9 @@ message RoomPayloadResponse { message RoomAddRequest { string id = 1; - string contact_id = 2; + string contact_id = 2 [deprecated = true]; bool invite_only = 3; + repeated string contact_ids = 4; } message RoomAddResponse {} @@ -49,7 +50,8 @@ message RoomCreateResponse { message RoomDelRequest { string id = 1; - string contact_id = 2; + string contact_id = 2 [deprecated = true]; + repeated string contact_ids = 3; } message RoomDelResponse {} diff --git a/scripts/install-protoc.sh b/scripts/install-protoc.sh index 1fbd1aec..3b5bbbae 100755 --- a/scripts/install-protoc.sh +++ b/scripts/install-protoc.sh @@ -32,14 +32,10 @@ function check_protoc_version () { majorVer=$(echo $protocVersion | cut -d. -f 1) minorVer=$(echo $protocVersion | cut -d. -f 2) - (($majorVer == 3)) || { - echo "protoc major version must >= 3 (the installed version is $protocVersion)" - exit 1 - } - # https://github.com/wechaty/grpc/issues/109 - (($minorVer >= 17)) || { - echo "protoc minor version must >= 17 (the installed version is $protocVersion)" + + ((($majorVer == 3 && $minorVer >= 17) || $majorVer > 3)) || { + echo "protoc version must >= 3.17 (the installed version is $protocVersion)" exit 1 } diff --git a/tests/puppet-server-impl.ts b/tests/puppet-server-impl.ts index fbece0ed..cff453da 100644 --- a/tests/puppet-server-impl.ts +++ b/tests/puppet-server-impl.ts @@ -391,4 +391,10 @@ export const puppetServerImpl: IPuppetServer = { throw new Error('not implemented.') }, + conversationRead: (call, callback) => { + void call + void callback + throw new Error('not implemented.') + }, + } diff --git a/tsconfig.json b/tsconfig.json index ba146f79..ec760206 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,9 @@ "extends": "@chatie/tsconfig", "compilerOptions": { "outDir": "dist/esm", + "verbatimModuleSyntax": false, + // See: https://github.com/wechaty/wechaty/issues/2551 + "ignoreDeprecations": "5.0" }, "exclude": [ "node_modules/",