@adobe/spacecat-shared-utils 1.35.1 → 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 CHANGED
@@ -1,3 +1,17 @@
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
+
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)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external major (major) ([#674](https://github.com/adobe/spacecat-shared/issues/674)) ([285b37d](https://github.com/adobe/spacecat-shared/commit/285b37de9df42adb6a23694bcc699608e3b5b8fe))
14
+
1
15
  # [@adobe/spacecat-shared-utils-v1.35.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.35.0...@adobe/spacecat-shared-utils-v1.35.1) (2025-04-01)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.35.1",
3
+ "version": "1.36.0",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "engines": {
@@ -40,7 +40,7 @@
40
40
  "chai-as-promised": "8.0.1",
41
41
  "husky": "9.1.7",
42
42
  "nock": "14.0.1",
43
- "sinon": "19.0.2",
43
+ "sinon": "20.0.0",
44
44
  "sinon-chai": "4.0.0"
45
45
  },
46
46
  "dependencies": {
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 * INTERVAL;
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[], interval: number):
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[], interval: number):
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[], interval: number):
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 { getHighFormViewsLowConversionMetrics, getHighPageViewsLowFormViewsMetrics, getHighPageViewsLowFormCtrMetrics } from './formcalc.js';
65
+ export {
66
+ getHighFormViewsLowConversionMetrics,
67
+ getHighPageViewsLowFormViewsMetrics,
68
+ getHighPageViewsLowFormCtrMetrics,
69
+ FORMS_AUDIT_INTERVAL,
70
+ } from './formcalc.js';