@maxim_mazurok/gapi.client.securitycenter-v1beta2 0.0.20220809
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/index.d.ts +3554 -0
- package/package.json +20 -0
- package/readme.md +283 -0
- package/tests.ts +546 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.securitycenter-v1beta2",
|
|
3
|
+
"version": "0.0.20220809",
|
|
4
|
+
"description": "TypeScript typings for Security Command Center API v1beta2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# TypeScript typings for Security Command Center API v1beta2
|
|
2
|
+
|
|
3
|
+
Security Command Center API provides access to temporal views of assets and findings within an organization.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/security-command-center).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Security Command Center API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.securitycenter-v1beta2 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://securitycenter.googleapis.com/$discovery/rest?version=v1beta2', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.securitycenter
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('securitycenter', 'v1beta2', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.securitycenter
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
50
|
+
],
|
|
51
|
+
immediate = true;
|
|
52
|
+
// ...
|
|
53
|
+
|
|
54
|
+
gapi.auth.authorize(
|
|
55
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
56
|
+
authResult => {
|
|
57
|
+
if (authResult && !authResult.error) {
|
|
58
|
+
/* handle successful authorization */
|
|
59
|
+
} else {
|
|
60
|
+
/* handle authorization error */
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After that you can use Security Command Center API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
Get the ContainerThreatDetectionSettings resource.
|
|
71
|
+
*/
|
|
72
|
+
await gapi.client.securitycenter.folders.getContainerThreatDetectionSettings({ name: "name", });
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
Get the EventThreatDetectionSettings resource.
|
|
76
|
+
*/
|
|
77
|
+
await gapi.client.securitycenter.folders.getEventThreatDetectionSettings({ name: "name", });
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
Retrieve the OnboardingState of a resource.
|
|
81
|
+
*/
|
|
82
|
+
await gapi.client.securitycenter.folders.getOnboardingState({ name: "name", });
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
Get the RapidVulnerabilityDetectionSettings resource.
|
|
86
|
+
*/
|
|
87
|
+
await gapi.client.securitycenter.folders.getRapidVulnerabilityDetectionSettings({ name: "name", });
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
Get the SecurityCenterSettings resource.
|
|
91
|
+
*/
|
|
92
|
+
await gapi.client.securitycenter.folders.getSecurityCenterSettings({ name: "name", });
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
Get the SecurityHealthAnalyticsSettings resource.
|
|
96
|
+
*/
|
|
97
|
+
await gapi.client.securitycenter.folders.getSecurityHealthAnalyticsSettings({ name: "name", });
|
|
98
|
+
|
|
99
|
+
/*
|
|
100
|
+
Get the VirtualMachineThreatDetectionSettings resource.
|
|
101
|
+
*/
|
|
102
|
+
await gapi.client.securitycenter.folders.getVirtualMachineThreatDetectionSettings({ name: "name", });
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
Get the WebSecurityScannerSettings resource.
|
|
106
|
+
*/
|
|
107
|
+
await gapi.client.securitycenter.folders.getWebSecurityScannerSettings({ name: "name", });
|
|
108
|
+
|
|
109
|
+
/*
|
|
110
|
+
Update the ContainerThreatDetectionSettings resource.
|
|
111
|
+
*/
|
|
112
|
+
await gapi.client.securitycenter.folders.updateContainerThreatDetectionSettings({ name: "name", });
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
Update the EventThreatDetectionSettings resource.
|
|
116
|
+
*/
|
|
117
|
+
await gapi.client.securitycenter.folders.updateEventThreatDetectionSettings({ name: "name", });
|
|
118
|
+
|
|
119
|
+
/*
|
|
120
|
+
Update the RapidVulnerabilityDetectionSettings resource.
|
|
121
|
+
*/
|
|
122
|
+
await gapi.client.securitycenter.folders.updateRapidVulnerabilityDetectionSettings({ name: "name", });
|
|
123
|
+
|
|
124
|
+
/*
|
|
125
|
+
Update the SecurityHealthAnalyticsSettings resource.
|
|
126
|
+
*/
|
|
127
|
+
await gapi.client.securitycenter.folders.updateSecurityHealthAnalyticsSettings({ name: "name", });
|
|
128
|
+
|
|
129
|
+
/*
|
|
130
|
+
Update the VirtualMachineThreatDetectionSettings resource.
|
|
131
|
+
*/
|
|
132
|
+
await gapi.client.securitycenter.folders.updateVirtualMachineThreatDetectionSettings({ name: "name", });
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
Update the WebSecurityScannerSettings resource.
|
|
136
|
+
*/
|
|
137
|
+
await gapi.client.securitycenter.folders.updateWebSecurityScannerSettings({ name: "name", });
|
|
138
|
+
|
|
139
|
+
/*
|
|
140
|
+
Get the ContainerThreatDetectionSettings resource.
|
|
141
|
+
*/
|
|
142
|
+
await gapi.client.securitycenter.organizations.getContainerThreatDetectionSettings({ name: "name", });
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
Get the EventThreatDetectionSettings resource.
|
|
146
|
+
*/
|
|
147
|
+
await gapi.client.securitycenter.organizations.getEventThreatDetectionSettings({ name: "name", });
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
Retrieve the OnboardingState of a resource.
|
|
151
|
+
*/
|
|
152
|
+
await gapi.client.securitycenter.organizations.getOnboardingState({ name: "name", });
|
|
153
|
+
|
|
154
|
+
/*
|
|
155
|
+
Get the RapidVulnerabilityDetectionSettings resource.
|
|
156
|
+
*/
|
|
157
|
+
await gapi.client.securitycenter.organizations.getRapidVulnerabilityDetectionSettings({ name: "name", });
|
|
158
|
+
|
|
159
|
+
/*
|
|
160
|
+
Get the SecurityCenterSettings resource.
|
|
161
|
+
*/
|
|
162
|
+
await gapi.client.securitycenter.organizations.getSecurityCenterSettings({ name: "name", });
|
|
163
|
+
|
|
164
|
+
/*
|
|
165
|
+
Get the SecurityHealthAnalyticsSettings resource.
|
|
166
|
+
*/
|
|
167
|
+
await gapi.client.securitycenter.organizations.getSecurityHealthAnalyticsSettings({ name: "name", });
|
|
168
|
+
|
|
169
|
+
/*
|
|
170
|
+
Get the Subscription resource.
|
|
171
|
+
*/
|
|
172
|
+
await gapi.client.securitycenter.organizations.getSubscription({ name: "name", });
|
|
173
|
+
|
|
174
|
+
/*
|
|
175
|
+
Get the VirtualMachineThreatDetectionSettings resource.
|
|
176
|
+
*/
|
|
177
|
+
await gapi.client.securitycenter.organizations.getVirtualMachineThreatDetectionSettings({ name: "name", });
|
|
178
|
+
|
|
179
|
+
/*
|
|
180
|
+
Get the WebSecurityScannerSettings resource.
|
|
181
|
+
*/
|
|
182
|
+
await gapi.client.securitycenter.organizations.getWebSecurityScannerSettings({ name: "name", });
|
|
183
|
+
|
|
184
|
+
/*
|
|
185
|
+
Update the ContainerThreatDetectionSettings resource.
|
|
186
|
+
*/
|
|
187
|
+
await gapi.client.securitycenter.organizations.updateContainerThreatDetectionSettings({ name: "name", });
|
|
188
|
+
|
|
189
|
+
/*
|
|
190
|
+
Update the EventThreatDetectionSettings resource.
|
|
191
|
+
*/
|
|
192
|
+
await gapi.client.securitycenter.organizations.updateEventThreatDetectionSettings({ name: "name", });
|
|
193
|
+
|
|
194
|
+
/*
|
|
195
|
+
Update the RapidVulnerabilityDetectionSettings resource.
|
|
196
|
+
*/
|
|
197
|
+
await gapi.client.securitycenter.organizations.updateRapidVulnerabilityDetectionSettings({ name: "name", });
|
|
198
|
+
|
|
199
|
+
/*
|
|
200
|
+
Update the SecurityHealthAnalyticsSettings resource.
|
|
201
|
+
*/
|
|
202
|
+
await gapi.client.securitycenter.organizations.updateSecurityHealthAnalyticsSettings({ name: "name", });
|
|
203
|
+
|
|
204
|
+
/*
|
|
205
|
+
Update the VirtualMachineThreatDetectionSettings resource.
|
|
206
|
+
*/
|
|
207
|
+
await gapi.client.securitycenter.organizations.updateVirtualMachineThreatDetectionSettings({ name: "name", });
|
|
208
|
+
|
|
209
|
+
/*
|
|
210
|
+
Update the WebSecurityScannerSettings resource.
|
|
211
|
+
*/
|
|
212
|
+
await gapi.client.securitycenter.organizations.updateWebSecurityScannerSettings({ name: "name", });
|
|
213
|
+
|
|
214
|
+
/*
|
|
215
|
+
Get the ContainerThreatDetectionSettings resource.
|
|
216
|
+
*/
|
|
217
|
+
await gapi.client.securitycenter.projects.getContainerThreatDetectionSettings({ name: "name", });
|
|
218
|
+
|
|
219
|
+
/*
|
|
220
|
+
Get the EventThreatDetectionSettings resource.
|
|
221
|
+
*/
|
|
222
|
+
await gapi.client.securitycenter.projects.getEventThreatDetectionSettings({ name: "name", });
|
|
223
|
+
|
|
224
|
+
/*
|
|
225
|
+
Retrieve the OnboardingState of a resource.
|
|
226
|
+
*/
|
|
227
|
+
await gapi.client.securitycenter.projects.getOnboardingState({ name: "name", });
|
|
228
|
+
|
|
229
|
+
/*
|
|
230
|
+
Get the RapidVulnerabilityDetectionSettings resource.
|
|
231
|
+
*/
|
|
232
|
+
await gapi.client.securitycenter.projects.getRapidVulnerabilityDetectionSettings({ name: "name", });
|
|
233
|
+
|
|
234
|
+
/*
|
|
235
|
+
Get the SecurityCenterSettings resource.
|
|
236
|
+
*/
|
|
237
|
+
await gapi.client.securitycenter.projects.getSecurityCenterSettings({ name: "name", });
|
|
238
|
+
|
|
239
|
+
/*
|
|
240
|
+
Get the SecurityHealthAnalyticsSettings resource.
|
|
241
|
+
*/
|
|
242
|
+
await gapi.client.securitycenter.projects.getSecurityHealthAnalyticsSettings({ name: "name", });
|
|
243
|
+
|
|
244
|
+
/*
|
|
245
|
+
Get the VirtualMachineThreatDetectionSettings resource.
|
|
246
|
+
*/
|
|
247
|
+
await gapi.client.securitycenter.projects.getVirtualMachineThreatDetectionSettings({ name: "name", });
|
|
248
|
+
|
|
249
|
+
/*
|
|
250
|
+
Get the WebSecurityScannerSettings resource.
|
|
251
|
+
*/
|
|
252
|
+
await gapi.client.securitycenter.projects.getWebSecurityScannerSettings({ name: "name", });
|
|
253
|
+
|
|
254
|
+
/*
|
|
255
|
+
Update the ContainerThreatDetectionSettings resource.
|
|
256
|
+
*/
|
|
257
|
+
await gapi.client.securitycenter.projects.updateContainerThreatDetectionSettings({ name: "name", });
|
|
258
|
+
|
|
259
|
+
/*
|
|
260
|
+
Update the EventThreatDetectionSettings resource.
|
|
261
|
+
*/
|
|
262
|
+
await gapi.client.securitycenter.projects.updateEventThreatDetectionSettings({ name: "name", });
|
|
263
|
+
|
|
264
|
+
/*
|
|
265
|
+
Update the RapidVulnerabilityDetectionSettings resource.
|
|
266
|
+
*/
|
|
267
|
+
await gapi.client.securitycenter.projects.updateRapidVulnerabilityDetectionSettings({ name: "name", });
|
|
268
|
+
|
|
269
|
+
/*
|
|
270
|
+
Update the SecurityHealthAnalyticsSettings resource.
|
|
271
|
+
*/
|
|
272
|
+
await gapi.client.securitycenter.projects.updateSecurityHealthAnalyticsSettings({ name: "name", });
|
|
273
|
+
|
|
274
|
+
/*
|
|
275
|
+
Update the VirtualMachineThreatDetectionSettings resource.
|
|
276
|
+
*/
|
|
277
|
+
await gapi.client.securitycenter.projects.updateVirtualMachineThreatDetectionSettings({ name: "name", });
|
|
278
|
+
|
|
279
|
+
/*
|
|
280
|
+
Update the WebSecurityScannerSettings resource.
|
|
281
|
+
*/
|
|
282
|
+
await gapi.client.securitycenter.projects.updateWebSecurityScannerSettings({ name: "name", });
|
|
283
|
+
```
|