@adobe/spacecat-shared-rum-api-client 1.3.6 → 1.4.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,17 @@
1
+ # [@adobe/spacecat-shared-rum-api-client-v1.4.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.4.0...@adobe/spacecat-shared-rum-api-client-v1.4.1) (2024-01-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add missing type declaration for SLACK_TARGETS ([#113](https://github.com/adobe/spacecat-shared/issues/113)) ([1658513](https://github.com/adobe/spacecat-shared/commit/1658513bc29b618f35ce31dfff88d26110525c7f))
7
+
8
+ # [@adobe/spacecat-shared-rum-api-client-v1.4.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.3.6...@adobe/spacecat-shared-rum-api-client-v1.4.0) (2024-01-24)
9
+
10
+
11
+ ### Features
12
+
13
+ * add create404Url method to RUMAPIClient ([9282a2d](https://github.com/adobe/spacecat-shared/commit/9282a2d97cf5f42868dcee16a40cbf26109a37fc))
14
+
1
15
  # [@adobe/spacecat-shared-rum-api-client-v1.3.6](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.3.5...@adobe/spacecat-shared-rum-api-client-v1.3.6) (2024-01-24)
2
16
 
3
17
 
package/README.md CHANGED
@@ -12,6 +12,18 @@ npm install @adobe/spacecat-shared-rum-api-client
12
12
 
13
13
  ## Usage
14
14
 
15
+ ### Configuring Tokens
16
+
17
+ To configure tokens for your application, follow these steps:
18
+
19
+ 1. Visit the main page of your Slack app at [https://api.slack.com/apps](https://api.slack.com/apps).
20
+
21
+ 2. Navigate to the "OAuth & Permissions" page and locate the "Scope" section. Here, you can add scopes to your Slack app based on the specific methods you intend to use from the Slack API. For example, if your app requires file upload functionality, ensure you add the `files:read` and `files:write` scopes.
22
+
23
+ 3. Locate your Slack bot token under the "Bot User OAuth Token" section on the same page. You will need to provide this token to the `SlackClient` in your application.
24
+
25
+ 4. For information on the scopes needed for each Slack API method, refer to the [documentation](https://api.slack.com/methods). The required scopes for each API method are listed in the "Bot tokens" row. As an example, to use the `postMessage` API method, the required scope is `chat:write`, as documented in [https://api.slack.com/methods/chat.postMessage](https://api.slack.com/methods/chat.postMessage).
26
+
15
27
  ### Creating and instance from Helix UniversalContext
16
28
 
17
29
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-rum-api-client",
3
- "version": "1.3.6",
3
+ "version": "1.4.1",
4
4
  "description": "Shared modules of the Spacecat Services - Rum API client",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.d.ts CHANGED
@@ -74,6 +74,14 @@ export default class RUMAPIClient {
74
74
  */
75
75
  get404Sources(params?: RUMAPIOptions): Promise<Array<object>>;
76
76
 
77
+ /**
78
+ * Method to return the url composed of params that the 404 sources API is called with.
79
+ * @param {RUMAPIOptions} params - An object representing the parameters to be included
80
+ * for the 404 sources API call.
81
+ * @returns A string returning to the 404 sources url including query parameters.
82
+ */
83
+ create404URL(params?: RUMAPIOptions): string;
84
+
77
85
  /**
78
86
  * Asynchronous method to return an array with the domain for a specific url
79
87
  * or an array of all domain urls
package/src/index.js CHANGED
@@ -106,6 +106,15 @@ export default class RUMAPIClient {
106
106
  this.domainkey = domainkey;
107
107
  }
108
108
 
109
+ create404URL(params = {}) {
110
+ return createUrl(
111
+ APIS.RUM_SOURCES,
112
+ {
113
+ domainkey: this.domainkey, ...RUM_DEFAULT_PARAMS, checkpoint: 404, ...params,
114
+ },
115
+ );
116
+ }
117
+
109
118
  async getRUMDashboard(params = {}) {
110
119
  return sendRequest(createUrl(
111
120
  APIS.RUM_DASHBOARD,
@@ -114,11 +123,8 @@ export default class RUMAPIClient {
114
123
  }
115
124
 
116
125
  async get404Sources(params = {}) {
117
- return sendRequest(createUrl(
118
- APIS.RUM_SOURCES,
119
- {
120
- domainkey: this.domainkey, ...RUM_DEFAULT_PARAMS, checkpoint: 404, ...params,
121
- },
126
+ return sendRequest(this.create404URL(
127
+ params,
122
128
  ));
123
129
  }
124
130