@maxim_mazurok/gapi.client.abusiveexperiencereport-v1 0.0.20220715
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 +110 -0
- package/package.json +20 -0
- package/readme.md +57 -0
- package/tests.ts +25 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Abusive Experience Report API v1 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/abusive-experience-report/
|
|
3
|
+
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
|
4
|
+
// Nick Amoscato <https://github.com/namoscato>
|
|
5
|
+
// Declan Vong <https://github.com/declanvong>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 2.8
|
|
8
|
+
|
|
9
|
+
// IMPORTANT
|
|
10
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
11
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
12
|
+
// Generated from: https://abusiveexperiencereport.googleapis.com/$discovery/rest?version=v1
|
|
13
|
+
// Revision: 20220715
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Abusive Experience Report API v1 */
|
|
19
|
+
function load(urlOrObject: "https://abusiveexperiencereport.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "abusiveexperiencereport", version: "v1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "abusiveexperiencereport", version: "v1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace abusiveexperiencereport {
|
|
26
|
+
interface SiteSummaryResponse {
|
|
27
|
+
/** The site's Abusive Experience Report status. */
|
|
28
|
+
abusiveStatus?: string;
|
|
29
|
+
/** The time at which [enforcement](https://support.google.com/webtools/answer/7538608) against the site began or will begin. Not set when the filter_status is OFF. */
|
|
30
|
+
enforcementTime?: string;
|
|
31
|
+
/** The site's [enforcement status](https://support.google.com/webtools/answer/7538608). */
|
|
32
|
+
filterStatus?: string;
|
|
33
|
+
/** The time at which the site's status last changed. */
|
|
34
|
+
lastChangeTime?: string;
|
|
35
|
+
/**
|
|
36
|
+
* A link to the full Abusive Experience Report for the site. Not set in ViolatingSitesResponse. Note that you must complete the [Search Console verification
|
|
37
|
+
* process](https://support.google.com/webmasters/answer/9008080) for the site before you can access the full report.
|
|
38
|
+
*/
|
|
39
|
+
reportUrl?: string;
|
|
40
|
+
/** The name of the reviewed site, e.g. `google.com`. */
|
|
41
|
+
reviewedSite?: string;
|
|
42
|
+
/** Whether the site is currently under review. */
|
|
43
|
+
underReview?: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface ViolatingSitesResponse {
|
|
46
|
+
/** The list of violating sites. */
|
|
47
|
+
violatingSites?: SiteSummaryResponse[];
|
|
48
|
+
}
|
|
49
|
+
interface SitesResource {
|
|
50
|
+
/** Gets a site's Abusive Experience Report summary. */
|
|
51
|
+
get(request?: {
|
|
52
|
+
/** V1 error format. */
|
|
53
|
+
"$.xgafv"?: string;
|
|
54
|
+
/** OAuth access token. */
|
|
55
|
+
access_token?: string;
|
|
56
|
+
/** Data format for response. */
|
|
57
|
+
alt?: string;
|
|
58
|
+
/** JSONP */
|
|
59
|
+
callback?: string;
|
|
60
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
61
|
+
fields?: string;
|
|
62
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
63
|
+
key?: string;
|
|
64
|
+
/** Required. The name of the site whose summary to get, e.g. `sites/http%3A%2F%2Fwww.google.com%2F`. Format: `sites/{site}` */
|
|
65
|
+
name: string;
|
|
66
|
+
/** OAuth 2.0 token for the current user. */
|
|
67
|
+
oauth_token?: string;
|
|
68
|
+
/** Returns response with indentations and line breaks. */
|
|
69
|
+
prettyPrint?: boolean;
|
|
70
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
71
|
+
quotaUser?: string;
|
|
72
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
73
|
+
upload_protocol?: string;
|
|
74
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
75
|
+
uploadType?: string;
|
|
76
|
+
}): Request<SiteSummaryResponse>;
|
|
77
|
+
}
|
|
78
|
+
interface ViolatingSitesResource {
|
|
79
|
+
/** Lists sites that are failing in the Abusive Experience Report. */
|
|
80
|
+
list(request?: {
|
|
81
|
+
/** V1 error format. */
|
|
82
|
+
"$.xgafv"?: string;
|
|
83
|
+
/** OAuth access token. */
|
|
84
|
+
access_token?: string;
|
|
85
|
+
/** Data format for response. */
|
|
86
|
+
alt?: string;
|
|
87
|
+
/** JSONP */
|
|
88
|
+
callback?: string;
|
|
89
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
90
|
+
fields?: string;
|
|
91
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
92
|
+
key?: string;
|
|
93
|
+
/** OAuth 2.0 token for the current user. */
|
|
94
|
+
oauth_token?: string;
|
|
95
|
+
/** Returns response with indentations and line breaks. */
|
|
96
|
+
prettyPrint?: boolean;
|
|
97
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
98
|
+
quotaUser?: string;
|
|
99
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
100
|
+
upload_protocol?: string;
|
|
101
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
102
|
+
uploadType?: string;
|
|
103
|
+
}): Request<ViolatingSitesResponse>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const sites: SitesResource;
|
|
107
|
+
|
|
108
|
+
const violatingSites: ViolatingSitesResource;
|
|
109
|
+
}
|
|
110
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.abusiveexperiencereport-v1",
|
|
3
|
+
"version": "0.0.20220715",
|
|
4
|
+
"description": "TypeScript typings for Abusive Experience Report 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,57 @@
|
|
|
1
|
+
# TypeScript typings for Abusive Experience Report API v1
|
|
2
|
+
|
|
3
|
+
Views Abusive Experience Report data, and gets a list of sites that have a significant number of abusive experiences.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/abusive-experience-report/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Abusive Experience Report API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.abusiveexperiencereport-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://abusiveexperiencereport.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.abusiveexperiencereport
|
|
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('abusiveexperiencereport', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.abusiveexperiencereport
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
After that you can use Abusive Experience Report API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
Gets a site's Abusive Experience Report summary.
|
|
50
|
+
*/
|
|
51
|
+
await gapi.client.abusiveexperiencereport.sites.get({ name: "name", });
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
Lists sites that are failing in the Abusive Experience Report.
|
|
55
|
+
*/
|
|
56
|
+
await gapi.client.abusiveexperiencereport.violatingSites.list({ });
|
|
57
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.abusiveexperiencereport-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: 20220715
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://abusiveexperiencereport.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.abusiveexperiencereport */
|
|
13
|
+
|
|
14
|
+
run();
|
|
15
|
+
|
|
16
|
+
async function run() {
|
|
17
|
+
/** Gets a site's Abusive Experience Report summary. */
|
|
18
|
+
await gapi.client.abusiveexperiencereport.sites.get({
|
|
19
|
+
name: "Test string",
|
|
20
|
+
});
|
|
21
|
+
/** Lists sites that are failing in the Abusive Experience Report. */
|
|
22
|
+
await gapi.client.abusiveexperiencereport.violatingSites.list({
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
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
|
+
}
|