Skip to content

Commit 9e0dc2c

Browse files
authored
fix: google client interface (#235)
Fix the google client interface, using the correct response types and parameters
1 parent 592054f commit 9e0dc2c

File tree

1 file changed

+8
-11
lines changed
  • packages/spacecat-shared-google-client/src

1 file changed

+8
-11
lines changed

packages/spacecat-shared-google-client/src/index.d.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ import { OAuth2Client } from 'google-auth-library';
1616
export default class GoogleClient {
1717
/**
1818
* Static factory method to create an instance of GoogleClient.
19+
*
1920
* @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.
2622
* @returns An instance of GoogleClient.
2723
*/
28-
static createFrom(context: UniversalContext, config: object): GoogleClient;
24+
static createFrom(context: UniversalContext, url: string): GoogleClient;
2925

3026
/**
3127
* Constructor for creating an instance of GoogleClient.
@@ -36,13 +32,14 @@ export default class GoogleClient {
3632

3733
/**
3834
* Retrieves the Google Search Console data for the specified date range.
35+
*
3936
* @param baseURL - The base URL of the site to be audited.
4037
* @param startDate - The start date of the date range.
4138
* @param endDate - The end date of the date range.
4239
* @param dimensions - The dimensions to be included in the report.
4340
* this parameter is optional and defaults to ['date'],
4441
* 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.
4643
* Format: {
4744
* "rows": [
4845
* {
@@ -63,12 +60,12 @@ export default class GoogleClient {
6360
startDate: Date,
6461
endDate: Date,
6562
dimensions: string[]
66-
): Promise<Response>;
63+
): Promise<JSON>;
6764

6865
/**
6966
* Lists all sites available to the authenticated user in Google Search Console.
7067
*
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.
7269
* @throws {Error} If an error occurs while retrieving the sites.
7370
* Format: {
7471
* "data": {
@@ -81,5 +78,5 @@ export default class GoogleClient {
8178
* }
8279
*}
8380
* */
84-
listSites(): Promise<Response>;
81+
listSites(): Promise<JSON>;
8582
}

0 commit comments

Comments
 (0)