@maxim_mazurok/gapi.client.testing-v1 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.testing-v1",
3
+ "version": "0.0.20220806",
4
+ "description": "TypeScript typings for Cloud Testing API v1",
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,81 @@
1
+ # TypeScript typings for Cloud Testing API v1
2
+
3
+ Allows developers to run automated tests for their mobile applications on Google infrastructure.
4
+ For detailed description please check [documentation](https://developers.google.com/cloud-test-lab/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Cloud Testing API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.testing-v1 --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://testing.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.testing
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('testing', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.testing
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
+ // View your data across Google Cloud services and see the email address of your Google Account
52
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ { client_id: client_id, scope: scope, immediate: immediate },
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ });
66
+ ```
67
+
68
+ After that you can use Cloud Testing API resources: <!-- TODO: make this work for multiple namespaces -->
69
+
70
+ ```typescript
71
+
72
+ /*
73
+ Gets the details of an Android application APK.
74
+ */
75
+ await gapi.client.testing.applicationDetailService.getApkDetails({ });
76
+
77
+ /*
78
+ Gets the catalog of supported test environments. May return any of the following canonical error codes: - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the environment type does not exist - INTERNAL - if an internal error occurred
79
+ */
80
+ await gapi.client.testing.testEnvironmentCatalog.get({ environmentType: "environmentType", });
81
+ ```
package/tests.ts ADDED
@@ -0,0 +1,557 @@
1
+ /* This is stub file for gapi.client.testing-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: 20220806
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://testing.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.testing */
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
+ /** View your data across Google Cloud services and see the email address of your Google Account */
21
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
22
+ ];
23
+ const immediate = false;
24
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
25
+ if (authResult && !authResult.error) {
26
+ /** handle successful authorization */
27
+ run();
28
+ } else {
29
+ /** handle authorization error */
30
+ }
31
+ });
32
+
33
+ async function run() {
34
+ /** Gets the details of an Android application APK. */
35
+ await gapi.client.testing.applicationDetailService.getApkDetails({
36
+ }, {
37
+ gcsPath: "Test string",
38
+ });
39
+ /**
40
+ * Cancels unfinished test executions in a test matrix. This call returns immediately and cancellation proceeds asynchronously. If the matrix is already final, this operation will have no
41
+ * effect. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed -
42
+ * NOT_FOUND - if the Test Matrix does not exist
43
+ */
44
+ await gapi.client.testing.projects.testMatrices.cancel({
45
+ projectId: "Test string",
46
+ testMatrixId: "Test string",
47
+ });
48
+ /**
49
+ * Creates and runs a matrix of tests according to the given specifications. Unsupported environments will be returned in the state UNSUPPORTED. A test matrix is limited to use at most
50
+ * 2000 devices in parallel. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the
51
+ * request is malformed or if the matrix tries to use too many simultaneous devices.
52
+ */
53
+ await gapi.client.testing.projects.testMatrices.create({
54
+ projectId: "Test string",
55
+ requestId: "Test string",
56
+ }, {
57
+ clientInfo: {
58
+ clientInfoDetails: [
59
+ {
60
+ key: "Test string",
61
+ value: "Test string",
62
+ }
63
+ ],
64
+ name: "Test string",
65
+ },
66
+ environmentMatrix: {
67
+ androidDeviceList: {
68
+ androidDevices: [
69
+ {
70
+ androidModelId: "Test string",
71
+ androidVersionId: "Test string",
72
+ locale: "Test string",
73
+ orientation: "Test string",
74
+ }
75
+ ],
76
+ },
77
+ androidMatrix: {
78
+ androidModelIds: [
79
+ "Test string"
80
+ ],
81
+ androidVersionIds: [
82
+ "Test string"
83
+ ],
84
+ locales: [
85
+ "Test string"
86
+ ],
87
+ orientations: [
88
+ "Test string"
89
+ ],
90
+ },
91
+ iosDeviceList: {
92
+ iosDevices: [
93
+ {
94
+ iosModelId: "Test string",
95
+ iosVersionId: "Test string",
96
+ locale: "Test string",
97
+ orientation: "Test string",
98
+ }
99
+ ],
100
+ },
101
+ },
102
+ failFast: true,
103
+ flakyTestAttempts: 42,
104
+ invalidMatrixDetails: "Test string",
105
+ outcomeSummary: "Test string",
106
+ projectId: "Test string",
107
+ resultStorage: {
108
+ googleCloudStorage: {
109
+ gcsPath: "Test string",
110
+ },
111
+ resultsUrl: "Test string",
112
+ toolResultsExecution: {
113
+ executionId: "Test string",
114
+ historyId: "Test string",
115
+ projectId: "Test string",
116
+ },
117
+ toolResultsHistory: {
118
+ historyId: "Test string",
119
+ projectId: "Test string",
120
+ },
121
+ },
122
+ state: "Test string",
123
+ testExecutions: [
124
+ {
125
+ environment: {
126
+ androidDevice: {
127
+ androidModelId: "Test string",
128
+ androidVersionId: "Test string",
129
+ locale: "Test string",
130
+ orientation: "Test string",
131
+ },
132
+ iosDevice: {
133
+ iosModelId: "Test string",
134
+ iosVersionId: "Test string",
135
+ locale: "Test string",
136
+ orientation: "Test string",
137
+ },
138
+ },
139
+ id: "Test string",
140
+ matrixId: "Test string",
141
+ projectId: "Test string",
142
+ shard: {
143
+ numShards: 42,
144
+ shardIndex: 42,
145
+ testTargetsForShard: {
146
+ testTargets: [
147
+ "Test string"
148
+ ],
149
+ },
150
+ },
151
+ state: "Test string",
152
+ testDetails: {
153
+ errorMessage: "Test string",
154
+ progressMessages: [
155
+ "Test string"
156
+ ],
157
+ },
158
+ testSpecification: {
159
+ androidInstrumentationTest: {
160
+ appApk: {
161
+ gcsPath: "Test string",
162
+ },
163
+ appBundle: {
164
+ bundleLocation: {
165
+ gcsPath: "Test string",
166
+ },
167
+ },
168
+ appPackageId: "Test string",
169
+ orchestratorOption: "Test string",
170
+ shardingOption: {
171
+ manualSharding: {
172
+ testTargetsForShard: [
173
+ {
174
+ testTargets: [
175
+ "Test string"
176
+ ],
177
+ }
178
+ ],
179
+ },
180
+ uniformSharding: {
181
+ numShards: 42,
182
+ },
183
+ },
184
+ testApk: {
185
+ gcsPath: "Test string",
186
+ },
187
+ testPackageId: "Test string",
188
+ testRunnerClass: "Test string",
189
+ testTargets: [
190
+ "Test string"
191
+ ],
192
+ },
193
+ androidRoboTest: {
194
+ appApk: {
195
+ gcsPath: "Test string",
196
+ },
197
+ appBundle: {
198
+ bundleLocation: {
199
+ gcsPath: "Test string",
200
+ },
201
+ },
202
+ appInitialActivity: "Test string",
203
+ appPackageId: "Test string",
204
+ maxDepth: 42,
205
+ maxSteps: 42,
206
+ roboDirectives: [
207
+ {
208
+ actionType: "Test string",
209
+ inputText: "Test string",
210
+ resourceName: "Test string",
211
+ }
212
+ ],
213
+ roboMode: "Test string",
214
+ roboScript: {
215
+ gcsPath: "Test string",
216
+ },
217
+ startingIntents: [
218
+ {
219
+ launcherActivity: {
220
+ },
221
+ startActivity: {
222
+ action: "Test string",
223
+ categories: [
224
+ "Test string"
225
+ ],
226
+ uri: "Test string",
227
+ },
228
+ timeout: "Test string",
229
+ }
230
+ ],
231
+ },
232
+ androidTestLoop: {
233
+ appApk: {
234
+ gcsPath: "Test string",
235
+ },
236
+ appBundle: {
237
+ bundleLocation: {
238
+ gcsPath: "Test string",
239
+ },
240
+ },
241
+ appPackageId: "Test string",
242
+ scenarioLabels: [
243
+ "Test string"
244
+ ],
245
+ scenarios: [
246
+ 42
247
+ ],
248
+ },
249
+ disablePerformanceMetrics: true,
250
+ disableVideoRecording: true,
251
+ iosTestLoop: {
252
+ appBundleId: "Test string",
253
+ appIpa: {
254
+ gcsPath: "Test string",
255
+ },
256
+ scenarios: [
257
+ 42
258
+ ],
259
+ },
260
+ iosTestSetup: {
261
+ additionalIpas: [
262
+ {
263
+ gcsPath: "Test string",
264
+ }
265
+ ],
266
+ networkProfile: "Test string",
267
+ pullDirectories: [
268
+ {
269
+ bundleId: "Test string",
270
+ content: {
271
+ gcsPath: "Test string",
272
+ },
273
+ devicePath: "Test string",
274
+ }
275
+ ],
276
+ pushFiles: [
277
+ {
278
+ bundleId: "Test string",
279
+ content: {
280
+ gcsPath: "Test string",
281
+ },
282
+ devicePath: "Test string",
283
+ }
284
+ ],
285
+ },
286
+ iosXcTest: {
287
+ appBundleId: "Test string",
288
+ testSpecialEntitlements: true,
289
+ testsZip: {
290
+ gcsPath: "Test string",
291
+ },
292
+ xcodeVersion: "Test string",
293
+ xctestrun: {
294
+ gcsPath: "Test string",
295
+ },
296
+ },
297
+ testSetup: {
298
+ account: {
299
+ googleAuto: {
300
+ },
301
+ },
302
+ additionalApks: [
303
+ {
304
+ location: {
305
+ gcsPath: "Test string",
306
+ },
307
+ packageName: "Test string",
308
+ }
309
+ ],
310
+ directoriesToPull: [
311
+ "Test string"
312
+ ],
313
+ dontAutograntPermissions: true,
314
+ environmentVariables: [
315
+ {
316
+ key: "Test string",
317
+ value: "Test string",
318
+ }
319
+ ],
320
+ filesToPush: [
321
+ {
322
+ obbFile: {
323
+ obb: {
324
+ gcsPath: "Test string",
325
+ },
326
+ obbFileName: "Test string",
327
+ },
328
+ regularFile: {
329
+ content: {
330
+ gcsPath: "Test string",
331
+ },
332
+ devicePath: "Test string",
333
+ },
334
+ }
335
+ ],
336
+ networkProfile: "Test string",
337
+ systrace: {
338
+ durationSeconds: 42,
339
+ },
340
+ },
341
+ testTimeout: "Test string",
342
+ },
343
+ timestamp: "Test string",
344
+ toolResultsStep: {
345
+ executionId: "Test string",
346
+ historyId: "Test string",
347
+ projectId: "Test string",
348
+ stepId: "Test string",
349
+ },
350
+ }
351
+ ],
352
+ testMatrixId: "Test string",
353
+ testSpecification: {
354
+ androidInstrumentationTest: {
355
+ appApk: {
356
+ gcsPath: "Test string",
357
+ },
358
+ appBundle: {
359
+ bundleLocation: {
360
+ gcsPath: "Test string",
361
+ },
362
+ },
363
+ appPackageId: "Test string",
364
+ orchestratorOption: "Test string",
365
+ shardingOption: {
366
+ manualSharding: {
367
+ testTargetsForShard: [
368
+ {
369
+ testTargets: [
370
+ "Test string"
371
+ ],
372
+ }
373
+ ],
374
+ },
375
+ uniformSharding: {
376
+ numShards: 42,
377
+ },
378
+ },
379
+ testApk: {
380
+ gcsPath: "Test string",
381
+ },
382
+ testPackageId: "Test string",
383
+ testRunnerClass: "Test string",
384
+ testTargets: [
385
+ "Test string"
386
+ ],
387
+ },
388
+ androidRoboTest: {
389
+ appApk: {
390
+ gcsPath: "Test string",
391
+ },
392
+ appBundle: {
393
+ bundleLocation: {
394
+ gcsPath: "Test string",
395
+ },
396
+ },
397
+ appInitialActivity: "Test string",
398
+ appPackageId: "Test string",
399
+ maxDepth: 42,
400
+ maxSteps: 42,
401
+ roboDirectives: [
402
+ {
403
+ actionType: "Test string",
404
+ inputText: "Test string",
405
+ resourceName: "Test string",
406
+ }
407
+ ],
408
+ roboMode: "Test string",
409
+ roboScript: {
410
+ gcsPath: "Test string",
411
+ },
412
+ startingIntents: [
413
+ {
414
+ launcherActivity: {
415
+ },
416
+ startActivity: {
417
+ action: "Test string",
418
+ categories: [
419
+ "Test string"
420
+ ],
421
+ uri: "Test string",
422
+ },
423
+ timeout: "Test string",
424
+ }
425
+ ],
426
+ },
427
+ androidTestLoop: {
428
+ appApk: {
429
+ gcsPath: "Test string",
430
+ },
431
+ appBundle: {
432
+ bundleLocation: {
433
+ gcsPath: "Test string",
434
+ },
435
+ },
436
+ appPackageId: "Test string",
437
+ scenarioLabels: [
438
+ "Test string"
439
+ ],
440
+ scenarios: [
441
+ 42
442
+ ],
443
+ },
444
+ disablePerformanceMetrics: true,
445
+ disableVideoRecording: true,
446
+ iosTestLoop: {
447
+ appBundleId: "Test string",
448
+ appIpa: {
449
+ gcsPath: "Test string",
450
+ },
451
+ scenarios: [
452
+ 42
453
+ ],
454
+ },
455
+ iosTestSetup: {
456
+ additionalIpas: [
457
+ {
458
+ gcsPath: "Test string",
459
+ }
460
+ ],
461
+ networkProfile: "Test string",
462
+ pullDirectories: [
463
+ {
464
+ bundleId: "Test string",
465
+ content: {
466
+ gcsPath: "Test string",
467
+ },
468
+ devicePath: "Test string",
469
+ }
470
+ ],
471
+ pushFiles: [
472
+ {
473
+ bundleId: "Test string",
474
+ content: {
475
+ gcsPath: "Test string",
476
+ },
477
+ devicePath: "Test string",
478
+ }
479
+ ],
480
+ },
481
+ iosXcTest: {
482
+ appBundleId: "Test string",
483
+ testSpecialEntitlements: true,
484
+ testsZip: {
485
+ gcsPath: "Test string",
486
+ },
487
+ xcodeVersion: "Test string",
488
+ xctestrun: {
489
+ gcsPath: "Test string",
490
+ },
491
+ },
492
+ testSetup: {
493
+ account: {
494
+ googleAuto: {
495
+ },
496
+ },
497
+ additionalApks: [
498
+ {
499
+ location: {
500
+ gcsPath: "Test string",
501
+ },
502
+ packageName: "Test string",
503
+ }
504
+ ],
505
+ directoriesToPull: [
506
+ "Test string"
507
+ ],
508
+ dontAutograntPermissions: true,
509
+ environmentVariables: [
510
+ {
511
+ key: "Test string",
512
+ value: "Test string",
513
+ }
514
+ ],
515
+ filesToPush: [
516
+ {
517
+ obbFile: {
518
+ obb: {
519
+ gcsPath: "Test string",
520
+ },
521
+ obbFileName: "Test string",
522
+ },
523
+ regularFile: {
524
+ content: {
525
+ gcsPath: "Test string",
526
+ },
527
+ devicePath: "Test string",
528
+ },
529
+ }
530
+ ],
531
+ networkProfile: "Test string",
532
+ systrace: {
533
+ durationSeconds: 42,
534
+ },
535
+ },
536
+ testTimeout: "Test string",
537
+ },
538
+ timestamp: "Test string",
539
+ });
540
+ /**
541
+ * Checks the status of a test matrix. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if
542
+ * the request is malformed - NOT_FOUND - if the Test Matrix does not exist
543
+ */
544
+ await gapi.client.testing.projects.testMatrices.get({
545
+ projectId: "Test string",
546
+ testMatrixId: "Test string",
547
+ });
548
+ /**
549
+ * Gets the catalog of supported test environments. May return any of the following canonical error codes: - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the environment
550
+ * type does not exist - INTERNAL - if an internal error occurred
551
+ */
552
+ await gapi.client.testing.testEnvironmentCatalog.get({
553
+ environmentType: "Test string",
554
+ projectId: "Test string",
555
+ });
556
+ }
557
+ });
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
+ }