@maxim_mazurok/gapi.client.appengine-v1alpha 0.0.20220806

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/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.appengine-v1alpha",
3
+ "version": "0.0.20220806",
4
+ "description": "TypeScript typings for App Engine Admin API v1alpha",
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,74 @@
1
+ # TypeScript typings for App Engine Admin API v1alpha
2
+
3
+ Provisions and manages developers' App Engine applications.
4
+ For detailed description please check [documentation](https://cloud.google.com/appengine/docs/admin-api/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for App Engine Admin API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.appengine-v1alpha --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://appengine.googleapis.com/$discovery/rest?version=v1alpha', () => {
29
+ // now we can use:
30
+ // gapi.client.appengine
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('appengine', 'v1alpha', () => {
37
+ // now we can use:
38
+ // gapi.client.appengine
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
+ // View and manage your applications deployed on Google App Engine
49
+ 'https://www.googleapis.com/auth/appengine.admin',
50
+
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
+ // View your data across Google Cloud services and see the email address of your Google Account
55
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
56
+ ],
57
+ immediate = true;
58
+ // ...
59
+
60
+ gapi.auth.authorize(
61
+ { client_id: client_id, scope: scope, immediate: immediate },
62
+ authResult => {
63
+ if (authResult && !authResult.error) {
64
+ /* handle successful authorization */
65
+ } else {
66
+ /* handle authorization error */
67
+ }
68
+ });
69
+ ```
70
+
71
+ After that you can use App Engine Admin API resources: <!-- TODO: make this work for multiple namespaces -->
72
+
73
+ ```typescript
74
+ ```
package/tests.ts ADDED
@@ -0,0 +1,237 @@
1
+ /* This is stub file for gapi.client.appengine-v1alpha 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: 20220806
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://appengine.googleapis.com/$discovery/rest?version=v1alpha');
12
+ /** now we can use gapi.client.appengine */
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
+ /** View and manage your applications deployed on Google App Engine */
19
+ 'https://www.googleapis.com/auth/appengine.admin',
20
+ /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
21
+ 'https://www.googleapis.com/auth/cloud-platform',
22
+ /** View your data across Google Cloud services and see the email address of your Google Account */
23
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
24
+ ];
25
+ const immediate = false;
26
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
27
+ if (authResult && !authResult.error) {
28
+ /** handle successful authorization */
29
+ run();
30
+ } else {
31
+ /** handle authorization error */
32
+ }
33
+ });
34
+
35
+ async function run() {
36
+ /** Uploads the specified SSL certificate. */
37
+ await gapi.client.appengine.apps.authorizedCertificates.create({
38
+ appsId: "Test string",
39
+ }, {
40
+ certificateRawData: {
41
+ privateKey: "Test string",
42
+ publicCertificate: "Test string",
43
+ },
44
+ displayName: "Test string",
45
+ domainMappingsCount: 42,
46
+ domainNames: [
47
+ "Test string"
48
+ ],
49
+ expireTime: "Test string",
50
+ id: "Test string",
51
+ managedCertificate: {
52
+ lastRenewalTime: "Test string",
53
+ status: "Test string",
54
+ },
55
+ name: "Test string",
56
+ visibleDomainMappings: [
57
+ "Test string"
58
+ ],
59
+ });
60
+ /** Deletes the specified SSL certificate. */
61
+ await gapi.client.appengine.apps.authorizedCertificates.delete({
62
+ appsId: "Test string",
63
+ authorizedCertificatesId: "Test string",
64
+ });
65
+ /** Gets the specified SSL certificate. */
66
+ await gapi.client.appengine.apps.authorizedCertificates.get({
67
+ appsId: "Test string",
68
+ authorizedCertificatesId: "Test string",
69
+ view: "Test string",
70
+ });
71
+ /** Lists all SSL certificates the user is authorized to administer. */
72
+ await gapi.client.appengine.apps.authorizedCertificates.list({
73
+ appsId: "Test string",
74
+ pageSize: 42,
75
+ pageToken: "Test string",
76
+ view: "Test string",
77
+ });
78
+ /**
79
+ * Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be
80
+ * applicable to the same domains as the original certificate. The certificate display_name may also be updated.
81
+ */
82
+ await gapi.client.appengine.apps.authorizedCertificates.patch({
83
+ appsId: "Test string",
84
+ authorizedCertificatesId: "Test string",
85
+ updateMask: "Test string",
86
+ }, {
87
+ certificateRawData: {
88
+ privateKey: "Test string",
89
+ publicCertificate: "Test string",
90
+ },
91
+ displayName: "Test string",
92
+ domainMappingsCount: 42,
93
+ domainNames: [
94
+ "Test string"
95
+ ],
96
+ expireTime: "Test string",
97
+ id: "Test string",
98
+ managedCertificate: {
99
+ lastRenewalTime: "Test string",
100
+ status: "Test string",
101
+ },
102
+ name: "Test string",
103
+ visibleDomainMappings: [
104
+ "Test string"
105
+ ],
106
+ });
107
+ /** Lists all domains the user is authorized to administer. */
108
+ await gapi.client.appengine.apps.authorizedDomains.list({
109
+ appsId: "Test string",
110
+ pageSize: 42,
111
+ pageToken: "Test string",
112
+ });
113
+ /**
114
+ * Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see
115
+ * AuthorizedDomains.ListAuthorizedDomains.
116
+ */
117
+ await gapi.client.appengine.apps.domainMappings.create({
118
+ appsId: "Test string",
119
+ noManagedCertificate: true,
120
+ overrideStrategy: "Test string",
121
+ }, {
122
+ id: "Test string",
123
+ name: "Test string",
124
+ resourceRecords: [
125
+ {
126
+ name: "Test string",
127
+ rrdata: "Test string",
128
+ type: "Test string",
129
+ }
130
+ ],
131
+ sslSettings: {
132
+ certificateId: "Test string",
133
+ isManagedCertificate: true,
134
+ },
135
+ });
136
+ /** Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. */
137
+ await gapi.client.appengine.apps.domainMappings.delete({
138
+ appsId: "Test string",
139
+ domainMappingsId: "Test string",
140
+ });
141
+ /** Gets the specified domain mapping. */
142
+ await gapi.client.appengine.apps.domainMappings.get({
143
+ appsId: "Test string",
144
+ domainMappingsId: "Test string",
145
+ });
146
+ /** Lists the domain mappings on an application. */
147
+ await gapi.client.appengine.apps.domainMappings.list({
148
+ appsId: "Test string",
149
+ pageSize: 42,
150
+ pageToken: "Test string",
151
+ });
152
+ /**
153
+ * Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to
154
+ * administer the associated domain in order to update a DomainMapping resource.
155
+ */
156
+ await gapi.client.appengine.apps.domainMappings.patch({
157
+ appsId: "Test string",
158
+ domainMappingsId: "Test string",
159
+ noManagedCertificate: true,
160
+ updateMask: "Test string",
161
+ }, {
162
+ id: "Test string",
163
+ name: "Test string",
164
+ resourceRecords: [
165
+ {
166
+ name: "Test string",
167
+ rrdata: "Test string",
168
+ type: "Test string",
169
+ }
170
+ ],
171
+ sslSettings: {
172
+ certificateId: "Test string",
173
+ isManagedCertificate: true,
174
+ },
175
+ });
176
+ /** Gets information about a location. */
177
+ await gapi.client.appengine.apps.locations.get({
178
+ appsId: "Test string",
179
+ locationsId: "Test string",
180
+ });
181
+ /** Lists information about the supported locations for this service. */
182
+ await gapi.client.appengine.apps.locations.list({
183
+ appsId: "Test string",
184
+ filter: "Test string",
185
+ pageSize: 42,
186
+ pageToken: "Test string",
187
+ });
188
+ /** 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. */
189
+ await gapi.client.appengine.apps.operations.get({
190
+ appsId: "Test string",
191
+ operationsId: "Test string",
192
+ });
193
+ /**
194
+ * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to
195
+ * override the binding to use different resource name schemes, such as users/*‍/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations"
196
+ * to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent
197
+ * resource, without the operations collection id.
198
+ */
199
+ await gapi.client.appengine.apps.operations.list({
200
+ appsId: "Test string",
201
+ filter: "Test string",
202
+ pageSize: 42,
203
+ pageToken: "Test string",
204
+ });
205
+ /** Gets information about a location. */
206
+ await gapi.client.appengine.projects.locations.get({
207
+ locationsId: "Test string",
208
+ projectsId: "Test string",
209
+ });
210
+ /** Lists information about the supported locations for this service. */
211
+ await gapi.client.appengine.projects.locations.list({
212
+ filter: "Test string",
213
+ pageSize: 42,
214
+ pageToken: "Test string",
215
+ projectsId: "Test string",
216
+ });
217
+ /** 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. */
218
+ await gapi.client.appengine.projects.locations.operations.get({
219
+ locationsId: "Test string",
220
+ operationsId: "Test string",
221
+ projectsId: "Test string",
222
+ });
223
+ /**
224
+ * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to
225
+ * override the binding to use different resource name schemes, such as users/*‍/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations"
226
+ * to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent
227
+ * resource, without the operations collection id.
228
+ */
229
+ await gapi.client.appengine.projects.locations.operations.list({
230
+ filter: "Test string",
231
+ locationsId: "Test string",
232
+ pageSize: 42,
233
+ pageToken: "Test string",
234
+ projectsId: "Test string",
235
+ });
236
+ }
237
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
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
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }