@webiny/api-page-builder-so-ddb-es 5.19.1 → 5.20.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.
@@ -36,6 +36,9 @@ const defineSystemEntity = params => {
36
36
  },
37
37
  version: {
38
38
  type: "string"
39
+ },
40
+ tenant: {
41
+ type: "string"
39
42
  }
40
43
  }, attributes)
41
44
  });
@@ -1050,7 +1050,7 @@ class PageStorageOperationsDdbEs {
1050
1050
 
1051
1051
  createBasePartitionKey() {
1052
1052
  const tenant = this.context.tenancy.getCurrentTenant().id;
1053
- const locale = this.context.i18nContent.getLocale().code;
1053
+ const locale = this.context.i18nContent.getCurrentLocale().code;
1054
1054
  return `T#${tenant}#L#${locale}#PB#`;
1055
1055
  }
1056
1056
 
@@ -153,7 +153,7 @@ class SettingsStorageOperationsDdbEs {
153
153
 
154
154
  if (locale !== false) {
155
155
  if (!locale) {
156
- locale = this.context.i18nContent.getLocale().code;
156
+ locale = this.context.i18nContent.getCurrentLocale().code;
157
157
  }
158
158
 
159
159
  parts.push(`L#${locale}`);
@@ -1,2 +1,3 @@
1
- import { InstallationPlugin } from "@webiny/api-page-builder/plugins/InstallationPlugin";
2
- export declare const installation: () => InstallationPlugin;
1
+ import { PbContext } from "@webiny/api-page-builder/types";
2
+ import { ContextPlugin } from "@webiny/handler/plugins/ContextPlugin";
3
+ export declare const installation: () => ContextPlugin<PbContext>;
@@ -7,16 +7,16 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.installation = void 0;
9
9
 
10
- var _InstallationPlugin = require("@webiny/api-page-builder/plugins/InstallationPlugin");
10
+ var _ContextPlugin = require("@webiny/handler/plugins/ContextPlugin");
11
11
 
12
12
  var _configurations = _interopRequireDefault(require("../configurations"));
13
13
 
14
14
  const installation = () => {
15
- return new _InstallationPlugin.InstallationPlugin({
16
- beforeInstall: async params => {
17
- const {
18
- context
19
- } = params;
15
+ return new _ContextPlugin.ContextPlugin(async context => {
16
+ /**
17
+ * Add the elasticsearch index for the page builder.
18
+ */
19
+ context.pageBuilder.onBeforeInstall.subscribe(async () => {
20
20
  const {
21
21
  elasticsearch
22
22
  } = context;
@@ -66,7 +66,7 @@ const installation = () => {
66
66
  }
67
67
  }
68
68
  });
69
- }
69
+ });
70
70
  });
71
71
  };
72
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-page-builder-so-ddb-es",
3
- "version": "5.19.1",
3
+ "version": "5.20.0",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "@webiny/api-page-builder",
@@ -18,13 +18,13 @@
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
20
  "@babel/runtime": "7.16.3",
21
- "@webiny/api-elasticsearch": "5.19.1",
22
- "@webiny/api-page-builder": "5.19.1",
23
- "@webiny/api-upgrade": "5.19.1",
24
- "@webiny/db-dynamodb": "5.19.1",
25
- "@webiny/error": "5.19.1",
26
- "@webiny/handler-db": "5.19.1",
27
- "@webiny/plugins": "5.19.1",
21
+ "@webiny/api-elasticsearch": "5.20.0",
22
+ "@webiny/api-page-builder": "5.20.0",
23
+ "@webiny/api-upgrade": "5.20.0",
24
+ "@webiny/db-dynamodb": "5.20.0",
25
+ "@webiny/error": "5.20.0",
26
+ "@webiny/handler-db": "5.20.0",
27
+ "@webiny/plugins": "5.20.0",
28
28
  "dataloader": "2.0.0",
29
29
  "dynamodb-toolbox": "0.3.5",
30
30
  "elastic-ts": "0.7.0",
@@ -38,14 +38,14 @@
38
38
  "@elastic/elasticsearch": "7.12.0",
39
39
  "@elastic/elasticsearch-mock": "0.3.0",
40
40
  "@shelf/jest-elasticsearch": "^1.0.0",
41
- "@webiny/api-dynamodb-to-elasticsearch": "^5.19.1",
42
- "@webiny/api-security": "^5.19.1",
43
- "@webiny/api-tenancy": "^5.19.1",
44
- "@webiny/cli": "^5.19.1",
45
- "@webiny/handler": "^5.19.1",
46
- "@webiny/handler-aws": "^5.19.1",
47
- "@webiny/handler-graphql": "^5.19.1",
48
- "@webiny/project-utils": "^5.19.1",
41
+ "@webiny/api-dynamodb-to-elasticsearch": "^5.20.0",
42
+ "@webiny/api-security": "^5.20.0",
43
+ "@webiny/api-tenancy": "^5.20.0",
44
+ "@webiny/cli": "^5.20.0",
45
+ "@webiny/handler": "^5.20.0",
46
+ "@webiny/handler-aws": "^5.20.0",
47
+ "@webiny/handler-graphql": "^5.20.0",
48
+ "@webiny/project-utils": "^5.20.0",
49
49
  "jest": "^26.6.3",
50
50
  "jest-dynalite": "^3.2.0",
51
51
  "jest-environment-node": "^27.0.6",
@@ -61,5 +61,5 @@
61
61
  "build": "yarn webiny run build",
62
62
  "watch": "yarn webiny run watch"
63
63
  },
64
- "gitHead": "1424145d10add470e70fba9c44225656894e0028"
64
+ "gitHead": "816632961750d4ae7f3af0d32d4e8a46c3f287a6"
65
65
  }
@@ -23,7 +23,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
23
23
 
24
24
  const upgradeCategories = async context => {
25
25
  const tenant = context.tenancy.getCurrentTenant().id;
26
- const localeCodes = await context.i18n.getLocales().map(locale => locale.code);
26
+ const localeCodes = await context.i18n.getLocales().map(locale => locale.code); // @ts-ignore
27
+
27
28
  const categoryStorageOperations = context.pageBuilder.categories.storageOperations;
28
29
 
29
30
  if (categoryStorageOperations instanceof _CategoryStorageOperations.CategoryStorageOperationsDdbEs === false) {
@@ -23,7 +23,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
23
23
 
24
24
  const upgradeMenus = async context => {
25
25
  const tenant = context.tenancy.getCurrentTenant().id;
26
- const localeCodes = await context.i18n.getLocales().map(locale => locale.code);
26
+ const localeCodes = await context.i18n.getLocales().map(locale => locale.code); // @ts-ignore
27
+
27
28
  const menuStorageOperations = context.pageBuilder.menus.storageOperations;
28
29
 
29
30
  if (menuStorageOperations instanceof _MenuStorageOperations.MenuStorageOperationsDdbEs === false) {
@@ -23,7 +23,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
23
23
 
24
24
  const upgradePageElements = async context => {
25
25
  const tenant = context.tenancy.getCurrentTenant().id;
26
- const localeCodes = await context.i18n.getLocales().map(locale => locale.code);
26
+ const localeCodes = await context.i18n.getLocales().map(locale => locale.code); // @ts-ignore
27
+
27
28
  const pageElementsStorageOperations = context.pageBuilder.pageElements.storageOperations;
28
29
 
29
30
  if (pageElementsStorageOperations instanceof _PageElementStorageOperations.PageElementStorageOperationsDdbEs === false) {