v5.d.ts
12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { OAuth2Client, JWT, Compute, UserRefreshClient } from 'google-auth-library';
import { GoogleConfigurable, MethodOptions, GlobalOptions, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { GaxiosPromise } from 'gaxios';
export declare namespace pagespeedonline_v5 {
export interface Options extends GlobalOptions {
version: 'v5';
}
interface StandardParameters {
/**
* Data format for the response.
*/
alt?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* 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.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
*/
quotaUser?: string;
/**
* Deprecated. Please use quotaUser instead.
*/
userIp?: string;
}
/**
* PageSpeed Insights API
*
* Analyzes the performance of a web page and provides tailored suggestions to make that page faster.
*
* @example
* const {google} = require('googleapis');
* const pagespeedonline = google.pagespeedonline('v5');
*
* @namespace pagespeedonline
* @type {Function}
* @version v5
* @variation v5
* @param {object=} options Options for Pagespeedonline
*/
export class Pagespeedonline {
context: APIRequestContext;
pagespeedapi: Resource$Pagespeedapi;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
export interface Schema$GoogleprotobufListValue {
}
export interface Schema$GoogleprotobufValue {
}
export interface Schema$LighthouseAuditResultV5 {
/**
* The description of the audit.
*/
description?: string | null;
/**
* Freeform details section of the audit.
*/
details?: {
[key: string]: any;
} | null;
/**
* The value that should be displayed on the UI for this audit.
*/
displayValue?: string | null;
/**
* An error message from a thrown error inside the audit.
*/
errorMessage?: string | null;
/**
* An explanation of the errors in the audit.
*/
explanation?: string | null;
/**
* The audit's id.
*/
id?: string | null;
score?: any | null;
/**
* The enumerated score display mode.
*/
scoreDisplayMode?: string | null;
/**
* The human readable title.
*/
title?: string | null;
warnings?: any | null;
}
export interface Schema$LighthouseCategoryV5 {
/**
* An array of references to all the audit members of this category.
*/
auditRefs?: Array<{
group?: string;
id?: string;
weight?: number;
}> | null;
/**
* A more detailed description of the category and its importance.
*/
description?: string | null;
/**
* The string identifier of the category.
*/
id?: string | null;
/**
* A description for the manual audits in the category.
*/
manualDescription?: string | null;
score?: any | null;
/**
* The human-friendly name of the category.
*/
title?: string | null;
}
export interface Schema$LighthouseResultV5 {
/**
* Map of audits in the LHR.
*/
audits?: {
[key: string]: Schema$LighthouseAuditResultV5;
} | null;
/**
* Map of categories in the LHR.
*/
categories?: {
accessibility?: Schema$LighthouseCategoryV5;
'best-practices'?: Schema$LighthouseCategoryV5;
performance?: Schema$LighthouseCategoryV5;
pwa?: Schema$LighthouseCategoryV5;
seo?: Schema$LighthouseCategoryV5;
} | null;
/**
* Map of category groups in the LHR.
*/
categoryGroups?: {
[key: string]: {
description?: string;
title?: string;
};
} | null;
/**
* The configuration settings for this LHR.
*/
configSettings?: {
emulatedFormFactor?: string;
locale?: string;
onlyCategories?: any;
} | null;
/**
* Environment settings that were used when making this LHR.
*/
environment?: {
benchmarkIndex?: number;
hostUserAgent?: string;
networkUserAgent?: string;
} | null;
/**
* The time that this run was fetched.
*/
fetchTime?: string | null;
/**
* The final resolved url that was audited.
*/
finalUrl?: string | null;
/**
* The internationalization strings that are required to render the LHR.
*/
i18n?: {
rendererFormattedStrings?: {
auditGroupExpandTooltip?: string;
crcInitialNavigation?: string;
crcLongestDurationLabel?: string;
errorLabel?: string;
errorMissingAuditInfo?: string;
labDataTitle?: string;
lsPerformanceCategoryDescription?: string;
manualAuditsGroupTitle?: string;
notApplicableAuditsGroupTitle?: string;
opportunityResourceColumnLabel?: string;
opportunitySavingsColumnLabel?: string;
passedAuditsGroupTitle?: string;
scorescaleLabel?: string;
toplevelWarningsMessage?: string;
varianceDisclaimer?: string;
warningHeader?: string;
};
} | null;
/**
* The lighthouse version that was used to generate this LHR.
*/
lighthouseVersion?: string | null;
/**
* The original requested url.
*/
requestedUrl?: string | null;
/**
* A top-level error message that, if present, indicates a serious enough problem that this Lighthouse result may need to be discarded.
*/
runtimeError?: {
code?: string;
message?: string;
} | null;
/**
* List of all run warnings in the LHR. Will always output to at least `[]`.
*/
runWarnings?: Schema$GoogleprotobufListValue;
/**
* The Stack Pack advice strings.
*/
stackPacks?: Array<{
descriptions?: {
[key: string]: string;
};
iconDataURL?: string;
id?: string;
title?: string;
}> | null;
/**
* Timing information for this LHR.
*/
timing?: {
total?: number;
} | null;
/**
* The user agent that was used to run this LHR.
*/
userAgent?: string | null;
}
export interface Schema$PagespeedApiLoadingExperienceV5 {
/**
* The url, pattern or origin which the metrics are on.
*/
id?: string | null;
initial_url?: string | null;
metrics?: {
[key: string]: {
category?: string;
distributions?: Array<{
max?: number;
min?: number;
proportion?: number;
}>;
percentile?: number;
};
} | null;
overall_category?: string | null;
}
export interface Schema$PagespeedApiPagespeedResponseV5 {
/**
* The UTC timestamp of this analysis.
*/
analysisUTCTimestamp?: string | null;
/**
* The captcha verify result
*/
captchaResult?: string | null;
/**
* Canonicalized and final URL for the document, after following page redirects (if any).
*/
id?: string | null;
/**
* Kind of result.
*/
kind?: string | null;
/**
* Lighthouse response for the audit url as an object.
*/
lighthouseResult?: Schema$LighthouseResultV5;
/**
* Metrics of end users' page loading experience.
*/
loadingExperience?: Schema$PagespeedApiLoadingExperienceV5;
/**
* Metrics of the aggregated page loading experience of the origin
*/
originLoadingExperience?: Schema$PagespeedApiLoadingExperienceV5;
/**
* The version of PageSpeed used to generate these results.
*/
version?: {
major?: number;
minor?: number;
} | null;
}
export class Resource$Pagespeedapi {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* pagespeedonline.pagespeedapi.runpagespeed
* @desc Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information.
* @alias pagespeedonline.pagespeedapi.runpagespeed
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string=} params.category A Lighthouse category to run; if none are given, only Performance category will be run
* @param {string=} params.locale The locale used to localize formatted results
* @param {string=} params.strategy The analysis strategy (desktop or mobile) to use, and desktop is the default
* @param {string} params.url The URL to fetch and analyze
* @param {string=} params.utm_campaign Campaign name for analytics.
* @param {string=} params.utm_source Campaign source for analytics.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
runpagespeed(params?: Params$Resource$Pagespeedapi$Runpagespeed, options?: MethodOptions): GaxiosPromise<Schema$PagespeedApiPagespeedResponseV5>;
runpagespeed(params: Params$Resource$Pagespeedapi$Runpagespeed, options: MethodOptions | BodyResponseCallback<Schema$PagespeedApiPagespeedResponseV5>, callback: BodyResponseCallback<Schema$PagespeedApiPagespeedResponseV5>): void;
runpagespeed(params: Params$Resource$Pagespeedapi$Runpagespeed, callback: BodyResponseCallback<Schema$PagespeedApiPagespeedResponseV5>): void;
runpagespeed(callback: BodyResponseCallback<Schema$PagespeedApiPagespeedResponseV5>): void;
}
export interface Params$Resource$Pagespeedapi$Runpagespeed extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* A Lighthouse category to run; if none are given, only Performance category will be run
*/
category?: string[];
/**
* The locale used to localize formatted results
*/
locale?: string;
/**
* The analysis strategy (desktop or mobile) to use, and desktop is the default
*/
strategy?: string;
/**
* The URL to fetch and analyze
*/
url?: string;
/**
* Campaign name for analytics.
*/
utm_campaign?: string;
/**
* Campaign source for analytics.
*/
utm_source?: string;
}
export {};
}