@maxim_mazurok/gapi.client.youtube_analytics-v2 0.0.20231128 → 0.0.20231201
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 +478 -765
- package/package.json +6 -6
- package/readme.md +32 -29
- package/tests.ts +0 -176
- 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.youtube_analytics-v2",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231201",
|
|
4
4
|
"description": "TypeScript typings for YouTube Analytics API v2",
|
|
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,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://youtubeanalytics.googleapis.com/$discovery/rest?version=v2',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.youtubeAnalytics
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,76 +48,76 @@ 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
|
-
|
|
51
|
+
// Manage your YouTube account
|
|
52
|
+
'https://www.googleapis.com/auth/youtube',
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
// View your YouTube account
|
|
55
|
+
'https://www.googleapis.com/auth/youtube.readonly',
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
// View and manage your assets and associated content on YouTube
|
|
58
|
+
'https://www.googleapis.com/auth/youtubepartner',
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
// View monetary and non-monetary YouTube Analytics reports for your YouTube content
|
|
61
|
+
'https://www.googleapis.com/auth/yt-analytics-monetary.readonly',
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
// View YouTube Analytics reports for your YouTube content
|
|
64
|
+
'https://www.googleapis.com/auth/yt-analytics.readonly',
|
|
65
|
+
],
|
|
66
|
+
immediate = true;
|
|
64
67
|
// ...
|
|
65
68
|
|
|
66
69
|
gapi.auth.authorize(
|
|
67
|
-
{
|
|
70
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
68
71
|
authResult => {
|
|
69
72
|
if (authResult && !authResult.error) {
|
|
70
|
-
|
|
73
|
+
/* handle successful authorization */
|
|
71
74
|
} else {
|
|
72
|
-
|
|
75
|
+
/* handle authorization error */
|
|
73
76
|
}
|
|
74
|
-
}
|
|
77
|
+
}
|
|
78
|
+
);
|
|
75
79
|
```
|
|
76
80
|
|
|
77
81
|
After that you can use YouTube Analytics API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
78
82
|
|
|
79
83
|
```typescript
|
|
80
|
-
|
|
81
84
|
/*
|
|
82
85
|
Removes an item from a group.
|
|
83
86
|
*/
|
|
84
|
-
await gapi.client.youtubeAnalytics.groupItems.delete({
|
|
87
|
+
await gapi.client.youtubeAnalytics.groupItems.delete({});
|
|
85
88
|
|
|
86
89
|
/*
|
|
87
90
|
Creates a group item.
|
|
88
91
|
*/
|
|
89
|
-
await gapi.client.youtubeAnalytics.groupItems.insert({
|
|
92
|
+
await gapi.client.youtubeAnalytics.groupItems.insert({});
|
|
90
93
|
|
|
91
94
|
/*
|
|
92
95
|
Returns a collection of group items that match the API request parameters.
|
|
93
96
|
*/
|
|
94
|
-
await gapi.client.youtubeAnalytics.groupItems.list({
|
|
97
|
+
await gapi.client.youtubeAnalytics.groupItems.list({});
|
|
95
98
|
|
|
96
99
|
/*
|
|
97
100
|
Deletes a group.
|
|
98
101
|
*/
|
|
99
|
-
await gapi.client.youtubeAnalytics.groups.delete({
|
|
102
|
+
await gapi.client.youtubeAnalytics.groups.delete({});
|
|
100
103
|
|
|
101
104
|
/*
|
|
102
105
|
Creates a group.
|
|
103
106
|
*/
|
|
104
|
-
await gapi.client.youtubeAnalytics.groups.insert({
|
|
107
|
+
await gapi.client.youtubeAnalytics.groups.insert({});
|
|
105
108
|
|
|
106
109
|
/*
|
|
107
110
|
Returns a collection of groups that match the API request parameters. For example, you can retrieve all groups that the authenticated user owns, or you can retrieve one or more groups by their unique IDs.
|
|
108
111
|
*/
|
|
109
|
-
await gapi.client.youtubeAnalytics.groups.list({
|
|
112
|
+
await gapi.client.youtubeAnalytics.groups.list({});
|
|
110
113
|
|
|
111
114
|
/*
|
|
112
115
|
Modifies a group. For example, you could change a group's title.
|
|
113
116
|
*/
|
|
114
|
-
await gapi.client.youtubeAnalytics.groups.update({
|
|
117
|
+
await gapi.client.youtubeAnalytics.groups.update({});
|
|
115
118
|
|
|
116
119
|
/*
|
|
117
120
|
Retrieve your YouTube Analytics reports.
|
|
118
121
|
*/
|
|
119
|
-
await gapi.client.youtubeAnalytics.reports.query({
|
|
122
|
+
await gapi.client.youtubeAnalytics.reports.query({});
|
|
120
123
|
```
|
package/tests.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/* This is stub file for gapi.client.youtube_analytics-v2 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: 20231128
|
|
7
|
-
|
|
8
|
-
gapi.load('client', async () => {
|
|
9
|
-
/** now we can use gapi.client */
|
|
10
|
-
|
|
11
|
-
await gapi.client.load('https://youtubeanalytics.googleapis.com/$discovery/rest?version=v2');
|
|
12
|
-
/** now we can use gapi.client.youtubeAnalytics */
|
|
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
|
-
/** Manage your YouTube account */
|
|
19
|
-
'https://www.googleapis.com/auth/youtube',
|
|
20
|
-
/** View your YouTube account */
|
|
21
|
-
'https://www.googleapis.com/auth/youtube.readonly',
|
|
22
|
-
/** View and manage your assets and associated content on YouTube */
|
|
23
|
-
'https://www.googleapis.com/auth/youtubepartner',
|
|
24
|
-
/** View monetary and non-monetary YouTube Analytics reports for your YouTube content */
|
|
25
|
-
'https://www.googleapis.com/auth/yt-analytics-monetary.readonly',
|
|
26
|
-
/** View YouTube Analytics reports for your YouTube content */
|
|
27
|
-
'https://www.googleapis.com/auth/yt-analytics.readonly',
|
|
28
|
-
];
|
|
29
|
-
const immediate = false;
|
|
30
|
-
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
31
|
-
if (authResult && !authResult.error) {
|
|
32
|
-
/** handle successful authorization */
|
|
33
|
-
run();
|
|
34
|
-
} else {
|
|
35
|
-
/** handle authorization error */
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
async function run() {
|
|
40
|
-
/** Removes an item from a group. */
|
|
41
|
-
await gapi.client.youtubeAnalytics.groupItems.delete({
|
|
42
|
-
id: "Test string",
|
|
43
|
-
onBehalfOfContentOwner: "Test string",
|
|
44
|
-
});
|
|
45
|
-
/** Creates a group item. */
|
|
46
|
-
await gapi.client.youtubeAnalytics.groupItems.insert({
|
|
47
|
-
onBehalfOfContentOwner: "Test string",
|
|
48
|
-
}, {
|
|
49
|
-
errors: {
|
|
50
|
-
code: "Test string",
|
|
51
|
-
error: [
|
|
52
|
-
{
|
|
53
|
-
argument: [
|
|
54
|
-
"Test string"
|
|
55
|
-
],
|
|
56
|
-
code: "Test string",
|
|
57
|
-
debugInfo: "Test string",
|
|
58
|
-
domain: "Test string",
|
|
59
|
-
externalErrorMessage: "Test string",
|
|
60
|
-
location: "Test string",
|
|
61
|
-
locationType: "Test string",
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
requestId: "Test string",
|
|
65
|
-
},
|
|
66
|
-
etag: "Test string",
|
|
67
|
-
groupId: "Test string",
|
|
68
|
-
id: "Test string",
|
|
69
|
-
kind: "Test string",
|
|
70
|
-
resource: {
|
|
71
|
-
id: "Test string",
|
|
72
|
-
kind: "Test string",
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
/** Returns a collection of group items that match the API request parameters. */
|
|
76
|
-
await gapi.client.youtubeAnalytics.groupItems.list({
|
|
77
|
-
groupId: "Test string",
|
|
78
|
-
onBehalfOfContentOwner: "Test string",
|
|
79
|
-
});
|
|
80
|
-
/** Deletes a group. */
|
|
81
|
-
await gapi.client.youtubeAnalytics.groups.delete({
|
|
82
|
-
id: "Test string",
|
|
83
|
-
onBehalfOfContentOwner: "Test string",
|
|
84
|
-
});
|
|
85
|
-
/** Creates a group. */
|
|
86
|
-
await gapi.client.youtubeAnalytics.groups.insert({
|
|
87
|
-
onBehalfOfContentOwner: "Test string",
|
|
88
|
-
}, {
|
|
89
|
-
contentDetails: {
|
|
90
|
-
itemCount: "Test string",
|
|
91
|
-
itemType: "Test string",
|
|
92
|
-
},
|
|
93
|
-
errors: {
|
|
94
|
-
code: "Test string",
|
|
95
|
-
error: [
|
|
96
|
-
{
|
|
97
|
-
argument: [
|
|
98
|
-
"Test string"
|
|
99
|
-
],
|
|
100
|
-
code: "Test string",
|
|
101
|
-
debugInfo: "Test string",
|
|
102
|
-
domain: "Test string",
|
|
103
|
-
externalErrorMessage: "Test string",
|
|
104
|
-
location: "Test string",
|
|
105
|
-
locationType: "Test string",
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
requestId: "Test string",
|
|
109
|
-
},
|
|
110
|
-
etag: "Test string",
|
|
111
|
-
id: "Test string",
|
|
112
|
-
kind: "Test string",
|
|
113
|
-
snippet: {
|
|
114
|
-
publishedAt: "Test string",
|
|
115
|
-
title: "Test string",
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
/**
|
|
119
|
-
* Returns a collection of groups that match the API request parameters. For example, you can retrieve all groups that the authenticated user owns, or you can retrieve one or more groups
|
|
120
|
-
* by their unique IDs.
|
|
121
|
-
*/
|
|
122
|
-
await gapi.client.youtubeAnalytics.groups.list({
|
|
123
|
-
id: "Test string",
|
|
124
|
-
mine: true,
|
|
125
|
-
onBehalfOfContentOwner: "Test string",
|
|
126
|
-
pageToken: "Test string",
|
|
127
|
-
});
|
|
128
|
-
/** Modifies a group. For example, you could change a group's title. */
|
|
129
|
-
await gapi.client.youtubeAnalytics.groups.update({
|
|
130
|
-
onBehalfOfContentOwner: "Test string",
|
|
131
|
-
}, {
|
|
132
|
-
contentDetails: {
|
|
133
|
-
itemCount: "Test string",
|
|
134
|
-
itemType: "Test string",
|
|
135
|
-
},
|
|
136
|
-
errors: {
|
|
137
|
-
code: "Test string",
|
|
138
|
-
error: [
|
|
139
|
-
{
|
|
140
|
-
argument: [
|
|
141
|
-
"Test string"
|
|
142
|
-
],
|
|
143
|
-
code: "Test string",
|
|
144
|
-
debugInfo: "Test string",
|
|
145
|
-
domain: "Test string",
|
|
146
|
-
externalErrorMessage: "Test string",
|
|
147
|
-
location: "Test string",
|
|
148
|
-
locationType: "Test string",
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
requestId: "Test string",
|
|
152
|
-
},
|
|
153
|
-
etag: "Test string",
|
|
154
|
-
id: "Test string",
|
|
155
|
-
kind: "Test string",
|
|
156
|
-
snippet: {
|
|
157
|
-
publishedAt: "Test string",
|
|
158
|
-
title: "Test string",
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
/** Retrieve your YouTube Analytics reports. */
|
|
162
|
-
await gapi.client.youtubeAnalytics.reports.query({
|
|
163
|
-
currency: "Test string",
|
|
164
|
-
dimensions: "Test string",
|
|
165
|
-
endDate: "Test string",
|
|
166
|
-
filters: "Test string",
|
|
167
|
-
ids: "Test string",
|
|
168
|
-
includeHistoricalChannelData: true,
|
|
169
|
-
maxResults: 42,
|
|
170
|
-
metrics: "Test string",
|
|
171
|
-
sort: "Test string",
|
|
172
|
-
startDate: "Test string",
|
|
173
|
-
startIndex: 42,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
});
|
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
|
-
}
|