@adobe/spacecat-shared-rum-api-client 1.6.7 → 1.6.9
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 +8 -0
- package/src/index.js +24 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-rum-api-client-v1.6.9](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.6.8...@adobe/spacecat-shared-rum-api-client-v1.6.9) (2024-03-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* don t expose rum domain key ([3930026](https://github.com/adobe/spacecat-shared/commit/39300265e14f2598cc0963f7ea74a6c8d964d446))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-rum-api-client-v1.6.8](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.6.7...@adobe/spacecat-shared-rum-api-client-v1.6.8) (2024-03-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* expose createRUMURL function ([#188](https://github.com/adobe/spacecat-shared/issues/188)) ([3b8b0c6](https://github.com/adobe/spacecat-shared/commit/3b8b0c6b0cc1b58cbe71951551ee48f991716c24))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-rum-api-client-v1.6.7](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.6.6...@adobe/spacecat-shared-rum-api-client-v1.6.7) (2024-03-09)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -104,6 +104,14 @@ export default class RUMAPIClient {
|
|
|
104
104
|
*/
|
|
105
105
|
get404Sources(params?: RUMAPIOptions): Promise<Array<object>>;
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Method to return the url composed of params that the RUM Dashboard API is called with.
|
|
109
|
+
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
|
110
|
+
* for the RUM Dashboard API call.
|
|
111
|
+
* @returns A string returning to the RUM Dashboard url including query parameters.
|
|
112
|
+
*/
|
|
113
|
+
createRUMURL(params?: RUMAPIOptions): string;
|
|
114
|
+
|
|
107
115
|
/**
|
|
108
116
|
* Method to return the url composed of params that the 404 sources API is called with.
|
|
109
117
|
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
package/src/index.js
CHANGED
|
@@ -42,6 +42,27 @@ export const NOT_FOUND_DEFAULT_PARAMS = {
|
|
|
42
42
|
checkpoint: 404,
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
export const create404URL = (params = {}) => createUrl(
|
|
46
|
+
APIS.RUM_SOURCES,
|
|
47
|
+
{
|
|
48
|
+
...NOT_FOUND_DEFAULT_PARAMS, ...params,
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export const createRUMURL = (params = {}) => createUrl(
|
|
53
|
+
APIS.RUM_DASHBOARD,
|
|
54
|
+
{
|
|
55
|
+
...RUM_DEFAULT_PARAMS, ...params,
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export const createExperimentationURL = (params = {}) => createUrl(
|
|
60
|
+
APIS.RUM_EXPERIMENTS,
|
|
61
|
+
{
|
|
62
|
+
...RUM_DEFAULT_PARAMS, ...params,
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
45
66
|
export async function sendRequest(url, opts) {
|
|
46
67
|
let respJson;
|
|
47
68
|
try {
|
|
@@ -123,43 +144,16 @@ export default class RUMAPIClient {
|
|
|
123
144
|
this.domainkey = domainkey;
|
|
124
145
|
}
|
|
125
146
|
|
|
126
|
-
create404URL(params = {}) {
|
|
127
|
-
return createUrl(
|
|
128
|
-
APIS.RUM_SOURCES,
|
|
129
|
-
{
|
|
130
|
-
domainkey: this.domainkey, ...NOT_FOUND_DEFAULT_PARAMS, ...params,
|
|
131
|
-
},
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
createRUMURL(params = {}) {
|
|
136
|
-
return createUrl(
|
|
137
|
-
APIS.RUM_DASHBOARD,
|
|
138
|
-
{
|
|
139
|
-
domainkey: this.domainkey, ...RUM_DEFAULT_PARAMS, ...params,
|
|
140
|
-
},
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
147
|
async getRUMDashboard(params = {}) {
|
|
145
|
-
return sendRequest(
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
createExperimentationURL(params = {}) {
|
|
149
|
-
return createUrl(
|
|
150
|
-
APIS.RUM_EXPERIMENTS,
|
|
151
|
-
{
|
|
152
|
-
domainkey: this.domainkey, ...RUM_DEFAULT_PARAMS, ...params,
|
|
153
|
-
},
|
|
154
|
-
);
|
|
148
|
+
return sendRequest(createRUMURL({ ...params, domainkey: this.domainkey }));
|
|
155
149
|
}
|
|
156
150
|
|
|
157
151
|
async getExperimentationData(params = {}) {
|
|
158
|
-
return sendRequest(
|
|
152
|
+
return sendRequest(createExperimentationURL({ ...params, domainkey: this.domainkey }));
|
|
159
153
|
}
|
|
160
154
|
|
|
161
155
|
async get404Sources(params = {}) {
|
|
162
|
-
return sendRequest(
|
|
156
|
+
return sendRequest(create404URL({ ...params, domainkey: this.domainkey }));
|
|
163
157
|
}
|
|
164
158
|
|
|
165
159
|
async getDomainList(params = {}) {
|