@adobe/spacecat-shared-google-client 1.0.0 → 1.0.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-google-client-v1.0.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-google-client-v1.0.0...@adobe/spacecat-shared-google-client-v1.0.1) (2024-05-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * google client interface ([#235](https://github.com/adobe/spacecat-shared/issues/235)) ([9e0dc2c](https://github.com/adobe/spacecat-shared/commit/9e0dc2cdc080411597f47319b5dcc2bedf764ada))
7
+
1
8
  # @adobe/spacecat-shared-google-client-v1.0.0 (2024-05-21)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-google-client",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Shared modules of the Spacecat Services - Google Client",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.d.ts CHANGED
@@ -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
  }