@adobe/spacecat-shared-data-access 2.1.0 → 2.1.2

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-data-access-v2.1.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.1.1...@adobe/spacecat-shared-data-access-v2.1.2) (2025-02-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#587](https://github.com/adobe/spacecat-shared/issues/587)) ([14cce0a](https://github.com/adobe/spacecat-shared/commit/14cce0aa900b4a1b3bbec2d48e6d37766c7769ee))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v2.1.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.1.0...@adobe/spacecat-shared-data-access-v2.1.1) (2025-02-06)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **sites-28856:** update shared-data schema to include type in options ([#577](https://github.com/adobe/spacecat-shared/issues/577)) ([de6b670](https://github.com/adobe/spacecat-shared/commit/de6b670f86e532e518453461de1b088697474852))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v2.1.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.0.6...@adobe/spacecat-shared-data-access-v2.1.0) (2025-02-06)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@adobe/spacecat-shared-utils": "1.26.4",
38
- "@aws-sdk/client-dynamodb": "3.738.0",
39
- "@aws-sdk/lib-dynamodb": "3.738.0",
38
+ "@aws-sdk/client-dynamodb": "3.744.0",
39
+ "@aws-sdk/lib-dynamodb": "3.744.0",
40
40
  "@types/joi": "17.2.3",
41
41
  "aws-xray-sdk": "3.10.3",
42
42
  "electrodb": "3.1.0",
@@ -47,6 +47,13 @@ class ImportJob extends BaseModel {
47
47
  static ImportOptions = {
48
48
  ENABLE_JAVASCRIPT: 'enableJavascript',
49
49
  PAGE_LOAD_TIMEOUT: 'pageLoadTimeout',
50
+ TYPE: 'type',
51
+ DATA: 'data',
52
+ };
53
+
54
+ static ImportOptionTypes = {
55
+ DOC: 'doc',
56
+ XWALK: 'xwalk',
50
57
  };
51
58
 
52
59
  // add your custom methods or overrides here
@@ -15,6 +15,7 @@
15
15
  import {
16
16
  isInteger,
17
17
  isIsoDate,
18
+ isNonEmptyObject,
18
19
  isNumber,
19
20
  isObject,
20
21
  isValidUrl,
@@ -35,6 +36,16 @@ const ImportOptionTypeValidator = {
35
36
  throw new Error(`Invalid value for ${ImportJob.ImportOptions.PAGE_LOAD_TIMEOUT}: ${value}`);
36
37
  }
37
38
  },
39
+ [ImportJob.ImportOptions.TYPE]: (value) => {
40
+ if (!Object.values(ImportJob.ImportOptionTypes).includes(value)) {
41
+ throw new Error(`Invalid value for ${ImportJob.ImportOptions.TYPE}: ${value}`);
42
+ }
43
+ },
44
+ [ImportJob.ImportOptions.DATA]: (value) => {
45
+ if (value && !isNonEmptyObject(value)) {
46
+ throw new Error(`Invalid value for ${ImportJob.ImportOptions.DATA}: ${value}`);
47
+ }
48
+ },
38
49
  };
39
50
 
40
51
  const validateOptions = (options) => {