@maxim_mazurok/gapi.client.cloudshell-v1 0.0.20231113 → 0.0.20231129
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 +513 -771
- package/package.json +6 -6
- package/readme.md +21 -18
- package/tests.ts +0 -107
- 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.cloudshell-v1",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231129",
|
|
4
4
|
"description": "TypeScript typings for Cloud Shell 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TypeScript typings for Cloud Shell API v1
|
|
2
2
|
|
|
3
|
-
Allows users to start, configure, and connect to interactive shell sessions running in the cloud.
|
|
3
|
+
Allows users to start, configure, and connect to interactive shell sessions running in the cloud.
|
|
4
4
|
For detailed description please check [documentation](https://cloud.google.com/shell/docs/).
|
|
5
5
|
|
|
6
6
|
## Installing
|
|
@@ -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://cloudshell.googleapis.com/$discovery/rest?version=v1',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.cloudshell
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,44 +48,44 @@ 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 Cloud Shell API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
70
|
|
|
67
71
|
```typescript
|
|
68
|
-
|
|
69
72
|
/*
|
|
70
73
|
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 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 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 1, corresponding to `Code.CANCELLED`.
|
|
71
74
|
*/
|
|
72
|
-
await gapi.client.cloudshell.operations.cancel({
|
|
75
|
+
await gapi.client.cloudshell.operations.cancel({name: 'name'});
|
|
73
76
|
|
|
74
77
|
/*
|
|
75
78
|
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 this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
76
79
|
*/
|
|
77
|
-
await gapi.client.cloudshell.operations.delete({
|
|
80
|
+
await gapi.client.cloudshell.operations.delete({name: 'name'});
|
|
78
81
|
|
|
79
82
|
/*
|
|
80
83
|
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.
|
|
81
84
|
*/
|
|
82
|
-
await gapi.client.cloudshell.operations.get({
|
|
85
|
+
await gapi.client.cloudshell.operations.get({name: 'name'});
|
|
83
86
|
|
|
84
87
|
/*
|
|
85
88
|
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
86
89
|
*/
|
|
87
|
-
await gapi.client.cloudshell.operations.list({
|
|
90
|
+
await gapi.client.cloudshell.operations.list({name: 'name'});
|
|
88
91
|
```
|
package/tests.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/* This is stub file for gapi.client.cloudshell-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://cloudshell.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
-
/** now we can use gapi.client.cloudshell */
|
|
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.cloudshell.operations.cancel({
|
|
39
|
-
name: "Test string",
|
|
40
|
-
}, {
|
|
41
|
-
});
|
|
42
|
-
/**
|
|
43
|
-
* 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
|
|
44
|
-
* this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
45
|
-
*/
|
|
46
|
-
await gapi.client.cloudshell.operations.delete({
|
|
47
|
-
name: "Test string",
|
|
48
|
-
});
|
|
49
|
-
/** 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. */
|
|
50
|
-
await gapi.client.cloudshell.operations.get({
|
|
51
|
-
name: "Test string",
|
|
52
|
-
});
|
|
53
|
-
/** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
|
|
54
|
-
await gapi.client.cloudshell.operations.list({
|
|
55
|
-
filter: "Test string",
|
|
56
|
-
name: "Test string",
|
|
57
|
-
pageSize: 42,
|
|
58
|
-
pageToken: "Test string",
|
|
59
|
-
});
|
|
60
|
-
/**
|
|
61
|
-
* Adds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same content already exists, this
|
|
62
|
-
* will error with ALREADY_EXISTS.
|
|
63
|
-
*/
|
|
64
|
-
await gapi.client.cloudshell.users.environments.addPublicKey({
|
|
65
|
-
environment: "Test string",
|
|
66
|
-
}, {
|
|
67
|
-
key: "Test string",
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* Sends OAuth credentials to a running environment on behalf of a user. When this completes, the environment will be authorized to run various Google Cloud command line tools without
|
|
71
|
-
* requiring the user to manually authenticate.
|
|
72
|
-
*/
|
|
73
|
-
await gapi.client.cloudshell.users.environments.authorize({
|
|
74
|
-
name: "Test string",
|
|
75
|
-
}, {
|
|
76
|
-
accessToken: "Test string",
|
|
77
|
-
expireTime: "Test string",
|
|
78
|
-
idToken: "Test string",
|
|
79
|
-
});
|
|
80
|
-
/** Gets an environment. Returns NOT_FOUND if the environment does not exist. */
|
|
81
|
-
await gapi.client.cloudshell.users.environments.get({
|
|
82
|
-
name: "Test string",
|
|
83
|
-
});
|
|
84
|
-
/**
|
|
85
|
-
* Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not
|
|
86
|
-
* present, this will error with NOT_FOUND.
|
|
87
|
-
*/
|
|
88
|
-
await gapi.client.cloudshell.users.environments.removePublicKey({
|
|
89
|
-
environment: "Test string",
|
|
90
|
-
}, {
|
|
91
|
-
key: "Test string",
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* Starts an existing environment, allowing clients to connect to it. The returned operation will contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for
|
|
95
|
-
* the environment to start by polling this operation via GetOperation. Once the environment has finished starting and is ready to accept connections, the operation will contain a
|
|
96
|
-
* StartEnvironmentResponse in its response field.
|
|
97
|
-
*/
|
|
98
|
-
await gapi.client.cloudshell.users.environments.start({
|
|
99
|
-
name: "Test string",
|
|
100
|
-
}, {
|
|
101
|
-
accessToken: "Test string",
|
|
102
|
-
publicKeys: [
|
|
103
|
-
"Test string"
|
|
104
|
-
],
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
});
|
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
|
-
}
|