@google-apps/chat 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +3 -0
- package/build/protos/google/chat/v1/chat_service.proto +43 -1
- package/build/protos/google/chat/v1/space_read_state.proto +112 -0
- package/build/protos/google/chat/v1/thread_read_state.proto +74 -0
- package/build/protos/protos.d.ts +566 -0
- package/build/protos/protos.js +1337 -131
- package/build/protos/protos.json +137 -2
- package/build/src/v1/chat_service_client.d.ts +195 -0
- package/build/src/v1/chat_service_client.js +148 -0
- package/build/src/v1/chat_service_client.js.map +1 -1
- package/build/src/v1/chat_service_client_config.json +15 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.3.0...chat-v0.4.0) (2024-04-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* [chat] Add Chat read state APIs ([#5268](https://github.com/googleapis/google-cloud-node/issues/5268)) ([3b345ca](https://github.com/googleapis/google-cloud-node/commit/3b345ca4dc99ee0e41be86eea4d3c1e8d07ac924))
|
|
9
|
+
|
|
3
10
|
## [0.3.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.2.0...chat-v0.3.0) (2024-04-18)
|
|
4
11
|
|
|
5
12
|
|
package/README.md
CHANGED
|
@@ -140,6 +140,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
|
|
|
140
140
|
| Chat_service.get_membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_membership.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_membership.js,packages/google-chat/samples/README.md) |
|
|
141
141
|
| Chat_service.get_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_message.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_message.js,packages/google-chat/samples/README.md) |
|
|
142
142
|
| Chat_service.get_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space.js,packages/google-chat/samples/README.md) |
|
|
143
|
+
| Chat_service.get_space_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js,packages/google-chat/samples/README.md) |
|
|
144
|
+
| Chat_service.get_thread_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js,packages/google-chat/samples/README.md) |
|
|
143
145
|
| Chat_service.list_memberships | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_memberships.js,packages/google-chat/samples/README.md) |
|
|
144
146
|
| Chat_service.list_messages | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_messages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_messages.js,packages/google-chat/samples/README.md) |
|
|
145
147
|
| Chat_service.list_reactions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_reactions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_reactions.js,packages/google-chat/samples/README.md) |
|
|
@@ -148,6 +150,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
|
|
|
148
150
|
| Chat_service.update_membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_membership.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_membership.js,packages/google-chat/samples/README.md) |
|
|
149
151
|
| Chat_service.update_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_message.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_message.js,packages/google-chat/samples/README.md) |
|
|
150
152
|
| Chat_service.update_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space.js,packages/google-chat/samples/README.md) |
|
|
153
|
+
| Chat_service.update_space_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js,packages/google-chat/samples/README.md) |
|
|
151
154
|
| Chat_service.upload_attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js,packages/google-chat/samples/README.md) |
|
|
152
155
|
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/quickstart.js,packages/google-chat/samples/README.md) |
|
|
153
156
|
|
|
@@ -23,7 +23,9 @@ import "google/chat/v1/membership.proto";
|
|
|
23
23
|
import "google/chat/v1/message.proto";
|
|
24
24
|
import "google/chat/v1/reaction.proto";
|
|
25
25
|
import "google/chat/v1/space.proto";
|
|
26
|
+
import "google/chat/v1/space_read_state.proto";
|
|
26
27
|
import "google/chat/v1/space_setup.proto";
|
|
28
|
+
import "google/chat/v1/thread_read_state.proto";
|
|
27
29
|
import "google/protobuf/empty.proto";
|
|
28
30
|
|
|
29
31
|
option csharp_namespace = "Google.Apps.Chat.V1";
|
|
@@ -53,7 +55,9 @@ service ChatService {
|
|
|
53
55
|
"https://www.googleapis.com/auth/chat.messages.readonly,"
|
|
54
56
|
"https://www.googleapis.com/auth/chat.spaces,"
|
|
55
57
|
"https://www.googleapis.com/auth/chat.spaces.create,"
|
|
56
|
-
"https://www.googleapis.com/auth/chat.spaces.readonly"
|
|
58
|
+
"https://www.googleapis.com/auth/chat.spaces.readonly,"
|
|
59
|
+
"https://www.googleapis.com/auth/chat.users.readstate,"
|
|
60
|
+
"https://www.googleapis.com/auth/chat.users.readstate.readonly";
|
|
57
61
|
|
|
58
62
|
// Creates a message in a Google Chat space. For an example, see [Send a
|
|
59
63
|
// message](https://developers.google.com/workspace/chat/create-messages).
|
|
@@ -502,4 +506,42 @@ service ChatService {
|
|
|
502
506
|
};
|
|
503
507
|
option (google.api.method_signature) = "name";
|
|
504
508
|
}
|
|
509
|
+
|
|
510
|
+
// Returns details about a user's read state within a space, used to identify
|
|
511
|
+
// read and unread messages.
|
|
512
|
+
//
|
|
513
|
+
// Requires [user
|
|
514
|
+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
|
|
515
|
+
rpc GetSpaceReadState(GetSpaceReadStateRequest) returns (SpaceReadState) {
|
|
516
|
+
option (google.api.http) = {
|
|
517
|
+
get: "/v1/{name=users/*/spaces/*/spaceReadState}"
|
|
518
|
+
};
|
|
519
|
+
option (google.api.method_signature) = "name";
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// Updates a user's read state within a space, used to identify read and
|
|
523
|
+
// unread messages.
|
|
524
|
+
//
|
|
525
|
+
// Requires [user
|
|
526
|
+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
|
|
527
|
+
rpc UpdateSpaceReadState(UpdateSpaceReadStateRequest)
|
|
528
|
+
returns (SpaceReadState) {
|
|
529
|
+
option (google.api.http) = {
|
|
530
|
+
patch: "/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}"
|
|
531
|
+
body: "space_read_state"
|
|
532
|
+
};
|
|
533
|
+
option (google.api.method_signature) = "space_read_state,update_mask";
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Returns details about a user's read state within a thread, used to identify
|
|
537
|
+
// read and unread messages.
|
|
538
|
+
//
|
|
539
|
+
// Requires [user
|
|
540
|
+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
|
|
541
|
+
rpc GetThreadReadState(GetThreadReadStateRequest) returns (ThreadReadState) {
|
|
542
|
+
option (google.api.http) = {
|
|
543
|
+
get: "/v1/{name=users/*/spaces/*/threads/*/threadReadState}"
|
|
544
|
+
};
|
|
545
|
+
option (google.api.method_signature) = "name";
|
|
546
|
+
}
|
|
505
547
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Copyright 2023 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.chat.v1;
|
|
18
|
+
|
|
19
|
+
import "google/api/field_behavior.proto";
|
|
20
|
+
import "google/api/resource.proto";
|
|
21
|
+
import "google/protobuf/field_mask.proto";
|
|
22
|
+
import "google/protobuf/timestamp.proto";
|
|
23
|
+
|
|
24
|
+
option csharp_namespace = "Google.Apps.Chat.V1";
|
|
25
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
26
|
+
option java_multiple_files = true;
|
|
27
|
+
option java_outer_classname = "SpaceReadStateProto";
|
|
28
|
+
option java_package = "com.google.chat.v1";
|
|
29
|
+
option php_namespace = "Google\\Apps\\Chat\\V1";
|
|
30
|
+
option ruby_package = "Google::Apps::Chat::V1";
|
|
31
|
+
|
|
32
|
+
// A user's read state within a space, used to identify read and unread
|
|
33
|
+
// messages.
|
|
34
|
+
message SpaceReadState {
|
|
35
|
+
option (google.api.resource) = {
|
|
36
|
+
type: "chat.googleapis.com/SpaceReadState"
|
|
37
|
+
pattern: "users/{user}/spaces/{space}/spaceReadState"
|
|
38
|
+
singular: "spaceReadState"
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Resource name of the space read state.
|
|
42
|
+
//
|
|
43
|
+
// Format: `users/{user}/spaces/{space}/spaceReadState`
|
|
44
|
+
string name = 1;
|
|
45
|
+
|
|
46
|
+
// Optional. The time when the user's space read state was updated. Usually
|
|
47
|
+
// this corresponds with either the timestamp of the last read message, or a
|
|
48
|
+
// timestamp specified by the user to mark the last read position in a space.
|
|
49
|
+
google.protobuf.Timestamp last_read_time = 2
|
|
50
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Request message for GetSpaceReadState API.
|
|
54
|
+
message GetSpaceReadStateRequest {
|
|
55
|
+
// Required. Resource name of the space read state to retrieve.
|
|
56
|
+
//
|
|
57
|
+
// Only supports getting read state for the calling user.
|
|
58
|
+
//
|
|
59
|
+
// To refer to the calling user, set one of the following:
|
|
60
|
+
//
|
|
61
|
+
// - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
|
|
62
|
+
//
|
|
63
|
+
// - Their Workspace email address. For example,
|
|
64
|
+
// `users/user@example.com/spaces/{space}/spaceReadState`.
|
|
65
|
+
//
|
|
66
|
+
// - Their user id. For example,
|
|
67
|
+
// `users/123456789/spaces/{space}/spaceReadState`.
|
|
68
|
+
//
|
|
69
|
+
// Format: users/{user}/spaces/{space}/spaceReadState
|
|
70
|
+
string name = 1 [
|
|
71
|
+
(google.api.field_behavior) = REQUIRED,
|
|
72
|
+
(google.api.resource_reference) = {
|
|
73
|
+
type: "chat.googleapis.com/SpaceReadState"
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Request message for UpdateSpaceReadState API.
|
|
79
|
+
message UpdateSpaceReadStateRequest {
|
|
80
|
+
// Required. The space read state and fields to update.
|
|
81
|
+
//
|
|
82
|
+
// Only supports updating read state for the calling user.
|
|
83
|
+
//
|
|
84
|
+
// To refer to the calling user, set one of the following:
|
|
85
|
+
//
|
|
86
|
+
// - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
|
|
87
|
+
//
|
|
88
|
+
// - Their Workspace email address. For example,
|
|
89
|
+
// `users/user@example.com/spaces/{space}/spaceReadState`.
|
|
90
|
+
//
|
|
91
|
+
// - Their user id. For example,
|
|
92
|
+
// `users/123456789/spaces/{space}/spaceReadState`.
|
|
93
|
+
//
|
|
94
|
+
// Format: users/{user}/spaces/{space}/spaceReadState
|
|
95
|
+
SpaceReadState space_read_state = 1 [(google.api.field_behavior) = REQUIRED];
|
|
96
|
+
|
|
97
|
+
// Required. The field paths to update. Currently supported field paths:
|
|
98
|
+
//
|
|
99
|
+
// - `last_read_time`
|
|
100
|
+
//
|
|
101
|
+
// When the `last_read_time` is before the latest message create time, the
|
|
102
|
+
// space appears as unread in the UI.
|
|
103
|
+
//
|
|
104
|
+
// To mark the space as read, set `last_read_time` to any value later (larger)
|
|
105
|
+
// than the latest message create time. The `last_read_time` is coerced to
|
|
106
|
+
// match the latest message create time. Note that the space read state only
|
|
107
|
+
// affects the read state of messages that are visible in the space's
|
|
108
|
+
// top-level conversation. Replies in threads are unaffected by this
|
|
109
|
+
// timestamp, and instead rely on the thread read state.
|
|
110
|
+
google.protobuf.FieldMask update_mask = 2
|
|
111
|
+
[(google.api.field_behavior) = REQUIRED];
|
|
112
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Copyright 2023 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.chat.v1;
|
|
18
|
+
|
|
19
|
+
import "google/api/field_behavior.proto";
|
|
20
|
+
import "google/api/resource.proto";
|
|
21
|
+
import "google/protobuf/timestamp.proto";
|
|
22
|
+
|
|
23
|
+
option csharp_namespace = "Google.Apps.Chat.V1";
|
|
24
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
25
|
+
option java_multiple_files = true;
|
|
26
|
+
option java_outer_classname = "ThreadReadStateProto";
|
|
27
|
+
option java_package = "com.google.chat.v1";
|
|
28
|
+
option php_namespace = "Google\\Apps\\Chat\\V1";
|
|
29
|
+
option ruby_package = "Google::Apps::Chat::V1";
|
|
30
|
+
|
|
31
|
+
// A user's read state within a thread, used to identify read and unread
|
|
32
|
+
// messages.
|
|
33
|
+
message ThreadReadState {
|
|
34
|
+
option (google.api.resource) = {
|
|
35
|
+
type: "chat.googleapis.com/ThreadReadState"
|
|
36
|
+
pattern: "users/{user}/spaces/{space}/threads/{thread}/threadReadState"
|
|
37
|
+
singular: "threadReadState"
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Resource name of the thread read state.
|
|
41
|
+
//
|
|
42
|
+
// Format: `users/{user}/spaces/{space}/threads/{thread}/threadReadState`
|
|
43
|
+
string name = 1;
|
|
44
|
+
|
|
45
|
+
// The time when the user's thread read state was updated. Usually this
|
|
46
|
+
// corresponds with the timestamp of the last read message in a thread.
|
|
47
|
+
google.protobuf.Timestamp last_read_time = 2;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Request message for GetThreadReadStateRequest API.
|
|
51
|
+
message GetThreadReadStateRequest {
|
|
52
|
+
// Required. Resource name of the thread read state to retrieve.
|
|
53
|
+
//
|
|
54
|
+
// Only supports getting read state for the calling user.
|
|
55
|
+
//
|
|
56
|
+
// To refer to the calling user, set one of the following:
|
|
57
|
+
//
|
|
58
|
+
// - The `me` alias. For example,
|
|
59
|
+
// `users/me/spaces/{space}/threads/{thread}/threadReadState`.
|
|
60
|
+
//
|
|
61
|
+
// - Their Workspace email address. For example,
|
|
62
|
+
// `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`.
|
|
63
|
+
//
|
|
64
|
+
// - Their user id. For example,
|
|
65
|
+
// `users/123456789/spaces/{space}/threads/{thread}/threadReadState`.
|
|
66
|
+
//
|
|
67
|
+
// Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState
|
|
68
|
+
string name = 1 [
|
|
69
|
+
(google.api.field_behavior) = REQUIRED,
|
|
70
|
+
(google.api.resource_reference) = {
|
|
71
|
+
type: "chat.googleapis.com/ThreadReadState"
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
}
|