@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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +202 -0
  3. package/README.md +220 -0
  4. package/build/protos/google/apps/card/v1/card.proto +1918 -0
  5. package/build/protos/google/chat/v1/action_status.proto +38 -0
  6. package/build/protos/google/chat/v1/annotation.proto +137 -0
  7. package/build/protos/google/chat/v1/attachment.proto +122 -0
  8. package/build/protos/google/chat/v1/chat_service.proto +493 -0
  9. package/build/protos/google/chat/v1/contextual_addon.proto +106 -0
  10. package/build/protos/google/chat/v1/deletion_metadata.proto +56 -0
  11. package/build/protos/google/chat/v1/group.proto +37 -0
  12. package/build/protos/google/chat/v1/history_state.proto +41 -0
  13. package/build/protos/google/chat/v1/matched_url.proto +35 -0
  14. package/build/protos/google/chat/v1/membership.proto +292 -0
  15. package/build/protos/google/chat/v1/message.proto +645 -0
  16. package/build/protos/google/chat/v1/reaction.proto +183 -0
  17. package/build/protos/google/chat/v1/slash_command.proto +32 -0
  18. package/build/protos/google/chat/v1/space.proto +360 -0
  19. package/build/protos/google/chat/v1/space_setup.proto +91 -0
  20. package/build/protos/google/chat/v1/user.proto +82 -0
  21. package/build/protos/google/chat/v1/widgets.proto +277 -0
  22. package/build/protos/protos.d.ts +20339 -0
  23. package/build/protos/protos.js +52506 -0
  24. package/build/protos/protos.json +5114 -0
  25. package/build/src/index.d.ts +11 -0
  26. package/build/src/index.js +28 -0
  27. package/build/src/index.js.map +1 -0
  28. package/build/src/v1/chat_service_client.d.ts +2194 -0
  29. package/build/src/v1/chat_service_client.js +1763 -0
  30. package/build/src/v1/chat_service_client.js.map +1 -0
  31. package/build/src/v1/chat_service_client_config.json +148 -0
  32. package/build/src/v1/index.d.ts +1 -0
  33. package/build/src/v1/index.js +23 -0
  34. package/build/src/v1/index.js.map +1 -0
  35. package/package.json +70 -0
@@ -0,0 +1,82 @@
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 = "UserProto";
26
+ option java_package = "com.google.chat.v1";
27
+ option php_namespace = "Google\\Chat\\V1";
28
+ option ruby_package = "Google::Chat::V1";
29
+
30
+ // A user in Google Chat.
31
+ // When returned as an output from a request, if your Chat app [authenticates as
32
+ // a user](https://developers.google.com/chat/api/guides/auth/users), the output
33
+ // for a `User` resource only populates the user's `name` and `type`.
34
+ message User {
35
+ enum Type {
36
+ // Default value for the enum. DO NOT USE.
37
+ TYPE_UNSPECIFIED = 0;
38
+
39
+ // Human user.
40
+ HUMAN = 1;
41
+
42
+ // Chat app user.
43
+ BOT = 2;
44
+ }
45
+
46
+ // Resource name for a Google Chat [user][google.chat.v1.User].
47
+ //
48
+ // Format: `users/{user}`. `users/app` can be used as an alias for the calling
49
+ // app [bot][google.chat.v1.User.Type.BOT] user.
50
+ //
51
+ // For [human users][google.chat.v1.User.Type.HUMAN], `{user}` is the same
52
+ // user identifier as:
53
+ //
54
+ // - the `id` for the
55
+ // [Person](https://developers.google.com/people/api/rest/v1/people) in the
56
+ // People API. For example, `users/123456789` in Chat API represents the same
57
+ // person as the `123456789` Person profile ID in People API.
58
+ //
59
+ // - the `id` for a
60
+ // [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
61
+ // in the Admin SDK Directory API.
62
+ //
63
+ // - the user's email address can be used as an alias for `{user}` in API
64
+ // requests. For example, if the People API Person profile ID for
65
+ // `user@example.com` is `123456789`, you can use `users/user@example.com` as
66
+ // an alias to reference `users/123456789`. Only the canonical resource name
67
+ // (for example `users/123456789`) will be returned from the API.
68
+ string name = 1;
69
+
70
+ // Output only. The user's display name.
71
+ string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
72
+
73
+ // Unique identifier of the user's Google Workspace domain.
74
+ string domain_id = 6;
75
+
76
+ // User type.
77
+ Type type = 5;
78
+
79
+ // Output only. When `true`, the user is deleted or their profile is not
80
+ // visible.
81
+ bool is_anonymous = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
82
+ }
@@ -0,0 +1,277 @@
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
+ option csharp_namespace = "Google.Chat.V1";
20
+ option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "WidgetsProto";
23
+ option java_package = "com.google.chat.v1";
24
+ option php_namespace = "Google\\Chat\\V1";
25
+ option ruby_package = "Google::Chat::V1";
26
+
27
+ // A widget is a UI element that presents text and images.
28
+ message WidgetMarkup {
29
+ // A paragraph of text. Formatted text supported. For more information
30
+ // about formatting text, see
31
+ // [Formatting text in Google Chat
32
+ // apps](https://developers.google.com/chat/format-messages#card-formatting)
33
+ // and
34
+ // [Formatting
35
+ // text in Google Workspace
36
+ // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
37
+ message TextParagraph {
38
+ string text = 1;
39
+ }
40
+
41
+ // The set of supported icons.
42
+ enum Icon {
43
+ ICON_UNSPECIFIED = 0;
44
+
45
+ AIRPLANE = 1;
46
+
47
+ BOOKMARK = 26;
48
+
49
+ BUS = 25;
50
+
51
+ CAR = 9;
52
+
53
+ CLOCK = 2;
54
+
55
+ CONFIRMATION_NUMBER_ICON = 12;
56
+
57
+ DOLLAR = 14;
58
+
59
+ DESCRIPTION = 27;
60
+
61
+ EMAIL = 10;
62
+
63
+ EVENT_PERFORMER = 20;
64
+
65
+ EVENT_SEAT = 21;
66
+
67
+ FLIGHT_ARRIVAL = 16;
68
+
69
+ FLIGHT_DEPARTURE = 15;
70
+
71
+ HOTEL = 6;
72
+
73
+ HOTEL_ROOM_TYPE = 17;
74
+
75
+ INVITE = 19;
76
+
77
+ MAP_PIN = 3;
78
+
79
+ MEMBERSHIP = 24;
80
+
81
+ MULTIPLE_PEOPLE = 18;
82
+
83
+ OFFER = 30;
84
+
85
+ PERSON = 11;
86
+
87
+ PHONE = 13;
88
+
89
+ RESTAURANT_ICON = 7;
90
+
91
+ SHOPPING_CART = 8;
92
+
93
+ STAR = 5;
94
+
95
+ STORE = 22;
96
+
97
+ TICKET = 4;
98
+
99
+ TRAIN = 23;
100
+
101
+ VIDEO_CAMERA = 28;
102
+
103
+ VIDEO_PLAY = 29;
104
+ }
105
+
106
+ // A button. Can be a text button or an image button.
107
+ message Button {
108
+ oneof type {
109
+ // A button with text and `onclick` action.
110
+ TextButton text_button = 1;
111
+
112
+ // A button with image and `onclick` action.
113
+ ImageButton image_button = 2;
114
+ }
115
+ }
116
+
117
+ // A button with text and `onclick` action.
118
+ message TextButton {
119
+ // The text of the button.
120
+ string text = 1;
121
+
122
+ // The `onclick` action of the button.
123
+ OnClick on_click = 2;
124
+ }
125
+
126
+ // A UI element contains a key (label) and a value (content). This
127
+ // element can also contain some actions such as `onclick` button.
128
+ message KeyValue {
129
+ // At least one of icons, `top_label` and `bottom_label` must be defined.
130
+ oneof icons {
131
+ // An enum value that's replaced by the Chat API with the
132
+ // corresponding icon image.
133
+ Icon icon = 1;
134
+
135
+ // The icon specified by a URL.
136
+ string icon_url = 2;
137
+ }
138
+
139
+ // The text of the top label. Formatted text supported. For more information
140
+ // about formatting text, see
141
+ // [Formatting text in Google Chat
142
+ // apps](https://developers.google.com/chat/format-messages#card-formatting)
143
+ // and
144
+ // [Formatting
145
+ // text in Google Workspace
146
+ // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
147
+ string top_label = 3;
148
+
149
+ // The text of the content. Formatted text supported and always required.
150
+ // For more information
151
+ // about formatting text, see
152
+ // [Formatting text in Google Chat
153
+ // apps](https://developers.google.com/chat/format-messages#card-formatting)
154
+ // and
155
+ // [Formatting
156
+ // text in Google Workspace
157
+ // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
158
+ string content = 4;
159
+
160
+ // If the content should be multiline.
161
+ bool content_multiline = 9;
162
+
163
+ // The text of the bottom label. Formatted text supported. For more
164
+ // information about formatting text, see [Formatting text in Google Chat
165
+ // apps](https://developers.google.com/chat/format-messages#card-formatting)
166
+ // and
167
+ // [Formatting
168
+ // text in Google Workspace
169
+ // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
170
+ string bottom_label = 5;
171
+
172
+ // The `onclick` action. Only the top label, bottom label, and content
173
+ // region are clickable.
174
+ OnClick on_click = 6;
175
+
176
+ // A control widget. You can set either `button` or `switch_widget`,
177
+ // but not both.
178
+ oneof control {
179
+ // A button that can be clicked to trigger an action.
180
+ Button button = 7;
181
+ }
182
+ }
183
+
184
+ // An image that's specified by a URL and can have an `onclick` action.
185
+ message Image {
186
+ // The URL of the image.
187
+ string image_url = 1;
188
+
189
+ // The `onclick` action.
190
+ OnClick on_click = 2;
191
+
192
+ // The aspect ratio of this image (width and height). This field lets you
193
+ // reserve the right height for the image while waiting for it to load.
194
+ // It's not meant to override the built-in aspect ratio of the image.
195
+ // If unset, the server fills it by prefetching the image.
196
+ double aspect_ratio = 3;
197
+ }
198
+
199
+ // An image button with an `onclick` action.
200
+ message ImageButton {
201
+ // The icon can be specified by an `Icon` `enum` or a URL.
202
+ oneof icons {
203
+ // The icon specified by an `enum` that indices to an icon provided by
204
+ // Chat API.
205
+ Icon icon = 1;
206
+
207
+ // The icon specified by a URL.
208
+ string icon_url = 3;
209
+ }
210
+
211
+ // The `onclick` action.
212
+ OnClick on_click = 2;
213
+
214
+ // The name of this `image_button` that's used for accessibility.
215
+ // Default value is provided if this name isn't specified.
216
+ string name = 4;
217
+ }
218
+
219
+ // An `onclick` action (for example, open a link).
220
+ message OnClick {
221
+ oneof data {
222
+ // A form action is triggered by this `onclick` action if specified.
223
+ FormAction action = 1;
224
+
225
+ // This `onclick` action triggers an open link action if specified.
226
+ OpenLink open_link = 2;
227
+ }
228
+ }
229
+
230
+ // A link that opens a new window.
231
+ message OpenLink {
232
+ // The URL to open.
233
+ string url = 1;
234
+ }
235
+
236
+ // A form action describes the behavior when the form is submitted.
237
+ // For example, you can invoke Apps Script to handle the form.
238
+ message FormAction {
239
+ // List of string parameters to supply when the action method is invoked.
240
+ // For example, consider three snooze buttons: snooze now, snooze one day,
241
+ // snooze next week. You might use `action method = snooze()`, passing the
242
+ // snooze type and snooze time in the list of string parameters.
243
+ message ActionParameter {
244
+ // The name of the parameter for the action script.
245
+ string key = 1;
246
+
247
+ // The value of the parameter.
248
+ string value = 2;
249
+ }
250
+
251
+ // The method name is used to identify which part of the form triggered the
252
+ // form submission. This information is echoed back to the Chat app as part
253
+ // of the card click event. You can use the same method name for several
254
+ // elements that trigger a common behavior.
255
+ string action_method_name = 1;
256
+
257
+ // List of action parameters.
258
+ repeated ActionParameter parameters = 2;
259
+ }
260
+
261
+ // A `WidgetMarkup` can only have one of the following items. You can use
262
+ // multiple `WidgetMarkup` fields to display more items.
263
+ oneof data {
264
+ // Display a text paragraph in this widget.
265
+ TextParagraph text_paragraph = 1;
266
+
267
+ // Display an image in this widget.
268
+ Image image = 2;
269
+
270
+ // Display a key value item in this widget.
271
+ KeyValue key_value = 3;
272
+ }
273
+
274
+ // A list of buttons. Buttons is also `oneof data` and only one of these
275
+ // fields should be set.
276
+ repeated Button buttons = 6;
277
+ }