@maxim_mazurok/gapi.client.ondemandscanning-v1 0.0.20231113 → 0.0.20231204
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 +1084 -1697
- package/package.json +6 -6
- package/readme.md +17 -12
- package/tests.ts +0 -151
- package/tsconfig.json +0 -18
- package/tslint.json +0 -6
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxim_mazurok/gapi.client.ondemandscanning-v1",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231204",
|
|
4
4
|
"description": "TypeScript typings for On-Demand Scanning API v1",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
8
|
+
},
|
|
5
9
|
"license": "MIT",
|
|
6
10
|
"author": {
|
|
7
|
-
"email": "maxim@mazurok.com",
|
|
8
11
|
"name": "Maxim Mazurok",
|
|
12
|
+
"email": "maxim@mazurok.com",
|
|
9
13
|
"url": "https://maxim.mazurok.com"
|
|
10
14
|
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
-
},
|
|
15
15
|
"types": "index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/gapi.client": "*",
|
package/readme.md
CHANGED
|
@@ -25,10 +25,13 @@ gapi.load('client', () => {
|
|
|
25
25
|
Then load api client wrapper:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
gapi.client.load(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
gapi.client.load(
|
|
29
|
+
'https://ondemandscanning.googleapis.com/$discovery/rest?version=v1',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.ondemandscanning
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,24 +48,26 @@ Don't forget to authenticate your client before sending any request to resources
|
|
|
45
48
|
// declare client_id registered in Google Developers Console
|
|
46
49
|
var client_id = '',
|
|
47
50
|
scope = [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
52
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
52
55
|
// ...
|
|
53
56
|
|
|
54
57
|
gapi.auth.authorize(
|
|
55
|
-
{
|
|
58
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
56
59
|
authResult => {
|
|
57
60
|
if (authResult && !authResult.error) {
|
|
58
|
-
|
|
61
|
+
/* handle successful authorization */
|
|
59
62
|
} else {
|
|
60
|
-
|
|
63
|
+
/* handle authorization error */
|
|
61
64
|
}
|
|
62
|
-
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
63
67
|
```
|
|
64
68
|
|
|
65
69
|
After that you can use On-Demand Scanning API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
70
|
|
|
67
71
|
```typescript
|
|
72
|
+
|
|
68
73
|
```
|
package/tests.ts
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/* This is stub file for gapi.client.ondemandscanning-v1 definition tests */
|
|
2
|
-
// IMPORTANT
|
|
3
|
-
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
-
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
-
|
|
6
|
-
// Revision: 20231113
|
|
7
|
-
|
|
8
|
-
gapi.load('client', async () => {
|
|
9
|
-
/** now we can use gapi.client */
|
|
10
|
-
|
|
11
|
-
await gapi.client.load('https://ondemandscanning.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
-
/** now we can use gapi.client.ondemandscanning */
|
|
13
|
-
|
|
14
|
-
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
-
/** declare client_id registered in Google Developers Console */
|
|
16
|
-
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
-
const scope = [
|
|
18
|
-
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
-
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
-
];
|
|
21
|
-
const immediate = false;
|
|
22
|
-
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
23
|
-
if (authResult && !authResult.error) {
|
|
24
|
-
/** handle successful authorization */
|
|
25
|
-
run();
|
|
26
|
-
} else {
|
|
27
|
-
/** handle authorization error */
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
async function run() {
|
|
32
|
-
/**
|
|
33
|
-
* Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this
|
|
34
|
-
* method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation
|
|
35
|
-
* completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of
|
|
36
|
-
* 1, corresponding to `Code.CANCELLED`.
|
|
37
|
-
*/
|
|
38
|
-
await gapi.client.ondemandscanning.projects.locations.operations.cancel({
|
|
39
|
-
name: "Test string",
|
|
40
|
-
});
|
|
41
|
-
/**
|
|
42
|
-
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support
|
|
43
|
-
* this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
44
|
-
*/
|
|
45
|
-
await gapi.client.ondemandscanning.projects.locations.operations.delete({
|
|
46
|
-
name: "Test string",
|
|
47
|
-
});
|
|
48
|
-
/** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
|
|
49
|
-
await gapi.client.ondemandscanning.projects.locations.operations.get({
|
|
50
|
-
name: "Test string",
|
|
51
|
-
});
|
|
52
|
-
/** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
|
|
53
|
-
await gapi.client.ondemandscanning.projects.locations.operations.list({
|
|
54
|
-
filter: "Test string",
|
|
55
|
-
name: "Test string",
|
|
56
|
-
pageSize: 42,
|
|
57
|
-
pageToken: "Test string",
|
|
58
|
-
});
|
|
59
|
-
/**
|
|
60
|
-
* Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is
|
|
61
|
-
* immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns
|
|
62
|
-
* `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an
|
|
63
|
-
* immediate response is no guarantee that the operation is done.
|
|
64
|
-
*/
|
|
65
|
-
await gapi.client.ondemandscanning.projects.locations.operations.wait({
|
|
66
|
-
name: "Test string",
|
|
67
|
-
timeout: "Test string",
|
|
68
|
-
});
|
|
69
|
-
/** Initiates an analysis of the provided packages. */
|
|
70
|
-
await gapi.client.ondemandscanning.projects.locations.scans.analyzePackages({
|
|
71
|
-
parent: "Test string",
|
|
72
|
-
}, {
|
|
73
|
-
includeOsvData: true,
|
|
74
|
-
packages: [
|
|
75
|
-
{
|
|
76
|
-
architecture: "Test string",
|
|
77
|
-
binarySourceInfo: [
|
|
78
|
-
{
|
|
79
|
-
binaryVersion: {
|
|
80
|
-
licenses: [
|
|
81
|
-
"Test string"
|
|
82
|
-
],
|
|
83
|
-
name: "Test string",
|
|
84
|
-
version: "Test string",
|
|
85
|
-
},
|
|
86
|
-
sourceVersion: {
|
|
87
|
-
licenses: [
|
|
88
|
-
"Test string"
|
|
89
|
-
],
|
|
90
|
-
name: "Test string",
|
|
91
|
-
version: "Test string",
|
|
92
|
-
},
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
binaryVersion: {
|
|
96
|
-
licenses: [
|
|
97
|
-
"Test string"
|
|
98
|
-
],
|
|
99
|
-
name: "Test string",
|
|
100
|
-
version: "Test string",
|
|
101
|
-
},
|
|
102
|
-
cpeUri: "Test string",
|
|
103
|
-
dependencyChain: [
|
|
104
|
-
{
|
|
105
|
-
package: "Test string",
|
|
106
|
-
version: "Test string",
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
fileLocation: [
|
|
110
|
-
{
|
|
111
|
-
filePath: "Test string",
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
hashDigest: "Test string",
|
|
115
|
-
licenses: [
|
|
116
|
-
"Test string"
|
|
117
|
-
],
|
|
118
|
-
maintainer: {
|
|
119
|
-
email: "Test string",
|
|
120
|
-
kind: "Test string",
|
|
121
|
-
name: "Test string",
|
|
122
|
-
url: "Test string",
|
|
123
|
-
},
|
|
124
|
-
os: "Test string",
|
|
125
|
-
osVersion: "Test string",
|
|
126
|
-
package: "Test string",
|
|
127
|
-
packageType: "Test string",
|
|
128
|
-
patchedCve: [
|
|
129
|
-
"Test string"
|
|
130
|
-
],
|
|
131
|
-
sourceVersion: {
|
|
132
|
-
licenses: [
|
|
133
|
-
"Test string"
|
|
134
|
-
],
|
|
135
|
-
name: "Test string",
|
|
136
|
-
version: "Test string",
|
|
137
|
-
},
|
|
138
|
-
unused: "Test string",
|
|
139
|
-
version: "Test string",
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
resourceUri: "Test string",
|
|
143
|
-
});
|
|
144
|
-
/** Lists vulnerabilities resulting from a successfully completed scan. */
|
|
145
|
-
await gapi.client.ondemandscanning.projects.locations.scans.vulnerabilities.list({
|
|
146
|
-
pageSize: 42,
|
|
147
|
-
pageToken: "Test string",
|
|
148
|
-
parent: "Test string",
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"lib": ["es6", "dom"],
|
|
5
|
-
"noImplicitAny": true,
|
|
6
|
-
"noImplicitThis": true,
|
|
7
|
-
"strictNullChecks": true,
|
|
8
|
-
"baseUrl": "../",
|
|
9
|
-
"typeRoots": [
|
|
10
|
-
"../"
|
|
11
|
-
],
|
|
12
|
-
"types": [],
|
|
13
|
-
"noEmit": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"strictFunctionTypes": true
|
|
16
|
-
},
|
|
17
|
-
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
-
}
|