@adobe/spacecat-shared-rum-api-client 1.5.0 → 1.6.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 +14 -0
- package/package.json +1 -1
- package/src/index.d.ts +16 -0
- package/src/index.js +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-rum-api-client-v1.6.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.6.0...@adobe/spacecat-shared-rum-api-client-v1.6.1) (2024-02-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Experimentation RUM API call ([#141](https://github.com/adobe/spacecat-shared/issues/141)) ([2f1e657](https://github.com/adobe/spacecat-shared/commit/2f1e657d747c06a5728740e6687b1add77df9d70))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-rum-api-client-v1.6.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.5.0...@adobe/spacecat-shared-rum-api-client-v1.6.0) (2024-02-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* experimentation RUM API method ([#133](https://github.com/adobe/spacecat-shared/issues/133)) ([f95eded](https://github.com/adobe/spacecat-shared/commit/f95ededcc5ba373717a90a577f20e75e1fad80d4))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-rum-api-client-v1.5.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.4.4...@adobe/spacecat-shared-rum-api-client-v1.5.0) (2024-02-06)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -66,6 +66,22 @@ export default class RUMAPIClient {
|
|
|
66
66
|
*/
|
|
67
67
|
getRUMDashboard(params?: RUMAPIOptions): Promise<Array<object>>;
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Asynchronous method to return the Experimentation API call response data.
|
|
71
|
+
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
|
72
|
+
* for the Experimentation data API call.
|
|
73
|
+
* @returns A Promise resolving to the Experimentation response data.
|
|
74
|
+
*/
|
|
75
|
+
getExperimentationData(params?: RUMAPIOptions): Promise<Array<object>>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Method to return the url composed of params that the Experimentation API is called with.
|
|
79
|
+
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
|
80
|
+
* for the Experimentation API call.
|
|
81
|
+
* @returns A string returning the Experimentation url including query parameters.
|
|
82
|
+
*/
|
|
83
|
+
createExperimentationURL(params?: RUMAPIOptions): string;
|
|
84
|
+
|
|
69
85
|
/**
|
|
70
86
|
* Asynchronous method to return the 404 sources API call response data.
|
|
71
87
|
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
package/src/index.js
CHANGED
|
@@ -22,6 +22,7 @@ const APIS = {
|
|
|
22
22
|
RUM_DASHBOARD: 'https://helix-pages.anywhere.run/helix-services/run-query@v3/rum-dashboard',
|
|
23
23
|
DOMAIN_LIST: 'https://helix-pages.anywhere.run/helix-services/run-query@v3/dash/domain-list',
|
|
24
24
|
RUM_SOURCES: 'https://helix-pages.anywhere.run/helix-services/run-query@v3/rum-sources',
|
|
25
|
+
RUM_EXPERIMENTS: 'https://helix-pages.anywhere.run/helix-services/run-query@v3/rum-experiments',
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const DOMAIN_LIST_DEFAULT_PARAMS = {
|
|
@@ -133,6 +134,19 @@ export default class RUMAPIClient {
|
|
|
133
134
|
return sendRequest(this.createRUMURL(params));
|
|
134
135
|
}
|
|
135
136
|
|
|
137
|
+
createExperimentationURL(params = {}) {
|
|
138
|
+
return createUrl(
|
|
139
|
+
APIS.RUM_EXPERIMENTS,
|
|
140
|
+
{
|
|
141
|
+
domainkey: this.domainkey, ...RUM_DEFAULT_PARAMS, ...params,
|
|
142
|
+
},
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async getExperimentationData(params = {}) {
|
|
147
|
+
return sendRequest(this.createExperimentationURL(params));
|
|
148
|
+
}
|
|
149
|
+
|
|
136
150
|
async get404Sources(params = {}) {
|
|
137
151
|
return sendRequest(this.create404URL(params));
|
|
138
152
|
}
|