From 752956023204a6a8befbcc560220980014ddf756 Mon Sep 17 00:00:00 2001 From: NickWang Date: Tue, 27 Jun 2023 13:03:48 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20message=20type=20enu?= =?UTF-8?q?m=20(#191)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/wechaty/puppet/message.proto | 4 ++++ 1 file changed, 4 insertions(+) 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 { From a5f98f0efb66553b047161e6804baa54a62e7a7f Mon Sep 17 00:00:00 2001 From: NickWang Date: Tue, 27 Jun 2023 13:04:56 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20batch=20add=20and=20?= =?UTF-8?q?remove=20room=20member=20(#192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/wechaty/puppet/room.proto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 {} From db2ee8463d6042e2059ba228a84d32e46fe91e8d Mon Sep 17 00:00:00 2001 From: NickWang Date: Tue, 27 Jun 2023 18:11:28 +0800 Subject: [PATCH 3/6] Feat/conversation read wechaty (#188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 conversation read mark * 1.5.3 * fix: 🐛 naming --- package.json | 2 +- proto/wechaty/puppet.proto | 13 +++++++++++++ proto/wechaty/puppet/conversation.proto | 15 +++++++++++++++ tests/puppet-server-impl.ts | 6 ++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 proto/wechaty/puppet/conversation.proto diff --git a/package.json b/package.json index 656e5b09..9bbdd589 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechaty-grpc", - "version": "1.5.2", + "version": "1.5.3", "description": "gRPC for Wechaty", "type": "module", "exports": { diff --git a/proto/wechaty/puppet.proto b/proto/wechaty/puppet.proto index ba8d239e..c9cccab3 100644 --- a/proto/wechaty/puppet.proto +++ b/proto/wechaty/puppet.proto @@ -28,6 +28,7 @@ import "wechaty/puppet/room-invitation.proto"; import "wechaty/puppet/room-member.proto"; import "wechaty/puppet/room.proto"; import "wechaty/puppet/tag.proto"; +import "wechaty/puppet/conversation.proto"; option java_package="io.github.wechaty.grpc"; option go_package="github.com/wechaty/go-grpc/wechaty"; @@ -358,6 +359,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/tests/puppet-server-impl.ts b/tests/puppet-server-impl.ts index 82af6841..8b7823ea 100644 --- a/tests/puppet-server-impl.ts +++ b/tests/puppet-server-impl.ts @@ -373,4 +373,10 @@ export const puppetServerImpl: IPuppetServer = { throw new Error('not implemented.') }, + conversationRead: (call, callback) => { + void call + void callback + throw new Error('not implemented.') + }, + } From 349dfea9302f8d4e96d22772c389876e5bdd3fa9 Mon Sep 17 00:00:00 2001 From: NickWang Date: Wed, 28 Jun 2023 07:18:37 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20room=20announc?= =?UTF-8?q?e=20event=20(#193)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/wechaty/puppet/event.proto | 2 ++ 1 file changed, 2 insertions(+) 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 {} From 1099c01784bb0296963f56d64f8c88c125b1dbe3 Mon Sep 17 00:00:00 2001 From: NickWang Date: Thu, 29 Jun 2023 16:07:03 +0800 Subject: [PATCH 5/6] [WIP] fix ci and lint (#199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 upgarde go for one dependency requires 1.18 * 1.5.4 --- .github/workflows/go.yml | 4 ++-- .github/workflows/node.yml | 6 +++--- .github/workflows/php.yml | 2 +- .github/workflows/python.yml | 6 +++--- package.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) 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": { From f1ecd6c6327c82cd372fd867c2846835e9552fd1 Mon Sep 17 00:00:00 2001 From: NickWang Date: Thu, 27 Jul 2023 15:24:51 +0800 Subject: [PATCH 6/6] Fix CI (#201) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 tsconfig * fix: 🐛 google api proto path * fix: 🐛 version condition * fix: 🐛 version condition --- .../options => google/api}/annotations.proto | 0 .../options => google/api}/openapiv2.proto | 0 scripts/install-protoc.sh | 10 +++------- tsconfig.json | 3 +++ 4 files changed, 6 insertions(+), 7 deletions(-) rename polyglot/csharp/Wechaty.Grpc/proto/{protoc-gen-openapiv2/options => google/api}/annotations.proto (100%) rename polyglot/csharp/Wechaty.Grpc/proto/{protoc-gen-openapiv2/options => google/api}/openapiv2.proto (100%) 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/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/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/",