@maxim_mazurok/gapi.client.analyticsadmin-v1beta 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 +2725 -4075
- package/package.json +6 -6
- package/readme.md +46 -33
- package/tests.ts +0 -711
- 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-v1beta",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231128",
|
|
4
4
|
"description": "TypeScript typings for Google Analytics Admin API v1beta",
|
|
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=v1beta',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.analyticsadmin
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,117 +48,127 @@ 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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
// See and download your Google Analytics data
|
|
55
|
+
'https://www.googleapis.com/auth/analytics.readonly',
|
|
56
|
+
],
|
|
57
|
+
immediate = true;
|
|
55
58
|
// ...
|
|
56
59
|
|
|
57
60
|
gapi.auth.authorize(
|
|
58
|
-
{
|
|
61
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
59
62
|
authResult => {
|
|
60
63
|
if (authResult && !authResult.error) {
|
|
61
|
-
|
|
64
|
+
/* handle successful authorization */
|
|
62
65
|
} else {
|
|
63
|
-
|
|
66
|
+
/* handle authorization error */
|
|
64
67
|
}
|
|
65
|
-
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
66
70
|
```
|
|
67
71
|
|
|
68
72
|
After that you can use Google Analytics Admin API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
73
|
|
|
70
74
|
```typescript
|
|
71
|
-
|
|
72
75
|
/*
|
|
73
76
|
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.
|
|
74
77
|
*/
|
|
75
|
-
await gapi.client.analyticsadmin.accounts.delete({
|
|
78
|
+
await gapi.client.analyticsadmin.accounts.delete({name: 'name'});
|
|
76
79
|
|
|
77
80
|
/*
|
|
78
81
|
Lookup for a single Account.
|
|
79
82
|
*/
|
|
80
|
-
await gapi.client.analyticsadmin.accounts.get({
|
|
83
|
+
await gapi.client.analyticsadmin.accounts.get({name: 'name'});
|
|
81
84
|
|
|
82
85
|
/*
|
|
83
86
|
Get data sharing settings on an account. Data sharing settings are singletons.
|
|
84
87
|
*/
|
|
85
|
-
await gapi.client.analyticsadmin.accounts.getDataSharingSettings({
|
|
88
|
+
await gapi.client.analyticsadmin.accounts.getDataSharingSettings({
|
|
89
|
+
name: 'name',
|
|
90
|
+
});
|
|
86
91
|
|
|
87
92
|
/*
|
|
88
93
|
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.
|
|
89
94
|
*/
|
|
90
|
-
await gapi.client.analyticsadmin.accounts.list({
|
|
95
|
+
await gapi.client.analyticsadmin.accounts.list({});
|
|
91
96
|
|
|
92
97
|
/*
|
|
93
98
|
Updates an account.
|
|
94
99
|
*/
|
|
95
|
-
await gapi.client.analyticsadmin.accounts.patch({
|
|
100
|
+
await gapi.client.analyticsadmin.accounts.patch({name: 'name'});
|
|
96
101
|
|
|
97
102
|
/*
|
|
98
103
|
Requests a ticket for creating an account.
|
|
99
104
|
*/
|
|
100
|
-
await gapi.client.analyticsadmin.accounts.provisionAccountTicket({
|
|
105
|
+
await gapi.client.analyticsadmin.accounts.provisionAccountTicket({});
|
|
101
106
|
|
|
102
107
|
/*
|
|
103
108
|
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).
|
|
104
109
|
*/
|
|
105
|
-
await gapi.client.analyticsadmin.accounts.runAccessReport({
|
|
110
|
+
await gapi.client.analyticsadmin.accounts.runAccessReport({entity: 'entity'});
|
|
106
111
|
|
|
107
112
|
/*
|
|
108
113
|
Searches through all changes to an account or its children given the specified set of filters.
|
|
109
114
|
*/
|
|
110
|
-
await gapi.client.analyticsadmin.accounts.searchChangeHistoryEvents({
|
|
115
|
+
await gapi.client.analyticsadmin.accounts.searchChangeHistoryEvents({
|
|
116
|
+
account: 'account',
|
|
117
|
+
});
|
|
111
118
|
|
|
112
119
|
/*
|
|
113
120
|
Returns summaries of all accounts accessible by the caller.
|
|
114
121
|
*/
|
|
115
|
-
await gapi.client.analyticsadmin.accountSummaries.list({
|
|
122
|
+
await gapi.client.analyticsadmin.accountSummaries.list({});
|
|
116
123
|
|
|
117
124
|
/*
|
|
118
125
|
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.
|
|
119
126
|
*/
|
|
120
|
-
await gapi.client.analyticsadmin.properties.acknowledgeUserDataCollection({
|
|
127
|
+
await gapi.client.analyticsadmin.properties.acknowledgeUserDataCollection({
|
|
128
|
+
property: 'property',
|
|
129
|
+
});
|
|
121
130
|
|
|
122
131
|
/*
|
|
123
132
|
Creates an "GA4" property with the specified location and attributes.
|
|
124
133
|
*/
|
|
125
|
-
await gapi.client.analyticsadmin.properties.create({
|
|
134
|
+
await gapi.client.analyticsadmin.properties.create({});
|
|
126
135
|
|
|
127
136
|
/*
|
|
128
137
|
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.
|
|
129
138
|
*/
|
|
130
|
-
await gapi.client.analyticsadmin.properties.delete({
|
|
139
|
+
await gapi.client.analyticsadmin.properties.delete({name: 'name'});
|
|
131
140
|
|
|
132
141
|
/*
|
|
133
142
|
Lookup for a single "GA4" Property.
|
|
134
143
|
*/
|
|
135
|
-
await gapi.client.analyticsadmin.properties.get({
|
|
144
|
+
await gapi.client.analyticsadmin.properties.get({name: 'name'});
|
|
136
145
|
|
|
137
146
|
/*
|
|
138
147
|
Returns the singleton data retention settings for this property.
|
|
139
148
|
*/
|
|
140
|
-
await gapi.client.analyticsadmin.properties.getDataRetentionSettings({
|
|
149
|
+
await gapi.client.analyticsadmin.properties.getDataRetentionSettings({
|
|
150
|
+
name: 'name',
|
|
151
|
+
});
|
|
141
152
|
|
|
142
153
|
/*
|
|
143
154
|
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.
|
|
144
155
|
*/
|
|
145
|
-
await gapi.client.analyticsadmin.properties.list({
|
|
156
|
+
await gapi.client.analyticsadmin.properties.list({});
|
|
146
157
|
|
|
147
158
|
/*
|
|
148
159
|
Updates a property.
|
|
149
160
|
*/
|
|
150
|
-
await gapi.client.analyticsadmin.properties.patch({
|
|
161
|
+
await gapi.client.analyticsadmin.properties.patch({name: 'name'});
|
|
151
162
|
|
|
152
163
|
/*
|
|
153
164
|
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).
|
|
154
165
|
*/
|
|
155
|
-
await gapi.client.analyticsadmin.properties.runAccessReport({
|
|
166
|
+
await gapi.client.analyticsadmin.properties.runAccessReport({entity: 'entity'});
|
|
156
167
|
|
|
157
168
|
/*
|
|
158
169
|
Updates the singleton data retention settings for this property.
|
|
159
170
|
*/
|
|
160
|
-
await gapi.client.analyticsadmin.properties.updateDataRetentionSettings({
|
|
171
|
+
await gapi.client.analyticsadmin.properties.updateDataRetentionSettings({
|
|
172
|
+
name: 'name',
|
|
173
|
+
});
|
|
161
174
|
```
|