@maxim_mazurok/gapi.client.admin-reports_v1 0.0.20231127 → 0.0.20231219
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 +697 -1280
- package/package.json +6 -6
- package/readme.md +38 -22
- package/tests.ts +0 -136
- 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.admin-reports_v1",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231219",
|
|
4
4
|
"description": "TypeScript typings for Admin SDK API reports_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,11 +25,14 @@ gapi.load('client', () => {
|
|
|
25
25
|
Then load api client wrapper:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
gapi.client.load(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
gapi.client.load(
|
|
29
|
+
'https://admin.googleapis.com/$discovery/rest?version=reports_v1',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.admin
|
|
33
|
+
// gapi.client.reports
|
|
34
|
+
}
|
|
35
|
+
);
|
|
33
36
|
```
|
|
34
37
|
|
|
35
38
|
```typescript
|
|
@@ -47,57 +50,70 @@ Don't forget to authenticate your client before sending any request to resources
|
|
|
47
50
|
// declare client_id registered in Google Developers Console
|
|
48
51
|
var client_id = '',
|
|
49
52
|
scope = [
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
// View audit reports for your G Suite domain
|
|
54
|
+
'https://www.googleapis.com/auth/admin.reports.audit.readonly',
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
// View usage reports for your G Suite domain
|
|
57
|
+
'https://www.googleapis.com/auth/admin.reports.usage.readonly',
|
|
58
|
+
],
|
|
59
|
+
immediate = true;
|
|
57
60
|
// ...
|
|
58
61
|
|
|
59
62
|
gapi.auth.authorize(
|
|
60
|
-
{
|
|
63
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
61
64
|
authResult => {
|
|
62
65
|
if (authResult && !authResult.error) {
|
|
63
|
-
|
|
66
|
+
/* handle successful authorization */
|
|
64
67
|
} else {
|
|
65
|
-
|
|
68
|
+
/* handle authorization error */
|
|
66
69
|
}
|
|
67
|
-
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
68
72
|
```
|
|
69
73
|
|
|
70
74
|
After that you can use Admin SDK API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
71
75
|
|
|
72
76
|
```typescript
|
|
73
|
-
|
|
74
77
|
/*
|
|
75
78
|
Retrieves a list of activities for a specific customer's account and application such as the Admin console application or the Google Drive application. For more information, see the guides for administrator and Google Drive activity reports. For more information about the activity report's parameters, see the activity parameters reference guides.
|
|
76
79
|
*/
|
|
77
|
-
await gapi.client.reports.activities.list({
|
|
80
|
+
await gapi.client.reports.activities.list({
|
|
81
|
+
applicationName: 'applicationName',
|
|
82
|
+
userKey: 'userKey',
|
|
83
|
+
});
|
|
78
84
|
|
|
79
85
|
/*
|
|
80
86
|
Start receiving notifications for account activities. For more information, see Receiving Push Notifications.
|
|
81
87
|
*/
|
|
82
|
-
await gapi.client.reports.activities.watch({
|
|
88
|
+
await gapi.client.reports.activities.watch({
|
|
89
|
+
applicationName: 'applicationName',
|
|
90
|
+
userKey: 'userKey',
|
|
91
|
+
});
|
|
83
92
|
|
|
84
93
|
/*
|
|
85
94
|
Stop watching resources through this channel.
|
|
86
95
|
*/
|
|
87
|
-
await gapi.client.admin.channels.stop({
|
|
96
|
+
await gapi.client.admin.channels.stop({});
|
|
88
97
|
|
|
89
98
|
/*
|
|
90
99
|
Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information about the customer report's parameters, see the Customers Usage parameters reference guides.
|
|
91
100
|
*/
|
|
92
|
-
await gapi.client.reports.customerUsageReports.get({
|
|
101
|
+
await gapi.client.reports.customerUsageReports.get({date: 'date'});
|
|
93
102
|
|
|
94
103
|
/*
|
|
95
104
|
Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more information about the entities report's parameters, see the Entities Usage parameters reference guides.
|
|
96
105
|
*/
|
|
97
|
-
await gapi.client.reports.entityUsageReports.get({
|
|
106
|
+
await gapi.client.reports.entityUsageReports.get({
|
|
107
|
+
date: 'date',
|
|
108
|
+
entityKey: 'entityKey',
|
|
109
|
+
entityType: 'entityType',
|
|
110
|
+
});
|
|
98
111
|
|
|
99
112
|
/*
|
|
100
113
|
Retrieves a report which is a collection of properties and statistics for a set of users with the account. For more information, see the User Usage Report guide. For more information about the user report's parameters, see the Users Usage parameters reference guides.
|
|
101
114
|
*/
|
|
102
|
-
await gapi.client.reports.userUsageReport.get({
|
|
115
|
+
await gapi.client.reports.userUsageReport.get({
|
|
116
|
+
date: 'date',
|
|
117
|
+
userKey: 'userKey',
|
|
118
|
+
});
|
|
103
119
|
```
|
package/tests.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/* This is stub file for gapi.client.admin-reports_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: 20231127
|
|
7
|
-
|
|
8
|
-
gapi.load('client', async () => {
|
|
9
|
-
/** now we can use gapi.client */
|
|
10
|
-
|
|
11
|
-
await gapi.client.load('https://admin.googleapis.com/$discovery/rest?version=reports_v1');
|
|
12
|
-
/** now we can use gapi.client.admin, gapi.client.reports */
|
|
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 audit reports for your G Suite domain */
|
|
19
|
-
'https://www.googleapis.com/auth/admin.reports.audit.readonly',
|
|
20
|
-
/** View usage reports for your G Suite domain */
|
|
21
|
-
'https://www.googleapis.com/auth/admin.reports.usage.readonly',
|
|
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
|
-
/** Stop watching resources through this channel. */
|
|
35
|
-
await gapi.client.admin.channels.stop({
|
|
36
|
-
}, {
|
|
37
|
-
address: "Test string",
|
|
38
|
-
expiration: "Test string",
|
|
39
|
-
id: "Test string",
|
|
40
|
-
kind: "Test string",
|
|
41
|
-
params: {
|
|
42
|
-
A: "Test string"
|
|
43
|
-
},
|
|
44
|
-
payload: true,
|
|
45
|
-
resourceId: "Test string",
|
|
46
|
-
resourceUri: "Test string",
|
|
47
|
-
token: "Test string",
|
|
48
|
-
type: "Test string",
|
|
49
|
-
});
|
|
50
|
-
/**
|
|
51
|
-
* Retrieves a list of activities for a specific customer's account and application such as the Admin console application or the Google Drive application. For more information, see the
|
|
52
|
-
* guides for administrator and Google Drive activity reports. For more information about the activity report's parameters, see the activity parameters reference guides.
|
|
53
|
-
*/
|
|
54
|
-
await gapi.client.reports.activities.list({
|
|
55
|
-
actorIpAddress: "Test string",
|
|
56
|
-
applicationName: "Test string",
|
|
57
|
-
customerId: "Test string",
|
|
58
|
-
endTime: "Test string",
|
|
59
|
-
eventName: "Test string",
|
|
60
|
-
filters: "Test string",
|
|
61
|
-
groupIdFilter: "Test string",
|
|
62
|
-
maxResults: 42,
|
|
63
|
-
orgUnitID: "Test string",
|
|
64
|
-
pageToken: "Test string",
|
|
65
|
-
startTime: "Test string",
|
|
66
|
-
userKey: "Test string",
|
|
67
|
-
});
|
|
68
|
-
/** Start receiving notifications for account activities. For more information, see Receiving Push Notifications. */
|
|
69
|
-
await gapi.client.reports.activities.watch({
|
|
70
|
-
actorIpAddress: "Test string",
|
|
71
|
-
applicationName: "Test string",
|
|
72
|
-
customerId: "Test string",
|
|
73
|
-
endTime: "Test string",
|
|
74
|
-
eventName: "Test string",
|
|
75
|
-
filters: "Test string",
|
|
76
|
-
groupIdFilter: "Test string",
|
|
77
|
-
maxResults: 42,
|
|
78
|
-
orgUnitID: "Test string",
|
|
79
|
-
pageToken: "Test string",
|
|
80
|
-
startTime: "Test string",
|
|
81
|
-
userKey: "Test string",
|
|
82
|
-
}, {
|
|
83
|
-
address: "Test string",
|
|
84
|
-
expiration: "Test string",
|
|
85
|
-
id: "Test string",
|
|
86
|
-
kind: "Test string",
|
|
87
|
-
params: {
|
|
88
|
-
A: "Test string"
|
|
89
|
-
},
|
|
90
|
-
payload: true,
|
|
91
|
-
resourceId: "Test string",
|
|
92
|
-
resourceUri: "Test string",
|
|
93
|
-
token: "Test string",
|
|
94
|
-
type: "Test string",
|
|
95
|
-
});
|
|
96
|
-
/**
|
|
97
|
-
* Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information
|
|
98
|
-
* about the customer report's parameters, see the Customers Usage parameters reference guides.
|
|
99
|
-
*/
|
|
100
|
-
await gapi.client.reports.customerUsageReports.get({
|
|
101
|
-
customerId: "Test string",
|
|
102
|
-
date: "Test string",
|
|
103
|
-
pageToken: "Test string",
|
|
104
|
-
parameters: "Test string",
|
|
105
|
-
});
|
|
106
|
-
/**
|
|
107
|
-
* Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more
|
|
108
|
-
* information about the entities report's parameters, see the Entities Usage parameters reference guides.
|
|
109
|
-
*/
|
|
110
|
-
await gapi.client.reports.entityUsageReports.get({
|
|
111
|
-
customerId: "Test string",
|
|
112
|
-
date: "Test string",
|
|
113
|
-
entityKey: "Test string",
|
|
114
|
-
entityType: "Test string",
|
|
115
|
-
filters: "Test string",
|
|
116
|
-
maxResults: 42,
|
|
117
|
-
pageToken: "Test string",
|
|
118
|
-
parameters: "Test string",
|
|
119
|
-
});
|
|
120
|
-
/**
|
|
121
|
-
* Retrieves a report which is a collection of properties and statistics for a set of users with the account. For more information, see the User Usage Report guide. For more information
|
|
122
|
-
* about the user report's parameters, see the Users Usage parameters reference guides.
|
|
123
|
-
*/
|
|
124
|
-
await gapi.client.reports.userUsageReport.get({
|
|
125
|
-
customerId: "Test string",
|
|
126
|
-
date: "Test string",
|
|
127
|
-
filters: "Test string",
|
|
128
|
-
groupIdFilter: "Test string",
|
|
129
|
-
maxResults: 42,
|
|
130
|
-
orgUnitID: "Test string",
|
|
131
|
-
pageToken: "Test string",
|
|
132
|
-
parameters: "Test string",
|
|
133
|
-
userKey: "Test string",
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
});
|
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
|
-
}
|