@google-apps/chat 0.1.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 +8 -0
- package/LICENSE +202 -0
- package/README.md +220 -0
- package/build/protos/google/apps/card/v1/card.proto +1918 -0
- package/build/protos/google/chat/v1/action_status.proto +38 -0
- package/build/protos/google/chat/v1/annotation.proto +137 -0
- package/build/protos/google/chat/v1/attachment.proto +122 -0
- package/build/protos/google/chat/v1/chat_service.proto +493 -0
- package/build/protos/google/chat/v1/contextual_addon.proto +106 -0
- package/build/protos/google/chat/v1/deletion_metadata.proto +56 -0
- package/build/protos/google/chat/v1/group.proto +37 -0
- package/build/protos/google/chat/v1/history_state.proto +41 -0
- package/build/protos/google/chat/v1/matched_url.proto +35 -0
- package/build/protos/google/chat/v1/membership.proto +292 -0
- package/build/protos/google/chat/v1/message.proto +645 -0
- package/build/protos/google/chat/v1/reaction.proto +183 -0
- package/build/protos/google/chat/v1/slash_command.proto +32 -0
- package/build/protos/google/chat/v1/space.proto +360 -0
- package/build/protos/google/chat/v1/space_setup.proto +91 -0
- package/build/protos/google/chat/v1/user.proto +82 -0
- package/build/protos/google/chat/v1/widgets.proto +277 -0
- package/build/protos/protos.d.ts +20339 -0
- package/build/protos/protos.js +52506 -0
- package/build/protos/protos.json +5114 -0
- package/build/src/index.d.ts +11 -0
- package/build/src/index.js +28 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v1/chat_service_client.d.ts +2194 -0
- package/build/src/v1/chat_service_client.js +1763 -0
- package/build/src/v1/chat_service_client.js.map +1 -0
- package/build/src/v1/chat_service_client_config.json +148 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +23 -0
- package/build/src/v1/index.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,38 @@
|
|
|
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/rpc/code.proto";
|
|
20
|
+
|
|
21
|
+
option csharp_namespace = "Google.Chat.V1";
|
|
22
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_outer_classname = "ActionStatusProto";
|
|
25
|
+
option java_package = "com.google.chat.v1";
|
|
26
|
+
option php_namespace = "Google\\Chat\\V1";
|
|
27
|
+
option ruby_package = "Google::Chat::V1";
|
|
28
|
+
|
|
29
|
+
// Represents the status for a request to either invoke or submit a
|
|
30
|
+
// [dialog](https://developers.google.com/chat/how-tos/dialogs).
|
|
31
|
+
message ActionStatus {
|
|
32
|
+
// The status code.
|
|
33
|
+
google.rpc.Code status_code = 1;
|
|
34
|
+
|
|
35
|
+
// The message to send users about the status of their request.
|
|
36
|
+
// If unset, a generic message based on the `status_code` is sent.
|
|
37
|
+
string user_facing_message = 2;
|
|
38
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
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/chat/v1/user.proto";
|
|
20
|
+
|
|
21
|
+
option csharp_namespace = "Google.Chat.V1";
|
|
22
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_outer_classname = "AnnotationProto";
|
|
25
|
+
option java_package = "com.google.chat.v1";
|
|
26
|
+
option php_namespace = "Google\\Chat\\V1";
|
|
27
|
+
option ruby_package = "Google::Chat::V1";
|
|
28
|
+
|
|
29
|
+
// Output only. Annotations associated with the plain-text body of the message.
|
|
30
|
+
// To add basic formatting to a text message, see
|
|
31
|
+
// [Format text
|
|
32
|
+
// messages](https://developers.google.com/chat/format-messages).
|
|
33
|
+
//
|
|
34
|
+
// Example plain-text message body:
|
|
35
|
+
// ```
|
|
36
|
+
// Hello @FooBot how are you!"
|
|
37
|
+
// ```
|
|
38
|
+
//
|
|
39
|
+
// The corresponding annotations metadata:
|
|
40
|
+
// ```
|
|
41
|
+
// "annotations":[{
|
|
42
|
+
// "type":"USER_MENTION",
|
|
43
|
+
// "startIndex":6,
|
|
44
|
+
// "length":7,
|
|
45
|
+
// "userMention": {
|
|
46
|
+
// "user": {
|
|
47
|
+
// "name":"users/{user}",
|
|
48
|
+
// "displayName":"FooBot",
|
|
49
|
+
// "avatarUrl":"https://goo.gl/aeDtrS",
|
|
50
|
+
// "type":"BOT"
|
|
51
|
+
// },
|
|
52
|
+
// "type":"MENTION"
|
|
53
|
+
// }
|
|
54
|
+
// }]
|
|
55
|
+
// ```
|
|
56
|
+
message Annotation {
|
|
57
|
+
// The type of this annotation.
|
|
58
|
+
AnnotationType type = 1;
|
|
59
|
+
|
|
60
|
+
// Start index (0-based, inclusive) in the plain-text message body this
|
|
61
|
+
// annotation corresponds to.
|
|
62
|
+
optional int32 start_index = 2;
|
|
63
|
+
|
|
64
|
+
// Length of the substring in the plain-text message body this annotation
|
|
65
|
+
// corresponds to.
|
|
66
|
+
int32 length = 3;
|
|
67
|
+
|
|
68
|
+
// Additional metadata about the annotation.
|
|
69
|
+
oneof metadata {
|
|
70
|
+
// The metadata of user mention.
|
|
71
|
+
UserMentionMetadata user_mention = 4;
|
|
72
|
+
|
|
73
|
+
// The metadata for a slash command.
|
|
74
|
+
SlashCommandMetadata slash_command = 5;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Annotation metadata for user mentions (@).
|
|
79
|
+
message UserMentionMetadata {
|
|
80
|
+
enum Type {
|
|
81
|
+
// Default value for the enum. Don't use.
|
|
82
|
+
TYPE_UNSPECIFIED = 0;
|
|
83
|
+
|
|
84
|
+
// Add user to space.
|
|
85
|
+
ADD = 1;
|
|
86
|
+
|
|
87
|
+
// Mention user in space.
|
|
88
|
+
MENTION = 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// The user mentioned.
|
|
92
|
+
User user = 1;
|
|
93
|
+
|
|
94
|
+
// The type of user mention.
|
|
95
|
+
Type type = 2;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Annotation metadata for slash commands (/).
|
|
99
|
+
message SlashCommandMetadata {
|
|
100
|
+
enum Type {
|
|
101
|
+
// Default value for the enum. Don't use.
|
|
102
|
+
TYPE_UNSPECIFIED = 0;
|
|
103
|
+
|
|
104
|
+
// Add Chat app to space.
|
|
105
|
+
ADD = 1;
|
|
106
|
+
|
|
107
|
+
// Invoke slash command in space.
|
|
108
|
+
INVOKE = 2;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// The Chat app whose command was invoked.
|
|
112
|
+
User bot = 1;
|
|
113
|
+
|
|
114
|
+
// The type of slash command.
|
|
115
|
+
Type type = 2;
|
|
116
|
+
|
|
117
|
+
// The name of the invoked slash command.
|
|
118
|
+
string command_name = 3;
|
|
119
|
+
|
|
120
|
+
// The command ID of the invoked slash command.
|
|
121
|
+
int64 command_id = 4;
|
|
122
|
+
|
|
123
|
+
// Indicates whether the slash command is for a dialog.
|
|
124
|
+
bool triggers_dialog = 5;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Type of the annotation.
|
|
128
|
+
enum AnnotationType {
|
|
129
|
+
// Default value for the enum. Don't use.
|
|
130
|
+
ANNOTATION_TYPE_UNSPECIFIED = 0;
|
|
131
|
+
|
|
132
|
+
// A user is mentioned.
|
|
133
|
+
USER_MENTION = 1;
|
|
134
|
+
|
|
135
|
+
// A slash command is invoked.
|
|
136
|
+
SLASH_COMMAND = 2;
|
|
137
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
|
|
22
|
+
option csharp_namespace = "Google.Chat.V1";
|
|
23
|
+
option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
|
|
24
|
+
option java_multiple_files = true;
|
|
25
|
+
option java_outer_classname = "AttachmentProto";
|
|
26
|
+
option java_package = "com.google.chat.v1";
|
|
27
|
+
option php_namespace = "Google\\Chat\\V1";
|
|
28
|
+
option ruby_package = "Google::Chat::V1";
|
|
29
|
+
|
|
30
|
+
// An attachment in Google Chat.
|
|
31
|
+
message Attachment {
|
|
32
|
+
option (google.api.resource) = {
|
|
33
|
+
type: "chat.googleapis.com/Attachment"
|
|
34
|
+
pattern: "spaces/{space}/messages/{message}/attachments/{attachment}"
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
enum Source {
|
|
38
|
+
SOURCE_UNSPECIFIED = 0;
|
|
39
|
+
|
|
40
|
+
DRIVE_FILE = 1;
|
|
41
|
+
|
|
42
|
+
UPLOADED_CONTENT = 2;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Resource name of the attachment, in the form
|
|
46
|
+
// `spaces/*/messages/*/attachments/*`.
|
|
47
|
+
string name = 1;
|
|
48
|
+
|
|
49
|
+
// Output only. The original file name for the content, not the full path.
|
|
50
|
+
string content_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
51
|
+
|
|
52
|
+
// Output only. The content type (MIME type) of the file.
|
|
53
|
+
string content_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
54
|
+
|
|
55
|
+
oneof data_ref {
|
|
56
|
+
// A reference to the attachment data. This field is used with the media API
|
|
57
|
+
// to download the attachment data.
|
|
58
|
+
AttachmentDataRef attachment_data_ref = 4;
|
|
59
|
+
|
|
60
|
+
// Output only. A reference to the Google Drive attachment. This field is
|
|
61
|
+
// used with the Google Drive API.
|
|
62
|
+
DriveDataRef drive_data_ref = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Output only. The thumbnail URL which should be used to preview the
|
|
66
|
+
// attachment to a human user. Chat apps shouldn't use this URL to download
|
|
67
|
+
// attachment content.
|
|
68
|
+
string thumbnail_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
69
|
+
|
|
70
|
+
// Output only. The download URL which should be used to allow a human user to
|
|
71
|
+
// download the attachment. Chat apps shouldn't use this URL to download
|
|
72
|
+
// attachment content.
|
|
73
|
+
string download_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
74
|
+
|
|
75
|
+
// Output only. The source of the attachment.
|
|
76
|
+
Source source = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// A reference to the data of a drive attachment.
|
|
80
|
+
message DriveDataRef {
|
|
81
|
+
// The ID for the drive file. Use with the Drive API.
|
|
82
|
+
string drive_file_id = 2;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message AttachmentDataRef {
|
|
86
|
+
// The resource name of the attachment data. This field is used with the media
|
|
87
|
+
// API to download the attachment data.
|
|
88
|
+
string resource_name = 1;
|
|
89
|
+
|
|
90
|
+
// Opaque token containing a reference to an uploaded attachment. Treated by
|
|
91
|
+
// clients as an opaque string and used to create or update Chat messages with
|
|
92
|
+
// attachments.
|
|
93
|
+
string attachment_upload_token = 2;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message GetAttachmentRequest {
|
|
97
|
+
// Required. Resource name of the attachment, in the form
|
|
98
|
+
// `spaces/*/messages/*/attachments/*`.
|
|
99
|
+
string name = 1 [
|
|
100
|
+
(google.api.field_behavior) = REQUIRED,
|
|
101
|
+
(google.api.resource_reference) = { type: "chat.googleapis.com/Attachment" }
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message UploadAttachmentRequest {
|
|
106
|
+
// Required. Resource name of the Chat space in which the attachment is
|
|
107
|
+
// uploaded. Format "spaces/{space}".
|
|
108
|
+
string parent = 1 [
|
|
109
|
+
(google.api.field_behavior) = REQUIRED,
|
|
110
|
+
(google.api.resource_reference) = {
|
|
111
|
+
child_type: "chat.googleapis.com/Message"
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
// Required. The filename of the attachment, including the file extension.
|
|
116
|
+
string filename = 4 [(google.api.field_behavior) = REQUIRED];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message UploadAttachmentResponse {
|
|
120
|
+
// Reference to the uploaded attachment.
|
|
121
|
+
AttachmentDataRef attachment_data_ref = 1;
|
|
122
|
+
}
|