@google-apps/chat 0.19.0 → 0.20.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/README.md +60 -145
- package/build/protos/google/apps/card/v1/card.proto +585 -146
- package/build/protos/protos.d.ts +1247 -746
- package/build/protos/protos.js +4343 -3141
- package/build/protos/protos.json +319 -211
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
|
|
2
|
-
[//]: # "
|
|
2
|
+
[//]: # "The comments you see below are used to generate those parts of the template in later states."
|
|
3
3
|
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
|
|
4
4
|
|
|
5
|
-
# [Google Chat API:
|
|
6
|
-
|
|
7
|
-
[](https://cloud.google.com/terms/launch-stages)
|
|
8
|
-
[](https://www.npmjs.org/package/@google-apps/chat)
|
|
9
|
-
|
|
5
|
+
# [Google Chat API: Nodejs Client][homepage]
|
|
10
6
|
|
|
7
|
+
This library is considered to be in **preview**. This means it is still a
|
|
8
|
+
work-in-progress and under active development. Any release is subject to
|
|
9
|
+
backwards-incompatible changes at any time.
|
|
11
10
|
|
|
11
|
+
[](https://www.npmjs.org/package/@google-apps/chat)
|
|
12
12
|
|
|
13
13
|
Google Chat API client for Node.js
|
|
14
14
|
|
|
15
|
+
[//]: # "partials.introduction"
|
|
15
16
|
|
|
16
17
|
A comprehensive list of changes in each version may be found in
|
|
17
|
-
[the CHANGELOG]
|
|
18
|
+
[the CHANGELOG][homepage_changelog].
|
|
18
19
|
|
|
19
|
-
* [Google Chat API
|
|
20
|
-
* [Google Chat API Documentation]
|
|
21
|
-
* [github.com/googleapis/google-cloud-node/packages/google-chat](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-chat)
|
|
20
|
+
* [Google Chat API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/chat/latest)
|
|
21
|
+
* [Google Chat API Documentation](https://developers.google.com/chat/concepts)
|
|
22
22
|
|
|
23
23
|
Read more about the client libraries for Cloud APIs, including the older
|
|
24
24
|
Google APIs Client Libraries, in [Client Libraries Explained][explained].
|
|
@@ -27,18 +27,15 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
|
|
|
27
27
|
|
|
28
28
|
**Table of contents:**
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
* [Quickstart](#quickstart)
|
|
32
31
|
* [Before you begin](#before-you-begin)
|
|
33
32
|
* [Installing the client library](#installing-the-client-library)
|
|
34
|
-
|
|
35
|
-
* [Samples](#samples)
|
|
33
|
+
|
|
36
34
|
* [Versioning](#versioning)
|
|
37
35
|
* [Contributing](#contributing)
|
|
38
36
|
* [License](#license)
|
|
39
37
|
|
|
40
38
|
## Quickstart
|
|
41
|
-
|
|
42
39
|
### Before you begin
|
|
43
40
|
|
|
44
41
|
1. [Select or create a Cloud Platform project][projects].
|
|
@@ -46,127 +43,57 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
|
|
|
46
43
|
1. [Enable the Google Chat API API][enable_api].
|
|
47
44
|
1. [Set up authentication][auth] so you can access the
|
|
48
45
|
API from your local workstation.
|
|
49
|
-
|
|
50
46
|
### Installing the client library
|
|
51
47
|
|
|
52
48
|
```bash
|
|
53
49
|
npm install @google-apps/chat
|
|
54
50
|
```
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
### Using the client library
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
/**
|
|
61
|
-
* This snippet has been automatically generated and should be regarded as a code template only.
|
|
62
|
-
* It will require modifications to work.
|
|
63
|
-
* It may require correct/in-range values for request initialization.
|
|
64
|
-
* TODO(developer): Uncomment these variables before running the sample.
|
|
65
|
-
*/
|
|
66
|
-
/**
|
|
67
|
-
* Optional. The maximum number of spaces to return. The service might return
|
|
68
|
-
* fewer than this value.
|
|
69
|
-
* If unspecified, at most 100 spaces are returned.
|
|
70
|
-
* The maximum value is 1,000. If you use a value more than 1,000, it's
|
|
71
|
-
* automatically changed to 1,000.
|
|
72
|
-
* Negative values return an `INVALID_ARGUMENT` error.
|
|
73
|
-
*/
|
|
74
|
-
// const pageSize = 1234
|
|
75
|
-
/**
|
|
76
|
-
* Optional. A page token, received from a previous list spaces call.
|
|
77
|
-
* Provide this parameter to retrieve the subsequent page.
|
|
78
|
-
* When paginating, the filter value should match the call that provided the
|
|
79
|
-
* page token. Passing a different value may lead to unexpected results.
|
|
80
|
-
*/
|
|
81
|
-
// const pageToken = 'abc123'
|
|
82
|
-
/**
|
|
83
|
-
* Optional. A query filter.
|
|
84
|
-
* You can filter spaces by the space type
|
|
85
|
-
* (`space_type` (https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)).
|
|
86
|
-
* To filter by space type, you must specify valid enum value, such as
|
|
87
|
-
* `SPACE` or `GROUP_CHAT` (the `space_type` can't be
|
|
88
|
-
* `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
|
|
89
|
-
* operator.
|
|
90
|
-
* For example, the following queries are valid:
|
|
91
|
-
* ```
|
|
92
|
-
* space_type = "SPACE"
|
|
93
|
-
* spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"
|
|
94
|
-
* ```
|
|
95
|
-
* Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
|
|
96
|
-
* error.
|
|
97
|
-
*/
|
|
98
|
-
// const filter = 'abc123'
|
|
99
|
-
|
|
100
|
-
// Imports the Chat library
|
|
101
|
-
const {ChatServiceClient} = require('@google-apps/chat').v1;
|
|
102
|
-
|
|
103
|
-
// Instantiates a client
|
|
104
|
-
const chatClient = new ChatServiceClient();
|
|
105
|
-
|
|
106
|
-
async function callListSpaces() {
|
|
107
|
-
// Construct request
|
|
108
|
-
const request = {};
|
|
109
|
-
|
|
110
|
-
// Run request
|
|
111
|
-
const iterable = chatClient.listSpacesAsync(request);
|
|
112
|
-
for await (const response of iterable) {
|
|
113
|
-
console.log(response);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
callListSpaces();
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
|
|
52
|
+
[//]: # "partials.body"
|
|
122
53
|
|
|
123
54
|
## Samples
|
|
124
55
|
|
|
125
|
-
Samples are in the [`samples/`]
|
|
126
|
-
|
|
127
|
-
| Sample | Source Code |
|
|
128
|
-
| --------------------------- | --------------------------------- |
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
The [Google Chat API Node.js Client API Reference][client-docs] documentation
|
|
169
|
-
also contains samples.
|
|
56
|
+
Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample.
|
|
57
|
+
|
|
58
|
+
| Sample | Source Code |
|
|
59
|
+
| --------------------------- | --------------------------------- |
|
|
60
|
+
| complete import space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.complete_import_space.js) |
|
|
61
|
+
| create custom emoji | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.create_custom_emoji.js) |
|
|
62
|
+
| create membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.create_membership.js) |
|
|
63
|
+
| create message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.create_message.js) |
|
|
64
|
+
| create reaction | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.create_reaction.js) |
|
|
65
|
+
| create space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.create_space.js) |
|
|
66
|
+
| delete custom emoji | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.delete_custom_emoji.js) |
|
|
67
|
+
| delete membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js) |
|
|
68
|
+
| delete message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.delete_message.js) |
|
|
69
|
+
| delete reaction | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.delete_reaction.js) |
|
|
70
|
+
| delete space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.delete_space.js) |
|
|
71
|
+
| find direct message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.find_direct_message.js) |
|
|
72
|
+
| get attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_attachment.js) |
|
|
73
|
+
| get custom emoji | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_custom_emoji.js) |
|
|
74
|
+
| get membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_membership.js) |
|
|
75
|
+
| get message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_message.js) |
|
|
76
|
+
| get space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space.js) |
|
|
77
|
+
| get space event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_event.js) |
|
|
78
|
+
| get space notification setting | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js) |
|
|
79
|
+
| 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) |
|
|
80
|
+
| 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) |
|
|
81
|
+
| list custom emojis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_custom_emojis.js) |
|
|
82
|
+
| list memberships | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js) |
|
|
83
|
+
| list messages | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_messages.js) |
|
|
84
|
+
| list reactions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_reactions.js) |
|
|
85
|
+
| list space events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js) |
|
|
86
|
+
| list spaces | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_spaces.js) |
|
|
87
|
+
| search spaces | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.search_spaces.js) |
|
|
88
|
+
| set up space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.set_up_space.js) |
|
|
89
|
+
| update membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_membership.js) |
|
|
90
|
+
| update message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_message.js) |
|
|
91
|
+
| update space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space.js) |
|
|
92
|
+
| update space notification setting | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js) |
|
|
93
|
+
| 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) |
|
|
94
|
+
| upload attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js) |
|
|
95
|
+
| chat | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json) |
|
|
96
|
+
|
|
170
97
|
|
|
171
98
|
## Supported Node.js Versions
|
|
172
99
|
|
|
@@ -193,41 +120,29 @@ for versions compatible with Node.js 8.
|
|
|
193
120
|
|
|
194
121
|
This library follows [Semantic Versioning](http://semver.org/).
|
|
195
122
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
This library is considered to be in **preview**. This means it is still a
|
|
203
|
-
work-in-progress and under active development. Any release is subject to
|
|
204
|
-
backwards-incompatible changes at any time.
|
|
205
|
-
|
|
206
|
-
|
|
207
123
|
More Information: [Google Cloud Platform Launch Stages][launch_stages]
|
|
208
124
|
|
|
209
125
|
[launch_stages]: https://cloud.google.com/terms/launch-stages
|
|
210
126
|
|
|
211
127
|
## Contributing
|
|
212
128
|
|
|
213
|
-
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md).
|
|
129
|
+
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/CONTRIBUTING.md).
|
|
214
130
|
|
|
215
|
-
Please note that this `README.md
|
|
131
|
+
Please note that this `README.md`
|
|
216
132
|
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
|
|
217
|
-
are generated from a central template.
|
|
218
|
-
to its templates in
|
|
219
|
-
[directory](https://github.com/googleapis/synthtool).
|
|
133
|
+
are generated from a central template.
|
|
220
134
|
|
|
221
135
|
## License
|
|
222
136
|
|
|
223
137
|
Apache Version 2.0
|
|
224
138
|
|
|
225
|
-
See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
|
|
139
|
+
See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/LICENSE)
|
|
226
140
|
|
|
227
|
-
[client-docs]: https://cloud.google.com/nodejs/docs/reference/chat/latest
|
|
228
|
-
[product-docs]: https://developers.google.com/chat/concepts
|
|
229
141
|
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
|
|
230
142
|
[projects]: https://console.cloud.google.com/project
|
|
231
143
|
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
|
|
232
144
|
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=chat.googleapis.com
|
|
233
145
|
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
|
|
146
|
+
[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples
|
|
147
|
+
[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/CHANGELOG.md
|
|
148
|
+
[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat
|