@adobe/spacecat-shared-utils 1.35.2 → 1.36.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 +7 -0
- package/package.json +1 -1
- package/src/formcalc.js +2 -3
- package/src/index.d.ts +3 -4
- package/src/index.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.36.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.35.2...@adobe/spacecat-shared-utils-v1.36.0) (2025-04-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* changing forms api signature ([#677](https://github.com/adobe/spacecat-shared/issues/677)) ([30b4825](https://github.com/adobe/spacecat-shared/commit/30b48250c492d1611503cb701c6acd0126a6c057))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-utils-v1.35.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.35.1...@adobe/spacecat-shared-utils-v1.35.2) (2025-04-01)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/formcalc.js
CHANGED
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
export const FORMS_AUDIT_INTERVAL = 15;
|
|
13
14
|
const DAILY_PAGEVIEW_THRESHOLD = 200;
|
|
14
15
|
const CR_THRESHOLD_RATIO = 0.3;
|
|
15
|
-
// audit interval
|
|
16
|
-
const INTERVAL = 15;
|
|
17
16
|
const MOBILE = 'mobile';
|
|
18
17
|
const DESKTOP = 'desktop';
|
|
19
18
|
|
|
@@ -63,7 +62,7 @@ function aggregateFormVitalsByDevice(formVitalsCollection) {
|
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
function hasHighPageViews(pageViews) {
|
|
66
|
-
return pageViews > DAILY_PAGEVIEW_THRESHOLD *
|
|
65
|
+
return pageViews > DAILY_PAGEVIEW_THRESHOLD * FORMS_AUDIT_INTERVAL;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
function hasLowerConversionRate(formSubmit, formViews) {
|
package/src/index.d.ts
CHANGED
|
@@ -184,10 +184,9 @@ declare function getQuery(placeholders: object, filename: string, log: object):
|
|
|
184
184
|
/**
|
|
185
185
|
* Retrieves the high-form-view-low-form-conversion metrics from the provided array of form vitals.
|
|
186
186
|
* @param {Object[]} formVitals - An array of form vitals.
|
|
187
|
-
* @param {number} interval - The interval in days.
|
|
188
187
|
* @returns {Object[]} - An array of high-form-view-low-form-conversion metrics.
|
|
189
188
|
*/
|
|
190
|
-
declare function getHighFormViewsLowConversionMetrics(formVitals: object[]
|
|
189
|
+
declare function getHighFormViewsLowConversionMetrics(formVitals: object[]):
|
|
191
190
|
object[];
|
|
192
191
|
|
|
193
192
|
/**
|
|
@@ -195,7 +194,7 @@ declare function getHighFormViewsLowConversionMetrics(formVitals: object[], inte
|
|
|
195
194
|
* @param {Object[]} formVitals - An array of form vitals.
|
|
196
195
|
* @returns {Object[]} - An array of high-page-view-low-form-view metrics.
|
|
197
196
|
*/
|
|
198
|
-
declare function getHighPageViewsLowFormViewsMetrics(formVitals: object[]
|
|
197
|
+
declare function getHighPageViewsLowFormViewsMetrics(formVitals: object[]):
|
|
199
198
|
object[];
|
|
200
199
|
|
|
201
200
|
/**
|
|
@@ -203,7 +202,7 @@ declare function getHighPageViewsLowFormViewsMetrics(formVitals: object[], inter
|
|
|
203
202
|
* @param {Object[]} formVitals - An array of form vitals.
|
|
204
203
|
* @returns {Object[]} - An array of high-page-view-low-form-ctr metrics.
|
|
205
204
|
*/
|
|
206
|
-
declare function getHighPageViewsLowFormCtrMetrics(formVitals: object[]
|
|
205
|
+
declare function getHighPageViewsLowFormCtrMetrics(formVitals: object[]):
|
|
207
206
|
object[];
|
|
208
207
|
|
|
209
208
|
/**
|
package/src/index.js
CHANGED
|
@@ -62,4 +62,9 @@ export { s3Wrapper } from './s3.js';
|
|
|
62
62
|
|
|
63
63
|
export { fetch } from './adobe-fetch.js';
|
|
64
64
|
export { tracingFetch, SPACECAT_USER_AGENT } from './tracing-fetch.js';
|
|
65
|
-
export {
|
|
65
|
+
export {
|
|
66
|
+
getHighFormViewsLowConversionMetrics,
|
|
67
|
+
getHighPageViewsLowFormViewsMetrics,
|
|
68
|
+
getHighPageViewsLowFormCtrMetrics,
|
|
69
|
+
FORMS_AUDIT_INTERVAL,
|
|
70
|
+
} from './formcalc.js';
|