@@ -16,16 +16,12 @@ import { OAuth2Client } from 'google-auth-library';
16
16
export default class GoogleClient {
17
17
/**
18
18
* Static factory method to create an instance of GoogleClient.
19
+ *
19
20
* @param {UniversalContext } context - An object containing the AWS Lambda context information
20
- * @param {object } config - The configuration object:
21
- * {
22
- * ACCESS_TOKEN: string,
23
- * REFRESH_TOKEN: string,
24
- * EXPIRATION: number,
25
- * }
21
+ * @param {string } url - The URL of the site to be audited.
26
22
* @returns An instance of GoogleClient.
27
23
*/
28
- static createFrom ( context : UniversalContext , config : object ) : GoogleClient ;
24
+ static createFrom ( context : UniversalContext , url : string ) : GoogleClient ;
29
25
30
26
/**
31
27
* Constructor for creating an instance of GoogleClient.
@@ -36,13 +32,14 @@ export default class GoogleClient {
36
32
37
33
/**
38
34
* Retrieves the Google Search Console data for the specified date range.
35
+ *
39
36
* @param baseURL - The base URL of the site to be audited.
40
37
* @param startDate - The start date of the date range.
41
38
* @param endDate - The end date of the date range.
42
39
* @param dimensions - The dimensions to be included in the report.
43
40
* this parameter is optional and defaults to ['date'],
44
41
* which means that the report will be grouped by date.
45
- * @returns {Promise<Response > } The Google Search Console data.
42
+ * @returns {Promise<JSON > } The Google Search Console data.
46
43
* Format: {
47
44
* "rows": [
48
45
* {
@@ -63,12 +60,12 @@ export default class GoogleClient {
63
60
startDate : Date ,
64
61
endDate : Date ,
65
62
dimensions : string [ ]
66
- ) : Promise < Response > ;
63
+ ) : Promise < JSON > ;
67
64
68
65
/**
69
66
* Lists all sites available to the authenticated user in Google Search Console.
70
67
*
71
- * @returns {Promise<Response > } A promise that resolves to the result of the list sites operation.
68
+ * @returns {Promise<JSON > } A promise that resolves to the result of the list sites operation.
72
69
* @throws {Error } If an error occurs while retrieving the sites.
73
70
* Format: {
74
71
* "data": {
@@ -81,5 +78,5 @@ export default class GoogleClient {
81
78
* }
82
79
*}
83
80
* */
84
- listSites ( ) : Promise < Response > ;
81
+ listSites ( ) : Promise < JSON > ;
85
82
}
0 commit comments