@adobe/spacecat-shared-rum-api-client 1.6.11 → 1.7.0
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 +2 -2
- package/src/index.d.ts +32 -0
- package/src/index.js +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-rum-api-client-v1.7.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.6.12...@adobe/spacecat-shared-rum-api-client-v1.7.0) (2024-04-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* API call for getting conversion data. ([#208](https://github.com/adobe/spacecat-shared/issues/208)) ([8df8327](https://github.com/adobe/spacecat-shared/commit/8df832793df3806c20be000bff10b93810aff02c))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-rum-api-client-v1.6.12](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.6.11...@adobe/spacecat-shared-rum-api-client-v1.6.12) (2024-04-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @adobe/helix-universal to v4.5.1 ([#207](https://github.com/adobe/spacecat-shared/issues/207)) ([985cdba](https://github.com/adobe/spacecat-shared/commit/985cdbaf6c2c354d73f91e94d38244b6eda055ab))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-rum-api-client-v1.6.11](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-rum-api-client-v1.6.10...@adobe/spacecat-shared-rum-api-client-v1.6.11) (2024-04-10)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-rum-api-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Rum API client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@adobe/fetch": "4.1.2",
|
|
34
34
|
"@adobe/helix-shared-wrap": "2.0.1",
|
|
35
|
-
"@adobe/helix-universal": "4.5.
|
|
35
|
+
"@adobe/helix-universal": "4.5.1",
|
|
36
36
|
"@adobe/spacecat-shared-utils": "1.4.0",
|
|
37
37
|
"aws4": "1.12.0"
|
|
38
38
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -96,6 +96,38 @@ export default class RUMAPIClient {
|
|
|
96
96
|
*/
|
|
97
97
|
createExperimentationURL(params?: RUMAPIOptions): string;
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Asynchronous method to return the conversion API call response data.
|
|
101
|
+
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
|
102
|
+
* for the conversion data API call.
|
|
103
|
+
* @returns A Promise resolving to the conversion response data.
|
|
104
|
+
*/
|
|
105
|
+
getConversionData(params?: RUMAPIOptions): Promise<Array<object>>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Method to return the url composed of params that the conversion API is called with.
|
|
109
|
+
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
|
110
|
+
* for the conversion API call.
|
|
111
|
+
* @returns A string returning the conversion url including query parameters.
|
|
112
|
+
*/
|
|
113
|
+
createConversionURL(params?: RUMAPIOptions): string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Asynchronous method to return the conversion API call response data.
|
|
117
|
+
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
|
118
|
+
* for the conversion data API call.
|
|
119
|
+
* @returns A Promise resolving to the conversion response data.
|
|
120
|
+
*/
|
|
121
|
+
getRUMFormsDashboard(params?: RUMAPIOptions): Promise<Array<object>>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Method to return the url composed of params that the conversion API is called with.
|
|
125
|
+
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
|
126
|
+
* for the conversion API call.
|
|
127
|
+
* @returns A string returning the conversion url including query parameters.
|
|
128
|
+
*/
|
|
129
|
+
createRUMFormsURL(params?: RUMAPIOptions): string;
|
|
130
|
+
|
|
99
131
|
/**
|
|
100
132
|
* Asynchronous method to return the 404 sources API call response data.
|
|
101
133
|
* @param {RUMAPIOptions} params - An object representing the parameters to be included
|
package/src/index.js
CHANGED
|
@@ -23,6 +23,8 @@ const APIS = {
|
|
|
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
25
|
RUM_EXPERIMENTS: 'https://helix-pages.anywhere.run/helix-services/run-query@v3/rum-experiments',
|
|
26
|
+
RUM_SOURCES_TARGETS: 'https://helix-pages.anywhere.run/helix-services/run-query@v3/rum-sources-targets',
|
|
27
|
+
RUM_FROMS_DASHBOARD: 'https://helix-pages.anywhere.run/helix-services/run-query@v3/rum-forms-dashboard',
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
const DOMAIN_LIST_DEFAULT_PARAMS = {
|
|
@@ -42,6 +44,11 @@ export const NOT_FOUND_DEFAULT_PARAMS = {
|
|
|
42
44
|
checkpoint: 404,
|
|
43
45
|
};
|
|
44
46
|
|
|
47
|
+
export const CONVERSION_DEFAULT_PARAMS = {
|
|
48
|
+
...RUM_DEFAULT_PARAMS,
|
|
49
|
+
checkpoint: 'convert',
|
|
50
|
+
};
|
|
51
|
+
|
|
45
52
|
export const create404URL = (params = {}) => createUrl(
|
|
46
53
|
APIS.RUM_SOURCES,
|
|
47
54
|
{
|
|
@@ -63,6 +70,20 @@ export const createExperimentationURL = (params = {}) => createUrl(
|
|
|
63
70
|
},
|
|
64
71
|
);
|
|
65
72
|
|
|
73
|
+
export const createConversionURL = (params = {}) => createUrl(
|
|
74
|
+
APIS.RUM_SOURCES_TARGETS,
|
|
75
|
+
{
|
|
76
|
+
...CONVERSION_DEFAULT_PARAMS, ...params,
|
|
77
|
+
},
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export const createRUMFormsURL = (params = {}) => createUrl(
|
|
81
|
+
APIS.RUM_FROMS_DASHBOARD,
|
|
82
|
+
{
|
|
83
|
+
...CONVERSION_DEFAULT_PARAMS, ...params,
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
|
|
66
87
|
export async function sendRequest(url, opts) {
|
|
67
88
|
let respJson;
|
|
68
89
|
try {
|
|
@@ -184,4 +205,12 @@ export default class RUMAPIClient {
|
|
|
184
205
|
params,
|
|
185
206
|
);
|
|
186
207
|
}
|
|
208
|
+
|
|
209
|
+
async getConversionData(params = {}) {
|
|
210
|
+
return sendRequest(createConversionURL({ ...params, domainkey: this.domainkey }));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async getRUMFormsDashboard(params = {}) {
|
|
214
|
+
return sendRequest(createRUMFormsURL({ ...params, domainkey: this.domainkey }));
|
|
215
|
+
}
|
|
187
216
|
}
|