@maxim_mazurok/gapi.client.analyticsadmin-v1alpha 0.0.20231114 → 0.0.20231128
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 +7358 -11016
- package/package.json +6 -6
- package/readme.md +74 -49
- package/tests.ts +0 -1945
- 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.analyticsadmin-v1alpha",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231128",
|
|
4
4
|
"description": "TypeScript typings for Google Analytics Admin API v1alpha",
|
|
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://analyticsadmin.googleapis.com/$discovery/rest?version=v1alpha',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.analyticsadmin
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,183 +48,205 @@ 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
|
+
// Edit Google Analytics management entities
|
|
52
|
+
'https://www.googleapis.com/auth/analytics.edit',
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
// Manage Google Analytics Account users by email address
|
|
55
|
+
'https://www.googleapis.com/auth/analytics.manage.users',
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
// View Google Analytics user permissions
|
|
58
|
+
'https://www.googleapis.com/auth/analytics.manage.users.readonly',
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
// See and download your Google Analytics data
|
|
61
|
+
'https://www.googleapis.com/auth/analytics.readonly',
|
|
62
|
+
],
|
|
63
|
+
immediate = true;
|
|
61
64
|
// ...
|
|
62
65
|
|
|
63
66
|
gapi.auth.authorize(
|
|
64
|
-
{
|
|
67
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
65
68
|
authResult => {
|
|
66
69
|
if (authResult && !authResult.error) {
|
|
67
|
-
|
|
70
|
+
/* handle successful authorization */
|
|
68
71
|
} else {
|
|
69
|
-
|
|
72
|
+
/* handle authorization error */
|
|
70
73
|
}
|
|
71
|
-
}
|
|
74
|
+
}
|
|
75
|
+
);
|
|
72
76
|
```
|
|
73
77
|
|
|
74
78
|
After that you can use Google Analytics Admin API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
75
79
|
|
|
76
80
|
```typescript
|
|
77
|
-
|
|
78
81
|
/*
|
|
79
82
|
Marks target Account as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI. If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.
|
|
80
83
|
*/
|
|
81
|
-
await gapi.client.analyticsadmin.accounts.delete({
|
|
84
|
+
await gapi.client.analyticsadmin.accounts.delete({name: 'name'});
|
|
82
85
|
|
|
83
86
|
/*
|
|
84
87
|
Lookup for a single Account.
|
|
85
88
|
*/
|
|
86
|
-
await gapi.client.analyticsadmin.accounts.get({
|
|
89
|
+
await gapi.client.analyticsadmin.accounts.get({name: 'name'});
|
|
87
90
|
|
|
88
91
|
/*
|
|
89
92
|
Get data sharing settings on an account. Data sharing settings are singletons.
|
|
90
93
|
*/
|
|
91
|
-
await gapi.client.analyticsadmin.accounts.getDataSharingSettings({
|
|
94
|
+
await gapi.client.analyticsadmin.accounts.getDataSharingSettings({
|
|
95
|
+
name: 'name',
|
|
96
|
+
});
|
|
92
97
|
|
|
93
98
|
/*
|
|
94
99
|
Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: "trashed") accounts are excluded by default. Returns an empty list if no relevant accounts are found.
|
|
95
100
|
*/
|
|
96
|
-
await gapi.client.analyticsadmin.accounts.list({
|
|
101
|
+
await gapi.client.analyticsadmin.accounts.list({});
|
|
97
102
|
|
|
98
103
|
/*
|
|
99
104
|
Updates an account.
|
|
100
105
|
*/
|
|
101
|
-
await gapi.client.analyticsadmin.accounts.patch({
|
|
106
|
+
await gapi.client.analyticsadmin.accounts.patch({name: 'name'});
|
|
102
107
|
|
|
103
108
|
/*
|
|
104
109
|
Requests a ticket for creating an account.
|
|
105
110
|
*/
|
|
106
|
-
await gapi.client.analyticsadmin.accounts.provisionAccountTicket({
|
|
111
|
+
await gapi.client.analyticsadmin.accounts.provisionAccountTicket({});
|
|
107
112
|
|
|
108
113
|
/*
|
|
109
114
|
Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. The property must be in Google Analytics 360. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).
|
|
110
115
|
*/
|
|
111
|
-
await gapi.client.analyticsadmin.accounts.runAccessReport({
|
|
116
|
+
await gapi.client.analyticsadmin.accounts.runAccessReport({entity: 'entity'});
|
|
112
117
|
|
|
113
118
|
/*
|
|
114
119
|
Searches through all changes to an account or its children given the specified set of filters.
|
|
115
120
|
*/
|
|
116
|
-
await gapi.client.analyticsadmin.accounts.searchChangeHistoryEvents({
|
|
121
|
+
await gapi.client.analyticsadmin.accounts.searchChangeHistoryEvents({
|
|
122
|
+
account: 'account',
|
|
123
|
+
});
|
|
117
124
|
|
|
118
125
|
/*
|
|
119
126
|
Returns summaries of all accounts accessible by the caller.
|
|
120
127
|
*/
|
|
121
|
-
await gapi.client.analyticsadmin.accountSummaries.list({
|
|
128
|
+
await gapi.client.analyticsadmin.accountSummaries.list({});
|
|
122
129
|
|
|
123
130
|
/*
|
|
124
131
|
Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or through this API) before MeasurementProtocolSecret resources may be created.
|
|
125
132
|
*/
|
|
126
|
-
await gapi.client.analyticsadmin.properties.acknowledgeUserDataCollection({
|
|
133
|
+
await gapi.client.analyticsadmin.properties.acknowledgeUserDataCollection({
|
|
134
|
+
property: 'property',
|
|
135
|
+
});
|
|
127
136
|
|
|
128
137
|
/*
|
|
129
138
|
Creates an "GA4" property with the specified location and attributes.
|
|
130
139
|
*/
|
|
131
|
-
await gapi.client.analyticsadmin.properties.create({
|
|
140
|
+
await gapi.client.analyticsadmin.properties.create({});
|
|
132
141
|
|
|
133
142
|
/*
|
|
134
143
|
Creates a connected site tag for a Universal Analytics property. You can create a maximum of 20 connected site tags per property. Note: This API cannot be used on GA4 properties.
|
|
135
144
|
*/
|
|
136
|
-
await gapi.client.analyticsadmin.properties.createConnectedSiteTag({
|
|
145
|
+
await gapi.client.analyticsadmin.properties.createConnectedSiteTag({});
|
|
137
146
|
|
|
138
147
|
/*
|
|
139
148
|
Create a roll-up property and all roll-up property source links.
|
|
140
149
|
*/
|
|
141
|
-
await gapi.client.analyticsadmin.properties.createRollupProperty({
|
|
150
|
+
await gapi.client.analyticsadmin.properties.createRollupProperty({});
|
|
142
151
|
|
|
143
152
|
/*
|
|
144
153
|
Create a subproperty and a subproperty event filter that applies to the created subproperty.
|
|
145
154
|
*/
|
|
146
|
-
await gapi.client.analyticsadmin.properties.createSubproperty({
|
|
155
|
+
await gapi.client.analyticsadmin.properties.createSubproperty({});
|
|
147
156
|
|
|
148
157
|
/*
|
|
149
158
|
Marks target Property as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not a GA4 Property.
|
|
150
159
|
*/
|
|
151
|
-
await gapi.client.analyticsadmin.properties.delete({
|
|
160
|
+
await gapi.client.analyticsadmin.properties.delete({name: 'name'});
|
|
152
161
|
|
|
153
162
|
/*
|
|
154
163
|
Deletes a connected site tag for a Universal Analytics property. Note: this has no effect on GA4 properties.
|
|
155
164
|
*/
|
|
156
|
-
await gapi.client.analyticsadmin.properties.deleteConnectedSiteTag({
|
|
165
|
+
await gapi.client.analyticsadmin.properties.deleteConnectedSiteTag({});
|
|
157
166
|
|
|
158
167
|
/*
|
|
159
168
|
Fetches the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.
|
|
160
169
|
*/
|
|
161
|
-
await gapi.client.analyticsadmin.properties.fetchAutomatedGa4ConfigurationOptOut(
|
|
170
|
+
await gapi.client.analyticsadmin.properties.fetchAutomatedGa4ConfigurationOptOut(
|
|
171
|
+
{}
|
|
172
|
+
);
|
|
162
173
|
|
|
163
174
|
/*
|
|
164
175
|
Given a specified UA property, looks up the GA4 property connected to it. Note: this cannot be used with GA4 properties.
|
|
165
176
|
*/
|
|
166
|
-
await gapi.client.analyticsadmin.properties.fetchConnectedGa4Property({
|
|
177
|
+
await gapi.client.analyticsadmin.properties.fetchConnectedGa4Property({});
|
|
167
178
|
|
|
168
179
|
/*
|
|
169
180
|
Lookup for a single "GA4" Property.
|
|
170
181
|
*/
|
|
171
|
-
await gapi.client.analyticsadmin.properties.get({
|
|
182
|
+
await gapi.client.analyticsadmin.properties.get({name: 'name'});
|
|
172
183
|
|
|
173
184
|
/*
|
|
174
185
|
Lookup for a AttributionSettings singleton.
|
|
175
186
|
*/
|
|
176
|
-
await gapi.client.analyticsadmin.properties.getAttributionSettings({
|
|
187
|
+
await gapi.client.analyticsadmin.properties.getAttributionSettings({
|
|
188
|
+
name: 'name',
|
|
189
|
+
});
|
|
177
190
|
|
|
178
191
|
/*
|
|
179
192
|
Returns the singleton data retention settings for this property.
|
|
180
193
|
*/
|
|
181
|
-
await gapi.client.analyticsadmin.properties.getDataRetentionSettings({
|
|
194
|
+
await gapi.client.analyticsadmin.properties.getDataRetentionSettings({
|
|
195
|
+
name: 'name',
|
|
196
|
+
});
|
|
182
197
|
|
|
183
198
|
/*
|
|
184
199
|
Lookup for Google Signals settings for a property.
|
|
185
200
|
*/
|
|
186
|
-
await gapi.client.analyticsadmin.properties.getGoogleSignalsSettings({
|
|
201
|
+
await gapi.client.analyticsadmin.properties.getGoogleSignalsSettings({
|
|
202
|
+
name: 'name',
|
|
203
|
+
});
|
|
187
204
|
|
|
188
205
|
/*
|
|
189
206
|
Returns child Properties under the specified parent Account. Only "GA4" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: "trashed") properties are excluded by default. Returns an empty list if no relevant properties are found.
|
|
190
207
|
*/
|
|
191
|
-
await gapi.client.analyticsadmin.properties.list({
|
|
208
|
+
await gapi.client.analyticsadmin.properties.list({});
|
|
192
209
|
|
|
193
210
|
/*
|
|
194
211
|
Lists the connected site tags for a Universal Analytics property. A maximum of 20 connected site tags will be returned. Note: this has no effect on GA4 property.
|
|
195
212
|
*/
|
|
196
|
-
await gapi.client.analyticsadmin.properties.listConnectedSiteTags({
|
|
213
|
+
await gapi.client.analyticsadmin.properties.listConnectedSiteTags({});
|
|
197
214
|
|
|
198
215
|
/*
|
|
199
216
|
Updates a property.
|
|
200
217
|
*/
|
|
201
|
-
await gapi.client.analyticsadmin.properties.patch({
|
|
218
|
+
await gapi.client.analyticsadmin.properties.patch({name: 'name'});
|
|
202
219
|
|
|
203
220
|
/*
|
|
204
221
|
Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. The property must be in Google Analytics 360. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).
|
|
205
222
|
*/
|
|
206
|
-
await gapi.client.analyticsadmin.properties.runAccessReport({
|
|
223
|
+
await gapi.client.analyticsadmin.properties.runAccessReport({entity: 'entity'});
|
|
207
224
|
|
|
208
225
|
/*
|
|
209
226
|
Sets the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.
|
|
210
227
|
*/
|
|
211
|
-
await gapi.client.analyticsadmin.properties.setAutomatedGa4ConfigurationOptOut(
|
|
228
|
+
await gapi.client.analyticsadmin.properties.setAutomatedGa4ConfigurationOptOut(
|
|
229
|
+
{}
|
|
230
|
+
);
|
|
212
231
|
|
|
213
232
|
/*
|
|
214
233
|
Updates attribution settings on a property.
|
|
215
234
|
*/
|
|
216
|
-
await gapi.client.analyticsadmin.properties.updateAttributionSettings({
|
|
235
|
+
await gapi.client.analyticsadmin.properties.updateAttributionSettings({
|
|
236
|
+
name: 'name',
|
|
237
|
+
});
|
|
217
238
|
|
|
218
239
|
/*
|
|
219
240
|
Updates the singleton data retention settings for this property.
|
|
220
241
|
*/
|
|
221
|
-
await gapi.client.analyticsadmin.properties.updateDataRetentionSettings({
|
|
242
|
+
await gapi.client.analyticsadmin.properties.updateDataRetentionSettings({
|
|
243
|
+
name: 'name',
|
|
244
|
+
});
|
|
222
245
|
|
|
223
246
|
/*
|
|
224
247
|
Updates Google Signals settings for a property.
|
|
225
248
|
*/
|
|
226
|
-
await gapi.client.analyticsadmin.properties.updateGoogleSignalsSettings({
|
|
249
|
+
await gapi.client.analyticsadmin.properties.updateGoogleSignalsSettings({
|
|
250
|
+
name: 'name',
|
|
251
|
+
});
|
|
227
252
|
```
|